2 lines
276 KiB
JavaScript
2 lines
276 KiB
JavaScript
"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[1],{350:(e,t,n)=>{n.r(t),n.d(t,{BrowserClient:()=>z.BrowserClient,OpenFeatureIntegrationHook:()=>ye.OpenFeatureIntegrationHook,SDK_VERSION:()=>H.SDK_VERSION,SEMANTIC_ATTRIBUTE_SENTRY_OP:()=>u.SEMANTIC_ATTRIBUTE_SENTRY_OP,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:()=>u.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:()=>u.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:()=>u.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,Scope:()=>h.Scope,WINDOW:()=>W.WINDOW,addBreadcrumb:()=>E.addBreadcrumb,addEventProcessor:()=>d.addEventProcessor,addIntegration:()=>_.addIntegration,breadcrumbsIntegration:()=>Y.breadcrumbsIntegration,browserApiErrorsIntegration:()=>ee.browserApiErrorsIntegration,browserProfilingIntegration:()=>fe.browserProfilingIntegration,browserSessionIntegration:()=>ge.browserSessionIntegration,browserTracingIntegration:()=>ue.browserTracingIntegration,buildLaunchDarklyFlagUsedHandler:()=>_e.buildLaunchDarklyFlagUsedHandler,captureConsoleIntegration:()=>k.captureConsoleIntegration,captureEvent:()=>d.captureEvent,captureException:()=>d.captureException,captureFeedback:()=>M.captureFeedback,captureMessage:()=>d.captureMessage,captureSession:()=>d.captureSession,chromeStackLineParser:()=>$.chromeStackLineParser,close:()=>d.close,consoleLoggingIntegration:()=>D.consoleLoggingIntegration,contextLinesIntegration:()=>oe.contextLinesIntegration,continueTrace:()=>a.continueTrace,createConsolaReporter:()=>U.createConsolaReporter,createTransport:()=>m.createTransport,createUserFeedbackEnvelope:()=>J.createUserFeedbackEnvelope,dedupeIntegration:()=>w.dedupeIntegration,defaultRequestInstrumentationOptions:()=>le.defaultRequestInstrumentationOptions,defaultStackLineParsers:()=>$.defaultStackLineParsers,defaultStackParser:()=>$.defaultStackParser,diagnoseSdkConnectivity:()=>ve.diagnoseSdkConnectivity,endSession:()=>d.endSession,eventFiltersIntegration:()=>T.eventFiltersIntegration,eventFromException:()=>q.eventFromException,eventFromMessage:()=>q.eventFromMessage,exceptionFromError:()=>q.exceptionFromError,extraErrorDataIntegration:()=>A.extraErrorDataIntegration,featureFlagsIntegration:()=>O.featureFlagsIntegration,feedbackAsyncIntegration:()=>r.feedbackAsyncIntegration,feedbackIntegration:()=>o.feedbackSyncIntegration,feedbackSyncIntegration:()=>o.feedbackSyncIntegration,flush:()=>d.flush,forceLoad:()=>V.forceLoad,functionToStringIntegration:()=>v.functionToStringIntegration,geckoStackLineParser:()=>$.geckoStackLineParser,getActiveSpan:()=>S.getActiveSpan,getClient:()=>p.getClient,getCurrentScope:()=>p.getCurrentScope,getDefaultIntegrations:()=>V.getDefaultIntegrations,getFeedback:()=>ce.getFeedback,getGlobalScope:()=>p.getGlobalScope,getIsolationScope:()=>p.getIsolationScope,getReplay:()=>ie.getReplay,getRootSpan:()=>S.getRootSpan,getSpanDescendants:()=>S.getSpanDescendants,getSpanStatusFromHttpCode:()=>i.getSpanStatusFromHttpCode,getTraceData:()=>b.getTraceData,globalHandlersIntegration:()=>Q.globalHandlersIntegration,graphqlClientIntegration:()=>se.graphqlClientIntegration,growthbookIntegration:()=>be.growthbookIntegration,httpClientIntegration:()=>re.httpClientIntegration,httpContextIntegration:()=>X.httpContextIntegration,inboundFiltersIntegration:()=>T.inboundFiltersIntegration,init:()=>V.init,instrumentAnthropicAiClient:()=>F.instrumentAnthropicAiClient,instrumentGoogleGenAIClient:()=>G.instrumentGoogleGenAIClient,instrumentOpenAiClient:()=>B.instrumentOpenAiClient,instrumentOutgoingRequests:()=>le.instrumentOutgoingRequests,instrumentSupabaseClient:()=>R.instrumentSupabaseClient,isEnabled:()=>d.isEnabled,isInitialized:()=>d.isInitialized,lastEventId:()=>d.lastEventId,launchDarklyIntegration:()=>_e.launchDarklyIntegration,lazyLoadIntegration:()=>te.lazyLoadIntegration,linkedErrorsIntegration:()=>Z.linkedErrorsIntegration,logger:()=>L,makeBrowserOfflineTransport:()=>he.makeBrowserOfflineTransport,makeFetchTransport:()=>j.makeFetchTransport,makeMultiplexedTransport:()=>g.makeMultiplexedTransport,metrics:()=>P,moduleMetadataIntegration:()=>I.moduleMetadataIntegration,onLoad:()=>V.onLoad,openFeatureIntegration:()=>ye.openFeatureIntegration,opera10StackLineParser:()=>$.opera10StackLineParser,opera11StackLineParser:()=>$.opera11StackLineParser,parameterize:()=>y.parameterize,registerSpanErrorInstrumentation:()=>s.registerSpanErrorInstrumentation,registerWebWorker:()=>Te.registerWebWorker,replayCanvasIntegration:()=>ae.replayCanvasIntegration,replayIntegration:()=>ie.replayIntegration,reportPageLoaded:()=>de.reportPageLoaded,reportingObserverIntegration:()=>ne.reportingObserverIntegration,rewriteFramesIntegration:()=>C.rewriteFramesIntegration,sendFeedback:()=>ce.sendFeedback,setActiveSpanInBrowser:()=>pe.setActiveSpanInBrowser,setContext:()=>d.setContext,setCurrentClient:()=>f.setCurrentClient,setExtra:()=>d.setExtra,setExtras:()=>d.setExtras,setHttpStatus:()=>i.setHttpStatus,setMeasurement:()=>l.setMeasurement,setTag:()=>d.setTag,setTags:()=>d.setTags,setUser:()=>d.setUser,showReportDialog:()=>K.showReportDialog,spanToBaggageHeader:()=>c.spanToBaggageHeader,spanToJSON:()=>S.spanToJSON,spanToTraceHeader:()=>S.spanToTraceHeader,spotlightBrowserIntegration:()=>me.spotlightBrowserIntegration,startBrowserTracingNavigationSpan:()=>ue.startBrowserTracingNavigationSpan,startBrowserTracingPageLoadSpan:()=>ue.startBrowserTracingPageLoadSpan,startInactiveSpan:()=>a.startInactiveSpan,startNewTrace:()=>a.startNewTrace,startSession:()=>d.startSession,startSpan:()=>a.startSpan,startSpanManual:()=>a.startSpanManual,statsigIntegration:()=>Ee.statsigIntegration,supabaseIntegration:()=>R.supabaseIntegration,suppressTracing:()=>a.suppressTracing,thirdPartyErrorFilterIntegration:()=>N.thirdPartyErrorFilterIntegration,unleashIntegration:()=>Se.unleashIntegration,updateSpanName:()=>S.updateSpanName,webWorkerIntegration:()=>Te.webWorkerIntegration,winjsStackLineParser:()=>$.winjsStackLineParser,withActiveSpan:()=>a.withActiveSpan,withIsolationScope:()=>p.withIsolationScope,withScope:()=>p.withScope,zodErrorsIntegration:()=>x.zodErrorsIntegration});var r=n(351),o=n(357),s=n(303),i=n(246),a=n(309),c=n(241),l=n(308),u=n(242),d=n(271),p=n(209),h=n(216),f=n(208),m=n(296),g=n(358),_=n(229),y=n(359),S=n(245),b=n(344),E=n(273),v=n(230),T=n(231),I=n(360),k=n(362),w=n(233),A=n(363),C=n(364),R=n(366),x=n(367),N=n(368),O=n(369),M=n(353),L=n(371),D=n(372),P=n(374),U=n(375),B=n(376),F=n(383),G=n(387),H=n(212),W=n(270),z=n(235),j=n(295),$=n(294),q=n(269),J=n(391),V=n(207),K=n(392),Y=n(272),Q=n(288),X=n(291),Z=n(292),ee=n(286),te=n(356),ne=n(393),re=n(394),oe=n(396),se=n(397),ie=n(398),ae=n(400),ce=n(352),le=n(343),ue=n(302),de=n(401),pe=n(402),he=n(403),fe=n(405),me=n(409),ge=n(287),_e=n(410),ye=n(411),Se=n(412),be=n(413),Ee=n(415),ve=n(416),Te=n(417)},351:(e,t,n)=>{n.r(t),n.d(t,{feedbackAsyncIntegration:()=>s});var r=n(352),o=n(356);const s=(0,r.buildFeedbackIntegration)({lazyLoadIntegration:o.lazyLoadIntegration})},352:(e,t,n)=>{n.r(t),n.d(t,{buildFeedbackIntegration:()=>T,feedbackModalIntegration:()=>He,feedbackScreenshotIntegration:()=>Ve,getFeedback:()=>I,sendFeedback:()=>f});var r=n(209),o=n(229),s=n(353),i=n(221),a=n(213),c=n(354),l=n(223);const u=a.GLOBAL_OBJ,d=u.document,p=u.navigator,h="Report a Bug",f=(e,t={includeReplay:!0})=>{if(!e.message)throw new Error("Unable to submit feedback with empty message");const n=(0,r.getClient)();if(!n)throw new Error("No client setup, cannot send feedback.");e.tags&&Object.keys(e.tags).length&&(0,r.getCurrentScope)().setTags(e.tags);const o=(0,s.captureFeedback)({source:"api",url:(0,i.getLocationHref)(),...e},t);return new Promise((e,t)=>{const r=setTimeout(()=>t("Unable to determine if Feedback was correctly sent."),3e4),s=n.on("afterSendEvent",(n,i)=>{if(n.event_id===o)return clearTimeout(r),s(),i?.statusCode&&i.statusCode>=200&&i.statusCode<300?e(o):t(403===i?.statusCode?"Unable to send feedback. This could be because this domain is not in your list of allowed domains.":"Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.")})})},m="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function g(e,t){return{...e,...t,tags:{...e.tags,...t.tags},onFormOpen:()=>{t.onFormOpen?.(),e.onFormOpen?.()},onFormClose:()=>{t.onFormClose?.(),e.onFormClose?.()},onSubmitSuccess:(n,r)=>{t.onSubmitSuccess?.(n,r),e.onSubmitSuccess?.(n,r)},onSubmitError:n=>{t.onSubmitError?.(n),e.onSubmitError?.(n)},onFormSubmitted:()=>{t.onFormSubmitted?.(),e.onFormSubmitted?.()},themeDark:{...e.themeDark,...t.themeDark},themeLight:{...e.themeLight,...t.themeLight}}}function _(e,t){return Object.entries(t).forEach(([t,n])=>{e.setAttributeNS(null,t,n)}),e}function y({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){const o=d.createElement("button");if(o.type="button",o.className="widget__actor",o.ariaHidden="false",o.ariaLabel=t||e||h,o.appendChild(function(){const e=e=>u.document.createElementNS("http://www.w3.org/2000/svg",e),t=_(e("svg"),{width:"20",height:"20",viewBox:"0 0 20 20",fill:"var(--actor-color, var(--foreground))"}),n=_(e("g"),{clipPath:"url(#clip0_57_80)"}),r=_(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.6622 15H12.3997C12.2129 14.9959 12.031 14.9396 11.8747 14.8375L8.04965 12.2H7.49956V19.1C7.4875 19.3348 7.3888 19.5568 7.22256 19.723C7.05632 19.8892 6.83435 19.9879 6.59956 20H2.04956C1.80193 19.9968 1.56535 19.8969 1.39023 19.7218C1.21511 19.5467 1.1153 19.3101 1.11206 19.0625V12.2H0.949652C0.824431 12.2017 0.700142 12.1783 0.584123 12.1311C0.468104 12.084 0.362708 12.014 0.274155 11.9255C0.185602 11.8369 0.115689 11.7315 0.0685419 11.6155C0.0213952 11.4995 -0.00202913 11.3752 -0.00034808 11.25V3.75C-0.00900498 3.62067 0.0092504 3.49095 0.0532651 3.36904C0.0972798 3.24712 0.166097 3.13566 0.255372 3.04168C0.344646 2.94771 0.452437 2.87327 0.571937 2.82307C0.691437 2.77286 0.82005 2.74798 0.949652 2.75H8.04965L11.8747 0.1625C12.031 0.0603649 12.2129 0.00407221 12.3997 0H15.6622C15.9098 0.00323746 16.1464 0.103049 16.3215 0.278167C16.4966 0.453286 16.5964 0.689866 16.5997 0.9375V3.25269C17.3969 3.42959 18.1345 3.83026 18.7211 4.41679C19.5322 5.22788 19.9878 6.32796 19.9878 7.47502C19.9878 8.62209 19.5322 9.72217 18.7211 10.5333C18.1345 11.1198 17.3969 11.5205 16.5997 11.6974V14.0125C16.6047 14.1393 16.5842 14.2659 16.5395 14.3847C16.4948 14.5035 16.4268 14.6121 16.3394 14.7042C16.252 14.7962 16.147 14.8698 16.0307 14.9206C15.9144 14.9714 15.7891 14.9984 15.6622 15ZM1.89695 10.325H1.88715V4.625H8.33715C8.52423 4.62301 8.70666 4.56654 8.86215 4.4625L12.6872 1.875H14.7247V13.125H12.6872L8.86215 10.4875C8.70666 10.3835 8.52423 10.327 8.33715 10.325H2.20217C2.15205 10.3167 2.10102 10.3125 2.04956 10.3125C1.9981 10.3125 1.94708 10.3167 1.89695 10.325ZM2.98706 12.2V18.1625H5.66206V12.2H2.98706ZM16.5997 9.93612V5.01393C16.6536 5.02355 16.7072 5.03495 16.7605 5.04814C17.1202 5.13709 17.4556 5.30487 17.7425 5.53934C18.0293 5.77381 18.2605 6.06912 18.4192 6.40389C18.578 6.73866 18.6603 7.10452 18.6603 7.47502C18.6603 7.84552 18.578 8.21139 18.4192 8.54616C18.2605 8.88093 18.0293 9.17624 17.7425 9.41071C17.4556 9.64518 17.1202 9.81296 16.7605 9.90191C16.7072 9.91509 16.6536 9.9265 16.5997 9.93612Z"});t.appendChild(n).appendChild(r);const o=e("defs"),s=_(e("clipPath"),{id:"clip0_57_80"}),i=_(e("rect"),{width:"20",height:"20",fill:"white"});return s.appendChild(i),o.appendChild(s),t.appendChild(o).appendChild(s).appendChild(i),t}()),e){const t=d.createElement("span");t.appendChild(d.createTextNode(e)),o.appendChild(t)}const s=function(e){const t=d.createElement("style");return t.textContent='\n.widget__actor {\n position: fixed;\n z-index: var(--z-index);\n margin: var(--page-margin);\n inset: var(--actor-inset);\n\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 16px;\n\n font-family: inherit;\n font-size: var(--font-size);\n font-weight: 600;\n line-height: 1.14em;\n text-decoration: none;\n\n background: var(--actor-background, var(--background));\n border-radius: var(--actor-border-radius, 1.7em/50%);\n border: var(--actor-border, var(--border));\n box-shadow: var(--actor-box-shadow, var(--box-shadow));\n color: var(--actor-color, var(--foreground));\n fill: var(--actor-color, var(--foreground));\n cursor: pointer;\n opacity: 1;\n transition: transform 0.2s ease-in-out;\n transform: translate(0, 0) scale(1);\n}\n.widget__actor[aria-hidden="true"] {\n opacity: 0;\n pointer-events: none;\n visibility: hidden;\n transform: translate(0, 16px) scale(0.98);\n}\n\n.widget__actor:hover {\n background: var(--actor-hover-background, var(--background));\n filter: var(--interactive-filter);\n}\n\n.widget__actor svg {\n width: 1.14em;\n height: 1.14em;\n}\n\n@media (max-width: 600px) {\n .widget__actor span {\n display: none;\n }\n}\n',e&&t.setAttribute("nonce",e),t}(r);return{el:o,appendToDom(){n.appendChild(s),n.appendChild(o)},removeFromDom(){o.remove(),s.remove()},show(){o.ariaHidden="false"},hide(){o.ariaHidden="true"}}}const S="rgba(88, 74, 192, 1)",b={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:S,successColor:"#268d75",errorColor:"#df3338",border:"1.5px solid rgba(41, 35, 47, 0.13)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(95%)"},E={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackground:S,successColor:"#2da98c",errorColor:"#f55459",border:"1.5px solid rgba(235, 230, 239, 0.15)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(150%)"};function v(e){return`\n --foreground: ${e.foreground};\n --background: ${e.background};\n --accent-foreground: ${e.accentForeground};\n --accent-background: ${e.accentBackground};\n --success-color: ${e.successColor};\n --error-color: ${e.errorColor};\n --border: ${e.border};\n --box-shadow: ${e.boxShadow};\n --outline: ${e.outline};\n --interactive-filter: ${e.interactiveFilter};\n `}const T=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>({id:r="sentry-feedback",autoInject:s=!0,showBranding:i=!0,isEmailRequired:a=!1,isNameRequired:u=!1,showEmail:_=!0,showName:S=!0,enableScreenshot:T=!0,useSentryUser:I={email:"email",name:"username"},tags:k,styleNonce:w,scriptNonce:A,colorScheme:C="system",themeLight:R={},themeDark:x={},addScreenshotButtonLabel:N="Add a screenshot",cancelButtonLabel:O="Cancel",confirmButtonLabel:M="Confirm",emailLabel:L="Email",emailPlaceholder:D="your.email@example.org",formTitle:P="Report a Bug",isRequiredLabel:U="(required)",messageLabel:B="Description",messagePlaceholder:F="What's the bug? What did you expect?",nameLabel:G="Name",namePlaceholder:H="Your Name",removeScreenshotButtonLabel:W="Remove screenshot",submitButtonLabel:z="Send Bug Report",successMessageText:j="Thank you for your report!",triggerLabel:$=h,triggerAriaLabel:q="",highlightToolText:J="Highlight",hideToolText:V="Hide",removeHighlightText:K="Remove",onFormOpen:Y,onFormClose:Q,onSubmitSuccess:X,onSubmitError:Z,onFormSubmitted:ee}={})=>{const te={id:r,autoInject:s,showBranding:i,isEmailRequired:a,isNameRequired:u,showEmail:_,showName:S,enableScreenshot:T,useSentryUser:I,tags:k,styleNonce:w,scriptNonce:A,colorScheme:C,themeDark:x,themeLight:R,triggerLabel:$,triggerAriaLabel:q,cancelButtonLabel:O,submitButtonLabel:z,confirmButtonLabel:M,formTitle:P,emailLabel:L,emailPlaceholder:D,messageLabel:B,messagePlaceholder:F,nameLabel:G,namePlaceholder:H,successMessageText:j,isRequiredLabel:U,addScreenshotButtonLabel:N,removeScreenshotButtonLabel:W,highlightToolText:J,hideToolText:V,removeHighlightText:K,onFormClose:Q,onFormOpen:Y,onSubmitError:Z,onSubmitSuccess:X,onFormSubmitted:ee};let ne=null,re=[];const oe=e=>{if(!ne){const t=d.createElement("div");t.id=String(e.id),d.body.appendChild(t),ne=t.attachShadow({mode:"open"}),ne.appendChild(function({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){const o=d.createElement("style");return o.textContent=`\n:host {\n --font-family: system-ui, 'Helvetica Neue', Arial, sans-serif;\n --font-size: 14px;\n --z-index: 100000;\n\n --page-margin: 16px;\n --inset: auto 0 0 auto;\n --actor-inset: var(--inset);\n\n font-family: var(--font-family);\n font-size: var(--font-size);\n\n ${"system"!==e?"color-scheme: only light;":""}\n\n ${v("dark"===e?{...E,...t}:{...b,...n})}\n}\n\n${"system"===e?`\n@media (prefers-color-scheme: dark) {\n :host {\n ${v({...E,...t})}\n }\n}`:""}\n}\n`,r&&o.setAttribute("nonce",r),o}(e))}return ne},se=async r=>{const s=r.enableScreenshot&&!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(p.userAgent)||/Macintosh/i.test(p.userAgent)&&p.maxTouchPoints&&p.maxTouchPoints>1||!isSecureContext);let i,a;try{i=(t?t():await e("feedbackModalIntegration",A))(),(0,o.addIntegration)(i)}catch{throw m&&l.debug.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),new Error("[Feedback] Missing feedback modal integration!")}try{const t=s?n?n():await e("feedbackScreenshotIntegration",A):void 0;t&&(a=t(),(0,o.addIntegration)(a))}catch{m&&l.debug.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}const c=i.createDialog({options:{...r,onFormClose:()=>{c?.close(),r.onFormClose?.()},onFormSubmitted:()=>{c?.close(),r.onFormSubmitted?.()}},screenshotIntegration:a,sendFeedback:f,shadow:oe(r)});return c},ie=(e,t={})=>{const n=g(te,t),r="string"==typeof e?d.querySelector(e):"function"==typeof e.addEventListener?e:null;if(!r)throw m&&l.debug.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let o=null;const s=async()=>{o||(o=await se({...n,onFormSubmitted:()=>{o?.removeFromDom(),n.onFormSubmitted?.()}})),o.appendToDom(),o.open()};r.addEventListener("click",s);const i=()=>{re=re.filter(e=>e!==i),o?.removeFromDom(),o=null,r.removeEventListener("click",s)};return re.push(i),i},ae=(e={})=>{const t=g(te,e),n=oe(t),r=y({triggerLabel:t.triggerLabel,triggerAriaLabel:t.triggerAriaLabel,shadow:n,styleNonce:w});return ie(r.el,{...t,onFormOpen(){r.hide()},onFormClose(){r.show()},onFormSubmitted(){r.show()}}),r};return{name:"Feedback",setupOnce(){(0,c.isBrowser)()&&te.autoInject&&("loading"===d.readyState?d.addEventListener("DOMContentLoaded",()=>ae().appendToDom()):ae().appendToDom())},attachTo:ie,createWidget(e={}){const t=ae(g(te,e));return t.appendToDom(),t},createForm:async(e={})=>se(g(te,e)),remove(){ne&&(ne.parentElement?.remove(),ne=null),re.forEach(e=>e()),re=[]}}};function I(){const e=(0,r.getClient)();return e?.getIntegrationByName("Feedback")}var k,w,A,C,R,x,N,O={},M=[],L=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,D=Array.isArray;function P(e,t){for(var n in t)e[n]=t[n];return e}function U(e){var t=e.parentNode;t&&t.removeChild(e)}function B(e,t,n){var r,o,s,i={};for(s in t)"key"==s?r=t[s]:"ref"==s?o=t[s]:i[s]=t[s];if(arguments.length>2&&(i.children=arguments.length>3?k.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===i[s]&&(i[s]=e.defaultProps[s]);return F(e,i,r,o,null)}function F(e,t,n,r,o){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++A:o,__i:-1,__u:0};return null==o&&null!=w.vnode&&w.vnode(s),s}function G(e){return e.children}function H(e,t){this.props=e,this.context=t}function W(e,t){if(null==t)return e.__?W(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?W(e):null}function z(e,t,n){var r,o=e.__v,s=o.__e,i=e.__P;if(i)return(r=P({},o)).__v=o.__v+1,w.vnode&&w.vnode(r),ee(i,r,o,e.__n,void 0!==i.ownerSVGElement,32&o.__u?[s]:null,t,null==s?W(o):s,!!(32&o.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=s&&j(r),r}function j(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return j(e)}}function $(e){(!e.__d&&(e.__d=!0)&&C.push(e)&&!q.__r++||R!==w.debounceRendering)&&((R=w.debounceRendering)||x)(q)}function q(){var e,t,n,r=[],o=[];for(C.sort(N);e=C.shift();)e.__d&&(n=C.length,t=z(e,r,o)||t,0===n||C.length>n?(te(r,t,o),o.length=r.length=0,t=void 0,C.sort(N)):t&&w.__c&&w.__c(t,M));t&&te(r,t,o),q.__r=0}function J(e,t,n,r,o,s,i,a,c,l,u){var d,p,h,f,m,g=r&&r.__k||M,_=t.length;for(n.__d=c,function(e,t,n){var r,o,s,i,a,c=t.length,l=n.length,u=l,d=0;for(e.__k=[],r=0;r<c;r++)null!=(o=e.__k[r]=null==(o=t[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?F(null,o,null,null,o):D(o)?F(G,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?F(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,a=K(o,n,i=r+d,u),o.__i=a,s=null,-1!==a&&(u--,(s=n[a])&&(s.__u|=131072)),null==s||null===s.__v?(-1==a&&d--,"function"!=typeof o.type&&(o.__u|=65536)):a!==i&&(a===i+1?d++:a>i?u>c-i?d+=a-i:d--:d=a<i&&a==i-1?a-i:0,a!==r+d&&(o.__u|=65536))):(s=n[r])&&null==s.key&&s.__e&&(s.__e==e.__d&&(e.__d=W(s)),oe(s,s,!1),n[r]=null,u--);if(u)for(r=0;r<l;r++)null!=(s=n[r])&&!(131072&s.__u)&&(s.__e==e.__d&&(e.__d=W(s)),oe(s,s))}(n,t,g),c=n.__d,d=0;d<_;d++)null!=(h=n.__k[d])&&"boolean"!=typeof h&&"function"!=typeof h&&(p=-1===h.__i?O:g[h.__i]||O,h.__i=d,ee(e,h,p,o,s,i,a,c,l,u),f=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&re(p.ref,null,h),u.push(h.ref,h.__c||f,h)),null==m&&null!=f&&(m=f),65536&h.__u||p.__k===h.__k?c=V(h,c,e):"function"==typeof h.type&&void 0!==h.__d?c=h.__d:f&&(c=f.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=c,n.__e=m}function V(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=V(r[o],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function K(e,t,n,r){var o=e.key,s=e.type,i=n-1,a=n+1,c=t[n];if(null===c||c&&o==c.key&&s===c.type)return n;if(r>(null==c||131072&c.__u?0:1))for(;i>=0||a<t.length;){if(i>=0){if((c=t[i])&&!(131072&c.__u)&&o==c.key&&s===c.type)return i;i--}if(a<t.length){if((c=t[a])&&!(131072&c.__u)&&o==c.key&&s===c.type)return a;a++}}return-1}function Y(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||L.test(t)?n:n+"px"}function Q(e,t,n,r,o){var s;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Y(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Y(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])s=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,s?Z:X,s)):e.removeEventListener(t,s?Z:X,s);else{if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function X(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(w.event?w.event(e):e)}}function Z(e){if(this.l)return this.l[e.type+!0](w.event?w.event(e):e)}function ee(e,t,n,r,o,s,i,a,c,l){var u,d,p,h,f,m,g,_,y,S,b,E,v,T,I,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),s=[a=t.__e=n.__e]),(u=w.__b)&&u(t);e:if("function"==typeof k)try{if(_=t.props,y=(u=k.contextType)&&r[u.__c],S=u?y?y.props.value:u.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(_,S):(t.__c=d=new H(_,S),d.constructor=k,d.render=se),y&&y.sub(d),d.props=_,d.state||(d.state={}),d.context=S,d.__n=r,p=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=P({},d.__s)),P(d.__s,k.getDerivedStateFromProps(_,d.__s))),h=d.props,f=d.state,d.__v=t,p)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&_!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(_,S),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(_,d.__s,S)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(e){e&&(e.__=t)}),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&i.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(_,d.__s,S),null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(h,f,m)})}if(d.context=S,d.props=_,d.__P=e,d.__e=!1,E=w.__r,v=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,E&&E(t),u=d.render(d.props,d.state,d.context),T=0;T<d._sb.length;T++)d.__h.push(d._sb[T]);d._sb=[]}else do{d.__d=!1,E&&E(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++v<25);d.state=d.__s,null!=d.getChildContext&&(r=P(P({},r),d.getChildContext())),p||null==d.getSnapshotBeforeUpdate||(m=d.getSnapshotBeforeUpdate(h,f)),J(e,D(I=null!=u&&u.type===G&&null==u.key?u.props.children:u)?I:[I],t,n,r,o,s,i,a,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&i.push(d),g&&(d.__E=d.__=null)}catch(e){t.__v=null,c||null!=s?(t.__e=a,t.__u|=c?160:32,s[s.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),w.__e(e,t,n)}else null==s&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=ne(n.__e,t,n,r,o,s,i,c,l);(u=w.diffed)&&u(t)}function te(e,t,n){for(var r=0;r<n.length;r++)re(n[r],n[++r],n[++r]);w.__c&&w.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){w.__e(e,t.__v)}})}function ne(e,t,n,r,o,s,i,a,c){var l,u,d,p,h,f,m,g=n.props,_=t.props,y=t.type;if("svg"===y&&(o=!0),null!=s)for(l=0;l<s.length;l++)if((h=s[l])&&"setAttribute"in h==!!y&&(y?h.localName===y:3===h.nodeType)){e=h,s[l]=null;break}if(null==e){if(null===y)return document.createTextNode(_);e=o?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,_.is&&_),s=null,a=!1}if(null===y)g===_||a&&e.data===_||(e.data=_);else{if(s=s&&k.call(e.childNodes),g=n.props||O,!a&&null!=s)for(g={},l=0;l<e.attributes.length;l++)g[(h=e.attributes[l]).name]=h.value;for(l in g)h=g[l],"children"==l||("dangerouslySetInnerHTML"==l?d=h:"key"===l||l in _||Q(e,l,null,h,o));for(l in _)h=_[l],"children"==l?p=h:"dangerouslySetInnerHTML"==l?u=h:"value"==l?f=h:"checked"==l?m=h:"key"===l||a&&"function"!=typeof h||g[l]===h||Q(e,l,h,g[l],o);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),J(e,D(p)?p:[p],t,n,r,o&&"foreignObject"!==y,s,i,s?s[0]:n.__k&&W(n,0),a,c),null!=s)for(l=s.length;l--;)null!=s[l]&&U(s[l]);a||(l="value",void 0!==f&&(f!==e[l]||"progress"===y&&!f||"option"===y&&f!==g[l])&&Q(e,l,f,g[l],!1),l="checked",void 0!==m&&m!==e[l]&&Q(e,l,m,g[l],!1))}return e}function re(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){w.__e(e,n)}}function oe(e,t,n){var r,o;if(w.unmount&&w.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||re(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){w.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&oe(r[o],t,n||"function"!=typeof e.type);n||null==e.__e||U(e.__e),e.__=e.__e=e.__d=void 0}function se(e,t,n){return this.constructor(e,n)}k=M.slice,w={__e:function(e,t,n,r){for(var o,s,i;t=t.__;)if((o=t.__c)&&!o.__)try{if((s=o.constructor)&&null!=s.getDerivedStateFromError&&(o.setState(s.getDerivedStateFromError(e)),i=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),i=o.__d),i)return o.__E=o}catch(t){e=t}throw e}},A=0,H.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=P({},this.state),"function"==typeof e&&(e=e(P({},n),this.props)),e&&P(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),$(this))},H.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$(this))},H.prototype.render=G,C=[],x="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,N=function(e,t){return e.__v.__b-t.__v.__b},q.__r=0;var ie,ae,ce,le,ue=0,de=[],pe=[],he=w,fe=he.__b,me=he.__r,ge=he.diffed,_e=he.__c,ye=he.unmount,Se=he.__;function be(e,t){he.__h&&he.__h(ae,e,ue||t),ue=0;var n=ae.__H||(ae.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:pe}),n.__[e]}function Ee(e){return ue=1,ve(Oe,e)}function ve(e,t,n){var r=be(ie++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Oe(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=ae,!ae.u)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter(function(e){return!!e.__c});if(o.every(function(e){return!e.__N}))return!s||s.call(this,e,t,n);var i=!1;return o.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}}),!(!i&&r.__c.props===e)&&(!s||s.call(this,e,t,n))};ae.u=!0;var s=ae.shouldComponentUpdate,i=ae.componentWillUpdate;ae.componentWillUpdate=function(e,t,n){if(this.__e){var r=s;s=void 0,o(e,t,n),s=r}i&&i.call(this,e,t,n)},ae.shouldComponentUpdate=o}return r.__N||r.__}function Te(e,t){var n=be(ie++,4);!he.__s&&Ne(n.__H,t)&&(n.__=e,n.i=t,ae.__h.push(n))}function Ie(e,t){var n=be(ie++,7);return Ne(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function ke(e,t){return ue=8,Ie(function(){return e},t)}function we(){for(var e;e=de.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Re),e.__H.__h.forEach(xe),e.__H.__h=[]}catch(t){e.__H.__h=[],he.__e(t,e.__v)}}he.__b=function(e){ae=null,fe&&fe(e)},he.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Se&&Se(e,t)},he.__r=function(e){me&&me(e),ie=0;var t=(ae=e.__c).__H;t&&(ce===ae?(t.__h=[],ae.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.__V=pe,e.__N=e.i=void 0})):(t.__h.forEach(Re),t.__h.forEach(xe),t.__h=[],ie=0)),ce=ae},he.diffed=function(e){ge&&ge(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==de.push(t)&&le===he.requestAnimationFrame||((le=he.requestAnimationFrame)||Ce)(we)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.__V!==pe&&(e.__=e.__V),e.i=void 0,e.__V=pe})),ce=ae=null},he.__c=function(e,t){t.some(function(e){try{e.__h.forEach(Re),e.__h=e.__h.filter(function(e){return!e.__||xe(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],he.__e(n,e.__v)}}),_e&&_e(e,t)},he.unmount=function(e){ye&&ye(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{Re(e)}catch(e){t=e}}),n.__H=void 0,t&&he.__e(t,n.__v))};var Ae="function"==typeof requestAnimationFrame;function Ce(e){var t,n=function(){clearTimeout(r),Ae&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Ae&&(t=requestAnimationFrame(n))}function Re(e){var t=ae,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),ae=t}function xe(e){var t=ae;e.__c=e.__(),ae=t}function Ne(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Oe(e,t){return"function"==typeof t?t(e):t}const Me=Object.defineProperty({__proto__:null,useCallback:ke,useContext:function(e){var t=ae.context[e.__c],n=be(ie++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(ae)),t.props.value):e.__},useDebugValue:function(e,t){he.useDebugValue&&he.useDebugValue(t?t(e):e)},useEffect:function(e,t){var n=be(ie++,3);!he.__s&&Ne(n.__H,t)&&(n.__=e,n.i=t,ae.__H.__h.push(n))},useErrorBoundary:function(e){var t=be(ie++,10),n=Ee();return t.__=e,ae.componentDidCatch||(ae.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]},useId:function(){var e=be(ie++,11);if(!e.__){for(var t=ae.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__},useImperativeHandle:function(e,t,n){ue=6,Te(function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},null==n?n:n.concat(e))},useLayoutEffect:Te,useMemo:Ie,useReducer:ve,useRef:function(e){return ue=5,Ie(function(){return{current:e}},[])},useState:Ee},Symbol.toStringTag,{value:"Module"});function Le(){const e=e=>d.createElementNS("http://www.w3.org/2000/svg",e),t=_(e("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=_(e("path"),{transform:"translate(11, 11)",d:"M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z"});return t.appendChild(n),t}function De({options:e}){const t=Ie(()=>({__html:Le().outerHTML}),[]);return B("h2",{class:"dialog__header"},B("span",{class:"dialog__title"},e.formTitle),e.showBranding?B("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:t}):null)}function Pe(e,t){const n=e.get(t);return"string"==typeof n?n.trim():""}function Ue({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:o,onSubmitSuccess:s,onSubmitError:i,showEmail:a,showName:c,screenshotInput:u}){const{tags:d,addScreenshotButtonLabel:p,removeScreenshotButtonLabel:h,cancelButtonLabel:f,emailLabel:g,emailPlaceholder:_,isEmailRequired:y,isNameRequired:S,messageLabel:b,messagePlaceholder:E,nameLabel:v,namePlaceholder:T,submitButtonLabel:I,isRequiredLabel:k}=e,[w,A]=Ee(!1),[C,R]=Ee(null),[x,N]=Ee(!1),O=u?.input,[M,L]=Ee(null),D=ke(e=>{L(e),N(!1)},[]),P=ke(e=>{const t=function(e,t){const n=[];return t.isNameRequired&&!e.name&&n.push(t.nameLabel),t.isEmailRequired&&!e.email&&n.push(t.emailLabel),e.message||n.push(t.messageLabel),n}(e,{emailLabel:g,isEmailRequired:y,isNameRequired:S,messageLabel:b,nameLabel:v});return t.length>0?R(`Please enter in the following required fields: ${t.join(", ")}`):R(null),0===t.length},[g,y,S,b,v]),U=ke(async e=>{A(!0);try{if(e.preventDefault(),!(e.target instanceof HTMLFormElement))return;const t=new FormData(e.target),n=await(u&&x?u.value():void 0),r={name:Pe(t,"name"),email:Pe(t,"email"),message:Pe(t,"message"),attachments:n?[n]:void 0};if(!P(r))return;try{const e=await o({name:r.name,email:r.email,message:r.message,source:"widget",tags:d},{attachments:r.attachments});s(r,e)}catch(e){m&&l.debug.error(e),R(e),i(e)}}finally{A(!1)}},[u&&x,s,i]);return B("form",{class:"form",onSubmit:U},O&&x?B(O,{onError:D}):null,B("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:w},B("div",{class:"form__top"},C?B("div",{class:"form__error-container"},C):null,c?B("label",{for:"name",class:"form__label"},B(Be,{label:v,isRequiredLabel:k,isRequired:S}),B("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:T,required:S,type:"text"})):B("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),a?B("label",{for:"email",class:"form__label"},B(Be,{label:g,isRequiredLabel:k,isRequired:y}),B("input",{class:"form__input",defaultValue:t,id:"email",name:"email",placeholder:_,required:y,type:"email"})):B("input",{"aria-hidden":!0,value:t,name:"email",type:"hidden"}),B("label",{for:"message",class:"form__label"},B(Be,{label:b,isRequiredLabel:k,isRequired:!0}),B("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:E,required:!0,rows:5})),O?B("label",{for:"screenshot",class:"form__label"},B("button",{class:"btn btn--default",disabled:w,type:"button",onClick:()=>{L(null),N(e=>!e)}},x?h:p),M?B("div",{class:"form__error-container"},M.message):null):null),B("div",{class:"btn-group"},B("button",{class:"btn btn--primary",disabled:w,type:"submit"},I),B("button",{class:"btn btn--default",disabled:w,type:"button",onClick:r},f))))}function Be({label:e,isRequired:t,isRequiredLabel:n}){return B("span",{class:"form__label__text"},e,t&&B("span",{class:"form__label__text--required"},n))}function Fe(){const e=e=>u.document.createElementNS("http://www.w3.org/2000/svg",e),t=_(e("svg"),{width:"16",height:"17",viewBox:"0 0 16 17",fill:"inherit"}),n=_(e("g"),{clipPath:"url(#clip0_57_156)"}),r=_(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z"}),o=_(e("path"),{d:"M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z"});t.appendChild(n).append(o,r);const s=e("defs"),i=_(e("clipPath"),{id:"clip0_57_156"}),a=_(e("rect"),{width:"16",height:"16",fill:"white",transform:"translate(0 0.5)"});return i.appendChild(a),s.appendChild(i),t.appendChild(s).appendChild(i).appendChild(a),t}function Ge({open:e,onFormSubmitted:t,...n}){const r=n.options,o=Ie(()=>({__html:Fe().outerHTML}),[]),[s,i]=Ee(null),a=ke(()=>{s&&(clearTimeout(s),i(null)),t()},[s]),c=ke((e,r)=>{n.onSubmitSuccess(e,r),i(setTimeout(()=>{t(),i(null)},5e3))},[t]);return B(G,null,s?B("div",{class:"success__position",onClick:a},B("div",{class:"success__content"},r.successMessageText,B("span",{class:"success__icon",dangerouslySetInnerHTML:o}))):B("dialog",{class:"dialog",onClick:r.onFormClose,open:e},B("div",{class:"dialog__position"},B("div",{class:"dialog__content",onClick:e=>{e.stopPropagation()}},B(De,{options:r}),B(Ue,{...n,onSubmitSuccess:c})))))}const He=()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:o})=>{const s=o,i=e.useSentryUser,a=function(){const e=(0,r.getCurrentScope)().getUser(),t=(0,r.getIsolationScope)().getUser(),n=(0,r.getGlobalScope)().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}(),c=d.createElement("div"),l=function(e){const t=d.createElement("style");return t.textContent="\n:host {\n --dialog-inset: var(--inset);\n}\n\n\n.dialog {\n position: fixed;\n z-index: var(--z-index);\n margin: 0;\n inset: 0;\n\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n height: 100vh;\n width: 100vw;\n\n color: var(--dialog-color, var(--foreground));\n fill: var(--dialog-color, var(--foreground));\n line-height: 1.75em;\n\n background-color: rgba(0, 0, 0, 0.05);\n border: none;\n inset: 0;\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n}\n\n.dialog__position {\n position: fixed;\n z-index: var(--z-index);\n inset: var(--dialog-inset);\n padding: var(--page-margin);\n display: flex;\n max-height: calc(100vh - (2 * var(--page-margin)));\n}\n@media (max-width: 600px) {\n .dialog__position {\n inset: var(--page-margin);\n padding: 0;\n }\n}\n\n.dialog__position:has(.editor) {\n inset: var(--page-margin);\n padding: 0;\n}\n\n.dialog:not([open]) {\n opacity: 0;\n pointer-events: none;\n visibility: hidden;\n}\n.dialog:not([open]) .dialog__content {\n transform: translate(0, -16px) scale(0.98);\n}\n\n.dialog__content {\n display: flex;\n flex-direction: column;\n gap: 16px;\n padding: var(--dialog-padding, 24px);\n max-width: 100%;\n width: 100%;\n max-height: 100%;\n overflow: auto;\n\n background: var(--dialog-background, var(--background));\n border-radius: var(--dialog-border-radius, 20px);\n border: var(--dialog-border, var(--border));\n box-shadow: var(--dialog-box-shadow, var(--box-shadow));\n transform: translate(0, 0) scale(1);\n transition: transform 0.2s ease-in-out;\n}\n\n\n\n.dialog__header {\n display: flex;\n gap: 4px;\n justify-content: space-between;\n font-weight: var(--dialog-header-weight, 600);\n margin: 0;\n}\n.dialog__title {\n align-self: center;\n width: var(--form-width, 272px);\n}\n\n@media (max-width: 600px) {\n .dialog__title {\n width: auto;\n }\n}\n\n.dialog__position:has(.editor) .dialog__title {\n width: auto;\n}\n\n\n.brand-link {\n display: inline-flex;\n}\n.brand-link:focus-visible {\n outline: var(--outline);\n}\n\n\n.form {\n display: flex;\n overflow: auto;\n flex-direction: row;\n gap: 16px;\n flex: 1 0;\n}\n\n.form fieldset {\n border: none;\n margin: 0;\n padding: 0;\n}\n\n.form__right {\n flex: 0 0 auto;\n display: flex;\n overflow: auto;\n flex-direction: column;\n justify-content: space-between;\n gap: 20px;\n width: var(--form-width, 100%);\n}\n\n.dialog__position:has(.editor) .form__right {\n width: var(--form-width, 272px);\n}\n\n.form__top {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.form__error-container {\n color: var(--error-color);\n fill: var(--error-color);\n}\n\n.form__label {\n display: flex;\n flex-direction: column;\n gap: 4px;\n margin: 0px;\n}\n\n.form__label__text {\n display: flex;\n gap: 4px;\n align-items: center;\n}\n\n.form__label__text--required {\n font-size: 0.85em;\n}\n\n.form__input {\n font-family: inherit;\n line-height: inherit;\n background: transparent;\n box-sizing: border-box;\n border: var(--input-border, var(--border));\n border-radius: var(--input-border-radius, 6px);\n color: var(--input-color, inherit);\n fill: var(--input-color, inherit);\n font-size: var(--input-font-size, inherit);\n font-weight: var(--input-font-weight, 500);\n padding: 6px 12px;\n}\n\n.form__input::placeholder {\n opacity: 0.65;\n color: var(--input-placeholder-color, inherit);\n filter: var(--interactive-filter);\n}\n\n.form__input:focus-visible {\n outline: var(--input-focus-outline, var(--outline));\n}\n\n.form__input--textarea {\n font-family: inherit;\n resize: vertical;\n}\n\n.error {\n color: var(--error-color);\n fill: var(--error-color);\n}\n\n\n.btn-group {\n display: grid;\n gap: 8px;\n}\n\n.btn {\n line-height: inherit;\n border: var(--button-border, var(--border));\n border-radius: var(--button-border-radius, 6px);\n cursor: pointer;\n font-family: inherit;\n font-size: var(--button-font-size, inherit);\n font-weight: var(--button-font-weight, 600);\n padding: var(--button-padding, 6px 16px);\n}\n.btn[disabled] {\n opacity: 0.6;\n pointer-events: none;\n}\n\n.btn--primary {\n color: var(--button-primary-color, var(--accent-foreground));\n fill: var(--button-primary-color, var(--accent-foreground));\n background: var(--button-primary-background, var(--accent-background));\n border: var(--button-primary-border, var(--border));\n border-radius: var(--button-primary-border-radius, 6px);\n font-weight: var(--button-primary-font-weight, 500);\n}\n.btn--primary:hover {\n color: var(--button-primary-hover-color, var(--accent-foreground));\n fill: var(--button-primary-hover-color, var(--accent-foreground));\n background: var(--button-primary-hover-background, var(--accent-background));\n filter: var(--interactive-filter);\n}\n.btn--primary:focus-visible {\n background: var(--button-primary-hover-background, var(--accent-background));\n filter: var(--interactive-filter);\n outline: var(--button-primary-focus-outline, var(--outline));\n}\n\n.btn--default {\n color: var(--button-color, var(--foreground));\n fill: var(--button-color, var(--foreground));\n background: var(--button-background, var(--background));\n border: var(--button-border, var(--border));\n border-radius: var(--button-border-radius, 6px);\n font-weight: var(--button-font-weight, 500);\n}\n.btn--default:hover {\n color: var(--button-color, var(--foreground));\n fill: var(--button-color, var(--foreground));\n background: var(--button-hover-background, var(--background));\n filter: var(--interactive-filter);\n}\n.btn--default:focus-visible {\n background: var(--button-hover-background, var(--background));\n filter: var(--interactive-filter);\n outline: var(--button-focus-outline, var(--outline));\n}\n\n\n.success__position {\n position: fixed;\n inset: var(--dialog-inset);\n padding: var(--page-margin);\n z-index: var(--z-index);\n}\n.success__content {\n background: var(--success-background, var(--background));\n border: var(--success-border, var(--border));\n border-radius: var(--success-border-radius, 1.7em/50%);\n box-shadow: var(--success-box-shadow, var(--box-shadow));\n font-weight: var(--success-font-weight, 600);\n color: var(--success-color);\n fill: var(--success-color);\n padding: 12px 24px;\n line-height: 1.75em;\n\n display: grid;\n align-items: center;\n grid-auto-flow: column;\n gap: 6px;\n cursor: default;\n}\n\n.success__icon {\n display: flex;\n}\n\n",e&&t.setAttribute("nonce",e),t}(e.styleNonce);let u="";const p={get el(){return c},appendToDom(){s.contains(l)||s.contains(c)||(s.appendChild(l),s.appendChild(c))},removeFromDom(){c.remove(),l.remove(),d.body.style.overflow=u},open(){f(!0),e.onFormOpen?.(),(0,r.getClient)()?.emit("openFeedbackWidget"),u=d.body.style.overflow,d.body.style.overflow="hidden"},close(){f(!1),d.body.style.overflow=u}},h=t?.createInput({h:B,hooks:Me,dialog:p,options:e}),f=t=>{!function(e,t){var n,r,o;w.__&&w.__(e,t),n=t.__k,r=[],o=[],ee(t,e=t.__k=B(G,null,[e]),n||O,O,void 0!==t.ownerSVGElement,n?null:t.firstChild?k.call(t.childNodes):null,r,n?n.__e:t.firstChild,!1,o),e.__d=void 0,te(r,e,o)}(B(Ge,{options:e,screenshotInput:h,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:i&&a?.[i.name]||"",defaultEmail:i&&a?.[i.email]||"",onFormClose:()=>{f(!1),e.onFormClose?.()},onSubmit:n,onSubmitSuccess:(t,n)=>{f(!1),e.onSubmitSuccess?.(t,n)},onSubmitError:t=>{e.onSubmitError?.(t)},onFormSubmitted:()=>{e.onFormSubmitted?.()},open:t}),c)};return p}});function We(e){const t=d.createElement("style"),n="#1A141F",r="#302735";return t.textContent=`\n.editor {\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n}\n\n.editor__image-container {\n justify-items: center;\n padding: 15px;\n position: relative;\n height: 100%;\n border-radius: var(--menu-border-radius, 6px);\n\n background-color: ${n};\n background-image: repeating-linear-gradient(\n -145deg,\n transparent,\n transparent 8px,\n ${n} 8px,\n ${n} 11px\n ),\n repeating-linear-gradient(\n -45deg,\n transparent,\n transparent 15px,\n ${r} 15px,\n ${r} 16px\n );\n}\n\n.editor__canvas-container {\n width: 100%;\n height: 100%;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.editor__canvas-container > * {\n object-fit: contain;\n position: absolute;\n}\n\n.editor__tool-container {\n padding-top: 8px;\n display: flex;\n justify-content: center;\n}\n\n.editor__tool-bar {\n display: flex;\n gap: 8px;\n}\n\n.editor__tool {\n display: flex;\n padding: 8px 12px;\n justify-content: center;\n align-items: center;\n border: var(--button-border, var(--border));\n border-radius: var(--button-border-radius, 6px);\n background: var(--button-background, var(--background));\n color: var(--button-color, var(--foreground));\n}\n\n.editor__tool--active {\n background: var(--button-primary-background, var(--accent-background));\n color: var(--button-primary-color, var(--accent-foreground));\n}\n\n.editor__rect {\n position: absolute;\n z-index: 2;\n}\n\n.editor__rect button {\n opacity: 0;\n position: absolute;\n top: -12px;\n right: -12px;\n cursor: pointer;\n padding: 0;\n z-index: 3;\n border: none;\n background: none;\n}\n\n.editor__rect:hover button {\n opacity: 1;\n}\n`,e&&t.setAttribute("nonce",e),t}function ze({hooks:e}){return function({onBeforeScreenshot:t,onScreenshot:n,onAfterScreenshot:r,onError:o}){const s=function(){const[t,n]=e.useState(u.devicePixelRatio??1);return e.useEffect(()=>{const e=()=>{n(u.devicePixelRatio)},t=matchMedia(`(resolution: ${u.devicePixelRatio}dppx)`);return t.addEventListener("change",e),()=>{t.removeEventListener("change",e)}},[]),t}();e.useEffect(()=>{(async()=>{t();const e=await p.mediaDevices.getDisplayMedia({video:{width:u.innerWidth*s,height:u.innerHeight*s},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),o=d.createElement("video");await new Promise((t,r)=>{o.srcObject=e,o.onloadedmetadata=()=>{n(o,s),e.getTracks().forEach(e=>e.stop()),t()},o.play().catch(r)}),r()})().catch(o)},[])}}function je(e,t,n){if(!e)return;const r=e.getContext("2d",t);r&&n(e,r)}function $e(e,t){je(e,{alpha:!0},(e,n)=>{n.drawImage(t,0,0,t.width,t.height,0,0,e.width,e.height)})}function qe(e,t,n){je(e,{alpha:!0},(e,r)=>{n.length&&(r.fillStyle="rgba(0, 0, 0, 0.25)",r.fillRect(0,0,e.width,e.height)),n.forEach(e=>{!function(e,t,n){switch(e.type){case"highlight":t.shadowColor="rgba(0, 0, 0, 0.7)",t.shadowBlur=50,t.fillStyle=n,t.fillRect(e.x-1,e.y-1,e.w+2,e.h+2),t.clearRect(e.x,e.y,e.w,e.h);break;case"hide":t.fillStyle="rgb(0, 0, 0)",t.fillRect(e.x,e.y,e.w,e.h)}}(e,r,t)})})}function Je({h:e,hooks:t,outputBuffer:n,dialog:r,options:o}){const s=ze({hooks:t}),i=function({h:e}){return function({action:t,setAction:n,options:r}){return e("div",{class:"editor__tool-container"},e("div",{class:"editor__tool-bar"},e("button",{type:"button",class:"editor__tool "+("highlight"===t?"editor__tool--active":""),onClick:()=>{n("highlight"===t?"":"highlight")}},r.highlightToolText),e("button",{type:"button",class:"editor__tool "+("hide"===t?"editor__tool--active":""),onClick:()=>{n("hide"===t?"":"hide")}},r.hideToolText)))}}({h:e}),a=function({h:e}){return function(){return e("svg",{"data-test-id":"icon-close",viewBox:"0 0 16 16",fill:"#2B2233",height:"25px",width:"25px"},e("circle",{r:"7",cx:"8",cy:"8",fill:"white"}),e("path",{strokeWidth:"1.5",d:"M8,16a8,8,0,1,1,8-8A8,8,0,0,1,8,16ZM8,1.53A6.47,6.47,0,1,0,14.47,8,6.47,6.47,0,0,0,8,1.53Z"}),e("path",{strokeWidth:"1.5",d:"M5.34,11.41a.71.71,0,0,1-.53-.22.74.74,0,0,1,0-1.06l5.32-5.32a.75.75,0,0,1,1.06,1.06L5.87,11.19A.74.74,0,0,1,5.34,11.41Z"}),e("path",{strokeWidth:"1.5",d:"M10.66,11.41a.74.74,0,0,1-.53-.22L4.81,5.87A.75.75,0,0,1,5.87,4.81l5.32,5.32a.74.74,0,0,1,0,1.06A.71.71,0,0,1,10.66,11.41Z"}))}}({h:e}),c={__html:We(o.styleNonce).innerText},l=r.el.style,p=({screenshot:r})=>{const[s,l]=t.useState("highlight"),[p,h]=t.useState([]),f=t.useRef(null),m=t.useRef(null),g=t.useRef(null),_=t.useRef(null),[y,S]=t.useState(1),b=t.useMemo(()=>{const e=d.getElementById(o.id);if(!e)return"white";const t=getComputedStyle(e);return t.getPropertyValue("--button-primary-background")||t.getPropertyValue("--accent-background")},[o.id]);t.useLayoutEffect(()=>{const e=()=>{const t=f.current;t&&(je(r.canvas,{alpha:!1},e=>{const n=Math.min(t.clientWidth/e.width,t.clientHeight/e.height);S(n)}),0!==t.clientHeight&&0!==t.clientWidth||setTimeout(e,0))};return e(),u.addEventListener("resize",e),()=>{u.removeEventListener("resize",e)}},[r]);const E=t.useCallback((e,t)=>{je(e,{alpha:!0},(e,n)=>{n.scale(t,t),e.width=r.canvas.width,e.height=r.canvas.height})},[r]);t.useEffect(()=>{E(m.current,r.dpi),$e(m.current,r.canvas)},[r]),t.useEffect(()=>{E(g.current,r.dpi),je(g.current,{alpha:!0},(e,t)=>{t.clearRect(0,0,e.width,e.height)}),qe(g.current,b,p)},[p,b]),t.useEffect(()=>{E(n,r.dpi),$e(n,r.canvas),je(d.createElement("canvas"),{alpha:!0},(e,t)=>{t.scale(r.dpi,r.dpi),e.width=r.canvas.width,e.height=r.canvas.height,qe(e,b,p),$e(n,e)})},[p,r,b]);const v=t.useCallback(e=>t=>{t.preventDefault(),t.stopPropagation(),h(t=>{const n=[...t];return n.splice(e,1),n})},[]),T={width:r.canvas.width*y+"px",height:r.canvas.height*y+"px"},I=e=>{e.stopPropagation()};return e("div",{class:"editor"},e("style",{nonce:o.styleNonce,dangerouslySetInnerHTML:c}),e("div",{class:"editor__image-container"},e("div",{class:"editor__canvas-container",ref:f},e("canvas",{ref:m,id:"background",style:T}),e("canvas",{ref:g,id:"foreground",style:T}),e("div",{ref:_,onMouseDown:e=>{if(!s||!_.current)return;const t=_.current.getBoundingClientRect(),n={type:s,x:e.offsetX/y,y:e.offsetY/y},r=(e,n)=>{const r=(n.clientX-t.x)/y,o=(n.clientY-t.y)/y;return{type:e.type,x:Math.min(e.x,r),y:Math.min(e.y,o),w:Math.abs(r-e.x),h:Math.abs(o-e.y)}},o=e=>{je(g.current,{alpha:!0},(e,t)=>{t.clearRect(0,0,e.width,e.height)}),qe(g.current,b,[...p,r(n,e)])},i=e=>{const t=r(n,e);t.w*y>=1&&t.h*y>=1&&h(e=>[...e,t]),d.removeEventListener("mousemove",o),d.removeEventListener("mouseup",i)};d.addEventListener("mousemove",o),d.addEventListener("mouseup",i)},style:T},p.map((t,n)=>e("div",{key:n,class:"editor__rect",style:{top:t.y*y+"px",left:t.x*y+"px",width:t.w*y+"px",height:t.h*y+"px"}},e("button",{"aria-label":o.removeHighlightText,onClick:v(n),onMouseDown:I,onMouseUp:I,type:"button"},e(a,null))))))),e(i,{options:o,action:s,setAction:l}))};return function({onError:r}){const[o,i]=t.useState();return s({onBeforeScreenshot:t.useCallback(()=>{l.display="none"},[]),onScreenshot:t.useCallback((e,t)=>{je(d.createElement("canvas"),{alpha:!1},(n,r)=>{r.scale(t,t),n.width=e.videoWidth,n.height=e.videoHeight,r.drawImage(e,0,0,n.width,n.height),i({canvas:n,dpi:t})}),n.width=e.videoWidth,n.height=e.videoHeight},[]),onAfterScreenshot:t.useCallback(()=>{l.display="block"},[]),onError:t.useCallback(e=>{l.display="block",r(e)},[])}),o?e(p,{screenshot:o}):e("div",null)}}const Ve=()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{const o=d.createElement("canvas");return{input:Je({h:e,hooks:t,outputBuffer:o,dialog:n,options:r}),value:async()=>{const e=await new Promise(e=>{o.toBlob(e,"image/png")});if(e){return{data:new Uint8Array(await e.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}}}}}})},353:(e,t,n)=>{n.r(t),n.d(t,{captureFeedback:()=>o});var r=n(209);function o(e,t={},n=(0,r.getCurrentScope)()){const{message:o,name:s,email:i,url:a,source:c,associatedEventId:l,tags:u}=e,d={contexts:{feedback:{contact_email:i,name:s,message:o,url:a,source:c,associated_event_id:l}},type:"feedback",level:"info",tags:u},p=n?.getClient()||(0,r.getClient)();p&&p.emit("beforeSendFeedback",d,t);return n.captureEvent(d,t)}},354:(e,t,n)=>{n.r(t),n.d(t,{isBrowser:()=>s});var r=n(355),o=n(213);function s(){return"undefined"!=typeof window&&(!(0,r.isNodeEnv)()||function(){const e=o.GLOBAL_OBJ.process;return"renderer"===e?.type}())}},355:(e,t,n)=>{n.r(t),n.d(t,{isNodeEnv:()=>o,loadModule:()=>i});var r=n(268);function o(){return!(0,r.isBrowserBundle)()&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function s(e,t){return e.require(t)}function i(e,t=module){let n;try{n=s(t,e)}catch{}if(!n)try{const{cwd:r}=s(t,"process");n=s(t,`${r()}/node_modules/${e}`)}catch{}return n}},356:(e,t,n)=>{n.r(t),n.d(t,{lazyLoadIntegration:()=>c});var r=n(209),o=n(212),s=n(270);const i={replayIntegration:"replay",replayCanvasIntegration:"replay-canvas",feedbackIntegration:"feedback",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot",captureConsoleIntegration:"captureconsole",contextLinesIntegration:"contextlines",linkedErrorsIntegration:"linkederrors",dedupeIntegration:"dedupe",extraErrorDataIntegration:"extraerrordata",graphqlClientIntegration:"graphqlclient",httpClientIntegration:"httpclient",reportingObserverIntegration:"reportingobserver",rewriteFramesIntegration:"rewriteframes",browserProfilingIntegration:"browserprofiling",moduleMetadataIntegration:"modulemetadata",instrumentAnthropicAiClient:"instrumentanthropicaiclient",instrumentOpenAiClient:"instrumentopenaiclient",instrumentGoogleGenAIClient:"instrumentgooglegenaiclient"},a=s.WINDOW;async function c(e,t){const n=i[e],c=a.Sentry=a.Sentry||{};if(!n)throw new Error(`Cannot lazy load integration: ${e}`);const l=c[e];if("function"==typeof l&&!("_isShim"in l))return l;const u=function(e){const t=(0,r.getClient)(),n=t?.getOptions()?.cdnBaseUrl||"https://browser.sentry-cdn.com";return new URL(`/${o.SDK_VERSION}/${e}.min.js`,n).toString()}(n),d=s.WINDOW.document.createElement("script");d.src=u,d.crossOrigin="anonymous",d.referrerPolicy="strict-origin",t&&d.setAttribute("nonce",t);const p=new Promise((e,t)=>{d.addEventListener("load",()=>e()),d.addEventListener("error",t)}),h=s.WINDOW.document.currentScript,f=s.WINDOW.document.body||s.WINDOW.document.head||h?.parentElement;if(!f)throw new Error(`Could not find parent element to insert lazy-loaded ${e} script`);f.appendChild(d);try{await p}catch{throw new Error(`Error when loading integration: ${e}`)}const m=c[e];if("function"!=typeof m)throw new Error(`Could not load integration: ${e}`);return m}},357:(e,t,n)=>{n.r(t),n.d(t,{feedbackSyncIntegration:()=>o});var r=n(352);const o=(0,r.buildFeedbackIntegration)({getModalIntegration:()=>r.feedbackModalIntegration,getScreenshotIntegration:()=>r.feedbackScreenshotIntegration})},358:(e,t,n)=>{n.r(t),n.d(t,{eventFromEnvelope:()=>i,makeMultiplexedTransport:()=>a});var r=n(237),o=n(238),s=n(250);function i(e,t){let n;return(0,s.forEachEnvelopeItem)(e,(e,r)=>(t.includes(r)&&(n=Array.isArray(e)?e[1]:void 0),!!n)),n}function a(e,t){return n=>{const a=e(n),c=new Map;function l(t,s){const a=s?`${t}:${s}`:t;let l=c.get(a);if(!l){const u=(0,o.dsnFromString)(t);if(!u)return;const d=(0,r.getEnvelopeEndpointWithUrlEncodedAuth)(u,n.tunnel);l=s?function(e,t){return n=>{const r=e(n);return{...r,send:async e=>{const n=i(e,["event","transaction","profile","replay_event"]);return n&&(n.release=t),r.send(e)}}}}(e,s)({...n,url:d}):e({...n,url:d}),c.set(a,l)}return[t,l]}return{send:async function(e){const n=t({envelope:e,getEvent:function(t){return i(e,t?.length?t:["event"])}}).map(e=>"string"==typeof e?l(e,void 0):l(e.dsn,e.release)).filter(e=>!!e),r=n.length?n:[["",a]];return(await Promise.all(r.map(([t,n])=>n.send(function(e,t){return(0,s.createEnvelope)(t?{...e[0],dsn:t}:e[0],e[1])}(e,t)))))[0]},flush:async function(e){const t=[...c.values(),a];return(await Promise.all(t.map(t=>t.flush(e)))).every(e=>e)}}}}},359:(e,t,n)=>{function r(e,...t){const n=new String(String.raw(e,...t));return n.__sentry_template_string__=e.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=t,n}n.r(t),n.d(t,{fmt:()=>o,parameterize:()=>r});const o=r},360:(e,t,n)=>{n.r(t),n.d(t,{moduleMetadataIntegration:()=>i});var r=n(229),o=n(361),s=n(250);const i=(0,r.defineIntegration)(()=>({name:"ModuleMetadata",setup(e){e.on("beforeEnvelope",e=>{(0,s.forEachEnvelopeItem)(e,(e,t)=>{if("event"===t){const t=Array.isArray(e)?e[1]:void 0;t&&((0,o.stripMetadataFromStackFrames)(t),e[1]=t)}})}),e.on("applyFrameMetadata",t=>{if(t.type)return;const n=e.getOptions().stackParser;(0,o.addMetadataToStackFrames)(n,t)})}}))},361:(e,t,n)=>{n.r(t),n.d(t,{addMetadataToStackFrames:()=>a,getMetadataForUrl:()=>i,stripMetadataFromStackFrames:()=>c});var r=n(213);const o=new Map,s=new Set;function i(e,t){return function(e){if(r.GLOBAL_OBJ._sentryModuleMetadata)for(const t of Object.keys(r.GLOBAL_OBJ._sentryModuleMetadata)){const n=r.GLOBAL_OBJ._sentryModuleMetadata[t];if(s.has(t))continue;s.add(t);const i=e(t);for(const e of i.reverse())if(e.filename){o.set(e.filename,n);break}}}(e),o.get(t)}function a(e,t){t.exception?.values?.forEach(t=>{t.stacktrace?.frames?.forEach(t=>{if(!t.filename||t.module_metadata)return;const n=i(e,t.filename);n&&(t.module_metadata=n)})})}function c(e){e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{delete e.module_metadata})})}},362:(e,t,n)=>{n.r(t),n.d(t,{captureConsoleIntegration:()=>p});var r=n(209),o=n(271),s=n(275),i=n(229),a=n(223),c=n(219),l=n(279),u=n(224),d=n(213);const p=(0,i.defineIntegration)((e={})=>{const t=e.levels||a.CONSOLE_LEVELS,n=e.handled??!0;return{name:"CaptureConsole",setup(e){"console"in d.GLOBAL_OBJ&&(0,s.addConsoleInstrumentationHandler)(({args:s,level:i})=>{(0,r.getClient)()===e&&t.includes(i)&&function(e,t,n){const s={level:(0,l.severityLevelFromString)(t),extra:{arguments:e}};(0,r.withScope)(r=>{if(r.addEventProcessor(e=>(e.logger="console",(0,c.addExceptionMechanism)(e,{handled:n,type:"auto.core.capture_console"}),e)),"assert"===t){if(!e[0]){const t=`Assertion failed: ${(0,u.safeJoin)(e.slice(1)," ")||"console.assert"}`;r.setExtra("arguments",e.slice(1)),(0,o.captureMessage)(t,s)}return}const i=e.find(e=>e instanceof Error);if(i)return void(0,o.captureException)(i,s);const a=(0,u.safeJoin)(e," ");(0,o.captureMessage)(a,s)})}(s,i,n)})}}})},363:(e,t,n)=>{n.r(t),n.d(t,{extraErrorDataIntegration:()=>u});var r=n(217),o=n(229),s=n(223),i=n(222),a=n(251),c=n(220),l=n(224);const u=(0,o.defineIntegration)((e={})=>{const{depth:t=3,captureErrorCause:n=!0}=e;return{name:"ExtraErrorData",processEvent(e,r,o){const{maxValueLength:s=250}=o.getOptions();return function(e,t={},n,r,o){if(!t.originalException||!(0,i.isError)(t.originalException))return e;const s=t.originalException.name||t.originalException.constructor.name,l=d(t.originalException,r,o);if(l){const t={...e.contexts},r=(0,a.normalize)(l,n);return(0,i.isPlainObject)(r)&&((0,c.addNonEnumerableProperty)(r,"__sentry_skip_normalization__",!0),t[s]=r),{...e,contexts:t}}return e}(e,r,t,n,s)}}});function d(e,t,n){try{const r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],o={};for(const t of Object.keys(e)){if(-1!==r.indexOf(t))continue;const s=e[t];o[t]=(0,i.isError)(s)||"string"==typeof s?(0,l.truncate)(`${s}`,n):s}if(t&&void 0!==e.cause)if((0,i.isError)(e.cause)){const t=e.cause.name||e.cause.constructor.name;o.cause={[t]:d(e.cause,!1,n)}}else o.cause=e.cause;if("function"==typeof e.toJSON){const t=e.toJSON();for(const e of Object.keys(t)){const n=t[e];o[e]=(0,i.isError)(n)?n.toString():n}}return o}catch(e){r.DEBUG_BUILD&&s.debug.error("Unable to extract extra data from the Error object:",e)}return null}},364:(e,t,n)=>{n.r(t),n.d(t,{generateIteratee:()=>a,rewriteFramesIntegration:()=>i});var r=n(229),o=n(365),s=n(213);const i=(0,r.defineIntegration)((e={})=>{const t=e.root,n=e.prefix||"app:///",r="window"in s.GLOBAL_OBJ&&!!s.GLOBAL_OBJ.window,o=e.iteratee||a({isBrowser:r,root:t,prefix:n});return{name:"RewriteFrames",processEvent(e){let t=e;return e.exception&&Array.isArray(e.exception.values)&&(t=function(e){try{return{...e,exception:{...e.exception,values:e.exception.values.map(e=>{return{...e,...e.stacktrace&&{stacktrace:(t=e.stacktrace,{...t,frames:t?.frames?.map(e=>o(e))})}};var t})}}}catch{return e}}(t)),t}}});function a({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;const s=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes("\\")&&!r.filename.includes("/"),i=/^\//.test(r.filename);if(e){if(t){const e=r.filename;0===e.indexOf(t)&&(r.filename=e.replace(t,n))}}else if(s||i){const e=s?r.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):r.filename,i=t?(0,o.relative)(t,e):(0,o.basename)(e);r.filename=`${n}${i}`}return r}}},365:(e,t,n)=>{function r(e,t){let n=0;for(let t=e.length-1;t>=0;t--){const r=e[t];"."===r?e.splice(t,1):".."===r?(e.splice(t,1),n++):n&&(e.splice(t,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}n.r(t),n.d(t,{basename:()=>h,dirname:()=>p,isAbsolute:()=>u,join:()=>d,normalizePath:()=>l,relative:()=>c,resolve:()=>i});const o=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function s(e){const t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=o.exec(t);return n?n.slice(1):[]}function i(...e){let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){const o=r>=0?e[r]:"/";o&&(t=`${o}/${t}`,n="/"===o.charAt(0))}return t=r(t.split("/").filter(e=>!!e),!n).join("/"),(n?"/":"")+t||"."}function a(e){let t=0;for(;t<e.length&&""===e[t];t++);let n=e.length-1;for(;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}function c(e,t){e=i(e).slice(1),t=i(t).slice(1);const n=a(e.split("/")),r=a(t.split("/")),o=Math.min(n.length,r.length);let s=o;for(let e=0;e<o;e++)if(n[e]!==r[e]){s=e;break}let c=[];for(let e=s;e<n.length;e++)c.push("..");return c=c.concat(r.slice(s)),c.join("/")}function l(e){const t=u(e),n="/"===e.slice(-1);let o=r(e.split("/").filter(e=>!!e),!t).join("/");return o||t||(o="."),o&&n&&(o+="/"),(t?"/":"")+o}function u(e){return"/"===e.charAt(0)}function d(...e){return l(e.join("/"))}function p(e){const t=s(e),n=t[0]||"";let r=t[1];return n||r?(r&&(r=r.slice(0,r.length-1)),n+r):"."}function h(e,t){let n=s(e)[2]||"";return t&&n.slice(-1*t.length)===t&&(n=n.slice(0,n.length-t.length)),n}},366:(e,t,n)=>{n.r(t),n.d(t,{DB_OPERATIONS_TO_INSTRUMENT:()=>g,FILTER_MAPPINGS:()=>m,extractOperation:()=>S,instrumentSupabaseClient:()=>I,supabaseIntegration:()=>k,translateFiltersIntoMethods:()=>b});var r=n(273),o=n(217),s=n(271),i=n(229),a=n(242),c=n(223),l=n(219),u=n(222),d=n(246),p=n(309);const h=["reauthenticate","signInAnonymously","signInWithOAuth","signInWithIdToken","signInWithOtp","signInWithPassword","signInWithSSO","signOut","signUp","verifyOtp"],f=["createUser","deleteUser","listUsers","getUserById","updateUserById","inviteUserByEmail"],m={eq:"eq",neq:"neq",gt:"gt",gte:"gte",lt:"lt",lte:"lte",like:"like","like(all)":"likeAllOf","like(any)":"likeAnyOf",ilike:"ilike","ilike(all)":"ilikeAllOf","ilike(any)":"ilikeAnyOf",is:"is",in:"in",cs:"contains",cd:"containedBy",sr:"rangeGt",nxl:"rangeGte",sl:"rangeLt",nxr:"rangeLte",adj:"rangeAdjacent",ov:"overlaps",fts:"",plfts:"plain",phfts:"phrase",wfts:"websearch",not:"not"},g=["select","insert","upsert","update","delete"];function _(e){try{e.__SENTRY_INSTRUMENTED__=!0}catch{}}function y(e){try{return e.__SENTRY_INSTRUMENTED__}catch{return!1}}function S(e,t={}){switch(e){case"GET":return"select";case"POST":return t.Prefer?.includes("resolution=")?"upsert":"insert";case"PATCH":return"update";case"DELETE":return"delete";default:return"<unknown-op>"}}function b(e,t){if(""===t||"*"===t)return"select(*)";if("select"===e)return`select(${t})`;if("or"===e||e.endsWith(".or"))return`${e}${t}`;const[n,...r]=t.split(".");let o;return o=n?.startsWith("fts")?"textSearch":n?.startsWith("plfts")?"textSearch[plain]":n?.startsWith("phfts")?"textSearch[phrase]":n?.startsWith("wfts")?"textSearch[websearch]":n&&m[n]||"filter",`${o}(${e}, ${r.join(".")})`}function E(e,t=!1){return new Proxy(e,{apply:(n,r,o)=>(0,p.startSpan)({name:`auth ${t?"(admin) ":""}${e.name}`,attributes:{[a.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.db.supabase",[a.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"db","db.system":"postgresql","db.operation":`auth.${t?"admin.":""}${e.name}`}},e=>Reflect.apply(n,r,o).then(t=>(t&&"object"==typeof t&&"error"in t&&t.error?(e.setStatus({code:d.SPAN_STATUS_ERROR}),(0,s.captureException)(t.error,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}})):e.setStatus({code:d.SPAN_STATUS_OK}),e.end(),t)).catch(t=>{throw e.setStatus({code:d.SPAN_STATUS_ERROR}),e.end(),(0,s.captureException)(t,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}}),t}).then(...o))})}function v(e){y(e.prototype.from)||(e.prototype.from=new Proxy(e.prototype.from,{apply(e,t,n){const r=Reflect.apply(e,t,n);return function(e){for(const t of g)y(e.prototype[t])||(e.prototype[t]=new Proxy(e.prototype[t],{apply(e,n,r){const s=Reflect.apply(e,n,r),i=s.constructor;return o.DEBUG_BUILD&&c.debug.log(`Instrumenting ${t} operation's PostgRESTFilterBuilder`),T(i),s}}),_(e.prototype[t]))}(r.constructor),r}}),_(e.prototype.from))}function T(e){y(e.prototype.then)||(e.prototype.then=new Proxy(e.prototype.then,{apply(e,t,n){const o=g,i=t,c=S(i.method,i.headers);if(!o.includes(c))return Reflect.apply(e,t,n);if(!i?.url?.pathname||"string"!=typeof i.url.pathname)return Reflect.apply(e,t,n);const h=i.url.pathname.split("/"),f=h.length>0?h[h.length-1]:"",m=[];for(const[e,t]of i.url.searchParams.entries())m.push(b(e,t));const _=Object.create(null);if((0,u.isPlainObject)(i.body))for(const[e,t]of Object.entries(i.body))_[e]=t;const y=`${"select"===c?"":`${c}${_?"(...) ":""}`}${m.join(" ")} from(${f})`,E={"db.table":f,"db.schema":i.schema,"db.url":i.url.origin,"db.sdk":i.headers["X-Client-Info"],"db.system":"postgresql","db.operation":c,[a.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.db.supabase",[a.SEMANTIC_ATTRIBUTE_SENTRY_OP]:"db"};return m.length&&(E["db.query"]=m),Object.keys(_).length&&(E["db.body"]=_),(0,p.startSpan)({name:y,attributes:E},o=>Reflect.apply(e,t,[]).then(e=>{if(o&&(e&&"object"==typeof e&&"status"in e&&(0,d.setHttpStatus)(o,e.status||500),o.end()),e.error){const t=new Error(e.error.message);e.error.code&&(t.code=e.error.code),e.error.details&&(t.details=e.error.details);const n={};m.length&&(n.query=m),Object.keys(_).length&&(n.body=_),(0,s.captureException)(t,e=>(e.addEventProcessor(e=>((0,l.addExceptionMechanism)(e,{handled:!1,type:"auto.db.supabase.postgres"}),e)),e.setContext("supabase",n),e))}const t={type:"supabase",category:`db.${c}`,message:y},n={};return m.length&&(n.query=m),Object.keys(_).length&&(n.body=_),Object.keys(n).length&&(t.data=n),(0,r.addBreadcrumb)(t),e},e=>{throw o&&((0,d.setHttpStatus)(o,500),o.end()),e}).then(...n))}}),_(e.prototype.then))}const I=e=>{if(!e)return void(o.DEBUG_BUILD&&c.debug.warn("Supabase integration was not installed because no Supabase client was provided."));v(e.constructor===Function?e:e.constructor),function(e){const t=e.auth;if(t&&!y(e.auth)){for(const n of h){const r=t[n];r&&"function"==typeof e.auth[n]&&(e.auth[n]=E(r))}for(const n of f){const r=t.admin[n];r&&"function"==typeof e.auth.admin[n]&&(e.auth.admin[n]=E(r,!0))}_(e.auth)}}(e)},k=(0,i.defineIntegration)(e=>{return t=e.supabaseClient,{setupOnce(){I(t)},name:"Supabase"};var t})},367:(e,t,n)=>{n.r(t),n.d(t,{applyZodErrorsToEvent:()=>l,flattenIssue:()=>i,flattenIssuePath:()=>a,formatIssueMessage:()=>c,zodErrorsIntegration:()=>u});var r=n(229),o=n(222),s=n(224);function i(e){return{...e,path:"path"in e&&Array.isArray(e.path)?e.path.join("."):void 0,keys:"keys"in e?JSON.stringify(e.keys):void 0,unionErrors:"unionErrors"in e?JSON.stringify(e.unionErrors):void 0}}function a(e){return e.map(e=>"number"==typeof e?"<array>":e).join(".")}function c(e){const t=new Set;for(const n of e.issues){const e=a(n.path);e.length>0&&t.add(e)}const n=Array.from(t);if(0===n.length){let t="variable";if(e.issues.length>0){const n=e.issues[0];void 0!==n&&"expected"in n&&"string"==typeof n.expected&&(t=n.expected)}return`Failed to validate ${t}`}return`Failed to validate keys: ${(0,s.truncate)(n.join(", "),100)}`}function l(e,t=!1,n,r){if(!(n.exception?.values&&r.originalException&&(s=r.originalException,(0,o.isError)(s)&&"ZodError"===s.name&&Array.isArray(s.issues))&&0!==r.originalException.issues.length))return n;var s;try{const o=(t?r.originalException.issues:r.originalException.issues.slice(0,e)).map(i);return t&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({filename:"zod_issues.json",data:JSON.stringify({issues:o})})),{...n,exception:{...n.exception,values:[{...n.exception.values[0],value:c(r.originalException)},...n.exception.values.slice(1)]},extra:{...n.extra,"zoderror.issues":o.slice(0,e)}}}catch(e){return{...n,extra:{...n.extra,"zoderrors sentry integration parse error":{message:"an exception was thrown while processing ZodError within applyZodErrorsToEvent()",error:e instanceof Error?`${e.name}: ${e.message}\n${e.stack}`:"unknown"}}}}}const u=(0,r.defineIntegration)((e={})=>{const t=e.limit??10;return{name:"ZodErrors",processEvent:(n,r)=>l(t,e.saveZodIssuesAsAttachment,n,r)}})},368:(e,t,n)=>{n.r(t),n.d(t,{thirdPartyErrorFilterIntegration:()=>a});var r=n(229),o=n(361),s=n(250),i=n(234);const a=(0,r.defineIntegration)(e=>({name:"ThirdPartyErrorsFilter",setup(e){e.on("beforeEnvelope",e=>{(0,s.forEachEnvelopeItem)(e,(e,t)=>{if("event"===t){const t=Array.isArray(e)?e[1]:void 0;t&&((0,o.stripMetadataFromStackFrames)(t),e[1]=t)}})}),e.on("applyFrameMetadata",t=>{if(t.type)return;const n=e.getOptions().stackParser;(0,o.addMetadataToStackFrames)(n,t)})},processEvent(t){const n=function(e){const t=(0,i.getFramesFromEvent)(e);if(!t)return;return t.filter(e=>!!e.filename&&null!=(e.lineno??e.colno)).map(e=>e.module_metadata?Object.keys(e.module_metadata).filter(e=>e.startsWith(c)).map(e=>e.slice(c.length)):[])}(t);if(n){if(n["drop-error-if-contains-third-party-frames"===e.behaviour||"apply-tag-if-contains-third-party-frames"===e.behaviour?"some":"every"](t=>!t.some(t=>e.filterKeys.includes(t)))){if("drop-error-if-contains-third-party-frames"===e.behaviour||"drop-error-if-exclusively-contains-third-party-frames"===e.behaviour)return null;t.tags={...t.tags,third_party_code:!0}}}return t}}));const c="_sentryBundlerPluginAppKey:"},369:(e,t,n)=>{n.r(t),n.d(t,{featureFlagsIntegration:()=>s});var r=n(229),o=n(370);const s=(0,r.defineIntegration)(()=>({name:"FeatureFlags",processEvent:(e,t,n)=>(0,o._INTERNAL_copyFlagsFromScopeToEvent)(e),addFeatureFlag(e,t){(0,o._INTERNAL_insertFlagToScope)(e,t),(0,o._INTERNAL_addFeatureFlagToActiveSpan)(e,t)}}))},370:(e,t,n)=>{n.r(t),n.d(t,{_INTERNAL_FLAG_BUFFER_SIZE:()=>a,_INTERNAL_MAX_FLAGS_PER_SPAN:()=>c,_INTERNAL_addFeatureFlagToActiveSpan:()=>h,_INTERNAL_copyFlagsFromScopeToEvent:()=>u,_INTERNAL_insertFlagToScope:()=>d,_INTERNAL_insertToFlagBuffer:()=>p});var r=n(209),o=n(217),s=n(223),i=n(245);const a=100,c=10,l="flag.evaluation.";function u(e){const t=(0,r.getCurrentScope)().getScopeData().contexts.flags,n=t?t.values:[];return n.length?(void 0===e.contexts&&(e.contexts={}),e.contexts.flags={values:[...n]},e):e}function d(e,t,n=a){const o=(0,r.getCurrentScope)().getScopeData().contexts;o.flags||(o.flags={values:[]});p(o.flags.values,e,t,n)}function p(e,t,n,r){if("boolean"!=typeof n)return;if(e.length>r)return void(o.DEBUG_BUILD&&s.debug.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`));const i=e.findIndex(e=>e.flag===t);-1!==i&&e.splice(i,1),e.length===r&&e.shift(),e.push({flag:t,result:n})}function h(e,t,n=c){if("boolean"!=typeof t)return;const r=(0,i.getActiveSpan)();if(!r)return;const o=(0,i.spanToJSON)(r).data;if(`${l}${e}`in o)return void r.setAttribute(`${l}${e}`,t);Object.keys(o).filter(e=>e.startsWith(l)).length<n&&r.setAttribute(`${l}${e}`,t)}},371:(e,t,n)=>{n.r(t),n.d(t,{debug:()=>a,error:()=>u,fatal:()=>d,fmt:()=>o.fmt,info:()=>c,trace:()=>i,warn:()=>l});var r=n(253),o=n(359);function s(e,t,n,o,s){(0,r._INTERNAL_captureLog)({level:e,message:t,attributes:n,severityNumber:s},o)}function i(e,t,{scope:n}={}){s("trace",e,t,n)}function a(e,t,{scope:n}={}){s("debug",e,t,n)}function c(e,t,{scope:n}={}){s("info",e,t,n)}function l(e,t,{scope:n}={}){s("warn",e,t,n)}function u(e,t,{scope:n}={}){s("error",e,t,n)}function d(e,t,{scope:n}={}){s("fatal",e,t,n)}},372:(e,t,n)=>{n.r(t),n.d(t,{consoleLoggingIntegration:()=>p});var r=n(209),o=n(217),s=n(275),i=n(229),a=n(242),c=n(223),l=n(253),u=n(373);const d={[a.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.log.console"},p=(0,i.defineIntegration)((e={})=>{const t=e.levels||c.CONSOLE_LEVELS;return{name:"ConsoleLogs",setup(e){const{enableLogs:n,normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e.getOptions();n?(0,s.addConsoleInstrumentationHandler)(({args:n,level:o})=>{if((0,r.getClient)()!==e||!t.includes(o))return;const s=n[0],c=n.slice(1);if("assert"===o){if(!s){const e=c.length>0?`Assertion failed: ${(0,u.formatConsoleArgs)(c,i,a)}`:"Assertion failed";(0,l._INTERNAL_captureLog)({level:"error",message:e,attributes:d})}return}const p="log"===o,h=n.length>1&&"string"==typeof n[0]&&!(0,u.hasConsoleSubstitutions)(n[0]),f={...d,...h?(0,u.createConsoleTemplateAttributes)(s,c):{}};(0,l._INTERNAL_captureLog)({level:p?"info":o,message:(0,u.formatConsoleArgs)(n,i,a),severityNumber:p?10:void 0,attributes:f})}):o.DEBUG_BUILD&&c.debug.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled")}}})},373:(e,t,n)=>{n.r(t),n.d(t,{createConsoleTemplateAttributes:()=>l,formatConsoleArgs:()=>i,hasConsoleSubstitutions:()=>c,safeJoinConsoleArgs:()=>a});var r=n(222),o=n(251),s=n(213);function i(e,t,n){return"util"in s.GLOBAL_OBJ&&"function"==typeof s.GLOBAL_OBJ.util.format?s.GLOBAL_OBJ.util.format(...e):a(e,t,n)}function a(e,t,n){return e.map(e=>(0,r.isPrimitive)(e)?String(e):JSON.stringify((0,o.normalize)(e,t,n))).join(" ")}function c(e){return/%[sdifocO]/.test(e)}function l(e,t){const n={},r=new Array(t.length).fill("{}").join(" ");return n["sentry.message.template"]=`${e} ${r}`,t.forEach((e,t)=>{n[`sentry.message.parameter.${t}`]=e}),n}},374:(e,t,n)=>{n.r(t),n.d(t,{count:()=>s,distribution:()=>a,gauge:()=>i});var r=n(258);function o(e,t,n,o){(0,r._INTERNAL_captureMetric)({type:e,name:t,value:n,unit:o?.unit,attributes:o?.attributes},{scope:o?.scope})}function s(e,t=1,n){o("counter",e,t,n)}function i(e,t,n){o("gauge",e,t,n)}function a(e,t,n){o("distribution",e,t,n)}},375:(e,t,n)=>{n.r(t),n.d(t,{createConsolaReporter:()=>a});var r=n(209),o=n(253),s=n(373);const i=["trace","debug","info","warn","error","fatal"];function a(e={}){const t=new Set(e.levels??i),n=e.client;return{log(e){const{type:i,level:a,message:u,args:d,tag:p,date:h,...f}=e,m=n||(0,r.getClient)();if(!m)return;const g=function(e,t){if("verbose"===e)return"debug";if("silent"===e)return"trace";if(e){const t=c[e];if(t)return t}if("number"==typeof t){const e=l[t];if(e)return e}return"info"}(i,a);if(!t.has(g))return;const{normalizeDepth:_=3,normalizeMaxBreadth:y=1e3}=m.getOptions(),S=[];u&&S.push(u),d&&d.length>0&&S.push((0,s.formatConsoleArgs)(d,_,y));const b=S.join(" ");f["sentry.origin"]="auto.log.consola",p&&(f["consola.tag"]=p),i&&(f["consola.type"]=i),null!=a&&"number"==typeof a&&(f["consola.level"]=a),(0,o._INTERNAL_captureLog)({level:g,message:b,attributes:f})}}}const c={silent:"trace",fatal:"fatal",error:"error",warn:"warn",log:"info",info:"info",success:"info",fail:"error",ready:"info",start:"info",box:"info",debug:"debug",trace:"trace",verbose:"debug",critical:"fatal",notice:"info"},l={0:"fatal",1:"warn",2:"info",3:"info",4:"debug",5:"trace"}},376:(e,t,n)=>{n.r(t),n.d(t,{instrumentOpenAiClient:()=>_});var r=n(209),o=n(271),s=n(242),i=n(246),a=n(309),c=n(377),l=n(378),u=n(380),d=n(381),p=n(382);function h(e,t,n){if(!t||"object"!=typeof t)return;const r=t;if((0,p.isChatCompletionResponse)(r)){if(function(e,t,n){if((0,p.setCommonResponseAttributes)(e,t.id,t.model,t.created),t.usage&&(0,p.setTokenUsageAttributes)(e,t.usage.prompt_tokens,t.usage.completion_tokens,t.usage.total_tokens),Array.isArray(t.choices)){const r=t.choices.map(e=>e.finish_reason).filter(e=>null!==e);if(r.length>0&&e.setAttributes({[c.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE]:JSON.stringify(r)}),n){const n=t.choices.map(e=>e.message?.tool_calls).filter(e=>Array.isArray(e)&&e.length>0).flat();n.length>0&&e.setAttributes({[c.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]:JSON.stringify(n)})}}}(e,r,n),n&&r.choices?.length){const t=r.choices.map(e=>e.message?.content||"");e.setAttributes({[c.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]:JSON.stringify(t)})}}else(0,p.isResponsesApiResponse)(r)&&(!function(e,t,n){if((0,p.setCommonResponseAttributes)(e,t.id,t.model,t.created_at),t.status&&e.setAttributes({[c.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE]:JSON.stringify([t.status])}),t.usage&&(0,p.setTokenUsageAttributes)(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.total_tokens),n){const n=t;if(Array.isArray(n.output)&&n.output.length>0){const t=n.output.filter(e=>"object"==typeof e&&null!==e&&"function_call"===e.type);t.length>0&&e.setAttributes({[c.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]:JSON.stringify(t)})}}}(e,r,n),n&&r.output_text&&e.setAttributes({[c.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]:r.output_text}))}function f(e,t){if("messages"in t){const n=(0,l.getTruncatedJsonString)(t.messages);e.setAttributes({[c.GEN_AI_REQUEST_MESSAGES_ATTRIBUTE]:n})}if("input"in t){const n=(0,l.getTruncatedJsonString)(t.input);e.setAttributes({[c.GEN_AI_REQUEST_MESSAGES_ATTRIBUTE]:n})}}function m(e,t,n,l){return async function(...m){const g=l||function(){const e=(0,r.getCurrentScope)().getClient(),t=e?.getIntegrationByName(u.OPENAI_INTEGRATION_NAME),n=!!t&&Boolean(e?.getOptions().sendDefaultPii);return{recordInputs:t?.options?.recordInputs??n,recordOutputs:t?.options?.recordOutputs??n}}(),_=function(e,t){const n={[c.GEN_AI_SYSTEM_ATTRIBUTE]:"openai",[c.GEN_AI_OPERATION_NAME_ATTRIBUTE]:(0,p.getOperationName)(t),[s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.ai.openai"};if(e.length>0&&"object"==typeof e[0]&&null!==e[0]){const t=e[0],r=[...Array.isArray(t.tools)?t.tools:[],...t.web_search_options&&"object"==typeof t.web_search_options?[{type:"web_search_options",...t.web_search_options}]:[]];r.length>0&&(n[c.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE]=JSON.stringify(r))}if(e.length>0&&"object"==typeof e[0]&&null!==e[0]){const t=e[0];n[c.GEN_AI_REQUEST_MODEL_ATTRIBUTE]=t.model??"unknown","temperature"in t&&(n[c.GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE]=t.temperature),"top_p"in t&&(n[c.GEN_AI_REQUEST_TOP_P_ATTRIBUTE]=t.top_p),"frequency_penalty"in t&&(n[c.GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE]=t.frequency_penalty),"presence_penalty"in t&&(n[c.GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE]=t.presence_penalty),"stream"in t&&(n[c.GEN_AI_REQUEST_STREAM_ATTRIBUTE]=t.stream)}else n[c.GEN_AI_REQUEST_MODEL_ATTRIBUTE]="unknown";return n}(m,t),y=_[c.GEN_AI_REQUEST_MODEL_ATTRIBUTE]||"unknown",S=(0,p.getOperationName)(t),b=m[0];return b&&"object"==typeof b&&!0===b.stream?(0,a.startSpanManual)({name:`${S} ${y} stream-response`,op:(0,p.getSpanOperation)(t),attributes:_},async r=>{try{g.recordInputs&&m[0]&&"object"==typeof m[0]&&f(r,m[0]);const t=await e.apply(n,m);return(0,d.instrumentStream)(t,r,g.recordOutputs??!1)}catch(e){throw r.setStatus({code:i.SPAN_STATUS_ERROR,message:"internal_error"}),(0,o.captureException)(e,{mechanism:{handled:!1,type:"auto.ai.openai.stream",data:{function:t}}}),r.end(),e}}):(0,a.startSpan)({name:`${S} ${y}`,op:(0,p.getSpanOperation)(t),attributes:_},async r=>{try{g.recordInputs&&m[0]&&"object"==typeof m[0]&&f(r,m[0]);const t=await e.apply(n,m);return h(r,t,g.recordOutputs),t}catch(e){throw(0,o.captureException)(e,{mechanism:{handled:!1,type:"auto.ai.openai",data:{function:t}}}),e}})}}function g(e,t="",n){return new Proxy(e,{get(e,r){const o=e[r],s=(0,p.buildMethodPath)(t,String(r));return"function"==typeof o&&(0,p.shouldInstrument)(s)?m(o,s,e,n):"function"==typeof o?o.bind(e):o&&"object"==typeof o?g(o,s,n):o}})}function _(e,t){return g(e,"",t)}},377:(e,t,n)=>{n.r(t),n.d(t,{ANTHROPIC_AI_RESPONSE_TIMESTAMP_ATTRIBUTE:()=>P,GEN_AI_OPERATION_NAME_ATTRIBUTE:()=>b,GEN_AI_PROMPT_ATTRIBUTE:()=>r,GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE:()=>T,GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE:()=>l,GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE:()=>c,GEN_AI_REQUEST_MESSAGES_ATTRIBUTE:()=>E,GEN_AI_REQUEST_MODEL_ATTRIBUTE:()=>s,GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE:()=>u,GEN_AI_REQUEST_STREAM_ATTRIBUTE:()=>i,GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE:()=>a,GEN_AI_REQUEST_TOP_K_ATTRIBUTE:()=>p,GEN_AI_REQUEST_TOP_P_ATTRIBUTE:()=>d,GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE:()=>h,GEN_AI_RESPONSE_ID_ATTRIBUTE:()=>m,GEN_AI_RESPONSE_MODEL_ATTRIBUTE:()=>f,GEN_AI_RESPONSE_STOP_REASON_ATTRIBUTE:()=>g,GEN_AI_RESPONSE_STREAMING_ATTRIBUTE:()=>I,GEN_AI_RESPONSE_TEXT_ATTRIBUTE:()=>v,GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE:()=>k,GEN_AI_SYSTEM_ATTRIBUTE:()=>o,GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS_ATTRIBUTE:()=>w,GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS_ATTRIBUTE:()=>A,GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE:()=>_,GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE:()=>R,GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE_ATTRIBUTE:()=>C,GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE:()=>y,GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE:()=>S,OPENAI_OPERATIONS:()=>D,OPENAI_RESPONSE_ID_ATTRIBUTE:()=>x,OPENAI_RESPONSE_MODEL_ATTRIBUTE:()=>N,OPENAI_RESPONSE_TIMESTAMP_ATTRIBUTE:()=>O,OPENAI_USAGE_COMPLETION_TOKENS_ATTRIBUTE:()=>M,OPENAI_USAGE_PROMPT_TOKENS_ATTRIBUTE:()=>L});const r="gen_ai.prompt",o="gen_ai.system",s="gen_ai.request.model",i="gen_ai.request.stream",a="gen_ai.request.temperature",c="gen_ai.request.max_tokens",l="gen_ai.request.frequency_penalty",u="gen_ai.request.presence_penalty",d="gen_ai.request.top_p",p="gen_ai.request.top_k",h="gen_ai.response.finish_reasons",f="gen_ai.response.model",m="gen_ai.response.id",g="gen_ai.response.stop_reason",_="gen_ai.usage.input_tokens",y="gen_ai.usage.output_tokens",S="gen_ai.usage.total_tokens",b="gen_ai.operation.name",E="gen_ai.request.messages",v="gen_ai.response.text",T="gen_ai.request.available_tools",I="gen_ai.response.streaming",k="gen_ai.response.tool_calls",w="gen_ai.usage.cache_creation_input_tokens",A="gen_ai.usage.cache_read_input_tokens",C="gen_ai.usage.input_tokens.cache_write",R="gen_ai.usage.input_tokens.cached",x="openai.response.id",N="openai.response.model",O="openai.response.timestamp",M="openai.usage.completion_tokens",L="openai.usage.prompt_tokens",D={CHAT:"chat",RESPONSES:"responses"},P="anthropic.response.timestamp"},378:(e,t,n)=>{n.r(t),n.d(t,{buildMethodPath:()=>a,getFinalOperationName:()=>s,getSpanOperation:()=>i,getTruncatedJsonString:()=>l,setTokenUsageAttributes:()=>c});var r=n(377),o=n(379);function s(e){return e.includes("messages")?"messages":e.includes("completions")?"completions":e.includes("models")?"models":e.includes("chat")?"chat":e.split(".").pop()||"unknown"}function i(e){return`gen_ai.${s(e)}`}function a(e,t){return e?`${e}.${t}`:t}function c(e,t,n,o,s){if(void 0!==t&&e.setAttributes({[r.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]:t}),void 0!==n&&e.setAttributes({[r.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]:n}),void 0!==t||void 0!==n||void 0!==o||void 0!==s){const i=(t??0)+(n??0)+(o??0)+(s??0);e.setAttributes({[r.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE]:i})}}function l(e){if("string"==typeof e)return e;if(Array.isArray(e)){const t=(0,o.truncateGenAiMessages)(e);return JSON.stringify(t)}return JSON.stringify(e)}},379:(e,t,n)=>{n.r(t),n.d(t,{DEFAULT_GEN_AI_MESSAGES_BYTE_LIMIT:()=>r,truncateGenAiMessages:()=>d,truncateMessagesByBytes:()=>u});const r=2e4,o=e=>(new TextEncoder).encode(e).length,s=e=>o(JSON.stringify(e));function i(e,t){if(o(e)<=t)return e;let n=0,r=e.length,s="";for(;n<=r;){const i=Math.floor((n+r)/2),a=e.slice(0,i);o(a)<=t?(s=a,n=i+1):r=i-1}return s}function a(e){return"string"==typeof e?e:e.text}function c(e,t){return"string"==typeof e?t:{...e,text:t}}function l(e,t){return e&&"object"==typeof e?function(e){return null!==e&&"object"==typeof e&&"content"in e&&"string"==typeof e.content}(e)?function(e,t){const n={...e,content:""},r=t-s(n);if(r<=0)return[];const o=i(e.content,r);return[{...e,content:o}]}(e,t):function(e){return null!==e&&"object"==typeof e&&"parts"in e&&Array.isArray(e.parts)&&e.parts.length>0}(e)?function(e,t){const{parts:n}=e,r=n.map(e=>c(e,""));let l=t-s({...e,parts:r});if(l<=0)return[];const u=[];for(const e of n){const t=a(e),n=o(t);if(!(n<=l)){if(0===u.length){const n=i(t,l);n&&u.push(c(e,n));break}break}u.push(e),l-=n}return u.length>0?[{...e,parts:u}]:[]}(e,t):[]:[]}function u(e,t){if(!Array.isArray(e)||0===e.length)return e;if(s(e)<=t)return e;const n=e.map(s);let r=0,o=e.length;for(let s=e.length-1;s>=0;s--){const e=n[s];if(e&&r+e>t)break;e&&(r+=e),o=s}if(o===e.length){return l(e[e.length-1],t)}return e.slice(o)}function d(e){return u(e,r)}},380:(e,t,n)=>{n.r(t),n.d(t,{INSTRUMENTED_METHODS:()=>o,OPENAI_INTEGRATION_NAME:()=>r,RESPONSES_TOOL_CALL_EVENT_TYPES:()=>s,RESPONSE_EVENT_TYPES:()=>i});const r="OpenAI",o=["responses.create","chat.completions.create"],s=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],i=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...s]},381:(e,t,n)=>{n.r(t),n.d(t,{instrumentStream:()=>d});var r=n(271),o=n(246),s=n(377),i=n(380),a=n(382);function c(e,t){for(const n of e){const e=n.index;if(void 0!==e&&n.function)if(e in t.chatCompletionToolCalls){const r=t.chatCompletionToolCalls[e];n.function.arguments&&r?.function&&(r.function.arguments+=n.function.arguments)}else t.chatCompletionToolCalls[e]={...n,function:{name:n.function.name,arguments:n.function.arguments||""}}}}function l(e,t,n){t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,t.responseTimestamp=e.created??t.responseTimestamp,e.usage&&(t.promptTokens=e.usage.prompt_tokens,t.completionTokens=e.usage.completion_tokens,t.totalTokens=e.usage.total_tokens);for(const r of e.choices??[])n&&(r.delta?.content&&t.responseTexts.push(r.delta.content),r.delta?.tool_calls&&c(r.delta.tool_calls,t)),r.finish_reason&&t.finishReasons.push(r.finish_reason)}function u(e,t,n,s){if(!e||"object"!=typeof e)return void t.eventTypes.push("unknown:non-object");if(e instanceof Error)return s.setStatus({code:o.SPAN_STATUS_ERROR,message:"internal_error"}),void(0,r.captureException)(e,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});if(!("type"in e))return;const a=e;if(i.RESPONSE_EVENT_TYPES.includes(a.type)){if(n&&("response.output_item.done"===a.type&&"item"in a&&t.responsesApiToolCalls.push(a.item),"response.output_text.delta"===a.type&&"delta"in a&&a.delta))t.responseTexts.push(a.delta);else if("response"in a){const{response:e}=a;t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,t.responseTimestamp=e.created_at??t.responseTimestamp,e.usage&&(t.promptTokens=e.usage.input_tokens,t.completionTokens=e.usage.output_tokens,t.totalTokens=e.usage.total_tokens),e.status&&t.finishReasons.push(e.status),n&&e.output_text&&t.responseTexts.push(e.output_text)}}else t.eventTypes.push(a.type)}async function*d(e,t,n){const r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:"",responseModel:"",responseTimestamp:0,promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(const o of e)(0,a.isChatCompletionChunk)(o)?l(o,r,n):(0,a.isResponsesApiStreamEvent)(o)&&u(o,r,n,t),yield o}finally{(0,a.setCommonResponseAttributes)(t,r.responseId,r.responseModel,r.responseTimestamp),(0,a.setTokenUsageAttributes)(t,r.promptTokens,r.completionTokens,r.totalTokens),t.setAttributes({[s.GEN_AI_RESPONSE_STREAMING_ATTRIBUTE]:!0}),r.finishReasons.length&&t.setAttributes({[s.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE]:JSON.stringify(r.finishReasons)}),n&&r.responseTexts.length&&t.setAttributes({[s.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]:r.responseTexts.join("")});const e=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];e.length>0&&t.setAttributes({[s.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]:JSON.stringify(e)}),t.end()}}},382:(e,t,n)=>{n.r(t),n.d(t,{buildMethodPath:()=>c,getOperationName:()=>s,getSpanOperation:()=>i,isChatCompletionChunk:()=>p,isChatCompletionResponse:()=>l,isResponsesApiResponse:()=>u,isResponsesApiStreamEvent:()=>d,setCommonResponseAttributes:()=>f,setTokenUsageAttributes:()=>h,shouldInstrument:()=>a});var r=n(377),o=n(380);function s(e){return e.includes("chat.completions")?r.OPENAI_OPERATIONS.CHAT:e.includes("responses")?r.OPENAI_OPERATIONS.RESPONSES:e.split(".").pop()||"unknown"}function i(e){return`gen_ai.${s(e)}`}function a(e){return o.INSTRUMENTED_METHODS.includes(e)}function c(e,t){return e?`${e}.${t}`:t}function l(e){return null!==e&&"object"==typeof e&&"object"in e&&"chat.completion"===e.object}function u(e){return null!==e&&"object"==typeof e&&"object"in e&&"response"===e.object}function d(e){return null!==e&&"object"==typeof e&&"type"in e&&"string"==typeof e.type&&e.type.startsWith("response.")}function p(e){return null!==e&&"object"==typeof e&&"object"in e&&"chat.completion.chunk"===e.object}function h(e,t,n,o){void 0!==t&&e.setAttributes({[r.OPENAI_USAGE_PROMPT_TOKENS_ATTRIBUTE]:t,[r.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]:t}),void 0!==n&&e.setAttributes({[r.OPENAI_USAGE_COMPLETION_TOKENS_ATTRIBUTE]:n,[r.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]:n}),void 0!==o&&e.setAttributes({[r.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE]:o})}function f(e,t,n,o){e.setAttributes({[r.OPENAI_RESPONSE_ID_ATTRIBUTE]:t,[r.GEN_AI_RESPONSE_ID_ATTRIBUTE]:t}),e.setAttributes({[r.OPENAI_RESPONSE_MODEL_ATTRIBUTE]:n,[r.GEN_AI_RESPONSE_MODEL_ATTRIBUTE]:n}),e.setAttributes({[r.OPENAI_RESPONSE_TIMESTAMP_ATTRIBUTE]:new Date(1e3*o).toISOString()})}},383:(e,t,n)=>{n.r(t),n.d(t,{instrumentAnthropicAiClient:()=>y});var r=n(209),o=n(271),s=n(242),i=n(246),a=n(309),c=n(377),l=n(378),u=n(310),d=n(384),p=n(385);function h(e,t){if("messages"in t){const n=(0,l.getTruncatedJsonString)(t.messages);e.setAttributes({[c.GEN_AI_REQUEST_MESSAGES_ATTRIBUTE]:n})}if("input"in t){const n=(0,l.getTruncatedJsonString)(t.input);e.setAttributes({[c.GEN_AI_REQUEST_MESSAGES_ATTRIBUTE]:n})}"prompt"in t&&e.setAttributes({[c.GEN_AI_PROMPT_ATTRIBUTE]:JSON.stringify(t.prompt)})}function f(e,t,n){t&&"object"==typeof t&&("type"in t&&"error"===t.type?(0,p.handleResponseError)(e,t):(n&&function(e,t){if("content"in t&&Array.isArray(t.content)){e.setAttributes({[c.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]:t.content.map(e=>e.text).filter(e=>!!e).join("")});const n=[];for(const e of t.content)"tool_use"!==e.type&&"server_tool_use"!==e.type||n.push(e);n.length>0&&e.setAttributes({[c.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]:JSON.stringify(n)})}"completion"in t&&e.setAttributes({[c.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]:t.completion}),"input_tokens"in t&&e.setAttributes({[c.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]:JSON.stringify(t.input_tokens)})}(e,t),function(e,t){"id"in t&&"model"in t&&(e.setAttributes({[c.GEN_AI_RESPONSE_ID_ATTRIBUTE]:t.id,[c.GEN_AI_RESPONSE_MODEL_ATTRIBUTE]:t.model}),"created"in t&&"number"==typeof t.created&&e.setAttributes({[c.ANTHROPIC_AI_RESPONSE_TIMESTAMP_ATTRIBUTE]:new Date(1e3*t.created).toISOString()}),"created_at"in t&&"number"==typeof t.created_at&&e.setAttributes({[c.ANTHROPIC_AI_RESPONSE_TIMESTAMP_ATTRIBUTE]:new Date(1e3*t.created_at).toISOString()}),"usage"in t&&t.usage&&(0,l.setTokenUsageAttributes)(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}(e,t)))}function m(e,t,n){throw(0,o.captureException)(e,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:n}}}),t.isRecording()&&(t.setStatus({code:i.SPAN_STATUS_ERROR,message:"internal_error"}),t.end()),e}function g(e,t,n,r){return new Proxy(e,{apply(i,p,g){const _=function(e,t){const n={[c.GEN_AI_SYSTEM_ATTRIBUTE]:"anthropic",[c.GEN_AI_OPERATION_NAME_ATTRIBUTE]:(0,l.getFinalOperationName)(t),[s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.ai.anthropic"};if(e.length>0&&"object"==typeof e[0]&&null!==e[0]){const t=e[0];t.tools&&Array.isArray(t.tools)&&(n[c.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE]=JSON.stringify(t.tools)),n[c.GEN_AI_REQUEST_MODEL_ATTRIBUTE]=t.model??"unknown","temperature"in t&&(n[c.GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE]=t.temperature),"top_p"in t&&(n[c.GEN_AI_REQUEST_TOP_P_ATTRIBUTE]=t.top_p),"stream"in t&&(n[c.GEN_AI_REQUEST_STREAM_ATTRIBUTE]=t.stream),"top_k"in t&&(n[c.GEN_AI_REQUEST_TOP_K_ATTRIBUTE]=t.top_k),"frequency_penalty"in t&&(n[c.GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE]=t.frequency_penalty),"max_tokens"in t&&(n[c.GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE]=t.max_tokens)}else n[c.GEN_AI_REQUEST_MODEL_ATTRIBUTE]="models.retrieve"===t||"models.get"===t?e[0]:"unknown";return n}(g,t),y=_[c.GEN_AI_REQUEST_MODEL_ATTRIBUTE]??"unknown",S=(0,l.getFinalOperationName)(t),b="object"==typeof g[0]?g[0]:void 0,E=Boolean(b?.stream),v="messages.stream"===t;return E||v?function(e,t,n,r,o,s,i,u,p,f,g){const _={name:`${s} ${o[c.GEN_AI_REQUEST_MODEL_ATTRIBUTE]??"unknown"} stream-response`,op:(0,l.getSpanOperation)(i),attributes:o};return f&&!g?(0,a.startSpanManual)(_,async t=>{try{p.recordInputs&&u&&h(t,u);const o=await e.apply(n,r);return(0,d.instrumentAsyncIterableStream)(o,t,p.recordOutputs??!1)}catch(e){return m(e,t,i)}}):(0,a.startSpanManual)(_,e=>{try{p.recordInputs&&u&&h(e,u);const o=t.apply(n,r);return(0,d.instrumentMessageStream)(o,e,p.recordOutputs??!1)}catch(t){return m(t,e,i)}})}(e,i,n,g,_,S,t,b,r,E,v):(0,a.startSpan)({name:`${S} ${y}`,op:(0,l.getSpanOperation)(t),attributes:_},e=>(r.recordInputs&&b&&h(e,b),(0,u.handleCallbackErrors)(()=>i.apply(n,g),e=>{(0,o.captureException)(e,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:t}}})},()=>{},t=>f(e,t,r.recordOutputs))))}})}function _(e,t="",n){return new Proxy(e,{get(e,r){const o=e[r],s=(0,l.buildMethodPath)(t,String(r));return"function"==typeof o&&(0,p.shouldInstrument)(s)?g(o,s,e,n):"function"==typeof o?o.bind(e):o&&"object"==typeof o?_(o,s,n):o}})}function y(e,t){const n=Boolean((0,r.getClient)()?.getOptions().sendDefaultPii);return _(e,"",{recordInputs:n,recordOutputs:n,...t})}},384:(e,t,n)=>{n.r(t),n.d(t,{instrumentAsyncIterableStream:()=>c,instrumentMessageStream:()=>l});var r=n(271),o=n(246),s=n(377),i=n(378);function a(e,t,n,s){if(!e||"object"!=typeof e)return;const i=function(e,t){return"type"in e&&"string"==typeof e.type&&"error"===e.type&&(t.setStatus({code:o.SPAN_STATUS_ERROR,message:e.error?.type??"unknown_error"}),(0,r.captureException)(e.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}),!0)}(e,s);i||(function(e,t){if("message_delta"===e.type&&e.usage&&"output_tokens"in e.usage&&"number"==typeof e.usage.output_tokens&&(t.completionTokens=e.usage.output_tokens),e.message){const n=e.message;n.id&&(t.responseId=n.id),n.model&&(t.responseModel=n.model),n.stop_reason&&t.finishReasons.push(n.stop_reason),n.usage&&("number"==typeof n.usage.input_tokens&&(t.promptTokens=n.usage.input_tokens),"number"==typeof n.usage.cache_creation_input_tokens&&(t.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),"number"==typeof n.usage.cache_read_input_tokens&&(t.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}(e,t),function(e,t){"content_block_start"===e.type&&"number"==typeof e.index&&e.content_block&&("tool_use"!==e.content_block.type&&"server_tool_use"!==e.content_block.type||(t.activeToolBlocks[e.index]={id:e.content_block.id,name:e.content_block.name,inputJsonParts:[]}))}(e,t),function(e,t,n){if("content_block_delta"===e.type&&e.delta){if("number"==typeof e.index&&"partial_json"in e.delta&&"string"==typeof e.delta.partial_json){const n=t.activeToolBlocks[e.index];n&&n.inputJsonParts.push(e.delta.partial_json)}n&&"string"==typeof e.delta.text&&t.responseTexts.push(e.delta.text)}}(e,t,n),function(e,t){if("content_block_stop"!==e.type||"number"!=typeof e.index)return;const n=t.activeToolBlocks[e.index];if(!n)return;const r=n.inputJsonParts.join("");let o;try{o=r?JSON.parse(r):{}}catch{o={__unparsed:r}}t.toolCalls.push({type:"tool_use",id:n.id,name:n.name,input:o}),delete t.activeToolBlocks[e.index]}(e,t))}async function*c(e,t,n){const r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(const o of e)a(o,r,n,t),yield o}finally{r.responseId&&t.setAttributes({[s.GEN_AI_RESPONSE_ID_ATTRIBUTE]:r.responseId}),r.responseModel&&t.setAttributes({[s.GEN_AI_RESPONSE_MODEL_ATTRIBUTE]:r.responseModel}),(0,i.setTokenUsageAttributes)(t,r.promptTokens,r.completionTokens,r.cacheCreationInputTokens,r.cacheReadInputTokens),t.setAttributes({[s.GEN_AI_RESPONSE_STREAMING_ATTRIBUTE]:!0}),r.finishReasons.length>0&&t.setAttributes({[s.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE]:JSON.stringify(r.finishReasons)}),n&&r.responseTexts.length>0&&t.setAttributes({[s.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]:r.responseTexts.join("")}),n&&r.toolCalls.length>0&&t.setAttributes({[s.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]:JSON.stringify(r.toolCalls)}),t.end()}}function l(e,t,n){const c={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on("streamEvent",e=>{a(e,c,n,t)}),e.on("message",()=>{!function(e,t,n){t.isRecording()&&(e.responseId&&t.setAttributes({[s.GEN_AI_RESPONSE_ID_ATTRIBUTE]:e.responseId}),e.responseModel&&t.setAttributes({[s.GEN_AI_RESPONSE_MODEL_ATTRIBUTE]:e.responseModel}),(0,i.setTokenUsageAttributes)(t,e.promptTokens,e.completionTokens,e.cacheCreationInputTokens,e.cacheReadInputTokens),t.setAttributes({[s.GEN_AI_RESPONSE_STREAMING_ATTRIBUTE]:!0}),e.finishReasons.length>0&&t.setAttributes({[s.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE]:JSON.stringify(e.finishReasons)}),n&&e.responseTexts.length>0&&t.setAttributes({[s.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]:e.responseTexts.join("")}),n&&e.toolCalls.length>0&&t.setAttributes({[s.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]:JSON.stringify(e.toolCalls)}),t.end())}(c,t,n)}),e.on("error",e=>{(0,r.captureException)(e,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),t.isRecording()&&(t.setStatus({code:o.SPAN_STATUS_ERROR,message:"stream_error"}),t.end())}),e}},385:(e,t,n)=>{n.r(t),n.d(t,{handleResponseError:()=>a,shouldInstrument:()=>i});var r=n(271),o=n(246),s=n(386);function i(e){return s.ANTHROPIC_AI_INSTRUMENTED_METHODS.includes(e)}function a(e,t){t.error&&(e.setStatus({code:o.SPAN_STATUS_ERROR,message:t.error.type||"unknown_error"}),(0,r.captureException)(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}},386:(e,t,n)=>{n.r(t),n.d(t,{ANTHROPIC_AI_INSTRUMENTED_METHODS:()=>o,ANTHROPIC_AI_INTEGRATION_NAME:()=>r});const r="Anthropic_AI",o=["messages.create","messages.stream","messages.countTokens","models.get","completions.create","models.retrieve","beta.messages.create"]},387:(e,t,n)=>{n.r(t),n.d(t,{extractModel:()=>f,instrumentGoogleGenAIClient:()=>S});var r=n(209),o=n(271),s=n(242),i=n(246),a=n(309),c=n(377),l=n(378),u=n(310),d=n(388),p=n(389),h=n(390);function f(e,t){if("model"in e&&"string"==typeof e.model)return e.model;if(t&&"object"==typeof t){const e=t;if("model"in e&&"string"==typeof e.model)return e.model;if("modelVersion"in e&&"string"==typeof e.modelVersion)return e.modelVersion}return"unknown"}function m(e,t,n){const r={[c.GEN_AI_SYSTEM_ATTRIBUTE]:d.GOOGLE_GENAI_SYSTEM_NAME,[c.GEN_AI_OPERATION_NAME_ATTRIBUTE]:(0,l.getFinalOperationName)(e),[s.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:"auto.ai.google_genai"};if(t){if(r[c.GEN_AI_REQUEST_MODEL_ATTRIBUTE]=f(t,n),"config"in t&&"object"==typeof t.config&&t.config){const e=t.config;if(Object.assign(r,function(e){const t={};return"temperature"in e&&"number"==typeof e.temperature&&(t[c.GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE]=e.temperature),"topP"in e&&"number"==typeof e.topP&&(t[c.GEN_AI_REQUEST_TOP_P_ATTRIBUTE]=e.topP),"topK"in e&&"number"==typeof e.topK&&(t[c.GEN_AI_REQUEST_TOP_K_ATTRIBUTE]=e.topK),"maxOutputTokens"in e&&"number"==typeof e.maxOutputTokens&&(t[c.GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE]=e.maxOutputTokens),"frequencyPenalty"in e&&"number"==typeof e.frequencyPenalty&&(t[c.GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE]=e.frequencyPenalty),"presencePenalty"in e&&"number"==typeof e.presencePenalty&&(t[c.GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE]=e.presencePenalty),t}(e)),"tools"in e&&Array.isArray(e.tools)){const t=e.tools.map(e=>e.functionDeclarations);r[c.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE]=JSON.stringify(t)}}}else r[c.GEN_AI_REQUEST_MODEL_ATTRIBUTE]=f({},n);return r}function g(e,t){if("contents"in t){const n=t.contents,r=(0,l.getTruncatedJsonString)(n);e.setAttributes({[c.GEN_AI_REQUEST_MESSAGES_ATTRIBUTE]:r})}if("message"in t){const n=t.message,r=(0,l.getTruncatedJsonString)(n);e.setAttributes({[c.GEN_AI_REQUEST_MESSAGES_ATTRIBUTE]:r})}if("history"in t){const n=t.history,r=(0,l.getTruncatedJsonString)(n);e.setAttributes({[c.GEN_AI_REQUEST_MESSAGES_ATTRIBUTE]:r})}}function _(e,t,n,r){const s=t===d.CHATS_CREATE_METHOD;return new Proxy(e,{apply(e,d,f){const _=f[0],y=m(t,_,n),S=y[c.GEN_AI_REQUEST_MODEL_ATTRIBUTE]??"unknown",b=(0,l.getFinalOperationName)(t);return(0,h.isStreamingMethod)(t)?(0,a.startSpanManual)({name:`${b} ${S} stream-response`,op:(0,l.getSpanOperation)(t),attributes:y},async s=>{try{r.recordInputs&&_&&g(s,_);const t=await e.apply(n,f);return(0,p.instrumentStream)(t,s,Boolean(r.recordOutputs))}catch(e){throw s.setStatus({code:i.SPAN_STATUS_ERROR,message:"internal_error"}),(0,o.captureException)(e,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}}),s.end(),e}}):(0,a.startSpan)({name:s?`${b} ${S} create`:`${b} ${S}`,op:(0,l.getSpanOperation)(t),attributes:y},i=>(r.recordInputs&&_&&g(i,_),(0,u.handleCallbackErrors)(()=>e.apply(n,f),e=>{(0,o.captureException)(e,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}})},()=>{},e=>{s||function(e,t,n){if(t&&"object"==typeof t){if(t.usageMetadata&&"object"==typeof t.usageMetadata){const n=t.usageMetadata;"number"==typeof n.promptTokenCount&&e.setAttributes({[c.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]:n.promptTokenCount}),"number"==typeof n.candidatesTokenCount&&e.setAttributes({[c.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]:n.candidatesTokenCount}),"number"==typeof n.totalTokenCount&&e.setAttributes({[c.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE]:n.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){const n=t.candidates.map(e=>e.content?.parts&&Array.isArray(e.content.parts)?e.content.parts.map(e=>"string"==typeof e.text?e.text:"").filter(e=>e.length>0).join(""):"").filter(e=>e.length>0);n.length>0&&e.setAttributes({[c.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]:n.join("")})}if(n&&t.functionCalls){const n=t.functionCalls;Array.isArray(n)&&n.length>0&&e.setAttributes({[c.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]:JSON.stringify(n)})}}}(i,e,r.recordOutputs)})))}})}function y(e,t="",n){return new Proxy(e,{get:(e,r,o)=>{const s=Reflect.get(e,r,o),i=(0,l.buildMethodPath)(t,String(r));if("function"==typeof s&&(0,h.shouldInstrument)(i)){if(i===d.CHATS_CREATE_METHOD){const t=_(s,i,e,n);return function(...e){const r=t(...e);return r&&"object"==typeof r?y(r,d.CHAT_PATH,n):r}}return _(s,i,e,n)}return"function"==typeof s?s.bind(e):s&&"object"==typeof s?y(s,i,n):s}})}function S(e,t){const n=Boolean((0,r.getClient)()?.getOptions().sendDefaultPii);return y(e,"",{recordInputs:n,recordOutputs:n,...t})}},388:(e,t,n)=>{n.r(t),n.d(t,{CHATS_CREATE_METHOD:()=>i,CHAT_PATH:()=>a,GOOGLE_GENAI_INSTRUMENTED_METHODS:()=>o,GOOGLE_GENAI_INTEGRATION_NAME:()=>r,GOOGLE_GENAI_SYSTEM_NAME:()=>s});const r="Google_GenAI",o=["models.generateContent","models.generateContentStream","chats.create","sendMessage","sendMessageStream"],s="google_genai",i="chats.create",a="chat"},389:(e,t,n)=>{n.r(t),n.d(t,{instrumentStream:()=>a});var r=n(271),o=n(246),s=n(377);function i(e,t,n,s){e&&!function(e,t){const n=e?.promptFeedback;if(n?.blockReason){const e=n.blockReasonMessage??n.blockReason;return t.setStatus({code:o.SPAN_STATUS_ERROR,message:`Content blocked: ${e}`}),(0,r.captureException)(`Content blocked: ${e}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}(e,s)&&(function(e,t){"string"==typeof e.responseId&&(t.responseId=e.responseId),"string"==typeof e.modelVersion&&(t.responseModel=e.modelVersion);const n=e.usageMetadata;n&&("number"==typeof n.promptTokenCount&&(t.promptTokens=n.promptTokenCount),"number"==typeof n.candidatesTokenCount&&(t.completionTokens=n.candidatesTokenCount),"number"==typeof n.totalTokenCount&&(t.totalTokens=n.totalTokenCount))}(e,t),function(e,t,n){Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(const r of e.candidates??[]){r?.finishReason&&!t.finishReasons.includes(r.finishReason)&&t.finishReasons.push(r.finishReason);for(const e of r?.content?.parts??[])n&&e.text&&t.responseTexts.push(e.text),e.functionCall&&t.toolCalls.push({type:"function",id:e.functionCall.id,name:e.functionCall.name,arguments:e.functionCall.args})}}(e,t,n))}async function*a(e,t,n){const r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(const o of e)i(o,r,n,t),yield o}finally{const e={[s.GEN_AI_RESPONSE_STREAMING_ATTRIBUTE]:!0};r.responseId&&(e[s.GEN_AI_RESPONSE_ID_ATTRIBUTE]=r.responseId),r.responseModel&&(e[s.GEN_AI_RESPONSE_MODEL_ATTRIBUTE]=r.responseModel),void 0!==r.promptTokens&&(e[s.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]=r.promptTokens),void 0!==r.completionTokens&&(e[s.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]=r.completionTokens),void 0!==r.totalTokens&&(e[s.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE]=r.totalTokens),r.finishReasons.length&&(e[s.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE]=JSON.stringify(r.finishReasons)),n&&r.responseTexts.length&&(e[s.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]=r.responseTexts.join("")),n&&r.toolCalls.length&&(e[s.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]=JSON.stringify(r.toolCalls)),t.setAttributes(e),t.end()}}},390:(e,t,n)=>{n.r(t),n.d(t,{isStreamingMethod:()=>s,shouldInstrument:()=>o});var r=n(388);function o(e){if(r.GOOGLE_GENAI_INSTRUMENTED_METHODS.includes(e))return!0;const t=e.split(".").pop();return r.GOOGLE_GENAI_INSTRUMENTED_METHODS.includes(t)}function s(e){return e.includes("Stream")||e.endsWith("generateContentStream")||e.endsWith("sendMessageStream")}},391:(e,t,n)=>{n.r(t),n.d(t,{createUserFeedbackEnvelope:()=>s});var r=n(238),o=n(250);function s(e,{metadata:t,tunnel:n,dsn:s}){const i={event_id:e.event_id,sent_at:(new Date).toISOString(),...t?.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!s&&{dsn:(0,r.dsnToString)(s)}},a=function(e){return[{type:"user_report"},e]}(e);return(0,o.createEnvelope)(i,[a])}},392:(e,t,n)=>{n.r(t),n.d(t,{showReportDialog:()=>l});var r=n(271),o=n(209),s=n(237),i=n(223),a=n(285),c=n(270);function l(e={}){const t=c.WINDOW.document,n=t?.head||t?.body;if(!n)return void(a.DEBUG_BUILD&&i.debug.error("[showReportDialog] Global document not defined"));const l=(0,o.getCurrentScope)(),u=(0,o.getClient)(),d=u?.getDsn();if(!d)return void(a.DEBUG_BUILD&&i.debug.error("[showReportDialog] DSN not configured"));const p={...e,user:{...l.getUser(),...e.user},eventId:e.eventId||(0,r.lastEventId)()},h=c.WINDOW.document.createElement("script");h.async=!0,h.crossOrigin="anonymous",h.src=(0,s.getReportDialogEndpoint)(d,p);const{onLoad:f,onClose:m}=p;if(f&&(h.onload=f),m){const e=t=>{if("__sentry_reportdialog_closed__"===t.data)try{m()}finally{c.WINDOW.removeEventListener("message",e)}};c.WINDOW.addEventListener("message",e)}n.appendChild(h)}},393:(e,t,n)=>{n.r(t),n.d(t,{reportingObserverIntegration:()=>u});var r=n(271),o=n(209),s=n(229),i=n(213),a=n(278);const c=i.GLOBAL_OBJ,l=new WeakMap,u=(0,s.defineIntegration)((e={})=>{const t=e.types||["crash","deprecation","intervention"];function n(e){if(l.has((0,o.getClient)()))for(const t of e)(0,o.withScope)(e=>{e.setExtra("url",t.url);const n=`ReportingObserver [${t.type}]`;let o="No details available";if(t.body){const n={};for(const e in t.body)n[e]=t.body[e];if(e.setExtra("body",n),"crash"===t.type){const e=t.body;o=[e.crashId||"",e.reason||""].join(" ").trim()||o}else{o=t.body.message||o}}(0,r.captureMessage)(`${n}: ${o}`)})}return{name:"ReportingObserver",setupOnce(){if(!(0,a.supportsReportingObserver)())return;new c.ReportingObserver(n,{buffered:!0,types:t}).observe()},setup(e){l.set(e,!0)}}})},394:(e,t,n)=>{n.r(t),n.d(t,{httpClientIntegration:()=>f});var r=n(271),o=n(209),s=n(229),i=n(395),a=n(213),c=n(277),l=n(223),u=n(219),d=n(278),p=n(284),h=n(285);const f=(0,s.defineIntegration)((e={})=>{const t={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...e};return{name:"HttpClient",setup(e){!function(e,t){if(!(0,d.supportsNativeFetch)())return;(0,c.addFetchInstrumentationHandler)(n=>{if((0,o.getClient)()!==e)return;const{response:s,args:i,error:a,virtualError:c}=n,[l,u]=i;s&&function(e,t,n,o,s){if(y(e,n.status,n.url)){const e=function(e,t){if(!t&&e instanceof Request)return e;if(e instanceof Request&&e.bodyUsed)return e;return new Request(e,t)}(t,o);let i,a,c,l;b()&&([i,c]=m("Cookie",e),[a,l]=m("Set-Cookie",n));const u=S({url:e.url,method:e.method,status:n.status,requestHeaders:i,responseHeaders:a,requestCookies:c,responseCookies:l,error:s,type:"fetch"});(0,r.captureEvent)(u)}}(t,l,s,u,a||c)},!1)}(e,t),function(e,t){if(!("XMLHttpRequest"in a.GLOBAL_OBJ))return;(0,p.addXhrInstrumentationHandler)(n=>{if((0,o.getClient)()!==e)return;const{error:s,virtualError:i}=n,a=n.xhr,c=a[p.SENTRY_XHR_DATA_KEY];if(!c)return;const{method:u,request_headers:d}=c;try{!function(e,t,n,o,s){if(y(e,t.status,t.responseURL)){let e,i,a;if(b()){try{const e=t.getResponseHeader("Set-Cookie")||t.getResponseHeader("set-cookie")||void 0;e&&(i=_(e))}catch{}try{a=function(e){const t=e.getAllResponseHeaders();if(!t)return{};return t.split("\r\n").reduce((e,t)=>{const[n,r]=t.split(": ");return n&&r&&(e[n]=r),e},{})}(t)}catch{}e=o}const c=S({url:t.responseURL,method:n,status:t.status,requestHeaders:e,responseHeaders:a,responseCookies:i,error:s,type:"xhr"});(0,r.captureEvent)(c)}}(t,a,u,d,s||i)}catch(e){h.DEBUG_BUILD&&l.debug.warn("Error while extracting response event form XHR response",e)}})}(e,t)}}});function m(e,t){const n=function(e){const t={};return e.forEach((e,n)=>{t[n]=e}),t}(t.headers);let r;try{const t=n[e]||n[e.toLowerCase()]||void 0;t&&(r=_(t))}catch{}return[n,r]}function g(e){if(e){const t=e["Content-Length"]||e["content-length"];if(t)return parseInt(t,10)}}function _(e){return e.split("; ").reduce((e,t)=>{const[n,r]=t.split("=");return n&&r&&(e[n]=r),e},{})}function y(e,t,n){return function(e,t){return e.some(e=>"number"==typeof e?e===t:t>=e[0]&&t<=e[1])}(e.failedRequestStatusCodes,t)&&(r=e.failedRequestTargets,s=n,r.some(e=>"string"==typeof e?s.includes(e):e.test(s)))&&!(0,i.isSentryRequestUrl)(n,(0,o.getClient)());var r,s}function S(e){const t=(0,o.getClient)(),n=t&&e.error&&e.error instanceof Error?e.error.stack:void 0,r=n&&t?t.getOptions().stackParser(n,0,1):void 0,s=`HTTP Client Error with status code: ${e.status}`,i={message:s,exception:{values:[{type:"Error",value:s,stacktrace:r?{frames:r}:void 0}]},request:{url:e.url,method:e.method,headers:e.requestHeaders,cookies:e.requestCookies},contexts:{response:{status_code:e.status,headers:e.responseHeaders,cookies:e.responseCookies,body_size:g(e.responseHeaders)}}};return(0,u.addExceptionMechanism)(i,{type:`auto.http.client.${e.type}`,handled:!1}),i}function b(){const e=(0,o.getClient)();return!!e&&Boolean(e.getOptions().sendDefaultPii)}},395:(e,t,n)=>{n.r(t),n.d(t,{isSentryRequestUrl:()=>o});var r=n(280);function o(e,t){const n=t?.getDsn(),o=t?.getOptions().tunnel;return function(e,t){const n=(0,r.parseStringToURLObject)(e);if(!n||(0,r.isURLObjectRelative)(n))return!1;return!!t&&(n.host.includes(t.host)&&/(^|&|\?)sentry_key=/.test(n.search))}(e,n)||function(e,t){if(!t)return!1;return s(e)===s(t)}(e,o)}function s(e){return"/"===e[e.length-1]?e.slice(0,-1):e}},396:(e,t,n)=>{n.r(t),n.d(t,{applySourceContextToFrame:()=>l,contextLinesIntegration:()=>c});var r=n(229),o=n(213),s=n(219),i=n(280);const a=o.GLOBAL_OBJ,c=(0,r.defineIntegration)((e={})=>{const t=null!=e.frameContextLines?e.frameContextLines:7;return{name:"ContextLines",processEvent:e=>function(e,t){const n=a.document,r=a.location&&(0,i.stripUrlQueryAndFragment)(a.location.href);if(!n||!r)return e;const o=e.exception?.values;if(!o?.length)return e;const s=n.documentElement.innerHTML;if(!s)return e;const c=["<!DOCTYPE html>","<html>",...s.split("\n"),"</html>"];return o.forEach(e=>{const n=e.stacktrace;n?.frames&&(n.frames=n.frames.map(e=>l(e,c,r,t)))}),e}(e,t)}});function l(e,t,n,r){return e.filename===n&&e.lineno&&t.length?((0,s.addContextToFrame)(t,e,r),e):e}},397:(e,t,n)=>{n.r(t),n.d(t,{getGraphQLRequestPayload:()=>h,getRequestPayloadXhrOrFetch:()=>d,graphqlClientIntegration:()=>f,parseGraphQLQuery:()=>p});var r=n(242),o=n(229),s=n(245),i=n(222),a=n(224),c=n(284),l=n(346);function u(e){const{query:t,operationName:n}=e,{operationName:r=n,operationType:o}=p(t);return r?`${o} ${r}`:`${o}`}function d(e){let t;if("xhr"in e){const n=e.xhr[c.SENTRY_XHR_DATA_KEY];t=n&&(0,l.getBodyString)(n.body)[0]}else{const n=(0,l.getFetchRequestArgBody)(e.input);t=(0,l.getBodyString)(n)[0]}return t}function p(e){const t=e.match(/^(?:\s*)(query|mutation|subscription)(?:\s*)(\w+)(?:\s*)[{(]/);if(t)return{operationType:t[1],operationName:t[2]};const n=e.match(/^(?:\s*)(query|mutation|subscription)(?:\s*)[{(]/);return n?{operationType:n[1],operationName:void 0}:{operationType:void 0,operationName:void 0}}function h(e){let t;try{const n=JSON.parse(e);!!n.query&&(t=n)}finally{return t}}const f=(0,o.defineIntegration)(e=>({name:"GraphQLClient",setup(t){!function(e,t){e.on("beforeOutgoingRequestSpan",(e,n)=>{const o=(0,s.spanToJSON)(e).data||{};if(!("http.client"===o[r.SEMANTIC_ATTRIBUTE_SENTRY_OP]))return;const c=o[r.SEMANTIC_ATTRIBUTE_URL_FULL]||o["http.url"],l=o[r.SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD]||o["http.method"];if(!(0,i.isString)(c)||!(0,i.isString)(l))return;const{endpoints:p}=t,f=(0,a.stringMatchesSomePattern)(c,p),m=d(n);if(f&&m){const t=h(m);if(t){const n=u(t);e.updateName(`${l} ${c} (${n})`),e.setAttribute("graphql.document",m)}}})}(t,e),function(e,t){e.on("beforeOutgoingRequestBreadcrumb",(e,n)=>{const{category:r,type:o,data:s}=e;if("http"===o&&("fetch"===r||"xhr"===r)){const e=s?.url,{endpoints:r}=t,o=(0,a.stringMatchesSomePattern)(e,r),i=d(n);if(o&&s&&i){const e=h(i);if(!s.graphql&&e){const t=u(e);s["graphql.document"]=e.query,s["graphql.operation"]=t}}}})}(t,e)}}))},398:(e,t,n)=>{n.r(t),n.d(t,{getReplay:()=>Pr,replayIntegration:()=>Mr});var r=n(241),o=n(242),s=n(271),i=n(209),a=n(261),c=n(395),l=n(245),u=n(249),d=n(399),p=n(273),h=n(221),f=n(213),m=n(354),g=n(223),_=n(219),y=n(251),S=n(220),b=n(279),E=n(224),v=n(225),T=n(250),I=n(298),k=n(314),w=n(281),A=n(283),C=n(299),R=n(284),x=n(346);const N=f.GLOBAL_OBJ,O="sentryReplaySession",M="Unable to send Replay",L=15e4,D=5e3,P=2e7,U=36e5;var B=Object.defineProperty,F=(e,t,n)=>((e,t,n)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),G=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(G||{});function H(e){const t=e?.host;return Boolean(t?.shadowRoot===e)}function W(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function z(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n,j).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function j(e){let t;if(function(e){return"styleSheet"in e}(e))try{t=z(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)){let t=e.cssText;const n=e.selectorText.includes(":"),r="string"==typeof e.style.all&&e.style.all;if(r&&(t=function(e){let t="";for(let n=0;n<e.style.length;n++){const r=e.style,o=r[n],s=r.getPropertyPriority(o);t+=`${o}:${r.getPropertyValue(o)}${s?" !important":""};`}return`${e.selectorText} { ${t} }`}(e)),n&&(t=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(t)),n||r)return t}return t||e.cssText}class ${constructor(){F(this,"idNodeMap",new Map),F(this,"nodeMetaMap",new WeakMap)}getId(e){if(!e)return-1;const t=this.getMeta(e)?.id;return t??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function q({maskInputOptions:e,tagName:t,type:n}){return"OPTION"===t&&(t="SELECT"),Boolean(e[t.toLowerCase()]||n&&e[n]||"password"===n||"INPUT"===t&&!n&&e.text)}function J({isMasked:e,element:t,value:n,maskInputFn:r}){let o=n||"";return e?(r&&(o=r(o,t)),"*".repeat(o.length)):o}function V(e){return e.toLowerCase()}function K(e){return e.toUpperCase()}const Y="__rrweb_original__";function Q(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?V(t):null}function X(e,t,n){return"INPUT"!==t||"radio"!==n&&"checkbox"!==n?e.value:e.getAttribute("value")||""}function Z(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(e){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return r?.[1]??null}const ee={};function te(e){const t=ee[e];if(t)return t;const n=window.document;let r=window[e];if(n&&"function"==typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const o=t.contentWindow;o&&o[e]&&(r=o[e]),n.head.removeChild(t)}catch(e){}return ee[e]=r.bind(window)}function ne(...e){return te("setTimeout")(...e)}function re(...e){return te("clearTimeout")(...e)}function oe(e){try{return e.contentDocument}catch(e){}}let se=1;const ie=new RegExp("[^a-z0-9-_:]");function ae(){return se++}let ce,le;const ue=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,de=/^(?:[a-z+]+:)?\/\//i,pe=/^www\..*/i,he=/^(data:)([^,]*),(.*)/i;function fe(e,t){return(e||"").replace(ue,(e,n,r,o,s,i)=>{const a=r||s||i,c=n||o||"";if(!a)return e;if(de.test(a)||pe.test(a))return`url(${c}${a}${c})`;if(he.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${c})`;const l=t.split("/"),u=a.split("/");l.pop();for(const e of u)"."!==e&&(".."===e?l.pop():l.push(e));return`url(${c}${l.join("/")}${c})`})}const me=/^[^ \t\n\r\u000c]+/,ge=/^[, \t\n\r\u000c]+/;const _e=new WeakMap;function ye(e,t){return t&&""!==t.trim()?be(e,t):t}function Se(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function be(e,t){let n=_e.get(e);if(n||(n=e.createElement("a"),_e.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function Ee(e,t,n,r,o,s){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?ye(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}const o=[];for(;r(ge),!(n>=t.length);){let s=r(me);if(","===s.slice(-1))s=ye(e,s.substring(0,s.length-1)),o.push(s);else{let r="";s=ye(e,s);let i=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((s+r).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){n+=1,o.push((s+r).trim());break}"("===e&&(i=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?fe(r,be(e)):"object"===t&&"data"===n?ye(e,r):"function"==typeof s?s(n,r,o):r:ye(e,r):r}function ve(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function Te(e,t,n=1/0,r=0){return e?e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Te(e.parentNode,t,n,r+1):-1}function Ie(e,t){return n=>{const r=n;if(null===r)return!1;try{if(e)if("string"==typeof e){if(r.matches(`.${e}`))return!0}else if(function(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}(r,e))return!0;return!(!t||!r.matches(t))}catch{return!1}}}function ke(e,t,n,r,o,s){try{const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===i)return!1;if("INPUT"===i.tagName){const e=i.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(e))return!0}let a=-1,c=-1;if(s){if(c=Te(i,Ie(r,o)),c<0)return!0;a=Te(i,Ie(t,n),c>=0?c:1/0)}else{if(a=Te(i,Ie(t,n)),a<0)return!1;c=Te(i,Ie(r,o),a>=0?a:1/0)}return a>=0?!(c>=0)||a<=c:!(c>=0)&&!!s}catch(e){}return!!s}function we(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskAttributeFn:c,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:f={},maskTextFn:m,maskInputFn:g,dataURLOptions:_={},inlineImages:y,recordCanvas:S,keepIframeSrcFn:b,newlyAddedElement:E=!1}=t,v=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:G.Document,childNodes:[],compatMode:e.compatMode}:{type:G.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:G.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:o,unblockSelector:s,inlineStylesheet:i,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:h,newlyAddedElement:f=!1,rootId:m,maskTextClass:g,unmaskTextClass:_,maskTextSelector:y,unmaskTextSelector:S}=t,b=function(e,t,n,r){try{if(r&&e.matches(r))return!1;if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,o,s),E=function(e){if(e instanceof HTMLFormElement)return"form";const t=V(e.tagName);return ie.test(t)?"div":t}(e);let v={};const T=e.attributes.length;for(let t=0;t<T;t++){const r=e.attributes[t];r.name&&!ve(E,r.name,r.value)&&(v[r.name]=Ee(n,E,V(r.name),r.value,e,c))}if("link"===E&&i){const t=Array.from(n.styleSheets).find(t=>t.href===e.href);let r=null;t&&(r=z(t)),r&&(v.rel=null,v.href=null,v.crossorigin=null,v._cssText=fe(r,t.href))}if("style"===E&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=z(e.sheet);t&&(v._cssText=fe(t,be(n)))}if("input"===E||"textarea"===E||"select"===E||"option"===E){const t=e,n=Q(t),r=X(t,K(E),n),o=t.checked;if("submit"!==n&&"button"!==n&&r){const e=ke(t,g,y,_,S,q({type:n,tagName:K(E),maskInputOptions:a}));v.value=J({isMasked:e,element:t,value:r,maskInputFn:l})}o&&(v.checked=o)}"option"===E&&(e.selected&&!a.select?v.selected=!0:delete v.selected);if("canvas"===E&&p)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const o=t.getImageData,s=Y in o?o[Y]:o;if(new Uint32Array(s.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(v.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){const t=e.toDataURL(u.type,u.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(u.type,u.quality)&&(v.rr_dataURL=t)}if("img"===E&&d){ce||(ce=n.createElement("canvas"),le=ce.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",o=t.crossOrigin,s=()=>{t.removeEventListener("load",s);try{ce.width=t.naturalWidth,ce.height=t.naturalHeight,le.drawImage(t,0,0),v.rr_dataURL=ce.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?s():t.addEventListener("load",s));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(o?v.crossOrigin=o:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?s():t.addEventListener("load",s)}"audio"!==E&&"video"!==E||(v.rr_mediaState=e.paused?"paused":"played",v.rr_mediaCurrentTime=e.currentTime);f||(e.scrollLeft&&(v.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(v.rr_scrollTop=e.scrollTop));if(b){const{width:t,height:n}=e.getBoundingClientRect();v={class:v.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==E||h(v.src)||(b||oe(e)||(v.rr_src=v.src),delete v.src);let I;try{customElements.get(E)&&(I=!0)}catch(e){}return{type:G.Element,tagName:E,attributes:v,childNodes:[],isSVG:Se(e)||void 0,needBlock:b,rootId:m,isCustom:I}}(e,{doc:n,blockClass:o,blockSelector:s,unblockSelector:i,inlineStylesheet:h,maskAttributeFn:c,maskInputOptions:f,maskInputFn:g,dataURLOptions:_,inlineImages:y,recordCanvas:S,keepIframeSrcFn:b,newlyAddedElement:E,rootId:v,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:p});case e.TEXT_NODE:return function(e,t){const{maskAllText:n,maskTextClass:r,unmaskTextClass:o,maskTextSelector:s,unmaskTextSelector:i,maskTextFn:a,maskInputOptions:c,maskInputFn:l,rootId:u}=t,d=e.parentNode&&e.parentNode.tagName;let p=e.textContent;const h="STYLE"===d||void 0,f="SCRIPT"===d||void 0,m="TEXTAREA"===d||void 0;if(h&&p){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(p=z(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}p=fe(p,be(t.doc))}f&&(p="SCRIPT_PLACEHOLDER");const g=ke(e,r,s,o,i,n);h||f||m||!p||!g||(p=a?a(p,e.parentElement):p.replace(/[\S]/g,"*"));m&&p&&(c.textarea||g)&&(p=l?l(p,e.parentNode):p.replace(/[\S]/g,"*"));if("OPTION"===d&&p){p=J({isMasked:ke(e,r,s,o,i,q({type:null,tagName:d,maskInputOptions:c})),element:e,value:p,maskInputFn:l})}return{type:G.Text,textContent:p||"",isStyle:h,rootId:u}}(e,{doc:n,maskAllText:a,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:p,maskTextFn:m,maskInputOptions:f,maskInputFn:g,rootId:v});case e.CDATA_SECTION_NODE:return{type:G.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:G.Comment,textContent:e.textContent||"",rootId:v};default:return!1}}function Ae(e){return null==e?"":e.toLowerCase()}function Ce(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:p=!1,inlineStylesheet:h=!0,maskInputOptions:f={},maskAttributeFn:m,maskTextFn:g,maskInputFn:_,slimDOMOptions:y,dataURLOptions:S={},inlineImages:b=!1,recordCanvas:E=!1,onSerialize:v,onIframeLoad:T,iframeLoadTimeout:I=5e3,onBlockedImageLoad:k,onStylesheetLoad:w,stylesheetLoadTimeout:A=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:R=!1}=t;let{preserveWhiteSpace:x=!0}=t;const N=we(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,maskAllText:a,unblockSelector:i,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,inlineStylesheet:h,maskInputOptions:f,maskAttributeFn:m,maskTextFn:g,maskInputFn:_,dataURLOptions:S,inlineImages:b,recordCanvas:E,keepIframeSrcFn:C,newlyAddedElement:R});if(!N)return console.warn(e,"not serialized"),null;let O;O=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===G.Comment)return!0;if(e.type===G.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Z(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ae(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ae(e.attributes.name)||"icon"===Ae(e.attributes.rel)||"apple-touch-icon"===Ae(e.attributes.rel)||"shortcut icon"===Ae(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ae(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ae(e.attributes.property).match(/^(og|twitter|fb):/)||Ae(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ae(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Ae(e.attributes.name)||"googlebot"===Ae(e.attributes.name)||"bingbot"===Ae(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Ae(e.attributes.name)||"generator"===Ae(e.attributes.name)||"framework"===Ae(e.attributes.name)||"publisher"===Ae(e.attributes.name)||"progid"===Ae(e.attributes.name)||Ae(e.attributes.property).match(/^article:/)||Ae(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Ae(e.attributes.name)||"yandex-verification"===Ae(e.attributes.name)||"csrf-token"===Ae(e.attributes.name)||"p:domain_verify"===Ae(e.attributes.name)||"verify-v1"===Ae(e.attributes.name)||"verification"===Ae(e.attributes.name)||"shopify-checkout-api-token"===Ae(e.attributes.name)))return!0}}return!1}(N,y)&&(x||N.type!==G.Text||N.isStyle||N.textContent.replace(/^\s+|\s+$/gm,"").length)?ae():-2;const M=Object.assign(N,{id:O});if(r.add(e,M),-2===O)return null;v&&v(e);let L=!p;if(M.type===G.Element){L=L&&!M.needBlock;const t=e.shadowRoot;t&&W(t)&&(M.isShadowHost=!0)}if((M.type===G.Document||M.type===G.Element)&&L){y.headWhitespace&&M.type===G.Element&&"head"===M.tagName&&(x=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:s,maskAllText:a,unblockSelector:i,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:p,inlineStylesheet:h,maskInputOptions:f,maskAttributeFn:m,maskTextFn:g,maskInputFn:_,slimDOMOptions:y,dataURLOptions:S,inlineImages:b,recordCanvas:E,preserveWhiteSpace:x,onSerialize:v,onIframeLoad:T,iframeLoadTimeout:I,onBlockedImageLoad:k,onStylesheetLoad:w,stylesheetLoadTimeout:A,keepIframeSrcFn:C},R=e.childNodes?Array.from(e.childNodes):[];for(const e of R){const n=Ce(e,t);n&&M.childNodes.push(n)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(const n of Array.from(e.shadowRoot.childNodes)){const r=Ce(n,t);r&&(W(e.shadowRoot)&&(r.isShadow=!0),M.childNodes.push(r))}}if(e.parentNode&&H(e.parentNode)&&W(e.parentNode)&&(M.isShadow=!0),M.type!==G.Element||"iframe"!==M.tagName||M.needBlock||function(e,t,n){const r=e.contentWindow;if(!r)return;let o,s=!1;try{o=r.document.readyState}catch(e){return}if("complete"!==o){const r=ne(()=>{s||(t(),s=!0)},n);return void e.addEventListener("load",()=>{re(r),s=!0,t()})}const i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return ne(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=oe(e);if(t&&T){const n=Ce(t,{doc:t,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:f,maskAttributeFn:m,maskTextFn:g,maskInputFn:_,slimDOMOptions:y,dataURLOptions:S,inlineImages:b,recordCanvas:E,preserveWhiteSpace:x,onSerialize:v,onIframeLoad:T,iframeLoadTimeout:I,onStylesheetLoad:w,stylesheetLoadTimeout:A,keepIframeSrcFn:C});n&&T(e,n)}},I),M.type===G.Element&&"img"===M.tagName&&!e.complete&&M.needBlock){const t=e,n=()=>{if(t.isConnected&&!t.complete&&k)try{const e=t.getBoundingClientRect();e.width>0&&e.height>0&&k(t,M,e)}catch(e){}t.removeEventListener("load",n)};t.isConnected&&t.addEventListener("load",n)}return M.type===G.Element&&"link"===M.tagName&&"string"==typeof M.attributes.rel&&("stylesheet"===M.attributes.rel||"preload"===M.attributes.rel&&"string"==typeof M.attributes.href&&"css"===Z(M.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(e){return}if(r)return;const s=ne(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{re(s),o=!0,t()})}(e,()=>{if(w){const t=Ce(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:f,maskAttributeFn:m,maskTextFn:g,maskInputFn:_,slimDOMOptions:y,dataURLOptions:S,inlineImages:b,recordCanvas:E,preserveWhiteSpace:x,onSerialize:v,onIframeLoad:T,iframeLoadTimeout:I,onStylesheetLoad:w,stylesheetLoadTimeout:A,keepIframeSrcFn:C});t&&w(e,t)}},A),M.type===G.Element&&delete M.needBlock,M}function Re(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const xe="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Ne={map:{},getId:()=>(console.error(xe),-1),getNode:()=>(console.error(xe),null),removeNodeFromMap(){console.error(xe)},has:()=>(console.error(xe),!1),reset(){console.error(xe)}};function Oe(e,t,n={}){let r=null,o=0;return function(...s){const i=Date.now();o||!1!==n.leading||(o=i);const a=t-(i-o),c=this;a<=0||a>t?(r&&(!function(...e){Xe("clearTimeout")(...e)}(r),r=null),o=i,e.apply(c,s)):r||!1===n.trailing||(r=Ze(()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(c,s)},a))}}function Me(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){Ze(()=>{n.set.call(this,e)},0),s&&s.set&&s.set.call(this,e)}}),()=>Me(e,t,s||{},!0)}function Le(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ne=new Proxy(Ne,{get:(e,t,n)=>("map"===t&&console.error(xe),Reflect.get(e,t,n))}));let De=Date.now;function Pe(e){const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0}}function Ue(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Be(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Fe(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch(e){return null}}function Ge(e,t,n,r,o){if(!e)return!1;const s=Fe(e);if(!s)return!1;const i=Ie(t,n);if(!o){const e=r&&s.matches(r);return i(s)&&!e}const a=Te(s,i);let c=-1;return!(a<0)&&(r&&(c=Te(s,Ie(null,r))),a>-1&&c<0||a<c)}function He(e,t){return-2===t.getId(e)}function We(e,t){if(H(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||We(e.parentNode,t))}function ze(e){return Boolean(e.changedTouches)}function je(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function $e(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function qe(e){return Boolean(e?.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(De=()=>(new Date).getTime());class Je{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Ve(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function Ke(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=Ve(n);)n=t;return n}(e);return t.contains(n)}function Ye(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||Ke(e))}const Qe={};function Xe(e){const t=Qe[e];if(t)return t;const n=window.document;let r=window[e];if(n&&"function"==typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const o=t.contentWindow;o&&o[e]&&(r=o[e]),n.head.removeChild(t)}catch(e){}return Qe[e]=r.bind(window)}function Ze(...e){return Xe("setTimeout")(...e)}var et=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(et||{}),tt=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(tt||{}),nt=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(nt||{}),rt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(rt||{}),ot=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(ot||{});function st(e){try{return e.contentDocument}catch(e){}}function it(e){return"__ln"in e}class at{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=t?.next||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&it(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&it(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const ct=(e,t)=>`${e}@${t}`;class lt{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new at,r=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{if(!o.parentNode||!Ye(o))return;const s=H(o.parentNode)?this.mirror.getId(Ve(o)):this.mirror.getId(o.parentNode),i=r(o);if(-1===s||-1===i)return n.addNode(o);const a=Ce(o,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{je(e,this.mirror)&&!Ge(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(e),$e(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),qe(o)&&this.shadowDomManager.addShadowRoot(o.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{Ge(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(e,t),e.contentWindow&&this.canvasManager.addWindow(e.contentWindow),this.shadowDomManager.observeAttachShadow(e))},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,{width:n,height:r})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${n}px`,height:`${r}px`}}}]})}});a&&(e.push({parentId:s,nextId:i,node:a}),t.add(a.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)dt(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||o(e);for(const e of this.addedSet)pt(this.droppedSet,e)||dt(this.removes,e,this.mirror)?pt(this.movedSet,e)?o(e):this.droppedSet.add(e):o(e);let s=null;for(;n.length;){let e=null;if(s){const t=this.mirror.getId(s.value.parentNode),n=r(s.value);-1!==t&&-1!==n&&(e=s)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}s=e.previous,n.removeNode(e.value),o(e.value)}const i={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(i.texts.length||i.attributes.length||i.removes.length||i.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(i))},this.processMutation=e=>{if(!He(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;Ge(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||t===e.oldValue||this.texts.push({value:ke(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t,Fe(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){const n=Q(t),o=t.tagName;r=X(t,o,n);const s=q({maskInputOptions:this.maskInputOptions,tagName:o,type:n});r=J({isMasked:ke(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,s),element:t,value:r,maskInputFn:this.maskInputFn})}if(Ge(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||r===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(st(t))return;n="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!ve(t.tagName,n)&&(o.attributes[n]=Ee(this.doc,V(t.tagName),V(n),r,t,this.maskAttributeFn),"style"===n)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),s=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||s!==n.style.getPropertyPriority(e)?o.styleDiff[e]=""===s?r:[r,s]:o._unchangedStyles[e]=[r,s]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}break}case"childList":if(Ge(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=H(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Ge(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||He(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(ut(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||We(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ct(n,r)]?ut(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!H(e.target)||!W(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(He(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[ct(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ge(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes&&e.childNodes.forEach(e=>this.genAdds(e)),qe(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ut(e,t){e.delete(t),t.childNodes?.forEach(t=>ut(e,t))}function dt(e,t,n){return 0!==e.length&&function(e,t,n){let r=t.parentNode;for(;r;){const t=n.getId(r);if(e.some(e=>e.id===t))return!0;r=r.parentNode}return!1}(e,t,n)}function pt(e,t){return 0!==e.size&&ht(e,t)}function ht(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||ht(e,n))}let ft;const mt=e=>{if(!ft)return e;return(...t)=>{try{return e(...t)}catch(e){if(ft&&!0===ft(e))return()=>{};throw e}}},gt=[];function _t(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function yt(e,t){const n=new lt;gt.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const o=window?.Zone?.__symbol__?.("MutationObserver");o&&window[o]&&(r=window[o]);const s=new r(mt(t=>{e.onMutation&&!1===e.onMutation(t)||n.processMutations.bind(n)(t)}));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function St({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,c=[];let l=null;return Object.keys(nt).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]).forEach(i=>{let a=V(i);const u=(t=>i=>{const a=_t(i);if(Ge(a,r,o,s,!0))return;let c=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":c=rt.Mouse;break;case"touch":c=rt.Touch;break;case"pen":c=rt.Pen}c===rt.Touch?nt[t]===nt.MouseDown?u="TouchStart":nt[t]===nt.MouseUp&&(u="TouchEnd"):rt.Pen}else ze(i)&&(c=rt.Touch);null!==c?(l=c,(u.startsWith("Touch")&&c===rt.Touch||u.startsWith("Mouse")&&c===rt.Mouse)&&(c=null)):nt[t]===nt.Click&&(c=l,l=null);const d=ze(i)?i.changedTouches[0]:i;if(!d)return;const p=n.getId(a),{clientX:h,clientY:f}=d;mt(e)({type:nt[u],id:p,x:h,y:f,...null!==c&&{pointerType:c}})})(i);if(window.PointerEvent)switch(nt[i]){case nt.MouseDown:case nt.MouseUp:a=a.replace("mouse","pointer");break;case nt.TouchStart:case nt.TouchEnd:return}c.push(Re(a,u,t))}),mt(()=>{c.forEach(e=>e())})}function bt({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,sampling:i}){return Re("scroll",mt(Oe(mt(i=>{const a=_t(i);if(!a||Ge(a,r,o,s,!0))return;const c=n.getId(a);if(a===t&&t.defaultView){const n=Pe(t.defaultView);e({id:c,x:n.left,y:n.top})}else e({id:c,x:a.scrollLeft,y:a.scrollTop})}),i.scroll||100)),t)}const Et=["INPUT","TEXTAREA","SELECT"],vt=new WeakMap;function Tt({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,ignoreClass:i,ignoreSelector:a,maskInputOptions:c,maskInputFn:l,sampling:u,userTriggeredOnInput:d,maskTextClass:p,unmaskTextClass:h,maskTextSelector:f,unmaskTextSelector:m}){function g(e){let n=_t(e);const u=e.isTrusted,g=n&&K(n.tagName);if("OPTION"===g&&(n=n.parentElement),!n||!g||Et.indexOf(g)<0||Ge(n,r,o,s,!0))return;const y=n;if(y.classList.contains(i)||a&&y.matches(a))return;const S=Q(n);let b=X(y,g,S),E=!1;const v=q({maskInputOptions:c,tagName:g,type:S}),T=ke(n,p,f,h,m,v);"radio"!==S&&"checkbox"!==S||(E=n.checked),b=J({isMasked:T,element:n,value:b,maskInputFn:l}),_(n,d?{text:b,isChecked:E,userTriggered:u}:{text:b,isChecked:E});const I=n.name;"radio"===S&&I&&E&&t.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach(e=>{if(e!==n){const t=J({isMasked:T,element:e,value:X(e,g,S),maskInputFn:l});_(e,d?{text:t,isChecked:!E,userTriggered:!1}:{text:t,isChecked:!E})}})}function _(t,r){const o=vt.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){vt.set(t,r);const o=n.getId(t);mt(e)({...r,id:o})}}const y=("last"===u.input?["change"]:["input","change"]).map(e=>Re(e,mt(g),t)),S=t.defaultView;if(!S)return()=>{y.forEach(e=>e())};const b=S.Object.getOwnPropertyDescriptor(S.HTMLInputElement.prototype,"value"),E=[[S.HTMLInputElement.prototype,"value"],[S.HTMLInputElement.prototype,"checked"],[S.HTMLSelectElement.prototype,"value"],[S.HTMLTextAreaElement.prototype,"value"],[S.HTMLSelectElement.prototype,"selectedIndex"],[S.HTMLOptionElement.prototype,"selected"]];return b&&b.set&&y.push(...E.map(e=>Me(e[0],e[1],{set(){mt(g)({target:this,isTrusted:!1})}},!1,S))),mt(()=>{y.forEach(e=>e())})}function It(e){return function(e,t){if(Ct("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ct("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ct("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ct("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function kt(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function wt({mirror:e,stylesheetManager:t},n){let r=null;r="#document"===n.nodeName?e.getId(n):e.getId(n.host);const o="#document"===n.nodeName?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,s=o?.prototype?Object.getOwnPropertyDescriptor(o?.prototype,"adoptedStyleSheets"):void 0;return null!==r&&-1!==r&&o&&s?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){return s.get?.call(this)},set(e){const n=s.set?.call(this,e);if(null!==r&&-1!==r)try{t.adoptStyleSheets(e,r)}catch(e){}return n}}),mt(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})})):()=>{}}function At(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=yt(e,e.doc));const o=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,s="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const c=Oe(mt(t=>{const n=Date.now()-i;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],i=null}),s),l=mt(Oe(mt(e=>{const t=_t(e),{clientX:n,clientY:o}=ze(e)?e.changedTouches[0]:e;i||(i=De()),a.push({x:n,y:o,id:r.getId(t),timeOffset:De()-i}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?tt.Drag:e instanceof MouseEvent?tt.MouseMove:tt.TouchMove)}),o,{trailing:!1})),u=[Re("mousemove",l,n),Re("touchmove",l,n),Re("drag",l,n)];return mt(()=>{u.forEach(e=>e())})}(e),s=St(e),i=bt(e),a=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return Re("resize",mt(Oe(mt(()=>{const t=Ue(),o=Be();n===t&&r===o||(e({width:Number(o),height:Number(t)}),n=t,r=o)}),200)),t)}(e,{win:n}),c=Tt(e),l=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:o,sampling:s,doc:i}){const a=mt(i=>Oe(mt(s=>{const a=_t(s);if(!a||Ge(a,t,n,r,!0))return;const{currentTime:c,volume:l,muted:u,playbackRate:d}=a;e({type:i,id:o.getId(a),currentTime:c,volume:l,muted:u,playbackRate:d})}),s.media||500)),c=[Re("play",a(ot.Play),i),Re("pause",a(ot.Pause),i),Re("seeked",a(ot.Seeked),i),Re("volumechange",a(ot.VolumeChange),i),Re("ratechange",a(ot.RateChange),i)];return mt(()=>{c.forEach(e=>e())})}(e);let u=()=>{},d=()=>{},p=()=>{},h=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:mt((r,o,s)=>{const[i,a]=s,{id:c,styleId:l}=kt(o,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:i,index:a}]}),r.apply(o,s)})});const s=r.CSSStyleSheet.prototype.deleteRule;let i,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:mt((r,o,s)=>{const[i]=s,{id:a,styleId:c}=kt(o,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:i}]}),r.apply(o,s)})}),r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:mt((r,o,s)=>{const[i]=s,{id:a,styleId:c}=kt(o,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replace:i}),r.apply(o,s)})})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:mt((r,o,s)=>{const[i]=s,{id:a,styleId:c}=kt(o,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replaceSync:i}),r.apply(o,s)})}));const c={};Rt("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(Rt("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),Rt("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),Rt("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach(([r,o])=>{l[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(l[r].insertRule,{apply:mt((r,o,s)=>{const[i,a]=s,{id:c,styleId:l}=kt(o.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:i,index:[...It(o),a||0]}]}),r.apply(o,s)})}),o.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:mt((r,o,s)=>{const[i]=s,{id:a,styleId:c}=kt(o.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:[...It(o),i]}]}),r.apply(o,s)})})}),mt(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=s,i&&(r.CSSStyleSheet.prototype.replace=i),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}(e,{win:n}),d=wt(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:mt((o,i,a)=>{const[c,l,u]=a;if(n.has(c))return s.apply(i,[c,l,u]);const{id:d,styleId:p}=kt(i.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&-1!==d||p&&-1!==p)&&e({id:d,styleId:p,set:{property:c,value:l,priority:u},index:It(i.parentRule)}),o.apply(i,a)})});const i=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:mt((o,s,a)=>{const[c]=a;if(n.has(c))return i.apply(s,[c]);const{id:l,styleId:u}=kt(s.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,remove:{property:c},index:It(s.parentRule)}),o.apply(s,a)})}),mt(()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=i})}(e,{win:n}),e.collectFonts&&(h=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(e,t,n){const r=new s(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const i=Le(t.fonts,"add",function(t){return function(n){return Ze(mt(()=>{const t=o.get(n);t&&(e(t),o.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=s}),r.push(i),mt(()=>{r.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,selectionCb:i}=e;let a=!0;const c=mt(()=>{const e=t.getSelection();if(!e||a&&e?.isCollapsed)return;a=e.isCollapsed||!1;const c=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const i=e.getRangeAt(t),{startContainer:a,startOffset:l,endContainer:u,endOffset:d}=i;Ge(a,r,o,s,!0)||Ge(u,r,o,s,!0)||c.push({start:n.getId(a),startOffset:l,end:n.getId(u),endOffset:d})}i({ranges:c})});return c(),Re("selectionchange",c)}(e),m=function({doc:e,customElementCb:t}){const n=e.defaultView;return n&&n.customElements?Le(n.customElements,"define",function(e){return function(n,r,o){try{t({define:{name:n}})}catch(e){}return e.apply(this,[n,r,o])}}):()=>{}}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,n,t.options));return mt(()=>{gt.forEach(e=>e.reset()),r?.disconnect(),o(),s(),i(),a(),c(),l(),u(),d(),p(),h(),f(),m(),g.forEach(e=>e())})}function Ct(e){return void 0!==window[e]}function Rt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class xt{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),s=r||this.getRemoteIdToIdMap(e);let i=o.get(t);return i||(i=this.generateIdFn(),o.set(t,i),s.set(i,t)),i}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Nt{constructor(){this.crossOriginIframeMirror=new xt(ae),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class Ot{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new xt(ae),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new xt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&e.contentWindow?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(e);const n=st(e);n&&n.adoptedStyleSheets&&n.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(n.adoptedStyleSheets,this.mirror.getId(n))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){switch(t.type){case et.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:et.IncrementalSnapshot,data:{source:tt.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case et.Meta:case et.Load:case et.DomContentLoaded:return!1;case et.Plugin:return t;case et.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case et.IncrementalSnapshot:switch(t.data.source){case tt.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case tt.Drag:case tt.TouchMove:case tt.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case tt.ViewportResize:return!1;case tt.MediaInteraction:case tt.MouseInteraction:case tt.Scroll:case tt.CanvasMutation:case tt.Input:return this.replaceIds(t.data,e,["id"]),t;case tt.StyleSheetRule:case tt.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case tt.Font:return t;case tt.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case tt.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),t.data.styles?.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===G.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Mt{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class Lt{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!W(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);const n=yt({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(bt({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),Ze(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(wt({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){const t=st(e),n=function(e){try{return e.contentWindow}catch(e){}}(e);t&&n&&this.patchAttachShadow(n.Element,t)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(Le(e.prototype,"attachShadow",function(e){return function(r){const o=e.call(this,r);return this.shadowRoot&&Ye(this)&&n.addShadowRoot(this.shadowRoot,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}for(var Dt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ut=0;Ut<64;Ut++)Pt[Dt.charCodeAt(Ut)]=Ut;class Bt{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class Ft{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Je,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,t)=>({rule:j(e),index:t}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Gt{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,function(...e){Xe("requestAnimationFrame")(...e)}(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let Ht,Wt;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const zt=new $;function jt(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:s=null,unblockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskAllText:l=!1,maskTextClass:u="rr-mask",unmaskTextClass:d=null,maskTextSelector:p=null,unmaskTextSelector:h=null,inlineStylesheet:f=!0,maskAllInputs:m,maskInputOptions:g,slimDOMOptions:_,maskAttributeFn:y,maskInputFn:S,maskTextFn:b,maxCanvasSize:E=null,packFn:v,sampling:T={},dataURLOptions:I={},mousemoveWait:k,recordDOM:w=!0,recordCanvas:A=!1,recordCrossOriginIframes:C=!1,recordAfter:R=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:x=!1,collectFonts:N=!1,inlineImages:O=!1,plugins:M,keepIframeSrcFn:L=()=>!1,ignoreCSSAttributes:D=new Set([]),errorHandler:P,onMutation:U,getCanvasManager:B}=e;ft=P;const F=!C||window.parent===window;let G=!1;if(!F)try{window.parent.document&&(G=!1)}catch(e){G=!0}if(F&&!t)throw new Error("emit function is required");if(!F&&!G)return()=>{};void 0!==k&&void 0===T.mousemove&&(T.mousemove=k),zt.reset();const H=!0===m?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:void 0!==g?g:{},W=!0===_||"all"===_?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===_,headMetaDescKeywords:"all"===_}:_||{};let z;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let j=0;const q=e=>{for(const t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!G&&(e=v(e)),e};Ht=(e,o)=>{const s=e;if(s.timestamp=De(),!gt[0]?.isFrozen()||s.type===et.FullSnapshot||s.type===et.IncrementalSnapshot&&s.data.source===tt.Mutation||gt.forEach(e=>e.unfreeze()),F)t?.(q(s),o);else if(G){const e={type:"rrweb",event:q(s),origin:window.location.origin,isCheckout:o};window.parent.postMessage(e,"*")}if(s.type===et.FullSnapshot)z=s,j=0;else if(s.type===et.IncrementalSnapshot){if(s.data.source===tt.Mutation&&s.data.isAttachIframe)return;j++;const e=r&&j>=r,t=n&&z&&s.timestamp-z.timestamp>n;(e||t)&&te(!0)}};const J=e=>{Ht({type:et.IncrementalSnapshot,data:{source:tt.Mutation,...e}})},V=e=>Ht({type:et.IncrementalSnapshot,data:{source:tt.Scroll,...e}}),K=e=>Ht({type:et.IncrementalSnapshot,data:{source:tt.CanvasMutation,...e}}),Y=new Ft({mutationCb:J,adoptedStyleSheetCb:e=>Ht({type:et.IncrementalSnapshot,data:{source:tt.AdoptedStyleSheet,...e}})}),Q="boolean"==typeof __RRWEB_EXCLUDE_IFRAME__&&__RRWEB_EXCLUDE_IFRAME__?new Nt:new Ot({mirror:zt,mutationCb:J,stylesheetManager:Y,recordCrossOriginIframes:C,wrappedEmit:Ht});for(const e of M||[])e.getMirror&&e.getMirror({nodeMirror:zt,crossOriginIframeMirror:Q.crossOriginIframeMirror,crossOriginIframeStyleMirror:Q.crossOriginIframeStyleMirror});const X=new Gt,Z=function(e,t){try{return e?e(t):new Bt}catch{return console.warn("Unable to initialize CanvasManager"),new Bt}}(B,{mirror:zt,win:window,mutationCb:e=>Ht({type:et.IncrementalSnapshot,data:{source:tt.CanvasMutation,...e}}),recordCanvas:A,blockClass:o,blockSelector:s,unblockSelector:i,maxCanvasSize:E,sampling:T.canvas,dataURLOptions:I,errorHandler:P}),ee="boolean"==typeof __RRWEB_EXCLUDE_SHADOW_DOM__&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Mt:new Lt({mutationCb:J,scrollCb:V,bypassOptions:{onMutation:U,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,inlineStylesheet:f,maskInputOptions:H,dataURLOptions:I,maskAttributeFn:y,maskTextFn:b,maskInputFn:S,recordCanvas:A,inlineImages:O,sampling:T,slimDOMOptions:W,iframeManager:Q,stylesheetManager:Y,canvasManager:Z,keepIframeSrcFn:L,processedNodeManager:X},mirror:zt}),te=(e=!1)=>{if(!w)return;Ht({type:et.Meta,data:{href:window.location.href,width:Be(),height:Ue()}},e),Y.reset(),ee.init(),gt.forEach(e=>e.lock());const t=function(e,t){const{mirror:n=new $,blockClass:r="rr-block",blockSelector:o=null,unblockSelector:s=null,maskAllText:i=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:u=null,inlineStylesheet:d=!0,inlineImages:p=!1,recordCanvas:h=!1,maskAllInputs:f=!1,maskAttributeFn:m,maskTextFn:g,maskInputFn:_,slimDOM:y=!1,dataURLOptions:S,preserveWhiteSpace:b,onSerialize:E,onIframeLoad:v,iframeLoadTimeout:T,onBlockedImageLoad:I,onStylesheetLoad:k,stylesheetLoadTimeout:w,keepIframeSrcFn:A=()=>!1}=t||{};return Ce(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,maskAllText:i,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===f?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:!1===f?{}:f,maskAttributeFn:m,maskTextFn:g,maskInputFn:_,slimDOMOptions:!0===y||"all"===y?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===y,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===y?{}:y,dataURLOptions:S,inlineImages:p,recordCanvas:h,preserveWhiteSpace:b,onSerialize:E,onIframeLoad:v,iframeLoadTimeout:T,onBlockedImageLoad:I,onStylesheetLoad:k,stylesheetLoadTimeout:w,keepIframeSrcFn:A,newlyAddedElement:!1})}(document,{mirror:zt,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,inlineStylesheet:f,maskAllInputs:H,maskAttributeFn:y,maskInputFn:S,maskTextFn:b,slimDOM:W,dataURLOptions:I,recordCanvas:A,inlineImages:O,onSerialize:e=>{je(e,zt)&&Q.addIframe(e),$e(e,zt)&&Y.trackLinkElement(e),qe(e)&&ee.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{Q.attachIframe(e,t),e.contentWindow&&Z.addWindow(e.contentWindow),ee.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Y.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,{width:n,height:r})=>{J({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${n}px`,height:`${r}px`}}}]})},keepIframeSrcFn:L});if(!t)return console.warn("Failed to snapshot the document");Ht({type:et.FullSnapshot,data:{node:t,initialOffset:Pe(window)}}),gt.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,zt.getId(document))};Wt=te;try{const e=[],t=e=>mt(At)({onMutation:U,mutationCb:J,mousemoveCb:(e,t)=>Ht({type:et.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Ht({type:et.IncrementalSnapshot,data:{source:tt.MouseInteraction,...e}}),scrollCb:V,viewportResizeCb:e=>Ht({type:et.IncrementalSnapshot,data:{source:tt.ViewportResize,...e}}),inputCb:e=>Ht({type:et.IncrementalSnapshot,data:{source:tt.Input,...e}}),mediaInteractionCb:e=>Ht({type:et.IncrementalSnapshot,data:{source:tt.MediaInteraction,...e}}),styleSheetRuleCb:e=>Ht({type:et.IncrementalSnapshot,data:{source:tt.StyleSheetRule,...e}}),styleDeclarationCb:e=>Ht({type:et.IncrementalSnapshot,data:{source:tt.StyleDeclaration,...e}}),canvasMutationCb:K,fontCb:e=>Ht({type:et.IncrementalSnapshot,data:{source:tt.Font,...e}}),selectionCb:e=>{Ht({type:et.IncrementalSnapshot,data:{source:tt.Selection,...e}})},customElementCb:e=>{Ht({type:et.IncrementalSnapshot,data:{source:tt.CustomElement,...e}})},blockClass:o,ignoreClass:a,ignoreSelector:c,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:p,unmaskTextSelector:h,maskInputOptions:H,inlineStylesheet:f,sampling:T,recordDOM:w,recordCanvas:A,inlineImages:O,userTriggeredOnInput:x,collectFonts:N,doc:e,maskAttributeFn:y,maskInputFn:S,maskTextFn:b,keepIframeSrcFn:L,blockSelector:s,unblockSelector:i,slimDOMOptions:W,dataURLOptions:I,mirror:zt,iframeManager:Q,stylesheetManager:Y,shadowDomManager:ee,processedNodeManager:X,canvasManager:Z,ignoreCSSAttributes:D,plugins:M?.filter(e=>e.observer)?.map(e=>({observer:e.observer,options:e.options,callback:t=>Ht({type:et.Plugin,data:{plugin:e.name,payload:t}})}))||[]},{});Q.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});const n=()=>{te(),e.push(t(document))};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(Re("DOMContentLoaded",()=>{Ht({type:et.DomContentLoaded,data:{}}),"DOMContentLoaded"===R&&n()})),e.push(Re("load",()=>{Ht({type:et.Load,data:{}}),"load"===R&&n()},window))),()=>{e.forEach(e=>e()),X.destroy(),Wt=void 0,ft=void 0}}catch(e){console.warn(e)}}var $t,qt;jt.mirror=zt,jt.takeFullSnapshot=function(e){if(!Wt)throw new Error("please take full snapshot after start recording");Wt(e)},(qt=$t||($t={}))[qt.NotStarted=0]="NotStarted",qt[qt.Running=1]="Running",qt[qt.Stopped=2]="Stopped";function Jt(e){return e>9999999999?e:1e3*e}function Vt(e){return e>9999999999?e/1e3:e}function Kt(e,t){"sentry.transaction"!==t.category&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:et.Custom,timestamp:1e3*(t.timestamp||0),data:{tag:"breadcrumb",payload:(0,y.normalize)(t,10,1e3)}}),"console"===t.category)))}function Yt(e){return e.closest("button,a")||e}function Qt(e){const t=Xt(e);return t&&t instanceof Element?Yt(t):t}function Xt(e){return function(e){return"object"==typeof e&&!!e&&"target"in e}(e)?e.target:e}let Zt;function en(e){return Zt||(Zt=[],(0,S.fill)(N,"open",function(e){return function(...t){if(Zt)try{Zt.forEach(e=>e())}catch{}return e.apply(N,t)}})),Zt.push(e),()=>{const t=Zt?Zt.indexOf(e):-1;t>-1&&Zt.splice(t,1)}}const tn=new Set([tt.Mutation,tt.StyleSheetRule,tt.StyleDeclaration,tt.AdoptedStyleSheet,tt.CanvasMutation,tt.Selection,tt.MediaInteraction]);class nn{constructor(e,t,n=Kt){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=t.timeout/1e3,this._threshold=t.threshold/1e3,this._scrollTimeout=t.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=t.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){const e=en(()=>{this._lastMutation=on()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,t){if(function(e,t){if(!rn.includes(e.tagName))return!0;if("INPUT"===e.tagName&&!["submit","button"].includes(e.getAttribute("type")||""))return!0;if("A"===e.tagName&&(e.hasAttribute("download")||e.hasAttribute("target")&&"_self"!==e.getAttribute("target")))return!0;if(t&&e.matches(t))return!0;return!1}(t,this._ignoreSelector)||!function(e){return!(!e.data||"number"!=typeof e.data.nodeId||!e.timestamp)}(e))return;const n={timestamp:Vt(e.timestamp),clickBreadcrumb:e,clickCount:0,node:t};this._clicks.some(e=>e.node===n.node&&Math.abs(e.timestamp-n.timestamp)<1)||(this._clicks.push(n),1===this._clicks.length&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=Vt(e)}registerScroll(e=Date.now()){this._lastScroll=Vt(e)}registerClick(e){const t=Yt(e);this._handleMultiClick(t)}_handleMultiClick(e){this._getClicks(e).forEach(e=>{e.clickCount++})}_getClicks(e){return this._clicks.filter(t=>t.node===e)}_checkClicks(){const e=[],t=on();this._clicks.forEach(n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=t&&e.push(n)});for(const t of e){const e=this._clicks.indexOf(t);e>-1&&(this._generateBreadcrumbs(t),this._clicks.splice(e,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){const t=this._replay,n=e.scrollAfter&&e.scrollAfter<=this._scrollTimeout,r=e.mutationAfter&&e.mutationAfter<=this._threshold,o=!n&&!r,{clickCount:s,clickBreadcrumb:i}=e;if(o){const n=1e3*Math.min(e.mutationAfter||this._timeout,this._timeout),r=n<1e3*this._timeout?"mutation":"timeout",o={type:"default",message:i.message,timestamp:i.timestamp,category:"ui.slowClickDetected",data:{...i.data,url:N.location.href,route:t.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:s||1}};return void this._addBreadcrumbEvent(t,o)}if(s>1){const e={type:"default",message:i.message,timestamp:i.timestamp,category:"ui.multiClick",data:{...i.data,url:N.location.href,route:t.getCurrentRoute(),clickCount:s,metric:!0}};this._addBreadcrumbEvent(t,e)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=(0,C.setTimeout)(()=>this._checkClicks(),1e3)}}const rn=["A","BUTTON","INPUT"];function on(){return Date.now()/1e3}function sn(e,t){try{if(!function(e){return 3===e.type}(t))return;const{source:n}=t.data;if(tn.has(n)&&e.registerMutation(t.timestamp),n===tt.Scroll&&e.registerScroll(t.timestamp),function(e){return e.data.source===tt.MouseInteraction}(t)){const{type:n,id:r}=t.data,o=jt.mirror.getNode(r);o instanceof HTMLElement&&n===nt.Click&&e.registerClick(o)}}catch{}}function an(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var cn=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(cn||{});const ln=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function un(e){const t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(const n in e)if(ln.has(n)){let r=n;"data-testid"!==n&&"data-test-id"!==n||(r="testId"),t[r]=e[n]}return t}const dn=e=>t=>{if(!e.isEnabled())return;const n=function(e){const{target:t,message:n}=function(e){const t="click"===e.name;let n,r=null;try{r=t?Qt(e.event):Xt(e.event),n=(0,h.htmlTreeAsString)(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}(e);return an({category:`ui.${e.name}`,...pn(t,n)})}(t);if(!n)return;const r="click"===t.name,o=r?t.event:void 0;var s,i,a;!(r&&e.clickDetector&&o?.target)||o.altKey||o.metaKey||o.ctrlKey||o.shiftKey||(s=e.clickDetector,i=n,a=Qt(t.event),s.handleClick(i,a)),Kt(e,n)};function pn(e,t){const n=jt.mirror.getId(e),r=n&&jt.mirror.getNode(n),o=r&&jt.mirror.getMeta(r),s=o&&function(e){return e.type===cn.Element}(o)?o:null;return{message:t,data:s?{nodeId:n,node:{id:n,tagName:s.tagName,textContent:Array.from(s.childNodes).map(e=>e.type===cn.Text&&e.textContent).filter(Boolean).map(e=>e.trim()).join(""),attributes:un(s.attributes)}}:{}}}function hn(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=function(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:s,target:i}=e;if(!i||function(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable}(i)||!s)return null;const a=t||r||o,c=1===s.length;if(!a&&c)return null;const l=(0,h.htmlTreeAsString)(i,{maxStringLength:200})||"<unknown>",u=pn(i,l);return an({category:"ui.keyDown",message:l,data:{...u.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:s}})}(t);n&&Kt(e,n)}const fn={resource:function(e){const{entryType:t,initiatorType:n,name:r,responseEnd:o,startTime:s,decodedBodySize:i,encodedBodySize:a,responseStatus:c,transferSize:l}=e;if(["fetch","xmlhttprequest"].includes(n))return null;return{type:`${t}.${n}`,start:_n(s),end:_n(o),name:r,data:{size:l,statusCode:c,decodedBodySize:i,encodedBodySize:a}}},paint:function(e){const{duration:t,entryType:n,name:r,startTime:o}=e,s=_n(o);return{type:n,name:r,start:s,end:s+t,data:void 0}},navigation:function(e){const{entryType:t,name:n,decodedBodySize:r,duration:o,domComplete:s,encodedBodySize:i,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:l,loadEventStart:u,loadEventEnd:d,redirectCount:p,startTime:h,transferSize:f,type:m}=e;if(0===o)return null;return{type:`${t}.${m}`,start:_n(h),end:_n(s),name:n,data:{size:f,decodedBodySize:r,encodedBodySize:i,duration:o,domInteractive:l,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:u,loadEventEnd:d,domComplete:s,redirectCount:p}}}};function mn(e,t){return({metric:n})=>{t.replayPerformanceEntries.push(e(n))}}function gn(e){const t=fn[e.entryType];return t?t(e):null}function _n(e){return(((0,v.browserPerformanceTimeOrigin)()||N.performance.timeOrigin)+e)/1e3}function yn(e){const t=e.entries[e.entries.length-1];return vn(e,"largest-contentful-paint",t?.element?[t.element]:void 0)}function Sn(e){return void 0!==e.sources}function bn(e){const t=[],n=[];for(const r of e.entries)if(Sn(r)){const e=[];for(const t of r.sources)if(t.node){n.push(t.node);const r=jt.mirror.getId(t.node);r&&e.push(r)}t.push({value:r.value,nodeIds:e.length?e:void 0})}return vn(e,"cumulative-layout-shift",n,t)}function En(e){const t=e.entries[e.entries.length-1];return vn(e,"interaction-to-next-paint",t?.target?[t.target]:void 0)}function vn(e,t,n,r){const o=e.value,s=e.rating,i=_n(o);return{type:"web-vital",name:t,start:i,end:i,data:{value:o,size:o,rating:s,nodeIds:n?n.map(e=>jt.mirror.getId(e)):void 0,attributions:r}}}const Tn="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;const In=["log","warn","error"],kn="[Replay] ";function wn(e,t="info"){(0,p.addBreadcrumb)({category:"console",data:{logger:"replay"},level:t,message:`${kn}${e}`},{level:t})}const An=function(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:n=>{e=!!n.captureExceptions,t=!!n.traceInternals}};return Tn?(In.forEach(e=>{n[e]=(...n)=>{g.debug[e](kn,...n),t&&wn(n.join(""),(0,b.severityLevelFromString)(e))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),g.debug.error(kn,r),e?(0,s.captureException)(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&wn(r,"error")},n.infoTick=(...e)=>{g.debug.log(kn,...e),t&&setTimeout(()=>wn(e[0]),0)}):In.forEach(e=>{n[e]=()=>{}}),n}();class Cn extends Error{constructor(){super("Event buffer exceeded maximum size of 20000000.")}}class Rn{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(e){const t=JSON.stringify(e).length;if(this._totalSize+=t,this._totalSize>P)throw new Cn;this.events.push(e)}finish(){return new Promise(e=>{const t=this.events;this.clear(),e(JSON.stringify(t))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const e=this.events.map(e=>e.timestamp).sort()[0];return e?Jt(e):null}}class xn{constructor(e){this._worker=e,this._id=0}ensureReady(){return this._ensureReadyPromise||(this._ensureReadyPromise=new Promise((e,t)=>{this._worker.addEventListener("message",({data:n})=>{n.success?e():t()},{once:!0}),this._worker.addEventListener("error",e=>{t(e)},{once:!0})})),this._ensureReadyPromise}destroy(){Tn&&An.log("Destroying compression worker"),this._worker.terminate()}postMessage(e,t){const n=this._getAndIncrementId();return new Promise((r,o)=>{const s=({data:t})=>{const i=t;if(i.method===e&&i.id===n){if(this._worker.removeEventListener("message",s),!i.success)return Tn&&An.error("Error in compression worker: ",i.response),void o(new Error("Error in compression worker"));r(i.response)}};this._worker.addEventListener("message",s),this._worker.postMessage({id:n,method:e,arg:t})})}_getAndIncrementId(){return this._id++}}class Nn{constructor(e){this._worker=new xn(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){const t=Jt(e.timestamp);(!this._earliestTimestamp||t<this._earliestTimestamp)&&(this._earliestTimestamp=t);const n=JSON.stringify(e);return this._totalSize+=n.length,this._totalSize>P?Promise.reject(new Cn):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{Tn&&An.exception(e,'Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){const e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}}class On{constructor(e){this._fallback=new Rn,this._compression=new Nn(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}set waitForCheckout(e){this._used.waitForCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){return void(Tn&&An.exception(e,"Failed to load the compression worker, falling back to simple buffer"))}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:e,hasCheckout:t,waitForCheckout:n}=this._fallback,r=[];for(const t of e)r.push(this._compression.addEvent(t));this._compression.hasCheckout=t,this._compression.waitForCheckout=n,this._used=this._compression;try{await Promise.all(r),this._fallback.clear()}catch(e){Tn&&An.exception(e,"Failed to add events when switching buffers.")}}}function Mn({useCompression:e,workerUrl:t}){if(e&&window.Worker){const e=function(e){try{const t=e||function(){if("undefined"==typeof __SENTRY_EXCLUDE_REPLAY_WORKER__||!__SENTRY_EXCLUDE_REPLAY_WORKER__)return function(){const e=new Blob(['var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});']);return URL.createObjectURL(e)}();return""}();if(!t)return;Tn&&An.log("Using compression worker"+(e?` from ${e}`:""));const n=new Worker(t);return new On(n)}catch(e){Tn&&An.exception(e,"Failed to create compression worker")}}(t);if(e)return e}return Tn&&An.log("Using simple buffer"),new Rn}function Ln(){try{return"sessionStorage"in N&&!!N.sessionStorage}catch{return!1}}function Dn(e){!function(){if(!Ln())return;try{N.sessionStorage.removeItem(O)}catch{}}(),e.session=void 0}function Pn(e){return void 0!==e&&Math.random()<e}function Un(e){if(Ln())try{N.sessionStorage.setItem(O,JSON.stringify(e))}catch{}}function Bn(e){const t=Date.now();return{id:e.id||(0,_.uuid4)(),started:e.started||t,lastActivity:e.lastActivity||t,segmentId:e.segmentId||0,sampled:e.sampled,previousSessionId:e.previousSessionId}}function Fn({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const o=function(e,t){return Pn(e)?"session":!!t&&"buffer"}(e,t),s=Bn({sampled:o,previousSessionId:r});return n&&Un(s),s}function Gn(e,t,n=+new Date){return null===e||void 0===t||t<0||0!==t&&e+t<=n}function Hn(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return Gn(e.started,t,r)||Gn(e.lastActivity,n,r)}function Wn(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!!Hn(e,{sessionIdleExpire:t,maxReplayDuration:n})&&("buffer"!==e.sampled||0!==e.segmentId)}function zn({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){const o=r.stickySession&&function(){if(!Ln())return null;try{const e=N.sessionStorage.getItem(O);if(!e)return null;const t=JSON.parse(e);return Tn&&An.infoTick("Loading existing session"),Bn(t)}catch{return null}}();return o?Wn(o,{sessionIdleExpire:e,maxReplayDuration:t})?(Tn&&An.infoTick("Session in sessionStorage is expired, creating new one..."),Fn(r,{previousSessionId:o.id})):o:(Tn&&An.infoTick("Creating new session"),Fn(r,{previousSessionId:n}))}function jn(e,t,n){return!!qn(e,t)&&($n(e,t,n),!0)}async function $n(e,t,n){const{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;const o="buffer"===e.recordingMode;try{n&&o&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const s=function(e,t){try{if("function"==typeof t&&function(e){return e.type===et.Custom}(e))return t(e)}catch(e){return Tn&&An.exception(e,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}(t,e.getOptions().beforeAddRecordingEvent);if(!s)return;return await r.addEvent(s)}catch(t){const n=t&&t instanceof Cn,s=n?"addEventSizeExceeded":"addEvent",a=(0,i.getClient)();if(a){const e=n?"buffer_overflow":"internal_sdk_error";a.recordDroppedEvent(e,"replay")}if(n&&o)return r.clear(),r.waitForCheckout=!0,null;e.handleException(t),await e.stop({reason:s})}}function qn(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=Jt(t.timestamp);return!(n+e.timeouts.sessionIdlePause<Date.now())&&(!(n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration)||(Tn&&An.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1))}function Jn(e){return!e.type}function Vn(e){return"transaction"===e.type}function Kn(e){return"feedback"===e.type}function Yn(e){return(t,n)=>{if(!e.isEnabled()||!Jn(t)&&!Vn(t))return;const r=n.statusCode;!r||r<200||r>=300||(Vn(t)?function(e,t){const n=e.getContext();t.contexts?.trace?.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}(e,t):function(e,t){const n=e.getContext();t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id);if("buffer"!==e.recordingMode||!t.tags||!t.tags.replayId)return;const{beforeErrorSampling:r}=e.getOptions();if("function"==typeof r&&!r(t))return;(0,C.setTimeout)(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(t){e.handleException(t)}})}(e,t))}}function Qn(e){return t=>{e.isEnabled()&&Jn(t)&&function(e,t){const n=t.exception?.values?.[0]?.value;if("string"!=typeof n)return;if(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i)){Kt(e,an({category:"replay.hydrate-error",data:{url:(0,h.getLocationHref)()}}))}}(e,t)}}function Xn(e){const t=(0,i.getClient)();t&&t.on("beforeAddBreadcrumb",t=>function(e,t){if(!e.isEnabled()||!Zn(t))return;const n=function(e){if(!Zn(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui."))return null;if("console"===e.category)return function(e){const t=e.data?.arguments;if(!Array.isArray(t)||0===t.length)return an(e);let n=!1;const r=t.map(e=>{if(!e)return e;if("string"==typeof e)return e.length>D?(n=!0,`${e.slice(0,D)}…`):e;if("object"==typeof e)try{const t=(0,y.normalize)(e,7);return JSON.stringify(t).length>D?(n=!0,`${JSON.stringify(t,null,2).slice(0,D)}…`):t}catch{}return e});return an({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}(e);return an(e)}(t);n&&Kt(e,n)}(e,t))}function Zn(e){return!!e.category}function er(){const e=(0,i.getCurrentScope)().getPropagationContext().dsc;e&&delete e.replay_id;const t=(0,l.getActiveSpan)();if(t){delete(0,r.getDynamicSamplingContextFromSpan)(t).replay_id}}function tr(e){return Object.assign((t,n)=>{if(!e.isEnabled()||e.isPaused())return t;if(function(e){return"replay_event"===e.type}(t))return delete t.breadcrumbs,t;if(!Jn(t)&&!Vn(t)&&!Kn(t))return t;if(!e.checkAndHandleExpiredSession())return er(),t;if(Kn(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),function(e,t){e.triggerUserActivity(),e.addUpdate(()=>!t.timestamp||(e.throttledAddEvent({type:et.Custom,timestamp:1e3*t.timestamp,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1))}(e,t),t;if(function(e,t){return!(e.type||!e.exception?.values?.length||!t.originalException?.__rrweb__)}(t,n)&&!e.getOptions()._experiments.captureExceptions)return Tn&&An.log("Ignoring error from rrweb internals",t),null;const r=function(e,t){return"buffer"===e.recordingMode&&t.message!==M&&!(!t.exception||t.type)&&Pn(e.getOptions().errorSampleRate)}(e,t);return(r||"session"===e.recordingMode)&&(t.tags={...t.tags,replayId:e.getSessionId()}),t},{id:"Replay"})}function nr(e,t){return t.map(({type:t,start:n,end:r,name:o,data:s})=>{const i=e.throttledAddEvent({type:et.Custom,timestamp:n,data:{tag:"performanceSpan",payload:{op:t,description:o,startTimestamp:n,endTimestamp:r,data:s}}});return"string"==typeof i?Promise.resolve(null):i})}function rr(e){return t=>{if(!e.isEnabled())return;const n=function(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}(t);null!==n&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(nr(e,[n]),!1)))}}function or(e,t){e.isEnabled()&&null!==t&&(function(e,t){return(!Tn||!e.getOptions()._experiments.traceInternals)&&(0,c.isSentryRequestUrl)(t,(0,i.getClient)())}(e,t.name)||e.addUpdate(()=>(nr(e,[t]),!0)))}function sr(e){if(!e)return;const t=new TextEncoder;try{if("string"==typeof e)return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){const n=(0,x.serializeFormData)(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function ir(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function ar(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function cr(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:o,method:s,statusCode:i,request:a,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:o,data:{method:s,statusCode:i,request:a,response:c}}}function lr(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function ur(e,t,n){if(!t&&0===Object.keys(e).length)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};const r={headers:e,size:t},{body:o,warnings:s}=function(e){if(!e||"string"!=typeof e)return{body:e};const t=e.length>L,n=function(e){const t=e[0],n=e[e.length-1];return"["===t&&"]"===n||"{"===t&&"}"===n}(e);if(t){const t=e.slice(0,L);return n?{body:t,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${t}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}(n);return r.body=o,s?.length&&(r._meta={warnings:s}),r}function dr(e,t){return Object.entries(e).reduce((n,[r,o])=>{const s=r.toLowerCase();return t.includes(s)&&e[r]&&(n[s]=o),n},{})}function pr(e,t){const n=function(e,t=N.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(N.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;if(!e.endsWith("/")&&r.endsWith("/"))return r.slice(0,-1);return r}(e);return(0,E.stringMatchesSomePattern)(n,t)}async function hr(e,t,n){try{const r=await async function(e,t,n){const r=Date.now(),{startTimestamp:o=r,endTimestamp:s=r}=t,{url:i,method:a,status_code:c=0,request_body_size:l,response_body_size:u}=e.data,d=pr(i,n.networkDetailAllowUrls)&&!pr(i,n.networkDetailDenyUrls),p=d?function({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const o=n?function(e,t){if(1===e.length&&"string"!=typeof e[0])return mr(e[0],t);if(2===e.length)return mr(e[1],t);return{}}(n,t):{};if(!e)return ur(o,r,void 0);const s=(0,x.getFetchRequestArgBody)(n),[i,a]=(0,x.getBodyString)(s,An),c=ur(o,r,i);if(a)return ar(c,a);return c}(n,t.input,l):lr(l),h=await async function(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,o){if(!e&&void 0!==o)return lr(o);const s=r?fr(r.headers,n):{};if(!r||!t&&void 0!==o)return ur(s,o,void 0);const[i,a]=await async function(e){const t=function(e){try{return e.clone()}catch(e){Tn&&An.exception(e,"Failed to clone response body")}}(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{const e=await function(e){return new Promise((t,n)=>{const r=(0,C.setTimeout)(()=>n(new Error("Timeout while trying to read response body")),500);(async function(e){return await e.text()})(e).then(e=>t(e),e=>n(e)).finally(()=>clearTimeout(r))})}(t);return[e]}catch(e){return e instanceof Error&&e.message.indexOf("Timeout")>-1?(Tn&&An.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(Tn&&An.exception(e,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}(r),c=function(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:o}){try{const s=e?.length&&void 0===n?sr(e):n;return r?ur(o,s,t?e:void 0):lr(s)}catch(e){return Tn&&An.exception(e,"Failed to serialize response body"),ur(o,n,void 0)}}(i,{networkCaptureBodies:t,responseBodySize:o,captureDetails:e,headers:s});if(a)return ar(c,a);return c}(d,n,t.response,u);return{startTimestamp:o,endTimestamp:s,url:i,method:a,statusCode:c,request:p,response:h}}(e,t,n),o=cr("resource.fetch",r);or(n.replay,o)}catch(e){Tn&&An.exception(e,"Failed to capture fetch breadcrumb")}}function fr(e,t){const n={};return t.forEach(t=>{e.get(t)&&(n[t]=e.get(t))}),n}function mr(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?fr(n,t):Array.isArray(n)?{}:dr(n,t):{}}async function gr(e,t,n){try{const r=function(e,t,n){const r=Date.now(),{startTimestamp:o=r,endTimestamp:s=r,input:i,xhr:a}=t,{url:c,method:l,status_code:u=0,request_body_size:d,response_body_size:p}=e.data;if(!c)return null;if(!a||!pr(c,n.networkDetailAllowUrls)||pr(c,n.networkDetailDenyUrls)){return{startTimestamp:o,endTimestamp:s,url:c,method:l,statusCode:u,request:lr(d),response:lr(p)}}const h=a[R.SENTRY_XHR_DATA_KEY],f=h?dr(h.request_headers,n.networkRequestHeaders):{},m=dr((0,x.parseXhrResponseHeaders)(a),n.networkResponseHeaders),[g,_]=n.networkCaptureBodies?(0,x.getBodyString)(i,An):[void 0],[y,S]=n.networkCaptureBodies?function(e){const t=[];try{return[e.responseText]}catch(e){t.push(e)}try{return function(e,t){try{if("string"==typeof e)return[e];if(e instanceof Document)return[e.body.outerHTML];if("json"===t&&e&&"object"==typeof e)return[JSON.stringify(e)];if(!e)return[void 0]}catch(t){return Tn&&An.exception(t,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Tn&&An.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}(e.response,e.responseType)}catch(e){t.push(e)}return Tn&&An.warn("Failed to get xhr response body",...t),[void 0]}(a):[void 0],b=ur(f,d,g),E=ur(m,p,y);return{startTimestamp:o,endTimestamp:s,url:c,method:l,statusCode:u,request:_?ar(b,_):b,response:S?ar(E,S):E}}(e,t,n),o=cr("resource.xhr",r);or(n.replay,o)}catch(e){Tn&&An.exception(e,"Failed to capture xhr breadcrumb")}}function _r(e,t){const{xhr:n,input:r}=t;if(!n)return;const o=sr(r),s=n.getResponseHeader("content-length")?ir(n.getResponseHeader("content-length")):function(e,t){try{return sr("json"===t&&e&&"object"==typeof e?JSON.stringify(e):e)}catch{return}}(n.response,n.responseType);void 0!==o&&(e.data.request_body_size=o),void 0!==s&&(e.data.response_body_size=s)}function yr(e){const t=(0,i.getClient)();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:i}=e.getOptions(),a={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:i};t&&t.on("beforeAddBreadcrumb",(e,t)=>function(e,t,n){if(!t.data)return;try{(function(e){return"xhr"===e.category})(t)&&function(e){return e?.xhr}(n)&&(_r(t,n),gr(t,n,e)),function(e){return"fetch"===e.category}(t)&&function(e){return e?.response}(n)&&(!function(e,t){const{input:n,response:r}=t,o=sr(n?(0,x.getFetchRequestArgBody)(n):void 0),s=r?ir(r.headers.get("content-length")):void 0;void 0!==o&&(e.data.request_body_size=o),void 0!==s&&(e.data.response_body_size=s)}(t,n),hr(t,n,e))}catch(e){Tn&&An.exception(e,"Error when enriching network breadcrumb")}}(a,e,t))}catch{}}function Sr(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,o=Date.now()/1e3;return{type:"memory",name:"memory",start:o,end:o,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}const br=f.GLOBAL_OBJ.navigator;function Er(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession())return void(Tn&&An.warn("Received replay event after session expired."));const o=r||!t;t=!0,e.clickDetector&&sn(e.clickDetector,n),e.addUpdate(()=>{if("buffer"===e.recordingMode&&o&&e.setInitialState(),!jn(e,n,o))return!0;if(!o)return!1;const t=e.session;if(function(e,t){if(!t||!e.session||0!==e.session.segmentId)return;jn(e,function(e){const t=e.getOptions();return{type:et.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:!!e.eventBuffer&&"worker"===e.eventBuffer.type,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}(e),!1)}(e,o),"buffer"===e.recordingMode&&t&&e.eventBuffer){const n=e.eventBuffer.getEarliestTimestamp();n&&(Tn&&An.log(`Updating session start time to earliest event in buffer to ${new Date(n)}`),t.started=n,e.getOptions().stickySession&&Un(t))}return t?.previousSessionId||"session"===e.recordingMode&&e.flush(),!0})}}async function vr({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:o,session:s}){const c=function({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)}\n`;if("string"==typeof e)n=`${r}${e}`;else{const t=(new TextEncoder).encode(r);n=new Uint8Array(t.length+e.length),n.set(t),n.set(e,t.length)}return n}({recordingData:e,headers:{segment_id:n}}),{urls:l,errorIds:u,traceIds:d,initialTimestamp:p}=r,h=(0,i.getClient)(),f=(0,i.getCurrentScope)(),m=h?.getTransport(),g=h?.getDsn();if(!(h&&m&&g&&s.sampled))return Promise.resolve({});const _={type:"replay_event",replay_start_timestamp:p/1e3,timestamp:o/1e3,error_ids:u,trace_ids:d,urls:l,replay_id:t,segment_id:n,replay_type:s.sampled},y=await async function({client:e,scope:t,replayId:n,event:r}){const o={event_id:n,integrations:"object"!=typeof e._integrations||null===e._integrations||Array.isArray(e._integrations)?void 0:Object.keys(e._integrations)};e.emit("preprocessEvent",r,o);const s=await(0,a.prepareEvent)(e.getOptions(),r,o,t,e,(0,i.getIsolationScope)());if(!s)return null;e.emit("postprocessEvent",s,o),s.platform=s.platform||"javascript";const c=e.getSdkMetadata(),{name:l,version:u,settings:d}=c?.sdk||{};return s.sdk={...s.sdk,name:l||"sentry.javascript.unknown",version:u||"0.0.0",settings:d},s}({scope:f,client:h,replayId:t,event:_});if(!y)return h.recordDroppedEvent("event_processor","replay"),Tn&&An.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete y.sdkProcessingMetadata;const S=function(e,t,n,r){return(0,T.createEnvelope)((0,T.createEventEnvelopeHeaders)(e,(0,T.getSdkMetadataForEnvelopeHeader)(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:"string"==typeof t?(new TextEncoder).encode(t).length:t.length},t]])}(y,c,g,h.getOptions().tunnel);let b;try{b=await m.send(S)}catch(e){const t=new Error(M);try{t.cause=e}catch{}throw t}if("number"==typeof b.statusCode&&(b.statusCode<200||b.statusCode>=300))throw new Tr(b.statusCode);const E=(0,I.updateRateLimits)({},b);if((0,I.isRateLimited)(E,"replay"))throw new Ir(E);return b}class Tr extends Error{constructor(e){super(`Transport returned status code ${e}`)}}class Ir extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}}async function kr(e,t={count:0,interval:5e3}){const{recordingData:n,onError:r}=e;if(n.length)try{return await vr(e),!0}catch(n){if(n instanceof Tr||n instanceof Ir)throw n;if((0,s.setContext)("Replays",{_retryCount:t.count}),r&&r(n),t.count>=3){const e=new Error(`${M} - max retries exceeded`);try{e.cause=n}catch{}throw e}return t.interval*=++t.count,new Promise((n,r)=>{(0,C.setTimeout)(async()=>{try{await kr(e,t),n(!0)}catch(e){r(e)}},t.interval)})}}const wr="__THROTTLED";function Ar(e,t,n){const r=new Map;let o=!1;return(...s)=>{const i=Math.floor(Date.now()/1e3);if((e=>{const t=e-n;r.forEach((e,n)=>{n<t&&r.delete(n)})})(i),[...r.values()].reduce((e,t)=>e+t,0)>=t){const e=o;return o=!0,e?"__SKIPPED":wr}o=!1;const a=r.get(i)||0;return r.set(i,a+1),e(...s)}}class Cr{constructor({options:e,recordingOptions:t}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:3e5,sessionIdleExpire:9e5},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=t,this._options=e,this._debouncedFlush=function(e,t,n){return(0,d.debounce)(e,t,{...n,setTimeoutImpl:C.setTimeout})}(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=Ar((e,t)=>function(e,t,n){return qn(e,t)?$n(e,t,n):Promise.resolve(null)}(this,e,t),300,5);const{slowClickTimeout:n,slowClickIgnoreSelectors:r}=this.getOptions(),o=n?{threshold:Math.min(3e3,n),timeout:n,scrollTimeout:300,ignoreSelector:r?r.join(","):""}:void 0;if(o&&(this.clickDetector=new nn(this,o)),Tn){const t=e._experiments;An.setConfig({captureExceptions:!!t.captureExceptions,traceInternals:!!t.traceInternals})}this._handleVisibilityChange=()=>{"visible"===N.document.visibilityState?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const e=an({category:"ui.blur"});this._doChangeToBackgroundTasks(e)},this._handleWindowFocus=()=>{const e=an({category:"ui.focus"});this._doChangeToForegroundTasks(e)},this._handleKeyboardEvent=e=>{hn(this,e)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return Boolean(this._canvas)}getOptions(){return this._options}handleException(e){Tn&&An.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){const{errorSampleRate:t,sessionSampleRate:n}=this._options,r=t<=0&&n<=0;this._requiresManualStart=r,r||(this._initializeSessionForSampling(e),this.session?!1!==this.session.sampled&&(this.recordingMode="buffer"===this.session.sampled&&0===this.session.segmentId?"buffer":"session",Tn&&An.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording()):Tn&&An.exception(new Error("Unable to initialize and create session")))}start(){if(this._isEnabled&&"session"===this.recordingMode)return void(Tn&&An.log("Recording is already in progress"));if(this._isEnabled&&"buffer"===this.recordingMode)return void(Tn&&An.log("Buffering is in progress, call `flush()` to save the replay"));Tn&&An.infoTick("Starting replay in session mode"),this._updateUserActivity();const e=zn({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled)return void(Tn&&An.log("Buffering is in progress, call `flush()` to save the replay"));Tn&&An.infoTick("Starting replay in buffer mode");const e=zn({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const e=this._canvas;this._stopRecording=jt({...this._recordingOptions,..."buffer"===this.recordingMode?{checkoutEveryNms:6e4}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:Er(this),.../iPhone|iPad|iPod/i.test(br?.userAgent??"")||/Macintosh/i.test(br?.userAgent??"")&&br?.maxTouchPoints&&br?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{},onMutation:this._onMutationHandler.bind(this),...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this.handleException(e),!1}}async stop({forceFlush:e=!1,reason:t}={}){if(this._isEnabled){this._isEnabled=!1,this.recordingMode="buffer";try{Tn&&An.log("Stopping Replay"+(t?` triggered by ${t}`:"")),er(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,Dn(this)}catch(e){this.handleException(e)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Tn&&An.log("Pausing replay"))}resume(){this._isPaused&&this._checkSession()&&(this._isPaused=!1,this.startRecording(),Tn&&An.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if("session"===this.recordingMode)return this.flushImmediate();const t=Date.now();Tn&&An.log("Converting buffer to session"),await this.flushImmediate();const n=this.stopRecording();e&&n&&"session"!==this.recordingMode&&(this.recordingMode="session",this.session&&(this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession()),this.startRecording())}addUpdate(e){const t=e();"buffer"!==this.recordingMode&&this._isEnabled&&!0!==t&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),this._stopRecording)this.checkAndHandleExpiredSession(),this._updateSessionActivity();else{if(!this._checkSession())return;this.resume()}}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return"buffer"===this.recordingMode?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(e){if(!e||!1!==this.session?.sampled)return this.session?.id}checkAndHandleExpiredSession(){if(!(this._lastActivity&&Gn(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&"session"===this.session.sampled))return!!this._checkSession();this.pause()}setInitialState(){const e=`${N.location.pathname}${N.location.hash}${N.location.search}`,t=`${N.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){const n=this._throttledAddEvent(e,t);if(n===wr){const e=an({category:"replay.throttled"});this.addUpdate(()=>!jn(this,{type:5,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e,metric:!0}}))}return n}getCurrentRoute(){const e=this.lastActiveSpan||(0,l.getActiveSpan)(),t=e&&(0,l.getRootSpan)(e),n=(t&&(0,l.spanToJSON)(t).data||{})[o.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];if(t&&n&&["route","custom"].includes(n))return(0,l.spanToJSON)(t).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=Mn({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_initializeSessionForSampling(e){const t=this._options.errorSampleRate>0,n=zn({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t});this.session=n}_checkSession(){if(!this.session)return!1;const e=this.session;return!Wn(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(e),!1)}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(e.id))}_addListeners(){try{N.document.addEventListener("visibilitychange",this._handleVisibilityChange),N.addEventListener("blur",this._handleWindowBlur),N.addEventListener("focus",this._handleWindowFocus),N.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(!function(e){const t=(0,i.getClient)();(0,w.addClickKeypressInstrumentationHandler)(dn(e)),(0,A.addHistoryInstrumentationHandler)(rr(e)),Xn(e),yr(e);const n=tr(e);(0,s.addEventProcessor)(n),t&&(t.on("beforeSendEvent",Qn(e)),t.on("afterSendEvent",Yn(e)),t.on("createDsc",t=>{const n=e.getSessionId();n&&e.isEnabled()&&"session"===e.recordingMode&&e.checkAndHandleExpiredSession()&&(t.replay_id=n)}),t.on("spanStart",t=>{e.lastActiveSpan=t}),t.on("spanEnd",t=>{e.lastActiveSpan=t}),t.on("beforeSendFeedback",async(t,n)=>{const r=e.getSessionId();n?.includeReplay&&e.isEnabled()&&r&&t.contexts?.feedback&&("api"===t.contexts.feedback.source&&await e.sendBufferedReplayOrFlush(),t.contexts.feedback.replay_id=r)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}(this),this._hasInitializedCoreListeners=!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=function(e){function t(t){e.performanceEntries.includes(t)||e.performanceEntries.push(t)}function n({entries:e}){e.forEach(t)}const r=[];return["navigation","paint","resource"].forEach(e=>{r.push((0,k.addPerformanceInstrumentationHandler)(e,n))}),r.push((0,k.addLcpInstrumentationHandler)(mn(yn,e)),(0,k.addClsInstrumentationHandler)(mn(bn,e)),(0,k.addInpInstrumentationHandler)(mn(En,e))),()=>{r.forEach(e=>e())}}(this)}_removeListeners(){try{N.document.removeEventListener("visibilitychange",this._handleVisibilityChange),N.removeEventListener("blur",this._handleWindowBlur),N.removeEventListener("focus",this._handleWindowFocus),N.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}_doChangeToBackgroundTasks(e){if(!this.session)return;Hn(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(e&&this._createCustomBreadcrumb(e),this.conditionalFlush())}_doChangeToForegroundTasks(e){if(!this.session)return;this.checkAndHandleExpiredSession()?e&&this._createCustomBreadcrumb(e):Tn&&An.log("Document has become active, but session has expired")}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:et.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){let e=(t=this.performanceEntries,t.map(gn).filter(Boolean)).concat(this.replayPerformanceEntries);var t;if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const t=this._context.initialTimestamp/1e3;e=e.filter(e=>e.start>=t)}return Promise.all(nr(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:t}=this;if(!e||!t||this._requiresManualStart)return;if(e.segmentId)return;const n=t.getEarliestTimestamp();n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}_popEventContext(){const e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){const e=this.getSessionId();if(this.session&&this.eventBuffer&&e){if(await this._addPerformanceEntries(),this.eventBuffer?.hasEvents&&(await async function(e){try{return Promise.all(nr(e,[Sr(N.performance.memory)]))}catch{return[]}}(this),this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const t=Date.now();if(t-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession();const o=await this.eventBuffer.finish();await kr({replayId:e,recordingData:o,segmentId:r,eventContext:n,session:this.session,timestamp:t,onError:e=>this.handleException(e)})}catch(e){this.handleException(e),this.stop({reason:"sendReplay"});const t=(0,i.getClient)();if(t){const n=e instanceof Ir?"ratelimit_backoff":"send_error";t.recordDroppedEvent(n,"replay")}}}else Tn&&An.error("No session or eventBuffer found to flush.")}async _flush({force:e=!1}={}){if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession())return void(Tn&&An.error("Attempting to finish replay event after session expired."));if(!this.session)return;const t=this.session.started,n=Date.now()-t;this._debouncedFlush.cancel();const r=n<this._options.minReplayDuration,o=n>this._options.maxReplayDuration+5e3;if(r||o)return Tn&&An.log(`Session duration (${Math.floor(n/1e3)}s) is too ${r?"short":"long"}, not sending replay.`),void(r&&this._debouncedFlush());const s=this.eventBuffer;s&&0===this.session.segmentId&&!s.hasCheckout&&Tn&&An.log("Flushing initial segment without checkout.");const i=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(e){this.handleException(e)}finally{this._flushLock=void 0,i&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&Un(this.session)}_onMutationHandler(e){const{ignoreMutations:t}=this._options._experiments;if(t?.length&&e.some(e=>{const n=function(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}(e.target),r=t.join(",");return n?.matches(r)}))return!1;const n=e.length,r=this._options.mutationLimit,o=r&&n>r;if(n>this._options.mutationBreadcrumbLimit||o){const e=an({category:"replay.mutations",data:{count:n,limit:o}});this._createCustomBreadcrumb(e)}return!o||(this.stop({reason:"mutationLimit",forceFlush:"session"===this.recordingMode}),!1)}}function Rr(e,t){return[...e,...t].join(",")}const xr='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Nr=["content-length","content-type","accept"];let Or=!1;const Mr=e=>new Lr(e);class Lr{constructor({flushMinDelay:e=5e3,flushMaxDelay:t=5500,minReplayDuration:n=4999,maxReplayDuration:r=36e5,stickySession:o=!0,useCompression:s=!0,workerUrl:i,_experiments:a={},maskAllText:c=!0,maskAllInputs:l=!0,blockAllMedia:u=!0,mutationBreadcrumbLimit:d=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:f=[],networkDetailAllowUrls:g=[],networkDetailDenyUrls:_=[],networkCaptureBodies:y=!0,networkRequestHeaders:S=[],networkResponseHeaders:b=[],mask:E=[],maskAttributes:v=["title","placeholder","aria-label"],unmask:T=[],block:I=[],unblock:k=[],ignore:w=[],maskFn:A,beforeAddRecordingEvent:C,beforeErrorSampling:R,onError:x}={}){this.name="Replay";const N=function({mask:e,unmask:t,block:n,unblock:r,ignore:o}){return{maskTextSelector:Rr(e,[".sentry-mask","[data-sentry-mask]"]),unmaskTextSelector:Rr(t,[]),blockSelector:Rr(n,[".sentry-block","[data-sentry-block]","base","iframe[srcdoc]:not([src])"]),unblockSelector:Rr(r,[]),ignoreSelector:Rr(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}({mask:E,unmask:T,block:I,unblock:k,ignore:w});if(this._recordingOptions={maskAllInputs:l,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:A,maskInputFn:A,maskAttributeFn:(e,t,n)=>function({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:o,value:s}){return r?o.unmaskTextSelector&&e.matches(o.unmaskTextSelector)?s:n.includes(t)||"value"===t&&"INPUT"===e.tagName&&["submit","button"].includes(e.getAttribute("type")||"")?s.replace(/[\S]/g,"*"):s:s}({maskAttributes:v,maskAllText:c,privacyOptions:N,key:e,value:t,el:n}),...N,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:e=>{try{e.__rrweb__=!0}catch{}},recordCrossOriginIframes:Boolean(a.recordCrossOriginIframes)},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(n,15e3),maxReplayDuration:Math.min(r,U),stickySession:o,useCompression:s,workerUrl:i,blockAllMedia:u,maskAllInputs:l,maskAllText:c,mutationBreadcrumbLimit:d,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:f,networkDetailAllowUrls:g,networkDetailDenyUrls:_,networkCaptureBodies:y,networkRequestHeaders:Dr(S),networkResponseHeaders:Dr(b),beforeAddRecordingEvent:C,beforeErrorSampling:R,onError:x,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${xr}`:xr),this._isInitialized&&(0,m.isBrowser)())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Or}set _isInitialized(e){Or=e}afterAllSetup(e){(0,m.isBrowser)()&&!this._replay&&(this._setup(e),this._initialize(e))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:"session"===this._replay.recordingMode}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(e){if(this._replay?.isEnabled())return this._replay.getSessionId(e)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){const t=function(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},o=(0,u.parseSampleRate)(n.replaysSessionSampleRate),s=(0,u.parseSampleRate)(n.replaysOnErrorSampleRate);null==o&&null==s&&(0,g.consoleSandbox)(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")});null!=o&&(r.sessionSampleRate=o);null!=s&&(r.errorSampleRate=s);return r}(this._initialOptions,e);this._replay=new Cr({options:t,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{const t=e.getIntegrationByName("ReplayCanvas");if(!t)return;this._replay._canvas=t.getOptions()}catch{}}}function Dr(e){return[...Nr,...e.map(e=>e.toLowerCase())]}function Pr(){const e=(0,i.getClient)();return e?.getIntegrationByName("Replay")}},399:(e,t,n)=>{function r(e,t,n){let r,o,s;const i=n?.maxWait?Math.max(n.maxWait,t):0,a=n?.setTimeoutImpl||setTimeout;function c(){return l(),r=e(),r}function l(){void 0!==o&&clearTimeout(o),void 0!==s&&clearTimeout(s),o=s=void 0}function u(){return o&&clearTimeout(o),o=a(c,t),i&&void 0===s&&(s=a(c,i)),r}return u.cancel=l,u.flush=function(){return void 0!==o||void 0!==s?c():r},u}n.r(t),n.d(t,{debounce:()=>r})},400:(e,t,n)=>{n.r(t),n.d(t,{replayCanvasIntegration:()=>P});var r=n(229),o=Object.defineProperty,s=(e,t,n)=>((e,t,n)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class i{constructor(){s(this,"idNodeMap",new Map),s(this,"nodeMetaMap",new WeakMap)}getId(e){if(!e)return-1;const t=this.getMeta(e)?.id;return t??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function a(e,t,n=1/0,r=0){return e?e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:a(e.parentNode,t,n,r+1):-1}function c(e,t){return n=>{const r=n;if(null===r)return!1;try{if(e)if("string"==typeof e){if(r.matches(`.${e}`))return!0}else if(function(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}(r,e))return!0;return!(!t||!r.matches(t))}catch{return!1}}}const l="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let u={map:{},getId:()=>(console.error(l),-1),getNode:()=>(console.error(l),null),removeNodeFromMap(){console.error(l)},has:()=>(console.error(l),!1),reset(){console.error(l)}};function d(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){_(()=>{n.set.call(this,e)},0),s&&s.set&&s.set.call(this,e)}}),()=>d(e,t,s||{},!0)}function p(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}function h(e,t,n,r,o){if(!e)return!1;const s=function(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch(e){return null}}(e);if(!s)return!1;const i=c(t,n);if(!o){const e=r&&s.matches(r);return i(s)&&!e}const l=a(s,i);let u=-1;return!(l<0)&&(r&&(u=a(s,c(null,r))),l>-1&&u<0||l<u)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(u=new Proxy(u,{get:(e,t,n)=>("map"===t&&console.error(l),Reflect.get(e,t,n))})),Date.now().toString();const f={};function m(e){const t=f[e];if(t)return t;const n=window.document;let r=window[e];if(n&&"function"==typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const o=t.contentWindow;o&&o[e]&&(r=o[e]),n.head.removeChild(t)}catch(e){}return f[e]=r.bind(window)}function g(...e){return m("requestAnimationFrame")(...e)}function _(...e){return m("setTimeout")(...e)}var y=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(y||{});let S;const b=e=>{if(!S)return e;return(...t)=>{try{return e(...t)}catch(e){if(S&&!0===S(e))return()=>{};throw e}}};for(var E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",v="undefined"==typeof Uint8Array?[]:new Uint8Array(256),T=0;T<64;T++)v[E.charCodeAt(T)]=T;const I=new Map;const k=(e,t,n)=>{if(!e||!C(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=I.get(e);return n||(n=new Map,I.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function w(e,t,n){if(e instanceof Array)return e.map(e=>w(e,t,n));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=E[n[t]>>2],o+=E[(3&n[t])<<4|n[t+1]>>4],o+=E[(15&n[t+1])<<2|n[t+2]>>6],o+=E[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[w(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[w(e.data,t,n),e.width,e.height]}}if(C(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:k(e,t,n)}}return e}const A=(e,t,n)=>e.map(e=>w(e,t,n)),C=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function R(e,t,n,r,o){const s=[];try{const i=p(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...i){if(!h(this,t,n,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(s);if("__context"in this||(this.__context=e),o&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){const e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[s,...i])}});s.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(e=>e())}}function x(e,t,n,r,o,s,i,a){const c=[],l=Object.getOwnPropertyNames(e);for(const i of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if("function"!=typeof e[i])continue;const l=p(e,i,function(e){return function(...c){const l=e.apply(this,c);if(k(l,a,this),"tagName"in this.canvas&&!h(this.canvas,r,o,s,!0)){const e=A(c,a,this),r={type:t,property:i,args:e};n(this.canvas,r)}return l}});c.push(l)}catch{const r=d(e,i,{set(e){n(this.canvas,{type:t,property:i,args:[e],setter:!0})}});c.push(r)}return c}class N{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.shadowDoms=new Set,this.windowsSet=new WeakSet,this.windows=[],this.restoreHandlers=[],this.frozen=!1,this.locked=!1,this.snapshotInProgressMap=new Map,this.worker=null,this.lastSnapshotTime=0,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{enableManualSnapshot:t,sampling:n="all",win:r,recordCanvas:o,errorHandler:s}=e;e.sampling=n,this.mutationCb=e.mutationCb,this.mirror=e.mirror,this.options=e,s&&(S=s),(o&&"number"==typeof n||t)&&(this.worker=this.initFPSWorker()),this.addWindow(r),t||b(()=>{o&&"all"===n&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),o&&"number"==typeof n&&this.initCanvasFPSObserver()})()}reset(){this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.windowsSet=new WeakSet,this.windows=[],this.shadowDoms=new Set,this.worker?.terminate(),this.worker=null,this.snapshotInProgressMap=new Map}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}addWindow(e){const{sampling:t="all",blockClass:n,blockSelector:r,unblockSelector:o,recordCanvas:s,enableManualSnapshot:i}=this.options;if(!this.windowsSet.has(e)){if(i)return this.windowsSet.add(e),void this.windows.push(new WeakRef(e));b(()=>{if(s&&"all"===t&&this.initCanvasMutationObserver(e,n,r,o),s&&"number"==typeof t){const t=R(e,n,r,o,!0);this.restoreHandlers.push(()=>{t()})}})(),this.windowsSet.add(e),this.windows.push(new WeakRef(e))}}addShadowRoot(e){this.shadowDoms.add(new WeakRef(e))}resetShadowRoots(){this.shadowDoms=new Set}snapshot(e,t){t?.skipRequestAnimationFrame?this.takeSnapshot(performance.now(),!0,e):g(t=>this.takeSnapshot(t,!0,e))}initFPSWorker(){const e=new Worker(function(){const e=new Blob(['for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)t[e.charCodeAt(a)]=a;var n=function(t){var a,n=new Uint8Array(t),r=n.length,s="";for(a=0;a<r;a+=3)s+=e[n[a]>>2],s+=e[(3&n[a])<<4|n[a+1]>>4],s+=e[(15&n[a+1])<<2|n[a+2]>>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(e<=n&&t<=r)return[e,t];let s=e,i=t;return s>n&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w?.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};']);return URL.createObjectURL(e)}());return e.onmessage=e=>{const t=e.data,{id:n}=t;if(this.snapshotInProgressMap.set(n,!1),!("base64"in t))return;const{base64:r,type:o,width:s,height:i}=t;this.mutationCb({id:n,type:y["2D"],commands:[{property:"clearRect",args:[0,0,s,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:o}]},0,0,s,i]}]})},e}initCanvasFPSObserver(){let e;if(!this.windows.length&&!this.shadowDoms.size)return;const t=n=>{this.takeSnapshot(n,!1),e=g(t)};e=g(t),this.restoreHandlers.push(()=>{e&&cancelAnimationFrame(e)})}initCanvasMutationObserver(e,t,n,r){const o=R(e,t,n,r,!1),s=function(e,t,n,r,o){const s=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])continue;const i=p(t.CanvasRenderingContext2D.prototype,a,function(s){return function(...i){return h(this.canvas,n,r,o,!0)||_(()=>{const n=A(i,t,this);e(this.canvas,{type:y["2D"],property:a,args:n})},0),s.apply(this,i)}});s.push(i)}catch{const n=d(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:y["2D"],property:a,args:[t],setter:!0})}});s.push(n)}return()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,r),i=function(e,t,n,r,o){const s=[];return s.push(...x(t.WebGLRenderingContext.prototype,y.WebGL,e,n,r,o,0,t)),void 0!==t.WebGL2RenderingContext&&s.push(...x(t.WebGL2RenderingContext.prototype,y.WebGL2,e,n,r,o,0,t)),()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,r,this.mirror);this.restoreHandlers.push(()=>{o(),s(),i()})}getCanvasElements(e,t,n){const r=[],o=o=>{o.querySelectorAll("canvas").forEach(o=>{h(o,e,t,n,!0)||r.push(o)})};for(const e of this.windows){const t=e.deref();let n;try{n=t&&t.document}catch{}n&&o(n)}for(const e of this.shadowDoms){const t=e.deref();t&&o(t)}return r}takeSnapshot(e,t,n){const{sampling:r,blockClass:o,blockSelector:s,unblockSelector:i,dataURLOptions:a,maxCanvasSize:c}=this.options,l=1e3/("all"===r?2:r||2);if(this.lastSnapshotTime&&e-this.lastSnapshotTime<l)return!1;this.lastSnapshotTime=e;return(n?[n]:this.getCanvasElements(o,s,i)).forEach(e=>{const n=this.mirror.getId(e);if(this.mirror.hasNode(e)&&e.width&&e.height&&!this.snapshotInProgressMap.get(n)){if(this.snapshotInProgressMap.set(n,!0),!t&&["webgl","webgl2"].includes(e.__context)){const t=e.getContext(e.__context);!1===t?.getContextAttributes()?.preserveDrawingBuffer&&t.clear(t.COLOR_BUFFER_BIT)}createImageBitmap(e).then(t=>{this.worker?.postMessage({id:n,bitmap:t,width:e.width,height:e.height,dataURLOptions:a,maxCanvasSize:c},[t])}).catch(e=>{b(()=>{throw this.snapshotInProgressMap.delete(n),e})()})}}),!0}startPendingCanvasMutationFlusher(){g(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,g(e)};g(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),g(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const{type:t,...n}=e;return n}),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var O,M;new i,(M=O||(O={}))[M.NotStarted=0]="NotStarted",M[M.Running=1]="Running",M[M.Stopped=2]="Stopped";const L={low:{sampling:{canvas:1},dataURLOptions:{type:"image/webp",quality:.25}},medium:{sampling:{canvas:2},dataURLOptions:{type:"image/webp",quality:.4}},high:{sampling:{canvas:4},dataURLOptions:{type:"image/webp",quality:.5}}},D=1280,P=(0,r.defineIntegration)((e={})=>{const[t,n]=e.maxCanvasSize||[],r={quality:e.quality||"medium",enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,D):D,n?Math.min(n,D):D]};let o;const s=new Promise(e=>o=e);return{name:"ReplayCanvas",getOptions(){const{quality:e,enableManualSnapshot:t,maxCanvasSize:n}=r;return{enableManualSnapshot:t,recordCanvas:!0,getCanvasManager:e=>{const r=new N({...e,enableManualSnapshot:t,maxCanvasSize:n,errorHandler:e=>{try{"object"==typeof e&&(e.__rrweb__=!0)}catch{}}});return o(r),r},...L[e]||L.medium}},async snapshot(e,t){(await s).snapshot(e,t)}}})},401:(e,t,n)=>{n.r(t),n.d(t,{reportPageLoaded:()=>o});var r=n(209);function o(e=(0,r.getClient)()){e?.emit("endPageloadSpan")}},402:(e,t,n)=>{n.r(t),n.d(t,{setActiveSpanInBrowser:()=>i});var r=n(209),o=n(245),s=n(228);function i(e){const t=(0,o.getActiveSpan)();if(t===e)return;const n=(0,r.getCurrentScope)();e.end=new Proxy(e.end,{apply:(e,r,o)=>((0,s._setSpanForScope)(n,t),Reflect.apply(e,r,o))}),(0,s._setSpanForScope)(n,e)}},403:(e,t,n)=>{n.r(t),n.d(t,{createStore:()=>c,makeBrowserOfflineTransport:()=>f,push:()=>u,shift:()=>p,unshift:()=>d});var r=n(404),o=n(250),s=n(270),i=n(295);function a(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function c(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=a(n);return e=>r.then(n=>e(n.transaction(t,"readwrite").objectStore(t)))}function l(e){return a(e.getAllKeys())}function u(e,t,n){return e(e=>l(e).then(r=>{if(!(r.length>=n))return e.put(t,Math.max(...r,0)+1),a(e.transaction)}))}function d(e,t,n){return e(e=>l(e).then(r=>{if(!(r.length>=n))return e.put(t,Math.min(...r,0)-1),a(e.transaction)}))}function p(e){return e(e=>l(e).then(t=>{const n=t[0];if(null!=n)return a(e.get(n)).then(t=>(e.delete(n),a(e.transaction).then(()=>t)))}))}function h(e){let t;function n(){return null==t&&(t=c(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async t=>{try{const r=await(0,o.serializeEnvelope)(t);await u(n(),r,e.maxQueueSize||30)}catch{}},unshift:async t=>{try{const r=await(0,o.serializeEnvelope)(t);await d(n(),r,e.maxQueueSize||30)}catch{}},shift:async()=>{try{const e=await p(n());if(e)return(0,o.parseEnvelope)(e)}catch{}}}}function f(e=i.makeFetchTransport){return function(e){return t=>{const n=e({...t,createStore:h});return s.WINDOW.addEventListener("online",async e=>{await n.flush()}),n}}((0,r.makeOfflineTransport)(e))}},404:(e,t,n)=>{n.r(t),n.d(t,{MIN_DELAY:()=>a,START_DELAY:()=>c,makeOfflineTransport:()=>u});var r=n(217),o=n(223),s=n(250),i=n(298);const a=100,c=5e3,l=36e5;function u(e){function t(...e){r.DEBUG_BUILD&&o.debug.log("[Offline]:",...e)}return n=>{const r=e(n);if(!n.createStore)throw new Error("No `createStore` function was provided");const o=n.createStore(n);let u,d=c;function p(e){u&&clearTimeout(u),u=setTimeout(async()=>{u=void 0;const e=await o.shift();e&&(t("Attempting to send previously queued event"),e[0].sent_at=(new Date).toISOString(),f(e,!0).catch(e=>{t("Failed to retry sending",e)}))},e),"number"!=typeof u&&u.unref&&u.unref()}function h(){u||(p(d),d=Math.min(2*d,l))}async function f(e,l=!1){if(!l&&(0,s.envelopeContainsItemType)(e,["replay_event","replay_recording"]))return await o.push(e),p(a),{};try{if(n.shouldSend&&!1===await n.shouldSend(e))throw new Error("Envelope not sent because `shouldSend` callback returned false");const t=await r.send(e);let o=a;if(t)if(t.headers?.["retry-after"])o=(0,i.parseRetryAfterHeader)(t.headers["retry-after"]);else if(t.headers?.["x-sentry-rate-limits"])o=6e4;else if((t.statusCode||0)>=400)return t;return p(o),d=c,t}catch(r){if(await function(e,t,r){return!(0,s.envelopeContainsItemType)(e,["client_report"])&&(!n.shouldStore||n.shouldStore(e,t,r))}(e,r,d))return l?await o.unshift(e):await o.push(e),h(),t("Error sending. Event queued.",r),{};throw r}}return n.flushAtStartup&&h(),{send:f,flush:e=>(void 0===e&&(d=c,p(a)),r.flush(e))}}}},405:(e,t,n)=>{n.r(t),n.d(t,{browserProfilingIntegration:()=>p});var r=n(229),o=n(244),s=n(245),i=n(223),a=n(285),c=n(270),l=n(406),u=n(408),d=n(407);const p=(0,r.defineIntegration)(()=>({name:"BrowserProfiling",setup(e){const t=e.getOptions();if((0,d.hasLegacyProfiling)(t)||t.profileLifecycle||(t.profileLifecycle="manual"),(0,d.hasLegacyProfiling)(t)&&!t.profilesSampleRate)return void(a.DEBUG_BUILD&&i.debug.log("[Profiling] Profiling disabled, no profiling options found."));const n=(0,s.getActiveSpan)(),r=n&&(0,s.getRootSpan)(n);if((0,d.hasLegacyProfiling)(t)&&void 0!==t.profileSessionSampleRate&&a.DEBUG_BUILD&&i.debug.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),(0,d.hasLegacyProfiling)(t))r&&(0,d.isAutomatedPageLoadSpan)(r)&&(0,d.shouldProfileSpanLegacy)(r)&&(0,u.startProfileForSpan)(r),e.on("spanStart",e=>{e===(0,s.getRootSpan)(e)&&(0,d.shouldProfileSpanLegacy)(e)&&(0,u.startProfileForSpan)(e)}),e.on("beforeEnvelope",e=>{if(!(0,d.getActiveProfilesCount)())return;const t=(0,d.findProfiledTransactionsFromEnvelope)(e);if(!t.length)return;const n=[];for(const e of t){const t=e?.contexts,r=t?.profile?.profile_id,o=t?.profile?.start_timestamp;if("string"!=typeof r){a.DEBUG_BUILD&&i.debug.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!r){a.DEBUG_BUILD&&i.debug.log("[Profiling] cannot find profile for a span without a profile context");continue}t?.profile&&delete t.profile;const s=(0,d.takeProfileFromGlobalCache)(r);if(!s){a.DEBUG_BUILD&&i.debug.log(`[Profiling] Could not retrieve profile for span: ${r}`);continue}const c=(0,d.createProfilingEvent)(r,o,s,e);c&&n.push(c)}(0,d.addProfilesToEnvelope)(e,n)});else{const n=(0,d.shouldProfileSession)(t);n||a.DEBUG_BUILD&&i.debug.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization.");if("trace"===t.profileLifecycle){if(!(0,o.hasSpansEnabled)(t))return void(a.DEBUG_BUILD&&i.debug.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing."));const u=new l.BrowserTraceLifecycleProfiler;u.initialize(e,n),r&&u.notifyRootSpanActive(r),c.WINDOW.setTimeout(()=>{const e=(0,s.getActiveSpan)(),t=e&&(0,s.getRootSpan)(e);t&&u.notifyRootSpanActive(t)},0)}}},processEvent:e=>(0,d.attachProfiledThreadToEvent)(e)}))},406:(e,t,n)=>{n.r(t),n.d(t,{BrowserTraceLifecycleProfiler:()=>d});var r=n(209),o=n(245),s=n(238),i=n(223),a=n(219),c=n(250),l=n(285),u=n(407);class d{constructor(){this._client=void 0,this._profiler=void 0,this._chunkTimer=void 0,this._activeRootSpanIds=new Set,this._rootSpanTimeouts=new Map,this._profilerId=void 0,this._isRunning=!1,this._sessionSampled=!1}initialize(e,t){this._profilerId=(0,a.uuid4)(),l.DEBUG_BUILD&&i.debug.log("[Profiling] Initializing profiler (lifecycle='trace')."),this._client=e,this._sessionSampled=t,e.on("spanStart",e=>{if(!this._sessionSampled)return void(l.DEBUG_BUILD&&i.debug.log("[Profiling] Session not sampled because of negative sampling decision."));if(e!==(0,o.getRootSpan)(e))return;if(!e.isRecording())return void(l.DEBUG_BUILD&&i.debug.log("[Profiling] Discarding profile because root span was not sampled."));(0,r.getGlobalScope)().setContext("profile",{profiler_id:this._profilerId});const t=e.spanContext().spanId;if(!t)return;if(this._activeRootSpanIds.has(t))return;this._activeRootSpanIds.add(t);const n=this._activeRootSpanIds.size,s=setTimeout(()=>{this._onRootSpanTimeout(t)},3e5);this._rootSpanTimeouts.set(t,s),1===n&&(l.DEBUG_BUILD&&i.debug.log(`[Profiling] Root span with ID ${t} started. Will continue profiling for as long as there are active root spans (currently: ${n}).`),this.start())}),e.on("spanEnd",e=>{if(!this._sessionSampled)return;const t=e.spanContext().spanId;if(!t||!this._activeRootSpanIds.has(t))return;this._activeRootSpanIds.delete(t);const n=this._activeRootSpanIds.size;l.DEBUG_BUILD&&i.debug.log(`[Profiling] Root span with ID ${t} ended. Will continue profiling for as long as there are active root spans (currently: ${n}).`),0===n&&(this._collectCurrentChunk().catch(e=>{l.DEBUG_BUILD&&i.debug.error("[Profiling] Failed to collect current profile chunk on `spanEnd`:",e)}),this.stop())})}notifyRootSpanActive(e){if(!this._sessionSampled)return;const t=e.spanContext().spanId;if(!t||this._activeRootSpanIds.has(t))return;this._activeRootSpanIds.add(t);const n=this._activeRootSpanIds.size;1===n&&(l.DEBUG_BUILD&&i.debug.log("[Profiling] Detected already active root span during setup. Active root spans now:",n),this.start())}start(){if(!this._isRunning){if(this._isRunning=!0,l.DEBUG_BUILD&&i.debug.log("[Profiling] Started profiling with profile ID:",this._profilerId),this._startProfilerInstance(),!this._profiler)return l.DEBUG_BUILD&&i.debug.log("[Profiling] Stopping trace lifecycle profiling."),void this._resetProfilerInfo();this._startPeriodicChunking()}}stop(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&(clearTimeout(this._chunkTimer),this._chunkTimer=void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(e=>{l.DEBUG_BUILD&&i.debug.error("[Profiling] Failed to collect current profile chunk on `stop()`:",e)}))}_resetProfilerInfo(){this._isRunning=!1,(0,r.getGlobalScope)().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(e=>clearTimeout(e)),this._rootSpanTimeouts.clear()}_startProfilerInstance(){if(!1===this._profiler?.stopped)return;const e=(0,u.startJSSelfProfile)();e?this._profiler=e:l.DEBUG_BUILD&&i.debug.log("[Profiling] Failed to start JS Profiler in trace lifecycle.")}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(e=>{l.DEBUG_BUILD&&i.debug.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",e)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler)return void this._resetProfilerInfo();this._startPeriodicChunking()}},6e4))}_onRootSpanTimeout(e){if(!this._rootSpanTimeouts.has(e))return;if(this._rootSpanTimeouts.delete(e),!this._activeRootSpanIds.has(e))return;l.DEBUG_BUILD&&i.debug.log(`[Profiling] Reached 5-minute timeout for root span ${e}. You likely started a manual root span that never called \`.end()\`.`),this._activeRootSpanIds.delete(e);0===this._activeRootSpanIds.size&&this.stop()}async _collectCurrentChunk(){const e=this._profiler;if(this._profiler=void 0,e)try{const t=await e.stop(),n=(0,u.createProfileChunkPayload)(t,this._client,this._profilerId),r=(0,u.validateProfileChunk)(n);if("reason"in r)return void(l.DEBUG_BUILD&&i.debug.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",r.reason));this._sendProfileChunk(n),l.DEBUG_BUILD&&i.debug.log("[Profiling] Collected browser profile chunk.")}catch(e){l.DEBUG_BUILD&&i.debug.log("[Profiling] Error while stopping JS Profiler for chunk:",e)}}_sendProfileChunk(e){const t=this._client,n=(0,c.getSdkMetadataForEnvelopeHeader)(t.getSdkMetadata?.()),r=t.getDsn(),o=t.getOptions().tunnel,u=(0,c.createEnvelope)({event_id:(0,a.uuid4)(),sent_at:(new Date).toISOString(),...n&&{sdk:n},...!!o&&r&&{dsn:(0,s.dsnToString)(r)}},[[{type:"profile_chunk"},e]]);t.sendEnvelope(u).then(null,e=>{l.DEBUG_BUILD&&i.debug.error("Error while sending profile chunk envelope:",e)})}}},407:(e,t,n)=>{n.r(t),n.d(t,{MAX_PROFILE_DURATION_MS:()=>B,PROFILER_THREAD_ID_STRING:()=>g,PROFILER_THREAD_NAME:()=>_,addProfileToGlobalCache:()=>J,addProfilesToEnvelope:()=>M,applyDebugMetadata:()=>D,attachProfiledThreadToEvent:()=>V,convertJSSelfProfileToSampledFormat:()=>O,createProfileChunkPayload:()=>R,createProfilePayload:()=>C,createProfilingEvent:()=>z,enrichWithThreadInformation:()=>A,findProfiledTransactionsFromEnvelope:()=>L,getActiveProfilesCount:()=>$,hasLegacyProfiling:()=>W,isAutomatedPageLoadSpan:()=>N,isValidSampleRate:()=>P,shouldProfileSession:()=>H,shouldProfileSpanLegacy:()=>G,startJSSelfProfile:()=>F,takeProfileFromGlobalCache:()=>q,validateProfileChunk:()=>x});var r=n(209),o=n(245),s=n(239),i=n(213),a=n(223),c=n(219),l=n(225),u=n(250),d=n(264),p=n(285),h=n(270);const f=1e6,m="window"in i.GLOBAL_OBJ&&i.GLOBAL_OBJ.window===i.GLOBAL_OBJ&&"undefined"==typeof importScripts,g=String(0),_=m?"main":"worker",y=h.WINDOW.navigator;let S="",b="",E="",v=y?.userAgent||"",T="";const I=y?.language||y?.languages?.[0]||"";const k=y?.userAgentData;var w;function A(e){return function(e){return!("thread_metadata"in e)}(e)?O(e):e}function C(e,t,n,r){if("transaction"!==r.type)throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(null==n)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);const o=function(e){const t=e.contexts?.trace?.trace_id;return"string"==typeof t&&32!==t.length&&p.DEBUG_BUILD&&a.debug.log(`[Profiling] Invalid traceId: ${t} on profiled event`),"string"!=typeof t?"":t}(r),i=A(n),u=t||("number"==typeof r.start_timestamp?1e3*r.start_timestamp:1e3*(0,l.timestampInSeconds)()),d="number"==typeof r.timestamp?1e3*r.timestamp:1e3*(0,l.timestampInSeconds)();return{event_id:e,timestamp:new Date(u).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||s.DEFAULT_ENVIRONMENT,runtime:{name:"javascript",version:h.WINDOW.navigator.userAgent},os:{name:S,version:b,build_number:v},device:{locale:I,model:T,manufacturer:v,architecture:E,is_emulator:!1},debug_meta:{images:D(n.resources)},profile:i,transactions:[{name:r.transaction||"",id:r.event_id||(0,c.uuid4)(),trace_id:o,active_thread_id:g,relative_start_ns:"0",relative_end_ns:(1e6*(d-u)).toFixed(0)}]}}function R(e,t,n){if(null==e)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);const r=function(e){const t=[];for(let n=0;n<e.frames.length;n++){const r=e.frames[n];r&&(t[n]={function:r.name,abs_path:"number"==typeof r.resourceId?e.resources[r.resourceId]:void 0,lineno:r.line,colno:r.column})}const n=[];for(let t=0;t<e.stacks.length;t++){const r=e.stacks[t];if(!r)continue;const o=[];let s=r;for(;s;)o.push(s.frameId),s=void 0===s.parentId?void 0:e.stacks[s.parentId];n[t]=o}const r=(0,l.browserPerformanceTimeOrigin)(),o="number"==typeof performance.timeOrigin?performance.timeOrigin:r||0,s=o-(r||o),i=[];for(let t=0;t<e.samples.length;t++){const n=e.samples[t];if(!n)continue;const r=(o+(n.timestamp-s))/1e3;i[t]={stack_id:n.stackId??0,thread_id:g,timestamp:r}}return{frames:t,stacks:n,samples:i,thread_metadata:{[g]:{name:_}}}}(e),o=t.getOptions(),s=t.getSdkMetadata?.()?.sdk;return{chunk_id:(0,c.uuid4)(),client_sdk:{name:s?.name??"sentry.javascript.browser",version:s?.version??"0.0.0"},profiler_id:n||(0,c.uuid4)(),platform:"javascript",version:"2",release:o.release??"",environment:o.environment??"production",debug_meta:{images:D(e.resources)},profile:r}}function x(e){try{if(!e||"object"!=typeof e)return{reason:"chunk is not an object"};const t=e=>"string"==typeof e&&/^[a-f0-9]{32}$/.test(e);if(!t(e.profiler_id))return{reason:"missing or invalid profiler_id"};if(!t(e.chunk_id))return{reason:"missing or invalid chunk_id"};if(!e.client_sdk)return{reason:"missing client_sdk metadata"};const n=e.profile;return n?Array.isArray(n.frames)&&n.frames.length?Array.isArray(n.stacks)&&n.stacks.length?Array.isArray(n.samples)&&n.samples.length?{valid:!0}:{reason:"profile has no samples"}:{reason:"profile has no stacks"}:{reason:"profile has no frames"}:{reason:"missing profile data"}}catch(e){return{reason:`unknown validation error: ${e}`}}}function N(e){return"pageload"===(0,o.spanToJSON)(e).op}function O(e){let t,n=0;const r={samples:[],stacks:[],frames:[],thread_metadata:{[g]:{name:_}}},o=e.samples[0];if(!o)return r;const s=o.timestamp,i=(0,l.browserPerformanceTimeOrigin)(),a="number"==typeof performance.timeOrigin?performance.timeOrigin:i||0,c=a-(i||a);return e.samples.forEach((o,i)=>{if(void 0===o.stackId)return void 0===t&&(t=n,r.stacks[t]=[],n++),void(r.samples[i]={elapsed_since_start_ns:((o.timestamp+c-s)*f).toFixed(0),stack_id:t,thread_id:g});let a=e.stacks[o.stackId];const l=[];for(;a;){l.push(a.frameId);const t=e.frames[a.frameId];t&&void 0===r.frames[a.frameId]&&(r.frames[a.frameId]={function:t.name,abs_path:"number"==typeof t.resourceId?e.resources[t.resourceId]:void 0,lineno:t.line,colno:t.column}),a=void 0===a.parentId?void 0:e.stacks[a.parentId]}const u={elapsed_since_start_ns:((o.timestamp+c-s)*f).toFixed(0),stack_id:n,thread_id:g};r.stacks[n]=l,r.samples[i]=u,n++}),r}function M(e,t){if(!t.length)return e;for(const n of t)e[1].push([{type:"profile"},n]);return e}function L(e){const t=[];return(0,u.forEachEnvelopeItem)(e,(e,n)=>{if("transaction"===n)for(let n=1;n<e.length;n++){const r=e[n];r?.contexts?.profile?.profile_id&&t.push(e[n])}}),t}function D(e){const t=(0,r.getClient)(),n=t?.getOptions(),o=n?.stackParser;return o?(0,d.getDebugImagesForResources)(o,e):[]}function P(e){return"number"!=typeof e&&"boolean"!=typeof e||"number"==typeof e&&isNaN(e)?(p.DEBUG_BUILD&&a.debug.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):!0===e||!1===e||(!(e<0||e>1)||(p.DEBUG_BUILD&&a.debug.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1))}"object"==typeof(w=k)&&null!==w&&"getHighEntropyValues"in w&&k.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{if(S=e.platform||"",E=e.architecture||"",T=e.model||"",b=e.platformVersion||"",e.fullVersionList?.length){const t=e.fullVersionList[e.fullVersionList.length-1];v=`${t.brand} ${t.version}`}}).catch(e=>{});let U=!1;const B=3e4;function F(){const e=h.WINDOW.Profiler;if("function"!=typeof e)return void(p.DEBUG_BUILD&&a.debug.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object."));const t=Math.floor(B/10);try{return new e({sampleInterval:10,maxBufferSize:t})}catch(e){p.DEBUG_BUILD&&(a.debug.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),a.debug.log("[Profiling] Disabling profiling for current user session.")),U=!0}}function G(e){if(U)return p.DEBUG_BUILD&&a.debug.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return p.DEBUG_BUILD&&a.debug.log("[Profiling] Discarding profile because root span was not sampled."),!1;const t=(0,r.getClient)(),n=t?.getOptions();if(!n)return p.DEBUG_BUILD&&a.debug.log("[Profiling] Profiling disabled, no options found."),!1;const o=n.profilesSampleRate;if(!P(o))return p.DEBUG_BUILD&&a.debug.warn("[Profiling] Discarding profile because of invalid sample rate."),!1;if(!o)return p.DEBUG_BUILD&&a.debug.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1;return!!(!0===o||Math.random()<o)||(p.DEBUG_BUILD&&a.debug.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(o)})`),!1)}function H(e){if(U)return p.DEBUG_BUILD&&a.debug.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if("trace"!==e.profileLifecycle)return!1;const t=e.profileSessionSampleRate;return P(t)?t?Math.random()<=t:(p.DEBUG_BUILD&&a.debug.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(p.DEBUG_BUILD&&a.debug.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)}function W(e){return void 0!==e.profilesSampleRate}function z(e,t,n,r){return function(e){return e.samples.length<2?(p.DEBUG_BUILD&&a.debug.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):!!e.frames.length||(p.DEBUG_BUILD&&a.debug.log("[Profiling] Discarding profile because it contains no frames"),!1)}(n)?C(e,t,n,r):null}const j=new Map;function $(){return j.size}function q(e){const t=j.get(e);return t&&j.delete(e),t}function J(e,t){if(j.set(e,t),j.size>30){const e=j.keys().next().value;void 0!==e&&j.delete(e)}}function V(e){return e?.contexts?.profile&&e.contexts?(e.contexts.trace={...e.contexts?.trace??{},data:{...e.contexts?.trace?.data??{},"thread.id":g,"thread.name":_}},e.spans?.forEach(e=>{e.data={...e.data||{},"thread.id":g,"thread.name":_}}),e):e}},408:(e,t,n)=>{n.r(t),n.d(t,{startProfileForSpan:()=>d});var r=n(209),o=n(245),s=n(223),i=n(219),a=n(225),c=n(285),l=n(270),u=n(407);function d(e){let t;(0,u.isAutomatedPageLoadSpan)(e)&&(t=1e3*(0,a.timestampInSeconds)());const n=(0,u.startJSSelfProfile)();if(!n)return;c.DEBUG_BUILD&&s.debug.log(`[Profiling] started profiling span: ${(0,o.spanToJSON)(e).description}`);const d=(0,i.uuid4)();let p=null;async function h(){if(e&&n){if(!p)return n.stop().then(t=>{f&&(l.WINDOW.clearTimeout(f),f=void 0),c.DEBUG_BUILD&&s.debug.log(`[Profiling] stopped profiling of span: ${(0,o.spanToJSON)(e).description}`),t?(p=t,(0,u.addProfileToGlobalCache)(d,t)):c.DEBUG_BUILD&&s.debug.log(`[Profiling] profiler returned null profile for: ${(0,o.spanToJSON)(e).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started")}).catch(e=>{c.DEBUG_BUILD&&s.debug.log("[Profiling] error while stopping profiler:",e)});c.DEBUG_BUILD&&s.debug.log("[Profiling] profile for:",(0,o.spanToJSON)(e).description,"already exists, returning early")}}(0,r.getCurrentScope)().setContext("profile",{profile_id:d,start_timestamp:t});let f=l.WINDOW.setTimeout(()=>{c.DEBUG_BUILD&&s.debug.log("[Profiling] max profile duration elapsed, stopping profiling for:",(0,o.spanToJSON)(e).description),h()},u.MAX_PROFILE_DURATION_MS);const m=e.end.bind(e);e.end=function(){return e?(h().then(()=>{m()},()=>{m()}),e):m()}}},409:(e,t,n)=>{n.r(t),n.d(t,{INTEGRATION_NAME:()=>c,isSpotlightInteraction:()=>u,spotlightBrowserIntegration:()=>l});var r=n(229),o=n(223),s=n(250),i=n(299),a=n(285);const c="SpotlightBrowser";const l=(0,r.defineIntegration)((e={})=>{const t=e.sidecarUrl||"http://localhost:8969/stream";return{name:c,setup:()=>{a.DEBUG_BUILD&&o.debug.log("Using Sidecar URL",t)},processEvent:e=>u(e)?null:e,afterAllSetup:e=>{!function(e,t){const n=(0,i.getNativeImplementation)("fetch");let r=0;e.on("beforeEnvelope",e=>{r>3?o.debug.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r):n(t,{method:"POST",body:(0,s.serializeEnvelope)(e),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(e=>{e.status>=200&&e.status<400&&(r=0)},e=>{r++,o.debug.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",e)})})}(e,t)}}});function u(e){return Boolean("transaction"===e.type&&e.spans&&e.contexts?.trace&&"ui.action.click"===e.contexts.trace.op&&e.spans.some(({description:e})=>e?.includes("#sentry-spotlight")))}},410:(e,t,n)=>{n.r(t),n.d(t,{buildLaunchDarklyFlagUsedHandler:()=>i,launchDarklyIntegration:()=>s});var r=n(229),o=n(370);const s=(0,r.defineIntegration)(()=>({name:"LaunchDarkly",processEvent:(e,t,n)=>(0,o._INTERNAL_copyFlagsFromScopeToEvent)(e)}));function i(){return{name:"sentry-flag-auditor",type:"flag-used",synchronous:!0,method:(e,t,n)=>{(0,o._INTERNAL_insertFlagToScope)(e,t.value),(0,o._INTERNAL_addFeatureFlagToActiveSpan)(e,t.value)}}}},411:(e,t,n)=>{n.r(t),n.d(t,{OpenFeatureIntegrationHook:()=>i,openFeatureIntegration:()=>s});var r=n(229),o=n(370);const s=(0,r.defineIntegration)(()=>({name:"OpenFeature",processEvent:(e,t,n)=>(0,o._INTERNAL_copyFlagsFromScopeToEvent)(e)}));class i{after(e,t){(0,o._INTERNAL_insertFlagToScope)(t.flagKey,t.value),(0,o._INTERNAL_addFeatureFlagToActiveSpan)(t.flagKey,t.value)}error(e,t,n){(0,o._INTERNAL_insertFlagToScope)(e.flagKey,e.defaultValue),(0,o._INTERNAL_addFeatureFlagToActiveSpan)(e.flagKey,e.defaultValue)}}},412:(e,t,n)=>{n.r(t),n.d(t,{unleashIntegration:()=>c});var r=n(229),o=n(370),s=n(223),i=n(220),a=n(285);const c=(0,r.defineIntegration)(({featureFlagClientClass:e})=>({name:"Unleash",setupOnce(){const t=e.prototype;(0,i.fill)(t,"isEnabled",l)},processEvent:(e,t,n)=>(0,o._INTERNAL_copyFlagsFromScopeToEvent)(e)}));function l(e){return function(...t){const n=t[0],r=e.apply(this,t);return"string"==typeof n&&"boolean"==typeof r?((0,o._INTERNAL_insertFlagToScope)(n,r),(0,o._INTERNAL_addFeatureFlagToActiveSpan)(n,r)):a.DEBUG_BUILD&&s.debug.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}},413:(e,t,n)=>{n.r(t),n.d(t,{growthbookIntegration:()=>o});var r=n(414);const o=({growthbookClass:e})=>(0,r.growthbookIntegration)({growthbookClass:e})},414:(e,t,n)=>{n.r(t),n.d(t,{growthbookIntegration:()=>i});var r=n(229),o=n(370),s=n(220);const i=(0,r.defineIntegration)(({growthbookClass:e})=>({name:"GrowthBook",setupOnce(){const t=e.prototype;"function"==typeof t.isOn&&(0,s.fill)(t,"isOn",a),"function"==typeof t.getFeatureValue&&(0,s.fill)(t,"getFeatureValue",a)},processEvent:(e,t,n)=>(0,o._INTERNAL_copyFlagsFromScopeToEvent)(e)}));function a(e){return function(...t){const n=t[0],r=e.apply(this,t);return"string"==typeof n&&"boolean"==typeof r&&((0,o._INTERNAL_insertFlagToScope)(n,r),(0,o._INTERNAL_addFeatureFlagToActiveSpan)(n,r)),r}}},415:(e,t,n)=>{n.r(t),n.d(t,{statsigIntegration:()=>s});var r=n(229),o=n(370);const s=(0,r.defineIntegration)(({featureFlagClient:e})=>({name:"Statsig",setup(t){e.on("gate_evaluation",e=>{(0,o._INTERNAL_insertFlagToScope)(e.gate.name,e.gate.value),(0,o._INTERNAL_addFeatureFlagToActiveSpan)(e.gate.name,e.gate.value)})},processEvent:(e,t,n)=>(0,o._INTERNAL_copyFlagsFromScopeToEvent)(e)}))},416:(e,t,n)=>{n.r(t),n.d(t,{diagnoseSdkConnectivity:()=>s});var r=n(309),o=n(209);async function s(){const e=(0,o.getClient)();if(!e)return"no-client-active";if(!e.getDsn())return"no-dsn-configured";try{await(0,r.suppressTracing)(()=>fetch("https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7",{body:"{}",method:"POST",mode:"cors",credentials:"omit"}))}catch{return"sentry-unreachable"}}},417:(e,t,n)=>{n.r(t),n.d(t,{INTEGRATION_NAME:()=>c,registerWebWorker:()=>d,webWorkerIntegration:()=>l});var r=n(229),o=n(222),s=n(223),i=n(285),a=n(270);const c="WebWorker",l=(0,r.defineIntegration)(({worker:e})=>({name:c,setupOnce:()=>{(Array.isArray(e)?e:[e]).forEach(e=>u(e))},addWorker:e=>u(e)}));function u(e){e.addEventListener("message",e=>{var t;t=e.data,(0,o.isPlainObject)(t)&&!0===t._sentryMessage&&"_sentryDebugIds"in t&&((0,o.isPlainObject)(t._sentryDebugIds)||void 0===t._sentryDebugIds)&&(e.stopImmediatePropagation(),i.DEBUG_BUILD&&s.debug.log("Sentry debugId web worker message received",e.data),a.WINDOW._sentryDebugIds={...e.data._sentryDebugIds,...a.WINDOW._sentryDebugIds})})}function d({self:e}){e.postMessage({_sentryMessage:!0,_sentryDebugIds:e._sentryDebugIds??void 0})}}}]);
|
|
//# sourceMappingURL=1.js.map?a5d7d3f893dbc64aed1f
|