import{r as xe,s as Lf,a as _n,E as Df}from"./index.DDkPkpRE.js";const w=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,$=globalThis,Ct="10.48.0";function Ht(){return uo($),$}function uo(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Ct,t[Ct]=t[Ct]||{}}function Er(e,t,n=$){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[Ct]=r[Ct]||{};return o[e]||(o[e]=t())}const hc=["debug","info","warn","error","log","assert","trace"],F_="Sentry Logger ",Rs={};function Wt(e){if(!("console"in $))return e();const t=$.console,n={},r=Object.keys(Rs);r.forEach(o=>{const s=Rs[o];n[o]=t[o],t[o]=s});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function $_(){gc().enabled=!0}function B_(){gc().enabled=!1}function Ff(){return gc().enabled}function U_(...e){mc("log",...e)}function H_(...e){mc("warn",...e)}function W_(...e){mc("error",...e)}function mc(e,...t){w&&Ff()&&Wt(()=>{$.console[e](`${F_}[${e}]:`,...t)})}function gc(){return w?Er("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const g={enable:$_,disable:B_,isEnabled:Ff,log:U_,warn:H_,error:W_},$f=50,bt="?",Wu=/\(error: (.*)\)/,ju=/captureMessage|captureException/;function Bf(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{const s=[],i=n.split(` `);for(let a=r;a1024&&(c=c.slice(0,1024));const u=Wu.test(c)?c.replace(Wu,"$1"):c;if(!u.includes("Error: ")){for(const d of t){const l=d(u);if(l){s.push(l);break}}if(s.length>=$f+o)break}}return z_(s.slice(o))}}function j_(e){return Array.isArray(e)?Bf(...e):e}function z_(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Ho(t).function||"")&&t.pop(),t.reverse(),ju.test(Ho(t).function||"")&&(t.pop(),ju.test(Ho(t).function||"")&&t.pop()),t.slice(0,$f).map(n=>({...n,filename:n.filename||Ho(t).filename,function:n.function||bt}))}function Ho(e){return e[e.length-1]||{}}const Wi="";function Lt(e){try{return!e||typeof e!="function"?Wi:e.name||Wi}catch{return Wi}}function Ta(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 Uf(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}function q_(e){let t=e?.startsWith("file://")?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}const ss={},zu={};function ln(e,t){ss[e]=ss[e]||[],ss[e].push(t)}function dn(e,t){if(!zu[e]){zu[e]=!0;try{t()}catch(n){w&&g.error(`Error while instrumenting ${e}`,n)}}}function et(e,t){const n=e&&ss[e];if(n)for(const r of n)try{r(t)}catch(o){w&&g.error(`Error while triggering instrumentation handler. Type: ${e} Name: ${Lt(r)} Error:`,o)}}let ji=null;function Hf(e){const t="error";ln(t,e),dn(t,G_)}function G_(){ji=$.onerror,$.onerror=function(e,t,n,r,o){return et("error",{column:r,error:o,line:n,msg:e,url:t}),ji?ji.apply(this,arguments):!1},$.onerror.__SENTRY_INSTRUMENTED__=!0}let zi=null;function Wf(e){const t="unhandledrejection";ln(t,e),dn(t,V_)}function V_(){zi=$.onunhandledrejection,$.onunhandledrejection=function(e){return et("unhandledrejection",e),zi?zi.apply(this,arguments):!0},$.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const jf=Object.prototype.toString;function yt(e){switch(jf.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Ft(e,Error)}}function Tr(e,t){return jf.call(e)===`[object ${t}]`}function zf(e){return Tr(e,"ErrorEvent")}function qu(e){return Tr(e,"DOMError")}function Y_(e){return Tr(e,"DOMException")}function ft(e){return Tr(e,"String")}function ai(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Dt(e){return e===null||ai(e)||typeof e!="object"&&typeof e!="function"}function qe(e){return Tr(e,"Object")}function ci(e){return typeof Event<"u"&&Ft(e,Event)}function J_(e){return typeof Element<"u"&&Ft(e,Element)}function K_(e){return Tr(e,"RegExp")}function fn(e){return!!(e?.then&&typeof e.then=="function")}function X_(e){return qe(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Ft(e,t){try{return e instanceof t}catch{return!1}}function qf(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function _c(e){return typeof Request<"u"&&Ft(e,Request)}const yc=$,Q_=80;function Ge(e,t={}){if(!e)return"";try{let n=e;const r=5,o=[];let s=0,i=0;const a=" > ",c=a.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||Q_;for(;n&&s++1&&i+o.length*c+u.length>=l));)o.push(u),i+=u.length,n=n.parentNode;return o.reverse().join(a)}catch{return""}}function Z_(e,t){const n=e,r=[];if(!n?.tagName)return"";if(yc.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 o=t?.length?t.filter(s=>n.getAttribute(s)).map(s=>[s,n.getAttribute(s)]):null;if(o?.length)o.forEach(s=>{r.push(`[${s[0]}="${s[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const s=n.className;if(s&&ft(s)){const i=s.split(/\s+/);for(const a of i)r.push(`.${a}`)}}for(const s of["aria-label","type","name","title","alt"]){const i=n.getAttribute(s);i&&r.push(`[${s}="${i}"]`)}return r.join("")}function Bn(){try{return yc.document.location.href}catch{return""}}function Gf(e){if(!yc.HTMLElement)return null;let t=e;const n=5;for(let r=0;r"}}function Vu(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function ey(e){const t=Object.keys(Yf(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let Wn;function lo(e){if(Wn!==void 0)return Wn?Wn(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=$;return t in n&&typeof n[t]=="function"?(Wn=n[t],Wn(e)):(Wn=null,e())}function xt(){return lo(()=>Math.random())}function fo(){return lo(()=>Date.now())}function Xr(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function qi(e,t){let n=e;const r=n.length;if(r<=150)return n;t>r&&(t=r);let o=Math.max(t-60,0);o<5&&(o=0);let s=Math.min(o+140,r);return s>r-5&&(s=r),s===r&&(o=Math.max(s-140,0)),n=n.slice(o,s),o>0&&(n=`'{snip} ${n}`),sis(e,r,n))}function ty(){const e=$;return e.crypto||e.msCrypto}let Gi;function ny(){return xt()*16}function we(e=ty()){try{if(e?.randomUUID)return lo(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Gi||(Gi="10000000100040008000"+1e11),Gi.replace(/[018]/g,t=>(t^(ny()&15)>>t/4).toString(16))}function Jf(e){return e.exception?.values?.[0]}function yn(e){const{message:t,event_id:n}=e;if(t)return t;const r=Jf(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"":n||""}function va(e,t,n){const r=e.exception=e.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type="Error")}function $t(e,t){const n=Jf(e);if(!n)return;const r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){const s={...o?.data,...t.data};n.mechanism.data=s}}function ry(e,t,n=5){if(t.lineno===void 0)return;const r=e.length,o=Math.max(Math.min(r-1,t.lineno-1),0);t.pre_context=e.slice(Math.max(0,o-n),o).map(i=>qi(i,0));const s=Math.min(r-1,o);t.context_line=qi(e[s],t.colno||0),t.post_context=e.slice(Math.min(o+1,r),o+1+n).map(i=>qi(i,0))}function Yu(e){if(oy(e))return!0;try{Se(e,"__sentry_captured__",!0)}catch{}return!1}function oy(e){try{return e.__sentry_captured__}catch{}}const Kf=1e3;function Un(){return fo()/Kf}function sy(){const{performance:e}=$;if(!e?.now||!e.timeOrigin)return Un;const t=e.timeOrigin;return()=>(t+lo(()=>e.now()))/Kf}let Ju;function he(){return(Ju??(Ju=sy()))()}let Vi=null;function iy(){const{performance:e}=$;if(!e?.now)return;const t=3e5,n=lo(()=>e.now()),r=fo(),o=e.timeOrigin;if(typeof o=="number"&&Math.abs(o+n-r)uy(n)};return e&&ar(n,e),n}function ar(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||he(),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:we()),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 cy(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),ar(e,n)}function uy(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 po(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 o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=po(r[o],t[o],n-1));return r}function Et(){return we()}function Mt(){return we().substring(16)}const Ia="_sentrySpan";function Tt(e,t){t?Se(e,Ia,t):delete e[Ia]}function cr(e){return e[Ia]}const ly=100;class ht{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:Et(),sampleRand:xt()}}clone(){const t=new ht;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,Tt(t,cr(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&&ar(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 ht?n.getScopeData():qe(n)?t:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:c,level:u,fingerprint:d=[],propagationContext:l,conversationId:f}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...c},a&&Object.keys(a).length&&(this._user=a),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,Tt(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Et(),sampleRand:xt()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const r=typeof n=="number"?n:ly;if(r<=0)return this;const o={timestamp:Un(),...t,message:t.message?Xr(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.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:cr(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=po(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=n?.event_id||we();if(!this._client)return w&&g.warn("No client configured on scope - will not capture exception!"),r;const o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){const o=r?.event_id||we();if(!this._client)return w&&g.warn("No client configured on scope - will not capture message!"),o;const s=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:s,...r,event_id:o},this),o}captureEvent(t,n){const r=t.event_id||n?.event_id||we();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(w&&g.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 dy(){return Er("defaultCurrentScope",()=>new ht)}function fy(){return Er("defaultIsolationScope",()=>new ht)}const Ku=e=>e instanceof Promise&&!e[Xf],Xf=Symbol("chained PromiseLike"),Qf=(e,t,n)=>{const r=e.then(o=>(t(o),o),o=>{throw n(o),o});return Ku(r)&&Ku(e)?r:py(e,r)},py=(e,t)=>{let n=!1;for(const r in e){if(r in t)continue;n=!0;const o=e[r];typeof o=="function"?Object.defineProperty(t,r,{value:(...s)=>o.apply(e,s),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[Xf]:!0}),t};class hy{constructor(t,n){let r;t?r=t:r=new ht;let o;n?o=n:o=new ht,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(o){throw this._popScope(),o}return fn(r)?Qf(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 ur(){const e=Ht(),t=uo(e);return t.stack=t.stack||new hy(dy(),fy())}function my(e){return ur().withScope(e)}function gy(e,t){const n=ur();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Xu(e){return ur().withScope(()=>e(ur().getIsolationScope()))}function _y(){return{withIsolationScope:Xu,withScope:my,withSetScope:gy,withSetIsolationScope:(e,t)=>Xu(t),getCurrentScope:()=>ur().getScope(),getIsolationScope:()=>ur().getIsolationScope()}}function pn(e){const t=uo(e);return t.acs?t.acs:_y()}function yy(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function Sy(e,t){const{value:n,unit:r}=yy(e)?e:{value:e,unit:void 0},o=by(n),s=r&&typeof r=="string"?{unit:r}:{};if(o)return{...o,...s};if(!t||t==="skip-undefined"&&n===void 0)return;let i="";try{i=JSON.stringify(n)??""}catch{}return{value:i,type:"string",...s}}function lr(e,t=!1){const n={};for(const[r,o]of Object.entries(e??{})){const s=Sy(o,t);s&&(n[r]=s)}return n}function Qu(e){if(!e)return 0;let t=0;for(const[n,r]of Object.entries(e)){t+=n.length*2,t+=r.type.length*2,t+=(r.unit?.length??0)*2;const o=r.value;Array.isArray(o)?t+=Zu(o[0])*o.length:Dt(o)?t+=Zu(o):t+=100}return t}function Zu(e){return typeof e=="string"?e.length*2:typeof e=="boolean"?4:typeof e=="number"?8:0}function by(e){const t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}function j(){const e=Ht();return pn(e).getCurrentScope()}function be(){const e=Ht();return pn(e).getIsolationScope()}function wn(){return Er("globalScope",()=>new ht)}function je(...e){const t=Ht(),n=pn(t);if(e.length===2){const[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function Ey(...e){const t=Ht(),n=pn(t);if(e.length===2){const[r,o]=e;return r?n.withSetIsolationScope(r,o):n.withIsolationScope(o)}return n.withIsolationScope(e[0])}function C(){return j().getClient()}function Zf(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:o}=t,s={trace_id:n,span_id:o||Mt()};return r&&(s.parent_span_id=r),s}const ie="sentry.source",ui="sentry.sample_rate",ep="sentry.previous_trace_sample_rate",ce="sentry.op",z="sentry.origin",Qr="sentry.idle_span_finish_reason",ho="sentry.measurement_unit",mo="sentry.measurement_value",Ty="sentry.release",vy="sentry.environment",Iy="sentry.segment.name",wy="sentry.segment.id",ky="sentry.sdk.name",Ry="sentry.sdk.version",Ay="user.id",Cy="user.email",xy="user.ip_address",My="user.name",wa="sentry.custom_span_name",bc="sentry.profile_id",vr="sentry.exclusive_time",Ny="http.request.method",Oy="url.full",Py="sentry.link.type",Ly="gen_ai.conversation.id",tp=0,go=1,ee=2;function np(e){if(e<400&&e>=100)return{code:go};if(e>=400&&e<500)switch(e){case 401:return{code:ee,message:"unauthenticated"};case 403:return{code:ee,message:"permission_denied"};case 404:return{code:ee,message:"not_found"};case 409:return{code:ee,message:"already_exists"};case 413:return{code:ee,message:"failed_precondition"};case 429:return{code:ee,message:"resource_exhausted"};case 499:return{code:ee,message:"cancelled"};default:return{code:ee,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:ee,message:"unimplemented"};case 503:return{code:ee,message:"unavailable"};case 504:return{code:ee,message:"deadline_exceeded"};default:return{code:ee,message:"internal_error"}}return{code:ee,message:"internal_error"}}function Zr(e,t){e.setAttribute("http.response.status_code",t);const n=np(t);n.message!=="unknown_error"&&e.setStatus(n)}const rp="_sentryScope",op="_sentryIsolationScope";function Dy(e){try{const t=$.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function Fy(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function $y(e,t,n){e&&(Se(e,op,Dy(n)),Se(e,rp,t))}function eo(e){const t=e;return{scope:t[rp],isolationScope:Fy(t[op])}}const Cs="sentry-",By=8192;function Ec(e){const t=Uy(e);if(!t)return;const n=Object.entries(t).reduce((r,[o,s])=>{if(o.startsWith(Cs)){const i=o.slice(Cs.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function sp(e){if(!e)return;const t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${Cs}${r}`]=o),n),{});return Hy(t)}function Uy(e){if(!(!e||!ft(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=el(n);return Object.entries(r).forEach(([o,s])=>{t[o]=s}),t},{}):el(e)}function el(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function Hy(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],o)=>{const s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,i=o===0?s:`${t},${s}`;return i.length>By?(w&&g.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):i},"")}const Wy=/^o(\d+)\./,jy=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function zy(e){return e==="http"||e==="https"}function It(e,t=!1){const{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${i}`}function ip(e){const t=jy.exec(e);if(!t){Wt(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,o="",s="",i="",a=""]=t.slice(1);let c="",u=a;const d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){const l=u.match(/^\d+/);l&&(u=l[0])}return ap({host:s,pass:o,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function ap(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function qy(e){if(!w)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(g.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?zy(r)?t&&isNaN(parseInt(t,10))?(g.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(g.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(g.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Gy(e){return e.match(Wy)?.[1]}function cp(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=Gy(n)),r}function up(e){const t=typeof e=="string"?ip(e):ap(e);if(!(!t||!qy(t)))return t}function Cn(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 lp=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Vy(e){if(!e)return;const t=e.match(lp);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 dp(e,t){const n=Vy(e),r=Ec(t);if(!n?.traceId)return{traceId:Et(),sampleRand:xt()};const o=Yy(n,r);r&&(r.sample_rand=o.toString());const{traceId:s,parentSpanId:i,parentSampled:a}=n;return{traceId:s,parentSpanId:i,sampled:a,dsc:r||{},sampleRand:o}}function fp(e=Et(),t=Mt(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function pp(e=Et(),t=Mt(),n){return`00-${e}-${t}-${n?"01":"00"}`}function Yy(e,t){const n=Cn(t?.sample_rand);if(n!==void 0)return n;const r=Cn(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?xt()*r:r+xt()*(1-r):xt()}function Jy(e,t){const n=cp(e);return t&&n&&t!==n?(g.log(`Won't continue trace because org IDs don't match (incoming baggage: ${t}, SDK options: ${n})`),!1):(e.getOptions().strictTraceContinuation||!1)&&(t&&!n||!t&&n)?(g.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${t}, Sentry client: ${n})`),!1):!0}const hp=0,li=1;let tl=!1;function Ky(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:s,status:i,origin:a,links:c}=F(e);return{parent_span_id:s,span_id:t,trace_id:n,data:r,op:o,status:i,origin:a,links:c}}function mp(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:F(e).parent_span_id,s=eo(e).scope,i=r?s?.getPropagationContext().propagationSpanId||Mt():t;return{parent_span_id:o,span_id:i,trace_id:n}}function gp(e){const{traceId:t,spanId:n}=e.spanContext(),r=jt(e);return fp(t,n,r)}function Xy(e){const{traceId:t,spanId:n}=e.spanContext(),r=jt(e);return pp(t,n,r)}function _p(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...o},attributes:s})=>({span_id:t,trace_id:n,sampled:r===li,attributes:s,...o}))}function yp(e){if(e?.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===li,attributes:o}))}function Nt(e){return typeof e=="number"?nl(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?nl(e.getTime()):he()}function nl(e){return e>9999999999?e/1e3:e}function F(e){if(Ep(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(bp(e)){const{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:Sp(e),start_timestamp:Nt(o),timestamp:Nt(i)||void 0,status:Tp(a),op:r[ce],origin:r[z],links:_p(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function rl(e){if(Ep(e))return e.getStreamedSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(bp(e)){const{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{name:s,span_id:t,trace_id:n,parent_span_id:Sp(e),start_timestamp:Nt(o),end_timestamp:Nt(i),is_segment:e===xs(e),status:vp(a),attributes:r,links:yp(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===xs(e)}}function Sp(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function Qy(e){return{...e,attributes:lr(e.attributes),links:e.links?.map(t=>({...t,attributes:lr(t.attributes)}))}}function bp(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Ep(e){return typeof e.getSpanJSON=="function"}function jt(e){const{traceFlags:t}=e.spanContext();return t===li}function Tp(e){if(!(!e||e.code===tp))return e.code===go?"ok":e.message||"internal_error"}function vp(e){return!e||e.code===go||e.code===tp||e.message==="cancelled"?"ok":"error"}const kn="_sentryChildSpans",ka="_sentryRootSpan";function Ip(e,t){const n=e[ka]||e;Se(t,ka,n),e[kn]?e[kn].add(t):Se(e,kn,new Set([t]))}function Zy(e,t){e[kn]&&e[kn].delete(t)}function qr(e){const t=new Set;function n(r){if(!t.has(r)&&jt(r)){t.add(r);const o=r[kn]?Array.from(r[kn]):[];for(const s of o)n(s)}}return n(e),Array.from(t)}const ye=xs;function xs(e){return e[ka]||e}function Te(){const e=Ht(),t=pn(e);return t.getActiveSpan?t.getActiveSpan():cr(j())}function Ms(){tl||(Wt(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),tl=!0)}function eS(e,t){e.updateName(t),e.setAttributes({[ie]:"custom",[wa]:t})}let ol=!1;function wp(){if(ol)return;function e(){const t=Te(),n=t&&ye(t);if(n){const r="internal_error";w&&g.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:ee,message:r})}}e.tag="sentry_tracingErrorCallback",ol=!0,Hf(e),Wf(e)}function tt(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||C()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function sl(e){g.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function to(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(nS(n)){if(is(e.description,n))return w&&sl(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?is(e.description,n.name):!0,o=n.op?e.op&&is(e.op,n.op):!0;if(r&&o)return w&&sl(e),!0}return!1}function tS(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function nS(e){return typeof e=="string"||e instanceof RegExp}const di="production",kp="_frozenDsc";function as(e,t){Se(e,kp,t)}function Rp(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||di,release:n.release,public_key:r,trace_id:e,org_id:cp(t)};return t.emit("createDsc",o),o}function Tc(e,t){const n=t.getPropagationContext();return n.dsc||Rp(n.traceId,e)}function rt(e){const t=C();if(!t)return{};const n=ye(e),r=F(n),o=r.data,s=n.spanContext().traceState,i=s?.get("sentry.sample_rate")??o[ui]??o[ep];function a(h){return(typeof i=="number"||typeof i=="string")&&(h.sample_rate=`${i}`),h}const c=n[kp];if(c)return a(c);const u=s?.get("sentry.dsc"),d=u&&Ec(u);if(d)return a(d);const l=Rp(e.spanContext().traceId,t),f=o[ie]??o["sentry.span.source"],p=r.description;return f!=="url"&&p&&(l.transaction=p),tt()&&(l.sampled=String(jt(n)),l.sample_rand=s?.get("sentry.sample_rand")??eo(n).scope?.getPropagationContext().sampleRand.toString()),a(l),t.emit("createDsc",l,n),l}function rS(e){const t=rt(e);return sp(t)}class Ke{constructor(t={}){this._traceId=t.traceId||Et(),this._spanId=t.spanId||Mt(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:hp}}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 oS(e){return Se(e,"_streamed",!0),e}function fi(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function Pe(e,t=100,n=1/0){try{return Ra("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Ap(e,t=3,n=100*1024){const r=Pe(e,t);return cS(r)>n?Ap(e,t-1,n):r}function Ra(e,t,n=1/0,r=1/0,o=uS()){const[s,i]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const a=sS(e,t);if(!a.startsWith("[object "))return a;if(t.__sentry_skip_normalization__)return t;const c=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(s(t))return"[Circular ~]";const u=t;if(u&&typeof u.toJSON=="function")try{const p=u.toJSON();return Ra("",p,c-1,r,o)}catch{}const d=Array.isArray(t)?[]:{};let l=0;const f=Yf(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]=Ra(p,h,c-1,r,o),l++}return i(t),d}function sS(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(qf(t))return Uf(t);if(X_(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Lt(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=iS(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function iS(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function aS(e){return~-encodeURI(e).split(/%..|./).length}function cS(e){return aS(JSON.stringify(e))}function uS(){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 st(e,t=[]){return[e,t]}function lS(e,t){const[n,r]=e;return[n,[...r,t]]}function xn(e,t){const n=e[1];for(const r of n){const o=r[0].type;if(t(r,o))return!0}return!1}function Aa(e,t){return xn(e,(n,r)=>t.includes(r))}function Ns(e){const t=uo($);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function dS(e){const t=uo($);return t.decodePolyfill?t.decodePolyfill(e):new TextDecoder().decode(e)}function Os(e){const[t,n]=e;let r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[Ns(r),s]:r.push(typeof s=="string"?Ns(s):s)}for(const s of n){const[i,a]=s;if(o(` ${JSON.stringify(i)} `),typeof a=="string"||a instanceof Uint8Array)o(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(Pe(a))}o(c)}}return typeof r=="string"?r:fS(r)}function fS(e){const t=e.reduce((o,s)=>o+s.length,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function pS(e){let t=typeof e=="string"?Ns(e):e;function n(i){const a=t.subarray(0,i);return t=t.subarray(i+1),a}function r(){let i=t.indexOf(10);return i<0&&(i=t.length),JSON.parse(dS(n(i)))}const o=r(),s=[];for(;t.length;){const i=r(),a=typeof i.length=="number"?i.length:void 0;s.push([i,a?n(a):r()])}return[o,s]}function hS(e){return[{type:"span"},e]}function mS(e){const t=typeof e.data=="string"?Ns(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const Cp={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 gS(e){return e in Cp}function il(e){return gS(e)?Cp[e]:e}function _o(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function xp(e,t,n,r){const o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:It(r)},...o&&{trace:o}}}function _S(e,t){if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function yS(e,t,n,r){const o=_o(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:It(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return st(s,[i])}function SS(e,t,n,r){const o=_o(n),s=e.type&&e.type!=="replay_event"?e.type:"event";_S(e,n?.sdk);const i=xp(e,o,r,t);return delete e.sdkProcessingMetadata,st(i,[[{type:s},e]])}function bS(e,t){function n(p){return!!p.trace_id&&!!p.public_key}const r=rt(e[0]),o=t?.getDsn(),s=t?.getOptions().tunnel,i={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!s&&o&&{dsn:It(o)}},{beforeSendSpan:a,ignoreSpans:c}=t?.getOptions()||{},u=c?.length?e.filter(p=>!to(F(p),c)):e,d=e.length-u.length;d&&t?.recordDroppedEvent("before_send","span",d);const l=a?p=>{const h=F(p),m=fi(a)?h:a(h);return m||(Ms(),h)}:F,f=[];for(const p of u){const h=l(p);h&&f.push(hS(h))}return st(i,f)}function ES(e){if(!w)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=F(e),{spanId:o}=e.spanContext(),s=jt(e),i=ye(e),a=i===e,c=`[Tracing] Starting ${s?"sampled":"unsampled"} ${a?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${o}`];if(r&&u.push(`parent ID: ${r}`),!a){const{op:d,description:l}=F(i);u.push(`root ID: ${i.spanContext().spanId}`),d&&u.push(`root op: ${d}`),l&&u.push(`root description: ${l}`)}g.log(`${c} ${u.join(` `)}`)}function TS(e){if(!w)return;const{description:t="< unknown name >",op:n="< unknown op >"}=F(e),{spanId:r}=e.spanContext(),s=ye(e)===e,i=`[Tracing] Finishing "${n}" ${s?"root ":""}span "${t}" with ID ${r}`;g.log(i)}function Mp(e,t,n,r=Te()){const o=r&&ye(r);o&&(w&&g.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[mo]:t,[ho]:n}))}function al(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},o=r[ho],s=r[mo];typeof o=="string"&&typeof s=="number"&&(t[n.name]={value:s,unit:o})}),t}function Ir(e){return e.getOptions().traceLifecycle==="stream"}const cl=1e3;class pi{constructor(t={}){this._traceId=t.traceId||Et(),this._spanId=t.spanId||Mt(),this._startTime=t.startTimestamp||he(),this._links=t.links,this._attributes={},this.setAttributes({[z]:"manual",[ce]: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?li:hp}}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=Nt(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(ie,"custom"),this}end(t){this._endTime||(this._endTime=Nt(t),TS(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[ce],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Tp(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[z],profile_id:this._attributes[bc],exclusive_time:this._attributes[vr],measurements:al(this._events),is_segment:this._isStandaloneSpan&&ye(this)===this||void 0,segment_id:this._isStandaloneSpan?ye(this).spanContext().spanId:void 0,links:_p(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===ye(this),status:vp(this._status),attributes:this._attributes,links:yp(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){w&&g.log("[Tracing] Adding an event to span:",t);const o=ul(n)?n:r||he(),s=ul(n)?{}:n||{},i={name:t,time:Nt(o),attributes:s};return this._events.push(i),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=C();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===ye(this)))return;if(this._isStandaloneSpan){this._sampled?IS(bS([this],t)):(w&&g.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&Ir(t)){t.emit("afterSegmentSpanEnd",this);return}const r=this._convertSpanToTransaction();r&&(eo(this).scope||j()).captureEvent(r)}_convertSpanToTransaction(){if(!ll(F(this)))return;this._name||(w&&g.warn("Transaction has no name, falling back to ``."),this._name="");const{scope:t,isolationScope:n}=eo(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const s=qr(this).filter(d=>d!==this&&!vS(d)).map(d=>F(d)).filter(ll),i=this._attributes[ie];delete this._attributes[wa],s.forEach(d=>{delete d.data[wa]});const a={contexts:{trace:Ky(this)},spans:s.length>cl?s.sort((d,l)=>d.start_timestamp-l.start_timestamp).slice(0,cl):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:rt(this)},request:r,...i&&{transaction_info:{source:i}}},c=al(this._events);return c&&Object.keys(c).length&&(w&&g.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),a.measurements=c),a}}function ul(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function ll(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function vS(e){return e instanceof pi&&e.isStandaloneSpan()}function IS(e){const t=C();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function vc(e,t,n=()=>{},r=()=>{}){let o;try{o=e()}catch(s){throw t(s),n(),s}return wS(o,t,n,r)}function wS(e,t,n,r){return fn(e)?Qf(e,o=>{n(),r(o)},o=>{t(o),n()}):(n(),r(e),e)}function kS(e,t,n){if(!tt(e))return[!1];let r,o;typeof e.tracesSampler=="function"?(o=e.tracesSampler({...t,inheritOrSampleWith:a=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):a}),r=!0):t.parentSampled!==void 0?o=t.parentSampled:typeof e.tracesSampleRate<"u"&&(o=e.tracesSampleRate,r=!0);const s=Cn(o);if(s===void 0)return w&&g.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(o)} of type ${JSON.stringify(typeof o)}.`),[!1];if(!s)return w&&g.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,s,r];const i=nPp(s)(()=>{const u=j(),d=kc(u,s),f=e.onlyIfParent&&!d?new Ke:Ic({parentSpan:d,spanArguments:r,forceTransaction:o,scope:u});return(!Lp(f)||!d)&&Tt(u,f),vc(()=>t(f),()=>{const{status:p}=F(f);f.isRecording()&&(!p||p==="ok")&&f.setStatus({code:ee,message:"internal_error"})},()=>{f.end()})}))}function Rt(e,t){const n=wr();if(n.startSpanManual)return n.startSpanManual(e,t);const r=wc(e),{forceTransaction:o,parentSpan:s,scope:i}=e,a=i?.clone();return je(a,()=>Pp(s)(()=>{const u=j(),d=kc(u,s),f=e.onlyIfParent&&!d?new Ke:Ic({parentSpan:d,spanArguments:r,forceTransaction:o,scope:u});return(!Lp(f)||!d)&&Tt(u,f),vc(()=>t(f,()=>f.end()),()=>{const{status:p}=F(f);f.isRecording()&&(!p||p==="ok")&&f.setStatus({code:ee,message:"internal_error"})})}))}function nt(e){const t=wr();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=wc(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?i=>je(e.scope,i):o!==void 0?i=>Mn(o,i):i=>i())(()=>{const i=j(),a=kc(i,o);return e.onlyIfParent&&!a?new Ke:Ic({parentSpan:a,spanArguments:n,forceTransaction:r,scope:i})})}const RS=(e,t)=>{const n=Ht(),r=pn(n);if(r.continueTrace)return r.continueTrace(e,t);const{sentryTrace:o,baggage:s}=e,i=C(),a=Ec(s);return i&&!Jy(i,a?.org_id)?Op(t):je(c=>{const u=dp(o,s);return c.setPropagationContext(u),Tt(c,void 0),t()})};function Mn(e,t){const n=wr();return n.withActiveSpan?n.withActiveSpan(e,t):je(r=>(Tt(r,e||void 0),t(r)))}function Np(e){const t=wr();return t.suppressTracing?t.suppressTracing(e):je(n=>{n.setSDKProcessingMetadata({[Ca]:!0});const r=e();return n.setSDKProcessingMetadata({[Ca]:void 0}),r})}function Op(e){const t=wr();return t.startNewTrace?t.startNewTrace(e):je(n=>(n.setPropagationContext({traceId:Et(),sampleRand:xt()}),w&&g.log(`Starting a new trace with id ${n.getPropagationContext().traceId}`),Mn(null,e)))}function Ic({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!tt()){const a=new Ke;if(n||!e){const c={sampled:"false",sample_rate:"0",transaction:t.name,...rt(a)};as(a,c)}return a}const o=C();if(CS(o,t))return Rc(r)||o?.recordDroppedEvent("ignored","span"),new Ke({dropReason:"ignored",traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});const s=be();let i;if(e&&!n)i=AS(e,r,t),Ip(e,i);else if(e){const a=rt(e),{traceId:c,spanId:u}=e.spanContext(),d=jt(e);i=dl({traceId:c,parentSpanId:u,...t},r,d),as(i,a)}else{const{traceId:a,dsc:c,parentSpanId:u,sampled:d}={...s.getPropagationContext(),...r.getPropagationContext()};i=dl({traceId:a,parentSpanId:u,...t},r,d),c&&as(i,c)}return ES(i),$y(i,r,s),i}function wc(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=Nt(e.startTime),delete r.startTime,r}return n}function wr(){const e=Ht();return pn(e)}function dl(e,t,n){const r=C(),o=r?.getOptions()||{},{name:s=""}=e,i={spanAttributes:{...e.attributes},spanName:s,parentSampled:n};r?.emit("beforeSampling",i,{decision:!1});const a=i.parentSampled??n,c=i.spanAttributes,u=t.getPropagationContext(),d=Rc(t),[l,f,p]=d?[!1]:kS(o,{name:s,parentSampled:a,attributes:c,parentSampleRate:Cn(u.dsc?.sample_rate)},u.sampleRand),h=new pi({...e,attributes:{[ie]:"custom",[ui]:f!==void 0&&p?f:void 0,...c},sampled:l});return!l&&r&&!d&&(w&&g.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",Ir(r)?"span":"transaction")),r&&r.emit("spanStart",h),h}function AS(e,t,n){const{spanId:r,traceId:o}=e.spanContext(),s=Rc(t),i=s?!1:jt(e),a=i?new pi({...n,parentSpanId:r,traceId:o,sampled:i}):new Ke({traceId:o});Ip(e,a);const c=C();return c&&(Ir(c)&&a instanceof Ke&&(e instanceof Ke&&e.dropReason?(a.dropReason=e.dropReason,c.recordDroppedEvent(e.dropReason,"span")):s||(a.dropReason="sample_rate",c.recordDroppedEvent("sample_rate","span"))),c.emit("spanStart",a),n.endTimestamp&&(c.emit("spanEnd",a),c.emit("afterSpanEnd",a))),a}function kc(e,t){if(t)return t;if(t===null)return;const n=cr(e);if(!n)return;const r=C();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?ye(n):n}function Pp(e){return e!==void 0?t=>Mn(e,t):t=>t()}function CS(e,t){const n=e?.getOptions().ignoreSpans;return!e||!Ir(e)||!n?.length?!1:to({description:t.name||"",op:t.attributes?.[ce]||t.op},n)}function Lp(e){return e instanceof Ke&&e.dropReason==="ignored"}function Rc(e){return e.getScopeData().sdkProcessingMetadata[Ca]===!0}const cs={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},xS="heartbeatFailed",MS="idleTimeout",NS="finalTimeout",OS="externalFinish";function Dp(e,t={}){const n=new Map;let r=!1,o,s=OS,i=!t.disableAutoFinish;const a=[],{idleTimeout:c=cs.idleTimeout,finalTimeout:u=cs.finalTimeout,childSpanTimeout:d=cs.childSpanTimeout,beforeSpanEnd:l,trimIdleSpanEndTimestamp:f=!0}=t,p=C();if(!p||!tt()){const b=new Ke,x={sample_rate:"0",sampled:"false",...rt(b)};return as(b,x),b}const h=j(),m=Te(),_=PS(e);_.end=new Proxy(_.end,{apply(b,x,H){if(l&&l(_),x instanceof Ke)return;const[E,...P]=H,A=E||he(),O=Nt(A),D=qr(_).filter(k=>k!==_),Z=F(_);if(!D.length||!f)return N(O),Reflect.apply(b,x,[O,...P]);const X=p.getOptions().ignoreSpans,ne=D?.reduce((k,V)=>{const ae=F(V);return!ae.timestamp||X&&to(ae,X)?k:k?Math.max(k,ae.timestamp):ae.timestamp},void 0),v=Z.start_timestamp,q=Math.min(v?v+u/1e3:1/0,Math.max(v||-1/0,Math.min(O,ne||1/0)));return N(q),Reflect.apply(b,x,[q,...P])}});function y(){o&&(clearTimeout(o),o=void 0)}function S(b){y(),o=setTimeout(()=>{!r&&n.size===0&&i&&(s=MS,_.end(b))},c)}function M(b){o=setTimeout(()=>{!r&&i&&(s=xS,_.end(b))},d)}function I(b){y(),n.set(b,!0);const x=he();M(x+d/1e3)}function L(b){if(n.has(b)&&n.delete(b),n.size===0){const x=he();S(x+c/1e3)}}function N(b){r=!0,n.clear(),a.forEach(D=>D()),Tt(h,m);const x=F(_),{start_timestamp:H}=x;if(!H)return;x.data[Qr]||_.setAttribute(Qr,s);const P=x.status;(!P||P==="unknown")&&_.setStatus({code:go}),g.log(`[Tracing] Idle span "${x.op}" finished`);const A=qr(_).filter(D=>D!==_);let O=0;A.forEach(D=>{D.isRecording()&&(D.setStatus({code:ee,message:"cancelled"}),D.end(b),w&&g.log("[Tracing] Cancelling span since span ended early",JSON.stringify(D,void 0,2)));const Z=F(D),{timestamp:X=0,start_timestamp:ne=0}=Z,v=ne<=b,q=(u+c)/1e3,k=X-ne<=q;if(w){const V=JSON.stringify(D,void 0,2);v?k||g.log("[Tracing] Discarding span since it finished after idle span final timeout",V):g.log("[Tracing] Discarding span since it happened after idle span was finished",V)}(!k||!v)&&(Zy(_,D),O++)}),O>0&&_.setAttribute("sentry.idle_span_discarded_spans",O)}return a.push(p.on("spanStart",b=>{if(r||b===_||F(b).timestamp||b instanceof pi&&b.isStandaloneSpan())return;qr(_).includes(b)&&I(b.spanContext().spanId)})),a.push(p.on("spanEnd",b=>{r||L(b.spanContext().spanId)})),a.push(p.on("idleSpanEnableAutoFinish",b=>{b===_&&(i=!0,S(),n.size&&M())})),t.disableAutoFinish||S(),setTimeout(()=>{r||(_.setStatus({code:ee,message:"deadline_exceeded"}),s=NS,_.end())},u),_}function PS(e){const t=nt(e);return Tt(j(),t),w&&g.log("[Tracing] Started span is an idle span"),t}function LS(e,t){const{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;DS(e,t),r&&BS(e,r),US(e,n),FS(e,o),$S(e,s)}function fl(e,t){const{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:d,eventProcessors:l,attachments:f,propagationContext:p,transactionName:h,span:m}=t;Br(e,"extra",n),Br(e,"tags",r),Br(e,"attributes",o),Br(e,"user",s),Br(e,"contexts",i),e.sdkProcessingMetadata=po(e.sdkProcessingMetadata,c,2),a&&(e.level=a),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 Br(e,t,n){e[t]=po(e[t],n,1)}function yo(e,t){const n=wn().getScopeData();return e&&fl(n,e.getScopeData()),t&&fl(n,t.getScopeData()),n}function DS(e,t){const{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(s).length&&(e.contexts={...s,...e.contexts}),i&&(e.level=i),a&&e.type!=="transaction"&&(e.transaction=a)}function FS(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function $S(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function BS(e,t){e.contexts={trace:mp(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:rt(t),...e.sdkProcessingMetadata};const n=ye(t),r=F(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function US(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}function HS(e,t){const n=rl(e),r=xs(e),o=rl(r),{isolationScope:s,scope:i}=eo(e),a=yo(s,i);WS(n,o,t,a),n.is_segment&&t.emit("processSegmentSpan",n),t.emit("processSpan",n);const{beforeSendSpan:c}=t.getOptions(),u=c&&fi(c)?jS(n,c):n,d=u.attributes?.[ie];return d&&Fp(u,{"sentry.span.source":d}),{...Qy(u),_segmentSpan:r}}function WS(e,t,n,r){const o=n.getSdkMetadata(),{release:s,environment:i,sendDefaultPii:a}=n.getOptions();Fp(e,{[Ty]:s,[vy]:i,[Iy]:t.name,[wy]:t.span_id,[ky]:o?.sdk?.name,[Ry]:o?.sdk?.version,...a?{[Ay]:r.user?.id,[Cy]:r.user?.email,[xy]:r.user?.ip_address,[My]:r.user?.username}:{},...r.attributes})}function jS(e,t){const n=t(e);return n||(Ms(),e)}function Fp(e,t){const n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}const Yi=0,pl=1,hl=2;function So(e){return new no(t=>{t(e)})}function Ac(e){return new no((t,n)=>{n(e)})}class no{constructor(t){this._state=Yi,this._handlers=[],this._runExecutor(t)}then(t,n){return new no((r,o)=>{this._handlers.push([!1,s=>{if(!t)r(s);else try{r(t(s))}catch(i){o(i)}},s=>{if(!n)o(s);else try{r(n(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new no((n,r)=>{let o,s;return this.then(i=>{s=!1,o=i,t&&t()},i=>{s=!0,o=i,t&&t()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===Yi)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===pl&&n[1](this._value),this._state===hl&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(s,i)=>{if(this._state===Yi){if(fn(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(pl,s)},o=s=>{n(hl,s)};try{t(r,o)}catch(s){o(s)}}}function zS(e,t,n,r=0){try{const o=xa(t,n,e,r);return fn(o)?o:So(o)}catch(o){return Ac(o)}}function xa(e,t,n,r){const o=n[r];if(!e||!o)return e;const s=o({...e},t);return w&&s===null&&g.log(`Event processor "${o.id||"?"}" dropped event`),fn(s)?s.then(i=>xa(i,t,n,r+1)):xa(s,t,n,r+1)}let mn,ml,gl,Gt;function $p(e){const t=$._sentryDebugIds,n=$._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(Gt&&r.length===ml&&o.length===gl)return Gt;ml=r.length,gl=o.length,Gt={},mn||(mn={});const s=(i,a)=>{for(const c of i){const u=a[c],d=mn?.[c];if(d&&Gt&&u)Gt[d[0]]=u,mn&&(mn[c]=[d[0],u]);else if(u){const l=e(c);for(let f=l.length-1;f>=0;f--){const h=l[f]?.filename;if(h&&Gt&&mn){Gt[h]=u,mn[c]=[h,u];break}}}}};return t&&s(r,t),n&&s(o,n),Gt}function qS(e,t){const n=$p(e);if(!n)return[];const r=[];for(const o of t){const s=q_(o);s&&n[s]&&r.push({type:"sourcemap",code_file:o,debug_id:n[s]})}return r}function Bp(e,t,n,r,o,s){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||we(),timestamp:t.timestamp||Un()},u=n.integrations||e.integrations.map(y=>y.name);GS(c,e),JS(c,u),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&VS(c,e.stackParser);const d=XS(r,n.captureContext);n.mechanism&&$t(c,n.mechanism);const l=o?o.getEventProcessors():[],f=yo(s,d),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),LS(c,f);const h=[...l,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?So(c):zS(h,c,n)).then(y=>(y&&YS(y),typeof i=="number"&&i>0?KS(y,i,a):y))}function GS(e,t){const{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||di,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);const i=e.request;i?.url&&s&&(i.url=Xr(i.url,s)),s&&e.exception?.values?.forEach(a=>{a.value&&(a.value=Xr(a.value,s))})}function VS(e,t){const n=$p(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function YS(e){const t={};if(e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?t[o.abs_path]=o.debug_id:o.filename&&(t[o.filename]=o.debug_id),delete o.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(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function JS(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function KS(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:Pe(o.data,t,n)}}))},...e.user&&{user:Pe(e.user,t,n)},...e.contexts&&{contexts:Pe(e.contexts,t,n)},...e.extra&&{extra:Pe(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Pe(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:Pe(o.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=Pe(e.contexts.flags,3,n)),r}function XS(e,t){if(!t)return e;const n=e?e.clone():new ht;return n.update(t),n}function QS(e){if(e)return ZS(e)?{captureContext:e}:tb(e)?{captureContext:e}:e}function ZS(e){return e instanceof ht||typeof e=="function"}const eb=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function tb(e){return Object.keys(e).some(t=>eb.includes(t))}function me(e,t){return j().captureException(e,QS(t))}function Cc(e,t){const n=typeof t=="string"?t:void 0,r=typeof t!="string"?{captureContext:t}:void 0;return j().captureMessage(e,n,r)}function kr(e,t){return j().captureEvent(e,t)}function xc(e,t){be().setContext(e,t)}function nb(e){be().setExtras(e)}function rb(e,t){be().setExtra(e,t)}function ob(e){be().setTags(e)}function sb(e,t){be().setTag(e,t)}function ib(e){be().setUser(e)}function ab(e){be().setConversationId(e)}function Up(){return be().lastEventId()}async function cb(e){const t=C();return t?t.flush(e):(w&&g.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function ub(e){const t=C();return t?t.close(e):(w&&g.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function lb(){return!!C()}function Hp(){const e=C();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Mc(e){be().addEventProcessor(e)}function Ma(e){const t=be(),{user:n}=yo(t,j()),{userAgent:r}=$.navigator||{},o=ay({user:n,...r&&{userAgent:r},...e}),s=t.getSession();return s?.status==="ok"&&ar(s,{status:"exited"}),Nc(),t.setSession(o),o}function Nc(){const e=be(),n=j().getSession()||e.getSession();n&&cy(n),Wp(),e.setSession()}function Wp(){const e=be(),t=C(),n=e.getSession();n&&t&&t.captureSession(n)}function us(e=!1){if(e){Nc();return}Wp()}const db="7";function jp(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function fb(e){return`${jp(e)}${e.projectId}/envelope/`}function pb(e,t){const n={sentry_version:db};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function zp(e,t,n){return t||`${fb(e)}?${pb(e,n)}`}function hb(e,t){const n=up(e);if(!n)return"";const r=`${jp(n)}embed/error-page/`;let o=`dsn=${It(n)}`;for(const s in t)if(s!=="dsn"&&s!=="onClose")if(s==="user"){const i=t.user;if(!i)continue;i.name&&(o+=`&name=${encodeURIComponent(i.name)}`),i.email&&(o+=`&email=${encodeURIComponent(i.email)}`)}else o+=`&${encodeURIComponent(s)}=${encodeURIComponent(t[s])}`;return`${r}?${o}`}const _l=[];function mb(e){const t={};return e.forEach(n=>{const{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function gb(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return mb(r)}function _b(e,t){const n={};return t.forEach(r=>{r?.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&qp(e,r,n)}),n}function yl(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function qp(e,t,n){if(n[t.name]){w&&g.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!_l.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),_l.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",(o,s)=>r(o,s,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),o=Object.assign((s,i)=>r(s,i,e),{id:t.name});e.addEventProcessor(o)}w&&g.log(`Integration installed: ${t.name}`)}function Ps(e){const t=C();if(!t){w&&g.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}const yb="sentry.timestamp.sequence";let Ji=0,Ki;function Gp(e){const t=Math.floor(e*1e3);Ki!==void 0&&t!==Ki&&(Ji=0);const n=Ji;return Ji++,Ki=t,{key:yb,value:{value:n,type:"integer"}}}function Vp(e,t){return t?je(t,()=>{const n=Te(),r=n?mp(n):Zf(t);return[n?rt(n):Tc(e,t),r]}):[void 0,void 0]}const Sb={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function bb(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function Eb(e,t,n,r){const o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=It(r)),st(o,[bb(e)])}const Tb=100;function gt(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function vb(e,t){const n=Oc(),r=Yp(e);r===void 0?n.set(e,[t]):r.length>=Tb?(Ds(e,r),n.set(e,[t])):n.set(e,[...r,t])}function Ls(e,t=j(),n=vb){const r=t?.getClient()??C();if(!r){w&&g.warn("No client available to capture log.");return}const{release:o,environment:s,enableLogs:i=!1,beforeSendLog:a}=r.getOptions();if(!i){w&&g.warn("logging option not enabled, log will not be captured.");return}const[,c]=Vp(r,t),u={...e.attributes},{user:{id:d,email:l,username:f},attributes:p={}}=yo(be(),t);gt(u,"user.id",d,!1),gt(u,"user.email",l,!1),gt(u,"user.name",f,!1),gt(u,"sentry.release",o),gt(u,"sentry.environment",s);const{name:h,version:m}=r.getSdkMetadata()?.sdk??{};gt(u,"sentry.sdk.name",h),gt(u,"sentry.sdk.version",m);const _=r.getIntegrationByName("Replay"),y=_?.getReplayId(!0);gt(u,"sentry.replay_id",y),y&&_?.getRecordingMode()==="buffer"&>(u,"sentry._internal.replay_is_buffering",!0);const S=e.message;if(ai(S)){const{__sentry_template_string__:O,__sentry_template_values__:D=[]}=S;D?.length&&(u["sentry.message.template"]=O),D.forEach((Z,X)=>{u[`sentry.message.parameter.${X}`]=Z})}const M=cr(t);gt(u,"sentry.trace.parent_span_id",M?.spanContext().spanId);const I={...e,attributes:u};r.emit("beforeCaptureLog",I);const L=a?Wt(()=>a(I)):I;if(!L){r.recordDroppedEvent("before_send","log_item",1),w&&g.warn("beforeSendLog returned null, log will not be captured.");return}const{level:N,message:b,attributes:x={},severityNumber:H}=L,E=he(),P=Gp(E),A={timestamp:E,level:N,body:b,trace_id:c?.trace_id,severity_number:H??Sb[N],attributes:{...lr(p),...lr(x,!0),[P.key]:P.value}};n(r,A),r.emit("afterCaptureLog",L)}function Ds(e,t){const n=t??Yp(e)??[];if(n.length===0)return;const r=e.getOptions(),o=Eb(n,r._metadata,r.tunnel,e.getDsn());Oc().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function Yp(e){return Oc().get(e)}function Oc(){return Er("clientToLogBufferMap",()=>new WeakMap)}function Ib(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function wb(e,t,n,r){const o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=It(r)),st(o,[Ib(e)])}const kb=1e3;function wt(e,t,n,r=!0){n&&(r||!(t in e))&&(e[t]=n)}function Rb(e,t){const n=Lc(),r=Jp(e);r===void 0?n.set(e,[t]):r.length>=kb?(Pc(e,r),n.set(e,[t])):n.set(e,[...r,t])}function Ab(e,t,n){const{release:r,environment:o}=t.getOptions(),s={...e.attributes};wt(s,"user.id",n.id,!1),wt(s,"user.email",n.email,!1),wt(s,"user.name",n.username,!1),wt(s,"sentry.release",r),wt(s,"sentry.environment",o);const{name:i,version:a}=t.getSdkMetadata()?.sdk??{};wt(s,"sentry.sdk.name",i),wt(s,"sentry.sdk.version",a);const c=t.getIntegrationByName("Replay"),u=c?.getReplayId(!0);return wt(s,"sentry.replay_id",u),u&&c?.getRecordingMode()==="buffer"&&wt(s,"sentry._internal.replay_is_buffering",!0),{...e,attributes:s}}function Cb(e,t,n,r){const[,o]=Vp(t,n),s=cr(n),i=s?s.spanContext().traceId:o?.trace_id,a=s?s.spanContext().spanId:void 0,c=he(),u=Gp(c);return{timestamp:c,trace_id:i??"",span_id:a,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...lr(r),...lr(e.attributes,"skip-undefined"),[u.key]:u.value}}}function xb(e,t){const n=t?.scope??j(),r=t?.captureSerializedMetric??Rb,o=n?.getClient()??C();if(!o){w&&g.warn("No client available to capture metric.");return}const{_experiments:s,enableMetrics:i,beforeSendMetric:a}=o.getOptions();if(!(i??s?.enableMetrics??!0)){w&&g.warn("metrics option not enabled, metric will not be captured.");return}const{user:u,attributes:d}=yo(be(),n),l=Ab(e,o,u);o.emit("processMetric",l);const f=a||s?.beforeSendMetric,p=f?f(l):l;if(!p){w&&g.log("`beforeSendMetric` returned `null`, will not send metric.");return}const h=Cb(p,o,n,d);w&&g.log("[Metric]",h),r(o,h),o.emit("afterCaptureMetric",p)}function Pc(e,t){const n=t??Jp(e)??[];if(n.length===0)return;const r=e.getOptions(),o=wb(n,r._metadata,r.tunnel,e.getDsn());Lc().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function Jp(e){return Lc().get(e)}function Lc(){return Er("clientToMetricBufferMap",()=>new WeakMap)}function hi(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const Dc=Symbol.for("SentryBufferFullError");function Fc(e=100){const t=new Set;function n(){return t.sizer(a),()=>r(a)),a}function s(i){if(!t.size)return So(!0);const a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!i)return a;const c=[a,new Promise(u=>hi(setTimeout(()=>u(!1),i)))];return Promise.race(c)}return{get $(){return Array.from(t)},add:o,drain:s}}const Mb=60*1e3;function Kp(e,t=fo()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?Mb:r-t}function Nb(e,t){return e[t]||e.all||0}function Xp(e,t,n=fo()){return Nb(e,t)>n}function Qp(e,{statusCode:t,headers:n},r=fo()){const o={...e},s=n?.["x-sentry-rate-limits"],i=n?.["retry-after"];if(s)for(const a of s.trim().split(",")){const[c,u,,,d]=a.split(":",5),l=parseInt(c,10),f=(isNaN(l)?60:l)*1e3;if(!u)o.all=r+f;else for(const p of u.split(";"))p==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(o[p]=r+f):o[p]=r+f}else i?o.all=r+Kp(i,r):t===429&&(o.all=r+60*1e3);return o}const Zp=64;function eh(e,t,n=Fc(e.bufferSize||Zp)){let r={};const o=i=>n.drain(i);function s(i){const a=[];if(xn(i,(l,f)=>{const p=il(f);Xp(r,p)?e.recordDroppedEvent("ratelimit_backoff",p):a.push(l)}),a.length===0)return Promise.resolve({});const c=st(i[0],a),u=l=>{if(Aa(c,["client_report"])){w&&g.warn(`Dropping client report. Will not send outcomes (reason: ${l}).`);return}xn(c,(f,p)=>{e.recordDroppedEvent(l,il(p))})},d=()=>t({body:Os(c)}).then(l=>l.statusCode===413?(w&&g.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),l):(w&&l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&g.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=Qp(r,l),l),l=>{throw u("network_error"),w&&g.error("Encountered error running transport request:",l),l});return n.add(d).then(l=>l,l=>{if(l===Dc)return w&&g.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:s,flush:o}}function Ob(e,t,n){const r=[{type:"client_report"},{timestamp:Un(),discarded_events:e}];return st(t?{dsn:t}:{},[r])}function th(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function Pb(e){const{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=e.contexts?.trace??{};return{data:i??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:i?.[bc],exclusive_time:i?.[vr],measurements:e.measurements,is_segment:!0}}function Lb(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&&{[bc]:e.profile_id},...e.exclusive_time&&{[vr]:e.exclusive_time}}}},measurements:e.measurements}}const Sl="Not capturing exception because it's already been captured.",bl="Discarded session because of missing or non-string release",nh=Symbol.for("SentryInternalError"),rh=Symbol.for("SentryDoNotSendEventError"),Db=5e3;function ls(e){return{message:e,[nh]:!0}}function Xi(e){return{message:e,[rh]:!0}}function El(e){return!!e&&typeof e=="object"&&nh in e}function Tl(e){return!!e&&typeof e=="object"&&rh in e}function vl(e,t,n,r,o){let s=0,i,a=!1;e.on(n,()=>{s=0,clearTimeout(i),a=!1}),e.on(t,c=>{s+=r(c),s>=8e5?o(e):a||(a=!0,i=hi(setTimeout(()=>{o(e)},Db)))}),e.on("flush",()=>{o(e)})}class Fb{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Fc(t.transportOptions?.bufferSize??Zp),t.dsn?this._dsn=up(t.dsn):w&&g.warn("No DSN provided, client will not send events."),this._dsn){const r=zp(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:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&vl(this,"afterCaptureLog","flushLogs",Hb,Ds),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&vl(this,"afterCaptureMetric","flushMetrics",Ub,Pc)}captureException(t,n,r){const o=we();if(Yu(t))return w&&g.log(Sl),o;const s={event_id:o,...n};return this._process(()=>this.eventFromException(t,s).then(i=>this._captureEvent(i,s,r)).then(i=>i),"error"),s.event_id}captureMessage(t,n,r,o){const s={event_id:we(),...r},i=ai(t)?t:String(t),a=Dt(t),c=a?this.eventFromMessage(i,n,s):this.eventFromException(t,s);return this._process(()=>c.then(u=>this._captureEvent(u,s,o)),a?"unknown":"error"),s.event_id}captureEvent(t,n,r){const o=we();if(n?.originalException&&Yu(n.originalException))return w&&g.log(Sl),o;const s={event_id:o,...n},i=t.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope,u=Il(t.type);return this._process(()=>this._captureEvent(t,s,a||r,c),u),s.event_id}captureSession(t){this.sendSession(t),ar(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),o=await n.flush(t);return r&&o}async close(t){Ds(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),qp(this,t,this._integrations),n||yl(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=SS(t,this._dsn,this._options._metadata,this._options.tunnel);for(const o of n.attachments||[])r=lS(r,mS(o));this.sendEnvelope(r).then(o=>this.emit("afterSendEvent",t,o))}sendSession(t){const{release:n,environment:r=di}=this._options;if("aggregates"in t){const s=t.attrs||{};if(!s.release&&!n){w&&g.warn(bl);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){w&&g.warn(bl);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const o=yS(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const o=`${t}:${n}`;w&&g.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,o=(...s)=>n(...s);return r.add(o),()=>{r.delete(o)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return w&&g.error("Error while sending envelope:",n),{}}return w&&g.error("Transport disabled"),{}}dispose(){}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=_b(this,t),yl(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",o=!1;const s=n.exception?.values;if(s){o=!0,r=!1;for(const c of s)if(c.mechanism?.handled===!1){r=!0;break}}const i=t.status==="ok";(i&&t.errors===0||i&&r)&&(ar(t,{...r&&{status:"crashed"},errors:t.errors||Number(o||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,o){const s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i?.length&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),Bp(s,t,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...a.contexts?.trace,...Zf(r)},...a.contexts};const c=Tc(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=j(),o=be()){return w&&Na(t)&&g.log(`Captured error event \`${th(t)[0]||""}\``),this._processEvent(t,n,r,o).then(s=>s.event_id,s=>{w&&(Tl(s)?g.log(s.message):El(s)?g.warn(s.message):g.warn(s))})}_processEvent(t,n,r,o){const s=this.getOptions(),{sampleRate:i}=s,a=oh(t),c=Na(t),d=`before send for type \`${t.type||"error"}\``,l=typeof i>"u"?void 0:Cn(i);if(c&&typeof l=="number"&&xt()>l)return this.recordDroppedEvent("sample_rate","error"),Ac(Xi(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));const f=Il(t.type);return this._prepareEvent(t,n,r,o).then(p=>{if(p===null)throw this.recordDroppedEvent("event_processor",f),Xi("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return p;const m=Bb(this,s,p,n);return $b(m,d)}).then(p=>{if(p===null){if(this.recordDroppedEvent("before_send",f),a){const y=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",y)}throw Xi(`${d} returned \`null\`, will not send event.`)}const h=r.getSession()||o.getSession();if(c&&h&&this._updateSessionFromEvent(h,p),a){const _=p.sdkProcessingMetadata?.spanCountBeforeProcessing||0,y=p.spans?p.spans.length:0,S=_-y;S>0&&this.recordDroppedEvent("before_send","span",S)}const m=p.transaction_info;if(a&&m&&p.transaction!==t.transaction){const _="custom";p.transaction_info={...m,source:_}}return this.sendEvent(p,n),p}).then(null,p=>{throw Tl(p)||El(p)?p:(this.captureException(p,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:p}),ls(`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===Dc&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){w&&g.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){w&&g.log("No outcomes to send");return}if(!this._dsn){w&&g.log("No dsn provided, will not send outcomes");return}w&&g.log("Sending outcomes:",t);const n=Ob(t,this._options.tunnel&&It(this._dsn));this.sendEnvelope(n)}}function Il(e){return e==="replay_event"?"replay":e||"error"}function $b(e,t){const n=`${t} must return \`null\` or a valid event.`;if(fn(e))return e.then(r=>{if(!qe(r)&&r!==null)throw ls(n);return r},r=>{throw ls(`${t} rejected with ${r}`)});if(!qe(e)&&e!==null)throw ls(n);return e}function Bb(e,t,n,r){const{beforeSend:o,beforeSendTransaction:s,ignoreSpans:i}=t,a=!fi(t.beforeSendSpan)&&t.beforeSendSpan;let c=n;if(Na(c)&&o)return o(c,r);if(oh(c)){if(a||i){const u=Pb(c);if(i?.length&&to(u,i))return null;if(a){const d=a(u);d?c=po(n,Lb(d)):Ms()}if(c.spans){const d=[],l=c.spans;for(const p of l){if(i?.length&&to(p,i)){tS(l,p);continue}if(a){const h=a(p);h?d.push(h):(Ms(),d.push(p))}else d.push(p)}const f=c.spans.length-d.length;f&&e.recordDroppedEvent("before_send","span",f),c.spans=d}}if(s){if(c.spans){const u=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return s(c,r)}}return c}function Na(e){return e.type===void 0}function oh(e){return e.type==="transaction"}function Ub(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+sh(e.attributes)}function Hb(e){let t=0;return e.message&&(t+=e.message.length*2),t+sh(e.attributes)}function sh(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*wl(n[0]):Dt(n)?t+=wl(n):t+=100}),t}function wl(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function Wb(e){return yt(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function kl(e){return Wb(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function jb(e,t){t.debug===!0&&(w?g.enable():Wt(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),j().update(t.initialScope);const r=new e(t);return ih(r),r.init(),r}function ih(e){j().setClient(e)}const Qi=100,Zi=5e3,zb=36e5;function qb(e){function t(...n){w&&g.log("[Offline]:",...n)}return n=>{const r=e(n);if(!n.createStore)throw new Error("No `createStore` function was provided");const o=n.createStore(n);let s=Zi,i;function a(l,f,p){return Aa(l,["client_report"])?!1:n.shouldStore?n.shouldStore(l,f,p):!0}function c(l){i&&clearTimeout(i),i=hi(setTimeout(async()=>{i=void 0;const f=await o.shift();f&&(t("Attempting to send previously queued event"),f[0].sent_at=new Date().toISOString(),d(f,!0).catch(p=>{t("Failed to retry sending",p)}))},l))}function u(){i||(c(s),s=Math.min(s*2,zb))}async function d(l,f=!1){if(!f&&Aa(l,["replay_event","replay_recording"]))return await o.push(l),c(Qi),{};try{if(n.shouldSend&&await n.shouldSend(l)===!1)throw new Error("Envelope not sent because `shouldSend` callback returned false");const p=await r.send(l);let h=Qi;if(p){if(p.headers?.["retry-after"])h=Kp(p.headers["retry-after"]);else if(p.headers?.["x-sentry-rate-limits"])h=6e4;else if((p.statusCode||0)>=400)return p}return c(h),s=Zi,p}catch(p){if(await a(l,p,s))return f?await o.unshift(l):await o.push(l),u(),t("Error sending. Event queued.",p),{};throw p}}return n.flushAtStartup&&u(),{send:d,flush:l=>(l===void 0&&(s=Zi,c(Qi)),r.flush(l))}}}const ds="MULTIPLEXED_TRANSPORT_EXTRA_KEY";function ah(e,t){let n;return xn(e,(r,o)=>(t.includes(o)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function Gb(e,t){return n=>{const r=e(n);return{...r,send:async o=>{const s=ah(o,["event","transaction","profile","replay_event"]);return s&&(s.release=t),r.send(o)}}}}function Vb(e,t){return st(t?{...e[0],dsn:t}:e[0],e[1])}function Yb(e,t){return n=>{const r=e(n),o=new Map,s=t||(u=>{const d=u.getEvent();return d?.extra?.[ds]&&Array.isArray(d.extra[ds])?d.extra[ds]:[]});function i(u,d){const l=d?`${u}:${d}`:u;let f=o.get(l);if(!f){const p=ip(u);if(!p)return;const h=zp(p,n.tunnel);f=d?Gb(e,d)({...n,url:h}):e({...n,url:h}),o.set(l,f)}return[u,f]}async function a(u){function d(h){const m=h?.length?h:["event"];return ah(u,m)}const l=s({envelope:u,getEvent:d}).map(h=>typeof h=="string"?i(h,void 0):i(h.dsn,h.release)).filter(h=>!!h),f=l.length?l:[["",r]];return(await Promise.all(f.map(([h,m])=>m.send(Vb(u,h)))))[0]}async function c(u){const d=[...o.values(),r];return(await Promise.all(d.map(f=>f.flush(u)))).every(f=>f)}return{send:a,flush:c}}}const Jb="thismessage:/";function $c(e){return"isRelative"in e}function Bc(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?Jb:void 0;try{if("canParse"in URL&&!URL.canParse(e,r))return;const o=new URL(e,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function Kb(e){if($c(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 Rn(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 ch(e){return e.split(/[?#]/,1)[0]}function Xt(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),s=e.indexOf(",");let i="";if(t&&s!==-1){const a=e.slice(s+1);i=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${o?",base64":""}${i?`,${i}`:""}`}return e}function uh(e,t){const n=t?.getDsn(),r=t?.getOptions().tunnel;return Qb(e,n)||Xb(e,r)}function Xb(e,t){return t?Rl(e)===Rl(t):!1}function Qb(e,t){const n=Bc(e);return!n||$c(n)?!1:t?n.host.includes(t.host)&&/(^|&|\?)sentry_key=/.test(n.search):!1}function Rl(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function lh(e,...t){const n=new String(String.raw(e,...t));return n.__sentry_template_string__=e.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=t,n}const Zb=lh;function eE(e){"aggregates"in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function dh(e,t,n=[t],r="npm"){const o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(s=>({name:`${r}:@sentry/${s}`,version:Ct})),o.version=Ct)}function Uc(e={}){const t=e.client||C();if(!Hp()||!t)return{};const n=Ht(),r=pn(n);if(r.getTraceData)return r.getTraceData(e);const o=e.scope||j(),s=e.span||Te(),i=s?gp(s):tE(o),a=s?rt(s):Tc(t,o),c=sp(a);if(!lp.test(i))return g.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const d={"sentry-trace":i,baggage:c};return e.propagateTraceparent&&(d.traceparent=s?Xy(s):nE(o)),d}function tE(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return fp(t,r,n)}function nE(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return pp(t,r,n)}function rE(e,t,n){let r,o,s;const i=n?.maxWait?Math.max(n.maxWait,t):0,a=n?.setTimeoutImpl||setTimeout;function c(){return u(),r=e(),r}function u(){o!==void 0&&clearTimeout(o),s!==void 0&&clearTimeout(s),o=s=void 0}function d(){return o!==void 0||s!==void 0?c():r}function l(){return o&&clearTimeout(o),o=a(c,t),i&&s===void 0&&(s=a(c,i)),r}return l.cancel=u,l.flush=d,l}const oE=100;function mt(e,t){const n=C(),r=be();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:s=oE}=n.getOptions();if(s<=0)return;const a={timestamp:Un(),...e},c=o?Wt(()=>o(a,t)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,t),r.addBreadcrumb(c,s))}let Al;const sE="FunctionToString",Cl=new WeakMap,iE=()=>({name:sE,setupOnce(){Al=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Sc(this),n=Cl.has(C())&&t!==void 0?t:this;return Al.apply(n,e)}}catch{}},setup(e){Cl.set(e,!0)}}),fh=iE,aE=[/^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$/],cE="EventFilters",ph=(e={})=>{let t;return{name:cE,setup(n){const r=n.getOptions();t=xl(e,r)},processEvent(n,r,o){if(!t){const s=o.getOptions();t=xl(e,s)}return uE(n,t)?null:n}}},hh=(e={})=>({...ph(e),name:"InboundFilters"});function xl(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:aE],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function uE(e,t){if(e.type){if(e.type==="transaction"&&dE(e,t.ignoreTransactions))return w&&g.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. Event: ${yn(e)}`),!0}else{if(lE(e,t.ignoreErrors))return w&&g.warn(`Event dropped due to being matched by \`ignoreErrors\` option. Event: ${yn(e)}`),!0;if(mE(e))return w&&g.warn(`Event dropped due to not having an error message, error type or stacktrace. Event: ${yn(e)}`),!0;if(fE(e,t.denyUrls))return w&&g.warn(`Event dropped due to being matched by \`denyUrls\` option. Event: ${yn(e)}. Url: ${Fs(e)}`),!0;if(!pE(e,t.allowUrls))return w&&g.warn(`Event dropped due to not being matched by \`allowUrls\` option. Event: ${yn(e)}. Url: ${Fs(e)}`),!0}return!1}function lE(e,t){return t?.length?th(e).some(n=>pt(n,t)):!1}function dE(e,t){if(!t?.length)return!1;const n=e.transaction;return n?pt(n,t):!1}function fE(e,t){if(!t?.length)return!1;const n=Fs(e);return n?pt(n,t):!1}function pE(e,t){if(!t?.length)return!0;const n=Fs(e);return n?pt(n,t):!0}function hE(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 Fs(e){try{const n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?hE(n):null}catch{return w&&g.error(`Cannot extract url for event ${yn(e)}`),null}}function mE(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function gE(e,t,n,r,o,s){if(!o.exception?.values||!s||!Ft(s.originalException,Error))return;const i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=Oa(e,t,r,s.originalException,n,o.exception.values,i,0))}function Oa(e,t,n,r,o,s,i,a){if(s.length>=n+1)return s;let c=[...s];if(Ft(r[o],Error)){Ml(i,a,r);const u=e(t,r[o]),d=c.length;Nl(u,o,d,a),c=Oa(e,t,n,r[o],o,[u,...c],u,d)}return mh(r)&&r.errors.forEach((u,d)=>{if(Ft(u,Error)){Ml(i,a,r);const l=e(t,u),f=c.length;Nl(l,`errors[${d}]`,f,a),c=Oa(e,t,n,u,o,[l,...c],l,f)}}),c}function mh(e){return Array.isArray(e.errors)}function Ml(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...mh(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Nl(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}const gh=new Map,Ol=new Set;function _E(e){if($._sentryModuleMetadata)for(const t of Object.keys($._sentryModuleMetadata)){const n=$._sentryModuleMetadata[t];if(Ol.has(t))continue;Ol.add(t);const r=e(t);for(const o of r.reverse())if(o.filename){gh.set(o.filename,n);break}}}function yE(e,t){return _E(e),gh.get(t)}function _h(e,t){t.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(r=>{if(!r.filename||r.module_metadata)return;const o=yE(e,r.filename);o&&(r.module_metadata=o)})})}function yh(e){e.exception?.values?.forEach(t=>{t.stacktrace?.frames?.forEach(n=>{delete n.module_metadata})})}const SE=()=>({name:"ModuleMetadata",setup(e){e.on("beforeEnvelope",t=>{xn(t,(n,r)=>{if(r==="event"){const o=Array.isArray(n)?n[1]:void 0;o&&(yh(o),n[1]=o)}})}),e.on("applyFrameMetadata",t=>{if(t.type)return;const n=e.getOptions().stackParser;_h(n,t)})}});function Hc(e){const t="console";ln(t,e),dn(t,bE)}function bE(){"console"in $&&hc.forEach(function(e){e in $.console&&Le($.console,e,function(t){return Rs[e]=t,function(...n){et("console",{args:n,level:e}),Rs[e]?.apply($.console,n)}})})}function $s(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const EE="CaptureConsole",TE=(e={})=>{const t=e.levels||hc,n=e.handled??!0;return{name:EE,setup(r){"console"in $&&Hc(({args:o,level:s})=>{C()!==r||!t.includes(s)||IE(o,s,n)})}}},vE=TE;function IE(e,t,n){const r=$s(t),o=new Error,s={level:$s(t),extra:{arguments:e}};je(i=>{if(i.addEventProcessor(u=>(u.logger="console",$t(u,{handled:n,type:"auto.core.capture_console"}),u)),t==="assert"){if(!e[0]){const u=`Assertion failed: ${As(e.slice(1)," ")||"console.assert"}`;i.setExtra("arguments",e.slice(1)),i.captureMessage(u,r,{captureContext:s,syntheticException:o})}return}const a=e.find(u=>u instanceof Error);if(a){me(a,s);return}const c=As(e," ");i.captureMessage(c,r,{captureContext:s,syntheticException:o})})}const wE="Dedupe",kE=()=>{let e;return{name:wE,processEvent(t){if(t.type)return t;try{if(RE(t,e))return w&&g.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},Sh=kE;function RE(e,t){return t?!!(AE(e,t)||CE(e,t)):!1}function AE(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Eh(e,t)||!bh(e,t))}function CE(e,t){const n=Pl(t),r=Pl(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Eh(e,t)||!bh(e,t))}function bh(e,t){let n=Ta(e),r=Ta(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o{const{depth:t=3,captureErrorCause:n=!0}=e;return{name:xE,processEvent(r,o,s){const{maxValueLength:i}=s.getOptions();return OE(r,o,t,n,i)}}},NE=ME;function OE(e,t={},n,r,o){if(!t.originalException||!yt(t.originalException))return e;const s=t.originalException.name||t.originalException.constructor.name,i=Th(t.originalException,r,o);if(i){const a={...e.contexts},c=Pe(i,n);return qe(c)&&(Se(c,"__sentry_skip_normalization__",!0),a[s]=c),{...e,contexts:a}}return e}function Th(e,t,n){try{const r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],o={};for(const s of Object.keys(e)){if(r.indexOf(s)!==-1)continue;const i=e[s];o[s]=yt(i)||typeof i=="string"?n?Xr(`${i}`,n):`${i}`:i}if(t&&e.cause!==void 0)if(yt(e.cause)){const s=e.cause.name||e.cause.constructor.name;o.cause={[s]:Th(e.cause,!1,n)}}else o.cause=e.cause;if(typeof e.toJSON=="function"){const s=e.toJSON();for(const i of Object.keys(s)){const a=s[i];o[i]=yt(a)?a.toString():a}}return o}catch(r){w&&g.error("Unable to extract extra data from the Error object:",r)}return null}function PE(e,t){let n=0;for(let r=e.length-1;r>=0;r--){const o=e[r];o==="."?e.splice(r,1):o===".."?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}const LE=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function DE(e){const t=e.length>1024?`${e.slice(-1024)}`:e,n=LE.exec(t);return n?n.slice(1):[]}function Ll(...e){let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){const o=r>=0?e[r]:"/";o&&(t=`${o}/${t}`,n=o.charAt(0)==="/")}return t=PE(t.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+t||"."}function Dl(e){let t=0;for(;t=0&&e[n]==="";n--);return t>n?[]:e.slice(t,n-t+1)}function FE(e,t){e=Ll(e).slice(1),t=Ll(t).slice(1);const n=Dl(e.split("/")),r=Dl(t.split("/")),o=Math.min(n.length,r.length);let s=o;for(let a=0;a{const t=e.root,n=e.prefix||"app:///",r="window"in $&&!!$.window,o=e.iteratee||HE({isBrowser:r,root:t,prefix:n});function s(a){try{return{...a,exception:{...a.exception,values:a.exception.values.map(c=>({...c,...c.stacktrace&&{stacktrace:i(c.stacktrace)}}))}}}catch{return a}}function i(a){return{...a,frames:a?.frames?.map(c=>o(c))}}return{name:BE,processEvent(a){let c=a;return a.exception&&Array.isArray(a.exception.values)&&(c=s(c)),c}}};function HE({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;const o=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes("\\")&&!r.filename.includes("/"),s=/^\//.test(r.filename);if(e){if(t){const i=r.filename;i.indexOf(t)===0&&(r.filename=i.replace(t,n))}}else if(o||s){const i=o?r.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):r.filename,a=t?FE(t,i):$E(i);r.filename=`${n}${a}`}return r}}const WE=["reauthenticate","signInAnonymously","signInWithOAuth","signInWithIdToken","signInWithOtp","signInWithPassword","signInWithSSO","signOut","signUp","verifyOtp"],jE=["createUser","deleteUser","listUsers","getUserById","updateUserById","inviteUserByEmail"],zE={eq:"eq",neq:"neq",gt:"gt",gte:"gte",lt:"lt",lte:"lte",like:"like","like(all)":"likeAllOf","like(any)":"likeAnyOf",ilike:"ilike","ilike(all)":"ilikeAllOf","ilike(any)":"ilikeAnyOf",is:"is",in:"in",cs:"contains",cd:"containedBy",sr:"rangeGt",nxl:"rangeGte",sl:"rangeLt",nxr:"rangeLte",adj:"rangeAdjacent",ov:"overlaps",fts:"",plfts:"plain",phfts:"phrase",wfts:"websearch",not:"not"},vh=["select","insert","upsert","update","delete"];function mi(e){try{e.__SENTRY_INSTRUMENTED__=!0}catch{}}function gi(e){try{return e.__SENTRY_INSTRUMENTED__}catch{return!1}}function qE(e,t={}){switch(e){case"GET":return"select";case"POST":return t.Prefer?.includes("resolution=")?"upsert":"insert";case"PATCH":return"update";case"DELETE":return"delete";default:return""}}function GE(e,t){if(t===""||t==="*")return"select(*)";if(e==="select")return`select(${t})`;if(e==="or"||e.endsWith(".or"))return`${e}${t}`;const[n,...r]=t.split(".");let o;return n?.startsWith("fts")?o="textSearch":n?.startsWith("plfts")?o="textSearch[plain]":n?.startsWith("phfts")?o="textSearch[phrase]":n?.startsWith("wfts")?o="textSearch[websearch]":o=n&&zE[n]||"filter",`${o}(${e}, ${r.join(".")})`}function Fl(e,t=!1){return new Proxy(e,{apply(n,r,o){return zt({name:`auth ${t?"(admin) ":""}${e.name}`,attributes:{[z]:"auto.db.supabase",[ce]:"db","db.system":"postgresql","db.operation":`auth.${t?"admin.":""}${e.name}`}},s=>Reflect.apply(n,r,o).then(i=>(i&&typeof i=="object"&&"error"in i&&i.error?(s.setStatus({code:ee}),me(i.error,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}})):s.setStatus({code:go}),s.end(),i)).catch(i=>{throw s.setStatus({code:ee}),s.end(),me(i,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}}),i}).then(...o))}})}function VE(e){const t=e.auth;if(!(!t||gi(e.auth))){for(const n of WE){const r=t[n];r&&typeof e.auth[n]=="function"&&(e.auth[n]=Fl(r))}for(const n of jE){const r=t.admin[n];r&&typeof e.auth.admin[n]=="function"&&(e.auth.admin[n]=Fl(r,!0))}mi(e.auth)}}function YE(e){gi(e.prototype.from)||(e.prototype.from=new Proxy(e.prototype.from,{apply(t,n,r){const o=Reflect.apply(t,n,r),s=o.constructor;return KE(s),o}}),mi(e.prototype.from))}function JE(e){gi(e.prototype.then)||(e.prototype.then=new Proxy(e.prototype.then,{apply(t,n,r){const o=vh,s=n,i=qE(s.method,s.headers);if(!o.includes(i)||!s?.url?.pathname||typeof s.url.pathname!="string")return Reflect.apply(t,n,r);const a=s.url.pathname.split("/"),c=a.length>0?a[a.length-1]:"",u=[];for(const[p,h]of s.url.searchParams.entries())u.push(GE(p,h));const d=Object.create(null);if(qe(s.body))for(const[p,h]of Object.entries(s.body))d[p]=h;const l=`${i==="select"?"":`${i}${d?"(...) ":""}`}${u.join(" ")} from(${c})`,f={"db.table":c,"db.schema":s.schema,"db.url":s.url.origin,"db.sdk":s.headers["X-Client-Info"],"db.system":"postgresql","db.operation":i,[z]:"auto.db.supabase",[ce]:"db"};return u.length&&(f["db.query"]=u),Object.keys(d).length&&(f["db.body"]=d),zt({name:l,attributes:f},p=>Reflect.apply(t,n,[]).then(h=>{if(p&&(h&&typeof h=="object"&&"status"in h&&Zr(p,h.status||500),p.end()),h?.error){const y=new Error(h.error.message);h.error.code&&(y.code=h.error.code),h.error.details&&(y.details=h.error.details);const S={};u.length&&(S.query=u),Object.keys(d).length&&(S.body=d),me(y,M=>(M.addEventProcessor(I=>($t(I,{handled:!1,type:"auto.db.supabase.postgres"}),I)),M.setContext("supabase",S),M))}const m={type:"supabase",category:`db.${i}`,message:l},_={};return u.length&&(_.query=u),Object.keys(d).length&&(_.body=d),Object.keys(_).length&&(m.data=_),mt(m),h},h=>{throw p&&(Zr(p,500),p.end()),h}).then(...r))}}),mi(e.prototype.then))}function KE(e){for(const t of vh)gi(e.prototype[t])||(e.prototype[t]=new Proxy(e.prototype[t],{apply(n,r,o){const s=Reflect.apply(n,r,o),i=s.constructor;return w&&g.log(`Instrumenting ${t} operation's PostgRESTFilterBuilder`),JE(i),s}}),mi(e.prototype[t]))}const Ih=e=>{if(!e){w&&g.warn("Supabase integration was not installed because no Supabase client was provided.");return}const t=e.constructor===Function?e:e.constructor;YE(t),VE(e)},XE="Supabase",QE=e=>({setupOnce(){Ih(e)},name:XE}),ZE=e=>QE(e.supabaseClient),eT=10,tT="ZodErrors";function nT(e){return yt(e)&&e.name==="ZodError"&&Array.isArray(e.issues)}function rT(e){return{...e,path:"path"in e&&Array.isArray(e.path)?e.path.join("."):void 0,keys:"keys"in e?JSON.stringify(e.keys):void 0,unionErrors:"unionErrors"in e?JSON.stringify(e.unionErrors):void 0}}function oT(e){return e.map(t=>typeof t=="number"?"":t).join(".")}function sT(e){const t=new Set;for(const r of e.issues){const o=oT(r.path);o.length>0&&t.add(o)}const n=Array.from(t);if(n.length===0){let r="variable";if(e.issues.length>0){const o=e.issues[0];o!==void 0&&"expected"in o&&typeof o.expected=="string"&&(r=o.expected)}return`Failed to validate ${r}`}return`Failed to validate keys: ${Xr(n.join(", "),100)}`}function iT(e,t=!1,n,r){if(!n.exception?.values||!r.originalException||!nT(r.originalException)||r.originalException.issues.length===0)return n;try{const s=(t?r.originalException.issues:r.originalException.issues.slice(0,e)).map(rT);return t&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({filename:"zod_issues.json",data:JSON.stringify({issues:s})})),{...n,exception:{...n.exception,values:[{...n.exception.values[0],value:sT(r.originalException)},...n.exception.values.slice(1)]},extra:{...n.extra,"zoderror.issues":s.slice(0,e)}}}catch(o){return{...n,extra:{...n.extra,"zoderrors sentry integration parse error":{message:"an exception was thrown while processing ZodError within applyZodErrorsToEvent()",error:o instanceof Error?`${o.name}: ${o.message} ${o.stack}`:"unknown"}}}}}const aT=(e={})=>{const t=e.limit??eT;return{name:tT,processEvent(n,r){return iT(t,e.saveZodIssuesAsAttachment,n,r)}}},cT=aT,uT=e=>({name:"ThirdPartyErrorsFilter",setup(t){t.on("beforeEnvelope",n=>{xn(n,(r,o)=>{if(o==="event"){const s=Array.isArray(r)?r[1]:void 0;s&&(yh(s),r[1]=s)}})}),t.on("applyFrameMetadata",n=>{if(n.type)return;const r=t.getOptions().stackParser;_h(r,n)})},processEvent(t){const n=dT(t,e.ignoreSentryInternalFrames);if(n){const r=e.behaviour==="drop-error-if-contains-third-party-frames"||e.behaviour==="apply-tag-if-contains-third-party-frames"?"some":"every";if(n[r](s=>!s.some(i=>e.filterKeys.includes(i)))){if(e.behaviour==="drop-error-if-contains-third-party-frames"||e.behaviour==="drop-error-if-exclusively-contains-third-party-frames")return null;t.tags={...t.tags,third_party_code:!0}}}return t}});function lT(e,t){if(t!==0||!e.context_line||!e.filename||!e.filename.includes("sentry")||!e.filename.includes("helpers")||!e.context_line.includes(pT))return!1;if(e.pre_context){const n=e.pre_context.length;for(let r=0;r!r.filename||r.lineno==null&&r.colno==null&&r.instruction_addr==null?!1:!t||!lT(r,o)).map(r=>r.module_metadata?Object.keys(r.module_metadata).filter(o=>o.startsWith($l)).map(o=>o.slice($l.length)):[])}const $l="_sentryBundlerPluginAppKey:",fT="Attempt to invoke user-land function",pT="fn.apply(this, wrappedArguments)",hT=100,mT=10,Wo="flag.evaluation.";function Rr(e){if(e.type)return e;const n=j().getScopeData().contexts.flags,r=n?n.values:[];return r.length&&(e.contexts===void 0&&(e.contexts={}),e.contexts.flags={values:[...r]}),e}function Nn(e,t,n=hT){const r=j().getScopeData().contexts;r.flags||(r.flags={values:[]});const o=r.flags.values;gT(o,e,t,n)}function gT(e,t,n,r){if(typeof n!="boolean")return;if(e.length>r){w&&g.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`);return}const o=e.findIndex(s=>s.flag===t);o!==-1&&e.splice(o,1),e.length===r&&e.shift(),e.push({flag:t,result:n})}function On(e,t,n=mT){if(typeof t!="boolean")return;const r=Te();if(!r)return;const o=F(r).data;if(`${Wo}${e}`in o){r.setAttribute(`${Wo}${e}`,t);return}Object.keys(o).filter(i=>i.startsWith(Wo)).length({name:"FeatureFlags",processEvent(e,t,n){return Rr(e)},addFeatureFlag(e,t){Nn(e,t),On(e,t)}}),yT=({growthbookClass:e})=>({name:"GrowthBook",setupOnce(){const t=e.prototype;typeof t.isOn=="function"&&Le(t,"isOn",Bl),typeof t.getFeatureValue=="function"&&Le(t,"getFeatureValue",Bl)},processEvent(t,n,r){return Rr(t)}});function Bl(e){return function(...t){const n=t[0],r=e.apply(this,t);return typeof n=="string"&&typeof r=="boolean"&&(Nn(n,r),On(n,r)),r}}const ST="ConversationId",bT=()=>({name:ST,setup(e){e.on("spanStart",t=>{const n=j().getScopeData(),r=be().getScopeData(),o=n.conversationId||r.conversationId;o&&t.setAttribute(Ly,o)})}}),ET=bT;function TT(e,t,n,r,o){if(!e.fetchData)return;const{method:s,url:i}=e.fetchData,a=tt()&&t(i);if(e.endTimestamp){const p=e.fetchData.__span;if(!p)return;const h=r[p];h&&(a&&(wT(h,e),vT(h,e,o)),delete r[p]);return}const{spanOrigin:c="auto.http.browser",propagateTraceparent:u=!1}=typeof o=="object"?o:{spanOrigin:o},d=!!Te(),l=a&&d?nt(RT(i,s,c)):new Ke;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=IT(p,h,tt()&&d?l:void 0,u);m&&(e.args[1]=h,h.headers=m)}const f=C();if(f){const p={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};f.emit("beforeOutgoingRequestSpan",l,p)}return l}function vT(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function IT(e,t,n,r){const o=Uc({span:n,propagateTraceparent:r}),s=o["sentry-trace"],i=o.baggage,a=o.traceparent;if(!s)return;const c=t.headers||(_c(e)?e.headers:void 0);if(c)if(kT(c)){const u=new Headers(c);if(u.get("sentry-trace")||u.set("sentry-trace",s),r&&a&&!u.get("traceparent")&&u.set("traceparent",a),i){const d=u.get("baggage");d?jo(d)||u.set("baggage",`${d},${i}`):u.set("baggage",i)}return u}else if(Array.isArray(c)){const u=[...c];c.find(l=>l[0]==="sentry-trace")||u.push(["sentry-trace",s]),r&&a&&!c.find(l=>l[0]==="traceparent")&&u.push(["traceparent",a]);const d=c.find(l=>l[0]==="baggage"&&jo(l[1]));return i&&!d&&u.push(["baggage",i]),u}else{const u="sentry-trace"in c?c["sentry-trace"]:void 0,d="traceparent"in c?c.traceparent:void 0,l="baggage"in c?c.baggage:void 0,f=l?Array.isArray(l)?[...l]:[l]:[],p=l&&(Array.isArray(l)?l.find(m=>jo(m)):jo(l));i&&!p&&f.push(i);const h={...c,"sentry-trace":u??s,baggage:f.length>0?f.join(","):void 0};return r&&a&&!d&&(h.traceparent=a),h}else return{...o}}function wT(e,t){if(t.response){Zr(e,t.response.status);const n=t.response?.headers?.get("content-length");if(n){const r=parseInt(n);r>0&&e.setAttribute("http.response_content_length",r)}}else t.error&&e.setStatus({code:ee,message:"internal_error"});e.end()}function jo(e){return e.split(",").some(t=>t.trim().startsWith(Cs))}function kT(e){return typeof Headers<"u"&&Ft(e,Headers)}function RT(e,t,n){if(e.startsWith("data:")){const s=Xt(e);return{name:`${t} ${s}`,attributes:Ul(e,void 0,t,n)}}const r=Bc(e),o=r?Kb(r):e;return{name:`${t} ${o}`,attributes:Ul(e,r,t,n)}}function Ul(e,t,n,r){const o={url:Xt(e),type:"fetch","http.method":n,[z]:r,[ce]:"http.client"};return t&&($c(t)||(o["http.url"]=Xt(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function wh(e,t={},n=j()){const{message:r,name:o,email:s,url:i,source:a,associatedEventId:c,tags:u}=e,d={contexts:{feedback:{contact_email:s,name:o,message:r,url:i,source:a,associated_event_id:c}},type:"feedback",level:"info",tags:u},l=n?.getClient()||C();return l&&l.emit("beforeSendFeedback",d,t),n.captureEvent(d,t)}function Ar(e,t,n,r,o){Ls({level:e,message:t,attributes:n,severityNumber:o},r)}function AT(e,t,{scope:n}={}){Ar("trace",e,t,n)}function CT(e,t,{scope:n}={}){Ar("debug",e,t,n)}function Pa(e,t,{scope:n}={}){Ar("info",e,t,n)}function xT(e,t,{scope:n}={}){Ar("warn",e,t,n)}function MT(e,t,{scope:n}={}){Ar("error",e,t,n)}function NT(e,t,{scope:n}={}){Ar("fatal",e,t,n)}const OT=Object.freeze(Object.defineProperty({__proto__:null,debug:CT,error:MT,fatal:NT,fmt:Zb,info:Pa,trace:AT,warn:xT},Symbol.toStringTag,{value:"Module"}));function Bs(e,t,n){return"util"in $&&typeof $.util.format=="function"?$.util.format(...e):PT(e,t,n)}function PT(e,t,n){return e.map(r=>Dt(r)?String(r):JSON.stringify(Pe(r,t,n))).join(" ")}function kh(e){return/%[sdifocO]/.test(e)}function Rh(e,t){const n={},r=new Array(t.length).fill("{}").join(" ");return n["sentry.message.template"]=`${e} ${r}`,t.forEach((o,s)=>{n[`sentry.message.parameter.${s}`]=o}),n}const LT="ConsoleLogs",Hl={[z]:"auto.log.console"},DT=(e={})=>{const t=e.levels||hc;return{name:LT,setup(n){const{enableLogs:r,normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=n.getOptions();if(!r){w&&g.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}Hc(({args:i,level:a})=>{if(C()!==n||!t.includes(a))return;const c=i[0],u=i.slice(1);if(a==="assert"){if(!c){const p=u.length>0?`Assertion failed: ${Bs(u,o,s)}`:"Assertion failed";Ls({level:"error",message:p,attributes:Hl})}return}const d=a==="log",l=i.length>1&&typeof i[0]=="string"&&!kh(i[0]),f={...Hl,...l?Rh(c,u):{}};Ls({level:d?"info":a,message:Bs(i,o,s),severityNumber:d?10:void 0,attributes:f})})}}},FT=DT;function Wc(e,t,n,r){xb({type:e,name:t,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope})}function $T(e,t=1,n){Wc("counter",e,t,n)}function BT(e,t,n){Wc("gauge",e,t,n)}function La(e,t,n){Wc("distribution",e,t,n)}const UT=Object.freeze(Object.defineProperty({__proto__:null,count:$T,distribution:La,gauge:BT},Symbol.toStringTag,{value:"Module"})),HT=["trace","debug","info","warn","error","fatal"];function WT(e={}){const t=new Set(e.levels??HT),n=e.client;return{log(r){const{type:o,level:s,message:i,args:a,tag:c,date:u,...d}=r,l=n||C();if(!l)return;const f=qT(o,s);if(!t.has(f))return;const{normalizeDepth:p=3,normalizeMaxBreadth:h=1e3}=l.getOptions(),m={};for(const[y,S]of Object.entries(d))m[y]=Pe(S,p,h);m["sentry.origin"]="auto.log.consola",c&&(m["consola.tag"]=c),o&&(m["consola.type"]=o),s!=null&&typeof s=="number"&&(m["consola.level"]=s);const _=VT(GT(a,p,h),p,h);_?.attributes&&Object.assign(m,_.attributes),Ls({level:f,message:_?.message||i||a&&Bs(a,p,h)||"",attributes:m})}}}const jT={silent:"trace",fatal:"fatal",error:"error",warn:"warn",log:"info",info:"info",success:"info",fail:"error",ready:"info",start:"info",box:"info",debug:"debug",trace:"trace",verbose:"debug",critical:"fatal",notice:"info"},zT={0:"fatal",1:"warn",2:"info",3:"info",4:"debug",5:"trace"};function qT(e,t){if(e==="verbose")return"debug";if(e==="silent")return"trace";if(e){const n=jT[e];if(n)return n}if(typeof t=="number"){const n=zT[t];if(n)return n}return"info"}function GT(e,t,n){if(!e?.length)return{message:""};const r=Bs(e,t,n),o=e[0];if(qe(o)){const s=typeof e[1]=="string"?2:1,i=e.slice(s);return{message:r,attributes:o,messageParameters:i}}else{const s=e.slice(1),i=s.length>0&&typeof o=="string"&&!kh(o);return{message:r,messageTemplate:i?o:void 0,messageParameters:i?s:void 0}}}function VT(e,t,n){const{message:r,attributes:o,messageTemplate:s,messageParameters:i}=e,a={};if(s&&i){const c=Rh(s,i);for(const[u,d]of Object.entries(c))a[u]=u.startsWith("sentry.message.parameter.")?Pe(d,t,n):d}else i&&i.length>0&&i.forEach((c,u)=>{a[`sentry.message.parameter.${u}`]=Pe(c,t,n)});return{message:r,attributes:{...Pe(o,t,n),...a}}}const YT="gen_ai.prompt",bo="gen_ai.system",De="gen_ai.request.model",jc="gen_ai.request.stream",_i="gen_ai.request.temperature",zc="gen_ai.request.max_tokens",yi="gen_ai.request.frequency_penalty",qc="gen_ai.request.presence_penalty",Si="gen_ai.request.top_p",Ah="gen_ai.request.top_k",Ch="gen_ai.request.encoding_format",xh="gen_ai.request.dimensions",nr="gen_ai.response.finish_reasons",Cr="gen_ai.response.model",bi="gen_ai.response.id",JT="gen_ai.response.stop_reason",Pn="gen_ai.usage.input_tokens",Ln="gen_ai.usage.output_tokens",an="gen_ai.usage.total_tokens",Bt="gen_ai.operation.name",Dn="sentry.sdk_meta.gen_ai.input.messages.original_length",xr="gen_ai.input.messages",Eo="gen_ai.system_instructions",St="gen_ai.response.text",Ei="gen_ai.request.available_tools",KT="gen_ai.response.streaming",Qt="gen_ai.response.tool_calls",Mh="gen_ai.agent.name",XT="gen_ai.pipeline.name",Gc="gen_ai.conversation.id",QT="gen_ai.usage.cache_creation_input_tokens",ZT="gen_ai.usage.cache_read_input_tokens",ev="gen_ai.invoke_agent",Vc="gen_ai.embeddings.input",Nh="gen_ai.embeddings",tv="gen_ai.tool.name",nv="gen_ai.tool.input",rv="gen_ai.tool.output";function rr(e){return!e||typeof e!="object"?!1:sv(e)||Ph(e)||ov(e)||Lh(e)||Dh(e)||iv(e)||av(e)||cv(e)||uv(e)||lv(e)||dv(e)||fv(e)}function ov(e){return"image_url"in e?typeof e.image_url=="string"?e.image_url.startsWith("data:"):Oh(e):!1}function Oh(e){return"image_url"in e&&!!e.image_url&&typeof e.image_url=="object"&&"url"in e.image_url&&typeof e.image_url.url=="string"&&e.image_url.url.startsWith("data:")}function sv(e){return"type"in e&&typeof e.type=="string"&&"source"in e&&rr(e.source)}function Ph(e){return"inlineData"in e&&!!e.inlineData&&typeof e.inlineData=="object"&&"data"in e.inlineData&&typeof e.inlineData.data=="string"}function Lh(e){return"type"in e&&e.type==="input_audio"&&"input_audio"in e&&!!e.input_audio&&typeof e.input_audio=="object"&&"data"in e.input_audio&&typeof e.input_audio.data=="string"}function Dh(e){return"type"in e&&e.type==="file"&&"file"in e&&!!e.file&&typeof e.file=="object"&&"file_data"in e.file&&typeof e.file.file_data=="string"}function iv(e){return"media_type"in e&&typeof e.media_type=="string"&&"data"in e}function av(e){return"type"in e&&e.type==="file"&&"mediaType"in e&&typeof e.mediaType=="string"&&"data"in e&&typeof e.data=="string"&&!e.data.startsWith("http://")&&!e.data.startsWith("https://")}function cv(e){return"type"in e&&e.type==="image"&&"image"in e&&typeof e.image=="string"&&!e.image.startsWith("http://")&&!e.image.startsWith("https://")}function uv(e){return"type"in e&&(e.type==="blob"||e.type==="base64")}function lv(e){return"b64_json"in e}function dv(e){return"type"in e&&"result"in e&&e.type==="image_generation"}function fv(e){return"uri"in e&&typeof e.uri=="string"&&e.uri.startsWith("data:")}const Ur="[Blob substitute]",pv=["image_url","data","content","b64_json","result","uri","image"];function Gr(e){const t={...e};rr(t.source)&&(t.source=Gr(t.source)),Ph(e)&&(t.inlineData={...e.inlineData,data:Ur}),Oh(e)&&(t.image_url={...e.image_url,url:Ur}),Lh(e)&&(t.input_audio={...e.input_audio,data:Ur}),Dh(e)&&(t.file={...e.file,file_data:Ur});for(const n of pv)typeof t[n]=="string"&&(t[n]=Ur);return t}const Fh=2e4,Us=e=>new TextEncoder().encode(e).length,Yc=e=>Us(JSON.stringify(e));function Ti(e,t){if(Us(e)<=t)return e;let n=0,r=e.length,o="";for(;n<=r;){const s=Math.floor((n+r)/2),i=e.slice(0,s);Us(i)<=t?(o=i,n=s+1):r=s-1}return o}function hv(e){return typeof e=="string"?e:"text"in e&&typeof e.text=="string"?e.text:""}function Wl(e,t){return typeof e=="string"?t:{...e,text:t}}function mv(e){return e!==null&&typeof e=="object"&&"content"in e&&typeof e.content=="string"}function $h(e){return e!==null&&typeof e=="object"&&"content"in e&&Array.isArray(e.content)}function Bh(e){return e!==null&&typeof e=="object"&&"parts"in e&&Array.isArray(e.parts)&&e.parts.length>0}function gv(e,t){const n={...e,content:""},r=Yc(n),o=t-r;if(o<=0)return[];const s=Ti(e.content,o);return[{...e,content:s}]}function _v(e){return"parts"in e&&Array.isArray(e.parts)?{key:"parts",items:e.parts}:"content"in e&&Array.isArray(e.content)?{key:"content",items:e.content}:{key:null,items:[]}}function yv(e,t){const{key:n,items:r}=_v(e);if(n===null||r.length===0)return[];const o=r.map(c=>Wl(c,"")),s=Yc({...e,[n]:o});let i=t-s;if(i<=0)return[];const a=[];for(const c of r){const u=hv(c),d=Us(u);if(d<=i)a.push(c),i-=d;else if(a.length===0){const l=Ti(u,i);l&&a.push(Wl(c,l));break}else break}return a.length<=0?[]:[{...e,[n]:a}]}function Sv(e,t){if(!e)return[];if(typeof e=="string"){const n=Ti(e,t);return n?[n]:[]}return typeof e!="object"?[]:mv(e)?gv(e,t):$h(e)||Bh(e)?yv(e,t):[]}function Da(e){return e.map(n=>{let r;return n&&typeof n=="object"&&($h(n)?r={...n,content:Da(n.content)}:"content"in n&&rr(n.content)&&(r={...n,content:Gr(n.content)}),Bh(n)&&(r={...r??n,parts:Da(n.parts)}),rr(r)?r=Gr(r):rr(n)&&(r=Gr(n))),r??n})}function bv(e,t){if(!Array.isArray(e)||e.length===0)return e;const n=t-2,r=e[e.length-1],o=Da([r]),s=o[0];return Yc(s)<=n?o:Sv(s,n)}function vi(e){return bv(e,Fh)}function Ev(e){return Ti(e,Fh)}function Mr(e){const t=!!C()?.getOptions().sendDefaultPii;return{...e,recordInputs:e?.recordInputs??t,recordOutputs:e?.recordOutputs??t}}function Jc(e,t){return e?`${e}.${t}`:t}function Tv(e,t,n,r,o){if(t!==void 0&&e.setAttributes({[Pn]:t}),n!==void 0&&e.setAttributes({[Ln]:n}),t!==void 0||n!==void 0||r!==void 0||o!==void 0){const s=(t??0)+(n??0)+(r??0)+(o??0);e.setAttributes({[an]:s})}}function Ii(e,t,n){if(!e.isRecording())return;const r={[KT]:!0};t.responseId&&(r[bi]=t.responseId),t.responseModel&&(r[Cr]=t.responseModel),t.promptTokens!==void 0&&(r[Pn]=t.promptTokens),t.completionTokens!==void 0&&(r[Ln]=t.completionTokens),t.totalTokens!==void 0?r[an]=t.totalTokens:(t.promptTokens!==void 0||t.completionTokens!==void 0||t.cacheCreationInputTokens!==void 0||t.cacheReadInputTokens!==void 0)&&(r[an]=(t.promptTokens??0)+(t.completionTokens??0)+(t.cacheCreationInputTokens??0)+(t.cacheReadInputTokens??0)),t.finishReasons.length&&(r[nr]=JSON.stringify(t.finishReasons)),n&&t.responseTexts.length&&(r[St]=t.responseTexts.join("")),n&&t.toolCalls.length&&(r[Qt]=JSON.stringify(t.toolCalls)),e.setAttributes(r),e.end()}function Uh(e){if(typeof e=="string")return Ev(e);if(Array.isArray(e)){const t=vi(e);return JSON.stringify(t)}return JSON.stringify(e)}function To(e){if(!Array.isArray(e))return{systemInstructions:void 0,filteredMessages:e};const t=e.findIndex(i=>i&&typeof i=="object"&&"role"in i&&i.role==="system");if(t===-1)return{systemInstructions:void 0,filteredMessages:e};const n=e[t],r=typeof n.content=="string"?n.content:n.content!==void 0?JSON.stringify(n.content):void 0;if(!r)return{systemInstructions:void 0,filteredMessages:e};const o=JSON.stringify([{type:"text",content:r}]),s=[...e.slice(0,t),...e.slice(t+1)];return{systemInstructions:o,filteredMessages:s}}async function vv(e,t,n){const r=e.catch(i=>{throw me(i,{mechanism:{handled:!1,type:n}}),i}),o=await t,s=await r;return s&&typeof s=="object"&&"data"in s?{...s,data:o}:o}function Hs(e,t,n){return fn(e)?new Proxy(e,{get(r,o){const i=o in Promise.prototype||o===Symbol.toStringTag?t:r,a=Reflect.get(i,o);return o==="withResponse"&&typeof a=="function"?function(){const u=a.call(r);return vv(u,t,n)}:typeof a=="function"?a.bind(i):a}}):t}const Iv={"responses.create":{operation:"chat"},"chat.completions.create":{operation:"chat"},"embeddings.create":{operation:"embeddings"},"conversations.create":{operation:"chat"}},wv=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],kv=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...wv];function Rv(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"&&e.type.startsWith("response.")}function Av(e){return e!==null&&typeof e=="object"&&"object"in e&&e.object==="chat.completion.chunk"}function Cv(e,t,n){if(!t||typeof t!="object")return;const r=t,o={};if(typeof r.id=="string"&&(o[bi]=r.id),typeof r.model=="string"&&(o[Cr]=r.model),r.object==="conversation"&&typeof r.id=="string"&&(o[Gc]=r.id),r.usage&&typeof r.usage=="object"){const s=r.usage,i=s.prompt_tokens??s.input_tokens;typeof i=="number"&&(o[Pn]=i);const a=s.completion_tokens??s.output_tokens;typeof a=="number"&&(o[Ln]=a),typeof s.total_tokens=="number"&&(o[an]=s.total_tokens)}if(Array.isArray(r.choices)){const s=r.choices,i=s.map(a=>a.finish_reason).filter(a=>typeof a=="string");if(i.length>0&&(o[nr]=JSON.stringify(i)),n){const a=s.map(u=>u.message?.content||"");o[St]=JSON.stringify(a);const c=s.map(u=>u.message?.tool_calls).filter(u=>Array.isArray(u)&&u.length>0).flat();c.length>0&&(o[Qt]=JSON.stringify(c))}}if(typeof r.status=="string"&&(o[nr]||(o[nr]=JSON.stringify([r.status]))),n&&(typeof r.output_text=="string"&&!o[St]&&(o[St]=r.output_text),Array.isArray(r.output)&&r.output.length>0&&!o[Qt])){const s=r.output.filter(i=>i?.type==="function_call");s.length>0&&(o[Qt]=JSON.stringify(s))}e.setAttributes(o)}function xv(e){if("conversation"in e&&typeof e.conversation=="string")return e.conversation;if("previous_response_id"in e&&typeof e.previous_response_id=="string")return e.previous_response_id}function Mv(e){const t={[De]:e.model??"unknown"};"temperature"in e&&(t[_i]=e.temperature),"top_p"in e&&(t[Si]=e.top_p),"frequency_penalty"in e&&(t[yi]=e.frequency_penalty),"presence_penalty"in e&&(t[qc]=e.presence_penalty),"stream"in e&&(t[jc]=e.stream),"encoding_format"in e&&(t[Ch]=e.encoding_format),"dimensions"in e&&(t[xh]=e.dimensions);const n=xv(e);return n&&(t[Gc]=n),t}function Nv(e,t){for(const n of e){const r=n.index;if(!(r===void 0||!n.function))if(!(r in t.chatCompletionToolCalls))t.chatCompletionToolCalls[r]={...n,function:{name:n.function.name,arguments:n.function.arguments||""}};else{const o=t.chatCompletionToolCalls[r];n.function.arguments&&o?.function&&(o.function.arguments+=n.function.arguments)}}}function Ov(e,t,n){t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.prompt_tokens,t.completionTokens=e.usage.completion_tokens,t.totalTokens=e.usage.total_tokens);for(const r of e.choices??[])n&&(r.delta?.content&&t.responseTexts.push(r.delta.content),r.delta?.tool_calls&&Nv(r.delta.tool_calls,t)),r.finish_reason&&t.finishReasons.push(r.finish_reason)}function Pv(e,t,n,r){if(!(e&&typeof e=="object")){t.eventTypes.push("unknown:non-object");return}if(e instanceof Error){r.setStatus({code:ee,message:"internal_error"}),me(e,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});return}if(!("type"in e))return;const o=e;if(!kv.includes(o.type)){t.eventTypes.push(o.type);return}if(n&&(o.type==="response.output_item.done"&&"item"in o&&t.responsesApiToolCalls.push(o.item),o.type==="response.output_text.delta"&&"delta"in o&&o.delta)){t.responseTexts.push(o.delta);return}if("response"in o){const{response:s}=o;t.responseId=s.id??t.responseId,t.responseModel=s.model??t.responseModel,s.usage&&(t.promptTokens=s.usage.input_tokens,t.completionTokens=s.usage.output_tokens,t.totalTokens=s.usage.total_tokens),s.status&&t.finishReasons.push(s.status),n&&s.output_text&&t.responseTexts.push(s.output_text)}}async function*Lv(e,t,n){const r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(const o of e)Av(o)?Ov(o,r,n):Rv(o)&&Pv(o,r,n,t),yield o}finally{const o=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];Ii(t,{...r,toolCalls:o},n)}}function Dv(e){const t=Array.isArray(e.tools)?e.tools:[],r=e.web_search_options&&typeof e.web_search_options=="object"?[{type:"web_search_options",...e.web_search_options}]:[],o=[...t,...r];if(o.length!==0)try{return JSON.stringify(o)}catch(s){w&&g.error("Failed to serialize OpenAI tools:",s);return}}function Fv(e,t){const n={[bo]:"openai",[Bt]:t,[z]:"auto.ai.openai"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){const r=e[0],o=Dv(r);o&&(n[Ei]=o),Object.assign(n,Mv(r))}else n[De]="unknown";return n}function jl(e,t,n){if(n==="embeddings"&&"input"in t){const a=t.input;if(a==null||typeof a=="string"&&a.length===0||Array.isArray(a)&&a.length===0)return;e.setAttribute(Vc,typeof a=="string"?a:JSON.stringify(a));return}const r="input"in t?t.input:"messages"in t?t.messages:void 0;if(!r||Array.isArray(r)&&r.length===0)return;const{systemInstructions:o,filteredMessages:s}=To(r);o&&e.setAttribute(Eo,o);const i=Uh(s);e.setAttribute(xr,i),Array.isArray(s)?e.setAttribute(Dn,s.length):e.setAttribute(Dn,1)}function $v(e,t,n,r,o){return function(...i){const a=n.operation||"unknown",c=Fv(i,a),u=c[De]||"unknown",d=i[0],l=d&&typeof d=="object"&&d.stream===!0,f={name:`${a} ${u}`,op:`gen_ai.${a}`,attributes:c};if(l){let m;const _=Rt(f,y=>(m=e.apply(r,i),o.recordInputs&&d&&jl(y,d,a),(async()=>{try{const S=await m;return Lv(S,y,o.recordOutputs??!1)}catch(S){throw y.setStatus({code:ee,message:"internal_error"}),me(S,{mechanism:{handled:!1,type:"auto.ai.openai.stream",data:{function:t}}}),y.end(),S}})()));return Hs(m,_,"auto.ai.openai")}let p;const h=zt(f,m=>(p=e.apply(r,i),o.recordInputs&&d&&jl(m,d,a),p.then(_=>(Cv(m,_,o.recordOutputs),_),_=>{throw me(_,{mechanism:{handled:!1,type:"auto.ai.openai",data:{function:t}}}),_})));return Hs(p,h,"auto.ai.openai")}}function Hh(e,t="",n){return new Proxy(e,{get(r,o){const s=r[o],i=Jc(t,String(o)),a=Iv[i];return typeof s=="function"&&a?$v(s,i,a,r,n):typeof s=="function"?s.bind(r):s&&typeof s=="object"?Hh(s,i,n):s}})}function Bv(e,t){return Hh(e,"",Mr(t))}const Uv={"messages.create":{operation:"chat"},"messages.stream":{operation:"chat",streaming:!0},"messages.countTokens":{operation:"chat"},"models.get":{operation:"models"},"completions.create":{operation:"chat"},"models.retrieve":{operation:"models"},"beta.messages.create":{operation:"chat"}};function Hv(e,t){if(Array.isArray(t)&&t.length===0)return;const{systemInstructions:n,filteredMessages:r}=To(t);n&&e.setAttributes({[Eo]:n});const o=Array.isArray(r)?r.length:1;e.setAttributes({[xr]:Uh(r),[Dn]:o})}const Wv={invalid_request_error:"invalid_argument",authentication_error:"unauthenticated",permission_error:"permission_denied",not_found_error:"not_found",request_too_large:"failed_precondition",rate_limit_error:"resource_exhausted",api_error:"internal_error",overloaded_error:"unavailable"};function Wh(e){return e&&Wv[e]||"internal_error"}function jv(e,t){t.error&&(e.setStatus({code:ee,message:Wh(t.error.type)}),me(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}function zv(e){const{system:t,messages:n,input:r}=e,o=typeof t=="string"?[{role:"system",content:e.system}]:[],s=Array.isArray(r)?r:r!=null?[r]:void 0,i=Array.isArray(n)?n:n!=null?[n]:[],a=s??i;return[...o,...a]}function qv(e,t){return"type"in e&&typeof e.type=="string"&&e.type==="error"?(t.setStatus({code:ee,message:Wh(e.error?.type)}),me(e.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}),!0):!1}function Gv(e,t){if(e.type==="message_delta"&&e.usage&&"output_tokens"in e.usage&&typeof e.usage.output_tokens=="number"&&(t.completionTokens=e.usage.output_tokens),e.message){const n=e.message;n.id&&(t.responseId=n.id),n.model&&(t.responseModel=n.model),n.stop_reason&&t.finishReasons.push(n.stop_reason),n.usage&&(typeof n.usage.input_tokens=="number"&&(t.promptTokens=n.usage.input_tokens),typeof n.usage.cache_creation_input_tokens=="number"&&(t.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),typeof n.usage.cache_read_input_tokens=="number"&&(t.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}function Vv(e,t){e.type!=="content_block_start"||typeof e.index!="number"||!e.content_block||(e.content_block.type==="tool_use"||e.content_block.type==="server_tool_use")&&(t.activeToolBlocks[e.index]={id:e.content_block.id,name:e.content_block.name,inputJsonParts:[]})}function Yv(e,t,n){if(!(e.type!=="content_block_delta"||!e.delta)){if(typeof e.index=="number"&&"partial_json"in e.delta&&typeof e.delta.partial_json=="string"){const r=t.activeToolBlocks[e.index];r&&r.inputJsonParts.push(e.delta.partial_json)}n&&typeof e.delta.text=="string"&&t.responseTexts.push(e.delta.text)}}function Jv(e,t){if(e.type!=="content_block_stop"||typeof e.index!="number")return;const n=t.activeToolBlocks[e.index];if(!n)return;const r=n.inputJsonParts.join("");let o;try{o=r?JSON.parse(r):{}}catch{o={__unparsed:r}}t.toolCalls.push({type:"tool_use",id:n.id,name:n.name,input:o}),delete t.activeToolBlocks[e.index]}function jh(e,t,n,r){!(e&&typeof e=="object")||qv(e,r)||(Gv(e,t),Vv(e,t),Yv(e,t,n),Jv(e,t))}async function*Kv(e,t,n){const r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(const o of e)jh(o,r,n,t),yield o}finally{Ii(t,r,n)}}function Xv(e,t,n){const r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on("streamEvent",o=>{jh(o,r,n,t)}),e.on("message",()=>{Ii(t,r,n)}),e.on("error",o=>{me(o,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),t.isRecording()&&(t.setStatus({code:ee,message:"internal_error"}),t.end())}),e}function Qv(e,t,n){const r={[bo]:"anthropic",[Bt]:n,[z]:"auto.ai.anthropic"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){const o=e[0];o.tools&&Array.isArray(o.tools)&&(r[Ei]=JSON.stringify(o.tools)),r[De]=o.model??"unknown","temperature"in o&&(r[_i]=o.temperature),"top_p"in o&&(r[Si]=o.top_p),"stream"in o&&(r[jc]=o.stream),"top_k"in o&&(r[Ah]=o.top_k),"frequency_penalty"in o&&(r[yi]=o.frequency_penalty),"max_tokens"in o&&(r[zc]=o.max_tokens)}else t==="models.retrieve"||t==="models.get"?r[De]=e[0]:r[De]="unknown";return r}function Fa(e,t){const n=zv(t);Hv(e,n),"prompt"in t&&e.setAttributes({[YT]:JSON.stringify(t.prompt)})}function Zv(e,t){if("content"in t&&Array.isArray(t.content)){e.setAttributes({[St]:t.content.map(r=>r.text).filter(r=>!!r).join("")});const n=[];for(const r of t.content)(r.type==="tool_use"||r.type==="server_tool_use")&&n.push(r);n.length>0&&e.setAttributes({[Qt]:JSON.stringify(n)})}"completion"in t&&e.setAttributes({[St]:t.completion}),"input_tokens"in t&&e.setAttributes({[St]:JSON.stringify(t.input_tokens)})}function eI(e,t){"id"in t&&"model"in t&&(e.setAttributes({[bi]:t.id,[Cr]:t.model}),"usage"in t&&t.usage&&Tv(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}function tI(e,t,n){if(!(!t||typeof t!="object")){if("type"in t&&t.type==="error"){jv(e,t);return}n&&Zv(e,t),eI(e,t)}}function zl(e,t,n){throw me(e,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:n}}}),t.isRecording()&&(t.setStatus({code:ee,message:"internal_error"}),t.end()),e}function nI(e,t,n,r,o,s,i,a,c,u,d){const l=o[De]??"unknown",f={name:`${s} ${l}`,op:`gen_ai.${s}`,attributes:o};if(u&&!d){let p;const h=Rt(f,m=>(p=e.apply(n,r),c.recordInputs&&a&&Fa(m,a),(async()=>{try{const _=await p;return Kv(_,m,c.recordOutputs??!1)}catch(_){return zl(_,m,i)}})()));return Hs(p,h,"auto.ai.anthropic")}else return Rt(f,p=>{try{c.recordInputs&&a&&Fa(p,a);const h=t.apply(n,r);return Xv(h,p,c.recordOutputs??!1)}catch(h){return zl(h,p,i)}})}function rI(e,t,n,r,o){return new Proxy(e,{apply(s,i,a){const c=n.operation||"unknown",u=Qv(a,t,c),d=u[De]??"unknown",l=typeof a[0]=="object"?a[0]:void 0,f=!!l?.stream,p=n.streaming===!0;if(f||p)return nI(e,s,r,a,u,c,t,l,o,f,p);let h;const m=zt({name:`${c} ${d}`,op:`gen_ai.${c}`,attributes:u},_=>(h=s.apply(r,a),o.recordInputs&&l&&Fa(_,l),h.then(y=>(tI(_,y,o.recordOutputs),y),y=>{throw me(y,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:t}}}),y})));return Hs(h,m,"auto.ai.anthropic")}})}function zh(e,t="",n){return new Proxy(e,{get(r,o){const s=r[o],i=Jc(t,String(o)),a=Uv[i];return typeof s=="function"&&a?rI(s,i,a,r,n):typeof s=="function"?s.bind(r):s&&typeof s=="object"?zh(s,i,n):s}})}function oI(e,t){return zh(e,"",Mr(t))}const sI={"models.generateContent":{operation:"generate_content"},"models.generateContentStream":{operation:"generate_content",streaming:!0},"models.embedContent":{operation:"embeddings"},"chats.create":{proxyResultPath:"chat"},"chat.sendMessage":{operation:"chat"},"chat.sendMessageStream":{operation:"chat",streaming:!0}},iI="google_genai";function aI(e,t){const n=e?.promptFeedback;if(n?.blockReason){const r=n.blockReasonMessage??n.blockReason;return t.setStatus({code:ee,message:"internal_error"}),me(`Content blocked: ${r}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}function cI(e,t){typeof e.responseId=="string"&&(t.responseId=e.responseId),typeof e.modelVersion=="string"&&(t.responseModel=e.modelVersion);const n=e.usageMetadata;n&&(typeof n.promptTokenCount=="number"&&(t.promptTokens=n.promptTokenCount),typeof n.candidatesTokenCount=="number"&&(t.completionTokens=n.candidatesTokenCount),typeof n.totalTokenCount=="number"&&(t.totalTokens=n.totalTokenCount))}function uI(e,t,n){Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(const r of e.candidates??[]){r?.finishReason&&!t.finishReasons.includes(r.finishReason)&&t.finishReasons.push(r.finishReason);for(const o of r?.content?.parts??[])n&&o.text&&t.responseTexts.push(o.text),o.functionCall&&t.toolCalls.push({type:"function",id:o.functionCall.id,name:o.functionCall.name,arguments:o.functionCall.args})}}function lI(e,t,n,r){!e||aI(e,r)||(cI(e,t),uI(e,t,n))}async function*dI(e,t,n){const r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(const o of e)lI(o,r,n,t),yield o}finally{Ii(t,r,n)}}function jr(e,t="user"){return typeof e=="string"?[{role:t,content:e}]:Array.isArray(e)?e.flatMap(n=>jr(n,t)):typeof e!="object"||!e?[]:"role"in e&&typeof e.role=="string"?[e]:"parts"in e?[{...e,role:t}]:[{role:t,content:e}]}function ql(e,t){if("model"in e&&typeof e.model=="string")return e.model;if(t&&typeof t=="object"){const n=t;if("model"in n&&typeof n.model=="string")return n.model;if("modelVersion"in n&&typeof n.modelVersion=="string")return n.modelVersion}return"unknown"}function fI(e){const t={};return"temperature"in e&&typeof e.temperature=="number"&&(t[_i]=e.temperature),"topP"in e&&typeof e.topP=="number"&&(t[Si]=e.topP),"topK"in e&&typeof e.topK=="number"&&(t[Ah]=e.topK),"maxOutputTokens"in e&&typeof e.maxOutputTokens=="number"&&(t[zc]=e.maxOutputTokens),"frequencyPenalty"in e&&typeof e.frequencyPenalty=="number"&&(t[yi]=e.frequencyPenalty),"presencePenalty"in e&&typeof e.presencePenalty=="number"&&(t[qc]=e.presencePenalty),t}function pI(e,t,n){const r={[bo]:iI,[Bt]:e,[z]:"auto.ai.google_genai"};if(t){if(r[De]=ql(t,n),"config"in t&&typeof t.config=="object"&&t.config){const o=t.config;if(Object.assign(r,fI(o)),"tools"in o&&Array.isArray(o.tools)){const s=o.tools.flatMap(i=>i.functionDeclarations);r[Ei]=JSON.stringify(s)}}}else r[De]=ql({},n);return r}function Gl(e,t,n){if(n){const o=t.contents;o!=null&&e.setAttribute(Vc,typeof o=="string"?o:JSON.stringify(o));return}const r=[];if("config"in t&&t.config&&typeof t.config=="object"&&"systemInstruction"in t.config&&t.config.systemInstruction&&r.push(...jr(t.config.systemInstruction,"system")),"history"in t&&r.push(...jr(t.history,"user")),"contents"in t&&r.push(...jr(t.contents,"user")),"message"in t&&r.push(...jr(t.message,"user")),Array.isArray(r)&&r.length){const{systemInstructions:o,filteredMessages:s}=To(r);o&&e.setAttribute(Eo,o);const i=Array.isArray(s)?s.length:0;e.setAttributes({[Dn]:i,[xr]:JSON.stringify(vi(s))})}}function hI(e,t,n){if(!(!t||typeof t!="object")){if(t.modelVersion&&e.setAttribute(Cr,t.modelVersion),t.usageMetadata&&typeof t.usageMetadata=="object"){const r=t.usageMetadata;typeof r.promptTokenCount=="number"&&e.setAttributes({[Pn]:r.promptTokenCount}),typeof r.candidatesTokenCount=="number"&&e.setAttributes({[Ln]:r.candidatesTokenCount}),typeof r.totalTokenCount=="number"&&e.setAttributes({[an]:r.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){const r=t.candidates.map(o=>o.content?.parts&&Array.isArray(o.content.parts)?o.content.parts.map(s=>typeof s.text=="string"?s.text:"").filter(s=>s.length>0).join(""):"").filter(o=>o.length>0);r.length>0&&e.setAttributes({[St]:r.join("")})}if(n&&t.functionCalls){const r=t.functionCalls;Array.isArray(r)&&r.length>0&&e.setAttributes({[Qt]:JSON.stringify(r)})}}}function mI(e,t,n,r,o){const s=n.operation==="embeddings";return new Proxy(e,{apply(i,a,c){const u=n.operation||"unknown",d=c[0],l=pI(u,d,r),f=l[De]??"unknown";return n.streaming?Rt({name:`${u} ${f}`,op:`gen_ai.${u}`,attributes:l},async p=>{try{o.recordInputs&&d&&Gl(p,d,s);const h=await i.apply(r,c);return dI(h,p,!!o.recordOutputs)}catch(h){throw p.setStatus({code:ee,message:"internal_error"}),me(h,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}}),p.end(),h}}):zt({name:`${u} ${f}`,op:`gen_ai.${u}`,attributes:l},p=>(o.recordInputs&&d&&Gl(p,d,s),vc(()=>i.apply(r,c),h=>{me(h,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}})},()=>{},h=>{s||hI(p,h,o.recordOutputs)})))}})}function $a(e,t="",n){return new Proxy(e,{get:(r,o,s)=>{const i=Reflect.get(r,o,s),a=Jc(t,String(o)),c=sI[a];if(typeof i=="function"&&c){const u=c.operation?mI(i,a,c,r,n):i.bind(r);return c.proxyResultPath?function(...d){const l=u(...d);return l&&typeof l=="object"?$a(l,c.proxyResultPath,n):l}:u}return typeof i=="function"?i.bind(r):i&&typeof i=="object"?$a(i,a,n):i}})}function gI(e,t){return $a(e,"",Mr(t))}const Kn="auto.ai.langchain",_I={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"},Ze=(e,t,n)=>{n!=null&&(e[t]=n)},Ve=(e,t,n)=>{const r=Number(n);Number.isNaN(r)||(e[t]=r)};function Ot(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function jn(e){if(Array.isArray(e))try{const t=e.map(n=>n&&typeof n=="object"&&rr(n)?Gr(n):n);return JSON.stringify(t)}catch{return String(e)}return Ot(e)}function Hr(e){const t=e.toLowerCase();return _I[t]??t}function Vl(e){return e.includes("System")?"system":e.includes("Human")?"user":e.includes("AI")||e.includes("Assistant")?"assistant":e.includes("Function")?"function":e.includes("Tool")?"tool":"user"}function Yl(e){if(!(!e||Array.isArray(e)))return e.invocation_params}function Kc(e){return e.map(t=>{const n=t._getType;if(typeof n=="function"){const o=n.call(t);return{role:Hr(o),content:jn(t.content)}}if(t.lc===1&&t.kwargs){const o=t.id,s=Array.isArray(o)&&o.length>0?o[o.length-1]:"",i=typeof s=="string"?Vl(s):"user";return{role:Hr(i),content:jn(t.kwargs?.content)}}if(t.type){const o=String(t.type).toLowerCase();return{role:Hr(o),content:jn(t.content)}}if(t.role)return{role:Hr(String(t.role)),content:jn(t.content)};const r=t.constructor?.name;return r&&r!=="Object"?{role:Hr(Vl(r)),content:jn(t.content)}:{role:"user",content:jn(t.content)}})}function yI(e,t,n){const r={},o="kwargs"in e?e.kwargs:void 0,s=t?.temperature??n?.ls_temperature??o?.temperature;Ve(r,_i,s);const i=t?.max_tokens??n?.ls_max_tokens??o?.max_tokens;Ve(r,zc,i);const a=t?.top_p??o?.top_p;Ve(r,Si,a);const c=t?.frequency_penalty;Ve(r,yi,c);const u=t?.presence_penalty;return Ve(r,qc,u),t&&"stream"in t&&Ze(r,jc,!!t.stream),r}function qh(e,t,n,r,o){return{[bo]:Ot(e??"langchain"),[Bt]:"chat",[De]:Ot(t),[z]:Kn,...yI(n,r,o)}}function SI(e,t,n,r,o){const s=o?.ls_provider,i=r?.model??o?.ls_model_name??"unknown",a=qh(s,i,e,r,o);if(n&&Array.isArray(t)&&t.length>0){Ze(a,Dn,t.length);const c=t.map(u=>({role:"user",content:u}));Ze(a,xr,Ot(c))}return a}function bI(e,t,n,r,o){const s=o?.ls_provider??e.id?.[2],i=r?.model??o?.ls_model_name??"unknown",a=qh(s,i,e,r,o);if(n&&Array.isArray(t)&&t.length>0){const c=Kc(t.flat()),{systemInstructions:u,filteredMessages:d}=To(c);u&&Ze(a,Eo,u);const l=Array.isArray(d)?d.length:0;Ze(a,Dn,l);const f=vi(d);Ze(a,xr,Ot(f))}return a}function EI(e,t){const n=[],r=e.flat();for(const o of r){const s=o.message?.content;if(Array.isArray(s))for(const i of s){const a=i;a.type==="tool_use"&&n.push(a)}}n.length>0&&Ze(t,Qt,Ot(n))}function TI(e,t){if(!e)return;const n=e.tokenUsage,r=e.usage;if(n)Ve(t,Pn,n.promptTokens),Ve(t,Ln,n.completionTokens),Ve(t,an,n.totalTokens);else if(r){Ve(t,Pn,r.input_tokens),Ve(t,Ln,r.output_tokens);const o=Number(r.input_tokens),s=Number(r.output_tokens),i=(Number.isNaN(o)?0:o)+(Number.isNaN(s)?0:s);i>0&&Ve(t,an,i),r.cache_creation_input_tokens!==void 0&&Ve(t,QT,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&Ve(t,ZT,r.cache_read_input_tokens)}}function vI(e,t){if(!e)return;const n={};if(Array.isArray(e.generations)){const u=e.generations.flat().map(d=>d.generationInfo?.finish_reason?d.generationInfo.finish_reason:d.generation_info?.finish_reason?d.generation_info.finish_reason:null).filter(d=>typeof d=="string");if(u.length>0&&Ze(n,nr,Ot(u)),EI(e.generations,n),t){const d=e.generations.flat().map(l=>l.text??l.message?.content).filter(l=>typeof l=="string");d.length>0&&Ze(n,St,Ot(d))}}TI(e.llmOutput,n);const r=e.llmOutput,s=e.generations?.[0]?.[0]?.message,i=r?.model_name??r?.model??s?.response_metadata?.model_name;i&&Ze(n,Cr,i);const a=r?.id??s?.id;a&&Ze(n,bi,a);const c=r?.stop_reason??s?.response_metadata?.finish_reason;return c&&Ze(n,JT,Ot(c)),n}function II(e={}){const{recordInputs:t,recordOutputs:n}=Mr(e),r=new Map,o=i=>{const a=r.get(i);a?.isRecording()&&(a.end(),r.delete(i))},s={lc_serializable:!1,lc_namespace:["langchain_core","callbacks","sentry"],lc_secrets:void 0,lc_attributes:void 0,lc_aliases:void 0,lc_serializable_keys:void 0,lc_id:["langchain_core","callbacks","sentry"],lc_kwargs:{},name:"SentryCallbackHandler",ignoreLLM:!1,ignoreChain:!1,ignoreAgent:!1,ignoreRetriever:!1,ignoreCustomEvent:!1,raiseError:!1,awaitHandlers:!0,handleLLMStart(i,a,c,u,d,l,f,p){const h=Yl(l),m=SI(i,a,t,h,f),_=m[De],y=m[Bt];Rt({name:`${y} ${_}`,op:"gen_ai.chat",attributes:{...m,[ce]:"gen_ai.chat"}},S=>(r.set(c,S),S))},handleChatModelStart(i,a,c,u,d,l,f,p){const h=Yl(l),m=bI(i,a,t,h,f),_=m[De],y=m[Bt];Rt({name:`${y} ${_}`,op:"gen_ai.chat",attributes:{...m,[ce]:"gen_ai.chat"}},S=>(r.set(c,S),S))},handleLLMEnd(i,a,c,u,d){const l=r.get(a);if(l?.isRecording()){const f=vI(i,n);f&&l.setAttributes(f),o(a)}},handleLLMError(i,a){const c=r.get(a);c?.isRecording()&&(c.setStatus({code:ee,message:"internal_error"}),o(a)),me(i,{mechanism:{handled:!1,type:`${Kn}.llm_error_handler`}})},handleChainStart(i,a,c,u,d,l,f,p){const h=p||i.name||"unknown_chain",m={[z]:"auto.ai.langchain","langchain.chain.name":h};t&&(m["langchain.chain.inputs"]=JSON.stringify(a)),Rt({name:`chain ${h}`,op:"gen_ai.invoke_agent",attributes:{...m,[ce]:"gen_ai.invoke_agent"}},_=>(r.set(c,_),_))},handleChainEnd(i,a){const c=r.get(a);c?.isRecording()&&(n&&c.setAttributes({"langchain.chain.outputs":JSON.stringify(i)}),o(a))},handleChainError(i,a){const c=r.get(a);c?.isRecording()&&(c.setStatus({code:ee,message:"internal_error"}),o(a)),me(i,{mechanism:{handled:!1,type:`${Kn}.chain_error_handler`}})},handleToolStart(i,a,c,u){const d=i.name||"unknown_tool",l={[z]:Kn,[tv]:d};t&&(l[nv]=a),Rt({name:`execute_tool ${d}`,op:"gen_ai.execute_tool",attributes:{...l,[ce]:"gen_ai.execute_tool"}},f=>(r.set(c,f),f))},handleToolEnd(i,a){const c=r.get(a);c?.isRecording()&&(n&&c.setAttributes({[rv]:JSON.stringify(i)}),o(a))},handleToolError(i,a){const c=r.get(a);c?.isRecording()&&(c.setStatus({code:ee,message:"internal_error"}),o(a)),me(i,{mechanism:{handled:!1,type:`${Kn}.tool_error_handler`}})},copy(){return s},toJSON(){return{lc:1,type:"not_implemented",id:s.lc_id}},toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:s.lc_id}}};return s}const Gh="auto.ai.langgraph";function wI(e){if(!e||e.length===0)return null;const t=[];for(const n of e)if(n&&typeof n=="object"){const r=n.tool_calls;r&&Array.isArray(r)&&t.push(...r)}return t.length>0?t:null}function kI(e){const t=e;let n=0,r=0,o=0;if(t.usage_metadata&&typeof t.usage_metadata=="object"){const s=t.usage_metadata;return typeof s.input_tokens=="number"&&(n=s.input_tokens),typeof s.output_tokens=="number"&&(r=s.output_tokens),typeof s.total_tokens=="number"&&(o=s.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:o}}if(t.response_metadata&&typeof t.response_metadata=="object"){const s=t.response_metadata;if(s.tokenUsage&&typeof s.tokenUsage=="object"){const i=s.tokenUsage;typeof i.promptTokens=="number"&&(n=i.promptTokens),typeof i.completionTokens=="number"&&(r=i.completionTokens),typeof i.totalTokens=="number"&&(o=i.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:o}}function RI(e,t){const n=t;if(n.response_metadata&&typeof n.response_metadata=="object"){const r=n.response_metadata;r.model_name&&typeof r.model_name=="string"&&e.setAttribute(Cr,r.model_name),r.finish_reason&&typeof r.finish_reason=="string"&&e.setAttribute(nr,[r.finish_reason])}}function AI(e){if(!e.builder?.nodes?.tools?.runnable?.tools)return null;const t=e.builder?.nodes?.tools?.runnable?.tools;return!t||!Array.isArray(t)||t.length===0?null:t.map(n=>({name:n.lc_kwargs?.name,description:n.lc_kwargs?.description,schema:n.lc_kwargs?.schema}))}function CI(e,t,n){const o=n?.messages;if(!o||!Array.isArray(o))return;const s=t?.length??0,i=o.length>s?o.slice(s):[];if(i.length===0)return;const a=wI(i);a&&e.setAttribute(Qt,JSON.stringify(a));const c=Kc(i);e.setAttribute(St,JSON.stringify(c));let u=0,d=0,l=0;for(const f of i){const p=kI(f);u+=p.inputTokens,d+=p.outputTokens,l+=p.totalTokens,RI(e,f)}u>0&&e.setAttribute(Pn,u),d>0&&e.setAttribute(Ln,d),l>0&&e.setAttribute(an,l)}function xI(e,t){return new Proxy(e,{apply(n,r,o){return zt({op:"gen_ai.create_agent",name:"create_agent",attributes:{[z]:Gh,[ce]:"gen_ai.create_agent",[Bt]:"create_agent"}},s=>{try{const i=Reflect.apply(n,r,o),a=o.length>0?o[0]:{};a?.name&&typeof a.name=="string"&&(s.setAttribute(Mh,a.name),s.updateName(`create_agent ${a.name}`));const c=i.invoke;return c&&typeof c=="function"&&(i.invoke=MI(c.bind(i),i,a,t)),i}catch(i){throw s.setStatus({code:ee,message:"internal_error"}),me(i,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),i}})}})}function MI(e,t,n,r){return new Proxy(e,{apply(o,s,i){return zt({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[z]:Gh,[ce]:ev,[Bt]:"invoke_agent"}},async a=>{try{const c=n?.name;c&&typeof c=="string"&&(a.setAttribute(XT,c),a.setAttribute(Mh,c),a.updateName(`invoke_agent ${c}`));const l=(i.length>1?i[1]:void 0)?.configurable?.thread_id;l&&typeof l=="string"&&a.setAttribute(Gc,l);const f=AI(t);f&&a.setAttribute(Ei,JSON.stringify(f));const p=r.recordInputs,h=r.recordOutputs,m=i.length>0?i[0]?.messages??[]:[];if(m&&p){const y=Kc(m),{systemInstructions:S,filteredMessages:M}=To(y);S&&a.setAttribute(Eo,S);const I=vi(M),L=Array.isArray(M)?M.length:0;a.setAttributes({[xr]:JSON.stringify(I),[Dn]:L})}const _=await Reflect.apply(o,s,i);return h&&CI(a,m??null,_),_}catch(c){throw a.setStatus({code:ee,message:"internal_error"}),me(c,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),c}})}})}function NI(e,t){return e.compile=xI(e.compile,Mr(t)),e}function OI(e,t,n){const r=n.getDsn(),o=n.getOptions().tunnel,s=_o(n.getOptions()._metadata),i={sent_at:new Date().toISOString(),...PI(t)&&{trace:t},...s&&{sdk:s},...!!o&&r&&{dsn:It(r)}},a=[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},{items:e}];return st(i,[a])}function PI(e){return!!e.trace_id&&!!e.public_key}function LI(e){let t=156;if(t+=e.name.length*2,t+=Qu(e.attributes),e.links&&e.links.length>0){const r=e.links[0]?.attributes,o=100+(r?Qu(r):0);t+=o*e.links.length}return t}const Jl=1e3,DI=5e6;class FI{constructor(t,n){this._traceBuckets=new Map,this._client=t;const{maxSpanLimit:r,flushInterval:o,maxTraceWeightInBytes:s}=n??{};this._maxSpanLimit=r&&r>0&&r<=Jl?r:Jl,this._flushInterval=o&&o>0?o:5e3,this._maxTraceWeight=s&&s>0?s:DI,this._client.on("flush",()=>{this.drain()}),this._client.on("close",()=>{this._traceBuckets.forEach(i=>{clearTimeout(i.timeout)}),this._traceBuckets.clear()})}add(t){const n=t.trace_id;let r=this._traceBuckets.get(n);r||(r={spans:new Set,size:0,timeout:hi(setTimeout(()=>{this.flush(n)},this._flushInterval))},this._traceBuckets.set(n,r)),r.spans.add(t),r.size+=LI(t),(r.spans.size>=this._maxSpanLimit||r.size>=this._maxTraceWeight)&&this.flush(n)}drain(){this._traceBuckets.size&&(w&&g.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((t,n)=>{this.flush(n)}))}flush(t){const n=this._traceBuckets.get(t);if(!n)return;if(!n.spans.size){this._removeTrace(t);return}const r=Array.from(n.spans),o=r[0]?._segmentSpan;if(!o){w&&g.warn("No segment span reference found on span JSON, cannot compute DSC"),this._removeTrace(t);return}const s=rt(o),i=r.map(c=>{const{_segmentSpan:u,...d}=c;return d}),a=OI(i,s,this._client);w&&g.log(`Sending span envelope for trace ${t} with ${i.length} spans`),this._client.sendEnvelope(a).then(null,c=>{w&&g.error("Error while sending streamed span envelope:",c)}),this._removeTrace(t)}_removeTrace(t){const n=this._traceBuckets.get(t);n&&clearTimeout(n.timeout),this._traceBuckets.delete(t)}}function Vh(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const dr=$;function $I(){return"history"in dr&&!!dr.history}function BI(){if(!("fetch"in dr))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function Ba(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Yh(){if(typeof EdgeRuntime=="string")return!0;if(!BI())return!1;if(Ba(dr.fetch))return!0;let e=!1;const t=dr.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=Ba(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){w&&g.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function UI(){return"ReportingObserver"in dr}function Xc(e,t){const n="fetch";ln(n,e),dn(n,()=>Jh(void 0,t))}function HI(e){const t="fetch-body-resolved";ln(t,e),dn(t,()=>Jh(jI))}function Jh(e,t=!1){t&&!Yh()||Le($,"fetch",function(n){return function(...r){const o=new Error,{method:s,url:i}=zI(r),a={args:r,fetchData:{method:s,url:i},startTimestamp:he()*1e3,virtualError:o,headers:qI(r)};return e||et("fetch",{...a}),n.apply($,r).then(async c=>(e?e(c):et("fetch",{...a,endTimestamp:he()*1e3,response:c}),c),c=>{et("fetch",{...a,endTimestamp:he()*1e3,error:c}),yt(c)&&c.stack===void 0&&(c.stack=o.stack,Se(c,"framesToPop",1));const d=C()?.getOptions().enhanceFetchErrorMessages??"always";if(d!==!1&&c instanceof TypeError&&(c.message==="Failed to fetch"||c.message==="Load failed"||c.message==="NetworkError when attempting to fetch resource."))try{const p=new URL(a.fetchData.url).host;d==="always"?c.message=`${c.message} (${p})`:Se(c,"__sentry_fetch_url_host__",p)}catch{}throw c})}})}async function WI(e,t){if(e?.body){const n=e.body,r=n.getReader(),o=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let s=!0;for(;s;){let i;try{i=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:a}=await r.read();clearTimeout(i),a&&(t(),s=!1)}catch{s=!1}finally{clearTimeout(i)}}clearTimeout(o),r.releaseLock(),n.cancel().then(null,()=>{})}}function jI(e){let t;try{t=e.clone()}catch{return}WI(t,()=>{et("fetch-body-resolved",{endTimestamp:he()*1e3,response:e})})}function fs(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Kl(e){return typeof e=="string"?e:e?fs(e,"url")?e.url:e.toString?e.toString():"":""}function zI(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:Kl(n),method:fs(r,"method")?String(r.method).toUpperCase():_c(n)&&fs(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:Kl(t),method:fs(t,"method")?String(t.method).toUpperCase():"GET"}}function qI(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(_c(t))return new Headers(t.headers)}catch{}}function GI(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function VI(){return"npm"}function YI(){return!GI()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Ws(){return typeof window<"u"&&(!YI()||JI())}function JI(){return $.process?.type==="renderer"}function KI(e){const t=e.constructor?.name??"";return t.includes("OpenAI")?"openai":t.includes("Google")?"google_genai":t.includes("Mistral")?"mistralai":t.includes("Vertex")?"google_vertexai":t.includes("Bedrock")?"aws_bedrock":t.includes("Ollama")?"ollama":t.includes("Cloudflare")?"cloudflare":t.includes("Cohere")?"cohere":"langchain"}function XI(e){const t=e??{},n={[z]:Kn,[ce]:Nh,[Bt]:"embeddings",[De]:t.model??"unknown"};return n[bo]=KI(t),"dimensions"in t&&(n[xh]=t.dimensions),"encodingFormat"in t&&(n[Ch]=t.encodingFormat),n}function Xl(e,t={}){const{recordInputs:n}=Mr(t);return new Proxy(e,{apply(r,o,s){const i=XI(o),a=i[De]||"unknown";if(n){const c=s[0];c!=null&&(i[Vc]=typeof c=="string"?c:JSON.stringify(c))}return zt({name:`embeddings ${a}`,op:Nh,attributes:i},()=>Reflect.apply(r,o,s).then(void 0,c=>{throw me(c,{mechanism:{handled:!1,type:"auto.ai.langchain"}}),c}))}})}function QI(e,t){const n=e;return typeof n.embedQuery=="function"&&(n.embedQuery=Xl(n.embedQuery,t)),typeof n.embedDocuments=="function"&&(n.embedDocuments=Xl(n.embedDocuments,t)),e}const dt=$,ue=dt.document,zr=dt.navigator,Kh="Report a Bug",ZI="Cancel",e0="Send Bug Report",t0="Confirm",n0="Report a Bug",r0="your.email@example.org",o0="Email",s0="What's the bug? What did you expect?",i0="Description",a0="Your Name",c0="Name",u0="Thank you for your report!",l0="(required)",d0="Add a screenshot",f0="Remove screenshot",p0="Highlight",h0="Hide",m0="Remove",g0="widget",_0="api",y0=5e3,Xh=(e,t={includeReplay:!0})=>{if(!e.message)throw new Error("Unable to submit feedback with empty message");const n=C();if(!n)throw new Error("No client setup, cannot send feedback.");e.tags&&Object.keys(e.tags).length&&j().setTags(e.tags);const r=wh({source:_0,url:Bn(),...e},t);return new Promise((o,s)=>{const i=setTimeout(()=>s("Unable to determine if Feedback was correctly sent."),3e4),a=n.on("afterSendEvent",(c,u)=>{if(c.event_id===r)return clearTimeout(i),a(),u?.statusCode&&u.statusCode>=200&&u.statusCode<300?o(r):u?.statusCode===403?s("Unable to send feedback. This could be because this domain is not in your list of allowed domains."):s("Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.")})})},ps=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function S0(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(zr.userAgent)||/Macintosh/i.test(zr.userAgent)&&zr.maxTouchPoints&&zr.maxTouchPoints>1||!isSecureContext)}function zo(e,t){return{...e,...t,tags:{...e.tags,...t.tags},onFormOpen:()=>{t.onFormOpen?.(),e.onFormOpen?.()},onFormClose:()=>{t.onFormClose?.(),e.onFormClose?.()},onSubmitSuccess:(n,r)=>{t.onSubmitSuccess?.(n,r),e.onSubmitSuccess?.(n,r)},onSubmitError:n=>{t.onSubmitError?.(n),e.onSubmitError?.(n)},onFormSubmitted:()=>{t.onFormSubmitted?.(),e.onFormSubmitted?.()},themeDark:{...e.themeDark,...t.themeDark},themeLight:{...e.themeLight,...t.themeLight}}}function b0(e){const t=ue.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 Je(e,t){return Object.entries(t).forEach(([n,r])=>{e.setAttributeNS(null,n,r)}),e}const zn=20,E0="http://www.w3.org/2000/svg";function T0(){const e=a=>dt.document.createElementNS(E0,a),t=Je(e("svg"),{width:`${zn}`,height:`${zn}`,viewBox:`0 0 ${zn} ${zn}`,fill:"var(--actor-color, var(--foreground))"}),n=Je(e("g"),{clipPath:"url(#clip0_57_80)"}),r=Je(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.6622 15H12.3997C12.2129 14.9959 12.031 14.9396 11.8747 14.8375L8.04965 12.2H7.49956V19.1C7.4875 19.3348 7.3888 19.5568 7.22256 19.723C7.05632 19.8892 6.83435 19.9879 6.59956 20H2.04956C1.80193 19.9968 1.56535 19.8969 1.39023 19.7218C1.21511 19.5467 1.1153 19.3101 1.11206 19.0625V12.2H0.949652C0.824431 12.2017 0.700142 12.1783 0.584123 12.1311C0.468104 12.084 0.362708 12.014 0.274155 11.9255C0.185602 11.8369 0.115689 11.7315 0.0685419 11.6155C0.0213952 11.4995 -0.00202913 11.3752 -0.00034808 11.25V3.75C-0.00900498 3.62067 0.0092504 3.49095 0.0532651 3.36904C0.0972798 3.24712 0.166097 3.13566 0.255372 3.04168C0.344646 2.94771 0.452437 2.87327 0.571937 2.82307C0.691437 2.77286 0.82005 2.74798 0.949652 2.75H8.04965L11.8747 0.1625C12.031 0.0603649 12.2129 0.00407221 12.3997 0H15.6622C15.9098 0.00323746 16.1464 0.103049 16.3215 0.278167C16.4966 0.453286 16.5964 0.689866 16.5997 0.9375V3.25269C17.3969 3.42959 18.1345 3.83026 18.7211 4.41679C19.5322 5.22788 19.9878 6.32796 19.9878 7.47502C19.9878 8.62209 19.5322 9.72217 18.7211 10.5333C18.1345 11.1198 17.3969 11.5205 16.5997 11.6974V14.0125C16.6047 14.1393 16.5842 14.2659 16.5395 14.3847C16.4948 14.5035 16.4268 14.6121 16.3394 14.7042C16.252 14.7962 16.147 14.8698 16.0307 14.9206C15.9144 14.9714 15.7891 14.9984 15.6622 15ZM1.89695 10.325H1.88715V4.625H8.33715C8.52423 4.62301 8.70666 4.56654 8.86215 4.4625L12.6872 1.875H14.7247V13.125H12.6872L8.86215 10.4875C8.70666 10.3835 8.52423 10.327 8.33715 10.325H2.20217C2.15205 10.3167 2.10102 10.3125 2.04956 10.3125C1.9981 10.3125 1.94708 10.3167 1.89695 10.325ZM2.98706 12.2V18.1625H5.66206V12.2H2.98706ZM16.5997 9.93612V5.01393C16.6536 5.02355 16.7072 5.03495 16.7605 5.04814C17.1202 5.13709 17.4556 5.30487 17.7425 5.53934C18.0293 5.77381 18.2605 6.06912 18.4192 6.40389C18.578 6.73866 18.6603 7.10452 18.6603 7.47502C18.6603 7.84552 18.578 8.21139 18.4192 8.54616C18.2605 8.88093 18.0293 9.17624 17.7425 9.41071C17.4556 9.64518 17.1202 9.81296 16.7605 9.90191C16.7072 9.91509 16.6536 9.9265 16.5997 9.93612Z"});t.appendChild(n).appendChild(r);const o=e("defs"),s=Je(e("clipPath"),{id:"clip0_57_80"}),i=Je(e("rect"),{width:`${zn}`,height:`${zn}`,fill:"white"});return s.appendChild(i),o.appendChild(s),t.appendChild(o).appendChild(s).appendChild(i),t}function v0({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){const o=ue.createElement("button");if(o.type="button",o.className="widget__actor",o.ariaHidden="false",o.ariaLabel=t||e||Kh,o.appendChild(T0()),e){const i=ue.createElement("span");i.appendChild(ue.createTextNode(e)),o.appendChild(i)}const s=b0(r);return{el:o,appendToDom(){n.appendChild(s),n.appendChild(o)},removeFromDom(){o.remove(),s.remove()},show(){o.ariaHidden="false"},hide(){o.ariaHidden="true"}}}const Qh="rgba(88, 74, 192, 1)",I0={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:Qh,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%)"},Ql={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackground:Qh,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 Zl(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 ed({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){const o=ue.createElement("style");return o.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};`:""} ${Zl(e==="dark"?{...Ql,...t}:{...I0,...n})} } ${e==="system"?` @media (prefers-color-scheme: dark) { :host { color-scheme: only dark; ${Zl({...Ql,...t})} } }`:""} `,r&&o.setAttribute("nonce",r),o}const Zh=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>({id:o="sentry-feedback",autoInject:s=!0,showBranding:i=!0,isEmailRequired:a=!1,isNameRequired:c=!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:y={},themeDark:S={},addScreenshotButtonLabel:M=d0,cancelButtonLabel:I=ZI,confirmButtonLabel:L=t0,emailLabel:N=o0,emailPlaceholder:b=r0,formTitle:x=n0,isRequiredLabel:H=l0,messageLabel:E=i0,messagePlaceholder:P=s0,nameLabel:A=c0,namePlaceholder:O=a0,removeScreenshotButtonLabel:D=f0,submitButtonLabel:Z=e0,successMessageText:X=u0,triggerLabel:ne=Kh,triggerAriaLabel:v="",highlightToolText:q=p0,hideToolText:k=h0,removeHighlightText:V=m0,onFormOpen:ae,onFormClose:re,onSubmitSuccess:ve,onSubmitError:$e,onFormSubmitted:qt}={})=>{const Me={id:o,autoInject:s,showBranding:i,isEmailRequired:a,isNameRequired:c,showEmail:u,showName:d,enableScreenshot:l,useSentryUser:f,tags:p,styleNonce:h,scriptNonce:m,colorScheme:_,themeDark:S,themeLight:y,triggerLabel:ne,triggerAriaLabel:v,cancelButtonLabel:I,submitButtonLabel:Z,confirmButtonLabel:L,formTitle:x,emailLabel:N,emailPlaceholder:b,messageLabel:E,messagePlaceholder:P,nameLabel:A,namePlaceholder:O,successMessageText:X,isRequiredLabel:H,addScreenshotButtonLabel:M,removeScreenshotButtonLabel:D,highlightToolText:q,hideToolText:k,removeHighlightText:V,onFormClose:re,onFormOpen:ae,onSubmitError:$e,onSubmitSuccess:ve,onFormSubmitted:qt};let Ne=null,it=null,at=[];const Fr=oe=>{if(!Ne){const ge=ue.createElement("div");ge.id=String(oe.id),ue.body.appendChild(ge),Ne=ge.attachShadow({mode:"open"}),it=ed(oe),Ne.appendChild(it)}return Ne},Bo=async oe=>{const ge=oe.enableScreenshot&&S0();let Xe,Ae;try{Xe=(t?t():await e("feedbackModalIntegration",m))(),Ps(Xe)}catch{throw ps&&g.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 K=ge?n?n():await e("feedbackScreenshotIntegration",m):void 0;K&&(Ae=K(),Ps(Ae))}catch{ps&&g.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}const Be=Xe.createDialog({options:{...oe,onFormClose:()=>{Be?.close(),oe.onFormClose?.()},onFormSubmitted:()=>{Be?.close(),oe.onFormSubmitted?.()}},screenshotIntegration:Ae,sendFeedback:Xh,shadow:Fr(oe)});return Be},Uo=(oe,ge={})=>{const Xe=zo(Me,ge),Ae=typeof oe=="string"?ue.querySelector(oe):typeof oe.addEventListener=="function"?oe:null;if(!Ae)throw ps&&g.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let Be=null;const K=async()=>{Be||(Be=await Bo({...Xe,onFormSubmitted:()=>{Be?.removeFromDom(),Xe.onFormSubmitted?.()}})),Be.appendToDom(),Be.open()};Ae.addEventListener("click",K);const Ue=()=>{at=at.filter(Q=>Q!==Ue),Be?.removeFromDom(),Be=null,Ae.removeEventListener("click",K)};return at.push(Ue),Ue},ct=(oe={})=>{const ge=zo(Me,oe),Xe=Fr(ge),Ae=v0({triggerLabel:ge.triggerLabel,triggerAriaLabel:ge.triggerAriaLabel,shadow:Xe,styleNonce:h});return Uo(Ae.el,{...ge,onFormOpen(){Ae.hide()},onFormClose(){Ae.show()},onFormSubmitted(){Ae.show()}}),Ae};return{name:"Feedback",setupOnce(){!Ws()||!Me.autoInject||(ue.readyState==="loading"?ue.addEventListener("DOMContentLoaded",()=>ct().appendToDom()):ct().appendToDom())},attachTo:Uo,createWidget(oe={}){const ge=ct(zo(Me,oe));return ge.appendToDom(),ge},async createForm(oe={}){return Bo(zo(Me,oe))},setTheme(oe){if(Me.colorScheme=oe,Ne){const ge=ed(Me);it?Ne.replaceChild(ge,it):Ne.prepend(ge),it=ge}},remove(){Ne&&(Ne.parentElement?.remove(),Ne=null,it=null),at.forEach(oe=>oe()),at=[]}}};function w0(){return C()?.getIntegrationByName("Feedback")}var wi,de,em,Sn,td,tm,Ua,ro={},Qc=[],k0=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Zc=Array.isArray;function Kt(e,t){for(var n in t)e[n]=t[n];return e}function nm(e){var t=e.parentNode;t&&t.removeChild(e)}function J(e,t,n){var r,o,s,i={};for(s in t)s=="key"?r=t[s]:s=="ref"?o=t[s]:i[s]=t[s];if(arguments.length>2&&(i.children=arguments.length>3?wi.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)i[s]===void 0&&(i[s]=e.defaultProps[s]);return hs(e,i,r,o,null)}function hs(e,t,n,r,o){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++em,__i:-1,__u:0};return o==null&&de.vnode!=null&&de.vnode(s),s}function vo(e){return e.children}function ms(e,t){this.props=e,this.context=t}function fr(e,t){if(t==null)return e.__?fr(e.__,e.__i+1):null;for(var n;tn?(Ha(r,t,o),o.length=r.length=0,t=void 0,Sn.sort(Ua)):t&&de.__c&&de.__c(t,Qc));t&&Ha(r,t,o),js.__r=0}function om(e,t,n,r,o,s,i,a,c,u,d){var l,f,p,h,m,_=r&&r.__k||Qc,y=t.length;for(n.__d=c,A0(n,t,_),c=n.__d,l=0;l0?hs(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,a=C0(o,n,i=r+l,d),o.__i=a,s=null,a!==-1&&(d--,(s=n[a])&&(s.__u|=131072)),s==null||s.__v===null?(a==-1&&l--,typeof o.type!="function"&&(o.__u|=65536)):a!==i&&(a===i+1?l++:a>i?d>c-i?l+=a-i:l--:l=a(c!=null&&(131072&c.__u)==0?1:0))for(;i>=0||a=0){if((c=t[i])&&(131072&c.__u)==0&&o==c.key&&s===c.type)return i;i--}if(a=n.__.length&&n.__.push({__V:gs}),n.__[e]}function En(e){return pr=1,am(um,e)}function am(e,t,n){var r=Hn(Ut++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):um(void 0,t),function(a){var c=r.__N?r.__N[0]:r.__[0],u=r.t(c,a);c!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=le,!le.u)){var o=function(a,c,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!s||s.call(this,a,c,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===a)&&(!s||s.call(this,a,c,u))};le.u=!0;var s=le.shouldComponentUpdate,i=le.componentWillUpdate;le.componentWillUpdate=function(a,c,u){if(this.__e){var d=s;s=void 0,o(a,c,u),s=d}i&&i.call(this,a,c,u)},le.shouldComponentUpdate=o}return r.__N||r.__}function O0(e,t){var n=Hn(Ut++,3);!_e.__s&&nu(n.__H,t)&&(n.__=e,n.i=t,le.__H.__h.push(n))}function cm(e,t){var n=Hn(Ut++,4);!_e.__s&&nu(n.__H,t)&&(n.__=e,n.i=t,le.__h.push(n))}function P0(e){return pr=5,Io(function(){return{current:e}},[])}function L0(e,t,n){pr=6,cm(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 Io(e,t){var n=Hn(Ut++,7);return nu(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function or(e,t){return pr=8,Io(function(){return e},t)}function D0(e){var t=le.context[e.__c],n=Hn(Ut++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(le)),t.props.value):e.__}function F0(e,t){_e.useDebugValue&&_e.useDebugValue(t?t(e):e)}function $0(e){var t=Hn(Ut++,10),n=En();return t.__=e,le.componentDidCatch||(le.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function B0(){var e=Hn(Ut++,11);if(!e.__){for(var t=le.__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 U0(){for(var e;e=im.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(_s),e.__H.__h.forEach(ja),e.__H.__h=[]}catch(t){e.__H.__h=[],_e.__e(t,e.__v)}}_e.__b=function(e){le=null,ad&&ad(e)},_e.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),fd&&fd(e,t)},_e.__r=function(e){cd&&cd(e),Ut=0;var t=(le=e.__c).__H;t&&(ea===le?(t.__h=[],le.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=gs,n.__N=n.i=void 0})):(t.__h.forEach(_s),t.__h.forEach(ja),t.__h=[],Ut=0)),ea=le},_e.diffed=function(e){ud&&ud(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(im.push(t)!==1&&id===_e.requestAnimationFrame||((id=_e.requestAnimationFrame)||H0)(U0)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==gs&&(n.__=n.__V),n.i=void 0,n.__V=gs})),ea=le=null},_e.__c=function(e,t){t.some(function(n){try{n.__h.forEach(_s),n.__h=n.__h.filter(function(r){return!r.__||ja(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],_e.__e(r,n.__v)}}),ld&&ld(e,t)},_e.unmount=function(e){dd&&dd(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{_s(r)}catch(o){t=o}}),n.__H=void 0,t&&_e.__e(t,n.__v))};var pd=typeof requestAnimationFrame=="function";function H0(e){var t,n=function(){clearTimeout(r),pd&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);pd&&(t=requestAnimationFrame(n))}function _s(e){var t=le,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),le=t}function ja(e){var t=le;e.__c=e.__(),le=t}function nu(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function um(e,t){return typeof t=="function"?t(e):t}const W0=Object.defineProperty({__proto__:null,useCallback:or,useContext:D0,useDebugValue:F0,useEffect:O0,useErrorBoundary:$0,useId:B0,useImperativeHandle:L0,useLayoutEffect:cm,useMemo:Io,useReducer:am,useRef:P0,useState:En},Symbol.toStringTag,{value:"Module"}),j0="http://www.w3.org/2000/svg";function z0(){const e=r=>ue.createElementNS(j0,r),t=Je(e("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=Je(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 q0({options:e}){const t=Io(()=>({__html:z0().outerHTML}),[]);return J("h2",{class:"dialog__header"},J("span",{class:"dialog__title"},e.formTitle),e.showBranding?J("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:t}):null)}function G0(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 ta(e,t){const n=e.get(t);return typeof n=="string"?n.trim():""}function V0({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:o,onSubmitSuccess:s,onSubmitError:i,showEmail:a,showName:c,screenshotInput:u}){const{tags:d,addScreenshotButtonLabel:l,removeScreenshotButtonLabel:f,cancelButtonLabel:p,emailLabel:h,emailPlaceholder:m,isEmailRequired:_,isNameRequired:y,messageLabel:S,messagePlaceholder:M,nameLabel:I,namePlaceholder:L,submitButtonLabel:N,isRequiredLabel:b}=e,[x,H]=En(!1),[E,P]=En(null),[A,O]=En(!1),D=u?.input,[Z,X]=En(null),ne=or(k=>{X(k),O(!1)},[]),v=or(k=>{const V=G0(k,{emailLabel:h,isEmailRequired:_,isNameRequired:y,messageLabel:S,nameLabel:I});return V.length>0?P(`Please enter in the following required fields: ${V.join(", ")}`):P(null),V.length===0},[h,_,y,S,I]),q=or(async k=>{H(!0);try{if(k.preventDefault(),!(k.target instanceof HTMLFormElement))return;const V=new FormData(k.target),ae=await(u&&A?u.value():void 0),re={name:ta(V,"name"),email:ta(V,"email"),message:ta(V,"message"),attachments:ae?[ae]:void 0};if(!v(re))return;try{const ve=await o({name:re.name,email:re.email,message:re.message,source:g0,tags:d},{attachments:re.attachments});s(re,ve)}catch(ve){ps&&g.error(ve),P(ve),i(ve)}}finally{H(!1)}},[u&&A,s,i]);return J("form",{class:"form",onSubmit:q},D&&A?J(D,{onError:ne}):null,J("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:x},J("div",{class:"form__top"},E?J("div",{class:"form__error-container"},E):null,c?J("label",{for:"name",class:"form__label"},J(na,{label:I,isRequiredLabel:b,isRequired:y}),J("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:L,required:y,type:"text"})):J("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),a?J("label",{for:"email",class:"form__label"},J(na,{label:h,isRequiredLabel:b,isRequired:_}),J("input",{class:"form__input",defaultValue:t,id:"email",name:"email",placeholder:m,required:_,type:"email"})):J("input",{"aria-hidden":!0,value:t,name:"email",type:"hidden"}),J("label",{for:"message",class:"form__label"},J(na,{label:S,isRequiredLabel:b,isRequired:!0}),J("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:M,required:!0,rows:5})),D?J("label",{for:"screenshot",class:"form__label"},J("button",{class:"btn btn--default",disabled:x,type:"button",onClick:()=>{X(null),O(k=>!k)}},A?f:l),Z?J("div",{class:"form__error-container"},Z.message):null):null),J("div",{class:"btn-group"},J("button",{class:"btn btn--primary",disabled:x,type:"submit"},N),J("button",{class:"btn btn--default",disabled:x,type:"button",onClick:r},p))))}function na({label:e,isRequired:t,isRequiredLabel:n}){return J("span",{class:"form__label__text"},e,t&&J("span",{class:"form__label__text--required"},n))}const Go=16,hd=17,Y0="http://www.w3.org/2000/svg";function J0(){const e=c=>dt.document.createElementNS(Y0,c),t=Je(e("svg"),{width:`${Go}`,height:`${hd}`,viewBox:`0 0 ${Go} ${hd}`,fill:"inherit"}),n=Je(e("g"),{clipPath:"url(#clip0_57_156)"}),r=Je(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z"}),o=Je(e("path"),{d:"M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z"});t.appendChild(n).append(o,r);const s=e("defs"),i=Je(e("clipPath"),{id:"clip0_57_156"}),a=Je(e("rect"),{width:`${Go}`,height:`${Go}`,fill:"white",transform:"translate(0 0.5)"});return i.appendChild(a),s.appendChild(i),t.appendChild(s).appendChild(i).appendChild(a),t}function K0({open:e,onFormSubmitted:t,...n}){const r=n.options,o=Io(()=>({__html:J0().outerHTML}),[]),[s,i]=En(null),a=or(()=>{s&&(clearTimeout(s),i(null)),t()},[s]),c=or((u,d)=>{n.onSubmitSuccess(u,d),i(setTimeout(()=>{t(),i(null)},y0))},[t]);return J(vo,null,s?J("div",{class:"success__position",onClick:a},J("div",{class:"success__content"},r.successMessageText,J("span",{class:"success__icon",dangerouslySetInnerHTML:o}))):J("dialog",{class:"dialog",onClick:r.onFormClose,open:e},J("div",{class:"dialog__position"},J("div",{class:"dialog__content",onClick:u=>{u.stopPropagation()}},J(q0,{options:r}),J(V0,{...n,onSubmitSuccess:c})))))}const X0=` .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; } `,Q0=` .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); } `,Z0=` .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); } `,ew=` .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)); } `,tw=` .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 nw(e){const t=ue.createElement("style");return t.textContent=` :host { --dialog-inset: var(--inset); } ${X0} ${Q0} ${Z0} ${ew} ${tw} `,e&&t.setAttribute("nonce",e),t}function rw(){const e=j().getUser(),t=be().getUser(),n=wn().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}const ow=()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{const o=r,s=e.useSentryUser,i=rw(),a=ue.createElement("div"),c=nw(e.styleNonce);let u="";const d={get el(){return a},appendToDom(){!o.contains(c)&&!o.contains(a)&&(o.appendChild(c),o.appendChild(a))},removeFromDom(){a.remove(),c.remove(),ue.body.style.overflow=u},open(){f(!0),e.onFormOpen?.(),C()?.emit("openFeedbackWidget"),u=ue.body.style.overflow,ue.body.style.overflow="hidden"},close(){f(!1),ue.body.style.overflow=u}},l=t?.createInput({h:J,hooks:W0,dialog:d,options:e}),f=p=>{N0(J(K0,{options:e,screenshotInput:l,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:String(s&&i?.[s.name]||""),defaultEmail:String(s&&i?.[s.email]||""),onFormClose:()=>{f(!1),e.onFormClose?.()},onSubmit:n,onSubmitSuccess:(h,m)=>{f(!1),e.onSubmitSuccess?.(h,m)},onSubmitError:h=>{e.onSubmitError?.(h)},onFormSubmitted:()=>{e.onFormSubmitted?.()},open:p}),a)};return d}});function sw({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 iw(e){const t=ue.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 aw({h:e}){return function({action:n,setAction:r,options:o}){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")}},o.highlightToolText),e("button",{type:"button",class:`editor__tool ${n==="hide"?"editor__tool--active":""}`,onClick:()=>{r(n==="hide"?"":"hide")}},o.hideToolText)))}}function cw({hooks:e}){function t(){const[n,r]=e.useState(dt.devicePixelRatio??1);return e.useEffect(()=>{const o=()=>{r(dt.devicePixelRatio)},s=matchMedia(`(resolution: ${dt.devicePixelRatio}dppx)`);return s.addEventListener("change",o),()=>{s.removeEventListener("change",o)}},[]),n}return function({onBeforeScreenshot:r,onScreenshot:o,onAfterScreenshot:s,onError:i}){const a=t();e.useEffect(()=>{(async()=>{r();const u=await zr.mediaDevices.getDisplayMedia({video:{width:dt.innerWidth*a,height:dt.innerHeight*a},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),d=ue.createElement("video");await new Promise((l,f)=>{d.srcObject=u,d.onloadedmetadata=()=>{o(d,a),u.getTracks().forEach(p=>p.stop()),l()},d.play().catch(f)}),s()})().catch(i)},[])}}function uw(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 Vt(e,t,n){if(!e)return;const r=e.getContext("2d",t);r&&n(e,r)}function ra(e,t){Vt(e,{alpha:!0},(n,r)=>{r.drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height)})}function oa(e,t,n){Vt(e,{alpha:!0},(r,o)=>{n.length&&(o.fillStyle="rgba(0, 0, 0, 0.25)",o.fillRect(0,0,r.width,r.height)),n.forEach(s=>{uw(s,o,t)})})}function lw({h:e,hooks:t,outputBuffer:n,dialog:r,options:o}){const s=cw({hooks:t}),i=aw({h:e}),a=sw({h:e}),c={__html:iw(o.styleNonce).innerText},u=r.el.style,d=({screenshot:l})=>{const[f,p]=t.useState("highlight"),[h,m]=t.useState([]),_=t.useRef(null),y=t.useRef(null),S=t.useRef(null),M=t.useRef(null),[I,L]=t.useState(1),N=t.useMemo(()=>{const A=ue.getElementById(o.id);if(!A)return"white";const O=getComputedStyle(A);return O.getPropertyValue("--button-primary-background")||O.getPropertyValue("--accent-background")},[o.id]);t.useLayoutEffect(()=>{const A=()=>{const O=_.current;O&&(Vt(l.canvas,{alpha:!1},D=>{const Z=Math.min(O.clientWidth/D.width,O.clientHeight/D.height);L(Z)}),(O.clientHeight===0||O.clientWidth===0)&&setTimeout(A,0))};return A(),dt.addEventListener("resize",A),()=>{dt.removeEventListener("resize",A)}},[l]);const b=t.useCallback((A,O)=>{Vt(A,{alpha:!0},(D,Z)=>{Z.scale(O,O),D.width=l.canvas.width,D.height=l.canvas.height})},[l]);t.useEffect(()=>{b(y.current,l.dpi),ra(y.current,l.canvas)},[l]),t.useEffect(()=>{b(S.current,l.dpi),Vt(S.current,{alpha:!0},(A,O)=>{O.clearRect(0,0,A.width,A.height)}),oa(S.current,N,h)},[h,N]),t.useEffect(()=>{b(n,l.dpi),ra(n,l.canvas),Vt(ue.createElement("canvas"),{alpha:!0},(A,O)=>{O.scale(l.dpi,l.dpi),A.width=l.canvas.width,A.height=l.canvas.height,oa(A,N,h),ra(n,A)})},[h,l,N]);const x=A=>{if(!f||!M.current)return;const O=M.current.getBoundingClientRect(),D={type:f,x:A.offsetX/I,y:A.offsetY/I},Z=(v,q)=>{const k=(q.clientX-O.x)/I,V=(q.clientY-O.y)/I;return{type:v.type,x:Math.min(v.x,k),y:Math.min(v.y,V),w:Math.abs(k-v.x),h:Math.abs(V-v.y)}},X=v=>{Vt(S.current,{alpha:!0},(q,k)=>{k.clearRect(0,0,q.width,q.height)}),oa(S.current,N,[...h,Z(D,v)])},ne=v=>{const q=Z(D,v);q.w*I>=1&&q.h*I>=1&&m(k=>[...k,q]),ue.removeEventListener("mousemove",X),ue.removeEventListener("mouseup",ne)};ue.addEventListener("mousemove",X),ue.addEventListener("mouseup",ne)},H=t.useCallback(A=>O=>{O.preventDefault(),O.stopPropagation(),m(D=>{const Z=[...D];return Z.splice(A,1),Z})},[]),E={width:`${l.canvas.width*I}px`,height:`${l.canvas.height*I}px`},P=A=>{A.stopPropagation()};return e("div",{class:"editor"},e("style",{nonce:o.styleNonce,dangerouslySetInnerHTML:c}),e("div",{class:"editor__image-container"},e("div",{class:"editor__canvas-container",ref:_},e("canvas",{ref:y,id:"background",style:E}),e("canvas",{ref:S,id:"foreground",style:E}),e("div",{ref:M,onMouseDown:x,style:E},h.map((A,O)=>e("div",{key:O,class:"editor__rect",style:{top:`${A.y*I}px`,left:`${A.x*I}px`,width:`${A.w*I}px`,height:`${A.h*I}px`}},e("button",{"aria-label":o.removeHighlightText,onClick:H(O),onMouseDown:P,onMouseUp:P,type:"button"},e(a,null))))))),e(i,{options:o,action:f,setAction:p}))};return function({onError:f}){const[p,h]=t.useState();return s({onBeforeScreenshot:t.useCallback(()=>{u.display="none"},[]),onScreenshot:t.useCallback((m,_)=>{Vt(ue.createElement("canvas"),{alpha:!1},(y,S)=>{S.scale(_,_),y.width=m.videoWidth,y.height=m.videoHeight,S.drawImage(m,0,0,y.width,y.height),h({canvas:y,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 dw=()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{const o=ue.createElement("canvas");return{input:lw({h:e,hooks:t,outputBuffer:o,dialog:n,options:r}),value:async()=>{const s=await new Promise(i=>{o.toBlob(i,"image/png")});if(s)return{data:new Uint8Array(await s.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}}}}}),R=$;let za=0;function lm(){return za>0}function fw(){za++,setTimeout(()=>{za--})}function hr(e,t={}){function n(o){return typeof o=="function"}if(!n(e))return e;try{const o=e.__sentry_wrapped__;if(o)return typeof o=="function"?o:e;if(Sc(e))return e}catch{return e}const r=function(...o){try{const s=o.map(i=>hr(i,t));return e.apply(this,s)}catch(s){throw fw(),je(i=>{i.addEventProcessor(a=>(t.mechanism&&(va(a,void 0),$t(a,t.mechanism)),a.extra={...a.extra,arguments:o},a)),me(s)}),s}};try{for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}Vf(r,e),Se(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function ru(){const e=Bn(),{referrer:t}=R.document||{},{userAgent:n}=R.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}const pw=["replayIntegration","replayCanvasIntegration","feedbackIntegration","feedbackModalIntegration","feedbackScreenshotIntegration","captureConsoleIntegration","contextLinesIntegration","linkedErrorsIntegration","dedupeIntegration","extraErrorDataIntegration","graphqlClientIntegration","httpClientIntegration","reportingObserverIntegration","rewriteFramesIntegration","browserProfilingIntegration","moduleMetadataIntegration","instrumentAnthropicAiClient","instrumentOpenAiClient","instrumentGoogleGenAIClient","instrumentLangGraph","createLangChainCallbackHandler","instrumentLangChainEmbeddings"],hw={replayCanvasIntegration:"replay-canvas",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot"};function mw(e){return hw[e]||e.replace("Integration","").toLowerCase()}const md=R;async function dm(e,t){const n=pw.includes(e)?mw(e):void 0,r=md.Sentry=md.Sentry||{};if(!n)throw new Error(`Cannot lazy load integration: ${e}`);const o=r[e];if(typeof o=="function"&&!("_isShim"in o))return o;const s=gw(n),i=R.document.createElement("script");i.src=s,i.crossOrigin="anonymous",i.referrerPolicy="strict-origin",t&&i.setAttribute("nonce",t);const a=new Promise((l,f)=>{i.addEventListener("load",()=>l()),i.addEventListener("error",f)}),c=R.document.currentScript,u=R.document.body||R.document.head||c?.parentElement;if(u)u.appendChild(i);else throw new Error(`Could not find parent element to insert lazy-loaded ${e} script`);try{await a}catch{throw new Error(`Error when loading integration: ${e}`)}const d=r[e];if(typeof d!="function")throw new Error(`Could not load integration: ${e}`);return d}function gw(e){const n=C()?.getOptions()?.cdnBaseUrl||"https://browser.sentry-cdn.com";return new URL(`/${Ct}/${e}.min.js`,n).toString()}const _w=Zh({lazyLoadIntegration:dm}),gd=Zh({getModalIntegration:()=>ow,getScreenshotIntegration:()=>dw});function ki(e,t){const n=ou(e,t),r={type:Tw(t),value:vw(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function yw(e,t,n,r){const s=C()?.getOptions().normalizeDepth,i=kw(t),a={__serialized__:Ap(t,s)};if(i)return{exception:{values:[ki(e,i)]},extra:a};const c={exception:{values:[{type:ci(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Iw(t,{isUnhandledRejection:r})}]},extra:a};if(n){const u=ou(e,n);u.length&&(c.exception.values[0].stacktrace={frames:u})}return c}function sa(e,t){return{exception:{values:[ki(e,t)]}}}function ou(e,t){const n=t.stacktrace||t.stack||"",r=bw(t),o=Ew(t);try{return e(n,r,o)}catch{}return[]}const Sw=/Minified React error #\d+;/i;function bw(e){return e&&Sw.test(e.message)?1:0}function Ew(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function fm(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function Tw(e){const t=e?.name;return!t&&fm(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function vw(e){const t=e?.message;return fm(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?kl(t.error):kl(e):"No error message"}function pm(e,t,n,r){const o=n?.syntheticException||void 0,s=Ri(e,t,o,r);return $t(s),s.level="error",n?.event_id&&(s.event_id=n.event_id),So(s)}function hm(e,t,n="info",r,o){const s=r?.syntheticException||void 0,i=qa(e,t,s,o);return i.level=n,r?.event_id&&(i.event_id=r.event_id),So(i)}function Ri(e,t,n,r,o){let s;if(zf(t)&&t.error)return sa(e,t.error);if(qu(t)||Y_(t)){const i=t;if("stack"in t)s=sa(e,t);else{const a=i.name||(qu(i)?"DOMError":"DOMException"),c=i.message?`${a}: ${i.message}`:a;s=qa(e,c,n,r),va(s,c)}return"code"in i&&(s.tags={...s.tags,"DOMException.code":`${i.code}`}),s}return yt(t)?sa(e,t):qe(t)||ci(t)?(s=yw(e,t,n,o),$t(s,{synthetic:!0}),s):(s=qa(e,t,n,r),va(s,`${t}`),$t(s,{synthetic:!0}),s)}function qa(e,t,n,r){const o={};if(r&&n){const s=ou(e,n);s.length&&(o.exception={values:[{value:t,stacktrace:{frames:s}}]}),$t(o,{synthetic:!0})}if(ai(t)){const{__sentry_template_string__:s,__sentry_template_values__:i}=t;return o.logentry={message:s,params:i},o}return o.message=t,o}function Iw(e,{isUnhandledRejection:t}){const n=ey(e),r=t?"promise rejection":"exception";return zf(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:ci(e)?`Event \`${ww(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function ww(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function kw(e){return Object.values(e).find(t=>t instanceof Error)}class mm extends Fb{constructor(t){const n=Rw(t),r=R.SENTRY_SDK_SOURCE||VI();dh(n,"browser",["browser"],r),n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:o,sendClientReports:s,enableLogs:i,_experiments:a,enableMetrics:c}=this._options,u=c??a?.enableMetrics??!0;R.document&&(s||i||u)&&R.document.addEventListener("visibilitychange",()=>{R.document.visibilityState==="hidden"&&(s&&this._flushOutcomes(),i&&Ds(this),u&&Pc(this))}),o&&this.on("beforeSendSession",eE)}eventFromException(t,n){return pm(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return hm(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,o){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,o)}}function Rw(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:R.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const Fn=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,G=$,Aw=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",wo=(e,t,n,r)=>{let o,s;return i=>{t.value>=0&&(i||r)&&(s=t.value-(o??0),(s||o===void 0)&&(o=t.value,t.delta=s,t.rating=Aw(t.value,n),e(t)))}},ko=(e=!0)=>{const t=G.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStartko()?.activationStart??0;function Zt(e,t,n){G.document&&G.addEventListener(e,t,n)}function zs(e,t,n){G.document&&G.removeEventListener(e,t,n)}let sr=-1;const gm=new Set,Cw=()=>G.document?.visibilityState==="hidden"&&!G.document?.prerendering?0:1/0,ys=e=>{if(xw(e)&&sr>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of gm)t();isFinite(sr)||(sr=e.type==="visibilitychange"?e.timeStamp:0,zs("prerenderingchange",ys,!0))}},Ro=()=>{if(G.document&&sr<0){const e=Nr();sr=(G.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??Cw(),Zt("visibilitychange",ys,!0),Zt("pagehide",ys,!0),Zt("prerenderingchange",ys,!0)}return{get firstHiddenTime(){return sr},onHidden(e){gm.add(e)}}};function xw(e){return e.type==="pagehide"||G.document?.visibilityState==="hidden"}const Mw=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,Ao=(e,t=-1)=>{const n=ko();let r="navigate";return n&&(G.document?.prerendering||Nr()>0?r="prerender":G.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:Mw(),navigationType:r}},ia=new WeakMap;function su(e,t){try{return ia.get(e)||ia.set(e,new t),ia.get(e)}catch{return new t}}class qs{constructor(){qs.prototype.__init.call(this),qs.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){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]),this._onAfterProcessingUnexpectedShift?.(t)}}const Or=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{t(o.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},iu=e=>{let t=!1;return()=>{t||(e(),t=!0)}},Ai=e=>{G.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Nw=[1800,3e3],Ow=(e,t={})=>{Ai(()=>{const n=Ro(),r=Ao("FCP");let o;const i=Or("paint",a=>{for(const c of a)c.name==="first-contentful-paint"&&(i.disconnect(),c.startTime{Ow(iu(()=>{const n=Ao("CLS",0);let r;const o=Ro(),s=su(t,qs),i=c=>{for(const u of c)s._processEntry(u);s._sessionValue>n.value&&(n.value=s._sessionValue,n.entries=s._sessionEntries,r())},a=Or("layout-shift",i);a&&(r=wo(e,n,Pw,t.reportAllChanges),o.onHidden(()=>{i(a.takeRecords()),r(!0)}),G?.setTimeout?.(r))}))};let _m=0,aa=1/0,Vo=0;const Dw=e=>{e.forEach(t=>{t.interactionId&&(aa=Math.min(aa,t.interactionId),Vo=Math.max(Vo,t.interactionId),_m=Vo?(Vo-aa)/7+1:0)})};let Ga;const ym=()=>Ga?_m:performance.interactionCount||0,Fw=()=>{"interactionCount"in performance||Ga||(Ga=Or("event",Dw,{type:"event",buffered:!0,durationThreshold:0}))},ca=10;let Sm=0;const $w=()=>ym()-Sm;class Gs{constructor(){Gs.prototype.__init.call(this),Gs.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){Sm=ym(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor($w()/50));return this._longestInteractionList[t]}_processEntry(t){if(this._onBeforeProcessingEntry?.(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,s)=>s._latency-o._latency),this._longestInteractionList.length>ca){const o=this._longestInteractionList.splice(ca);for(const s of o)this._longestInteractionMap.delete(s.id)}this._onAfterProcessingINPCandidate?.(r)}}}const bm=e=>{const t=G.requestIdleCallback||G.setTimeout;G.document?.visibilityState==="hidden"?e():(e=iu(e),Zt("visibilitychange",e,{once:!0,capture:!0}),Zt("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),zs("visibilitychange",e,{capture:!0}),zs("pagehide",e,{capture:!0})}))},Bw=[200,500],Uw=40,Hw=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=Ro();Ai(()=>{Fw();const r=Ao("INP");let o;const s=su(t,Gs),i=c=>{bm(()=>{for(const d of c)s._processEntry(d);const u=s._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,o())})},a=Or("event",i,{durationThreshold:t.durationThreshold??Uw});o=wo(e,r,Bw,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{i(a.takeRecords()),o(!0)}))})};class Ww{_processEntry(t){this._onBeforeProcessingEntry?.(t)}}const jw=[2500,4e3],zw=(e,t={})=>{Ai(()=>{const n=Ro(),r=Ao("LCP");let o;const s=su(t,Ww),i=c=>{t.reportAllChanges||(c=c.slice(-1));for(const u of c)s._processEntry(u),u.startTime{i(a.takeRecords()),a.disconnect(),o(!0)}),u=d=>{d.isTrusted&&(bm(c),zs(d.type,u,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])Zt(d,u,{capture:!0})}})},qw=[800,1800],Va=e=>{G.document?.prerendering?Ai(()=>Va(e)):G.document?.readyState!=="complete"?addEventListener("load",()=>Va(e),!0):setTimeout(e)},Gw=(e,t={})=>{const n=Ao("TTFB"),r=wo(e,n,qw,t.reportAllChanges);Va(()=>{const o=ko();o&&(n.value=Math.max(o.responseStart-Nr(),0),n.entries=[o],r(!0))})},Vr={},Vs={};let Em,Tm,vm,Im;function au(e,t=!1){return Ci("cls",e,Yw,Em,t)}function cu(e,t=!1){return Ci("lcp",e,Jw,Tm,t)}function Vw(e){return Ci("ttfb",e,Kw,vm)}function wm(e){return Ci("inp",e,Xw,Im)}function $n(e,t){return km(e,t),Vs[e]||(Qw(e),Vs[e]=!0),Rm(e,t)}function Co(e,t){const n=Vr[e];if(n?.length)for(const r of n)try{r(t)}catch(o){Fn&&g.error(`Error while triggering instrumentation handler. Type: ${e} Name: ${Lt(r)} Error:`,o)}}function Yw(){return Lw(e=>{Co("cls",{metric:e}),Em=e},{reportAllChanges:!0})}function Jw(){return zw(e=>{Co("lcp",{metric:e}),Tm=e},{reportAllChanges:!0})}function Kw(){return Gw(e=>{Co("ttfb",{metric:e}),vm=e})}function Xw(){return Hw(e=>{Co("inp",{metric:e}),Im=e})}function Ci(e,t,n,r,o=!1){km(e,t);let s;return Vs[e]||(s=n(),Vs[e]=!0),r&&t({metric:r}),Rm(e,t,o?s:void 0)}function Qw(e){const t={};e==="event"&&(t.durationThreshold=0),Or(e,n=>{Co(e,{entries:n})},t)}function km(e,t){Vr[e]=Vr[e]||[],Vr[e].push(t)}function Rm(e,t,n){return()=>{n&&n();const r=Vr[e];if(!r)return;const o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function Zw(e){return"duration"in e}const ek=e=>{const t=n=>{(n.type==="pagehide"||G.document?.visibilityState==="hidden")&&e(n)};Zt("visibilitychange",t,{capture:!0,once:!0}),Zt("pagehide",t,{capture:!0,once:!0})};function ua(e){return typeof e=="number"&&isFinite(e)}function cn(e,t,n,{...r}){const o=F(e).start_timestamp;return o&&o>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),Mn(e,()=>{const s=nt({startTime:t,...r});return s&&s.end(n),s})}function uu(e){const t=C();if(!t)return;const{name:n,transaction:r,attributes:o,startTime:s}=e,{release:i,environment:a,sendDefaultPii:c}=t.getOptions(),d=t.getIntegrationByName("Replay")?.getReplayId(),l=j(),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:i,environment:a,user:p||void 0,profile_id:h||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":G.navigator?.userAgent,"client.address":c?"{{auto}}":void 0,...o};return nt({name:n,attributes:m,startTime:s,experimental:{standalone:!0}})}function xo(){return G.addEventListener&&G.performance}function ke(e){return e/1e3}function tk(e){let t="unknown",n="unknown",r="";for(const o of e){if(o==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(o))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=o}return r===e&&(t=r),{name:t,version:n}}function Am(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function Cm(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n),r=!0}ek(()=>{o("pagehide")});const s=e.on("beforeStartNavigationSpan",(a,c)=>{c?.isRedirect||(o("navigation"),s(),i())}),i=e.on("afterStartPageLoadSpan",a=>{n=a.spanContext().spanId,i()})}function nk(e){let t=0,n;if(!Am("layout-shift"))return;const r=au(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);Cm(e,(o,s)=>{rk(t,n,s,o),r()})}function rk(e,t,n,r){Fn&&g.log(`Sending CLS span (${e})`);const o=t?ke((Fe()||0)+t.startTime):he(),s=j().getScopeData().transactionName,i=t?Ge(t.sources[0]?.node):"Layout shift",a={[z]:"auto.http.browser.cls",[ce]:"ui.webvital.cls",[vr]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((u,d)=>{a[`cls.source.${d+1}`]=Ge(u.node)});const c=uu({name:i,transaction:s,attributes:a,startTime:o});c&&(c.addEvent("cls",{[ho]:"",[mo]:e}),c.end(o))}function ok(e){let t=0,n;if(!Am("largest-contentful-paint"))return;const r=cu(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);Cm(e,(o,s)=>{sk(t,n,s,o),r()})}function sk(e,t,n,r){Fn&&g.log(`Sending LCP span (${e})`);const o=ke((Fe()||0)+(t?.startTime||0)),s=j().getScopeData().transactionName,i=t?Ge(t.element):"Largest contentful paint",a={[z]:"auto.http.browser.lcp",[ce]:"ui.webvital.lcp",[vr]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=Ge(t.element)),t.id&&(a["lcp.id"]=t.id),t.url&&(a["lcp.url"]=t.url),t.loadTime!=null&&(a["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(a["lcp.renderTime"]=t.renderTime),t.size!=null&&(a["lcp.size"]=t.size));const c=uu({name:i,transaction:s,attributes:a,startTime:o});c&&(c.addEvent("lcp",{[ho]:"millisecond",[mo]:e}),c.end(o))}function Qe(e){return e&&((Fe()||performance.timeOrigin)+e)/1e3}function xm(e){const t={};if(e.nextHopProtocol!=null){const{name:n,version:r}=tk(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return Fe()||xo()?.timeOrigin?ik({...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 ik(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const ak=2147483647;let _d=0,lt={},ze,Ys;function ck({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=xo();if(r&&Fe()){r.mark&&G.performance.mark("sentry-tracing-init");const o=t?ok(n):pk(),s=hk(),i=e?nk(n):fk();return()=>{o?.(),s(),i?.()}}return()=>{}}function uk(){$n("longtask",({entries:e})=>{const t=Te();if(!t)return;const{op:n,start_timestamp:r}=F(t);for(const o of e){const s=ke(Fe()+o.startTime),i=ke(o.duration);n==="navigation"&&r&&s{const n=Te();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const o=ke(Fe()+r.startTime),{start_timestamp:s,op:i}=F(n);if(i==="navigation"&&s&&o{const t=Te();if(t){for(const n of e)if(n.name==="click"){const r=ke(Fe()+n.startTime),o=ke(n.duration),s={name:Ge(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[z]:"auto.ui.browser.metrics"}},i=Gf(n.target);i&&(s.attributes["ui.component_name"]=i),cn(t,r,r+o,s)}}})}function fk(){return au(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(lt.cls={value:e.value,unit:""},Ys=t)},!0)}function pk(){return cu(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(lt.lcp={value:e.value,unit:"millisecond"},ze=t)},!0)}function hk(){return Vw(({metric:e})=>{e.entries[e.entries.length-1]&&(lt.ttfb={value:e.value,unit:"millisecond"})})}function mk(e,t){const n=xo(),r=Fe();if(!n?.getEntries||!r)return;const o=ke(r),s=n.getEntries(),{op:i,start_timestamp:a}=F(e);s.slice(_d).forEach(c=>{const u=ke(c.startTime),d=ke(Math.max(0,c.duration));if(!(i==="navigation"&&a&&o+u{Mp(c,u.value,u.unit)}),e.setAttribute("performance.timeOrigin",o),e.setAttribute("performance.activationStart",Nr()),Ik(e,t)),ze=void 0,Ys=void 0,lt={}}function gk(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function _k(e,t,n,r,o,s){if(gk(t)||["mark","measure"].includes(t.entryType)&&pt(t.name,s))return;const i=ko(!1),a=ke(i?i.requestStart:0),c=o+Math.max(n,a),u=o+n,d=u+r,l={[z]:"auto.resource.browser.metrics"};c!==u&&(l["sentry.browser.measure_happened_before_request"]=!0,l["sentry.browser.measure_start_time"]=c),yk(l,t),c<=d&&cn(e,c,d,{name:t.name,op:t.entryType,attributes:l})}function yk(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,o]of Object.entries(n))if(o&&Dt(o))e[`sentry.browser.measure.detail.${r}`]=o;else if(o!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(o)}catch{}return}if(Dt(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function Sk(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Yo(e,t,r,n)}),Yo(e,t,"secureConnection",n,"TLS/SSL"),Yo(e,t,"fetch",n,"cache"),Yo(e,t,"domainLookup",n,"DNS"),Ek(e,t,n)}function Yo(e,t,n,r,o=n){const s=bk(n),i=t[s],a=t[`${n}Start`];!a||!i||cn(e,r+ke(a),r+ke(i),{op:`browser.${o}`,name:t.name,attributes:{[z]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function bk(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function Ek(e,t,n){const r=n+ke(t.requestStart),o=n+ke(t.responseEnd),s=n+ke(t.responseStart);t.responseEnd&&(cn(e,r,o,{op:"browser.request",name:t.name,attributes:{[z]:"auto.ui.browser.metrics"}}),cn(e,s,o,{op:"browser.response",name:t.name,attributes:{[z]:"auto.ui.browser.metrics"}}))}function Tk(e,t,n,r,o,s,i){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(i?.includes(a))return;const c={[z]:"auto.resource.browser.metrics"},u=Rn(n);u.protocol&&(c["url.scheme"]=u.protocol.split(":").pop()),u.host&&(c["server.address"]=u.host),c["url.same_origin"]=n.includes(G.location.origin),wk(t,c,[["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={...c,...xm(t)},l=s+r,f=l+o;cn(e,l,f,{name:n.replace(G.location.origin,""),op:a,attributes:d})}function vk(e){const t=G.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),ua(n.rtt)&&(lt["connection.rtt"]={value:n.rtt,unit:"millisecond"})),ua(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),ua(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function Ik(e,t){ze&&t.recordLcpOnPageloadSpan&&(ze.element&&e.setAttribute("lcp.element",Ge(ze.element)),ze.id&&e.setAttribute("lcp.id",ze.id),ze.url&&e.setAttribute("lcp.url",ze.url.trim().slice(0,200)),ze.loadTime!=null&&e.setAttribute("lcp.loadTime",ze.loadTime),ze.renderTime!=null&&e.setAttribute("lcp.renderTime",ze.renderTime),e.setAttribute("lcp.size",ze.size)),Ys?.sources&&t.recordClsOnPageloadSpan&&Ys.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Ge(n.node)))}function wk(e,t,n){n.forEach(([r,o])=>{const s=e[r];s!=null&&(typeof s=="number"&&s({name:Rk,setup(){!xo()||!Fe()||$n("element",({entries:t})=>{for(const n of t){const r=n;if(!r.identifier)continue;const o=r.identifier,s=r.name,i=r.renderTime,a=r.loadTime,c={"sentry.origin":"auto.ui.browser.element_timing","ui.element.identifier":o};s&&(c["ui.element.paint_type"]=s),r.id&&(c["ui.element.id"]=r.id),r.element&&(c["ui.element.type"]=r.element.tagName.toLowerCase()),r.url&&(c["ui.element.url"]=r.url),r.naturalWidth&&(c["ui.element.width"]=r.naturalWidth),r.naturalHeight&&(c["ui.element.height"]=r.naturalHeight),i>0&&La("ui.element.render_time",i,{unit:"millisecond",attributes:c}),a>0&&La("ui.element.load_time",a,{unit:"millisecond",attributes:c})}})}}),Ck=Ak,xk=1e3;let yd,Ya,Ja;function Mm(e){const t="dom";ln(t,e),dn(t,Mk)}function Mk(){if(!G.document)return;const e=et.bind(null,"dom"),t=Sd(e,!0);G.document.addEventListener("click",t,!1),G.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const o=G[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(Le(o,"addEventListener",function(s){return function(i,a,c){if(i==="click"||i=="keypress")try{const u=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},d=u[i]=u[i]||{refCount:0};if(!d.handler){const l=Sd(e);d.handler=l,s.call(this,i,l,c)}d.refCount++}catch{}return s.call(this,i,a,c)}}),Le(o,"removeEventListener",function(s){return function(i,a,c){if(i==="click"||i=="keypress")try{const u=this.__sentry_instrumentation_handlers__||{},d=u[i];d&&(d.refCount--,d.refCount<=0&&(s.call(this,i,d.handler,c),d.handler=void 0,delete u[i]),Object.keys(u).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return s.call(this,i,a,c)}}))})}function Nk(e){if(e.type!==Ya)return!1;try{if(!e.target||e.target._sentryId!==Ja)return!1}catch{}return!0}function Ok(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Sd(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Pk(n);if(Ok(n.type,r))return;Se(n,"_sentryCaptured",!0),r&&!r._sentryId&&Se(r,"_sentryId",we());const o=n.type==="keypress"?"input":n.type;Nk(n)||(e({event:n,name:o,global:t}),Ya=n.type,Ja=r?r._sentryId:void 0),clearTimeout(yd),yd=G.setTimeout(()=>{Ja=void 0,Ya=void 0},xk)}}function Pk(e){try{return e.target}catch{return null}}let Jo;function xi(e){const t="history";ln(t,e),dn(t,Lk)}function Lk(){if(G.addEventListener("popstate",()=>{const t=G.location.href,n=Jo;if(Jo=t,n===t)return;et("history",{from:n,to:t})}),!$I())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const o=Jo,s=Dk(String(r));if(Jo=s,o===s)return t.apply(this,n);et("history",{from:o,to:s})}return t.apply(this,n)}}Le(G.history,"pushState",e),Le(G.history,"replaceState",e)}function Dk(e){try{return new URL(e,G.location.origin).toString()}catch{return e}}const Ss={};function lu(e){const t=Ss[e];if(t)return t;let n=G[e];if(Ba(n))return Ss[e]=n.bind(G);const r=G.document;if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const s=o.contentWindow;s?.[e]&&(n=s[e]),r.head.removeChild(o)}catch(o){Fn&&g.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(Ss[e]=n.bind(G))}function Fk(e){Ss[e]=void 0}function Mo(...e){return lu("setTimeout")(...e)}const At="__sentry_xhr_v3__";function du(e){const t="xhr";ln(t,e),dn(t,$k)}function $k(){if(!G.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const o=new Error,s=he()*1e3,i=ft(r[0])?r[0].toUpperCase():void 0,a=Bk(r[1]);if(!i||!a)return t.apply(n,r);n[At]={method:i,url:a,request_headers:{}},i==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const c=()=>{const u=n[At];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const d={endTimestamp:he()*1e3,startTimestamp:s,xhr:n,virtualError:o};et("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,d,l){return c(),u.apply(d,l)}}):n.addEventListener("readystatechange",c),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,d,l){const[f,p]=l,h=d[At];return h&&ft(f)&&ft(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 o=n[At];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);const s={startTimestamp:he()*1e3,xhr:n};return et("xhr",s),t.apply(n,r)}})}function Bk(e){if(ft(e))return e;try{return e.toString()}catch{}}const Uk=Symbol.for("sentry__originalRequestBody");function Nm(e){return new URLSearchParams(e).toString()}function Js(e,t=g){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[Nm(e)];if(!e)return[void 0]}catch(n){return Fn&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Fn&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function fu(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][Uk];return n!==void 0?n:void 0}}function Om(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Fn&&g.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r `).reduce((n,r)=>{const[o,s]=r.split(": ");return s&&(n[o.toLowerCase()]=s),n},{}):{}}const la=[],bs=new Map,qn=new Map,Hk=60;function Wk(){if(xo()&&Fe()){const t=jk();return()=>{t()}}return()=>{}}const Ka={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 jk(){return wm(zk)}const zk=({metric:e})=>{if(e.value==null)return;const t=ke(e.value);if(t>Hk)return;const n=e.entries.find(h=>h.duration===e.value&&Ka[h.name]);if(!n)return;const{interactionId:r}=n,o=Ka[n.name],s=ke(Fe()+n.startTime),i=Te(),a=i?ye(i):void 0,c=r!=null?bs.get(r):void 0,u=c?.span||a,d=u?F(u).description:j().getScopeData().transactionName,l=c?.elementName||Ge(n.target),f={[z]:"auto.http.browser.inp",[ce]:`ui.interaction.${o}`,[vr]:n.duration},p=uu({name:l,transaction:d,attributes:f,startTime:s});p&&(p.addEvent("inp",{[ho]:"millisecond",[mo]:e.value}),p.end(s+t))};function qk(){const e=Object.keys(Ka);Ws()&&e.forEach(o=>{G.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){const s=o.target;if(!s)return;const i=Ge(s),a=Math.round(o.timeStamp);if(qn.set(a,i),qn.size>50){const c=qn.keys().next().value;c!==void 0&&qn.delete(c)}}function n(o){const s=Math.round(o.startTime);let i=qn.get(s);if(!i)for(let a=-5;a<=5;a++){const c=qn.get(s+a);if(c){i=c;break}}return i||""}const r=({entries:o})=>{const s=Te(),i=s&&ye(s);o.forEach(a=>{if(!Zw(a))return;const c=a.interactionId;if(c==null||bs.has(c))return;const u=a.target?Ge(a.target):n(a);if(la.length>10){const d=la.shift();bs.delete(d)}la.push(c),bs.set(c,{span:i,elementName:u})})};$n("event",r),$n("first-input",r)}const Gk=40;function pu(e,t=lu("fetch")){let n=0,r=0;async function o(s){const i=s.body.length;n+=i,r++;const a={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const c=await t(e.url,a);return{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}}catch(c){throw Fk("fetch"),c}finally{n-=i,r--}}return eh(e,o,Fc(e.bufferSize||Gk))}const T=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Vk(){const e=C();if(!e){T&&g.warn("No Sentry client available, profiling is not started");return}if(!e.getIntegrationByName("BrowserProfiling")){T&&g.warn("BrowserProfiling integration is not available");return}e.emit("startUIProfiler")}function Yk(){const e=C();if(!e){T&&g.warn("No Sentry client available, profiling is not started");return}if(!e.getIntegrationByName("BrowserProfiling")){T&&g.warn("ProfilingIntegration is not available");return}e.emit("stopUIProfiler")}const Jk={startProfiler:Vk,stopProfiler:Yk},Kk=10,Xk=20,Qk=30,Zk=40,eR=50;function mr(e,t,n,r){const o={filename:e,function:t===""?bt:t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const tR=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,nR=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,rR=/\((\S*)(?::(\d+))(?::(\d+))\)/,oR=/at (.+?) ?\(data:(.+?),/,sR=e=>{const t=e.match(oR);if(t)return{filename:``,function:t[1]};const n=tR.exec(e);if(n){const[,o,s,i]=n;return mr(o,bt,+s,+i)}const r=nR.exec(e);if(r){if(r[2]?.indexOf("eval")===0){const a=rR.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}const[s,i]=$m(r[1]||bt,r[2]);return mr(i,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Pm=[Qk,sR],iR=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,aR=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,cR=e=>{const t=iR.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const s=aR.exec(t[3]);s&&(t[1]=t[1]||"eval",t[3]=s[1],t[4]=s[2],t[5]="")}let r=t[3],o=t[1]||bt;return[o,r]=$m(o,r),mr(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Lm=[eR,cR],uR=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,lR=e=>{const t=uR.exec(e);return t?mr(t[2],t[1]||bt,+t[3],t[4]?+t[4]:void 0):void 0},dR=[Zk,lR],fR=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,pR=e=>{const t=fR.exec(e);return t?mr(t[2],t[3]||bt,+t[1]):void 0},hR=[Kk,pR],mR=/ line (\d+), column (\d+)\s*(?:in (?:]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,gR=e=>{const t=mR.exec(e);return t?mr(t[5],t[3]||t[4]||bt,+t[1],+t[2]):void 0},_R=[Xk,gR],Dm=[Pm,Lm],Fm=Bf(...Dm),$m=(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]:bt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};function yR(e,{metadata:t,tunnel:n,dsn:r}){const o={event_id:e.event_id,sent_at:new Date().toISOString(),...t?.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:It(r)}},s=SR(e);return st(o,[s])}function SR(e){return[{type:"user_report"},e]}const Ko=1024,bR="Breadcrumbs",ER=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:bR,setup(n){t.console&&Hc(IR(n)),t.dom&&Mm(vR(n,t.dom)),t.xhr&&du(wR(n)),t.fetch&&Xc(kR(n)),t.history&&xi(RR(n)),t.sentry&&n.on("beforeSendEvent",TR(n))}}},Bm=ER;function TR(e){return function(n){C()===e&&mt({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:yn(n)},{event:n})}}function vR(e,t){return function(r){if(C()!==e)return;let o,s,i=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>Ko&&(T&&g.warn(`\`dom.maxStringLength\` cannot exceed ${Ko}, but a value of ${a} was configured. Sentry will use ${Ko} instead.`),a=Ko),typeof i=="string"&&(i=[i]);try{const u=r.event,d=AR(u)?u.target:u;o=Ge(d,{keyAttrs:i,maxStringLength:a}),s=Gf(d)}catch{o=""}if(o.length===0)return;const c={category:`ui.${r.name}`,message:o};s&&(c.data={"ui.component_name":s}),mt(c,{event:r.event,name:r.name,global:r.global})}}function IR(e){return function(n){if(C()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:$s(n.level),message:As(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${As(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;mt(r,{input:n.args,level:n.level})}}function wR(e){return function(n){if(C()!==e)return;const{startTimestamp:r,endTimestamp:o}=n,s=n.xhr[At];if(!r||!o||!s)return;const{method:i,url:a,status_code:c,body:u}=s,d={method:i,url:a,status_code:c},l={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:o},f={category:"xhr",data:d,type:"http",level:Vh(c)};e.emit("beforeOutgoingRequestBreadcrumb",f,l),mt(f,l)}}function kR(e){return function(n){if(C()!==e)return;const{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const s={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o},i={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",i,s),mt(i,s)}else{const s=n.response,i={...n.fetchData,status_code:s?.status},a={input:n.args,response:s,startTimestamp:r,endTimestamp:o},c={category:"fetch",data:i,type:"http",level:Vh(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",c,a),mt(c,a)}}}function RR(e){return function(n){if(C()!==e)return;let r=n.from,o=n.to;const s=Rn(R.location.href);let i=r?Rn(r):void 0;const a=Rn(o);i?.path||(i=s),s.protocol===a.protocol&&s.host===a.host&&(o=a.relative),s.protocol===i.protocol&&s.host===i.host&&(r=i.relative),mt({category:"navigation",data:{from:r,to:o}})}}function AR(e){return!!e&&!!e.target}const CR="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(","),xR="BrowserApiErrors",MR=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:xR,setupOnce(){t.setTimeout&&Le(R,"setTimeout",bd),t.setInterval&&Le(R,"setInterval",bd),t.requestAnimationFrame&&Le(R,"requestAnimationFrame",NR),t.XMLHttpRequest&&"XMLHttpRequest"in R&&Le(XMLHttpRequest.prototype,"send",OR);const n=t.eventTarget;n&&(Array.isArray(n)?n:CR).forEach(o=>PR(o,t))}}},Um=MR;function bd(e){return function(...t){const n=t[0];return t[0]=hr(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Lt(e)}`}}),e.apply(this,t)}}function NR(e){return function(t){return e.apply(this,[hr(t,{mechanism:{data:{handler:Lt(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function OR(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&Le(n,o,function(s){const i={mechanism:{data:{handler:Lt(s)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=Sc(s);return a&&(i.mechanism.data.handler=Lt(a)),hr(s,i)})}),e.apply(this,t)}}function PR(e,t){const r=R[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Le(r,"addEventListener",function(o){return function(s,i,a){try{LR(i)&&(i.handleEvent=hr(i.handleEvent,{mechanism:{data:{handler:Lt(i),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&DR(this,s,i),o.apply(this,[s,hr(i,{mechanism:{data:{handler:Lt(i),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),Le(r,"removeEventListener",function(o){return function(s,i,a){try{const c=i.__sentry_wrapped__;c&&o.call(this,s,c,a)}catch{}return o.call(this,s,i,a)}}))}function LR(e){return typeof e.handleEvent=="function"}function DR(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const Hm=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof R.document>"u"){T&&g.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Ma({ignoreDuration:!0}),us();const n=be();let r=n.getUser();n.addScopeListener(o=>{const s=o.getUser();(r?.id!==s?.id||r?.ip_address!==s?.ip_address)&&(us(),r=s)}),t==="route"&&xi(({from:o,to:s})=>{o!==s&&(Ma({ignoreDuration:!0}),us())})}}},FR="CultureContext",$R=()=>({name:FR,preprocessEvent(e){const t=BR();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})}}),Wm=$R;function BR(){try{const e=R.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const UR="GlobalHandlers",HR=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:UR,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(WR(n),Ed("onerror")),t.onunhandledrejection&&(jR(n),Ed("onunhandledrejection"))}}},jm=HR;function WR(e){Hf(t=>{const{stackParser:n,attachStacktrace:r}=Gm();if(C()!==e||lm())return;const{msg:o,url:s,line:i,column:a,error:c}=t,u=zR(Ri(n,c||o,void 0,r,!1),s,i,a);u.level="error",kr(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function jR(e){Wf(t=>{const{stackParser:n,attachStacktrace:r}=Gm();if(C()!==e||lm())return;const o=zm(t),s=Dt(o)?qm(o):Ri(n,o,void 0,r,!0);s.level="error",kr(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function zm(e){if(Dt(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 qm(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function zR(e,t,n,r){const o=e.exception=e.exception||{},s=o.values=o.values||[],i=s[0]=s[0]||{},a=i.stacktrace=i.stacktrace||{},c=a.frames=a.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:qR(t)??Bn(),function:bt,in_app:!0}),e}function Ed(e){T&&g.log(`Global Handler attached: ${e}`)}function Gm(){return C()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function qR(e){if(!(!ft(e)||e.length===0))return e.startsWith("data:")?`<${Xt(e,!1)}>`:e}const Vm=()=>({name:"HttpContext",preprocessEvent(e){if(!R.navigator&&!R.location&&!R.document)return;const t=ru(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),GR="cause",VR=5,YR="LinkedErrors",JR=(e={})=>{const t=e.limit||VR,n=e.key||GR;return{name:YR,preprocessEvent(r,o,s){const i=s.getOptions();gE(ki,i.stackParser,n,t,r,o)}}},Ym=JR,KR="SpotlightBrowser",XR=(e={})=>{const t=e.sidecarUrl||"http://localhost:8969/stream";return{name:KR,setup:()=>{T&&g.log("Using Sidecar URL",t)},processEvent:n=>eA(n)?null:n,afterAllSetup:n=>{QR(n,t)}}};function QR(e,t){const n=lu("fetch");let r=0;e.on("beforeEnvelope",o=>{if(r>3){g.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r);return}n(t,{method:"POST",body:Os(o),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(s=>{s.status>=200&&s.status<400&&(r=0)},s=>{r++,g.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",s)})})}const ZR=XR;function eA(e){return!!(e.type==="transaction"&&e.spans&&e.contexts?.trace&&e.contexts.trace.op==="ui.action.click"&&e.spans.some(({description:t})=>t?.includes("#sentry-spotlight")))}function tA(){return nA()?(T&&Wt(()=>{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 nA(){if(typeof R.window>"u")return!1;const e=R;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=Bn();return!(R===R.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function Jm(e){return[hh(),fh(),ET(),Um(),Bm(),jm(),Ym(),Sh(),Vm(),Wm(),Hm()]}function rA(e={}){const t=!e.skipBrowserExtensionCheck&&tA();let n=e.defaultIntegrations==null?Jm():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:j_(e.stackParser||Fm),integrations:gb({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||pu};return jb(mm,r)}function oA(){}function sA(e){e()}function Xa(e={}){const t=R.document,n=t?.head||t?.body;if(!n){T&&g.error("[showReportDialog] Global document not defined");return}const r=j(),s=C()?.getDsn();if(!s){T&&g.error("[showReportDialog] DSN not configured");return}const i={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||Up()},a=R.document.createElement("script");a.async=!0,a.crossOrigin="anonymous",a.src=hb(s,i);const{onLoad:c,onClose:u}=i;if(c&&(a.onload=c),u){const d=l=>{if(l.data==="__sentry_reportdialog_closed__")try{u()}finally{R.removeEventListener("message",d)}};R.addEventListener("message",d)}n.appendChild(a)}const iA=$,aA="ReportingObserver",Td=new WeakMap,cA=(e={})=>{const t=e.types||["crash","deprecation","intervention"];function n(r){if(Td.has(C()))for(const o of r)je(s=>{s.setExtra("url",o.url);const i=`ReportingObserver [${o.type}]`;let a="No details available";if(o.body){const c={};for(const u in o.body)c[u]=o.body[u];if(s.setExtra("body",c),o.type==="crash"){const u=o.body;a=[u.crashId||"",u.reason||""].join(" ").trim()||a}else a=o.body.message||a}Cc(`${i}: ${a}`)})}return{name:aA,setupOnce(){if(!UI())return;new iA.ReportingObserver(n,{buffered:!0,types:t}).observe()},setup(r){Td.set(r,!0)}}},uA=cA,lA="HttpClient",dA=(e={})=>{const t={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...e};return{name:lA,setup(n){bA(n,t),EA(n,t)}}},fA=dA;function pA(e,t,n,r,o){if(Xm(e,n.status,n.url)){const s=TA(t,r);let i,a,c,u;Zm()&&([i,c]=vd("Cookie",s),[a,u]=vd("Set-Cookie",n));const d=Qm({url:s.url,method:s.method,status:n.status,requestHeaders:i,responseHeaders:a,requestCookies:c,responseCookies:u,error:o,type:"fetch"});kr(d)}}function vd(e,t){const n=gA(t.headers);let r;try{const o=n[e]||n[e.toLowerCase()]||void 0;o&&(r=Km(o))}catch{}return[n,r]}function hA(e,t,n,r,o){if(Xm(e,t.status,t.responseURL)){let s,i,a;if(Zm()){try{const u=t.getResponseHeader("Set-Cookie")||t.getResponseHeader("set-cookie")||void 0;u&&(i=Km(u))}catch{}try{a=_A(t)}catch{}s=r}const c=Qm({url:t.responseURL,method:n,status:t.status,requestHeaders:s,responseHeaders:a,responseCookies:i,error:o,type:"xhr"});kr(c)}}function mA(e){if(e){const t=e["Content-Length"]||e["content-length"];if(t)return parseInt(t,10)}}function Km(e){return e.split("; ").reduce((t,n)=>{const[r,o]=n.split("=");return r&&o&&(t[r]=o),t},{})}function gA(e){const t={};return e.forEach((n,r)=>{t[r]=n}),t}function _A(e){const t=e.getAllResponseHeaders();return t?t.split(`\r `).reduce((n,r)=>{const[o,s]=r.split(": ");return o&&s&&(n[o]=s),n},{}):{}}function yA(e,t){return e.some(n=>typeof n=="string"?t.includes(n):n.test(t))}function SA(e,t){return e.some(n=>typeof n=="number"?n===t:t>=n[0]&&t<=n[1])}function bA(e,t){Yh()&&Xc(n=>{if(C()!==e)return;const{response:r,args:o,error:s,virtualError:i}=n,[a,c]=o;r&&pA(t,a,r,c,s||i)},!1)}function EA(e,t){"XMLHttpRequest"in $&&du(n=>{if(C()!==e)return;const{error:r,virtualError:o}=n,s=n.xhr,i=s[At];if(!i)return;const{method:a,request_headers:c}=i;try{hA(t,s,a,c,r||o)}catch(u){T&&g.warn("Error while extracting response event form XHR response",u)}})}function Xm(e,t,n){return SA(e.failedRequestStatusCodes,t)&&yA(e.failedRequestTargets,n)&&!uh(n,C())}function Qm(e){const t=C(),n=t&&e.error&&e.error instanceof Error?e.error.stack:void 0,r=n&&t?t.getOptions().stackParser(n,0,1):void 0,o=`HTTP Client Error with status code: ${e.status}`,s={message:o,exception:{values:[{type:"Error",value:o,stacktrace:r?{frames:r}:void 0}]},request:{url:e.url,method:e.method,headers:e.requestHeaders,cookies:e.requestCookies},contexts:{response:{status_code:e.status,headers:e.responseHeaders,cookies:e.responseCookies,body_size:mA(e.responseHeaders)}}};return $t(s,{type:`auto.http.client.${e.type}`,handled:!1}),s}function TA(e,t){return!t&&e instanceof Request||e instanceof Request&&e.bodyUsed?e:new Request(e,t)}function Zm(){const e=C();return e?!!e.getOptions().sendDefaultPii:!1}const da=$,vA=7,IA="ContextLines",wA=(e={})=>{const t=e.frameContextLines!=null?e.frameContextLines:vA;return{name:IA,processEvent(n){return RA(n,t)}}},kA=wA;function RA(e,t){const n=da.document,r=da.location&&ch(da.location.href);if(!n||!r)return e;const o=e.exception?.values;if(!o?.length)return e;const s=n.documentElement.innerHTML;if(!s)return e;const i=["","",...s.split(` `),""];return o.forEach(a=>{const c=a.stacktrace;c?.frames&&(c.frames=c.frames.map(u=>AA(u,i,r,t)))}),e}function AA(e,t,n,r){return e.filename!==n||!e.lineno||!t.length||ry(t,e,r),e}const CA="GraphQLClient",xA=e=>({name:CA,setup(t){MA(t,e),NA(t,e)}});function MA(e,t){e.on("beforeOutgoingRequestSpan",(n,r)=>{const s=F(n).data||{};if(!(s[ce]==="http.client"))return;const c=s[Oy]||s["http.url"],u=s[Ny]||s["http.method"];if(!ft(c)||!ft(u))return;const{endpoints:d}=t,l=pt(c,d),f=tg(r);if(l&&f){const p=ng(f);if(p){const h=eg(p);n.updateName(`${u} ${c} (${h})`),Mi(p)&&n.setAttribute("graphql.document",p.query),Ni(p)&&(n.setAttribute("graphql.persisted_query.hash.sha256",p.extensions.persistedQuery.sha256Hash),n.setAttribute("graphql.persisted_query.version",p.extensions.persistedQuery.version))}}})}function NA(e,t){e.on("beforeOutgoingRequestBreadcrumb",(n,r)=>{const{category:o,type:s,data:i}=n;if(s==="http"&&(o==="fetch"||o==="xhr")){const d=i?.url,{endpoints:l}=t,f=pt(d,l),p=tg(r);if(f&&i&&p){const h=ng(p);if(!i.graphql&&h){const m=eg(h);i["graphql.operation"]=m,Mi(h)&&(i["graphql.document"]=h.query),Ni(h)&&(i["graphql.persisted_query.hash.sha256"]=h.extensions.persistedQuery.sha256Hash,i["graphql.persisted_query.version"]=h.extensions.persistedQuery.version)}}}})}function eg(e){if(Ni(e))return`persisted ${e.operationName}`;if(Mi(e)){const{query:t,operationName:n}=e,{operationName:r=n,operationType:o}=OA(t);return r?`${o} ${r}`:`${o}`}return"unknown"}function tg(e){const t="xhr"in e;let n;if(t){const r=e.xhr[At];n=r&&Js(r.body)[0]}else{const r=fu(e.input);n=Js(r)[0]}return n}function OA(e){const t=/^(?:\s*)(query|mutation|subscription)(?:\s*)(\w+)(?:\s*)[{(]/,n=/^(?:\s*)(query|mutation|subscription)(?:\s*)[{(]/,r=e.match(t);if(r)return{operationType:r[1],operationName:r[2]};const o=e.match(n);return o?{operationType:o[1],operationName:void 0}:{operationType:void 0,operationName:void 0}}function Es(e){return typeof e=="object"&&e!==null}function Mi(e){return Es(e)&&typeof e.query=="string"}function Ni(e){return Es(e)&&typeof e.operationName=="string"&&Es(e.extensions)&&Es(e.extensions.persistedQuery)&&typeof e.extensions.persistedQuery.sha256Hash=="string"&&typeof e.extensions.persistedQuery.version=="number"}function ng(e){try{const t=JSON.parse(e);return Mi(t)||Ni(t)?t:void 0}catch{return}}const PA=xA,pe=$,hu="sentryReplaySession",LA="replay_event",mu="Unable to send Replay",DA=3e5,FA=9e5,$A=5e3,BA=5500,UA=6e4,HA=5e3,WA=3,Id=15e4,Xo=5e3,jA=3e3,zA=300,gu=2e7,qA=4999,GA=5e4,wd=36e5;var VA=Object.defineProperty,YA=(e,t,n)=>t in e?VA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kd=(e,t,n)=>YA(e,typeof t!="symbol"?t+"":t,n),Ie=(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))(Ie||{});function JA(e){return e.nodeType===e.ELEMENT_NODE}function Yr(e){return e?.host?.shadowRoot===e}function Jr(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function KA(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 XA(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 Ks(e){try{const t=e.rules||e.cssRules;return t?KA(Array.from(t,rg).join("")):null}catch{return null}}function QA(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 o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function nC(){return new og}function Oi({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 oo({isMasked:e,element:t,value:n,maskInputFn:r}){let o=n||"";return e?(r&&(o=r(o,t)),"*".repeat(o.length)):o}function gr(e){return e.toLowerCase()}function Qa(e){return e.toUpperCase()}const Rd="__rrweb_original__";function rC(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;rc!==0))return!1}return!0}function _u(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?gr(t):null}function Xs(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function sg(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i;return n.pathname.match(r)?.[1]??null}const Ad={};function ig(e){const t=Ad[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);const s=o.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(o)}catch{}return Ad[e]=r.bind(window)}function Za(...e){return ig("setTimeout")(...e)}function ag(...e){return ig("clearTimeout")(...e)}function cg(e){try{return e.contentDocument}catch{}}let oC=1;const sC=new RegExp("[^a-z0-9-_:]"),so=-2;function yu(){return oC++}function iC(e){if(e instanceof HTMLFormElement)return"form";const t=gr(e.tagName);return sC.test(t)?"div":t}function aC(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let Gn,Cd;const cC=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,uC=/^(?:[a-z+]+:)?\/\//i,lC=/^www\..*/i,dC=/^(data:)([^,]*),(.*)/i;function fC(e,t){if(!e||t.size===0)return e;try{const n=e.split(";"),r=[];for(let o of n){if(o=o.trim(),!o)continue;const s=o.indexOf(":");if(s===-1){r.push(o);continue}const i=o.slice(0,s).trim();t.has(i)||r.push(o)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function Qs(e,t){return(e||"").replace(cC,(n,r,o,s,i,a)=>{const c=o||i||a,u=r||s||"";if(!c)return n;if(uC.test(c)||lC.test(c))return`url(${u}${c}${u})`;if(dC.test(c))return`url(${u}${c}${u})`;if(c[0]==="/")return`url(${u}${aC(t)+c}${u})`;const d=t.split("/"),l=c.split("/");d.pop();for(const f of l)f!=="."&&(f===".."?d.pop():d.push(f));return`url(${u}${d.join("/")}${u})`})}const pC=/^[^ \t\n\r\u000c]+/,hC=/^[, \t\n\r\u000c]+/;function mC(e,t){if(t.trim()==="")return t;let n=0;function r(s){let i;const a=s.exec(t.substring(n));return a?(i=a[0],n+=i.length,i):""}const o=[];for(;r(hC),!(n>=t.length);){let s=r(pC);if(s.slice(-1)===",")s=Xn(e,s.substring(0,s.length-1)),o.push(s);else{let i="";s=Xn(e,s);let a=!1;for(;;){const c=t.charAt(n);if(c===""){o.push((s+i).trim());break}else if(a)c===")"&&(a=!1);else if(c===","){n+=1,o.push((s+i).trim());break}else c==="("&&(a=!0);i+=c,n+=1}}}return o.join(", ")}const xd=new WeakMap;function Xn(e,t){return!t||t.trim()===""?t:Pi(e,t)}function gC(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function Pi(e,t){let n=xd.get(e);if(n||(n=e.createElement("a"),xd.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function ug(e,t,n,r,o,s,i){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return Xn(e,r);if(n==="xlink:href"&&r[0]!=="#")return Xn(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return Xn(e,r);if(n==="srcset")return mC(e,r);if(n==="style"){let a=Qs(r,Pi(e));return i&&i.size>0&&(a=fC(a,i)),a}else if(t==="object"&&n==="data")return Xn(e,r);return typeof s=="function"?s(n,r,o):r}function lg(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function _C(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 o=e.classList.length;o--;){const s=e.classList[o];if(t.test(s))return!0}if(n)return e.matches(n)}catch{}return!1}function yC(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function Tn(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Tn(e.parentNode,t,n,r+1)}function Qn(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(yC(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function _r(e,t,n,r,o,s){try{const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(i===null)return!1;if(i.tagName==="INPUT"){const u=i.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let a=-1,c=-1;if(s){if(c=Tn(i,Qn(r,o)),c<0)return!0;a=Tn(i,Qn(t,n),c>=0?c:1/0)}else{if(a=Tn(i,Qn(t,n)),a<0)return!1;c=Tn(i,Qn(r,o),a>=0?a:1/0)}return a>=0?c>=0?a<=c:!0:c>=0?!1:!!s}catch{}return!!s}function SC(e,t,n){const r=e.contentWindow;if(!r)return;let o=!1,s;try{s=r.document.readyState}catch{return}if(s!=="complete"){const a=Za(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{ag(a),o=!0,t()});return}const i="about:blank";if(r.location.href!==i||e.src===i||e.src==="")return Za(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function bC(e,t,n){let r=!1,o;try{o=e.sheet}catch{return}if(o)return;const s=Za(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{ag(s),r=!0,t()})}function EC(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskAttributeFn:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:h={},maskTextFn:m,maskInputFn:_,dataURLOptions:y={},inlineImages:S,recordCanvas:M,keepIframeSrcFn:I,newlyAddedElement:L=!1,ignoreCSSAttributes:N}=t,b=TC(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Ie.Document,childNodes:[],compatMode:e.compatMode}:{type:Ie.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ie.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return IC(e,{doc:n,blockClass:o,blockSelector:s,unblockSelector:i,inlineStylesheet:p,maskAttributeFn:c,maskInputOptions:h,maskInputFn:_,dataURLOptions:y,inlineImages:S,recordCanvas:M,keepIframeSrcFn:I,newlyAddedElement:L,rootId:b,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,ignoreCSSAttributes:N});case e.TEXT_NODE:return vC(e,{doc:n,maskAllText:a,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,maskTextFn:m,maskInputOptions:h,maskInputFn:_,rootId:b});case e.CDATA_SECTION_NODE:return{type:Ie.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:Ie.Comment,textContent:e.textContent||"",rootId:b};default:return!1}}function TC(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function vC(e,t){const{maskAllText:n,maskTextClass:r,unmaskTextClass:o,maskTextSelector:s,unmaskTextSelector:i,maskTextFn:a,maskInputOptions:c,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||e.parentNode.sheet?.cssRules&&(f=Ks(e.parentNode.sheet))}catch(y){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${y}`,e)}f=Qs(f,Pi(t.doc))}h&&(f="SCRIPT_PLACEHOLDER");const _=_r(e,r,s,o,i,n);if(!p&&!h&&!m&&f&&_&&(f=a?a(f,e.parentElement):f.replace(/[\S]/g,"*")),m&&f&&(c.textarea||_)&&(f=u?u(f,e.parentNode):f.replace(/[\S]/g,"*")),l==="OPTION"&&f){const y=Oi({type:null,tagName:l,maskInputOptions:c});f=oo({isMasked:_r(e,r,s,o,i,y),element:e,value:f,maskInputFn:u})}return{type:Ie.Text,textContent:f||"",isStyle:p,rootId:d}}function IC(e,t){const{doc:n,blockClass:r,blockSelector:o,unblockSelector:s,inlineStylesheet:i,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:l,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:m,maskTextClass:_,unmaskTextClass:y,maskTextSelector:S,unmaskTextSelector:M,ignoreCSSAttributes:I}=t,L=_C(e,r,o,s),N=iC(e);let b={};const x=e.attributes.length;for(let E=0;EA.href===e.href);let P=null;E&&(P=Ks(E)),P&&(b.rel=null,b.href=null,b.crossorigin=null,b._cssText=Qs(P,E.href))}if(N==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const E=Ks(e.sheet);E&&(b._cssText=Qs(E,Pi(n)))}if(N==="input"||N==="textarea"||N==="select"||N==="option"){const E=e,P=_u(E),A=Xs(E,Qa(N),P),O=E.checked;if(P!=="submit"&&P!=="button"&&A){const D=_r(E,_,S,y,M,Oi({type:P,tagName:Qa(N),maskInputOptions:a}));b.value=oo({isMasked:D,element:E,value:A,maskInputFn:u})}O&&(b.checked=O)}if(N==="option"&&(e.selected&&!a.select?b.selected=!0:delete b.selected),N==="canvas"&&f){if(e.__context==="2d")rC(e)||(b.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){const E=e.toDataURL(d.type,d.quality),P=n.createElement("canvas");P.width=e.width,P.height=e.height;const A=P.toDataURL(d.type,d.quality);E!==A&&(b.rr_dataURL=E)}}if(N==="img"&&l){Gn||(Gn=n.createElement("canvas"),Cd=Gn.getContext("2d"));const E=e,P=E.currentSrc||E.getAttribute("src")||"",A=E.crossOrigin,O=()=>{E.removeEventListener("load",O);try{Gn.width=E.naturalWidth,Gn.height=E.naturalHeight,Cd.drawImage(E,0,0),b.rr_dataURL=Gn.toDataURL(d.type,d.quality)}catch(D){if(E.crossOrigin!=="anonymous"){E.crossOrigin="anonymous",E.complete&&E.naturalWidth!==0?O():E.addEventListener("load",O);return}else console.warn(`Cannot inline img src=${P}! Error: ${D}`)}E.crossOrigin==="anonymous"&&(A?b.crossOrigin=A:E.removeAttribute("crossorigin"))};E.complete&&E.naturalWidth!==0?O():E.addEventListener("load",O)}if((N==="audio"||N==="video")&&(b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime),h||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop)),L){const{width:E,height:P}=e.getBoundingClientRect();b={class:b.class,rr_width:`${E}px`,rr_height:`${P}px`}}N==="iframe"&&!p(b.src)&&(!L&&!cg(e)&&(b.rr_src=b.src),delete b.src);let H;try{customElements.get(N)&&(H=!0)}catch{}return{type:Ie.Element,tagName:N,attributes:b,childNodes:[],isSVG:gC(e)||void 0,needBlock:L,rootId:m,isCustom:H}}function fe(e){return e==null?"":e.toLowerCase()}function wC(e,t){if(t.comment&&e.type===Ie.Comment)return!0;if(e.type===Ie.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"&&sg(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(fe(e.attributes.name).match(/^msapplication-tile(image|color)$/)||fe(e.attributes.name)==="application-name"||fe(e.attributes.rel)==="icon"||fe(e.attributes.rel)==="apple-touch-icon"||fe(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&fe(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(fe(e.attributes.property).match(/^(og|twitter|fb):/)||fe(e.attributes.name).match(/^(og|twitter):/)||fe(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(fe(e.attributes.name)==="robots"||fe(e.attributes.name)==="googlebot"||fe(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(fe(e.attributes.name)==="author"||fe(e.attributes.name)==="generator"||fe(e.attributes.name)==="framework"||fe(e.attributes.name)==="publisher"||fe(e.attributes.name)==="progid"||fe(e.attributes.property).match(/^article:/)||fe(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(fe(e.attributes.name)==="google-site-verification"||fe(e.attributes.name)==="yandex-verification"||fe(e.attributes.name)==="csrf-token"||fe(e.attributes.name)==="p:domain_verify"||fe(e.attributes.name)==="verify-v1"||fe(e.attributes.name)==="verification"||fe(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Zn(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:h={},maskAttributeFn:m,maskTextFn:_,maskInputFn:y,slimDOMOptions:S,dataURLOptions:M={},inlineImages:I=!1,recordCanvas:L=!1,onSerialize:N,onIframeLoad:b,iframeLoadTimeout:x=5e3,onBlockedImageLoad:H,onStylesheetLoad:E,stylesheetLoadTimeout:P=5e3,keepIframeSrcFn:A=()=>!1,newlyAddedElement:O=!1,ignoreCSSAttributes:D}=t;let{preserveWhiteSpace:Z=!0}=t;const X=EC(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,maskAllText:a,unblockSelector:i,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:y,dataURLOptions:M,inlineImages:I,recordCanvas:L,keepIframeSrcFn:A,newlyAddedElement:O,ignoreCSSAttributes:D});if(!X)return console.warn(e,"not serialized"),null;let ne;r.hasNode(e)?ne=r.getId(e):wC(X,S)||!Z&&X.type===Ie.Text&&!X.isStyle&&!X.textContent.replace(/^\s+|\s+$/gm,"").length?ne=so:ne=yu();const v=Object.assign(X,{id:ne});if(r.add(e,v),ne===so)return null;N&&N(e);let q=!f;if(v.type===Ie.Element){q=q&&!v.needBlock;const k=e.shadowRoot;k&&Jr(k)&&(v.isShadowHost=!0)}if((v.type===Ie.Document||v.type===Ie.Element)&&q){S.headWhitespace&&v.type===Ie.Element&&v.tagName==="head"&&(Z=!1);const k={doc:n,mirror:r,blockClass:o,blockSelector:s,maskAllText:a,unblockSelector:i,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:y,slimDOMOptions:S,dataURLOptions:M,inlineImages:I,recordCanvas:L,preserveWhiteSpace:Z,onSerialize:N,onIframeLoad:b,iframeLoadTimeout:x,onBlockedImageLoad:H,onStylesheetLoad:E,stylesheetLoadTimeout:P,keepIframeSrcFn:A,ignoreCSSAttributes:D},V=e.childNodes?Array.from(e.childNodes):[];for(const ae of V){const re=Zn(ae,k);re&&v.childNodes.push(re)}if(JA(e)&&e.shadowRoot)for(const ae of Array.from(e.shadowRoot.childNodes)){const re=Zn(ae,k);re&&(Jr(e.shadowRoot)&&(re.isShadow=!0),v.childNodes.push(re))}}if(e.parentNode&&Yr(e.parentNode)&&Jr(e.parentNode)&&(v.isShadow=!0),v.type===Ie.Element&&v.tagName==="iframe"&&!v.needBlock&&SC(e,()=>{const k=cg(e);if(k&&b){const V=Zn(k,{doc:k,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:y,slimDOMOptions:S,dataURLOptions:M,inlineImages:I,recordCanvas:L,preserveWhiteSpace:Z,onSerialize:N,onIframeLoad:b,iframeLoadTimeout:x,onStylesheetLoad:E,stylesheetLoadTimeout:P,keepIframeSrcFn:A,ignoreCSSAttributes:D});V&&b(e,V)}},x),v.type===Ie.Element&&v.tagName==="img"&&!e.complete&&v.needBlock){const k=e,V=()=>{if(k.isConnected&&!k.complete&&H)try{const ae=k.getBoundingClientRect();ae.width>0&&ae.height>0&&H(k,v,ae)}catch{}k.removeEventListener("load",V)};k.isConnected&&k.addEventListener("load",V)}return v.type===Ie.Element&&v.tagName==="link"&&typeof v.attributes.rel=="string"&&(v.attributes.rel==="stylesheet"||v.attributes.rel==="preload"&&typeof v.attributes.href=="string"&&sg(v.attributes.href)==="css")&&bC(e,()=>{if(E){const k=Zn(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:y,slimDOMOptions:S,dataURLOptions:M,inlineImages:I,recordCanvas:L,preserveWhiteSpace:Z,onSerialize:N,onIframeLoad:b,iframeLoadTimeout:x,onStylesheetLoad:E,stylesheetLoadTimeout:P,keepIframeSrcFn:A,ignoreCSSAttributes:D});k&&E(e,k)}},P),v.type===Ie.Element&&delete v.needBlock,v}function kC(e,t){const{mirror:n=new og,blockClass:r="rr-block",blockSelector:o=null,unblockSelector:s=null,maskAllText:i=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:u=null,unmaskTextSelector:d=null,inlineStylesheet:l=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:h=!1,maskAttributeFn:m,maskTextFn:_,maskInputFn:y,slimDOM:S=!1,dataURLOptions:M,preserveWhiteSpace:I,onSerialize:L,onIframeLoad:N,iframeLoadTimeout:b,onBlockedImageLoad:x,onStylesheetLoad:H,stylesheetLoadTimeout:E,keepIframeSrcFn:P=()=>!1,ignoreCSSAttributes:A=new Set([])}=t||{};return Zn(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,maskAllText:i,maskTextClass:a,unmaskTextClass:c,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:y,slimDOMOptions:S===!0||S==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:S==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:S===!1?{}:S,dataURLOptions:M,inlineImages:f,recordCanvas:p,preserveWhiteSpace:I,onSerialize:L,onIframeLoad:N,iframeLoadTimeout:b,onBlockedImageLoad:x,onStylesheetLoad:H,stylesheetLoadTimeout:E,keepIframeSrcFn:P,newlyAddedElement:!1,ignoreCSSAttributes:A})}function We(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Vn=`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 Md={map:{},getId(){return console.error(Vn),-1},getNode(){return console.error(Vn),null},removeNodeFromMap(){console.error(Vn)},has(){return console.error(Vn),!1},reset(){console.error(Vn)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Md=new Proxy(Md,{get(e,t,n){return t==="map"&&console.error(Vn),Reflect.get(e,t,n)}}));function io(e,t,n={}){let r=null,o=0;return function(...s){const i=Date.now();!o&&n.leading===!1&&(o=i);const a=t-(i-o),c=this;a<=0||a>t?(r&&(OC(r),r=null),o=i,e.apply(c,s)):!r&&n.trailing!==!1&&(r=Li(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,s)},a))}}function dg(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(i){Li(()=>{n.set.call(this,i)},0),s&&s.set&&s.set.call(this,i)}}),()=>dg(e,t,s||{},!0)}function Su(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}let Zs=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Zs=()=>new Date().getTime());function fg(e){const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0}}function pg(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function hg(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function mg(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Ye(e,t,n,r,o){if(!e)return!1;const s=mg(e);if(!s)return!1;const i=Qn(t,n);if(!o){const u=r&&s.matches(r);return i(s)&&!u}const a=Tn(s,i);let c=-1;return a<0?!1:(r&&(c=Tn(s,Qn(null,r))),a>-1&&c<0?!0:a{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 _g(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function yg(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function tc(e){return!!e?.shadowRoot}class CC{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 Sg(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function xC(e){let t=e,n;for(;n=Sg(t);)t=n;return t}function MC(e){const t=e.ownerDocument;if(!t)return!1;const n=xC(e);return t.contains(n)}function bg(e){const t=e.ownerDocument;return t?t.contains(e)||MC(e):!1}const Nd={};function bu(e){const t=Nd[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);const s=o.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(o)}catch{}return Nd[e]=r.bind(window)}function NC(...e){return bu("requestAnimationFrame")(...e)}function Li(...e){return bu("setTimeout")(...e)}function OC(...e){return bu("clearTimeout")(...e)}var Y=(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))(Y||{}),W=(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))(W||{}),He=(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))(He||{}),kt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(kt||{}),Yn=(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))(Yn||{});function Eu(e){try{return e.contentDocument}catch{}}function PC(e){try{return e.contentWindow}catch{}}function Od(e){return"__ln"in e}class LC{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 DC{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 LC,o=c=>{let u=c,d=so;for(;d===so;)u=u&&u.nextSibling,d=u&&this.mirror.getId(u);return d},s=c=>{if(!c.parentNode||!bg(c))return;const u=Yr(c.parentNode)?this.mirror.getId(Sg(c)):this.mirror.getId(c.parentNode),d=o(c);if(u===-1||d===-1)return r.addNode(c);const l=Zn(c,{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=>{_g(f,this.mirror)&&!Ye(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(f),yg(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),tc(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{Ye(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 c of this.movedSet)Ld(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||s(c);for(const c of this.addedSet)!Dd(this.droppedSet,c)&&!Ld(this.removes,c,this.mirror)||Dd(this.movedSet,c)?s(c):this.droppedSet.add(c);let i=null;for(;r.length;){let c=null;if(i){const u=this.mirror.getId(i.value.parentNode),d=o(i.value);u!==-1&&d!==-1&&(c=i)}if(!c){let u=r.tail;for(;u;){const d=u;if(u=u.previous,d){const l=this.mirror.getId(d.value.parentNode);if(o(d.value)===-1)continue;if(l!==-1){c=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){c=d;break}}}}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}i=c.previous,r.removeNode(c.value),s(c.value)}const a={texts:this.texts.map(c=>({id:this.mirror.getId(c.node),value:c.value})).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:u}=c;if(typeof u.style=="string"){const d=JSON.stringify(c.styleDiff),l=JSON.stringify(c._unchangedStyles);d.length!n.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.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(a))},this.processMutation=t=>{if(!fa(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!Ye(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:_r(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,mg(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.attributeName,o=t.target.getAttribute(r);if(r==="value"){const i=_u(n),a=n.tagName;o=Xs(n,a,i);const c=Oi({maskInputOptions:this.maskInputOptions,tagName:a,type:i}),u=_r(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,c);o=oo({isMasked:u,element:n,value:o,maskInputFn:this.maskInputFn})}if(Ye(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||o===t.oldValue)return;let s=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(o))if(!Eu(n))r="rr_src";else return;if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!lg(n.tagName,r)&&(s.attributes[r]=ug(this.doc,gr(n.tagName),gr(r),o,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const i=this.unattachedDoc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue);for(const a of Array.from(n.style)){const c=n.style.getPropertyValue(a),u=n.style.getPropertyPriority(a);c!==i.style.getPropertyValue(a)||u!==i.style.getPropertyPriority(a)?u===""?s.styleDiff[a]=c:s.styleDiff[a]=[c,u]:s._unchangedStyles[a]=[c,u]}for(const a of Array.from(i.style))n.style.getPropertyValue(a)===""&&(s.styleDiff[a]=!1)}break}case"childList":{if(Ye(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),o=Yr(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);Ye(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||fa(n,this.mirror)||!RC(n,this.mirror)||(this.addedSet.has(n)?(nc(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||gg(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[Pd(r,o)]?nc(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:Yr(t.target)&&Jr(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(fa(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[Pd(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ye(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),tc(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 nc(e,t){e.delete(t),t.childNodes?.forEach(n=>nc(e,n))}function Ld(e,t,n){return e.length===0?!1:FC(e,t,n)}function FC(e,t,n){let r=t.parentNode;for(;r;){const o=n.getId(r);if(e.some(s=>s.id===o))return!0;r=r.parentNode}return!1}function Dd(e,t){return e.size===0?!1:Eg(e,t)}function Eg(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:Eg(e,n):!1}let Kr;function $C(e){Kr=e}function BC(){Kr=void 0}const te=e=>Kr?(...n)=>{try{return e(...n)}catch(r){if(Kr&&Kr(r)===!0)return()=>{};throw r}}:e,er=[];function No(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 Tg(e,t){const n=new DC;er.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const o=window?.Zone?.__symbol__?.("MutationObserver");o&&window[o]&&(r=window[o]);const s=new r(te(i=>{e.onMutation&&e.onMutation(i)===!1||n.processMutations.bind(n)(i)}));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function UC({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let i=[],a;const c=io(te(l=>{const f=Date.now()-a;e(i.map(p=>(p.timeOffset-=f,p)),l),i=[],a=null}),s),u=te(io(te(l=>{const f=No(l),{clientX:p,clientY:h}=ec(l)?l.changedTouches[0]:l;a||(a=Zs()),i.push({x:p,y:h,id:r.getId(f),timeOffset:Zs()-a}),c(typeof DragEvent<"u"&&l instanceof DragEvent?W.Drag:l instanceof MouseEvent?W.MouseMove:W.TouchMove)}),o,{trailing:!1})),d=[We("mousemove",u,n),We("touchmove",u,n),We("drag",u,n)];return te(()=>{d.forEach(l=>l())})}function HC({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,sampling:i}){if(i.mouseInteraction===!1)return()=>{};const a=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,c=[];let u=null;const d=l=>f=>{const p=No(f);if(Ye(p,r,o,s,!0))return;let h=null,m=l;if("pointerType"in f){switch(f.pointerType){case"mouse":h=kt.Mouse;break;case"touch":h=kt.Touch;break;case"pen":h=kt.Pen;break}h===kt.Touch?He[l]===He.MouseDown?m="TouchStart":He[l]===He.MouseUp&&(m="TouchEnd"):kt.Pen}else ec(f)&&(h=kt.Touch);h!==null?(u=h,(m.startsWith("Touch")&&h===kt.Touch||m.startsWith("Mouse")&&h===kt.Mouse)&&(h=null)):He[l]===He.Click&&(h=u,u=null);const _=ec(f)?f.changedTouches[0]:f;if(!_)return;const y=n.getId(p),{clientX:S,clientY:M}=_;te(e)({type:He[m],id:y,x:S,y:M,...h!==null&&{pointerType:h}})};return Object.keys(He).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&a[l]!==!1).forEach(l=>{let f=gr(l);const p=d(l);if(window.PointerEvent)switch(He[l]){case He.MouseDown:case He.MouseUp:f=f.replace("mouse","pointer");break;case He.TouchStart:case He.TouchEnd:return}c.push(We(f,p,t))}),te(()=>{c.forEach(l=>l())})}function vg({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,sampling:i}){const a=te(io(te(c=>{const u=No(c);if(!u||Ye(u,r,o,s,!0))return;const d=n.getId(u);if(u===t&&t.defaultView){const l=fg(t.defaultView);e({id:d,x:l.left,y:l.top})}else e({id:d,x:u.scrollLeft,y:u.scrollTop})}),i.scroll||100));return We("scroll",a,t)}function WC({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const o=te(io(te(()=>{const s=pg(),i=hg();(n!==s||r!==i)&&(e({width:Number(i),height:Number(s)}),n=s,r=i)}),200));return We("resize",o,t)}const jC=["INPUT","TEXTAREA","SELECT"],Fd=new WeakMap;function zC({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,ignoreClass:i,ignoreSelector:a,maskInputOptions:c,maskInputFn:u,sampling:d,userTriggeredOnInput:l,maskTextClass:f,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:m}){function _(b){let x=No(b);const H=b.isTrusted,E=x&&Qa(x.tagName);if(E==="OPTION"&&(x=x.parentElement),!x||!E||jC.indexOf(E)<0||Ye(x,r,o,s,!0))return;const P=x;if(P.classList.contains(i)||a&&P.matches(a))return;const A=_u(x);let O=Xs(P,E,A),D=!1;const Z=Oi({maskInputOptions:c,tagName:E,type:A}),X=_r(x,f,h,p,m,Z);(A==="radio"||A==="checkbox")&&(D=x.checked),O=oo({isMasked:X,element:x,value:O,maskInputFn:u}),y(x,l?{text:O,isChecked:D,userTriggered:H}:{text:O,isChecked:D});const ne=x.name;A==="radio"&&ne&&D&&t.querySelectorAll(`input[type="radio"][name="${ne}"]`).forEach(v=>{if(v!==x){const q=oo({isMasked:X,element:v,value:Xs(v,E,A),maskInputFn:u});y(v,l?{text:q,isChecked:!D,userTriggered:!1}:{text:q,isChecked:!D})}})}function y(b,x){const H=Fd.get(b);if(!H||H.text!==x.text||H.isChecked!==x.isChecked){Fd.set(b,x);const E=n.getId(b);te(e)({...x,id:E})}}const M=(d.input==="last"?["change"]:["input","change"]).map(b=>We(b,te(_),t)),I=t.defaultView;if(!I)return()=>{M.forEach(b=>b())};const L=I.Object.getOwnPropertyDescriptor(I.HTMLInputElement.prototype,"value"),N=[[I.HTMLInputElement.prototype,"value"],[I.HTMLInputElement.prototype,"checked"],[I.HTMLSelectElement.prototype,"value"],[I.HTMLTextAreaElement.prototype,"value"],[I.HTMLSelectElement.prototype,"selectedIndex"],[I.HTMLOptionElement.prototype,"selected"]];return L&&L.set&&M.push(...N.map(b=>dg(b[0],b[1],{set(){te(_)({target:this,isTrusted:!1})}},!1,I))),te(()=>{M.forEach(b=>b())})}function ei(e){const t=[];function n(r,o){if(Qo("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Qo("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Qo("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Qo("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const i=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(i)}else if(r.parentStyleSheet){const i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(i)}return o}return n(e,t)}function Yt(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function qC({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:te((d,l,f)=>{const[p,h]=f,{id:m,styleId:_}=Yt(l,t,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&e({id:m,styleId:_,adds:[{rule:p,index:h}]}),d.apply(l,f)})});const s=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:te((d,l,f)=>{const[p]=f,{id:h,styleId:m}=Yt(l,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,removes:[{index:p}]}),d.apply(l,f)})});let i;r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:te((d,l,f)=>{const[p]=f,{id:h,styleId:m}=Yt(l,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replace:p}),d.apply(l,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:te((d,l,f)=>{const[p]=f,{id:h,styleId:m}=Yt(l,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replaceSync:p}),d.apply(l,f)})}));const c={};Zo("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(Zo("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),Zo("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),Zo("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(c).forEach(([d,l])=>{u[d]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=new Proxy(u[d].insertRule,{apply:te((f,p,h)=>{const[m,_]=h,{id:y,styleId:S}=Yt(p.parentStyleSheet,t,n.styleMirror);return(y&&y!==-1||S&&S!==-1)&&e({id:y,styleId:S,adds:[{rule:m,index:[...ei(p),_||0]}]}),f.apply(p,h)})}),l.prototype.deleteRule=new Proxy(u[d].deleteRule,{apply:te((f,p,h)=>{const[m]=h,{id:_,styleId:y}=Yt(p.parentStyleSheet,t,n.styleMirror);return(_&&_!==-1||y&&y!==-1)&&e({id:_,styleId:y,removes:[{index:[...ei(p),m]}]}),f.apply(p,h)})})}),te(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=s,i&&(r.CSSStyleSheet.prototype.replace=i),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([d,l])=>{l.prototype.insertRule=u[d].insertRule,l.prototype.deleteRule=u[d].deleteRule})})}function Ig({mirror:e,stylesheetManager:t},n){let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);const o=n.nodeName==="#document"?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,s=o?.prototype?Object.getOwnPropertyDescriptor(o?.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!o||!s?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){return s.get?.call(this)},set(i){const a=s.set?.call(this,i);if(r!==null&&r!==-1)try{t.adoptStyleSheets(i,r)}catch{}return a}}),te(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function GC({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:te((a,c,u)=>{const[d,l,f]=u;if(n.has(d))return s.apply(c,[d,l,f]);const{id:p,styleId:h}=Yt(c.parentRule?.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,set:{property:d,value:l,priority:f},index:ei(c.parentRule)}),a.apply(c,u)})});const i=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:te((a,c,u)=>{const[d]=u;if(n.has(d))return i.apply(c,[d]);const{id:l,styleId:f}=Yt(c.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||f&&f!==-1)&&e({id:l,styleId:f,remove:{property:d},index:ei(c.parentRule)}),a.apply(c,u)})}),te(()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=i})}function VC({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:o,sampling:s,doc:i}){const a=te(u=>io(te(d=>{const l=No(d);if(!l||Ye(l,t,n,r,!0))return;const{currentTime:f,volume:p,muted:h,playbackRate:m}=l;e({type:u,id:o.getId(l),currentTime:f,volume:p,muted:h,playbackRate:m})}),s.media||500)),c=[We("play",a(Yn.Play),i),We("pause",a(Yn.Pause),i),We("seeked",a(Yn.Seeked),i),We("volumechange",a(Yn.VolumeChange),i),We("ratechange",a(Yn.RateChange),i)];return te(()=>{c.forEach(u=>u())})}function YC({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(c,u,d){const l=new s(c,u,d);return o.set(l,{family:c,buffer:typeof u!="string",descriptors:d,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),l};const i=Su(t.fonts,"add",function(a){return function(c){return Li(te(()=>{const u=o.get(c);u&&(e(u),o.delete(c))}),0),a.apply(this,[c])}});return r.push(()=>{n.FontFace=s}),r.push(i),te(()=>{r.forEach(a=>a())})}function JC(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,selectionCb:i}=e;let a=!0;const c=te(()=>{const u=t.getSelection();if(!u||a&&u?.isCollapsed)return;a=u.isCollapsed||!1;const d=[],l=u.rangeCount||0;for(let f=0;f{}:Su(n.customElements,"define",function(o){return function(s,i,a){try{t({define:{name:s}})}catch{}return o.apply(this,[s,i,a])}})}function XC(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=Tg(e,e.doc));const o=UC(e),s=HC(e),i=vg(e),a=WC(e,{win:n}),c=zC(e),u=VC(e);let d=()=>{},l=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(d=qC(e,{win:n}),l=Ig(e,e.doc),f=GC(e,{win:n}),e.collectFonts&&(p=YC(e)));const h=JC(e),m=KC(e),_=[];for(const y of e.plugins)_.push(y.observer(y.callback,n,y.options));return te(()=>{er.forEach(y=>y.reset()),r?.disconnect(),o(),s(),i(),a(),c(),u(),d(),l(),f(),p(),h(),m(),_.forEach(y=>y())})}function Qo(e){return typeof window[e]<"u"}function Zo(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class rc{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,o){const s=r||this.getIdToRemoteIdMap(t),i=o||this.getRemoteIdToIdMap(t);let a=s.get(n);return a||(a=this.generateIdFn(),s.set(n,a),i.set(a,n)),a}getIds(t,n){const r=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return n.map(s=>this.getId(t,s,r,o))}getRemoteId(t,n,r){const o=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const s=o.get(n);return s||-1}getRemoteIds(t,n){const r=this.getRemoteIdToIdMap(t);return n.map(o=>this.getRemoteId(t,o,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 QC{constructor(){this.crossOriginIframeMirror=new rc(yu),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class ZC{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new rc(yu),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new rc(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){this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&t.contentWindow?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(t);const r=Eu(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 o=this.crossOriginIframeMap.get(t.source);if(!o)return;const s=this.transformCrossOriginEvent(o,n.data.event);s&&this.wrappedEmit(s,n.data.isCheckout)}transformCrossOriginEvent(t,n){switch(n.type){case Y.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const r=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(n.data.node,r),{timestamp:n.timestamp,type:Y.IncrementalSnapshot,data:{source:W.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Y.Meta:case Y.Load:case Y.DomContentLoaded:return!1;case Y.Plugin:return n;case Y.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case Y.IncrementalSnapshot:switch(n.data.source){case W.Mutation:return n.data.adds.forEach(r=>{this.replaceIds(r,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,t);const o=this.crossOriginIframeRootIdMap.get(t);o&&this.patchRootIdOnNode(r.node,o)}),n.data.removes.forEach(r=>{this.replaceIds(r,t,["parentId","id"])}),n.data.attributes.forEach(r=>{this.replaceIds(r,t,["id"])}),n.data.texts.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case W.Drag:case W.TouchMove:case W.MouseMove:return n.data.positions.forEach(r=>{this.replaceIds(r,t,["id"])}),n;case W.ViewportResize:return!1;case W.MediaInteraction:case W.MouseInteraction:case W.Scroll:case W.CanvasMutation:case W.Input:return this.replaceIds(n.data,t,["id"]),n;case W.StyleSheetRule:case W.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case W.Font:return n;case W.Selection:return n.data.ranges.forEach(r=>{this.replaceIds(r,t,["start","end"])}),n;case W.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),n.data.styles?.forEach(r=>{this.replaceStyleIds(r,t,["styleId"])}),n}}return!1}replace(t,n,r,o){for(const s of o)!Array.isArray(n[s])&&typeof n[s]!="number"||(Array.isArray(n[s])?n[s]=t.getIds(r,n[s]):n[s]=t.getId(r,n[s]));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!==Ie.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class e1{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class t1{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(!Jr(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const r=Tg({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(vg({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),Li(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Ig({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){const n=Eu(t),r=PC(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(Su(t.prototype,"attachShadow",function(o){return function(s){const i=o.call(this,s);return this.shadowRoot&&bg(this)&&r.addShadowRoot(this.shadowRoot,n),i}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}var $d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var es=0;es<$d.length;es++)n1[$d.charCodeAt(es)]=es;class Bd{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class r1{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new CC,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;const r={id:n,styleIds:[]},o=[];for(const s of t){let i;this.styleMirror.has(s)?i=this.styleMirror.getId(s):(i=this.styleMirror.add(s),o.push({styleId:i,rules:Array.from(s.rules||CSSRule,(a,c)=>({rule:rg(a),index:c}))})),r.styleIds.push(i)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class o1{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(o=>o!==n)}add(t,n){this.active||(this.active=!0,NC(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}}let Ee,ti;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const ut=nC();function Pt(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:s=null,unblockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskAllText:u=!1,maskTextClass:d="rr-mask",unmaskTextClass:l=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:h=!0,maskAllInputs:m,maskInputOptions:_,slimDOMOptions:y,maskAttributeFn:S,maskInputFn:M,maskTextFn:I,maxCanvasSize:L=null,packFn:N,sampling:b={},dataURLOptions:x={},mousemoveWait:H,recordDOM:E=!0,recordCanvas:P=!1,recordCrossOriginIframes:A=!1,recordAfter:O=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:D=!1,collectFonts:Z=!1,inlineImages:X=!1,plugins:ne,keepIframeSrcFn:v=()=>!1,ignoreCSSAttributes:q=new Set([]),errorHandler:k,onMutation:V,getCanvasManager:ae}=e;$C(k);const re=A?window.parent===window:!0;let ve=!1;if(!re)try{window.parent.document&&(ve=!1)}catch{ve=!0}if(re&&!t)throw new Error("emit function is required");if(!re&&!ve)return()=>{};H!==void 0&&b.mousemove===void 0&&(b.mousemove=H),ut.reset();const $e=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?_:{},qt=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all"}:y||{};AC();let Me,Ne=0;const it=K=>{for(const Ue of ne||[])Ue.eventProcessor&&(K=Ue.eventProcessor(K));return N&&!ve&&(K=N(K)),K};Ee=(K,Ue)=>{const Q=K;if(Q.timestamp=Zs(),er[0]?.isFrozen()&&Q.type!==Y.FullSnapshot&&!(Q.type===Y.IncrementalSnapshot&&Q.data.source===W.Mutation)&&er.forEach(Oe=>Oe.unfreeze()),re)t?.(it(Q),Ue);else if(ve){const Oe={type:"rrweb",event:it(Q),origin:window.location.origin,isCheckout:Ue};window.parent.postMessage(Oe,"*")}if(Q.type===Y.FullSnapshot)Me=Q,Ne=0;else if(Q.type===Y.IncrementalSnapshot){if(Q.data.source===W.Mutation&&Q.data.isAttachIframe)return;Ne++;const Oe=r&&Ne>=r,se=n&&Me&&Q.timestamp-Me.timestamp>n;(Oe||se)&&Be(!0)}};const at=K=>{Ee({type:Y.IncrementalSnapshot,data:{source:W.Mutation,...K}})},Fr=K=>Ee({type:Y.IncrementalSnapshot,data:{source:W.Scroll,...K}}),Bo=K=>Ee({type:Y.IncrementalSnapshot,data:{source:W.CanvasMutation,...K}}),Uo=K=>Ee({type:Y.IncrementalSnapshot,data:{source:W.AdoptedStyleSheet,...K}}),ct=new r1({mutationCb:at,adoptedStyleSheetCb:Uo}),oe=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new QC:new ZC({mirror:ut,mutationCb:at,stylesheetManager:ct,recordCrossOriginIframes:A,wrappedEmit:Ee});for(const K of ne||[])K.getMirror&&K.getMirror({nodeMirror:ut,crossOriginIframeMirror:oe.crossOriginIframeMirror,crossOriginIframeStyleMirror:oe.crossOriginIframeStyleMirror});const ge=new o1,Xe=i1(ae,{mirror:ut,win:window,mutationCb:K=>Ee({type:Y.IncrementalSnapshot,data:{source:W.CanvasMutation,...K}}),recordCanvas:P,blockClass:o,blockSelector:s,unblockSelector:i,maxCanvasSize:L,sampling:b.canvas,dataURLOptions:x,errorHandler:k}),Ae=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new e1:new t1({mutationCb:at,scrollCb:Fr,bypassOptions:{onMutation:V,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:$e,dataURLOptions:x,maskAttributeFn:S,maskTextFn:I,maskInputFn:M,recordCanvas:P,inlineImages:X,sampling:b,slimDOMOptions:qt,iframeManager:oe,stylesheetManager:ct,canvasManager:Xe,keepIframeSrcFn:v,processedNodeManager:ge,ignoreCSSAttributes:q},mirror:ut}),Be=(K=!1)=>{if(!E)return;Ee({type:Y.Meta,data:{href:window.location.href,width:hg(),height:pg()}},K),ct.reset(),Ae.init(),er.forEach(Q=>Q.lock());const Ue=kC(document,{mirror:ut,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskAllInputs:$e,maskAttributeFn:S,maskInputFn:M,maskTextFn:I,slimDOM:qt,dataURLOptions:x,recordCanvas:P,inlineImages:X,onSerialize:Q=>{_g(Q,ut)&&oe.addIframe(Q),yg(Q,ut)&&ct.trackLinkElement(Q),tc(Q)&&Ae.addShadowRoot(Q.shadowRoot,document)},onIframeLoad:(Q,Oe)=>{oe.attachIframe(Q,Oe),Q.contentWindow&&Xe.addWindow(Q.contentWindow),Ae.observeAttachShadow(Q)},onStylesheetLoad:(Q,Oe)=>{ct.attachLinkElement(Q,Oe)},onBlockedImageLoad:(Q,Oe,{width:se,height:$r})=>{at({adds:[],removes:[],texts:[],attributes:[{id:Oe.id,attributes:{style:{width:`${se}px`,height:`${$r}px`}}}]})},keepIframeSrcFn:v,ignoreCSSAttributes:q});if(!Ue)return console.warn("Failed to snapshot the document");Ee({type:Y.FullSnapshot,data:{node:Ue,initialOffset:fg(window)}}),er.forEach(Q=>Q.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ct.adoptStyleSheets(document.adoptedStyleSheets,ut.getId(document))};ti=Be;try{const K=[],Ue=Oe=>te(XC)({onMutation:V,mutationCb:at,mousemoveCb:(se,$r)=>Ee({type:Y.IncrementalSnapshot,data:{source:$r,positions:se}}),mouseInteractionCb:se=>Ee({type:Y.IncrementalSnapshot,data:{source:W.MouseInteraction,...se}}),scrollCb:Fr,viewportResizeCb:se=>Ee({type:Y.IncrementalSnapshot,data:{source:W.ViewportResize,...se}}),inputCb:se=>Ee({type:Y.IncrementalSnapshot,data:{source:W.Input,...se}}),mediaInteractionCb:se=>Ee({type:Y.IncrementalSnapshot,data:{source:W.MediaInteraction,...se}}),styleSheetRuleCb:se=>Ee({type:Y.IncrementalSnapshot,data:{source:W.StyleSheetRule,...se}}),styleDeclarationCb:se=>Ee({type:Y.IncrementalSnapshot,data:{source:W.StyleDeclaration,...se}}),canvasMutationCb:Bo,fontCb:se=>Ee({type:Y.IncrementalSnapshot,data:{source:W.Font,...se}}),selectionCb:se=>{Ee({type:Y.IncrementalSnapshot,data:{source:W.Selection,...se}})},customElementCb:se=>{Ee({type:Y.IncrementalSnapshot,data:{source:W.CustomElement,...se}})},blockClass:o,ignoreClass:a,ignoreSelector:c,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:$e,inlineStylesheet:h,sampling:b,recordDOM:E,recordCanvas:P,inlineImages:X,userTriggeredOnInput:D,collectFonts:Z,doc:Oe,maskAttributeFn:S,maskInputFn:M,maskTextFn:I,keepIframeSrcFn:v,blockSelector:s,unblockSelector:i,slimDOMOptions:qt,dataURLOptions:x,mirror:ut,iframeManager:oe,stylesheetManager:ct,shadowDomManager:Ae,processedNodeManager:ge,canvasManager:Xe,ignoreCSSAttributes:q,plugins:ne?.filter(se=>se.observer)?.map(se=>({observer:se.observer,options:se.options,callback:$r=>Ee({type:Y.Plugin,data:{plugin:se.name,payload:$r}})}))||[]},{});oe.addLoadListener(Oe=>{try{K.push(Ue(Oe.contentDocument))}catch(se){console.warn(se)}});const Q=()=>{Be(),K.push(Ue(document))};return document.readyState==="interactive"||document.readyState==="complete"?Q():(K.push(We("DOMContentLoaded",()=>{Ee({type:Y.DomContentLoaded,data:{}}),O==="DOMContentLoaded"&&Q()})),K.push(We("load",()=>{Ee({type:Y.Load,data:{}}),O==="load"&&Q()},window))),()=>{K.forEach(Oe=>Oe()),ge.destroy(),ti=void 0,BC()}}catch(K){console.warn(K)}}function s1(e){if(!ti)throw new Error("please take full snapshot after start recording");ti(e)}Pt.mirror=ut;Pt.takeFullSnapshot=s1;function i1(e,t){try{return e?e(t):new Bd}catch{return console.warn("Unable to initialize CanvasManager"),new Bd}}var Ud;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Ud||(Ud={}));const a1=3,c1=5;function Tu(e){return e>9999999999?e:e*1e3}function pa(e){return e>9999999999?e/1e3:e}function Oo(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:Y.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Pe(t,10,1e3)}}),t.category==="console")))}const u1="button,a";function wg(e){return e.closest(u1)||e}function kg(e){const t=Rg(e);return!t||!(t instanceof Element)?t:wg(t)}function Rg(e){return l1(e)?e.target:e}function l1(e){return typeof e=="object"&&!!e&&"target"in e}let Jt;function d1(e){return Jt||(Jt=[],f1()),Jt.push(e),()=>{const t=Jt?Jt.indexOf(e):-1;t>-1&&Jt.splice(t,1)}}function f1(){Le(pe,"open",function(e){return function(...t){if(Jt)try{Jt.forEach(n=>n())}catch{}return e.apply(pe,t)}})}const p1=new Set([W.Mutation,W.StyleSheetRule,W.StyleDeclaration,W.AdoptedStyleSheet,W.CanvasMutation,W.Selection,W.MediaInteraction]);function h1(e,t,n){e.handleClick(t,n)}class m1{constructor(t,n,r=Oo){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=d1(()=>{this._lastMutation=Hd()});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(_1(n,this._ignoreSelector)||!y1(t))return;const r={timestamp:pa(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(o=>o.node===r.node&&Math.abs(o.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=pa(t)}registerScroll(t=Date.now()){this._lastScroll=pa(t)}registerClick(t){const n=wg(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=Hd();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 o=this._clicks.indexOf(r);o>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(o,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scrollTimeout,o=t.mutationAfter&&t.mutationAfter<=this._threshold,s=!r&&!o,{clickCount:i,clickBreadcrumb:a}=t;if(s){const c=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,u=c1){const c={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.multiClick",data:{...a.data,url:pe.location.href,route:n.getCurrentRoute(),clickCount:i,metric:!0}};this._addBreadcrumbEvent(n,c)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Mo(()=>this._checkClicks(),1e3)}}const g1=["A","BUTTON","INPUT"];function _1(e,t){return!!(!g1.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 y1(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function Hd(){return Date.now()/1e3}function S1(e,t){try{if(!b1(t))return;const{source:n}=t.data;if(p1.has(n)&&e.registerMutation(t.timestamp),n===W.Scroll&&e.registerScroll(t.timestamp),E1(t)){const{type:r,id:o}=t.data,s=Pt.mirror.getNode(o);s instanceof HTMLElement&&r===He.Click&&e.registerClick(s)}}catch{}}function b1(e){return e.type===a1}function E1(e){return e.data.source===W.MouseInteraction}function _t(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var vu=(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))(vu||{});const T1=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function v1(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(T1.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const I1=e=>t=>{if(!e.isEnabled())return;const n=w1(t);if(!n)return;const r=t.name==="click",o=r?t.event:void 0;r&&e.clickDetector&&o?.target&&!o.altKey&&!o.metaKey&&!o.ctrlKey&&!o.shiftKey&&h1(e.clickDetector,n,kg(t.event)),Oo(e,n)};function Ag(e,t){const n=Pt.mirror.getId(e),r=n&&Pt.mirror.getNode(n),o=r&&Pt.mirror.getMeta(r),s=o&&R1(o)?o:null;return{message:t,data:s?{nodeId:n,node:{id:n,tagName:s.tagName,textContent:Array.from(s.childNodes).map(i=>i.type===vu.Text&&i.textContent).filter(Boolean).map(i=>i.trim()).join(""),attributes:v1(s.attributes)}}:{}}}function w1(e){const{target:t,message:n}=k1(e);return _t({category:`ui.${e.name}`,...Ag(t,n)})}function k1(e){const t=e.name==="click";let n,r=null;try{r=t?kg(e.event):Rg(e.event),n=Ge(r,{maxStringLength:200})||""}catch{n=""}return{target:r,message:n}}function R1(e){return e.type===vu.Element}function A1(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=C1(t);n&&Oo(e,n)}function C1(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:s,target:i}=e;if(!i||x1(i)||!s)return null;const a=t||r||o,c=s.length===1;if(!a&&c)return null;const u=Ge(i,{maxStringLength:200})||"",d=Ag(i,u);return _t({category:"ui.keyDown",message:u,data:{...d.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:s}})}function x1(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const M1={resource:D1,paint:P1,navigation:L1};function ha(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function N1(e){return e.map(O1).filter(Boolean)}function O1(e){const t=M1[e.entryType];return t?t(e):null}function yr(e){return((Fe()||pe.performance.timeOrigin)+e)/1e3}function P1(e){const{duration:t,entryType:n,name:r,startTime:o}=e,s=yr(o);return{type:n,name:r,start:s,end:s+t,data:void 0}}function L1(e){const{entryType:t,name:n,decodedBodySize:r,duration:o,domComplete:s,encodedBodySize:i,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:u,loadEventStart:d,loadEventEnd:l,redirectCount:f,startTime:p,transferSize:h,type:m}=e;return o===0?null:{type:`${t}.${m}`,start:yr(p),end:yr(s),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:i,duration:o,domInteractive:u,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:d,loadEventEnd:l,domComplete:s,redirectCount:f}}}function D1(e){const{entryType:t,initiatorType:n,name:r,responseEnd:o,startTime:s,decodedBodySize:i,encodedBodySize:a,responseStatus:c,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:yr(s),end:yr(o),name:r,data:{size:u,statusCode:c,decodedBodySize:i,encodedBodySize:a}}}function F1(e){const t=e.entries[e.entries.length-1],n=t?.element?[t.element]:void 0;return Iu(e,"largest-contentful-paint",n)}function $1(e){return e.sources!==void 0}function B1(e){const t=[],n=[];for(const r of e.entries)if($1(r)){const o=[];for(const s of r.sources)if(s.node){n.push(s.node);const i=Pt.mirror.getId(s.node);i&&o.push(i)}t.push({value:r.value,nodeIds:o.length?o:void 0})}return Iu(e,"cumulative-layout-shift",n,t)}function U1(e){const t=e.entries[e.entries.length-1],n=t?.target?[t.target]:void 0;return Iu(e,"interaction-to-next-paint",n)}function Iu(e,t,n,r){const o=e.value,s=e.rating,i=yr(o);return{type:"web-vital",name:t,start:i,end:i,data:{value:o,size:o,rating:s,nodeIds:n?n.map(a=>Pt.mirror.getId(a)):void 0,attributions:r}}}function H1(e){function t(o){e.performanceEntries.includes(o)||e.performanceEntries.push(o)}function n({entries:o}){o.forEach(t)}const r=[];return["navigation","paint","resource"].forEach(o=>{r.push($n(o,n))}),r.push(cu(ha(F1,e)),au(ha(B1,e)),wm(ha(U1,e))),()=>{r.forEach(o=>o())}}const B=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,W1='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 j1(){const e=new Blob([W1]);return URL.createObjectURL(e)}const Wd=["log","warn","error"],Ts="[Replay] ";function ma(e,t="info"){mt({category:"console",data:{logger:"replay"},level:t,message:`${Ts}${e}`},{level:t})}function z1(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return B?(Wd.forEach(r=>{n[r]=(...o)=>{g[r](Ts,...o),t&&ma(o.join(""),$s(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),g.error(Ts,r),e?me(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&ma(r,"error")},n.infoTick=(...r)=>{g.log(Ts,...r),t&&setTimeout(()=>ma(r[0]),0)}):Wd.forEach(r=>{n[r]=()=>{}}),n}const U=z1();class wu extends Error{constructor(){super(`Event buffer exceeded maximum size of ${gu}.`)}}class Cg{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>gu)throw new wu;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():(B&&U.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{B&&U.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(){B&&U.log("Destroying compression worker"),this._worker.terminate()}postMessage(t,n){const r=this._getAndIncrementId();return new Promise((o,s)=>{const i=({data:a})=>{const c=a;if(c.method===t&&c.id===r){if(this._worker.removeEventListener("message",i),!c.success){B&&U.error("Error in compression worker: ",c.response),s(new Error("Error in compression worker"));return}o(c.response)}};this._worker.addEventListener("message",i),this._worker.postMessage({id:r,method:t,arg:n})})}_getAndIncrementId(){return this._id++}}class G1{constructor(t){this._worker=new q1(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=Tu(t.timestamp);(!this._earliestTimestamp||ngu?Promise.reject(new wu):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{B&&U.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 V1{constructor(t){this._fallback=new Cg,this._compression=new G1(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){B&&U.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,o=[];for(const s of t)o.push(this._compression.addEvent(s));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(o),this._fallback.clear()}catch(s){B&&U.exception(s,"Failed to add events when switching buffers.")}}}function Y1({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=J1(t);if(n)return n}return B&&U.log("Using simple buffer"),new Cg}function J1(e){try{const t=e||K1();if(!t)return;B&&U.log(`Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new V1(n)}catch(t){B&&U.exception(t,"Failed to create compression worker")}}function K1(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?j1():""}function ku(){try{return"sessionStorage"in pe&&!!pe.sessionStorage}catch{return!1}}function X1(e){Q1(),e.session=void 0}function Q1(){if(ku())try{pe.sessionStorage.removeItem(hu)}catch{}}function xg(e){return e===void 0?!1:Math.random()e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(B&&U.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function rx(e,t){try{if(typeof t=="function"&&tx(e))return t(e)}catch(n){return B&&U.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Au(e){return!e.type}function sc(e){return e.type==="transaction"}function ox(e){return e.type==="replay_event"}function zd(e){return e.type==="feedback"}function sx(e){return(t,n)=>{if(!e.isEnabled()||!Au(t)&&!sc(t))return;const r=n.statusCode;if(!(!r||r<200||r>=300)){if(sc(t)){ix(e,t);return}ax(e,t)}}}function ix(e,t){const n=e.getContext();t.contexts?.trace?.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function ax(e,t){const n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!t.tags?.replayId)return;const{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||Mo(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(o){e.handleException(o)}})}function cx(e){return t=>{!e.isEnabled()||!Au(t)||ux(e,t)}}function ux(e,t){const n=t.exception?.values?.[0]?.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 r=_t({category:"replay.hydrate-error",data:{url:Bn()}});Oo(e,r)}}function lx(e){const t=C();t&&t.on("beforeAddBreadcrumb",n=>dx(e,n))}function dx(e,t){if(!e.isEnabled()||!Dg(t))return;const n=fx(t);n&&Oo(e,n)}function fx(e){return!Dg(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?px(e):_t(e)}function px(e){const t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return _t(e);let n=!1;const r=t.map(o=>{if(!o)return o;if(typeof o=="string")return o.length>Xo?(n=!0,`${o.slice(0,Xo)}…`):o;if(typeof o=="object")try{const s=Pe(o,7);return JSON.stringify(s).length>Xo?(n=!0,`${JSON.stringify(s,null,2).slice(0,Xo)}…`):s}catch{}return o});return _t({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function Dg(e){return!!e.category}function hx(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function Fg(){const e=j().getPropagationContext().dsc;e&&delete e.replay_id;const t=Te();if(t){const n=rt(t);delete n.replay_id}}function mx(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:Y.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 gx(e,t){return e.recordingMode!=="buffer"||t.message===mu||!t.exception||t.type?!1:xg(e.getOptions().errorSampleRate)}function _x(e){return Object.assign((t,n)=>{if(!e.isEnabled()||e.isPaused())return t;if(ox(t))return delete t.breadcrumbs,t;if(!Au(t)&&!sc(t)&&!zd(t))return t;if(!e.checkAndHandleExpiredSession())return Fg(),t;if(zd(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),mx(e,t),t;if(hx(t,n)&&!e.getOptions()._experiments.captureExceptions)return B&&U.log("Ignoring error from rrweb internals",t),null;const o=gx(e,t);if((o||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),o&&e.recordingMode==="buffer"&&e.session?.sampled==="buffer"){const i=e.session;i.dirty=!0,e.getOptions().stickySession&&Di(i)}return t},{id:"Replay"})}function Fi(e,t){return t.map(({type:n,start:r,end:o,name:s,data:i})=>{const a=e.throttledAddEvent({type:Y.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:s,startTimestamp:r,endTimestamp:o,data:i}}});return typeof a=="string"?Promise.resolve(null):a})}function yx(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 Sx(e){return t=>{if(!e.isEnabled())return;const n=yx(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(Fi(e,[n]),!1)))}}function bx(e,t){return B&&e.getOptions()._experiments.traceInternals?!1:uh(t,C())}function $g(e,t){e.isEnabled()&&t!==null&&(bx(e,t.name)||e.addUpdate(()=>(Fi(e,[t]),!0)))}function $i(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=Nm(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function Bg(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function ni(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 Ug(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:o,method:s,statusCode:i,request:a,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:o,data:{method:s,statusCode:i,request:a,response:c}}}function ao(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function en(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:o,warnings:s}=Ex(n);return r.body=o,s?.length&&(r._meta={warnings:s}),r}function ic(e,t){return Object.entries(e).reduce((n,[r,o])=>{const s=r.toLowerCase();return t.includes(s)&&e[r]&&(n[s]=o),n},{})}function Ex(e){if(!e||typeof e!="string")return{body:e};const t=e.length>Id,n=Tx(e);if(t){const r=e.slice(0,Id);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 Tx(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function ri(e,t){const n=vx(e);return pt(n,t)}function vx(e,t=pe.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(pe.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 Ix(e,t,n){try{const r=await kx(e,t,n),o=Ug("resource.fetch",r);$g(n.replay,o)}catch(r){B&&U.exception(r,"Failed to capture fetch breadcrumb")}}function wx(e,t){const{input:n,response:r}=t,o=n?fu(n):void 0,s=$i(o),i=r?Bg(r.headers.get("content-length")):void 0;s!==void 0&&(e.data.request_body_size=s),i!==void 0&&(e.data.response_body_size=i)}async function kx(e,t,n){const r=Date.now(),{startTimestamp:o=r,endTimestamp:s=r}=t,{url:i,method:a,status_code:c=0,request_body_size:u,response_body_size:d}=e.data,l=ri(i,n.networkDetailAllowUrls)&&!ri(i,n.networkDetailDenyUrls),f=l?Rx(n,t.input,u):ao(u),p=await Ax(l,n,t.response,d);return{startTimestamp:o,endTimestamp:s,url:i,method:a,statusCode:c,request:f,response:p}}function Rx({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const o=n?Mx(n,t):{};if(!e)return en(o,r,void 0);const s=fu(n),[i,a]=Js(s,U),c=en(o,r,i);return a?ni(c,a):c}async function Ax(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,o){if(!e&&o!==void 0)return ao(o);const s=r?Hg(r.headers,n):{};if(!r||!t&&o!==void 0)return en(s,o,void 0);const[i,a]=await xx(r),c=Cx(i,{networkCaptureBodies:t,responseBodySize:o,captureDetails:e,headers:s});return a?ni(c,a):c}function Cx(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:o}){try{const s=e?.length&&n===void 0?$i(e):n;return r?t?en(o,s,e):en(o,s,void 0):ao(s)}catch(s){return B&&U.exception(s,"Failed to serialize response body"),en(o,n,void 0)}}async function xx(e){const t=Nx(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await Ox(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(B&&U.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(B&&U.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function Hg(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function Mx(e,t){return e.length===1&&typeof e[0]!="string"?qd(e[0],t):e.length===2?qd(e[1],t):{}}function qd(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?Hg(n,t):Array.isArray(n)?{}:ic(n,t):{}}function Nx(e){try{return e.clone()}catch(t){B&&U.exception(t,"Failed to clone response body")}}function Ox(e){return new Promise((t,n)=>{const r=Mo(()=>n(new Error("Timeout while trying to read response body")),500);Px(e).then(o=>t(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function Px(e){return await e.text()}async function Lx(e,t,n){try{const r=Fx(e,t,n),o=Ug("resource.xhr",r);$g(n.replay,o)}catch(r){B&&U.exception(r,"Failed to capture xhr breadcrumb")}}function Dx(e,t){const{xhr:n,input:r}=t;if(!n)return;const o=$i(r),s=n.getResponseHeader("content-length")?Bg(n.getResponseHeader("content-length")):Ux(n.response,n.responseType);o!==void 0&&(e.data.request_body_size=o),s!==void 0&&(e.data.response_body_size=s)}function Fx(e,t,n){const r=Date.now(),{startTimestamp:o=r,endTimestamp:s=r,input:i,xhr:a}=t,{url:c,method:u,status_code:d=0,request_body_size:l,response_body_size:f}=e.data;if(!c)return null;if(!a||!ri(c,n.networkDetailAllowUrls)||ri(c,n.networkDetailDenyUrls)){const N=ao(l),b=ao(f);return{startTimestamp:o,endTimestamp:s,url:c,method:u,statusCode:d,request:N,response:b}}const p=a[At],h=p?ic(p.request_headers,n.networkRequestHeaders):{},m=ic(Om(a),n.networkResponseHeaders),[_,y]=n.networkCaptureBodies?Js(i,U):[void 0],[S,M]=n.networkCaptureBodies?$x(a):[void 0],I=en(h,l,_),L=en(m,f,S);return{startTimestamp:o,endTimestamp:s,url:c,method:u,statusCode:d,request:y?ni(I,y):I,response:M?ni(L,M):L}}function $x(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return Bx(e.response,e.responseType)}catch(n){t.push(n)}return B&&U.warn("Failed to get xhr response body",...t),[void 0]}function Bx(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 B&&U.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return B&&U.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function Ux(e,t){try{const n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return $i(n)}catch{return}}function Hx(e){const t=C();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:i}=e.getOptions(),a={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:i};t&&t.on("beforeAddBreadcrumb",(c,u)=>Wx(a,c,u))}catch{}}function Wx(e,t,n){if(t.data)try{jx(t)&&qx(n)&&(Dx(t,n),Lx(t,n,e)),zx(t)&&Gx(n)&&(wx(t,n),Ix(t,n,e))}catch(r){B&&U.exception(r,"Error when enriching network breadcrumb")}}function jx(e){return e.category==="xhr"}function zx(e){return e.category==="fetch"}function qx(e){return e?.xhr}function Gx(e){return e?.response}function Vx(e){const t=C();Mm(I1(e)),xi(Sx(e)),lx(e),Hx(e);const n=_x(e);Mc(n),t&&(t.on("beforeSendEvent",cx(e)),t.on("afterSendEvent",sx(e)),t.on("createDsc",r=>{const o=e.getSessionId();o&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=o)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,o)=>{const s=e.getSessionId();o?.includeReplay&&e.isEnabled()&&s&&r.contexts?.feedback&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=s)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function Yx(e){try{return Promise.all(Fi(e,[Jx(pe.performance.memory)]))}catch{return[]}}function Jx(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,o=Date.now()/1e3;return{type:"memory",name:"memory",start:o,end:o,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function Kx(e,t,n){return rE(e,t,{...n,setTimeoutImpl:Mo})}const ts=$.navigator;function Xx(){return/iPhone|iPad|iPod/i.test(ts?.userAgent??"")||/Macintosh/i.test(ts?.userAgent??"")&&ts?.maxTouchPoints&&ts?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function Qx(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){B&&U.warn("Received replay event after session expired.");return}const o=r||!t;t=!0,e.clickDetector&&S1(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&o&&e.setInitialState(),!Ru(e,n,o))return!0;if(!o)return!1;const s=e.session;if(eM(e,o),e.recordingMode==="buffer"&&s&&e.eventBuffer&&!s.dirty){const i=e.eventBuffer.getEarliestTimestamp();i&&(B&&U.log(`Updating session start time to earliest event in buffer to ${new Date(i)}`),s.started=i,e.getOptions().stickySession&&Di(s))}return s?.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function Zx(e){const t=e.getOptions();return{type:Y.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 eM(e,t){!t||e.session?.segmentId!==0||Ru(e,Zx(e),!1)}function tM(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function nM(e,t,n,r){return st(xp(e,_o(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function rM({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)} `;if(typeof e=="string")n=`${r}${e}`;else{const s=new TextEncoder().encode(r);n=new Uint8Array(s.length+e.length),n.set(s),n.set(e,s.length)}return n}async function oM({client:e,scope:t,replayId:n,event:r}){const o=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,s={event_id:n,integrations:o};e.emit("preprocessEvent",r,s);const i=await Bp(e.getOptions(),r,s,t,e,be());if(!i)return null;e.emit("postprocessEvent",i,s),i.platform=i.platform||"javascript";const a=e.getSdkMetadata(),{name:c,version:u,settings:d}=a?.sdk||{};return i.sdk={...i.sdk,name:c||"sentry.javascript.unknown",version:u||"0.0.0",settings:d},i}async function sM({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:o,session:s}){const i=rM({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:c,traceIds:u,initialTimestamp:d}=r,l=C(),f=j(),p=l?.getTransport(),h=l?.getDsn();if(!l||!p||!h||!s.sampled)return Promise.resolve({});const m={type:LA,replay_start_timestamp:d/1e3,timestamp:o/1e3,error_ids:c,trace_ids:u,urls:a,replay_id:t,segment_id:n,replay_type:s.sampled},_=await oM({scope:f,client:l,replayId:t,event:m});if(!_)return l.recordDroppedEvent("event_processor","replay"),B&&U.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete _.sdkProcessingMetadata;const y=nM(_,i,h,l.getOptions().tunnel);let S;try{S=await p.send(y)}catch(I){const L=new Error(mu);try{L.cause=I}catch{}throw L}const M=Qp({},S);if(Xp(M,"replay"))throw new Cu(M);if(typeof S.statusCode=="number"&&(S.statusCode<200||S.statusCode>=300))throw new Wg(S.statusCode);return S}class Wg extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class Cu extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}class Gd extends Error{constructor(){super("Session is too long, not sending replay")}}async function jg(e,t={count:0,interval:HA}){const{recordingData:n,onError:r}=e;if(n.length)try{return await sM(e),!0}catch(o){if(o instanceof Wg||o instanceof Cu)throw o;if(xc("Replays",{_retryCount:t.count}),r&&r(o),t.count>=WA){const s=new Error(`${mu} - max retries exceeded`);try{s.cause=o}catch{}throw s}return t.interval*=++t.count,new Promise((s,i)=>{Mo(async()=>{try{await jg(e,t),s(!0)}catch(a){i(a)}},t.interval)})}}const zg="__THROTTLED",iM="__SKIPPED";function aM(e,t,n){const r=new Map,o=a=>{const c=a-n;r.forEach((u,d)=>{d[...r.values()].reduce((a,c)=>a+c,0);let i=!1;return(...a)=>{const c=Math.floor(Date.now()/1e3);if(o(c),s()>=t){const d=i;return i=!0,d?iM:zg}i=!1;const u=r.get(c)||0;return r.set(c,u+1),e(...a)}}class cM{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:DA,sessionIdleExpire:FA},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=Kx(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=aM((i,a)=>nx(this,i,a),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),s=r?{threshold:Math.min(jA,r),timeout:r,scrollTimeout:zA,ignoreSelector:o?o.join(","):""}:void 0;if(s&&(this.clickDetector=new m1(this,s)),B){const i=t._experiments;U.setConfig({captureExceptions:!!i.captureExceptions,traceInternals:!!i.traceInternals})}this._handleVisibilityChange=()=>{pe.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const i=_t({category:"ui.blur"});this._doChangeToBackgroundTasks(i)},this._handleWindowFocus=()=>{const i=_t({category:"ui.focus"});this._doChangeToForegroundTasks(i)},this._handleKeyboardEvent=i=>{A1(this,i)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){B&&U.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){const{errorSampleRate:n,sessionSampleRate:r}=this._options,o=n<=0&&r<=0;if(this._requiresManualStart=o,!o){if(this._initializeSessionForSampling(t),!this.session){B&&U.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",B&&U.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){B&&U.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){B&&U.log("Buffering is in progress, call `flush()` to save the replay");return}B&&U.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=ga({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){B&&U.log("Buffering is in progress, call `flush()` to save the replay");return}B&&U.infoTick("Starting replay in buffer mode");const t=ga({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=Pt({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:UA}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:Qx(this),...Xx(),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}={}){if(this._isEnabled){this._isEnabled=!1,this.recordingMode="buffer";try{B&&U.log(`Stopping Replay${n?` triggered by ${n}`:""}`),Fg(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,X1(this)}catch(r){this.handleException(r)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),B&&U.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),B&&U.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();B&&U.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){if(!(t&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&oc(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${pe.location.pathname}${pe.location.hash}${pe.location.search}`,n=`${pe.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===zg){const o=_t({category:"replay.throttled"});this.addUpdate(()=>!Ru(this,{type:c1,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||Te(),n=t&&ye(t),o=(n&&F(n).data||{})[ie];if(!(!n||!o||!["route","custom"].includes(o)))return F(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=Y1({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=ga({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 Og(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{pe.document.addEventListener("visibilitychange",this._handleVisibilityChange),pe.addEventListener("blur",this._handleWindowBlur),pe.addEventListener("focus",this._handleWindowFocus),pe.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(Vx(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=H1(this)}_removeListeners(){try{pe.document.removeEventListener("visibilitychange",this._handleVisibilityChange),pe.removeEventListener("blur",this._handleWindowBlur),pe.removeEventListener("focus",this._handleWindowFocus),pe.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){!this.session||Ng(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()){B&&U.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:Y.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=N1(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(Fi(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 Gd;const r=this._popEventContext(),o=this.session.segmentId++;this._maybeSaveSession();const s=await this.eventBuffer.finish();await jg({replayId:t,recordingData:s,segmentId:o,eventContext:r,session:this.session,timestamp:n,onError:i=>this.handleException(i)})}catch(n){this.handleException(n),this.stop({reason:"sendReplay"});const r=C();if(r){let o;n instanceof Cu?o="ratelimit_backoff":n instanceof Gd?o="invalid":o="send_error",r.recordDroppedEvent(o,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){B&&U.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,o=Date.now()-n;this._debouncedFlush.cancel();const s=othis._options.maxReplayDuration+5e3;if(s||i){B&&U.log(`Session duration (${Math.floor(o/1e3)}s) is too ${s?"short":"long"}, not sending replay.`),s&&this._debouncedFlush();return}const a=this.eventBuffer;a&&this.session.segmentId===0&&!a.hasCheckout&&B&&U.log("Flushing initial segment without checkout.");const c=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(u){this.handleException(u)}finally{this._flushLock=void 0,c&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&Di(this.session)}_onMutationHandler(t){const{ignoreMutations:n}=this._options._experiments;if(n?.length&&t.some(a=>{const c=tM(a.target),u=n.join(",");return c?.matches(u)}))return!1;const r=t.length,o=this._options.mutationLimit,s=this._options.mutationBreadcrumbLimit,i=o&&r>o;if(r>s||i){const a=_t({category:"replay.mutations",data:{count:r,limit:i}});this._createCustomBreadcrumb(a)}return i?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}function Wr(e,t){return[...e,...t].join(",")}function uM({mask:e,unmask:t,block:n,unblock:r,ignore:o}){const s=["base","iframe[srcdoc]:not([src])"],i=Wr(e,[".sentry-mask","[data-sentry-mask]"]),a=Wr(t,[]);return{maskTextSelector:i,unmaskTextSelector:a,blockSelector:Wr(n,[".sentry-block","[data-sentry-block]",...s]),unblockSelector:Wr(r,[]),ignoreSelector:Wr(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function lM({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:o,value:s}){return!r||o.unmaskTextSelector&&e.matches(o.unmaskTextSelector)?s:n.includes(t)||t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"")?s.replace(/[\S]/g,"*"):s}const Vd='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',dM=["content-length","content-type","accept"],fM=Symbol.for("sentry__originalRequestBody");let Yd=!1,Jd=!1;function pM(){if(typeof Request>"u"||Jd)return;const e=Request;try{const t=function(n,r){const o=new e(n,r);return r?.body!=null&&(o[fM]=r.body),o};t.prototype=e.prototype,$.Request=t,Jd=!0}catch{}}const qg=e=>new hM(e);class hM{constructor({flushMinDelay:t=$A,flushMaxDelay:n=BA,minReplayDuration:r=qA,maxReplayDuration:o=wd,stickySession:s=!0,useCompression:i=!0,workerUrl:a,_experiments:c={},maskAllText:u=!0,maskAllInputs:d=!0,blockAllMedia:l=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:_=[],networkDetailDenyUrls:y=[],networkCaptureBodies:S=!0,networkRequestHeaders:M=[],networkResponseHeaders:I=[],mask:L=[],maskAttributes:N=["title","placeholder","aria-label"],unmask:b=[],block:x=[],unblock:H=[],ignore:E=[],maskFn:P,beforeAddRecordingEvent:A,beforeErrorSampling:O,onError:D,attachRawBodyFromRequest:Z=!1}={}){this.name="Replay";const X=uM({mask:L,unmask:b,block:x,unblock:H,ignore:E});if(this._recordingOptions={maskAllInputs:d,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:P,maskInputFn:P,maskAttributeFn:(ne,v,q)=>lM({maskAttributes:N,maskAllText:u,privacyOptions:X,key:ne,value:v,el:q}),...X,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:ne=>{try{ne.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!c.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,GA),maxReplayDuration:Math.min(o,wd),stickySession:s,useCompression:i,workerUrl:a,blockAllMedia:l,maskAllInputs:d,maskAllText:u,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:m,networkDetailAllowUrls:_,networkDetailDenyUrls:y,networkCaptureBodies:S,networkRequestHeaders:Kd(M),networkResponseHeaders:Kd(I),beforeAddRecordingEvent:A,beforeErrorSampling:O,onError:D,attachRawBodyFromRequest:Z,_experiments:c},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${Vd}`:Vd,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&Ws())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Yd}set _isInitialized(t){Yd=t}afterAllSetup(t){!Ws()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&pM(),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){if(this._replay?.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=mM(this._initialOptions,t);this._replay=new cM({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}function mM(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},o=Cn(n.replaysSessionSampleRate),s=Cn(n.replaysOnErrorSampleRate);return o==null&&s==null&&Wt(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),s!=null&&(r.errorSampleRate=s),r}function Kd(e){return[...dM,...e.map(t=>t.toLowerCase())]}function gM(){return C()?.getIntegrationByName("Replay")}var _M=Object.defineProperty,yM=(e,t,n)=>t in e?_M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xd=(e,t,n)=>yM(e,typeof t!="symbol"?t+"":t,n);class SM{constructor(){Xd(this,"idNodeMap",new Map),Xd(this,"nodeMetaMap",new WeakMap)}getId(t){return t?this.getMeta(t)?.id??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.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 o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function bM(){return new SM}function EM(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function ac(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:ac(e.parentNode,t,n,r+1)}function Qd(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(EM(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}const Jn=`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 Zd={map:{},getId(){return console.error(Jn),-1},getNode(){return console.error(Jn),null},removeNodeFromMap(){console.error(Jn)},has(){return console.error(Jn),!1},reset(){console.error(Jn)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Zd=new Proxy(Zd,{get(e,t,n){return t==="map"&&console.error(Jn),Reflect.get(e,t,n)}}));function xu(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(i){Vg(()=>{n.set.call(this,i)},0),s&&s.set&&s.set.call(this,i)}}),()=>xu(e,t,s||{},!0)}function Mu(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}Date.now().toString();function TM(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Bi(e,t,n,r,o){if(!e)return!1;const s=TM(e);if(!s)return!1;const i=Qd(t,n),a=ac(s,i);let c=-1;return a<0?!1:(r&&(c=ac(s,Qd(null,r))),a>-1&&c<0?!0:a(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Sr||{});let vs;function vM(e){vs=e}const _a=e=>vs?(...n)=>{try{return e(...n)}catch(r){if(vs&&vs(r)===!0)return()=>{};throw r}}:e;var tr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",IM=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var ns=0;ns>2],o+=tr[(t[n]&3)<<4|t[n+1]>>4],o+=tr[(t[n+1]&15)<<2|t[n+2]>>6],o+=tr[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o};const tf=new Map;function kM(e,t){let n=tf.get(e);return n||(n=new Map,tf.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const Yg=(e,t,n)=>{if(!e||!(Kg(e,t)||typeof e=="object"))return;const r=e.constructor.name,o=kM(n,r);let s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function Is(e,t,n){if(e instanceof Array)return e.map(r=>Is(r,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const r=e.constructor.name,o=wM(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Is(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Is(e.data,t,n),e.width,e.height]};if(Kg(e,t)||typeof e=="object"){const r=e.constructor.name,o=Yg(e,t,n);return{rr_type:r,index:o}}}}return e}const Jg=(e,t,n)=>e.map(r=>Is(r,t,n)),Kg=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof t[o]=="function").find(o=>e instanceof t[o]);function RM(e,t,n,r,o){const s=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const c=Mu(t.CanvasRenderingContext2D.prototype,a,function(u){return function(...d){return Bi(this.canvas,n,r,o,!0)||Vg(()=>{const l=Jg(d,t,this);e(this.canvas,{type:Sr["2D"],property:a,args:l})},0),u.apply(this,d)}});s.push(c)}catch{const c=xu(t.CanvasRenderingContext2D.prototype,a,{set(u){e(this.canvas,{type:Sr["2D"],property:a,args:[u],setter:!0})}});s.push(c)}return()=>{s.forEach(a=>a())}}function AM(e){return e==="experimental-webgl"?"webgl":e}function nf(e,t,n,r,o){const s=[];try{const i=Mu(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...u){if(!Bi(this,t,n,r,!0)){const d=AM(c);if("__context"in this||(this.__context=d),o&&["webgl","webgl2"].includes(d))if(u[0]&&typeof u[0]=="object"){const l=u[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else u.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[c,...u])}});s.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(i=>i())}}function rf(e,t,n,r,o,s,i,a){const c=[],u=Object.getOwnPropertyNames(e);for(const d of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(d))try{if(typeof e[d]!="function")continue;const l=Mu(e,d,function(f){return function(...p){const h=f.apply(this,p);if(Yg(h,a,this),"tagName"in this.canvas&&!Bi(this.canvas,r,o,s,!0)){const m=Jg(p,a,this),_={type:t,property:d,args:m};n(this.canvas,_)}return h}});c.push(l)}catch{const l=xu(e,d,{set(f){n(this.canvas,{type:t,property:d,args:[f],setter:!0})}});c.push(l)}return c}function CM(e,t,n,r,o,s){const i=[];return i.push(...rf(t.WebGLRenderingContext.prototype,Sr.WebGL,e,n,r,o,s,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...rf(t.WebGL2RenderingContext.prototype,Sr.WebGL2,e,n,r,o,s,t)),()=>{i.forEach(a=>a())}}const xM='for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)t[e.charCodeAt(a)]=a;var n=function(t){var a,n=new Uint8Array(t),r=n.length,s="";for(a=0;a>2],s+=e[(3&n[a])<<4|n[a+1]>>4],s+=e[(15&n[a+1])<<2|n[a+2]>>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(e<=n&&t<=r)return[e,t];let s=e,i=t;return s>n&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w?.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};';function MM(){const e=new Blob([xM]);return URL.createObjectURL(e)}class NM{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.shadowDoms=new Set,this.windowsSet=new WeakSet,this.windows=[],this.restoreHandlers=[],this.frozen=!1,this.locked=!1,this.snapshotInProgressMap=new Map,this.worker=null,this.lastSnapshotTime=0,this.processMutation=(a,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(c)};const{enableManualSnapshot:n,sampling:r="all",win:o,recordCanvas:s,errorHandler:i}=t;t.sampling=r,this.mutationCb=t.mutationCb,this.mirror=t.mirror,this.options=t,i&&vM(i),(s&&typeof r=="number"||n)&&(this.worker=this.initFPSWorker()),this.addWindow(o),!n&&_a(()=>{s&&r==="all"&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),s&&typeof r=="number"&&this.initCanvasFPSObserver()})()}reset(){this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.windowsSet=new WeakSet,this.windows=[],this.shadowDoms=new Set,this.worker?.terminate(),this.worker=null,this.snapshotInProgressMap=new Map}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}addWindow(t){const{sampling:n="all",blockClass:r,blockSelector:o,unblockSelector:s,recordCanvas:i,enableManualSnapshot:a}=this.options;if(!this.windowsSet.has(t)){if(a){this.windowsSet.add(t),this.windows.push(new WeakRef(t));return}_a(()=>{if(i&&n==="all"&&this.initCanvasMutationObserver(t,r,o,s),i&&typeof n=="number"){const c=nf(t,r,o,s,!0);this.restoreHandlers.push(()=>{c()})}})(),this.windowsSet.add(t),this.windows.push(new WeakRef(t))}}addShadowRoot(t){this.shadowDoms.add(new WeakRef(t))}resetShadowRoots(){this.shadowDoms=new Set}snapshot(t,n){if(n?.skipRequestAnimationFrame){this.takeSnapshot(performance.now(),!0,t);return}gn(r=>this.takeSnapshot(r,!0,t))}initFPSWorker(){const t=new Worker(MM());return t.onmessage=n=>{const r=n.data,{id:o}=r;if(this.snapshotInProgressMap.set(o,!1),!("base64"in r))return;const{base64:s,type:i,width:a,height:c}=r;this.mutationCb({id:o,type:Sr["2D"],commands:[{property:"clearRect",args:[0,0,a,c]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:s}],type:i}]},0,0,a,c]}]})},t}initCanvasFPSObserver(){let t;if(!this.windows.length&&!this.shadowDoms.size)return;const n=r=>{this.takeSnapshot(r,!1),t=gn(n)};t=gn(n),this.restoreHandlers.push(()=>{t&&cancelAnimationFrame(t)})}initCanvasMutationObserver(t,n,r,o){const s=nf(t,n,r,o,!1),i=RM(this.processMutation.bind(this),t,n,r,o),a=CM(this.processMutation.bind(this),t,n,r,o,this.mirror);this.restoreHandlers.push(()=>{s(),i(),a()})}getCanvasElements(t,n,r){const o=[],s=i=>{i.querySelectorAll("canvas").forEach(a=>{Bi(a,t,n,r)||o.push(a)})};for(const i of this.windows){const a=i.deref();let c;try{c=a&&a.document}catch{}c&&s(c)}for(const i of this.shadowDoms){const a=i.deref();a&&s(a)}return o}takeSnapshot(t,n,r){const{sampling:o,blockClass:s,blockSelector:i,unblockSelector:a,dataURLOptions:c,maxCanvasSize:u}=this.options,l=1e3/(o==="all"?2:o||2);return this.lastSnapshotTime&&t-this.lastSnapshotTime{const m=this.mirror.getId(h);if(!(!this.mirror.hasNode(h)||!h.width||!h.height||this.snapshotInProgressMap.get(m))){if(this.snapshotInProgressMap.set(m,!0),!n&&["webgl","webgl2"].includes(h.__context)){const _=h.getContext(h.__context);_?.getContextAttributes()?.preserveDrawingBuffer===!1&&_.clear(_.COLOR_BUFFER_BIT)}createImageBitmap(h).then(_=>{this.worker?.postMessage({id:m,bitmap:_,width:h.width,height:h.height,dataURLOptions:c,maxCanvasSize:u},[_])}).catch(_=>{_a(()=>{throw this.snapshotInProgressMap.delete(m),_})()})}}),!0)}startPendingCanvasMutationFlusher(){gn(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=n=>{this.rafStamps.latestId=n,gn(t)};gn(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),gn(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;const o=r.map(i=>{const{type:a,...c}=i;return c}),{type:s}=r[0];this.mutationCb({id:n,type:s,commands:o}),this.pendingCanvasMutations.delete(t)}}try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}bM();var of;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(of||(of={}));const sf={low:{sampling:{canvas:1},dataURLOptions:{type:"image/webp",quality:.25}},medium:{sampling:{canvas:2},dataURLOptions:{type:"image/webp",quality:.4}},high:{sampling:{canvas:4},dataURLOptions:{type:"image/webp",quality:.5}}},OM="ReplayCanvas",rs=1280,PM=(e={})=>{const[t,n]=e.maxCanvasSize||[],r={quality:e.quality||"medium",enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,rs):rs,n?Math.min(n,rs):rs]};let o,s;const i=new Promise(a=>s=a);return{name:OM,getOptions(){const{quality:a,enableManualSnapshot:c,maxCanvasSize:u}=r;return{enableManualSnapshot:c,recordCanvas:!0,getCanvasManager:d=>{const l=new NM({...d,enableManualSnapshot:c,maxCanvasSize:u,errorHandler:f=>{try{typeof f=="object"&&(f.__rrweb__=!0)}catch{}}});return o=l,s(l),l},...sf[a]||sf.medium}},async snapshot(a,c){(o||await i).snapshot(a,c)}}},LM=PM;function DM(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function Xg(e){try{return new URL(e,R.location.origin).href}catch{return}}function FM(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Qg(e){try{return new Headers(e)}catch{return}}const af=new WeakMap,ya=new Map,Nu={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function Zg(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:o,shouldCreateSpanForRequest:s,enableHTTPTimings:i,tracePropagationTargets:a,onRequestSpanStart:c,onRequestSpanEnd:u}={...Nu,...t},d=typeof s=="function"?s:h=>!0,l=h=>BM(h,a),f={},p=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(h=>(h.type==="transaction"&&h.spans&&h.spans.forEach(m=>{if(m.op==="http.client"){const _=ya.get(m.span_id);_&&(m.timestamp=_/1e3,ya.delete(m.span_id))}}),h)),o&&HI(h=>{if(h.response){const m=af.get(h.response);m&&h.endTimestamp&&ya.set(m,h.endTimestamp)}}),Xc(h=>{const m=TT(h,d,l,f,{propagateTraceparent:p,onRequestSpanEnd:u});if(h.response&&h.fetchData.__span&&af.set(h.response,h.fetchData.__span),m){const _=Xg(h.fetchData.url),y=_?Rn(_).host:void 0;m.setAttributes({"http.url":_?Xt(_):void 0,"server.address":y}),i&&cf(m,e),c?.(m,{headers:h.headers})}})),r&&du(h=>{const m=UM(h,d,l,f,p,u);m&&(i&&cf(m,e),c?.(m,{headers:Qg(h.xhr.__sentry_xhr_v3__?.request_headers)}))})}const $M=300;function cf(e,t){const{url:n}=F(e).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(o);if(Ir(t)){const s=e.end.bind(e);e.end=i=>{const a=i??he();let c=!1;const u=()=>{c||(c=!0,setTimeout(o),s(a),clearTimeout(d))};r=u;const d=setTimeout(u,$M)}}const o=$n("resource",({entries:s})=>{s.forEach(i=>{FM(i)&&i.name.endsWith(n)&&(e.setAttributes(xm(i)),r())})})}function BM(e,t){const n=Bn();if(n){let r,o;try{r=new URL(e,n),o=new URL(n).origin}catch{return!1}const s=r.origin===o;return t?pt(r.toString(),t)||s&&pt(r.pathname,t):s}else{const r=!!e.match(/^\/(?!\/)/);return t?pt(e,t):r}}function UM(e,t,n,r,o,s){const i=e.xhr,a=i?.[At];if(!i||i.__sentry_own_request__||!a)return;const{url:c,method:u}=a,d=tt()&&t(c);if(e.endTimestamp){const y=i.__sentry_xhr_span_id__;if(!y)return;const S=r[y];S&&(d&&a.status_code!==void 0&&(Zr(S,a.status_code),S.end(),s?.(S,{headers:Qg(Om(i)),error:e.error})),delete r[y]);return}const l=Xg(c),f=Rn(l||c),p=Xt(ch(c)),h=!!Te(),m=d&&h?nt({name:`${u} ${p}`,attributes:{url:Xt(c),type:"xhr","http.method":u,"http.url":l?Xt(l):void 0,"server.address":f?.host,[z]:"auto.http.browser",[ce]:"http.client",...f?.search&&{"http.query":f?.search},...f?.hash&&{"http.fragment":f?.hash}}}):new Ke;i.__sentry_xhr_span_id__=m.spanContext().spanId,r[i.__sentry_xhr_span_id__]=m,n(c)&&HM(i,tt()&&h?m:void 0,o);const _=C();return _&&_.emit("beforeOutgoingRequestSpan",m,e),m}function HM(e,t,n){const{"sentry-trace":r,baggage:o,traceparent:s}=Uc({span:t,propagateTraceparent:n});r&&WM(e,r,o,s)}function WM(e,t,n,r){const o=e.__sentry_xhr_v3__?.request_headers;if(!(o?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!o?.traceparent&&e.setRequestHeader("traceparent",r),n){const s=o?.baggage;(!s||!DM(s))&&e.setRequestHeader("baggage",n)}}catch{}}function jM(){R.document?R.document.addEventListener("visibilitychange",()=>{const e=Te();if(!e)return;const t=ye(e);if(R.document.hidden&&t){const n="cancelled",{op:r,status:o}=F(t);T&&g.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||t.setStatus({code:ee,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):T&&g.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const zM=3600,e_="sentry_previous_trace",qM="sentry.previous_trace";function GM(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let o=r?JM():void 0;e.on("spanStart",i=>{if(ye(i)!==i)return;const a=j().getPropagationContext();o=VM(o,i,a),r&&YM(o)});let s=!0;n&&e.on("beforeSampling",i=>{if(!o)return;const a=j(),c=a.getPropagationContext();if(s&&c.parentSpanId){s=!1;return}a.setPropagationContext({...c,dsc:{...c.dsc,sample_rate:String(o.sampleRate),sampled:String(cc(o.spanContext))},sampleRand:o.sampleRand}),i.parentSampled=cc(o.spanContext),i.parentSampleRate=o.sampleRate,i.spanAttributes={...i.spanAttributes,[ep]:o.sampleRate}})}function VM(e,t,n){const r=F(t);function o(){try{return Number(n.dsc?.sample_rate)??Number(r.data?.[ui])}catch{return 0}}const s={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:o(),sampleRand:n.sampleRand};if(!e)return s;const i=e.spanContext;return i.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=zM&&(T&&g.log(`Adding previous_trace \`${JSON.stringify(i)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:i,attributes:{[Py]:"previous_trace"}}),t.setAttribute(qM,`${i.traceId}-${i.spanId}-${cc(i)?1:0}`)),s)}function YM(e){try{R.sessionStorage.setItem(e_,JSON.stringify(e))}catch(t){T&&g.warn("Could not store previous trace in sessionStorage",t)}}function JM(){try{const e=R.sessionStorage?.getItem(e_);return JSON.parse(e)}catch{return}}function cc(e){return e.traceFlags===1}const KM="BrowserTracing",XM=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function QM(){const e=R.navigator;return e?.userAgent?XM.test(e.userAgent):!1}const ZM={...cs,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...Nu},Pr=(e={})=>{"enableElementTiming"in e&&Wt(()=>{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=R.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:s,_experiments:{enableInteractions:i,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:c},beforeStartSpan:u,idleTimeout:d,finalTimeout:l,childSpanTimeout:f,markBackgroundSpan:p,traceFetch:h,traceXHR:m,trackFetchStreamPerformance:_,shouldCreateSpanForRequest:y,enableHTTPTimings:S,ignoreResourceSpans:M,ignorePerformanceApiSpans:I,instrumentPageLoad:L,instrumentNavigation:N,detectRedirects:b,linkPreviousTrace:x,consistentTraceSampling:H,enableReportPageLoaded:E,onRequestSpanStart:P,onRequestSpanEnd:A}={...ZM,...e},O=QM();let D,Z,X;function ne(v,q,k=!0){const V=q.op==="pageload",ae=q.name,re=u?u(q):q,ve=re.attributes||{};if(ae!==re.name&&(ve[ie]="custom",re.attributes=ve),!k){const Me=Un();nt({...re,startTime:Me}).end(Me);return}t.name=re.name,t.source=ve[ie];const $e=Dp(re,{idleTimeout:d,finalTimeout:l,childSpanTimeout:f,disableAutoFinish:V,beforeSpanEnd:Me=>{D?.(),mk(Me,{recordClsOnPageloadSpan:!a,recordLcpOnPageloadSpan:!c,ignoreResourceSpans:M,ignorePerformanceApiSpans:I}),df(v,void 0);const Ne=j(),it=Ne.getPropagationContext();Ne.setPropagationContext({...it,traceId:$e.spanContext().traceId,sampled:jt($e),dsc:rt(Me)}),V&&(X=void 0)},trimIdleSpanEndTimestamp:!E});V&&E&&(X=$e),df(v,$e);function qt(){n&&["interactive","complete"].includes(n.readyState)&&v.emit("idleSpanEnableAutoFinish",$e)}V&&!E&&n&&(n.addEventListener("readystatechange",()=>{qt()}),qt())}return{name:KM,setup(v){if(O){T&&g.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(wp(),D=ck({recordClsStandaloneSpans:a||!1,recordLcpStandaloneSpans:c||!1,client:v}),r&&Wk(),s&&$.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?lk():o&&uk(),i&&dk(),b&&n){const k=()=>{Z=he()};addEventListener("click",k,{capture:!0}),addEventListener("keydown",k,{capture:!0,passive:!0})}function q(){const k=co(v);k&&!F(k).timestamp&&(T&&g.log(`[Tracing] Finishing current active span with op: ${F(k).op}`),k.setAttribute(Qr,"cancelled"),k.end())}v.on("startNavigationSpan",(k,V)=>{if(C()!==v)return;if(V?.isRedirect){T&&g.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),ne(v,{op:"navigation.redirect",...k},!1);return}Z=void 0,q(),be().setPropagationContext({traceId:Et(),sampleRand:Math.random(),propagationSpanId:tt()?void 0:Mt()});const ae=j();ae.setPropagationContext({traceId:Et(),sampleRand:Math.random(),propagationSpanId:tt()?void 0:Mt()}),ae.setSDKProcessingMetadata({normalizedRequest:void 0}),ne(v,{op:"navigation",...k,parentSpan:null,forceTransaction:!0})}),v.on("startPageLoadSpan",(k,V={})=>{if(C()!==v)return;q();const ae=V.sentryTrace||uf("sentry-trace")||lf("sentry-trace"),re=V.baggage||uf("baggage")||lf("baggage"),ve=dp(ae,re),$e=j();$e.setPropagationContext(ve),tt()||($e.getPropagationContext().propagationSpanId=Mt()),$e.setSDKProcessingMetadata({normalizedRequest:ru()}),ne(v,{op:"pageload",...k})}),v.on("endPageloadSpan",()=>{E&&X&&(X.setAttribute(Qr,"reportPageLoaded"),X.end())})},afterAllSetup(v){if(O)return;let q=Bn();if(x!=="off"&&GM(v,{linkPreviousTrace:x,consistentTraceSampling:H}),R.location){if(L){const k=Fe();Lr(v,{name:R.location.pathname,startTime:k?k/1e3:void 0,attributes:{[ie]:"url",[z]:"auto.pageload.browser"}})}N&&xi(({to:k,from:V})=>{if(V===void 0&&q?.indexOf(k)!==-1){q=void 0;return}q=void 0;const ae=Bc(k),re=co(v),ve=re&&b&&tN(re,Z);Dr(v,{name:ae?.pathname||R.location.pathname,attributes:{[ie]:"url",[z]:"auto.navigation.browser"}},{url:k,isRedirect:ve})})}p&&jM(),i&&eN(v,d,l,f,t),r&&qk(),Zg(v,{traceFetch:h,traceXHR:m,trackFetchStreamPerformance:_,tracePropagationTargets:v.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:y,enableHTTPTimings:S,onRequestSpanStart:P,onRequestSpanEnd:A})}}};function Lr(e,t,n){e.emit("startPageLoadSpan",t,n),j().setTransactionName(t.name);const r=co(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function Dr(e,t,n){const{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});const s=j();return s.setTransactionName(t.name),r&&!o&&s.setSDKProcessingMetadata({normalizedRequest:{...ru(),url:r}}),co(e)}function uf(e){return R.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function lf(e){return R.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===e)?.description}function eN(e,t,n,r,o){const s=R.document;let i;const a=()=>{const c="ui.action.click",u=co(e);if(u){const d=F(u).op;if(["navigation","pageload"].includes(d)){T&&g.warn(`[Tracing] Did not create ${c} span because a pageload or navigation span is in progress.`);return}}if(i&&(i.setAttribute(Qr,"interactionInterrupted"),i.end(),i=void 0),!o.name){T&&g.warn(`[Tracing] Did not create ${c} transaction because _latestRouteName is missing.`);return}i=Dp({name:o.name,op:c,attributes:{[ie]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};s&&addEventListener("click",a,{capture:!0})}const t_="_sentry_idleSpan";function co(e){return e[t_]}function df(e,t){Se(e,t_,t)}const ff=1.5;function tN(e,t){const n=F(e),r=Un(),o=n.start_timestamp;return!(r-o>ff||t&&r-t<=ff)}function nN(e=C()){e?.emit("endPageloadSpan")}function rN(e){const t=Te();if(t===e)return;const n=j();e.end=new Proxy(e.end,{apply(r,o,s){return Tt(n,t),Reflect.apply(r,o,s)}}),Tt(n,e)}const oN=()=>({name:"SpanStreaming",beforeSetup(e){const t=e.getOptions();t.traceLifecycle||(T&&g.log('[SpanStreaming] set `traceLifecycle` to "stream"'),t.traceLifecycle="stream")},setup(e){const t="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",r=e.getOptions();if(!Ir(e)){r.traceLifecycle="static",T&&g.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}const o=r.beforeSendSpan;if(o&&!fi(o)){r.traceLifecycle="static",T&&g.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}const s=new FI(e);e.on("afterSpanEnd",i=>{jt(i)&&s.add(HS(i,e))}),e.on("afterSegmentSpanEnd",i=>{const a=i.spanContext().traceId;setTimeout(()=>{s.flush(a)},500)})}});function br(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function sN(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=br(n);return o=>r.then(s=>o(s.transaction(t,"readwrite").objectStore(t)))}function Ou(e){return br(e.getAllKeys())}function iN(e,t,n){return e(r=>Ou(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.max(...o,0)+1),br(r.transaction)}))}function aN(e,t,n){return e(r=>Ou(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.min(...o,0)-1),br(r.transaction)}))}function cN(e){return e(t=>Ou(t).then(n=>{const r=n[0];if(r!=null)return br(t.get(r)).then(o=>(t.delete(r),br(t.transaction).then(()=>o)))}))}function uN(e){let t;function n(){return t==null&&(t=sN(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async r=>{try{const o=Os(r);await iN(n(),o,e.maxQueueSize||30)}catch{}},unshift:async r=>{try{const o=Os(r);await aN(n(),o,e.maxQueueSize||30)}catch{}},shift:async()=>{try{const r=await cN(n());if(r)return pS(r)}catch{}}}}function lN(e){return t=>{const n=e({...t,createStore:uN});return R.addEventListener("online",async r=>{await n.flush()}),n}}function dN(e=pu){return lN(qb(e))}const pf=1e6,fN="window"in $&&$.window===$&&typeof importScripts>"u",tn=String(0),oi=fN?"main":"worker",si=R.navigator;let n_="",r_="",o_="",uc=si?.userAgent||"",s_="";const pN=si?.language||si?.languages?.[0]||"";function hN(e){return typeof e=="object"&&e!==null&&"getHighEntropyValues"in e}const hf=si?.userAgentData;hN(hf)&&hf.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{if(n_=e.platform||"",o_=e.architecture||"",s_=e.model||"",r_=e.platformVersion||"",e.fullVersionList?.length){const t=e.fullVersionList[e.fullVersionList.length-1];uc=`${t.brand} ${t.version}`}}).catch(e=>{});function mN(e){return!("thread_metadata"in e)}function gN(e){return mN(e)?TN(e):e}function _N(e){const t=e.contexts?.trace?.trace_id;return typeof t=="string"&&t.length!==32&&T&&g.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t!="string"?"":t}function yN(e,t,n,r){if(r.type!=="transaction")throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(n==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);const o=_N(r),s=gN(n),i=t||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:he()*1e3),a=typeof r.timestamp=="number"?r.timestamp*1e3:he()*1e3;return{event_id:e,timestamp:new Date(i).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||di,runtime:{name:"javascript",version:R.navigator.userAgent},os:{name:n_,version:r_,build_number:uc},device:{locale:pN,model:s_,manufacturer:uc,architecture:o_,is_emulator:!1},debug_meta:{images:a_(n.resources)},profile:s,transactions:[{name:r.transaction||"",id:r.event_id||we(),trace_id:o,active_thread_id:tn,relative_start_ns:"0",relative_end_ns:((a-i)*1e6).toFixed(0)}]}}function SN(e,t,n){if(e==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);const r=EN(e),o=t.getOptions(),s=t.getSdkMetadata?.()?.sdk;return{chunk_id:we(),client_sdk:{name:s?.name??"sentry.javascript.browser",version:s?.version??"0.0.0"},profiler_id:n||we(),platform:"javascript",version:"2",release:o.release??"",environment:o.environment??"production",debug_meta:{images:a_(e.resources)},profile:r}}function bN(e){try{if(!e||typeof e!="object")return{reason:"chunk is not an object"};const t=r=>typeof r=="string"&&/^[a-f0-9]{32}$/.test(r);if(!t(e.profiler_id))return{reason:"missing or invalid profiler_id"};if(!t(e.chunk_id))return{reason:"missing or invalid chunk_id"};if(!e.client_sdk)return{reason:"missing client_sdk metadata"};const n=e.profile;return n?!Array.isArray(n.frames)||!n.frames.length?{reason:"profile has no frames"}:!Array.isArray(n.stacks)||!n.stacks.length?{reason:"profile has no stacks"}:!Array.isArray(n.samples)||!n.samples.length?{reason:"profile has no samples"}:{valid:!0}:{reason:"missing profile data"}}catch(t){return{reason:`unknown validation error: ${t}`}}}function EN(e){const t=[];for(let a=0;a{if(u.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[d]={elapsed_since_start_ns:((u.timestamp+c-s)*pf).toFixed(0),stack_id:t,thread_id:tn};return}let l=e.stacks[u.stackId];const f=[];for(;l;){f.push(l.frameId);const h=e.frames[l.frameId];h&&r.frames[l.frameId]===void 0&&(r.frames[l.frameId]={function:h.name,abs_path:typeof h.resourceId=="number"?e.resources[h.resourceId]:void 0,lineno:h.line,colno:h.column}),l=l.parentId===void 0?void 0:e.stacks[l.parentId]}const p={elapsed_since_start_ns:((u.timestamp+c-s)*pf).toFixed(0),stack_id:n,thread_id:tn};r.stacks[n]=f,r.samples[d]=p,n++}),r}function vN(e,t){if(!t.length)return e;for(const n of t)e[1].push([{type:"profile"},n]);return e}function IN(e){const t=[];return xn(e,(n,r)=>{if(r==="transaction")for(let o=1;o1?(T&&g.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function wN(e){return e.samples.length<2?(T&&g.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):e.frames.length?!0:(T&&g.log("[Profiling] Discarding profile because it contains no frames"),!1)}let Pu=!1;const u_=3e4;function kN(e){return typeof e=="function"}function l_(){const e=R.Profiler;if(!kN(e)){T&&g.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}const t=10,n=Math.floor(u_/t);try{return new e({sampleInterval:t,maxBufferSize:n})}catch{T&&(g.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),g.log("[Profiling] Disabling profiling for current user session.")),Pu=!0}}function mf(e){if(Pu)return T&&g.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return T&&g.log("[Profiling] Discarding profile because root span was not sampled."),!1;const n=C()?.getOptions();if(!n)return T&&g.log("[Profiling] Profiling disabled, no options found."),!1;const r=n.profilesSampleRate;return c_(r)?r?(r===!0?!0:Math.random()30){const n=vn.keys().next().value;n!==void 0&&vn.delete(n)}}function NN(e){return!e?.contexts?.profile||!e.contexts||(e.contexts.trace?.trace_id&&(e.contexts.trace={...e.contexts.trace,data:{...e.contexts.trace.data??{},"thread.id":tn,"thread.name":oi}}),e.spans?.forEach(t=>{t.data={...t.data||{},"thread.id":tn,"thread.name":oi}})),e}function gf(e){let t;i_(e)&&(t=he()*1e3);const n=l_();if(!n)return;T&&g.log(`[Profiling] started profiling span: ${F(e).description}`);const r=we();let o=null;j().setContext("profile",{profile_id:r,start_timestamp:t});async function s(){if(e&&n){if(o){T&&g.log("[Profiling] profile for:",F(e).description,"already exists, returning early");return}return n.stop().then(u=>{if(i&&(R.clearTimeout(i),i=void 0),T&&g.log(`[Profiling] stopped profiling of span: ${F(e).description}`),!u){T&&g.log(`[Profiling] profiler returned null profile for: ${F(e).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started");return}o=u,MN(r,u)}).catch(u=>{T&&g.log("[Profiling] error while stopping profiler:",u)})}}let i=R.setTimeout(()=>{T&&g.log("[Profiling] max profile duration elapsed, stopping profiling for:",F(e).description),s()},u_);const a=e.end.bind(e);function c(){return e?(s().then(()=>{a()},()=>{a()}),e):a()}e.end=c}const ON=6e4,PN=3e5;class LN{constructor(){this._client=void 0,this._profiler=void 0,this._chunkTimer=void 0,this._profilerId=void 0,this._isRunning=!1,this._sessionSampled=!1,this._lifecycleMode=void 0,this._activeRootSpanIds=new Set,this._rootSpanTimeouts=new Map}initialize(t){const n=t.getOptions().profileLifecycle,r=RN(t.getOptions());T&&g.log(`[Profiling] Initializing profiler (lifecycle='${n}').`),r||T&&g.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),this._profilerId=we(),this._client=t,this._sessionSampled=r,this._lifecycleMode=n,n==="trace"&&this._setupTraceLifecycleListeners(t)}start(){if(this._lifecycleMode==="trace"){T&&g.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){T&&g.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){T&&g.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode==="trace"){T&&g.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){T&&g.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");return}this._endProfiling()}notifyRootSpanActive(t){if(this._lifecycleMode!=="trace"||!this._sessionSampled)return;const n=t.spanContext().spanId;if(!n||this._activeRootSpanIds.has(n))return;this._registerTraceRootSpan(n);const r=this._activeRootSpanIds.size;r===1&&(T&&g.log("[Profiling] Detected already active root span during setup. Active root spans now:",r),this._beginProfiling())}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,T&&g.log("[Profiling] Started profiling with profiler ID:",this._profilerId),wn().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){T&&g.log("[Profiling] Failed to start JS Profiler; stopping."),this._resetProfilerInfo();return}this._startPeriodicChunking()}}_endProfiling(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&(clearTimeout(this._chunkTimer),this._chunkTimer=void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(t=>{T&&g.error("[Profiling] Failed to collect current profile chunk on `stop()`:",t)}),this._lifecycleMode==="manual"&&wn().setContext("profile",{}))}_setupTraceLifecycleListeners(t){t.on("spanStart",n=>{if(!this._sessionSampled){T&&g.log("[Profiling] Span not profiled because of negative sampling decision for user session.");return}if(n!==ye(n))return;if(!n.isRecording()){T&&g.log("[Profiling] Discarding profile because root span was not sampled.");return}const r=n.spanContext().spanId;if(!r||this._activeRootSpanIds.has(r))return;this._registerTraceRootSpan(r);const o=this._activeRootSpanIds.size;o===1&&(T&&g.log(`[Profiling] Root span ${r} started. Profiling active while there are active root spans (count=${o}).`),this._beginProfiling())}),t.on("spanEnd",n=>{if(!this._sessionSampled)return;const r=n.spanContext().spanId;if(!r||!this._activeRootSpanIds.has(r))return;this._activeRootSpanIds.delete(r);const o=this._activeRootSpanIds.size;T&&g.log(`[Profiling] Root span with ID ${r} ended. Will continue profiling for as long as there are active root spans (currently: ${o}).`),o===0&&(this._collectCurrentChunk().catch(s=>{T&&g.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",s)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,wn().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(t=>clearTimeout(t)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(t){this._activeRootSpanIds.add(t);const n=setTimeout(()=>this._onRootSpanTimeout(t),PN);this._rootSpanTimeouts.set(t,n)}_startProfilerInstance(){if(this._profiler?.stopped===!1)return;const t=l_();if(!t){T&&g.log("[Profiling] Failed to start JS Profiler.");return}this._profiler=t}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(t=>{T&&g.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",t)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},ON))}_onRootSpanTimeout(t){this._rootSpanTimeouts.has(t)&&(this._rootSpanTimeouts.delete(t),this._activeRootSpanIds.has(t)&&(T&&g.log(`[Profiling] Reached 5-minute timeout for root span ${t}. You likely started a manual root span that never called \`.end()\`.`),this._activeRootSpanIds.delete(t),this._activeRootSpanIds.size===0&&this._endProfiling()))}async _collectCurrentChunk(){const t=this._profiler;if(this._profiler=void 0,!!t)try{const n=await t.stop(),r=SN(n,this._client,this._profilerId),o=bN(r);if("reason"in o){T&&g.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",o.reason);return}this._sendProfileChunk(r),T&&g.log("[Profiling] Collected browser profile chunk.")}catch(n){T&&g.log("[Profiling] Error while stopping JS Profiler for chunk:",n)}}_sendProfileChunk(t){const n=this._client,r=_o(n.getSdkMetadata?.()),o=n.getDsn(),s=n.getOptions().tunnel,i=st({event_id:we(),sent_at:new Date().toISOString(),...r&&{sdk:r},...!!s&&o&&{dsn:It(o)}},[[{type:"profile_chunk",platform:"javascript"},t]]);n.sendEnvelope(i).then(null,a=>{T&&g.error("Error while sending profile chunk envelope:",a)})}}const DN="BrowserProfiling",FN=()=>({name:DN,setup(e){const t=e.getOptions(),n=new LN;if(!os(t)&&!t.profileLifecycle&&(t.profileLifecycle="manual"),os(t)&&!t.profilesSampleRate){T&&g.log("[Profiling] Profiling disabled, no profiling options found.");return}const r=Te(),o=r&&ye(r);if(os(t)&&t.profileSessionSampleRate!==void 0&&T&&g.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),os(t))o&&i_(o)&&mf(o)&&gf(o),e.on("spanStart",s=>{s===ye(s)&&mf(s)&&gf(s)}),e.on("beforeEnvelope",s=>{if(!CN())return;const i=IN(s);if(!i.length)return;const a=[];for(const c of i){const u=c?.contexts,d=u?.profile?.profile_id,l=u?.profile?.start_timestamp;if(typeof d!="string"){T&&g.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!d){T&&g.log("[Profiling] cannot find profile for a span without a profile context");continue}u?.profile&&delete u.profile;const f=xN(d);if(!f){T&&g.log(`[Profiling] Could not retrieve profile for span: ${d}`);continue}const p=AN(d,l,f,c);p&&a.push(p)}vN(s,a)});else{const s=t.profileLifecycle;if(e.on("startUIProfiler",()=>n.start()),e.on("stopUIProfiler",()=>n.stop()),s==="manual")n.initialize(e);else if(s==="trace"){if(!tt(t)){T&&g.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}n.initialize(e),o&&n.notifyRootSpanActive(o),R.setTimeout(()=>{const i=Te(),a=i&&ye(i);a&&n.notifyRootSpanActive(a)},0)}}},processEvent(e){return NN(e)}}),$N=FN,BN=()=>({name:"LaunchDarkly",processEvent(e,t,n){return Rr(e)}});function UN(){return{name:"sentry-flag-auditor",type:"flag-used",synchronous:!0,method:(e,t,n)=>{Nn(e,t.value),On(e,t.value)}}}const HN=()=>({name:"OpenFeature",processEvent(e,t,n){return Rr(e)}});class WN{after(t,n){Nn(n.flagKey,n.value),On(n.flagKey,n.value)}error(t,n,r){Nn(t.flagKey,t.defaultValue),On(t.flagKey,t.defaultValue)}}const jN=({featureFlagClientClass:e})=>({name:"Unleash",setupOnce(){const t=e.prototype;Le(t,"isEnabled",zN)},processEvent(t,n,r){return Rr(t)}});function zN(e){return function(...t){const n=t[0],r=e.apply(this,t);return typeof n=="string"&&typeof r=="boolean"?(Nn(n,r),On(n,r)):T&&g.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}const qN=({growthbookClass:e})=>yT({growthbookClass:e}),GN=({featureFlagClient:e})=>({name:"Statsig",setup(t){e.on("gate_evaluation",n=>{Nn(n.gate.name,n.gate.value),On(n.gate.name,n.gate.value)})},processEvent(t,n,r){return Rr(t)}});async function VN(){const e=C();if(!e)return"no-client-active";if(!e.getDsn())return"no-dsn-configured";const r=e.getOptions().tunnel||"https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7";try{await Np(()=>fetch(r,{body:"{}",method:"POST",mode:"cors",credentials:"omit"}))}catch{return"sentry-unreachable"}}const YN="WebWorker",JN=({worker:e})=>({name:YN,setupOnce:()=>{(Array.isArray(e)?e:[e]).forEach(t=>_f(t))},addWorker:t=>_f(t)});function _f(e){e.addEventListener("message",t=>{if(QN(t.data)){if(t.stopImmediatePropagation(),t.data._sentryDebugIds&&(T&&g.log("Sentry debugId web worker message received",t.data),R._sentryDebugIds={...t.data._sentryDebugIds,...R._sentryDebugIds}),t.data._sentryModuleMetadata&&(T&&g.log("Sentry module metadata web worker message received",t.data),R._sentryModuleMetadata={...t.data._sentryModuleMetadata,...R._sentryModuleMetadata}),t.data._sentryWasmImages){T&&g.log("Sentry WASM images web worker message received",t.data);const n=R._sentryWasmImages||[],r=t.data._sentryWasmImages.filter(o=>qe(o)&&typeof o.code_file=="string"&&!n.some(s=>s.code_file===o.code_file));R._sentryWasmImages=[...n,...r]}t.data._sentryWorkerError&&(T&&g.log("Sentry worker rejection message received",t.data._sentryWorkerError),KN(t.data._sentryWorkerError))}})}function KN(e){const t=C();if(!t)return;const n=t.getOptions().stackParser,r=t.getOptions().attachStacktrace,o=e.reason,s=Dt(o)?qm(o):Ri(n,o,void 0,r,!0);s.level="error",e.filename&&(s.contexts={...s.contexts,worker:{filename:e.filename}}),kr(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.web_worker.onunhandledrejection"}}),T&&g.log("Captured worker unhandled rejection",o)}function XN({self:e}){e.postMessage({_sentryMessage:!0,_sentryDebugIds:e._sentryDebugIds??void 0,_sentryModuleMetadata:e._sentryModuleMetadata??void 0}),e.addEventListener("unhandledrejection",t=>{const r={reason:zm(t),filename:e.location?.href};e.postMessage({_sentryMessage:!0,_sentryWorkerError:r}),T&&g.log("[Sentry Worker] Forwarding unhandled rejection to parent",r)}),T&&g.log("[Sentry Worker] Registered worker with unhandled rejection handling")}function QN(e){if(!qe(e)||e._sentryMessage!==!0)return!1;const t="_sentryDebugIds"in e,n="_sentryModuleMetadata"in e,r="_sentryWorkerError"in e,o="_sentryWasmImages"in e;return!(!t&&!n&&!r&&!o||t&&!(qe(e._sentryDebugIds)||e._sentryDebugIds===void 0)||n&&!(qe(e._sentryModuleMetadata)||e._sentryModuleMetadata===void 0)||r&&!qe(e._sentryWorkerError)||o&&(!Array.isArray(e._sentryWasmImages)||!e._sentryWasmImages.every(s=>qe(s)&&typeof s.code_file=="string")))}function d_(e){const t={...e};return dh(t,"react"),xc("react",{version:xe.version}),rA(t)}function ZN(e){const t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}function eO(e,t){const n=new WeakSet;function r(o,s){if(!n.has(o)){if(o.cause)return n.add(o),r(o.cause,s);o.cause=s}}r(e,t)}function Lu(e,{componentStack:t},n){if(ZN(xe.version)&&yt(e)&&t){const r=new Error(e.message);r.name=`React ErrorBoundary ${e.name}`,r.stack=t,eO(e,r)}return je(r=>(r.setContext("react",{componentStack:t}),me(e,n)))}function tO(e){return(t,n)=>{const r=!!e,o=Lu(t,n,{mechanism:{handled:r,type:"auto.function.react.error_handler"}});r&&e(t,n,o)}}const f_="ui.react.render",nO="ui.react.update",p_="ui.react.mount",rO={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},oO={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},sO={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},h_={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},iO=Symbol.for("react.forward_ref"),m_=Symbol.for("react.memo");function aO(e){return typeof e=="object"&&e!==null&&e.$$typeof===m_}const Du={};Du[iO]=sO;Du[m_]=h_;function yf(e){if(aO(e))return h_;const t=e.$$typeof;return t&&Du[t]||rO}const cO=Object.defineProperty.bind(Object),uO=Object.getOwnPropertyNames.bind(Object),Sf=Object.getOwnPropertySymbols?.bind(Object),bf=Object.getOwnPropertyDescriptor.bind(Object),lO=Object.getPrototypeOf.bind(Object),Ef=Object.prototype;function Po(e,t,n){if(typeof t!="string"){if(Ef){const i=lO(t);i&&i!==Ef&&Po(e,i)}let r=uO(t);Sf&&(r=r.concat(Sf(t)));const o=yf(e),s=yf(t);for(const i of r)if(!oO[i]&&!s?.[i]&&!o?.[i]&&!bf(e,i)){const a=bf(t,i);if(a)try{cO(e,i,a)}catch{}}}return e}const dO="unknown";class Fu extends xe.Component{constructor(t){super(t);const{name:n,disabled:r=!1}=this.props;r||(this._mountSpan=nt({name:`<${n}>`,onlyIfParent:!0,op:p_,attributes:{[z]:"auto.ui.react.profiler","ui.component_name":n}}))}componentDidMount(){this._mountSpan&&this._mountSpan.end()}shouldComponentUpdate({updateProps:t,includeUpdates:n=!0}){if(n&&this._mountSpan&&t!==this.props.updateProps){const r=Object.keys(t).filter(o=>t[o]!==this.props.updateProps[o]);if(r.length>0){const o=he();this._updateSpan=Mn(this._mountSpan,()=>nt({name:`<${this.props.name}>`,onlyIfParent:!0,op:nO,startTime:o,attributes:{[z]:"auto.ui.react.profiler","ui.component_name":this.props.name,"ui.react.changed_props":r}}))}}return!0}componentDidUpdate(){this._updateSpan&&(this._updateSpan.end(),this._updateSpan=void 0)}componentWillUnmount(){const t=he(),{name:n,includeRender:r=!0}=this.props;if(this._mountSpan&&r){const o=F(this._mountSpan).timestamp;Mn(this._mountSpan,()=>{const s=nt({onlyIfParent:!0,name:`<${n}>`,op:f_,startTime:o,attributes:{[z]:"auto.ui.react.profiler","ui.component_name":n}});s&&s.end(t)})}}render(){return this.props.children}}Object.assign(Fu,{defaultProps:{disabled:!1,includeRender:!0,includeUpdates:!0}});function fO(e,t){const n=t?.name||e.displayName||e.name||dO,r=o=>xe.createElement(Fu,{...t,name:n,updateProps:o},xe.createElement(e,{...o}));return r.displayName=`profiler(${n})`,Po(r,e),r}function pO(e,t={disabled:!1,hasRenderSpan:!0}){const[n]=xe.useState(()=>{if(!t?.disabled)return nt({name:`<${e}>`,onlyIfParent:!0,op:p_,attributes:{[z]:"auto.ui.react.profiler","ui.component_name":e}})});xe.useEffect(()=>(n&&n.end(),()=>{if(n&&t.hasRenderSpan){const r=F(n).timestamp,o=he(),s=nt({name:`<${e}>`,onlyIfParent:!0,op:f_,startTime:r,attributes:{[z]:"auto.ui.react.profiler","ui.component_name":e}});s&&s.end(o)}}),[])}const Re=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,hO="unknown",Sa={componentStack:null,error:null,eventId:null};class g_ extends xe.Component{constructor(t){super(t),this.state=Sa,this._openFallbackReportDialog=!0;const n=C();n&&t.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=n.on("afterSendEvent",r=>{!r.type&&this._lastEventId&&r.event_id===this._lastEventId&&Xa({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,n){const{componentStack:r}=n,{beforeCapture:o,onError:s,showDialog:i,dialogOptions:a}=this.props;je(c=>{o&&o(c,t,r);const u=this.props.handled!=null?this.props.handled:!!this.props.fallback,d=Lu(t,n,{mechanism:{handled:u,type:"auto.function.react.error_boundary"}});s&&s(t,r,d),i&&(this._lastEventId=d,this._openFallbackReportDialog&&Xa({...a,eventId:d})),this.setState({error:t,componentStack:r,eventId:d})})}componentDidMount(){const{onMount:t}=this.props;t&&t()}componentWillUnmount(){const{error:t,componentStack:n,eventId:r}=this.state,{onUnmount:o}=this.props;o&&(this.state===Sa?o(null,null,null):o(t,n,r)),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}resetErrorBoundary(){const{onReset:t}=this.props,{error:n,componentStack:r,eventId:o}=this.state;t&&t(n,r,o),this.setState(Sa)}render(){const{fallback:t,children:n}=this.props,r=this.state;if(r.componentStack===null)return typeof n=="function"?n():n;const o=typeof t=="function"?xe.createElement(t,{error:r.error,componentStack:r.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:r.eventId}):t;return xe.isValidElement(o)?o:(t&&Re&&g.warn("fallback did not produce a valid ReactElement"),null)}}function mO(e,t){const n=e.displayName||e.name||hO,r=xe.memo(o=>xe.createElement(g_,{...t},xe.createElement(e,{...o})));return r.displayName=`errorBoundary(${n})`,Po(r,e),r}const gO="redux.action",_O="info",yO={attachReduxState:!0,actionTransformer:e=>e,stateTransformer:e=>e||null};function SO(e){const t={...yO,...e};return n=>(r,o)=>{t.attachReduxState&&wn().addEventProcessor((a,c)=>{try{a.type===void 0&&a.contexts.state.state.type==="redux"&&(c.attachments=[...c.attachments||[],{filename:"redux_state.json",data:JSON.stringify(a.contexts.state.state.value)}])}catch{}return a});function s(a){return(c,u)=>{const d=a(c,u),l=j(),f=t.actionTransformer(u);typeof f<"u"&&f!==null&&mt({category:gO,data:f,type:_O});const p=t.stateTransformer(d);if(typeof p<"u"&&p!==null){const y=C()?.getOptions()?.normalizeDepth||3,S={state:{type:"redux",value:p}};Se(S,"__sentry_override_normalization_depth__",3+y),l.setContext("state",S)}else l.setContext("state",null);const{configureScopeWithState:h}=t;return typeof h=="function"&&h(l,d),d}}const i=n(s(r),o);return i.replaceReducer=new Proxy(i.replaceReducer,{apply:function(a,c,u){a.apply(c,[s(u[0])])}}),i}}function bO(e){const t=Pr({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,match:o,instrumentPageLoad:s=!0,instrumentNavigation:i=!0}=e;return{...t,afterAllSetup(a){t.afterAllSetup(a),s&&R.location&&Tf(r,R.location,o,(c,u="url")=>{Lr(a,{name:c,attributes:{[ce]:"pageload",[z]:"auto.pageload.react.reactrouter_v3",[ie]:u}})}),i&&n.listen&&n.listen(c=>{(c.action==="PUSH"||c.action==="POP")&&Tf(r,c,o,(u,d="url")=>{Dr(a,{name:u,attributes:{[ce]:"navigation",[z]:"auto.navigation.react.reactrouter_v3",[ie]:d}})})})}}}function Tf(e,t,n,r){let o=t.pathname;n({location:t,routes:e},(s,i,a)=>{if(s||!a)return r(o);const c=EO(a.routes||[]);return c.length===0||c==="/*"?r(o):(o=c,r(o,"route"))})}function EO(e){if(!Array.isArray(e)||e.length===0)return"";const t=e.filter(r=>!!r.path);let n=-1;for(let r=t.length-1;r>=0;r--)if(t[r].path?.startsWith("/")){n=r;break}return t.slice(n).reduce((r,{path:o})=>{const s=r==="/"||r===""?o:`/${o}`;return`${r}${s}`},"")}function TO(e,t={}){const n=e,r=Pr({...t,instrumentNavigation:!1,instrumentPageLoad:!1}),{instrumentPageLoad:o=!0,instrumentNavigation:s=!0}=t;return{...r,afterAllSetup(i){r.afterAllSetup(i);const a=R.location;if(o&&a){const c=n.matchRoutes(a.pathname,n.options.parseSearch(a.search),{preload:!1,throwOnError:!1}),u=c[c.length-1],d=u?.routeId!=="__root__"?u:void 0;Lr(i,{name:d?d.routeId:a.pathname,attributes:{[ce]:"pageload",[z]:"auto.pageload.react.tanstack_router",[ie]:d?"route":"url",...vf(d)}})}s&&n.subscribe("onBeforeNavigate",c=>{if(!c.fromLocation||c.toLocation.state===c.fromLocation.state)return;const u=n.matchRoutes(c.toLocation.pathname,c.toLocation.search,{preload:!1,throwOnError:!1}),d=u[u.length-1],l=d?.routeId!=="__root__"?d:void 0,f=R.location,p=Dr(i,{name:l?l.routeId:f.pathname,attributes:{[ce]:"navigation",[z]:"auto.navigation.react.tanstack_router",[ie]:l?"route":"url"}}),h=n.subscribe("onResolved",m=>{if(h(),p){const _=n.matchRoutes(m.toLocation.pathname,m.toLocation.search,{preload:!1,throwOnError:!1}),y=_[_.length-1],S=y?.routeId!=="__root__"?y:void 0;S&&(p.updateName(S.routeId),p.setAttribute(ie,"route"),p.setAttributes(vf(S)))}})})}}}function vf(e){if(!e)return{};const t={};return Object.entries(e.params).forEach(([n,r])=>{t[`url.path.params.${n}`]=r,t[`url.path.parameter.${n}`]=r,t[`params.${n}`]=r}),t}function vO(e){const t=Pr({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,matchPath:o,instrumentPageLoad:s=!0,instrumentNavigation:i=!0}=e;return{...t,afterAllSetup(a){t.afterAllSetup(a),__(a,s,i,n,"reactrouter_v4",r,o)}}}function IO(e){const t=Pr({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,matchPath:o,instrumentPageLoad:s=!0,instrumentNavigation:i=!0}=e;return{...t,afterAllSetup(a){t.afterAllSetup(a),__(a,s,i,n,"reactrouter_v5",r,o)}}}function __(e,t,n,r,o,s=[],i){function a(){if(r.location)return r.location.pathname;if(R.location)return R.location.pathname}function c(u){if(s.length===0||!i)return[u,"url"];const d=y_(s,u,i);for(const l of d)if(l.match.isExact)return[l.match.path,"route"];return[u,"url"]}if(t){const u=a();if(u){const[d,l]=c(u);Lr(e,{name:d,attributes:{[ce]:"pageload",[z]:`auto.pageload.react.${o}`,[ie]:l}})}}n&&r.listen&&r.listen((u,d)=>{if(d&&(d==="PUSH"||d==="POP")){const[l,f]=c(u.pathname);Dr(e,{name:l,attributes:{[ce]:"navigation",[z]:`auto.navigation.react.${o}`,[ie]:f}})}})}function y_(e,t,n,r=[]){return e.some(o=>{const s=o.path?n(t,o):r.length?r[r.length-1].match:wO(t);return s&&(r.push({route:o,match:s}),o.routes&&y_(o.routes,t,n,r)),!!s}),r}function wO(e){return{path:"/",url:"/",params:{},isExact:e==="/"}}function kO(e){const t=e.displayName||e.name,n=r=>{if(r?.computedMatch?.isExact){const o=r.computedMatch.path,s=RO();j().setTransactionName(o),s&&(s.updateName(o),s.setAttribute(ie,"route"))}return xe.createElement(e,{...r})};return n.displayName=`sentryRoute(${t})`,Po(n,e),n}function RO(){const e=Te(),t=e&&ye(e);if(!t)return;const n=F(t).op;return n==="navigation"||n==="pageload"?t:void 0}function Lo(e,t){if(!t||t==="/"||!e.toLowerCase().startsWith(t.toLowerCase()))return e;const n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?e:e.slice(n)||"/"}const If=new WeakMap;function AO(e,t,n){if(!e||!t?.length)return null;const r=n?Lo(e,n):e;let o=If.get(t);o||(o=PO(t),If.set(t,o),Re&&g.log("[React Router] Sorted route manifest by specificity:",o.length,"patterns"));for(const s of o)if(CO(r,s))return Re&&g.log("[React Router] Matched pathname",r,"to pattern",s),s;return Re&&g.log("[React Router] No manifest match found for pathname:",r),null}function CO(e,t){if(t==="/")return e==="/"||e==="";const n=kf(e),r=kf(t);if(r.length>0&&r[r.length-1]==="*"){const s=r.slice(0,-1);if(n.length{const r=Rf(t);return Rf(n)-r})}let $u,An=!1;const nn=[],LO=10;function DO(e,t){const n={};return nn.length>=LO&&(Re&&g.warn("[React Router] Navigation context stack overflow - removing oldest context"),nn.shift()),nn.push({token:n,targetPath:e,span:t}),n}function FO(e){nn[nn.length-1]?.token===e&&nn.pop()}function b_(){const e=nn.length;return e>0?nn[e-1]??null:null}function $O(e,t=!1){$u=e,An=t}function BO(e){return HO(e.route.path||"")}function UO(e){return e.params["*"]||""}function HO(e){return e[e.length-1]==="*"?e.slice(0,-1):e}function ir(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function E_(e){return e.endsWith("*")}function un(e){return e.includes("/*")||e.endsWith("*")}function Af(e,t){return E_(e)&&!!t.route.children?.length||!1}function WO(e){return!!(!e.children&&e.element&&e.path?.endsWith("/*"))}function jO(e,t,n){const r=e&&e.length>0?e:An?Lo(t,n):t;let o=r.slice(-2)==="/*"?r.slice(0,-2):r;return o.length>1&&o[o.length-1]==="/"&&(o=o.slice(0,-1)),[o,"route"]}function Cf(e){return e.split(/\\?\//).filter(t=>t.length>0&&t!==",").length}function ii(e){return e[0]==="/"?e:`/${e}`}function T_(e,t){const n=$u(e,t);if(!n||n.length===0)return"";for(const r of n)if(r.route.path&&r.route.path!=="*"){const o=BO(r),s=Lo(t.pathname,ii(r.pathnameBase));return t.pathname===s?ir(s):ir(ir(o||"")+ii(T_(e.filter(i=>i!==r.route),{pathname:s})))}return""}function zO(e,t){const n=$u(t,e);if(n){for(const r of n)if(WO(r.route)&&UO(r))return!0}return!1}function xf(e,t){return An?Lo(e.pathname,t):e.pathname||""}function qO(e,t,n,r=""){if(!e||e.length===0)return[An?Lo(t.pathname,r):t.pathname,"url"];if(!n)return[xf(t,r),"url"];let o="";for(const s of n){const i=s.route;if(!i)continue;if(i.index)return jO(o,s.pathname,r);const a=i.path;if(!a||Af(a,s))continue;const c=a[0]==="/"||o[o.length-1]==="/"?a:`/${a}`;if(o=ir(o)+ii(c),ir(t.pathname)===ir(r+s.pathname))return Cf(o)!==Cf(s.pathname)&&!E_(o)?[(An?"":r)+c,"route"]:(Af(o,s)&&(o=o.slice(0,-1)),[(An?"":r)+o,"route"])}return[xf(t,r),"url"]}function Ui(e,t,n,r,o="",s,i){if(i&&s&&s.length>0){const d=AO(e.pathname,s,o);if(d)return[(An?"":o)+d,"route"]}let a,c="url";const u=zO(e,n);return u&&(a=ii(T_(n,e)),c="route"),(!u||!a)&&([a,c]=qO(t,e,r,o)),[a||e.pathname,c]}function vt(){const e=Te(),t=e?ye(e):void 0;if(!t)return;const n=F(t).op;return n==="navigation"||n==="pageload"?t:void 0}function GO(){const e=b_();if(e)return e.targetPath?{pathname:e.targetPath,search:"",hash:"",state:null,key:"default"}:null;if(typeof R<"u")try{const t=R.location;if(t)return{pathname:t.pathname,search:t.search||"",hash:t.hash||"",state:null,key:"default"}}catch{Re&&g.warn("[React Router] Could not access window.location")}return null}function VO(){const e=b_();return e?e.span:vt()}function YO(e,t,n,r){const o=new Proxy(e,{apply(s,i,a){const c=GO(),u=VO(),d=s.apply(i,a);return JO(d,t,n,r,c,u),d}});return Se(o,"__sentry_proxied__",!0),o}function JO(e,t,n,r,o,s){fn(e)?e.then(i=>{Array.isArray(i)&&r(i,t,o??void 0,s)}).catch(i=>{Re&&g.warn(`Error resolving async handler '${n}' for route`,t,i)}):Array.isArray(e)&&r(e,t,o??void 0,s)}function Hi(e,t){if(e.handle&&typeof e.handle=="object")for(const n of Object.keys(e.handle)){const r=e.handle[n];typeof r=="function"&&!r.__sentry_proxied__&&(e.handle[n]=YO(r,e,n,t))}if(Array.isArray(e.children))for(const n of e.children)Hi(n,t)}let rn,on,sn,ws,ot,hn=!1,In=3e3,Do,Bu="";const v_=new WeakSet,bn=new WeakMap,Ce=new Set,ks=new WeakMap,lc=new WeakMap;function KO(e){return R?.requestAnimationFrame?R.requestAnimationFrame(e):setTimeout(e,0)}function Mf(e){R?.cancelAnimationFrame?R.cancelAnimationFrame(e):clearTimeout(e)}function I_(e){return`${e.pathname}${e.search||""}${e.hash||""}`}function Nf(e){return e.includes(":")||e.includes("*")}function XO(e,t,n,r){if(!e)return{skip:!1,shouldUpdate:!1};if(e.locationKey===t&&(e.isPlaceholder||!r)){const s=!!e.routeName&&un(e.routeName),i=un(n),a=!!e.routeName&&Nf(e.routeName),c=Nf(n),u=s&&!i,d=!a&&c,l=n!==e.routeName&&n.length>(e.routeName?.length||0)&&!i;return{skip:!0,shouldUpdate:!!(e.routeName&&(u||d||l))}}return{skip:!1,shouldUpdate:!1}}function w_(e,t){const n=t.children||[],r=e.filter(o=>!n.some(s=>s===o||o.path&&s.path===o.path||o.id&&s.id===o.id));r.length>0&&(t.children=[...n,...r])}function k_(e,t){let n=ks.get(e);n||(n=new Set,ks.set(e,n)),n.add(t),t.finally(()=>{const r=ks.get(e);r&&r.delete(t)})}function R_(e){const t=new Promise(n=>{lc.set(e,n)});k_(e,t)}function QO(e){const t=lc.get(e);t&&(t(),lc.delete(e),e.__sentry_may_have_lazy_routes__&&(e.__sentry_may_have_lazy_routes__=!1))}function Uu(e,t,n=null,r){e.forEach(s=>{Ce.add(s),hn&&Hi(s,Uu)}),t&&w_(e,t);const o=r??vt();if(o){const s=F(o);if(s.timestamp){Re&&g.warn("[React Router] Lazy handler resolved after span ended - skipping update");return}const i=s.op;let a=n;if(!a&&!r&&typeof R<"u"){const c=R.location;c?.pathname&&(a={pathname:c.pathname})}a&&(i==="pageload"?$o({activeRootSpan:o,location:{pathname:a.pathname},routes:Array.from(Ce),allRoutes:Array.from(Ce)}):i==="navigation"&&dc(o,a,Array.from(Ce),!1,ot))}}function dc(e,t,n,r=!1,o){const s=F(e),i=s.description,a=e?.__sentry_navigation_name_set__,c=i&&un(i);if((!a||r||c)&&!s.timestamp){const d=o(n,t),[l,f]=Ui(t,n,n,d||[],Bu,Do,hn),p=s.data?.[ie];l&&(!i||!a&&(p!=="route"||f==="route")||p!=="route"&&f==="route"||p==="route"&&f==="route"&&c)&&(e.updateName(l),e.setAttribute(ie,f),!un(l)&&f==="route"&&Se(e,"__sentry_navigation_name_set__",!0))}}function A_(e,t,n,r,o){let s=!1,i=!!o&&F(o).op==="pageload",a=!1,c=null,u=null;e.subscribe(d=>{if(!s){const f=vt();f&&F(f).op==="pageload"?i=!0:i&&(d.historyAction==="POP"&&!a?a=!0:s=!0)}if(d.historyAction==="PUSH"||d.historyAction==="POP"&&s){const f=I_(d.location),p=()=>{u!==f&&(u=f,c=null,Hu({location:d.location,routes:t,navigationType:d.historyAction,version:n,basename:r,allRoutes:Array.from(Ce)}))};d.navigation.state!=="idle"?(u!==f&&(u=null),c!==null&&Mf(c),c=KO(p)):(c!==null&&(Mf(c),c=null),p())}})}function C_(e,t){return!rn||!on||!sn||!ot?(Re&&g.warn(`reactRouterV${t}Instrumentation was unable to wrap the \`createRouter\` function because of one or more missing parameters.`),e):function(n,r){if(Fo(n),hn)for(const u of n)Hi(u,Uu);const o=vt();r&&"patchRoutesOnNavigation"in r&&typeof r.patchRoutesOnNavigation=="function"&&o&&(Se(o,"__sentry_may_have_lazy_routes__",!0),R_(o));const i=O_(r,!1,o),a=e(n,i),c=r?.basename;return a.state.historyAction==="POP"&&o&&$o({activeRootSpan:o,location:a.state.location,routes:n,basename:c,allRoutes:Array.from(Ce)}),Bu=c||"",A_(a,n,t,c,o),a}}function x_(e,t){return!rn||!on||!sn||!ot?(Re&&g.warn(`reactRouterV${t}Instrumentation was unable to wrap the \`createMemoryRouter\` function because of one or more missing parameters.`),e):function(n,r){if(Fo(n),hn)for(const _ of n)Hi(_,Uu);const o=vt();r&&"patchRoutesOnNavigation"in r&&typeof r.patchRoutesOnNavigation=="function"&&o&&(Se(o,"__sentry_may_have_lazy_routes__",!0),R_(o));const i=O_(r,!0,o),a=e(n,i),c=r?.basename;let u;const d=r?.initialEntries,l=r?.initialIndex,f=d?.length===1,p=l!==void 0&&d?.[l];u=f?d[0]:p?d[l]:void 0;const h=u?typeof u=="string"?{pathname:u}:u:a.state.location,m=vt();return a.state.historyAction==="POP"&&m&&$o({activeRootSpan:m,location:h,routes:n,basename:c,allRoutes:Array.from(Ce)}),Bu=c||"",A_(a,n,t,c,m),a}}function M_(e,t){const n=Pr({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:r,useLocation:o,useNavigationType:s,createRoutesFromChildren:i,matchRoutes:a,stripBasename:c,enableAsyncRouteHandlers:u=!1,instrumentPageLoad:d=!0,instrumentNavigation:l=!0,lazyRouteTimeout:f,lazyRouteManifest:p}=e;return{...n,setup(h){n.setup(h);const m=e.finalTimeout??3e4,_=(e.idleTimeout??1e3)*3,y=f??_;y===1/0?(In=m,Re&&g.log("[React Router] lazyRouteTimeout set to Infinity, capping at finalTimeout:",m,"ms to prevent indefinite hangs")):Number.isNaN(y)?(Re&&g.warn("[React Router] lazyRouteTimeout must be a number, falling back to default:",_),In=_):y<0?(Re&&g.warn("[React Router] lazyRouteTimeout must be non-negative or Infinity, got:",y,"falling back to:",_),In=_):In=y,rn=r,on=o,sn=s,ot=a,ws=i,hn=u,Do=p,$O(a,c||!1)},afterAllSetup(h){n.afterAllSetup(h);const m=R.location?.pathname;d&&m&&Lr(h,{name:m,attributes:{[ie]:"url",[ce]:"pageload",[z]:`auto.pageload.react.reactrouter_v${t}`}}),l&&v_.add(h)}}}function N_(e,t){if(!rn||!on||!sn||!ot)return Re&&g.warn("reactRouterV6Instrumentation was unable to wrap `useRoutes` because of one or more missing parameters."),e;const n=r=>{const o=xe.useRef(!0),{routes:s,locationArg:i}=r,a=e(s,i),c=on(),u=sn(),d=typeof i=="string"||i?.pathname?i:c;return rn(()=>{const l=typeof d=="string"?{pathname:d}:d;o.current?(Fo(s),$o({activeRootSpan:vt(),location:l,routes:s,allRoutes:Array.from(Ce)}),o.current=!1):Hu({location:l,routes:s,navigationType:u,version:t,allRoutes:Array.from(Ce)})},[u,d]),a};return(r,o)=>xe.createElement(n,{routes:r,locationArg:o})}function O_(e,t=!1,n){if(!e||!("patchRoutesOnNavigation"in e)||typeof e.patchRoutesOnNavigation!="function")return e||{};const r=e.patchRoutesOnNavigation;return{...e,patchRoutesOnNavigation:async o=>{const s=o?.path,i=vt()??n;if(!t){const c=o?.patch,u=o?.matches;c&&(o.patch=(d,l)=>{if(Fo(l),u&&u.length>0){const h=u[u.length-1]?.route;if(h){const m=Array.from(Ce).find(_=>{const y=_.id!==void 0&&_.id===d,S=_===h,M=_.path!==void 0&&h.path!==void 0&&_.path===h.path;return y||S||M});m&&w_(l,m)}}const f=i?F(i):void 0;return s&&i&&f&&!f.timestamp&&f.op==="navigation"&&dc(i,{pathname:s,search:"",hash:"",state:null,key:"default"},Array.from(Ce),!0,ot),c(d,l)})}const a=(async()=>{const c=DO(s,i);let u;try{u=await r(o)}finally{FO(c),i&&QO(i)}const d=i?F(i):void 0;if(i&&d&&!d.timestamp&&d.op==="navigation"){const l=s;l&&dc(i,{pathname:l,search:"",hash:"",state:null,key:"default"},Array.from(Ce),!1,ot)}return u})();return i&&k_(i,a),a}}}function Hu(e){const{location:t,routes:n,navigationType:r,version:o,matches:s,basename:i,allRoutes:a}=e,c=Array.isArray(s)?s:ot(a||n,t,i),u=C();if(!u||!v_.has(u))return;const d=vt();if(!(d&&F(d).op==="pageload"&&r==="POP")&&(r==="PUSH"||r==="POP")&&c){const[l,f]=Ui(t,a||n,a||n,c,i,Do,hn),p=I_(t),h=bn.get(u),m=h&&!h.isPlaceholder?!!F(h.span).timestamp:!1,{skip:_,shouldUpdate:y}=XO(h,p,l,m);if(_){if(y&&h){const L=h.routeName;h.isPlaceholder?(h.routeName=l,Re&&g.log(`[Tracing] Updated placeholder navigation name from "${L}" to "${l}" (will apply to real span)`)):(h.span.updateName(l),h.span.setAttribute(ie,f),Se(h.span,"__sentry_navigation_name_set__",!0),h.routeName=l,Re&&g.log(`[Tracing] Updated navigation span name from "${L}" to "${l}"`))}else Re&&g.log(`[Tracing] Skipping duplicate navigation for location: ${p}`);return}const M={span:{end:()=>{}},routeName:l,pathname:t.pathname,locationKey:p,isPlaceholder:!0};bn.set(u,M);let I;try{I=Dr(u,{name:M.routeName,attributes:{[ie]:f,[ce]:"navigation",[z]:`auto.navigation.react.reactrouter_v${o}`}})}catch(L){throw bn.delete(u),L}I?(bn.set(u,{span:I,routeName:M.routeName,pathname:t.pathname,locationKey:p}),fc(I,t,n,i,"navigation")):bn.delete(u)}}function Fo(e){e.forEach(t=>{P_(t).forEach(r=>{Ce.add(r)})})}function P_(e,t=new Set){return t.has(e)||(t.add(e),e.children&&!e.index&&e.children.forEach(n=>{P_(n,t).forEach(o=>{t.add(o)})})),t}function $o({activeRootSpan:e,location:t,routes:n,matches:r,basename:o,allRoutes:s}){const i=Array.isArray(r)?r:ot(s||n,t,o);if(i){const[a,c]=Ui(t,s||n,s||n,i,o,Do,hn);j().setTransactionName(a||"/"),e&&(e.updateName(a),e.setAttribute(ie,c),fc(e,t,n,o,"pageload"))}else e&&fc(e,t,n,o,"pageload")}function ZO(e,t,n,r,o=!1){return n?!!(!e&&o||e&&un(e)&&r==="route"&&!un(n)||t!=="route"&&r==="route"):!1}function ba(e,t,n,r,o,s,i,a){try{const c=t.data?.[ie];if(c==="route"&&n&&!un(n))return;const u=Array.from(a),d=u.length>0?u:o,l=ot(d,r,s);if(!l)return;const[f,p]=Ui(r,d,d,l,s,Do,hn),h=ZO(n,c,f,p,!0),m=i==="pageload"||!t.timestamp;h&&m&&(e.updateName(f),e.setAttribute(ie,p))}catch(c){Re&&g.warn(`Error updating span details before ending: ${c}`)}}function fc(e,t,n,r,o){const s=`__sentry_${o}_end_patched__`;if(e?.[s]||!e.end)return;const a=e.end.bind(e);let c=!1;e.end=function(...d){if(c)return;c=!0;const l=d.length>0?d[0]:Date.now()/1e3,f=F(e),p=f.description,h=f.data?.[ie],m=()=>{const I=C();if(I&&o==="navigation"){const L=bn.get(I);L&&L.span===e&&bn.delete(I)}},_=ks.get(e),y=e.__sentry_may_have_lazy_routes__;if((_&&_.size>0||y)&&p&&(un(p)||h!=="route")){if(In===0){ba(e,f,p,t,n,r,o,Ce),m(),a(l);return}const I=new Promise(N=>setTimeout(N,In));let L;if(_&&_.size>0){const N=Promise.allSettled(_).then(()=>{});L=In===1/0?N:Promise.race([N,I])}else L=I;L.then(()=>{const N=F(e);ba(e,N,N.description,t,n,r,o,Ce),m(),a(l)}).catch(()=>{m(),a(l)});return}ba(e,f,p,t,n,r,o,Ce),m(),a(l)},Se(e,s,!0)}function L_(e,t){if(!rn||!on||!sn||!ws||!ot)return Re&&g.warn(`reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters. useEffect: ${rn}. useLocation: ${on}. useNavigationType: ${sn}. createRoutesFromChildren: ${ws}. matchRoutes: ${ot}.`),e;const n=r=>{const o=xe.useRef(!0),s=on(),i=sn();return rn(()=>{const a=ws(r.children);o.current?(Fo(a),$o({activeRootSpan:vt(),location:s,routes:a,allRoutes:Array.from(Ce)}),o.current=!1):Hu({location:s,routes:a,navigationType:i,version:t,allRoutes:Array.from(Ce)})},[s,i]),xe.createElement(e,{...r})};return Po(n,e),n}function eP(e){return M_(e,"6")}function tP(e){return N_(e,"6")}function nP(e){return C_(e,"6")}function rP(e){return x_(e,"6")}function oP(e){return L_(e,"6")}function sP(e){return M_(e,"7")}function iP(e){return L_(e,"7")}function aP(e){return C_(e,"7")}function cP(e){return x_(e,"7")}function uP(e){return N_(e,"7")}const yP=Object.freeze(Object.defineProperty({__proto__:null,BrowserClient:mm,ErrorBoundary:g_,MULTIPLEXED_TRANSPORT_EXTRA_KEY:ds,OpenFeatureIntegrationHook:WN,Profiler:Fu,SDK_VERSION:Ct,SEMANTIC_ATTRIBUTE_SENTRY_OP:ce,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:z,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:ui,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:ie,Scope:ht,WINDOW:R,addBreadcrumb:mt,addEventProcessor:Mc,addIntegration:Ps,breadcrumbsIntegration:Bm,browserApiErrorsIntegration:Um,browserProfilingIntegration:$N,browserSessionIntegration:Hm,browserTracingIntegration:Pr,buildLaunchDarklyFlagUsedHandler:UN,captureConsoleIntegration:vE,captureEvent:kr,captureException:me,captureFeedback:wh,captureMessage:Cc,captureReactException:Lu,captureSession:us,chromeStackLineParser:Pm,close:ub,consoleLoggingIntegration:FT,contextLinesIntegration:kA,continueTrace:RS,createConsolaReporter:WT,createLangChainCallbackHandler:II,createReduxEnhancer:SO,createTransport:eh,createUserFeedbackEnvelope:yR,cultureContextIntegration:Wm,dedupeIntegration:Sh,defaultRequestInstrumentationOptions:Nu,defaultStackLineParsers:Dm,defaultStackParser:Fm,diagnoseSdkConnectivity:VN,elementTimingIntegration:Ck,endSession:Nc,eventFiltersIntegration:ph,eventFromException:pm,eventFromMessage:hm,exceptionFromError:ki,extraErrorDataIntegration:NE,featureFlagsIntegration:_T,feedbackAsyncIntegration:_w,feedbackIntegration:gd,feedbackSyncIntegration:gd,flush:cb,forceLoad:oA,functionToStringIntegration:fh,geckoStackLineParser:Lm,getActiveSpan:Te,getClient:C,getCurrentScope:j,getDefaultIntegrations:Jm,getFeedback:w0,getGlobalScope:wn,getIsolationScope:be,getReplay:gM,getRootSpan:ye,getSpanDescendants:qr,getSpanStatusFromHttpCode:np,getTraceData:Uc,globalHandlersIntegration:jm,graphqlClientIntegration:PA,growthbookIntegration:qN,httpClientIntegration:fA,httpContextIntegration:Vm,inboundFiltersIntegration:hh,init:d_,instrumentAnthropicAiClient:oI,instrumentGoogleGenAIClient:gI,instrumentLangChainEmbeddings:QI,instrumentLangGraph:NI,instrumentOpenAiClient:Bv,instrumentOutgoingRequests:Zg,instrumentSupabaseClient:Ih,isEnabled:Hp,isInitialized:lb,lastEventId:Up,launchDarklyIntegration:BN,lazyLoadIntegration:dm,linkedErrorsIntegration:Ym,logger:OT,makeBrowserOfflineTransport:dN,makeFetchTransport:pu,makeMultiplexedTransport:Yb,metrics:UT,moduleMetadataIntegration:SE,onLoad:sA,openFeatureIntegration:HN,opera10StackLineParser:hR,opera11StackLineParser:_R,parameterize:lh,reactErrorHandler:tO,reactRouterV3BrowserTracingIntegration:bO,reactRouterV4BrowserTracingIntegration:vO,reactRouterV5BrowserTracingIntegration:IO,reactRouterV6BrowserTracingIntegration:eP,reactRouterV7BrowserTracingIntegration:sP,registerSpanErrorInstrumentation:wp,registerWebWorker:XN,replayCanvasIntegration:LM,replayIntegration:qg,reportPageLoaded:nN,reportingObserverIntegration:uA,rewriteFramesIntegration:UE,sendFeedback:Xh,setActiveSpanInBrowser:rN,setContext:xc,setConversationId:ab,setCurrentClient:ih,setExtra:rb,setExtras:nb,setHttpStatus:Zr,setMeasurement:Mp,setTag:sb,setTags:ob,setUser:ib,showReportDialog:Xa,spanStreamingIntegration:oN,spanToBaggageHeader:rS,spanToJSON:F,spanToTraceHeader:gp,spotlightBrowserIntegration:ZR,startBrowserTracingNavigationSpan:Dr,startBrowserTracingPageLoadSpan:Lr,startInactiveSpan:nt,startNewTrace:Op,startSession:Ma,startSpan:zt,startSpanManual:Rt,statsigIntegration:GN,supabaseIntegration:ZE,suppressTracing:Np,tanstackRouterBrowserTracingIntegration:TO,thirdPartyErrorFilterIntegration:uT,uiProfiler:Jk,unleashIntegration:jN,updateSpanName:eS,useProfiler:pO,webWorkerIntegration:JN,winjsStackLineParser:dR,withActiveSpan:Mn,withErrorBoundary:mO,withIsolationScope:Ey,withProfiler:fO,withScope:je,withSentryReactRouterV6Routing:oP,withSentryReactRouterV7Routing:iP,withSentryRouting:kO,withStreamedSpan:oS,wrapCreateBrowserRouterV6:nP,wrapCreateBrowserRouterV7:aP,wrapCreateMemoryRouterV6:rP,wrapCreateMemoryRouterV7:cP,wrapUseRoutesV6:tP,wrapUseRoutesV7:uP,zodErrorsIntegration:cT},Symbol.toStringTag,{value:"Module"})),pc=()=>Df.sentry.release,Of=()=>"production",lP=e=>{if(e)try{return new URL(e).hostname||void 0}catch{try{return new URL(`https://${e}`).hostname||void 0}catch{return}}},dP=e=>{if(!e)return;let t=5381;for(let n=0;n>>0).toString(16)},D_=()=>{const e=_n.getWidgetId(),t=_n.getAppHost()||_n.getReferrer(),n={},r=lP(t),o=_n.getAccountId(),s=_n.getVisitorAlias();return o&&(n.account_id=o),s&&(n.visitor_alias=s),e&&(n.widget_id=e),r&&(n.widget_host=r),n},fP=()=>{const e=_n.getToken(),t=dP(e),n={};return t&&(n.widget_token_hash=t),n},pP=()=>!!_n.getConfigKey("sentryReplayEnabled");let Pf=!1,Ea=!1;const SP=()=>{Pf||Ea||typeof window>"u"||!pP()||(Ea=!0,Ps(qg()),Pf=!0,Ea=!1)};d_({dsn:Df.sentry.dsn,environment:Of(),sendDefaultPii:!0,tracesSampleRate:1,replaysSessionSampleRate:0,replaysOnErrorSampleRate:1,integrations:[],ignoreErrors:[],release:pc(),_experiments:{enableLogs:!0}}),Mc((e,t)=>{e.release||(e.release=pc()),e.environment||(e.environment=Of());const n=D_();Object.keys(n).length>0&&(e.tags={...e.tags,...n});const r=fP();return Object.keys(r).length>0&&(e.extra={...e.extra,...r}),n.widget_id&&hP(e,t,n),e});function hP(e,t,n){const r={infoType:e.message||"exception",capturedAt:new Date().toISOString()};for(const[a,c]of Object.entries(n))r[a]=String(c);const o=Lf.getNetworkLogs();o.length>0&&Pa(`Network Logs - JSON object of recorded network requests, ${JSON.stringify(o)}`,{...r,log_count:o.length});const s=mP();s&&Pa("DOM Snapshot - page HTML content",{...r,page_snapshot:s}),(e.level==="error"||e.level===void 0)&&!e.contexts?.error&&(e.tags={...e.tags,capturedAt:new Date().toISOString()},t.originalException instanceof Error&&(e.contexts={...e.contexts,error:{message:t.originalException.message}}))}function mP(){try{const e=document.getElementById("root");return e?`${e.outerHTML}`:null}catch{return null}}const bP=(e="network-logs-captured",t={})=>{const n=Lf.getNetworkLogs();if(n.length===0)return;const r=D_();if(r.account_id===-1)return;const o=e==="api-error"&&r.widget_host?`${e} | ${r.widget_host}`:e;je(s=>{s.setLevel("info"),Object.entries({infoType:e||"network-logs-captured",release:pc(),capturedAt:new Date().toISOString(),...r}).forEach(([i,a])=>s.setTag(i,String(a))),s.setExtras({networkLogCount:n.length,...t}),Cc(o)})};export{yP as default,SP as loadSentryReplayIfEnabled,bP as sendNetworkLogsToSentry};