const R=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,G=globalThis,Ht="10.49.0";function Vt(){return us(G),G}function us(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Ht,t[Ht]=t[Ht]||{}}function En(e,t,n=G){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[Ht]=r[Ht]||{};return s[e]||(s[e]=t())}const Nd=["debug","info","warn","error","log","assert","trace"],Ld="Sentry Logger ",jr={};function ot(e){if(!("console"in G))return e();const t=G.console,n={},r=Object.keys(jr);r.forEach(s=>{const i=jr[s];n[s]=t[s],t[s]=i});try{return e()}finally{r.forEach(s=>{t[s]=n[s]})}}function Dd(){Ui().enabled=!0}function Od(){Ui().enabled=!1}function Dc(){return Ui().enabled}function Pd(...e){Hi("log",...e)}function Fd(...e){Hi("warn",...e)}function $d(...e){Hi("error",...e)}function Hi(e,...t){R&&Dc()&&ot(()=>{G.console[e](`${Ld}[${e}]:`,...t)})}function Ui(){return R?En("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const S={enable:Dd,disable:Od,isEnabled:Dc,log:Pd,warn:Fd,error:$d},Oc=50,zt="?",Lo=/\(error: (.*)\)/,Do=/captureMessage|captureException/;function Pc(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,s=0)=>{const i=[],o=n.split(` `);for(let c=r;c1024&&(a=a.slice(0,1024));const u=Lo.test(a)?a.replace(Lo,"$1"):a;if(!u.includes("Error: ")){for(const d of t){const l=d(u);if(l){i.push(l);break}}if(i.length>=Oc+s)break}}return Hd(i.slice(s))}}function Bd(e){return Array.isArray(e)?Pc(...e):e}function Hd(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(_r(t).function||"")&&t.pop(),t.reverse(),Do.test(_r(t).function||"")&&(t.pop(),Do.test(_r(t).function||"")&&t.pop()),t.slice(0,Oc).map(n=>({...n,filename:n.filename||_r(t).filename,function:n.function||zt}))}function _r(e){return e[e.length-1]||{}}const Ns="";function pt(e){try{return!e||typeof e!="function"?Ns:e.name||Ns}catch{return Ns}}function Oo(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function Fc(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const xr={},Po={};function Mt(e,t){xr[e]=xr[e]||[],xr[e].push(t)}function At(e,t){if(!Po[e]){Po[e]=!0;try{t()}catch(n){R&&S.error(`Error while instrumenting ${e}`,n)}}}function Ge(e,t){const n=e&&xr[e];if(n)for(const r of n)try{r(t)}catch(s){R&&S.error(`Error while triggering instrumentation handler. Type: ${e} Name: ${pt(r)} Error:`,s)}}let Ls=null;function $c(e){const t="error";Mt(t,e),At(t,Ud)}function Ud(){Ls=G.onerror,G.onerror=function(e,t,n,r,s){return Ge("error",{column:r,error:s,line:n,msg:e,url:t}),Ls?Ls.apply(this,arguments):!1},G.onerror.__SENTRY_INSTRUMENTED__=!0}let Ds=null;function Bc(e){const t="unhandledrejection";Mt(t,e),At(t,Wd)}function Wd(){Ds=G.onunhandledrejection,G.onunhandledrejection=function(e){return Ge("unhandledrejection",e),Ds?Ds.apply(this,arguments):!0},G.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Hc=Object.prototype.toString;function ls(e){switch(Hc.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return ht(e,Error)}}function vn(e,t){return Hc.call(e)===`[object ${t}]`}function Uc(e){return vn(e,"ErrorEvent")}function Fo(e){return vn(e,"DOMError")}function zd(e){return vn(e,"DOMException")}function ut(e){return vn(e,"String")}function Wi(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function ln(e){return e===null||Wi(e)||typeof e!="object"&&typeof e!="function"}function Fn(e){return vn(e,"Object")}function ds(e){return typeof Event<"u"&&ht(e,Event)}function jd(e){return typeof Element<"u"&&ht(e,Element)}function qd(e){return vn(e,"RegExp")}function Xn(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function Vd(e){return Fn(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function ht(e,t){try{return e instanceof t}catch{return!1}}function Wc(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function zi(e){return typeof Request<"u"&&ht(e,Request)}const ji=G,Gd=80;function Se(e,t={}){if(!e)return"";try{let n=e;const r=5,s=[];let i=0,o=0;const c=" > ",a=c.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||Gd;for(;n&&i++1&&o+s.length*a+u.length>=l));)s.push(u),o+=u.length,n=n.parentNode;return s.reverse().join(c)}catch{return""}}function Yd(e,t){const n=e,r=[];if(!(n!=null&&n.tagName))return"";if(ji.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=t!=null&&t.length?t.filter(i=>n.getAttribute(i)).map(i=>[i,n.getAttribute(i)]):null;if(s!=null&&s.length)s.forEach(i=>{r.push(`[${i[0]}="${i[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const i=n.className;if(i&&ut(i)){const o=i.split(/\s+/);for(const c of o)r.push(`.${c}`)}}for(const i of["aria-label","type","name","title","alt"]){const o=n.getAttribute(i);o&&r.push(`[${i}="${o}"]`)}return r.join("")}function Gt(){try{return ji.document.location.href}catch{return""}}function zc(e,t=5){if(!ji.HTMLElement)return null;let n=e;for(let r=0;r"}}function Bo(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function Kd(e){const t=Object.keys(qc(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let Xt;function Jn(e){if(Xt!==void 0)return Xt?Xt(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=G;return t in n&&typeof n[t]=="function"?(Xt=n[t],Xt(e)):(Xt=null,e())}function wt(){return Jn(()=>Math.random())}function Zn(){return Jn(()=>Date.now())}function ii(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Ho(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;rMr(e,r,n))}function Xd(){const e=G;return e.crypto||e.msCrypto}let Os;function Jd(){return wt()*16}function Ue(e=Xd()){try{if(e!=null&&e.randomUUID)return Jn(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Os||(Os="10000000100040008000"+1e11),Os.replace(/[018]/g,t=>(t^(Jd()&15)>>t/4).toString(16))}function Vc(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}function Ot(e){const{message:t,event_id:n}=e;if(t)return t;const r=Vc(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"":n||""}function oi(e,t,n){const r=e.exception=e.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=t||""),i.type||(i.type="Error")}function dn(e,t){const n=Vc(e);if(!n)return;const r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...t},t&&"data"in t){const i={...s==null?void 0:s.data,...t.data};n.mechanism.data=i}}function Uo(e){if(Zd(e))return!0;try{Oe(e,"__sentry_captured__",!0)}catch{}return!1}function Zd(e){try{return e.__sentry_captured__}catch{}}const Gc=1e3;function Yt(){return Zn()/Gc}function Qd(){const{performance:e}=G;if(!(e!=null&&e.now)||!e.timeOrigin)return Yt;const t=e.timeOrigin;return()=>(t+Jn(()=>e.now()))/Gc}let Wo;function _e(){return(Wo??(Wo=Qd()))()}let Ps=null;function ef(){var o;const{performance:e}=G;if(!(e!=null&&e.now))return;const t=3e5,n=Jn(()=>e.now()),r=Zn(),s=e.timeOrigin;if(typeof s=="number"&&Math.abs(s+n-r)rf(n)};return e&&fn(n,e),n}function fn(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||_e(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:Ue()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function nf(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),fn(e,n)}function rf(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function Qn(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const r={...e};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=Qn(r[s],t[s],n-1));return r}function mt(){return Ue()}function dt(){return Ue().substring(16)}const ai="_sentrySpan";function $n(e,t){t?Oe(e,ai,t):delete e[ai]}function qr(e){return e[ai]}const sf=100;class it{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:mt(),sampleRand:wt()}}clone(){const t=new it;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,$n(t,qr(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&fn(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,r=n instanceof it?n.getScopeData():Fn(n)?t:void 0,{tags:s,attributes:i,extra:o,user:c,contexts:a,level:u,fingerprint:d=[],propagationContext:l,conversationId:f}=r||{};return this._tags={...this._tags,...s},this._attributes={...this._attributes,...i},this._extra={...this._extra,...o},this._contexts={...this._contexts,...a},c&&Object.keys(c).length&&(this._user=c),u&&(this._level=u),d.length&&(this._fingerprint=d),l&&(this._propagationContext=l),f&&(this._conversationId=f),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,$n(this,void 0),this._attachments=[],this.setPropagationContext({traceId:mt(),sampleRand:wt()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){var i;const r=typeof n=="number"?n:sf;if(r<=0)return this;const s={timestamp:Yt(),...t,message:t.message?ii(t.message,2048):t.message};return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),(i=this._client)==null||i.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:qr(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Qn(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=(n==null?void 0:n.event_id)||Ue();if(!this._client)return R&&S.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:s,...n,event_id:r},this),r}captureMessage(t,n,r){const s=(r==null?void 0:r.event_id)||Ue();if(!this._client)return R&&S.warn("No client configured on scope - will not capture message!"),s;const i=(r==null?void 0:r.syntheticException)??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...r,event_id:s},this),s}captureEvent(t,n){const r=t.event_id||(n==null?void 0:n.event_id)||Ue();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(R&&S.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function of(){return En("defaultCurrentScope",()=>new it)}function af(){return En("defaultIsolationScope",()=>new it)}const zo=e=>e instanceof Promise&&!e[Yc],Yc=Symbol("chained PromiseLike"),cf=(e,t,n)=>{const r=e.then(s=>(t(s),s),s=>{throw n(s),s});return zo(r)&&zo(e)?r:uf(e,r)},uf=(e,t)=>{let n=!1;for(const r in e){if(r in t)continue;n=!0;const s=e[r];typeof s=="function"?Object.defineProperty(t,r,{value:(...i)=>s.apply(e,i),enumerable:!0,configurable:!0,writable:!0}):t[r]=s}return n&&Object.assign(t,{[Yc]:!0}),t};class lf{constructor(t,n){let r;t?r=t:r=new it;let s;n?s=n:s=new it,this._stack=[{scope:r}],this._isolationScope=s}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(s){throw this._popScope(),s}return Xn(r)?cf(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function pn(){const e=Vt(),t=us(e);return t.stack=t.stack||new lf(of(),af())}function df(e){return pn().withScope(e)}function ff(e,t){const n=pn();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function jo(e){return pn().withScope(()=>e(pn().getIsolationScope()))}function pf(){return{withIsolationScope:jo,withScope:df,withSetScope:ff,withSetIsolationScope:(e,t)=>jo(t),getCurrentScope:()=>pn().getScope(),getIsolationScope:()=>pn().getIsolationScope()}}function Tn(e){const t=us(e);return t.acs?t.acs:pf()}function ne(){const e=Vt();return Tn(e).getCurrentScope()}function Me(){const e=Vt();return Tn(e).getIsolationScope()}function Kc(){return En("globalScope",()=>new it)}function Vi(...e){const t=Vt(),n=Tn(t);if(e.length===2){const[r,s]=e;return r?n.withSetScope(r,s):n.withScope(s)}return n.withScope(e[0])}function U(){return ne().getClient()}function hf(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:s}=t,i={trace_id:n,span_id:s||dt()};return r&&(i.parent_span_id=r),i}const He="sentry.source",Gi="sentry.sample_rate",Xc="sentry.previous_trace_sample_rate",et="sentry.op",he="sentry.origin",Bn="sentry.idle_span_finish_reason",er="sentry.measurement_unit",tr="sentry.measurement_value",qo="sentry.custom_span_name",Yi="sentry.profile_id",Nt="sentry.exclusive_time",mf="sentry.link.type",_f="gen_ai.conversation.id",Jc=0,fs=1,ve=2;function gf(e){if(e<400&&e>=100)return{code:fs};if(e>=400&&e<500)switch(e){case 401:return{code:ve,message:"unauthenticated"};case 403:return{code:ve,message:"permission_denied"};case 404:return{code:ve,message:"not_found"};case 409:return{code:ve,message:"already_exists"};case 413:return{code:ve,message:"failed_precondition"};case 429:return{code:ve,message:"resource_exhausted"};case 499:return{code:ve,message:"cancelled"};default:return{code:ve,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:ve,message:"unimplemented"};case 503:return{code:ve,message:"unavailable"};case 504:return{code:ve,message:"deadline_exceeded"};default:return{code:ve,message:"internal_error"}}return{code:ve,message:"internal_error"}}function Zc(e,t){e.setAttribute("http.response.status_code",t);const n=gf(t);n.message!=="unknown_error"&&e.setStatus(n)}function yf(e){try{const t=G.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function Sf(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}const Qc="_sentryScope",eu="_sentryIsolationScope";function bf(e,t,n){e&&(Oe(e,eu,yf(n)),Oe(e,Qc,t))}function Vr(e){const t=e;return{scope:t[Qc],isolationScope:Sf(t[eu])}}const Gr="sentry-",Ef=8192;function tu(e){const t=Tf(e);if(!t)return;const n=Object.entries(t).reduce((r,[s,i])=>{if(s.startsWith(Gr)){const o=s.slice(Gr.length);r[o]=i}return r},{});if(Object.keys(n).length>0)return n}function vf(e){if(!e)return;const t=Object.entries(e).reduce((n,[r,s])=>(s&&(n[`${Gr}${r}`]=s),n),{});return wf(t)}function Tf(e){if(!(!e||!ut(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=Vo(n);return Object.entries(r).forEach(([s,i])=>{t[s]=i}),t},{}):Vo(e)}function Vo(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const r=t.slice(0,n),s=t.slice(n+1);return[r,s].map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function wf(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],s)=>{const i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=s===0?i:`${t},${i}`;return o.length>Ef?(R&&S.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):o},"")}const If=/^o(\d+)\./,kf=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Cf(e){return e==="http"||e==="https"}function wn(e,t=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:c,publicKey:a}=e;return`${c}://${a}${t&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${o}`}function Rf(e){const t=kf.exec(e);if(!t){ot(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,s="",i="",o="",c=""]=t.slice(1);let a="",u=c;const d=u.split("/");if(d.length>1&&(a=d.slice(0,-1).join("/"),u=d.pop()),u){const l=u.match(/^\d+/);l&&(u=l[0])}return nu({host:i,pass:s,path:a,projectId:u,port:o,protocol:n,publicKey:r})}function nu(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function xf(e){if(!R)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(o=>e[o]?!1:(S.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?Cf(r)?t&&isNaN(parseInt(t,10))?(S.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(S.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(S.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Mf(e){const t=e.match(If);return t==null?void 0:t[1]}function Af(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=Mf(n)),r}function Nf(e){const t=typeof e=="string"?Rf(e):nu(e);if(!(!t||!xf(t)))return t}function jt(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const ru=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Lf(e){if(!e)return;const t=e.match(ru);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function Df(e,t){const n=Lf(e),r=tu(t);if(!(n!=null&&n.traceId))return{traceId:mt(),sampleRand:wt()};const s=Of(n,r);r&&(r.sample_rand=s.toString());const{traceId:i,parentSpanId:o,parentSampled:c}=n;return{traceId:i,parentSpanId:o,sampled:c,dsc:r||{},sampleRand:s}}function su(e=mt(),t=dt(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function iu(e=mt(),t=dt(),n){return`00-${e}-${t}-${n?"01":"00"}`}function Of(e,t){const n=jt(t==null?void 0:t.sample_rand);if(n!==void 0)return n;const r=jt(t==null?void 0:t.sample_rate);return r&&(e==null?void 0:e.parentSampled)!==void 0?e.parentSampled?wt()*r:r+wt()*(1-r):wt()}const ou=0,ps=1;let Go=!1;function Pf(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:s,parent_span_id:i,status:o,origin:c,links:a}=te(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:s,status:o,origin:c,links:a}}function Ff(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),s=r?t:te(e).parent_span_id,i=Vr(e).scope,o=r?(i==null?void 0:i.getPropagationContext().propagationSpanId)||dt():t;return{parent_span_id:s,span_id:o,trace_id:n}}function $f(e){const{traceId:t,spanId:n}=e.spanContext(),r=Lt(e);return su(t,n,r)}function Bf(e){const{traceId:t,spanId:n}=e.spanContext(),r=Lt(e);return iu(t,n,r)}function au(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...s},attributes:i})=>({span_id:t,trace_id:n,sampled:r===ps,attributes:i,...s}))}function cu(e){if(e!=null&&e.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:s})=>({span_id:t,trace_id:n,sampled:r===ps,attributes:s}))}function ft(e){return typeof e=="number"?Yo(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Yo(e.getTime()):_e()}function Yo(e){return e>9999999999?e/1e3:e}function te(e){if(fu(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(du(e)){const{attributes:r,startTime:s,name:i,endTime:o,status:c,links:a}=e;return{span_id:t,trace_id:n,data:r,description:i,parent_span_id:lu(e),start_timestamp:ft(s),timestamp:ft(o)||void 0,status:pu(c),op:r[et],origin:r[he],links:au(a)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function uu(e){if(fu(e))return e.getStreamedSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(du(e)){const{attributes:r,startTime:s,name:i,endTime:o,status:c,links:a}=e;return{name:i,span_id:t,trace_id:n,parent_span_id:lu(e),start_timestamp:ft(s),end_timestamp:ft(o),is_segment:e===ui(e),status:hu(c),attributes:r,links:cu(a)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===ui(e)}}function lu(e){var t;return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?(t=e.parentSpanContext)==null?void 0:t.spanId:void 0}function du(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function fu(e){return typeof e.getSpanJSON=="function"}function Lt(e){const{traceFlags:t}=e.spanContext();return t===ps}function pu(e){if(!(!e||e.code===Jc))return e.code===fs?"ok":e.message||"internal_error"}function hu(e){return!e||e.code===fs||e.code===Jc||e.message==="cancelled"?"ok":"error"}const Ut="_sentryChildSpans",ci="_sentryRootSpan";function mu(e,t){const n=e[ci]||e;Oe(t,ci,n),e[Ut]?e[Ut].add(t):Oe(e,Ut,new Set([t]))}function Hf(e,t){e[Ut]&&e[Ut].delete(t)}function Ar(e){const t=new Set;function n(r){if(!t.has(r)&&Lt(r)){t.add(r);const s=r[Ut]?Array.from(r[Ut]):[];for(const i of s)n(i)}}return n(e),Array.from(t)}const Te=ui;function ui(e){return e[ci]||e}function Ie(){const e=Vt(),t=Tn(e);return t.getActiveSpan?t.getActiveSpan():qr(ne())}function li(){Go||(ot(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),Go=!0)}let Ko=!1;function Uf(){if(Ko)return;function e(){const t=Ie(),n=t&&Te(t);if(n){const r="internal_error";R&&S.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:ve,message:r})}}e.tag="sentry_tracingErrorCallback",Ko=!0,$c(e),Bc(e)}function Ye(e){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||((n=U())==null?void 0:n.getOptions());return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function Xo(e){S.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Hn(e,t){if(!(t!=null&&t.length)||!e.description)return!1;for(const n of t){if(zf(n)){if(Mr(e.description,n))return R&&Xo(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?Mr(e.description,n.name):!0,s=n.op?e.op&&Mr(e.op,n.op):!0;if(r&&s)return R&&Xo(e),!0}return!1}function Wf(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const s of e)s.parent_span_id===r&&(s.parent_span_id=n)}function zf(e){return typeof e=="string"||e instanceof RegExp}const Ki="production",_u="_frozenDsc";function Nr(e,t){Oe(e,_u,t)}function gu(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},s={environment:n.environment||Ki,release:n.release,public_key:r,trace_id:e,org_id:Af(t)};return t.emit("createDsc",s),s}function yu(e,t){const n=t.getPropagationContext();return n.dsc||gu(n.traceId,e)}function _t(e){var h;const t=U();if(!t)return{};const n=Te(e),r=te(n),s=r.data,i=n.spanContext().traceState,o=(i==null?void 0:i.get("sentry.sample_rate"))??s[Gi]??s[Xc];function c(m){return(typeof o=="number"||typeof o=="string")&&(m.sample_rate=`${o}`),m}const a=n[_u];if(a)return c(a);const u=i==null?void 0:i.get("sentry.dsc"),d=u&&tu(u);if(d)return c(d);const l=gu(e.spanContext().traceId,t),f=s[He]??s["sentry.span.source"],p=r.description;return f!=="url"&&p&&(l.transaction=p),Ye()&&(l.sampled=String(Lt(n)),l.sample_rand=(i==null?void 0:i.get("sentry.sample_rand"))??((h=Vr(n).scope)==null?void 0:h.getPropagationContext().sampleRand.toString())),c(l),t.emit("createDsc",l,n),l}class st{constructor(t={}){this._traceId=t.traceId||mt(),this._spanId=t.spanId||dt(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:ou}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,r){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}}function Su(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function Je(e,t=100,n=1/0){try{return di("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function bu(e,t=3,n=100*1024){const r=Je(e,t);return Gf(r)>n?bu(e,t-1,n):r}function di(e,t,n=1/0,r=1/0,s=Yf()){const[i,o]=s;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const c=jf(e,t);if(!c.startsWith("[object "))return c;if(t.__sentry_skip_normalization__)return t;const a=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(a===0)return c.replace("object ","");if(i(t))return"[Circular ~]";const u=t;if(u&&typeof u.toJSON=="function")try{const p=u.toJSON();return di("",p,a-1,r,s)}catch{}const d=Array.isArray(t)?[]:{};let l=0;const f=qc(t);for(const p in f){if(!Object.prototype.hasOwnProperty.call(f,p))continue;if(l>=r){d[p]="[MaxProperties ~]";break}const h=f[p];d[p]=di(p,h,a-1,r,s),l++}return o(t),d}function jf(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(Wc(t))return Fc(t);if(Vd(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${pt(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=qf(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function qf(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function Vf(e){return~-encodeURI(e).split(/%..|./).length}function Gf(e){return Vf(JSON.stringify(e))}function Yf(){const e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function Dt(e,t=[]){return[e,t]}function Kf(e,t){const[n,r]=e;return[n,[...r,t]]}function fi(e,t){const n=e[1];for(const r of n){const s=r[0].type;if(t(r,s))return!0}return!1}function Xf(e,t){return fi(e,(n,r)=>t.includes(r))}function pi(e){const t=us(G);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Jf(e){const[t,n]=e;let r=JSON.stringify(t);function s(i){typeof r=="string"?r=typeof i=="string"?r+i:[pi(r),i]:r.push(typeof i=="string"?pi(i):i)}for(const i of n){const[o,c]=i;if(s(` ${JSON.stringify(o)} `),typeof c=="string"||c instanceof Uint8Array)s(c);else{let a;try{a=JSON.stringify(c)}catch{a=JSON.stringify(Je(c))}s(a)}}return typeof r=="string"?r:Zf(r)}function Zf(e){const t=e.reduce((s,i)=>s+i.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Qf(e){return[{type:"span"},e]}function ep(e){const t=typeof e.data=="string"?pi(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const Eu={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function tp(e){return e in Eu}function Jo(e){return tp(e)?Eu[e]:e}function Xi(e){if(!(e!=null&&e.sdk))return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function vu(e,t,n,r){var i;const s=(i=e.sdkProcessingMetadata)==null?void 0:i.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:wn(r)},...s&&{trace:s}}}function np(e,t){var r,s,i,o;if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...((r=e.sdk)==null?void 0:r.integrations)||[],...t.integrations||[]],packages:[...((s=e.sdk)==null?void 0:s.packages)||[],...t.packages||[]],settings:(i=e.sdk)!=null&&i.settings||t.settings?{...(o=e.sdk)==null?void 0:o.settings,...t.settings}:void 0},e}function rp(e,t,n,r){const s=Xi(n),i={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:wn(t)}},o="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Dt(i,[o])}function sp(e,t,n,r){const s=Xi(n),i=e.type&&e.type!=="replay_event"?e.type:"event";np(e,n==null?void 0:n.sdk);const o=vu(e,s,r,t);return delete e.sdkProcessingMetadata,Dt(o,[[{type:i},e]])}function ip(e,t){function n(p){return!!p.trace_id&&!!p.public_key}const r=_t(e[0]),s=t==null?void 0:t.getDsn(),i=t==null?void 0:t.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!i&&s&&{dsn:wn(s)}},{beforeSendSpan:c,ignoreSpans:a}=(t==null?void 0:t.getOptions())||{},u=a!=null&&a.length?e.filter(p=>!Hn(te(p),a)):e,d=e.length-u.length;d&&(t==null||t.recordDroppedEvent("before_send","span",d));const l=c?p=>{const h=te(p),m=Su(c)?h:c(h);return m||(li(),h)}:te,f=[];for(const p of u){const h=l(p);h&&f.push(Qf(h))}return Dt(o,f)}function op(e){if(!R)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=te(e),{spanId:s}=e.spanContext(),i=Lt(e),o=Te(e),c=o===e,a=`[Tracing] Starting ${i?"sampled":"unsampled"} ${c?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${s}`];if(r&&u.push(`parent ID: ${r}`),!c){const{op:d,description:l}=te(o);u.push(`root ID: ${o.spanContext().spanId}`),d&&u.push(`root op: ${d}`),l&&u.push(`root description: ${l}`)}S.log(`${a} ${u.join(` `)}`)}function ap(e){if(!R)return;const{description:t="< unknown name >",op:n="< unknown op >"}=te(e),{spanId:r}=e.spanContext(),i=Te(e)===e,o=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;S.log(o)}function cp(e,t,n,r=Ie()){const s=r&&Te(r);s&&(R&&S.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),s.addEvent(e,{[tr]:t,[er]:n}))}function Zo(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},s=r[er],i=r[tr];typeof s=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:s})}),t}function qt(e){return e.getOptions().traceLifecycle==="stream"}const Qo=1e3;class hs{constructor(t={}){this._traceId=t.traceId||mt(),this._spanId=t.spanId||dt(),this._startTime=t.startTimestamp||_e(),this._links=t.links,this._attributes={},this.setAttributes({[he]:"manual",[et]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){const{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?ps:ou}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=ft(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(He,"custom"),this}end(t){this._endTime||(this._endTime=ft(t),ap(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[et],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:pu(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[he],profile_id:this._attributes[Yi],exclusive_time:this._attributes[Nt],measurements:Zo(this._events),is_segment:this._isStandaloneSpan&&Te(this)===this||void 0,segment_id:this._isStandaloneSpan?Te(this).spanContext().spanId:void 0,links:au(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===Te(this),status:hu(this._status),attributes:this._attributes,links:cu(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){R&&S.log("[Tracing] Adding an event to span:",t);const s=ea(n)?n:r||_e(),i=ea(n)?{}:n||{},o={name:t,time:ft(s),attributes:i};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=U();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===Te(this)))return;if(this._isStandaloneSpan){this._sampled?lp(ip([this],t)):(R&&S.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&qt(t)){t.emit("afterSegmentSpanEnd",this);return}const r=this._convertSpanToTransaction();r&&(Vr(this).scope||ne()).captureEvent(r)}_convertSpanToTransaction(){var d;if(!ta(te(this)))return;this._name||(R&&S.warn("Transaction has no name, falling back to ``."),this._name="");const{scope:t,isolationScope:n}=Vr(this),r=(d=t==null?void 0:t.getScopeData().sdkProcessingMetadata)==null?void 0:d.normalizedRequest;if(this._sampled!==!0)return;const i=Ar(this).filter(l=>l!==this&&!up(l)).map(l=>te(l)).filter(ta),o=this._attributes[He];delete this._attributes[qo],i.forEach(l=>{delete l.data[qo]});const c={contexts:{trace:Pf(this)},spans:i.length>Qo?i.sort((l,f)=>l.start_timestamp-f.start_timestamp).slice(0,Qo):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:_t(this)},request:r,...o&&{transaction_info:{source:o}}},a=Zo(this._events);return a&&Object.keys(a).length&&(R&&S.log("[Measurements] Adding measurements to transaction event",JSON.stringify(a,void 0,2)),c.measurements=a),c}}function ea(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function ta(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function up(e){return e instanceof hs&&e.isStandaloneSpan()}function lp(e){const t=U();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function dp(e,t,n){if(!Ye(e))return[!1];let r,s;typeof e.tracesSampler=="function"?(s=e.tracesSampler({...t,inheritOrSampleWith:c=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):c}),r=!0):t.parentSampled!==void 0?s=t.parentSampled:typeof e.tracesSampleRate<"u"&&(s=e.tracesSampleRate,r=!0);const i=jt(s);if(i===void 0)return R&&S.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(s)} of type ${JSON.stringify(typeof s)}.`),[!1];if(!i)return R&&S.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,i,r];const o=nVi(e.scope,o):s!==void 0?o=>Tu(s,o):o=>o())(()=>{const o=ne(),c=_p(o,s);return e.onlyIfParent&&!c?new st:pp({parentSpan:c,spanArguments:n,forceTransaction:r,scope:o})})}function Tu(e,t){const n=wu();return n.withActiveSpan?n.withActiveSpan(e,t):Vi(r=>($n(r,e||void 0),t(r)))}function pp({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Ye()){const c=new st;if(n||!e){const a={sampled:"false",sample_rate:"0",transaction:t.name,..._t(c)};Nr(c,a)}return c}const s=U();if(gp(s,t))return Ji(r)||s==null||s.recordDroppedEvent("ignored","span"),new st({dropReason:"ignored",traceId:(e==null?void 0:e.spanContext().traceId)??r.getPropagationContext().traceId});const i=Me();let o;if(e&&!n)o=mp(e,r,t),mu(e,o);else if(e){const c=_t(e),{traceId:a,spanId:u}=e.spanContext(),d=Lt(e);o=na({traceId:a,parentSpanId:u,...t},r,d),Nr(o,c)}else{const{traceId:c,dsc:a,parentSpanId:u,sampled:d}={...i.getPropagationContext(),...r.getPropagationContext()};o=na({traceId:c,parentSpanId:u,...t},r,d),a&&Nr(o,a)}return op(o),bf(o,r,i),o}function hp(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=ft(e.startTime),delete r.startTime,r}return n}function wu(){const e=Vt();return Tn(e)}function na(e,t,n){var m;const r=U(),s=(r==null?void 0:r.getOptions())||{},{name:i=""}=e,o={spanAttributes:{...e.attributes},spanName:i,parentSampled:n};r==null||r.emit("beforeSampling",o,{decision:!1});const c=o.parentSampled??n,a=o.spanAttributes,u=t.getPropagationContext(),d=Ji(t),[l,f,p]=d?[!1]:dp(s,{name:i,parentSampled:c,attributes:a,parentSampleRate:jt((m=u.dsc)==null?void 0:m.sample_rate)},u.sampleRand),h=new hs({...e,attributes:{[He]:"custom",[Gi]:f!==void 0&&p?f:void 0,...a},sampled:l});return!l&&r&&!d&&(R&&S.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",qt(r)?"span":"transaction")),r&&r.emit("spanStart",h),h}function mp(e,t,n){const{spanId:r,traceId:s}=e.spanContext(),i=Ji(t),o=i?!1:Lt(e),c=o?new hs({...n,parentSpanId:r,traceId:s,sampled:o}):new st({traceId:s});mu(e,c);const a=U();return a&&(qt(a)&&c instanceof st&&(e instanceof st&&e.dropReason?(c.dropReason=e.dropReason,a.recordDroppedEvent(e.dropReason,"span")):i||(c.dropReason="sample_rate",a.recordDroppedEvent("sample_rate","span"))),a.emit("spanStart",c),n.endTimestamp&&(a.emit("spanEnd",c),a.emit("afterSpanEnd",c))),c}function _p(e,t){if(t)return t;if(t===null)return;const n=qr(e);if(!n)return;const r=U();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Te(n):n}function gp(e,t){var r;const n=e==null?void 0:e.getOptions().ignoreSpans;return!e||!qt(e)||!(n!=null&&n.length)?!1:Hn({description:t.name||"",op:((r=t.attributes)==null?void 0:r[et])||t.op},n)}function Ji(e){return e.getScopeData().sdkProcessingMetadata[fp]===!0}const Lr={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},yp="heartbeatFailed",Sp="idleTimeout",bp="finalTimeout",Ep="externalFinish";function Iu(e,t={}){const n=new Map;let r=!1,s,i=Ep,o=!t.disableAutoFinish;const c=[],{idleTimeout:a=Lr.idleTimeout,finalTimeout:u=Lr.finalTimeout,childSpanTimeout:d=Lr.childSpanTimeout,beforeSpanEnd:l,trimIdleSpanEndTimestamp:f=!0}=t,p=U();if(!p||!Ye()){const y=new st,w={sample_rate:"0",sampled:"false",..._t(y)};return Nr(y,w),y}const h=ne(),m=Ie(),_=vp(e);_.end=new Proxy(_.end,{apply(y,w,$){if(l&&l(_),w instanceof st)return;const[v,...x]=$,T=v||_e(),k=ft(T),M=Ar(_).filter(I=>I!==_),Z=te(_);if(!M.length||!f)return A(k),Reflect.apply(y,w,[k,...x]);const J=p.getOptions().ignoreSpans,Q=M==null?void 0:M.reduce((I,V)=>{const W=te(V);return!W.timestamp||J&&Hn(W,J)?I:I?Math.max(I,W.timestamp):W.timestamp},void 0),E=Z.start_timestamp,P=Math.min(E?E+u/1e3:1/0,Math.max(E||-1/0,Math.min(k,Q||1/0)));return A(P),Reflect.apply(y,w,[P,...x])}});function g(){s&&(clearTimeout(s),s=void 0)}function b(y){g(),s=setTimeout(()=>{!r&&n.size===0&&o&&(i=Sp,_.end(y))},a)}function N(y){s=setTimeout(()=>{!r&&o&&(i=yp,_.end(y))},d)}function C(y){g(),n.set(y,!0);const w=_e();N(w+d/1e3)}function H(y){if(n.has(y)&&n.delete(y),n.size===0){const w=_e();b(w+a/1e3)}}function A(y){r=!0,n.clear(),c.forEach(M=>M()),$n(h,m);const w=te(_),{start_timestamp:$}=w;if(!$)return;w.data[Bn]||_.setAttribute(Bn,i);const x=w.status;(!x||x==="unknown")&&_.setStatus({code:fs}),S.log(`[Tracing] Idle span "${w.op}" finished`);const T=Ar(_).filter(M=>M!==_);let k=0;T.forEach(M=>{M.isRecording()&&(M.setStatus({code:ve,message:"cancelled"}),M.end(y),R&&S.log("[Tracing] Cancelling span since span ended early",JSON.stringify(M,void 0,2)));const Z=te(M),{timestamp:J=0,start_timestamp:Q=0}=Z,E=Q<=y,P=(u+a)/1e3,I=J-Q<=P;if(R){const V=JSON.stringify(M,void 0,2);E?I||S.log("[Tracing] Discarding span since it finished after idle span final timeout",V):S.log("[Tracing] Discarding span since it happened after idle span was finished",V)}(!I||!E)&&(Hf(_,M),k++)}),k>0&&_.setAttribute("sentry.idle_span_discarded_spans",k)}return c.push(p.on("spanStart",y=>{if(r||y===_||te(y).timestamp||y instanceof hs&&y.isStandaloneSpan())return;Ar(_).includes(y)&&C(y.spanContext().spanId)})),c.push(p.on("spanEnd",y=>{r||H(y.spanContext().spanId)})),c.push(p.on("idleSpanEnableAutoFinish",y=>{y===_&&(o=!0,b(),n.size&&N())})),t.disableAutoFinish||b(),setTimeout(()=>{r||(_.setStatus({code:ve,message:"deadline_exceeded"}),i=bp,_.end())},u),_}function vp(e){const t=gt(e);return $n(ne(),t),R&&S.log("[Tracing] Started span is an idle span"),t}function Tp(e,t){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=t;wp(e,t),r&&Cp(e,r),Rp(e,n),Ip(e,s),kp(e,i)}function ra(e,t){const{extra:n,tags:r,attributes:s,user:i,contexts:o,level:c,sdkProcessingMetadata:a,breadcrumbs:u,fingerprint:d,eventProcessors:l,attachments:f,propagationContext:p,transactionName:h,span:m}=t;Rn(e,"extra",n),Rn(e,"tags",r),Rn(e,"attributes",s),Rn(e,"user",i),Rn(e,"contexts",o),e.sdkProcessingMetadata=Qn(e.sdkProcessingMetadata,a,2),c&&(e.level=c),h&&(e.transactionName=h),m&&(e.span=m),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),l.length&&(e.eventProcessors=[...e.eventProcessors,...l]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function Rn(e,t,n){e[t]=Qn(e[t],n,1)}function ku(e,t){const n=Kc().getScopeData();return e&&ra(n,e.getScopeData()),t&&ra(n,t.getScopeData()),n}function wp(e,t){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:c}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(s).length&&(e.user={...s,...e.user}),Object.keys(i).length&&(e.contexts={...i,...e.contexts}),o&&(e.level=o),c&&e.type!=="transaction"&&(e.transaction=c)}function Ip(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function kp(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Cp(e,t){e.contexts={trace:Ff(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:_t(t),...e.sdkProcessingMetadata};const n=Te(t),r=te(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function Rp(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}const Fs=0,sa=1,ia=2;function nr(e){return new Un(t=>{t(e)})}function Zi(e){return new Un((t,n)=>{n(e)})}class Un{constructor(t){this._state=Fs,this._handlers=[],this._runExecutor(t)}then(t,n){return new Un((r,s)=>{this._handlers.push([!1,i=>{if(!t)r(i);else try{r(t(i))}catch(o){s(o)}},i=>{if(!n)s(i);else try{r(n(i))}catch(o){s(o)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new Un((n,r)=>{let s,i;return this.then(o=>{i=!1,s=o,t&&t()},o=>{i=!0,s=o,t&&t()}).then(()=>{if(i){r(s);return}n(s)})})}_executeHandlers(){if(this._state===Fs)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===sa&&n[1](this._value),this._state===ia&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(i,o)=>{if(this._state===Fs){if(Xn(o)){o.then(r,s);return}this._state=i,this._value=o,this._executeHandlers()}},r=i=>{n(sa,i)},s=i=>{n(ia,i)};try{t(r,s)}catch(i){s(i)}}}function xp(e,t,n,r=0){try{const s=hi(t,n,e,r);return Xn(s)?s:nr(s)}catch(s){return Zi(s)}}function hi(e,t,n,r){const s=n[r];if(!e||!s)return e;const i=s({...e},t);return R&&i===null&&S.log(`Event processor "${s.id||"?"}" dropped event`),Xn(i)?i.then(o=>hi(o,t,n,r+1)):hi(i,t,n,r+1)}let at,oa,aa,St;function Mp(e){const t=G._sentryDebugIds,n=G._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],s=n?Object.keys(n):[];if(St&&r.length===oa&&s.length===aa)return St;oa=r.length,aa=s.length,St={},at||(at={});const i=(o,c)=>{for(const a of o){const u=c[a],d=at==null?void 0:at[a];if(d&&St&&u)St[d[0]]=u,at&&(at[a]=[d[0],u]);else if(u){const l=e(a);for(let f=l.length-1;f>=0;f--){const p=l[f],h=p==null?void 0:p.filename;if(h&&St&&at){St[h]=u,at[a]=[h,u];break}}}}};return t&&i(r,t),n&&i(s,n),St}function Cu(e,t,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:c=1e3}=e,a={...t,event_id:t.event_id||n.event_id||Ue(),timestamp:t.timestamp||Yt()},u=n.integrations||e.integrations.map(g=>g.name);Ap(a,e),Dp(a,u),s&&s.emit("applyFrameMetadata",t),t.type===void 0&&Np(a,e.stackParser);const d=Pp(r,n.captureContext);n.mechanism&&dn(a,n.mechanism);const l=s?s.getEventProcessors():[],f=ku(i,d),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),Tp(a,f);const h=[...l,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?nr(a):xp(h,a,n)).then(g=>(g&&Lp(g),typeof o=="number"&&o>0?Op(g,o,c):g))}function Ap(e,t){var c,a;const{environment:n,release:r,dist:s,maxValueLength:i}=t;e.environment=e.environment||n||Ki,!e.release&&r&&(e.release=r),!e.dist&&s&&(e.dist=s);const o=e.request;o!=null&&o.url&&i&&(o.url=ii(o.url,i)),i&&((a=(c=e.exception)==null?void 0:c.values)==null||a.forEach(u=>{u.value&&(u.value=ii(u.value,i))}))}function Np(e,t){var r,s;const n=Mp(t);(s=(r=e.exception)==null?void 0:r.values)==null||s.forEach(i=>{var o,c;(c=(o=i.stacktrace)==null?void 0:o.frames)==null||c.forEach(a=>{a.filename&&(a.debug_id=n[a.filename])})})}function Lp(e){var r,s;const t={};if((s=(r=e.exception)==null?void 0:r.values)==null||s.forEach(i=>{var o,c;(c=(o=i.stacktrace)==null?void 0:o.frames)==null||c.forEach(a=>{a.debug_id&&(a.abs_path?t[a.abs_path]=a.debug_id:a.filename&&(t[a.filename]=a.debug_id),delete a.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([i,o])=>{n.push({type:"sourcemap",code_file:i,debug_id:o})})}function Dp(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Op(e,t,n){var s,i;if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:Je(o.data,t,n)}}))},...e.user&&{user:Je(e.user,t,n)},...e.contexts&&{contexts:Je(e.contexts,t,n)},...e.extra&&{extra:Je(e.extra,t,n)}};return(s=e.contexts)!=null&&s.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Je(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:Je(o.data,t,n)}}))),(i=e.contexts)!=null&&i.flags&&r.contexts&&(r.contexts.flags=Je(e.contexts.flags,3,n)),r}function Pp(e,t){if(!t)return e;const n=e?e.clone():new it;return n.update(t),n}function Fp(e){if(e)return $p(e)?{captureContext:e}:Hp(e)?{captureContext:e}:e}function $p(e){return e instanceof it||typeof e=="function"}const Bp=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Hp(e){return Object.keys(e).some(t=>Bp.includes(t))}function ms(e,t){return ne().captureException(e,Fp(t))}function Ru(e,t){return ne().captureEvent(e,t)}function Up(e,t){Me().setContext(e,t)}function U0(e,t){Me().setTag(e,t)}function W0(e){Me().setUser(e)}function Wp(){const e=U();return(e==null?void 0:e.getOptions().enabled)!==!1&&!!(e!=null&&e.getTransport())}function zp(e){Me().addEventProcessor(e)}function ca(e){const t=Me(),{user:n}=ku(t,ne()),{userAgent:r}=G.navigator||{},s=tf({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return(i==null?void 0:i.status)==="ok"&&fn(i,{status:"exited"}),xu(),t.setSession(s),s}function xu(){const e=Me(),n=ne().getSession()||e.getSession();n&&nf(n),Mu(),e.setSession()}function Mu(){const e=Me(),t=U(),n=e.getSession();n&&t&&t.captureSession(n)}function $s(e=!1){if(e){xu();return}Mu()}const jp="7";function qp(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Vp(e){return`${qp(e)}${e.projectId}/envelope/`}function Gp(e,t){const n={sentry_version:jp};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Yp(e,t,n){return t||`${Vp(e)}?${Gp(e,n)}`}const ua=[];function Kp(e){const t={};return e.forEach(n=>{const{name:r}=n,s=t[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function Xp(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(s=>{s.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const s=n(t);r=Array.isArray(s)?s:[s]}else r=t;return Kp(r)}function Jp(e,t){const n={};return t.forEach(r=>{r!=null&&r.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&Au(e,r,n)}),n}function la(e,t){for(const n of t)n!=null&&n.afterAllSetup&&n.afterAllSetup(e)}function Au(e,t,n){if(n[t.name]){R&&S.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!ua.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),ua.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(s,i)=>r(s,i,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),s=Object.assign((i,o)=>r(i,o,e),{id:t.name});e.addEventProcessor(s)}R&&S.log(`Integration installed: ${t.name}`)}function da(e){const t=U();if(!t){R&&S.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}function Zp(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function Qp(e,t,n,r){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=wn(r)),Dt(s,[Zp(e)])}function mi(e,t){const n=t??eh(e)??[];if(n.length===0)return;const r=e.getOptions(),s=Qp(n,r._metadata,r.tunnel,e.getDsn());Nu().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function eh(e){return Nu().get(e)}function Nu(){return En("clientToLogBufferMap",()=>new WeakMap)}function th(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function nh(e,t,n,r){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=wn(r)),Dt(s,[th(e)])}function Lu(e,t){const n=t??rh(e)??[];if(n.length===0)return;const r=e.getOptions(),s=nh(n,r._metadata,r.tunnel,e.getDsn());Du().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function rh(e){return Du().get(e)}function Du(){return En("clientToMetricBufferMap",()=>new WeakMap)}function Ou(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const Qi=Symbol.for("SentryBufferFullError");function eo(e=100){const t=new Set;function n(){return t.sizer(c),()=>r(c)),c}function i(o){if(!t.size)return nr(!0);const c=Promise.allSettled(Array.from(t)).then(()=>!0);if(!o)return c;const a=[c,new Promise(u=>Ou(setTimeout(()=>u(!1),o)))];return Promise.race(a)}return{get $(){return Array.from(t)},add:s,drain:i}}const sh=60*1e3;function ih(e,t=Zn()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?sh:r-t}function oh(e,t){return e[t]||e.all||0}function Pu(e,t,n=Zn()){return oh(e,t)>n}function Fu(e,{statusCode:t,headers:n},r=Zn()){const s={...e},i=n==null?void 0:n["x-sentry-rate-limits"],o=n==null?void 0:n["retry-after"];if(i)for(const c of i.trim().split(",")){const[a,u,,,d]=c.split(":",5),l=parseInt(a,10),f=(isNaN(l)?60:l)*1e3;if(!u)s.all=r+f;else for(const p of u.split(";"))p==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(s[p]=r+f):s[p]=r+f}else o?s.all=r+ih(o,r):t===429&&(s.all=r+60*1e3);return s}const $u=64;function ah(e,t,n=eo(e.bufferSize||$u)){let r={};const s=o=>n.drain(o);function i(o){const c=[];if(fi(o,(l,f)=>{const p=Jo(f);Pu(r,p)?e.recordDroppedEvent("ratelimit_backoff",p):c.push(l)}),c.length===0)return Promise.resolve({});const a=Dt(o[0],c),u=l=>{if(Xf(a,["client_report"])){R&&S.warn(`Dropping client report. Will not send outcomes (reason: ${l}).`);return}fi(a,(f,p)=>{e.recordDroppedEvent(l,Jo(p))})},d=()=>t({body:Jf(a)}).then(l=>l.statusCode===413?(R&&S.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),l):(R&&l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&S.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=Fu(r,l),l),l=>{throw u("network_error"),R&&S.error("Encountered error running transport request:",l),l});return n.add(d).then(l=>l,l=>{if(l===Qi)return R&&S.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:i,flush:s}}function ch(e,t,n){const r=[{type:"client_report"},{timestamp:Yt(),discarded_events:e}];return Dt(t?{dsn:t}:{},[r])}function Bu(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n!=null&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function uh(e){var a;const{trace_id:t,parent_span_id:n,span_id:r,status:s,origin:i,data:o,op:c}=((a=e.contexts)==null?void 0:a.trace)??{};return{data:o??{},description:e.transaction,op:c,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:s,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:o==null?void 0:o[Yi],exclusive_time:o==null?void 0:o[Nt],measurements:e.measurements,is_segment:!0}}function lh(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[Yi]:e.profile_id},...e.exclusive_time&&{[Nt]:e.exclusive_time}}}},measurements:e.measurements}}const fa="Not capturing exception because it's already been captured.",pa="Discarded session because of missing or non-string release",Hu=Symbol.for("SentryInternalError"),Uu=Symbol.for("SentryDoNotSendEventError"),dh=5e3;function Dr(e){return{message:e,[Hu]:!0}}function Bs(e){return{message:e,[Uu]:!0}}function ha(e){return!!e&&typeof e=="object"&&Hu in e}function ma(e){return!!e&&typeof e=="object"&&Uu in e}function _a(e,t,n,r,s){let i=0,o,c=!1;e.on(n,()=>{i=0,clearTimeout(o),c=!1}),e.on(t,a=>{i+=r(a),i>=8e5?s(e):c||(c=!0,o=Ou(setTimeout(()=>{s(e)},dh)))}),e.on("flush",()=>{s(e)})}class fh{constructor(t){var r,s,i;if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=eo(((r=t.transportOptions)==null?void 0:r.bufferSize)??$u),t.dsn?this._dsn=Nf(t.dsn):R&&S.warn("No DSN provided, client will not send events."),this._dsn){const o=Yp(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:o})}this._options.enableLogs=this._options.enableLogs??((s=this._options._experiments)==null?void 0:s.enableLogs),this._options.enableLogs&&_a(this,"afterCaptureLog","flushLogs",_h,mi),(this._options.enableMetrics??((i=this._options._experiments)==null?void 0:i.enableMetrics)??!0)&&_a(this,"afterCaptureMetric","flushMetrics",mh,Lu)}captureException(t,n,r){const s=Ue();if(Uo(t))return R&&S.log(fa),s;const i={event_id:s,...n};return this._process(()=>this.eventFromException(t,i).then(o=>this._captureEvent(o,i,r)).then(o=>o),"error"),i.event_id}captureMessage(t,n,r,s){const i={event_id:Ue(),...r},o=Wi(t)?t:String(t),c=ln(t),a=c?this.eventFromMessage(o,n,i):this.eventFromException(t,i);return this._process(()=>a.then(u=>this._captureEvent(u,i,s)),c?"unknown":"error"),i.event_id}captureEvent(t,n,r){const s=Ue();if(n!=null&&n.originalException&&Uo(n.originalException))return R&&S.log(fa),s;const i={event_id:s,...n},o=t.sdkProcessingMetadata||{},c=o.capturedSpanScope,a=o.capturedSpanIsolationScope,u=ga(t.type);return this._process(()=>this._captureEvent(t,i,c||r,a),u),i.event_id}captureSession(t){this.sendSession(t),fn(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(!n)return!0;this.emit("flush");const r=await this._isClientDoneProcessing(t),s=await n.flush(t);return r&&s}async close(t){mi(this);const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),Au(this,t,this._integrations),n||la(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=sp(t,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=Kf(r,ep(s));this.sendEnvelope(r).then(s=>this.emit("afterSendEvent",t,s))}sendSession(t){const{release:n,environment:r=Ki}=this._options;if("aggregates"in t){const i=t.attrs||{};if(!i.release&&!n){R&&S.warn(pa);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){R&&S.warn(pa);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const s=rp(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(s)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const s=`${t}:${n}`;R&&S.log(`Recording outcome: "${s}"${r>1?` (${r} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,s=(...i)=>n(...i);return r.add(s),()=>{r.delete(s)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(s=>s(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return R&&S.error("Error while sending envelope:",n),{}}return R&&S.error("Transport disabled"),{}}dispose(){}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=Jp(this,t),la(this,t)}_updateSessionFromEvent(t,n){var a,u;let r=n.level==="fatal",s=!1;const i=(a=n.exception)==null?void 0:a.values;if(i){s=!0,r=!1;for(const d of i)if(((u=d.mechanism)==null?void 0:u.handled)===!1){r=!0;break}}const o=t.status==="ok";(o&&t.errors===0||o&&r)&&(fn(t,{...r&&{status:"crashed"},errors:t.errors||Number(s||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||nsetTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,s){const i=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&(o!=null&&o.length)&&(n.integrations=o),this.emit("preprocessEvent",t,n),t.type||s.setLastEventId(t.event_id||n.event_id),Cu(i,t,n,r,this,s).then(c=>{var u;if(c===null)return c;this.emit("postprocessEvent",c,n),c.contexts={trace:{...(u=c.contexts)==null?void 0:u.trace,...hf(r)},...c.contexts};const a=yu(this,r);return c.sdkProcessingMetadata={dynamicSamplingContext:a,...c.sdkProcessingMetadata},c})}_captureEvent(t,n={},r=ne(),s=Me()){return R&&_i(t)&&S.log(`Captured error event \`${Bu(t)[0]||""}\``),this._processEvent(t,n,r,s).then(i=>i.event_id,i=>{R&&(ma(i)?S.log(i.message):ha(i)?S.warn(i.message):S.warn(i))})}_processEvent(t,n,r,s){const i=this.getOptions(),{sampleRate:o}=i,c=Wu(t),a=_i(t),d=`before send for type \`${t.type||"error"}\``,l=typeof o>"u"?void 0:jt(o);if(a&&typeof l=="number"&&wt()>l)return this.recordDroppedEvent("sample_rate","error"),Zi(Bs(`Discarding event because it's not included in the random sample (sampling rate = ${o})`));const f=ga(t.type);return this._prepareEvent(t,n,r,s).then(p=>{var _;if(p===null)throw this.recordDroppedEvent("event_processor",f),Bs("An event processor returned `null`, will not send event.");if(((_=n.data)==null?void 0:_.__sentry__)===!0)return p;const m=hh(this,i,p,n);return ph(m,d)}).then(p=>{var _;if(p===null){if(this.recordDroppedEvent("before_send",f),c){const b=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",b)}throw Bs(`${d} returned \`null\`, will not send event.`)}const h=r.getSession()||s.getSession();if(a&&h&&this._updateSessionFromEvent(h,p),c){const g=((_=p.sdkProcessingMetadata)==null?void 0:_.spanCountBeforeProcessing)||0,b=p.spans?p.spans.length:0,N=g-b;N>0&&this.recordDroppedEvent("before_send","span",N)}const m=p.transaction_info;if(c&&m&&p.transaction!==t.transaction){const g="custom";p.transaction_info={...m,source:g}}return this.sendEvent(p,n),p}).then(null,p=>{throw ma(p)||ha(p)?p:(this.captureException(p,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:p}),Dr(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. Reason: ${p}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===Qi&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[s,i]=n.split(":");return{reason:s,category:i,quantity:r}})}_flushOutcomes(){R&&S.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){R&&S.log("No outcomes to send");return}if(!this._dsn){R&&S.log("No dsn provided, will not send outcomes");return}R&&S.log("Sending outcomes:",t);const n=ch(t,this._options.tunnel&&wn(this._dsn));this.sendEnvelope(n)}}function ga(e){return e==="replay_event"?"replay":e||"error"}function ph(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Xn(e))return e.then(r=>{if(!Fn(r)&&r!==null)throw Dr(n);return r},r=>{throw Dr(`${t} rejected with ${r}`)});if(!Fn(e)&&e!==null)throw Dr(n);return e}function hh(e,t,n,r){const{beforeSend:s,beforeSendTransaction:i,ignoreSpans:o}=t,c=!Su(t.beforeSendSpan)&&t.beforeSendSpan;let a=n;if(_i(a)&&s)return s(a,r);if(Wu(a)){if(c||o){const u=uh(a);if(o!=null&&o.length&&Hn(u,o))return null;if(c){const d=c(u);d?a=Qn(n,lh(d)):li()}if(a.spans){const d=[],l=a.spans;for(const p of l){if(o!=null&&o.length&&Hn(p,o)){Wf(l,p);continue}if(c){const h=c(p);h?d.push(h):(li(),d.push(p))}else d.push(p)}const f=a.spans.length-d.length;f&&e.recordDroppedEvent("before_send","span",f),a.spans=d}}if(i){if(a.spans){const u=a.spans.length;a.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return i(a,r)}}return a}function _i(e){return e.type===void 0}function Wu(e){return e.type==="transaction"}function mh(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+zu(e.attributes)}function _h(e){let t=0;return e.message&&(t+=e.message.length*2),t+zu(e.attributes)}function zu(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*ya(n[0]):ln(n)?t+=ya(n):t+=100}),t}function ya(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function gh(e){return ls(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Sa(e){return gh(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function yh(e,t){t.debug===!0&&(R?S.enable():ot(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),ne().update(t.initialScope);const r=new e(t);return Sh(r),r.init(),r}function Sh(e){ne().setClient(e)}const bh="thismessage:/";function to(e){return"isRelative"in e}function no(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?bh:void 0;try{if("canParse"in URL&&!URL.canParse(e,r))return;const s=new URL(e,r);return n?{isRelative:n,pathname:s.pathname,search:s.search,hash:s.hash}:s}catch{}}function Eh(e){if(to(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function Wt(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function vh(e){return e.split(/[?#]/,1)[0]}function It(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",s=e.includes(";base64,"),i=e.indexOf(",");let o="";if(t&&i!==-1){const c=e.slice(i+1);o=c.length>10?`${c.slice(0,10)}... [truncated]`:c}return`data:${r}${s?",base64":""}${o?`,${o}`:""}`}return e}function Th(e,t){const n=t==null?void 0:t.getDsn(),r=t==null?void 0:t.getOptions().tunnel;return Ih(e,n)||wh(e,r)}function wh(e,t){return t?ba(e)===ba(t):!1}function Ih(e,t){const n=no(e);return!n||to(n)?!1:t?n.host.includes(t.host)&&/(^|&|\?)sentry_key=/.test(n.search):!1}function ba(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function kh(e){var t;"aggregates"in e?((t=e.attrs)==null?void 0:t.ip_address)===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function ju(e,t,n=[t],r="npm"){const s=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};s.name||(s.name=`sentry.javascript.${t}`,s.packages=n.map(i=>({name:`${r}:@sentry/${i}`,version:Ht})),s.version=Ht)}function qu(e={}){const t=e.client||U();if(!Wp()||!t)return{};const n=Vt(),r=Tn(n);if(r.getTraceData)return r.getTraceData(e);const s=e.scope||ne(),i=e.span||Ie(),o=i?$f(i):Ch(s),c=i?_t(i):yu(t,s),a=vf(c);if(!ru.test(o))return S.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const d={"sentry-trace":o,baggage:a};return e.propagateTraceparent&&(d.traceparent=i?Bf(i):Rh(s)),d}function Ch(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return su(t,r,n)}function Rh(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return iu(t,r,n)}function xh(e,t,n){let r,s,i;const o=n!=null&&n.maxWait?Math.max(n.maxWait,t):0,c=(n==null?void 0:n.setTimeoutImpl)||setTimeout;function a(){return u(),r=e(),r}function u(){s!==void 0&&clearTimeout(s),i!==void 0&&clearTimeout(i),s=i=void 0}function d(){return s!==void 0||i!==void 0?a():r}function l(){return s&&clearTimeout(s),s=c(a,t),o&&i===void 0&&(i=c(a,o)),r}return l.cancel=u,l.flush=d,l}const Mh=100;function Rt(e,t){const n=U(),r=Me();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=Mh}=n.getOptions();if(i<=0)return;const c={timestamp:Yt(),...e},a=s?ot(()=>s(c,t)):c;a!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,i))}let Ea;const Ah="FunctionToString",va=new WeakMap,Nh=()=>({name:Ah,setupOnce(){Ea=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=qi(this),n=va.has(U())&&t!==void 0?t:this;return Ea.apply(n,e)}}catch{}},setup(e){va.set(e,!0)}}),Lh=Nh,Dh=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],Oh="EventFilters",Ph=(e={})=>{let t;return{name:Oh,setup(n){const r=n.getOptions();t=Ta(e,r)},processEvent(n,r,s){if(!t){const i=s.getOptions();t=Ta(e,i)}return $h(n,t)?null:n}}},Fh=(e={})=>({...Ph(e),name:"InboundFilters"});function Ta(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Dh],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function $h(e,t){if(e.type){if(e.type==="transaction"&&Hh(e,t.ignoreTransactions))return R&&S.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. Event: ${Ot(e)}`),!0}else{if(Bh(e,t.ignoreErrors))return R&&S.warn(`Event dropped due to being matched by \`ignoreErrors\` option. Event: ${Ot(e)}`),!0;if(jh(e))return R&&S.warn(`Event dropped due to not having an error message, error type or stacktrace. Event: ${Ot(e)}`),!0;if(Uh(e,t.denyUrls))return R&&S.warn(`Event dropped due to being matched by \`denyUrls\` option. Event: ${Ot(e)}. Url: ${Yr(e)}`),!0;if(!Wh(e,t.allowUrls))return R&&S.warn(`Event dropped due to not being matched by \`allowUrls\` option. Event: ${Ot(e)}. Url: ${Yr(e)}`),!0}return!1}function Bh(e,t){return t!=null&&t.length?Bu(e).some(n=>lt(n,t)):!1}function Hh(e,t){if(!(t!=null&&t.length))return!1;const n=e.transaction;return n?lt(n,t):!1}function Uh(e,t){if(!(t!=null&&t.length))return!1;const n=Yr(e);return n?lt(n,t):!1}function Wh(e,t){if(!(t!=null&&t.length))return!0;const n=Yr(e);return n?lt(n,t):!0}function zh(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!==""&&n.filename!=="[native code]")return n.filename||null}return null}function Yr(e){var t,n;try{const r=[...((t=e.exception)==null?void 0:t.values)??[]].reverse().find(i=>{var o,c,a;return((o=i.mechanism)==null?void 0:o.parent_id)===void 0&&((a=(c=i.stacktrace)==null?void 0:c.frames)==null?void 0:a.length)}),s=(n=r==null?void 0:r.stacktrace)==null?void 0:n.frames;return s?zh(s):null}catch{return R&&S.error(`Cannot extract url for event ${Ot(e)}`),null}}function jh(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)!=null&&n.length?!e.message&&!e.exception.values.some(r=>r.stacktrace||r.type&&r.type!=="Error"||r.value):!1}function qh(e,t,n,r,s,i){var c;if(!((c=s.exception)!=null&&c.values)||!i||!ht(i.originalException,Error))return;const o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;o&&(s.exception.values=gi(e,t,r,i.originalException,n,s.exception.values,o,0))}function gi(e,t,n,r,s,i,o,c){if(i.length>=n+1)return i;let a=[...i];if(ht(r[s],Error)){wa(o,c,r);const u=e(t,r[s]),d=a.length;Ia(u,s,d,c),a=gi(e,t,n,r[s],s,[u,...a],u,d)}return Vu(r)&&r.errors.forEach((u,d)=>{if(ht(u,Error)){wa(o,c,r);const l=e(t,u),f=a.length;Ia(l,`errors[${d}]`,f,c),a=gi(e,t,n,u,s,[l,...a],l,f)}}),a}function Vu(e){return Array.isArray(e.errors)}function wa(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Vu(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Ia(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Vh(e){const t="console";Mt(t,e),At(t,Gh)}function Gh(){"console"in G&&Nd.forEach(function(e){e in G.console&&De(G.console,e,function(t){return jr[e]=t,function(...n){Ge("console",{args:n,level:e});const s=jr[e];s==null||s.apply(G.console,n)}})})}function Gu(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const Yh="Dedupe",Kh=()=>{let e;return{name:Yh,processEvent(t){if(t.type)return t;try{if(Jh(t,e))return R&&S.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},Xh=Kh;function Jh(e,t){return t?!!(Zh(e,t)||Qh(e,t)):!1}function Zh(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Ku(e,t)||!Yu(e,t))}function Qh(e,t){const n=ka(t),r=ka(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Ku(e,t)||!Yu(e,t))}function Yu(e,t){let n=Oo(e),r=Oo(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let s=0;s({name:em,setup(e){e.on("spanStart",t=>{const n=ne().getScopeData(),r=Me().getScopeData(),s=n.conversationId||r.conversationId;if(s){const{op:i,data:o,description:c}=te(t);if(!(i!=null&&i.startsWith("gen_ai."))&&!o["ai.operationId"]&&!(c!=null&&c.startsWith("ai.")))return;t.setAttribute(_f,s)}})}}),nm=tm;function rm(e,t,n,r,s){if(!e.fetchData)return;const{method:i,url:o}=e.fetchData,c=Ye()&&t(o);if(e.endTimestamp){const p=e.fetchData.__span;if(!p)return;const h=r[p];h&&(c&&(om(h,e),sm(h,e,s)),delete r[p]);return}const{spanOrigin:a="auto.http.browser",propagateTraceparent:u=!1}=typeof s=="object"?s:{spanOrigin:s},d=!!Ie(),l=c&&d?gt(um(o,i,a)):new st;if(e.fetchData.__span=l.spanContext().spanId,r[l.spanContext().spanId]=l,n(e.fetchData.url)){const p=e.args[0],h={...e.args[1]||{}},m=im(p,h,Ye()&&d?l:void 0,u);m&&(e.args[1]=h,h.headers=m)}const f=U();if(f){const p={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};f.emit("beforeOutgoingRequestSpan",l,p)}return l}function sm(e,t,n){var s;const r=typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0;r==null||r(e,{headers:(s=t.response)==null?void 0:s.headers,error:t.error})}function im(e,t,n,r){const s=qu({span:n,propagateTraceparent:r}),i=s["sentry-trace"],o=s.baggage,c=s.traceparent;if(!i)return;const a=t.headers||(zi(e)?e.headers:void 0);if(a)if(am(a)){const u=new Headers(a);if(u.get("sentry-trace")||u.set("sentry-trace",i),r&&c&&!u.get("traceparent")&&u.set("traceparent",c),o){const d=u.get("baggage");d?gr(d)||u.set("baggage",`${d},${o}`):u.set("baggage",o)}return u}else if(cm(a)){const u=[...a];u.find(l=>l[0]==="sentry-trace")||u.push(["sentry-trace",i]),r&&c&&!u.find(l=>l[0]==="traceparent")&&u.push(["traceparent",c]);const d=a.find(l=>l[0]==="baggage"&&typeof l[1]=="string"&&gr(l[1]));return o&&!d&&u.push(["baggage",o]),u}else{const u="sentry-trace"in a?a["sentry-trace"]:void 0,d="traceparent"in a?a.traceparent:void 0,l="baggage"in a?a.baggage:void 0,f=l?Array.isArray(l)?[...l]:[l]:[],p=l&&(Array.isArray(l)?l.find(m=>gr(m)):gr(l));o&&!p&&f.push(o);const h=Object.assign({},a,{"sentry-trace":u??i,baggage:f.length>0?f.join(","):void 0});return r&&c&&!d&&(h.traceparent=c),h}else return{...s}}function om(e,t){var n,r;if(t.response){Zc(e,t.response.status);const s=(r=(n=t.response)==null?void 0:n.headers)==null?void 0:r.get("content-length");if(s){const i=parseInt(s);i>0&&e.setAttribute("http.response_content_length",i)}}else t.error&&e.setStatus({code:ve,message:"internal_error"});e.end()}function gr(e){return typeof e!="string"?!1:e.split(",").some(t=>t.trim().startsWith(Gr))}function am(e){return typeof Headers<"u"&&ht(e,Headers)}function cm(e){return Array.isArray(e)?e.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"):!1}function um(e,t,n){if(e.startsWith("data:")){const i=It(e);return{name:`${t} ${i}`,attributes:Ca(e,void 0,t,n)}}const r=no(e),s=r?Eh(r):e;return{name:`${t} ${s}`,attributes:Ca(e,r,t,n)}}function Ca(e,t,n,r){const s={url:It(e),type:"fetch","http.method":n,[he]:r,[et]:"http.client"};return t&&(to(t)||(s["http.url"]=It(t.href),s["server.address"]=t.host),t.search&&(s["http.query"]=t.search),t.hash&&(s["http.fragment"]=t.hash)),s}function lm(e,t={},n=ne()){const{message:r,name:s,email:i,url:o,source:c,associatedEventId:a,tags:u}=e,d={contexts:{feedback:{contact_email:i,name:s,message:r,url:o,source:c,associated_event_id:a}},type:"feedback",level:"info",tags:u},l=(n==null?void 0:n.getClient())||U();return l&&l.emit("beforeSendFeedback",d,t),n.captureEvent(d,t)}function Xu(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const Wn=G;function dm(){return"history"in Wn&&!!Wn.history}function fm(){if(!("fetch"in Wn))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function yi(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function pm(){var n;if(typeof EdgeRuntime=="string")return!0;if(!fm())return!1;if(yi(Wn.fetch))return!0;let e=!1;const t=Wn.document;if(t&&typeof t.createElement=="function")try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),(n=r.contentWindow)!=null&&n.fetch&&(e=yi(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){R&&S.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function Ju(e,t){const n="fetch";Mt(n,e),At(n,()=>Zu(void 0,t))}function hm(e){const t="fetch-body-resolved";Mt(t,e),At(t,()=>Zu(_m))}function Zu(e,t=!1){t&&!pm()||De(G,"fetch",function(n){return function(...r){const s=new Error,{method:i,url:o}=gm(r),c={args:r,fetchData:{method:i,url:o},startTimestamp:_e()*1e3,virtualError:s,headers:ym(r)};return e||Ge("fetch",{...c}),n.apply(G,r).then(async a=>(e?e(a):Ge("fetch",{...c,endTimestamp:_e()*1e3,response:a}),a),a=>{Ge("fetch",{...c,endTimestamp:_e()*1e3,error:a}),ls(a)&&a.stack===void 0&&(a.stack=s.stack,Oe(a,"framesToPop",1));const u=U(),d=(u==null?void 0:u.getOptions().enhanceFetchErrorMessages)??"always";if(d!==!1&&a instanceof TypeError&&(a.message==="Failed to fetch"||a.message==="Load failed"||a.message==="NetworkError when attempting to fetch resource."))try{const p=new URL(c.fetchData.url).host;d==="always"?a.message=`${a.message} (${p})`:Oe(a,"__sentry_fetch_url_host__",p)}catch{}throw a})}})}async function mm(e,t){if(e!=null&&e.body){const n=e.body,r=n.getReader(),s=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let i=!0;for(;i;){let o;try{o=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:c}=await r.read();clearTimeout(o),c&&(t(),i=!1)}catch{i=!1}finally{clearTimeout(o)}}clearTimeout(s),r.releaseLock(),n.cancel().then(null,()=>{})}}function _m(e){let t;try{t=e.clone()}catch{return}mm(t,()=>{Ge("fetch-body-resolved",{endTimestamp:_e()*1e3,response:e})})}function Or(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Ra(e){return typeof e=="string"?e:e?Or(e,"url")?e.url:e.toString?e.toString():"":""}function gm(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:Ra(n),method:Or(r,"method")?String(r.method).toUpperCase():zi(n)&&Or(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:Ra(t),method:Or(t,"method")?String(t.method).toUpperCase():"GET"}}function ym(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(zi(t))return new Headers(t.headers)}catch{}}function Sm(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function bm(){return"npm"}function Em(){return!Sm()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Kr(){return typeof window<"u"&&(!Em()||vm())}function vm(){const e=G.process;return(e==null?void 0:e.type)==="renderer"}const Ze=G,se=Ze.document,Mn=Ze.navigator,Qu="Report a Bug",Tm="Cancel",wm="Send Bug Report",Im="Confirm",km="Report a Bug",Cm="your.email@example.org",Rm="Email",xm="What's the bug? What did you expect?",Mm="Description",Am="Your Name",Nm="Name",Lm="Thank you for your report!",Dm="(required)",Om="Add a screenshot",Pm="Remove screenshot",Fm="Highlight",$m="Hide",Bm="Remove",Hm="widget",Um="api",Wm=5e3,zm=(e,t={includeReplay:!0})=>{if(!e.message)throw new Error("Unable to submit feedback with empty message");const n=U();if(!n)throw new Error("No client setup, cannot send feedback.");e.tags&&Object.keys(e.tags).length&&ne().setTags(e.tags);const r=lm({source:Um,url:Gt(),...e},t);return new Promise((s,i)=>{const o=setTimeout(()=>i("Unable to determine if Feedback was correctly sent."),3e4),c=n.on("afterSendEvent",(a,u)=>{if(a.event_id===r)return clearTimeout(o),c(),u!=null&&u.statusCode&&u.statusCode>=200&&u.statusCode<300?s(r):(u==null?void 0:u.statusCode)===403?i("Unable to send feedback. This could be because this domain is not in your list of allowed domains."):i("Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.")})})},Pr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function jm(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(Mn.userAgent)||/Macintosh/i.test(Mn.userAgent)&&Mn.maxTouchPoints&&Mn.maxTouchPoints>1||!isSecureContext)}function yr(e,t){return{...e,...t,tags:{...e.tags,...t.tags},onFormOpen:()=>{var n,r;(n=t.onFormOpen)==null||n.call(t),(r=e.onFormOpen)==null||r.call(e)},onFormClose:()=>{var n,r;(n=t.onFormClose)==null||n.call(t),(r=e.onFormClose)==null||r.call(e)},onSubmitSuccess:(n,r)=>{var s,i;(s=t.onSubmitSuccess)==null||s.call(t,n,r),(i=e.onSubmitSuccess)==null||i.call(e,n,r)},onSubmitError:n=>{var r,s;(r=t.onSubmitError)==null||r.call(t,n),(s=e.onSubmitError)==null||s.call(e,n)},onFormSubmitted:()=>{var n,r;(n=t.onFormSubmitted)==null||n.call(t),(r=e.onFormSubmitted)==null||r.call(e)},themeDark:{...e.themeDark,...t.themeDark},themeLight:{...e.themeLight,...t.themeLight}}}function qm(e){const t=se.createElement("style");return t.textContent=` .widget__actor { position: fixed; z-index: var(--z-index); margin: var(--page-margin); inset: var(--actor-inset); display: flex; align-items: center; gap: 8px; padding: 16px; font-family: inherit; font-size: var(--font-size); font-weight: 600; line-height: 1.14em; text-decoration: none; background: var(--actor-background, var(--background)); border-radius: var(--actor-border-radius, 1.7em/50%); border: var(--actor-border, var(--border)); box-shadow: var(--actor-box-shadow, var(--box-shadow)); color: var(--actor-color, var(--foreground)); fill: var(--actor-color, var(--foreground)); cursor: pointer; opacity: 1; transition: transform 0.2s ease-in-out; transform: translate(0, 0) scale(1); } .widget__actor[aria-hidden="true"] { opacity: 0; pointer-events: none; visibility: hidden; transform: translate(0, 16px) scale(0.98); } .widget__actor:hover { background: var(--actor-hover-background, var(--background)); filter: var(--interactive-filter); } .widget__actor svg { width: 1.14em; height: 1.14em; } @media (max-width: 600px) { .widget__actor span { display: none; } } `,e&&t.setAttribute("nonce",e),t}function Be(e,t){return Object.entries(t).forEach(([n,r])=>{e.setAttributeNS(null,n,r)}),e}const Jt=20,Vm="http://www.w3.org/2000/svg";function Gm(){const e=c=>Ze.document.createElementNS(Vm,c),t=Be(e("svg"),{width:`${Jt}`,height:`${Jt}`,viewBox:`0 0 ${Jt} ${Jt}`,fill:"var(--actor-color, var(--foreground))"}),n=Be(e("g"),{clipPath:"url(#clip0_57_80)"}),r=Be(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 s=e("defs"),i=Be(e("clipPath"),{id:"clip0_57_80"}),o=Be(e("rect"),{width:`${Jt}`,height:`${Jt}`,fill:"white"});return i.appendChild(o),s.appendChild(i),t.appendChild(s).appendChild(i).appendChild(o),t}function Ym({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){const s=se.createElement("button");if(s.type="button",s.className="widget__actor",s.ariaHidden="false",s.ariaLabel=t||e||Qu,s.appendChild(Gm()),e){const o=se.createElement("span");o.appendChild(se.createTextNode(e)),s.appendChild(o)}const i=qm(r);return{el:s,appendToDom(){n.appendChild(i),n.appendChild(s)},removeFromDom(){s.remove(),i.remove()},show(){s.ariaHidden="false"},hide(){s.ariaHidden="true"}}}const el="rgba(88, 74, 192, 1)",Km={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:el,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%)"},xa={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackground:el,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 Ma(e){return` --foreground: ${e.foreground}; --background: ${e.background}; --accent-foreground: ${e.accentForeground}; --accent-background: ${e.accentBackground}; --success-color: ${e.successColor}; --error-color: ${e.errorColor}; --border: ${e.border}; --box-shadow: ${e.boxShadow}; --outline: ${e.outline}; --interactive-filter: ${e.interactiveFilter}; `}function Aa({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){const s=se.createElement("style");return s.textContent=` :host { --font-family: system-ui, 'Helvetica Neue', Arial, sans-serif; --font-size: 14px; --z-index: 100000; --page-margin: 16px; --inset: auto 0 0 auto; --actor-inset: var(--inset); font-family: var(--font-family); font-size: var(--font-size); ${e!=="system"?`color-scheme: only ${e};`:""} ${Ma(e==="dark"?{...xa,...t}:{...Km,...n})} } ${e==="system"?` @media (prefers-color-scheme: dark) { :host { color-scheme: only dark; ${Ma({...xa,...t})} } }`:""} `,r&&s.setAttribute("nonce",r),s}const Xm=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>({id:s="sentry-feedback",autoInject:i=!0,showBranding:o=!0,isEmailRequired:c=!1,isNameRequired:a=!1,showEmail:u=!0,showName:d=!0,enableScreenshot:l=!0,useSentryUser:f={email:"email",name:"username"},tags:p,styleNonce:h,scriptNonce:m,colorScheme:_="system",themeLight:g={},themeDark:b={},addScreenshotButtonLabel:N=Om,cancelButtonLabel:C=Tm,confirmButtonLabel:H=Im,emailLabel:A=Rm,emailPlaceholder:y=Cm,formTitle:w=km,isRequiredLabel:$=Dm,messageLabel:v=Mm,messagePlaceholder:x=xm,nameLabel:T=Nm,namePlaceholder:k=Am,removeScreenshotButtonLabel:M=Pm,submitButtonLabel:Z=wm,successMessageText:J=Lm,triggerLabel:Q=Qu,triggerAriaLabel:E="",highlightToolText:P=Fm,hideToolText:I=$m,removeHighlightText:V=Bm,onFormOpen:W,onFormClose:Y,onSubmitSuccess:de,onSubmitError:Pe,onFormSubmitted:nt}={})=>{const ge={id:s,autoInject:i,showBranding:o,isEmailRequired:c,isNameRequired:a,showEmail:u,showName:d,enableScreenshot:l,useSentryUser:f,tags:p,styleNonce:h,scriptNonce:m,colorScheme:_,themeDark:b,themeLight:g,triggerLabel:Q,triggerAriaLabel:E,cancelButtonLabel:C,submitButtonLabel:Z,confirmButtonLabel:H,formTitle:w,emailLabel:A,emailPlaceholder:y,messageLabel:v,messagePlaceholder:x,nameLabel:T,namePlaceholder:k,successMessageText:J,isRequiredLabel:$,addScreenshotButtonLabel:N,removeScreenshotButtonLabel:M,highlightToolText:P,hideToolText:I,removeHighlightText:V,onFormClose:Y,onFormOpen:W,onSubmitError:Pe,onSubmitSuccess:de,onFormSubmitted:nt};let be=null,ze=null,Fe=[];const Cn=K=>{if(!be){const ue=se.createElement("div");ue.id=String(K.id),se.body.appendChild(ue),be=ue.attachShadow({mode:"open"}),ze=Aa(K),be.appendChild(ze)}return be},hr=async K=>{const ue=K.enableScreenshot&&jm();let Ae,Ee;try{Ae=(t?t():await e("feedbackModalIntegration",m))(),da(Ae)}catch{throw Pr&&S.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 B=ue?n?n():await e("feedbackScreenshotIntegration",m):void 0;B&&(Ee=B(),da(Ee))}catch{Pr&&S.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}const fe=Ae.createDialog({options:{...K,onFormClose:()=>{var B;fe==null||fe.close(),(B=K.onFormClose)==null||B.call(K)},onFormSubmitted:()=>{var B;fe==null||fe.close(),(B=K.onFormSubmitted)==null||B.call(K)}},screenshotIntegration:Ee,sendFeedback:zm,shadow:Cn(K)});return fe},mr=(K,ue={})=>{const Ae=yr(ge,ue),Ee=typeof K=="string"?se.querySelector(K):typeof K.addEventListener=="function"?K:null;if(!Ee)throw Pr&&S.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let fe=null;const B=async()=>{fe||(fe=await hr({...Ae,onFormSubmitted:()=>{var z;fe==null||fe.removeFromDom(),(z=Ae.onFormSubmitted)==null||z.call(Ae)}})),fe.appendToDom(),fe.open()};Ee.addEventListener("click",B);const ke=()=>{Fe=Fe.filter(z=>z!==ke),fe==null||fe.removeFromDom(),fe=null,Ee.removeEventListener("click",B)};return Fe.push(ke),ke},Ke=(K={})=>{const ue=yr(ge,K),Ae=Cn(ue),Ee=Ym({triggerLabel:ue.triggerLabel,triggerAriaLabel:ue.triggerAriaLabel,shadow:Ae,styleNonce:h});return mr(Ee.el,{...ue,onFormOpen(){Ee.hide()},onFormClose(){Ee.show()},onFormSubmitted(){Ee.show()}}),Ee};return{name:"Feedback",setupOnce(){!Kr()||!ge.autoInject||(se.readyState==="loading"?se.addEventListener("DOMContentLoaded",()=>Ke().appendToDom()):Ke().appendToDom())},attachTo:mr,createWidget(K={}){const ue=Ke(yr(ge,K));return ue.appendToDom(),ue},async createForm(K={}){return hr(yr(ge,K))},setTheme(K){if(ge.colorScheme=K,be){const ue=Aa(ge);ze?be.replaceChild(ue,ze):be.prepend(ue),ze=ue}},remove(){var K;be&&((K=be.parentElement)==null||K.remove(),be=null,ze=null),Fe.forEach(ue=>ue()),Fe=[]}}};var _s,oe,tl,Pt,Na,nl,Si,zn={},ro=[],Jm=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,so=Array.isArray;function Tt(e,t){for(var n in t)e[n]=t[n];return e}function rl(e){var t=e.parentNode;t&&t.removeChild(e)}function q(e,t,n){var r,s,i,o={};for(i in t)i=="key"?r=t[i]:i=="ref"?s=t[i]:o[i]=t[i];if(arguments.length>2&&(o.children=arguments.length>3?_s.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)o[i]===void 0&&(o[i]=e.defaultProps[i]);return Fr(e,o,r,s,null)}function Fr(e,t,n,r,s){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:s??++tl,__i:-1,__u:0};return s==null&&oe.vnode!=null&&oe.vnode(i),i}function rr(e){return e.children}function $r(e,t){this.props=e,this.context=t}function hn(e,t){if(t==null)return e.__?hn(e.__,e.__i+1):null;for(var n;tn?(bi(r,t,s),s.length=r.length=0,t=void 0,Pt.sort(Si)):t&&oe.__c&&oe.__c(t,ro));t&&bi(r,t,s),Xr.__r=0}function il(e,t,n,r,s,i,o,c,a,u,d){var l,f,p,h,m,_=r&&r.__k||ro,g=t.length;for(n.__d=a,Qm(n,t,_),a=n.__d,l=0;l0?Fr(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s)!=null?(s.__=e,s.__b=e.__b+1,c=e_(s,n,o=r+l,d),s.__i=c,i=null,c!==-1&&(d--,(i=n[c])&&(i.__u|=131072)),i==null||i.__v===null?(c==-1&&l--,typeof s.type!="function"&&(s.__u|=65536)):c!==o&&(c===o+1?l++:c>o?d>a-o?l+=c-o:l--:l=c(a!=null&&!(131072&a.__u)?1:0))for(;o>=0||c=0){if((a=t[o])&&!(131072&a.__u)&&s==a.key&&i===a.type)return o;o--}if(c=n.__.length&&n.__.push({__V:Br}),n.__[e]}function Ft(e){return mn=1,cl(ll,e)}function cl(e,t,n){var r=Kt(yt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ll(void 0,t),function(c){var a=r.__N?r.__N[0]:r.__[0],u=r.t(a,c);a!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=ie,!ie.u)){var s=function(c,a,u){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(f){return!!f.__c});if(d.every(function(f){return!f.__N}))return!i||i.call(this,c,a,u);var l=!1;return d.forEach(function(f){if(f.__N){var p=f.__[0];f.__=f.__N,f.__N=void 0,p!==f.__[0]&&(l=!0)}}),!(!l&&r.__c.props===c)&&(!i||i.call(this,c,a,u))};ie.u=!0;var i=ie.shouldComponentUpdate,o=ie.componentWillUpdate;ie.componentWillUpdate=function(c,a,u){if(this.__e){var d=i;i=void 0,s(c,a,u),i=d}o&&o.call(this,c,a,u)},ie.shouldComponentUpdate=s}return r.__N||r.__}function s_(e,t){var n=Kt(yt++,3);!pe.__s&&ao(n.__H,t)&&(n.__=e,n.i=t,ie.__H.__h.push(n))}function ul(e,t){var n=Kt(yt++,4);!pe.__s&&ao(n.__H,t)&&(n.__=e,n.i=t,ie.__h.push(n))}function i_(e){return mn=5,sr(function(){return{current:e}},[])}function o_(e,t,n){mn=6,ul(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function sr(e,t){var n=Kt(yt++,7);return ao(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function cn(e,t){return mn=8,sr(function(){return e},t)}function a_(e){var t=ie.context[e.__c],n=Kt(yt++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(ie)),t.props.value):e.__}function c_(e,t){pe.useDebugValue&&pe.useDebugValue(t?t(e):e)}function u_(e){var t=Kt(yt++,10),n=Ft();return t.__=e,ie.componentDidCatch||(ie.componentDidCatch=function(r,s){t.__&&t.__(r,s),n[1](r)}),[n[0],function(){n[1](void 0)}]}function l_(){var e=Kt(yt++,11);if(!e.__){for(var t=ie.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function d_(){for(var e;e=al.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Hr),e.__H.__h.forEach(vi),e.__H.__h=[]}catch(t){e.__H.__h=[],pe.__e(t,e.__v)}}pe.__b=function(e){ie=null,$a&&$a(e)},pe.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),za&&za(e,t)},pe.__r=function(e){Ba&&Ba(e),yt=0;var t=(ie=e.__c).__H;t&&(Hs===ie?(t.__h=[],ie.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Br,n.__N=n.i=void 0})):(t.__h.forEach(Hr),t.__h.forEach(vi),t.__h=[],yt=0)),Hs=ie},pe.diffed=function(e){Ha&&Ha(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(al.push(t)!==1&&Fa===pe.requestAnimationFrame||((Fa=pe.requestAnimationFrame)||f_)(d_)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Br&&(n.__=n.__V),n.i=void 0,n.__V=Br})),Hs=ie=null},pe.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Hr),n.__h=n.__h.filter(function(r){return!r.__||vi(r)})}catch(r){t.some(function(s){s.__h&&(s.__h=[])}),t=[],pe.__e(r,n.__v)}}),Ua&&Ua(e,t)},pe.unmount=function(e){Wa&&Wa(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Hr(r)}catch(s){t=s}}),n.__H=void 0,t&&pe.__e(t,n.__v))};var ja=typeof requestAnimationFrame=="function";function f_(e){var t,n=function(){clearTimeout(r),ja&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);ja&&(t=requestAnimationFrame(n))}function Hr(e){var t=ie,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),ie=t}function vi(e){var t=ie;e.__c=e.__(),ie=t}function ao(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function ll(e,t){return typeof t=="function"?t(e):t}const p_=Object.defineProperty({__proto__:null,useCallback:cn,useContext:a_,useDebugValue:c_,useEffect:s_,useErrorBoundary:u_,useId:l_,useImperativeHandle:o_,useLayoutEffect:ul,useMemo:sr,useReducer:cl,useRef:i_,useState:Ft},Symbol.toStringTag,{value:"Module"}),h_="http://www.w3.org/2000/svg";function m_(){const e=r=>se.createElementNS(h_,r),t=Be(e("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=Be(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 __({options:e}){const t=sr(()=>({__html:m_().outerHTML}),[]);return q("h2",{class:"dialog__header"},q("span",{class:"dialog__title"},e.formTitle),e.showBranding?q("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:t}):null)}function g_(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}function Us(e,t){const n=e.get(t);return typeof n=="string"?n.trim():""}function y_({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:s,onSubmitSuccess:i,onSubmitError:o,showEmail:c,showName:a,screenshotInput:u}){const{tags:d,addScreenshotButtonLabel:l,removeScreenshotButtonLabel:f,cancelButtonLabel:p,emailLabel:h,emailPlaceholder:m,isEmailRequired:_,isNameRequired:g,messageLabel:b,messagePlaceholder:N,nameLabel:C,namePlaceholder:H,submitButtonLabel:A,isRequiredLabel:y}=e,[w,$]=Ft(!1),[v,x]=Ft(null),[T,k]=Ft(!1),M=u==null?void 0:u.input,[Z,J]=Ft(null),Q=cn(I=>{J(I),k(!1)},[]),E=cn(I=>{const V=g_(I,{emailLabel:h,isEmailRequired:_,isNameRequired:g,messageLabel:b,nameLabel:C});return V.length>0?x(`Please enter in the following required fields: ${V.join(", ")}`):x(null),V.length===0},[h,_,g,b,C]),P=cn(async I=>{$(!0);try{if(I.preventDefault(),!(I.target instanceof HTMLFormElement))return;const V=new FormData(I.target),W=await(u&&T?u.value():void 0),Y={name:Us(V,"name"),email:Us(V,"email"),message:Us(V,"message"),attachments:W?[W]:void 0};if(!E(Y))return;try{const de=await s({name:Y.name,email:Y.email,message:Y.message,source:Hm,tags:d},{attachments:Y.attachments});i(Y,de)}catch(de){Pr&&S.error(de),x(de),o(de)}}finally{$(!1)}},[u&&T,i,o]);return q("form",{class:"form",onSubmit:P},M&&T?q(M,{onError:Q}):null,q("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:w},q("div",{class:"form__top"},v?q("div",{class:"form__error-container"},v):null,a?q("label",{for:"name",class:"form__label"},q(Ws,{label:C,isRequiredLabel:y,isRequired:g}),q("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:H,required:g,type:"text"})):q("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),c?q("label",{for:"email",class:"form__label"},q(Ws,{label:h,isRequiredLabel:y,isRequired:_}),q("input",{class:"form__input",defaultValue:t,id:"email",name:"email",placeholder:m,required:_,type:"email"})):q("input",{"aria-hidden":!0,value:t,name:"email",type:"hidden"}),q("label",{for:"message",class:"form__label"},q(Ws,{label:b,isRequiredLabel:y,isRequired:!0}),q("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:N,required:!0,rows:5})),M?q("label",{for:"screenshot",class:"form__label"},q("button",{class:"btn btn--default",disabled:w,type:"button",onClick:()=>{J(null),k(I=>!I)}},T?f:l),Z?q("div",{class:"form__error-container"},Z.message):null):null),q("div",{class:"btn-group"},q("button",{class:"btn btn--primary",disabled:w,type:"submit"},A),q("button",{class:"btn btn--default",disabled:w,type:"button",onClick:r},p))))}function Ws({label:e,isRequired:t,isRequiredLabel:n}){return q("span",{class:"form__label__text"},e,t&&q("span",{class:"form__label__text--required"},n))}const br=16,qa=17,S_="http://www.w3.org/2000/svg";function b_(){const e=a=>Ze.document.createElementNS(S_,a),t=Be(e("svg"),{width:`${br}`,height:`${qa}`,viewBox:`0 0 ${br} ${qa}`,fill:"inherit"}),n=Be(e("g"),{clipPath:"url(#clip0_57_156)"}),r=Be(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"}),s=Be(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(s,r);const i=e("defs"),o=Be(e("clipPath"),{id:"clip0_57_156"}),c=Be(e("rect"),{width:`${br}`,height:`${br}`,fill:"white",transform:"translate(0 0.5)"});return o.appendChild(c),i.appendChild(o),t.appendChild(i).appendChild(o).appendChild(c),t}function E_({open:e,onFormSubmitted:t,...n}){const r=n.options,s=sr(()=>({__html:b_().outerHTML}),[]),[i,o]=Ft(null),c=cn(()=>{i&&(clearTimeout(i),o(null)),t()},[i]),a=cn((u,d)=>{n.onSubmitSuccess(u,d),o(setTimeout(()=>{t(),o(null)},Wm))},[t]);return q(rr,null,i?q("div",{class:"success__position",onClick:c},q("div",{class:"success__content"},r.successMessageText,q("span",{class:"success__icon",dangerouslySetInnerHTML:s}))):q("dialog",{class:"dialog",onClick:r.onFormClose,open:e},q("div",{class:"dialog__position"},q("div",{class:"dialog__content",onClick:u=>{u.stopPropagation()}},q(__,{options:r}),q(y_,{...n,onSubmitSuccess:a})))))}const v_=` .dialog { position: fixed; z-index: var(--z-index); margin: 0; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0; height: 100vh; width: 100vw; color: var(--dialog-color, var(--foreground)); fill: var(--dialog-color, var(--foreground)); line-height: 1.75em; background-color: rgba(0, 0, 0, 0.05); border: none; inset: 0; opacity: 1; transition: opacity 0.2s ease-in-out; } .dialog__position { position: fixed; z-index: var(--z-index); inset: var(--dialog-inset); padding: var(--page-margin); display: flex; max-height: calc(100vh - (2 * var(--page-margin))); } @media (max-width: 600px) { .dialog__position { inset: var(--page-margin); padding: 0; } } .dialog__position:has(.editor) { inset: var(--page-margin); padding: 0; } .dialog:not([open]) { opacity: 0; pointer-events: none; visibility: hidden; } .dialog:not([open]) .dialog__content { transform: translate(0, -16px) scale(0.98); } .dialog__content { display: flex; flex-direction: column; gap: 16px; padding: var(--dialog-padding, 24px); max-width: 100%; width: 100%; max-height: 100%; overflow: auto; background: var(--dialog-background, var(--background)); border-radius: var(--dialog-border-radius, 20px); border: var(--dialog-border, var(--border)); box-shadow: var(--dialog-box-shadow, var(--box-shadow)); transform: translate(0, 0) scale(1); transition: transform 0.2s ease-in-out; } `,T_=` .dialog__header { display: flex; gap: 4px; justify-content: space-between; font-weight: var(--dialog-header-weight, 600); margin: 0; } .dialog__title { align-self: center; width: var(--form-width, 272px); } @media (max-width: 600px) { .dialog__title { width: auto; } } .dialog__position:has(.editor) .dialog__title { width: auto; } .brand-link { display: inline-flex; } .brand-link:focus-visible { outline: var(--outline); } `,w_=` .form { display: flex; overflow: auto; flex-direction: row; gap: 16px; flex: 1 0; } .form fieldset { border: none; margin: 0; padding: 0; } .form__right { flex: 0 0 auto; display: flex; overflow: auto; flex-direction: column; justify-content: space-between; gap: 20px; width: var(--form-width, 100%); } .dialog__position:has(.editor) .form__right { width: var(--form-width, 272px); } .form__top { display: flex; flex-direction: column; gap: 8px; } .form__error-container { color: var(--error-color); fill: var(--error-color); } .form__label { display: flex; flex-direction: column; gap: 4px; margin: 0px; } .form__label__text { display: flex; gap: 4px; align-items: center; } .form__label__text--required { font-size: 0.85em; } .form__input { font-family: inherit; line-height: inherit; background: transparent; box-sizing: border-box; border: var(--input-border, var(--border)); border-radius: var(--input-border-radius, 6px); color: var(--input-color, inherit); fill: var(--input-color, inherit); font-size: var(--input-font-size, inherit); font-weight: var(--input-font-weight, 500); padding: 6px 12px; } .form__input::placeholder { opacity: 0.65; color: var(--input-placeholder-color, inherit); filter: var(--interactive-filter); } .form__input:focus-visible { outline: var(--input-focus-outline, var(--outline)); } .form__input--textarea { font-family: inherit; resize: vertical; } .error { color: var(--error-color); fill: var(--error-color); } `,I_=` .btn-group { display: grid; gap: 8px; } .btn { line-height: inherit; border: var(--button-border, var(--border)); border-radius: var(--button-border-radius, 6px); cursor: pointer; font-family: inherit; font-size: var(--button-font-size, inherit); font-weight: var(--button-font-weight, 600); padding: var(--button-padding, 6px 16px); } .btn[disabled] { opacity: 0.6; pointer-events: none; } .btn--primary { color: var(--button-primary-color, var(--accent-foreground)); fill: var(--button-primary-color, var(--accent-foreground)); background: var(--button-primary-background, var(--accent-background)); border: var(--button-primary-border, var(--border)); border-radius: var(--button-primary-border-radius, 6px); font-weight: var(--button-primary-font-weight, 500); } .btn--primary:hover { color: var(--button-primary-hover-color, var(--accent-foreground)); fill: var(--button-primary-hover-color, var(--accent-foreground)); background: var(--button-primary-hover-background, var(--accent-background)); filter: var(--interactive-filter); } .btn--primary:focus-visible { background: var(--button-primary-hover-background, var(--accent-background)); filter: var(--interactive-filter); outline: var(--button-primary-focus-outline, var(--outline)); } .btn--default { color: var(--button-color, var(--foreground)); fill: var(--button-color, var(--foreground)); background: var(--button-background, var(--background)); border: var(--button-border, var(--border)); border-radius: var(--button-border-radius, 6px); font-weight: var(--button-font-weight, 500); } .btn--default:hover { color: var(--button-color, var(--foreground)); fill: var(--button-color, var(--foreground)); background: var(--button-hover-background, var(--background)); filter: var(--interactive-filter); } .btn--default:focus-visible { background: var(--button-hover-background, var(--background)); filter: var(--interactive-filter); outline: var(--button-focus-outline, var(--outline)); } `,k_=` .success__position { position: fixed; inset: var(--dialog-inset); padding: var(--page-margin); z-index: var(--z-index); } .success__content { background: var(--success-background, var(--background)); border: var(--success-border, var(--border)); border-radius: var(--success-border-radius, 1.7em/50%); box-shadow: var(--success-box-shadow, var(--box-shadow)); font-weight: var(--success-font-weight, 600); color: var(--success-color); fill: var(--success-color); padding: 12px 24px; line-height: 1.75em; display: grid; align-items: center; grid-auto-flow: column; gap: 6px; cursor: default; } .success__icon { display: flex; } `;function C_(e){const t=se.createElement("style");return t.textContent=` :host { --dialog-inset: var(--inset); } ${v_} ${T_} ${w_} ${I_} ${k_} `,e&&t.setAttribute("nonce",e),t}function R_(){const e=ne().getUser(),t=Me().getUser(),n=Kc().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}const x_=()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{const s=r,i=e.useSentryUser,o=R_(),c=se.createElement("div"),a=C_(e.styleNonce);let u="";const d={get el(){return c},appendToDom(){!s.contains(a)&&!s.contains(c)&&(s.appendChild(a),s.appendChild(c))},removeFromDom(){c.remove(),a.remove(),se.body.style.overflow=u},open(){var p,h;f(!0),(p=e.onFormOpen)==null||p.call(e),(h=U())==null||h.emit("openFeedbackWidget"),u=se.body.style.overflow,se.body.style.overflow="hidden"},close(){f(!1),se.body.style.overflow=u}},l=t==null?void 0:t.createInput({h:q,hooks:p_,dialog:d,options:e}),f=p=>{r_(q(E_,{options:e,screenshotInput:l,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:String(i&&(o==null?void 0:o[i.name])||""),defaultEmail:String(i&&(o==null?void 0:o[i.email])||""),onFormClose:()=>{var h;f(!1),(h=e.onFormClose)==null||h.call(e)},onSubmit:n,onSubmitSuccess:(h,m)=>{var _;f(!1),(_=e.onSubmitSuccess)==null||_.call(e,h,m)},onSubmitError:h=>{var m;(m=e.onSubmitError)==null||m.call(e,h)},onFormSubmitted:()=>{var h;(h=e.onFormSubmitted)==null||h.call(e)},open:p}),c)};return d}});function M_({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"}))}}function A_(e){const t=se.createElement("style"),n="#1A141F",r="#302735";return t.textContent=` .editor { display: flex; flex-grow: 1; flex-direction: column; } .editor__image-container { justify-items: center; padding: 15px; position: relative; height: 100%; border-radius: var(--menu-border-radius, 6px); background-color: ${n}; background-image: repeating-linear-gradient( -145deg, transparent, transparent 8px, ${n} 8px, ${n} 11px ), repeating-linear-gradient( -45deg, transparent, transparent 15px, ${r} 15px, ${r} 16px ); } .editor__canvas-container { width: 100%; height: 100%; position: relative; display: flex; align-items: center; justify-content: center; } .editor__canvas-container > * { object-fit: contain; position: absolute; } .editor__tool-container { padding-top: 8px; display: flex; justify-content: center; } .editor__tool-bar { display: flex; gap: 8px; } .editor__tool { display: flex; padding: 8px 12px; justify-content: center; align-items: center; border: var(--button-border, var(--border)); border-radius: var(--button-border-radius, 6px); background: var(--button-background, var(--background)); color: var(--button-color, var(--foreground)); } .editor__tool--active { background: var(--button-primary-background, var(--accent-background)); color: var(--button-primary-color, var(--accent-foreground)); } .editor__rect { position: absolute; z-index: 2; } .editor__rect button { opacity: 0; position: absolute; top: -12px; right: -12px; cursor: pointer; padding: 0; z-index: 3; border: none; background: none; } .editor__rect:hover button { opacity: 1; } `,e&&t.setAttribute("nonce",e),t}function N_({h:e}){return function({action:n,setAction:r,options:s}){return e("div",{class:"editor__tool-container"},e("div",{class:"editor__tool-bar"},e("button",{type:"button",class:`editor__tool ${n==="highlight"?"editor__tool--active":""}`,onClick:()=>{r(n==="highlight"?"":"highlight")}},s.highlightToolText),e("button",{type:"button",class:`editor__tool ${n==="hide"?"editor__tool--active":""}`,onClick:()=>{r(n==="hide"?"":"hide")}},s.hideToolText)))}}function L_({hooks:e}){function t(){const[n,r]=e.useState(Ze.devicePixelRatio??1);return e.useEffect(()=>{const s=()=>{r(Ze.devicePixelRatio)},i=matchMedia(`(resolution: ${Ze.devicePixelRatio}dppx)`);return i.addEventListener("change",s),()=>{i.removeEventListener("change",s)}},[]),n}return function({onBeforeScreenshot:r,onScreenshot:s,onAfterScreenshot:i,onError:o}){const c=t();e.useEffect(()=>{(async()=>{r();const u=await Mn.mediaDevices.getDisplayMedia({video:{width:Ze.innerWidth*c,height:Ze.innerHeight*c},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),d=se.createElement("video");await new Promise((l,f)=>{d.srcObject=u,d.onloadedmetadata=()=>{s(d,c),u.getTracks().forEach(p=>p.stop()),l()},d.play().catch(f)}),i()})().catch(o)},[])}}function D_(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);break}}function bt(e,t,n){if(!e)return;const r=e.getContext("2d",t);r&&n(e,r)}function zs(e,t){bt(e,{alpha:!0},(n,r)=>{r.drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height)})}function js(e,t,n){bt(e,{alpha:!0},(r,s)=>{n.length&&(s.fillStyle="rgba(0, 0, 0, 0.25)",s.fillRect(0,0,r.width,r.height)),n.forEach(i=>{D_(i,s,t)})})}function O_({h:e,hooks:t,outputBuffer:n,dialog:r,options:s}){const i=L_({hooks:t}),o=N_({h:e}),c=M_({h:e}),a={__html:A_(s.styleNonce).innerText},u=r.el.style,d=({screenshot:l})=>{const[f,p]=t.useState("highlight"),[h,m]=t.useState([]),_=t.useRef(null),g=t.useRef(null),b=t.useRef(null),N=t.useRef(null),[C,H]=t.useState(1),A=t.useMemo(()=>{const T=se.getElementById(s.id);if(!T)return"white";const k=getComputedStyle(T);return k.getPropertyValue("--button-primary-background")||k.getPropertyValue("--accent-background")},[s.id]);t.useLayoutEffect(()=>{const T=()=>{const k=_.current;k&&(bt(l.canvas,{alpha:!1},M=>{const Z=Math.min(k.clientWidth/M.width,k.clientHeight/M.height);H(Z)}),(k.clientHeight===0||k.clientWidth===0)&&setTimeout(T,0))};return T(),Ze.addEventListener("resize",T),()=>{Ze.removeEventListener("resize",T)}},[l]);const y=t.useCallback((T,k)=>{bt(T,{alpha:!0},(M,Z)=>{Z.scale(k,k),M.width=l.canvas.width,M.height=l.canvas.height})},[l]);t.useEffect(()=>{y(g.current,l.dpi),zs(g.current,l.canvas)},[l]),t.useEffect(()=>{y(b.current,l.dpi),bt(b.current,{alpha:!0},(T,k)=>{k.clearRect(0,0,T.width,T.height)}),js(b.current,A,h)},[h,A]),t.useEffect(()=>{y(n,l.dpi),zs(n,l.canvas),bt(se.createElement("canvas"),{alpha:!0},(T,k)=>{k.scale(l.dpi,l.dpi),T.width=l.canvas.width,T.height=l.canvas.height,js(T,A,h),zs(n,T)})},[h,l,A]);const w=T=>{if(!f||!N.current)return;const k=N.current.getBoundingClientRect(),M={type:f,x:T.offsetX/C,y:T.offsetY/C},Z=(E,P)=>{const I=(P.clientX-k.x)/C,V=(P.clientY-k.y)/C;return{type:E.type,x:Math.min(E.x,I),y:Math.min(E.y,V),w:Math.abs(I-E.x),h:Math.abs(V-E.y)}},J=E=>{bt(b.current,{alpha:!0},(P,I)=>{I.clearRect(0,0,P.width,P.height)}),js(b.current,A,[...h,Z(M,E)])},Q=E=>{const P=Z(M,E);P.w*C>=1&&P.h*C>=1&&m(I=>[...I,P]),se.removeEventListener("mousemove",J),se.removeEventListener("mouseup",Q)};se.addEventListener("mousemove",J),se.addEventListener("mouseup",Q)},$=t.useCallback(T=>k=>{k.preventDefault(),k.stopPropagation(),m(M=>{const Z=[...M];return Z.splice(T,1),Z})},[]),v={width:`${l.canvas.width*C}px`,height:`${l.canvas.height*C}px`},x=T=>{T.stopPropagation()};return e("div",{class:"editor"},e("style",{nonce:s.styleNonce,dangerouslySetInnerHTML:a}),e("div",{class:"editor__image-container"},e("div",{class:"editor__canvas-container",ref:_},e("canvas",{ref:g,id:"background",style:v}),e("canvas",{ref:b,id:"foreground",style:v}),e("div",{ref:N,onMouseDown:w,style:v},h.map((T,k)=>e("div",{key:k,class:"editor__rect",style:{top:`${T.y*C}px`,left:`${T.x*C}px`,width:`${T.w*C}px`,height:`${T.h*C}px`}},e("button",{"aria-label":s.removeHighlightText,onClick:$(k),onMouseDown:x,onMouseUp:x,type:"button"},e(c,null))))))),e(o,{options:s,action:f,setAction:p}))};return function({onError:f}){const[p,h]=t.useState();return i({onBeforeScreenshot:t.useCallback(()=>{u.display="none"},[]),onScreenshot:t.useCallback((m,_)=>{bt(se.createElement("canvas"),{alpha:!1},(g,b)=>{b.scale(_,_),g.width=m.videoWidth,g.height=m.videoHeight,b.drawImage(m,0,0,g.width,g.height),h({canvas:g,dpi:_})}),n.width=m.videoWidth,n.height=m.videoHeight},[]),onAfterScreenshot:t.useCallback(()=>{u.display="block"},[]),onError:t.useCallback(m=>{u.display="block",f(m)},[])}),p?e(d,{screenshot:p}):e("div",null)}}const P_=()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{const s=se.createElement("canvas");return{input:O_({h:e,hooks:t,outputBuffer:s,dialog:n,options:r}),value:async()=>{const i=await new Promise(o=>{s.toBlob(o,"image/png")});if(i)return{data:new Uint8Array(await i.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}}}}}),X=G;let Ti=0;function dl(){return Ti>0}function F_(){Ti++,setTimeout(()=>{Ti--})}function _n(e,t={}){function n(s){return typeof s=="function"}if(!n(e))return e;try{const s=e.__sentry_wrapped__;if(s)return typeof s=="function"?s:e;if(qi(e))return e}catch{return e}const r=function(...s){try{const i=s.map(o=>_n(o,t));return e.apply(this,i)}catch(i){throw F_(),Vi(o=>{o.addEventProcessor(c=>(t.mechanism&&(oi(c,void 0),dn(c,t.mechanism)),c.extra={...c.extra,arguments:s},c)),ms(i)}),i}};try{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}catch{}jc(r,e),Oe(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function co(){const e=Gt(),{referrer:t}=X.document||{},{userAgent:n}=X.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}const z0=Xm({getModalIntegration:()=>x_,getScreenshotIntegration:()=>P_});function uo(e,t){const n=lo(e,t),r={type:W_(t),value:z_(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function $_(e,t,n,r){const s=U(),i=s==null?void 0:s.getOptions().normalizeDepth,o=Y_(t),c={__serialized__:bu(t,i)};if(o)return{exception:{values:[uo(e,o)]},extra:c};const a={exception:{values:[{type:ds(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:V_(t,{isUnhandledRejection:r})}]},extra:c};if(n){const u=lo(e,n);u.length&&(a.exception.values[0].stacktrace={frames:u})}return a}function qs(e,t){return{exception:{values:[uo(e,t)]}}}function lo(e,t){const n=t.stacktrace||t.stack||"",r=H_(t),s=U_(t);try{return e(n,r,s)}catch{}return[]}const B_=/Minified React error #\d+;/i;function H_(e){return e&&B_.test(e.message)?1:0}function U_(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function fl(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function W_(e){const t=e==null?void 0:e.name;return!t&&fl(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function z_(e){const t=e==null?void 0:e.message;return fl(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Sa(t.error):Sa(e):"No error message"}function j_(e,t,n,r){const s=(n==null?void 0:n.syntheticException)||void 0,i=fo(e,t,s,r);return dn(i),i.level="error",n!=null&&n.event_id&&(i.event_id=n.event_id),nr(i)}function q_(e,t,n="info",r,s){const i=(r==null?void 0:r.syntheticException)||void 0,o=wi(e,t,i,s);return o.level=n,r!=null&&r.event_id&&(o.event_id=r.event_id),nr(o)}function fo(e,t,n,r,s){let i;if(Uc(t)&&t.error)return qs(e,t.error);if(Fo(t)||zd(t)){const o=t;if("stack"in t)i=qs(e,t);else{const c=o.name||(Fo(o)?"DOMError":"DOMException"),a=o.message?`${c}: ${o.message}`:c;i=wi(e,a,n,r),oi(i,a)}return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}return ls(t)?qs(e,t):Fn(t)||ds(t)?(i=$_(e,t,n,s),dn(i,{synthetic:!0}),i):(i=wi(e,t,n,r),oi(i,`${t}`),dn(i,{synthetic:!0}),i)}function wi(e,t,n,r){const s={};if(r&&n){const i=lo(e,n);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]}),dn(s,{synthetic:!0})}if(Wi(t)){const{__sentry_template_string__:i,__sentry_template_values__:o}=t;return s.logentry={message:i,params:o},s}return s.message=t,s}function V_(e,{isUnhandledRejection:t}){const n=Kd(e),r=t?"promise rejection":"exception";return Uc(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:ds(e)?`Event \`${G_(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function G_(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Y_(e){return Object.values(e).find(t=>t instanceof Error)}class K_ extends fh{constructor(t){var d;const n=X_(t),r=X.SENTRY_SDK_SOURCE||bm();ju(n,"browser",["browser"],r),(d=n._metadata)!=null&&d.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:s,sendClientReports:i,enableLogs:o,_experiments:c,enableMetrics:a}=this._options,u=a??(c==null?void 0:c.enableMetrics)??!0;X.document&&(i||o||u)&&X.document.addEventListener("visibilitychange",()=>{X.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),o&&mi(this),u&&Lu(this))}),s&&this.on("beforeSendSession",kh)}eventFromException(t,n){return j_(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return q_(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,s){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,s)}}function X_(e){var t;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(t=X.SENTRY_RELEASE)==null?void 0:t.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const tt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,O=G,J_=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",ir=(e,t,n,r)=>{let s,i;return o=>{t.value>=0&&(o||r)&&(i=t.value-(s??0),(i||s===void 0)&&(s=t.value,t.delta=i,t.rating=J_(t.value,n),e(t)))}},or=(e=!0)=>{var n,r;const t=(r=(n=O.performance)==null?void 0:n.getEntriesByType)==null?void 0:r.call(n,"navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart{const e=or();return(e==null?void 0:e.activationStart)??0};function kt(e,t,n){O.document&&O.addEventListener(e,t,n)}function Jr(e,t,n){O.document&&O.removeEventListener(e,t,n)}let un=-1;const pl=new Set,Z_=()=>{var e,t;return((e=O.document)==null?void 0:e.visibilityState)==="hidden"&&!((t=O.document)!=null&&t.prerendering)?0:1/0},Ur=e=>{if(Q_(e)&&un>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of pl)t();isFinite(un)||(un=e.type==="visibilitychange"?e.timeStamp:0,Jr("prerenderingchange",Ur,!0))}},ar=()=>{var e;if(O.document&&un<0){const t=In();un=(O.document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>t)[0])==null?void 0:e.startTime)??Z_(),kt("visibilitychange",Ur,!0),kt("pagehide",Ur,!0),kt("prerenderingchange",Ur,!0)}return{get firstHiddenTime(){return un},onHidden(t){pl.add(t)}}};function Q_(e){var t;return e.type==="pagehide"||((t=O.document)==null?void 0:t.visibilityState)==="hidden"}const eg=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,cr=(e,t=-1)=>{var i,o;const n=or();let r="navigate";return n&&((i=O.document)!=null&&i.prerendering||In()>0?r="prerender":(o=O.document)!=null&&o.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:eg(),navigationType:r}},Vs=new WeakMap;function po(e,t){try{return Vs.get(e)||Vs.set(e,new t),Vs.get(e)}catch{return new t}}class Zr{constructor(){Zr.prototype.__init.call(this),Zr.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){var s;if(t.hadRecentInput)return;const n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),(s=this._onAfterProcessingUnexpectedShift)==null||s.call(this,t)}}const kn=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(s=>{Promise.resolve().then(()=>{t(s.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},ho=e=>{let t=!1;return()=>{t||(e(),t=!0)}},gs=e=>{var t;(t=O.document)!=null&&t.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},tg=[1800,3e3],ng=(e,t={})=>{gs(()=>{const n=ar(),r=cr("FCP");let s;const o=kn("paint",c=>{for(const a of c)a.name==="first-contentful-paint"&&(o.disconnect(),a.startTime{ng(ho(()=>{var a;const n=cr("CLS",0);let r;const s=ar(),i=po(t,Zr),o=u=>{for(const d of u)i._processEntry(d);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},c=kn("layout-shift",o);c&&(r=ir(e,n,rg,t.reportAllChanges),s.onHidden(()=>{o(c.takeRecords()),r(!0)}),(a=O==null?void 0:O.setTimeout)==null||a.call(O,r))}))};let hl=0,Gs=1/0,Er=0;const ig=e=>{e.forEach(t=>{t.interactionId&&(Gs=Math.min(Gs,t.interactionId),Er=Math.max(Er,t.interactionId),hl=Er?(Er-Gs)/7+1:0)})};let Ii;const ml=()=>Ii?hl:performance.interactionCount||0,og=()=>{"interactionCount"in performance||Ii||(Ii=kn("event",ig,{type:"event",buffered:!0,durationThreshold:0}))},Ys=10;let _l=0;const ag=()=>ml()-_l;class Qr{constructor(){Qr.prototype.__init.call(this),Qr.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){_l=ml(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(ag()/50));return this._longestInteractionList[t]}_processEntry(t){var s,i;if((s=this._onBeforeProcessingEntry)==null||s.call(this,t),!(t.interactionId||t.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let r=this._longestInteractionMap.get(t.interactionId);if(r||this._longestInteractionList.lengthn._latency){if(r?t.duration>r._latency?(r.entries=[t],r._latency=t.duration):t.duration===r._latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((o,c)=>c._latency-o._latency),this._longestInteractionList.length>Ys){const o=this._longestInteractionList.splice(Ys);for(const c of o)this._longestInteractionMap.delete(c.id)}(i=this._onAfterProcessingINPCandidate)==null||i.call(this,r)}}}const gl=e=>{var n;const t=O.requestIdleCallback||O.setTimeout;((n=O.document)==null?void 0:n.visibilityState)==="hidden"?e():(e=ho(e),kt("visibilitychange",e,{once:!0,capture:!0}),kt("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),Jr("visibilitychange",e,{capture:!0}),Jr("pagehide",e,{capture:!0})}))},cg=[200,500],ug=40,lg=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=ar();gs(()=>{og();const r=cr("INP");let s;const i=po(t,Qr),o=a=>{gl(()=>{for(const d of a)i._processEntry(d);const u=i._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,s())})},c=kn("event",o,{durationThreshold:t.durationThreshold??ug});s=ir(e,r,cg,t.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{o(c.takeRecords()),s(!0)}))})};class dg{_processEntry(t){var n;(n=this._onBeforeProcessingEntry)==null||n.call(this,t)}}const fg=[2500,4e3],pg=(e,t={})=>{gs(()=>{const n=ar(),r=cr("LCP");let s;const i=po(t,dg),o=a=>{t.reportAllChanges||(a=a.slice(-1));for(const u of a)i._processEntry(u),u.startTime{o(c.takeRecords()),c.disconnect(),s(!0)}),u=d=>{d.isTrusted&&(gl(a),Jr(d.type,u,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])kt(d,u,{capture:!0})}})},hg=[800,1800],ki=e=>{var t,n;(t=O.document)!=null&&t.prerendering?gs(()=>ki(e)):((n=O.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>ki(e),!0):setTimeout(e)},mg=(e,t={})=>{const n=cr("TTFB"),r=ir(e,n,hg,t.reportAllChanges);ki(()=>{const s=or();s&&(n.value=Math.max(s.responseStart-In(),0),n.entries=[s],r(!0))})},An={},es={};let yl,Sl,bl,El;function ys(e,t=!1){return bs("cls",e,gg,yl,t)}function Ss(e,t=!1){return bs("lcp",e,yg,Sl,t)}function _g(e){return bs("ttfb",e,Sg,bl)}function mo(e){return bs("inp",e,bg,El)}function gn(e,t){return vl(e,t),es[e]||(Eg(e),es[e]=!0),Tl(e,t)}function ur(e,t){const n=An[e];if(n!=null&&n.length)for(const r of n)try{r(t)}catch(s){tt&&S.error(`Error while triggering instrumentation handler. Type: ${e} Name: ${pt(r)} Error:`,s)}}function gg(){return sg(e=>{ur("cls",{metric:e}),yl=e},{reportAllChanges:!0})}function yg(){return pg(e=>{ur("lcp",{metric:e}),Sl=e},{reportAllChanges:!0})}function Sg(){return mg(e=>{ur("ttfb",{metric:e}),bl=e})}function bg(){return lg(e=>{ur("inp",{metric:e}),El=e})}function bs(e,t,n,r,s=!1){vl(e,t);let i;return es[e]||(i=n(),es[e]=!0),r&&t({metric:r}),Tl(e,t,s?i:void 0)}function Eg(e){const t={};e==="event"&&(t.durationThreshold=0),kn(e,n=>{ur(e,{entries:n})},t)}function vl(e,t){An[e]=An[e]||[],An[e].push(t)}function Tl(e,t,n){return()=>{n&&n();const r=An[e];if(!r)return;const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}function vg(e){return"duration"in e}const Tg=e=>{const t=n=>{var r;(n.type==="pagehide"||((r=O.document)==null?void 0:r.visibilityState)==="hidden")&&e(n)};kt("visibilitychange",t,{capture:!0,once:!0}),kt("pagehide",t,{capture:!0,once:!0})};function Ks(e){return typeof e=="number"&&isFinite(e)}function xt(e,t,n,{...r}){const s=te(e).start_timestamp;return s&&s>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),Tu(e,()=>{const i=gt({startTime:t,...r});return i&&i.end(n),i})}function _o(e){var _;const t=U();if(!t)return;const{name:n,transaction:r,attributes:s,startTime:i}=e,{release:o,environment:c,sendDefaultPii:a}=t.getOptions(),u=t.getIntegrationByName("Replay"),d=u==null?void 0:u.getReplayId(),l=ne(),f=l.getUser(),p=f!==void 0?f.email||f.id||f.ip_address:void 0;let h;try{h=l.getScopeData().contexts.profile.profile_id}catch{}const m={release:o,environment:c,user:p||void 0,profile_id:h||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":(_=O.navigator)==null?void 0:_.userAgent,"client.address":a?"{{auto}}":void 0,...s};return gt({name:n,attributes:m,startTime:i,experimental:{standalone:!0}})}function lr(){return O.addEventListener&&O.performance}function le(e){return e/1e3}function wg(e){let t="unknown",n="unknown",r="";for(const s of e){if(s==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(s))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=s}return r===e&&(t=r),{name:t,version:n}}function Es(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function vs(e,t){let n,r=!1;function s(c){!r&&n&&t(c,n.spanContext().spanId,n),r=!0}Tg(()=>{s("pagehide")});const i=e.on("beforeStartNavigationSpan",(c,a)=>{a!=null&&a.isRedirect||(s("navigation"),i(),o())}),o=e.on("afterStartPageLoadSpan",c=>{n=c,o()})}function Ig(e){let t=0,n;if(!Es("layout-shift"))return;const r=ys(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);vs(e,(s,i)=>{kg(t,n,i,s),r()})}function kg(e,t,n,r){var u;tt&&S.log(`Sending CLS span (${e})`);const s=t?le((we()||0)+t.startTime):_e(),i=ne().getScopeData().transactionName,o=t?Se((u=t.sources[0])==null?void 0:u.node):"Layout shift",c={[he]:"auto.http.browser.cls",[et]:"ui.webvital.cls",[Nt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t!=null&&t.sources&&t.sources.forEach((d,l)=>{c[`cls.source.${l+1}`]=Se(d.node)});const a=_o({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("cls",{[er]:"",[tr]:e}),a.end(s))}function Cg(e){let t=0,n;if(!Es("largest-contentful-paint"))return;const r=Ss(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);vs(e,(s,i)=>{Rg(t,n,i,s),r()})}function Rg(e,t,n,r){tt&&S.log(`Sending LCP span (${e})`);const s=le((we()||0)+((t==null?void 0:t.startTime)||0)),i=ne().getScopeData().transactionName,o=t?Se(t.element):"Largest contentful paint",c={[he]:"auto.http.browser.lcp",[et]:"ui.webvital.lcp",[Nt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(c["lcp.element"]=Se(t.element)),t.id&&(c["lcp.id"]=t.id),t.url&&(c["lcp.url"]=t.url),t.loadTime!=null&&(c["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(c["lcp.renderTime"]=t.renderTime),t.size!=null&&(c["lcp.size"]=t.size));const a=_o({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("lcp",{[er]:"millisecond",[tr]:e}),a.end(s))}function qe(e){return e&&((we()||performance.timeOrigin)+e)/1e3}function wl(e){var n;const t={};if(e.nextHopProtocol!=null){const{name:r,version:s}=wg(e.nextHopProtocol);t["network.protocol.version"]=s,t["network.protocol.name"]=r}return we()||(n=lr())!=null&&n.timeOrigin?xg({...t,"http.request.redirect_start":qe(e.redirectStart),"http.request.redirect_end":qe(e.redirectEnd),"http.request.worker_start":qe(e.workerStart),"http.request.fetch_start":qe(e.fetchStart),"http.request.domain_lookup_start":qe(e.domainLookupStart),"http.request.domain_lookup_end":qe(e.domainLookupEnd),"http.request.connect_start":qe(e.connectStart),"http.request.secure_connection_start":qe(e.secureConnectionStart),"http.request.connection_end":qe(e.connectEnd),"http.request.request_start":qe(e.requestStart),"http.request.response_start":qe(e.responseStart),"http.request.response_end":qe(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function xg(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const Mg=2147483647;let Va=0,Re={},Le,nn;function Ag({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=lr();if(r&&we()){r.mark&&O.performance.mark("sentry-tracing-init");const s=t?Cg(n):t===!1?Pg():void 0,i=e?Ig(n):e===!1?Og():void 0,o=Fg();return()=>{o(),s==null||s(),i==null||i()}}return()=>{}}function Ng(){gn("longtask",({entries:e})=>{const t=Ie();if(!t)return;const{op:n,start_timestamp:r}=te(t);for(const s of e){const i=le(we()+s.startTime),o=le(s.duration);n==="navigation"&&r&&i{const n=Ie();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const s=le(we()+r.startTime),{start_timestamp:i,op:o}=te(n);if(o==="navigation"&&i&&s{const t=Ie();if(t){for(const n of e)if(n.name==="click"){const r=le(we()+n.startTime),s=le(n.duration),i={name:Se(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[he]:"auto.ui.browser.metrics"}},o=zc(n.target);o&&(i.attributes["ui.component_name"]=o),xt(t,r,r+s,i)}}})}function Og(){return ys(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Re.cls={value:e.value,unit:""},nn=t)},!0)}function Pg(){return Ss(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Re.lcp={value:e.value,unit:"millisecond"},Le=t)},!0)}function Fg(){return _g(({metric:e})=>{e.entries[e.entries.length-1]&&(Re.ttfb={value:e.value,unit:"millisecond"})})}function $g(e,t){const n=lr(),r=we();if(!(n!=null&&n.getEntries)||!r)return;const{spanStreamingEnabled:s,ignorePerformanceApiSpans:i,ignoreResourceSpans:o,recordClsOnPageloadSpan:c,recordLcpOnPageloadSpan:a}=t,u=le(r),d=n.getEntries(),{op:l,start_timestamp:f}=te(e);if(d.slice(Va).forEach(p=>{const h=le(p.startTime),m=le(Math.max(0,p.duration));if(!(l==="navigation"&&f&&u+h{const g=_??`browser.web_vital.${h}.value`;e.setAttribute(g,m),tt&&S.log("Setting web vital attribute",{[g]:m},"on pageload span")};["ttfb","fp","fcp"].forEach(h=>{Re[h]&&p(h,Re[h].value)}),Re["ttfb.requestTime"]&&p("ttfb.requestTime",Re["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else c||delete Re.cls,a||delete Re.lcp,Object.entries(Re).forEach(([p,h])=>{cp(p,h.value,h.unit)}),Gg(e,t);e.setAttribute(s?"browser.performance.time_origin":"performance.timeOrigin",u),e.setAttribute(s?"browser.performance.navigation.activation_start":"performance.activationStart",In())}Le=void 0,nn=void 0,Re={}}function Bg(e){if((e==null?void 0:e.entryType)==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function Hg(e,t,n,r,s,i){if(Bg(t)||["mark","measure"].includes(t.entryType)&<(t.name,i))return;const o=or(!1),c=le(o?o.requestStart:0),a=s+Math.max(n,c),u=s+n,d=u+r,l={[he]:"auto.resource.browser.metrics"};a!==u&&(l["sentry.browser.measure_happened_before_request"]=!0,l["sentry.browser.measure_start_time"]=a),Ug(l,t),a<=d&&xt(e,a,d,{name:t.name,op:t.entryType,attributes:l})}function Ug(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,s]of Object.entries(n))if(s&&ln(s))e[`sentry.browser.measure.detail.${r}`]=s;else if(s!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(s)}catch{}return}if(ln(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function Wg(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{vr(e,t,r,n)}),vr(e,t,"secureConnection",n,"TLS/SSL"),vr(e,t,"fetch",n,"cache"),vr(e,t,"domainLookup",n,"DNS"),jg(e,t,n)}function vr(e,t,n,r,s=n){const i=zg(n),o=t[i],c=t[`${n}Start`];!c||!o||xt(e,r+le(c),r+le(o),{op:`browser.${s}`,name:t.name,attributes:{[he]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function zg(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function jg(e,t,n){const r=n+le(t.requestStart),s=n+le(t.responseEnd),i=n+le(t.responseStart);t.responseEnd&&(xt(e,r,s,{op:"browser.request",name:t.name,attributes:{[he]:"auto.ui.browser.metrics"}}),xt(e,i,s,{op:"browser.response",name:t.name,attributes:{[he]:"auto.ui.browser.metrics"}}))}function qg(e,t,n,r,s,i,o){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const c=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(o!=null&&o.includes(c))return;const a={[he]:"auto.resource.browser.metrics"},u=Wt(n);u.protocol&&(a["url.scheme"]=u.protocol.split(":").pop()),u.host&&(a["server.address"]=u.host),a["url.same_origin"]=n.includes(O.location.origin),Yg(t,a,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const d={...a,...wl(t)},l=i+r,f=l+s;xt(e,l,f,{name:n.replace(O.location.origin,""),op:c,attributes:d})}function Vg(e,t){const n=O.navigator;if(!n)return;const r=n.connection;r&&(r.effectiveType&&e.setAttribute(t?"network.connection.effective_type":"effectiveConnectionType",r.effectiveType),r.type&&e.setAttribute(t?"network.connection.type":"connectionType",r.type),Ks(r.rtt)&&(Re["connection.rtt"]={value:r.rtt,unit:"millisecond"},t&&e.setAttribute("network.connection.rtt",r.rtt))),Ks(n.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",n.deviceMemory):e.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),Ks(n.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",n.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function Gg(e,t){Le&&t.recordLcpOnPageloadSpan&&(Le.element&&e.setAttribute("lcp.element",Se(Le.element)),Le.id&&e.setAttribute("lcp.id",Le.id),Le.url&&e.setAttribute("lcp.url",Le.url.trim().slice(0,200)),Le.loadTime!=null&&e.setAttribute("lcp.loadTime",Le.loadTime),Le.renderTime!=null&&e.setAttribute("lcp.renderTime",Le.renderTime),e.setAttribute("lcp.size",Le.size)),nn!=null&&nn.sources&&t.recordClsOnPageloadSpan&&nn.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Se(n.node)))}function Yg(e,t,n){n.forEach(([r,s])=>{const i=e[r];i!=null&&(typeof i=="number"&&i{t()}}return()=>{}}const jn={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function Jg(){return mo(Zg)}const Zg=({metric:e})=>{if(e.value==null)return;const t=le(e.value);if(t>Il)return;const n=e.entries.find(h=>h.duration===e.value&&jn[h.name]);if(!n)return;const{interactionId:r}=n,s=jn[n.name],i=le(we()+n.startTime),o=Ie(),c=o?Te(o):void 0,a=r!=null?Nn.get(r):void 0,u=(a==null?void 0:a.span)||c,d=u?te(u).description:ne().getScopeData().transactionName,l=(a==null?void 0:a.elementName)||Se(n.target),f={[he]:"auto.http.browser.inp",[et]:`ui.interaction.${s}`,[Nt]:n.duration},p=_o({name:l,transaction:d,attributes:f,startTime:i});p&&(p.addEvent("inp",{[er]:"millisecond",[tr]:e.value}),p.end(i+t))};function Qg(e){return e!=null?Nn.get(e):void 0}function ey(){const e=Object.keys(jn);Kr()&&e.forEach(s=>{O.addEventListener(s,t,{capture:!0,passive:!0})});function t(s){const i=s.target;if(!i)return;const o=Se(i),c=Math.round(s.timeStamp);if(Zt.set(c,o),Zt.size>50){const a=Zt.keys().next().value;a!==void 0&&Zt.delete(a)}}function n(s){const i=Math.round(s.startTime);let o=Zt.get(i);if(!o)for(let c=-5;c<=5;c++){const a=Zt.get(i+c);if(a){o=a;break}}return o||""}const r=({entries:s})=>{const i=Ie(),o=i&&Te(i);s.forEach(c=>{if(!vg(c))return;const a=c.interactionId;if(a==null||Nn.has(a))return;const u=c.target?Se(c.target):n(c);if(Xs.length>10){const d=Xs.shift();Nn.delete(d)}Xs.push(a),Nn.set(a,{span:o,elementName:u})})};gn("event",r),gn("first-input",r)}function go(e){var h,m;const{name:t,op:n,origin:r,metricName:s,value:i,attributes:o,parentSpan:c,reportEvent:a,startTime:u,endTime:d}=e,l=ne().getScopeData().transactionName,f={[he]:r,[et]:n,[Nt]:0,[`browser.web_vital.${s}.value`]:i,"sentry.transaction":l,"user_agent.original":(h=O.navigator)==null?void 0:h.userAgent,...o};c&&((m=uu(c).attributes)==null?void 0:m[et])==="pageload"&&(f["sentry.pageload.span_id"]=c.spanContext().spanId),a&&(f[`browser.web_vital.${s}.report_event`]=a);const p=gt({name:t,attributes:f,startTime:u,parentSpan:c});p&&p.end(d??u)}function ty(e){let t=0,n;if(!Es("largest-contentful-paint"))return;const r=Ss(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);vs(e,(s,i,o)=>{ny(t,n,o,s),r()})}function ny(e,t,n,r){tt&&S.log(`Sending LCP span (${e})`);const s=we()||0,i=le(s),o=le(s+((t==null?void 0:t.startTime)||0)),c=t?Se(t.element):"Largest contentful paint",a={};t!=null&&t.element&&(a["browser.web_vital.lcp.element"]=Se(t.element)),t!=null&&t.id&&(a["browser.web_vital.lcp.id"]=t.id),t!=null&&t.url&&(a["browser.web_vital.lcp.url"]=t.url),(t==null?void 0:t.loadTime)!=null&&(a["browser.web_vital.lcp.load_time"]=t.loadTime),(t==null?void 0:t.renderTime)!=null&&(a["browser.web_vital.lcp.render_time"]=t.renderTime),(t==null?void 0:t.size)!=null&&(a["browser.web_vital.lcp.size"]=t.size),go({name:c,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:e,attributes:a,parentSpan:n,reportEvent:r,startTime:i,endTime:o})}function ry(e){let t=0,n;if(!Es("layout-shift"))return;const r=ys(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);vs(e,(s,i,o)=>{sy(t,n,o,s),r()})}function sy(e,t,n,r){var c;tt&&S.log(`Sending CLS span (${e})`);const s=t?le((we()||0)+t.startTime):_e(),i=t?Se((c=t.sources[0])==null?void 0:c.node):"Layout shift",o={};t!=null&&t.sources&&t.sources.forEach((a,u)=>{o[`browser.web_vital.cls.source.${u+1}`]=Se(a.node)}),go({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:o,parentSpan:n,reportEvent:r,startTime:s})}function iy(){if(!lr()||!we())return;mo(({metric:n})=>{if(n.value==null||le(n.value)>Il)return;const s=n.entries.find(i=>i.duration===n.value&&jn[i.name]);s&&oy(n.value,s)})}function oy(e,t){tt&&S.log(`Sending INP span (${e})`);const n=le(we()+t.startTime),r=le(e),s=jn[t.name],i=Qg(t.interactionId),o=Ie(),c=o?Te(o):void 0,a=(i==null?void 0:i.span)||c,u=a?uu(a).name:ne().getScopeData().transactionName,d=(i==null?void 0:i.elementName)||Se(t.target);go({name:d,op:`ui.interaction.${s}`,origin:"auto.http.browser.inp",metricName:"inp",value:e,attributes:{[Nt]:t.duration,"sentry.transaction":u},startTime:n,endTime:n+r,parentSpan:a})}const ay=1e3;let Ga,Ci,Ri;function kl(e){const t="dom";Mt(t,e),At(t,cy)}function cy(){if(!O.document)return;const e=Ge.bind(null,"dom"),t=Ya(e,!0);O.document.addEventListener("click",t,!1),O.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{var i,o;const s=(i=O[n])==null?void 0:i.prototype;(o=s==null?void 0:s.hasOwnProperty)!=null&&o.call(s,"addEventListener")&&(De(s,"addEventListener",function(c){return function(a,u,d){if(a==="click"||a=="keypress")try{const l=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},f=l[a]=l[a]||{refCount:0};if(!f.handler){const p=Ya(e);f.handler=p,c.call(this,a,p,d)}f.refCount++}catch{}return c.call(this,a,u,d)}}),De(s,"removeEventListener",function(c){return function(a,u,d){if(a==="click"||a=="keypress")try{const l=this.__sentry_instrumentation_handlers__||{},f=l[a];f&&(f.refCount--,f.refCount<=0&&(c.call(this,a,f.handler,d),f.handler=void 0,delete l[a]),Object.keys(l).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return c.call(this,a,u,d)}}))})}function uy(e){if(e.type!==Ci)return!1;try{if(!e.target||e.target._sentryId!==Ri)return!1}catch{}return!0}function ly(e,t){return e!=="keypress"?!1:t!=null&&t.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Ya(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=dy(n);if(ly(n.type,r))return;Oe(n,"_sentryCaptured",!0),r&&!r._sentryId&&Oe(r,"_sentryId",Ue());const s=n.type==="keypress"?"input":n.type;uy(n)||(e({event:n,name:s,global:t}),Ci=n.type,Ri=r?r._sentryId:void 0),clearTimeout(Ga),Ga=O.setTimeout(()=>{Ri=void 0,Ci=void 0},ay)}}function dy(e){try{return e.target}catch{return null}}let Tr;function Ts(e){const t="history";Mt(t,e),At(t,fy)}function fy(){if(O.addEventListener("popstate",()=>{const t=O.location.href,n=Tr;if(Tr=t,n===t)return;Ge("history",{from:n,to:t})}),!dm())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=Tr,i=py(String(r));if(Tr=i,s===i)return t.apply(this,n);Ge("history",{from:s,to:i})}return t.apply(this,n)}}De(O.history,"pushState",e),De(O.history,"replaceState",e)}function py(e){try{return new URL(e,O.location.origin).toString()}catch{return e}}const Wr={};function Cl(e){const t=Wr[e];if(t)return t;let n=O[e];if(yi(n))return Wr[e]=n.bind(O);const r=O.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const i=s.contentWindow;i!=null&&i[e]&&(n=i[e]),r.head.removeChild(s)}catch(s){tt&&S.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,s)}return n&&(Wr[e]=n.bind(O))}function hy(e){Wr[e]=void 0}function dr(...e){return Cl("setTimeout")(...e)}const $t="__sentry_xhr_v3__";function Rl(e){const t="xhr";Mt(t,e),At(t,my)}function my(){if(!O.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const s=new Error,i=_e()*1e3,o=ut(r[0])?r[0].toUpperCase():void 0,c=_y(r[1]);if(!o||!c)return t.apply(n,r);n[$t]={method:o,url:c,request_headers:{}},o==="POST"&&c.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const a=()=>{const u=n[$t];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const d={endTimestamp:_e()*1e3,startTimestamp:i,xhr:n,virtualError:s};Ge("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,d,l){return a(),u.apply(d,l)}}):n.addEventListener("readystatechange",a),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,d,l){const[f,p]=l,h=d[$t];return h&&ut(f)&&ut(p)&&(h.request_headers[f.toLowerCase()]=p),u.apply(d,l)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const s=n[$t];if(!s)return t.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const i={startTimestamp:_e()*1e3,xhr:n};return Ge("xhr",i),t.apply(n,r)}})}function _y(e){if(ut(e))return e;try{return e.toString()}catch{}}const gy=Symbol.for("sentry__originalRequestBody");function xl(e){return new URLSearchParams(e).toString()}function Ml(e,t=S){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[xl(e)];if(!e)return[void 0]}catch(n){return tt&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return tt&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Al(e=[]){if(e.length>=2&&e[1]&&typeof e[1]=="object"&&"body"in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){const n=e[0][gy];return n!==void 0?n:void 0}}function Nl(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return tt&&S.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r `).reduce((n,r)=>{const[s,i]=r.split(": ");return i&&(n[s.toLowerCase()]=i),n},{}):{}}const yy=40;function Sy(e,t=Cl("fetch")){let n=0,r=0;async function s(i){const o=i.body.length;n+=o,r++;const c={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const a=await t(e.url,c);return{statusCode:a.status,headers:{"x-sentry-rate-limits":a.headers.get("X-Sentry-Rate-Limits"),"retry-after":a.headers.get("Retry-After")}}}catch(a){throw hy("fetch"),a}finally{n-=o,r--}}return ah(e,s,eo(e.bufferSize||yy))}const We=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,by=30,Ey=50;function xi(e,t,n,r){const s={filename:e,function:t===""?zt:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const vy=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ty=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,wy=/\((\S*)(?::(\d+))(?::(\d+))\)/,Iy=/at (.+?) ?\(data:(.+?),/,ky=e=>{var s;const t=e.match(Iy);if(t)return{filename:``,function:t[1]};const n=vy.exec(e);if(n){const[,i,o,c]=n;return xi(i,zt,+o,+c)}const r=Ty.exec(e);if(r){if(((s=r[2])==null?void 0:s.indexOf("eval"))===0){const a=wy.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}const[o,c]=Ll(r[1]||zt,r[2]);return xi(c,o,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Cy=[by,ky],Ry=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,xy=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,My=e=>{const t=Ry.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=xy.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],s=t[1]||zt;return[s,r]=Ll(s,r),xi(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Ay=[Ey,My],Ny=[Cy,Ay],Ly=Pc(...Ny),Ll=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:zt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},wr=1024,Dy="Breadcrumbs",Oy=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Dy,setup(n){t.console&&Vh(By(n)),t.dom&&kl($y(n,t.dom)),t.xhr&&Rl(Hy(n)),t.fetch&&Ju(Uy(n)),t.history&&Ts(Wy(n)),t.sentry&&n.on("beforeSendEvent",Fy(n))}}},Py=Oy;function Fy(e){return function(n){U()===e&&Rt({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Ot(n)},{event:n})}}function $y(e,t){return function(r){if(U()!==e)return;let s,i,o=typeof t=="object"?t.serializeAttribute:void 0,c=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;c&&c>wr&&(We&&S.warn(`\`dom.maxStringLength\` cannot exceed ${wr}, but a value of ${c} was configured. Sentry will use ${wr} instead.`),c=wr),typeof o=="string"&&(o=[o]);try{const u=r.event,d=zy(u)?u.target:u;s=Se(d,{keyAttrs:o,maxStringLength:c}),i=zc(d)}catch{s=""}if(s.length===0)return;const a={category:`ui.${r.name}`,message:s};i&&(a.data={"ui.component_name":i}),Rt(a,{event:r.event,name:r.name,global:r.global})}}function By(e){return function(n){if(U()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:Gu(n.level),message:Ho(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Ho(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;Rt(r,{input:n.args,level:n.level})}}function Hy(e){return function(n){if(U()!==e)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[$t];if(!r||!s||!i)return;const{method:o,url:c,status_code:a,body:u}=i,d={method:o,url:c,status_code:a},l={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:s},f={category:"xhr",data:d,type:"http",level:Xu(a)};e.emit("beforeOutgoingRequestBreadcrumb",f,l),Rt(f,l)}}function Uy(e){return function(n){if(U()!==e)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s},o={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",o,i),Rt(o,i)}else{const i=n.response,o={...n.fetchData,status_code:i==null?void 0:i.status},c={input:n.args,response:i,startTimestamp:r,endTimestamp:s},a={category:"fetch",data:o,type:"http",level:Xu(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,c),Rt(a,c)}}}function Wy(e){return function(n){if(U()!==e)return;let r=n.from,s=n.to;const i=Wt(X.location.href);let o=r?Wt(r):void 0;const c=Wt(s);o!=null&&o.path||(o=i),i.protocol===c.protocol&&i.host===c.host&&(s=c.relative),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),Rt({category:"navigation",data:{from:r,to:s}})}}function zy(e){return!!e&&!!e.target}const jy="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),qy="BrowserApiErrors",Vy=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:qy,setupOnce(){t.setTimeout&&De(X,"setTimeout",Ka),t.setInterval&&De(X,"setInterval",Ka),t.requestAnimationFrame&&De(X,"requestAnimationFrame",Yy),t.XMLHttpRequest&&"XMLHttpRequest"in X&&De(XMLHttpRequest.prototype,"send",Ky);const n=t.eventTarget;n&&(Array.isArray(n)?n:jy).forEach(s=>Xy(s,t))}}},Gy=Vy;function Ka(e){return function(...t){const n=t[0];return t[0]=_n(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${pt(e)}`}}),e.apply(this,t)}}function Yy(e){return function(t){return e.apply(this,[_n(t,{mechanism:{data:{handler:pt(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function Ky(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&De(n,s,function(i){const o={mechanism:{data:{handler:pt(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},c=qi(i);return c&&(o.mechanism.data.handler=pt(c)),_n(i,o)})}),e.apply(this,t)}}function Xy(e,t){var s,i;const r=(s=X[e])==null?void 0:s.prototype;(i=r==null?void 0:r.hasOwnProperty)!=null&&i.call(r,"addEventListener")&&(De(r,"addEventListener",function(o){return function(c,a,u){try{Jy(a)&&(a.handleEvent=_n(a.handleEvent,{mechanism:{data:{handler:pt(a),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&Zy(this,c,a),o.apply(this,[c,_n(a,{mechanism:{data:{handler:pt(a),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),De(r,"removeEventListener",function(o){return function(c,a,u){try{const d=a.__sentry_wrapped__;d&&o.call(this,c,d,u)}catch{}return o.call(this,c,a,u)}}))}function Jy(e){return typeof e.handleEvent=="function"}function Zy(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const Qy=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof X.document>"u"){We&&S.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}ca({ignoreDuration:!0}),$s();const n=Me();let r=n.getUser();n.addScopeListener(s=>{const i=s.getUser();((r==null?void 0:r.id)!==(i==null?void 0:i.id)||(r==null?void 0:r.ip_address)!==(i==null?void 0:i.ip_address))&&($s(),r=i)}),t==="route"&&Ts(({from:s,to:i})=>{s!==i&&(ca({ignoreDuration:!0}),$s())})}}},eS="CultureContext",tS=()=>({name:eS,preprocessEvent(e){var n;const t=rS();t&&(e.contexts={...e.contexts,culture:{...t,...(n=e.contexts)==null?void 0:n.culture}})}}),nS=tS;function rS(){try{const e=X.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const sS="GlobalHandlers",iS=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:sS,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(aS(n),Xa("onerror")),t.onunhandledrejection&&(cS(n),Xa("onunhandledrejection"))}}},oS=iS;function aS(e){$c(t=>{const{stackParser:n,attachStacktrace:r}=Dl();if(U()!==e||dl())return;const{msg:s,url:i,line:o,column:c,error:a}=t,u=dS(fo(n,a||s,void 0,r,!1),i,o,c);u.level="error",Ru(u,{originalException:a,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function cS(e){Bc(t=>{const{stackParser:n,attachStacktrace:r}=Dl();if(U()!==e||dl())return;const s=uS(t),i=ln(s)?lS(s):fo(n,s,void 0,r,!0);i.level="error",Ru(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function uS(e){if(ln(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function lS(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function dS(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},c=o.stacktrace=o.stacktrace||{},a=c.frames=c.frames||[];return a.length===0&&a.push({colno:r,lineno:n,filename:fS(t)??Gt(),function:zt,in_app:!0}),e}function Xa(e){We&&S.log(`Global Handler attached: ${e}`)}function Dl(){const e=U();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function fS(e){if(!(!ut(e)||e.length===0))return e.startsWith("data:")?`<${It(e,!1)}>`:e}const pS=()=>({name:"HttpContext",preprocessEvent(e){var r;if(!X.navigator&&!X.location&&!X.document)return;const t=co(),n={...t.headers,...(r=e.request)==null?void 0:r.headers};e.request={...t,...e.request,headers:n}}}),hS="cause",mS=5,_S="LinkedErrors",gS=(e={})=>{const t=e.limit||mS,n=e.key||hS;return{name:_S,preprocessEvent(r,s,i){const o=i.getOptions();qh(uo,o.stackParser,n,t,r,s)}}},yS=gS;function SS(){return bS()?(We&&ot(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function bS(){var s;if(typeof X.window>"u")return!1;const e=X;if(e.nw)return!1;const t=e.chrome||e.browser;if(!((s=t==null?void 0:t.runtime)!=null&&s.id))return!1;const n=Gt();return!(X===X.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function Ol(e){return[Fh(),Lh(),nm(),Gy(),Py(),oS(),yS(),Xh(),pS(),nS(),Qy()]}function ES(e={}){const t=!e.skipBrowserExtensionCheck&&SS();let n=e.defaultIntegrations==null?Ol():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:Bd(e.stackParser||Ly),integrations:Xp({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||Sy};return yh(K_,r)}const ce=G,yo="sentryReplaySession",vS="replay_event",So="Unable to send Replay",TS=3e5,wS=9e5,IS=5e3,kS=5500,CS=6e4,RS=5e3,xS=3,Ja=15e4,Ir=5e3,MS=3e3,AS=300,bo=2e7,NS=4999,LS=5e4,Za=36e5;var DS=Object.defineProperty,OS=(e,t,n)=>t in e?DS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qa=(e,t,n)=>OS(e,typeof t!="symbol"?t+"":t,n),ye=(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))(ye||{});function PS(e){return e.nodeType===e.ELEMENT_NODE}function Ln(e){const t=e==null?void 0:e.host;return(t==null?void 0:t.shadowRoot)===e}function Dn(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function FS(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function $S(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(" ")+";"}function ts(e){try{const t=e.rules||e.cssRules;return t?FS(Array.from(t,Pl).join("")):null}catch{return null}}function BS(e){let t="";for(let n=0;nthis.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){const r=this.getNode(t);if(r){const s=this.nodeMetaMap.get(r);s&&this.nodeMetaMap.set(n,s)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function zS(){return new Fl}function ws({maskInputOptions:e,tagName:t,type:n}){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||n&&e[n]||n==="password"||t==="INPUT"&&!n&&e.text)}function qn({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function yn(e){return e.toLowerCase()}function Mi(e){return e.toUpperCase()}const ec="__rrweb_original__";function jS(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;ra!==0))return!1}return!0}function Eo(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?yn(t):null}function ns(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function $l(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i,s=n.pathname.match(r);return(s==null?void 0:s[1])??null}const tc={};function Bl(e){const t=tc[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return tc[e]=r.bind(window)}function Ai(...e){return Bl("setTimeout")(...e)}function Hl(...e){return Bl("clearTimeout")(...e)}function Ul(e){try{return e.contentDocument}catch{}}let qS=1;const VS=new RegExp("[^a-z0-9-_:]"),Vn=-2;function vo(){return qS++}function GS(e){if(e instanceof HTMLFormElement)return"form";const t=yn(e.tagName);return VS.test(t)?"div":t}function YS(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let Qt,nc;const KS=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,XS=/^(?:[a-z+]+:)?\/\//i,JS=/^www\..*/i,ZS=/^(data:)([^,]*),(.*)/i;function QS(e,t){if(!e||t.size===0)return e;try{const n=e.split(";"),r=[];for(let s of n){if(s=s.trim(),!s)continue;const i=s.indexOf(":");if(i===-1){r.push(s);continue}const o=s.slice(0,i).trim();t.has(o)||r.push(s)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function rs(e,t){return(e||"").replace(KS,(n,r,s,i,o,c)=>{const a=s||o||c,u=r||i||"";if(!a)return n;if(XS.test(a)||JS.test(a))return`url(${u}${a}${u})`;if(ZS.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${YS(t)+a}${u})`;const d=t.split("/"),l=a.split("/");d.pop();for(const f of l)f!=="."&&(f===".."?d.pop():d.push(f));return`url(${u}${d.join("/")}${u})`})}const eb=/^[^ \t\n\r\u000c]+/,tb=/^[, \t\n\r\u000c]+/;function nb(e,t){if(t.trim()==="")return t;let n=0;function r(i){let o;const c=i.exec(t.substring(n));return c?(o=c[0],n+=o.length,o):""}const s=[];for(;r(tb),!(n>=t.length);){let i=r(eb);if(i.slice(-1)===",")i=rn(e,i.substring(0,i.length-1)),s.push(i);else{let o="";i=rn(e,i);let c=!1;for(;;){const a=t.charAt(n);if(a===""){s.push((i+o).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){n+=1,s.push((i+o).trim());break}else a==="("&&(c=!0);o+=a,n+=1}}}return s.join(", ")}const rc=new WeakMap;function rn(e,t){return!t||t.trim()===""?t:Is(e,t)}function rb(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Is(e,t){let n=rc.get(e);if(n||(n=e.createElement("a"),rc.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function Wl(e,t,n,r,s,i,o){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return rn(e,r);if(n==="xlink:href"&&r[0]!=="#")return rn(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return rn(e,r);if(n==="srcset")return nb(e,r);if(n==="style"){let c=rs(r,Is(e));return o&&o.size>0&&(c=QS(c,o)),c}else if(t==="object"&&n==="data")return rn(e,r);return typeof i=="function"?i(n,r,s):r}function zl(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function sb(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const i=e.classList[s];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function ib(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function Bt(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Bt(e.parentNode,t,n,r+1)}function sn(e,t){return n=>{const r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(ib(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function Sn(e,t,n,r,s,i){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(o.tagName==="INPUT"){const u=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let c=-1,a=-1;if(i){if(a=Bt(o,sn(r,s)),a<0)return!0;c=Bt(o,sn(t,n),a>=0?a:1/0)}else{if(c=Bt(o,sn(t,n)),c<0)return!1;a=Bt(o,sn(r,s),c>=0?c:1/0)}return c>=0?a>=0?c<=a:!0:a>=0?!1:!!i}catch{}return!!i}function ob(e,t,n){const r=e.contentWindow;if(!r)return;let s=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){const c=Ai(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{Hl(c),s=!0,t()});return}const o="about:blank";if(r.location.href!==o||e.src===o||e.src==="")return Ai(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function ab(e,t,n){let r=!1,s;try{s=e.sheet}catch{return}if(s)return;const i=Ai(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{Hl(i),r=!0,t()})}function cb(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskAttributeFn:a,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:h={},maskTextFn:m,maskInputFn:_,dataURLOptions:g={},inlineImages:b,recordCanvas:N,keepIframeSrcFn:C,newlyAddedElement:H=!1,ignoreCSSAttributes:A}=t,y=ub(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:ye.Document,childNodes:[],compatMode:e.compatMode}:{type:ye.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ye.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return db(e,{doc:n,blockClass:s,blockSelector:i,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:a,maskInputOptions:h,maskInputFn:_,dataURLOptions:g,inlineImages:b,recordCanvas:N,keepIframeSrcFn:C,newlyAddedElement:H,rootId:y,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,ignoreCSSAttributes:A});case e.TEXT_NODE:return lb(e,{doc:n,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,maskTextFn:m,maskInputOptions:h,maskInputFn:_,rootId:y});case e.CDATA_SECTION_NODE:return{type:ye.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:ye.Comment,textContent:e.textContent||"",rootId:y};default:return!1}}function ub(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function lb(e,t){var g;const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:o,maskTextFn:c,maskInputOptions:a,maskInputFn:u,rootId:d}=t,l=e.parentNode&&e.parentNode.tagName;let f=e.textContent;const p=l==="STYLE"?!0:void 0,h=l==="SCRIPT"?!0:void 0,m=l==="TEXTAREA"?!0:void 0;if(p&&f){try{e.nextSibling||e.previousSibling||(g=e.parentNode.sheet)!=null&&g.cssRules&&(f=ts(e.parentNode.sheet))}catch(b){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${b}`,e)}f=rs(f,Is(t.doc))}h&&(f="SCRIPT_PLACEHOLDER");const _=Sn(e,r,i,s,o,n);if(!p&&!h&&!m&&f&&_&&(f=c?c(f,e.parentElement):f.replace(/[\S]/g,"*")),m&&f&&(a.textarea||_)&&(f=u?u(f,e.parentNode):f.replace(/[\S]/g,"*")),l==="OPTION"&&f){const b=ws({type:null,tagName:l,maskInputOptions:a});f=qn({isMasked:Sn(e,r,i,s,o,b),element:e,value:f,maskInputFn:u})}return{type:ye.Text,textContent:f||"",isStyle:p,rootId:d}}function db(e,t){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:o,maskInputOptions:c={},maskAttributeFn:a,maskInputFn:u,dataURLOptions:d={},inlineImages:l,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:m,maskTextClass:_,unmaskTextClass:g,maskTextSelector:b,unmaskTextSelector:N,ignoreCSSAttributes:C}=t,H=sb(e,r,s,i),A=GS(e);let y={};const w=e.attributes.length;for(let v=0;vT.href===e.href);let x=null;v&&(x=ts(v)),x&&(y.rel=null,y.href=null,y.crossorigin=null,y._cssText=rs(x,v.href))}if(A==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const v=ts(e.sheet);v&&(y._cssText=rs(v,Is(n)))}if(A==="input"||A==="textarea"||A==="select"||A==="option"){const v=e,x=Eo(v),T=ns(v,Mi(A),x),k=v.checked;if(x!=="submit"&&x!=="button"&&T){const M=Sn(v,_,b,g,N,ws({type:x,tagName:Mi(A),maskInputOptions:c}));y.value=qn({isMasked:M,element:v,value:T,maskInputFn:u})}k&&(y.checked=k)}if(A==="option"&&(e.selected&&!c.select?y.selected=!0:delete y.selected),A==="canvas"&&f){if(e.__context==="2d")jS(e)||(y.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){const v=e.toDataURL(d.type,d.quality),x=n.createElement("canvas");x.width=e.width,x.height=e.height;const T=x.toDataURL(d.type,d.quality);v!==T&&(y.rr_dataURL=v)}}if(A==="img"&&l){Qt||(Qt=n.createElement("canvas"),nc=Qt.getContext("2d"));const v=e,x=v.currentSrc||v.getAttribute("src")||"",T=v.crossOrigin,k=()=>{v.removeEventListener("load",k);try{Qt.width=v.naturalWidth,Qt.height=v.naturalHeight,nc.drawImage(v,0,0),y.rr_dataURL=Qt.toDataURL(d.type,d.quality)}catch(M){if(v.crossOrigin!=="anonymous"){v.crossOrigin="anonymous",v.complete&&v.naturalWidth!==0?k():v.addEventListener("load",k);return}else console.warn(`Cannot inline img src=${x}! Error: ${M}`)}v.crossOrigin==="anonymous"&&(T?y.crossOrigin=T:v.removeAttribute("crossorigin"))};v.complete&&v.naturalWidth!==0?k():v.addEventListener("load",k)}if((A==="audio"||A==="video")&&(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime),h||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),H){const{width:v,height:x}=e.getBoundingClientRect();y={class:y.class,rr_width:`${v}px`,rr_height:`${x}px`}}A==="iframe"&&!p(y.src)&&(!H&&!Ul(e)&&(y.rr_src=y.src),delete y.src);let $;try{customElements.get(A)&&($=!0)}catch{}return{type:ye.Element,tagName:A,attributes:y,childNodes:[],isSVG:rb(e)||void 0,needBlock:H,rootId:m,isCustom:$}}function ae(e){return e==null?"":e.toLowerCase()}function fb(e,t){if(t.comment&&e.type===ye.Comment)return!0;if(e.type===ye.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&$l(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ae(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ae(e.attributes.name)==="application-name"||ae(e.attributes.rel)==="icon"||ae(e.attributes.rel)==="apple-touch-icon"||ae(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){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):/)||ae(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ae(e.attributes.name)==="robots"||ae(e.attributes.name)==="googlebot"||ae(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ae(e.attributes.name)==="author"||ae(e.attributes.name)==="generator"||ae(e.attributes.name)==="framework"||ae(e.attributes.name)==="publisher"||ae(e.attributes.name)==="progid"||ae(e.attributes.property).match(/^article:/)||ae(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ae(e.attributes.name)==="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"))return!0}}return!1}function on(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:h={},maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:b,dataURLOptions:N={},inlineImages:C=!1,recordCanvas:H=!1,onSerialize:A,onIframeLoad:y,iframeLoadTimeout:w=5e3,onBlockedImageLoad:$,onStylesheetLoad:v,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:T=()=>!1,newlyAddedElement:k=!1,ignoreCSSAttributes:M}=t;let{preserveWhiteSpace:Z=!0}=t;const J=cb(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,dataURLOptions:N,inlineImages:C,recordCanvas:H,keepIframeSrcFn:T,newlyAddedElement:k,ignoreCSSAttributes:M});if(!J)return console.warn(e,"not serialized"),null;let Q;r.hasNode(e)?Q=r.getId(e):fb(J,b)||!Z&&J.type===ye.Text&&!J.isStyle&&!J.textContent.replace(/^\s+|\s+$/gm,"").length?Q=Vn:Q=vo();const E=Object.assign(J,{id:Q});if(r.add(e,E),Q===Vn)return null;A&&A(e);let P=!f;if(E.type===ye.Element){P=P&&!E.needBlock;const I=e.shadowRoot;I&&Dn(I)&&(E.isShadowHost=!0)}if((E.type===ye.Document||E.type===ye.Element)&&P){b.headWhitespace&&E.type===ye.Element&&E.tagName==="head"&&(Z=!1);const I={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:b,dataURLOptions:N,inlineImages:C,recordCanvas:H,preserveWhiteSpace:Z,onSerialize:A,onIframeLoad:y,iframeLoadTimeout:w,onBlockedImageLoad:$,onStylesheetLoad:v,stylesheetLoadTimeout:x,keepIframeSrcFn:T,ignoreCSSAttributes:M},V=e.childNodes?Array.from(e.childNodes):[];for(const W of V){const Y=on(W,I);Y&&E.childNodes.push(Y)}if(PS(e)&&e.shadowRoot)for(const W of Array.from(e.shadowRoot.childNodes)){const Y=on(W,I);Y&&(Dn(e.shadowRoot)&&(Y.isShadow=!0),E.childNodes.push(Y))}}if(e.parentNode&&Ln(e.parentNode)&&Dn(e.parentNode)&&(E.isShadow=!0),E.type===ye.Element&&E.tagName==="iframe"&&!E.needBlock&&ob(e,()=>{const I=Ul(e);if(I&&y){const V=on(I,{doc:I,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:b,dataURLOptions:N,inlineImages:C,recordCanvas:H,preserveWhiteSpace:Z,onSerialize:A,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:v,stylesheetLoadTimeout:x,keepIframeSrcFn:T,ignoreCSSAttributes:M});V&&y(e,V)}},w),E.type===ye.Element&&E.tagName==="img"&&!e.complete&&E.needBlock){const I=e,V=()=>{if(I.isConnected&&!I.complete&&$)try{const W=I.getBoundingClientRect();W.width>0&&W.height>0&&$(I,E,W)}catch{}I.removeEventListener("load",V)};I.isConnected&&I.addEventListener("load",V)}return E.type===ye.Element&&E.tagName==="link"&&typeof E.attributes.rel=="string"&&(E.attributes.rel==="stylesheet"||E.attributes.rel==="preload"&&typeof E.attributes.href=="string"&&$l(E.attributes.href)==="css")&&ab(e,()=>{if(v){const I=on(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:b,dataURLOptions:N,inlineImages:C,recordCanvas:H,preserveWhiteSpace:Z,onSerialize:A,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:v,stylesheetLoadTimeout:x,keepIframeSrcFn:T,ignoreCSSAttributes:M});I&&v(e,I)}},x),E.type===ye.Element&&delete E.needBlock,E}function pb(e,t){const{mirror:n=new Fl,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:o=!1,maskTextClass:c="rr-mask",unmaskTextClass:a=null,maskTextSelector:u=null,unmaskTextSelector:d=null,inlineStylesheet:l=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:h=!1,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOM:b=!1,dataURLOptions:N,preserveWhiteSpace:C,onSerialize:H,onIframeLoad:A,iframeLoadTimeout:y,onBlockedImageLoad:w,onStylesheetLoad:$,stylesheetLoadTimeout:v,keepIframeSrcFn:x=()=>!1,ignoreCSSAttributes:T=new Set([])}=t||{};return on(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:o,maskTextClass:c,unmaskTextClass:a,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:l,maskInputOptions:h===!0?{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}:h===!1?{}:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:b===!0||b==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:b==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:b===!1?{}:b,dataURLOptions:N,inlineImages:f,recordCanvas:p,preserveWhiteSpace:C,onSerialize:H,onIframeLoad:A,iframeLoadTimeout:y,onBlockedImageLoad:w,onStylesheetLoad:$,stylesheetLoadTimeout:v,keepIframeSrcFn:x,newlyAddedElement:!1,ignoreCSSAttributes:T})}function xe(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const en=`Please stop import mirror directly. Instead of that,\r now you can use replayer.getMirror() to access the mirror instance of a replayer,\r or you can use record.mirror to access the mirror instance during recording.`;let sc={map:{},getId(){return console.error(en),-1},getNode(){return console.error(en),null},removeNodeFromMap(){console.error(en)},has(){return console.error(en),!1},reset(){console.error(en)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(sc=new Proxy(sc,{get(e,t,n){return t==="map"&&console.error(en),Reflect.get(e,t,n)}}));function Gn(e,t,n={}){let r=null,s=0;return function(...i){const o=Date.now();!s&&n.leading===!1&&(s=o);const c=t-(o-s),a=this;c<=0||c>t?(r&&(bb(r),r=null),s=o,e.apply(a,i)):!r&&n.trailing!==!1&&(r=ks(()=>{s=n.leading===!1?0:Date.now(),r=null,e.apply(a,i)},c))}}function jl(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(o){ks(()=>{n.set.call(this,o)},0),i&&i.set&&i.set.call(this,o)}}),()=>jl(e,t,i||{},!0)}function To(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}let ss=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ss=()=>new Date().getTime());function ql(e){var n,r,s,i,o,c;const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:(t==null?void 0:t.documentElement.scrollLeft)||((r=(n=t==null?void 0:t.body)==null?void 0:n.parentElement)==null?void 0:r.scrollLeft)||((s=t==null?void 0:t.body)==null?void 0:s.scrollLeft)||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(t==null?void 0:t.documentElement.scrollTop)||((o=(i=t==null?void 0:t.body)==null?void 0:i.parentElement)==null?void 0:o.scrollTop)||((c=t==null?void 0:t.body)==null?void 0:c.scrollTop)||0}}function Vl(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Gl(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Yl(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function $e(e,t,n,r,s){if(!e)return!1;const i=Yl(e);if(!i)return!1;const o=sn(t,n);if(!s){const u=r&&i.matches(r);return o(i)&&!u}const c=Bt(i,o);let a=-1;return c<0?!1:(r&&(a=Bt(i,sn(null,r))),c>-1&&a<0?!0:c{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Xl(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Jl(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Li(e){return!!(e!=null&&e.shadowRoot)}class _b{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Zl(e){var n,r;let t=null;return((r=(n=e.getRootNode)==null?void 0:n.call(e))==null?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function gb(e){let t=e,n;for(;n=Zl(t);)t=n;return t}function yb(e){const t=e.ownerDocument;if(!t)return!1;const n=gb(e);return t.contains(n)}function Ql(e){const t=e.ownerDocument;return t?t.contains(e)||yb(e):!1}const ic={};function wo(e){const t=ic[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return ic[e]=r.bind(window)}function Sb(...e){return wo("requestAnimationFrame")(...e)}function ks(...e){return wo("setTimeout")(...e)}function bb(...e){return wo("clearTimeout")(...e)}var j=(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))(j||{}),F=(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))(F||{}),Ce=(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))(Ce||{}),ct=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ct||{}),tn=(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))(tn||{});function Io(e){try{return e.contentDocument}catch{}}function Eb(e){try{return e.contentWindow}catch{}}function oc(e){return"__ln"in e}class vb{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r`${e}@${t}`;class Tb{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=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Set,r=new vb,s=a=>{let u=a,d=Vn;for(;d===Vn;)u=u&&u.nextSibling,d=u&&this.mirror.getId(u);return d},i=a=>{if(!a.parentNode||!Ql(a))return;const u=Ln(a.parentNode)?this.mirror.getId(Zl(a)):this.mirror.getId(a.parentNode),d=s(a);if(u===-1||d===-1)return r.addNode(a);const l=on(a,{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:f=>{Xl(f,this.mirror)&&!$e(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(f),Jl(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Li(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{$e(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(f,p),f.contentWindow&&this.canvasManager.addWindow(f.contentWindow),this.shadowDomManager.observeAttachShadow(f))},onStylesheetLoad:(f,p)=>{this.stylesheetManager.attachLinkElement(f,p)},onBlockedImageLoad:(f,p,{width:h,height:m})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:p.id,attributes:{style:{width:`${h}px`,height:`${m}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});l&&(t.push({parentId:u,nextId:d,node:l}),n.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)cc(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(const a of this.addedSet)!uc(this.droppedSet,a)&&!cc(this.removes,a,this.mirror)||uc(this.movedSet,a)?i(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const u=this.mirror.getId(o.value.parentNode),d=s(o.value);u!==-1&&d!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){const d=u;if(u=u.previous,d){const l=this.mirror.getId(d.value.parentNode);if(s(d.value)===-1)continue;if(l!==-1){a=d;break}else{const p=d.value;if(p.parentNode&&p.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=p.parentNode.host;if(this.mirror.getId(h)!==-1){a=d;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),i(a.value)}const c={texts:this.texts.map(a=>({id:this.mirror.getId(a.node),value:a.value})).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:u}=a;if(typeof u.style=="string"){const d=JSON.stringify(a.styleDiff),l=JSON.stringify(a._unchangedStyles);d.length!n.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.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(c))},this.processMutation=t=>{if(!Js(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!$e(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Sn(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,Yl(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.attributeName,s=t.target.getAttribute(r);if(r==="value"){const o=Eo(n),c=n.tagName;s=ns(n,c,o);const a=ws({maskInputOptions:this.maskInputOptions,tagName:c,type:o}),u=Sn(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a);s=qn({isMasked:u,element:n,value:s,maskInputFn:this.maskInputFn})}if($e(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||s===t.oldValue)return;let i=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!Io(n))r="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!zl(n.tagName,r)&&(i.attributes[r]=Wl(this.doc,yn(n.tagName),yn(r),s,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");t.oldValue&&o.setAttribute("style",t.oldValue);for(const c of Array.from(n.style)){const a=n.style.getPropertyValue(c),u=n.style.getPropertyPriority(c);a!==o.style.getPropertyValue(c)||u!==o.style.getPropertyPriority(c)?u===""?i.styleDiff[c]=a:i.styleDiff[c]=[a,u]:i._unchangedStyles[c]=[a,u]}for(const c of Array.from(o.style))n.style.getPropertyValue(c)===""&&(i.styleDiff[c]=!1)}break}case"childList":{if($e(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),s=Ln(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);$e(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Js(n,this.mirror)||!hb(n,this.mirror)||(this.addedSet.has(n)?(Di(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||Kl(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[ac(r,s)]?Di(this.movedSet,n):this.removes.push({parentId:s,id:r,isShadow:Ln(t.target)&&Dn(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Js(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[ac(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);$e(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),Li(t)&&t.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,t)}))}}}init(t){["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","ignoreCSSAttributes"].forEach(n=>{this[n]=t[n]})}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 Di(e,t){var n;e.delete(t),(n=t.childNodes)==null||n.forEach(r=>Di(e,r))}function cc(e,t,n){return e.length===0?!1:wb(e,t,n)}function wb(e,t,n){let r=t.parentNode;for(;r;){const s=n.getId(r);if(e.some(i=>i.id===s))return!0;r=r.parentNode}return!1}function uc(e,t){return e.size===0?!1:ed(e,t)}function ed(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:ed(e,n):!1}let On;function Ib(e){On=e}function kb(){On=void 0}const ee=e=>On?(...n)=>{try{return e(...n)}catch(r){if(On&&On(r)===!0)return()=>{};throw r}}:e,an=[];function fr(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 td(e,t){var o,c;const n=new Tb;an.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=(c=(o=window==null?void 0:window.Zone)==null?void 0:o.__symbol__)==null?void 0:c.call(o,"MutationObserver");s&&window[s]&&(r=window[s]);const i=new r(ee(a=>{e.onMutation&&e.onMutation(a)===!1||n.processMutations.bind(n)(a)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Cb({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const s=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let o=[],c;const a=Gn(ee(l=>{const f=Date.now()-c;e(o.map(p=>(p.timeOffset-=f,p)),l),o=[],c=null}),i),u=ee(Gn(ee(l=>{const f=fr(l),{clientX:p,clientY:h}=Ni(l)?l.changedTouches[0]:l;c||(c=ss()),o.push({x:p,y:h,id:r.getId(f),timeOffset:ss()-c}),a(typeof DragEvent<"u"&&l instanceof DragEvent?F.Drag:l instanceof MouseEvent?F.MouseMove:F.TouchMove)}),s,{trailing:!1})),d=[xe("mousemove",u,n),xe("touchmove",u,n),xe("drag",u,n)];return ee(()=>{d.forEach(l=>l())})}function Rb({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const c=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[];let u=null;const d=l=>f=>{const p=fr(f);if($e(p,r,s,i,!0))return;let h=null,m=l;if("pointerType"in f){switch(f.pointerType){case"mouse":h=ct.Mouse;break;case"touch":h=ct.Touch;break;case"pen":h=ct.Pen;break}h===ct.Touch?Ce[l]===Ce.MouseDown?m="TouchStart":Ce[l]===Ce.MouseUp&&(m="TouchEnd"):ct.Pen}else Ni(f)&&(h=ct.Touch);h!==null?(u=h,(m.startsWith("Touch")&&h===ct.Touch||m.startsWith("Mouse")&&h===ct.Mouse)&&(h=null)):Ce[l]===Ce.Click&&(h=u,u=null);const _=Ni(f)?f.changedTouches[0]:f;if(!_)return;const g=n.getId(p),{clientX:b,clientY:N}=_;ee(e)({type:Ce[m],id:g,x:b,y:N,...h!==null&&{pointerType:h}})};return Object.keys(Ce).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&c[l]!==!1).forEach(l=>{let f=yn(l);const p=d(l);if(window.PointerEvent)switch(Ce[l]){case Ce.MouseDown:case Ce.MouseUp:f=f.replace("mouse","pointer");break;case Ce.TouchStart:case Ce.TouchEnd:return}a.push(xe(f,p,t))}),ee(()=>{a.forEach(l=>l())})}function nd({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){const c=ee(Gn(ee(a=>{const u=fr(a);if(!u||$e(u,r,s,i,!0))return;const d=n.getId(u);if(u===t&&t.defaultView){const l=ql(t.defaultView);e({id:d,x:l.left,y:l.top})}else e({id:d,x:u.scrollLeft,y:u.scrollTop})}),o.scroll||100));return xe("scroll",c,t)}function xb({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const s=ee(Gn(ee(()=>{const i=Vl(),o=Gl();(n!==i||r!==o)&&(e({width:Number(o),height:Number(i)}),n=i,r=o)}),200));return xe("resize",s,t)}const Mb=["INPUT","TEXTAREA","SELECT"],lc=new WeakMap;function Ab({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:o,ignoreSelector:c,maskInputOptions:a,maskInputFn:u,sampling:d,userTriggeredOnInput:l,maskTextClass:f,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:m}){function _(y){let w=fr(y);const $=y.isTrusted,v=w&&Mi(w.tagName);if(v==="OPTION"&&(w=w.parentElement),!w||!v||Mb.indexOf(v)<0||$e(w,r,s,i,!0))return;const x=w;if(x.classList.contains(o)||c&&x.matches(c))return;const T=Eo(w);let k=ns(x,v,T),M=!1;const Z=ws({maskInputOptions:a,tagName:v,type:T}),J=Sn(w,f,h,p,m,Z);(T==="radio"||T==="checkbox")&&(M=w.checked),k=qn({isMasked:J,element:w,value:k,maskInputFn:u}),g(w,l?{text:k,isChecked:M,userTriggered:$}:{text:k,isChecked:M});const Q=w.name;T==="radio"&&Q&&M&&t.querySelectorAll(`input[type="radio"][name="${Q}"]`).forEach(E=>{if(E!==w){const P=qn({isMasked:J,element:E,value:ns(E,v,T),maskInputFn:u});g(E,l?{text:P,isChecked:!M,userTriggered:!1}:{text:P,isChecked:!M})}})}function g(y,w){const $=lc.get(y);if(!$||$.text!==w.text||$.isChecked!==w.isChecked){lc.set(y,w);const v=n.getId(y);ee(e)({...w,id:v})}}const N=(d.input==="last"?["change"]:["input","change"]).map(y=>xe(y,ee(_),t)),C=t.defaultView;if(!C)return()=>{N.forEach(y=>y())};const H=C.Object.getOwnPropertyDescriptor(C.HTMLInputElement.prototype,"value"),A=[[C.HTMLInputElement.prototype,"value"],[C.HTMLInputElement.prototype,"checked"],[C.HTMLSelectElement.prototype,"value"],[C.HTMLTextAreaElement.prototype,"value"],[C.HTMLSelectElement.prototype,"selectedIndex"],[C.HTMLOptionElement.prototype,"selected"]];return H&&H.set&&N.push(...A.map(y=>jl(y[0],y[1],{set(){ee(_)({target:this,isTrusted:!1})}},!1,C))),ee(()=>{N.forEach(y=>y())})}function is(e){const t=[];function n(r,s){if(kr("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||kr("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||kr("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||kr("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);s.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);s.unshift(o)}return s}return n(e,t)}function Et(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function Nb({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:ee((d,l,f)=>{const[p,h]=f,{id:m,styleId:_}=Et(l,t,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&e({id:m,styleId:_,adds:[{rule:p,index:h}]}),d.apply(l,f)})});const i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:ee((d,l,f)=>{const[p]=f,{id:h,styleId:m}=Et(l,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,removes:[{index:p}]}),d.apply(l,f)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:ee((d,l,f)=>{const[p]=f,{id:h,styleId:m}=Et(l,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replace:p}),d.apply(l,f)})}));let c;r.CSSStyleSheet.prototype.replaceSync&&(c=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:ee((d,l,f)=>{const[p]=f,{id:h,styleId:m}=Et(l,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replaceSync:p}),d.apply(l,f)})}));const a={};Cr("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(Cr("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),Cr("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),Cr("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(a).forEach(([d,l])=>{u[d]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=new Proxy(u[d].insertRule,{apply:ee((f,p,h)=>{const[m,_]=h,{id:g,styleId:b}=Et(p.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||b&&b!==-1)&&e({id:g,styleId:b,adds:[{rule:m,index:[...is(p),_||0]}]}),f.apply(p,h)})}),l.prototype.deleteRule=new Proxy(u[d].deleteRule,{apply:ee((f,p,h)=>{const[m]=h,{id:_,styleId:g}=Et(p.parentStyleSheet,t,n.styleMirror);return(_&&_!==-1||g&&g!==-1)&&e({id:_,styleId:g,removes:[{index:[...is(p),m]}]}),f.apply(p,h)})})}),ee(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=i,o&&(r.CSSStyleSheet.prototype.replace=o),c&&(r.CSSStyleSheet.prototype.replaceSync=c),Object.entries(a).forEach(([d,l])=>{l.prototype.insertRule=u[d].insertRule,l.prototype.deleteRule=u[d].deleteRule})})}function rd({mirror:e,stylesheetManager:t},n){var o,c,a;let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);const s=n.nodeName==="#document"?(o=n.defaultView)==null?void 0:o.Document:(a=(c=n.ownerDocument)==null?void 0:c.defaultView)==null?void 0:a.ShadowRoot,i=s!=null&&s.prototype?Object.getOwnPropertyDescriptor(s==null?void 0:s.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!s||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){var u;return(u=i.get)==null?void 0:u.call(this)},set(u){var l;const d=(l=i.set)==null?void 0:l.call(this,u);if(r!==null&&r!==-1)try{t.adoptStyleSheets(u,r)}catch{}return d}}),ee(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function Lb({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:ee((c,a,u)=>{var m;const[d,l,f]=u;if(n.has(d))return i.apply(a,[d,l,f]);const{id:p,styleId:h}=Et((m=a.parentRule)==null?void 0:m.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,set:{property:d,value:l,priority:f},index:is(a.parentRule)}),c.apply(a,u)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:ee((c,a,u)=>{var p;const[d]=u;if(n.has(d))return o.apply(a,[d]);const{id:l,styleId:f}=Et((p=a.parentRule)==null?void 0:p.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||f&&f!==-1)&&e({id:l,styleId:f,remove:{property:d},index:is(a.parentRule)}),c.apply(a,u)})}),ee(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}function Db({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:o}){const c=ee(u=>Gn(ee(d=>{const l=fr(d);if(!l||$e(l,t,n,r,!0))return;const{currentTime:f,volume:p,muted:h,playbackRate:m}=l;e({type:u,id:s.getId(l),currentTime:f,volume:p,muted:h,playbackRate:m})}),i.media||500)),a=[xe("play",c(tn.Play),o),xe("pause",c(tn.Pause),o),xe("seeked",c(tn.Seeked),o),xe("volumechange",c(tn.VolumeChange),o),xe("ratechange",c(tn.RateChange),o)];return ee(()=>{a.forEach(u=>u())})}function Ob({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(a,u,d){const l=new i(a,u,d);return s.set(l,{family:a,buffer:typeof u!="string",descriptors:d,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),l};const o=To(t.fonts,"add",function(c){return function(a){return ks(ee(()=>{const u=s.get(a);u&&(e(u),s.delete(a))}),0),c.apply(this,[a])}});return r.push(()=>{n.FontFace=i}),r.push(o),ee(()=>{r.forEach(c=>c())})}function Pb(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:o}=e;let c=!0;const a=ee(()=>{const u=t.getSelection();if(!u||c&&(u!=null&&u.isCollapsed))return;c=u.isCollapsed||!1;const d=[],l=u.rangeCount||0;for(let f=0;f{}:To(n.customElements,"define",function(s){return function(i,o,c){try{t({define:{name:i}})}catch{}return s.apply(this,[i,o,c])}})}function $b(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=td(e,e.doc));const s=Cb(e),i=Rb(e),o=nd(e),c=xb(e,{win:n}),a=Ab(e),u=Db(e);let d=()=>{},l=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(d=Nb(e,{win:n}),l=rd(e,e.doc),f=Lb(e,{win:n}),e.collectFonts&&(p=Ob(e)));const h=Pb(e),m=Fb(e),_=[];for(const g of e.plugins)_.push(g.observer(g.callback,n,g.options));return ee(()=>{an.forEach(g=>g.reset()),r==null||r.disconnect(),s(),i(),o(),c(),a(),u(),d(),l(),f(),p(),h(),m(),_.forEach(g=>g())})}function kr(e){return typeof window[e]<"u"}function Cr(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Oi{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,s){const i=r||this.getIdToRemoteIdMap(t),o=s||this.getRemoteIdToIdMap(t);let c=i.get(n);return c||(c=this.generateIdFn(),i.set(n,c),o.set(c,n)),c}getIds(t,n){const r=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,s))}getRemoteId(t,n,r){const s=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const i=s.get(n);return i||-1}getRemoteIds(t,n){const r=this.getRemoteIdToIdMap(t);return n.map(s=>this.getRemoteId(t,s,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}}class Bb{constructor(){this.crossOriginIframeMirror=new Oi(vo),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class Hb{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Oi(vo),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Oi(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){var s,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((s=t.contentWindow)==null||s.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,t);const r=Io(t);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(t){const n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;const s=this.crossOriginIframeMap.get(t.source);if(!s)return;const i=this.transformCrossOriginEvent(s,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(t,n){var r;switch(n.type){case j.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const s=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(n.data.node,s),{timestamp:n.timestamp,type:j.IncrementalSnapshot,data:{source:F.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case j.Meta:case j.Load:case j.DomContentLoaded:return!1;case j.Plugin:return n;case j.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case j.IncrementalSnapshot:switch(n.data.source){case F.Mutation:return n.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);const i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(s.node,i)}),n.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"])}),n.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"])}),n.data.texts.forEach(s=>{this.replaceIds(s,t,["id"])}),n;case F.Drag:case F.TouchMove:case F.MouseMove:return n.data.positions.forEach(s=>{this.replaceIds(s,t,["id"])}),n;case F.ViewportResize:return!1;case F.MediaInteraction:case F.MouseInteraction:case F.Scroll:case F.CanvasMutation:case F.Input:return this.replaceIds(n.data,t,["id"]),n;case F.StyleSheetRule:case F.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case F.Font:return n;case F.Selection:return n.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"])}),n;case F.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)==null||r.forEach(s=>{this.replaceStyleIds(s,t,["styleId"])}),n}}return!1}replace(t,n,r,s){for(const i of s)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==ye.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class Ub{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class Wb{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,n){if(!Dn(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const r=td({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(nd({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),ks(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(rd({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){const n=Io(t),r=Eb(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(To(t.prototype,"attachShadow",function(s){return function(i){const o=s.call(this,i);return this.shadowRoot&&Ql(this)&&r.addShadowRoot(this.shadowRoot,n),o}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}var dc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zb=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Rr=0;Rr({rule:Pl(c),index:a}))})),r.styleIds.push(o)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class qb{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(s=>s!==n)}add(t,n){this.active||(this.active=!0,Sb(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}}let me,os;var Lc;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Lc=e.contentWindow)==null?void 0:Lc.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Xe=zS();function Qe(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:i=null,unblockSelector:o=null,ignoreClass:c="rr-ignore",ignoreSelector:a=null,maskAllText:u=!1,maskTextClass:d="rr-mask",unmaskTextClass:l=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:h=!0,maskAllInputs:m,maskInputOptions:_,slimDOMOptions:g,maskAttributeFn:b,maskInputFn:N,maskTextFn:C,maxCanvasSize:H=null,packFn:A,sampling:y={},dataURLOptions:w={},mousemoveWait:$,recordDOM:v=!0,recordCanvas:x=!1,recordCrossOriginIframes:T=!1,recordAfter:k=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:M=!1,collectFonts:Z=!1,inlineImages:J=!1,plugins:Q,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:I,onMutation:V,getCanvasManager:W}=e;Ib(I);const Y=T?window.parent===window:!0;let de=!1;if(!Y)try{window.parent.document&&(de=!1)}catch{de=!0}if(Y&&!t)throw new Error("emit function is required");if(!Y&&!de)return()=>{};$!==void 0&&y.mousemove===void 0&&(y.mousemove=$),Xe.reset();const Pe=m===!0?{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?_:{},nt=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all"}:g||{};mb();let ge,be=0;const ze=B=>{for(const ke of Q||[])ke.eventProcessor&&(B=ke.eventProcessor(B));return A&&!de&&(B=A(B)),B};me=(B,ke)=>{var Ne;const z=B;if(z.timestamp=ss(),(Ne=an[0])!=null&&Ne.isFrozen()&&z.type!==j.FullSnapshot&&!(z.type===j.IncrementalSnapshot&&z.data.source===F.Mutation)&&an.forEach(je=>je.unfreeze()),Y)t==null||t(ze(z),ke);else if(de){const je={type:"rrweb",event:ze(z),origin:window.location.origin,isCheckout:ke};window.parent.postMessage(je,"*")}if(z.type===j.FullSnapshot)ge=z,be=0;else if(z.type===j.IncrementalSnapshot){if(z.data.source===F.Mutation&&z.data.isAttachIframe)return;be++;const je=r&&be>=r,re=n&&ge&&z.timestamp-ge.timestamp>n;(je||re)&&fe(!0)}};const Fe=B=>{me({type:j.IncrementalSnapshot,data:{source:F.Mutation,...B}})},Cn=B=>me({type:j.IncrementalSnapshot,data:{source:F.Scroll,...B}}),hr=B=>me({type:j.IncrementalSnapshot,data:{source:F.CanvasMutation,...B}}),mr=B=>me({type:j.IncrementalSnapshot,data:{source:F.AdoptedStyleSheet,...B}}),Ke=new jb({mutationCb:Fe,adoptedStyleSheetCb:mr}),K=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Bb:new Hb({mirror:Xe,mutationCb:Fe,stylesheetManager:Ke,recordCrossOriginIframes:T,wrappedEmit:me});for(const B of Q||[])B.getMirror&&B.getMirror({nodeMirror:Xe,crossOriginIframeMirror:K.crossOriginIframeMirror,crossOriginIframeStyleMirror:K.crossOriginIframeStyleMirror});const ue=new qb,Ae=Gb(W,{mirror:Xe,win:window,mutationCb:B=>me({type:j.IncrementalSnapshot,data:{source:F.CanvasMutation,...B}}),recordCanvas:x,blockClass:s,blockSelector:i,unblockSelector:o,maxCanvasSize:H,sampling:y.canvas,dataURLOptions:w,errorHandler:I}),Ee=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Ub:new Wb({mutationCb:Fe,scrollCb:Cn,bypassOptions:{onMutation:V,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:Pe,dataURLOptions:w,maskAttributeFn:b,maskTextFn:C,maskInputFn:N,recordCanvas:x,inlineImages:J,sampling:y,slimDOMOptions:nt,iframeManager:K,stylesheetManager:Ke,canvasManager:Ae,keepIframeSrcFn:E,processedNodeManager:ue,ignoreCSSAttributes:P},mirror:Xe}),fe=(B=!1)=>{if(!v)return;me({type:j.Meta,data:{href:window.location.href,width:Gl(),height:Vl()}},B),Ke.reset(),Ee.init(),an.forEach(z=>z.lock());const ke=pb(document,{mirror:Xe,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskAllInputs:Pe,maskAttributeFn:b,maskInputFn:N,maskTextFn:C,slimDOM:nt,dataURLOptions:w,recordCanvas:x,inlineImages:J,onSerialize:z=>{Xl(z,Xe)&&K.addIframe(z),Jl(z,Xe)&&Ke.trackLinkElement(z),Li(z)&&Ee.addShadowRoot(z.shadowRoot,document)},onIframeLoad:(z,Ne)=>{K.attachIframe(z,Ne),z.contentWindow&&Ae.addWindow(z.contentWindow),Ee.observeAttachShadow(z)},onStylesheetLoad:(z,Ne)=>{Ke.attachLinkElement(z,Ne)},onBlockedImageLoad:(z,Ne,{width:je,height:re})=>{Fe({adds:[],removes:[],texts:[],attributes:[{id:Ne.id,attributes:{style:{width:`${je}px`,height:`${re}px`}}}]})},keepIframeSrcFn:E,ignoreCSSAttributes:P});if(!ke)return console.warn("Failed to snapshot the document");me({type:j.FullSnapshot,data:{node:ke,initialOffset:ql(window)}}),an.forEach(z=>z.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ke.adoptStyleSheets(document.adoptedStyleSheets,Xe.getId(document))};os=fe;try{const B=[],ke=Ne=>{var je;return ee($b)({onMutation:V,mutationCb:Fe,mousemoveCb:(re,As)=>me({type:j.IncrementalSnapshot,data:{source:As,positions:re}}),mouseInteractionCb:re=>me({type:j.IncrementalSnapshot,data:{source:F.MouseInteraction,...re}}),scrollCb:Cn,viewportResizeCb:re=>me({type:j.IncrementalSnapshot,data:{source:F.ViewportResize,...re}}),inputCb:re=>me({type:j.IncrementalSnapshot,data:{source:F.Input,...re}}),mediaInteractionCb:re=>me({type:j.IncrementalSnapshot,data:{source:F.MediaInteraction,...re}}),styleSheetRuleCb:re=>me({type:j.IncrementalSnapshot,data:{source:F.StyleSheetRule,...re}}),styleDeclarationCb:re=>me({type:j.IncrementalSnapshot,data:{source:F.StyleDeclaration,...re}}),canvasMutationCb:hr,fontCb:re=>me({type:j.IncrementalSnapshot,data:{source:F.Font,...re}}),selectionCb:re=>{me({type:j.IncrementalSnapshot,data:{source:F.Selection,...re}})},customElementCb:re=>{me({type:j.IncrementalSnapshot,data:{source:F.CustomElement,...re}})},blockClass:s,ignoreClass:c,ignoreSelector:a,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:Pe,inlineStylesheet:h,sampling:y,recordDOM:v,recordCanvas:x,inlineImages:J,userTriggeredOnInput:M,collectFonts:Z,doc:Ne,maskAttributeFn:b,maskInputFn:N,maskTextFn:C,keepIframeSrcFn:E,blockSelector:i,unblockSelector:o,slimDOMOptions:nt,dataURLOptions:w,mirror:Xe,iframeManager:K,stylesheetManager:Ke,shadowDomManager:Ee,processedNodeManager:ue,canvasManager:Ae,ignoreCSSAttributes:P,plugins:((je=Q==null?void 0:Q.filter(re=>re.observer))==null?void 0:je.map(re=>({observer:re.observer,options:re.options,callback:As=>me({type:j.Plugin,data:{plugin:re.name,payload:As}})})))||[]},{})};K.addLoadListener(Ne=>{try{B.push(ke(Ne.contentDocument))}catch(je){console.warn(je)}});const z=()=>{fe(),B.push(ke(document))};return document.readyState==="interactive"||document.readyState==="complete"?z():(B.push(xe("DOMContentLoaded",()=>{me({type:j.DomContentLoaded,data:{}}),k==="DOMContentLoaded"&&z()})),B.push(xe("load",()=>{me({type:j.Load,data:{}}),k==="load"&&z()},window))),()=>{B.forEach(Ne=>Ne()),ue.destroy(),os=void 0,kb()}}catch(B){console.warn(B)}}function Vb(e){if(!os)throw new Error("please take full snapshot after start recording");os(e)}Qe.mirror=Xe;Qe.takeFullSnapshot=Vb;function Gb(e,t){try{return e?e(t):new fc}catch{return console.warn("Unable to initialize CanvasManager"),new fc}}var pc;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(pc||(pc={}));const Yb=3,Kb=5;function ko(e){return e>9999999999?e:e*1e3}function Zs(e){return e>9999999999?e/1e3:e}function pr(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:j.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Je(t,10,1e3)}}),t.category==="console")))}const Xb="button,a";function sd(e){return e.closest(Xb)||e}function id(e){const t=od(e);return!t||!(t instanceof Element)?t:sd(t)}function od(e){return Jb(e)?e.target:e}function Jb(e){return typeof e=="object"&&!!e&&"target"in e}let vt;function Zb(e){return vt||(vt=[],Qb()),vt.push(e),()=>{const t=vt?vt.indexOf(e):-1;t>-1&&vt.splice(t,1)}}function Qb(){De(ce,"open",function(e){return function(...t){if(vt)try{vt.forEach(n=>n())}catch{}return e.apply(ce,t)}})}const eE=new Set([F.Mutation,F.StyleSheetRule,F.StyleDeclaration,F.AdoptedStyleSheet,F.CanvasMutation,F.Selection,F.MediaInteraction]);function tE(e,t,n){e.handleClick(t,n)}class nE{constructor(t,n,r=pr){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const t=Zb(()=>{this._lastMutation=hc()});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,n){if(sE(n,this._ignoreSelector)||!iE(t))return;const r={timestamp:Zs(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(s=>s.node===r.node&&Math.abs(s.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=Zs(t)}registerScroll(t=Date.now()){this._lastScroll=Zs(t)}registerClick(t){const n=sd(t);this._handleMultiClick(n)}_handleMultiClick(t){this._getClicks(t).forEach(n=>{n.clickCount++})}_getClicks(t){return this._clicks.filter(n=>n.node===t)}_checkClicks(){const t=[],n=hc();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&t.push(r)});for(const r of t){const s=this._clicks.indexOf(r);s>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(s,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scrollTimeout,s=t.mutationAfter&&t.mutationAfter<=this._threshold,i=!r&&!s,{clickCount:o,clickBreadcrumb:c}=t;if(i){const a=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,u=a1){const a={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.multiClick",data:{...c.data,url:ce.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(n,a)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=dr(()=>this._checkClicks(),1e3)}}const rE=["A","BUTTON","INPUT"];function sE(e,t){return!!(!rE.includes(e.tagName)||e.tagName==="INPUT"&&!["submit","button"].includes(e.getAttribute("type")||"")||e.tagName==="A"&&(e.hasAttribute("download")||e.hasAttribute("target")&&e.getAttribute("target")!=="_self")||t&&e.matches(t))}function iE(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function hc(){return Date.now()/1e3}function oE(e,t){try{if(!aE(t))return;const{source:n}=t.data;if(eE.has(n)&&e.registerMutation(t.timestamp),n===F.Scroll&&e.registerScroll(t.timestamp),cE(t)){const{type:r,id:s}=t.data,i=Qe.mirror.getNode(s);i instanceof HTMLElement&&r===Ce.Click&&e.registerClick(i)}}catch{}}function aE(e){return e.type===Yb}function cE(e){return e.data.source===F.MouseInteraction}function rt(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var Cs=(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))(Cs||{});const uE=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function lE(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(uE.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const dE=e=>t=>{if(!e.isEnabled())return;const n=fE(t);if(!n)return;const r=t.name==="click",s=r?t.event:void 0;r&&e.clickDetector&&(s!=null&&s.target)&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.shiftKey&&tE(e.clickDetector,n,id(t.event)),pr(e,n)};function ad(e,t){const n=Qe.mirror.getId(e),r=n&&Qe.mirror.getNode(n),s=r&&Qe.mirror.getMeta(r),i=s&&hE(s)?s:null;return{message:t,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(o=>o.type===Cs.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:lE(i.attributes)}}:{}}}function fE(e){const{target:t,message:n}=pE(e);return rt({category:`ui.${e.name}`,...ad(t,n)})}function pE(e){const t=e.name==="click";let n,r=null;try{r=t?id(e.event):od(e.event),n=Se(r,{maxStringLength:200})||""}catch{n=""}return{target:r,message:n}}function hE(e){return e.type===Cs.Element}function mE(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=_E(t);n&&pr(e,n)}function _E(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:o}=e;if(!o||gE(o)||!i)return null;const c=t||r||s,a=i.length===1;if(!c&&a)return null;const u=Se(o,{maxStringLength:200})||"",d=ad(o,u);return rt({category:"ui.keyDown",message:u,data:{...d.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i}})}function gE(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const yE={resource:TE,paint:EE,navigation:vE};function Qs(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function SE(e){return e.map(bE).filter(Boolean)}function bE(e){const t=yE[e.entryType];return t?t(e):null}function bn(e){return((we()||ce.performance.timeOrigin)+e)/1e3}function EE(e){const{duration:t,entryType:n,name:r,startTime:s}=e,i=bn(s);return{type:n,name:r,start:i,end:i+t,data:void 0}}function vE(e){const{entryType:t,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,domInteractive:u,loadEventStart:d,loadEventEnd:l,redirectCount:f,startTime:p,transferSize:h,type:m}=e;return s===0?null:{type:`${t}.${m}`,start:bn(p),end:bn(i),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:o,duration:s,domInteractive:u,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,loadEventStart:d,loadEventEnd:l,domComplete:i,redirectCount:f}}}function TE(e){const{entryType:t,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:o,encodedBodySize:c,responseStatus:a,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:bn(i),end:bn(s),name:r,data:{size:u,statusCode:a,decodedBodySize:o,encodedBodySize:c}}}function wE(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.element?[t.element]:void 0;return Co(e,"largest-contentful-paint",n)}function IE(e){return e.sources!==void 0}function kE(e){const t=[],n=[];for(const r of e.entries)if(IE(r)){const s=[];for(const i of r.sources)if(i.node){n.push(i.node);const o=Qe.mirror.getId(i.node);o&&s.push(o)}t.push({value:r.value,nodeIds:s.length?s:void 0})}return Co(e,"cumulative-layout-shift",n,t)}function CE(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.target?[t.target]:void 0;return Co(e,"interaction-to-next-paint",n)}function Co(e,t,n,r){const s=e.value,i=e.rating,o=bn(s);return{type:"web-vital",name:t,start:o,end:o,data:{value:s,size:s,rating:i,nodeIds:n?n.map(c=>Qe.mirror.getId(c)):void 0,attributions:r}}}function RE(e){function t(s){e.performanceEntries.includes(s)||e.performanceEntries.push(s)}function n({entries:s}){s.forEach(t)}const r=[];return["navigation","paint","resource"].forEach(s=>{r.push(gn(s,n))}),r.push(Ss(Qs(wE,e)),ys(Qs(kE,e)),mo(Qs(CE,e))),()=>{r.forEach(s=>s())}}const L=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,xE='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<>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>f]=l}else for(o=new n(i),s=0;s>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;sd&&(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<e))break;w+=m-(1<>=y;w>0;){var M=o[s].s;p[M]=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>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s4&&!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+(X15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B255){_(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>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<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;$Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;Pnt&&(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&&(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>>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;oi.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{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});';function ME(){const e=new Blob([xE]);return URL.createObjectURL(e)}const mc=["log","warn","error"],zr="[Replay] ";function ei(e,t="info"){Rt({category:"console",data:{logger:"replay"},level:t,message:`${zr}${e}`},{level:t})}function AE(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return L?(mc.forEach(r=>{n[r]=(...s)=>{S[r](zr,...s),t&&ei(s.join(""),Gu(r))}}),n.exception=(r,...s)=>{s.length&&n.error&&n.error(...s),S.error(zr,r),e?ms(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&ei(r,"error")},n.infoTick=(...r)=>{S.log(zr,...r),t&&setTimeout(()=>ei(r[0]),0)}):mc.forEach(r=>{n[r]=()=>{}}),n}const D=AE();class Ro extends Error{constructor(){super(`Event buffer exceeded maximum size of ${bo}.`)}}class cd{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(t){const n=JSON.stringify(t).length;if(this._totalSize+=n,this._totalSize>bo)throw new Ro;this.events.push(t)}finish(){return new Promise(t=>{const n=this.events;this.clear(),t(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let t=null;for(const{timestamp:n}of this.events)(t===null||n{this._worker.addEventListener("message",({data:r})=>{r.success?t():(L&&D.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{L&&D.warn("Failed to load Replay compression worker",r),n(new Error(`Failed to load Replay compression worker: ${r instanceof ErrorEvent&&r.message?r.message:"Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load."}`))},{once:!0})}),this._ensureReadyPromise)}destroy(){L&&D.log("Destroying compression worker"),this._worker.terminate()}postMessage(t,n){const r=this._getAndIncrementId();return new Promise((s,i)=>{const o=({data:c})=>{const a=c;if(a.method===t&&a.id===r){if(this._worker.removeEventListener("message",o),!a.success){L&&D.error("Error in compression worker: ",a.response),i(new Error("Error in compression worker"));return}s(a.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:r,method:t,arg:n})})}_getAndIncrementId(){return this._id++}}class LE{constructor(t){this._worker=new NE(t),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(t){const n=ko(t.timestamp);(!this._earliestTimestamp||nbo?Promise.reject(new Ro):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{L&&D.exception(t,'Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){const t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}}class DE{constructor(t){this._fallback=new cd,this._compression=new LE(t),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(t){this._used.hasCheckout=t}set waitForCheckout(t){this._used.waitForCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(t){L&&D.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:t,hasCheckout:n,waitForCheckout:r}=this._fallback,s=[];for(const i of t)s.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(s),this._fallback.clear()}catch(i){L&&D.exception(i,"Failed to add events when switching buffers.")}}}function OE({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=PE(t);if(n)return n}return L&&D.log("Using simple buffer"),new cd}function PE(e){try{const t=e||FE();if(!t)return;L&&D.log(`Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new DE(n)}catch(t){L&&D.exception(t,"Failed to create compression worker")}}function FE(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?ME():""}function xo(){try{return"sessionStorage"in ce&&!!ce.sessionStorage}catch{return!1}}function $E(e){BE(),e.session=void 0}function BE(){if(xo())try{ce.sessionStorage.removeItem(yo)}catch{}}function ud(e){return e===void 0?!1:Math.random()e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(L&&D.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function jE(e,t){try{if(typeof t=="function"&&WE(e))return t(e)}catch(n){return L&&D.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Ao(e){return!e.type}function Fi(e){return e.type==="transaction"}function qE(e){return e.type==="replay_event"}function gc(e){return e.type==="feedback"}function VE(e){return(t,n)=>{if(!e.isEnabled()||!Ao(t)&&!Fi(t))return;const r=n.statusCode;if(!(!r||r<200||r>=300)){if(Fi(t)){GE(e,t);return}YE(e,t)}}}function GE(e,t){var r,s;const n=e.getContext();(s=(r=t.contexts)==null?void 0:r.trace)!=null&&s.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function YE(e,t){var s;const n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!((s=t.tags)!=null&&s.replayId))return;const{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||dr(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(i){e.handleException(i)}})}function KE(e){return t=>{!e.isEnabled()||!Ao(t)||XE(e,t)}}function XE(e,t){var r,s,i;const n=(i=(s=(r=t.exception)==null?void 0:r.values)==null?void 0:s[0])==null?void 0:i.value;if(typeof n=="string"&&(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))){const o=rt({category:"replay.hydrate-error",data:{url:Gt()}});pr(e,o)}}function JE(e){const t=U();t&&t.on("beforeAddBreadcrumb",n=>ZE(e,n))}function ZE(e,t){if(!e.isEnabled()||!md(t))return;const n=QE(t);n&&pr(e,n)}function QE(e){return!md(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?ev(e):rt(e)}function ev(e){var s;const t=(s=e.data)==null?void 0:s.arguments;if(!Array.isArray(t)||t.length===0)return rt(e);let n=!1;const r=t.map(i=>{if(!i)return i;if(typeof i=="string")return i.length>Ir?(n=!0,`${i.slice(0,Ir)}…`):i;if(typeof i=="object")try{const o=Je(i,7);return JSON.stringify(o).length>Ir?(n=!0,`${JSON.stringify(o,null,2).slice(0,Ir)}…`):o}catch{}return i});return rt({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function md(e){return!!e.category}function tv(e,t){var n,r,s;return e.type||!((r=(n=e.exception)==null?void 0:n.values)!=null&&r.length)?!1:!!((s=t.originalException)!=null&&s.__rrweb__)}function _d(){const e=ne().getPropagationContext().dsc;e&&delete e.replay_id;const t=Ie();if(t){const n=_t(t);delete n.replay_id}}function nv(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:j.Custom,timestamp:t.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1):!0)}function rv(e,t){return e.recordingMode!=="buffer"||t.message===So||!t.exception||t.type?!1:ud(e.getOptions().errorSampleRate)}function sv(e){return Object.assign((t,n)=>{var o;if(!e.isEnabled()||e.isPaused())return t;if(qE(t))return delete t.breadcrumbs,t;if(!Ao(t)&&!Fi(t)&&!gc(t))return t;if(!e.checkAndHandleExpiredSession())return _d(),t;if(gc(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),nv(e,t),t;if(tv(t,n)&&!e.getOptions()._experiments.captureExceptions)return L&&D.log("Ignoring error from rrweb internals",t),null;const s=rv(e,t);if((s||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),s&&e.recordingMode==="buffer"&&((o=e.session)==null?void 0:o.sampled)==="buffer"){const c=e.session;c.dirty=!0,e.getOptions().stickySession&&Rs(c)}return t},{id:"Replay"})}function xs(e,t){return t.map(({type:n,start:r,end:s,name:i,data:o})=>{const c=e.throttledAddEvent({type:j.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:i,startTimestamp:r,endTimestamp:s,data:o}}});return typeof c=="string"?Promise.resolve(null):c})}function iv(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}function ov(e){return t=>{if(!e.isEnabled())return;const n=iv(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(xs(e,[n]),!1)))}}function av(e,t){return L&&e.getOptions()._experiments.traceInternals?!1:Th(t,U())}function gd(e,t){e.isEnabled()&&t!==null&&(av(e,t.name)||e.addUpdate(()=>(xs(e,[t]),!0)))}function Ms(e){if(!e)return;const t=new TextEncoder;try{if(typeof e=="string")return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){const n=xl(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function yd(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function as(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 Sd(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:i,statusCode:o,request:c,response:a}=t;return{type:e,start:n/1e3,end:r/1e3,name:s,data:{method:i,statusCode:o,request:c,response:a}}}function Yn(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function Ct(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};const r={headers:e,size:t},{body:s,warnings:i}=cv(n);return r.body=s,i!=null&&i.length&&(r._meta={warnings:i}),r}function $i(e,t){return Object.entries(e).reduce((n,[r,s])=>{const i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=s),n},{})}function cv(e){if(!e||typeof e!="string")return{body:e};const t=e.length>Ja,n=uv(e);if(t){const r=e.slice(0,Ja);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function uv(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function cs(e,t){const n=lv(e);return lt(n,t)}function lv(e,t=ce.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(ce.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function dv(e,t,n){try{const r=await pv(e,t,n),s=Sd("resource.fetch",r);gd(n.replay,s)}catch(r){L&&D.exception(r,"Failed to capture fetch breadcrumb")}}function fv(e,t){const{input:n,response:r}=t,s=n?Al(n):void 0,i=Ms(s),o=r?yd(r.headers.get("content-length")):void 0;i!==void 0&&(e.data.request_body_size=i),o!==void 0&&(e.data.response_body_size=o)}async function pv(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r}=t,{url:o,method:c,status_code:a=0,request_body_size:u,response_body_size:d}=e.data,l=cs(o,n.networkDetailAllowUrls)&&!cs(o,n.networkDetailDenyUrls),f=l?hv(n,t.input,u):Yn(u),p=await mv(l,n,t.response,d);return{startTimestamp:s,endTimestamp:i,url:o,method:c,statusCode:a,request:f,response:p}}function hv({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const s=n?yv(n,t):{};if(!e)return Ct(s,r,void 0);const i=Al(n),[o,c]=Ml(i,D),a=Ct(s,r,o);return c?as(a,c):a}async function mv(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,s){if(!e&&s!==void 0)return Yn(s);const i=r?bd(r.headers,n):{};if(!r||!t&&s!==void 0)return Ct(i,s,void 0);const[o,c]=await gv(r),a=_v(o,{networkCaptureBodies:t,responseBodySize:s,captureDetails:e,headers:i});return c?as(a,c):a}function _v(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:s}){try{const i=e!=null&&e.length&&n===void 0?Ms(e):n;return r?t?Ct(s,i,e):Ct(s,i,void 0):Yn(i)}catch(i){return L&&D.exception(i,"Failed to serialize response body"),Ct(s,n,void 0)}}async function gv(e){const t=Sv(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await bv(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(L&&D.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(L&&D.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function bd(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function yv(e,t){return e.length===1&&typeof e[0]!="string"?yc(e[0],t):e.length===2?yc(e[1],t):{}}function yc(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?bd(n,t):Array.isArray(n)?{}:$i(n,t):{}}function Sv(e){try{return e.clone()}catch(t){L&&D.exception(t,"Failed to clone response body")}}function bv(e){return new Promise((t,n)=>{const r=dr(()=>n(new Error("Timeout while trying to read response body")),500);Ev(e).then(s=>t(s),s=>n(s)).finally(()=>clearTimeout(r))})}async function Ev(e){return await e.text()}async function vv(e,t,n){try{const r=wv(e,t,n),s=Sd("resource.xhr",r);gd(n.replay,s)}catch(r){L&&D.exception(r,"Failed to capture xhr breadcrumb")}}function Tv(e,t){const{xhr:n,input:r}=t;if(!n)return;const s=Ms(r),i=n.getResponseHeader("content-length")?yd(n.getResponseHeader("content-length")):Cv(n.response,n.responseType);s!==void 0&&(e.data.request_body_size=s),i!==void 0&&(e.data.response_body_size=i)}function wv(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:o,xhr:c}=t,{url:a,method:u,status_code:d=0,request_body_size:l,response_body_size:f}=e.data;if(!a)return null;if(!c||!cs(a,n.networkDetailAllowUrls)||cs(a,n.networkDetailDenyUrls)){const A=Yn(l),y=Yn(f);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:d,request:A,response:y}}const p=c[$t],h=p?$i(p.request_headers,n.networkRequestHeaders):{},m=$i(Nl(c),n.networkResponseHeaders),[_,g]=n.networkCaptureBodies?Ml(o,D):[void 0],[b,N]=n.networkCaptureBodies?Iv(c):[void 0],C=Ct(h,l,_),H=Ct(m,f,b);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:d,request:g?as(C,g):C,response:N?as(H,N):H}}function Iv(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return kv(e.response,e.responseType)}catch(n){t.push(n)}return L&&D.warn("Failed to get xhr response body",...t),[void 0]}function kv(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&e&&typeof e=="object")return[JSON.stringify(e)];if(!e)return[void 0]}catch(n){return L&&D.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return L&&D.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Cv(e,t){try{const n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return Ms(n)}catch{return}}function Rv(e){const t=U();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o}=e.getOptions(),c={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o};t&&t.on("beforeAddBreadcrumb",(a,u)=>xv(c,a,u))}catch{}}function xv(e,t,n){if(t.data)try{Mv(t)&&Nv(n)&&(Tv(t,n),vv(t,n,e)),Av(t)&&Lv(n)&&(fv(t,n),dv(t,n,e))}catch(r){L&&D.exception(r,"Error when enriching network breadcrumb")}}function Mv(e){return e.category==="xhr"}function Av(e){return e.category==="fetch"}function Nv(e){return e==null?void 0:e.xhr}function Lv(e){return e==null?void 0:e.response}function Dv(e){const t=U();kl(dE(e)),Ts(ov(e)),JE(e),Rv(e);const n=sv(e);zp(n),t&&(t.on("beforeSendEvent",KE(e)),t.on("afterSendEvent",VE(e)),t.on("createDsc",r=>{const s=e.getSessionId();s&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=s)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,s)=>{var o;const i=e.getSessionId();s!=null&&s.includeReplay&&e.isEnabled()&&i&&((o=r.contexts)!=null&&o.feedback)&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=i)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function Ov(e){try{return Promise.all(xs(e,[Pv(ce.performance.memory)]))}catch{return[]}}function Pv(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function Fv(e,t,n){return xh(e,t,{...n,setTimeoutImpl:dr})}const Ve=G.navigator;function $v(){return/iPhone|iPad|iPod/i.test((Ve==null?void 0:Ve.userAgent)??"")||/Macintosh/i.test((Ve==null?void 0:Ve.userAgent)??"")&&(Ve!=null&&Ve.maxTouchPoints)&&(Ve==null?void 0:Ve.maxTouchPoints)>1?{sampling:{mousemove:!1}}:{}}function Bv(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){L&&D.warn("Received replay event after session expired.");return}const s=r||!t;t=!0,Hv(n),e.clickDetector&&oE(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&s&&e.setInitialState(),!Mo(e,n,s))return!0;if(!s)return!1;const i=e.session;if(Wv(e,s),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){const o=e.eventBuffer.getEarliestTimestamp();o&&(L&&D.log(`Updating session start time to earliest event in buffer to ${new Date(o)}`),i.started=o,e.getOptions().stickySession&&Rs(i))}return i!=null&&i.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function Hv(e){const t=e.data;if(!(e.type!==j.IncrementalSnapshot||!t||typeof t!="object"||!("source"in t)||t.source!==F.Mutation||!("attributes"in t)||!Array.isArray(t.attributes)))for(const n of t.attributes){const r=Qe.mirror.getNode(n.id),s=r&&Qe.mirror.getMeta(r);if((s==null?void 0:s.type)===Cs.Element)for(const[i,o]of Object.entries(n.attributes))o===null?delete s.attributes[i]:s.attributes[i]=o}}function Uv(e){const t=e.getOptions();return{type:j.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?e.eventBuffer.type==="worker":!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function Wv(e,t){var n;!t||((n=e.session)==null?void 0:n.segmentId)!==0||Mo(e,Uv(e),!1)}function zv(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function jv(e,t,n,r){return Dt(vu(e,Xi(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function qv({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)} `;if(typeof e=="string")n=`${r}${e}`;else{const i=new TextEncoder().encode(r);n=new Uint8Array(i.length+e.length),n.set(i),n.set(e,i.length)}return n}async function Vv({client:e,scope:t,replayId:n,event:r}){const s=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,i={event_id:n,integrations:s};e.emit("preprocessEvent",r,i);const o=await Cu(e.getOptions(),r,i,t,e,Me());if(!o)return null;e.emit("postprocessEvent",o,i),o.platform=o.platform||"javascript";const c=e.getSdkMetadata(),{name:a,version:u,settings:d}=(c==null?void 0:c.sdk)||{};return o.sdk={...o.sdk,name:a||"sentry.javascript.unknown",version:u||"0.0.0",settings:d},o}async function Gv({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:s,session:i}){const o=qv({recordingData:e,headers:{segment_id:n}}),{urls:c,errorIds:a,traceIds:u,initialTimestamp:d}=r,l=U(),f=ne(),p=l==null?void 0:l.getTransport(),h=l==null?void 0:l.getDsn();if(!l||!p||!h||!i.sampled)return Promise.resolve({});const m={type:vS,replay_start_timestamp:d/1e3,timestamp:s/1e3,error_ids:a,trace_ids:u,urls:c,replay_id:t,segment_id:n,replay_type:i.sampled},_=await Vv({scope:f,client:l,replayId:t,event:m});if(!_)return l.recordDroppedEvent("event_processor","replay"),L&&D.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete _.sdkProcessingMetadata;const g=jv(_,o,h,l.getOptions().tunnel);let b;try{b=await p.send(g)}catch(C){const H=new Error(So);try{H.cause=C}catch{}throw H}const N=Fu({},b);if(Pu(N,"replay"))throw new No(N);if(typeof b.statusCode=="number"&&(b.statusCode<200||b.statusCode>=300))throw new Ed(b.statusCode);return b}class Ed extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class No extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}class Sc extends Error{constructor(){super("Session is too long, not sending replay")}}async function vd(e,t={count:0,interval:RS}){const{recordingData:n,onError:r}=e;if(n.length)try{return await Gv(e),!0}catch(s){if(s instanceof Ed||s instanceof No)throw s;if(Up("Replays",{_retryCount:t.count}),r&&r(s),t.count>=xS){const i=new Error(`${So} - max retries exceeded`);try{i.cause=s}catch{}throw i}return t.interval*=++t.count,new Promise((i,o)=>{dr(async()=>{try{await vd(e,t),i(!0)}catch(c){o(c)}},t.interval)})}}const Td="__THROTTLED",Yv="__SKIPPED";function Kv(e,t,n){const r=new Map,s=c=>{const a=c-n;r.forEach((u,d)=>{d[...r.values()].reduce((c,a)=>c+a,0);let o=!1;return(...c)=>{const a=Math.floor(Date.now()/1e3);if(s(a),i()>=t){const d=o;return o=!0,d?Yv:Td}o=!1;const u=r.get(a)||0;return r.set(a,u+1),e(...c)}}class Xv{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:TS,sessionIdleExpire:wS},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=n,this._options=t,this._debouncedFlush=Fv(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=Kv((o,c)=>zE(this,o,c),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),i=r?{threshold:Math.min(MS,r),timeout:r,scrollTimeout:AS,ignoreSelector:s?s.join(","):""}:void 0;if(i&&(this.clickDetector=new nE(this,i)),L){const o=t._experiments;D.setConfig({captureExceptions:!!o.captureExceptions,traceInternals:!!o.traceInternals})}this._handleVisibilityChange=()=>{ce.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const o=rt({category:"ui.blur"});this._doChangeToBackgroundTasks(o)},this._handleWindowFocus=()=>{const o=rt({category:"ui.focus"});this._doChangeToForegroundTasks(o)},this._handleKeyboardEvent=o=>{mE(this,o)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){L&&D.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){const{errorSampleRate:n,sessionSampleRate:r}=this._options,s=n<=0&&r<=0;if(this._requiresManualStart=s,!s){if(this._initializeSessionForSampling(t),!this.session){L&&D.exception(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",L&&D.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){L&&D.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){L&&D.log("Buffering is in progress, call `flush()` to save the replay");return}L&&D.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=ti({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){L&&D.log("Buffering is in progress, call `flush()` to save the replay");return}L&&D.infoTick("Starting replay in buffer mode");const t=ti({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const t=this._canvas;this._stopRecording=Qe({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:CS}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:Bv(this),...$v(),onMutation:this._onMutationHandler.bind(this),...t?{recordCanvas:t.recordCanvas,getCanvasManager:t.getCanvasManager,sampling:t.sampling,dataURLOptions:t.dataURLOptions}:{}})}catch(t){this.handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this.handleException(t),!1}}async stop({forceFlush:t=!1,reason:n}={}){var r;if(this._isEnabled){this._isEnabled=!1,this.recordingMode="buffer";try{L&&D.log(`Stopping Replay${n?` triggered by ${n}`:""}`),_d(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),(r=this.eventBuffer)==null||r.destroy(),this.eventBuffer=null,$E(this)}catch(s){this.handleException(s)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),L&&D.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),L&&D.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();L&&D.log("Converting buffer to session"),await this.flushImmediate();const r=this.stopRecording();!t||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession()),this.startRecording())}addUpdate(t){const n=t();this.recordingMode==="buffer"||!this._isEnabled||n!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(t){var n,r;if(!(t&&((n=this.session)==null?void 0:n.sampled)===!1))return(r=this.session)==null?void 0:r.id}checkAndHandleExpiredSession(){var t;if(this._lastActivity&&Pi(this._lastActivity,this.timeouts.sessionIdlePause)&&((t=this.session)==null?void 0:t.sampled)==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${ce.location.pathname}${ce.location.hash}${ce.location.search}`,n=`${ce.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(t,n){const r=this._throttledAddEvent(t,n);if(r===Td){const s=rt({category:"replay.throttled"});this.addUpdate(()=>!Mo(this,{type:Kb,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||Ie(),n=t&&Te(t),s=(n&&te(n).data||{})[He];if(!(!n||!s||!["route","custom"].includes(s)))return te(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=OE({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_initializeSessionForSampling(t){const n=this._options.errorSampleRate>0,r=ti({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const t=this.session;return fd(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(t.id))}_addListeners(){try{ce.document.addEventListener("visibilitychange",this._handleVisibilityChange),ce.addEventListener("blur",this._handleWindowBlur),ce.addEventListener("focus",this._handleWindowFocus),ce.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(Dv(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=RE(this)}_removeListeners(){try{ce.document.removeEventListener("visibilitychange",this._handleVisibilityChange),ce.removeEventListener("blur",this._handleWindowBlur),ce.removeEventListener("focus",this._handleWindowFocus),ce.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){!this.session||dd(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(t&&this._createCustomBreadcrumb(t),this.conditionalFlush())}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){L&&D.log("Document has become active, but session has expired");return}t&&this._createCustomBreadcrumb(t)}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate(()=>{this.throttledAddEvent({type:j.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=SE(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const n=this._context.initialTimestamp/1e3;t=t.filter(r=>r.start>=n)}return Promise.all(xs(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:t,eventBuffer:n}=this;if(!t||!n||this._requiresManualStart||t.segmentId)return;const r=n.getEarliestTimestamp();r&&rthis._options.maxReplayDuration+3e4)throw new Sc;const s=this._popEventContext(),i=this.session.segmentId++;this._maybeSaveSession();const o=await this.eventBuffer.finish();await vd({replayId:t,recordingData:o,segmentId:i,eventContext:s,session:this.session,timestamp:r,onError:c=>this.handleException(c)})}catch(r){this.handleException(r),this.stop({reason:"sendReplay"});const s=U();if(s){let i;r instanceof No?i="ratelimit_backoff":r instanceof Sc?i="invalid":i="send_error",s.recordDroppedEvent(i,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){L&&D.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,s=Date.now()-n;this._debouncedFlush.cancel();const i=sthis._options.maxReplayDuration+5e3;if(i||o){L&&D.log(`Session duration (${Math.floor(s/1e3)}s) is too ${i?"short":"long"}, not sending replay.`),i&&this._debouncedFlush();return}const c=this.eventBuffer;c&&this.session.segmentId===0&&!c.hasCheckout&&L&&D.log("Flushing initial segment without checkout.");const a=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(u){this.handleException(u)}finally{this._flushLock=void 0,a&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&Rs(this.session)}_onMutationHandler(t){const{ignoreMutations:n}=this._options._experiments;if(n!=null&&n.length&&t.some(c=>{const a=zv(c.target),u=n.join(",");return a==null?void 0:a.matches(u)}))return!1;const r=t.length,s=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,o=s&&r>s;if(r>i||o){const c=rt({category:"replay.mutations",data:{count:r,limit:o}});this._createCustomBreadcrumb(c)}return o?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}function xn(e,t){return[...e,...t].join(",")}function Jv({mask:e,unmask:t,block:n,unblock:r,ignore:s}){const i=["base","iframe[srcdoc]:not([src])"],o=xn(e,[".sentry-mask","[data-sentry-mask]"]),c=xn(t,[]);return{maskTextSelector:o,unmaskTextSelector:c,blockSelector:xn(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:xn(r,[]),ignoreSelector:xn(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function Zv({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){return!r||s.unmaskTextSelector&&e.matches(s.unmaskTextSelector)?i:n.includes(t)||t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"")?i.replace(/[\S]/g,"*"):i}const bc='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Qv=["content-length","content-type","accept"],e0=Symbol.for("sentry__originalRequestBody");let Ec=!1,vc=!1;function t0(){if(typeof Request>"u"||vc)return;const e=Request;try{const t=function(n,r){const s=new e(n,r);return(r==null?void 0:r.body)!=null&&(s[e0]=r.body),s};t.prototype=e.prototype,G.Request=t,vc=!0}catch{}}const j0=e=>new n0(e);class n0{constructor({flushMinDelay:t=IS,flushMaxDelay:n=kS,minReplayDuration:r=NS,maxReplayDuration:s=Za,stickySession:i=!0,useCompression:o=!0,workerUrl:c,_experiments:a={},maskAllText:u=!0,maskAllInputs:d=!0,blockAllMedia:l=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:_=[],networkDetailDenyUrls:g=[],networkCaptureBodies:b=!0,networkRequestHeaders:N=[],networkResponseHeaders:C=[],mask:H=[],maskAttributes:A=["title","placeholder","aria-label"],unmask:y=[],block:w=[],unblock:$=[],ignore:v=[],maskFn:x,beforeAddRecordingEvent:T,beforeErrorSampling:k,onError:M,attachRawBodyFromRequest:Z=!1}={}){this.name="Replay";const J=Jv({mask:H,unmask:y,block:w,unblock:$,ignore:v});if(this._recordingOptions={maskAllInputs:d,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:x,maskInputFn:x,maskAttributeFn:(Q,E,P)=>Zv({maskAttributes:A,maskAllText:u,privacyOptions:J,key:Q,value:E,el:P}),...J,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:Q=>{try{Q.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!a.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,LS),maxReplayDuration:Math.min(s,Za),stickySession:i,useCompression:o,workerUrl:c,blockAllMedia:l,maskAllInputs:d,maskAllText:u,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:m,networkDetailAllowUrls:_,networkDetailDenyUrls:g,networkCaptureBodies:b,networkRequestHeaders:Tc(N),networkResponseHeaders:Tc(C),beforeAddRecordingEvent:T,beforeErrorSampling:k,onError:M,attachRawBodyFromRequest:Z,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${bc}`:bc,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&Kr())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Ec}set _isInitialized(t){Ec=t}afterAllSetup(t){!Kr()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&t0(),this._setup(t),this._initialize(t))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session"}):Promise.resolve()}flush(t){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(t):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(t){var n;if((n=this._replay)!=null&&n.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){var t;if((t=this._replay)!=null&&t.isEnabled())return this._replay.recordingMode}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=r0(this._initialOptions,t);this._replay=new Xv({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}function r0(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},s=jt(n.replaysSessionSampleRate),i=jt(n.replaysOnErrorSampleRate);return s==null&&i==null&&ot(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),s!=null&&(r.sessionSampleRate=s),i!=null&&(r.errorSampleRate=i),r}function Tc(e){return[...Qv,...e.map(t=>t.toLowerCase())]}function s0(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function wd(e){try{return new URL(e,X.location.origin).href}catch{return}}function i0(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Id(e){try{return new Headers(e)}catch{return}}const wc=new WeakMap,ni=new Map,kd={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function o0(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o,tracePropagationTargets:c,onRequestSpanStart:a,onRequestSpanEnd:u}={...kd,...t},d=typeof i=="function"?i:h=>!0,l=h=>c0(h,c),f={},p=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(h=>(h.type==="transaction"&&h.spans&&h.spans.forEach(m=>{if(m.op==="http.client"){const _=ni.get(m.span_id);_&&(m.timestamp=_/1e3,ni.delete(m.span_id))}}),h)),s&&hm(h=>{if(h.response){const m=wc.get(h.response);m&&h.endTimestamp&&ni.set(m,h.endTimestamp)}}),Ju(h=>{const m=rm(h,d,l,f,{propagateTraceparent:p,onRequestSpanEnd:u});if(h.response&&h.fetchData.__span&&wc.set(h.response,h.fetchData.__span),m){const _=wd(h.fetchData.url),g=_?Wt(_).host:void 0;m.setAttributes({"http.url":_?It(_):void 0,"server.address":g}),o&&Ic(m,e),a==null||a(m,{headers:h.headers})}})),r&&Rl(h=>{var _;const m=u0(h,d,l,f,p,u);m&&(o&&Ic(m,e),a==null||a(m,{headers:Id((_=h.xhr.__sentry_xhr_v3__)==null?void 0:_.request_headers)}))})}const a0=300;function Ic(e,t){const{url:n}=te(e).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(s);if(qt(t)){const i=e.end.bind(e);e.end=o=>{const c=o??_e();let a=!1;const u=()=>{a||(a=!0,setTimeout(s),i(c),clearTimeout(d))};r=u;const d=setTimeout(u,a0)}}const s=gn("resource",({entries:i})=>{i.forEach(o=>{i0(o)&&o.name.endsWith(n)&&(e.setAttributes(wl(o)),r())})})}function c0(e,t){const n=Gt();if(n){let r,s;try{r=new URL(e,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return t?lt(r.toString(),t)||i&<(r.pathname,t):i}else{const r=!!e.match(/^\/(?!\/)/);return t?lt(e,t):r}}function u0(e,t,n,r,s,i){const o=e.xhr,c=o==null?void 0:o[$t];if(!o||o.__sentry_own_request__||!c)return;const{url:a,method:u}=c,d=Ye()&&t(a);if(e.endTimestamp){const g=o.__sentry_xhr_span_id__;if(!g)return;const b=r[g];b&&(d&&c.status_code!==void 0&&(Zc(b,c.status_code),b.end(),i==null||i(b,{headers:Id(Nl(o)),error:e.error})),delete r[g]);return}const l=wd(a),f=Wt(l||a),p=It(vh(a)),h=!!Ie(),m=d&&h?gt({name:`${u} ${p}`,attributes:{url:It(a),type:"xhr","http.method":u,"http.url":l?It(l):void 0,"server.address":f==null?void 0:f.host,[he]:"auto.http.browser",[et]:"http.client",...(f==null?void 0:f.search)&&{"http.query":f==null?void 0:f.search},...(f==null?void 0:f.hash)&&{"http.fragment":f==null?void 0:f.hash}}}):new st;o.__sentry_xhr_span_id__=m.spanContext().spanId,r[o.__sentry_xhr_span_id__]=m,n(a)&&l0(o,Ye()&&h?m:void 0,s);const _=U();return _&&_.emit("beforeOutgoingRequestSpan",m,e),m}function l0(e,t,n){const{"sentry-trace":r,baggage:s,traceparent:i}=qu({span:t,propagateTraceparent:n});r&&d0(e,r,s,i)}function d0(e,t,n,r){var i;const s=(i=e.__sentry_xhr_v3__)==null?void 0:i.request_headers;if(!(s!=null&&s["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!(s!=null&&s.traceparent)&&e.setRequestHeader("traceparent",r),n){const o=s==null?void 0:s.baggage;(!o||!s0(o))&&e.setRequestHeader("baggage",n)}}catch{}}function f0(){X.document?X.document.addEventListener("visibilitychange",()=>{const e=Ie();if(!e)return;const t=Te(e);if(X.document.hidden&&t){const n="cancelled",{op:r,status:s}=te(t);We&&S.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||t.setStatus({code:ve,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):We&&S.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const p0=3600,Cd="sentry_previous_trace",h0="sentry.previous_trace";function m0(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let s=r?y0():void 0;e.on("spanStart",o=>{if(Te(o)!==o)return;const c=ne().getPropagationContext();s=_0(s,o,c),r&&g0(s)});let i=!0;n&&e.on("beforeSampling",o=>{if(!s)return;const c=ne(),a=c.getPropagationContext();if(i&&a.parentSpanId){i=!1;return}c.setPropagationContext({...a,dsc:{...a.dsc,sample_rate:String(s.sampleRate),sampled:String(Bi(s.spanContext))},sampleRand:s.sampleRand}),o.parentSampled=Bi(s.spanContext),o.parentSampleRate=s.sampleRate,o.spanAttributes={...o.spanAttributes,[Xc]:s.sampleRate}})}function _0(e,t,n){const r=te(t);function s(){var c,a;try{return Number((c=n.dsc)==null?void 0:c.sample_rate)??Number((a=r.data)==null?void 0:a[Gi])}catch{return 0}}const i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:s(),sampleRand:n.sampleRand};if(!e)return i;const o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=p0&&(We&&S.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[mf]:"previous_trace"}}),t.setAttribute(h0,`${o.traceId}-${o.spanId}-${Bi(o)?1:0}`)),i)}function g0(e){try{X.sessionStorage.setItem(Cd,JSON.stringify(e))}catch(t){We&&S.warn("Could not store previous trace in sessionStorage",t)}}function y0(){var e;try{const t=(e=X.sessionStorage)==null?void 0:e.getItem(Cd);return JSON.parse(t)}catch{return}}function Bi(e){return e.traceFlags===1}const S0="BrowserTracing",b0=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function E0(){const e=X.navigator;return e!=null&&e.userAgent?b0.test(e.userAgent):!1}const v0={...Lr,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...kd},kc=(e={})=>{"enableElementTiming"in e&&ot(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const t={name:void 0,source:void 0},n=X.document,{enableInp:r,enableLongTask:s,enableLongAnimationFrame:i,_experiments:{enableInteractions:o,enableStandaloneClsSpans:c,enableStandaloneLcpSpans:a},beforeStartSpan:u,idleTimeout:d,finalTimeout:l,childSpanTimeout:f,markBackgroundSpan:p,traceFetch:h,traceXHR:m,trackFetchStreamPerformance:_,shouldCreateSpanForRequest:g,enableHTTPTimings:b,ignoreResourceSpans:N,ignorePerformanceApiSpans:C,instrumentPageLoad:H,instrumentNavigation:A,detectRedirects:y,linkPreviousTrace:w,consistentTraceSampling:$,enableReportPageLoaded:v,onRequestSpanStart:x,onRequestSpanEnd:T}={...v0,...e},k=E0();let M,Z,J;function Q(E,P,I=!0){const V=P.op==="pageload",W=P.name,Y=u?u(P):P,de=Y.attributes||{};if(W!==Y.name&&(de[He]="custom",Y.attributes=de),!I){const ge=Yt();gt({...Y,startTime:ge}).end(ge);return}t.name=Y.name,t.source=de[He];const Pe=Iu(Y,{idleTimeout:d,finalTimeout:l,childSpanTimeout:f,disableAutoFinish:V,beforeSpanEnd:ge=>{M==null||M();const be=qt(E);$g(ge,{recordClsOnPageloadSpan:!be&&!c,recordLcpOnPageloadSpan:!be&&!a,ignoreResourceSpans:N,ignorePerformanceApiSpans:C,spanStreamingEnabled:be}),xc(E,void 0);const ze=ne(),Fe=ze.getPropagationContext();ze.setPropagationContext({...Fe,traceId:Pe.spanContext().traceId,sampled:Lt(Pe),dsc:_t(ge)}),V&&(J=void 0)},trimIdleSpanEndTimestamp:!v});V&&v&&(J=Pe),xc(E,Pe);function nt(){n&&["interactive","complete"].includes(n.readyState)&&E.emit("idleSpanEnableAutoFinish",Pe)}V&&!v&&n&&(n.addEventListener("readystatechange",()=>{nt()}),nt())}return{name:S0,setup(E){var V;if(k){We&&S.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}Uf();const P=qt(E);if(M=Ag({recordClsStandaloneSpans:P?void 0:c||!1,recordLcpStandaloneSpans:P?void 0:a||!1,client:E}),P?(ty(E),ry(E),r&&iy()):r&&Xg(),i&&G.PerformanceObserver&&((V=PerformanceObserver.supportedEntryTypes)!=null&&V.includes("long-animation-frame"))?Lg():s&&Ng(),o&&Dg(),y&&n){const W=()=>{Z=_e()};addEventListener("click",W,{capture:!0}),addEventListener("keydown",W,{capture:!0,passive:!0})}function I(){const W=Kn(E);W&&!te(W).timestamp&&(We&&S.log(`[Tracing] Finishing current active span with op: ${te(W).op}`),W.setAttribute(Bn,"cancelled"),W.end())}E.on("startNavigationSpan",(W,Y)=>{if(U()!==E)return;if(Y!=null&&Y.isRedirect){We&&S.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),Q(E,{op:"navigation.redirect",...W},!1);return}Z=void 0,I(),Me().setPropagationContext({traceId:mt(),sampleRand:Math.random(),propagationSpanId:Ye()?void 0:dt()});const de=ne();de.setPropagationContext({traceId:mt(),sampleRand:Math.random(),propagationSpanId:Ye()?void 0:dt()}),de.setSDKProcessingMetadata({normalizedRequest:void 0}),Q(E,{op:"navigation",...W,parentSpan:null,forceTransaction:!0})}),E.on("startPageLoadSpan",(W,Y={})=>{if(U()!==E)return;I();const de=Y.sentryTrace||Cc("sentry-trace")||Rc("sentry-trace"),Pe=Y.baggage||Cc("baggage")||Rc("baggage"),nt=Df(de,Pe),ge=ne();ge.setPropagationContext(nt),Ye()||(ge.getPropagationContext().propagationSpanId=dt()),ge.setSDKProcessingMetadata({normalizedRequest:co()}),Q(E,{op:"pageload",...W})}),E.on("endPageloadSpan",()=>{v&&J&&(J.setAttribute(Bn,"reportPageLoaded"),J.end())})},afterAllSetup(E){if(k)return;let P=Gt();if(w!=="off"&&m0(E,{linkPreviousTrace:w,consistentTraceSampling:$}),X.location){if(H){const I=we();T0(E,{name:X.location.pathname,startTime:I?I/1e3:void 0,attributes:{[He]:"url",[he]:"auto.pageload.browser"}})}A&&Ts(({to:I,from:V})=>{if(V===void 0&&(P==null?void 0:P.indexOf(I))!==-1){P=void 0;return}P=void 0;const W=no(I),Y=Kn(E),de=Y&&y&&I0(Y,Z);Rd(E,{name:(W==null?void 0:W.pathname)||X.location.pathname,attributes:{[He]:"url",[he]:"auto.navigation.browser"}},{url:I,isRedirect:de})})}p&&f0(),o&&w0(E,d,l,f,t),r&&ey(),o0(E,{traceFetch:h,traceXHR:m,trackFetchStreamPerformance:_,tracePropagationTargets:E.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:g,enableHTTPTimings:b,onRequestSpanStart:x,onRequestSpanEnd:T})}}};function T0(e,t,n){e.emit("startPageLoadSpan",t,n),ne().setTransactionName(t.name);const r=Kn(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function Rd(e,t,n){const{url:r,isRedirect:s}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:s}),e.emit("startNavigationSpan",t,{isRedirect:s});const i=ne();return i.setTransactionName(t.name),r&&!s&&i.setSDKProcessingMetadata({normalizedRequest:{...co(),url:r}}),Kn(e)}function Cc(e){const t=X.document,n=t==null?void 0:t.querySelector(`meta[name=${e}]`);return(n==null?void 0:n.getAttribute("content"))||void 0}function Rc(e){var r,s,i;const t=(s=(r=X.performance)==null?void 0:r.getEntriesByType)==null?void 0:s.call(r,"navigation")[0],n=(i=t==null?void 0:t.serverTiming)==null?void 0:i.find(o=>o.name===e);return n==null?void 0:n.description}function w0(e,t,n,r,s){const i=X.document;let o;const c=()=>{const a="ui.action.click",u=Kn(e);if(u){const d=te(u).op;if(["navigation","pageload"].includes(d)){We&&S.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(Bn,"interactionInterrupted"),o.end(),o=void 0),!s.name){We&&S.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=Iu({name:s.name,op:a,attributes:{[He]:s.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",c,{capture:!0})}const xd="_sentry_idleSpan";function Kn(e){return e[xd]}function xc(e,t){Oe(e,xd,t)}const Mc=1.5;function I0(e,t){const n=te(e),r=Yt(),s=n.start_timestamp;return!(r-s>Mc||t&&r-t<=Mc)}const Md=["activate","mount"],Ad=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,k0=/(?:^|[-_])(\w)/g,C0=e=>e.replace(k0,t=>t.toUpperCase()).replace(/[-_]/g,""),R0="",ri="",x0=(e,t)=>e.repeat(t),Pn=(e,t)=>{if(!e)return ri;if(e.$root===e)return R0;if(!e.$options)return ri;const n=e.$options;let r=n.name||n._componentTag||n.__name;const s=n.__file;if(!r&&s){const i=s.match(/([^/\\]+)\.vue$/);i&&(r=i[1])}return(r?`<${C0(r)}>`:ri)+(s&&t!==!1?` at ${s}`:"")},M0=e=>{if(e&&(e._isVue||e.__isVue)&&e.$parent){const t=[];let n=0;for(;e;){if(t.length>0){const s=t[t.length-1];if(s.constructor===e.constructor){n++,e=e.$parent;continue}else n>0&&(t[t.length-1]=[s,n],n=0)}t.push(e),e=e.$parent}return` found in ${t.map((s,i)=>`${(i===0?"---> ":x0(" ",5+i*2))+(Array.isArray(s)?`${Pn(s[0])}... (${s[1]} recursive calls)`:Pn(s))}`).join(` `)}`}return` (found in ${Pn(e)})`},A0=(e,t)=>{const{errorHandler:n}=e.config;e.config.errorHandler=(r,s,i)=>{var u;const o=Pn(s,!1),c=s?M0(s):"",a={componentName:o,lifecycleHook:i,trace:c};if((t==null?void 0:t.attachProps)!==!1&&s&&((u=s.$options)!=null&&u.propsData?a.propsData=s.$options.propsData:s.$props&&(a.propsData=s.$props)),setTimeout(()=>{ms(r,{captureContext:{contexts:{vue:a}},mechanism:{handled:!!n,type:"auto.function.vue.error_handler"}})}),typeof n=="function"&&e.config.errorHandler)n.call(e,r,s,i);else throw r}},Ac="ui.vue",N0={activate:["activated","deactivated"],create:["beforeCreate","created"],unmount:["beforeUnmount","unmounted"],destroy:["beforeDestroy","destroyed"],mount:["beforeMount","mounted"],update:["beforeUpdate","updated"]};function si(e,t,n){e.$_sentryRootComponentSpanTimer&&clearTimeout(e.$_sentryRootComponentSpanTimer),e.$_sentryRootComponentSpanTimer=setTimeout(()=>{var r;(r=e.$root)!=null&&r.$_sentryRootComponentSpan&&(e.$root.$_sentryRootComponentSpan.end(t),e.$root.$_sentryRootComponentSpan=void 0)},n)}function L0(e,t){function n(s){return s.replace(/^<([^\s]*)>(?: at [^\s]*)?$/,"$1")}return e.some(s=>n(t)===n(s))}const D0=(e={})=>{const t=(e.hooks||[]).concat(Md).filter((s,i,o)=>o.indexOf(s)===i),n={},r=e.timeout||2e3;for(const s of t){const i=N0[s];if(!i){Ad&&S.warn(`Unknown hook: ${s}`);continue}for(const o of i)n[o]=function(){var f;const c=this.$root===this;c&&(this.$_sentryRootComponentSpan=this.$_sentryRootComponentSpan||gt({name:"Application Render",op:`${Ac}.render`,attributes:{[he]:"auto.ui.vue"},onlyIfParent:!0}),si(this,_e(),r));const a=Pn(this,!1);if(!(c||(Array.isArray(e.trackComponents)?L0(e.trackComponents,a):e.trackComponents))){si(this,_e(),r);return}this.$_sentryComponentSpans=this.$_sentryComponentSpans||{};const d=o===i[0],l=((f=this.$root)==null?void 0:f.$_sentryRootComponentSpan)||Ie();if(d){if(l){const p=this.$_sentryComponentSpans[s];p&&p.end(),this.$_sentryComponentSpans[s]=gt({name:`Vue ${a}`,op:`${Ac}.${s}`,attributes:{[he]:"auto.ui.vue"},onlyIfParent:!0})}}else{const p=this.$_sentryComponentSpans[s];if(!p)return;p.end(),si(this,_e(),r)}}}return n},O0=G,P0={Vue:O0.Vue,attachProps:!0,attachErrorHandler:!0,tracingOptions:{hooks:Md,timeout:2e3,trackComponents:!1}},F0="Vue",$0=(e={})=>({name:F0,setup(t){const n={...P0,...t.getOptions(),...e};if(!n.Vue&&!n.app){ot(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue specific errors will not be captured. Update your `Sentry.init` call with an appropriate config option: `app` (Application Instance - Vue 3) or `Vue` (Vue Constructor - Vue 2).")});return}n.app?(Array.isArray(n.app)?n.app:[n.app]).forEach(s=>Nc(s,n)):n.Vue&&Nc(n.Vue,n)}}),Nc=(e,t)=>{var n;Ad&&((n=e._instance)==null?void 0:n.isMounted)===!0&&ot(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue app is already mounted. Make sure to call `app.mount()` after `Sentry.init()`.")}),t.attachErrorHandler&&A0(e,t),Ye(t)&&e.mixin(D0(t.tracingOptions))};function q0(e={}){const t={defaultIntegrations:[...Ol(),$0()],...e};return ju(t,"vue"),ES(t)}function B0(e,t,n){let r=!1;const s="mode"in e;e.onError(i=>ms(i,{mechanism:{handled:!1}})),e.beforeEach((i,o,...c)=>{const a=r?void 0:H0(),u={};for(const f of Object.keys(i.params))u[`url.path.parameter.${f}`]=i.params[f],u[`params.${f}`]=i.params[f];for(const f of Object.keys(i.query)){const p=i.query[f];p&&(u[`query.${f}`]=p)}let d=i.path,l="url";if(i.name&&t.routeLabel!=="path")d=i.name.toString(),l="custom";else if(i.matched.length>0){const f=i.matched.length-1;d=i.matched[f].path,l="route"}if(ne().setTransactionName(d),t.instrumentPageLoad&&a&&(te(a).data[He]!=="custom"&&(a.updateName(d),a.setAttribute(He,l)),a.setAttributes({...u,[he]:"auto.pageload.vue"}),r=!0),t.instrumentNavigation&&!a&&n({name:d,op:"navigation",attributes:{...u,[he]:"auto.navigation.vue",[He]:l}}),s){const f=c[0];typeof f=="function"&&f()}})}function H0(){const e=Ie(),t=e&&Te(e);return t&&te(t).op==="pageload"?t:void 0}function V0(e={}){if(!e.router)return kc(e);const t=kc({...e,instrumentNavigation:!1}),{router:n,instrumentNavigation:r=!0,instrumentPageLoad:s=!0,routeLabel:i="name"}=e;return{...t,afterAllSetup(o){t.afterAllSetup(o),B0(n,{routeLabel:i,instrumentNavigation:r,instrumentPageLoad:s},a=>{Rd(o,a)})}}}export{U0 as a,V0 as b,z0 as f,U as g,q0 as i,j0 as r,W0 as s};