@cmmd-center/forge 0.13.125 → 0.13.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.cjs +138 -41
- package/dist/bin.mjs +162 -65
- package/dist/client/assets/{CanvasPanel-BOh2xUZv.js → CanvasPanel-Db1Iz4JN.js} +2 -2
- package/dist/client/assets/CompositeItem-BxPZ_9BJ.js +2 -0
- package/dist/client/assets/DiffPanel-CqRZidQp.js +64 -0
- package/dist/client/assets/{DiffPanel.logic-DS1mmUZB.js → DiffPanel.logic-D4K70r-U.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-C2tnM5gq.js → DiffWorkerPoolProvider-BHmRAZ9V.js} +11 -11
- package/dist/client/assets/PullRequestCodePanel-Bfws9NZf.js +5 -0
- package/dist/client/assets/{ThemeEditorPanel-v2mnY18G.js → ThemeEditorPanel-DTfrlPBc.js} +2 -2
- package/dist/client/assets/{Virtualizer-Ds5-GzY3.js → Virtualizer-BaK0M9lw.js} +2 -2
- package/dist/client/assets/WorkerPoolContext-CD9L3Rin.js +1533 -0
- package/dist/client/assets/{canvasStateStore-xaZAenqH.js → canvasStateStore-DKtQcBVc.js} +2 -2
- package/dist/client/assets/cmmdForgeRuntimeListResource-lbV63vQg.js +1008 -0
- package/dist/client/assets/currentForgeWorkspaceStore-Cukj-AKS.js +2 -0
- package/dist/client/assets/index-CFdawhcA.js +169 -0
- package/dist/client/assets/popover-Cvb1Axgx.js +2 -0
- package/dist/client/assets/scroll-area-DzReJmNn.js +2 -0
- package/dist/client/assets/switch-RuRK1onH.js +2 -0
- package/dist/client/assets/{themePalette-eOA8OvYM.js → themePalette-gr6ZYaOx.js} +2 -2
- package/dist/client/assets/toggle-D8xaJAgP.js +2 -0
- package/dist/client/assets/toggle-group-CwSbXP07.js +2 -0
- package/dist/client/assets/useOpenInteractionType-B983ff5H.js +2 -0
- package/dist/client/assets/utils-B4G-Q0s7.js +2 -0
- package/dist/client/index.html +16 -13
- package/dist/forge-build.json +1 -1
- package/dist/{open-yHTUkd2Y.mjs → open-2-reBrpv.mjs} +3 -3
- package/package.json +1 -1
- package/dist/client/assets/CompositeItem-DNVaubQt.js +0 -2
- package/dist/client/assets/DiffPanel-BM-qanPT.js +0 -64
- package/dist/client/assets/PullRequestCodePanel-zxkVGUeq.js +0 -5
- package/dist/client/assets/WorkerPoolContext-BWuPUnhX.js +0 -2538
- package/dist/client/assets/index-Rx6Z6FPS.js +0 -169
- package/dist/client/assets/popover-Cxnw5kve.js +0 -2
- package/dist/client/assets/scroll-area-DDcW71H4.js +0 -2
- package/dist/client/assets/switch-Wi-2Dkh9.js +0 -2
- package/dist/client/assets/toggle-group-Cqh7gA8I.js +0 -2
- package/dist/client/assets/toggle-m8ncTpRB.js +0 -2
- package/dist/client/assets/useOpenInteractionType-CN3hnnfp.js +0 -2
|
@@ -0,0 +1,1008 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/currentForgeWorkspaceStore-Cukj-AKS.js","assets/rolldown-runtime-hePW80VL.js","assets/Stream-mUTFnSY9.js","assets/cmmdAuthRedirect-BYBGztDm.js","assets/atomRegistry-C1yW8tyM.js","assets/src-BAHvoNAY.js","assets/preload-helper-Czpn1I53.js","assets/transport-CgH8pQK3.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{Ha as n,Oa as r,Ua as i,Wa as a}from"./Stream-mUTFnSY9.js";import{Fn as o,H as s,In as c,J as l,Mn as u,Nt as d,On as f,Ot as p,Tn as m,a as h,bt as g,cn as _,er as v,gn as y,hn as b,i as x,jn as S,kn as C,pn as w,sn as T,v as ee,vn as E,vt as te,wt as ne,yn as re}from"./src-BAHvoNAY.js";import{A as ie,F as ae,L as oe,M as D,N as se,P as ce,a as le,c as ue,d as de,l as fe,n as pe,s as me,u as he}from"./cmmdAuthRedirect-BYBGztDm.js";import{t as ge}from"./utils-B4G-Q0s7.js";import{t as _e}from"./preload-helper-Czpn1I53.js";import{o as ve,t as ye}from"./debouncer-BmyJL8Gi.js";import{n as O,t as be}from"./transport-CgH8pQK3.js";var k=t(a(),1),xe=typeof window<`u`&&(window.desktopBridge!==void 0||window.nativeApi!==void 0);function Se(e){return{id:e.id??`ws:${e.label}`,label:e.label,source:e.source??`manual`,target:e.target}}function Ce(e){return e?.target.wsBaseUrl??null}function we(e){return e?.target.httpBaseUrl??null}function Te(e,t){return{...e,environmentId:t.environmentId,label:t.label}}function Ee(e){return e.cloudMode?`cmmd-cloud-runtime`:`local-web`}function De(e){let t=Ee(e);return{topology:t,controlPlane:t!==`cmmd-cloud-runtime`,executionPlane:!0,workspaceProxy:!1}}function Oe(e){let t=e.topology===`cmmd-cloud-runtime`;return{cmmd:!0,ownerBootstrapPromotion:e.topology!==`cloud-shell`&&!t,bearerBootstrap:!0,desktopBootstrap:e.topology===`desktop-local`,providerCredentialBroker:e.topology===`cmmd-control-plane`}}function ke(e){let t=e.executionPlane;return{agents:t,browser:t,github:t,terminal:t,providerEgress:e.topology===`cmmd-control-plane`}}function Ae(e,t){return{localProjects:t.executionPlane,cloudProjects:e.cloudMode}}function je(e){let t=e.capabilities,n=t.runtime??De(t);return{repositoryIdentity:t.repositoryIdentity,pullRequests:t.pullRequests??!1,cloudMode:t.cloudMode,posthogPublicKey:t.posthogPublicKey,posthogHost:t.posthogHost,runtime:n,auth:t.auth??Oe(n),tools:t.tools??ke(n),projects:t.projects??Ae(t,n)}}function Me(e){return e?je(e).projects.cloudProjects:!1}function Ne(e){return e?je(e).runtime.workspaceProxy??!1:!1}function Pe(e,t){return{environmentId:e,projectId:t}}function Fe(e,t){return{environmentId:e,threadId:t}}var Ie=`scoped:v1:`;function Le(e){let t=`projectId`in e?e.projectId:e.threadId;return t.includes(`:`)||e.environmentId.startsWith(Ie)?`${Ie}${encodeURIComponent(e.environmentId)}:${encodeURIComponent(t)}`:`${e.environmentId}:${t}`}function eee(e){return Le(e)}function tee(e){return Le(e)}function Re(e){let t=e.slice(10),n=t.indexOf(`:`);if(n<=0||n>=t.length-1||t.indexOf(`:`,n+1)!==-1)return null;try{let e=decodeURIComponent(t.slice(0,n)),r=decodeURIComponent(t.slice(n+1));return e.length>0&&r.length>0?{environmentId:e,localId:r}:null}catch{return null}}function ze(e){if(e.startsWith(Ie))return Re(e);let t=e.lastIndexOf(`:`);return t<=0||t>=e.length-1?null:{environmentId:e.slice(0,t),localId:e.slice(t+1)}}function Be(e){let t=ze(e);return t?{environmentId:t.environmentId,projectId:t.localId}:null}function Ve(e){let t=ze(e);return t?{environmentId:t.environmentId,threadId:t.localId}:null}var He=n();function Ue(e){return e.stageLabel.trim().toLowerCase()===`latest`?e.baseName:`${e.baseName} (${e.stageLabel})`}var We=`Forge`,Ge=``,Ke=Ge===`latest`||Ge===`nightly`?Ge:null,qe=Ke===`nightly`?`Nightly`:Ke===`latest`?`Latest`:null,Je=qe??`Alpha`,Ye=qe?Ue({baseName:We,stageLabel:Je}):We,Xe=`0.13.4`,Ze=ge(`forge-app-top-bar drag-region @container/header-actions relative z-20 w-full min-w-0 shrink-0 bg-background`,`grid grid-cols-[minmax(0,1fr)_minmax(0,auto)] items-center`),Qe=`flex h-full min-w-0 items-center gap-1 md:gap-1.5`,$e=`flex h-touch min-w-0 max-w-full touch-manipulation items-center justify-center rounded-lg px-3 text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring md:h-7 md:px-2`,nee={width:`calc(100% - var(--forge-right-panel-reserved-width, 0px))`},et=`forge-app-shell flex w-full min-w-0 flex-row`,tt=`forge-app-shell flex w-full min-w-0 flex-col`,nt=`flex min-h-0 min-w-0 flex-1 flex-col`,rt=`relative flex h-[var(--forge-content-height)] min-h-0 min-w-0 flex-1 overflow-hidden`,it=i();function at(e){let t=(0,He.c)(19),{showStageBadge:n,tone:r,variant:i}=e,a=n!==void 0&&n,o=r===void 0?`default`:r,s=(i===void 0?`default`:i)===`auth`,c=s?20:16,l=s?`h-5 w-5 shrink-0`:`h-4 w-4 shrink-0`,u;t[0]!==c||t[1]!==l?(u=(0,it.jsx)(`img`,{className:l,src:`/forge-mark.svg`,width:c,height:c,alt:``,"aria-hidden":`true`}),t[0]=c,t[1]=l,t[2]=u):u=t[2];let d=u,f=s?`text-[15px] sm:text-base`:`text-sm`,p=o===`on-dark`?`text-primary-foreground`:`text-foreground`,m;t[3]!==f||t[4]!==p?(m=ge(`truncate font-semibold tracking-tight`,f,p),t[3]=f,t[4]=p,t[5]=m):m=t[5];let h;t[6]===m?h=t[7]:(h=(0,it.jsx)(`span`,{className:m,children:We}),t[6]=m,t[7]=h);let g=h,_=s?`rounded-full bg-muted/50 px-2 py-0.5 text-[9px] leading-none font-medium tracking-[0.14em] text-muted-foreground/70 uppercase [text-indent:0.14em]`:`rounded-full bg-muted/50 px-1.5 py-0.5 text-[8px] leading-none font-medium tracking-[0.18em] text-muted-foreground/60 uppercase [text-indent:0.18em]`,v;t[8]===_?v=t[9]:(v=(0,it.jsx)(`span`,{className:_,children:Je}),t[8]=_,t[9]=v);let y=v;if(a){let e;t[10]!==d||t[11]!==g?(e=(0,it.jsxs)(`span`,{className:`flex items-center gap-2`,children:[d,g]}),t[10]=d,t[11]=g,t[12]=e):e=t[12];let n;return t[13]!==y||t[14]!==e?(n=(0,it.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md`,"aria-label":Ye,children:[e,y]}),t[13]=y,t[14]=e,t[15]=n):n=t[15],n}let b;return t[16]!==d||t[17]!==g?(b=(0,it.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,"aria-label":Ye,children:[d,g]}),t[16]=d,t[17]=g,t[18]=b):b=t[18],b}function ot(e){let t=(0,He.c)(5),{className:n}=e,r;t[0]===n?r=t[1]:(r=ge(`pointer-events-none flex select-none items-center`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,it.jsx)(at,{}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,it.jsx)(`div`,{className:r,children:i}),t[3]=r,t[4]=a),a}function st(){let e=new Map;return{clear:()=>e.clear(),getItem:t=>e.get(t)??null,key:t=>Array.from(e.keys()).at(t)??null,get length(){return e.size},removeItem:t=>e.delete(t),setItem:(t,n)=>e.set(t,n)}}var ct=typeof window<`u`?window.localStorage:st(),lt=(e,t)=>m(u(e))(t),ut=(e,t)=>S(u(e))(t),dt=(e,t)=>{let n=ct.getItem(e);return n?lt(t,n):null},ft=(e,t,n)=>{let r=ut(n,t);ct.setItem(e,r)},pt=e=>{ct.removeItem(e)},mt=`forge:local_storage_change`;function ree(e){typeof window>`u`||window.dispatchEvent(new CustomEvent(mt,{detail:{key:e}}))}function iee(e,t,n){let[r,i]=(0,k.useState)(()=>{try{return dt(e,n)??t}catch(e){return console.error(`[LOCALSTORAGE] Error:`,e),t}}),a=(0,k.useCallback)(t=>{i(r=>{try{let i=typeof t==`function`?t(r):t;return i===null?pt(e):ft(e,i,n),queueMicrotask(()=>ree(e)),i}catch(e){return console.error(`[LOCALSTORAGE] Error:`,e),r}})},[e,n]),o=(0,k.useRef)(e);return(0,k.useEffect)(()=>{if(o.current!==e){o.current=e;try{let r=dt(e,n);i(r??t)}catch(e){console.error(`[LOCALSTORAGE] Error:`,e)}}},[e,t,n]),(0,k.useEffect)(()=>{let r=()=>{try{let r=dt(e,n);i(r??t)}catch(e){console.error(`[LOCALSTORAGE] Error:`,e)}},a=t=>{t.key===e&&r()},o=t=>{t.detail.key===e&&r()};return window.addEventListener(`storage`,a),window.addEventListener(mt,o),()=>{window.removeEventListener(`storage`,a),window.removeEventListener(mt,o)}},[e,t,n]),[r,a]}var ht=`cmmd-runtime:`;function gt(e){return`${ht}${e}`}var aee=`cmmd-cloud-project:`,oee=/^env_[0-9a-f]{32}$/,see=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,_t={shape:`local`,isCloud:!1,legacyRuntimeId:null},vt={shape:`cloud-project-placeholder`,isCloud:!0,legacyRuntimeId:null},yt={shape:`durable-environment`,isCloud:!0,legacyRuntimeId:null};function bt(e){if(typeof e!=`string`)return _t;if(e.startsWith(`cmmd-runtime:`)){let t=e.slice(ht.length);return see.test(t)?{shape:`legacy-runtime`,isCloud:!0,legacyRuntimeId:t}:_t}return e.startsWith(`cmmd-cloud-project:`)?vt:oee.test(e)?yt:_t}var xt=`forge:client-settings:v1`,St=`forge:saved-environment-registry:v1`,Ct=re({environmentId:p,label:E,httpBaseUrl:E,wsBaseUrl:E,createdAt:E,lastConnectedAt:b(E),cmmdOrganizationId:c(E),cmmdProjectId:c(E),runtimeId:c(E),runtimeTicketExpiresAt:c(E),lastAuthenticatedPullRequestCapability:c(_),bearerToken:c(E)}),wt=re({version:c(y),records:c(T(Ct))});function Tt(){return typeof window<`u`}var Et={uiFontSize:14,codeFontSize:15},Dt=[[`uiFontSize`,11,20],[`codeFontSize`,11,20]];function Ot(e){return e.defaultThreadRuntime===`desktop-cloud-bridge`?{...e,defaultThreadRuntime:`cloud`}:null}function kt(e){if(typeof e.fontDefaultsVersion==`number`)return null;let t=Object.entries(Et).filter(([t,n])=>e[t]===n);if(t.length===0)return null;let n={...e};for(let[e]of t)delete n[e];return n}function At(e){let t=Dt.flatMap(([t,n,r])=>{let i=e[t];if(typeof i!=`number`||!Number.isFinite(i))return[];let a=Math.min(r,Math.max(n,Math.round(i)));return a===i?[]:[[t,a]]});if(t.length===0)return null;let n={...e};for(let[e,r]of t)n[e]=r;return n}function jt(e){if(!e||typeof e!=`object`)return e;let t=e,n=!1;for(let e of[Ot,kt,At]){let r=e(t);r!==null&&(t=r,n=!0)}return n?t:e}function Mt(){if(!Tt())return null;try{let e=window.localStorage.getItem(xt);return e?C(ee)(jt(JSON.parse(e))):null}catch{return null}}function Nt(e){Tt()&&ft(xt,e,ee)}function Pt(){if(!Tt())return{};try{return dt(`forge:saved-environment-registry:v1`,wt)??{}}catch{return{}}}function Ft(e){Tt()&&ft(St,e,wt)}function It(){return Pt().records??[]}function Lt(e){Ft({version:1,records:e})}function Rt(){return It().map(e=>s(e))}function zt(e){let t=new Map(It().map(e=>[e.environmentId,e]));Lt(e.map(e=>{let n=bt(e.environmentId).legacyRuntimeId===null?t.get(e.environmentId)?.bearerToken:void 0;return n?{...s(e),bearerToken:n}:s(e)}))}function Bt(e){return It().find(t=>t.environmentId===e)?.bearerToken??null}function Vt(e,t){let n=Pt(),r=n.records??[],i=!1;return Ft({version:n.version??1,records:r.map(n=>n.environmentId===e?(i=!0,Object.assign(s(n),{bearerToken:t})):n)}),i}function Ht(e){let t=Pt();Ft({version:t.version??1,records:(t.records??[]).map(t=>t.environmentId===e?s(t):t)})}var Ut=C(ee);function Wt(){return typeof window>`u`?void 0:window.desktopBridge}function Gt(e){let t=Wt(),n=t?.[e];return typeof n==`function`?n.bind(t):null}async function Kt(){let e=Gt(`getClientSettings`);if(e){let t=await e();return t?Ut(t):null}return Mt()}async function qt(e){let t=Gt(`setClientSettings`);if(t)return t(e);Nt(e)}async function Jt(){let e=Gt(`getSavedEnvironmentRegistry`);return e?e():Rt()}async function Yt(e){let t=Gt(`setSavedEnvironmentRegistry`);if(t)return t(e);zt(e)}async function Xt(e){let t=Gt(`getSavedEnvironmentSecret`);return t?t(e):Bt(e)}async function Zt(e,t){let n=Gt(`setSavedEnvironmentSecret`);return n?n(e,t):Vt(e,t)}async function Qt(e){let t=Gt(`removeSavedEnvironmentSecret`);if(t)return t(e);Ht(e)}var $t=`token`;function en(e){return new URLSearchParams(e.hash.startsWith(`#`)?e.hash.slice(1):e.hash)}function tn(e){let t=en(e).get($t)?.trim()??``;if(t.length>0)return t;let n=e.searchParams.get($t)?.trim()??``;return n.length>0?n:null}function nn(e){let t=new URL(e.toString()),n=en(t);return n.has($t)&&(n.delete($t),t.hash=n.toString()),t.searchParams.delete($t),t}function rn(e,t){let n=new URL(e.toString());return n.searchParams.delete($t),n.hash=new URLSearchParams([[$t,t]]).toString(),n}function an(e,t){let n=new URL(e);return n.pathname=`/login`,rn(n,t).toString()}function cee(e){return rn(new URL(`/login`,window.location.href),e).toString()}var lee=`host`;function uee(e){let t=new URL(e),n=tn(t),r=new URL(`forge:///pair`);return r.searchParams.set(lee,t.origin),n&&r.searchParams.set($t,n),r.toString()}var on=`/api/cmmd/auth-runtime`;function dee(e){return O({method:`POST`,path:on},e)}function fee(e){return O({method:`GET`,path:on},e)}function pee(e){return O({method:`DELETE`,path:on},e)}function mee(e){return O({method:`POST`,path:`${on}/connect`},e)}function hee(e,t){return O({method:`GET`,path:`/api/cmmd/billing`,...t?.organizationId===void 0?{}:{query:{orgId:t.organizationId}}},e)}function gee(e,t){return O({method:`GET`,path:`/api/cmmd/billing/series`,query:{timeZone:t.timeZone}},e)}function _ee(e,t){return O({method:`GET`,path:`/api/cmmd/bootstrap`,...t?.organizationId===void 0?{}:{query:{orgId:t.organizationId}}},e)}var sn=`/api/cmmd/providers/codex/credential`,cn=`/api/cmmd/providers/claude/credential`;function vee(e){return O({method:`GET`,path:sn},e)}function yee(e){return O({method:`DELETE`,path:sn},e)}function bee(e){return O({method:`GET`,path:cn},e)}function xee(e){return O({method:`DELETE`,path:cn},e)}function See(e,t){return O({method:`DELETE`,path:`/api/cmmd/providers/accounts/${encodeURIComponent(String(t))}`},e)}function Cee(e,t,n){return`/api/cmmd/threads/${encodeURIComponent(e)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/disposition`}function wee(e,t,n,r,i){return O({method:`PUT`,path:Cee(t,n,r),body:i},e)}function Tee(e){return(t,n,r,i)=>wee(e,t,n,r,i)}function ln(e,t=``){return`/api/cmmd/thread-attachments/${encodeURIComponent(e)}${t}`}function Eee(e){return{async listThreadAttachments(t){return O({method:`GET`,path:ln(t)},e)},async uploadThreadAttachment(t,n,r,i){let a=new FormData;return a.append(`file`,n),r!==void 0&&a.append(`attachmentId`,r),O({method:`POST`,path:ln(t),form:a,...i===void 0?{}:{signal:i}},e)},async getThreadAttachmentDownloadUrl(t,n){return O({method:`GET`,path:ln(t,`/${encodeURIComponent(n)}/download`)},e)},async deleteThreadAttachment(t,n){await O({method:`DELETE`,path:ln(t,`/${encodeURIComponent(n)}`)},e)}}}var Dee=class extends Error{constructor(e){super(e),this.name=`CmmdApiAuthError`}},Oee=class extends Error{status;constructor(e,t){super(e),this.name=`CmmdApiServerError`,this.status=t}};async function un(e){try{return await e}catch(e){throw e instanceof be?e.kind===`auth`?new Dee(e.message):new Oee(e.message,e.status??502):e}}function dn(e,t,n){return`/api/cmmd/threads/${encodeURIComponent(e)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/archive`}function fn(e,t,n,r,i){return O({method:`POST`,path:dn(t,n,r),body:i},e)}function kee(e){return(t,n,r,i)=>fn(e,t,n,r,i)}function pn(e){return typeof e==`object`&&!!e&&`status`in e&&e.status===409}async function mn(e){let t={action:e.action,...e.operationId===void 0?{}:{operationId:e.operationId},expectedRevision:e.expectedRevision,force:e.force};try{return await e.submit(t)}catch(n){if(!pn(n))throw n;let r=await e.refresh();return e.submit({...t,expectedRevision:r.revision})}}function hn(e){return{getForgeAccountPreferences:()=>O({method:`GET`,path:`/api/cmmd/account/preferences`},e),updateForgeAccountPreferences:t=>O({method:`PATCH`,path:`/api/cmmd/account/preferences`,body:t},e),getUserSettings:t=>O({method:`GET`,path:`/api/cmmd/user/settings/${t}`},e),putUserSettings:(t,n)=>O({method:`PUT`,path:`/api/cmmd/user/settings/${t}`,body:n},e)}}function gn(e,t,n){return O({method:`POST`,path:`/api/cmmd/forge-runtimes/${encodeURIComponent(t)}/rename`,body:{displayName:n}},e)}function _n(e,t,n){return O({method:`POST`,path:`/api/cmmd/devices/${encodeURIComponent(String(t))}/rename`,body:{displayName:n}},e)}function vn(e,t){return O({method:`POST`,path:`/api/cmmd/devices/${encodeURIComponent(String(t))}/revoke`},e)}function yn(e){return{...e?.projectId===void 0?{}:{projectId:String(e.projectId)},...e?.allWorkspaces===!0?{allWorkspaces:`true`}:{},...e?.organizationId===void 0?{}:{orgId:String(e.organizationId)}}}var bn=`rt-demo`,xn=`th-demo`,Sn=`example-project`,Aee=`example-conversation`,Cn=`2026-09-26T20:00:00.000Z`;function jee(e,t){return e===bn&&t===xn}function Mee(){return{runtime:{id:bn,source:`forge-cloud`,runtimeKind:`cloud-vm`,displayName:`Example Forge Server`,status:`online`,endpointUrl:null,hostId:null,deviceId:null,workspaceRoot:null,githubRepoFullName:null,lastSeenAt:Cn,reachability:{status:`online`,lastReachableAt:Cn,source:`cloud-runtime`},metadata:null},inventoryStatus:`synced`,inventoryPublishedAt:Cn,projectCount:1,threadCount:1,projects:[{projectId:Sn,title:`Example project`,workspaceRoot:null,githubRepoFullName:null,branch:null,status:`active`,threadCount:1,lastActivityAt:Cn,metadata:null,publishedAt:Cn,updatedAt:Cn,threads:[{threadId:xn,title:`Example thread (viewer check)`,status:`active`,model:null,provider:null,providerAccountId:null,branch:null,lastMessagePreview:null,lastActivityAt:Cn,kind:`master`,parentThreadId:null,workerRole:null,anchorKind:`scratch`,anchorCmmdId:null,archive:null,disposition:{manualDisposition:null,automaticDisposition:null,effectiveDisposition:null,revision:null,source:null},metadata:null,publishedAt:Cn,updatedAt:Cn}]}]}}function Nee(){return{conversationId:Aee,runtime:{id:bn,source:`forge-cloud`,runtimeKind:`cloud-vm`,displayName:`Example Forge Server`,status:`online`,endpointUrl:null,deviceId:null,workspaceRoot:null,githubRepoFullName:null,lastSeenAt:Cn,metadata:null},project:{projectId:Sn,title:`Example project`,githubRepoFullName:null,branch:null},thread:{threadId:xn,title:`Example thread (viewer check)`,status:`active`,model:null,provider:null,providerAccountId:null,branch:null,lastActivityAt:Cn,metadata:null},reachability:`online`,execution:{available:!0,reason:null},replication:null,events:[{sequence:1,eventId:`example-user-1`,kind:`user_message`,turnId:null,text:`This is an example chat thread for verifying the Forge embed viewer. It is not a live Work Session.`,status:null,occurredAt:`2026-09-26T19:58:00.000Z`},{sequence:2,eventId:`example-assistant-1`,kind:`assistant_message`,turnId:null,text:`Understood. You should see this reply in the iframe under CMMD /forge, with the composer still available below.`,status:null,occurredAt:`2026-09-26T19:59:00.000Z`},{sequence:3,eventId:`example-user-2`,kind:`user_message`,turnId:null,text:`Thanks. If these three turns render, the thread wire is working.`,status:null,occurredAt:Cn}]}}function Pee(e){return e.runtimes.some(e=>e.runtime.id===bn)?{...e,runtimes:[...e.runtimes]}:{...e,runtimes:[...e.runtimes,Mee()]}}function A(e,t){if(!e||typeof e!=`object`)return null;let n=e[t];return typeof n==`string`&&n.trim().length>0?n.trim():null}function Fee(e,t){if(!e||typeof e!=`object`)return null;let n=e[t];return typeof n==`boolean`?n:null}function wn(e,t){if(!e||typeof e!=`object`)return null;let n=e[t];return typeof n==`string`&&n.trim().length>0?n.trim():typeof n==`number`&&Number.isFinite(n)?String(n):null}function Tn(e){return{...e.limit===void 0?{}:{limit:e.limit},...e.cursor?{cursor:e.cursor}:{}}}var En=class extends Error{constructor(e){super(`CmmdApiClient.${e} is not implemented yet`),this.name=`CmmdApiNotImplementedError`}};function Dn(e,t){if(Array.isArray(e))return e;if(e&&typeof e==`object`){let n=e[t];if(Array.isArray(n))return n}return[]}function On(e,t){if(Array.isArray(e))return e;if(e&&typeof e==`object`){let n=e[t];if(Array.isArray(n))return n}return[]}function kn(e,t){let n={};return e?.organizationId&&(n.orgId=e.organizationId),t!==void 0&&(n.taskId=String(t)),Object.keys(n).length>0?n:void 0}function An(e){let t=`${A(e,`firstName`)??``} ${A(e,`lastName`)??``}`.trim()||A(e,`username`)||A(e,`email`)||`Unknown`;return{id:wn(e,`userId`)??wn(e,`id`)??t,name:t,email:A(e,`email`),role:A(e,`role`),avatarUrl:A(e,`profileImage`)??A(e,`avatar`)}}function jn(e){let t=Pn(e,`user`)??e;return An({...typeof t==`object`&&t?t:{},userId:wn(e,`userId`)??wn(t,`id`),role:A(e,`role`)})}function Mn(e){let t=A(e,`authorFirstName`)??``,n=A(e,`authorLastName`)??``,r=A(e,`status`),i=r===`at_risk`||r===`off_track`||r===`complete`?r:`on_track`;return{id:wn(e,`id`)??``,status:i,body:A(e,`body`)??``,authorName:`${t} ${n}`.trim()||null,authorAvatarUrl:A(e,`authorProfileImage`)??null,createdAt:A(e,`createdAt`)??``,updatedAt:A(e,`updatedAt`)??A(e,`createdAt`)??``,canEdit:Fee(e,`canEdit`)??!1}}function Nn(e,t,n){let r=Array.isArray(e.data)?e.data.map(Mn):[];return{updates:r,pagination:e.pagination??{page:t,limit:n,total:r.length,hasMore:!1}}}function Pn(e,t){if(!e||typeof e!=`object`)return null;let n=e[t];return n&&typeof n==`object`?n:null}var Fn=[`avatarUrl`,`avatar_url`,`profileImage`,`profile_image`,`profileImageUrl`,`profile_image_url`,`image`,`imageUrl`,`image_url`,`picture`];function In(e,t){let n=Pn(e,t);if(!n)return null;for(let e of Fn){let t=A(n,e);if(t)return t}return null}function Ln(e,t){let n=Pn(e,t);return n?wn(n,`id`):null}function Rn(e,t){return!!(e&&typeof e==`object`&&Object.hasOwn(e,t))}function zn(e){let t={...e,id:wn(e,`id`)??e.id,title:e.title??A(e,`name`)??``},n=wn(e,`workspaceId`)??wn(e,`workspace_id`)??Ln(e,`workspace`)??e.workspaceId??null;return n!==null||Rn(e,`workspaceId`)?{...t,workspaceId:n,startDate:e.startDate??A(e,`start_date`)??null,endDate:e.endDate??A(e,`end_date`)??null}:t}function Bn(e){let t=e.ownerAvatarUrl??A(e,`owner_avatar_url`)??A(e,`ownerProfileImage`)??A(e,`owner_profile_image`)??A(e,`ownerImage`)??A(e,`owner_image`)??A(e,`ownerImageUrl`)??A(e,`owner_image_url`)??A(e,`createdByAvatarUrl`)??A(e,`created_by_avatar_url`)??A(e,`createdByProfileImage`)??A(e,`created_by_profile_image`)??In(e,`owner`)??In(e,`createdBy`)??In(e,`created_by`)??null,n={...e,id:wn(e,`id`)??e.id},r=wn(e,`campaignId`)??wn(e,`campaign_id`)??Ln(e,`campaign`)??e.campaignId??null;(r!==null||Rn(e,`campaignId`))&&(n.campaignId=r);let i=e.campaignTitle??A(e,`campaignTitle`)??A(e,`campaign_title`)??A(Pn(e,`campaign`),`title`)??A(Pn(e,`campaign`),`name`)??null;(i!==null||Rn(e,`campaignTitle`))&&(n.campaignTitle=i);let a=wn(e,`workspaceId`)??wn(e,`workspace_id`)??Ln(e,`workspace`)??e.workspaceId??null;(a!==null||Rn(e,`workspaceId`))&&(n.workspaceId=a);let o=e.workspaceName??A(e,`workspace_name`)??A(Pn(e,`workspace`),`name`)??null;(o!==null||Rn(e,`workspaceName`))&&(n.workspaceName=o);let s=A(e,`workspaceIconUrl`)??A(e,`workspace_icon_url`)??A(Pn(e,`workspace`),`iconUrl`)??null;(s!==null||Rn(e,`workspaceIconUrl`))&&(n.workspaceIconUrl=s);let c=wn(e,`ownerId`)??wn(e,`owner_id`)??Ln(e,`owner`)??e.ownerId??null;(c!==null||Rn(e,`ownerId`))&&(n.ownerId=c);let l=e.ownerName??A(e,`owner_name`)??A(Pn(e,`owner`),`name`)??null;(l!==null||Rn(e,`ownerName`))&&(n.ownerName=l),(t!==null||Rn(e,`ownerAvatarUrl`))&&(n.ownerAvatarUrl=t);let u=wn(e,`teamId`)??wn(e,`team_id`)??Ln(e,`team`)??e.teamId??null;(u!==null||Rn(e,`teamId`))&&(n.teamId=u);let d=e.teamName??A(e,`team_name`)??A(Pn(e,`team`),`name`)??null;(d!==null||Rn(e,`teamName`))&&(n.teamName=d);let f=e.startDate??A(e,`start_date`)??null;(f!==null||Rn(e,`startDate`))&&(n.startDate=f);let p=e.targetEndDate??A(e,`target_end_date`)??null;return(p!==null||Rn(e,`targetEndDate`))&&(n.targetEndDate=p),n}function Vn(e){if(Array.isArray(e))return e;if(e&&typeof e==`object`){let t=e;if(Array.isArray(t.items))return t.items;if(Array.isArray(t.results))return t.results}return[]}function Hn(e){return Vn(e).flatMap(e=>{let t=e,n=typeof t.id==`number`?t.id:null,r=typeof t.name==`string`?t.name:null;if(n===null||r===null)return[];let i=e=>typeof t[e]==`string`?t[e]:null;return[{id:n,name:r,startDate:i(`startDate`),endDate:i(`endDate`),status:i(`status`)}]})}function Un(e){if(e&&typeof e==`object`){let t=e;if(t.project&&typeof t.project==`object`)return t.project}return e}function Wn(e){if(e===null||e.trim()===``)return null;let t=Number(e);return Number.isSafeInteger(t)?t:e}var Gn=class e{cfg;putThreadDisposition;listThreadAttachments;uploadThreadAttachment;getThreadAttachmentDownloadUrl;deleteThreadAttachment;postThreadArchive;getForgeAccountPreferences;updateForgeAccountPreferences;getUserSettings;putUserSettings;commentEditIdempotencyKeys=new Map;commentDeleteIdempotencyKeys=new Map;constructor(e={}){let t=e.forgeOrigin===void 0,n=e.forgeOrigin??`http://localhost:13773`;this.cfg={resolveUrl:t?ae:e=>`${n}${e}`,maxRetries:e.maxRetries??3,onAuthExpired:e.onAuthExpired??pe,...t?{resolveBearerToken:()=>ce()?.bearerToken??null}:{}},this.putThreadDisposition=Tee(this.cfg);let r=Eee(this.cfg);this.listThreadAttachments=r.listThreadAttachments,this.uploadThreadAttachment=r.uploadThreadAttachment,this.getThreadAttachmentDownloadUrl=r.getThreadAttachmentDownloadUrl,this.deleteThreadAttachment=r.deleteThreadAttachment,this.postThreadArchive=kee(this.cfg);let i=hn(this.cfg);this.getForgeAccountPreferences=i.getForgeAccountPreferences,this.updateForgeAccountPreferences=i.updateForgeAccountPreferences,this.getUserSettings=i.getUserSettings,this.putUserSettings=i.putUserSettings}async getTask(e){return un(O({method:`GET`,path:`/api/cmmd/tasks/${e}`},this.cfg))}async getForgeTaskDetail(e){return O({method:`GET`,path:`/api/cmmd/tasks/${e}`},this.cfg)}async searchTasks(e){let t={q:e.q};return e.status&&(t.status=e.status),e.limit!==void 0&&(t.limit=e.limit),e.projectId&&(t.projectId=e.projectId),(await un(O({method:`GET`,path:`/api/cmmd/tasks/search`,query:t},this.cfg))).tasks??[]}async getTaskComments(e){return(await un(O({method:`GET`,path:`/api/cmmd/tasks/${e}/comments`},this.cfg))).comments??[]}async listProjectTaskComments(e){return(await un(O({method:`GET`,path:`/api/cmmd/tasks/${e}/comments`},this.cfg))).comments??[]}async createProjectTaskComment(e,t){return(await un(O({method:`POST`,path:`/api/cmmd/tasks/comment`,body:{taskId:e,content:t.content}},this.cfg))).details}async updateProjectTaskComment(e,t,n){return(await un(O({method:`PATCH`,path:`/api/cmmd/tasks/${e}/comments/${encodeURIComponent(t)}`,body:n},this.cfg))).comment}async deleteProjectTaskComment(e,t,n){return un(O({method:`DELETE`,path:`/api/cmmd/tasks/${e}/comments/${encodeURIComponent(t)}`,body:n},this.cfg))}async getTaskAttachments(e){return un(O({method:`GET`,path:`/api/cmmd/tasks/${e}/attachments`},this.cfg))}async getProjectRepository(e){return un(O({method:`GET`,path:`/api/cmmd/projects/${e}/repository`},this.cfg))}async listProjectRepositories(e){return(await un(O({method:`GET`,path:`/api/cmmd/projects/${e}/repositories`},this.cfg))).repositories}async getWorkspaceMembers(e){return un(O({method:`GET`,path:`/api/cmmd/organizations/${e}/members`},this.cfg))}async getWebSocketToken(e){return O({method:`GET`,path:`/api/cmmd/ws-token`,...e?.signal===void 0?{}:{signal:e.signal}},this.cfg)}async getProjectComments(e,t){let n={};return t?.organizationId&&(n.organizationId=t.organizationId),(await O({method:`GET`,path:`/api/cmmd/projects/${e}/comments`,query:n},this.cfg))?.comments??[]}async getProjectLink(e){return O({method:`GET`,path:`/.well-known/forge/project-link`,query:{environmentId:e.environmentId,projectId:e.projectId,cwd:e.cwd}},this.cfg)}async listProjectLinks(){return O({method:`GET`,path:`/.well-known/forge/project-links`,suppressBearerToken:!0},this.cfg)}async listProjectContextLinks(e){let t={};e.environmentId&&(t.forgeEnvironmentId=e.environmentId),e.projectId&&(t.forgeProjectId=e.projectId),e.githubRepoFullName&&(t.githubRepoFullName=e.githubRepoFullName),e.cmmdOrganizationId&&(t.cmmdOrganizationId=e.cmmdOrganizationId);let n=await O({method:`GET`,path:`/.well-known/forge/cmmd/project-links`,query:t},this.cfg),r=f(l)(n);return r._tag===`Some`?r.value.links:[]}async listCmmdWorkspaces(){return Vn(await O({method:`GET`,path:`/.well-known/forge/cmmd/workspaces`},this.cfg))}async listCmmdCampaigns(e){return Hn(await O({method:`GET`,path:`/.well-known/forge/cmmd/campaigns`,query:{workspaceId:e.workspaceId}},this.cfg))}async listCmmdProjects(e){return Vn(await O({method:`GET`,path:`/.well-known/forge/cmmd/projects`,query:{campaignId:e.campaignId}},this.cfg))}async updateTask(e,t){let n={taskId:e};return t.title!==void 0&&(n.title=t.title),t.description!==void 0&&(n.description=t.description),t.status!==void 0&&(n.status=t.status),t.priority!==void 0&&(n.priority=t.priority),t.dueDate!==void 0&&(n.dueDate=t.dueDate),t.assigneeId!==void 0&&(n.assigneeId=t.assigneeId),t.labels!==void 0&&(n.labels=t.labels),un(O({method:`POST`,path:`/api/cmmd/tasks/update`,body:n},this.cfg))}async createComment(e){return un(O({method:`POST`,path:`/api/cmmd/tasks/comment`,body:{taskId:e.entityId,content:e.content}},this.cfg))}async updateComment(e,t,n){let r=`${e}:${t}:${n}`,i=this.commentEditIdempotencyKeys.get(r)??crypto.randomUUID();this.commentEditIdempotencyKeys.set(r,i);let a=await un(O({method:`PATCH`,path:`/api/cmmd/tasks/${e}/comments/${t}`,body:{content:n,idempotencyKey:i}},this.cfg));return this.commentEditIdempotencyKeys.delete(r),a}async deleteComment(e,t){let n=`${e}:${t}`,r=this.commentDeleteIdempotencyKeys.get(n)??crypto.randomUUID();this.commentDeleteIdempotencyKeys.set(n,r),await un(O({method:`DELETE`,path:`/api/cmmd/tasks/${e}/comments/${t}`,body:{idempotencyKey:r}},this.cfg)),this.commentDeleteIdempotencyKeys.delete(n)}async createProjectComment(e,t){let n=(await O({method:`POST`,path:`/api/cmmd/projects/${e}/comments`,body:{content:t.content,organizationId:t.organizationId??null}},this.cfg))?.comment;if(!n)throw new be({kind:`server`,message:`CMMD did not return the created project comment.`});return n}async updateProject(e,t){let n={};for(let e of h){let r=t[e];r!==void 0&&(n[e]=x[e]===`nullableId`?Wn(r):r)}await O({method:`PATCH`,path:`/api/cmmd/projects/${e}`,body:n},this.cfg)}async setProjectLink(e){await O({method:`POST`,path:`/.well-known/forge/project-link`,body:e},this.cfg)}async deleteProjectLink(e){await O({method:`DELETE`,path:`/.well-known/forge/project-link`,query:{environmentId:e.environmentId,projectId:e.projectId,cwd:e.cwd,...e.cmmdProjectId?{cmmdProjectId:e.cmmdProjectId}:{}}},this.cfg)}async createCmmdProject(e){return O({method:`POST`,path:`/.well-known/forge/cmmd/projects`,body:e},this.cfg)}async ensureGitHubProjectContext(e){return O({method:`POST`,path:`/.well-known/forge/cmmd/github-project-contexts/ensure`,body:e},this.cfg)}async createBrainDoc(e){return O({method:`POST`,path:`/api/cmmd/brain-docs`,body:e},this.cfg)}async uploadTaskAttachment(e,t){let n=new FormData;return n.append(`file`,t),un(O({method:`POST`,path:`/api/cmmd/tasks/${e}/attachments`,form:n},this.cfg))}async archiveTask(e){await O({method:`POST`,path:`/api/cmmd/tasks/${e}/archive`},this.cfg)}async unarchiveTask(e){await O({method:`POST`,path:`/api/cmmd/tasks/${e}/unarchive`},this.cfg)}async getProfile(){return O({method:`GET`,path:`/api/cmmd/profile`},this.cfg)}async getUsageSummary(e){return O({method:`GET`,path:`/api/cmmd/usage/summary`,query:{sinceDay:e.sinceDay,untilDay:e.untilDay,timeZone:e.timeZone,...e.resolution===`hour`?{resolution:e.resolution,sinceTime:e.sinceTime,untilTime:e.untilTime}:{}}},this.cfg)}getBilling(e){return hee(this.cfg,e)}getBillingSeries(e){return gee(this.cfg,e)}getBootstrap(e){return _ee(this.cfg,e)}async getOrgProviderPolicy(){return O({method:`GET`,path:`/api/cmmd/org/provider-policy`},this.cfg)}async listSavedDataViews(e){return O({method:`GET`,path:`/api/cmmd/saved-views`,query:{surface:e.surface,projectId:e.projectId}},this.cfg)}async createSavedDataView(e){return O({method:`POST`,path:`/api/cmmd/saved-views`,body:e},this.cfg)}async importSavedDataView(e){return O({method:`POST`,path:`/api/cmmd/saved-views/import`,body:e},this.cfg)}async updateSavedDataView(e,t){return O({method:`PATCH`,path:`/api/cmmd/saved-views/${encodeURIComponent(e)}`,body:t},this.cfg)}async deleteSavedDataView(e,t){return O({method:`DELETE`,path:`/api/cmmd/saved-views/${encodeURIComponent(e)}`,query:t},this.cfg)}async getDeviceRegistry(e){return O({method:`GET`,path:`/api/cmmd/devices`,...e?.projectId===void 0?{}:{query:{projectId:String(e.projectId)}},...e?.signal===void 0?{}:{signal:e.signal}},this.cfg)}async registerDevice(e){return O({method:`POST`,path:`/api/cmmd/devices/register`,body:e},this.cfg)}async grantRuntimeAccess(e,t){return O({method:`POST`,path:`/api/cmmd/devices/runtimes/${encodeURIComponent(e)}/access-grants`,body:t},this.cfg)}async revokeRuntimeAccess(e,t){return O({method:`POST`,path:`/api/cmmd/devices/runtimes/${encodeURIComponent(e)}/access-grants/${encodeURIComponent(String(t))}/revoke`},this.cfg)}async issueRelayControlRoute(e,t){return O({method:`POST`,path:`/api/cmmd/devices/runtimes/${encodeURIComponent(e)}/relay-routes`,body:t},this.cfg)}async issueRelayActionGrant(e,t){return O({method:`POST`,path:`/api/cmmd/devices/runtimes/${encodeURIComponent(e)}/relay-action-grants`,body:t},this.cfg)}async getRuntimeInventory(e){let t=yn(e);return Pee(await O({method:`GET`,path:`/api/cmmd/runtime-inventory`,...Object.keys(t).length>0?{query:t}:{}},this.cfg))}async getRuntimeDiagnostics(e){return O({method:`GET`,path:`/api/cmmd/runtime-diagnostics/v2/runtimes/${encodeURIComponent(e)}`},this.cfg)}async getCloudProjectLifecyclePreflight(e){return(await O({method:`GET`,path:`/api/cmmd/forge-cloud-projects/${encodeURIComponent(String(e))}/lifecycle-preflight`},this.cfg)).preflight}async replaceRuntimeInventory(e,t){return O({method:`PUT`,path:`/api/cmmd/devices/runtimes/${encodeURIComponent(e)}/inventory`,body:t},this.cfg)}static PROVIDER_ACCOUNTS_PATH=`/api/cmmd/providers/accounts`;static PROVIDER_USAGE_PATH=`/api/cmmd/providers/usage`;static PROVIDER_USAGE_REFRESH_PATH=`/api/cmmd/providers/usage/refresh`;provisionAuthRuntime(){return dee(this.cfg)}getAuthRuntimeState(){return fee(this.cfg)}destroyAuthRuntime(){return pee(this.cfg)}connectAuthRuntime(){return mee(this.cfg)}getUserCodexCredential(){return vee(this.cfg)}disconnectUserCodexCredential(){return yee(this.cfg)}getUserClaudeCredential(){return bee(this.cfg)}async getProviderAccounts(){return O({method:`GET`,path:e.PROVIDER_ACCOUNTS_PATH},this.cfg)}async removeLinkedProviderAccount(e){return See(this.cfg,e)}async setProviderAccountDefault(t){return O({method:`PUT`,path:`${e.PROVIDER_ACCOUNTS_PATH}/default`,body:{provider:t.provider,provider_account_id:t.providerAccountId}},this.cfg)}async getProviderUsage(){return O({method:`GET`,path:e.PROVIDER_USAGE_PATH},this.cfg)}async refreshProviderUsage(t,n){return O({method:`POST`,path:e.PROVIDER_USAGE_REFRESH_PATH,body:{provider:t,providerAccountId:n}},this.cfg)}disconnectUserClaudeCredential(){return xee(this.cfg)}async getClaudeRuntimeReadiness(e){return O({method:`GET`,path:`/api/cmmd/providers/claude/runtime-readiness/${encodeURIComponent(e)}`},this.cfg)}async appendRuntimeThreadEvents(e,t,n){return O({method:`POST`,path:`/api/cmmd/devices/runtimes/${encodeURIComponent(e)}/threads/${encodeURIComponent(t)}/events`,body:n},this.cfg)}async getRuntimeThreadReplica(e,t){return jee(e,t)?Nee():O({method:`GET`,path:`/api/cmmd/threads/${encodeURIComponent(e)}/${encodeURIComponent(t)}`},this.cfg)}renameCloudEnvironment(e,t){return gn(this.cfg,e,t)}renameDevice(e,t){return _n(this.cfg,e,t)}revokeDevice(e){return vn(this.cfg,e)}static SIM_PATH=`/api/cmmd/sim-host`;static simScope(e){return e?.orgId===void 0?``:`?orgId=${encodeURIComponent(String(e.orgId))}`}async listSimHosts(t){return O({method:`GET`,path:`${e.SIM_PATH}/hosts${e.simScope(t)}`},this.cfg)}async getSimLease(t){let n=new URLSearchParams({forgeEnvironmentId:t.forgeEnvironmentId,threadId:t.threadId,...t.orgId===void 0?{}:{orgId:String(t.orgId)}});return O({method:`GET`,path:`${e.SIM_PATH}/leases?${n.toString()}`},this.cfg)}async claimSimLease(t){return O({method:`POST`,path:`${e.SIM_PATH}/leases${e.simScope(t)}`,body:{hostId:t.hostId,forgeEnvironmentId:t.forgeEnvironmentId,threadId:t.threadId,ttlMs:t.ttlMs}},this.cfg)}async renewSimLease(t){return O({method:`POST`,path:`${e.SIM_PATH}/leases/${encodeURIComponent(String(t.leaseId))}/renew${e.simScope(t)}`,body:{generation:t.generation,rowVersion:t.rowVersion,ttlMs:t.ttlMs}},this.cfg)}async releaseSimLease(t){await O({method:`POST`,path:`${e.SIM_PATH}/leases/${encodeURIComponent(String(t.leaseId))}/release${e.simScope(t)}`,body:{generation:t.generation,rowVersion:t.rowVersion}},this.cfg)}async listCampaigns(e){let t={};return e?.orgId&&(t.orgId=e.orgId),e?.allWorkspaces&&(t.allWorkspaces=`true`),Dn(await O({method:`GET`,path:`/api/cmmd/campaigns`,query:t,...e?.signal?{signal:e.signal}:{}},this.cfg),`campaigns`).map(zn)}async getCampaign(e){return O({method:`GET`,path:`/api/cmmd/campaigns/${e}`},this.cfg)}async createCampaign(e){return O({method:`POST`,path:`/api/cmmd/campaigns`,body:e},this.cfg)}async updateCampaign(e,t){return O({method:`PUT`,path:`/api/cmmd/campaigns/${e}`,body:t},this.cfg)}async deleteCampaign(e){await O({method:`DELETE`,path:`/api/cmmd/campaigns/${e}`},this.cfg)}async listProjects(e){let t={};return e?.campaignId&&(t.campaignId=e.campaignId),e?.orgId&&(t.orgId=e.orgId),e?.allWorkspaces&&(t.allWorkspaces=`true`),Dn(await O({method:`GET`,path:`/api/cmmd/projects`,query:t,...e?.signal?{signal:e.signal}:{}},this.cfg),`projects`).map(Bn)}async listTasks(e){let t={};return e?.projectId&&(t.projectId=e.projectId),e?.status&&(t.status=e.status),O({method:`GET`,path:`/api/cmmd/tasks`,query:t},this.cfg)}async getProject(e){return Bn(await O({method:`GET`,path:`/api/cmmd/projects/${e}`},this.cfg))}async getProjectMembers(e){let t=await O({method:`GET`,path:`/api/cmmd/projects/${e}/members`},this.cfg);return Array.isArray(t)?t.map(An):[]}async listWorkspaceMembers(){let e=await O({method:`GET`,path:`/api/cmmd/members`},this.cfg);return Array.isArray(e)?e.map(jn):[]}async addProjectMember(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/members`,body:t},this.cfg)}async listProjectAgentMembers(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/agent-members`},this.cfg)}async createProjectAgentMember(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/agent-members`,body:t},this.cfg)}async renameProjectAgentMember(e,t,n){return O({method:`PATCH`,path:`/api/cmmd/projects/${e}/agent-members/${t}`,body:n},this.cfg)}async retireProjectAgentMember(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/agent-members/${t}/retire`,body:n},this.cfg)}async updateProjectAgentMemberAvatar(e,t,n){return O({method:`PUT`,path:`/api/cmmd/projects/${e}/agent-members/${t}/avatar`,body:n},this.cfg)}async listProjectAgentMemberInstances(e,t){return O({method:`GET`,path:`/api/cmmd/projects/${e}/agent-members/${t}/instances`},this.cfg)}async previewProjectAgentMemberConsolidation(e){return O({method:`POST`,path:`/api/cmmd/projects/${e}/agent-members/consolidation/preview`},this.cfg)}async applyProjectAgentMemberConsolidation(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/agent-members/consolidation/apply`,body:t},this.cfg)}async setProjectTaskAssignment(e,t,n){return O({method:`PUT`,path:`/api/cmmd/projects/${e}/tasks/${t}/assignment`,body:n},this.cfg)}async getProjectUpdates(e,t){let n=t?.page??1,r=t?.limit??10;return Nn(await O({method:`GET`,path:`/api/cmmd/projects/${e}/updates`,query:{page:n,limit:r},unwrapEnvelope:!1},this.cfg),n,r)}async createProjectUpdate(e,t){return Mn(await O({method:`POST`,path:`/api/cmmd/projects/${e}/updates`,body:t},this.cfg))}async updateProjectUpdate(e,t,n){return Mn(await O({method:`PATCH`,path:`/api/cmmd/projects/${e}/updates/${t}`,body:n},this.cfg))}async deleteProjectUpdate(e,t){await O({method:`DELETE`,path:`/api/cmmd/projects/${e}/updates/${t}`},this.cfg)}async listProjectMilestones(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/milestones`},this.cfg)}async createProjectMilestone(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/milestones`,body:t},this.cfg)}async updateProjectMilestone(e,t,n){return O({method:`PATCH`,path:`/api/cmmd/projects/${e}/milestones/${t}`,body:n},this.cfg)}async deleteProjectMilestone(e,t){await O({method:`DELETE`,path:`/api/cmmd/projects/${e}/milestones/${t}`},this.cfg)}async improveProjectContent(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/content/readability`,body:t},this.cfg)}async listProjectBoard(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/board`},this.cfg)}async createProjectTaskDraft(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/task-drafts`,body:t},this.cfg)}async getProjectTaskDraft(e,t){return O({method:`GET`,path:`/api/cmmd/projects/${e}/task-drafts/${t}`},this.cfg)}async updateProjectTaskDraft(e,t,n){return O({method:`PATCH`,path:`/api/cmmd/projects/${e}/task-drafts/${t}`,body:n},this.cfg)}async previewProjectTaskDraft(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/task-drafts/${t}/preview`,body:n},this.cfg)}async commitProjectTaskDraft(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/task-drafts/${t}/commit`,body:n},this.cfg)}async discardProjectTaskDraft(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/task-drafts/${t}/discard`,body:n},this.cfg)}async getProjectTaskWorkflow(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/task-workflow`},this.cfg)}async updateProjectTaskWorkflow(e,t){return O({method:`PUT`,path:`/api/cmmd/projects/${e}/task-workflow`,body:t},this.cfg)}async getProjectLeadPlan(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/project-lead/plan`},this.cfg)}async activateProjectLeadAutomaticStaffing(e){return O({method:`POST`,path:`/api/cmmd/projects/${e}/project-lead/authority/activate`,body:{}},this.cfg)}async getProjectLeadReadiness(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/project-lead/readiness`},this.cfg)}async getProjectLeadCapabilities(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/project-lead/capabilities`},this.cfg)}async getProjectLeadSummary(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/project-lead/summary`},this.cfg)}async getProjectLeadDetail(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/project-lead/detail`},this.cfg)}async getProjectLeadBriefing(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/project-lead/briefing`},this.cfg)}async decideProjectLeadApproval(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/project-lead/approvals/${t}/decision`,body:n},this.cfg)}async listProjectLeadEvents(e,t){return O({method:`GET`,path:`/api/cmmd/projects/${e}/project-lead/events`,...t?{query:{...t.afterEventId===void 0?{}:{afterEventId:String(t.afterEventId)},...t.latest===void 0?{}:{latest:String(t.latest)},...t.limit===void 0?{}:{limit:String(t.limit)}}}:{}},this.cfg)}async explainProjectLead(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/project-lead/explain`},this.cfg)}async pauseProjectLead(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/project-lead/pause`,body:t},this.cfg)}async resumeProjectLead(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/project-lead/resume`,body:t},this.cfg)}async reserveProjectLeadTask(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/project-lead/tasks/${t}/reservations`,body:n},this.cfg)}async releaseProjectLeadReservation(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/project-lead/reservations/${t}/release`,body:n},this.cfg)}async reconcileProjectLead(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/project-lead/reconcile`,body:t},this.cfg)}async resolveProjectLeadAttention(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/project-lead/attention/${t}/resolve`,body:n},this.cfg)}async listCenterBoard(e){let t={};return e?.status&&(t.status=e.status),e?.workspaceId&&(t.workspaceId=String(e.workspaceId)),e?.campaignId&&(t.campaignId=String(e.campaignId)),e?.ownerId&&(t.ownerId=String(e.ownerId)),e?.includeArchived!==void 0&&(t.includeArchived=e.includeArchived),e?.q&&(t.q=e.q),O({method:`GET`,path:`/api/cmmd/work-items/board`,query:t},this.cfg)}async listForgeAutomationPresets(){return On(await O({method:`GET`,path:`/api/cmmd/automations/presets`},this.cfg),`presets`)}async listUserForgeAutomationRules(){return On(await O({method:`GET`,path:`/api/cmmd/automations/user/rules`},this.cfg),`rules`)}async createUserForgeAutomationRule(e){return O({method:`POST`,path:`/api/cmmd/automations/user/rules`,body:e},this.cfg)}async updateUserForgeAutomationRule(e,t){return O({method:`PATCH`,path:`/api/cmmd/automations/user/rules/${e}`,body:t},this.cfg)}async listUserForgeAutomationRuns(e){return On(await O({method:`GET`,path:`/api/cmmd/automations/user/rules/${e}/runs`},this.cfg),`runs`)}async startUserForgeAutomationRun(e,t){return O({method:`POST`,path:`/api/cmmd/automations/user/rules/${e}/runs`,body:t},this.cfg)}async listForgeAutomationRules(e,t){let n=kn(t);return On(await O({method:`GET`,path:`/api/cmmd/automations/projects/${e}/rules`,...n?{query:n}:{}},this.cfg),`rules`)}async createForgeAutomationRule(e,t,n){let r=kn(n);return O({method:`POST`,path:`/api/cmmd/automations/projects/${e}/rules`,body:t,...r?{query:r}:{}},this.cfg)}async updateForgeAutomationRule(e,t,n,r){let i=kn(r);return O({method:`PATCH`,path:`/api/cmmd/automations/projects/${e}/rules/${t}`,body:n,...i?{query:i}:{}},this.cfg)}async listForgeAutomationRuns(e,t){let n=kn(t,t?.taskId);return On(await O({method:`GET`,path:`/api/cmmd/automations/projects/${e}/runs`,...n?{query:n}:{}},this.cfg),`runs`)}async getForgeAutomationRun(e,t){let n=kn(t);return O({method:`GET`,path:`/api/cmmd/automations/runs/${e}`,...n?{query:n}:{}},this.cfg)}async startForgeAutomationRun(e,t,n,r){let i=kn(r);return O({method:`POST`,path:`/api/cmmd/automations/projects/${e}/tasks/${t}/runs`,body:n,...i?{query:i}:{}},this.cfg)}async retryForgeAutomationRun(e,t,n){let r=kn(n);return O({method:`POST`,path:`/api/cmmd/automations/runs/${e}/retry`,body:t,...r?{query:r}:{}},this.cfg)}async cancelForgeAutomationRun(e,t,n){let r=kn(n);return O({method:`POST`,path:`/api/cmmd/automations/runs/${e}/cancel`,body:t,...r?{query:r}:{}},this.cfg)}async approveForgeAutomationEscalation(e,t,n){let r=kn(n);return O({method:`POST`,path:`/api/cmmd/automations/runs/${e}/escalations/approve`,body:t,...r?{query:r}:{}},this.cfg)}async rejectForgeAutomationEscalation(e,t,n){let r=kn(n);return O({method:`POST`,path:`/api/cmmd/automations/runs/${e}/escalations/reject`,body:t,...r?{query:r}:{}},this.cfg)}async createProjectBoardTask(e,t){let n={title:t.title};return t.description!==void 0&&(n.description=t.description),t.priority!==void 0&&(n.priority=t.priority),t.status!==void 0&&(n.status=t.status),t.workflowStageId!==void 0&&(n.workflowStageId=t.workflowStageId),t.assignee!==void 0&&(n.assignee=t.assignee),t.dueDate!==void 0&&(n.dueDate=t.dueDate),t.workItemType!==void 0&&(n.workItemType=t.workItemType),t.parentTaskId!==void 0&&(n.parentTaskId=t.parentTaskId),t.milestoneId!==void 0&&(n.milestoneId=t.milestoneId),t.dependsOn!==void 0&&(n.dependsOn=t.dependsOn),O({method:`POST`,path:`/api/cmmd/projects/${e}/board`,body:n},this.cfg)}async createCenterBoardTask(e){let t={title:e.title,projectId:e.projectId};return e.description!==void 0&&(t.description=e.description),e.priority!==void 0&&(t.priority=e.priority),e.status!==void 0&&(t.status=e.status),e.assignee!==void 0&&(t.assignee=e.assignee),e.dueDate!==void 0&&(t.dueDate=e.dueDate),e.workItemType!==void 0&&(t.workItemType=e.workItemType),e.parentTaskId!==void 0&&(t.parentTaskId=e.parentTaskId),e.milestoneId!==void 0&&(t.milestoneId=e.milestoneId),e.dependsOn!==void 0&&(t.dependsOn=e.dependsOn),O({method:`POST`,path:`/api/cmmd/work-items/board`,body:t},this.cfg)}async submitFeedback(e){let t={type:e.type,title:e.title,source:e.source};return e.description!==void 0&&(t.description=e.description),e.priority!==void 0&&(t.priority=e.priority),e.senderName!==void 0&&(t.senderName=e.senderName),O({method:`POST`,path:`/api/cmmd/feedback`,body:t},this.cfg)}async updateProjectBoardTask(e,t,n){return O({method:`PATCH`,path:`/api/cmmd/projects/${e}/board/${t}`,body:n},this.cfg)}async updateCenterBoardTask(e,t){return O({method:`PATCH`,path:`/api/cmmd/work-items/board/${e}`,body:t},this.cfg)}async moveCenterBoardTask(e,t){let n={toStatus:t.toStatus};return t.beforeTaskId!==void 0&&(n.beforeTaskId=t.beforeTaskId),t.afterTaskId!==void 0&&(n.afterTaskId=t.afterTaskId),O({method:`PATCH`,path:`/api/cmmd/work-items/board/${e}/move`,body:n},this.cfg)}async moveProjectBoardTask(e,t,n){let r={toStatus:n.toStatus};return n.toStageId!==void 0&&(r.toStageId=n.toStageId),n.beforeTaskId!==void 0&&(r.beforeTaskId=n.beforeTaskId),n.afterTaskId!==void 0&&(r.afterTaskId=n.afterTaskId),O({method:`PATCH`,path:`/api/cmmd/projects/${e}/board/${t}/move`,body:r},this.cfg)}async archiveProjectBoardTask(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/board/${t}/archive`},this.cfg)}async unarchiveProjectBoardTask(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/board/${t}/unarchive`},this.cfg)}async updateProjectBoardTaskStatus(e,t,n,r){return O({method:`PATCH`,path:`/api/cmmd/projects/${e}/board/${t}/status`,body:{status:n,...r?{workflowStageId:r}:{}}},this.cfg)}async listTaskExecutionOptions(e,t){return O({method:`GET`,path:`/api/cmmd/projects/${e}/board/${t}/execution-options`},this.cfg)}async createTaskWorkSession(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/board/${t}/work-sessions`,body:n},this.cfg)}async listProjectWorkSessions(e,t={}){return O({method:`GET`,path:`/api/cmmd/projects/${e}/work-sessions`,query:t},this.cfg)}async getWorkSession(e){return O({method:`GET`,path:`/api/cmmd/work-sessions/${e}`},this.cfg)}async updateWorkSessionStatus(e,t){return O({method:`PATCH`,path:`/api/cmmd/work-sessions/${e}`,body:{status:t}},this.cfg)}async attachWorkSessionThread(e,t){return O({method:`POST`,path:`/api/cmmd/work-sessions/${e}/threads`,body:t},this.cfg)}async listTaskConversations(e,t={}){return O({method:`GET`,path:`/api/cmmd/tasks/${e}/conversations`,query:Tn(t)},this.cfg)}async linkTaskConversation(e,t){return O({method:`POST`,path:`/api/cmmd/tasks/${e}/conversations`,body:t},this.cfg)}async getTaskHistory(e){return O({method:`GET`,path:`/api/cmmd/tasks/${e}/history`},this.cfg)}async upsertTaskPullRequest(e,t){return O({method:`PUT`,path:`/api/cmmd/tasks/${e}/pull-requests`,body:t},this.cfg)}postPullRequest(e,t){return O({method:`POST`,path:`/api/cmmd/pull-requests/${e}`,body:t},this.cfg)}async listPullRequests(e){return this.postPullRequest(`list`,e)}async getPullRequestListStats(e){return this.postPullRequest(`list-stats`,e)}async getPullRequestDetail(e){return this.postPullRequest(`detail`,e)}async getPullRequestActivity(e){return this.postPullRequest(`activity`,e)}async getPullRequestDiff(e){return this.postPullRequest(`diff`,e)}async getPullRequestDiffFileContents(e){return this.postPullRequest(`diff-file-contents`,e)}async getPullRequestThreadComments(e){return this.postPullRequest(`thread/comments`,e)}async getPullRequestReviewerCandidates(e){return this.postPullRequest(`reviewer-candidates`,e)}async runPullRequestAction(e){return this.postPullRequest(`action`,e)}async createPullRequestComment(e){return this.postPullRequest(`comment`,e)}async updatePullRequest(e){return this.postPullRequest(`update`,e)}async updatePullRequestComment(e){return this.postPullRequest(`comment/update`,e)}async submitPullRequestReview(e){return this.postPullRequest(`review`,e)}async replyToPullRequestThread(e){return this.postPullRequest(`thread/reply`,e)}async setPullRequestThreadResolution(e){return this.postPullRequest(`thread/resolution`,e)}async requestPullRequestReviewers(e){return this.postPullRequest(`reviewers`,e)}async setPullRequestReaction(e){return this.postPullRequest(`reaction`,e)}async getTaskConversation(e,t,n={}){return O({method:`GET`,path:`/api/cmmd/tasks/${e}/conversations/${encodeURIComponent(t)}`,query:Tn(n)},this.cfg)}async createTask(e){return O({method:`POST`,path:`/api/cmmd/tasks`,body:e},this.cfg)}async createSubtask(e){throw new En(`createSubtask`)}async createBoardTask(e){throw new En(`createBoardTask`)}async createProject(e){let t={};for(let[n,r]of Object.entries(e))r!=null&&(t[n]=r);return e.campaignId!==void 0&&e.campaignId!==null&&(t.campaignId=Wn(e.campaignId)),e.organizationId!==void 0&&e.organizationId!==null&&(t.organizationId=Wn(e.organizationId)),Un(await O({method:`POST`,path:`/api/cmmd/projects`,body:t},this.cfg))}async moveProject(e,t){let n={targetOrgId:Wn(t.targetOrgId)};return t.campaignStrategy!==void 0&&(n.campaignStrategy=t.campaignStrategy),t.targetCampaignId!==void 0&&(n.targetCampaignId=Wn(t.targetCampaignId)),t.dryRun!==void 0&&(n.dryRun=t.dryRun),O({method:`POST`,path:`/api/cmmd/projects/${e}/move`,body:n},this.cfg)}async uploadBrainDoc(e,t){throw new En(`uploadBrainDoc`)}};function Kn(e){return new Gn(e)}var qn=new Gn({onAuthExpired:pe});function Jn(e={resolveUrl:ae}){let t=ce()?.bearerToken;return t?{...e,bearerToken:t}:e}var Yn=new Set([`CMMD_AUTH_REQUIRED`,`CMMD_AUTH_EXPIRED`]);function Xn(e,t){return!e&&t===null?{}:{query:{...e?{fresh:1}:{},...t===null?{}:{orgId:t}}}}async function Zn(e){let t=`/api/cmmd/work-intake`,{getCurrentForgeWorkspaceId:n}=await _e(async()=>{let{getCurrentForgeWorkspaceId:e}=await import(`./currentForgeWorkspaceStore-Cukj-AKS.js`).then(e=>e.t);return{getCurrentForgeWorkspaceId:e}},__vite__mapDeps([0,1,2,3,4,5,6])),r=n(),i;try{i=await O({method:`GET`,path:t,allowRetry:!1,...Xn(e,r)},Jn())}catch(e){throw e instanceof be&&e.kind!==`auth`&&e.code!==null&&Yn.has(e.code)?new be({kind:`auth`,message:e.message,status:e.status??401,code:e.code}):e}if(!i)throw Error(`Invalid response from ${t}`);return i}async function Qn(e={}){return Zn(e.forceFresh===!0)}var j=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,M=globalThis,$n=`10.74.0`;function er(){return tr(M),M}function tr(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||`10.74.0`,t[$n]=t[`10.74.0`]||{}}function nr(e,t,n=M){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[$n]=r[`10.74.0`]||{};return i[e]||(i[e]=t())}var rr=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],Iee=`Sentry Logger `,ir={};function ar(e){if(!(`console`in M))return e();let t=M.console,n={},r=Object.keys(ir);r.forEach(e=>{let r=ir[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function Lee(){cr().enabled=!0}function Ree(){cr().enabled=!1}function or(){return cr().enabled}function zee(...e){sr(`log`,...e)}function Bee(...e){sr(`warn`,...e)}function Vee(...e){sr(`error`,...e)}function sr(e,...t){j&&or()&&ar(()=>{M.console[e](`${Iee}[${e}]:`,...t)})}function cr(){return j?nr(`loggerSettings`,()=>({enabled:!1})):{enabled:!1}}var N={enable:Lee,disable:Ree,isEnabled:or,log:zee,warn:Bee,error:Vee},lr=50,ur=/\(error: (.*)\)/,dr=/captureMessage|captureException/;function fr(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{let i=[],a=e.split(`
|
|
3
|
+
`);for(let e=n;e<a.length;e++){let n=a[e];n.length>1024&&(n=n.slice(0,1024));let o=ur.test(n)?n.replace(ur,`$1`):n;if(!o.includes(`Error: `)){for(let e of t){let t=e(o);if(t){i.push(t);break}}if(i.length>=lr+r)break}}return mr(i.slice(r))}}function pr(e){return Array.isArray(e)?fr(...e):e}function mr(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(hr(t).function||``)&&t.pop(),t.reverse(),dr.test(hr(t).function||``)&&(t.pop(),dr.test(hr(t).function||``)&&t.pop()),t.slice(0,lr).map(e=>({...e,filename:e.filename||hr(t).filename,function:e.function||`?`}))}function hr(e){return e[e.length-1]||{}}var gr=`<anonymous>`;function _r(e){try{return!e||typeof e!=`function`?gr:e.name||gr}catch{return gr}}function vr(e){let t=e.exception;if(t){let e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function yr(e){let t=e?.startsWith(`file://`)?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}var br={},xr={};function Sr(e,t){return br[e]=br[e]||[],br[e].push(t),()=>{let n=br[e];if(n){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}function Cr(e,t){if(!xr[e]){xr[e]=!0;try{t()}catch(t){j&&N.error(`Error while instrumenting ${e}`,t)}}}function wr(e,t){let n=e&&br[e];if(n)for(let r of n)try{r(t)}catch(t){j&&N.error(`Error while triggering instrumentation handler.
|
|
4
|
+
Type: ${e}
|
|
5
|
+
Name: ${_r(r)}
|
|
6
|
+
Error:`,t)}}var Tr=null;function Er(e){let t=`error`;Sr(t,e),Cr(t,Dr)}function Dr(){Tr=M.onerror,M.onerror=function(e,t,n,r,i){return wr(`error`,{column:r,error:i,line:n,msg:e,url:t}),Tr?Tr.apply(this,arguments):!1},M.onerror.__SENTRY_INSTRUMENTED__=!0}var Or=null;function kr(e){let t=`unhandledrejection`;Sr(t,e),Cr(t,Ar)}function Ar(){Or=M.onunhandledrejection,M.onunhandledrejection=function(e){return wr(`unhandledrejection`,e),!Or||Or.apply(this,arguments)},M.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var jr=Object.prototype.toString;function Mr(e){switch(jr.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object WebAssembly.Exception]`:return!0;default:return Gr(e,Error)}}function Nr(e,t){return jr.call(e)===`[object ${t}]`}function Pr(e){return Nr(e,`ErrorEvent`)}function Fr(e){return Nr(e,`DOMError`)}function Ir(e){return Nr(e,`DOMException`)}function Lr(e){return Nr(e,`String`)}function Rr(e){return typeof e==`object`&&!!e&&`__sentry_template_string__`in e&&`__sentry_template_values__`in e}function zr(e){return e===null||Rr(e)||typeof e!=`object`&&typeof e!=`function`}function Br(e){return Nr(e,`Object`)}function Vr(e){return typeof e==`object`&&!!e}function Hr(e){return typeof Event<`u`&&Gr(e,Event)}function Ur(e){return Nr(e,`RegExp`)}function Wr(e){return!!(e?.then&&typeof e.then==`function`)}function Gr(e,t){try{return e instanceof t}catch{return!1}}function Kr(e){return typeof Request<`u`&&Gr(e,Request)}function qr(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!=`function`)return;let i=n(r);typeof i==`function`&&Yr(i,r);try{e[t]=i}catch{j&&N.log(`Failed to replace method "${t}" in object`,e)}}function Jr(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{j&&N.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function Yr(e,t){try{e.prototype=t.prototype=t.prototype||{},Jr(e,`__sentry_original__`,t)}catch{}}function Xr(e){return e.__sentry_original__}function Zr(e){if(Mr(e))return{message:e.message,name:e.name,stack:e.stack,...Qr(e)};if(Hr(e)){let{type:t,target:n,currentTarget:r,detail:i}=e;return{type:t,target:n,currentTarget:r,...i?{detail:i}:{},...Qr(e)}}return e}function Qr(e){return Vr(e)?Object.fromEntries(Object.entries(e)):{}}function $r(e){let t=Object.keys(Zr(e));return t.sort(),t[0]?t.join(`, `):`[object has no keys]`}var ei;function ti(e){if(ei!==void 0)return ei?ei(e):e();let t=Symbol.for(`__SENTRY_SAFE_RANDOM_ID_WRAPPER__`),n=M;return t in n&&typeof n[t]==`function`?(ei=n[t],ei(e)):(ei=null,e())}function ni(){return ti(()=>Math.random())}function ri(){return ti(()=>Date.now())}var ii=Symbol.for(`sentry.skipNormalization`),ai=Symbol.for(`sentry.overrideNormalizationDepth`);function oi(e){Jr(e,ii,!0)}function si(e,t){Jr(e,ai,t)}function ci(e){return!!e[ii]}function li(e){let t=e[ai];return typeof t==`number`?t:void 0}var ui;function di(e){ui=e}function fi(e,t=100,n=1/0){try{return mi(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function pi(e,t=3,n=102400){let r=fi(e,t);return vi(r)>n?pi(e,t-1,n):r}function mi(e,t,n=1/0,r=1/0,i=yi()){let[a,o]=i;if(t==null||[`boolean`,`string`].includes(typeof t)||typeof t==`number`&&Number.isFinite(t))return t;let s=hi(e,t);if(!s.startsWith(`[object `))return s;if(ci(t))return t;let c=li(t),l=c===void 0?n:c;if(l===0)return s.replace(`object `,``);if(a(t))return`[Circular ~]`;let u=t;if(u&&typeof u.toJSON==`function`)try{return mi(``,u.toJSON(),l-1,r,i)}catch{}let d=Array.isArray(t)?[]:{},f=0,p=Zr(t);for(let e in p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;if(f>=r){d[e]=`[MaxProperties ~]`;break}let t=p[e];d[e]=mi(e,t,l-1,r,i),f++}return o(t),d}function hi(e,t){try{if(ui){let e=ui(t);if(e)return e}return typeof global<`u`&&t===global?`[Global]`:typeof t==`number`&&!Number.isFinite(t)?`[${t}]`:typeof t==`function`?`[Function: ${_r(t)}]`:typeof t==`symbol`?`[${String(t)}]`:typeof t==`bigint`?`[BigInt: ${String(t)}]`:`[object ${gi(t)}]`}catch(e){return`**non-serializable** (${e})`}}function gi(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function _i(e){return~-encodeURI(e).split(/%..|./).length}function vi(e){return _i(JSON.stringify(e))}function yi(){let e=new WeakSet;function t(t){return e.has(t)?!0:(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}function bi(e,t=`[unserializable]`){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return typeof t==`function`?t(e):t}}function xi(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Si(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let i=Math.max(t-60,0);i<5&&(i=0);let a=Math.min(i+140,r);return a>r-5&&(a=r),a===r&&(i=Math.max(a-140,0)),n=n.slice(i,a),i>0&&(n=`'{snip} ${n}`),a<r&&(n+=` {snip}`),n}function Ci(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];zr(r)?n.push(String(r)):r instanceof Error?n.push(r.message?`${r.name}: ${r.message}`:r.name):n.push(hi(void 0,r))}return n.join(t)}function wi(e,t,n=!1){return Lr(e)?Ur(t)?t.test(e):Lr(t)?n?e===t:e.includes(t):typeof t==`function`&&t(e):!1}function Ti(e,t=[],n=!1){for(let r of t)if(wi(e,r,n))return!0;return!1}function Ei(){let e=M;return e.crypto||e.msCrypto}var Di;function Oi(){return ni()*16}function ki(e=Ei()){try{if(e?.randomUUID)return ti(()=>e.randomUUID()).replace(/-/g,``)}catch{}return Di||=`10000000100040008000100000000000`,Di.replace(/[018]/g,e=>(e^(Oi()&15)>>e/4).toString(16))}function Ai(e){return e.exception?.values?.[0]}function ji(e){let{message:t,event_id:n}=e;if(t)return t;let r=Ai(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function Mi(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||=t||``,a.type||=n||`Error`}function Ni(e,t){let n=Ai(e);if(!n)return;let r={type:`generic`,handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&`data`in t){let e={...i?.data,...t.data};n.mechanism.data=e}}function Pi(e,t,n=5){if(t.lineno===void 0)return;let r=e.length,i=Math.max(Math.min(r-1,t.lineno-1),0);t.pre_context=e.slice(Math.max(0,i-n),i).map(e=>Si(e,0)),t.context_line=Si(e[Math.min(r-1,i)],t.colno||0),t.post_context=e.slice(Math.min(i+1,r),i+1+n).map(e=>Si(e,0))}function Fi(e){if(Ii(e))return!0;try{Jr(e,`__sentry_captured__`,!0)}catch{}return!1}function Ii(e){try{return e.__sentry_captured__}catch{}}var Li=1e3;function Ri(){return ri()/Li}function Hee(){let{performance:e}=M;if(!e?.now||!e.timeOrigin)return Ri;let t=e.timeOrigin;return()=>(t+ti(()=>e.now()))/Li}var Uee;function zi(){return(Uee??=Hee())()}var Bi=null;function Wee(){let{performance:e}=M;if(!e?.now)return;let t=3e5,n=ti(()=>e.now()),r=ri(),i=e.timeOrigin;if(typeof i==`number`&&Math.abs(i+n-r)<t)return i;let a=e.timing?.navigationStart;return typeof a==`number`&&Math.abs(a+n-r)<t?a:r-n}function Vi(){return Bi===null&&(Bi=Wee()),Bi}function Gee(e){let t=zi(),n={sid:ki(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>qee(n)};return e&&Hi(n,e),n}function Hi(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||zi(),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:ki()),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{let t=e.timestamp-e.started;e.duration=t>=0?t: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 Kee(e,t){let n={};t?n={status:t}:e.status===`ok`&&(n={status:`exited`}),Hi(e,n)}function qee(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 Ui(e,t,n=2){if(!t||typeof t!=`object`||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=Ui(r[e],t[e],n-1));return r}function Wi(){return ki()}function Gi(){return ki().substring(16)}function Ki(e){try{let t=M.WeakRef;if(typeof t==`function`)return new t(e)}catch{}return e}function qi(e){if(e){if(typeof e==`object`&&`deref`in e&&typeof e.deref==`function`)try{return e.deref()}catch{return}return e}}var Ji=`_sentrySpan`;function Yi(e,t){t?Jr(e,Ji,Ki(t)):delete e[Ji]}function Xi(e){return qi(e[Ji])}var Jee=100,Zi=class e{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:Wi(),sampleRand:ni()}}clone(){let t=new e;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,Yi(t,Xi(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Hi(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t==`function`?t(this):t,{tags:r,attributes:i,extra:a,user:o,contexts:s,level:c,fingerprint:l=[],propagationContext:u,conversationId:d}=(n instanceof e?n.getScopeData():Br(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),d&&(this._conversationId=d),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,Yi(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Wi(),sampleRand:ni()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:Jee;if(n<=0)return this;let r={timestamp:Ri(),...e,message:e.message?xi(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),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(e){return this._attachments.push(e),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:Xi(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Ui(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t?.event_id||ki();if(!this._client)return j&&N.warn(`No client configured on scope - will not capture exception!`),n;let r=Error(`Sentry syntheticException`);return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){let r=n?.event_id||ki();if(!this._client)return j&&N.warn(`No client configured on scope - will not capture message!`),r;let i=n?.syntheticException??Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){let n=e.event_id||t?.event_id||ki();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(j&&N.warn(`No client configured on scope - will not capture event!`),n)}_notifyScopeListeners(){this._notifyingListeners||=(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),!1)}};function Yee(){return nr(`defaultCurrentScope`,()=>new Zi)}function Xee(){return nr(`defaultIsolationScope`,()=>new Zi)}var Qi=e=>e instanceof Promise&&!e[$i],$i=Symbol(`chained PromiseLike`),ea=(e,t,n)=>{let r=e.then(e=>(t(e),e),e=>{throw n(e),e});return Qi(r)&&Qi(e)?r:Zee(e,r)},Zee=(e,t)=>{if(!t)return e;let n=!1;for(let r in e){if(r in t)continue;n=!0;let i=e[r];typeof i==`function`?Object.defineProperty(t,r,{value:(...t)=>i.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=i}return n&&Object.assign(t,{[$i]:!0}),t},Qee=class{constructor(e,t){let n;n=e||new Zi;let r;r=t||new Zi,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){let t=this._pushScope(),n;try{n=e(t)}catch(e){throw this._popScope(),e}return Wr(n)?ea(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function ta(){let e=tr(er());return e.stack=e.stack||new Qee(Yee(),Xee())}function $ee(e){return ta().withScope(e)}function ete(e,t){let n=ta();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function na(e){return ta().withScope(()=>e(ta().getIsolationScope()))}function tte(){return{withIsolationScope:na,withScope:$ee,withSetScope:ete,withSetIsolationScope:(e,t)=>na(t),getCurrentScope:()=>ta().getScope(),getIsolationScope:()=>ta().getIsolationScope()}}function ra(e){let t=tr(e);return t.acs?t.acs:tte()}function nte(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.keys(e).includes(`value`)}function rte(e,t){let{value:n,unit:r}=nte(e)?e:{value:e,unit:void 0},i=ite(n),a=r&&typeof r==`string`?{unit:r}:{};if(i)return{...i,...a};if(!t||t===`skip-undefined`&&n===void 0)return;let o=``;try{o=JSON.stringify(n)??``}catch{}return{value:o,type:`string`,...a}}function ia(e,t=!1){let n={};for(let[r,i]of Object.entries(e??{})){let e=rte(i,t);e&&(n[r]=e)}return n}function aa(e){if(!e)return 0;let t=0;for(let[n,r]of Object.entries(e)){t+=n.length*2,t+=r.type.length*2,t+=(r.unit?.length??0)*2;let e=r.value;Array.isArray(e)?t+=oa(e[0])*e.length:zr(e)?t+=oa(e):t+=100}return t}function oa(e){return typeof e==`string`?e.length*2:typeof e==`boolean`?4:typeof e==`number`?8:0}function ite(e){if(Array.isArray(e))return{value:e,type:`array`};let 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}}var sa;function ate(){return sa?.()}function ote(){return sa!==void 0}function P(){return ra(er()).getCurrentScope()}function ca(){return ra(er()).getIsolationScope()}function la(){return nr(`globalScope`,()=>new Zi)}function ua(...e){let t=ra(er());if(e.length===2){let[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}return t.withScope(e[0])}function ste(...e){let t=ra(er());if(e.length===2){let[n,r]=e;return n?t.withSetIsolationScope(n,r):t.withIsolationScope(r)}return t.withIsolationScope(e[0])}function F(){return P().getClient()}function da(e){let t=ate();if(t)return{trace_id:t.traceId,span_id:t.spanId};let{traceId:n,parentSpanId:r,propagationSpanId:i}=e.getPropagationContext(),a={trace_id:n,span_id:i||Gi()};return r&&(a.parent_span_id=r),a}var fa=`sentry.source`,pa=`sentry.sample_rate`,cte=`sentry.previous_trace_sample_rate`,ma=`sentry.op`,I=`sentry.origin`,ha=`sentry.idle_span_finish_reason`,ga=`sentry.measurement_unit`,_a=`sentry.measurement_value`,lte=`sentry.release`,va=`sentry.environment`,ya=`sentry.sdk.integrations`,ba=`user.id`,xa=`user.email`,Sa=`user.ip_address`,Ca=`user.name`,wa=`sentry.custom_span_name`,Ta=`sentry.profile_id`,Ea=`sentry.exclusive_time`,Da=`sentry.link.type`,Oa=`gen_ai.conversation.id`;function ka(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:`unauthenticated`};case 403:return{code:2,message:`permission_denied`};case 404:return{code:2,message:`not_found`};case 409:return{code:2,message:`already_exists`};case 413:return{code:2,message:`failed_precondition`};case 429:return{code:2,message:`resource_exhausted`};case 499:return{code:2,message:`cancelled`};default:return{code:2,message:`invalid_argument`}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:`unimplemented`};case 503:return{code:2,message:`unavailable`};case 504:return{code:2,message:`deadline_exceeded`};default:return{code:2,message:`internal_error`}}return{code:2,message:`internal_error`}}function Aa(e,t){e.setAttribute(`http.response.status_code`,t);let n=ka(t);n.message!==`unknown_error`&&e.setStatus(n)}var ja=`_sentryScope`,Ma=`_sentryIsolationScope`,ute=Symbol.for(`sentry.otelSourceInference`),dte=Symbol.for(`sentry.otelSourceExplicitlySet`),fte=Symbol.for(`sentry.tracerProviderSpan`);function Na(e,t,n){e&&(Jr(e,Ma,Ki(n)),Jr(e,ja,t))}function Pa(e){let t=e;return{scope:t[ja],isolationScope:qi(t[Ma])}}function Fa(e){return e[ute]===!0}function Ia(e){Jr(e,dte,!0)}function La(e){return e[fte]===!0}var Ra=`sentry-`;function za(e){let t=Va(e);if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith(`sentry-`)){let r=t.slice(7);e[r]=n}return e},{});if(Object.keys(n).length>0)return n}function Ba(e){if(e)return Ua(Object.entries(e).reduce((e,[t,n])=>(n&&(e[`${Ra}${t}`]=n),e),{}))}function Va(e){if(!(!e||!Lr(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{let n=Ha(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):Ha(e)}function Ha(e){return e.split(`,`).map(e=>{let t=e.indexOf(`=`);return t===-1?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}function Ua(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((e,[t,n],r)=>{let i=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,a=r===0?i:`${e},${i}`;return a.length>8192?(j&&N.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},``)}var Wa=/^o(\d+)\./,Ga=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Ka(e){return e===`http`||e===`https`}function qa(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function Ja(e){let t=Ga.exec(e);if(!t){ar(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i=``,a=``,o=``,s=``]=t.slice(1),c=``,l=s,u=l.split(`/`);if(u.length>1&&(c=u.slice(0,-1).join(`/`),l=u.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return Ya({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function Ya(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function Xa(e){if(!j)return!0;let{port:t,projectId:n,protocol:r}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>!e[t]&&(N.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:n.match(/^\d+$/)?Ka(r)?t&&isNaN(parseInt(t,10))?(N.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(N.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(N.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Za(e){return e.match(Wa)?.[1]}function Qa(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=Za(n)),r}function $a(e){let t=typeof e==`string`?Ja(e):Ya(e);if(!(!t||!Xa(t)))return t}function eo(e){if(typeof e==`boolean`)return Number(e);let t=typeof e==`string`?parseFloat(e):e;if(!(typeof t!=`number`||isNaN(t)||t<0||t>1))return t}var to=RegExp(`^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$`);function no(e){if(!e)return;let t=e.match(to);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 ro(e,t){let n=no(e),r=za(t);if(!n?.traceId)return{traceId:Wi(),sampleRand:ni()};let i=oo(n,r);r&&(r.sample_rand=i.toString());let{traceId:a,parentSpanId:o,parentSampled:s}=n;return{traceId:a,parentSpanId:o,sampled:s,dsc:r||{},sampleRand:i}}function io(e=Wi(),t=Gi(),n){let r=``;return n!==void 0&&(r=n?`-1`:`-0`),`${e}-${t}${r}`}function ao(e=Wi(),t=Gi(),n){return`00-${e}-${t}-${n?`01`:`00`}`}function oo(e,t){let n=eo(t?.sample_rand);if(n!==void 0)return n;let r=eo(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?ni()*r:r+ni()*(1-r):ni()}function so(e,t){let n=Qa(e);return t&&n&&t!==n?(N.log(`Won't continue trace because org IDs don't match (incoming baggage: ${t}, SDK options: ${n})`),!1):e.getOptions().strictTraceContinuation&&(t&&!n||!t&&n)?(N.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}var co=!1;function lo(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:a,status:o,origin:s,links:c}=L(e);return{parent_span_id:a,span_id:t,trace_id:n,data:r,op:i,status:o,origin:s,links:c}}function uo(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:L(e).parent_span_id,a=Pa(e).scope;return{parent_span_id:i,span_id:r?a?.getPropagationContext().propagationSpanId||Gi():t,trace_id:n}}function fo(e){let{traceId:t,spanId:n}=e.spanContext();return io(t,n,Co(e))}function po(e){let{traceId:t,spanId:n}=e.spanContext();return ao(t,n,Co(e))}function mo(e){if(e&&e.length>0)return e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:i})=>({span_id:e,trace_id:t,sampled:n===1,attributes:i,...r}))}function ho(e){if(e?.length)return e.map(({context:{spanId:e,traceId:t,traceFlags:n},attributes:r})=>({span_id:e,trace_id:t,sampled:n===1,attributes:r}))}function go(e){return typeof e==`number`?_o(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?_o(e.getTime()):zi()}function _o(e){return e>9999999999?e/1e3:e}function L(e){if(So(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(xo(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{span_id:t,trace_id:n,data:r,description:a,parent_span_id:yo(e),start_timestamp:go(i),timestamp:go(o)||void 0,status:wo(s),op:r[ma],origin:r[I],links:mo(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function vo(e){if(So(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(xo(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{name:a,span_id:t,trace_id:n,parent_span_id:yo(e),start_timestamp:go(i),end_timestamp:go(o),is_segment:e===Mo(e),status:To(s),attributes:Eo(r,s),links:ho(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:``,end_timestamp:0,status:`ok`,is_segment:e===Mo(e)}}function yo(e){return`parentSpanId`in e?e.parentSpanId:`parentSpanContext`in e?e.parentSpanContext?.spanId:void 0}function bo(e){return{...e,attributes:ia(e.attributes),links:e.links?.map(e=>({...e,attributes:ia(e.attributes)}))}}function xo(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function So(e){return typeof e.getSpanJSON==`function`}function Co(e){let{traceFlags:t}=e.spanContext();return t===1}function wo(e){if(!(!e||e.code===0))return e.code===1?`ok`:e.message||`internal_error`}function To(e){return!e||e.code===1||e.code===0||e.message===`cancelled`?`ok`:`error`}function Eo(e,t){let n=To(t)===`error`?t?.message:void 0;return{...n&&{"sentry.status.message":n},...e}}var Do=`_sentryChildSpans`,Oo=`_sentryRootSpan`;function ko(e,t){let n=e[Oo]||e;Jr(t,Oo,n),Co(e)&&(!e.isRecording()&&!n.isRecording()||(e[Do]?e[Do].add(t):Jr(e,Do,new Set([t]))))}function pte(e,t){e[Do]&&e[Do].delete(t)}function Ao(e){let t=new Set;function n(e){if(!t.has(e)&&Co(e)){t.add(e);let r=e[Do]?Array.from(e[Do]):[];for(let e of r)n(e)}}return n(e),Array.from(t)}var jo=Mo;function Mo(e){return e[Oo]||e}function No(){let e=ra(er());return e.getActiveSpan?e.getActiveSpan():Xi(P())}function Po(){co||=(ar(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),!0)}function mte(e,t){e.updateName(t),e.setAttributes({[fa]:`custom`,[wa]:t})}var Fo=!1;function Io(){if(Fo)return;function e(){let e=No(),t=e&&jo(e);if(t){let e=`internal_error`;j&&N.log(`[Tracing] Root span: ${e} -> Global error occurred`),t.setStatus({code:2,message:e})}}Fo=!0,Er(e),kr(e)}function Lo(e){if(typeof __SENTRY_TRACING__==`boolean`&&!__SENTRY_TRACING__)return!1;let t=e||F()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function Ro(e){N.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function zo(e,t){if(!t?.length)return!1;for(let n of t){if(_te(n)){if(e.description&&wi(e.description,n))return j&&Ro(e),!0;continue}let t=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!t)continue;let r=!n.name||e.description&&wi(e.description,n.name),i=!n.op||e.op&&wi(e.op,n.op),a=!n.attributes||Object.entries(n.attributes).every(([t,n])=>hte(e.attributes?.[t],n));if(r&&i&&a)return j&&Ro(e),!0}return!1}function hte(e,t){return typeof e==`string`&&(typeof t==`string`||t instanceof RegExp)?wi(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}function gte(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function _te(e){return typeof e==`string`||e instanceof RegExp}var Bo=Symbol.for(`sentry.nonRecordingSpan`),Vo=class{constructor(e={}){this._traceId=e.traceId||Wi(),this._spanId=e.spanId||Gi(),this.dropReason=e.dropReason,Jr(this,Bo,!0)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}};function Ho(e){return!!e&&e[Bo]===!0}var Uo=`production`,Wo=`_frozenDsc`;function Go(e,t){Jr(e,Wo,t)}function Ko(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||`production`,release:n.release,public_key:r,trace_id:e,org_id:Qa(t)};return t.emit(`createDsc`,i),i}function qo(e,t){let n=t.getPropagationContext();return n.dsc||Ko(n.traceId,e)}function Jo(e){let t=F();if(!t)return{};let n=jo(e),r=L(n),i=r.data,a=n.spanContext().traceState,o=a?.get(`sentry.sample_rate`)??i[`sentry.sample_rate`]??i[`sentry.previous_trace_sample_rate`];function s(e){return(typeof o==`number`||typeof o==`string`)&&(e.sample_rate=`${o}`),e}let c=n[Wo];if(c)return s(c);let l=Ho(n),u=l&&n.dropReason===`ignored`;if(l&&(!Lo(t.getOptions())||u)){let e=Pa(n).scope;if(e){let n={...qo(t,e)};return u&&(n.sampled=`false`),s(n)}}let d=a?.get(`sentry.dsc`),f=d&&za(d);if(f)return s(f);let p=Ko(e.spanContext().traceId,t),m=i[`sentry.source`]??i[`sentry.segment.name.source`],h=r.description;return m!==`url`&&h&&(p.transaction=h),Lo()&&(p.sampled=String(Co(n)),p.sample_rand=a?.get(`sentry.sample_rand`)??Pa(n).scope?.getPropagationContext().sampleRand.toString()),s(p),t.emit(`createDsc`,p,n),p}function Yo(e){return Ba(Jo(e))}function Xo(e){return Jr(e,`_streamed`,!0),e}function Zo(e){return!!e&&typeof e==`function`&&`_streamed`in e&&!!e._streamed}function Qo(e,t=[]){return[e,t]}function $o(e,t){let[n,r]=e;return[n,[...r,t]]}function es(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function ts(e,t){return es(e,(e,n)=>t.includes(n))}function ns(e){let t=tr(M);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function rs(e){let t=tr(M);return t.decodePolyfill?t.decodePolyfill(e):new TextDecoder().decode(e)}function is(e){let[t,n]=e,r=JSON.stringify(t);function i(e){typeof r==`string`?r=typeof e==`string`?r+e:[ns(r),e]:r.push(typeof e==`string`?ns(e):e)}for(let e of n){let[t,n]=e;if(i(`
|
|
7
|
+
${JSON.stringify(t)}
|
|
8
|
+
`),typeof n==`string`||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(fi(n))}i(e)}}return typeof r==`string`?r:as(r)}function as(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function os(e){let t=typeof e==`string`?ns(e):e;function n(e){let n=t.subarray(0,e);return t=t.subarray(e+1),n}function r(){let e=t.indexOf(10);return e<0&&(e=t.length),JSON.parse(rs(n(e)))}let i=r(),a=[];for(;t.length;){let e=r(),t=typeof e.length==`number`?e.length:void 0;a.push([e,t?n(t):r()])}return[i,a]}function ss(e){return[{type:`span`},e]}function cs(e){let 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]}var ls={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 us(e){return e in ls}function ds(e){return us(e)?ls[e]:e}function fs(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function ps(e,t,n,r){let i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date(ri()).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:qa(r)},...i&&{trace:i}}}function ms(e,t){if(!t)return e;let 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 hs(e,t,n,r){let i=fs(n);return Qo({sent_at:new Date(ri()).toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:qa(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function gs(e,t,n,r){let i=fs(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;ms(e,n?.sdk);let o=ps(e,i,r,t);return delete e.sdkProcessingMetadata,Qo(o,[[{type:a},e]])}function _s(e,t){function n(e){return!!e.trace_id&&!!e.public_key}let r=Jo(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,o={sent_at:new Date(ri()).toISOString(),...n(r)&&{trace:r},...!!a&&i&&{dsn:qa(i)}},{beforeSendSpan:s,ignoreSpans:c}=t?.getOptions()||{},l=c?.length?e.filter(e=>{let t=L(e);return!zo({description:t.description,op:t.op,attributes:t.data},c)}):e,u=e.length-l.length;u&&t?.recordDroppedEvent(`before_send`,`span`,u);let d=s?e=>{let t=L(e);return(Zo(s)?t:s(t))||(Po(),t)}:L,f=[];for(let e of l){let t=d(e);t&&f.push(ss(t))}return Qo(o,f)}function vs(e){if(!j)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`,parent_span_id:r}=L(e),{spanId:i}=e.spanContext(),a=Co(e),o=jo(e),s=o===e,c=`[Tracing] Starting ${a?`sampled`:`unsampled`} ${s?`root `:``}span`,l=[`op: ${n}`,`name: ${t}`,`ID: ${i}`];if(r&&l.push(`parent ID: ${r}`),!s){let{op:e,description:t}=L(o);l.push(`root ID: ${o.spanContext().spanId}`),e&&l.push(`root op: ${e}`),t&&l.push(`root description: ${t}`)}N.log(`${c}
|
|
9
|
+
${l.join(`
|
|
10
|
+
`)}`)}function ys(e){if(!j)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`}=L(e),{spanId:r}=e.spanContext(),i=`[Tracing] Finishing "${n}" ${jo(e)===e?`root `:``}span "${t}" with ID ${r}`;N.log(i)}function bs(e,t,n,r=No()){let i=r&&jo(r);i&&(j&&N.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[_a]:t,[ga]:n}))}function xs(e){if(!e||e.length===0)return;let t={};return e.forEach(e=>{let n=e.attributes||{},r=n[ga],i=n[_a];typeof r==`string`&&typeof i==`number`&&(t[e.name]={value:i,unit:r})}),t}function Ss(){return tr(er()).segmentSpanCaptureStrategy}function Cs(e){return e.getOptions().traceLifecycle===`stream`}var ws=1e3,Ts=class{constructor(e={}){this._traceId=e.traceId||Wi(),this._spanId=e.spanId||Gi(),this._startTime=e.startTimestamp||zi(),this._links=e.links,this._attributes={},this.setAttributes({[I]:`manual`,[ma]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),`sampled`in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._frozen||(this._links?this._links.push(e):this._links=[e]),this}addLinks(e){return this._frozen||(this._links?this._links.push(...e):this._links=e),this}recordException(e,t){}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:+!!n}}setAttribute(e,t){return this._frozen?this:(t===void 0?delete this._attributes[e]:this._attributes[e]=t,e===`sentry.source`&&t!==void 0&&Fa(this)&&Ia(this),this)}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._frozen||(this._startTime=go(e))}setStatus(e){return this._frozen||(this._status=e),this}updateName(e){return this._frozen?this:(this._name=e,Fa(this)||this.setAttribute(fa,`custom`),this)}end(e){if(this._endTime){this._frozen=La(this);return}this._endTime=go(e),ys(this),this._onSpanEnded(),this._frozen=La(this)}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[ma],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:wo(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[I],profile_id:this._attributes[Ta],exclusive_time:this._attributes[Ea],measurements:xs(this._events),is_segment:this._isStandaloneSpan&&jo(this)===this||void 0,segment_id:this._isStandaloneSpan?jo(this).spanContext().spanId:void 0,links:mo(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===jo(this),status:To(this._status),attributes:Eo(this._attributes,this._status),links:ho(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){if(this._frozen)return this;j&&N.log(`[Tracing] Adding an event to span:`,e);let r=Es(t)?t:n||zi(),i=Es(t)?{}:t||{},a={name:e,time:go(r),attributes:i};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=F();e&&(e.emit(`spanEnd`,this),this._isStandaloneSpan||e.emit(`afterSpanEnd`,this));let t=jo(this),n=this._isStandaloneSpan||this===t;if(this._isStandaloneSpan){this._sampled?ks(_s([this],e)):(j&&N.log(`[Tracing] Discarding standalone span because its trace was not chosen to be sampled.`),e&&e.recordDroppedEvent(`sample_rate`,`span`));return}if(!n){let e=Ss();if(e){let n=Pa(this).scope||P();e.onChildSpanEnded(this,t,e=>this._convertSpanToTransaction(e),n)}return}if(e&&Cs(e)){e.emit(`afterSegmentSpanEnd`,this);return}let r=Pa(this).scope||P(),i=Ss();if(i)i.onSegmentSpanEnded(e=>this._convertSpanToTransaction(e),r);else{let e=this._convertSpanToTransaction();e&&r.captureEvent(e)}}_convertSpanToTransaction(e={}){if(!Ds(L(this)))return;this._name||=(j&&N.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),`<unlabeled transaction>`);let{scope:t,isolationScope:n}=Pa(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;e.onSpanCaptured?.(this);let i=[];for(let t of Ao(this)){if(t===this||Os(t)||e.isSpanAlreadyCaptured?.(t))continue;let n=L(t);Ds(n)&&(e.onSpanCaptured?.(t),i.push(n))}let a=this._attributes[fa];delete this._attributes[wa];let o=!1;i.forEach(e=>{delete e.data[wa],e.op?.startsWith(`gen_ai.`)&&(o=!0)});let s={contexts:{trace:lo(this)},spans:i.length>ws?i.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,ws):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:`transaction`,sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:Jo(this),hasGenAiSpans:o},request:r,...a&&{transaction_info:{source:a}}},c=xs(this._events);return c&&Object.keys(c).length&&(j&&N.log(`[Measurements] Adding measurements to transaction event`,JSON.stringify(c,void 0,2)),s.measurements=c),s}};function Es(e){return e&&typeof e==`number`||e instanceof Date||Array.isArray(e)}function Ds(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function Os(e){return e instanceof Ts&&e.isStandaloneSpan()}function ks(e){let t=F();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent(`before_send`,`span`);return}t.sendEnvelope(e)}function As(e,t,n=()=>{},r=()=>{}){let i;try{i=e()}catch(e){throw t(e),n(),e}return js(i,t,n,r)}function js(e,t,n,r){return Wr(e)?ea(e,e=>{n(),r(e)},e=>{t(e),n()}):(n(),r(e),e)}function Ms(e,t,n){if(!Lo(e))return[!1];let r,i;typeof e.tracesSampler==`function`?(i=e.tracesSampler({...t,inheritOrSampleWith:e=>typeof t.parentSampleRate==`number`?t.parentSampleRate:typeof t.parentSampled==`boolean`?Number(t.parentSampled):e}),r=!0):t.parentSampled===void 0?e.tracesSampleRate!==void 0&&(i=e.tracesSampleRate,r=!0):i=t.parentSampled;let a=eo(i);if(a===void 0)return j&&N.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(i)} of type ${JSON.stringify(typeof i)}.`),[!1];if(!a)return j&&N.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,a,r];let o=n<a;return o||j&&N.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[o,a,r]}var Ns=`__SENTRY_SUPPRESS_TRACING__`;function Ps(e,t){let n=Ks();if(n.startSpan)return n.startSpan(e,t);let r=Gs(e),{forceTransaction:i,parentSpan:a,scope:o}=e,s=o?.clone();return ua(s,()=>Xs(a)(()=>{let n=P(),o=Ys(n,a),s=F(),c=e.onlyIfParent&&!o?Us(n,s):Ws({parentSpan:o,spanArguments:r,forceTransaction:i,scope:n});return(!Qs(c)||!o)&&Yi(n,c),As(()=>t(c),()=>{let{status:e}=L(c);c.isRecording()&&(!e||e===`ok`)&&c.setStatus({code:2,message:`internal_error`})},()=>{c.end()})}))}function Fs(e,t){let n=Ks();if(n.startSpanManual)return n.startSpanManual(e,t);let r=Gs(e),{forceTransaction:i,parentSpan:a,scope:o}=e,s=o?.clone();return ua(s,()=>Xs(a)(()=>{let n=P(),o=Ys(n,a),s=e.onlyIfParent&&!o?Us(n,F()):Ws({parentSpan:o,spanArguments:r,forceTransaction:i,scope:n});return(!Qs(s)||!o)&&Yi(n,s),As(()=>t(s,()=>s.end()),()=>{let{status:e}=L(s);s.isRecording()&&(!e||e===`ok`)&&s.setStatus({code:2,message:`internal_error`})})}))}function Is(e){let t=Ks();return t.startInactiveSpan?t.startInactiveSpan(e):Ls(e)}function Ls(e){let t=Gs(e),{forceTransaction:n,parentSpan:r}=e;return(e.scope?t=>ua(e.scope,t):r===void 0?e=>e():e=>zs(r,e))(()=>{let i=P(),a=Ys(i,r),o=F();return e.onlyIfParent&&!a?Us(i,o):Ws({parentSpan:a,spanArguments:t,forceTransaction:n,scope:i})})}var Rs=(e,t)=>{let n=ra(er());if(n.continueTrace)return n.continueTrace(e,t);let{sentryTrace:r,baggage:i}=e,a=F(),o=za(i);return a&&!so(a,o?.org_id)?Hs(t):ua(e=>{let n=ro(r,i);return e.setPropagationContext(n),Yi(e,void 0),t()})};function zs(e,t){let n=Ks();return n.withActiveSpan?n.withActiveSpan(e,t):ua(n=>(Yi(n,e||void 0),t(n)))}function Bs(e){let t=Ks();return t.suppressTracing?t.suppressTracing(e):ua(t=>{t.setSDKProcessingMetadata({[Ns]:!0});let n=e();return t.setSDKProcessingMetadata({[Ns]:void 0}),n})}function Vs(e=P()){let t=Ks();return t.isTracingSuppressed?t.isTracingSuppressed(e):e.getScopeData().sdkProcessingMetadata[Ns]===!0}function Hs(e){let t=Ks();return t.startNewTrace?t.startNewTrace(e):ua(t=>(t.setPropagationContext({traceId:Wi(),sampleRand:ni()}),j&&N.log(`Starting a new trace with id ${t.getPropagationContext().traceId}`),zs(null,e)))}function Us(e,t){t?.recordDroppedEvent(`no_parent_span`,`span`);let n=new Vo({traceId:e.getPropagationContext().traceId});return Na(n,e,ca()),n}function Ws({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){let i=ca();if(!Lo()){let t=r.getPropagationContext(),a=new Vo({traceId:e?e.spanContext().traceId:t.traceId});return e&&!n&&ko(e,a),Na(a,r,i),a}let a=F();if(Zs(a,t)){Vs(r)||a?.recordDroppedEvent(`ignored`,`span`);let t=new Vo({dropReason:`ignored`,traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});return e&&!n&&ko(e,t),Na(t,r,i),t}let o;if(e&&!n)o=Js(e,r,t,i),ko(e,o);else if(e){let n=Jo(e),{traceId:a,spanId:s}=e.spanContext(),c=Co(e);o=qs({traceId:a,parentSpanId:s,...t},r,i,c),Go(o,n)}else{let{traceId:e,dsc:n,parentSpanId:a,sampled:s}=r.getPropagationContext();o=qs({traceId:e,parentSpanId:a,...t},r,i,s),n&&Go(o,n)}return vs(o),o}function Gs(e){let t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let n={...t};return n.startTimestamp=go(e.startTime),delete n.startTime,n}return t}function Ks(){return ra(er())}function qs(e,t,n,r){let i=F(),a=i?.getOptions()||{},{name:o=``}=e,s={spanAttributes:{...e.attributes},spanName:o,parentSampled:r};i?.emit(`beforeSampling`,s,{decision:!1});let c=s.parentSampled??r,l=s.spanAttributes,u=t.getPropagationContext(),d=Vs(t),[f,p,m]=d?[!1]:Ms(a,{name:o,parentSampled:c,attributes:l,normalizedRequest:n.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampleRate:eo(u.dsc?.sample_rate)},u.sampleRand),h=new Ts({...e,attributes:{[fa]:`custom`,[pa]:p!==void 0&&m?p:void 0,...l},sampled:f});return!f&&i&&!d&&(j&&N.log(`[Tracing] Discarding root span because its trace was not chosen to be sampled.`),i.recordDroppedEvent(`sample_rate`,Cs(i)?`span`:`transaction`)),Na(h,t,n),i&&i.emit(`spanStart`,h),h}function Js(e,t,n,r){let{spanId:i,traceId:a}=e.spanContext(),o=Vs(t),s=!o&&Co(e),c=s?new Ts({...n,parentSpanId:i,traceId:a,sampled:s}):new Vo({traceId:a});ko(e,c),Na(c,t,r);let l=F();return l?(Cs(l)&&Ho(c)&&(Ho(e)&&e.dropReason?(c.dropReason=e.dropReason,l.recordDroppedEvent(e.dropReason,`span`)):o||(c.dropReason=`sample_rate`,l.recordDroppedEvent(`sample_rate`,`span`))),l.emit(`spanStart`,c),n.endTimestamp&&(l.emit(`spanEnd`,c),l.emit(`afterSpanEnd`,c)),c):c}function Ys(e,t){if(t)return t;if(t===null)return;let n=Xi(e);if(!n)return;let r=F();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?jo(n):n}function Xs(e){return e===void 0?e=>e():t=>zs(e,t)}function Zs(e,t){let n=e?.getOptions().ignoreSpans;return!e||!Cs(e)||!n?.length?!1:zo({description:t.name||``,op:t.attributes?.[`sentry.op`]||t.op,attributes:t.attributes},n)}function Qs(e){return Ho(e)&&e.dropReason===`ignored`}var $s={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},ec=`heartbeatFailed`,tc=`idleTimeout`,nc=`finalTimeout`,rc=`externalFinish`;function ic(e,t={}){let n=new Map,r=!1,i,a,o=rc,s=!t.disableAutoFinish,c=[],{idleTimeout:l=$s.idleTimeout,finalTimeout:u=$s.finalTimeout,childSpanTimeout:d=$s.childSpanTimeout,beforeSpanEnd:f,trimIdleSpanEndTimestamp:p=!0}=t,m=F(),h=P();if(!m||!Lo()){let e=new Vo({traceId:h.getPropagationContext().traceId});return Na(e,h,ca()),e}let g=No(),_=ac(e);_.end=new Proxy(_.end,{apply(e,t,n){if(f&&f(_),Ho(t))return;let[r,...i]=n,a=go(r||zi()),o=Ao(_).filter(e=>e!==_),s=L(_);if(!o.length||!p)return w(a),Reflect.apply(e,t,[a,...i]);let c=m.getOptions().ignoreSpans,l=o?.reduce((e,t)=>{let n=L(t);return!n.timestamp||c&&zo({description:n.description,op:n.op,attributes:n.data},c)?e:e?Math.max(e,n.timestamp):n.timestamp},void 0),d=s.start_timestamp,h=Math.min(d?d+u/1e3:1/0,Math.max(d||-1/0,Math.min(a,l||1/0)));return w(h),Reflect.apply(e,t,[h,...i])}});function v(){i&&=(clearTimeout(i),void 0)}function y(){a&&=(clearTimeout(a),void 0)}function b(e){v(),i=setTimeout(()=>{!r&&n.size===0&&s&&(o=tc,_.end(e))},l)}function x(e){y(),a=setTimeout(()=>{!r&&s&&(o=ec,_.end(e))},d)}function S(e){v(),n.set(e,!0),x(zi()+d/1e3)}function C(e){n.has(e)&&n.delete(e),n.size===0&&(b(zi()+l/1e3),y())}function w(e){r=!0,n.clear(),c.forEach(e=>e()),Yi(h,g);let t=L(_),{start_timestamp:i}=t;if(!i)return;t.data[`sentry.idle_span_finish_reason`]||_.setAttribute(ha,o);let a=t.status;(!a||a===`unknown`)&&_.setStatus({code:1}),N.log(`[Tracing] Idle span "${t.op}" finished`);let s=Ao(_).filter(e=>e!==_),d=0;s.forEach(t=>{t.isRecording()&&(t.setStatus({code:2,message:`cancelled`}),t.end(e),j&&N.log(`[Tracing] Cancelling span since span ended early`,JSON.stringify(t,void 0,2)));let{timestamp:n=0,start_timestamp:r=0}=L(t),i=r<=e,a=(u+l)/1e3,o=n-r<=a;if(j){let e=JSON.stringify(t,void 0,2);i?o||N.log(`[Tracing] Discarding span since it finished after idle span final timeout`,e):N.log(`[Tracing] Discarding span since it happened after idle span was finished`,e)}(!o||!i)&&(pte(_,t),d++)}),d>0&&_.setAttribute(`sentry.idle_span_discarded_spans`,d)}return c.push(m.on(`spanStart`,e=>{r||e===_||L(e).timestamp||e instanceof Ts&&e.isStandaloneSpan()||Ao(_).includes(e)&&S(e.spanContext().spanId)})),c.push(m.on(`spanEnd`,e=>{r||C(e.spanContext().spanId)})),c.push(m.on(`idleSpanEnableAutoFinish`,e=>{e===_&&(s=!0,b(),n.size&&x())})),t.disableAutoFinish||b(),setTimeout(()=>{r||(_.setStatus({code:2,message:`deadline_exceeded`}),o=nc,_.end())},u),_}function ac(e){let t=Is(e);return Yi(P(),t),j&&N.log(`[Tracing] Started span is an idle span`),t}function oc(e,t,n){let r,i,a,o=n?.maxWait?Math.max(n.maxWait,t):0,s=n?.setTimeoutImpl||setTimeout;function c(){return l(),r=e(),r}function l(){i!==void 0&&clearTimeout(i),a!==void 0&&clearTimeout(a),i=a=void 0}function u(){return i!==void 0||a!==void 0?c():r}function d(){return i&&clearTimeout(i),i=s(c,t),o&&a===void 0&&(a=s(c,o)),r}return d.cancel=l,d.flush=u,d}var sc=[`addListener`,`on`,`once`,`prependListener`,`prependOnceListener`,`addEventListener`],cc=[`removeListener`,`off`,`removeEventListener`],lc=Symbol(`SentryScopeBoundListeners`),uc;function dc(e){return uc!==void 0&&(e===uc||e.listener===uc)}function fc(e,t=P()){let n=e;if(yc(n))return e;vc(n);for(let e of sc)typeof n[e]==`function`&&(n[e]=hc(n,n[e],t));for(let e of cc)typeof n[e]==`function`&&(n[e]=gc(n,n[e]));return typeof n.removeAllListeners==`function`&&(n.removeAllListeners=_c(n,n.removeAllListeners)),e}function pc(e,t){return function(...n){return ua(t,()=>e.apply(this,n))}}function mc(e){return typeof e==`function`}function hc(e,t,n){return function(...r){let i=r[0],a=r[1],o=r.slice(2);if(!mc(a)||dc(a))return t.apply(this,r);let s=yc(e)||vc(e),c=s.get(i);c||(c=new WeakMap,s.set(i,c));let l=c.get(a);l||(l=pc(a,n),c.set(a,l));let u=uc;uc=l;try{return t.call(this,i,l,...o)}finally{uc=u}}}function gc(e,t){return function(...n){let r=n[0],i=n[1],a=n.slice(2),o=mc(i)?yc(e)?.get(r)?.get(i):void 0;return o?t.call(this,r,o,...a):t.apply(this,n)}}function _c(e,t){return function(...n){let r=yc(e);if(r)if(n.length===0)vc(e);else{let e=n[0];r.delete(e)}return t.apply(this,n)}}function vc(e){let t=new Map;return e[lc]=t,t}function yc(e){return e[lc]}function bc(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;wc(e,t),r&&Dc(e,r),vte(e,n),Tc(e,i),Ec(e,a)}function xc(e,t){let{extra:n,tags:r,attributes:i,user:a,contexts:o,level:s,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:m,span:h}=t;Sc(e,`extra`,n),Sc(e,`tags`,r),Sc(e,`attributes`,i),Sc(e,`user`,a),Sc(e,`contexts`,o),e.sdkProcessingMetadata=Ui(e.sdkProcessingMetadata,c,2),s&&(e.level=s),m&&(e.transactionName=m),h&&(e.span=h),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function Sc(e,t,n){e[t]=Ui(e[t],n,1)}function Cc(e,t){let n=la().getScopeData();return e&&xc(n,e.getScopeData()),t&&xc(n,t.getScopeData()),n}function wc(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),s&&e.type!==`transaction`&&(e.transaction=s)}function Tc(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Ec(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Dc(e,t){e.contexts={trace:uo(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Jo(t),...e.sdkProcessingMetadata};let n=L(jo(t)).description;n&&!e.transaction&&e.type===`transaction`&&(e.transaction=n)}function vte(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 yte(e){let t={},{response:n,profile:r,cloud_resource:i,culture:a,state:o}=e;if(n&&(n.status_code!=null&&(t[`http.response.status_code`]=n.status_code),n.body_size!=null&&(t[`http.response.body.size`]=n.body_size)),r&&(r.profile_id&&(t[`sentry.profile_id`]=r.profile_id),r.profiler_id&&(t[`sentry.profiler_id`]=r.profiler_id)),i)for(let[e,n]of Object.entries(i))n!=null&&(t[e]=n);a&&(a.locale&&(t[`culture.locale`]=a.locale),a.timezone&&(t[`culture.timezone`]=a.timezone)),o?.state&&typeof o.state.type==`string`&&(t[`state.type`]=o.state.type);let s=e.angular;if(s){let e=s.version;(typeof e==`string`||typeof e==`number`)&&(t[`angular.version`]=e)}let c=e.react;if(c){let e=c.version;(typeof e==`string`||typeof e==`number`)&&(t[`react.version`]=e)}return t}var Oc=`graphql.document`,kc=`http.url`,bte=`params`,Ac=`sentry.sdk.name`,jc=`sentry.sdk.version`,Mc=`sentry.segment.id`,Nc=`sentry.segment.name`,Pc=`sentry.trace_lifecycle`,Fc=`sentry.transaction`,Ic=`url.full`,xte=`url.path`,Ste=`url.path.parameter`,Lc=`url.template`,Cte=`user_agent.original`;function wte(e,t){let n=vo(e),r=Mo(e),i=vo(r),{isolationScope:a,scope:o}=Pa(e),s=Cc(a,o);Dte(n,i,t,s);let c=e.kind;t.emit(`preprocessSpan`,n,{spanKind:c}),n.is_segment&&(Tte(n,s),Ete(n,t),t.emit(`processSegmentSpan`,n)),t.emit(`processSpan`,n);let{beforeSendSpan:l}=t.getOptions(),u=l&&Zo(l)?Ote(n,l):n,d=u.attributes?.[fa];return n.is_segment&&d&&Rc(u,{"sentry.segment.name.source":d}),{...bo(u),_segmentSpan:r}}function Tte(e,t){Rc(e,yte(t.contexts))}function Rc(e,t){let n=e.attributes??={};Object.entries(t).forEach(([e,t])=>{t!=null&&!(e in n)&&(n[e]=t)})}function Ete(e,t){let n=t.getIntegrationNames();n.length&&Rc(e,{[ya]:n})}function Dte(e,t,n,r){let i=n.getSdkMetadata(),{release:a,environment:o}=n.getOptions();Rc(e,{[Pc]:`stream`,[Nc]:t.name,[Mc]:t.span_id,[Ac]:i?.sdk?.name,[jc]:i?.sdk?.version,[lte]:a,[va]:o||`production`,[ba]:r.user?.id,[xa]:r.user?.email,[Sa]:r.user?.ip_address,[Ca]:r.user?.username,...r.attributes})}function Ote(e,t){return t(e)||(Po(),e)}var zc=0,Bc=1,Vc=2;function Hc(e){return new Wc(t=>{t(e)})}function Uc(e){return new Wc((t,n)=>{n(e)})}var Wc=class e{constructor(e){this._state=zc,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(!t)e(n);else try{e(t(n))}catch(e){r(e)}},t=>{if(!n)r(t);else try{e(n(t))}catch(e){r(e)}}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{if(i){n(r);return}e(r)})})}_executeHandlers(){if(this._state===zc)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||=(this._state===Bc&&e[1](this._value),this._state===Vc&&e[2](this._value),!0)})}_runExecutor(e){let t=(e,t)=>{if(this._state===zc){if(Wr(t)){t.then(n,r);return}this._state=e,this._value=t,this._executeHandlers()}},n=e=>{t(Bc,e)},r=e=>{t(Vc,e)};try{e(n,r)}catch(e){r(e)}}};function kte(e,t,n,r=0){try{let i=Gc(t,n,e,r);return Wr(i)?i:Hc(i)}catch(e){return Uc(e)}}function Gc(e,t,n,r){let i=n[r];if(!e||!i)return e;let a=i({...e},t);return j&&a===null&&N.log(`Event processor "${i.id||`?`}" dropped event`),Wr(a)?a.then(e=>Gc(e,t,n,r+1)):Gc(a,t,n,r+1)}var Kc,qc,Jc,Yc;function Xc(e){let t=M._sentryDebugIds,n=M._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(Yc&&r.length===qc&&i.length===Jc)return Yc;qc=r.length,Jc=i.length,Yc={},Kc||={};let a=(t,n)=>{for(let r of t){let t=n[r],i=Kc?.[r];if(i&&Yc&&t)Yc[i[0]]=t,Kc&&(Kc[r]=[i[0],t]);else if(t){let n=e(r);for(let e=n.length-1;e>=0;e--){let i=n[e]?.filename;if(i&&Yc&&Kc){Yc[i]=t,Kc[r]=[i,t];break}}}}};return t&&a(r,t),n&&a(i,n),Yc}function Ate(e,t){let n=Xc(e);if(!n)return[];let r=[];for(let e of t){let t=yr(e);t&&n[t]&&r.push({type:`sourcemap`,code_file:e,debug_id:n[t]})}return r}function Zc(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||ki(),timestamp:t.timestamp||Ri()},l=n.integrations||e.integrations.map(e=>e.name);jte(c,e),Pte(c,l),i&&i.emit(`applyFrameMetadata`,t),t.type===void 0&&Mte(c,e.stackParser);let u=Ite(r,n.captureContext);n.mechanism&&Ni(c,n.mechanism);let d=i?i.getEventProcessors():[],f=Cc(a,u),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),bc(c,f);let m=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?Hc(c):kte(m,c,n)).then(e=>(e&&Nte(e),typeof o==`number`&&o>0?Fte(e,o,s):e))}function jte(e,t){let{environment:n,release:r,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||`production`,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);let o=e.request;o?.url&&a&&(o.url=xi(o.url,a)),a&&e.exception?.values?.forEach(e=>{e.value&&=xi(e.value,a)})}function Mte(e,t){let n=Xc(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}function Nte(e){let t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:`sourcemap`,code_file:e,debug_id:t})})}function Pte(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Fte(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:fi(e.data,t,n)}}))},...e.user&&{user:fi(e.user,t,n)},...e.contexts&&{contexts:fi(e.contexts,t,n)},...e.extra&&{extra:fi(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=fi(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:fi(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=fi(e.contexts.flags,3,n)),r}function Ite(e,t){if(!t)return e;let n=e?e.clone():new Zi;return n.update(t),n}function Lte(e){if(e)return Rte(e)||Bte(e)?{captureContext:e}:e}function Rte(e){return e instanceof Zi||typeof e==`function`}var zte=[`user`,`level`,`extra`,`contexts`,`tags`,`fingerprint`,`propagationContext`];function Bte(e){return Object.keys(e).some(e=>zte.includes(e))}function Qc(e,t){return P().captureException(e,Lte(t))}function $c(e,t){let n=typeof t==`string`?t:void 0,r=typeof t==`string`?void 0:{captureContext:t};return P().captureMessage(e,n,r)}function el(e,t){return P().captureEvent(e,t)}function tl(e,t){ca().setContext(e,t)}function Vte(e){ca().setExtras(e)}function nl(e,t){ca().setExtra(e,t)}function rl(e){ca().setTags(e)}function il(e,t){ca().setTag(e,t)}function al(e){ca().setAttributes(e)}function ol(e,t){ca().setAttribute(e,t)}function sl(e){ca().setUser(e)}function cl(e){ca().setConversationId(e)}function ll(){return ca().lastEventId()}async function ul(e){let t=F();return t?t.flush(e):(j&&N.warn(`Cannot flush events. No client defined.`),Promise.resolve(!1))}async function dl(e){let t=F();return t?t.close(e):(j&&N.warn(`Cannot flush events and disable SDK. No client defined.`),Promise.resolve(!1))}function fl(){return!!F()}function pl(){let e=F();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function ml(e){ca().addEventProcessor(e)}function hl(e){let t=ca(),{user:n}=Cc(t,P()),{userAgent:r}=M.navigator||{},i=Gee({user:n,...r&&{userAgent:r},...e}),a=t.getSession();return a?.status===`ok`&&Hi(a,{status:`exited`}),gl(),t.setSession(i),i}function gl(){let e=ca(),t=P().getSession()||e.getSession();t&&Kee(t),_l(),e.setSession()}function _l(){let e=ca(),t=F(),n=e.getSession();n&&t&&t.captureSession(n)}function vl(e=!1){if(e){gl();return}_l()}function yl(e){return typeof e==`object`&&typeof e.unref==`function`&&e.unref(),e}function bl(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function xl(e){return`${bl(e)}${e.projectId}/envelope/`}function Sl(e,t){let n={sentry_version:`7`};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Cl(e,t,n){return t||`${xl(e)}?${Sl(e,n)}`}function wl(e,t){let n=$a(e);if(!n)return``;let r=`${bl(n)}embed/error-page/`,i=`dsn=${qa(n)}`;for(let e in t)if(e!==`dsn`&&e!==`onClose`)if(e===`user`){let e=t.user;if(!e)continue;e.name&&(i+=`&name=${encodeURIComponent(e.name)}`),e.email&&(i+=`&email=${encodeURIComponent(e.email)}`)}else i+=`&${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`;return`${r}?${i}`}var Tl=[];function El(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}function Dl(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n==`function`){let e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return El(r)}function Ol(e,t){let n={};return t.forEach(t=>{t?.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&Al(e,t,n)}),n}function kl(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Al(e,t,n){if(n[t.name]){j&&N.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Tl.includes(t.name)&&typeof t.setupOnce==`function`&&(t.setupOnce(),Tl.push(t.name)),t.setup&&typeof t.setup==`function`&&t.setup(e),typeof t.preprocessEvent==`function`){let n=t.preprocessEvent.bind(t);e.on(`preprocessEvent`,(t,r)=>n(t,r,e))}if(typeof t.processEvent==`function`){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}[`processSpan`,`processSegmentSpan`].forEach(n=>{let r=t[n];typeof r==`function`&&e.on(n,n=>r.call(t,n,e))}),j&&N.log(`Integration installed: ${t.name}`)}function jl(e){let t=F();if(!t){j&&N.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}function Ml(e){return e}var Nl=`sentry.timestamp.sequence`,Pl=0,Fl;function Il(e){let t=Math.floor(e*1e3);Fl!==void 0&&t!==Fl&&(Pl=0);let n=Pl;return Pl++,Fl=t,{key:Nl,value:{value:n,type:`integer`}}}function Ll(e,t){return t?ua(t,()=>{let n=No(),r=n?uo(n):da(t);return[n?Jo(n):qo(e,t),r]}):[void 0,void 0]}var Rl={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function zl(){return typeof __SENTRY_BROWSER_BUNDLE__<`u`&&!!__SENTRY_BROWSER_BUNDLE__}function Bl(){return`npm`}function Vl(){return!zl()&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`}function Hl(){return typeof window<`u`&&(!Vl()||Ul())}function Ul(){return M.process?.type===`renderer`}function Wl(e,t){let n=t?`auto`:`never`;return[{type:`log`,item_count:e.length,content_type:`application/vnd.sentry.items.log+json`},{version:2,...Hl()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function Gl(e,t,n,r,i){let a={};return t?.sdk&&(a.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(a.dsn=qa(r)),Qo(a,[Wl(e,i)])}var Kl=100;function ql(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function Jl(e,t){let n=Ql(),r=Zl(e);r===void 0?n.set(e,[t]):r.length>=Kl?(Xl(e,r),n.set(e,[t])):n.set(e,[...r,t])}function Yl(e,t=P(),n=Jl){let r=t?.getClient()??F();if(!r){j&&N.warn(`No client available to capture log.`);return}let{release:i,environment:a,enableLogs:o=!0,beforeSendLog:s}=r.getOptions();if(!o){j&&N.warn(`logging option not enabled, log will not be captured.`);return}let[,c]=Ll(r,t),l={...e.attributes},{user:{id:u,email:d,username:f},attributes:p={}}=Cc(ca(),t);ql(l,`user.id`,u,!1),ql(l,`user.email`,d,!1),ql(l,`user.name`,f,!1),ql(l,`sentry.release`,i),ql(l,`sentry.environment`,a);let{name:m,version:h}=r.getSdkMetadata()?.sdk??{};ql(l,`sentry.sdk.name`,m),ql(l,`sentry.sdk.version`,h);let g=r.getIntegrationByName(`Replay`),_=g?.getReplayId(!0);ql(l,`sentry.replay_id`,_),_&&g?.getRecordingMode()===`buffer`&&ql(l,`sentry._internal.replay_is_buffering`,!0);let v=e.message;if(Rr(v)){let{__sentry_template_string__:e,__sentry_template_values__:t=[]}=v;t?.length&&(l[`sentry.message.template`]=e),t.forEach((e,t)=>{l[`sentry.message.parameter.${t}`]=e})}ql(l,`sentry.trace.parent_span_id`,Xi(t)?.spanContext().spanId);let y={...e,attributes:l};r.emit(`beforeCaptureLog`,y);let b=s?ar(()=>s(y)):y;if(!b){r.recordDroppedEvent(`before_send`,`log_item`,1),j&&N.warn(`beforeSendLog returned null, log will not be captured.`);return}let{level:x,message:S,attributes:C={},severityNumber:w}=b,T=zi(),ee=Il(T);n(r,{timestamp:T,level:x,body:eu(String(S)),trace_id:c?.trace_id,severity_number:w??Rl[x],attributes:$l({...ia(p),...ia(C,!0),[ee.key]:ee.value})}),r.emit(`afterCaptureLog`,b)}function Xl(e,t){let n=t??Zl(e)??[];if(n.length===0)return;let r=e.getOptions(),i=Gl(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);Ql().set(e,[]),e.emit(`flushLogs`),e.sendEnvelope(i)}function Zl(e){return Ql().get(e)}function Ql(){return nr(`clientToLogBufferMap`,()=>new WeakMap)}function $l(e){let t={};for(let[n,r]of Object.entries(e)){let e=eu(n);t[e]=r.type===`string`?{...r,value:eu(r.value)}:r}return t}function eu(e){let t=Object(e),n=t.isWellFormed,r=t.toWellFormed;return typeof n==`function`&&typeof r==`function`?n.call(e)?e:r.call(e):e}function tu(e,t){let n=t?`auto`:`never`;return[{type:`trace_metric`,item_count:e.length,content_type:`application/vnd.sentry.items.trace-metric+json`},{version:2,...Hl()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function nu(e,t,n,r,i){let a={};return t?.sdk&&(a.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(a.dsn=qa(r)),Qo(a,[tu(e,i)])}var ru=1e3;function iu(e,t,n,r=!0){n&&(r||!(t in e))&&(e[t]=n)}function au(e,t){let n=du(),r=uu(e);r===void 0?n.set(e,[t]):r.length>=ru?(lu(e,r),n.set(e,[t])):n.set(e,[...r,t])}function ou(e,t,n){let{release:r,environment:i}=t.getOptions(),a={...e.attributes};iu(a,`user.id`,n.id,!1),iu(a,`user.email`,n.email,!1),iu(a,`user.name`,n.username,!1),iu(a,`sentry.release`,r),iu(a,`sentry.environment`,i);let{name:o,version:s}=t.getSdkMetadata()?.sdk??{};iu(a,`sentry.sdk.name`,o),iu(a,`sentry.sdk.version`,s);let c=t.getIntegrationByName(`Replay`),l=c?.getReplayId(!0);return iu(a,`sentry.replay_id`,l),l&&c?.getRecordingMode()===`buffer`&&iu(a,`sentry._internal.replay_is_buffering`,!0),{...e,attributes:a}}function su(e,t,n,r){let[,i]=Ll(t,n),a=Xi(n),o=a?a.spanContext().traceId:i?.trace_id,s=a?a.spanContext().spanId:void 0,c=zi(),l=Il(c);return{timestamp:c,trace_id:o??``,span_id:s,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...ia(r),...ia(e.attributes,`skip-undefined`),[l.key]:l.value}}}function cu(e,t){let n=t?.scope??P(),r=t?.captureSerializedMetric??au,i=n?.getClient()??F();if(!i){j&&N.warn(`No client available to capture metric.`);return}let{_experiments:a,enableMetrics:o,beforeSendMetric:s}=i.getOptions();if(!(o??a?.enableMetrics??!0)){j&&N.warn(`metrics option not enabled, metric will not be captured.`);return}let{user:c,attributes:l}=Cc(ca(),n),u=ou(e,i,c);i.emit(`processMetric`,u);let d=s||a?.beforeSendMetric,f=d?d(u):u;if(!f){j&&N.log("`beforeSendMetric` returned `null`, will not send metric.");return}let p=su(f,i,n,l);j&&N.log(`[Metric]`,p),r(i,p),i.emit(`afterCaptureMetric`,f)}function lu(e,t){let n=t??uu(e)??[];if(n.length===0)return;let r=e.getOptions(),i=nu(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);du().set(e,[]),e.emit(`flushMetrics`),e.sendEnvelope(i)}function uu(e){return du().get(e)}function du(){return nr(`clientToMetricBufferMap`,()=>new WeakMap)}function fu(e){return bo({trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||``,start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:!e.status||e.status===`ok`||e.status===`cancelled`?`ok`:`error`,is_segment:!1,attributes:{...e.data},links:e.links})}function pu(e,t){if(e.type!==`transaction`||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||t.getOptions().streamGenAiSpans===!1||Cs(t))return;let n=[],r=[];for(let t of e.spans)t.op?.startsWith(`gen_ai.`)?n.push(fu(t)):r.push(t);if(n.length===0)return;e.spans=r;let i=t.getDataCollectionOptions().userInfo?`auto`:`never`;return[{type:`span`,item_count:n.length,content_type:`application/vnd.sentry.items.span.v2+json`},{version:2,...Hl()&&{ingest_settings:{infer_ip:i,infer_user_agent:i}},items:n}]}var mu=Symbol.for(`SentryBufferFullError`);function hu(e=100){let t=new Set;function n(){return t.size<e}function r(e){t.delete(e)}function i(e){if(!n())return Uc(mu);let i=e();return t.add(i),i.then(()=>r(i),()=>r(i)),i}function a(e){if(!t.size)return Hc(!0);let n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;let r=[n,new Promise(t=>yl(setTimeout(()=>t(!1),e)))];return Promise.race(r)}return{get $(){return Array.from(t)},add:i,drain:a}}var gu=6e4;function _u(e,t=ri()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?gu:r-t}function vu(e,t){return e[t]||e.all||0}function yu(e,t,n=ri()){return vu(e,t)>n}function bu(e,{statusCode:t,headers:n},r=ri()){let i={...e},a=n?.[`x-sentry-rate-limits`],o=n?.[`retry-after`];if(a)for(let e of a.trim().split(`,`)){let[t,n,,,a]=e.split(`:`,5),o=parseInt(t,10),s=(isNaN(o)?60:o)*1e3;if(!n)i.all=r+s;else for(let e of n.split(`;`))e===`metric_bucket`?(!a||a.split(`;`).includes(`custom`))&&(i[e]=r+s):i[e]=r+s}else o?i.all=r+_u(o,r):t===429&&(i.all=r+6e4);return i}function xu(e,t,n=hu(e.bufferSize||64)){let r={},i=e=>n.drain(e);function a(i){let a=[];if(es(i,(t,n)=>{let i=ds(n);yu(r,i)?e.recordDroppedEvent(`ratelimit_backoff`,i):a.push(t)}),a.length===0)return Promise.resolve({});let o=Qo(i[0],a),s=t=>{if(ts(o,[`client_report`])){j&&N.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`);return}es(o,(n,r)=>{e.recordDroppedEvent(t,ds(r))})};return n.add(()=>t({body:is(o)}).then(e=>e.statusCode===413?(j&&N.error(`Sentry responded with status code 413. Envelope was discarded due to exceeding size limits.`),s(`send_error`),e):(j&&e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&N.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=bu(r,e),e),e=>{throw s(`network_error`),j&&N.error(`Encountered error running transport request:`,e),e})).then(e=>e,e=>{if(e===mu)return j&&N.error(`Skipped sending event because buffer is full.`),s(`queue_overflow`),Promise.resolve({});throw e})}return{send:a,flush:i}}function Su(e,t,n){let r=[{type:`client_report`},{timestamp:n||Ri(),discarded_events:e}];return Qo(t?{dsn:t}:{},[r])}function Cu(e){let t=[];e.message&&t.push(e.message);try{let 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 wu(e){let{trace_id:t,parent_span_id:n,span_id:r,status:i,origin:a,data:o,op:s}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:s,parent_span_id:n,span_id:r??``,start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??``,origin:a,profile_id:o?.[Ta],exclusive_time:o?.[Ea],measurements:e.measurements,is_segment:!0}}function Tu(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&&{"sentry.profile_id":e.profile_id},...e.exclusive_time&&{"sentry.exclusive_time":e.exclusive_time}}}},measurements:e.measurements}}var Eu=`[Filtered]`,Du=[`forwarded`,`-ip`,`remote-`,`via`,`-user`],Ou=[`auth`,`token`,`secret`,`session`,`password`,`passwd`,`pwd`,`key`,`jwt`,`bearer`,`sso`,`saml`,`csrf`,`xsrf`,`credentials`,`sid`,`identity`,`set-cookie`,`cookie`],ku=[`.sid`,`sessid`,`remember`,`oidc`,`pkce`,`nonce`,`__secure-`,`__host-`,`awsalb`,`awselb`,`akamai`,`__stripe`,`cognito`,`firebase`,`supabase`,`sb-`,`mfa`,`2fa`];function Au(e){return e===!0?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:[`incomingRequest`,`outgoingRequest`,`incomingResponse`,`outgoingResponse`],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:Du},httpHeaders:{request:{deny:Du},response:{deny:Du}},httpBodies:[],urlQueryParams:{deny:Du},graphQL:{document:!0,variables:!0},genAI:{inputs:!1,outputs:!1},databaseQueryData:!1,stackFrameVariables:!0,frameContextLines:7}}var ju={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:[`incomingRequest`,`outgoingRequest`,`incomingResponse`,`outgoingResponse`],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:5};function Mu(e){let t=e.dataCollection==null?Au(e.sendDefaultPii):ju,n=e.dataCollection??{};return{userInfo:n.userInfo??t.userInfo,cookies:n.cookies??t.cookies,httpHeaders:{request:n.httpHeaders?.request??t.httpHeaders.request,response:n.httpHeaders?.response??t.httpHeaders.response},httpBodies:n.httpBodies??t.httpBodies,urlQueryParams:n.urlQueryParams??n.queryParams??t.urlQueryParams,graphQL:{document:n.graphQL?.document??t.graphQL.document,variables:n.graphQL?.variables??t.graphQL.variables},genAI:{inputs:n.genAI?.inputs??t.genAI.inputs,outputs:n.genAI?.outputs??t.genAI.outputs},databaseQueryData:n.databaseQueryData??t.databaseQueryData,stackFrameVariables:n.stackFrameVariables??t.stackFrameVariables,frameContextLines:n.frameContextLines??t.frameContextLines}}var Nu=`Not capturing exception because it's already been captured.`,Pu=`Discarded session because of missing or non-string release`,Fu=Symbol.for(`SentryInternalError`),Iu=Symbol.for(`SentryDoNotSendEventError`),Lu=5e3;function Ru(e){return{message:e,[Fu]:!0}}function zu(e){return{message:e,[Iu]:!0}}function Bu(e){return Vr(e)&&Fu in e}function Vu(e){return Vr(e)&&Iu in e}function Hu(e,t,n,r,i){let a=0,o,s=!1;e.on(n,()=>{a=0,clearTimeout(o),s=!1}),e.on(t,t=>{if(a+=r(t),a>=8e5)i(e);else if(!s){let t=e.getOptions()._flushInterval??Lu;t>0&&(s=!0,o=yl(setTimeout(()=>{i(e)},t)))}}),e.on(`flush`,()=>{i(e)})}var Uu=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=hu(e.transportOptions?.bufferSize??64),this._dataCollection=Mu(e),e.dsn?this._dsn=$a(e.dsn):j&&N.warn(`No DSN provided, client will not send events.`),this._dsn){let t=Cl(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs??!0,this._options.enableLogs&&Hu(this,`afterCaptureLog`,`flushLogs`,Xu,Xl),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Hu(this,`afterCaptureMetric`,`flushMetrics`,Yu,lu)}captureException(e,t,n){let r=ki();if(Fi(e))return j&&N.log(Nu),r;let i={event_id:r,...t};return this._process(()=>this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n)).then(e=>e),`error`),i.event_id}captureMessage(e,t,n,r){let i={event_id:ki(),...n},a=Rr(e)?e:String(e),o=zr(e),s=o?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process(()=>s.then(e=>this._captureEvent(e,i,r)),o?`unknown`:`error`),i.event_id}captureEvent(e,t,n){let r=ki();if(t?.originalException&&Fi(t.originalException))return j&&N.log(Nu),r;let i={event_id:r,...t},a=e.sdkProcessingMetadata||{},o=a.capturedSpanScope,s=a.capturedSpanIsolationScope,c=Wu(e.type);return this._process(()=>this._captureEvent(e,i,o||n,s),c),i.event_id}captureSession(e){this.sendSession(e),Hi(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){let t=this._transport;if(this.emit(`flush`),!t)return!0;let n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){let t=await this.flush(e);return this.getOptions().enabled=!1,this.emit(`close`),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith(`Spotlight`)))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(e){let t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),Al(this,e,this._integrations),t||kl(this,[e])}sendEvent(e,t={}){this.emit(`beforeSendEvent`,e,t);let n=pu(e,this),r=gs(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])r=$o(r,cs(e));n&&(r=$o(r,n)),this.sendEnvelope(r).then(t=>this.emit(`afterSendEvent`,e,t))}sendSession(e){let{release:t,environment:n=Uo}=this._options;if(`aggregates`in e){let r=e.attrs||{};if(!r.release&&!t){j&&N.warn(Pu);return}r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t){j&&N.warn(Pu);return}e.release=e.release||t,e.environment=e.environment||n}this.emit(`beforeSendSession`,e);let r=hs(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){let r=`${e}:${t}`;j&&N.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:``}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){let n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return j&&N.error(`Error while sending envelope:`,e),{}}return j&&N.error(`Transport disabled`),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=Ol(this,e),kl(this,e)}_updateSessionFromEvent(e,t){let n=t.level===`fatal`,r=!1,i=t.exception?.values;if(i){r=!0,n=!1;for(let e of i)if(e.mechanism?.handled===!1){n=!0;break}}let a=e.status===`ok`;(a&&e.errors===0||a&&n)&&(Hi(e,{...n&&{status:`crashed`},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,n,r){let i=this.getOptions(),a=this.getIntegrationNames();return!t.integrations&&a.length&&(t.integrations=a),this.emit(`preprocessEvent`,e,t),e.type||r.setLastEventId(e.event_id||t.event_id),Zc(i,e,t,n,this,r).then(e=>e===null?e:(this.emit(`postprocessEvent`,e,t),e.contexts={trace:{...e.contexts?.trace,...da(n)},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:qo(this,n),...e.sdkProcessingMetadata},e))}_captureEvent(e,t={},n=P(),r=ca()){return j&&qu(e)&&N.log(`Captured error event \`${Cu(e)[0]||`<unknown>`}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{j&&(Vu(e)?N.log(e.message):Bu(e)?N.warn(e.message):N.warn(e))})}_processEvent(e,t,n,r){let i=this.getOptions(),{sampleRate:a}=i,o=Ju(e),s=qu(e),c=`before send for type \`${e.type||`error`}\``,l=a===void 0?void 0:eo(a),u=Wu(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(e===null)throw this.recordDroppedEvent(`event_processor`,u),zu("An event processor returned `null`, will not send event.");return t.data?.__sentry__===!0?e:Gu(Ku(this,i,e,t),c)}).then(i=>{if(i===null){if(this.recordDroppedEvent(`before_send`,u),o){let t=1+(e.spans||[]).length;this.recordDroppedEvent(`before_send`,`span`,t)}throw zu(`${c} returned \`null\`, will not send event.`)}let d=n.getSession()||r.getSession();if(s&&d&&this._updateSessionFromEvent(d,i),s&&typeof l==`number`&&ni()>l)throw this.recordDroppedEvent(`sample_rate`,`error`),zu(`Discarding event because it's not included in the random sample (sampling rate = ${a})`);if(o){let e=(i.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(i.spans?i.spans.length:0);e>0&&this.recordDroppedEvent(`before_send`,`span`,e)}let f=i.transaction_info;return o&&f&&i.transaction!==e.transaction&&(i.transaction_info={...f,source:`custom`}),this.sendEvent(i,t),i}).then(null,e=>{throw Vu(e)||Bu(e)?e:(this.captureException(e,{mechanism:{handled:!1,type:`internal`},data:{__sentry__:!0},originalException:e}),Ru(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
11
|
+
Reason: ${e}`))})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===mu&&this.recordDroppedEvent(`queue_overflow`,t),e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(`:`);return{reason:n,category:r,quantity:t}})}_flushOutcomes(){j&&N.log(`Flushing outcomes...`);let e=this._clearOutcomes();if(e.length===0){j&&N.log(`No outcomes to send`);return}if(!this._dsn){j&&N.log(`No dsn provided, will not send outcomes`);return}j&&N.log(`Sending outcomes:`,e);let t=Su(e,this._options.tunnel&&qa(this._dsn));this.sendEnvelope(t)}};function Wu(e){return e===`replay_event`?`replay`:e||`error`}function Gu(e,t){let n=`${t} must return \`null\` or a valid event.`;if(Wr(e))return e.then(e=>{if(!Br(e)&&e!==null)throw Ru(n);return e},e=>{throw Ru(`${t} rejected with ${e}`)});if(!Br(e)&&e!==null)throw Ru(n);return e}function Ku(e,t,n,r){let{beforeSend:i,beforeSendTransaction:a,ignoreSpans:o}=t,s=!Zo(t.beforeSendSpan)&&t.beforeSendSpan,c=n;if(qu(c)&&i)return i(c,r);if(Ju(c)){if(s||o){let t=wu(c);if(o?.length&&zo({description:t.description,op:t.op,attributes:t.data},o))return null;if(s){let e=s(t);e?c=Ui(n,Tu(e)):Po()}if(c.spans){let t=[],n=c.spans;for(let e of n){if(o?.length&&zo({description:e.description,op:e.op,attributes:e.data},o)){gte(n,e);continue}if(s){let n=s(e);n?t.push(n):(Po(),t.push(e))}else t.push(e)}let r=c.spans.length-t.length;r&&e.recordDroppedEvent(`before_send`,`span`,r),c.spans=t}}if(a){if(c.spans){let e=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return a(c,r)}}return c}function qu(e){return e.type===void 0}function Ju(e){return e.type===`transaction`}function Yu(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Zu(e.attributes)}function Xu(e){let t=0;return e.message&&(t+=e.message.length*2),t+Zu(e.attributes)}function Zu(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*Qu(e[0]):zr(e)?t+=Qu(e):t+=100}),t}function Qu(e){return typeof e==`string`?e.length*2:typeof e==`number`?8:typeof e==`boolean`?4:0}function $u(e,t){t.debug===!0&&(j?N.enable():ar(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),P().update(t.initialScope);let n=new e(t);return ed(n),n.init(),n}function ed(e){P().setClient(e)}var td=5e3,nd=36e5;function rd(e){function t(...e){j&&N.log(`[Offline]:`,...e)}return n=>{let r=e(n);if(!n.createStore)throw Error("No `createStore` function was provided");let i=n.createStore(n),a=td,o;function s(e,t,r){return ts(e,[`client_report`])?!1:!n.shouldStore||n.shouldStore(e,t,r)}function c(e){o&&clearTimeout(o),o=yl(setTimeout(async()=>{o=void 0;let e=await i.shift();e&&(t(`Attempting to send previously queued event`),e[0].sent_at=new Date(ri()).toISOString(),u(e,!0).catch(e=>{t(`Failed to retry sending`,e)}))},e))}function l(){o||(c(a),a=Math.min(a*2,nd))}async function u(e,o=!1){if(!o&&ts(e,[`replay_event`,`replay_recording`]))return await i.push(e),c(100),{};try{if(n.shouldSend&&await n.shouldSend(e)===!1)throw Error("Envelope not sent because `shouldSend` callback returned false");let t=await r.send(e),i=100;if(t){if(t.headers?.[`retry-after`])i=_u(t.headers[`retry-after`]);else if(t.headers?.[`x-sentry-rate-limits`])i=6e4;else if((t.statusCode||0)>=400)return t}return c(i),a=td,t}catch(n){if(await s(e,n,a))return o?await i.unshift(e):await i.push(e),l(),t(`Error sending. Event queued.`,n),{};throw n}}return n.flushAtStartup&&l(),{send:u,flush:e=>(e===void 0&&(a=td,c(100)),r.flush(e))}}}var id=`MULTIPLEXED_TRANSPORT_EXTRA_KEY`;function ad(e,t){let n;return es(e,(e,r)=>(t.includes(r)&&(n=Array.isArray(e)?e[1]:void 0),!!n)),n}function od(e,t){return n=>{let r=e(n);return{...r,send:async e=>{let n=ad(e,[`event`,`transaction`,`profile`,`replay_event`]);return n&&(n.release=t),r.send(e)}}}}function sd(e,t){return Qo(t?{...e[0],dsn:t}:e[0],e[1])}function cd(e,t){return n=>{let r=e(n),i=new Map,a=t||(e=>{let t=e.getEvent();return t?.extra?.MULTIPLEXED_TRANSPORT_EXTRA_KEY&&Array.isArray(t.extra.MULTIPLEXED_TRANSPORT_EXTRA_KEY)?t.extra.MULTIPLEXED_TRANSPORT_EXTRA_KEY:[]});function o(t,r){let a=r?`${t}:${r}`:t,o=i.get(a);if(!o){let s=Ja(t);if(!s)return;let c=Cl(s,n.tunnel);o=r?od(e,r)({...n,url:c}):e({...n,url:c}),i.set(a,o)}return[t,o]}async function s(e){function t(t){return ad(e,t?.length?t:[`event`])}let n=a({envelope:e,getEvent:t}).map(e=>typeof e==`string`?o(e,void 0):o(e.dsn,e.release)).filter(e=>!!e),i=n.length?n:[[``,r]];return(await Promise.all(i.map(([t,n])=>n.send(sd(e,t)))))[0]}async function c(e){let t=[...i.values(),r];return(await Promise.all(t.map(t=>t.flush(e)))).every(e=>e)}return{send:s,flush:c}}}function ld(e,t){return t.some(t=>e.includes(t))}function ud(e,t,n){if(t===!1)return{};let r=n==null?Ou:[...Ou,...n],i={};if(t===!0){for(let t of Object.keys(e))i[t]=ld(t.toLowerCase(),r)?Eu:e[t];return i}if(`deny`in t){let n=t.deny.map(e=>e.toLowerCase());for(let t of Object.keys(e)){let a=t.toLowerCase();i[t]=ld(a,r)||n.some(e=>a.includes(e))?Eu:e[t]}return i}let a=t.allow.map(e=>e.toLowerCase());for(let t of Object.keys(e)){let n=t.toLowerCase();i[t]=ld(n,r)?Eu:a.some(e=>n.includes(e))?e[t]:Eu}return i}function dd(e){let t={},n=0;for(;n<e.length;){let r=e.indexOf(`=`,n);if(r===-1)break;let i=e.indexOf(`;`,n);if(i===-1)i=e.length;else if(i<r){n=e.lastIndexOf(`;`,r-1)+1;continue}let a=e.slice(n,r).trim();if(t[a]===void 0){let n=e.slice(r+1,i).trim();n.charCodeAt(0)===34&&(n=n.slice(1,-1));try{t[a]=n.indexOf(`%`)===-1?n:decodeURIComponent(n)}catch{t[a]=n}}n=i+1}return t}function fd(e,t){if(t===!1)return{};try{let n=dd(e);return Object.keys(n).length===0?{}:ud(n,t,ku)}catch{return Eu}}var pd=`thismessage:/`;function md(e){return`isRelative`in e}function hd(e,t){let n=e.indexOf(`://`)<=0&&e.indexOf(`//`)!==0,r=t??(n?pd:void 0);try{if(`canParse`in URL&&!URL.canParse(e,r))return;let t=new URL(e,r);return n?{isRelative:n,pathname:t.pathname,search:t.search,hash:t.hash}:t}catch{}}function gd(e){if(md(e))return e.pathname;let t=new URL(e);return t.search=``,t.hash=``,[`80`,`443`].includes(t.port)&&(t.port=``),t.password&&=`%filtered%`,t.username&&=`%filtered%`,t.toString()}function _d(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let 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 vd(e){return e.split(/[?#]/,1)[0]}function yd(e,t=!0){if(e.startsWith(`data:`)){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:`text/plain`,i=e.includes(`;base64,`),a=e.indexOf(`,`),o=``;if(t&&a!==-1){let t=e.slice(a+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${i?`,base64`:``}${o?`,${o}`:``}`}return e}function bd(e,t){let n=t?.getDsn(),r=t?.getOptions().tunnel;return Sd(e,n)||xd(e,r)}function xd(e,t){return t?wd(e)===wd(t):!1}function Sd(e,t){let n=hd(e);return!n||md(n)||!t?!1:Cd(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function Cd(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function wd(e){return e[e.length-1]===`/`?e.slice(0,-1):e}function Td(e,...t){let 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}var Ed=Td;function Dd(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 Od(e,t,n=[t],r=`npm`){let i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:$n})),i.version=$n)}function kd(e={}){let t=e.client||F();if(!pl()||!t)return{};let n=ra(er());if(n.getTraceData)return n.getTraceData(e);let r=e.scope||P(),i=e.span||No(),a=Ho(i)&&!Lo(t.getOptions());if(!i&&ote())return{};let o=i&&!a?fo(i):Ad(r),s=Ba(i?Jo(i):qo(t,r));if(!to.test(o))return N.warn(`Invalid sentry-trace data. Cannot generate trace data`),{};let c={"sentry-trace":o,baggage:s};return e.propagateTraceparent&&(c.traceparent=i&&!a?po(i):jd(r)),c}function Ad(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return io(t,r,n)}function jd(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return ao(t,r,n)}var Md=100;function Nd(e,t){let n=F(),r=ca();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=Md}=n.getOptions();if(a<=0)return;let o={timestamp:Ri(),...e},s=i?ar(()=>i(o,t)):o;s!==null&&(n.emit&&n.emit(`beforeAddBreadcrumb`,s,t),r.addBreadcrumb(s,a))}var Pd=`FunctionToString`,Fd=new WeakMap,Id=Ml((()=>({name:Pd,setupOnce(){let e=Function.prototype.toString;try{Function.prototype.toString=function(...t){let n=Xr(this),r;try{Fd.has(F())&&n!==void 0&&(r=n)}catch{}return e.apply(r??this,t)}}catch{}},setup(e){Fd.set(e,!0)}}))),Ld=[/^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$/,/Java object is gone$/],Rd=`EventFilters`,zd=Ml((e={})=>{let t;return{name:Rd,setup(n){t=Vd(e,n.getOptions())},processEvent(n,r,i){return t||=Vd(e,i.getOptions()),Hd(n,t)?null:n}}}),Bd=Ml(((e={})=>({...zd(e),name:`InboundFilters`})));function Vd(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Ld],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Hd(e,t){if(!e.type){if(Ud(e,t.ignoreErrors))return j&&N.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
12
|
+
Event: ${ji(e)}`),!0;if(Yd(e))return j&&N.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
13
|
+
Event: ${ji(e)}`),!0;if(Gd(e,t.denyUrls))return j&&N.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
14
|
+
Event: ${ji(e)}.
|
|
15
|
+
Url: ${Jd(e)}`),!0;if(!Kd(e,t.allowUrls))return j&&N.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
16
|
+
Event: ${ji(e)}.
|
|
17
|
+
Url: ${Jd(e)}`),!0}else if(e.type===`transaction`&&Wd(e,t.ignoreTransactions))return j&&N.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
18
|
+
Event: ${ji(e)}`),!0;return!1}function Ud(e,t){return t?.length?Cu(e).some(e=>Ti(e,t)):!1}function Wd(e,t){if(!t?.length)return!1;let n=e.transaction;return n?Ti(n,t):!1}function Gd(e,t){if(!t?.length)return!1;let n=Jd(e);return n?Ti(n,t):!1}function Kd(e,t){if(!t?.length)return!0;let n=Jd(e);return!n||Ti(n,t)}function qd(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function Jd(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?qd(t):null}catch{return j&&N.error(`Cannot extract url for event ${ji(e)}`),null}}function Yd(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function Xd(e,t,n,r,i,a){if(!i.exception?.values||!a||!Mr(a.originalException))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=Zd(e,t,r,a.originalException,n,i.exception.values,o,0))}function Zd(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(Mr(r[i])){$d(o,s,r);let a=e(t,r[i]),l=c.length;ef(a,i,l,s),c=Zd(e,t,n,r[i],i,[a,...c],a,l)}return Qd(r)&&r.errors.forEach((a,l)=>{if(Mr(a)){$d(o,s,r);let u=e(t,a),d=c.length;ef(u,`errors[${l}]`,d,s),c=Zd(e,t,n,a,i,[u,...c],u,d)}}),c}function Qd(e){return Array.isArray(e.errors)}function $d(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...Qd(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function ef(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function tf(e){return Mr(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function nf(e){return tf(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var rf=new Map,af=new Set;function of(e){if(M._sentryModuleMetadata)for(let t of Object.keys(M._sentryModuleMetadata)){let n=M._sentryModuleMetadata[t];if(af.has(t))continue;af.add(t);let r=e(t);for(let e of r.reverse())if(e.filename){rf.set(e.filename,n);break}}}function sf(e,t){return of(e),rf.get(t)}function cf(e,t){t.exception?.values?.forEach(t=>{t.stacktrace?.frames?.forEach(t=>{if(!t.filename||t.module_metadata)return;let n=sf(e,t.filename);n&&(t.module_metadata=n)})})}function lf(e){e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{delete e.module_metadata})})}var uf=Ml(()=>({name:`ModuleMetadata`,setup(e){e.on(`beforeEnvelope`,e=>{es(e,(e,t)=>{if(t===`event`){let t=Array.isArray(e)?e[1]:void 0;t&&(lf(t),e[1]=t)}})}),e.on(`applyFrameMetadata`,t=>{if(t.type)return;let n=e.getOptions().stackParser;cf(n,t)})}})),df=new Set([]);function ff(e){let t=`console`,n=Sr(t,e);return Cr(t,mf),n}var pf=new Set;function mf(){`console`in M&&rr.forEach(function(e){pf.has(e)||!(e in M.console)||(pf.add(e),qr(M.console,e,function(t){return ir[e]=t,function(...t){let n=t[0],r=ir[e],i=df.size&&typeof n==`string`&&Ti(n,df);i||wr(`console`,{args:t,level:e}),(!i||j&&N.isEnabled())&&r?.apply(M.console,t)}}))})}function hf(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}var gf=`CaptureConsole`,_f=Ml(((e={})=>{let t=e.levels||rr,n=e.handled??!0;return{name:gf,setup(e){`console`in M&&ff(({args:r,level:i})=>{F()!==e||!t.includes(i)||vf(r,i,n)})}}}));function vf(e,t,n){let r=hf(t),i=Error(),a={level:hf(t),extra:{arguments:e}};ua(o=>{if(o.addEventProcessor(e=>(e.logger=`console`,Ni(e,{handled:n,type:`auto.core.capture_console`}),e)),t===`assert`){if(!e[0]){let t=`Assertion failed: ${Ci(e.slice(1),` `)||`console.assert`}`;o.setExtra(`arguments`,e.slice(1)),o.captureMessage(t,r,{captureContext:a,syntheticException:i})}return}let s=e.find(e=>e instanceof Error);if(s){Qc(s,a);return}let c=Ci(e,` `);o.captureMessage(c,r,{captureContext:a,syntheticException:i})})}var yf=`Dedupe`,bf=Ml((()=>{let e;return{name:yf,processEvent(t){if(t.type)return t;try{if(xf(t,e))return j&&N.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}}));function xf(e,t){return t?!!(Sf(e,t)||Cf(e,t)):!1}function Sf(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Tf(e,t)||!wf(e,t))}function Cf(e,t){let n=Ef(t),r=Ef(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Tf(e,t)||!wf(e,t))}function wf(e,t){let n=vr(e),r=vr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function Tf(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join(``)===r.join(``)}catch{return!1}}function Ef(e){return e.exception?.values?.[0]}var Df=`ExtraErrorData`,Of=Ml(((e={})=>{let{depth:t=3,captureErrorCause:n=!0}=e;return{name:Df,processEvent(e,r,i){let{maxValueLength:a}=i.getOptions();return kf(e,r,t,n,a)}}}));function kf(e,t={},n,r,i){if(!t.originalException||!Mr(t.originalException))return e;let a=t.originalException.name||t.originalException.constructor.name,o=Af(t.originalException,r,i);if(o){let t={...e.contexts},r=fi(o,n);return Br(r)&&(oi(r),t[a]=r),{...e,contexts:t}}return e}function Af(e,t,n){try{let r=[`name`,`message`,`stack`,`line`,`column`,`fileName`,`lineNumber`,`columnNumber`,`toJSON`],i={};for(let t of Object.keys(e)){if(r.indexOf(t)!==-1)continue;let a=e[t];i[t]=Mr(a)||typeof a==`string`?n?xi(`${a}`,n):`${a}`:a}if(t&&e.cause!==void 0&&(i.cause=Mr(e.cause)?{[e.cause.name||e.cause.constructor.name]:Af(e.cause,!1,n)}:e.cause),typeof e.toJSON==`function`){let t=e.toJSON();for(let e of Object.keys(t)){let n=t[e];i[e]=Mr(n)?n.toString():n}}return i}catch(e){j&&N.error(`Unable to extract extra data from the Error object:`,e)}return null}function jf(e,t){let n=0;for(let t=e.length-1;t>=0;t--){let r=e[t];r===`.`?e.splice(t,1):r===`..`?(e.splice(t,1),n++):n&&(e.splice(t,1),n--)}if(t)for(;n--;)e.unshift(`..`);return e}var Mf=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Nf(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=Mf.exec(t);return n?n.slice(1):[]}function Pf(...e){let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:`/`;i&&(t=`${i}/${t}`,n=i.charAt(0)===`/`)}return t=jf(t.split(`/`).filter(e=>!!e),!n).join(`/`),(n?`/`:``)+t||`.`}function Ff(e){let t=0;for(;t<e.length&&e[t]===``;t++);let n=e.length-1;for(;n>=0&&e[n]===``;n--);return t>n?[]:e.slice(t,n-t+1)}function If(e,t){e=Pf(e).slice(1),t=Pf(t).slice(1);let n=Ff(e.split(`/`)),r=Ff(t.split(`/`)),i=Math.min(n.length,r.length),a=i;for(let e=0;e<i;e++)if(n[e]!==r[e]){a=e;break}let o=[];for(let e=a;e<n.length;e++)o.push(`..`);return o=o.concat(r.slice(a)),o.join(`/`)}function Lf(e,t){let n=Nf(e)[2]||``;return t&&n.slice(t.length*-1)===t&&(n=n.slice(0,n.length-t.length)),n}var Rf=`RewriteFrames`,zf=Ml((e={})=>{let t=e.root,n=e.prefix||`app:///`,r=`window`in M&&!!M.window,i=e.iteratee||Bf({isBrowser:r,root:t,prefix:n});function a(e){try{return{...e,exception:{...e.exception,values:e.exception.values.map(e=>({...e,...e.stacktrace&&{stacktrace:o(e.stacktrace)}}))}}}catch{return e}}function o(e){return{...e,frames:e?.frames?.map(e=>i(e))}}return{name:Rf,processEvent(e){let t=e;return e.exception&&Array.isArray(e.exception.values)&&(t=a(t)),t}}});function Bf({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;let i=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes(`\\`)&&!r.filename.includes(`/`),a=/^\//.test(r.filename);if(e){if(t){let e=r.filename;e.indexOf(t)===0&&(r.filename=e.replace(t,n))}}else if(i||a){let e=i?r.filename.replace(/^[a-zA-Z]:/,``).replace(/\\/g,`/`):r.filename;r.filename=`${n}${t?If(t,e):Lf(e)}`}return r}}var Vf=[`reauthenticate`,`signInAnonymously`,`signInWithOAuth`,`signInWithIdToken`,`signInWithOtp`,`signInWithPassword`,`signInWithSSO`,`signOut`,`signUp`,`verifyOtp`],Hf=[`createUser`,`deleteUser`,`listUsers`,`getUserById`,`updateUserById`,`inviteUserByEmail`],Uf={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`},Wf=[`select`,`insert`,`upsert`,`update`,`delete`];function Gf(e){try{e.__SENTRY_INSTRUMENTED__=!0}catch{}}function Kf(e){try{return e.__SENTRY_INSTRUMENTED__}catch{return!1}}function qf(e,t){if(Object.keys(t).length>0)return t;if(Array.isArray(e)&&e.length>0)return e}function Jf(e,t){return qf(e,t)!==void 0}function Yf(e,t){if(!e)return;if(typeof e.get==`function`)return e.get(t)??void 0;let n=e,r=t.toLowerCase(),i=Object.keys(n).find(e=>e.toLowerCase()===r);return i===void 0?void 0:n[i]}function Xf(e,t={}){switch(e){case`GET`:return`select`;case`POST`:return Yf(t,`Prefer`)?.includes(`resolution=`)?`upsert`:`insert`;case`PATCH`:return`update`;case`DELETE`:return`delete`;default:return`<unknown-op>`}}function Zf(e,t){if(t===``||t===`*`)return`select(*)`;if(e===`select`)return`select(${t})`;if(e===`or`||e.endsWith(`.or`))return`${e}${t}`;let[n,...r]=t.split(`.`),i;return i=n?.startsWith(`fts`)?`textSearch`:n?.startsWith(`plfts`)?`textSearch[plain]`:n?.startsWith(`phfts`)?`textSearch[phrase]`:n?.startsWith(`wfts`)?`textSearch[websearch]`:n&&Uf[n]||`filter`,`${i}(${e}, ${r.join(`.`)})`}function Qf(e,t=!1){return new Proxy(e,{apply(n,r,i){return Ps({name:`auth ${t?`(admin) `:``}${e.name}`,attributes:{[I]:`auto.db.supabase`,[ma]:`db`,"db.system":`postgresql`,"db.operation":`auth.${t?`admin.`:``}${e.name}`}},e=>Reflect.apply(n,r,i).then(t=>(Vr(t)&&`error`in t&&t.error?(e.setStatus({code:2}),Qc(t.error,{mechanism:{handled:!1,type:`auto.db.supabase.auth`}})):e.setStatus({code:1}),e.end(),t)).catch(t=>{throw e.setStatus({code:2}),e.end(),Qc(t,{mechanism:{handled:!1,type:`auto.db.supabase.auth`}}),t}).then(...i))}})}function $f(e){let t=e.auth;if(!(!t||Kf(e.auth))){for(let n of Vf){let r=t[n];r&&typeof e.auth[n]==`function`&&(e.auth[n]=Qf(r))}for(let n of Hf){let r=t.admin[n];r&&typeof e.auth.admin[n]==`function`&&(e.auth.admin[n]=Qf(r,!0))}Gf(e.auth)}}function ep(e,t){Kf(e.prototype.from)||(e.prototype.from=new Proxy(e.prototype.from,{apply(e,n,r){let i=Reflect.apply(e,n,r),a=i.constructor;return np(a,t),i}}),Gf(e.prototype.from))}function tp(e,t){Kf(e.prototype.then)||(e.prototype.then=new Proxy(e.prototype.then,{apply(e,n,r){let i=Wf,a=n,o=Xf(a.method,a.headers);if(!i.includes(o)||!a?.url?.pathname||typeof a.url.pathname!=`string`)return Reflect.apply(e,n,r);let s=a.url.pathname.split(`/`),c=s.length>0?s[s.length-1]:``,l=[];for(let[e,t]of a.url.searchParams.entries())l.push(Zf(e,t));let u=Object.create(null);if(Br(a.body))for(let[e,t]of Object.entries(a.body))u[e]=t;let d=F(),f=t.sendOperationData??d?.getDataCollectionOptions().databaseQueryData===!0,p=qf(a.body,u),m=o===`select`?``:`${o}${Jf(a.body,u)?`(...) `:``}`,h=f?l.join(` `):l.length>0?`[redacted]`:``,g=[m.trimEnd(),h].filter(Boolean).join(` `),_=g?`${g} from(${c})`:`from(${c})`,v={"db.table":c,"db.schema":a.schema,"db.url":a.url.origin,"db.sdk":Yf(a.headers,`X-Client-Info`),"db.system":`postgresql`,"db.operation":o,[I]:`auto.db.supabase`,[ma]:`db`};return l.length&&f&&(v[`db.query`]=l),p!==void 0&&f&&(v[`db.body`]=p),Ps({name:_,attributes:v},t=>Reflect.apply(e,n,[]).then(e=>{if(t&&(e&&typeof e==`object`&&`status`in e&&Aa(t,e.status||500),t.end()),e?.error){let t=Error(e.error.message);e.error.code&&(t.code=e.error.code),e.error.details&&(t.details=e.error.details);let n={};l.length&&f&&(n.query=l),p!==void 0&&f&&(n.body=p),Qc(t,e=>(e.addEventProcessor(e=>(Ni(e,{handled:!1,type:`auto.db.supabase.postgres`}),e)),e.setContext(`supabase`,n),e))}let n={type:`supabase`,category:`db.${o}`,message:_},r={};return l.length&&f&&(r.query=l),p!==void 0&&f&&(r.body=p),Object.keys(r).length&&(n.data=r),Nd(n),e},e=>{throw t&&(Aa(t,500),t.end()),e}).then(...r))}}),Gf(e.prototype.then))}function np(e,t){for(let n of Wf)Kf(e.prototype[n])||(e.prototype[n]=new Proxy(e.prototype[n],{apply(e,r,i){let a=Reflect.apply(e,r,i),o=a.constructor;return j&&N.log(`Instrumenting ${n} operation's PostgRESTFilterBuilder`),tp(o,t),a}}),Gf(e.prototype[n]))}var rp=(e,t={})=>{if(!e){j&&N.warn(`Supabase integration was not installed because no Supabase client was provided.`);return}ep(e.constructor===Function?e:e.constructor,t),$f(e)},ip=`Supabase`,ap=((e,t)=>({setupOnce(){rp(e,t)},name:ip})),op=Ml(e=>ap(e.supabaseClient,{sendOperationData:e.sendOperationData})),sp=10,cp=`ZodErrors`;function lp(e){return Mr(e)&&e.name===`ZodError`&&Array.isArray(e.issues)}function up(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 dp(e){return e.map(e=>typeof e==`number`?`<array>`:e).join(`.`)}function fp(e){let t=new Set;for(let n of e.issues){let e=dp(n.path);e.length>0&&t.add(e)}let n=Array.from(t);if(n.length===0){let t=`variable`;if(e.issues.length>0){let n=e.issues[0];n!==void 0&&`expected`in n&&typeof n.expected==`string`&&(t=n.expected)}return`Failed to validate ${t}`}return`Failed to validate keys: ${xi(n.join(`, `),100)}`}function pp(e,t=!1,n,r){if(!n.exception?.values||!r.originalException||!lp(r.originalException)||r.originalException.issues.length===0)return n;try{let i=(t?r.originalException.issues:r.originalException.issues.slice(0,e)).map(up);return t&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({filename:`zod_issues.json`,data:JSON.stringify({issues:i})})),{...n,exception:{...n.exception,values:[{...n.exception.values[0],value:fp(r.originalException)},...n.exception.values.slice(1)]},extra:{...n.extra,"zoderror.issues":i.slice(0,e)}}}catch(e){return{...n,extra:{...n.extra,"zoderrors sentry integration parse error":{message:`an exception was thrown while processing ZodError within applyZodErrorsToEvent()`,error:e instanceof Error?`${e.name}: ${e.message}
|
|
19
|
+
${e.stack}`:`unknown`}}}}}var mp=Ml(((e={})=>{let t=e.limit??sp;return{name:cp,processEvent(n,r){return pp(t,e.saveZodIssuesAsAttachment,n,r)}}})),hp=Ml(e=>({name:`ThirdPartyErrorsFilter`,setup(e){e.on(`beforeEnvelope`,e=>{es(e,(e,t)=>{if(t===`event`){let t=Array.isArray(e)?e[1]:void 0;t&&(lf(t),e[1]=t)}})}),e.on(`applyFrameMetadata`,t=>{if(t.type)return;let n=e.getOptions().stackParser;cf(n,t)})},preprocessEvent(t){e.ignoreSentryInternalFrames&&(M._sentryWrappedDepth??0)>0&&(t.sdkProcessingMetadata={...t.sdkProcessingMetadata,insideSentryWrapped:!0})},processEvent(t){let n=e.ignoreSentryInternalFrames?t.sdkProcessingMetadata?.insideSentryWrapped===!0&&t.exception?.values?.length===1:!1,r=_p(t,e.ignoreSentryInternalFrames,n);if(r&&r[e.behaviour===`drop-error-if-contains-third-party-frames`||e.behaviour===`apply-tag-if-contains-third-party-frames`?`some`:`every`](t=>!t.some(t=>e.filterKeys.includes(t)))){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 gp(e,t,n){if(t!==0)return!1;if(n&&vp(e)||e.function===`sentryWrapped`)return!0;if(!e.context_line||!e.filename||!e.filename.includes(`sentry`)||!e.filename.includes(`helpers`)||!e.context_line.includes(xp))return!1;if(e.pre_context){let t=e.pre_context.length;for(let n=0;n<t;n++)if(e.pre_context[n]?.includes(bp))return!0}return!1}function _p(e,t,n){let r=vr(e);if(r)return r.filter((e,r)=>!e.filename||e.lineno==null&&e.colno==null&&e.instruction_addr==null?!1:!t||!gp(e,r,!!n)).map(e=>e.module_metadata?Object.keys(e.module_metadata).filter(e=>e.startsWith(yp)).map(e=>e.slice(yp.length)):[])}function vp(e){return!e.context_line&&!e.pre_context&&!!e.function&&e.function.length<=2}var yp=`_sentryBundlerPluginAppKey:`,bp=`Attempt to invoke user-land function`,xp=`fn.apply(this, wrappedArguments)`,Sp=`flag.evaluation.`;function Cp(e){if(e.type)return e;let t=P().getScopeData().contexts.flags,n=t?t.values:[];return n.length?(e.contexts===void 0&&(e.contexts={}),e.contexts.flags={values:[...n]},e):e}function wp(e,t,n=100){let r=P().getScopeData().contexts;r.flags||={values:[]};let i=r.flags.values;Tp(i,e,t,n)}function Tp(e,t,n,r){if(typeof n!=`boolean`)return;if(e.length>r){j&&N.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`);return}let i=e.findIndex(e=>e.flag===t);i!==-1&&e.splice(i,1),e.length===r&&e.shift(),e.push({flag:t,result:n})}function Ep(e,t,n=10){if(typeof t!=`boolean`)return;let r=No();if(!r)return;let i=L(r).data;if(`${Sp}${e}`in i){r.setAttribute(`${Sp}${e}`,t);return}Object.keys(i).filter(e=>e.startsWith(Sp)).length<n&&r.setAttribute(`${Sp}${e}`,t)}var Dp=Ml(()=>({name:`FeatureFlags`,processEvent(e,t,n){return Cp(e)},addFeatureFlag(e,t){wp(e,t),Ep(e,t)}})),Op=Ml(({growthbookClass:e})=>({name:`GrowthBook`,setupOnce(){let t=e.prototype;typeof t.isOn==`function`&&qr(t,`isOn`,kp),typeof t.getFeatureValue==`function`&&qr(t,`getFeatureValue`,kp)},processEvent(e,t,n){return Cp(e)}}));function kp(e){return function(...t){let n=t[0],r=e.apply(this,t);return typeof n==`string`&&typeof r==`boolean`&&(wp(n,r),Ep(n,r)),r}}var Ap=`ConversationId`,jp=Ml((()=>({name:Ap,setup(e){e.on(`spanStart`,e=>{let t=P().getScopeData(),n=ca().getScopeData(),r=t.conversationId||n.conversationId;if(r){let{op:t,data:n,description:i}=L(e);if(!t?.startsWith(`gen_ai.`)&&!n[`ai.operationId`]&&!i?.startsWith(`ai.`))return;e.setAttribute(Oa,r)}})}})));function Mp(e,t,n,r,i){if(!e.fetchData)return;let{method:a,url:o}=e.fetchData,s=Lo()&&t(o);if(e.endTimestamp){let t=e.fetchData.__span;if(!t)return;let n=r[t];n&&(s&&(Fp(n,e),Np(n,e,i)),delete r[t]);return}let{spanOrigin:c=`auto.http.browser`,propagateTraceparent:l=!1}=typeof i==`object`?i:{spanOrigin:i},u=F(),d=!!No(),f=d||!!u&&Cs(u),p=s&&f?Is(zp(o,a,c)):new Vo,m=Qs(p)&&d?void 0:p;if(s&&!f&&u?.recordDroppedEvent(`no_parent_span`,`span`),e.fetchData.__span=p.spanContext().spanId,r[p.spanContext().spanId]=p,n(e.fetchData.url)){let t=e.args[0],n={...e.args[1]||{}},r=Pp(t,n,Lo()&&f?m:void 0,l);r&&(e.args[1]=n,n.headers=r)}if(u){let t={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};u.emit(`beforeOutgoingRequestSpan`,p,t)}return p}function Np(e,t,n){(typeof n==`object`&&n?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function Pp(e,t,n,r){let i=kd({span:n,propagateTraceparent:r}),a=i[`sentry-trace`],o=i.baggage,s=i.traceparent;if(!a)return;let c=t.headers||(Kr(e)?e.headers:void 0);if(!c)return{"sentry-trace":a,...o&&{baggage:o},...s&&{traceparent:s}};if(Lp(c)){let e=new Headers(c);if(e.get(`sentry-trace`)||e.set(`sentry-trace`,a),r&&s&&!e.get(`traceparent`)&&e.set(`traceparent`,s),o){let t=e.get(`baggage`);t?Ip(t)||e.set(`baggage`,`${t},${o}`):e.set(`baggage`,o)}return e}if(Rp(c)){let e=[...c];e.find(e=>e[0]===`sentry-trace`)||e.push([`sentry-trace`,a]),r&&s&&!e.find(e=>e[0]===`traceparent`)&&e.push([`traceparent`,s]);let t=c.find(e=>e[0]===`baggage`&&typeof e[1]==`string`&&Ip(e[1]));return o&&!t&&e.push([`baggage`,o]),e}{let e=`sentry-trace`in c?c[`sentry-trace`]:void 0,t=`traceparent`in c?c.traceparent:void 0,n=`baggage`in c?c.baggage:void 0,i=n?Array.isArray(n)?[...n]:[n]:[],l=n&&(Array.isArray(n)?n.find(e=>Ip(e)):Ip(n));o&&!l&&i.push(o);let u=Object.assign({},c,{"sentry-trace":e??a,...i.length>0&&{baggage:i.join(`,`)}});return r&&s&&!t&&(u.traceparent=s),u}}function Fp(e,t){if(t.response){Aa(e,t.response.status);let n=t.response?.headers?.get(`content-length`);if(n){let t=parseInt(n);t>0&&e.setAttribute(`http.response_content_length`,t)}}else t.error&&e.setStatus({code:2,message:`internal_error`});e.end()}function Ip(e){return typeof e==`string`&&e.split(`,`).some(e=>e.trim().startsWith(Ra))}function Lp(e){return typeof Headers<`u`&&Gr(e,Headers)}function Rp(e){return Array.isArray(e)?e.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]==`string`):!1}function zp(e,t,n){if(e.startsWith(`data:`))return{name:`${t} ${yd(e)}`,attributes:Bp(e,void 0,t,n)};let r=hd(e);return{name:`${t} ${r?gd(r):e}`,attributes:Bp(e,r,t,n)}}function Bp(e,t,n,r){let i={url:yd(e),type:`fetch`,"http.method":n,[I]:r,[ma]:`http.client`};return t&&(md(t)||(i[kc]=yd(t.href),i[Ic]=yd(t.href),i[`server.address`]=t.host),t.search&&(i[`http.query`]=t.search),t.hash&&(i[`http.fragment`]=t.hash)),i}function Vp(e,t={},n=P()){let{message:r,name:i,email:a,url:o,source:s,associatedEventId:c,tags:l}=e,u={contexts:{feedback:{contact_email:a,name:i,message:r,url:o,source:s,associated_event_id:c}},type:`feedback`,level:`info`,tags:l},d=n?.getClient()||F();return d&&d.emit(`beforeSendFeedback`,u,t),n.captureEvent(u,t)}var Hp=e({debug:()=>Gp,error:()=>Jp,fatal:()=>Yp,fmt:()=>Ed,info:()=>Kp,trace:()=>Wp,warn:()=>qp});function Up(e,t,n,r,i){Yl({level:e,message:t,attributes:n,severityNumber:i},r)}function Wp(e,t,{scope:n}={}){Up(`trace`,e,t,n)}function Gp(e,t,{scope:n}={}){Up(`debug`,e,t,n)}function Kp(e,t,{scope:n}={}){Up(`info`,e,t,n)}function qp(e,t,{scope:n}={}){Up(`warn`,e,t,n)}function Jp(e,t,{scope:n}={}){Up(`error`,e,t,n)}function Yp(e,t,{scope:n}={}){Up(`fatal`,e,t,n)}function Xp(e,t,n){return`util`in M&&typeof M.util.format==`function`?M.util.format(...e):Zp(e,t,n)}function Zp(e,t,n){return e.map(e=>zr(e)?String(e):JSON.stringify(fi(e,t,n))).join(` `)}function Qp(e){return/%[sdifocO]/.test(e)}function $p(e,t){let n={};return n[`sentry.message.template`]=`${e} ${Array(t.length).fill(`{}`).join(` `)}`,t.forEach((e,t)=>{n[`sentry.message.parameter.${t}`]=e}),n}var em=`ConsoleLogs`,tm={[I]:`auto.log.console`},nm=Ml(((e={})=>{let t=e.levels||rr;return{name:em,setup(e){let{enableLogs:n,normalizeDepth:r=3,normalizeMaxBreadth:i=1e3}=e.getOptions();if(!n){j&&N.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}let a=ff(({args:n,level:a})=>{if(F()!==e||!t.includes(a))return;let o=n[0],s=n.slice(1);if(a===`assert`){o||Yl({level:`error`,message:s.length>0?`Assertion failed: ${Xp(s,r,i)}`:`Assertion failed`,attributes:tm});return}let c=a===`log`,l={...tm};if(Br(o)){Object.assign(l,fi(o,r,i));let e=typeof n[1]==`string`?2:1;n.slice(e).forEach((e,t)=>{l[`sentry.message.parameter.${t}`]=fi(e,r,i)})}else if(s.length>0&&typeof o==`string`&&!Qp(o)){let e=$p(o,s);for(let[t,n]of Object.entries(e))l[t]=t.startsWith(`sentry.message.parameter.`)?fi(n,r,i):n}Yl({level:c?`info`:a,message:Xp(n,r,i),severityNumber:c?10:void 0,attributes:l})});e.registerCleanup(a)}}})),rm=e({count:()=>am,distribution:()=>sm,gauge:()=>om});function im(e,t,n,r){cu({type:e,name:t,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope})}function am(e,t=1,n){im(`counter`,e,t,n)}function om(e,t,n){im(`gauge`,e,t,n)}function sm(e,t,n){im(`distribution`,e,t,n)}var cm=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`];function lm(e={}){let t=new Set(e.levels??cm),n=e.client;return{log(e){let{type:r,level:i,message:a,args:o,tag:s,date:c,...l}=e,u=n||F();if(!u)return;let d=fm(r,i);if(!t.has(d))return;let{normalizeDepth:f=3,normalizeMaxBreadth:p=1e3}=u.getOptions(),m={};for(let[e,t]of Object.entries(l))m[e]=fi(t,f,p);m[`sentry.origin`]=`auto.log.consola`,s&&(m[`consola.tag`]=s),r&&(m[`consola.type`]=r),i!=null&&typeof i==`number`&&(m[`consola.level`]=i);let h=mm(pm(o,f,p),f,p);h?.attributes&&Object.assign(m,h.attributes),Yl({level:d,message:h?.message||a||o&&Xp(o,f,p)||``,attributes:m})}}}var um={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`},dm={0:`fatal`,1:`warn`,2:`info`,3:`info`,4:`debug`,5:`trace`};function fm(e,t){if(e===`verbose`)return`debug`;if(e===`silent`)return`trace`;if(e){let t=um[e];if(t)return t}if(typeof t==`number`){let e=dm[t];if(e)return e}return`info`}function pm(e,t,n){if(!e?.length)return{message:``};let r=Xp(e,t,n),i=e[0];if(Br(i)){let t=typeof e[1]==`string`?2:1;return{message:r,attributes:i,messageParameters:e.slice(t)}}{let t=e.slice(1),n=t.length>0&&typeof i==`string`&&!Qp(i);return{message:r,messageTemplate:n?i:void 0,messageParameters:n?t:void 0}}}function mm(e,t,n){let{message:r,attributes:i,messageTemplate:a,messageParameters:o}=e,s={};if(a&&o){let e=$p(a,o);for(let[r,i]of Object.entries(e))s[r]=r.startsWith(`sentry.message.parameter.`)?fi(i,t,n):i}else o&&o.length>0&&o.forEach((e,r)=>{s[`sentry.message.parameter.${r}`]=fi(e,t,n)});return{message:r,attributes:{...fi(i,t,n),...s}}}var hm=`gen_ai.prompt`,gm=`gen_ai.system`,_m=`gen_ai.request.model`,vm=`gen_ai.request.stream`,ym=`gen_ai.request.temperature`,bm=`gen_ai.request.max_tokens`,xm=`gen_ai.request.frequency_penalty`,Sm=`gen_ai.request.presence_penalty`,Cm=`gen_ai.request.top_p`,wm=`gen_ai.request.top_k`,Tm=`gen_ai.request.encoding_format`,Em=`gen_ai.request.dimensions`,Dm=`gen_ai.response.finish_reasons`,Om=`gen_ai.response.model`,km=`gen_ai.response.id`,Am=`gen_ai.response.stop_reason`,jm=`gen_ai.usage.input_tokens`,Mm=`gen_ai.usage.output_tokens`,Nm=`gen_ai.usage.total_tokens`,Pm=`gen_ai.operation.name`,Fm=`sentry.sdk_meta.gen_ai.input.messages.original_length`,Im=`gen_ai.input.messages`,Lm=`gen_ai.system_instructions`,Rm=`gen_ai.response.text`,zm=`gen_ai.request.available_tools`,Bm=`gen_ai.response.streaming`,Vm=`gen_ai.response.tool_calls`,Hm=`gen_ai.agent.name`,Um=`gen_ai.pipeline.name`,Wm=`gen_ai.conversation.id`,Gm=`gen_ai.usage.cache_creation_input_tokens`,Km=`gen_ai.usage.cache_read_input_tokens`,qm=`gen_ai.invoke_agent`,Jm=`gen_ai.embeddings.input`,Ym=`gen_ai.embeddings`,Xm=`gen_ai.execute_tool`,Zm=`gen_ai.tool.name`,Qm=`gen_ai.tool.call.id`,$m=`gen_ai.tool.type`,eh=`gen_ai.tool.input`,th=`gen_ai.tool.output`,nh=`gen_ai.tool.description`;function rh(e){return!e||typeof e!=`object`?!1:oh(e)||sh(e)||ih(e)||ch(e)||lh(e)||uh(e)||dh(e)||fh(e)||ph(e)||mh(e)||hh(e)||gh(e)}function ih(e){return`image_url`in e?typeof e.image_url==`string`?e.image_url.startsWith(`data:`):ah(e):!1}function ah(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 oh(e){return`type`in e&&typeof e.type==`string`&&`source`in e&&rh(e.source)}function sh(e){return`inlineData`in e&&!!e.inlineData&&typeof e.inlineData==`object`&&`data`in e.inlineData&&typeof e.inlineData.data==`string`}function ch(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 lh(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 uh(e){return`media_type`in e&&typeof e.media_type==`string`&&`data`in e}function dh(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 fh(e){return`type`in e&&e.type===`image`&&`image`in e&&typeof e.image==`string`&&!e.image.startsWith(`http://`)&&!e.image.startsWith(`https://`)}function ph(e){return`type`in e&&(e.type===`blob`||e.type===`base64`)}function mh(e){return`b64_json`in e}function hh(e){return`type`in e&&`result`in e&&e.type===`image_generation`}function gh(e){return`uri`in e&&typeof e.uri==`string`&&e.uri.startsWith(`data:`)}var _h=`[Blob substitute]`,vh=[`image_url`,`data`,`content`,`b64_json`,`result`,`uri`,`image`];function yh(e){let t={...e};rh(t.source)&&(t.source=yh(t.source)),sh(e)&&(t.inlineData={...e.inlineData,data:_h}),ah(e)&&(t.image_url={...e.image_url,url:_h}),ch(e)&&(t.input_audio={...e.input_audio,data:_h}),lh(e)&&(t.file={...e.file,file_data:_h});for(let e of vh)typeof t[e]==`string`&&(t[e]=_h);return t}var bh=2e4,xh=e=>new TextEncoder().encode(e).length,Sh=e=>xh(JSON.stringify(e));function Ch(e,t){if(xh(e)<=t)return e;let n=0,r=e.length,i=``;for(;n<=r;){let a=Math.floor((n+r)/2),o=e.slice(0,a);xh(o)<=t?(i=o,n=a+1):r=a-1}return i}function wh(e){return typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``}function Th(e,t){return typeof e==`string`?t:{...e,text:t}}function Eh(e){return typeof e==`object`&&!!e&&`content`in e&&typeof e.content==`string`}function Dh(e){return typeof e==`object`&&!!e&&`content`in e&&Array.isArray(e.content)}function Oh(e){return typeof e==`object`&&!!e&&`parts`in e&&Array.isArray(e.parts)&&e.parts.length>0}function kh(e,t){let n=t-Sh({...e,content:``});if(n<=0)return[];let r=Ch(e.content,n);return[{...e,content:r}]}function Ah(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 jh(e,t){let{key:n,items:r}=Ah(e);if(n===null||r.length===0)return[];let i=r.map(e=>Th(e,``)),a=t-Sh({...e,[n]:i});if(a<=0)return[];let o=[];for(let e of r){let t=wh(e),n=xh(t);if(n<=a)o.push(e),a-=n;else if(o.length===0){let n=Ch(t,a);n&&o.push(Th(e,n));break}else break}return o.length<=0?[]:[{...e,[n]:o}]}function Mh(e,t){if(!e)return[];if(typeof e==`string`){let n=Ch(e,t);return n?[n]:[]}return typeof e==`object`?Eh(e)?kh(e,t):Dh(e)||Oh(e)?jh(e,t):[]:[]}function Nh(e){return e.map(e=>{let t;return e&&typeof e==`object`&&(Dh(e)?t={...e,content:Nh(e.content)}:`content`in e&&rh(e.content)&&(t={...e,content:yh(e.content)}),Oh(e)&&(t={...t??e,parts:Nh(e.parts)}),rh(t)?t=yh(t):rh(e)&&(t=yh(e))),t??e})}function Ph(e,t){if(!Array.isArray(e)||e.length===0)return e;let n=t-2,r=e[e.length-1],i=Nh([r]),a=i[0];return Sh(a)<=n?i:Mh(a,n)}function Fh(e){return Ph(e,bh)}function Ih(e){return Ch(e,bh)}function Lh(e){let t=F()?.getDataCollectionOptions().genAI;return{...e,recordInputs:e?.recordInputs??t?.inputs??!1,recordOutputs:e?.recordOutputs??t?.outputs??!1}}function Rh(e){if(e!==void 0)return e;let t=F();return!t||!Cs(t)&&t.getOptions().streamGenAiSpans===!1}function zh(e,t){return e?`${e}.${t}`:t}function Bh(e,t,n,r,i){if(t!==void 0&&e.setAttributes({[jm]:t}),n!==void 0&&e.setAttributes({[Mm]:n}),t!==void 0||n!==void 0||r!==void 0||i!==void 0){let a=(t??0)+(n??0)+(r??0)+(i??0);e.setAttributes({[Nm]:a})}}function Vh(e,t,n){if(!e.isRecording())return;let r={[Bm]:!0};t.responseId&&(r[km]=t.responseId),t.responseModel&&(r[Om]=t.responseModel),t.promptTokens!==void 0&&(r[jm]=t.promptTokens),t.completionTokens!==void 0&&(r[Mm]=t.completionTokens),t.totalTokens===void 0?(t.promptTokens!==void 0||t.completionTokens!==void 0||t.cacheCreationInputTokens!==void 0||t.cacheReadInputTokens!==void 0)&&(r[Nm]=(t.promptTokens??0)+(t.completionTokens??0)+(t.cacheCreationInputTokens??0)+(t.cacheReadInputTokens??0)):r[Nm]=t.totalTokens,t.finishReasons.length&&(r[Dm]=JSON.stringify(t.finishReasons)),n&&t.responseTexts.length&&(r[Rm]=t.responseTexts.join(``)),n&&t.toolCalls.length&&(r[Vm]=JSON.stringify(t.toolCalls)),e.setAttributes(r),e.end()}function Hh(e){if(typeof e==`string`)return Ih(e);try{return JSON.stringify(Array.isArray(e)?Fh(e):e)}catch{return`[unserializable]`}}function Uh(e){if(!Array.isArray(e))return{systemInstructions:void 0,filteredMessages:e};let t=e.findIndex(e=>e&&typeof e==`object`&&`role`in e&&e.role===`system`);if(t===-1)return{systemInstructions:void 0,filteredMessages:e};let n=e[t],r=typeof n.content==`string`?n.content:n.content===void 0?void 0:JSON.stringify(n.content);return r?{systemInstructions:JSON.stringify([{type:`text`,content:r}]),filteredMessages:[...e.slice(0,t),...e.slice(t+1)]}:{systemInstructions:void 0,filteredMessages:e}}async function Wh(e,t){let[n,r]=await Promise.all([t,e]);return r&&typeof r==`object`&&`data`in r?{...r,data:n}:n}function Gh(e,t){return Wr(e)?new Proxy(e,{get(e,n){let r=n in Promise.prototype||n===Symbol.toStringTag?t:e,i=Reflect.get(r,n);return n===`withResponse`&&typeof i==`function`?function(){return Wh(i.call(e),t)}:typeof i==`function`?i.bind(r):i}}):t}var Kh={"responses.create":{operation:`chat`},"chat.completions.create":{operation:`chat`},"embeddings.create":{operation:`embeddings`},"conversations.create":{operation:`chat`}},qh=[`response.created`,`response.in_progress`,`response.failed`,`response.completed`,`response.incomplete`,`response.queued`,`response.output_text.delta`,`response.output_item.added`,`response.function_call_arguments.delta`,`response.function_call_arguments.done`,`response.output_item.done`];function Jh(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`&&e.type.startsWith(`response.`)}function Yh(e){return typeof e==`object`&&!!e&&`object`in e&&e.object===`chat.completion.chunk`}function Xh(e,t,n){if(!t||typeof t!=`object`)return;let r=t,i={};if(typeof r.id==`string`&&(i[km]=r.id),typeof r.model==`string`&&(i[Om]=r.model),r.object===`conversation`&&typeof r.id==`string`&&(i[Wm]=r.id),r.usage&&typeof r.usage==`object`){let e=r.usage,t=e.prompt_tokens??e.input_tokens;typeof t==`number`&&(i[jm]=t);let n=e.completion_tokens??e.output_tokens;typeof n==`number`&&(i[Mm]=n),typeof e.total_tokens==`number`&&(i[Nm]=e.total_tokens)}if(Array.isArray(r.choices)){let e=r.choices,t=e.map(e=>e.finish_reason).filter(e=>typeof e==`string`);if(t.length>0&&(i[Dm]=JSON.stringify(t)),n){let t=e.map(e=>e.message?.content||``);i[Rm]=JSON.stringify(t);let n=e.map(e=>e.message?.tool_calls).filter(e=>Array.isArray(e)&&e.length>0).flat();n.length>0&&(i[Vm]=JSON.stringify(n))}}if(typeof r.status==`string`&&(i[`gen_ai.response.finish_reasons`]||(i[Dm]=JSON.stringify([r.status]))),n&&(typeof r.output_text==`string`&&!i[`gen_ai.response.text`]&&(i[Rm]=r.output_text),Array.isArray(r.output)&&r.output.length>0&&!i[`gen_ai.response.tool_calls`])){let e=r.output.filter(e=>e?.type===`function_call`);e.length>0&&(i[Vm]=JSON.stringify(e))}e.setAttributes(i)}function Zh(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 Qh(e){let t={[_m]:e.model??`unknown`};`temperature`in e&&(t[ym]=e.temperature),`top_p`in e&&(t[Cm]=e.top_p),`frequency_penalty`in e&&(t[xm]=e.frequency_penalty),`presence_penalty`in e&&(t[Sm]=e.presence_penalty),`stream`in e&&(t[vm]=e.stream),`encoding_format`in e&&(t[Tm]=e.encoding_format),`dimensions`in e&&(t[Em]=e.dimensions);let n=Zh(e);return n&&(t[Wm]=n),t}function $h(e,t){for(let n of e){let e=n.index;if(!(e===void 0||!n.function))if(!(e in t.chatCompletionToolCalls))t.chatCompletionToolCalls[e]={...n,function:{name:n.function.name,arguments:n.function.arguments||``}};else{let r=t.chatCompletionToolCalls[e];n.function.arguments&&r?.function&&(r.function.arguments+=n.function.arguments)}}}function eg(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(let r of e.choices??[])n&&(r.delta?.content&&t.responseTexts.push(r.delta.content),r.delta?.tool_calls&&$h(r.delta.tool_calls,t)),r.finish_reason&&t.finishReasons.push(r.finish_reason)}function tg(e,t,n,r){if(!(e&&typeof e==`object`)){t.eventTypes.push(`unknown:non-object`);return}if(e instanceof Error){r.setStatus({code:2,message:`internal_error`}),Qc(e,{mechanism:{handled:!1,type:`auto.ai.openai.stream-response`}});return}if(!(`type`in e))return;let i=e;if(!qh.includes(i.type)){t.eventTypes.push(i.type);return}if(n&&(i.type===`response.output_item.done`&&`item`in i&&t.responsesApiToolCalls.push(i.item),i.type===`response.output_text.delta`&&`delta`in i&&i.delta)){t.responseTexts.push(i.delta);return}if(`response`in i){let{response:e}=i;t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.input_tokens,t.completionTokens=e.usage.output_tokens,t.totalTokens=e.usage.total_tokens),e.status&&t.finishReasons.push(e.status),n&&e.output_text&&t.responseTexts.push(e.output_text)}}async function*ng(e,t,n){let r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(let i of e)Yh(i)?eg(i,r,n):Jh(i)&&tg(i,r,n,t),yield i}finally{let e=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];Vh(t,{...r,toolCalls:e},n)}}function rg(e){let t=Array.isArray(e.tools)?e.tools:[],n=e.web_search_options&&typeof e.web_search_options==`object`?[{type:`web_search_options`,...e.web_search_options}]:[],r=[...t,...n];if(r.length!==0)try{return JSON.stringify(r)}catch(e){j&&N.error(`Failed to serialize OpenAI tools:`,e);return}}function ig(e,t){let n={[gm]:`openai`,[Pm]:t,[I]:`auto.ai.openai`};if(e.length>0&&typeof e[0]==`object`&&e[0]!==null){let t=e[0],r=rg(t);r&&(n[zm]=r),Object.assign(n,Qh(t))}else n[_m]=`unknown`;return n}function ag(e,t,n,r){if(n===`embeddings`&&`input`in t){let n=t.input;if(n==null||typeof n==`string`&&n.length===0||Array.isArray(n)&&n.length===0)return;e.setAttribute(Jm,typeof n==`string`?n:JSON.stringify(n));return}let i=`input`in t?t.input:`messages`in t?t.messages:void 0;if(!i||Array.isArray(i)&&i.length===0)return;let{systemInstructions:a,filteredMessages:o}=Uh(i);a&&e.setAttribute(Lm,a),e.setAttribute(Im,r?Hh(o):bi(o)),Array.isArray(o)?e.setAttribute(Fm,o.length):e.setAttribute(Fm,1)}function og(e,t,n,r,i){return function(...t){let a=n.operation||`unknown`,o=ig(t,a),s=o[`gen_ai.request.model`]||`unknown`,c=t[0],l=c&&typeof c==`object`&&c.stream===!0,u={name:`${a} ${s}`,op:`gen_ai.${a}`,attributes:o};if(l){let n,o=Fs(u,o=>(n=e.apply(r,t),i.recordInputs&&c&&ag(o,c,a,Rh(i.enableTruncation)),(async()=>{try{return ng(await n,o,i.recordOutputs??!1)}catch(e){throw o.setStatus({code:2,message:`internal_error`}),o.end(),e}})()));return Gh(n,o)}let d,f=Ps(u,n=>(d=e.apply(r,t),i.recordInputs&&c&&ag(n,c,a,Rh(i.enableTruncation)),d.then(e=>(Xh(n,e,i.recordOutputs),e))));return Gh(d,f)}}function sg(e,t=``,n){return new Proxy(e,{get(e,r){let i=e[r],a=zh(t,String(r)),o=Kh[a];return typeof i==`function`&&o?og(i,a,o,e,n):typeof i==`function`?i.bind(e):i&&typeof i==`object`?sg(i,a,n):i}})}function cg(e,t){return sg(e,``,Lh(t))}var lg={"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 ug(e,t,n){if(Array.isArray(t)&&t.length===0)return;let{systemInstructions:r,filteredMessages:i}=Uh(t);r&&e.setAttributes({[Lm]:r});let a=Array.isArray(i)?i.length:1;e.setAttributes({[Im]:n?Hh(i):bi(i),[Fm]:a})}var dg={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 fg(e){return e&&dg[e]||`internal_error`}function pg(e,t){t.error&&(e.setStatus({code:2,message:fg(t.error.type)}),Qc(t.error,{mechanism:{handled:!1,type:`auto.ai.anthropic.anthropic_error`}}))}function mg(e){let{system:t,messages:n,input:r}=e,i=typeof t==`string`?[{role:`system`,content:e.system}]:[],a=(Array.isArray(r)?r:r==null?void 0:[r])??(Array.isArray(n)?n:n==null?[]:[n]);return[...i,...a]}function hg(e,t){return`type`in e&&typeof e.type==`string`&&e.type===`error`&&(t.setStatus({code:2,message:fg(e.error?.type)}),!0)}function gg(e,t){if(e.type===`message_delta`&&(e.usage&&typeof e.usage.output_tokens==`number`&&(t.completionTokens=e.usage.output_tokens),e.delta?.stop_reason&&t.finishReasons.push(e.delta.stop_reason)),e.message){let n=e.message;n.id&&(t.responseId=n.id),n.model&&(t.responseModel=n.model),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 _g(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 vg(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`){let n=t.activeToolBlocks[e.index];n&&n.inputJsonParts.push(e.delta.partial_json)}n&&typeof e.delta.text==`string`&&t.responseTexts.push(e.delta.text)}}function yg(e,t){if(e.type!==`content_block_stop`||typeof e.index!=`number`)return;let n=t.activeToolBlocks[e.index];if(!n)return;let r=n.inputJsonParts.join(``),i;try{i=r?JSON.parse(r):{}}catch{i={__unparsed:r}}t.toolCalls.push({type:`tool_use`,id:n.id,name:n.name,input:i}),delete t.activeToolBlocks[e.index]}function bg(e,t,n,r){e&&typeof e==`object`&&(hg(e,r)||(gg(e,t),_g(e,t),vg(e,t,n),yg(e,t)))}async function*Hte(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(let i of e)bg(i,r,n,t),yield i}finally{Vh(t,r,n)}}function Ute(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on(`streamEvent`,e=>{bg(e,r,n,t)}),e.on(`message`,()=>{Vh(t,r,n)}),e.on(`error`,e=>{Qc(e,{mechanism:{handled:!1,type:`auto.ai.anthropic.stream_error`}}),t.isRecording()&&(t.setStatus({code:2,message:`internal_error`}),t.end())}),e}var xg=!1,Sg=new WeakSet;function Wte(e,t,n){let r={[gm]:`anthropic`,[Pm]:n,[I]:`auto.ai.anthropic`};if(e.length>0&&typeof e[0]==`object`&&e[0]!==null){let t=e[0];t.tools&&Array.isArray(t.tools)&&(r[zm]=JSON.stringify(t.tools)),r[_m]=t.model??`unknown`,`temperature`in t&&(r[ym]=t.temperature),`top_p`in t&&(r[Cm]=t.top_p),`stream`in t&&(r[vm]=t.stream),`top_k`in t&&(r[wm]=t.top_k),`frequency_penalty`in t&&(r[xm]=t.frequency_penalty),`max_tokens`in t&&(r[bm]=t.max_tokens)}else r[_m]=t===`models.retrieve`||t===`models.get`?e[0]:`unknown`;return r}function Cg(e,t,n){ug(e,mg(t),n),`prompt`in t&&e.setAttributes({[hm]:JSON.stringify(t.prompt)})}function Gte(e,t){if(`content`in t&&Array.isArray(t.content)){e.setAttributes({[Rm]:t.content.map(e=>e.text).filter(e=>!!e).join(``)});let n=[];for(let e of t.content)(e.type===`tool_use`||e.type===`server_tool_use`)&&n.push(e);n.length>0&&e.setAttributes({[Vm]:JSON.stringify(n)})}`completion`in t&&e.setAttributes({[Rm]:t.completion}),`input_tokens`in t&&e.setAttributes({[Rm]:JSON.stringify(t.input_tokens)})}function Kte(e,t){`id`in t&&`model`in t&&(e.setAttributes({[km]:t.id,[Om]:t.model}),`usage`in t&&t.usage&&Bh(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}function qte(e,t,n){if(!(!t||typeof t!=`object`)){if(`type`in t&&t.type===`error`){pg(e,t);return}n&&Gte(e,t),Kte(e,t)}}function wg(e,t){throw t.isRecording()&&(t.setStatus({code:2,message:`internal_error`}),t.end()),e}function Jte(e,t,n,r,i,a,o,s,c,l){let u={name:`${i} ${r[`gen_ai.request.model`]??`unknown`}`,op:`gen_ai.${i}`,attributes:r};if(c&&!l){let r,i=Fs(u,i=>(r=e.apply(t,n),s.recordInputs&&o&&Cg(i,o,Rh(s.enableTruncation)),(async()=>{try{return Hte(await r,i,s.recordOutputs??!1)}catch(e){return wg(e,i)}})()));return Gh(r,i)}return Fs(u,r=>{try{s.recordInputs&&o&&Cg(r,o,Rh(s.enableTruncation)),xg=!0;let i=e.apply(t,n);return xg=!1,Ute(i,r,s.recordOutputs??!1)}catch(e){return xg=!1,wg(e,r)}})}function Yte(e,t,n,r,i){return new Proxy(e,{apply(e,a,o){let s=a===void 0?r:a,c=n.streaming===!0;if(!c&&xg)return e.apply(s,o);let l=n.operation||`unknown`,u=Wte(o,t,l),d=u[`gen_ai.request.model`]??`unknown`,f=typeof o[0]==`object`?o[0]:void 0,p=!!f?.stream;if(p||c)return Jte(e,s,o,u,l,t,f,i,p,c);let m,h=Ps({name:`${l} ${d}`,op:`gen_ai.${l}`,attributes:u},t=>(m=e.apply(s,o),i.recordInputs&&f&&Cg(t,f,Rh(i.enableTruncation)),m.then(e=>(qte(t,e,i.recordOutputs),e))));return Gh(m,h)}})}function Xte(e,t){for(let n of Object.keys(lg)){let r=n.split(`.`),i=r.pop(),a=e;for(let e of r)a=a?.[e];if(!a||typeof a[i]!=`function`)continue;let o=a[i];if(Sg.has(o))continue;let s=Yte(o,n,lg[n],a,t);Sg.add(s),a[i]=s}return e}function Zte(e,t){return Xte(e,Lh(t))}var Qte={"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}},$te=`google_genai`;function ene(e,t){let n=e?.promptFeedback;if(n?.blockReason){let e=n.blockReasonMessage??n.blockReason;return t.setStatus({code:2,message:`internal_error`}),Qc(`Content blocked: ${e}`,{mechanism:{handled:!1,type:`auto.ai.google_genai`}}),!0}return!1}function tne(e,t){typeof e.responseId==`string`&&(t.responseId=e.responseId),typeof e.modelVersion==`string`&&(t.responseModel=e.modelVersion);let 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 nne(e,t,n){Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(let r of e.candidates??[]){r?.finishReason&&!t.finishReasons.includes(r.finishReason)&&t.finishReasons.push(r.finishReason);for(let e of r?.content?.parts??[])n&&e.text&&t.responseTexts.push(e.text),e.functionCall&&t.toolCalls.push({type:`function`,id:e.functionCall.id,name:e.functionCall.name,arguments:e.functionCall.args})}}function rne(e,t,n,r){!e||ene(e,r)||(tne(e,t),nne(e,t,n))}async function*ine(e,t,n){let r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let i of e)rne(i,r,n,t),yield i}finally{Vh(t,r,n)}}function Tg(e,t=`user`){return typeof e==`string`?[{role:t,content:e}]:Array.isArray(e)?e.flatMap(e=>Tg(e,t)):typeof e!=`object`||!e?[]:`role`in e&&typeof e.role==`string`?[e]:`parts`in e?[{...e,role:t}]:[{role:t,content:e}]}function Eg(e,t){if(`model`in e&&typeof e.model==`string`)return e.model;if(t&&typeof t==`object`){let e=t;if(`model`in e&&typeof e.model==`string`)return e.model;if(`modelVersion`in e&&typeof e.modelVersion==`string`)return e.modelVersion}return`unknown`}function ane(e){let t={};return`temperature`in e&&typeof e.temperature==`number`&&(t[ym]=e.temperature),`topP`in e&&typeof e.topP==`number`&&(t[Cm]=e.topP),`topK`in e&&typeof e.topK==`number`&&(t[wm]=e.topK),`maxOutputTokens`in e&&typeof e.maxOutputTokens==`number`&&(t[bm]=e.maxOutputTokens),`frequencyPenalty`in e&&typeof e.frequencyPenalty==`number`&&(t[xm]=e.frequencyPenalty),`presencePenalty`in e&&typeof e.presencePenalty==`number`&&(t[Sm]=e.presencePenalty),t}function one(e,t,n){let r={[gm]:$te,[Pm]:e,[I]:`auto.ai.google_genai`};if(t){if(r[_m]=Eg(t,n),`config`in t&&typeof t.config==`object`&&t.config){let e=t.config;if(Object.assign(r,ane(e)),`tools`in e&&Array.isArray(e.tools)){let t=e.tools.flatMap(e=>e.functionDeclarations);r[zm]=JSON.stringify(t)}}}else r[_m]=Eg({},n);return r}function Dg(e,t,n,r){if(n===`embeddings`){let n=t.contents;n!=null&&e.setAttribute(Jm,typeof n==`string`?n:JSON.stringify(n));return}let i=[];if(`config`in t&&t.config&&typeof t.config==`object`&&`systemInstruction`in t.config&&t.config.systemInstruction&&i.push(...Tg(t.config.systemInstruction,`system`)),`history`in t&&i.push(...Tg(t.history,`user`)),`contents`in t&&i.push(...Tg(t.contents,`user`)),`message`in t&&i.push(...Tg(t.message,`user`)),Array.isArray(i)&&i.length){let{systemInstructions:t,filteredMessages:n}=Uh(i);t&&e.setAttribute(Lm,t);let a=Array.isArray(n)?n.length:0;e.setAttributes({[Fm]:a,[Im]:r?Hh(n):bi(n)})}}function sne(e,t,n){if(!(!t||typeof t!=`object`)){if(t.modelVersion&&e.setAttribute(Om,t.modelVersion),t.usageMetadata&&typeof t.usageMetadata==`object`){let n=t.usageMetadata;typeof n.promptTokenCount==`number`&&e.setAttributes({[jm]:n.promptTokenCount}),typeof n.candidatesTokenCount==`number`&&e.setAttributes({[Mm]:n.candidatesTokenCount}),typeof n.totalTokenCount==`number`&&e.setAttributes({[Nm]:n.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){let n=t.candidates.map(e=>e.content?.parts&&Array.isArray(e.content.parts)?e.content.parts.map(e=>typeof e.text==`string`?e.text:``).filter(e=>e.length>0).join(``):``).filter(e=>e.length>0);n.length>0&&e.setAttributes({[Rm]:n.join(``)})}if(n&&t.functionCalls){let n=t.functionCalls;Array.isArray(n)&&n.length>0&&e.setAttributes({[Vm]:JSON.stringify(n)})}}}function cne(e,t,n,r,i){let a=n.operation===`embeddings`;return new Proxy(e,{apply(e,t,o){let s=n.operation||`unknown`,c=o[0],l=one(s,c,r),u=l[`gen_ai.request.model`]??`unknown`;return n.streaming?Fs({name:`${s} ${u}`,op:`gen_ai.${s}`,attributes:l},async t=>{try{return i.recordInputs&&c&&Dg(t,c,s,Rh(i.enableTruncation)),ine(await e.apply(r,o),t,!!i.recordOutputs)}catch(e){throw t.setStatus({code:2,message:`internal_error`}),t.end(),e}}):Ps({name:`${s} ${u}`,op:`gen_ai.${s}`,attributes:l},t=>(i.recordInputs&&c&&Dg(t,c,s,Rh(i.enableTruncation)),As(()=>e.apply(r,o),()=>{},()=>{},e=>{a||sne(t,e,i.recordOutputs)})))}})}function Og(e,t=``,n){return new Proxy(e,{get:(e,r,i)=>{let a=Reflect.get(e,r,i),o=zh(t,String(r)),s=Qte[o];if(typeof a==`function`&&s){let t=s.operation?cne(a,o,s,e,n):a.bind(e);return s.proxyResultPath?function(...e){let r=t(...e);return r&&typeof r==`object`?Og(r,s.proxyResultPath,n):r}:t}return typeof a==`function`?a.bind(e):a&&typeof a==`object`?Og(a,o,n):a}})}function lne(e,t){return Og(e,``,Lh(t))}var kg=`auto.ai.langchain`,une={human:`user`,ai:`assistant`,assistant:`assistant`,system:`system`,function:`function`,tool:`tool`},Ag=(e,t,n)=>{n!=null&&(e[t]=n)},jg=(e,t,n)=>{let r=Number(n);Number.isNaN(r)||(e[t]=r)};function Mg(e){if(Array.isArray(e))try{let t=e.map(e=>e&&typeof e==`object`&&rh(e)?yh(e):e);return JSON.stringify(t)}catch{return String(e)}return bi(e,String)}function Ng(e){let t=e.toLowerCase();return une[t]??t}function Pg(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 Fg(e){if(!(!e||Array.isArray(e)))return e.invocation_params}function Ig(e){return e.map(e=>{let t=e._getType;if(typeof t==`function`)return{role:Ng(t.call(e)),content:Mg(e.content)};if(e.lc===1&&e.kwargs){let t=e.id,n=Array.isArray(t)&&t.length>0?t[t.length-1]:``;return{role:Ng(typeof n==`string`?Pg(n):`user`),content:Mg(e.kwargs?.content)}}if(e.type)return{role:Ng(String(e.type).toLowerCase()),content:Mg(e.content)};if(e.role)return{role:Ng(String(e.role)),content:Mg(e.content)};let n=e.constructor?.name;return n&&n!==`Object`?{role:Ng(Pg(n)),content:Mg(e.content)}:{role:`user`,content:Mg(e.content)}})}function dne(e,t,n){let r={},i=`kwargs`in e?e.kwargs:void 0;jg(r,ym,t?.temperature??n?.ls_temperature??i?.temperature),jg(r,bm,t?.max_tokens??n?.ls_max_tokens??i?.max_tokens),jg(r,Cm,t?.top_p??i?.top_p);let a=t?.frequency_penalty;jg(r,xm,a);let o=t?.presence_penalty;return jg(r,Sm,o),t&&`stream`in t&&Ag(r,vm,!!t.stream),r}function Lg(e,t,n,r,i){return{[gm]:bi(e??`langchain`,String),[Pm]:`chat`,[_m]:bi(t,String),[I]:kg,...dne(n,r,i)}}function fne(e,t,n,r,i,a){let o=a?.ls_provider,s=Lg(o,i?.model??a?.ls_model_name??`unknown`,e,i,a);if(n&&Array.isArray(t)&&t.length>0){Ag(s,Fm,t.length);let e=t.map(e=>({role:`user`,content:e}));Ag(s,Im,r?Hh(e):bi(e))}return s}function pne(e,t,n,r,i,a){let o=Lg(a?.ls_provider??e.id?.[2],i?.model??a?.ls_model_name??`unknown`,e,i,a);if(n&&Array.isArray(t)&&t.length>0){let{systemInstructions:e,filteredMessages:n}=Uh(Ig(t.flat()));e&&Ag(o,Lm,e),Ag(o,Fm,Array.isArray(n)?n.length:0),Ag(o,Im,r?Hh(n):bi(n))}return o}function mne(e,t){let n=[],r=e.flat();for(let e of r){let t=e.message?.tool_calls;if(Array.isArray(t)&&t.length>0)n.push(...t);else{let t=e.message?.content;if(Array.isArray(t))for(let e of t){let t=e;t.type===`tool_use`&&n.push(t)}}}n.length>0&&Ag(t,Vm,bi(n,String))}function hne(e,t){if(!e)return;let n=e.tokenUsage,r=e.usage;if(n)jg(t,jm,n.promptTokens),jg(t,Mm,n.completionTokens),jg(t,Nm,n.totalTokens);else if(r){jg(t,jm,r.input_tokens),jg(t,Mm,r.output_tokens);let e=Number(r.input_tokens),n=Number(r.output_tokens),i=(Number.isNaN(e)?0:e)+(Number.isNaN(n)?0:n);i>0&&jg(t,Nm,i),r.cache_creation_input_tokens!==void 0&&jg(t,Gm,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&jg(t,Km,r.cache_read_input_tokens)}}function gne(e,t){if(!e)return;let n={};if(Array.isArray(e.generations)){let r=e.generations.flat().map(e=>e.generationInfo?.finish_reason?e.generationInfo.finish_reason:e.generation_info?.finish_reason?e.generation_info.finish_reason:null).filter(e=>typeof e==`string`);if(r.length>0&&Ag(n,Dm,bi(r,String)),mne(e.generations,n),t){let t=e.generations.flat().map(e=>e.text??e.message?.content).filter(e=>typeof e==`string`);t.length>0&&Ag(n,Rm,bi(t,String))}}hne(e.llmOutput,n);let r=e.llmOutput,i=e.generations?.[0]?.[0]?.message,a=r?.model_name??r?.model??i?.response_metadata?.model_name;a&&Ag(n,Om,a);let o=r?.id??i?.id;o&&Ag(n,km,o);let s=r?.stop_reason??i?.response_metadata?.finish_reason;return s&&Ag(n,Am,bi(s,String)),n}function Rg(e){let t={},n=e?.lc_agent_name;return typeof n==`string`&&(t[Hm]=n),t}function _ne(e){let t=e?.invocation_params?.tools??e?.options?.tools;if(!Array.isArray(t)||t.length===0)return;let n=t.map(e=>{let t=e.function;return{type:`function`,name:e.name??t?.name??``,description:e.description??t?.description}});return JSON.stringify(n)}function vne(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.addHandler==`function`&&typeof t.copy==`function`}function yne(e){return typeof e==`object`&&e?.name===`SentryCallbackHandler`}function zg(e){return e.some(yne)}function bne(e,t){if(!e)return[t];if(vne(e)){if(zg(e.handlers??[]))return e;let n=e.copy();return n.addHandler(t,!0),n}let n=Array.isArray(e)?e:[e];return zg(n)?e:[...n,t]}function Bg(e={}){let{recordInputs:t,recordOutputs:n}=Lh(e),r=Rh(e.enableTruncation),i=new Map,a=e=>{let t=i.get(e);t?.isRecording()&&(t.end(),i.delete(e))},o={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(e,n,a,o,s,c,l,u){let d=Fg(c),f=fne(e,n,t,r,d,l),p=f[_m],m=f[Pm];Fs({name:`${m} ${p}`,op:`gen_ai.chat`,attributes:{...Rg(l),...f,[ma]:`gen_ai.chat`}},e=>(i.set(a,e),e))},handleChatModelStart(e,n,a,o,s,c,l,u){let d=Fg(c),f=pne(e,n,t,r,d,l),p=_ne(s);p&&(f[zm]=p);let m=f[_m],h=f[Pm];Fs({name:`${h} ${m}`,op:`gen_ai.chat`,attributes:{...Rg(l),...f,[ma]:`gen_ai.chat`}},e=>(i.set(a,e),e))},handleLLMEnd(e,t,r,o,s){let c=i.get(t);if(c?.isRecording()){let r=gne(e,n);r&&c.setAttributes(r),a(t)}},handleLLMError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t))},handleChainStart(e,n,r,a,o,s,c,l){if(s?.__sentry_langgraph__)return;let u=l||e.name||`unknown_chain`,d={[I]:`auto.ai.langchain`,"langchain.chain.name":u};t&&(d[`langchain.chain.inputs`]=JSON.stringify(n)),Fs({name:`chain ${u}`,op:`gen_ai.invoke_agent`,attributes:{...d,[ma]:`gen_ai.invoke_agent`}},e=>(i.set(r,e),e))},handleChainEnd(e,t){let r=i.get(t);r?.isRecording()&&(n&&r.setAttributes({"langchain.chain.outputs":JSON.stringify(e)}),a(t))},handleChainError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t))},handleToolStart(e,n,r,a,o,s,c){if(s?.__sentry_langgraph__)return;let l=c||e.name||`unknown_tool`,u={...Rg(s),[I]:kg,[Pm]:`execute_tool`,[Zm]:l};t&&(u[eh]=n),Fs({name:`execute_tool ${l}`,op:`gen_ai.execute_tool`,attributes:{...u,[ma]:`gen_ai.execute_tool`}},e=>(i.set(r,e),e))},handleToolEnd(e,t){let r=i.get(t);if(r?.isRecording()){if(n){let t=e,n=t&&typeof t==`object`&&`content`in t?t.content:e;r.setAttributes({[th]:typeof n==`string`?n:JSON.stringify(n)})}a(t)}},handleToolError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t))},copy(){return o},toJSON(){return{lc:1,type:`not_implemented`,id:o.lc_id}},toJSONNotImplemented(){return{lc:1,type:`not_implemented`,id:o.lc_id}}};return o}function xne(e){let 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 Sne(e){let t=e??{},n={[I]:kg,[ma]:Ym,[Pm]:`embeddings`,[_m]:t.model??`unknown`};return n[gm]=xne(t),`dimensions`in t&&(n[Em]=t.dimensions),`encodingFormat`in t&&(n[Tm]=t.encodingFormat),n}function Cne(e,t,n={}){let{recordInputs:r}=Lh(n),i=Sne(e),a=i[`gen_ai.request.model`]||`unknown`;return r&&t!=null&&(i[Jm]=typeof t==`string`?t:JSON.stringify(t)),{name:`embeddings ${a}`,op:Ym,attributes:i}}function Vg(e,t={}){return new Proxy(e,{apply(e,n,r){return Ps(Cne(n,r[0],t),()=>Reflect.apply(e,n,r))}})}function wne(e,t){let n=e;return typeof n.embedQuery==`function`&&(n.embedQuery=Vg(n.embedQuery,t)),typeof n.embedDocuments==`function`&&(n.embedDocuments=Vg(n.embedDocuments,t)),e}var Hg=`auto.ai.langgraph`;function Tne(e){let t=e[0];if(typeof t!=`object`||!t||!(`llm`in t)||!t.llm||typeof t.llm!=`object`)return null;let n=t.llm;return typeof n.modelName!=`string`&&typeof n.model!=`string`?null:n}function Ene(e){let t=e[0];return typeof t==`object`&&t&&`name`in t&&typeof t.name==`string`?t.name:null}function Dne(e,t,n){let r=`__sentry_tool_wrapped__`;for(let i of e){if(!i||typeof i!=`object`)continue;let e=i,a=e.invoke;if(typeof a!=`function`||Object.prototype.hasOwnProperty.call(e,r))continue;let o=typeof e.name==`string`?e.name:`unknown_tool`,s=typeof e.description==`string`?e.description:void 0;e.invoke=new Proxy(a,{apply(e,r,i){let a={[I]:Hg,[ma]:Xm,[Pm]:`execute_tool`,[Zm]:o,[$m]:`function`},c=i[1]?.metadata?.lc_agent_name??n;typeof c==`string`&&(a[Hm]=c),s&&(a[nh]=s);let l=i[0];if(typeof l==`object`&&l&&(`id`in l&&typeof l.id==`string`&&(a[Qm]=l.id),t.recordInputs)){let e=`args`in l&&typeof l.args==`object`?l.args:l;try{a[eh]=JSON.stringify(e)}catch{}}return Ps({op:Xm,name:`execute_tool ${o}`,attributes:a},async n=>{try{let a=await Reflect.apply(e,r,i);if(t.recordOutputs)try{let e=a,t=e&&typeof e==`object`&&`content`in e?e.content:a;n.setAttribute(th,typeof t==`string`?t:JSON.stringify(t))}catch{}return a}catch(e){throw n.setStatus({code:2,message:`internal_error`}),e}})}}),Object.defineProperty(e,r,{value:!0,enumerable:!1})}return e}function One(e){if(!e||e.length===0)return null;let t=[];for(let n of e)if(n&&typeof n==`object`){let e=n.tool_calls;e&&Array.isArray(e)&&t.push(...e)}return t.length>0?t:null}function kne(e){let t=e,n=0,r=0,i=0;if(t.usage_metadata&&typeof t.usage_metadata==`object`){let e=t.usage_metadata;return typeof e.input_tokens==`number`&&(n=e.input_tokens),typeof e.output_tokens==`number`&&(r=e.output_tokens),typeof e.total_tokens==`number`&&(i=e.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:i}}if(t.response_metadata&&typeof t.response_metadata==`object`){let e=t.response_metadata;if(e.tokenUsage&&typeof e.tokenUsage==`object`){let t=e.tokenUsage;typeof t.promptTokens==`number`&&(n=t.promptTokens),typeof t.completionTokens==`number`&&(r=t.completionTokens),typeof t.totalTokens==`number`&&(i=t.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:i}}function Ane(e,t){let n=t;if(n.response_metadata&&typeof n.response_metadata==`object`){let t=n.response_metadata;t.model_name&&typeof t.model_name==`string`&&e.setAttribute(Om,t.model_name),t.finish_reason&&typeof t.finish_reason==`string`&&e.setAttribute(Dm,[t.finish_reason])}}function jne(e){if(!e.builder?.nodes?.tools?.runnable?.tools)return null;let t=e.builder?.nodes?.tools?.runnable?.tools;return!t||!Array.isArray(t)||t.length===0?null:t.map(e=>({name:e.lc_kwargs?.name,description:e.lc_kwargs?.description,schema:e.lc_kwargs?.schema}))}function Mne(e,t,n){let r=n?.messages;if(!r||!Array.isArray(r))return;let i=t?.length??0,a=r.length>i?r.slice(i):[];if(a.length===0)return;let o=One(a);o&&e.setAttribute(Vm,JSON.stringify(o));let s=Ig(a);e.setAttribute(Rm,JSON.stringify(s));let c=0,l=0,u=0;for(let t of a){let n=kne(t);c+=n.inputTokens,l+=n.outputTokens,u+=n.totalTokens,Ane(e,t)}c>0&&e.setAttribute(jm,c),l>0&&e.setAttribute(Mm,l),u>0&&e.setAttribute(Nm,u)}var Ug=!1,Wg=`__sentry_patched__`;function Nne(e){let t={[I]:Hg,[ma]:`gen_ai.create_agent`,[Pm]:`create_agent`};return e&&(t[Hm]=e),{op:`gen_ai.create_agent`,name:e?`create_agent ${e}`:`create_agent`,attributes:t}}function Pne(e,t){if(Object.prototype.hasOwnProperty.call(e,Wg))return e;let n=Bg(t),r=new Proxy(e,{apply(e,r,i){return Ug?Reflect.apply(e,r,i):Ps(Nne(),a=>{try{let o=Reflect.apply(e,r,i),s=i.length>0?i[0]:{};s?.name&&typeof s.name==`string`&&(a.setAttribute(Hm,s.name),a.updateName(`create_agent ${s.name}`));let c=o.invoke;return c&&typeof c==`function`&&(o.invoke=Gg(c.bind(o),o,s,t,void 0,n)),o}catch(e){throw a.setStatus({code:2,message:`internal_error`}),e}})}});return Object.defineProperty(r,Wg,{value:!0,enumerable:!1}),r}function Gg(e,t,n,r,i,a){return new Proxy(e,{apply(e,o,s){let c=i?.modelName??i?.model;return Ps({op:`gen_ai.invoke_agent`,name:`invoke_agent`,attributes:{[I]:Hg,[ma]:qm,[Pm]:`invoke_agent`}},async i=>{try{let l=n?.name;l&&typeof l==`string`&&(i.setAttribute(Um,l),i.setAttribute(Hm,l),i.updateName(`invoke_agent ${l}`)),c&&i.setAttribute(_m,c);let u=(s.length>1?s[1]:void 0)?.configurable?.thread_id;if(u&&typeof u==`string`&&i.setAttribute(Wm,u),a){let e=s[1]??{};s[1]=e,e.metadata={...e.metadata??{},__sentry_langgraph__:!0,...typeof l==`string`?{lc_agent_name:l}:{}},e.callbacks=bne(e.callbacks,a)}let d=jne(t);d&&i.setAttribute(zm,JSON.stringify(d));let f=r.recordInputs,p=r.recordOutputs,m=s.length>0?s[0]?.messages??[]:[];if(m&&f){let{systemInstructions:e,filteredMessages:t}=Uh(Ig(m));e&&i.setAttribute(Lm,e);let n=Rh(r.enableTruncation),a=Array.isArray(t)?t.length:0;i.setAttributes({[Im]:n?Hh(t):bi(t),[Fm]:a})}let h=await Reflect.apply(e,o,s);return p&&Mne(i,m??null,h),h}catch(e){throw i.setStatus({code:2,message:`internal_error`}),e}})}})}function Fne(e,t){if(Object.prototype.hasOwnProperty.call(e,Wg))return e;let n=Lh(t),r=Bg(n),i=new Proxy(e,{apply(e,t,i){let a=Tne(i),o=Ene(i),s=i[0];s&&Array.isArray(s.tools)&&s.tools.length>0&&Dne(s.tools,n,o??void 0),Ug=!0;let c;try{c=Reflect.apply(e,t,i)}finally{Ug=!1}let l=c.invoke;if(l&&typeof l==`function`){let e={};o&&(e.name=o),c.invoke=Gg(l.bind(c),c,e,n,a,r)}return c}});return Object.defineProperty(i,Wg,{value:!0,enumerable:!1}),i}function Kg(e,t){return e.compile=Pne(e.compile,Lh(t)),e}var Ine=Kg;function Lne(e,t,n){let r=n.getOptions(),i=n.getDsn(),a=r.tunnel,o=fs(r._metadata),s={sent_at:new Date(ri()).toISOString(),...Rne(t)&&{trace:t},...o&&{sdk:o},...!!a&&i&&{dsn:qa(i)}},c=n.getDataCollectionOptions().userInfo?`auto`:`never`;return Qo(s,[[{type:`span`,item_count:e.length,content_type:`application/vnd.sentry.items.span.v2+json`},{version:2,...Hl()&&{ingest_settings:{infer_ip:c,infer_user_agent:c}},items:e}]])}function Rne(e){return!!e.trace_id&&!!e.public_key}function zne(e){let t=156;if(t+=e.name.length*2,t+=aa(e.attributes),e.links&&e.links.length>0){let n=e.links[0]?.attributes,r=100+(n?aa(n):0);t+=r*e.links.length}return t}var qg=1e3,Bne=5e6,Vne=class{constructor(e,t){this._traceBuckets=new Map,this._client=e;let{maxSpanLimit:n,flushInterval:r,maxTraceWeightInBytes:i}=t??{};this._maxSpanLimit=n&&n>0&&n<=qg?n:qg,this._flushInterval=r&&r>0?r:5e3,this._maxTraceWeight=i&&i>0?i:Bne,this._client.on(`flush`,()=>{this.drain()}),this._client.on(`close`,()=>{this._traceBuckets.forEach(e=>{clearTimeout(e.timeout)}),this._traceBuckets.clear()})}add(e){let t=e.trace_id,n=this._traceBuckets.get(t);n||(n={spans:new Set,size:0,timeout:yl(setTimeout(()=>{this.flush(t)},this._flushInterval))},this._traceBuckets.set(t,n)),n.spans.add(e),n.size+=zne(e),(n.spans.size>=this._maxSpanLimit||n.size>=this._maxTraceWeight)&&this.flush(t)}drain(){this._traceBuckets.size&&(j&&N.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((e,t)=>{this.flush(t)}))}flush(e){let t=this._traceBuckets.get(e);if(!t)return;if(!t.spans.size){this._removeTrace(e);return}let n=Array.from(t.spans),r=n[0]?._segmentSpan;if(!r){j&&N.warn(`No segment span reference found on span JSON, cannot compute DSC`),this._removeTrace(e);return}let i=Jo(r),a=n.map(e=>{let{_segmentSpan:t,...n}=e;return n}),o=Lne(a,i,this._client);j&&N.log(`Sending span envelope for trace ${e} with ${a.length} spans`),this._client.sendEnvelope(o).then(null,e=>{j&&N.error(`Error while sending streamed span envelope:`,e)}),this._removeTrace(e)}_removeTrace(e){let t=this._traceBuckets.get(e);t&&clearTimeout(t.timeout),this._traceBuckets.delete(e)}};function Jg(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}var Yg=M;function Hne(){return`history`in Yg&&!!Yg.history}function Une(){if(!(`fetch`in Yg))return!1;try{return new Headers,new Request(`data:,`),new Response,!0}catch{return!1}}function Xg(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Zg(){if(typeof EdgeRuntime==`string`)return!0;if(!Une())return!1;if(Xg(Yg.fetch))return!0;let e=!1,t=Yg.document;if(t&&typeof t.createElement==`function`)try{let n=t.createElement(`iframe`);n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=Xg(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){j&&N.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return e}function Wne(){return`ReportingObserver`in Yg}function Qg(e,t){let n=`fetch`,r=Sr(n,e);return Cr(n,()=>$g(void 0,t)),r}function Gne(e){let t=`fetch-body-resolved`,n=Sr(t,e);return Cr(t,()=>$g(qne)),n}function $g(e,t=!1){t&&!Zg()||qr(M,`fetch`,function(t){return function(...n){let r=Error(),{method:i,url:a}=Jne(n),o={args:n,fetchData:{method:i,url:a},startTimestamp:zi()*1e3,virtualError:r,headers:Yne(n)};return e||wr(`fetch`,{...o}),t.apply(M,n).then(async t=>(e?e(t):wr(`fetch`,{...o,endTimestamp:zi()*1e3,response:t}),t),e=>{wr(`fetch`,{...o,endTimestamp:zi()*1e3,error:e}),Mr(e)&&e.stack===void 0&&(e.stack=r.stack,Jr(e,`framesToPop`,1));let t=F()?.getOptions().enhanceFetchErrorMessages??`always`;if(t!==!1&&Mr(e)&&e.name===`TypeError`&&(e.message===`Failed to fetch`||e.message===`Load failed`||e.message===`NetworkError when attempting to fetch resource.`))try{let n=new URL(o.fetchData.url).host;t===`always`?e.message=`${e.message} (${n})`:Jr(e,`__sentry_fetch_url_host__`,n)}catch{}throw e})}})}async function Kne(e,t){if(e?.body){let n=e.body,r=n.getReader(),i=setTimeout(()=>{n.cancel().then(null,()=>{})},9e4),a=!0;for(;a;){let e;try{e=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:i}=await r.read();clearTimeout(e),i&&(t(),a=!1)}catch{a=!1}finally{clearTimeout(e)}}clearTimeout(i),r.releaseLock(),n.cancel().then(null,()=>{})}}function qne(e){let t;try{t=e.clone()}catch{return}Kne(t,()=>{wr(`fetch-body-resolved`,{endTimestamp:zi()*1e3,response:e})})}function e_(e,t){return Vr(e)&&!!e[t]}function t_(e){return typeof e==`string`?e:e?e_(e,`url`)?e.url:e.toString?e.toString():``:``}function Jne(e){if(e.length===0)return{method:`GET`,url:``};if(e.length===2){let[t,n]=e;return{url:t_(t),method:e_(n,`method`)?String(n.method).toUpperCase():Kr(t)&&e_(t,`method`)?String(t.method).toUpperCase():`GET`}}let t=e[0];return{url:t_(t),method:e_(t,`method`)?String(t.method).toUpperCase():`GET`}}function Yne(e){let[t,n]=e;try{if(typeof n==`object`&&n&&`headers`in n&&n.headers)return new Headers(n.headers);if(Kr(t))return new Headers(t.headers)}catch{}}var n_=M;function r_(){try{return n_.document.location.href}catch{return``}}function i_(e,t=5){if(!n_.HTMLElement)return null;let n=e;for(let e=0;e<t;e++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}var a_=M,o_=a_.document,s_=a_.navigator,c_=`Report a Bug`,Xne=`Cancel`,Zne=`Send Bug Report`,Qne=`Confirm`,$ne=`Report a Bug`,ere=`your.email@example.org`,tre=`Email`,nre=`What's the bug? What did you expect?`,rre=`Description`,ire=`Your Name`,are=`Name`,ore=`Thank you for your report!`,sre=`(required)`,cre=`Add a screenshot`,lre=`Remove screenshot`,ure=`Highlight`,dre=`Hide`,fre=`Remove`,l_=`Unable to submit feedback with empty message`,u_=`No client setup, cannot send feedback.`,d_=`Unable to determine if Feedback was correctly sent.`,f_=`Unable to send feedback. This could be because this domain is not in your list of allowed domains.`,p_=`Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.`,pre=`widget`,mre=`api`,hre=5e3,gre={ERROR_EMPTY_MESSAGE:l_,ERROR_NO_CLIENT:u_,ERROR_TIMEOUT:d_,ERROR_FORBIDDEN:f_,ERROR_GENERIC:p_};function m_(e,t){return t?.[e]??gre[e]}function h_(e,t){return Error(m_(e,t))}var g_=(e,t={includeReplay:!0})=>{let n=t.errorMessages;if(!e.message)throw h_(`ERROR_EMPTY_MESSAGE`,n);let r=F();if(!r)throw h_(`ERROR_NO_CLIENT`,n);e.tags&&Object.keys(e.tags).length&&P().setTags(e.tags);let i=Vp({source:mre,url:r_(),...e},t);return new Promise((e,t)=>{let a=setTimeout(()=>{o(),t(m_(`ERROR_TIMEOUT`,n))},3e4),o=r.on(`afterSendEvent`,(r,s)=>{if(r.event_id===i)return clearTimeout(a),o(),s?.statusCode&&s.statusCode>=200&&s.statusCode<300?e(i):s?.statusCode===403?t(m_(`ERROR_FORBIDDEN`,n)):t(m_(`ERROR_GENERIC`,n))})})},__=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;function _re(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(s_.userAgent)||/Macintosh/i.test(s_.userAgent)&&s_.maxTouchPoints&&s_.maxTouchPoints>1||!isSecureContext)}function v_(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 vre(e){let t=o_.createElement(`style`);return t.textContent=`
|
|
20
|
+
.widget__actor {
|
|
21
|
+
position: fixed;
|
|
22
|
+
z-index: var(--z-index);
|
|
23
|
+
margin: var(--page-margin);
|
|
24
|
+
inset: var(--actor-inset);
|
|
25
|
+
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
gap: 8px;
|
|
29
|
+
padding: 16px;
|
|
30
|
+
|
|
31
|
+
font-family: inherit;
|
|
32
|
+
font-size: var(--font-size);
|
|
33
|
+
font-weight: 600;
|
|
34
|
+
line-height: 1.14em;
|
|
35
|
+
text-decoration: none;
|
|
36
|
+
|
|
37
|
+
background: var(--actor-background, var(--background));
|
|
38
|
+
border-radius: var(--actor-border-radius, 1.7em/50%);
|
|
39
|
+
border: var(--actor-border, var(--border));
|
|
40
|
+
box-shadow: var(--actor-box-shadow, var(--box-shadow));
|
|
41
|
+
color: var(--actor-color, var(--foreground));
|
|
42
|
+
fill: var(--actor-color, var(--foreground));
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
opacity: 1;
|
|
45
|
+
transition: transform 0.2s ease-in-out;
|
|
46
|
+
transform: translate(0, 0) scale(1);
|
|
47
|
+
}
|
|
48
|
+
.widget__actor[aria-hidden="true"] {
|
|
49
|
+
opacity: 0;
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
visibility: hidden;
|
|
52
|
+
transform: translate(0, 16px) scale(0.98);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.widget__actor:hover {
|
|
56
|
+
background: var(--actor-hover-background, var(--background));
|
|
57
|
+
filter: var(--interactive-filter);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.widget__actor svg {
|
|
61
|
+
width: 1.14em;
|
|
62
|
+
height: 1.14em;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@media (max-width: 600px) {
|
|
66
|
+
.widget__actor span {
|
|
67
|
+
display: none;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
`,e&&t.setAttribute(`nonce`,e),t}function y_(e,t){return Object.entries(t).forEach(([t,n])=>{e.setAttributeNS(null,t,n)}),e}var b_=20,yre=`http://www.w3.org/2000/svg`;function bre(){let e=e=>a_.document.createElementNS(yre,e),t=y_(e(`svg`),{width:`${b_}`,height:`${b_}`,viewBox:`0 0 ${b_} ${b_}`,fill:`var(--actor-color, var(--foreground))`}),n=y_(e(`g`),{clipPath:`url(#clip0_57_80)`}),r=y_(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);let i=e(`defs`),a=y_(e(`clipPath`),{id:`clip0_57_80`}),o=y_(e(`rect`),{width:`${b_}`,height:`${b_}`,fill:`white`});return a.appendChild(o),i.appendChild(a),t.appendChild(i).appendChild(a).appendChild(o),t}function xre({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){let i=o_.createElement(`button`);if(i.type=`button`,i.className=`widget__actor`,i.ariaHidden=`false`,i.ariaLabel=t||e||c_,i.appendChild(bre()),e){let t=o_.createElement(`span`);t.appendChild(o_.createTextNode(e)),i.appendChild(t)}let a=vre(r);return{el:i,appendToDom(){n.appendChild(a),n.appendChild(i)},removeFromDom(){i.remove(),a.remove()},show(){i.ariaHidden=`false`},hide(){i.ariaHidden=`true`}}}var x_=`rgba(88, 74, 192, 1)`,Sre={foreground:`#2b2233`,background:`#ffffff`,accentForeground:`white`,accentBackground:x_,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%)`},S_={foreground:`#ebe6ef`,background:`#29232f`,accentForeground:`white`,accentBackground:x_,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 C_(e){return`
|
|
71
|
+
--foreground: ${e.foreground};
|
|
72
|
+
--background: ${e.background};
|
|
73
|
+
--accent-foreground: ${e.accentForeground};
|
|
74
|
+
--accent-background: ${e.accentBackground};
|
|
75
|
+
--success-color: ${e.successColor};
|
|
76
|
+
--error-color: ${e.errorColor};
|
|
77
|
+
--border: ${e.border};
|
|
78
|
+
--box-shadow: ${e.boxShadow};
|
|
79
|
+
--outline: ${e.outline};
|
|
80
|
+
--interactive-filter: ${e.interactiveFilter};
|
|
81
|
+
`}function w_({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){let i=o_.createElement(`style`);return i.textContent=`
|
|
82
|
+
:host {
|
|
83
|
+
--font-family: system-ui, 'Helvetica Neue', Arial, sans-serif;
|
|
84
|
+
--font-size: 14px;
|
|
85
|
+
--z-index: 100000;
|
|
86
|
+
|
|
87
|
+
--page-margin: 16px;
|
|
88
|
+
--inset: auto 0 0 auto;
|
|
89
|
+
--actor-inset: var(--inset);
|
|
90
|
+
|
|
91
|
+
font-family: var(--font-family);
|
|
92
|
+
font-size: var(--font-size);
|
|
93
|
+
|
|
94
|
+
${e===`system`?``:`color-scheme: only ${e};`}
|
|
95
|
+
|
|
96
|
+
${C_(e===`dark`?{...S_,...t}:{...Sre,...n})}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
${e===`system`?`
|
|
100
|
+
@media (prefers-color-scheme: dark) {
|
|
101
|
+
:host {
|
|
102
|
+
color-scheme: only dark;
|
|
103
|
+
|
|
104
|
+
${C_({...S_,...t})}
|
|
105
|
+
}
|
|
106
|
+
}`:``}
|
|
107
|
+
`,r&&i.setAttribute(`nonce`,r),i}var T_=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>(({id:r=`sentry-feedback`,autoInject:i=!0,showBranding:a=!0,isEmailRequired:o=!1,isNameRequired:s=!1,showEmail:c=!0,showName:l=!0,enableScreenshot:u=!0,useSentryUser:d={email:`email`,name:`username`},tags:f,styleNonce:p,scriptNonce:m,colorScheme:h=`system`,themeLight:g={},themeDark:_={},addScreenshotButtonLabel:v=cre,cancelButtonLabel:y=Xne,confirmButtonLabel:b=Qne,emailLabel:x=tre,emailPlaceholder:S=ere,formTitle:C=$ne,isRequiredLabel:w=sre,messageLabel:T=rre,messagePlaceholder:ee=nre,nameLabel:E=are,namePlaceholder:te=ire,removeScreenshotButtonLabel:ne=lre,submitButtonLabel:re=Zne,successMessageText:ie=ore,triggerLabel:ae=c_,triggerAriaLabel:oe=``,highlightToolText:D=ure,hideToolText:se=dre,removeHighlightText:ce=fre,errorEmptyMessageText:le=l_,errorNoClientText:ue=u_,errorTimeoutText:de=d_,errorForbiddenText:fe=f_,errorGenericText:pe=p_,onFormOpen:me,onFormClose:he,onSubmitSuccess:ge,onSubmitError:_e,onFormSubmitted:ve}={})=>{let ye={id:r,autoInject:i,showBranding:a,isEmailRequired:o,isNameRequired:s,showEmail:c,showName:l,enableScreenshot:u,useSentryUser:d,tags:f,styleNonce:p,scriptNonce:m,colorScheme:h,themeDark:_,themeLight:g,triggerLabel:ae,triggerAriaLabel:oe,cancelButtonLabel:y,submitButtonLabel:re,confirmButtonLabel:b,formTitle:C,emailLabel:x,emailPlaceholder:S,messageLabel:T,messagePlaceholder:ee,nameLabel:E,namePlaceholder:te,successMessageText:ie,isRequiredLabel:w,addScreenshotButtonLabel:v,removeScreenshotButtonLabel:ne,highlightToolText:D,hideToolText:se,removeHighlightText:ce,errorEmptyMessageText:le,errorNoClientText:ue,errorTimeoutText:de,errorForbiddenText:fe,errorGenericText:pe,onFormClose:he,onFormOpen:me,onSubmitError:_e,onSubmitSuccess:ge,onFormSubmitted:ve},O=null,be=null,k=[],xe=e=>{if(!O){let t=o_.createElement(`div`);t.id=String(e.id),o_.body.appendChild(t),O=t.attachShadow({mode:`open`}),be=w_(e),O.appendChild(be)}return O},Se=async r=>{let i=r.enableScreenshot&&_re(),a,o;try{a=(t?t():await e(`feedbackModalIntegration`,m))(),jl(a)}catch{throw __&&N.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),Error(`[Feedback] Missing feedback modal integration!`)}try{let t=i?n?n():await e(`feedbackScreenshotIntegration`,m):void 0;t&&(o=t(),jl(o))}catch{__&&N.error(`[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.`)}let s={ERROR_EMPTY_MESSAGE:r.errorEmptyMessageText,ERROR_NO_CLIENT:r.errorNoClientText,ERROR_TIMEOUT:r.errorTimeoutText,ERROR_FORBIDDEN:r.errorForbiddenText,ERROR_GENERIC:r.errorGenericText},c=(e,t)=>g_(e,{includeReplay:!0,...t,errorMessages:s}),l=a.createDialog({options:{...r,onFormClose:()=>{l?.close(),r.onFormClose?.()},onFormSubmitted:()=>{l?.close(),r.onFormSubmitted?.()}},screenshotIntegration:o,sendFeedback:c,shadow:xe(r)});return l},Ce=(e,t={})=>{let n=v_(ye,t),r=typeof e==`string`?o_.querySelector(e):typeof e.addEventListener==`function`?e:null;if(!r)throw __&&N.error(`[Feedback] Unable to attach to target element`),Error(`Unable to attach to target element`);let i=null,a=async()=>{i||=await Se({...n,onFormSubmitted:()=>{i?.removeFromDom(),n.onFormSubmitted?.()}}),i.appendToDom(),i.open()};r.addEventListener(`click`,a);let o=()=>{k=k.filter(e=>e!==o),i?.removeFromDom(),i=null,r.removeEventListener(`click`,a)};return k.push(o),o},we=(e={})=>{let t=v_(ye,e),n=xe(t),r=xre({triggerLabel:t.triggerLabel,triggerAriaLabel:t.triggerAriaLabel,shadow:n,styleNonce:p});return Ce(r.el,{...t,onFormOpen(){r.hide()},onFormClose(){r.show()},onFormSubmitted(){r.show()}}),r};return{name:`Feedback`,setupOnce(){!Hl()||!ye.autoInject||(o_.readyState===`loading`?o_.addEventListener(`DOMContentLoaded`,()=>we().appendToDom()):we().appendToDom())},attachTo:Ce,createWidget(e={}){let t=we(v_(ye,e));return t.appendToDom(),t},async createForm(e={}){return Se(v_(ye,e))},setTheme(e){if(ye.colorScheme=e,O){let e=w_(ye);be?O.replaceChild(e,be):O.prepend(e),be=e}},remove(){O&&(O.parentElement?.remove(),O=null,be=null),k.forEach(e=>e()),k=[]}}});function Cre(){return F()?.getIntegrationByName(`Feedback`)}var E_,D_,O_,k_,A_,j_,M_,N_={},P_=[],wre=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,F_=Array.isArray;function I_(e,t){for(var n in t)e[n]=t[n];return e}function L_(e){var t=e.parentNode;t&&t.removeChild(e)}function R_(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?E_.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return z_(e,o,r,i,null)}function z_(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++O_,__i:-1,__u:0};return i==null&&D_.vnode!=null&&D_.vnode(a),a}function B_(e){return e.children}function V_(e,t){this.props=e,this.context=t}function H_(e,t){if(t==null)return e.__?H_(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?H_(e):null}function Tre(e,t,n){var r,i=e.__v,a=i.__e,o=e.__P;if(o)return(r=I_({},i)).__v=i.__v+1,D_.vnode&&D_.vnode(r),$_(o,r,i,e.__n,o.ownerSVGElement!==void 0,32&i.__u?[a]:null,t,a??H_(i),!!(32&i.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=a&&U_(r),r}function U_(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return U_(e)}}function W_(e){(!e.__d&&(e.__d=!0)&&k_.push(e)&&!G_.__r++||A_!==D_.debounceRendering)&&((A_=D_.debounceRendering)||j_)(G_)}function G_(){var e,t,n,r=[],i=[];for(k_.sort(M_);e=k_.shift();)e.__d&&(n=k_.length,t=Tre(e,r,i)||t,n===0||k_.length>n?(ev(r,t,i),i.length=r.length=0,t=void 0,k_.sort(M_)):t&&D_.__c&&D_.__c(t,P_));t&&ev(r,t,i),G_.__r=0}function K_(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g=r&&r.__k||P_,_=t.length;for(n.__d=c,q_(n,t,g),c=n.__d,d=0;d<_;d++)(p=n.__k[d])!=null&&typeof p!=`boolean`&&typeof p!=`function`&&(f=p.__i===-1?N_:g[p.__i]||N_,p.__i=d,$_(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&tv(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),65536&p.__u||f.__k===p.__k?c=J_(p,c,e):typeof p.type==`function`&&p.__d!==void 0?c=p.__d:m&&(c=m.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=c,n.__e=h}function q_(e,t,n){var r,i,a,o,s,c=t.length,l=n.length,u=l,d=0;for(e.__k=[],r=0;r<c;r++)(i=e.__k[r]=(i=t[r])==null||typeof i==`boolean`||typeof i==`function`?null:typeof i==`string`||typeof i==`number`||typeof i==`bigint`||i.constructor==String?z_(null,i,null,null,i):F_(i)?z_(B_,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?z_(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)==null?(a=n[r])&&a.key==null&&a.__e&&(a.__e==e.__d&&(e.__d=H_(a)),nv(a,a,!1),n[r]=null,u--):(i.__=e,i.__b=e.__b+1,s=Ere(i,n,o=r+d,u),i.__i=s,a=null,s!==-1&&(u--,(a=n[s])&&(a.__u|=131072)),a==null||a.__v===null?(s==-1&&d--,typeof i.type!=`function`&&(i.__u|=65536)):s!==o&&(s===o+1?d++:s>o?u>c-o?d+=s-o:d--:d=s<o&&s==o-1?s-o:0,s!==r+d&&(i.__u|=65536)));if(u)for(r=0;r<l;r++)(a=n[r])!=null&&!(131072&a.__u)&&(a.__e==e.__d&&(e.__d=H_(a)),nv(a,a))}function J_(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=J_(r[i],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType===8);return t}function Ere(e,t,n,r){var i=e.key,a=e.type,o=n-1,s=n+1,c=t[n];if(c===null||c&&i==c.key&&a===c.type)return n;if(r>+(c!=null&&!(131072&c.__u)))for(;o>=0||s<t.length;){if(o>=0){if((c=t[o])&&!(131072&c.__u)&&i==c.key&&a===c.type)return o;o--}if(s<t.length){if((c=t[s])&&!(131072&c.__u)&&i==c.key&&a===c.type)return s;s++}}return-1}function Y_(e,t,n){t[0]===`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||wre.test(t)?n:n+`px`}function X_(e,t,n,r,i){var a;n:if(t===`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||Y_(e.style,t,``);if(n)for(t in n)r&&n[t]===r[t]||Y_(e.style,t,n[t])}else if(t[0]===`o`&&t[1]===`n`)a=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,`$1`)),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,a?Q_:Z_,a)):e.removeEventListener(t,a?Q_:Z_,a);else{if(i)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!==`width`&&t!==`height`&&t!==`href`&&t!==`list`&&t!==`form`&&t!==`tabIndex`&&t!==`download`&&t!==`rowSpan`&&t!==`colSpan`&&t!==`role`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!==`-`?e.removeAttribute(t):e.setAttribute(t,n))}}function Z_(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(D_.event?D_.event(e):e)}}function Q_(e){if(this.l)return this.l[e.type+!0](D_.event?D_.event(e):e)}function $_(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=D_.__b)&&u(t);n:if(typeof T==`function`)try{if(_=t.props,v=(u=T.contextType)&&r[u.__c],y=u?v?v.props.value:u.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:(`prototype`in T&&T.prototype.render?t.__c=d=new T(_,y):(t.__c=d=new V_(_,y),d.constructor=T,d.render=Ore),v&&v.sub(d),d.props=_,d.state||(d.state={}),d.context=y,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),d.__s??(d.__s=d.state),T.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=I_({},d.__s)),I_(d.__s,T.getDerivedStateFromProps(_,d.__s))),p=d.props,m=d.state,d.__v=t,f)T.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(T.getDerivedStateFromProps==null&&_!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(_,y),!d.__e&&(d.shouldComponentUpdate!=null&&!1===d.shouldComponentUpdate(_,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(e){e&&(e.__=t)}),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&o.push(d);break n}d.componentWillUpdate!=null&&d.componentWillUpdate(_,d.__s,y),d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(p,m,h)})}if(d.context=y,d.props=_,d.__P=e,d.__e=!1,x=D_.__r,S=0,`prototype`in T&&T.prototype.render){for(d.state=d.__s,d.__d=!1,x&&x(t),u=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do d.__d=!1,x&&x(t),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++S<25);d.state=d.__s,d.getChildContext!=null&&(r=I_(I_({},r),d.getChildContext())),f||d.getSnapshotBeforeUpdate==null||(h=d.getSnapshotBeforeUpdate(p,m)),K_(e,F_(w=u!=null&&u.type===B_&&u.key==null?u.props.children:u)?w:[w],t,n,r,i,a,o,s,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),g&&(d.__E=d.__=null)}catch(e){t.__v=null,c||a!=null?(t.__e=s,t.__u|=c?160:32,a[a.indexOf(s)]=null):(t.__e=n.__e,t.__k=n.__k),D_.__e(e,t,n)}else a==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Dre(n.__e,t,n,r,i,a,o,c,l);(u=D_.diffed)&&u(t)}function ev(e,t,n){for(var r=0;r<n.length;r++)tv(n[r],n[++r],n[++r]);D_.__c&&D_.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){D_.__e(e,t.__v)}})}function Dre(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h,g=n.props,_=t.props,v=t.type;if(v===`svg`&&(i=!0),a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&`setAttribute`in p==!!v&&(v?p.localName===v:p.nodeType===3)){e=p,a[l]=null;break}}if(e==null){if(v===null)return document.createTextNode(_);e=i?document.createElementNS(`http://www.w3.org/2000/svg`,v):document.createElement(v,_.is&&_),a=null,s=!1}if(v===null)g===_||s&&e.data===_||(e.data=_);else{if(a&&=E_.call(e.childNodes),g=n.props||N_,!s&&a!=null)for(g={},l=0;l<e.attributes.length;l++)g[(p=e.attributes[l]).name]=p.value;for(l in g)p=g[l],l==`children`||(l==`dangerouslySetInnerHTML`?d=p:l===`key`||l in _||X_(e,l,null,p,i));for(l in _)p=_[l],l==`children`?f=p:l==`dangerouslySetInnerHTML`?u=p:l==`value`?m=p:l==`checked`?h=p:l===`key`||s&&typeof p!=`function`||g[l]===p||X_(e,l,p,g[l],i);if(u)s||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=``),K_(e,F_(f)?f:[f],t,n,r,i&&v!==`foreignObject`,a,o,a?a[0]:n.__k&&H_(n,0),s,c),a!=null)for(l=a.length;l--;)a[l]!=null&&L_(a[l]);s||(l=`value`,m!==void 0&&(m!==e[l]||v===`progress`&&!m||v===`option`&&m!==g[l])&&X_(e,l,m,g[l],!1),l=`checked`,h!==void 0&&h!==e[l]&&X_(e,l,h,g[l],!1))}return e}function tv(e,t,n){try{typeof e==`function`?e(t):e.current=t}catch(e){D_.__e(e,n)}}function nv(e,t,n){var r,i;if(D_.unmount&&D_.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||tv(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){D_.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&nv(r[i],t,n||typeof e.type!=`function`);n||e.__e==null||L_(e.__e),e.__=e.__e=e.__d=void 0}function Ore(e,t,n){return this.constructor(e,n)}function kre(e,t,n){var r,i,a,o;D_.__&&D_.__(e,t),i=(r=!1)?null:t.__k,a=[],o=[],$_(t,e=t.__k=R_(B_,null,[e]),i||N_,N_,t.ownerSVGElement!==void 0,i?null:t.firstChild?E_.call(t.childNodes):null,a,i?i.__e:t.firstChild,r,o),e.__d=void 0,ev(a,e,o)}E_=P_.slice,D_={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},O_=0,V_.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=I_({},this.state);typeof e==`function`&&(e=e(I_({},n),this.props)),e&&I_(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),W_(this))},V_.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),W_(this))},V_.prototype.render=B_,k_=[],j_=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,M_=function(e,t){return e.__v.__b-t.__v.__b},G_.__r=0;var rv,iv,av,ov,sv=0,cv=[],lv=[],uv=D_,dv=uv.__b,fv=uv.__r,pv=uv.diffed,mv=uv.__c,hv=uv.unmount,gv=uv.__;function _v(e,t){uv.__h&&uv.__h(iv,e,sv||t),sv=0;var n=iv.__H||(iv.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:lv}),n.__[e]}function vv(e){return sv=1,yv(Av,e)}function yv(e,t,n){var r=_v(rv++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Av(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=iv,!iv.u)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=!1;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),!(!o&&r.__c.props===e)&&(!a||a.call(this,e,t,n))};iv.u=!0;var a=iv.shouldComponentUpdate,o=iv.componentWillUpdate;iv.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},iv.shouldComponentUpdate=i}return r.__N||r.__}function Are(e,t){var n=_v(rv++,3);!uv.__s&&kv(n.__H,t)&&(n.__=e,n.i=t,iv.__H.__h.push(n))}function bv(e,t){var n=_v(rv++,4);!uv.__s&&kv(n.__H,t)&&(n.__=e,n.i=t,iv.__h.push(n))}function jre(e){return sv=5,xv(function(){return{current:e}},[])}function Mre(e,t,n){sv=6,bv(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 xv(e,t){var n=_v(rv++,7);return kv(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Sv(e,t){return sv=8,xv(function(){return e},t)}function Nre(e){var t=iv.context[e.__c],n=_v(rv++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(iv)),t.props.value):e.__}function Pre(e,t){uv.useDebugValue&&uv.useDebugValue(t?t(e):e)}function Cv(e){var t=_v(rv++,10),n=vv();return t.__=e,iv.componentDidCatch||(iv.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function Fre(){var e=_v(rv++,11);if(!e.__){for(var t=iv.__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 wv(){for(var e;e=cv.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Dv),e.__H.__h.forEach(Ov),e.__H.__h=[]}catch(t){e.__H.__h=[],uv.__e(t,e.__v)}}uv.__b=function(e){iv=null,dv&&dv(e)},uv.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),gv&&gv(e,t)},uv.__r=function(e){fv&&fv(e),rv=0;var t=(iv=e.__c).__H;t&&(av===iv?(t.__h=[],iv.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.__V=lv,e.__N=e.i=void 0})):(t.__h.forEach(Dv),t.__h.forEach(Ov),t.__h=[],rv=0)),av=iv},uv.diffed=function(e){pv&&pv(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(cv.push(t)!==1&&ov===uv.requestAnimationFrame||((ov=uv.requestAnimationFrame)||Ev)(wv)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.__V!==lv&&(e.__=e.__V),e.i=void 0,e.__V=lv})),av=iv=null},uv.__c=function(e,t){t.some(function(e){try{e.__h.forEach(Dv),e.__h=e.__h.filter(function(e){return!e.__||Ov(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],uv.__e(n,e.__v)}}),mv&&mv(e,t)},uv.unmount=function(e){hv&&hv(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{Dv(e)}catch(e){t=e}}),n.__H=void 0,t&&uv.__e(t,n.__v))};var Tv=typeof requestAnimationFrame==`function`;function Ev(e){var t,n=function(){clearTimeout(r),Tv&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Tv&&(t=requestAnimationFrame(n))}function Dv(e){var t=iv,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),iv=t}function Ov(e){var t=iv;e.__c=e.__(),iv=t}function kv(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Av(e,t){return typeof t==`function`?t(e):t}var Ire=Object.defineProperty({__proto__:null,useCallback:Sv,useContext:Nre,useDebugValue:Pre,useEffect:Are,useErrorBoundary:Cv,useId:Fre,useImperativeHandle:Mre,useLayoutEffect:bv,useMemo:xv,useReducer:yv,useRef:jre,useState:vv},Symbol.toStringTag,{value:`Module`}),Lre=`http://www.w3.org/2000/svg`;function Rre(){let e=e=>o_.createElementNS(Lre,e),t=y_(e(`svg`),{width:`32`,height:`30`,viewBox:`0 0 72 66`,fill:`inherit`}),n=y_(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 zre({options:e}){let t=xv(()=>({__html:Rre().outerHTML}),[]);return R_(`h2`,{class:`dialog__header`},R_(`span`,{class:`dialog__title`},e.formTitle),e.showBranding?R_(`a`,{class:`brand-link`,target:`_blank`,href:`https://sentry.io/welcome/`,title:`Powered by Sentry`,rel:`noopener noreferrer`,dangerouslySetInnerHTML:t}):null)}function jv(e,t){let 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 Mv(e,t){let n=e.get(t);return typeof n==`string`?n.trim():``}function Nv({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:i,onSubmitSuccess:a,onSubmitError:o,showEmail:s,showName:c,screenshotInput:l}){let{tags:u,addScreenshotButtonLabel:d,removeScreenshotButtonLabel:f,cancelButtonLabel:p,emailLabel:m,emailPlaceholder:h,isEmailRequired:g,isNameRequired:_,messageLabel:v,messagePlaceholder:y,nameLabel:b,namePlaceholder:x,submitButtonLabel:S,isRequiredLabel:C}=e,[w,T]=vv(!1),[ee,E]=vv(null),[te,ne]=vv(!1),re=l?.input,[ie,ae]=vv(null),oe=Sv(e=>{ae(e),ne(!1)},[]),D=Sv(e=>{let t=jv(e,{emailLabel:m,isEmailRequired:g,isNameRequired:_,messageLabel:v,nameLabel:b});return t.length>0?E(`Please enter in the following required fields: ${t.join(`, `)}`):E(null),t.length===0},[m,g,_,v,b]);return R_(`form`,{class:`form`,onSubmit:Sv(async e=>{T(!0);try{if(e.preventDefault(),!(e.target instanceof HTMLFormElement))return;let t=new FormData(e.target),n=await(l&&te?l.value():void 0),r={name:Mv(t,`name`),email:Mv(t,`email`),message:Mv(t,`message`),attachments:n?[n]:void 0};if(!D(r))return;try{a(r,await i({name:r.name,email:r.email,message:r.message,source:pre,tags:u},{attachments:r.attachments}))}catch(e){__&&N.error(e);let t=e instanceof Error?e:Error(String(e));E(t.message),o(t)}}finally{T(!1)}},[l&&te,a,o])},re&&te?R_(re,{onError:oe}):null,R_(`fieldset`,{class:`form__right`,"data-sentry-feedback":!0,disabled:w},R_(`div`,{class:`form__top`},ee?R_(`div`,{class:`form__error-container`},ee):null,c?R_(`label`,{for:`name`,class:`form__label`},R_(Pv,{label:b,isRequiredLabel:C,isRequired:_}),R_(`input`,{class:`form__input`,defaultValue:n,id:`name`,name:`name`,placeholder:x,required:_,type:`text`})):R_(`input`,{"aria-hidden":!0,value:n,name:`name`,type:`hidden`}),s?R_(`label`,{for:`email`,class:`form__label`},R_(Pv,{label:m,isRequiredLabel:C,isRequired:g}),R_(`input`,{class:`form__input`,defaultValue:t,id:`email`,name:`email`,placeholder:h,required:g,type:`email`})):R_(`input`,{"aria-hidden":!0,value:t,name:`email`,type:`hidden`}),R_(`label`,{for:`message`,class:`form__label`},R_(Pv,{label:v,isRequiredLabel:C,isRequired:!0}),R_(`textarea`,{autoFocus:!0,class:`form__input form__input--textarea`,id:`message`,name:`message`,placeholder:y,required:!0,rows:5})),re?R_(`label`,{for:`screenshot`,class:`form__label`},R_(`button`,{class:`btn btn--default`,disabled:w,type:`button`,onClick:()=>{ae(null),ne(e=>!e)}},te?f:d),ie?R_(`div`,{class:`form__error-container`},ie.message):null):null),R_(`div`,{class:`btn-group`},R_(`button`,{class:`btn btn--primary`,disabled:w,type:`submit`},S),R_(`button`,{class:`btn btn--default`,disabled:w,type:`button`,onClick:r},p))))}function Pv({label:e,isRequired:t,isRequiredLabel:n}){return R_(`span`,{class:`form__label__text`},e,t&&R_(`span`,{class:`form__label__text--required`},n))}var Fv=16,Iv=17,Lv=`http://www.w3.org/2000/svg`;function Rv(){let e=e=>a_.document.createElementNS(Lv,e),t=y_(e(`svg`),{width:`${Fv}`,height:`${Iv}`,viewBox:`0 0 ${Fv} ${Iv}`,fill:`inherit`}),n=y_(e(`g`),{clipPath:`url(#clip0_57_156)`}),r=y_(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`}),i=y_(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(i,r);let a=e(`defs`),o=y_(e(`clipPath`),{id:`clip0_57_156`}),s=y_(e(`rect`),{width:`${Fv}`,height:`${Fv}`,fill:`white`,transform:`translate(0 0.5)`});return o.appendChild(s),a.appendChild(o),t.appendChild(a).appendChild(o).appendChild(s),t}function zv({open:e,onFormSubmitted:t,...n}){let r=n.options,i=xv(()=>({__html:Rv().outerHTML}),[]),[a,o]=vv(null),s=Sv(()=>{a&&(clearTimeout(a),o(null)),t()},[a]),c=Sv((e,r)=>{n.onSubmitSuccess(e,r),o(setTimeout(()=>{t(),o(null)},hre))},[t]);return R_(B_,null,a?R_(`div`,{class:`success__position`,onClick:s},R_(`div`,{class:`success__content`},r.successMessageText,R_(`span`,{class:`success__icon`,dangerouslySetInnerHTML:i}))):R_(`dialog`,{class:`dialog`,onClick:r.onFormClose,open:e},R_(`div`,{class:`dialog__position`},R_(`div`,{class:`dialog__content`,onClick:e=>{e.stopPropagation()}},R_(zre,{options:r}),R_(Nv,{...n,onSubmitSuccess:c})))))}var Bv=`
|
|
108
|
+
.dialog {
|
|
109
|
+
position: fixed;
|
|
110
|
+
z-index: var(--z-index);
|
|
111
|
+
margin: 0;
|
|
112
|
+
inset: 0;
|
|
113
|
+
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
justify-content: center;
|
|
117
|
+
padding: 0;
|
|
118
|
+
height: 100vh;
|
|
119
|
+
width: 100vw;
|
|
120
|
+
|
|
121
|
+
color: var(--dialog-color, var(--foreground));
|
|
122
|
+
fill: var(--dialog-color, var(--foreground));
|
|
123
|
+
line-height: 1.75em;
|
|
124
|
+
|
|
125
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
126
|
+
border: none;
|
|
127
|
+
inset: 0;
|
|
128
|
+
opacity: 1;
|
|
129
|
+
transition: opacity 0.2s ease-in-out;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.dialog__position {
|
|
133
|
+
position: fixed;
|
|
134
|
+
z-index: var(--z-index);
|
|
135
|
+
inset: var(--dialog-inset);
|
|
136
|
+
padding: var(--page-margin);
|
|
137
|
+
display: flex;
|
|
138
|
+
max-height: calc(100vh - (2 * var(--page-margin)));
|
|
139
|
+
}
|
|
140
|
+
@media (max-width: 600px) {
|
|
141
|
+
.dialog__position {
|
|
142
|
+
inset: var(--page-margin);
|
|
143
|
+
padding: 0;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.dialog__position:has(.editor) {
|
|
148
|
+
inset: var(--page-margin);
|
|
149
|
+
padding: 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.dialog:not([open]) {
|
|
153
|
+
opacity: 0;
|
|
154
|
+
pointer-events: none;
|
|
155
|
+
visibility: hidden;
|
|
156
|
+
}
|
|
157
|
+
.dialog:not([open]) .dialog__content {
|
|
158
|
+
transform: translate(0, -16px) scale(0.98);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.dialog__content {
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-direction: column;
|
|
164
|
+
gap: 16px;
|
|
165
|
+
padding: var(--dialog-padding, 24px);
|
|
166
|
+
max-width: 100%;
|
|
167
|
+
width: 100%;
|
|
168
|
+
max-height: 100%;
|
|
169
|
+
overflow: auto;
|
|
170
|
+
|
|
171
|
+
background: var(--dialog-background, var(--background));
|
|
172
|
+
border-radius: var(--dialog-border-radius, 20px);
|
|
173
|
+
border: var(--dialog-border, var(--border));
|
|
174
|
+
box-shadow: var(--dialog-box-shadow, var(--box-shadow));
|
|
175
|
+
transform: translate(0, 0) scale(1);
|
|
176
|
+
transition: transform 0.2s ease-in-out;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
`,Vv=`
|
|
180
|
+
.dialog__header {
|
|
181
|
+
display: flex;
|
|
182
|
+
gap: 4px;
|
|
183
|
+
justify-content: space-between;
|
|
184
|
+
font-weight: var(--dialog-header-weight, 600);
|
|
185
|
+
margin: 0;
|
|
186
|
+
}
|
|
187
|
+
.dialog__title {
|
|
188
|
+
align-self: center;
|
|
189
|
+
width: var(--form-width, 272px);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
@media (max-width: 600px) {
|
|
193
|
+
.dialog__title {
|
|
194
|
+
width: auto;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.dialog__position:has(.editor) .dialog__title {
|
|
199
|
+
width: auto;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
.brand-link {
|
|
204
|
+
display: inline-flex;
|
|
205
|
+
}
|
|
206
|
+
.brand-link:focus-visible {
|
|
207
|
+
outline: var(--outline);
|
|
208
|
+
}
|
|
209
|
+
`,Hv=`
|
|
210
|
+
.form {
|
|
211
|
+
display: flex;
|
|
212
|
+
overflow: auto;
|
|
213
|
+
flex-direction: row;
|
|
214
|
+
gap: 16px;
|
|
215
|
+
flex: 1 0;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.form fieldset {
|
|
219
|
+
border: none;
|
|
220
|
+
margin: 0;
|
|
221
|
+
padding: 0;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.form__right {
|
|
225
|
+
flex: 0 0 auto;
|
|
226
|
+
display: flex;
|
|
227
|
+
overflow: auto;
|
|
228
|
+
flex-direction: column;
|
|
229
|
+
justify-content: space-between;
|
|
230
|
+
gap: 20px;
|
|
231
|
+
width: var(--form-width, 100%);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.dialog__position:has(.editor) .form__right {
|
|
235
|
+
width: var(--form-width, 272px);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.form__top {
|
|
239
|
+
display: flex;
|
|
240
|
+
flex-direction: column;
|
|
241
|
+
gap: 8px;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.form__error-container {
|
|
245
|
+
color: var(--error-color);
|
|
246
|
+
fill: var(--error-color);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.form__label {
|
|
250
|
+
display: flex;
|
|
251
|
+
flex-direction: column;
|
|
252
|
+
gap: 4px;
|
|
253
|
+
margin: 0px;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.form__label__text {
|
|
257
|
+
display: flex;
|
|
258
|
+
gap: 4px;
|
|
259
|
+
align-items: center;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.form__label__text--required {
|
|
263
|
+
font-size: 0.85em;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.form__input {
|
|
267
|
+
font-family: inherit;
|
|
268
|
+
line-height: inherit;
|
|
269
|
+
background: transparent;
|
|
270
|
+
box-sizing: border-box;
|
|
271
|
+
border: var(--input-border, var(--border));
|
|
272
|
+
border-radius: var(--input-border-radius, 6px);
|
|
273
|
+
color: var(--input-color, inherit);
|
|
274
|
+
fill: var(--input-color, inherit);
|
|
275
|
+
font-size: var(--input-font-size, inherit);
|
|
276
|
+
font-weight: var(--input-font-weight, 500);
|
|
277
|
+
padding: 6px 12px;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.form__input::placeholder {
|
|
281
|
+
opacity: 0.65;
|
|
282
|
+
color: var(--input-placeholder-color, inherit);
|
|
283
|
+
filter: var(--interactive-filter);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.form__input:focus-visible {
|
|
287
|
+
outline: var(--input-focus-outline, var(--outline));
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.form__input--textarea {
|
|
291
|
+
font-family: inherit;
|
|
292
|
+
resize: vertical;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.error {
|
|
296
|
+
color: var(--error-color);
|
|
297
|
+
fill: var(--error-color);
|
|
298
|
+
}
|
|
299
|
+
`,Uv=`
|
|
300
|
+
.btn-group {
|
|
301
|
+
display: grid;
|
|
302
|
+
gap: 8px;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.btn {
|
|
306
|
+
line-height: inherit;
|
|
307
|
+
border: var(--button-border, var(--border));
|
|
308
|
+
border-radius: var(--button-border-radius, 6px);
|
|
309
|
+
cursor: pointer;
|
|
310
|
+
font-family: inherit;
|
|
311
|
+
font-size: var(--button-font-size, inherit);
|
|
312
|
+
font-weight: var(--button-font-weight, 600);
|
|
313
|
+
padding: var(--button-padding, 6px 16px);
|
|
314
|
+
}
|
|
315
|
+
.btn[disabled] {
|
|
316
|
+
opacity: 0.6;
|
|
317
|
+
pointer-events: none;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.btn--primary {
|
|
321
|
+
color: var(--button-primary-color, var(--accent-foreground));
|
|
322
|
+
fill: var(--button-primary-color, var(--accent-foreground));
|
|
323
|
+
background: var(--button-primary-background, var(--accent-background));
|
|
324
|
+
border: var(--button-primary-border, var(--border));
|
|
325
|
+
border-radius: var(--button-primary-border-radius, 6px);
|
|
326
|
+
font-weight: var(--button-primary-font-weight, 500);
|
|
327
|
+
}
|
|
328
|
+
.btn--primary:hover {
|
|
329
|
+
color: var(--button-primary-hover-color, var(--accent-foreground));
|
|
330
|
+
fill: var(--button-primary-hover-color, var(--accent-foreground));
|
|
331
|
+
background: var(--button-primary-hover-background, var(--accent-background));
|
|
332
|
+
filter: var(--interactive-filter);
|
|
333
|
+
}
|
|
334
|
+
.btn--primary:focus-visible {
|
|
335
|
+
background: var(--button-primary-hover-background, var(--accent-background));
|
|
336
|
+
filter: var(--interactive-filter);
|
|
337
|
+
outline: var(--button-primary-focus-outline, var(--outline));
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.btn--default {
|
|
341
|
+
color: var(--button-color, var(--foreground));
|
|
342
|
+
fill: var(--button-color, var(--foreground));
|
|
343
|
+
background: var(--button-background, var(--background));
|
|
344
|
+
border: var(--button-border, var(--border));
|
|
345
|
+
border-radius: var(--button-border-radius, 6px);
|
|
346
|
+
font-weight: var(--button-font-weight, 500);
|
|
347
|
+
}
|
|
348
|
+
.btn--default:hover {
|
|
349
|
+
color: var(--button-color, var(--foreground));
|
|
350
|
+
fill: var(--button-color, var(--foreground));
|
|
351
|
+
background: var(--button-hover-background, var(--background));
|
|
352
|
+
filter: var(--interactive-filter);
|
|
353
|
+
}
|
|
354
|
+
.btn--default:focus-visible {
|
|
355
|
+
background: var(--button-hover-background, var(--background));
|
|
356
|
+
filter: var(--interactive-filter);
|
|
357
|
+
outline: var(--button-focus-outline, var(--outline));
|
|
358
|
+
}
|
|
359
|
+
`,Wv=`
|
|
360
|
+
.success__position {
|
|
361
|
+
position: fixed;
|
|
362
|
+
inset: var(--dialog-inset);
|
|
363
|
+
padding: var(--page-margin);
|
|
364
|
+
z-index: var(--z-index);
|
|
365
|
+
}
|
|
366
|
+
.success__content {
|
|
367
|
+
background: var(--success-background, var(--background));
|
|
368
|
+
border: var(--success-border, var(--border));
|
|
369
|
+
border-radius: var(--success-border-radius, 1.7em/50%);
|
|
370
|
+
box-shadow: var(--success-box-shadow, var(--box-shadow));
|
|
371
|
+
font-weight: var(--success-font-weight, 600);
|
|
372
|
+
color: var(--success-color);
|
|
373
|
+
fill: var(--success-color);
|
|
374
|
+
padding: 12px 24px;
|
|
375
|
+
line-height: 1.75em;
|
|
376
|
+
|
|
377
|
+
display: grid;
|
|
378
|
+
align-items: center;
|
|
379
|
+
grid-auto-flow: column;
|
|
380
|
+
gap: 6px;
|
|
381
|
+
cursor: default;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.success__icon {
|
|
385
|
+
display: flex;
|
|
386
|
+
}
|
|
387
|
+
`;function Gv(e){let t=o_.createElement(`style`);return t.textContent=`
|
|
388
|
+
:host {
|
|
389
|
+
--dialog-inset: var(--inset);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
${Bv}
|
|
393
|
+
${Vv}
|
|
394
|
+
${Hv}
|
|
395
|
+
${Uv}
|
|
396
|
+
${Wv}
|
|
397
|
+
`,e&&t.setAttribute(`nonce`,e),t}function Kv(){let e=P().getUser(),t=ca().getUser(),n=la().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}var qv=(()=>({name:`FeedbackModal`,setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{let i=r,a=e.useSentryUser,o=Kv(),s=o_.createElement(`div`),c=Gv(e.styleNonce),l=``,u={get el(){return s},appendToDom(){!i.contains(c)&&!i.contains(s)&&(i.appendChild(c),i.appendChild(s))},removeFromDom(){s.remove(),c.remove(),o_.body.style.overflow=l},open(){f(!0),e.onFormOpen?.(),F()?.emit(`openFeedbackWidget`),l=o_.body.style.overflow,o_.body.style.overflow=`hidden`},close(){f(!1),o_.body.style.overflow=l}},d=t?.createInput({h:R_,hooks:Ire,dialog:u,options:e}),f=t=>{kre(R_(zv,{options:e,screenshotInput:d,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:String(a&&o?.[a.name]||``),defaultEmail:String(a&&o?.[a.email]||``),onFormClose:()=>{f(!1),e.onFormClose?.()},onSubmit:n,onSubmitSuccess:(t,n)=>{f(!1),e.onSubmitSuccess?.(t,n)},onSubmitError:t=>{e.onSubmitError?.(t)},onFormSubmitted:()=>{e.onFormSubmitted?.()},open:t}),s)};return u}}));function Jv({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 Yv(e){let t=o_.createElement(`style`),n=`#1A141F`,r=`#302735`;return t.textContent=`
|
|
398
|
+
.editor {
|
|
399
|
+
display: flex;
|
|
400
|
+
flex-grow: 1;
|
|
401
|
+
flex-direction: column;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.editor__image-container {
|
|
405
|
+
justify-items: center;
|
|
406
|
+
padding: 15px;
|
|
407
|
+
position: relative;
|
|
408
|
+
height: 100%;
|
|
409
|
+
border-radius: var(--menu-border-radius, 6px);
|
|
410
|
+
|
|
411
|
+
background-color: ${n};
|
|
412
|
+
background-image: repeating-linear-gradient(
|
|
413
|
+
-145deg,
|
|
414
|
+
transparent,
|
|
415
|
+
transparent 8px,
|
|
416
|
+
${n} 8px,
|
|
417
|
+
${n} 11px
|
|
418
|
+
),
|
|
419
|
+
repeating-linear-gradient(
|
|
420
|
+
-45deg,
|
|
421
|
+
transparent,
|
|
422
|
+
transparent 15px,
|
|
423
|
+
${r} 15px,
|
|
424
|
+
${r} 16px
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.editor__canvas-container {
|
|
429
|
+
width: 100%;
|
|
430
|
+
height: 100%;
|
|
431
|
+
position: relative;
|
|
432
|
+
display: flex;
|
|
433
|
+
align-items: center;
|
|
434
|
+
justify-content: center;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.editor__canvas-container > * {
|
|
438
|
+
object-fit: contain;
|
|
439
|
+
position: absolute;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
.editor__tool-container {
|
|
443
|
+
padding-top: 8px;
|
|
444
|
+
display: flex;
|
|
445
|
+
justify-content: center;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.editor__tool-bar {
|
|
449
|
+
display: flex;
|
|
450
|
+
gap: 8px;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.editor__tool {
|
|
454
|
+
display: flex;
|
|
455
|
+
padding: 8px 12px;
|
|
456
|
+
justify-content: center;
|
|
457
|
+
align-items: center;
|
|
458
|
+
border: var(--button-border, var(--border));
|
|
459
|
+
border-radius: var(--button-border-radius, 6px);
|
|
460
|
+
background: var(--button-background, var(--background));
|
|
461
|
+
color: var(--button-color, var(--foreground));
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.editor__tool--active {
|
|
465
|
+
background: var(--button-primary-background, var(--accent-background));
|
|
466
|
+
color: var(--button-primary-color, var(--accent-foreground));
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.editor__rect {
|
|
470
|
+
position: absolute;
|
|
471
|
+
z-index: 2;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.editor__rect button {
|
|
475
|
+
opacity: 0;
|
|
476
|
+
position: absolute;
|
|
477
|
+
top: -12px;
|
|
478
|
+
right: -12px;
|
|
479
|
+
cursor: pointer;
|
|
480
|
+
padding: 0;
|
|
481
|
+
z-index: 3;
|
|
482
|
+
border: none;
|
|
483
|
+
background: none;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.editor__rect:hover button {
|
|
487
|
+
opacity: 1;
|
|
488
|
+
}
|
|
489
|
+
`,e&&t.setAttribute(`nonce`,e),t}function Xv({h:e}){return function({action:t,setAction:n,options:r}){return e(`div`,{class:`editor__tool-container`},e(`div`,{class:`editor__tool-bar`},e(`button`,{type:`button`,class:`editor__tool ${t===`highlight`?`editor__tool--active`:``}`,onClick:()=>{n(t===`highlight`?``:`highlight`)}},r.highlightToolText),e(`button`,{type:`button`,class:`editor__tool ${t===`hide`?`editor__tool--active`:``}`,onClick:()=>{n(t===`hide`?``:`hide`)}},r.hideToolText)))}}function Zv({hooks:e}){function t(){let[t,n]=e.useState(a_.devicePixelRatio??1);return e.useEffect(()=>{let e=()=>{n(a_.devicePixelRatio)},t=matchMedia(`(resolution: ${a_.devicePixelRatio}dppx)`);return t.addEventListener(`change`,e),()=>{t.removeEventListener(`change`,e)}},[]),t}return function({onBeforeScreenshot:n,onScreenshot:r,onAfterScreenshot:i,onError:a}){let o=t();e.useEffect(()=>{(async()=>{n();let e=await s_.mediaDevices.getDisplayMedia({video:{width:a_.innerWidth*o,height:a_.innerHeight*o},audio:!1,monitorTypeSurfaces:`exclude`,preferCurrentTab:!0,selfBrowserSurface:`include`,surfaceSwitching:`exclude`}),t=o_.createElement(`video`);await new Promise((n,i)=>{t.srcObject=e,t.onloadedmetadata=()=>{r(t,o),e.getTracks().forEach(e=>e.stop()),n()},t.play().catch(i)}),i()})().catch(a)},[])}}function Qv(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)}}function $v(e,t,n){if(!e)return;let r=e.getContext(`2d`,t);r&&n(e,r)}function ey(e,t){$v(e,{alpha:!0},(e,n)=>{n.drawImage(t,0,0,t.width,t.height,0,0,e.width,e.height)})}function ty(e,t,n){$v(e,{alpha:!0},(e,r)=>{n.length&&(r.fillStyle=`rgba(0, 0, 0, 0.25)`,r.fillRect(0,0,e.width,e.height)),n.forEach(e=>{Qv(e,r,t)})})}function ny({h:e,hooks:t,outputBuffer:n,dialog:r,options:i}){let a=Zv({hooks:t}),o=Xv({h:e}),s=Jv({h:e}),c={__html:Yv(i.styleNonce).innerText},l=r.el.style,u=({screenshot:r})=>{let[a,l]=t.useState(`highlight`),[u,d]=t.useState([]),f=t.useRef(null),p=t.useRef(null),m=t.useRef(null),h=t.useRef(null),[g,_]=t.useState(1),v=t.useMemo(()=>{let e=o_.getElementById(i.id);if(!e)return`white`;let t=getComputedStyle(e);return t.getPropertyValue(`--button-primary-background`)||t.getPropertyValue(`--accent-background`)},[i.id]);t.useLayoutEffect(()=>{let e=()=>{let t=f.current;t&&($v(r.canvas,{alpha:!1},e=>{let n=Math.min(t.clientWidth/e.width,t.clientHeight/e.height);_(n)}),(t.clientHeight===0||t.clientWidth===0)&&setTimeout(e,0))};return e(),a_.addEventListener(`resize`,e),()=>{a_.removeEventListener(`resize`,e)}},[r]);let y=t.useCallback((e,t)=>{$v(e,{alpha:!0},(e,n)=>{n.scale(t,t),e.width=r.canvas.width,e.height=r.canvas.height})},[r]);t.useEffect(()=>{y(p.current,r.dpi),ey(p.current,r.canvas)},[r]),t.useEffect(()=>{y(m.current,r.dpi),$v(m.current,{alpha:!0},(e,t)=>{t.clearRect(0,0,e.width,e.height)}),ty(m.current,v,u)},[u,v]),t.useEffect(()=>{y(n,r.dpi),ey(n,r.canvas),$v(o_.createElement(`canvas`),{alpha:!0},(e,t)=>{t.scale(r.dpi,r.dpi),e.width=r.canvas.width,e.height=r.canvas.height,ty(e,v,u),ey(n,e)})},[u,r,v]);let b=e=>{if(!a||!h.current)return;let t=h.current.getBoundingClientRect(),n={type:a,x:e.offsetX/g,y:e.offsetY/g},r=(e,n)=>{let r=(n.clientX-t.x)/g,i=(n.clientY-t.y)/g;return{type:e.type,x:Math.min(e.x,r),y:Math.min(e.y,i),w:Math.abs(r-e.x),h:Math.abs(i-e.y)}},i=e=>{$v(m.current,{alpha:!0},(e,t)=>{t.clearRect(0,0,e.width,e.height)}),ty(m.current,v,[...u,r(n,e)])},o=e=>{let t=r(n,e);t.w*g>=1&&t.h*g>=1&&d(e=>[...e,t]),o_.removeEventListener(`mousemove`,i),o_.removeEventListener(`mouseup`,o)};o_.addEventListener(`mousemove`,i),o_.addEventListener(`mouseup`,o)},x=t.useCallback(e=>t=>{t.preventDefault(),t.stopPropagation(),d(t=>{let n=[...t];return n.splice(e,1),n})},[]),S={width:`${r.canvas.width*g}px`,height:`${r.canvas.height*g}px`},C=e=>{e.stopPropagation()};return e(`div`,{class:`editor`},e(`style`,{nonce:i.styleNonce,dangerouslySetInnerHTML:c}),e(`div`,{class:`editor__image-container`},e(`div`,{class:`editor__canvas-container`,ref:f},e(`canvas`,{ref:p,id:`background`,style:S}),e(`canvas`,{ref:m,id:`foreground`,style:S}),e(`div`,{ref:h,onMouseDown:b,style:S},u.map((t,n)=>e(`div`,{key:n,class:`editor__rect`,style:{top:`${t.y*g}px`,left:`${t.x*g}px`,width:`${t.w*g}px`,height:`${t.h*g}px`}},e(`button`,{"aria-label":i.removeHighlightText,onClick:x(n),onMouseDown:C,onMouseUp:C,type:`button`},e(s,null))))))),e(o,{options:i,action:a,setAction:l}))};return function({onError:r}){let[i,o]=t.useState();return a({onBeforeScreenshot:t.useCallback(()=>{l.display=`none`},[]),onScreenshot:t.useCallback((e,t)=>{$v(o_.createElement(`canvas`),{alpha:!1},(n,r)=>{r.scale(t,t),n.width=e.videoWidth,n.height=e.videoHeight,r.drawImage(e,0,0,n.width,n.height),o({canvas:n,dpi:t})}),n.width=e.videoWidth,n.height=e.videoHeight},[]),onAfterScreenshot:t.useCallback(()=>{l.display=`block`},[]),onError:t.useCallback(e=>{l.display=`block`,r(e)},[])}),i?e(u,{screenshot:i}):e(`div`,null)}}var ry=(()=>({name:`FeedbackScreenshot`,setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{let i=o_.createElement(`canvas`);return{input:ny({h:e,hooks:t,outputBuffer:i,dialog:n,options:r}),value:async()=>{let e=await new Promise(e=>{i.toBlob(e,`image/png`)});if(e)return{data:new Uint8Array(await e.arrayBuffer()),filename:`screenshot.png`,contentType:`application/png`}}}}})),R=M,iy=0;function ay(){return iy>0}function oy(){iy++,setTimeout(()=>{iy--})}function sy(e,t={}){function n(e){return typeof e==`function`}if(!n(e))return e;try{if(Object.prototype.hasOwnProperty.call(e,`__sentry_wrapped__`)){let t=e.__sentry_wrapped__;return typeof t==`function`?t:e}if(Xr(e))return e}catch{return e}let r=function(...n){M._sentryWrappedDepth=(M._sentryWrappedDepth||0)+1;try{let r=n.map(e=>sy(e,t));return e.apply(this,r)}catch(e){throw oy(),ua(r=>{r.addEventProcessor(e=>(t.mechanism&&(Mi(e,void 0,void 0),Ni(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),Qc(e)}),e}finally{M._sentryWrappedDepth=(M._sentryWrappedDepth||0)-1}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}Yr(r,e),Jr(e,`__sentry_wrapped__`,r);try{Object.getOwnPropertyDescriptor(r,`name`).configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function cy(){let e=r_(),{referrer:t}=R.document||{},{userAgent:n}=R.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}var ly=[`replayIntegration`,`replayCanvasIntegration`,`feedbackIntegration`,`feedbackModalIntegration`,`feedbackScreenshotIntegration`,`captureConsoleIntegration`,`contextLinesIntegration`,`linkedErrorsIntegration`,`dedupeIntegration`,`extraErrorDataIntegration`,`graphqlClientIntegration`,`httpClientIntegration`,`reportingObserverIntegration`,`rewriteFramesIntegration`,`browserProfilingIntegration`,`moduleMetadataIntegration`,`instrumentAnthropicAiClient`,`instrumentOpenAiClient`,`instrumentGoogleGenAIClient`,`instrumentStateGraph`,`instrumentLangGraph`,`createLangChainCallbackHandler`,`instrumentLangChainEmbeddings`],uy={replayCanvasIntegration:`replay-canvas`,feedbackModalIntegration:`feedback-modal`,feedbackScreenshotIntegration:`feedback-screenshot`};function dy(e){return uy[e]||e.replace(`Integration`,``).toLowerCase()}var fy=R;async function py(e,t){let n=ly.includes(e)?dy(e):void 0,r=fy.Sentry=fy.Sentry||{};if(!n)throw Error(`Cannot lazy load integration: ${e}`);let i=r[e];if(typeof i==`function`&&!(`_isShim`in i))return i;let a=Bre(n),o=R.document.createElement(`script`);o.src=a,o.crossOrigin=`anonymous`,o.referrerPolicy=`strict-origin`,t&&o.setAttribute(`nonce`,t);let s=new Promise((e,t)=>{o.addEventListener(`load`,()=>e()),o.addEventListener(`error`,t)}),c=R.document.currentScript,l=R.document.body||R.document.head||c?.parentElement;if(l)l.appendChild(o);else throw Error(`Could not find parent element to insert lazy-loaded ${e} script`);try{await s}catch{throw Error(`Error when loading integration: ${e}`)}let u=r[e];if(typeof u!=`function`)throw Error(`Could not load integration: ${e}`);return u}function Bre(e){let t=F()?.getOptions()?.cdnBaseUrl||`https://browser.sentry-cdn.com`;return new URL(`/${$n}/${e}.min.js`,t).toString()}var Vre=T_({lazyLoadIntegration:py}),my=T_({getModalIntegration:()=>qv,getScreenshotIntegration:()=>ry});function hy(e,t){let n=_y(e,t),r={type:Kre(t),value:qre(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===``&&(r.value=`Unrecoverable error caught`),r}function Hre(e,t,n,r){let i=F()?.getOptions().normalizeDepth,a=Xre(t),o={__serialized__:pi(t,i)};if(a)return{exception:{values:[hy(e,a)]},extra:o};let s={exception:{values:[{type:Hr(t)?t.constructor.name:r?`UnhandledRejection`:`Error`,value:Jre(t,{isUnhandledRejection:r})}]},extra:o};if(n){let t=_y(e,n);t.length&&(s.exception.values[0].stacktrace={frames:t})}return s}function gy(e,t){return{exception:{values:[hy(e,t)]}}}function _y(e,t){let n=t.stacktrace||t.stack||``,r=Wre(t),i=Gre(t);try{return e(n,r,i)}catch{}return[]}var Ure=/Minified React error #\d+;/i;function Wre(e){return e&&Ure.test(e.message)?1:0}function Gre(e){return typeof e.framesToPop==`number`?e.framesToPop:0}function vy(e){return typeof WebAssembly<`u`&&WebAssembly.Exception!==void 0&&e instanceof WebAssembly.Exception}function Kre(e){let t=e?.name;return!t&&vy(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:`WebAssembly.Exception`:t}function qre(e){let t=e?.message;return vy(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:`wasm exception`:t?t.error&&typeof t.error.message==`string`?nf(t.error):nf(e):`No error message`}function yy(e,t,n,r){let i=xy(e,t,n?.syntheticException||void 0,r);return Ni(i),i.level=`error`,n?.event_id&&(i.event_id=n.event_id),Hc(i)}function by(e,t,n=`info`,r,i){let a=Sy(e,t,r?.syntheticException||void 0,i);return a.level=n,r?.event_id&&(a.event_id=r.event_id),Hc(a)}function xy(e,t,n,r,i){let a;if(Pr(t)&&t.error)return gy(e,t.error);if(Fr(t)||Ir(t)){let i=t;if(`stack`in t){a=gy(e,t);let i=a.exception?.values?.[0];if(r&&n&&i&&!i.stacktrace){let t=_y(e,n);t.length&&(i.stacktrace={frames:t},Ni(a,{synthetic:!0}))}}else{let t=i.name||(Fr(i)?`DOMError`:`DOMException`),o=i.message?`${t}: ${i.message}`:t;a=Sy(e,o,n,r),Mi(a,o)}return`code`in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}return Mr(t)?gy(e,t):Br(t)||Hr(t)?(a=Hre(e,t,n,i),Ni(a,{synthetic:!0}),a):(a=Sy(e,t,n,r),Mi(a,`${t}`,void 0),Ni(a,{synthetic:!0}),a)}function Sy(e,t,n,r){let i={};if(r&&n){let r=_y(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),Ni(i,{synthetic:!0})}if(Rr(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function Jre(e,{isUnhandledRejection:t}){let n=$r(e),r=t?`promise rejection`:`exception`;return Pr(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Hr(e)?`Event \`${Yre(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Yre(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Xre(e){return Object.values(e).find(Mr)}var Cy=class extends Uu{constructor(e){let t=wy(e);Od(t,`browser`,[`browser`],R.SENTRY_SDK_SOURCE||Bl()),super(t);let{userInfo:n}=this.getDataCollectionOptions();t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:n?`auto`:`never`,...t._metadata.sdk.settings});let{sendClientReports:r}=this._options;R.document&&R.document.addEventListener(`visibilitychange`,()=>{R.document.visibilityState===`hidden`&&(r&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}),n&&this.on(`beforeSendSession`,Dd)}eventFromException(e,t){return yy(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t=`info`,n){return by(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||`javascript`,super._prepareEvent(e,t,n,r)}};function wy(e){return{release:typeof __SENTRY_RELEASE__==`string`?__SENTRY_RELEASE__:R.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var Ty=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Ey=M,Dy=(e,t)=>e>t[1]?`poor`:e>t[0]?`needs-improvement`:`good`,Oy=(e,t,n,r)=>{let i,a;return o=>{t.value>=0&&(o||r)&&(a=t.value-(i??0),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=Dy(t.value,n),e(t)))}},ky=(e=!0)=>{let t=Ey.performance?.getEntriesByType?.(`navigation`)[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Ay=()=>ky()?.activationStart??0;function jy(e,t,n){Ey.document&&Ey.addEventListener(e,t,n)}function My(e,t,n){Ey.document&&Ey.removeEventListener(e,t,n)}var Ny=-1,Py=new Set,Fy=()=>Ey.document?.visibilityState===`hidden`&&!Ey.document?.prerendering?0:1/0,Iy=e=>{if(Ry(e)&&Ny>-1){if(e.type===`visibilitychange`||e.type===`pagehide`)for(let e of Py)e();isFinite(Ny)||(Ny=e.type===`visibilitychange`?e.timeStamp:0,My(`prerenderingchange`,Iy,!0))}},Ly=()=>{if(Ey.document&&Ny<0){let e=Ay();Ny=(Ey.document.prerendering?void 0:globalThis.performance.getEntriesByType(`visibility-state`).filter(t=>t.name===`hidden`&&t.startTime>e)[0]?.startTime)??Fy(),jy(`visibilitychange`,Iy,!0),jy(`pagehide`,Iy,!0),jy(`prerenderingchange`,Iy,!0)}return{get firstHiddenTime(){return Ny},onHidden(e){Py.add(e)}}};function Ry(e){return e.type===`pagehide`||Ey.document?.visibilityState===`hidden`}var zy=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+0xe8d4a51000}`,By=(e,t=-1)=>{let n=ky(),r=`navigate`;return n&&(Ey.document?.prerendering||Ay()>0?r=`prerender`:Ey.document?.wasDiscarded?r=`restore`:n.type&&(r=n.type.replace(/_/g,`-`))),{name:e,value:t,rating:`good`,delta:0,entries:[],id:zy(),navigationType:r}},Vy=new WeakMap;function Hy(e,t){try{return Vy.get(e)||Vy.set(e,new t),Vy.get(e)}catch{return new t}}var Uy=class{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(e){if(e.hadRecentInput)return;let t=this._sessionEntries[0],n=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this._sessionValue+=e.value,this._sessionEntries.push(e)):(this._sessionValue=e.value,this._sessionEntries=[e]),this._onAfterProcessingUnexpectedShift?.(e)}},Wy=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},Gy=e=>{let t=!1;return()=>{t||=(e(),!0)}},Ky=e=>{Ey.document?.prerendering?addEventListener(`prerenderingchange`,()=>e(),!0):e()},qy=[1800,3e3],Jy=(e,t={})=>{Ky(()=>{let n=Ly(),r=By(`FCP`),i,a=Wy(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-Ay(),0),r.entries.push(t),i(!0)))});a&&(i=Oy(e,r,qy,t.reportAllChanges))})},Yy=[.1,.25],Xy=(e,t={})=>{Jy(Gy(()=>{let n=By(`CLS`,0),r,i=Ly(),a=Hy(t,Uy),o=e=>{for(let t of e)a._processEntry(t);a._sessionValue>n.value&&(n.value=a._sessionValue,n.entries=a._sessionEntries,r())},s=Wy(`layout-shift`,o);s&&(r=Oy(e,n,Yy,t.reportAllChanges),i.onHidden(()=>{o(s.takeRecords()),r(!0)}),Ey?.setTimeout?.(r))}))},Zy=0,Qy=1/0,$y=0,eb=e=>{e.forEach(e=>{e.interactionId&&(Qy=Math.min(Qy,e.interactionId),$y=Math.max($y,e.interactionId),Zy=$y?($y-Qy)/7+1:0)})},tb,nb=()=>tb?Zy:performance.interactionCount||0,rb=()=>{`interactionCount`in performance||tb||(tb=Wy(`event`,eb,{type:`event`,buffered:!0,durationThreshold:0}))},ib=10,ab=0,ob=()=>nb()-ab,sb=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){ab=nb(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let e=Math.min(this._longestInteractionList.length-1,Math.floor(ob()/50));return this._longestInteractionList[e]}_processEntry(e){if(this._onBeforeProcessingEntry?.(e),!(e.interactionId||e.entryType===`first-input`))return;let t=this._longestInteractionList.at(-1),n=this._longestInteractionMap.get(e.interactionId);if(n||this._longestInteractionList.length<ib||e.duration>t._latency){if(n?e.duration>n._latency?(n.entries=[e],n._latency=e.duration):e.duration===n._latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],_latency:e.duration},this._longestInteractionMap.set(n.id,n),this._longestInteractionList.push(n)),this._longestInteractionList.sort((e,t)=>t._latency-e._latency),this._longestInteractionList.length>ib){let e=this._longestInteractionList.splice(ib);for(let t of e)this._longestInteractionMap.delete(t.id)}this._onAfterProcessingINPCandidate?.(n)}}},cb=e=>{let t=Ey.requestIdleCallback||Ey.setTimeout;Ey.document?.visibilityState===`hidden`?e():(e=Gy(e),jy(`visibilitychange`,e,{once:!0,capture:!0}),jy(`pagehide`,e,{once:!0,capture:!0}),t(()=>{e(),My(`visibilitychange`,e,{capture:!0}),My(`pagehide`,e,{capture:!0})}))},lb=[200,500],ub=40,db=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&`interactionId`in PerformanceEventTiming.prototype))return;let n=Ly();Ky(()=>{rb();let r=By(`INP`),i,a=Hy(t,sb),o=e=>{cb(()=>{for(let t of e)a._processEntry(t);let t=a._estimateP98LongestInteraction();t&&t._latency!==r.value&&(r.value=t._latency,r.entries=t.entries,i())})},s=Wy(`event`,o,{durationThreshold:t.durationThreshold??ub});i=Oy(e,r,lb,t.reportAllChanges),s&&(s.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{o(s.takeRecords()),i(!0)}))})},fb=class{_processEntry(e){this._onBeforeProcessingEntry?.(e)}},pb=[2500,4e3],mb=(e,t={})=>{Ky(()=>{let n=Ly(),r=By(`LCP`),i,a=Hy(t,fb),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(let t of e)a._processEntry(t),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-Ay(),0),r.entries=[t],i())},s=Wy(`largest-contentful-paint`,o);if(s){i=Oy(e,r,pb,t.reportAllChanges);let n=Gy(()=>{o(s.takeRecords()),s.disconnect(),i(!0)}),a=e=>{e.isTrusted&&(cb(n),My(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])jy(e,a,{capture:!0})}})},hb=[800,1800],gb=e=>{Ey.document?.prerendering?Ky(()=>gb(e)):Ey.document?.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>gb(e),!0)},_b=(e,t={})=>{let n=By(`TTFB`),r=Oy(e,n,hb,t.reportAllChanges);gb(()=>{let e=ky();e&&(n.value=Math.max(e.responseStart-Ay(),0),n.entries=[e],r(!0))})},vb={},yb={},bb,xb,Sb,Cb;function wb(e,t=!1){return Pb(`cls`,e,Ab,bb,t)}function Tb(e,t=!1){return Pb(`lcp`,e,jb,xb,t)}function Eb(e){return Pb(`ttfb`,e,Mb,Sb)}function Db(e){return Pb(`inp`,e,Nb,Cb)}function Ob(e,t){return Ib(e,t),yb[e]||(Fb(e),yb[e]=!0),Lb(e,t)}function kb(e,t){let n=vb[e];if(n?.length)for(let r of n)try{r(t)}catch(t){Ty&&N.error(`Error while triggering instrumentation handler.
|
|
490
|
+
Type: ${e}
|
|
491
|
+
Name: ${_r(r)}
|
|
492
|
+
Error:`,t)}}function Ab(){return Xy(e=>{kb(`cls`,{metric:e}),bb=e},{reportAllChanges:!0})}function jb(){return mb(e=>{kb(`lcp`,{metric:e}),xb=e},{reportAllChanges:!0})}function Mb(){return _b(e=>{kb(`ttfb`,{metric:e}),Sb=e})}function Nb(){return db(e=>{kb(`inp`,{metric:e}),Cb=e})}function Pb(e,t,n,r,i=!1){Ib(e,t);let a;return yb[e]||(a=n(),yb[e]=!0),r&&t({metric:r}),Lb(e,t,i?a:void 0)}function Fb(e){let t={};e===`event`&&(t.durationThreshold=0),Wy(e,t=>{kb(e,{entries:t})},t)}function Ib(e,t){vb[e]=vb[e]||[],vb[e].push(t)}function Lb(e,t,n){return()=>{n&&n();let r=vb[e];if(!r)return;let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}function Rb(e){return`duration`in e}var zb=80,Bb={};try{typeof Node<`u`&&(Bb.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,`parentNode`).get),typeof Element<`u`&&(Bb.tagName=Object.getOwnPropertyDescriptor(Element.prototype,`tagName`).get,Bb.id=Object.getOwnPropertyDescriptor(Element.prototype,`id`).get,Bb.className=Object.getOwnPropertyDescriptor(Element.prototype,`className`).get,Bb.getAttribute=Element.prototype.getAttribute),typeof HTMLElement<`u`&&(Bb.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,`dataset`).get)}catch{}function Vb(e,t,n){let r=Bb[t];if(r)try{return r.call(e,n)}catch{}let i=e[t];return typeof i==`function`?i.call(e,n):i}function Hb(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||zb;for(;n&&i++<5&&(o=Ub(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=Vb(n,`parentNode`);return r.reverse().join(` > `)}catch{return`<unknown>`}}function Ub(e,t){let n=[],r=Vb(e,`tagName`);if(!r)return``;if(typeof HTMLElement<`u`&&e instanceof HTMLElement){let t=Vb(e,`dataset`);if(t){if(t.sentryComponent)return t.sentryComponent;if(t.sentryElement)return t.sentryElement}}n.push(r.toLowerCase());let i=t?.length?t.filter(t=>Vb(e,`getAttribute`,t)).map(t=>[t,Vb(e,`getAttribute`,t)]):null;if(i?.length)i.forEach(e=>{n.push(`[${e[0]}="${e[1]}"]`)});else{let t=Vb(e,`id`);t&&n.push(`#${t}`);let r=Vb(e,`className`);if(r&&Lr(r)){let e=r.split(/\s+/);for(let t of e)n.push(`.${t}`)}}for(let t of[`aria-label`,`type`,`name`,`title`,`alt`]){let r=Vb(e,`getAttribute`,t);r&&n.push(`[${t}="${r}"]`)}return n.join(``)}var Wb=e=>{let t=t=>{(t.type===`pagehide`||Ey.document?.visibilityState===`hidden`)&&e(t)};jy(`visibilitychange`,t,{capture:!0,once:!0}),jy(`pagehide`,t,{capture:!0,once:!0})};function Gb(e){return typeof e==`number`&&isFinite(e)}function Kb(e,t,n,{...r}){let i=L(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime==`function`&&e.updateStartTime(t),zs(e,()=>{let e=Is({startTime:t,...r});return e&&e.end(n),e})}function qb(e){let t=F();if(!t)return;let{name:n,transaction:r,attributes:i,startTime:a}=e,{release:o,environment:s}=t.getOptions(),{userInfo:c}=t.getDataCollectionOptions(),l=t.getIntegrationByName(`Replay`)?.getReplayId(),u=P(),d=u.getUser(),f=d===void 0?void 0:d.email||d.id||d.ip_address,p;try{p=u.getScopeData().contexts.profile.profile_id}catch{}return Is({name:n,attributes:{release:o,environment:s,user:f||void 0,profile_id:p||void 0,replay_id:l||void 0,transaction:r,"user_agent.original":Ey.navigator?.userAgent,"client.address":c?`{{auto}}`:void 0,...i},startTime:a,experimental:{standalone:!0}})}function Jb(){return Ey.addEventListener&&Ey.performance}function Yb(e){return e/1e3}function Xb(e){let t=`unknown`,n=`unknown`,r=``;for(let i of e){if(i===`/`){[t,n]=e.split(`/`);break}if(!isNaN(Number(i))){t=r===`h`?`http`:r,n=e.split(r)[1];break}r+=i}return r===e&&(t=r),{name:t,version:n}}function Zb(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function Qb(e,t){let n,r=!1;function i(e){!r&&n&&t(e,n.spanContext().spanId,n),r=!0}Wb(()=>{i(`pagehide`)});let a=e.on(`beforeStartNavigationSpan`,(e,t)=>{t?.isRedirect||(i(`navigation`),a(),o())}),o=e.on(`afterStartPageLoadSpan`,e=>{n=e,o()})}function $b(e){let t=0,n;if(!Zb(`layout-shift`))return;let r=wb(({metric:e})=>{let r=e.entries[e.entries.length-1];r&&(t=e.value,n=r)},!0);Qb(e,(e,i)=>{ex(t,n,i,e),r()})}function ex(e,t,n,r){Ty&&N.log(`Sending CLS span (${e})`);let i=t?Yb((Vi()||0)+t.startTime):zi(),a=P().getScopeData().transactionName,o=t?Hb(t.sources[0]?.node):`Layout shift`,s={[I]:`auto.http.browser.cls`,[ma]:`ui.webvital.cls`,[Ea]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((e,t)=>{s[`cls.source.${t+1}`]=Hb(e.node)});let c=qb({name:o,transaction:a,attributes:s,startTime:i});c&&(c.addEvent(`cls`,{[ga]:``,[_a]:e}),c.end(i))}function tx(e){return e!=null&&e>0&&e<=6e4}function nx(e){let t=0,n;if(!Zb(`largest-contentful-paint`))return;let r=Tb(({metric:e})=>{let r=e.entries[e.entries.length-1];!r||!tx(e.value)||(t=e.value,n=r)},!0);Qb(e,(e,i)=>{rx(t,n,i,e),r()})}function rx(e,t,n,r){if(!tx(e))return;Ty&&N.log(`Sending LCP span (${e})`);let i=Yb((Vi()||0)+(t?.startTime||0)),a=P().getScopeData().transactionName,o=t?Hb(t.element):`Largest contentful paint`,s={[I]:`auto.http.browser.lcp`,[ma]:`ui.webvital.lcp`,[Ea]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(s[`lcp.element`]=Hb(t.element)),t.id&&(s[`lcp.id`]=t.id),t.url&&(s[`lcp.url`]=t.url),t.loadTime!=null&&(s[`lcp.loadTime`]=t.loadTime),t.renderTime!=null&&(s[`lcp.renderTime`]=t.renderTime),t.size!=null&&(s[`lcp.size`]=t.size));let c=qb({name:o,transaction:a,attributes:s,startTime:i});c&&(c.addEvent(`lcp`,{[ga]:`millisecond`,[_a]:e}),c.end(i))}function ix(e){return e&&((Vi()||performance.timeOrigin)+e)/1e3}function ax(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=Xb(e.nextHopProtocol);t[`network.protocol.version`]=r,t[`network.protocol.name`]=n}return Vi()||Jb()?.timeOrigin?ox({...t,"http.request.redirect_start":ix(e.redirectStart),"http.request.redirect_end":ix(e.redirectEnd),"http.request.worker_start":ix(e.workerStart),"http.request.fetch_start":ix(e.fetchStart),"http.request.domain_lookup_start":ix(e.domainLookupStart),"http.request.domain_lookup_end":ix(e.domainLookupEnd),"http.request.connect_start":ix(e.connectStart),"http.request.secure_connection_start":ix(e.secureConnectionStart),"http.request.connection_end":ix(e.connectEnd),"http.request.request_start":ix(e.requestStart),"http.request.response_start":ix(e.responseStart),"http.request.response_end":ix(e.responseEnd),"http.request.time_to_first_byte":e.responseStart==null?void 0:e.responseStart/1e3}):t}function ox(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!=null))}var sx=2147483647,cx=0,lx={},ux,dx;function fx({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=Jb();if(r&&Vi()){r.mark&&Ey.performance.mark(`sentry-tracing-init`);let i=t?nx(n):t===!1?_x():void 0,a=e?$b(n):e===!1?gx():void 0,o=vx(),s=yx();return()=>{o(),s(),i?.(),a?.()}}return()=>void 0}function px(){Ob(`longtask`,({entries:e})=>{let t=No();if(!t)return;let{op:n,start_timestamp:r}=L(t);for(let i of e){let e=Yb(Vi()+i.startTime),a=Yb(i.duration);n===`navigation`&&r&&e<r||Kb(t,e,e+a,{name:`Main UI thread blocked`,op:`ui.long-task`,attributes:{[I]:`auto.ui.browser.metrics`}})}})}function mx(){new PerformanceObserver(e=>{let t=No();if(t)for(let n of e.getEntries()){if(!n.scripts[0])continue;let e=Yb(Vi()+n.startTime),{start_timestamp:r,op:i}=L(t);if(i===`navigation`&&r&&e<r)continue;let a=Yb(n.duration),o={[I]:`auto.ui.browser.metrics`},{invoker:s,invokerType:c,sourceURL:l,sourceFunctionName:u,sourceCharPosition:d}=n.scripts[0];o[`browser.script.invoker`]=s,o[`browser.script.invoker_type`]=c,l&&(o[`code.filepath`]=l),u&&(o[`code.function`]=u),d!==-1&&(o[`browser.script.source_char_position`]=d),Kb(t,e,e+a,{name:`Main UI thread blocked`,op:`ui.long-animation-frame`,attributes:o})}}).observe({type:`long-animation-frame`,buffered:!0})}function hx(){Ob(`event`,({entries:e})=>{let t=No();if(t){for(let n of e)if(n.name===`click`){let e=Yb(Vi()+n.startTime),r=Yb(n.duration),i={name:Hb(n.target),op:`ui.interaction.${n.name}`,startTime:e,attributes:{[I]:`auto.ui.browser.metrics`}},a=i_(n.target);a&&(i.attributes[`ui.component_name`]=a),Kb(t,e,e+r,i)}}})}function gx(){return wb(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(lx.cls={value:e.value,unit:``},dx=t)},!0)}function _x(){return Tb(({metric:e})=>{let t=e.entries[e.entries.length-1];!t||!tx(e.value)||(lx.lcp={value:e.value,unit:`millisecond`},ux=t)},!0)}function vx(){return Eb(({metric:e})=>{e.entries[e.entries.length-1]&&(lx.ttfb={value:e.value,unit:`millisecond`})})}function yx(){return Ob(`paint`,({entries:e})=>{let t=Ly();for(let n of e){let e=n.startTime<t.firstHiddenTime;n.name===`first-paint`&&e&&(lx.fp={value:n.startTime,unit:`millisecond`}),n.name===`first-contentful-paint`&&e&&(lx.fcp={value:n.startTime,unit:`millisecond`})}})}function bx(e,t){let n=Jb(),r=Vi();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:i,ignorePerformanceApiSpans:a,ignoreResourceSpans:o}=t,s=Yb(r),c=n.getEntries(),{op:l,start_timestamp:u}=L(e);c.slice(cx).forEach(t=>{let n=Yb(t.startTime),r=Yb(Math.max(0,t.duration));if(!(l===`navigation`&&u&&s+n<u))switch(t.entryType){case`navigation`:Ex(e,t,s);break;case`mark`:case`paint`:case`measure`:wx(e,t,n,r,s,a);break;case`resource`:Qre(e,t,t.name,n,r,s,o)}}),cx=Math.max(c.length-1,0),$re(e,i)}function xx(e,t){let n=Vi();if(!Jb()?.getEntries||!n){Sx();return}let{spanStreamingEnabled:r,recordClsOnPageloadSpan:i,recordLcpOnPageloadSpan:a}=t,o=Yb(n);if(L(e).op===`pageload`){if(nie(lx),r){let t=(t,n,r)=>{let i=r??`browser.web_vital.${t}.value`;e.setAttribute(i,n),Ty&&N.log(`Setting web vital attribute`,{[i]:n},`on pageload span`)};[`ttfb`,`fp`,`fcp`].forEach(e=>{lx[e]&&t(e,lx[e].value)}),lx[`ttfb.requestTime`]&&t(`ttfb.requestTime`,lx[`ttfb.requestTime`].value,`browser.web_vital.ttfb.request_time`)}else i||delete lx.cls,a||delete lx.lcp,Object.entries(lx).forEach(([t,n])=>{bs(t,n.value,n.unit,e)}),eie(e,t);e.setAttribute(r?`browser.performance.time_origin`:`performance.timeOrigin`,o),e.setAttribute(r?`browser.performance.navigation.activation_start`:`performance.activationStart`,Ay())}Sx()}function Sx(){ux=void 0,dx=void 0,lx={}}function Cx(e){if(e?.entryType===`measure`)try{return e.detail.devtools.track===`Components ⚛`}catch{return}}function wx(e,t,n,r,i,a){if(Cx(t)||[`mark`,`measure`].includes(t.entryType)&&Ti(t.name,a))return;let o=ky(!1),s=Yb(o?o.requestStart:0),c=i+Math.max(n,s),l=i+n,u=l+r,d={[I]:`auto.resource.browser.metrics`};c!==l&&(d[`sentry.browser.measure_happened_before_request`]=!0,d[`sentry.browser.measure_start_time`]=c),Tx(d,t),c<=u&&Kb(e,c,u,{name:t.name,op:t.entryType,attributes:d})}function Tx(e,t){try{let n=t.detail;if(!n)return;if(typeof n==`object`){for(let[t,r]of Object.entries(n))if(r&&zr(r))e[`sentry.browser.measure.detail.${t}`]=r;else if(r!==void 0)try{e[`sentry.browser.measure.detail.${t}`]=JSON.stringify(r)}catch{}return}if(zr(n)){e[`sentry.browser.measure.detail`]=n;return}try{e[`sentry.browser.measure.detail`]=JSON.stringify(n)}catch{}}catch{}}function Ex(e,t,n){[`unloadEvent`,`redirect`,`domContentLoadedEvent`,`loadEvent`,`connect`].forEach(r=>{Dx(e,t,r,n)}),Dx(e,t,`secureConnection`,n,`TLS/SSL`),Dx(e,t,`fetch`,n,`cache`),Dx(e,t,`domainLookup`,n,`DNS`),Zre(e,t,n)}function Dx(e,t,n,r,i=n){let a=t[Ox(n)],o=t[`${n}Start`];!o||!a||Kb(e,r+Yb(o),r+Yb(a),{op:`browser.${i}`,name:t.name,attributes:{[I]:`auto.ui.browser.metrics`,...n===`redirect`&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function Ox(e){return e===`secureConnection`?`connectEnd`:e===`fetch`?`domainLookupStart`:`${e}End`}function Zre(e,t,n){let r=n+Yb(t.requestStart),i=n+Yb(t.responseEnd),a=n+Yb(t.responseStart);t.responseEnd&&(Kb(e,r,i,{op:`browser.request`,name:t.name,attributes:{[I]:`auto.ui.browser.metrics`}}),Kb(e,a,i,{op:`browser.response`,name:t.name,attributes:{[I]:`auto.ui.browser.metrics`}}))}function Qre(e,t,n,r,i,a,o){if(t.initiatorType===`xmlhttprequest`||t.initiatorType===`fetch`)return;let s=t.initiatorType?`resource.${t.initiatorType}`:`resource.other`;if(o?.includes(s))return;let c={[I]:`auto.resource.browser.metrics`},l=_d(n);l.protocol&&(c[`url.scheme`]=l.protocol.split(`:`).pop()),l.host&&(c[`server.address`]=l.host),c[`url.same_origin`]=n.includes(Ey.location.origin),c[Ic]=n,tie(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`]]);let u={...c,...ax(t)},d=a+r;Kb(e,d,d+i,{name:n.replace(Ey.location.origin,``),op:s,attributes:u})}function $re(e,t){let n=Ey.navigator;if(!n)return;let r=n.connection;r&&(r.effectiveType&&e.setAttribute(t?`network.connection.effective_type`:`effectiveConnectionType`,r.effectiveType),r.type&&e.setAttribute(t?`network.connection.type`:`connectionType`,r.type),Gb(r.rtt)&&(t?e.setAttribute(`network.connection.rtt`,r.rtt):L(e).op===`pageload`&&bs(`connection.rtt`,r.rtt,`millisecond`))),Gb(n.deviceMemory)&&(t?e.setAttribute(`device.memory.estimated_capacity`,n.deviceMemory):e.setAttribute(`deviceMemory`,`${n.deviceMemory} GB`)),Gb(n.hardwareConcurrency)&&(t?e.setAttribute(`device.processor_count`,n.hardwareConcurrency):e.setAttribute(`hardwareConcurrency`,String(n.hardwareConcurrency)))}function eie(e,t){ux&&t.recordLcpOnPageloadSpan&&(ux.element&&e.setAttribute(`lcp.element`,Hb(ux.element)),ux.id&&e.setAttribute(`lcp.id`,ux.id),ux.url&&e.setAttribute(`lcp.url`,ux.url.trim().slice(0,200)),ux.loadTime!=null&&e.setAttribute(`lcp.loadTime`,ux.loadTime),ux.renderTime!=null&&e.setAttribute(`lcp.renderTime`,ux.renderTime),e.setAttribute(`lcp.size`,ux.size)),dx?.sources&&t.recordClsOnPageloadSpan&&dx.sources.forEach((t,n)=>e.setAttribute(`cls.source.${n+1}`,Hb(t.node)))}function tie(e,t,n){n.forEach(([n,r])=>{let i=e[n];i!=null&&(typeof i==`number`&&i<sx||typeof i==`string`)&&(t[r]=i)})}function nie(e){let t=ky(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e[`ttfb.requestTime`]={value:n-r,unit:`millisecond`})}var rie=`ElementTiming`,iie=Ml((()=>({name:rie,setup(){!Jb()||!Vi()||Ob(`element`,({entries:e})=>{for(let t of e){let e=t;if(!e.identifier)continue;let n=e.identifier,r=e.name,i=e.renderTime,a=e.loadTime,o={"sentry.origin":`auto.ui.browser.element_timing`,"ui.element.identifier":n};r&&(o[`ui.element.paint_type`]=r),e.id&&(o[`ui.element.id`]=e.id),e.element&&(o[`ui.element.type`]=e.element.tagName.toLowerCase()),e.url&&(o[`ui.element.url`]=e.url),e.naturalWidth&&(o[`ui.element.width`]=e.naturalWidth),e.naturalHeight&&(o[`ui.element.height`]=e.naturalHeight),i>0&&sm(`ui.element.render_time`,i,{unit:`millisecond`,attributes:o}),a>0&&sm(`ui.element.load_time`,a,{unit:`millisecond`,attributes:o})}})}}))),kx=[],Ax=new Map,jx=new Map;function aie(){if(Jb()&&Vi()){let e=oie();return()=>{e()}}return()=>void 0}var Mx={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 oie(){return Db(sie)}var sie=({metric:e})=>{if(e.value==null)return;let t=Yb(e.value);if(t>60)return;let n=e.entries.find(t=>t.duration===e.value&&Mx[t.name]);if(!n)return;let{interactionId:r}=n,i=Mx[n.name],a=Yb(Vi()+n.startTime),o=No(),s=o?jo(o):void 0,c=r==null?void 0:Ax.get(r),l=c?.span||s,u=l?L(l).description:P().getScopeData().transactionName,d=qb({name:c?.elementName||Hb(n.target),transaction:u,attributes:{[I]:`auto.http.browser.inp`,[ma]:`ui.interaction.${i}`,[Ea]:n.duration},startTime:a});d&&(d.addEvent(`inp`,{[ga]:`millisecond`,[_a]:e.value}),d.end(a+t))};function cie(e){return e==null?void 0:Ax.get(e)}function lie(){let e=Object.keys(Mx);Hl()&&e.forEach(e=>{Ey.addEventListener(e,t,{capture:!0,passive:!0})});function t(e){let t=e.target;if(!t)return;let n=Hb(t),r=Math.round(e.timeStamp);if(jx.set(r,n),jx.size>50){let e=jx.keys().next().value;e!==void 0&&jx.delete(e)}}function n(e){let t=Math.round(e.startTime),n=jx.get(t);if(!n)for(let e=-5;e<=5;e++){let r=jx.get(t+e);if(r){n=r;break}}return n||`<unknown>`}let r=({entries:e})=>{let t=No(),r=t&&jo(t);e.forEach(e=>{if(!Rb(e))return;let t=e.interactionId;if(t==null||Ax.has(t))return;let i=e.target?Hb(e.target):n(e);if(kx.length>10){let e=kx.shift();Ax.delete(e)}kx.push(t),Ax.set(t,{span:r,elementName:i})})};Ob(`event`,r),Ob(`first-input`,r)}function Nx(e){let{name:t,op:n,origin:r,metricName:i,value:a,attributes:o,parentSpan:s,reportEvent:c,startTime:l,endTime:u}=e,d=P().getScopeData().transactionName,f={[I]:r,[ma]:n,[Ea]:0,[`browser.web_vital.${i}.value`]:a,[Fc]:d,[Nc]:d,"user_agent.original":Ey.navigator?.userAgent,...o};s&&vo(s).attributes?.[`sentry.op`]===`pageload`&&(f[`sentry.pageload.span_id`]=s.spanContext().spanId),c&&(f[`browser.web_vital.${i}.report_event`]=c);let p=Is({name:t,attributes:f,startTime:l,parentSpan:s});p&&p.end(u??l)}function uie(e){let t=0,n;if(!Zb(`largest-contentful-paint`))return;let r=Tb(({metric:e})=>{let r=e.entries[e.entries.length-1];!r||!tx(e.value)||(t=e.value,n=r)},!0);Qb(e,(e,i,a)=>{die(t,n,a,e),r()})}function die(e,t,n,r){if(!tx(e))return;Ty&&N.log(`Sending LCP span (${e})`);let i=Vi()||0,a=Yb(i),o=Yb(i+(t?.startTime||0)),s=t?Hb(t.element):`Largest contentful paint`,c={};t?.element&&(c[`browser.web_vital.lcp.element`]=Hb(t.element)),t?.id&&(c[`browser.web_vital.lcp.id`]=t.id),t?.url&&(c[`browser.web_vital.lcp.url`]=t.url),t?.loadTime!=null&&(c[`browser.web_vital.lcp.load_time`]=t.loadTime),t?.renderTime!=null&&(c[`browser.web_vital.lcp.render_time`]=t.renderTime),t?.size!=null&&(c[`browser.web_vital.lcp.size`]=t.size),Nx({name:s,op:`ui.webvital.lcp`,origin:`auto.http.browser.lcp`,metricName:`lcp`,value:e,attributes:c,parentSpan:n,reportEvent:r,startTime:a,endTime:o})}function fie(e){let t=0,n;if(!Zb(`layout-shift`))return;let r=wb(({metric:e})=>{let r=e.entries[e.entries.length-1];r&&(t=e.value,n=r)},!0);Qb(e,(e,i,a)=>{pie(t,n,a,e),r()})}function pie(e,t,n,r){Ty&&N.log(`Sending CLS span (${e})`);let i=t?Yb((Vi()||0)+t.startTime):zi(),a=t?Hb(t.sources[0]?.node):`Layout shift`,o={};t?.sources&&t.sources.forEach((e,t)=>{o[`browser.web_vital.cls.source.${t+1}`]=Hb(e.node)}),Nx({name:a,op:`ui.webvital.cls`,origin:`auto.http.browser.cls`,metricName:`cls`,value:e,attributes:o,parentSpan:n,reportEvent:r,startTime:i})}function mie(){!Jb()||!Vi()||Db(({metric:e})=>{if(e.value==null||Yb(e.value)>60)return;let t=e.entries.find(t=>t.duration===e.value&&Mx[t.name]);t&&hie(e.value,t)})}function hie(e,t){Ty&&N.log(`Sending INP span (${e})`);let n=Yb(Vi()+t.startTime),r=Yb(e),i=Mx[t.name],a=cie(t.interactionId),o=No(),s=o?jo(o):void 0,c=a?.span||s,l=c?vo(c).name:P().getScopeData().transactionName;Nx({name:a?.elementName||Hb(t.target),op:`ui.interaction.${i}`,origin:`auto.http.browser.inp`,metricName:`inp`,value:e,attributes:{[Ea]:t.duration,[Fc]:l,[Nc]:l},startTime:n,endTime:n+r,parentSpan:c})}var gie=1e3,Px,Fx,Ix;function Lx(e){Sr(`dom`,e),Cr(`dom`,_ie)}function _ie(){if(!Ey.document)return;let e=wr.bind(null,`dom`),t=Rx(e,!0);Ey.document.addEventListener(`click`,t,!1),Ey.document.addEventListener(`keypress`,t,!1),[`EventTarget`,`Node`].forEach(t=>{let n=Ey[t]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(qr(n,`addEventListener`,function(t){return function(n,r,i){if(n===`click`||n==`keypress`)try{let r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=r[n]=r[n]||{refCount:0};if(!a.handler){let r=Rx(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch{}return t.call(this,n,r,i)}}),qr(n,`removeEventListener`,function(e){return function(t,n,r){if(t===`click`||t==`keypress`)try{let n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),Object.keys(n).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function vie(e){if(e.type!==Fx)return!1;try{if(!e.target||e.target._sentryId!==Ix)return!1}catch{}return!0}function yie(e,t){return e===`keypress`?!t?.tagName||!(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable):!1}function Rx(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=bie(n);if(yie(n.type,r))return;Jr(n,`_sentryCaptured`,!0),r&&!r._sentryId&&Jr(r,`_sentryId`,ki());let i=n.type===`keypress`?`input`:n.type;vie(n)||(e({event:n,name:i,global:t}),Fx=n.type,Ix=r?r._sentryId:void 0),clearTimeout(Px),Px=Ey.setTimeout(()=>{Ix=void 0,Fx=void 0},gie)}}function bie(e){try{return e.target}catch{return null}}var zx;function Bx(e){let t=`history`;Sr(t,e),Cr(t,xie)}function xie(){if(Ey.addEventListener(`popstate`,()=>{let e=Ey.location.href,t=zx;zx=e,t!==e&&wr(`history`,{from:t,to:e})}),!Hne())return;function e(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let r=zx,i=Sie(String(n));if(zx=i,r===i)return e.apply(this,t);wr(`history`,{from:r,to:i})}return e.apply(this,t)}}qr(Ey.history,`pushState`,e),qr(Ey.history,`replaceState`,e)}function Sie(e){try{return new URL(e,Ey.location.origin).toString()}catch{return e}}var Vx={};function Hx(e){let t=Vx[e];if(t)return t;let n=Ey[e];if(Xg(n))return Vx[e]=n.bind(Ey);let r=Ey.document;if(r&&typeof r.createElement==`function`)try{let t=r.createElement(`iframe`);t.hidden=!0,r.head.appendChild(t);let i=t.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(t)}catch(t){Ty&&N.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n&&(Vx[e]=n.bind(Ey))}function Cie(e){Vx[e]=void 0}function Ux(...e){return Hx(`setTimeout`)(...e)}var Wx=`__sentry_xhr_v3__`;function Gx(e){Sr(`xhr`,e),Cr(`xhr`,wie)}function wie(){if(!Ey.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=Error(),i=zi()*1e3,a=Lr(n[0])?n[0].toUpperCase():void 0,o=Tie(n[1]);if(!a||!o)return e.apply(t,n);t[Wx]={method:a,url:o,request_headers:{}},a===`POST`&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);let s=()=>{let e=t[Wx];if(e&&t.readyState===4){try{e.status_code=t.status}catch{}wr(`xhr`,{endTimestamp:zi()*1e3,startTimestamp:i,xhr:t,virtualError:r}),t.removeEventListener(`readystatechange`,s)}};return`onreadystatechange`in t&&typeof t.onreadystatechange==`function`?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply(e,t,n){return s(),e.apply(t,n)}}):t.addEventListener(`readystatechange`,s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){let[r,i]=n,a=t[Wx];return a&&Lr(r)&&Lr(i)&&(a.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){let r=t[Wx];return r?(n[0]!==void 0&&(r.body=n[0]),wr(`xhr`,{startTimestamp:zi()*1e3,xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function Tie(e){if(Lr(e))return e;try{return e.toString()}catch{}}var Eie=Symbol.for(`sentry__originalRequestBody`);function Kx(e){return new URLSearchParams(e).toString()}function qx(e,t=N){try{if(typeof e==`string`)return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[Kx(e)];if(!e)return[void 0]}catch(n){return Ty&&t.error(n,`Failed to serialize body`,e),[void 0,`BODY_PARSE_ERROR`]}return Ty&&t.log(`Skipping network body because of body type`,e),[void 0,`UNPARSEABLE_BODY_TYPE`]}function Jx(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){let t=e[0][Eie];return t===void 0?void 0:t}}function Yx(e){let t;try{t=e.getAllResponseHeaders()}catch(t){return Ty&&N.error(t,`Failed to get xhr response headers`,e),{}}return t?t.split(`\r
|
|
493
|
+
`).reduce((e,t)=>{let[n,r]=t.split(`: `);return r&&(e[n.toLowerCase()]=r),e},{}):{}}function Die(e){if(typeof Element>`u`)return!1;try{return e instanceof Element}catch{return!1}}function Xx(e){try{return new URL(e,Ey.location.origin).toString()}catch{return e}}var Oie=40;function Zx(e,t=Hx(`fetch`)){let n=0,r=0;async function i(i){let a=i.body.length;n+=a,r++;let o={body:i.body,method:`POST`,referrerPolicy:`strict-origin`,headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{let n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get(`X-Sentry-Rate-Limits`),"retry-after":n.headers.get(`Retry-After`)}}}catch(e){throw Cie(`fetch`),e}finally{n-=a,r--}}return xu(e,i,hu(e.bufferSize||Oie))}var z=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;function kie(){let e=F();if(!e){z&&N.warn(`No Sentry client available, profiling is not started`);return}if(!e.getIntegrationByName(`BrowserProfiling`)){z&&N.warn(`BrowserProfiling integration is not available`);return}e.emit(`startUIProfiler`)}function Aie(){let e=F();if(!e){z&&N.warn(`No Sentry client available, profiling is not started`);return}if(!e.getIntegrationByName(`BrowserProfiling`)){z&&N.warn(`ProfilingIntegration is not available`);return}e.emit(`stopUIProfiler`)}var jie={startProfiler:kie,stopProfiler:Aie},Mie=10,Nie=20,Pie=30,Fie=40,Iie=50;function Qx(e,t,n,r){let i={filename:e,function:t===`<anonymous>`?`?`:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var Lie=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Rie=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,zie=/\((\S*)(?::(\d+))(?::(\d+))\)/,Bie=/at (.+?) ?\(data:(.+?),/,$x=[Pie,e=>{let t=e.match(Bie);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=Lie.exec(e);if(n){let[,e,t,r]=n;return Qx(e,`?`,+t,+r)}let r=Rie.exec(e);if(r){if(r[2]?.indexOf(`eval`)===0){let e=zie.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}let[e,t]=rS(r[1]||`?`,r[2]);return Qx(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],Vie=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Hie=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,eS=[Iie,e=>{let t=Vie.exec(e);if(t){if(t[3]&&t[3].indexOf(` > eval`)>-1){let e=Hie.exec(t[3]);e&&(t[1]=t[1]||`eval`,t[3]=e[1],t[4]=e[2],t[5]=``)}let e=t[3],n=t[1]||`?`;return[n,e]=rS(n,e),Qx(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],Uie=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Wie=[Fie,e=>{let t=Uie.exec(e);return t?Qx(t[2],t[1]||`?`,+t[3],t[4]?+t[4]:void 0):void 0}],Gie=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,Kie=[Mie,e=>{let t=Gie.exec(e);return t?Qx(t[2],t[3]||`?`,+t[1]):void 0}],qie=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,Jie=[Nie,e=>{let t=qie.exec(e);return t?Qx(t[5],t[3]||t[4]||`?`,+t[1],+t[2]):void 0}],tS=[$x,eS],nS=fr(...tS),rS=(e,t)=>{let n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?`?`:e.split(`@`)[0],n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};function Yie(e,{metadata:t,tunnel:n,dsn:r}){return Qo({event_id:e.event_id,sent_at:new Date().toISOString(),...t?.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:qa(r)}},[Xie(e)])}function Xie(e){return[{type:`user_report`},e]}var iS=1024,Zie=`Breadcrumbs`,aS=Ml(((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Zie,setup(e){t.console&&ff(eae(e)),t.dom&&Lx($ie(e,t.dom)),t.xhr&&Gx(tae(e)),t.fetch&&Qg(nae(e)),t.history&&Bx(rae(e)),t.sentry&&e.on(`beforeSendEvent`,Qie(e))}}}));function Qie(e){return function(t){F()===e&&Nd({category:`sentry.${t.type===`transaction`?`transaction`:`event`}`,event_id:t.event_id,level:t.level,message:ji(t)},{event:t})}}function $ie(e,t){return function(n){if(F()!==e)return;let r,i,a=typeof t==`object`?t.serializeAttribute:void 0,o=typeof t==`object`&&typeof t.maxStringLength==`number`?t.maxStringLength:void 0;o&&o>iS&&(z&&N.warn(`\`dom.maxStringLength\` cannot exceed ${iS}, but a value of ${o} was configured. Sentry will use ${iS} instead.`),o=iS),typeof a==`string`&&(a=[a]);try{let e=n.event,t=iae(e)?e.target:e;r=Hb(t,{keyAttrs:a,maxStringLength:o}),i=i_(t)}catch{r=`<unknown>`}if(r.length===0)return;let s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),Nd(s,{event:n.event,name:n.name,global:n.global})}}function eae(e){return function(t){if(F()!==e)return;let n={category:`console`,data:{arguments:t.args,logger:`console`},level:hf(t.level),message:Ci(t.args,` `)};if(t.level===`assert`)if(t.args[0]===!1)n.message=`Assertion failed: ${Ci(t.args.slice(1),` `)||`console.assert`}`,n.data.arguments=t.args.slice(1);else return;Nd(n,{input:t.args,level:t.level})}}function tae(e){return function(t){if(F()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[Wx];if(!n||!r||!i)return;let{method:a,url:o,status_code:s,body:c}=i,l={method:a,url:o,status_code:s},u={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},d={category:`xhr`,data:l,type:`http`,level:Jg(s)};e.emit(`beforeOutgoingRequestBreadcrumb`,d,u),Nd(d,u)}}function nae(e){return function(t){if(F()!==e)return;let{startTimestamp:n,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method===`POST`))if(t.error){let i={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},a={category:`fetch`,data:t.fetchData,level:`error`,type:`http`};e.emit(`beforeOutgoingRequestBreadcrumb`,a,i),Nd(a,i)}else{let i=t.response,a={...t.fetchData,status_code:i?.status},o={input:t.args,response:i,startTimestamp:n,endTimestamp:r},s={category:`fetch`,data:a,type:`http`,level:Jg(a.status_code)};e.emit(`beforeOutgoingRequestBreadcrumb`,s,o),Nd(s,o)}}}function rae(e){return function(t){if(F()!==e)return;let n=t.from,r=t.to,i=_d(R.location.href),a=n?_d(n):void 0,o=_d(r);a?.path||(a=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),Nd({category:`navigation`,data:{from:n,to:r}})}}function iae(e){return!!e&&!!e.target}var oS=`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(`,`),sS=`BrowserApiErrors`,cS=Ml(((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:sS,setupOnce(){t.setTimeout&&qr(R,`setTimeout`,lS),t.setInterval&&qr(R,`setInterval`,lS),t.requestAnimationFrame&&qr(R,`requestAnimationFrame`,uS),t.XMLHttpRequest&&`XMLHttpRequest`in R&&qr(XMLHttpRequest.prototype,`send`,dS);let e=t.eventTarget;e&&(Array.isArray(e)?e:oS).forEach(e=>fS(e,t))}}}));function lS(e){return function(...t){let n=t[0];return t[0]=sy(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${_r(e)}`}}),e.apply(this,t)}}function uS(e){return function(t){return e.apply(this,[sy(t,{mechanism:{data:{handler:_r(e)},handled:!1,type:`auto.browser.browserapierrors.requestAnimationFrame`}})])}}function dS(e){return function(...t){let n=this;return[`onload`,`onerror`,`onprogress`,`onreadystatechange`].forEach(e=>{e in n&&typeof n[e]==`function`&&qr(n,e,function(t){let n={mechanism:{data:{handler:_r(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=Xr(t);return r&&(n.mechanism.data.handler=_r(r)),sy(t,n)})}),e.apply(this,t)}}function fS(e,t){let n=R[e]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(qr(n,`addEventListener`,function(n){return function(r,i,a){try{pS(i)&&(i.handleEvent=sy(i.handleEvent,{mechanism:{data:{handler:_r(i),target:e},handled:!1,type:`auto.browser.browserapierrors.handleEvent`}}))}catch{}return t.unregisterOriginalCallbacks&&mS(this,r,i),n.apply(this,[r,sy(i,{mechanism:{data:{handler:_r(i),target:e},handled:!1,type:`auto.browser.browserapierrors.addEventListener`}}),a])}}),qr(n,`removeEventListener`,function(e){return function(t,n,r){try{if(Object.prototype.hasOwnProperty.call(n,`__sentry_wrapped__`)){let i=n.__sentry_wrapped__;i&&e.call(this,t,i,r)}}catch{}return e.call(this,t,n,r)}}))}function pS(e){return typeof e.handleEvent==`function`}function mS(e,t,n){e&&typeof e==`object`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`&&e.removeEventListener(t,n)}var hS=Ml((e={})=>{let t=e.lifecycle??`route`;return{name:`BrowserSession`,setupOnce(){if(R.document===void 0){z&&N.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}hl({ignoreDuration:!0});let e=!1;cb(()=>{e||=(vl(),!0)});let n=ca(),r=n.getUser();n.addScopeListener(t=>{let n=t.getUser();(r?.id!==n?.id||r?.ip_address!==n?.ip_address)&&(r=n,e&&vl())}),t===`route`&&Bx(({from:t,to:n})=>{t!==n&&(hl({ignoreDuration:!0}),vl(),e=!0)})}}}),gS=`CultureContext`,_S=Ml((()=>({name:gS,preprocessEvent(e){let t=vS();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=vS();t&&Rc(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})));function vS(){try{let e=R.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var yS=`GlobalHandlers`,bS=Ml(((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:yS,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(xS(e),ES(`onerror`)),t.onunhandledrejection&&(SS(e),ES(`onunhandledrejection`))}}}));function xS(e){Er(t=>{let{stackParser:n,attachStacktrace:r}=DS();if(F()!==e||ay())return;let{msg:i,url:a,line:o,column:s,error:c}=t,l=TS(xy(n,c||i,void 0,r,!1),a,o,s);l.level=`error`,el(l,{originalException:c,mechanism:{handled:!1,type:`auto.browser.global_handlers.onerror`}})})}function SS(e){kr(t=>{let{stackParser:n,attachStacktrace:r}=DS();if(F()!==e||ay())return;let i=CS(t),a=zr(i)?wS(i):xy(n,i,void 0,r,!0);a.level=`error`,el(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.global_handlers.onunhandledrejection`}})})}function CS(e){if(zr(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 wS(e){return{exception:{values:[{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function TS(e,t,n,r){let i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},c=s.frames=s.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:OS(t)??r_(),function:`?`,in_app:!0}),e}function ES(e){z&&N.log(`Global Handler attached: ${e}`)}function DS(){return F()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function OS(e){if(!(!Lr(e)||e.length===0))return e.startsWith(`data:`)?`<${yd(e,!1)}>`:e}var kS=Ml(()=>({name:`HttpContext`,preprocessEvent(e){if(!R.navigator&&!R.location&&!R.document)return;let t=cy(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSpan(e){if(!R.navigator&&!R.location&&!R.document)return;let t=cy();Rc(e,{[Cte]:t.headers[`User-Agent`],...e.is_segment&&{"url.full":e.attributes?.[`sentry.op`]===`http.client`?void 0:t.url,"http.request.header.referer":t.headers.Referer}})}})),AS=`cause`,jS=5,MS=`LinkedErrors`,NS=Ml(((e={})=>{let t=e.limit||jS,n=e.key||AS;return{name:MS,preprocessEvent(e,r,i){Xd(hy,i.getOptions().stackParser,n,t,e,r)}}})),PS=/^HTML(\w*)Element$/;function FS(e){if(typeof window<`u`&&e===window)return`[Window]`;if(typeof document<`u`&&e===document)return`[Document]`;if(Die(e)){let t=IS(e);if(PS.test(t))return`[HTMLElement: ${Hb(e)}]`}}function IS(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function LS(){return RS()?(z&&ar(()=>{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 RS(){if(R.window===void 0)return!1;let e=R;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let t=r_();return!(R===R.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}function zS(e){return[Bd(),Id(),jp(),cS(),aS(),bS(),NS(),bf(),kS(),_S(),hS()]}function BS(e={}){let t=!e.skipBrowserExtensionCheck&&LS(),n=e.defaultIntegrations==null?zS():e.defaultIntegrations,r={...e,enabled:!t&&e.enabled,stackParser:pr(e.stackParser||nS),integrations:Dl({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||Zx};return di(FS),$u(Cy,r)}function VS(){}function HS(e){e()}function US(e={}){let t=R.document,n=t?.head||t?.body;if(!n){z&&N.error(`[showReportDialog] Global document not defined`);return}let r=P(),i=F()?.getDsn();if(!i){z&&N.error(`[showReportDialog] DSN not configured`);return}let a={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||ll()},o=R.document.createElement(`script`);o.async=!0,o.crossOrigin=`anonymous`,o.src=wl(i,a);let{onLoad:s,onClose:c}=a;if(s&&(o.onload=s),c){let e=t=>{if(t.data===`__sentry_reportdialog_closed__`)try{c()}finally{R.removeEventListener(`message`,e)}};R.addEventListener(`message`,e)}n.appendChild(o)}var WS=M,GS=`ReportingObserver`,KS=new WeakMap,qS=Ml(((e={})=>{let t=e.types||[`crash`,`deprecation`,`intervention`];function n(e){if(KS.has(F()))for(let t of e)ua(e=>{e.setExtra(`url`,t.url);let n=`ReportingObserver [${t.type}]`,r=`No details available`;if(t.body){let n={};for(let e in t.body)n[e]=t.body[e];if(e.setExtra(`body`,n),t.type===`crash`){let e=t.body;r=[e.crashId||``,e.reason||``].join(` `).trim()||r}else r=t.body.message||r}$c(`${n}: ${r}`)})}return{name:GS,setupOnce(){Wne()&&new WS.ReportingObserver(n,{buffered:!0,types:t}).observe()},setup(e){KS.set(e,!0)}}})),JS=`HttpClient`,YS=Ml(((e={})=>{let t={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...e};return{name:JS,setup(e){rC(e,t),iC(e,t)}}}));function XS(e,t,n,r,i){if(aC(e,n.status,n.url)){let e=sC(t,r),a,o,s,c,l=cC();if(l.requestHeaders!==!1&&(a=ud($S(e.headers),l.requestHeaders)),l.responseHeaders!==!1&&(o=ud($S(n.headers),l.responseHeaders)),l.cookies!==!1){let t=e.headers.get(`Cookie`)||void 0;if(t){let e=fd(t,l.cookies);typeof e==`object`&&(s=e)}let r=n.headers.get(`Set-Cookie`)||void 0;if(r){let e=fd(r,l.cookies);typeof e==`object`&&(c=e)}}el(oC({url:e.url,method:e.method,status:n.status,requestHeaders:a,responseHeaders:o,requestCookies:s,responseCookies:c,error:i,type:`fetch`}))}}function ZS(e,t,n,r,i){if(aC(e,t.status,t.responseURL)){let e,a,o,s=cC();if(s.cookies!==!1)try{let e=t.getResponseHeader(`Set-Cookie`)||t.getResponseHeader(`set-cookie`)||void 0;if(e){let t=fd(e,s.cookies);typeof t==`object`&&(a=t)}}catch{}if(s.responseHeaders!==!1)try{o=ud(eC(t),s.responseHeaders)}catch{}s.requestHeaders!==!1&&(e=ud(r,s.requestHeaders)),el(oC({url:t.responseURL,method:n,status:t.status,requestHeaders:e,responseHeaders:o,responseCookies:a,error:i,type:`xhr`}))}}function QS(e){if(e){let t=e[`Content-Length`]||e[`content-length`];if(t)return parseInt(t,10)}}function $S(e){let t={};return e.forEach((e,n)=>{t[n]=e}),t}function eC(e){let t=e.getAllResponseHeaders();return t?t.split(`\r
|
|
494
|
+
`).reduce((e,t)=>{let[n,r]=t.split(`: `);return n&&r&&(e[n]=r),e},{}):{}}function tC(e,t){return e.some(e=>typeof e==`string`?t.includes(e):e.test(t))}function nC(e,t){return e.some(e=>typeof e==`number`?e===t:t>=e[0]&&t<=e[1])}function rC(e,t){Zg()&&Qg(n=>{if(F()!==e)return;let{response:r,args:i,error:a,virtualError:o}=n,[s,c]=i;r&&XS(t,s,r,c,a||o)},!1)}function iC(e,t){`XMLHttpRequest`in M&&Gx(n=>{if(F()!==e)return;let{error:r,virtualError:i}=n,a=n.xhr,o=a[Wx];if(!o)return;let{method:s,request_headers:c}=o;try{ZS(t,a,s,c,r||i)}catch(e){z&&N.warn(`Error while extracting response event form XHR response`,e)}})}function aC(e,t,n){return nC(e.failedRequestStatusCodes,t)&&tC(e.failedRequestTargets,n)&&!bd(n,F())}function oC(e){let t=F(),n=t&&e.error&&e.error instanceof Error?e.error.stack:void 0,r=n&&t?t.getOptions().stackParser(n,0,1):void 0,i=`HTTP Client Error with status code: ${e.status}`,a={message:i,exception:{values:[{type:`Error`,value:i,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:QS(e.responseHeaders)}}};return Ni(a,{type:`auto.http.client.${e.type}`,handled:!1}),a}function sC(e,t){return!t&&e instanceof Request||e instanceof Request&&e.bodyUsed?e:new Request(e,t)}function cC(){let e=F();if(!e)return{cookies:!1,requestHeaders:!1,responseHeaders:!1};let t=e.getOptions();if(t.dataCollection==null){let e=!!t.sendDefaultPii;return{cookies:e,requestHeaders:e,responseHeaders:e}}let{cookies:n,httpHeaders:r}=e.getDataCollectionOptions();return{cookies:n,requestHeaders:r.request,responseHeaders:r.response}}var lC=M,uC=7,dC=`ContextLines`,fC=Ml(((e={})=>({name:dC,processEvent(t,n,r){return pC(t,e.frameContextLines??r?.getDataCollectionOptions().frameContextLines??uC)}})));function pC(e,t){let n=lC.document,r=lC.location&&vd(lC.location.href);if(!n||!r)return e;let i=e.exception?.values;if(!i?.length)return e;let a=n.documentElement.innerHTML;if(!a)return e;let o=[`<!DOCTYPE html>`,`<html>`,...a.split(`
|
|
495
|
+
`),`</html>`];return i.forEach(e=>{let n=e.stacktrace;n?.frames&&(n.frames=n.frames.map(e=>mC(e,o,r,t)))}),e}function mC(e,t,n,r){return e.filename!==n||!e.lineno||!t.length||Pi(t,e,r),e}var hC=`GraphQLClient`,gC=(e=>({name:hC,setup(t){_C(t,e),vC(t,e)}}));function _C(e,t){e.on(`beforeOutgoingRequestSpan`,(n,r)=>{let i=L(n).data||{};if(i[`sentry.op`]!==`http.client`)return;let a=i[`url.full`]||i[`http.url`]||i.url,o=i[`http.request.method`]||i[`http.method`];if(!Lr(a)||!Lr(o))return;let{endpoints:s}=t,c=Ti(a,s),l=bC(r);if(c&&l){let t=wC(l);if(t){let r=yC(t);n.updateName(`${o} ${a} (${r})`),SC(t)&&e.getDataCollectionOptions().graphQL.document===!0&&n.setAttribute(Oc,t.query),CC(t)&&(n.setAttribute(`graphql.persisted_query.hash.sha256`,t.extensions.persistedQuery.sha256Hash),n.setAttribute(`graphql.persisted_query.version`,t.extensions.persistedQuery.version))}}})}function vC(e,t){e.on(`beforeOutgoingRequestBreadcrumb`,(n,r)=>{let{category:i,type:a,data:o}=n;if(a===`http`&&(i===`fetch`||i===`xhr`)){let n=o?.url,{endpoints:i}=t,a=Ti(n,i),s=bC(r);if(a&&o&&s){let t=wC(s);!o.graphql&&t&&(o[`graphql.operation`]=yC(t),SC(t)&&e.getDataCollectionOptions().graphQL.document===!0&&(o[Oc]=t.query),CC(t)&&(o[`graphql.persisted_query.hash.sha256`]=t.extensions.persistedQuery.sha256Hash,o[`graphql.persisted_query.version`]=t.extensions.persistedQuery.version))}}})}function yC(e){if(CC(e))return`persisted ${e.operationName}`;if(SC(e)){let{query:t,operationName:n}=e,{operationName:r=n,operationType:i}=xC(t);return r?`${i} ${r}`:`${i}`}return`unknown`}function bC(e){let t=`xhr`in e,n;if(t){let t=e.xhr[Wx];n=t&&qx(t.body)[0]}else n=qx(Jx(e.input))[0];return n}function xC(e){let 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]};let i=e.match(n);return i?{operationType:i[1],operationName:void 0}:{operationType:void 0,operationName:void 0}}function SC(e){return Vr(e)&&typeof e.query==`string`}function CC(e){return Vr(e)&&typeof e.operationName==`string`&&Vr(e.extensions)&&Vr(e.extensions.persistedQuery)&&typeof e.extensions.persistedQuery.sha256Hash==`string`&&typeof e.extensions.persistedQuery.version==`number`}function wC(e){try{let t=JSON.parse(e);return SC(t)||CC(t)?t:void 0}catch{return}}var TC=Ml(gC),EC=Ml((e={})=>{let t=[`script`];function n(r,i,a=0){if(!r)return;let o=`shadowRoot`in r&&r.shadowRoot?r.shadowRoot.children:r.children;for(let r of o){if(!(r instanceof HTMLElement))continue;let o=i_(r,1)||void 0,s=r.tagName.toLowerCase();if(t.includes(s))continue;let c=e.onElement?.({element:r,componentName:o,tagName:s,depth:a})||{};if(c===`skip`)continue;if(c===`children`){n(r,i,a+1);continue}let{x:l,y:u,width:d,height:f}=r.getBoundingClientRect(),p={identifier:r.id||void 0,type:o||s,visible:!0,alpha:1,height:f,width:d,x:l,y:u,...c};p.children=[],n(r,p.children,a+1),i.push(p)}}return{name:`ViewHierarchy`,processEvent:(t,r)=>{if(t.type!==void 0||e.shouldAttach?.(t,r)===!1)return t;let i={rendering_system:`DOM`,positioning:`absolute`,windows:[]};n(e.rootElement?.()||R.document.body,i.windows);let a={filename:`view-hierarchy.json`,attachmentType:`event.view_hierarchy`,contentType:`application/json`,data:JSON.stringify(i)};return r.attachments=r.attachments||[],r.attachments.push(a),t}}}),DC=M,OC=`sentryReplaySession`,kC=`replay_event`,AC=`Unable to send Replay`,jC=3e5,MC=9e5,NC=5e3,PC=5500,FC=6e4,IC=5e3,LC=3,RC=15e4,zC=5e3,BC=3e3,VC=300,HC=2e7,UC=4999,WC=5e4,GC=36e5,KC=Object.defineProperty,qC=(e,t,n)=>t in e?KC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JC=(e,t,n)=>qC(e,typeof t==`symbol`?t:t+``,n),YC=(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))(YC||{});function XC(e){return e.nodeType===e.ELEMENT_NODE}function ZC(e){return e?.host?.shadowRoot===e}function QC(e){return Object.prototype.toString.call(e)===`[object ShadowRoot]`}function $C(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 ew(e){let{cssText:t}=e;if(t.split(`"`).length<3)return t;let 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 tw(e){try{let t=e.rules||e.cssRules;return t?$C(Array.from(t,rw).join(``)):null}catch{return null}}function nw(e){let t=``;for(let n=0;n<e.style.length;n++){let r=e.style,i=r[n],a=r.getPropertyPriority(i);t+=`${i}:${r.getPropertyValue(i)}${a?` !important`:``};`}return`${e.selectorText} { ${t} }`}function rw(e){let t;if(aw(e))try{t=tw(e.styleSheet)||ew(e)}catch{}else if(ow(e)){let t=e.cssText,n=e.selectorText.includes(`:`),r=typeof e.style.all==`string`&&e.style.all;if(r&&(t=nw(e)),n&&(t=iw(t)),n||r)return t}return t||e.cssText}function iw(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,`$1\\$2`)}function aw(e){return`styleSheet`in e}function ow(e){return`selectorText`in e}var sw=class{constructor(){JC(this,`idNodeMap`,new Map),JC(this,`nodeMetaMap`,new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function cw(){return new sw}function lw({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 uw({isMasked:e,element:t,value:n,maskInputFn:r}){let i=n||``;return e?(r&&(i=r(i,t)),`*`.repeat(i.length)):i}function dw(e){return e.toLowerCase()}function fw(e){return e.toUpperCase()}var pw=`__rrweb_original__`;function mw(e){let t=e.getContext(`2d`);if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){let i=t.getImageData,a=pw in i?i[pw]:i;if(new Uint32Array(a.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>e!==0))return!1}return!0}function hw(e){let t=e.type;return e.hasAttribute(`data-rr-is-password`)?`password`:t?dw(t):null}function gw(e,t,n){return t===`INPUT`&&(n===`radio`||n===`checkbox`)?e.getAttribute(`value`)||``:e.value}function _w(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}return n.pathname.match(/\.([0-9a-z]+)(?:$)/i)?.[1]??null}var vw={};function yw(e){let t=vw[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement==`function`)try{let t=n.createElement(`iframe`);t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch{}return vw[e]=r.bind(window)}function bw(...e){return yw(`setTimeout`)(...e)}function xw(...e){return yw(`clearTimeout`)(...e)}function Sw(e){try{return e.contentDocument}catch{}}function Cw(e){try{return e.contentWindow}catch{}}var ww=1,Tw=RegExp(`[^a-z0-9-_:]`),Ew=-2;function Dw(){return ww++}function Ow(e){if(e instanceof HTMLFormElement)return`form`;let t=dw(e.tagName);return Tw.test(t)?`div`:t}function kw(e){let t=``;return t=e.indexOf(`//`)>-1?e.split(`/`).slice(0,3).join(`/`):e.split(`/`)[0],t=t.split(`?`)[0],t}var Aw,jw,Mw=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Nw=/^(?:[a-z+]+:)?\/\//i,Pw=/^www\..*/i,Fw=/^(data:)([^,]*),(.*)/i;function Iw(e,t){if(!e||t.size===0)return e;try{let n=e.split(`;`),r=[];for(let e of n){if(e=e.trim(),!e)continue;let n=e.indexOf(`:`);if(n===-1){r.push(e);continue}let i=e.slice(0,n).trim();t.has(i)||r.push(e)}return r.join(`; `)+(r.length>0&&e.endsWith(`;`)?`;`:``)}catch(t){return console.warn(`Error filtering CSS properties:`,t),e}}function Lw(e,t){return(e||``).replace(Mw,(e,n,r,i,a,o)=>{let s=r||a||o,c=n||i||``;if(!s)return e;if(Nw.test(s)||Pw.test(s)||Fw.test(s))return`url(${c}${s}${c})`;if(s[0]===`/`)return`url(${c}${kw(t)+s}${c})`;let l=t.split(`/`),u=s.split(`/`);l.pop();for(let e of u)if(e===`.`)continue;else e===`..`?l.pop():l.push(e);return`url(${c}${l.join(`/`)}${c})`})}var Rw=/^[^ \t\n\r\u000c]+/,zw=/^[, \t\n\r\u000c]+/;function Bw(e,t){if(t.trim()===``)return t;let n=0;function r(e){let r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):``}let i=[];for(;r(zw),!(n>=t.length);){let a=r(Rw);if(a.slice(-1)===`,`)a=Hw(e,a.substring(0,a.length-1)),i.push(a);else{let r=``;a=Hw(e,a);let o=!1;for(;;){let e=t.charAt(n);if(e===``){i.push((a+r).trim());break}if(o)e===`)`&&(o=!1);else{if(e===`,`){n+=1,i.push((a+r).trim());break}e===`(`&&(o=!0)}r+=e,n+=1}}}return i.join(`, `)}var Vw=new WeakMap;function Hw(e,t){return!t||t.trim()===``?t:Ww(e,t)}function Uw(e){return!!(e.tagName===`svg`||e.ownerSVGElement)}function Ww(e,t){let n=Vw.get(e);if(n||(n=e.createElement(`a`),Vw.set(e,n)),!t)t=``;else if(t.startsWith(`blob:`)||t.startsWith(`data:`))return t;return n.setAttribute(`href`,t),n.href}function Gw(e,t,n,r,i,a,o){if(!r)return r;if(n===`src`||n===`href`&&(t!==`use`||r[0]!==`#`)||n===`xlink:href`&&r[0]!==`#`||n===`background`&&(t===`table`||t===`td`||t===`th`))return Hw(e,r);if(n===`srcset`)return Bw(e,r);if(n===`style`){let t=Lw(r,Ww(e));return o&&o.size>0&&(t=Iw(t,o)),t}return t===`object`&&n===`data`?Hw(e,r):typeof a==`function`?a(n,r,i):r}function Kw(e,t,n){return(e===`video`||e===`audio`)&&t===`autoplay`}function qw(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 n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch{}return!1}function Jw(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function Yw(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Yw(e.parentNode,t,n,r+1)}function Xw(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e==`string`){if(r.matches(`.${e}`))return!0}else if(Jw(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function Zw(e,t,n,r,i,a){try{let o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(o.tagName===`INPUT`){let e=o.getAttribute(`autocomplete`);if([`current-password`,`new-password`,`cc-number`,`cc-exp`,`cc-exp-month`,`cc-exp-year`,`cc-csc`].includes(e))return!0}let s=-1,c=-1;if(a){if(c=Yw(o,Xw(r,i)),c<0)return!0;s=Yw(o,Xw(t,n),c>=0?c:1/0)}else{if(s=Yw(o,Xw(t,n)),s<0)return!1;c=Yw(o,Xw(r,i),s>=0?s:1/0)}return s>=0?c>=0?s<=c:!0:c>=0?!1:!!a}catch{}return!!a}function Qw(e,t,n){let r=Cw(e);if(!r)return;let i=!1,a;try{a=r.document.readyState}catch{return}if(a!==`complete`){let r=bw(()=>{i||=(t(),!0)},n);e.addEventListener(`load`,()=>{xw(r),i=!0,t()});return}let o=`about:blank`;if(r.location.href!==o||e.src===o||e.src===``)return bw(t,0),e.addEventListener(`load`,t);e.addEventListener(`load`,t)}function $w(e,t,n){let r=!1,i;try{i=e.sheet}catch{i=null}if(i)return;let a=bw(()=>{r||=(t(),!0)},n);e.addEventListener(`load`,()=>{xw(a),r=!0,t()})}function eT(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskAttributeFn:c,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:m={},maskTextFn:h,maskInputFn:g,dataURLOptions:_={},inlineImages:v,recordCanvas:y,keepIframeSrcFn:b,newlyAddedElement:x=!1,ignoreCSSAttributes:S}=t,C=tT(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode===`CSS1Compat`?{type:YC.Document,childNodes:[]}:{type:YC.Document,childNodes:[],compatMode:e.compatMode};case e.DOCUMENT_TYPE_NODE:return{type:YC.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return rT(e,{doc:n,blockClass:i,blockSelector:a,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:c,maskInputOptions:m,maskInputFn:g,dataURLOptions:_,inlineImages:v,recordCanvas:y,keepIframeSrcFn:b,newlyAddedElement:x,rootId:C,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,ignoreCSSAttributes:S});case e.TEXT_NODE:return nT(e,{doc:n,maskAllText:s,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,maskTextFn:h,maskInputOptions:m,maskInputFn:g,rootId:C});case e.CDATA_SECTION_NODE:return{type:YC.CDATA,textContent:``,rootId:C};case e.COMMENT_NODE:return{type:YC.Comment,textContent:e.textContent||``,rootId:C};default:return!1}}function tT(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function nT(e,t){let{maskAllText:n,maskTextClass:r,unmaskTextClass:i,maskTextSelector:a,unmaskTextSelector:o,maskTextFn:s,maskInputOptions:c,maskInputFn:l,rootId:u}=t,d=e.parentNode&&e.parentNode.tagName,f=e.textContent,p=d===`STYLE`||void 0,m=d===`SCRIPT`||void 0,h=d===`TEXTAREA`||void 0;if(p&&f){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(f=tw(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}f=Lw(f,Ww(t.doc))}m&&(f=`SCRIPT_PLACEHOLDER`);let g=Zw(e,r,a,i,o,n);return!p&&!m&&!h&&f&&g&&(f=s?s(f,e.parentElement):f.replace(/[\S]/g,`*`)),h&&f&&(c.textarea||g)&&(f=l?l(f,e.parentNode):f.replace(/[\S]/g,`*`)),d===`OPTION`&&f&&(f=uw({isMasked:Zw(e,r,a,i,o,lw({type:null,tagName:d,maskInputOptions:c})),element:e,value:f,maskInputFn:l})),{type:YC.Text,textContent:f||``,isStyle:p,rootId:u}}function rT(e,t){let{doc:n,blockClass:r,blockSelector:i,unblockSelector:a,inlineStylesheet:o,maskInputOptions:s={},maskAttributeFn:c,maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:h,maskTextClass:g,unmaskTextClass:_,maskTextSelector:v,unmaskTextSelector:y,ignoreCSSAttributes:b}=t,x=qw(e,r,i,a),S=Ow(e),C={},w=e.attributes.length;for(let t=0;t<w;t++){let r=e.attributes[t];r.name&&!Kw(S,r.name,r.value)&&(C[r.name]=Gw(n,S,dw(r.name),r.value,e,c,b))}if(S===`link`&&o){let t=Array.from(n.styleSheets).find(t=>t.href===e.href),r=null;t&&(r=tw(t)),r&&(C.rel=null,C.href=null,C.crossorigin=null,C._cssText=Lw(r,t.href))}if(S===`style`&&e.sheet&&!(e.innerText||e.textContent||``).trim().length){let t=tw(e.sheet);t&&(C._cssText=Lw(t,Ww(n)))}if(S===`input`||S===`textarea`||S===`select`||S===`option`){let t=e,n=hw(t),r=gw(t,fw(S),n),i=t.checked;if(n!==`submit`&&n!==`button`&&r){let e=Zw(t,g,v,_,y,lw({type:n,tagName:fw(S),maskInputOptions:s}));C.value=uw({isMasked:e,element:t,value:r,maskInputFn:l})}i&&(C.checked=i)}if(S===`option`&&(e.selected&&!s.select?C.selected=!0:delete C.selected),S===`canvas`&&f){if(e.__context===`2d`)mw(e)||(C.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!(`__context`in e)){let t=e.toDataURL(u.type,u.quality),r=n.createElement(`canvas`);r.width=e.width,r.height=e.height,t!==r.toDataURL(u.type,u.quality)&&(C.rr_dataURL=t)}}if(S===`img`&&d){Aw||(Aw=n.createElement(`canvas`),jw=Aw.getContext(`2d`));let t=e,r=t.currentSrc||t.getAttribute(`src`)||`<unknown-src>`,i=t.crossOrigin,a=()=>{t.removeEventListener(`load`,a);try{Aw.width=t.naturalWidth,Aw.height=t.naturalHeight,jw.drawImage(t,0,0),C.rr_dataURL=Aw.toDataURL(u.type,u.quality)}catch(e){if(t.crossOrigin!==`anonymous`){t.crossOrigin=`anonymous`,t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a);return}console.warn(`Cannot inline img src=${r}! Error: ${e}`)}t.crossOrigin===`anonymous`&&(i?C.crossOrigin=i:t.removeAttribute(`crossorigin`))};t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a)}if((S===`audio`||S===`video`)&&(C.rr_mediaState=e.paused?`paused`:`played`,C.rr_mediaCurrentTime=e.currentTime),m||(e.scrollLeft&&(C.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(C.rr_scrollTop=e.scrollTop)),x){let{width:t,height:n}=e.getBoundingClientRect();C={class:C.class,rr_width:`${t}px`,rr_height:`${n}px`}}S===`iframe`&&!p(C.src)&&(!x&&!Sw(e)&&(C.rr_src=C.src),delete C.src);let T;try{customElements.get(S)&&(T=!0)}catch{}return{type:YC.Element,tagName:S,attributes:C,childNodes:[],isSVG:Uw(e)||void 0,needBlock:x,rootId:h,isCustom:T}}function iT(e){return e==null?``:e.toLowerCase()}function aT(e,t){return!!(t.comment&&e.type===YC.Comment||e.type===YC.Element&&(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`&&_w(e.attributes.href)===`js`)||t.headFavicon&&(e.tagName===`link`&&e.attributes.rel===`shortcut icon`||e.tagName===`meta`&&(iT(e.attributes.name).match(/^msapplication-tile(image|color)$/)||iT(e.attributes.name)===`application-name`||iT(e.attributes.rel)===`icon`||iT(e.attributes.rel)===`apple-touch-icon`||iT(e.attributes.rel)===`shortcut icon`))||e.tagName===`meta`&&(t.headMetaDescKeywords&&iT(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(iT(e.attributes.property).match(/^(og|twitter|fb):/)||iT(e.attributes.name).match(/^(og|twitter):/)||iT(e.attributes.name)===`pinterest`)||t.headMetaRobots&&(iT(e.attributes.name)===`robots`||iT(e.attributes.name)===`googlebot`||iT(e.attributes.name)===`bingbot`)||t.headMetaHttpEquiv&&e.attributes[`http-equiv`]!==void 0||t.headMetaAuthorship&&(iT(e.attributes.name)===`author`||iT(e.attributes.name)===`generator`||iT(e.attributes.name)===`framework`||iT(e.attributes.name)===`publisher`||iT(e.attributes.name)===`progid`||iT(e.attributes.property).match(/^article:/)||iT(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(iT(e.attributes.name)===`google-site-verification`||iT(e.attributes.name)===`yandex-verification`||iT(e.attributes.name)===`csrf-token`||iT(e.attributes.name)===`p:domain_verify`||iT(e.attributes.name)===`verify-v1`||iT(e.attributes.name)===`verification`||iT(e.attributes.name)===`shopify-checkout-api-token`))))}function oT(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:m={},maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y={},inlineImages:b=!1,recordCanvas:x=!1,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w=5e3,onBlockedImageLoad:T,onStylesheetLoad:ee,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:te=()=>!1,newlyAddedElement:ne=!1,ignoreCSSAttributes:re}=t,{preserveWhiteSpace:ie=!0}=t,ae=eT(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,maskAllText:s,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,dataURLOptions:y,inlineImages:b,recordCanvas:x,keepIframeSrcFn:te,newlyAddedElement:ne,ignoreCSSAttributes:re});if(!ae)return console.warn(e,`not serialized`),null;let oe;oe=r.hasNode(e)?r.getId(e):aT(ae,v)||!ie&&ae.type===YC.Text&&!ae.isStyle&&!ae.textContent.trim().length?Ew:Dw();let D=Object.assign(ae,{id:oe});if(r.add(e,D),oe===Ew)return null;S&&S(e);let se=!f;if(D.type===YC.Element){se&&=!D.needBlock;let t=e.shadowRoot;t&&QC(t)&&(D.isShadowHost=!0)}if((D.type===YC.Document||D.type===YC.Element)&&se){v.headWhitespace&&D.type===YC.Element&&D.tagName===`head`&&(ie=!1);let t={doc:n,mirror:r,blockClass:i,blockSelector:a,maskAllText:s,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:f,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:ie,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onBlockedImageLoad:T,onStylesheetLoad:ee,stylesheetLoadTimeout:E,keepIframeSrcFn:te,ignoreCSSAttributes:re},ne=e.childNodes?Array.from(e.childNodes):[];for(let e of ne){let n=oT(e,t);n&&D.childNodes.push(n)}if(XC(e)&&e.shadowRoot)for(let n of Array.from(e.shadowRoot.childNodes)){let r=oT(n,t);r&&(QC(e.shadowRoot)&&(r.isShadow=!0),D.childNodes.push(r))}}if(e.parentNode&&ZC(e.parentNode)&&QC(e.parentNode)&&(D.isShadow=!0),D.type===YC.Element&&D.tagName===`iframe`&&!D.needBlock&&Qw(e,()=>{let t=Sw(e);if(t&&C){let n=oT(t,{doc:t,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:ie,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:ee,stylesheetLoadTimeout:E,keepIframeSrcFn:te,ignoreCSSAttributes:re});n&&C(e,n)}},w),D.type===YC.Element&&D.tagName===`img`&&!e.complete&&D.needBlock){let t=e,n=()=>{if(t.isConnected&&!t.complete&&T)try{let e=t.getBoundingClientRect();e.width>0&&e.height>0&&T(t,D,e)}catch{}t.removeEventListener(`load`,n)};t.isConnected&&t.addEventListener(`load`,n)}return D.type===YC.Element&&D.tagName===`link`&&typeof D.attributes.rel==`string`&&(D.attributes.rel===`stylesheet`||D.attributes.rel===`preload`&&typeof D.attributes.href==`string`&&_w(D.attributes.href)===`css`)&&$w(e,()=>{if(ee){let t=oT(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:ie,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:ee,stylesheetLoadTimeout:E,keepIframeSrcFn:te,ignoreCSSAttributes:re});t&&ee(e,t)}},E),D.type===YC.Element&&delete D.needBlock,D}function sT(e,t){let{mirror:n=new sw,blockClass:r=`rr-block`,blockSelector:i=null,unblockSelector:a=null,maskAllText:o=!1,maskTextClass:s=`rr-mask`,unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:u=null,inlineStylesheet:d=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:m=!1,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOM:v=!1,dataURLOptions:y,preserveWhiteSpace:b,onSerialize:x,onIframeLoad:S,iframeLoadTimeout:C,onBlockedImageLoad:w,onStylesheetLoad:T,stylesheetLoadTimeout:ee,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:te=new Set([])}=t||{};return oT(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,maskAllText:o,maskTextClass:s,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions: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}:m===!1?{}:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v===!0||v===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:v===`all`,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:v===!1?{}:v,dataURLOptions:y,inlineImages:f,recordCanvas:p,preserveWhiteSpace:b,onSerialize:x,onIframeLoad:S,iframeLoadTimeout:C,onBlockedImageLoad:w,onStylesheetLoad:T,stylesheetLoadTimeout:ee,keepIframeSrcFn:E,newlyAddedElement:!1,ignoreCSSAttributes:te})}function cT(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var lT=`Please stop import mirror directly. Instead of that,\r
|
|
496
|
+
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
497
|
+
or you can use record.mirror to access the mirror instance during recording.`,uT={map:{},getId(){return console.error(lT),-1},getNode(){return console.error(lT),null},removeNodeFromMap(){console.error(lT)},has(){return console.error(lT),!1},reset(){console.error(lT)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(uT=new Proxy(uT,{get(e,t,n){return t===`map`&&console.error(lT),Reflect.get(e,t,n)}}));function dT(e,t,n={}){let r=null,i=0;return function(...a){let o=Date.now();!i&&n.leading===!1&&(i=o);let s=t-(o-i),c=this;s<=0||s>t?(r&&=(LT(r),null),i=o,e.apply(c,a)):!r&&n.trailing!==!1&&(r=IT(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(c,a)},s))}}function fT(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){IT(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>fT(e,t,a||{},!0)}function pT(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var mT=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(mT=()=>new Date().getTime());function hT(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset===void 0?t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0:e.pageXOffset,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset===void 0?t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0:e.pageYOffset}}function gT(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _T(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function vT(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function yT(e,t,n,r,i){if(!e)return!1;let a=vT(e);if(!a)return!1;let o=Xw(t,n);if(!i){let e=r&&a.matches(r);return o(a)&&!e}let s=Yw(a,o),c=-1;return s<0?!1:(r&&(c=Yw(a,Xw(null,r))),s>-1&&c<0||s<c)}function bT(e,t){return t.getId(e)!==-1}function xT(e,t){return t.getId(e)===Ew}function ST(e,t){if(ZC(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:!e.parentNode||ST(e.parentNode,t):!0}function CT(e){return!!e.changedTouches}function wT(e=window){`NodeList`in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw TypeError(`1 argument is required`);do if(this===t)return!0;while(t&&=t.parentNode);return!1})}function TT(e,t){return!!(e.nodeName===`IFRAME`&&t.getMeta(e))}function ET(e,t){return!!(e.nodeName===`LINK`&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute(`rel`)===`stylesheet`&&t.getMeta(e))}function DT(e){return!!e?.shadowRoot}var OT=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=t===void 0?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function kT(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function AT(e){let t=e,n;for(;n=kT(t);)t=n;return t}function jT(e){let t=e.ownerDocument;if(!t)return!1;let n=AT(e);return t.contains(n)}function MT(e){let t=e.ownerDocument;return t?t.contains(e)||jT(e):!1}var NT={};function PT(e){let t=NT[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement==`function`)try{let t=n.createElement(`iframe`);t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch{}return NT[e]=r.bind(window)}function FT(...e){return PT(`requestAnimationFrame`)(...e)}function IT(...e){return PT(`setTimeout`)(...e)}function LT(...e){return PT(`clearTimeout`)(...e)}var RT=(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))(RT||{}),B=(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))(B||{}),zT=(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))(zT||{}),BT=(e=>(e[e.Mouse=0]=`Mouse`,e[e.Pen=1]=`Pen`,e[e.Touch=2]=`Touch`,e))(BT||{}),VT=(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))(VT||{}),HT;function UT(e){HT=e}function WT(){HT=void 0}for(var GT=e=>HT?((...t)=>{try{return e(...t)}catch(e){if(HT&&HT(e)===!0)return()=>{};throw e}}):e,KT=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,qT=typeof Uint8Array>`u`?[]:new Uint8Array(256),JT=0;JT<KT.length;JT++)qT[KT.charCodeAt(JT)]=JT;var YT=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function XT(e){try{return e.contentDocument}catch{}}function ZT(e){try{return e.contentWindow}catch{}}var QT=class{constructor(e){this.doc=e,this.unattachedDoc=null}parse(e){return this.parseWithConstructableStylesheet(e)||this.parseWithDetachedElement(e)}parseWithConstructableStylesheet(e){if(typeof CSSStyleSheet>`u`||typeof CSSStyleSheet.prototype.replaceSync!=`function`)return null;try{let t=new CSSStyleSheet;t.replaceSync(`x { ${e} }`);let n=t.cssRules[0];return!n||n.type!==CSSRule.STYLE_RULE?null:n.style}catch{return null}}parseWithDetachedElement(e){let t=this.getUnattachedDoc().createElement(`span`);return t.setAttribute(`style`,e),t.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}};function $T(e){return`__ln`in e}var eE=class{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw Error(`Position outside of list range`);let t=this.head;for(let n=0;n<e;n++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&$T(e.previousSibling)){let n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&$T(e.nextSibling)&&e.nextSibling.__ln.previous){let n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},tE=(e,t)=>`${e}@${t}`,nE=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,n=new eE,r=e=>{let t=e,n=Ew;for(;n===Ew;)t&&=t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{if(!i.parentNode||!MT(i))return;let a=ZC(i.parentNode)?this.mirror.getId(kT(i)):this.mirror.getId(i.parentNode),o=r(i);if(a===-1||o===-1)return n.addNode(i);let s=oT(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{TT(e,this.mirror)&&!yT(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(e),ET(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),DT(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{if(yT(e,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(e,t);let n=ZT(e);n&&this.canvasManager.addWindow(n),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,{width:n,height:r})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${n}px`,height:`${r}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});s&&(e.push({parentId:a,nextId:o,node:s}),t.add(s.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet)iE(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||i(e);for(let e of this.addedSet)!oE(this.droppedSet,e)&&!iE(this.removes,e,this.mirror)||oE(this.movedSet,e)?i(e):this.droppedSet.add(e);let a=null;for(;n.length;){let e=null;if(a){let t=this.mirror.getId(a.value.parentNode),n=r(a.value);t!==-1&&n!==-1&&(e=a)}if(!e){let t=n.tail;for(;t;){let n=t;if(t=t.previous,n){let t=this.mirror.getId(n.value.parentNode);if(r(n.value)===-1)continue;if(t!==-1){e=n;break}{let t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let r=t.parentNode.host;if(this.mirror.getId(r)!==-1){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}a=e.previous,n.removeNode(e.value),i(e.value)}let o={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{let{attributes:t}=e;if(typeof t.style==`string`){let n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split(`var(`).length===t.style.split(`var(`).length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};!o.texts.length&&!o.attributes.length&&!o.removes.length&&!o.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(o))},this.processMutation=e=>{if(!xT(e.target,this.mirror))switch(e.type){case`characterData`:{let t=e.target.textContent;!yT(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Zw(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t,vT(e.target)):t.replace(/[\S]/g,`*`):t,node:e.target});break}case`attributes`:{let t=e.target,n=e.attributeName,r=e.target.getAttribute(n);if(n===`value`){let n=hw(t),i=t.tagName;r=gw(t,i,n);let a=lw({maskInputOptions:this.maskInputOptions,tagName:i,type:n});r=uw({isMasked:Zw(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a),element:t,value:r,maskInputFn:this.maskInputFn})}if(yT(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||r===e.oldValue)return;let i=this.attributeMap.get(e.target);if(t.tagName===`IFRAME`&&n===`src`&&!this.keepIframeSrcFn(r))if(!XT(t))n=`rr_src`;else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),n===`type`&&t.tagName===`INPUT`&&(e.oldValue||``).toLowerCase()===`password`&&t.setAttribute(`data-rr-is-password`,`true`),!Kw(t.tagName,n)&&(i.attributes[n]=Gw(this.doc,dw(t.tagName),dw(n),r,t,this.maskAttributeFn),n===`style`)){let n=e.oldValue?this.styleDeclarationParser.parse(e.oldValue):null;for(let e of Array.from(t.style)){let r=t.style.getPropertyValue(e),a=t.style.getPropertyPriority(e);r!==(n?.getPropertyValue(e)||``)||a!==(n?.getPropertyPriority(e)||``)?a===``?i.styleDiff[e]=r:i.styleDiff[e]=[r,a]:i._unchangedStyles[e]=[r,a]}if(n)for(let e of Array.from(n))t.style.getPropertyValue(e)===``&&(i.styleDiff[e]=!1)}break}case`childList`:if(yT(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let n=this.mirror.getId(t),r=ZC(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);yT(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||xT(t,this.mirror)||!bT(t,this.mirror)||(this.addedSet.has(t)?(rE(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&n===-1||ST(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[tE(n,r)]?rE(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:ZC(e.target)&&QC(e.target)?!0:void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(xT(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&n!==-1&&(this.movedMap[tE(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);yT(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes&&e.childNodes.forEach(e=>this.genAdds(e)),DT(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}}init(e){`mutationCb.blockClass.blockSelector.unblockSelector.maskAllText.maskTextClass.unmaskTextClass.maskTextSelector.unmaskTextSelector.inlineStylesheet.maskInputOptions.maskAttributeFn.maskTextFn.maskInputFn.keepIframeSrcFn.recordCanvas.inlineImages.slimDOMOptions.dataURLOptions.doc.mirror.iframeManager.stylesheetManager.shadowDomManager.canvasManager.processedNodeManager.ignoreCSSAttributes`.split(`.`).forEach(t=>{this[t]=e[t]}),this.styleDeclarationParser=new QT(this.doc)}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 rE(e,t){e.delete(t),t.childNodes?.forEach(t=>rE(e,t))}function iE(e,t,n){return e.length!==0&&aE(e,t,n)}function aE(e,t,n){let r=t.parentNode;for(;r;){let t=n.getId(r);if(e.some(e=>e.id===t))return!0;r=r.parentNode}return!1}function oE(e,t){return e.size!==0&&sE(e,t)}function sE(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:sE(e,n):!1}var cE=[];function lE(e){try{if(`composedPath`in e){let 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 uE(e,t){let n=new nE;cE.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver,i=window?.Zone?.__symbol__?.(`MutationObserver`);i&&window[i]&&(r=window[i]);let a=new r(GT(t=>{e.onMutation&&e.onMutation(t)===!1||n.processMutations.bind(n)(t)}));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function dE({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove==`number`?t.mousemove:50,a=typeof t.mousemoveCallback==`number`?t.mousemoveCallback:500,o=[],s,c=dT(GT(t=>{let n=Date.now()-s;e(o.map(e=>(e.timeOffset-=n,e)),t),o=[],s=null}),a),l=GT(dT(GT(e=>{let t=lE(e),{clientX:n,clientY:i}=CT(e)?e.changedTouches[0]:e;s||=mT(),o.push({x:n,y:i,id:r.getId(t),timeOffset:mT()-s}),c(typeof DragEvent<`u`&&e instanceof DragEvent?B.Drag:e instanceof MouseEvent?B.MouseMove:B.TouchMove)}),i,{trailing:!1})),u=[cT(`mousemove`,l,n),cT(`touchmove`,l,n),cT(`drag`,l,n)];return GT(()=>{u.forEach(e=>e())})}function fE({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[],l=null,u=t=>o=>{let s=lE(o);if(yT(s,r,i,a,!0))return;let c=null,u=t;if(`pointerType`in o){switch(o.pointerType){case`mouse`:c=BT.Mouse;break;case`touch`:c=BT.Touch;break;case`pen`:c=BT.Pen}c===BT.Touch?zT[t]===zT.MouseDown?u=`TouchStart`:zT[t]===zT.MouseUp&&(u=`TouchEnd`):BT.Pen}else CT(o)&&(c=BT.Touch);c===null?zT[t]===zT.Click&&(c=l,l=null):(l=c,(u.startsWith(`Touch`)&&c===BT.Touch||u.startsWith(`Mouse`)&&c===BT.Mouse)&&(c=null));let d=CT(o)?o.changedTouches[0]:o;if(!d)return;let f=n.getId(s),{clientX:p,clientY:m}=d;GT(e)({type:zT[u],id:f,x:p,y:m,...c!==null&&{pointerType:c}})};return Object.keys(zT).filter(e=>Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&s[e]!==!1).forEach(e=>{let n=dw(e),r=u(e);if(window.PointerEvent)switch(zT[e]){case zT.MouseDown:case zT.MouseUp:n=n.replace(`mouse`,`pointer`);break;case zT.TouchStart:case zT.TouchEnd:return}c.push(cT(n,r,t))}),GT(()=>{c.forEach(e=>e())})}function pE({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,sampling:o}){return cT(`scroll`,GT(dT(GT(o=>{let s=lE(o);if(!s||yT(s,r,i,a,!0))return;let c=n.getId(s);if(s===t&&t.defaultView){let n=hT(t.defaultView);e({id:c,x:n.left,y:n.top})}else e({id:c,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100)),t)}function mE({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return cT(`resize`,GT(dT(GT(()=>{let t=gT(),i=_T();(n!==t||r!==i)&&(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}var hE=[`INPUT`,`TEXTAREA`,`SELECT`],gE=new WeakMap;function _E({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,ignoreClass:o,ignoreSelector:s,maskInputOptions:c,maskInputFn:l,sampling:u,userTriggeredOnInput:d,maskTextClass:f,unmaskTextClass:p,maskTextSelector:m,unmaskTextSelector:h}){function g(e){let n=lE(e),u=e.isTrusted,g=n&&fw(n.tagName);if(g===`OPTION`&&(n=n.parentElement),!n||!g||hE.indexOf(g)<0||yT(n,r,i,a,!0))return;let v=n;if(v.classList.contains(o)||s&&v.matches(s))return;let y=hw(n),b=gw(v,g,y),x=!1,S=lw({maskInputOptions:c,tagName:g,type:y}),C=Zw(n,f,m,p,h,S);(y===`radio`||y===`checkbox`)&&(x=n.checked),b=uw({isMasked:C,element:n,value:b,maskInputFn:l}),_(n,d?{text:b,isChecked:x,userTriggered:u}:{text:b,isChecked:x});let w=n.name;y===`radio`&&w&&x&&t.querySelectorAll(`input[type="radio"][name="${w}"]`).forEach(e=>{if(e!==n){let t=uw({isMasked:C,element:e,value:gw(e,g,y),maskInputFn:l});_(e,d?{text:t,isChecked:!x,userTriggered:!1}:{text:t,isChecked:!x})}})}function _(t,r){let i=gE.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){gE.set(t,r);let i=n.getId(t);GT(e)({...r,id:i})}}let v=(u.input===`last`?[`change`]:[`input`,`change`]).map(e=>cT(e,GT(g),t)),y=t.defaultView;if(!y)return()=>{v.forEach(e=>e())};let b=y.Object.getOwnPropertyDescriptor(y.HTMLInputElement.prototype,`value`),x=[[y.HTMLInputElement.prototype,`value`],[y.HTMLInputElement.prototype,`checked`],[y.HTMLSelectElement.prototype,`value`],[y.HTMLTextAreaElement.prototype,`value`],[y.HTMLSelectElement.prototype,`selectedIndex`],[y.HTMLOptionElement.prototype,`selected`]];return b&&b.set&&v.push(...x.map(e=>fT(e[0],e[1],{set(){GT(g)({target:this,isTrusted:!1})}},!1,y))),GT(()=>{v.forEach(e=>e())})}function vE(e){let t=[];function n(e,t){if(OE(`CSSGroupingRule`)&&e.parentRule instanceof CSSGroupingRule||OE(`CSSMediaRule`)&&e.parentRule instanceof CSSMediaRule||OE(`CSSSupportsRule`)&&e.parentRule instanceof CSSSupportsRule||OE(`CSSConditionRule`)&&e.parentRule instanceof CSSConditionRule){let n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){let n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}return n(e,t)}function yE(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function bE({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:GT((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=yE(i,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:s}]}),r.apply(i,a)})});let a=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:GT((r,i,a)=>{let[o]=a,{id:s,styleId:c}=yE(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:o}]}),r.apply(i,a)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:GT((r,i,a)=>{let[o]=a,{id:s,styleId:c}=yE(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replace:o}),r.apply(i,a)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:GT((r,i,a)=>{let[o]=a,{id:s,styleId:c}=yE(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replaceSync:o}),r.apply(i,a)})}));let c={};kE(`CSSGroupingRule`)?c.CSSGroupingRule=r.CSSGroupingRule:(kE(`CSSMediaRule`)&&(c.CSSMediaRule=r.CSSMediaRule),kE(`CSSConditionRule`)&&(c.CSSConditionRule=r.CSSConditionRule),kE(`CSSSupportsRule`)&&(c.CSSSupportsRule=r.CSSSupportsRule));let l={};return Object.entries(c).forEach(([r,i])=>{l[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(l[r].insertRule,{apply:GT((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=yE(i.parentStyleSheet,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:[...vE(i),s||0]}]}),r.apply(i,a)})}),i.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:GT((r,i,a)=>{let[o]=a,{id:s,styleId:c}=yE(i.parentStyleSheet,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:[...vE(i),o]}]}),r.apply(i,a)})})}),GT(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=a,o&&(r.CSSStyleSheet.prototype.replace=o),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}function xE({mirror:e,stylesheetManager:t},n){let r=null;r=n.nodeName===`#document`?e.getId(n):e.getId(n.host);let i=n.nodeName===`#document`?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,a=i?.prototype?Object.getOwnPropertyDescriptor(i?.prototype,`adoptedStyleSheets`):void 0;return r===null||r===-1||!i||!a?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){return a.get?.call(this)},set(e){let n=a.set?.call(this,e);if(r!==null&&r!==-1)try{t.adoptStyleSheets(e,r)}catch{}return n}}),GT(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function SE({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:GT((i,o,s)=>{let[c,l,u]=s;if(n.has(c))return a.apply(o,[c,l,u]);let{id:d,styleId:f}=yE(o.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:c,value:l,priority:u},index:vE(o.parentRule)}),i.apply(o,s)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:GT((i,a,s)=>{let[c]=s;if(n.has(c))return o.apply(a,[c]);let{id:l,styleId:u}=yE(a.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||u&&u!==-1)&&e({id:l,styleId:u,remove:{property:c},index:vE(a.parentRule)}),i.apply(a,s)})}),GT(()=>{i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o})}function CE({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:i,sampling:a,doc:o}){let s=GT(o=>dT(GT(a=>{let s=lE(a);if(!s||yT(s,t,n,r,!0))return;let{currentTime:c,volume:l,muted:u,playbackRate:d}=s;e({type:o,id:i.getId(s),currentTime:c,volume:l,muted:u,playbackRate:d})}),a.media||500)),c=[cT(`play`,s(VT.Play),o),cT(`pause`,s(VT.Pause),o),cT(`seeked`,s(VT.Seeked),o),cT(`volumechange`,s(VT.VolumeChange),o),cT(`ratechange`,s(VT.RateChange),o)];return GT(()=>{c.forEach(e=>e())})}function wE({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,n){let r=new a(e,t,n);return i.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};let o=pT(t.fonts,`add`,function(t){return function(n){return IT(GT(()=>{let t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=a}),r.push(o),GT(()=>{r.forEach(e=>e())})}function TE(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,selectionCb:o}=e,s=!0,c=GT(()=>{let e=t.getSelection();if(!e||s&&e?.isCollapsed)return;s=e.isCollapsed||!1;let c=[],l=e.rangeCount||0;for(let t=0;t<l;t++){let{startContainer:o,startOffset:s,endContainer:l,endOffset:u}=e.getRangeAt(t);yT(o,r,i,a,!0)||yT(l,r,i,a,!0)||c.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:c})});return c(),cT(`selectionchange`,c)}function EE({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:pT(n.customElements,`define`,function(e){return function(n,r,i){try{t({define:{name:n}})}catch{}return e.apply(this,[n,r,i])}})}function DE(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=uE(e,e.doc));let i=dE(e),a=fE(e),o=pE(e),s=mE(e,{win:n}),c=_E(e),l=CE(e),u=()=>{},d=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(u=bE(e,{win:n}),d=xE(e,e.doc),f=SE(e,{win:n}),e.collectFonts&&(p=wE(e)));let m=TE(e),h=EE(e),g=[];for(let t of e.plugins)g.push(t.observer(t.callback,n,t.options));return GT(()=>{cE.forEach(e=>e.reset()),r?.disconnect(),i(),a(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h(),g.forEach(e=>e())})}function OE(e){return window[e]!==void 0}function kE(e){return!!(window[e]!==void 0&&window[e].prototype&&`insertRule`in window[e].prototype&&`deleteRule`in window[e].prototype)}var AE=class{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){let i=n||this.getIdToRemoteIdMap(e),a=r||this.getRemoteIdToIdMap(e),o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){let n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){let r=n||this.getRemoteIdToIdMap(e);return typeof t==`number`?r.get(t)||-1:t}getRemoteIds(e,t){let n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},jE=class{constructor(){this.crossOriginIframeMirror=new AE(Dw),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},ME=class{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new AE(Dw),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new AE(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener(`message`,this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0);let t=ZT(e);t&&this.crossOriginIframeMap.set(t,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&ZT(e)?.addEventListener(`message`,this.handleMessage.bind(this)),this.loadListener?.(e);let n=XT(e);n&&n.adoptedStyleSheets&&n.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(n.adoptedStyleSheets,this.mirror.getId(n))}handleMessage(e){let t=e;if(t.data.type!==`rrweb`||t.origin!==t.data.origin||!e.source)return;let n=this.crossOriginIframeMap.get(e.source);if(!n)return;let r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){switch(t.type){case RT.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:RT.IncrementalSnapshot,data:{source:B.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case RT.Meta:case RT.Load:case RT.DomContentLoaded:return!1;case RT.Plugin:return t;case RT.Custom:return this.replaceIds(t.data.payload,e,[`id`,`parentId`,`previousId`,`nextId`]),t;case RT.IncrementalSnapshot:switch(t.data.source){case B.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,[`parentId`,`nextId`,`previousId`]),this.replaceIdOnNode(t.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,[`parentId`,`id`])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,[`id`])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case B.Drag:case B.TouchMove:case B.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case B.ViewportResize:return!1;case B.MediaInteraction:case B.MouseInteraction:case B.Scroll:case B.CanvasMutation:case B.Input:return this.replaceIds(t.data,e,[`id`]),t;case B.StyleSheetRule:case B.StyleDeclaration:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleId`]),t;case B.Font:return t;case B.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,[`start`,`end`])}),t;case B.AdoptedStyleSheet:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleIds`]),t.data.styles?.forEach(t=>{this.replaceStyleIds(t,e,[`styleId`])}),t}}return!1}replace(e,t,n,r){for(let i of r)!Array.isArray(t[i])&&typeof t[i]!=`number`||(t[i]=Array.isArray(t[i])?e.getIds(n,t[i]):e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,[`id`,`rootId`]),`childNodes`in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type!==YC.Document&&!e.rootId&&(e.rootId=t),`childNodes`in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},NE=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},PE=class{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!QC(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);let n=uE({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(pE({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),IT(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(xE({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){let t=XT(e),n=ZT(e);!t||!n||this.patchAttachShadow(n.Element,t)}patchAttachShadow(e,t){let n=this;this.restoreHandlers.push(pT(e.prototype,`attachShadow`,function(e){return function(r){let i=e.call(this,r);return this.shadowRoot&&MT(this)&&n.addShadowRoot(this.shadowRoot,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}},FE=class{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new OT,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){`_cssText`in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let n={id:t,styleIds:[]},r=[];for(let t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,t)=>({rule:rw(e),index:t}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},IE=class{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,t){let n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,FT(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},LE,RE;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement(`iframe`);document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug(`Unable to override Array.from`,e)}var zE=cw();function BE(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i=`rr-block`,blockSelector:a=null,unblockSelector:o=null,ignoreClass:s=`rr-ignore`,ignoreSelector:c=null,maskAllText:l=!1,maskTextClass:u=`rr-mask`,unmaskTextClass:d=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:m=!0,maskAllInputs:h,maskInputOptions:g,slimDOMOptions:_,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,maxCanvasSize:x=null,packFn:S,sampling:C={},dataURLOptions:w={},mousemoveWait:T,recordDOM:ee=!0,recordCanvas:E=!1,recordCrossOriginIframes:te=!1,recordAfter:ne=e.recordAfter===`DOMContentLoaded`?e.recordAfter:`load`,userTriggeredOnInput:re=!1,collectFonts:ie=!1,inlineImages:ae=!1,plugins:oe,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:se=new Set([]),errorHandler:ce,onMutation:le,getCanvasManager:ue}=e;UT(ce);let de=!te||window.parent===window,fe=!1;if(!de)try{window.parent.document&&(fe=!1)}catch{fe=!0}if(de&&!t)throw Error(`emit function is required`);if(!de&&!fe)return()=>{};T!==void 0&&C.mousemove===void 0&&(C.mousemove=T),zE.reset();let pe=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,radio:!0,checkbox:!0}:g===void 0?{}:g,me=_===!0||_===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:_===`all`,headMetaDescKeywords:_===`all`}:_||{};wT();let he,ge=0,_e=e=>{for(let t of oe||[])t.eventProcessor&&(e=t.eventProcessor(e));return S&&!fe&&(e=S(e)),e};LE=(e,i)=>{let a=e;if(a.timestamp=mT(),cE[0]?.isFrozen()&&a.type!==RT.FullSnapshot&&(a.type!==RT.IncrementalSnapshot||a.data.source!==B.Mutation)&&cE.forEach(e=>e.unfreeze()),de)t?.(_e(a),i);else if(fe){let e={type:`rrweb`,event:_e(a),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,`*`)}if(a.type===RT.FullSnapshot)he=a,ge=0;else if(a.type===RT.IncrementalSnapshot){if(a.data.source===B.Mutation&&a.data.isAttachIframe)return;ge++;let e=r&&ge>=r,t=n&&he&&a.timestamp-he.timestamp>n;(e||t)&&we(!0)}};let ve=e=>{LE({type:RT.IncrementalSnapshot,data:{source:B.Mutation,...e}})},ye=e=>LE({type:RT.IncrementalSnapshot,data:{source:B.Scroll,...e}}),O=e=>LE({type:RT.IncrementalSnapshot,data:{source:B.CanvasMutation,...e}}),be=new FE({mutationCb:ve,adoptedStyleSheetCb:e=>LE({type:RT.IncrementalSnapshot,data:{source:B.AdoptedStyleSheet,...e}})}),k=typeof __RRWEB_EXCLUDE_IFRAME__==`boolean`&&__RRWEB_EXCLUDE_IFRAME__?new jE:new ME({mirror:zE,mutationCb:ve,stylesheetManager:be,recordCrossOriginIframes:te,wrappedEmit:LE});for(let e of oe||[])e.getMirror&&e.getMirror({nodeMirror:zE,crossOriginIframeMirror:k.crossOriginIframeMirror,crossOriginIframeStyleMirror:k.crossOriginIframeStyleMirror});let xe=new IE,Se=HE(ue,{mirror:zE,win:window,mutationCb:e=>LE({type:RT.IncrementalSnapshot,data:{source:B.CanvasMutation,...e}}),recordCanvas:E,blockClass:i,blockSelector:a,unblockSelector:o,maxCanvasSize:x,sampling:C.canvas,dataURLOptions:w,errorHandler:ce}),Ce=typeof __RRWEB_EXCLUDE_SHADOW_DOM__==`boolean`&&__RRWEB_EXCLUDE_SHADOW_DOM__?new NE:new PE({mutationCb:ve,scrollCb:ye,bypassOptions:{onMutation:le,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskInputOptions:pe,dataURLOptions:w,maskAttributeFn:v,maskTextFn:b,maskInputFn:y,recordCanvas:E,inlineImages:ae,sampling:C,slimDOMOptions:me,iframeManager:k,stylesheetManager:be,canvasManager:Se,keepIframeSrcFn:D,processedNodeManager:xe,ignoreCSSAttributes:se},mirror:zE}),we=(e=!1)=>{if(!ee)return;LE({type:RT.Meta,data:{href:window.location.href,width:_T(),height:gT()}},e),be.reset(),Ce.init(),cE.forEach(e=>e.lock());let t=sT(document,{mirror:zE,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskAllInputs:pe,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,slimDOM:me,dataURLOptions:w,recordCanvas:E,inlineImages:ae,onSerialize:e=>{TT(e,zE)&&k.addIframe(e),ET(e,zE)&&be.trackLinkElement(e),DT(e)&&Ce.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{k.attachIframe(e,t);let n=ZT(e);n&&Se.addWindow(n),Ce.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{be.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,{width:n,height:r})=>{ve({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${n}px`,height:`${r}px`}}}]})},keepIframeSrcFn:D,ignoreCSSAttributes:se});if(!t)return console.warn(`Failed to snapshot the document`);LE({type:RT.FullSnapshot,data:{node:t,initialOffset:hT(window)}}),cE.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&be.adoptStyleSheets(document.adoptedStyleSheets,zE.getId(document))};RE=we;try{let e=[],t=e=>GT(DE)({onMutation:le,mutationCb:ve,mousemoveCb:(e,t)=>LE({type:RT.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>LE({type:RT.IncrementalSnapshot,data:{source:B.MouseInteraction,...e}}),scrollCb:ye,viewportResizeCb:e=>LE({type:RT.IncrementalSnapshot,data:{source:B.ViewportResize,...e}}),inputCb:e=>LE({type:RT.IncrementalSnapshot,data:{source:B.Input,...e}}),mediaInteractionCb:e=>LE({type:RT.IncrementalSnapshot,data:{source:B.MediaInteraction,...e}}),styleSheetRuleCb:e=>LE({type:RT.IncrementalSnapshot,data:{source:B.StyleSheetRule,...e}}),styleDeclarationCb:e=>LE({type:RT.IncrementalSnapshot,data:{source:B.StyleDeclaration,...e}}),canvasMutationCb:O,fontCb:e=>LE({type:RT.IncrementalSnapshot,data:{source:B.Font,...e}}),selectionCb:e=>{LE({type:RT.IncrementalSnapshot,data:{source:B.Selection,...e}})},customElementCb:e=>{LE({type:RT.IncrementalSnapshot,data:{source:B.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:c,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:pe,inlineStylesheet:m,sampling:C,recordDOM:ee,recordCanvas:E,inlineImages:ae,userTriggeredOnInput:re,collectFonts:ie,doc:e,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,keepIframeSrcFn:D,blockSelector:a,unblockSelector:o,slimDOMOptions:me,dataURLOptions:w,mirror:zE,iframeManager:k,stylesheetManager:be,shadowDomManager:Ce,processedNodeManager:xe,canvasManager:Se,ignoreCSSAttributes:se,plugins:oe?.filter(e=>e.observer)?.map(e=>({observer:e.observer,options:e.options,callback:t=>LE({type:RT.Plugin,data:{plugin:e.name,payload:t}})}))||[]},{});k.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});let n=()=>{we(),e.push(t(document))};return document.readyState===`interactive`||document.readyState===`complete`?n():(e.push(cT(`DOMContentLoaded`,()=>{LE({type:RT.DomContentLoaded,data:{}}),ne===`DOMContentLoaded`&&n()})),e.push(cT(`load`,()=>{LE({type:RT.Load,data:{}}),ne===`load`&&n()},window))),()=>{e.forEach(e=>e()),xe.destroy(),RE=void 0,WT()}}catch(e){console.warn(e)}}function VE(e){if(!RE)throw Error(`please take full snapshot after start recording`);RE(e)}BE.mirror=zE,BE.takeFullSnapshot=VE;function HE(e,t){try{return e?e(t):new YT}catch{return console.warn(`Unable to initialize CanvasManager`),new YT}}var UE;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})(UE||={});var WE=3,GE=5;function KE(e){return e>9999999999?e:e*1e3}function qE(e){return e>9999999999?e/1e3:e}function JE(e,t){t.category!==`sentry.transaction`&&([`ui.click`,`ui.input`].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:RT.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:`breadcrumb`,payload:fi(t,10,1e3)}}),t.category===`console`)))}var YE=`button,a`;function XE(e){return e.closest(YE)||e}function ZE(e){let t=QE(e);return!t||!(t instanceof Element)?t:XE(t)}function QE(e){return $E(e)?e.target:e}function $E(e){return Vr(e)&&`target`in e}var eD;function tD(e){return eD||(eD=[],nD()),eD.push(e),()=>{let t=eD?eD.indexOf(e):-1;t>-1&&eD.splice(t,1)}}function nD(){qr(DC,`open`,function(e){return function(...t){if(eD)try{eD.forEach(e=>e())}catch{}return e.apply(DC,t)}})}var rD=new Set([B.Mutation,B.StyleSheetRule,B.StyleDeclaration,B.AdoptedStyleSheet,B.CanvasMutation,B.Selection,B.MediaInteraction]);function iD(e,t,n){e.handleClick(t,n)}var aD=class{constructor(e,t,n=JE){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=t.timeout/1e3,this._threshold=t.threshold/1e3,this._scrollTimeout=t.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=t.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){let e=tD(()=>{this._lastMutation=lD()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,t){if(sD(t,this._ignoreSelector)||!cD(e))return;let n={timestamp:qE(e.timestamp),clickBreadcrumb:e,clickCount:0,node:t};this._clicks.some(e=>e.node===n.node&&Math.abs(e.timestamp-n.timestamp)<1)||(this._clicks.push(n),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=qE(e)}registerScroll(e=Date.now()){this._lastScroll=qE(e)}registerClick(e){let t=XE(e);this._handleMultiClick(t)}_handleMultiClick(e){this._getClicks(e).forEach(e=>{e.clickCount++})}_getClicks(e){return this._clicks.filter(t=>t.node===e)}_checkClicks(){let e=[],t=lD();this._clicks.forEach(n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=t&&e.push(n)});for(let t of e){let e=this._clicks.indexOf(t);e>-1&&(this._generateBreadcrumbs(t),this._clicks.splice(e,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){let t=this._replay,n=e.scrollAfter&&e.scrollAfter<=this._scrollTimeout,r=e.mutationAfter&&e.mutationAfter<=this._threshold,i=!n&&!r,{clickCount:a,clickBreadcrumb:o}=e;if(i){let n=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,r=n<this._timeout*1e3?`mutation`:`timeout`,i={type:`default`,message:o.message,timestamp:o.timestamp,category:`ui.slowClickDetected`,data:{...o.data,url:DC.location.href,route:t.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:a||1}};this._addBreadcrumbEvent(t,i);return}if(a>1){let e={type:`default`,message:o.message,timestamp:o.timestamp,category:`ui.multiClick`,data:{...o.data,url:DC.location.href,route:t.getCurrentRoute(),clickCount:a,metric:!0}};this._addBreadcrumbEvent(t,e)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Ux(()=>this._checkClicks(),1e3)}},oD=[`A`,`BUTTON`,`INPUT`];function sD(e,t){return!!(!oD.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 cD(e){return!!(e.data&&typeof e.data.nodeId==`number`&&e.timestamp)}function lD(){return Date.now()/1e3}function uD(e,t){try{if(!dD(t))return;let{source:n}=t.data;if(rD.has(n)&&e.registerMutation(t.timestamp),n===B.Scroll&&e.registerScroll(t.timestamp),fD(t)){let{type:n,id:r}=t.data,i=BE.mirror.getNode(r);i instanceof HTMLElement&&n===zT.Click&&e.registerClick(i)}}catch{}}function dD(e){return e.type===WE}function fD(e){return e.data.source===B.MouseInteraction}function pD(e){return{timestamp:Date.now()/1e3,type:`default`,...e}}var mD=(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))(mD||{}),hD=new Set([`id`,`class`,`aria-label`,`role`,`name`,`alt`,`title`,`data-test-id`,`data-testid`,`disabled`,`aria-disabled`,`data-sentry-component`]);function gD(e){let t={};!e[`data-sentry-component`]&&e[`data-sentry-element`]&&(e[`data-sentry-component`]=e[`data-sentry-element`]);for(let n in e)if(hD.has(n)){let r=n;(n===`data-testid`||n===`data-test-id`)&&(r=`testId`),t[r]=e[n]}return t}var _D=e=>t=>{if(!e.isEnabled())return;let n=yD(t);if(!n)return;let r=t.name===`click`,i=r?t.event:void 0;r&&e.clickDetector&&i?.target&&!i.altKey&&!i.metaKey&&!i.ctrlKey&&!i.shiftKey&&iD(e.clickDetector,n,ZE(t.event)),JE(e,n)};function vD(e,t){let n=BE.mirror.getId(e),r=n&&BE.mirror.getNode(n),i=r&&BE.mirror.getMeta(r),a=i&&xD(i)?i:null;return{message:t,data:a?{nodeId:n,node:{id:n,tagName:a.tagName,textContent:Array.from(a.childNodes).map(e=>e.type===mD.Text&&e.textContent).filter(Boolean).map(e=>e.trim()).join(``),attributes:gD(a.attributes)}}:{}}}function yD(e){let{target:t,message:n}=bD(e);return pD({category:`ui.${e.name}`,...vD(t,n)})}function bD(e){let t=e.name===`click`,n,r=null;try{r=t?ZE(e.event):QE(e.event),n=Hb(r,{maxStringLength:200})||`<unknown>`}catch{n=`<unknown>`}return{target:r,message:n}}function xD(e){return e.type===mD.Element}function SD(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=CD(t);n&&JE(e,n)}function CD(e){let{metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:a,target:o}=e;if(!o||wD(o)||!a)return null;let s=t||r||i,c=a.length===1;if(!s&&c)return null;let l=Hb(o,{maxStringLength:200})||`<unknown>`;return pD({category:`ui.keyDown`,message:l,data:{...vD(o,l).data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:a}})}function wD(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable}var TD={resource:MD,paint:AD,navigation:jD};function ED(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function DD(e){return e.map(OD).filter(Boolean)}function OD(e){let t=TD[e.entryType];return t?t(e):null}function kD(e){return((Vi()||DC.performance.timeOrigin)+e)/1e3}function AD(e){let{duration:t,entryType:n,name:r,startTime:i}=e,a=kD(i);return{type:n,name:r,start:a,end:a+t,data:void 0}}function jD(e){let{entryType:t,name:n,decodedBodySize:r,duration:i,domComplete:a,encodedBodySize:o,domContentLoadedEventStart:s,domContentLoadedEventEnd:c,domInteractive:l,loadEventStart:u,loadEventEnd:d,redirectCount:f,startTime:p,transferSize:m,type:h}=e;return i===0?null:{type:`${t}.${h}`,start:kD(p),end:kD(a),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:o,duration:i,domInteractive:l,domContentLoadedEventStart:s,domContentLoadedEventEnd:c,loadEventStart:u,loadEventEnd:d,domComplete:a,redirectCount:f}}}function MD(e){let{entryType:t,initiatorType:n,name:r,responseEnd:i,startTime:a,decodedBodySize:o,encodedBodySize:s,responseStatus:c,transferSize:l}=e;return[`fetch`,`xmlhttprequest`].includes(n)?null:{type:`${t}.${n}`,start:kD(a),end:kD(i),name:r,data:{size:l,statusCode:c,decodedBodySize:o,encodedBodySize:s}}}function ND(e){let t=e.entries[e.entries.length-1];return LD(e,`largest-contentful-paint`,t?.element?[t.element]:void 0)}function PD(e){return e.sources!==void 0}function FD(e){let t=[],n=[];for(let r of e.entries)if(PD(r)){let e=[];for(let t of r.sources)if(t.node){n.push(t.node);let r=BE.mirror.getId(t.node);r&&e.push(r)}t.push({value:r.value,nodeIds:e.length?e:void 0})}return LD(e,`cumulative-layout-shift`,n,t)}function ID(e){let t=e.entries[e.entries.length-1];return LD(e,`interaction-to-next-paint`,t?.target?[t.target]:void 0)}function LD(e,t,n,r){let i=e.value,a=e.rating,o=kD(i);return{type:`web-vital`,name:t,start:o,end:o,data:{value:i,size:i,rating:a,nodeIds:n?n.map(e=>BE.mirror.getId(e)):void 0,attributions:r}}}function RD(e){function t(t){e.performanceEntries.includes(t)||e.performanceEntries.push(t)}function n({entries:e}){e.forEach(t)}let r=[];return[`navigation`,`paint`,`resource`].forEach(e=>{r.push(Ob(e,n))}),r.push(Tb(ED(ND,e)),wb(ED(FD,e)),Db(ED(ID,e))),()=>{r.forEach(e=>e())}}var V=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,zD=`var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});`;function BD(){let e=new Blob([zD],{type:`text/javascript`});return URL.createObjectURL(e)}var VD=[`log`,`warn`,`error`],HD=`[Replay] `;function UD(e,t=`info`){Nd({category:`console`,data:{logger:`replay`},level:t,message:`${HD}${e}`},{level:t})}function WD(){let e=!1,t=!1,n={exception:()=>void 0,infoTick:()=>void 0,setConfig:n=>{e=!!n.captureExceptions,t=!!n.traceInternals}};return V?(VD.forEach(e=>{n[e]=(...n)=>{N[e](HD,...n),t&&UD(n.join(``),hf(e))}}),n.exception=(r,...i)=>{i.length&&n.error&&n.error(...i),N.error(HD,r),e?Qc(r,{mechanism:{handled:!0,type:`auto.function.replay.debug`}}):t&&UD(r,`error`)},n.infoTick=(...e)=>{N.log(HD,...e),t&&setTimeout(()=>UD(e[0]),0)}):VD.forEach(e=>{n[e]=()=>void 0}),n}var H=WD(),GD=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${HC}.`)}},KD=class extends Error{constructor(){super(`Worker destroyed`)}},qD=class{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return`sync`}destroy(){this.events=[]}async addEvent(e){let t=JSON.stringify(e).length;if(this._totalSize+=t,this._totalSize>HC)throw new GD;this.events.push(e)}finish(){return new Promise(e=>{let t=this.events;this.clear(),e(JSON.stringify(t))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let e=null;for(let{timestamp:t}of this.events)(e===null||t<e)&&(e=t);return e===null?e:KE(e)}},JD=class{constructor(e){this._onMessage=({data:e})=>{let t=e;if(typeof t.id!=`number`)return;let n=this._pending.get(t.id);if(!(!n||n.method!==t.method)){if(this._pending.delete(t.id),!t.success){V&&H.error(`Error in compression worker: `,t.response),n.reject(Error(`Error in compression worker`));return}n.resolve(t.response)}},this._worker=e,this._id=0,this._pending=new Map,this._worker.addEventListener(`message`,this._onMessage)}ensureReady(){return this._ensureReadyPromise||=new Promise((e,t)=>{this._worker.addEventListener(`message`,({data:n})=>{n.success?e():(V&&H.warn(`Received worker message with unsuccessful status`,n),t(Error(`Received worker message with unsuccessful status`)))},{once:!0}),this._worker.addEventListener(`error`,e=>{V&&H.warn(`Failed to load Replay compression worker`,e),t(Error(`Failed to load Replay compression worker: ${e instanceof ErrorEvent&&e.message?e.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(){V&&H.log(`Destroying compression worker`),this._worker.removeEventListener(`message`,this._onMessage),this._pending.forEach(e=>e.reject(new KD)),this._pending.clear(),this._worker.terminate()}postMessage(e,t){let n=this._getAndIncrementId();return new Promise((r,i)=>{this._pending.set(n,{method:e,resolve:r,reject:i});try{this._worker.postMessage({id:n,method:e,arg:t})}catch(e){this._pending.delete(n),i(e)}})}_getAndIncrementId(){return this._id++}},YD=class{constructor(e){this._worker=new JD(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return`worker`}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){let t=KE(e.timestamp);(!this._earliestTimestamp||t<this._earliestTimestamp)&&(this._earliestTimestamp=t);let n=JSON.stringify(e);return this._totalSize+=n.length,this._totalSize>HC?Promise.reject(new GD):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage(`clear`).then(null,e=>{V&&H.exception(e,`Sending "clear" message to worker failed`,e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage(`addEvent`,e)}async _finishRequest(){let e=await this._worker.postMessage(`finish`);return this._earliestTimestamp=null,this._totalSize=0,e}},XD=class{constructor(e){this._fallback=new qD,this._compression=new YD(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}set waitForCheckout(e){this._used.waitForCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){V&&H.exception(e,`Failed to load the compression worker, falling back to simple buffer`);return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:e,hasCheckout:t,waitForCheckout:n}=this._fallback,r=[];for(let t of e)r.push(this._compression.addEvent(t));this._compression.hasCheckout=t,this._compression.waitForCheckout=n,this._used=this._compression;try{await Promise.all(r),this._fallback.clear()}catch(e){if(e instanceof KD)return;V&&H.exception(e,`Failed to add events when switching buffers.`)}}};function ZD({useCompression:e,workerUrl:t}){if(e&&window.Worker){let e=QD(t);if(e)return e}return V&&H.log(`Using simple buffer`),new qD}function QD(e){try{let t=e||$D();return t?(V&&H.log(`Using compression worker${e?` from ${e}`:``}`),new XD(new Worker(t))):void 0}catch(e){V&&H.exception(e,`Failed to create compression worker`)}}function $D(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>`u`||!__SENTRY_EXCLUDE_REPLAY_WORKER__?BD():``}function eO(){try{return`sessionStorage`in DC&&!!DC.sessionStorage}catch{return!1}}function tO(e){nO(),e.session=void 0}function nO(){if(eO())try{DC.sessionStorage.removeItem(OC)}catch{}}function rO(e){return e!==void 0&&Math.random()<e}function iO(e){if(eO())try{DC.sessionStorage.setItem(OC,JSON.stringify(e))}catch{}}function aO(e){let t=Date.now();return{id:e.id||ki(),started:e.started||t,lastActivity:e.lastActivity||t,segmentId:e.segmentId||0,sampled:e.sampled,previousSessionId:e.previousSessionId,dirty:e.dirty||!1}}function oO(e,t){return rO(e)?`session`:t?`buffer`:!1}function sO({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let i=aO({sampled:oO(e,t),previousSessionId:r});return n&&iO(i),i}function cO(){if(!eO())return null;try{let e=DC.sessionStorage.getItem(OC);if(!e)return null;let t=JSON.parse(e);return V&&H.infoTick(`Loading existing session`),aO(t)}catch{return null}}function lO(e,t,n=+new Date){return e===null||t===void 0||t<0||t!==0&&e+t<=n}function uO(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return lO(e.started,t,r)||lO(e.lastActivity,n,r)}function dO(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!uO(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled===`buffer`&&e.segmentId===0)}function fO({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){let i=r.stickySession&&cO();return i?dO(i,{sessionIdleExpire:e,maxReplayDuration:t})?(V&&H.infoTick(`Session in sessionStorage is expired, creating new one...`),sO(r,{previousSessionId:i.id})):i:(V&&H.infoTick(`Creating new session`),sO(r,{previousSessionId:n}))}function pO(e){return e.type===RT.Custom}function mO(e,t,n){return _O(e,t)?(gO(e,t,n),!0):!1}function hO(e,t,n){return _O(e,t)?gO(e,t,n):Promise.resolve(null)}async function gO(e,t,n){let{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;let i=e.recordingMode===`buffer`;try{n&&i&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);let a=vO(t,e.getOptions().beforeAddRecordingEvent);return a?await r.addEvent(a):void 0}catch(t){if(!e.isEnabled())return e.handleException(t),null;let n=t&&t instanceof GD,a=n?`eventBufferOverflow`:`eventBufferError`,o=F();if(o){let e=n?`buffer_overflow`:`internal_sdk_error`;o.recordDroppedEvent(e,`replay`)}if(n&&i)return r.clear(),r.waitForCheckout=!0,null;e.handleException(t),await e.stop({reason:a})}}function _O(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=KE(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(V&&H.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function vO(e,t){try{if(typeof t==`function`&&pO(e))return t(e)}catch(e){return V&&H.exception(e,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}var yO=100;function bO(e,t,n){let r=e.getContext();t&&r.traceIds.size<yO&&r.traceIds.add(t),n&&r.segmentNames.size<yO&&r.segmentNames.add(n)}function xO(e){return t=>{e.isEnabled()&&bO(e,t.trace_id,t.name||void 0)}}function SO(e){return!e.type}function CO(e){return e.type===`transaction`}function wO(e){return e.type===`replay_event`}function TO(e){return e.type===`feedback`}function EO(e){return(t,n)=>{if(!e.isEnabled()||!SO(t)&&!CO(t))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(CO(t)){DO(e,t);return}OO(e,t)}}}function DO(e,t){bO(e,t.contexts?.trace?.trace_id,t.transaction)}function OO(e,t){let n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!==`buffer`||!t.tags?.replayId)return;let{beforeErrorSampling:r}=e.getOptions();typeof r==`function`&&!r(t)||Ux(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(t){e.handleException(t)}})}function kO(e){return t=>{!e.isEnabled()||!SO(t)||AO(e,t)}}function AO(e,t){let n=t.exception?.values?.[0]?.value;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))&&JE(e,pD({category:`replay.hydrate-error`,data:{url:r_()}}))}function jO(e){let t=F();t&&t.on(`beforeAddBreadcrumb`,t=>MO(e,t))}function MO(e,t){if(!e.isEnabled()||!FO(t))return;let n=NO(t);n&&JE(e,n)}function NO(e){return!FO(e)||[`fetch`,`xhr`,`sentry.event`,`sentry.transaction`].includes(e.category)||e.category.startsWith(`ui.`)?null:e.category===`console`?PO(e):pD(e)}function PO(e){let t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return pD(e);let n=!1,r=t.map(e=>{if(!e)return e;if(typeof e==`string`)return e.length>zC?(n=!0,`${e.slice(0,zC)}\u2026`):e;if(typeof e==`object`)try{let t=fi(e,7);return JSON.stringify(t).length>zC?(n=!0,`${JSON.stringify(t,null,2).slice(0,zC)}\u2026`):t}catch{}return e});return pD({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:[`CONSOLE_ARG_TRUNCATED`]}}:{}}})}function FO(e){return!!e.category}function IO(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function LO(){let e=P().getPropagationContext().dsc;e&&delete e.replay_id;let t=No();if(t){let e=Jo(t);delete e.replay_id}}function RO(e){let t=P().getPropagationContext().dsc;t&&(t.replay_id=e);let n=No();if(n){let t=Jo(n);t.replay_id=e}}function zO(e,t){e.triggerUserActivity(),e.addUpdate(()=>!t.timestamp||(e.throttledAddEvent({type:RT.Custom,timestamp:t.timestamp*1e3,data:{tag:`breadcrumb`,payload:{timestamp:t.timestamp,type:`default`,category:`sentry.feedback`,data:{feedbackId:t.event_id}}}}),!1))}function BO(e,t){return e.recordingMode!==`buffer`||t.message===AC||!t.exception||t.type?!1:rO(e.getOptions().errorSampleRate)}function VO(e){return Object.assign((t,n)=>{if(e.session&&dO(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&LO(),!e.isEnabled()||e.isPaused())return t;if(wO(t))return delete t.breadcrumbs,t;if(!SO(t)&&!CO(t)&&!TO(t))return t;if(!e.checkAndHandleExpiredSession())return LO(),t;if(TO(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),zO(e,t),t;if(IO(t,n)&&!e.getOptions()._experiments.captureExceptions)return V&&H.log(`Ignoring error from rrweb internals`,t),null;let r=BO(e,t);if((r||e.recordingMode===`session`)&&(t.tags={...t.tags,replayId:e.getSessionId()}),r&&e.recordingMode===`buffer`&&e.session?.sampled===`buffer`){let t=e.session;t.dirty=!0,e.getOptions().stickySession&&iO(t)}return t},{id:`Replay`})}function HO(e,t){return t.map(({type:t,start:n,end:r,name:i,data:a})=>{let o=e.throttledAddEvent({type:RT.Custom,timestamp:n,data:{tag:`performanceSpan`,payload:{op:t,description:i,startTimestamp:n,endTimestamp:r,data:a}}});return typeof o==`string`?Promise.resolve(null):o})}function UO(e){let{from:t,to:n}=e,r=Date.now()/1e3;return{type:`navigation.push`,start:r,end:r,name:n,data:{previous:t}}}function WO(e){return t=>{if(!e.isEnabled())return;let n=UO(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(HO(e,[n]),!1)))}}function GO(e,t){return V&&e.getOptions()._experiments.traceInternals?!1:bd(t,F())}function KO(e,t){e.isEnabled()&&t!==null&&(GO(e,t.name)||e.addUpdate(()=>(HO(e,[t]),!0)))}function qO(e){if(!e)return;let 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){let n=Kx(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function JO(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function YO(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};let n={...e._meta};return n.warnings=[...n.warnings||[],t],e._meta=n,e}function XO(e,t){if(!t)return null;let{startTimestamp:n,endTimestamp:r,url:i,method:a,statusCode:o,request:s,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:i,data:{method:a,statusCode:o,request:s,response:c}}}function ZO(e){return{headers:{},size:e,_meta:{warnings:[`URL_SKIPPED`]}}}function QO(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};let r={headers:e,size:t},{body:i,warnings:a}=ek(n);return r.body=i,a?.length&&(r._meta={warnings:a}),r}function $O(e,t){return Object.entries(e).reduce((n,[r,i])=>{let a=r.toLowerCase();return t.includes(a)&&e[r]&&(n[a]=i),n},{})}function ek(e){if(!e||typeof e!=`string`)return{body:e};let t=e.length>RC,n=tk(e);if(t){let t=e.slice(0,RC);return n?{body:t,warnings:[`MAYBE_JSON_TRUNCATED`]}:{body:`${t}\u2026`,warnings:[`TEXT_TRUNCATED`]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function tk(e){let t=e[0],n=e[e.length-1];return t===`[`&&n===`]`||t===`{`&&n===`}`}function nk(e,t){return Ti(rk(e),t)}function rk(e,t=DC.document.baseURI){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(DC.location.origin))return e;let n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;let r=n.href;return!e.endsWith(`/`)&&r.endsWith(`/`)?r.slice(0,-1):r}async function ik(e,t,n){try{let r=XO(`resource.fetch`,await ok(e,t,n));KO(n.replay,r)}catch(e){V&&H.exception(e,`Failed to capture fetch breadcrumb`)}}function ak(e,t){let{input:n,response:r}=t,i=qO(n?Jx(n):void 0),a=r?JO(r.headers.get(`content-length`)):void 0;i!==void 0&&(e.data.request_body_size=i),a!==void 0&&(e.data.response_body_size=a)}async function ok(e,t,n){let r=Date.now(),{startTimestamp:i=r,endTimestamp:a=r}=t,{url:o,method:s,status_code:c=0,request_body_size:l,response_body_size:u}=e.data,d=nk(o,n.networkDetailAllowUrls)&&!nk(o,n.networkDetailDenyUrls);return{startTimestamp:i,endTimestamp:a,url:o,method:s,statusCode:c,request:d?sk(n,t.input,l):ZO(l),response:await ck(d,n,t.response,u)}}function sk({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let i=n?fk(n,t):{};if(!e)return QO(i,r,void 0);let[a,o]=qx(Jx(n),H),s=QO(i,r,a);return o?YO(s,o):s}async function ck(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,i){if(!e&&i!==void 0)return ZO(i);let a=r?dk(r.headers,n):{};if(!r||!t&&i!==void 0)return QO(a,i,void 0);let[o,s]=await uk(r),c=lk(o,{networkCaptureBodies:t,responseBodySize:i,captureDetails:e,headers:a});return s?YO(c,s):c}function lk(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:i}){try{let a=e?.length&&n===void 0?qO(e):n;return r?t?QO(i,a,e):QO(i,a,void 0):ZO(a)}catch(e){return V&&H.exception(e,`Failed to serialize response body`),QO(i,n,void 0)}}async function uk(e){let t=mk(e);if(!t)return[void 0,`BODY_PARSE_ERROR`];try{return[await hk(t)]}catch(e){return e instanceof Error&&e.message.indexOf(`Timeout`)>-1?(V&&H.warn(`Parsing text body from response timed out`),[void 0,`BODY_PARSE_TIMEOUT`]):(V&&H.exception(e,`Failed to get text body from response`),[void 0,`BODY_PARSE_ERROR`])}}function dk(e,t){let n={};return t.forEach(t=>{e.get(t)&&(n[t]=e.get(t))}),n}function fk(e,t){return e.length===1&&typeof e[0]!=`string`?pk(e[0],t):e.length===2?pk(e[1],t):{}}function pk(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?dk(n,t):Array.isArray(n)?{}:$O(n,t):{}}function mk(e){try{return e.clone()}catch(e){V&&H.exception(e,`Failed to clone response body`)}}function hk(e){return new Promise((t,n)=>{let r=Ux(()=>n(Error(`Timeout while trying to read response body`)),500);gk(e).then(e=>t(e),e=>n(e)).finally(()=>clearTimeout(r))})}async function gk(e){return await e.text()}async function _k(e,t,n){try{let r=XO(`resource.xhr`,yk(e,t,n));KO(n.replay,r)}catch(e){V&&H.exception(e,`Failed to capture xhr breadcrumb`)}}function vk(e,t){let{xhr:n,input:r}=t;if(!n)return;let i=qO(r),a=n.getResponseHeader(`content-length`)?JO(n.getResponseHeader(`content-length`)):Sk(n.response,n.responseType);i!==void 0&&(e.data.request_body_size=i),a!==void 0&&(e.data.response_body_size=a)}function yk(e,t,n){let r=Date.now(),{startTimestamp:i=r,endTimestamp:a=r,input:o,xhr:s}=t,{url:c,method:l,status_code:u=0,request_body_size:d,response_body_size:f}=e.data;if(!c)return null;if(!s||!nk(c,n.networkDetailAllowUrls)||nk(c,n.networkDetailDenyUrls))return{startTimestamp:i,endTimestamp:a,url:c,method:l,statusCode:u,request:ZO(d),response:ZO(f)};let p=s[Wx],m=p?$O(p.request_headers,n.networkRequestHeaders):{},h=$O(Yx(s),n.networkResponseHeaders),[g,_]=n.networkCaptureBodies?qx(o,H):[void 0],[v,y]=n.networkCaptureBodies?bk(s):[void 0],b=QO(m,d,g),x=QO(h,f,v);return{startTimestamp:i,endTimestamp:a,url:c,method:l,statusCode:u,request:_?YO(b,_):b,response:y?YO(x,y):x}}function bk(e){let t=[];try{return[e.responseText]}catch(e){t.push(e)}try{return xk(e.response,e.responseType)}catch(e){t.push(e)}return V&&H.warn(`Failed to get xhr response body`,...t),[void 0]}function xk(e,t){try{if(typeof e==`string`)return[e];if(e instanceof Document)return[e.body.outerHTML];if(t===`json`&&Vr(e))return[JSON.stringify(e)];if(!e)return[void 0]}catch(t){return V&&H.exception(t,`Failed to serialize body`,e),[void 0,`BODY_PARSE_ERROR`]}return V&&H.log(`Skipping network body because of body type`,e),[void 0,`UNPARSEABLE_BODY_TYPE`]}function Sk(e,t){try{return qO(t===`json`&&Vr(e)?JSON.stringify(e):e)}catch{return}}function Ck(e){let t=F();try{let{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:i,networkRequestHeaders:a,networkResponseHeaders:o}=e.getOptions(),s={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:i,networkRequestHeaders:a,networkResponseHeaders:o};t&&t.on(`beforeAddBreadcrumb`,(e,t)=>wk(s,e,t))}catch{}}function wk(e,t,n){if(t.data)try{Tk(t)&&Dk(n)&&(vk(t,n),_k(t,n,e)),Ek(t)&&Ok(n)&&(ak(t,n),ik(t,n,e))}catch(e){V&&H.exception(e,`Error when enriching network breadcrumb`)}}function Tk(e){return e.category===`xhr`}function Ek(e){return e.category===`fetch`}function Dk(e){return e?.xhr}function Ok(e){return e?.input!==void 0}function aae(e){let t=F();Lx(_D(e)),Bx(WO(e)),jO(e),Ck(e),ml(VO(e)),t&&(t.on(`beforeSendEvent`,kO(e)),t.on(`afterSendEvent`,EO(e)),t.on(`createDsc`,t=>{let n=e.getSessionId();n&&e.isEnabled()&&e.recordingMode===`session`&&e.checkAndHandleExpiredSession()&&(t.replay_id=n)}),t.on(`processSegmentSpan`,xO(e)),t.on(`spanStart`,t=>{e.lastActiveSpan=t}),t.on(`spanEnd`,t=>{e.lastActiveSpan=t}),t.on(`beforeSendFeedback`,async(t,n)=>{let r=e.getSessionId();n?.includeReplay&&e.isEnabled()&&r&&t.contexts?.feedback&&(t.contexts.feedback.source===`api`&&await e.sendBufferedReplayOrFlush(),t.contexts.feedback.replay_id=r)}),t.on(`openFeedbackWidget`,async()=>{await e.sendBufferedReplayOrFlush()}))}async function oae(e){try{return Promise.all(HO(e,[sae(DC.performance.memory)]))}catch{return[]}}function sae(e){let{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,i=Date.now()/1e3;return{type:`memory`,name:`memory`,start:i,end:i,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function cae(e,t,n){return oc(e,t,{...n,setTimeoutImpl:Ux})}var kk=M.navigator;function lae(){return/iPhone|iPad|iPod/i.test(kk?.userAgent??``)||/Macintosh/i.test(kk?.userAgent??``)&&kk?.maxTouchPoints&&kk?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function uae(e){let t=!1;return(n,r)=>{try{if(!e.checkAndHandleExpiredSession()){V&&H.warn(`Received replay event after session expired.`);return}let i=r||!t;t=!0,dae(n),e.clickDetector&&uD(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode===`buffer`&&i&&e.setInitialState(),!mO(e,n,i))return!0;if(!i)return!1;let t=e.session;if(pae(e,i),e.recordingMode===`buffer`&&t&&e.eventBuffer&&!t.dirty){let n=e.eventBuffer.getEarliestTimestamp();n&&(V&&H.log(`Updating session start time to earliest event in buffer to ${new Date(n)}`),t.started=n,e.getOptions().stickySession&&iO(t))}return t?.previousSessionId||e.recordingMode===`session`&&e.flush(),!0})}catch(t){e.handleException(t)}}}function dae(e){let t=e.data;if(!(e.type!==RT.IncrementalSnapshot||!t||typeof t!=`object`||!(`source`in t)||t.source!==B.Mutation||!(`attributes`in t)||!Array.isArray(t.attributes)))for(let e of t.attributes){let t=BE.mirror.getNode(e.id),n=t&&BE.mirror.getMeta(t);if(n?.type===mD.Element)for(let[t,r]of Object.entries(e.attributes))r===null?delete n.attributes[t]:n.attributes[t]=r}}function fae(e){let t=e.getOptions();return{type:RT.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 pae(e,t){!t||e.session?.segmentId!==0||mO(e,fae(e),!1)}function mae(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function hae(e,t,n,r){return Qo(ps(e,fs(e),r,n),[[{type:`replay_event`},e],[{type:`replay_recording`,length:typeof t==`string`?new TextEncoder().encode(t).length:t.length},t]])}function gae({recordingData:e,headers:t}){let n,r=`${JSON.stringify(t)}
|
|
498
|
+
`;if(typeof e==`string`)n=`${r}${e}`;else{let t=new TextEncoder().encode(r);n=new Uint8Array(t.length+e.length),n.set(t),n.set(e,t.length)}return n}async function _ae({client:e,scope:t,replayId:n,event:r}){let i={event_id:n,integrations:typeof e._integrations==`object`&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0};e.emit(`preprocessEvent`,r,i);let a=await Zc(e.getOptions(),r,i,t,e,ca());if(!a)return null;e.emit(`postprocessEvent`,a,i),a.platform=a.platform||`javascript`;let{name:o,version:s,settings:c}=e.getSdkMetadata()?.sdk||{};return a.sdk={...a.sdk,name:o||`sentry.javascript.unknown`,version:s||`0.0.0`,settings:c},a}async function vae({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:i,session:a}){let o=gae({recordingData:e,headers:{segment_id:n}}),{urls:s,errorIds:c,traceIds:l,segmentNames:u,initialTimestamp:d}=r,f=F(),p=P(),m=f?.getTransport(),h=f?.getDsn();if(!f||!m||!h||!a.sampled)return Promise.resolve({});let g=await _ae({scope:p,client:f,replayId:t,event:{type:kC,replay_start_timestamp:d/1e3,timestamp:i/1e3,error_ids:c,trace_ids:l,segment_names:u,urls:s,replay_id:t,segment_id:n,replay_type:a.sampled}});if(!g)return f.recordDroppedEvent(`event_processor`,`replay`),V&&H.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete g.sdkProcessingMetadata;let _=hae(g,o,h,f.getOptions().tunnel),v;try{v=await m.send(_)}catch(e){let t=Error(AC);try{t.cause=e}catch{}throw t}let y=bu({},v);if(yu(y,`replay`))throw new jk(y);if(typeof v.statusCode==`number`&&(v.statusCode<200||v.statusCode>=300))throw new Ak(v.statusCode);return v}var Ak=class extends Error{constructor(e){super(`Transport returned status code ${e}`)}},jk=class extends Error{constructor(e){super(`Rate limit hit`),this.rateLimits=e}},Mk=class extends Error{constructor(){super(`Session is too long, not sending replay`)}};async function Nk(e,t={count:0,interval:IC}){let{recordingData:n,onError:r}=e;if(n.length)try{return await vae(e),!0}catch(n){if(n instanceof Ak||n instanceof jk)throw n;if(tl(`Replays`,{_retryCount:t.count}),r&&r(n),t.count>=LC){let e=Error(`${AC} - max retries exceeded`);try{e.cause=n}catch{}throw e}return t.interval*=++t.count,new Promise((n,r)=>{Ux(async()=>{try{await Nk(e,t),n(!0)}catch(e){r(e)}},t.interval)})}}var Pk=`__THROTTLED`,yae=`__SKIPPED`;function bae(e,t,n){let r=new Map,i=e=>{let t=e-n;r.forEach((e,n)=>{n<t&&r.delete(n)})},a=()=>[...r.values()].reduce((e,t)=>e+t,0),o=!1;return(...n)=>{let s=Math.floor(Date.now()/1e3);if(i(s),a()>=t){let e=o;return o=!0,e?yae:Pk}o=!1;let c=r.get(s)||0;return r.set(s,c+1),e(...n)}}var xae=class{constructor({options:e,recordingOptions:t}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode=`session`,this.timeouts={sessionIdlePause:jC,sessionIdleExpire:MC},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,segmentNames:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:``},this._recordingOptions=t,this._options=e,this._debouncedFlush=cae(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=bae((e,t)=>hO(this,e,t),300,5);let{slowClickTimeout:n,slowClickIgnoreSelectors:r}=this.getOptions(),i=n?{threshold:Math.min(BC,n),timeout:n,scrollTimeout:VC,ignoreSelector:r?r.join(`,`):``}:void 0;if(i&&(this.clickDetector=new aD(this,i)),V){let t=e._experiments;H.setConfig({captureExceptions:!!t.captureExceptions,traceInternals:!!t.traceInternals})}this._handleVisibilityChange=()=>{DC.document.visibilityState===`visible`?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{let e=pD({category:`ui.blur`});this._doChangeToBackgroundTasks(e)},this._handleWindowFocus=()=>{let e=pD({category:`ui.focus`});this._doChangeToForegroundTasks(e)},this._handleKeyboardEvent=e=>{SD(this,e)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(e){V&&H.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){let{errorSampleRate:t,sessionSampleRate:n}=this._options,r=t<=0&&n<=0;if(this._requiresManualStart=r,!r){if(this._initializeSessionForSampling(e),!this.session){V&&H.exception(Error(`Unable to initialize and create session`));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled===`buffer`&&this.session.segmentId===0?`buffer`:`session`,V&&H.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode===`session`){V&&H.log(`Recording is already in progress`);return}if(this._isEnabled&&this.recordingMode===`buffer`){V&&H.log("Buffering is in progress, call `flush()` to save the replay");return}V&&H.infoTick(`Starting replay in session mode`),this._updateUserActivity();let e=fO({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this.recordingMode=`session`,this._initializeRecording()}startBuffering(){if(this._isEnabled){V&&H.log("Buffering is in progress, call `flush()` to save the replay");return}V&&H.infoTick(`Starting replay in buffer mode`);let e=fO({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode=`buffer`,this._initializeRecording()}startRecording(){try{let e=this._canvas;this._stopRecording=BE({...this._recordingOptions,...this.recordingMode===`buffer`?{checkoutEveryNms:FC}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:uae(this),...lae(),onMutation:this._onMutationHandler.bind(this),...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&=(this._stopRecording(),void 0),!0}catch(e){return this.handleException(e),!1}}async stop({forceFlush:e=!1,reason:t}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode=`buffer`;let n=t??`manual`;F()?.emit(`replayEnd`,{sessionId:this.session?.id,reason:n});try{V&&H.log(`Stopping Replay triggered by ${n}`),LO(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,tO(this)}catch(e){this.handleException(e)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),V&&H.log(`Pausing replay`))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),V&&H.log(`Resuming replay`))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode===`session`)return this.flushImmediate();let t=Date.now();V&&H.log(`Converting buffer to session`),await this.flushImmediate();let n=this.stopRecording();!e||!n||this.recordingMode!==`session`&&(this.recordingMode=`session`,this.session&&(this.session.dirty=!1,this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession(),RO(this.session.id)),this.startRecording())}addUpdate(e){let t=e();this.recordingMode===`buffer`||!this._isEnabled||t!==!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(e){if(!(e&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&lO(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled===`session`){this.pause();return}return!!this._checkSession()}setInitialState(){let e=`${DC.location.pathname}${DC.location.hash}${DC.location.search}`,t=`${DC.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){let n=this._throttledAddEvent(e,t);if(n===Pk){let e=pD({category:`replay.throttled`});this.addUpdate(()=>!mO(this,{type:GE,timestamp:e.timestamp||0,data:{tag:`breadcrumb`,payload:e,metric:!0}}))}return n}getCurrentRoute(){let e=this.lastActiveSpan||No(),t=e&&jo(e),n=(t&&L(t).data||{})[fa];if(!(!t||!n||![`route`,`custom`].includes(n)))return L(t).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=ZD({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&F()?.emit(`replayStart`,{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode===`session`&&this.session&&RO(this.session.id)}_initializeSessionForSampling(e){let t=this._options.errorSampleRate>0,n=fO({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t});this.session=n}_checkSession(){if(!this.session)return!1;let e=this.session;return!dO(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(e),!1)}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:`sessionExpired`}),this.initializeSampling(e.id))}_addListeners(){try{DC.document.addEventListener(`visibilitychange`,this._handleVisibilityChange),DC.addEventListener(`blur`,this._handleWindowBlur),DC.addEventListener(`focus`,this._handleWindowFocus),DC.addEventListener(`keydown`,this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||=(aae(this),!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=RD(this)}_removeListeners(){try{DC.document.removeEventListener(`visibilitychange`,this._handleVisibilityChange),DC.removeEventListener(`blur`,this._handleWindowBlur),DC.removeEventListener(`focus`,this._handleWindowFocus),DC.removeEventListener(`keydown`,this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}_doChangeToBackgroundTasks(e){if(this.session){if(dO(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){LO();return}e&&this._createCustomBreadcrumb(e),this.conditionalFlush()}}_doChangeToForegroundTasks(e){if(this.session){if(!this.checkAndHandleExpiredSession()){V&&H.log(`Document has become active, but session has expired`);return}e&&this._createCustomBreadcrumb(e)}}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:RT.Custom,timestamp:e.timestamp||0,data:{tag:`breadcrumb`,payload:e}})})}_addPerformanceEntries(){let e=DD(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){let t=this._context.initialTimestamp/1e3;e=e.filter(e=>e.start>=t)}return Promise.all(HO(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.segmentNames.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:e,eventBuffer:t}=this;if(!e||!t||this._requiresManualStart||e.segmentId)return;let n=t.getEarliestTimestamp();n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}_popEventContext(){let e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),segmentNames:Array.from(this._context.segmentNames),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){let e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){V&&H.error(`No session or eventBuffer found to flush.`);return}if(await this._addPerformanceEntries(),this.eventBuffer?.hasEvents&&(await oae(this),this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let t=Date.now();if(t-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Mk;let n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession(),await Nk({replayId:e,recordingData:await this.eventBuffer.finish(),segmentId:r,eventContext:n,session:this.session,timestamp:t,onError:e=>this.handleException(e)})}catch(e){this.handleException(e),this.stop({reason:`sendError`});let t=F();if(t){let n;n=e instanceof jk?`ratelimit_backoff`:e instanceof Mk?`invalid`:`send_error`,t.recordDroppedEvent(n,`replay`)}}}async _flush({force:e=!1}={}){if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){V&&H.error(`Attempting to finish replay event after session expired.`);return}if(!this.session)return;let t=this.session.started,n=Date.now()-t;this._debouncedFlush.cancel();let r=n<this._options.minReplayDuration,i=n>this._options.maxReplayDuration+5e3;if(r||i){V&&H.log(`Session duration (${Math.floor(n/1e3)}s) is too ${r?`short`:`long`}, not sending replay.`),r&&this._debouncedFlush();return}let a=this.eventBuffer;a&&this.session.segmentId===0&&!a.hasCheckout&&V&&H.log(`Flushing initial segment without checkout.`);let o=!!this._flushLock;this._flushLock||=this._runFlush();try{await this._flushLock}catch(e){this.handleException(e)}finally{this._flushLock=void 0,o&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&iO(this.session)}_onMutationHandler(e){let{ignoreMutations:t}=this._options._experiments;if(t?.length&&e.some(e=>{let n=mae(e.target),r=t.join(`,`);return n?.matches(r)}))return!1;let n=e.length,r=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,a=r&&n>r;if(n>i||a){let e=pD({category:`replay.mutations`,data:{count:n,limit:a}});this._createCustomBreadcrumb(e)}return!a||(this.stop({reason:`mutationLimit`,forceFlush:this.recordingMode===`session`}),!1)}};function Fk(e,t){return[...e,...t].join(`,`)}function Sae({mask:e,unmask:t,block:n,unblock:r,ignore:i}){return{maskTextSelector:Fk(e,[`.sentry-mask`,`[data-sentry-mask]`]),unmaskTextSelector:Fk(t,[]),blockSelector:Fk(n,[`.sentry-block`,`[data-sentry-block]`,`base`,`iframe[srcdoc]:not([src])`]),unblockSelector:Fk(r,[]),ignoreSelector:Fk(i,[`.sentry-ignore`,`[data-sentry-ignore]`,`input[type="file"]`])}}function Cae({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:i,value:a}){if(i.unmaskTextSelector&&e.matches(i.unmaskTextSelector))return a;let o=n.includes(t),s=r&&t===`value`&&e.tagName===`INPUT`&&[`submit`,`button`].includes(e.getAttribute(`type`)||``);return o||s?a.replace(/[\S]/g,`*`):a}var Ik=`img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]`,wae=[`content-length`,`content-type`,`accept`],Tae=Symbol.for(`sentry__originalRequestBody`),Lk=!1,Rk=!1;function Eae(){if(typeof Request>`u`||Rk)return;let e=Request;try{let t=function(t,n){let r=new e(t,n);return n?.body!=null&&(r[Tae]=n.body),r};t.prototype=e.prototype,M.Request=t,Rk=!0}catch{}}var zk=(e=>new Dae(e)),Dae=class{constructor({flushMinDelay:e=NC,flushMaxDelay:t=PC,minReplayDuration:n=UC,maxReplayDuration:r=GC,stickySession:i=!0,useCompression:a=!0,workerUrl:o,_experiments:s={},maskAllText:c=!0,maskAllInputs:l=!0,blockAllMedia:u=!0,mutationBreadcrumbLimit:d=750,mutationLimit:f=1e4,slowClickTimeout:p=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:h=[],networkDetailDenyUrls:g=[],networkCaptureBodies:_=!0,networkRequestHeaders:v=[],networkResponseHeaders:y=[],mask:b=[],maskAttributes:x=[`title`,`placeholder`,`aria-label`],unmask:S=[],block:C=[],unblock:w=[],ignore:T=[],maskFn:ee,beforeAddRecordingEvent:E,beforeErrorSampling:te,onError:ne,attachRawBodyFromRequest:re=!1}={}){this.name=`Replay`;let ie=Sae({mask:b,unmask:S,block:C,unblock:w,ignore:T});if(this._recordingOptions={maskAllInputs:l,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:ee,maskInputFn:ee,maskAttributeFn:(e,t,n)=>Cae({maskAttributes:x,maskAllText:c,privacyOptions:ie,key:e,value:t,el:n}),...ie,slimDOMOptions:`all`,inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:e=>{try{e.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!s.recordCrossOriginIframes},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(n,WC),maxReplayDuration:Math.min(r,GC),stickySession:i,useCompression:a,workerUrl:o,blockAllMedia:u,maskAllInputs:l,maskAllText:c,mutationBreadcrumbLimit:d,mutationLimit:f,slowClickTimeout:p,slowClickIgnoreSelectors:m,networkDetailAllowUrls:h,networkDetailDenyUrls:g,networkCaptureBodies:_,networkRequestHeaders:Bk(v),networkResponseHeaders:Bk(y),beforeAddRecordingEvent:E,beforeErrorSampling:te,onError:ne,attachRawBodyFromRequest:re,_experiments:s},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${Ik}`:Ik,this._recordingOptions.ignoreCSSAttributes=new Set([`background-image`])),this._isInitialized&&Hl())throw Error(`Multiple Sentry Session Replay instances are not supported`);this._isInitialized=!0}get _isInitialized(){return Lk}set _isInitialized(e){Lk=e}afterAllSetup(e){!Hl()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&Eae(),this._setup(e),this._initialize(e))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(e){return this._replay?this._replay.stop({forceFlush:e?.flush??this._replay.recordingMode===`session`,reason:`manual`}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(e){if(this._replay?.isEnabled())return this._replay.getSessionId(e)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}processSpan(e){let t=this.getReplayId(!0);t&&(Rc(e,{"sentry.replay_id":t}),this.getRecordingMode()===`buffer`&&Rc(e,{"sentry._internal.replay_is_buffering":!0}))}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){let t=Oae(this._initialOptions,e);this._replay=new xae({options:t,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{let t=e.getIntegrationByName(`ReplayCanvas`);if(!t)return;this._replay._canvas=t.getOptions()}catch{}}};function Oae(e,t){let n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},i=eo(n.replaysSessionSampleRate),a=eo(n.replaysOnErrorSampleRate);return i==null&&a==null&&ar(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),i!=null&&(r.sessionSampleRate=i),a!=null&&(r.errorSampleRate=a),r}function Bk(e){return[...wae,...e.map(e=>e.toLowerCase())]}function kae(){return F()?.getIntegrationByName(`Replay`)}var Aae=Object.defineProperty,jae=(e,t,n)=>t in e?Aae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vk=(e,t,n)=>jae(e,typeof t==`symbol`?t:t+``,n),Mae=class{constructor(){Vk(this,`idNodeMap`,new Map),Vk(this,`nodeMetaMap`,new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Nae(){return new Mae}function Pae(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function Hk(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Hk(e.parentNode,t,n,r+1)}function Uk(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e==`string`){if(r.matches(`.${e}`))return!0}else if(Pae(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}var Wk=`Please stop import mirror directly. Instead of that,\r
|
|
499
|
+
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
500
|
+
or you can use record.mirror to access the mirror instance during recording.`,Gk={map:{},getId(){return console.error(Wk),-1},getNode(){return console.error(Wk),null},removeNodeFromMap(){console.error(Wk)},has(){return console.error(Wk),!1},reset(){console.error(Wk)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(Gk=new Proxy(Gk,{get(e,t,n){return t===`map`&&console.error(Wk),Reflect.get(e,t,n)}}));function Kk(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){Qk(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>Kk(e,t,a||{},!0)}function qk(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}Date.now().toString();function Fae(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Jk(e,t,n,r,i){if(!e)return!1;let a=Fae(e);if(!a)return!1;let o=Uk(t,n);if(!i){let e=r&&a.matches(r);return o(a)&&!e}let s=Hk(a,o),c=-1;return s<0?!1:(r&&(c=Hk(a,Uk(null,r))),s>-1&&c<0||s<c)}var Yk={};function Xk(e){let t=Yk[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement==`function`)try{let t=n.createElement(`iframe`);t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch{}return Yk[e]=r.bind(window)}function Zk(...e){return Xk(`requestAnimationFrame`)(...e)}function Qk(...e){return Xk(`setTimeout`)(...e)}var $k=(e=>(e[e[`2D`]=0]=`2D`,e[e.WebGL=1]=`WebGL`,e[e.WebGL2=2]=`WebGL2`,e))($k||{}),eA;function Iae(e){eA=e}for(var tA=e=>eA?((...t)=>{try{return e(...t)}catch(e){if(eA&&eA(e)===!0)return()=>{};throw e}}):e,nA=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Lae=typeof Uint8Array>`u`?[]:new Uint8Array(256),rA=0;rA<nA.length;rA++)Lae[nA.charCodeAt(rA)]=rA;var Rae=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=nA[t[n]>>2],i+=nA[(t[n]&3)<<4|t[n+1]>>4],i+=nA[(t[n+1]&15)<<2|t[n+2]>>6],i+=nA[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i},iA=new Map;function zae(e,t){let n=iA.get(e);return n||(n=new Map,iA.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var aA=(e,t,n)=>{if(!e||!(cA(e,t)||typeof e==`object`))return;let r=e.constructor.name,i=zae(n,r),a=i.indexOf(e);return a===-1&&(a=i.length,i.push(e)),a};function oA(e,t,n){if(e instanceof Array)return e.map(e=>oA(e,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)return{rr_type:e.constructor.name,base64:Rae(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[oA(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}return e instanceof HTMLCanvasElement?{rr_type:`HTMLImageElement`,src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[oA(e.data,t,n),e.width,e.height]}:cA(e,t)||typeof e==`object`?{rr_type:e.constructor.name,index:aA(e,t,n)}:e}var sA=(e,t,n)=>e.map(e=>oA(e,t,n)),cA=(e,t)=>!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(e=>typeof t[e]==`function`).find(n=>e instanceof t[n]);function Bae(e,t,n,r,i){let a=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!=`function`)continue;let o=qk(t.CanvasRenderingContext2D.prototype,s,function(a){return function(...o){return Jk(this.canvas,n,r,i,!0)||Qk(()=>{let n=sA(o,t,this);e(this.canvas,{type:$k[`2D`],property:s,args:n})},0),a.apply(this,o)}});a.push(o)}catch{let n=Kk(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:$k[`2D`],property:s,args:[t],setter:!0})}});a.push(n)}return()=>{a.forEach(e=>e())}}function Vae(e){return e===`experimental-webgl`?`webgl`:e}function lA(e,t,n,r,i){let a=[];try{let o=qk(e.HTMLCanvasElement.prototype,`getContext`,function(e){return function(a,...o){if(!Jk(this,t,n,r,!0)){let e=Vae(a);if(`__context`in this||(this.__context=e),i&&[`webgl`,`webgl2`].includes(e))if(o[0]&&typeof o[0]==`object`){let e=o[0];e.preserveDrawingBuffer||=!0}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[a,...o])}});a.push(o)}catch{console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return()=>{a.forEach(e=>e())}}function uA(e,t,n,r,i,a,o,s){let c=[],l=Object.getOwnPropertyNames(e);for(let o of l)if(![`isContextLost`,`canvas`,`drawingBufferWidth`,`drawingBufferHeight`].includes(o))try{if(typeof e[o]!=`function`)continue;let l=qk(e,o,function(e){return function(...c){let l=e.apply(this,c);if(aA(l,s,this),`tagName`in this.canvas&&!Jk(this.canvas,r,i,a,!0)){let e=sA(c,s,this),r={type:t,property:o,args:e};n(this.canvas,r)}return l}});c.push(l)}catch{let r=Kk(e,o,{set(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});c.push(r)}return c}function Hae(e,t,n,r,i,a){let o=[];return o.push(...uA(t.WebGLRenderingContext.prototype,$k.WebGL,e,n,r,i,a,t)),t.WebGL2RenderingContext!==void 0&&o.push(...uA(t.WebGL2RenderingContext.prototype,$k.WebGL2,e,n,r,i,a,t)),()=>{o.forEach(e=>e())}}var Uae=`for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)t[e.charCodeAt(a)]=a;var n=function(t){var a,n=new Uint8Array(t),r=n.length,s="";for(a=0;a<r;a+=3)s+=e[n[a]>>2],s+=e[(3&n[a])<<4|n[a+1]>>4],s+=e[(15&n[a+1])<<2|n[a+2]>>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(e<=n&&t<=r)return[e,t];let s=e,i=t;return s>n&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w?.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};`;function Wae(){let e=new Blob([Uae]);return URL.createObjectURL(e)}var Gae=class{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.shadowDoms=new Set,this.windowsSet=new WeakSet,this.windows=[],this.restoreHandlers=[],this.frozen=!1,this.locked=!1,this.snapshotInProgressMap=new Map,this.worker=null,this.lastSnapshotTime=0,this.processMutation=(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};let{enableManualSnapshot:t,sampling:n=`all`,win:r,recordCanvas:i,errorHandler:a}=e;e.sampling=n,this.mutationCb=e.mutationCb,this.mirror=e.mirror,this.options=e,a&&Iae(a),(i&&typeof n==`number`||t)&&(this.worker=this.initFPSWorker()),this.addWindow(r),!t&&tA(()=>{i&&n===`all`&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),i&&typeof n==`number`&&this.initCanvasFPSObserver()})()}reset(){this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(e=>{try{e()}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(e){let{sampling:t=`all`,blockClass:n,blockSelector:r,unblockSelector:i,recordCanvas:a,enableManualSnapshot:o}=this.options;if(!this.windowsSet.has(e)){if(o){this.windowsSet.add(e),this.windows.push(new WeakRef(e));return}tA(()=>{if(a&&t===`all`&&this.initCanvasMutationObserver(e,n,r,i),a&&typeof t==`number`){let t=lA(e,n,r,i,!0);this.restoreHandlers.push(()=>{t()})}})(),this.windowsSet.add(e),this.windows.push(new WeakRef(e))}}addShadowRoot(e){this.shadowDoms.add(new WeakRef(e))}resetShadowRoots(){this.shadowDoms=new Set}snapshot(e,t){if(t?.skipRequestAnimationFrame){this.takeSnapshot(performance.now(),!0,e);return}Zk(t=>this.takeSnapshot(t,!0,e))}initFPSWorker(){let e=new Worker(Wae());return e.onmessage=e=>{let t=e.data,{id:n}=t;if(this.snapshotInProgressMap.set(n,!1),!(`base64`in t))return;let{base64:r,type:i,width:a,height:o}=t;this.mutationCb({id:n,type:$k[`2D`],commands:[{property:`clearRect`,args:[0,0,a,o]},{property:`drawImage`,args:[{rr_type:`ImageBitmap`,args:[{rr_type:`Blob`,data:[{rr_type:`ArrayBuffer`,base64:r}],type:i}]},0,0,a,o]}]})},e}initCanvasFPSObserver(){let e;if(!this.windows.length&&!this.shadowDoms.size)return;let t=n=>{this.takeSnapshot(n,!1),e=Zk(t)};e=Zk(t),this.restoreHandlers.push(()=>{e&&cancelAnimationFrame(e)})}initCanvasMutationObserver(e,t,n,r){let i=lA(e,t,n,r,!1),a=Bae(this.processMutation.bind(this),e,t,n,r),o=Hae(this.processMutation.bind(this),e,t,n,r,this.mirror);this.restoreHandlers.push(()=>{i(),a(),o()})}getCanvasElements(e,t,n){let r=[],i=i=>{i.querySelectorAll(`canvas`).forEach(i=>{Jk(i,e,t,n,!0)||r.push(i)})};for(let e of this.windows){let t=e.deref(),n;try{n=t&&t.document}catch{}n&&i(n)}for(let e of this.shadowDoms){let t=e.deref();t&&i(t)}return r}takeSnapshot(e,t,n){let{sampling:r,blockClass:i,blockSelector:a,unblockSelector:o,dataURLOptions:s,maxCanvasSize:c}=this.options,l=1e3/(r===`all`?2:r||2);return this.lastSnapshotTime&&e-this.lastSnapshotTime<l?!1:(this.lastSnapshotTime=e,(n?[n]:this.getCanvasElements(i,a,o)).forEach(e=>{let n=this.mirror.getId(e);if(!(!this.mirror.hasNode(e)||!e.width||!e.height||this.snapshotInProgressMap.get(n))){if(this.snapshotInProgressMap.set(n,!0),!t&&[`webgl`,`webgl2`].includes(e.__context)){let t=e.getContext(e.__context);t?.getContextAttributes()?.preserveDrawingBuffer===!1&&t.clear(t.COLOR_BUFFER_BIT)}createImageBitmap(e).then(t=>{this.worker?.postMessage({id:n,bitmap:t,width:e.width,height:e.height,dataURLOptions:s,maxCanvasSize:c},[t])}).catch(e=>{tA(()=>{throw this.snapshotInProgressMap.delete(n),e})()})}}),!0)}startPendingCanvasMutationFlusher(){Zk(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,Zk(e)};Zk(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),Zk(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(e);if(!n||t===-1)return;let r=n.map(e=>{let{type:t,...n}=e;return n}),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}};try{if(Array.from([1],e=>e*2)[0]!==2){let 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)}Nae();var Kae;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})(Kae||={});var dA={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}}},qae=`ReplayCanvas`,fA=1280,Jae=Ml(((e={})=>{let[t,n]=e.maxCanvasSize||[],r={quality:e.quality||`medium`,enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,fA):fA,n?Math.min(n,fA):fA]},i,a,o=new Promise(e=>a=e);return{name:qae,getOptions(){let{quality:e,enableManualSnapshot:t,maxCanvasSize:n}=r;return{enableManualSnapshot:t,recordCanvas:!0,getCanvasManager:e=>{let r=new Gae({...e,enableManualSnapshot:t,maxCanvasSize:n,errorHandler:e=>{try{typeof e==`object`&&(e.__rrweb__=!0)}catch{}}});return i=r,a(r),r},...dA[e]||dA.medium}},async snapshot(e,t){(i||await o).snapshot(e,t)}}}));function Yae(e){return e.split(`,`).some(e=>e.trim().startsWith(`sentry-`))}function pA(e){try{return new URL(e,R.location.origin).href}catch{return}}function Xae(e){return e.entryType===`resource`&&`initiatorType`in e&&typeof e.nextHopProtocol==`string`&&(e.initiatorType===`fetch`||e.initiatorType===`xmlhttprequest`)}function mA(e){try{return new Headers(e)}catch{return}}var hA={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function gA(e,t){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:i,enableHTTPTimings:a,tracePropagationTargets:o,onRequestSpanStart:s,onRequestSpanEnd:c}={...hA,...t},l=typeof i==`function`?i:e=>!0,u=e=>Qae(e,o),d={},f=e.getOptions().propagateTraceparent;n&&Qg(t=>{let n=Mp(t,l,u,d,{propagateTraceparent:f,onRequestSpanEnd:c});if(n){let r=pA(t.fetchData.url),i=r?_d(r).host:void 0,o=r?yd(r):void 0;n.setAttributes({[kc]:o,[Ic]:o,"server.address":i}),a&&_A(n,e),s?.(n,{headers:t.headers})}}),r&&Gx(t=>{let n=$ae(t,l,u,d,f,c);n&&(a&&_A(n,e),s?.(n,{headers:mA(t.xhr.__sentry_xhr_v3__?.request_headers)}))})}var Zae=300;function _A(e,t){let{url:n}=L(e).data;if(!n||typeof n!=`string`)return;let r=()=>void setTimeout(i);if(Cs(t)){let t=e.end.bind(e);e.end=e=>{let n=e??zi(),a=!1,o=()=>{a||(a=!0,setTimeout(i),t(n),clearTimeout(s))};r=o;let s=setTimeout(o,Zae)}}let i=Ob(`resource`,({entries:t})=>{t.forEach(t=>{Xae(t)&&t.name.endsWith(n)&&(e.setAttributes(ax(t)),r())})})}function Qae(e,t){let n=r_();if(n){let r,i;try{r=new URL(e,n),i=new URL(n).origin}catch{return!1}let a=r.origin===i;return t?Ti(r.toString(),t)||a&&Ti(r.pathname,t):a}{let n=!!e.match(/^\/(?!\/)/);return t?Ti(e,t):n}}function $ae(e,t,n,r,i,a){let o=e.xhr,s=o?.[Wx];if(!o||o.__sentry_own_request__||!s)return;let{url:c,method:l}=s,u=Lo()&&t(c);if(e.endTimestamp){let t=o.__sentry_xhr_span_id__;if(!t)return;let n=r[t];n&&(u&&s.status_code!==void 0&&(Aa(n,s.status_code),n.end(),a?.(n,{headers:mA(Yx(o)),error:e.error})),delete r[t]);return}let d=pA(c),f=_d(d||c),p=d?yd(d):void 0,m=yd(vd(c)),h=F(),g=!!No(),_=g||!!h&&Cs(h),v=u&&_?Is({name:`${l} ${m}`,attributes:{url:yd(c),type:`xhr`,"http.method":l,"http.url":p,[Ic]:p,"server.address":f?.host,[I]:`auto.http.browser`,[ma]:`http.client`,...f?.search&&{"http.query":f?.search},...f?.hash&&{"http.fragment":f?.hash}}}):new Vo,y=Qs(v)&&g?void 0:v;return u&&!_&&h?.recordDroppedEvent(`no_parent_span`,`span`),o.__sentry_xhr_span_id__=v.spanContext().spanId,r[o.__sentry_xhr_span_id__]=v,n(c)&&eoe(o,Lo()&&_?y:void 0,i),h&&h.emit(`beforeOutgoingRequestSpan`,v,e),v}function eoe(e,t,n){let{"sentry-trace":r,baggage:i,traceparent:a}=kd({span:t,propagateTraceparent:n});r&&toe(e,r,i,a)}function toe(e,t,n,r){let i=e.__sentry_xhr_v3__?.request_headers;if(!(i?.[`sentry-trace`]||!e.setRequestHeader))try{if(e.setRequestHeader(`sentry-trace`,t),r&&!i?.traceparent&&e.setRequestHeader(`traceparent`,r),n){let t=i?.baggage;(!t||!Yae(t))&&e.setRequestHeader(`baggage`,n)}}catch{}}var vA=new WeakMap,yA=new WeakMap,noe=9e4,roe=[`text/event-stream`,`application/x-ndjson`,`application/stream+json`],bA=Ml(()=>({name:`FetchStreamPerformance`,setup(){Gne(e=>{if(e.response){let t=vA.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);let n=yA.get(e.response);n&&clearTimeout(n)}}}),Qg(e=>{if(e.endTimestamp&&e.response){let t=e.response.headers?.get(`content-type`)||``;if(e.response.headers?.get(`content-length`)||!roe.some(e=>t.startsWith(e)))return;let n=e.fetchData?.url||``,r=e.fetchData?.method||`GET`,i=hd(n),a=Is({name:`${r} ${n.startsWith(`data:`)?yd(n):i?gd(i):n}`,startTime:e.endTimestamp,attributes:{url:yd(n),"http.method":r,type:`fetch`,[ma]:`http.client.stream`,[I]:`auto.http.browser.stream`}});vA.set(e.response,a);let o=setTimeout(()=>{a.isRecording()&&a.end()},noe);yA.set(e.response,o)}})}})),ioe=`WebVitals`,xA=Ml((e={})=>{let t=new Set(e.ignore??[]);return{name:ioe,setup(n){let r=Cs(n),{enableStandaloneClsSpans:i,enableStandaloneLcpSpans:a}=e._experiments??{},o=r||t.has(`cls`)?void 0:i||!1,s=r||t.has(`lcp`)?void 0:a||!1,c=fx({recordClsStandaloneSpans:o,recordLcpStandaloneSpans:s,client:n}),l=new WeakSet;n.on(`afterStartPageLoadSpan`,e=>{l.add(e)}),n.on(`spanEnd`,e=>{l.delete(e)&&(c(),xx(e,{recordClsOnPageloadSpan:o===!1,recordLcpOnPageloadSpan:s===!1,spanStreamingEnabled:r}))}),r?(t.has(`lcp`)||uie(n),t.has(`cls`)||fie(n),t.has(`inp`)||mie()):t.has(`inp`)||aie()},afterAllSetup(){t.has(`inp`)||lie()}}});function aoe(){R.document?R.document.addEventListener(`visibilitychange`,()=>{let e=No();if(!e)return;let t=jo(e);if(R.document.hidden&&t){let e=`cancelled`,{op:n,status:r}=L(t);z&&N.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus({code:2,message:e}),t.setAttribute(`sentry.cancellation_reason`,`document.hidden`),t.end()}}):z&&N.warn(`[Tracing] Could not set up background tab detection due to lack of global document`)}var SA=`sentry_previous_trace`,ooe=`sentry.previous_trace`;function soe(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t===`session-storage`,i=r?uoe():void 0;e.on(`spanStart`,e=>{if(jo(e)!==e)return;let t=P().getPropagationContext();i=coe(i,e,t),r&&loe(i)});let a=!0;n&&e.on(`beforeSampling`,e=>{if(!i)return;let t=P(),n=t.getPropagationContext();if(a&&n.parentSpanId){a=!1;return}t.setPropagationContext({...n,dsc:{...n.dsc,sample_rate:String(i.sampleRate),sampled:String(CA(i.spanContext))},sampleRand:i.sampleRand}),e.parentSampled=CA(i.spanContext),e.parentSampleRate=i.sampleRate,e.spanAttributes={...e.spanAttributes,[cte]:i.sampleRate}})}function coe(e,t,n){let r=L(t);function i(){try{let e=Number(r.data?.[`sentry.sample_rate`]??n.dsc?.sample_rate);return Number.isNaN(e)?0:e}catch{return 0}}let a={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:i(),sampleRand:n.sampleRand};if(!e)return a;let o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=3600&&(z&&N.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[Da]:`previous_trace`}}),t.setAttribute(ooe,`${o.traceId}-${o.spanId}-${+!!CA(o)}`)),a)}function loe(e){try{R.sessionStorage.setItem(SA,JSON.stringify(e))}catch(e){z&&N.warn(`Could not store previous trace in sessionStorage`,e)}}function uoe(){try{let e=R.sessionStorage?.getItem(SA);return JSON.parse(e)}catch{return}}function CA(e){return e.traceFlags===1}var doe=`BrowserTracing`,foe=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function wA(){let e=R.navigator;return e?.userAgent?foe.test(e.userAgent):!1}var poe={...$s,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:`in-memory`,consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...hA},TA=((e={})=>{`enableElementTiming`in e&&ar(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});let t={name:void 0,source:void 0},n=R.document,{enableInp:r,enableLongTask:i,enableLongAnimationFrame:a,_experiments:{enableInteractions:o,enableStandaloneClsSpans:s,enableStandaloneLcpSpans:c},beforeStartSpan:l,idleTimeout:u,finalTimeout:d,childSpanTimeout:f,markBackgroundSpan:p,traceFetch:m,traceXHR:h,trackFetchStreamPerformance:g,shouldCreateSpanForRequest:_,enableHTTPTimings:v,ignoreResourceSpans:y,ignorePerformanceApiSpans:b,instrumentPageLoad:x,instrumentNavigation:S,detectRedirects:C,linkPreviousTrace:w,consistentTraceSampling:T,enableReportPageLoaded:ee,onRequestSpanStart:E,onRequestSpanEnd:te}={...poe,...e},ne=wA(),re,ie;function ae(e,r,i=!0,a){let o=r.op===`pageload`,s=r.name,c=l?l(r):r,p=hd(a||r_()),m={...p?.pathname&&{"url.path":p.pathname},...p&&!md(p)&&{"url.full":p.href},...c.attributes};if(s!==c.name&&(m[fa]=`custom`),c.attributes=m,!i){let e=Ri();Is({...c,startTime:e}).end(e);return}t.name=c.name,t.source=m[fa];let h=ic(c,{idleTimeout:u,finalTimeout:d,childSpanTimeout:f,disableAutoFinish:o,beforeSpanEnd:t=>{bx(t,{ignoreResourceSpans:y,ignorePerformanceApiSpans:b,spanStreamingEnabled:Cs(e)}),MA(e,void 0);let n=P(),r=n.getPropagationContext();n.setPropagationContext({...r,traceId:h.spanContext().traceId,sampled:Co(h),dsc:Jo(t)}),o&&(ie=void 0)},trimIdleSpanEndTimestamp:!ee});o&&ee&&(ie=h),MA(e,h);function g(){n&&[`interactive`,`complete`].includes(n.readyState)&&(e.emit(`idleSpanEnableAutoFinish`,h),n.removeEventListener(`readystatechange`,g))}o&&!ee&&n&&(n.addEventListener(`readystatechange`,g),g())}return{name:doe,setup(e){if(ne){z&&N.log(`[Tracing] Skipping browserTracingIntegration setup for bot user agent.`);return}if(Io(),a&&M.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes(`long-animation-frame`)?mx():i&&px(),o&&hx(),C&&n){let e=()=>{re=zi()};addEventListener(`click`,e,{capture:!0}),addEventListener(`keydown`,e,{capture:!0,passive:!0})}function t(){let t=jA(e);t&&!L(t).timestamp&&(z&&N.log(`[Tracing] Finishing current active span with op: ${L(t).op}`),t.setAttribute(ha,`cancelled`),t.end())}e.on(`startNavigationSpan`,(n,r)=>{if(F()!==e)return;if(r?.isRedirect){z&&N.warn(`[Tracing] Detected redirect, navigation span will not be the root span, but a child span.`),ae(e,{op:`navigation.redirect`,...n},!1,r.url);return}re=void 0,t();let i=P();i.setPropagationContext({traceId:Wi(),sampleRand:Math.random(),propagationSpanId:Lo()?void 0:Gi()}),i.setSDKProcessingMetadata({normalizedRequest:void 0}),ae(e,{op:`navigation`,...n,parentSpan:null,forceTransaction:!0},!0,r?.url)}),e.on(`startPageLoadSpan`,(n,r={})=>{if(F()!==e)return;t();let i=ro(r.sentryTrace||OA(`sentry-trace`)||kA(`sentry-trace`),r.baggage||OA(`baggage`)||kA(`baggage`)),a=P();a.setPropagationContext(i),Lo()||(a.getPropagationContext().propagationSpanId=Gi()),a.setSDKProcessingMetadata({normalizedRequest:cy()}),ae(e,{op:`pageload`,...n})}),e.on(`endPageloadSpan`,()=>{ee&&ie&&(ie.setAttribute(ha,`reportPageLoaded`),ie.end())})},afterAllSetup(e){if(ne)return;e.addIntegration&&!e.getIntegrationByName?.(`WebVitals`)&&e.addIntegration(xA({ignore:r?[]:[`inp`],_experiments:{enableStandaloneClsSpans:s,enableStandaloneLcpSpans:c}}));let n=r_();if(w!==`off`&&soe(e,{linkPreviousTrace:w,consistentTraceSampling:T}),R.location){if(x){let t=Vi();EA(e,{name:R.location.pathname,startTime:t?t/1e3:void 0,attributes:{[fa]:`url`,[I]:`auto.pageload.browser`}})}S&&Bx(({to:t,from:r})=>{if(r===void 0&&n?.indexOf(t)!==-1){n=void 0;return}n=void 0;let i=hd(t),a=jA(e),o=a&&C&&hoe(a,re);DA(e,{name:i?.pathname||R.location.pathname,attributes:{[fa]:`url`,[I]:`auto.navigation.browser`}},{url:t,isRedirect:o})})}p&&aoe(),o&&moe(e,u,d,f,t),gA(e,{traceFetch:m,traceXHR:h,tracePropagationTargets:e.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:_,enableHTTPTimings:v,onRequestSpanStart:E,onRequestSpanEnd:te}),g&&e.addIntegration(bA())}}});function EA(e,t,n){e.emit(`startPageLoadSpan`,t,n),P().setTransactionName(t.name);let r=jA(e);return r&&e.emit(`afterStartPageLoadSpan`,r),r}function DA(e,t,n){let{url:r,isRedirect:i}=n||{};e.emit(`beforeStartNavigationSpan`,t,{isRedirect:i,url:r}),e.emit(`startNavigationSpan`,t,{isRedirect:i,url:r});let a=P();return a.setTransactionName(t.name),r&&!i&&a.setSDKProcessingMetadata({normalizedRequest:{...cy(),url:r}}),jA(e)}function OA(e){return(R.document?.querySelector(`meta[name=${e}]`))?.getAttribute(`content`)||void 0}function kA(e){return(R.performance?.getEntriesByType?.(`navigation`)[0])?.serverTiming?.find(t=>t.name===e)?.description}function moe(e,t,n,r,i){let a=R.document,o;a&&addEventListener(`click`,()=>{let a=`ui.action.click`,s=jA(e);if(s){let e=L(s).op;if([`navigation`,`pageload`].includes(e)){z&&N.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&=(o.setAttribute(ha,`interactionInterrupted`),o.end(),void 0),!i.name){z&&N.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=ic({name:i.name,op:a,attributes:{[fa]:i.source||`url`}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})},{capture:!0})}var AA=`_sentry_idleSpan`;function jA(e){return e[AA]}function MA(e,t){Jr(e,AA,t)}var NA=1.5;function hoe(e,t){let n=L(e),r=Ri();return!(r-n.start_timestamp>NA||t&&r-t<=NA)}function goe(e=F()){e?.emit(`endPageloadSpan`)}function _oe(e){let t=No();if(t===e)return;let n=P();e.end=new Proxy(e.end,{apply(e,r,i){return Yi(n,t),Reflect.apply(e,r,i)}}),Yi(n,e)}var voe=Ml(()=>({name:`SpanStreaming`,beforeSetup(e){let t=e.getOptions();t.traceLifecycle||=(z&&N.log('[SpanStreaming] setting `traceLifecycle` to "stream"'),`stream`)},setup(e){let t=`SpanStreaming integration requires`,n=`Falling back to static trace lifecycle.`,r=e.getOptions();if(!Cs(e)){r.traceLifecycle=`static`,z&&N.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let i=r.beforeSendSpan;if(i&&!Zo(i)){r.traceLifecycle=`static`,z&&N.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let a=new Vne(e);e.on(`afterSpanEnd`,t=>{Co(t)&&a.add(wte(t,e))}),e.on(`afterSegmentSpanEnd`,e=>{let t=e.spanContext().traceId;setTimeout(()=>{a.flush(t)},500)})}}));function PA(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function yoe(e,t){let n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);let r=PA(n);return e=>r.then(n=>e(n.transaction(t,`readwrite`).objectStore(t)))}function FA(e){return PA(e.getAllKeys())}function boe(e,t,n){return e(e=>FA(e).then(r=>{if(!(r.length>=n))return e.put(t,Math.max(...r,0)+1),PA(e.transaction)}))}function xoe(e,t,n){return e(e=>FA(e).then(r=>{if(!(r.length>=n))return e.put(t,Math.min(...r,0)-1),PA(e.transaction)}))}function Soe(e){return e(e=>FA(e).then(t=>{let n=t[0];if(n!=null)return PA(e.get(n)).then(t=>(e.delete(n),PA(e.transaction).then(()=>t)))}))}function Coe(e){let t;function n(){return t??=yoe(e.dbName||`sentry-offline`,e.storeName||`queue`),t}return{push:async t=>{try{let r=is(t);await boe(n(),r,e.maxQueueSize||30)}catch{}},unshift:async t=>{try{let r=is(t);await xoe(n(),r,e.maxQueueSize||30)}catch{}},shift:async()=>{try{let e=await Soe(n());if(e)return os(e)}catch{}}}}function woe(e){return t=>{let n=e({...t,createStore:Coe});return R.addEventListener(`online`,async e=>{await n.flush()}),n}}function Toe(e=Zx){return woe(rd(e))}var IA=1e6,Eoe=`window`in M&&M.window===M&&typeof importScripts>`u`,LA=`0`,RA=Eoe?`main`:`worker`,zA=R.navigator,BA=``,VA=``,HA=``,UA=zA?.userAgent||``,WA=``,Doe=zA?.language||zA?.languages?.[0]||``;function Ooe(e){return typeof e==`object`&&!!e&&`getHighEntropyValues`in e}var GA=zA?.userAgentData;Ooe(GA)&&GA.getHighEntropyValues([`architecture`,`model`,`platform`,`platformVersion`,`fullVersionList`]).then(e=>{if(BA=e.platform||``,HA=e.architecture||``,WA=e.model||``,VA=e.platformVersion||``,e.fullVersionList?.length){let t=e.fullVersionList[e.fullVersionList.length-1];UA=`${t.brand} ${t.version}`}}).catch(e=>void 0);function koe(e){return!(`thread_metadata`in e)}function Aoe(e){return koe(e)?Ioe(e):e}function joe(e){let t=e.contexts?.trace?.trace_id;return typeof t==`string`&&t.length!==32&&z&&N.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t==`string`?t:``}function Moe(e,t,n,r){if(r.type!==`transaction`)throw TypeError(`Profiling events may only be attached to transactions, this should never occur.`);if(n==null)throw TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);let i=joe(r),a=Aoe(n),o=t||(typeof r.start_timestamp==`number`?r.start_timestamp*1e3:zi()*1e3),s=typeof r.timestamp==`number`?r.timestamp*1e3:zi()*1e3;return{event_id:e,timestamp:new Date(o).toISOString(),platform:`javascript`,version:`1`,release:r.release||``,environment:r.environment||`production`,runtime:{name:`javascript`,version:R.navigator.userAgent},os:{name:BA,version:VA,build_number:UA},device:{locale:Doe,model:WA,manufacturer:UA,architecture:HA,is_emulator:!1},debug_meta:{images:qA(n.resources)},profile:a,transactions:[{name:r.transaction||``,id:r.event_id||ki(),trace_id:i,active_thread_id:LA,relative_start_ns:`0`,relative_end_ns:((s-o)*1e6).toFixed(0)}]}}function Noe(e,t,n){if(e==null)throw TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);let r=Foe(e),i=t.getOptions(),a=t.getSdkMetadata?.()?.sdk;return{chunk_id:ki(),client_sdk:{name:a?.name??`sentry.javascript.browser`,version:a?.version??`0.0.0`},profiler_id:n||ki(),platform:`javascript`,version:`2`,release:i.release??``,environment:i.environment??`production`,debug_meta:{images:qA(e.resources)},profile:r}}function Poe(e){try{if(!e||typeof e!=`object`)return{reason:`chunk is not an object`};let t=e=>typeof e==`string`&&/^[a-f0-9]{32}$/.test(e);if(!t(e.profiler_id))return{reason:`missing or invalid profiler_id`};if(!t(e.chunk_id))return{reason:`missing or invalid chunk_id`};if(!e.client_sdk)return{reason:`missing client_sdk metadata`};let 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(e){return{reason:`unknown validation error: ${e}`}}}function Foe(e){let t=[];for(let n=0;n<e.frames.length;n++){let r=e.frames[n];r&&(t[n]={function:r.name,abs_path:typeof r.resourceId==`number`?e.resources[r.resourceId]:void 0,lineno:r.line,colno:r.column})}let n=[];for(let t=0;t<e.stacks.length;t++){let r=e.stacks[t];if(!r)continue;let i=[],a=r;for(;a;)i.push(a.frameId),a=a.parentId===void 0?void 0:e.stacks[a.parentId];n[t]=i}let r=Vi(),i=typeof performance.timeOrigin==`number`?performance.timeOrigin:r||0,a=i-(r||i),o=[];for(let t=0;t<e.samples.length;t++){let n=e.samples[t];if(!n)continue;let r=(i+(n.timestamp-a))/1e3;o[t]={stack_id:n.stackId??0,thread_id:LA,timestamp:r}}return{frames:t,stacks:n,samples:o,thread_metadata:{[LA]:{name:RA}}}}function KA(e){return L(e).op===`pageload`}function Ioe(e){let t,n=0,r={samples:[],stacks:[],frames:[],thread_metadata:{[LA]:{name:RA}}},i=e.samples[0];if(!i)return r;let a=i.timestamp,o=Vi(),s=typeof performance.timeOrigin==`number`?performance.timeOrigin:o||0,c=s-(o||s);return e.samples.forEach((i,o)=>{if(i.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[o]={elapsed_since_start_ns:((i.timestamp+c-a)*IA).toFixed(0),stack_id:t,thread_id:LA};return}let s=e.stacks[i.stackId],l=[];for(;s;){l.push(s.frameId);let t=e.frames[s.frameId];t&&r.frames[s.frameId]===void 0&&(r.frames[s.frameId]={function:t.name,abs_path:typeof t.resourceId==`number`?e.resources[t.resourceId]:void 0,lineno:t.line,colno:t.column}),s=s.parentId===void 0?void 0:e.stacks[s.parentId]}let u={elapsed_since_start_ns:((i.timestamp+c-a)*IA).toFixed(0),stack_id:n,thread_id:LA};r.stacks[n]=l,r.samples[o]=u,n++}),r}function Loe(e,t){if(!t.length)return e;for(let n of t)e[1].push([{type:`profile`},n]);return e}function Roe(e){let t=[];return es(e,(e,n)=>{if(n===`transaction`)for(let n=1;n<e.length;n++)e[n]?.contexts?.profile?.profile_id&&t.push(e[n])}),t}function qA(e){let t=F()?.getOptions()?.stackParser;return t?Ate(t,e):[]}function JA(e){return typeof e!=`number`&&typeof e!=`boolean`||typeof e==`number`&&isNaN(e)?(z&&N.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):e===!0||e===!1?!0:e<0||e>1?(z&&N.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function zoe(e){return e.samples.length<2?(z&&N.log(`[Profiling] Discarding profile because it contains less than 2 samples`),!1):e.frames.length?!0:(z&&N.log(`[Profiling] Discarding profile because it contains no frames`),!1)}var YA=!1,XA=3e4;function Boe(e){return typeof e==`function`}function ZA(){let e=R.Profiler;if(!Boe(e)){z&&N.log(`[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.`);return}let t=Math.floor(XA/10);try{return new e({sampleInterval:10,maxBufferSize:t})}catch{z&&(N.log(`[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header.`),N.log(`[Profiling] Disabling profiling for current user session.`)),YA=!0}}function QA(e){if(YA)return z&&N.log(`[Profiling] Profiling has been disabled for the duration of the current user session.`),!1;if(!e.isRecording())return z&&N.log(`[Profiling] Discarding profile because root span was not sampled.`),!1;let t=F()?.getOptions();if(!t)return z&&N.log(`[Profiling] Profiling disabled, no options found.`),!1;let n=t.profilesSampleRate;return JA(n)?n?n===!0||Math.random()<n||(z&&N.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(n)})`),!1):(z&&N.log(`[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0`),!1):(z&&N.warn(`[Profiling] Discarding profile because of invalid sample rate.`),!1)}function Voe(e){if(YA)return z&&N.log(`[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started.`),!1;if(e.profileLifecycle!==`trace`&&e.profileLifecycle!==`manual`)return z&&N.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;let t=e.profileSessionSampleRate;return JA(t)?t?Math.random()<=t:(z&&N.log(`[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0`),!1):(z&&N.warn(`[Profiling] Discarding profile because of invalid profileSessionSampleRate.`),!1)}function $A(e){return e.profilesSampleRate!==void 0}function Hoe(e,t,n,r){return zoe(n)?Moe(e,t,n,r):null}var ej=new Map;function Uoe(){return ej.size}function Woe(e){let t=ej.get(e);return t&&ej.delete(e),t}function Goe(e,t){if(ej.set(e,t),ej.size>30){let e=ej.keys().next().value;e!==void 0&&ej.delete(e)}}var tj=new WeakSet;function nj(e){e.setAttribute(`thread.id`,LA),e.setAttribute(`thread.name`,RA)}function rj(e){let t;KA(e)&&(t=zi()*1e3);let n=ZA();if(!n)return;z&&N.log(`[Profiling] started profiling span: ${L(e).description}`);let r=ki(),i=null;P().setContext(`profile`,{profile_id:r,start_timestamp:t}),tj.add(e),nj(e);async function a(){if(e&&n){if(i){z&&N.log(`[Profiling] profile for:`,L(e).description,`already exists, returning early`);return}return n.stop().then(t=>{if(o&&=(R.clearTimeout(o),void 0),z&&N.log(`[Profiling] stopped profiling of span: ${L(e).description}`),!t){z&&N.log(`[Profiling] profiler returned null profile for: ${L(e).description}`,`this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started`);return}i=t,Goe(r,t)}).catch(e=>{z&&N.log(`[Profiling] error while stopping profiler:`,e)})}}let o=R.setTimeout(()=>{z&&N.log(`[Profiling] max profile duration elapsed, stopping profiling for:`,L(e).description),a()},XA),s=e.end.bind(e);function c(){return e?(a().then(()=>{s()},()=>{s()}),e):s()}e.end=c}var Koe=6e4,qoe=3e5,Joe=class{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(e){let t=e.getOptions().profileLifecycle,n=Voe(e.getOptions());z&&N.log(`[Profiling] Initializing profiler (lifecycle='${t}').`),n||z&&N.log(`[Profiling] Session not sampled. Skipping lifecycle profiler initialization.`),this._profilerId=ki(),this._client=e,this._sessionSampled=n,this._lifecycleMode=t,t===`trace`&&this._setupTraceLifecycleListeners(e),e.on(`spanStart`,e=>{this._isRunning&&nj(e)})}start(){if(this._lifecycleMode===`trace`){z&&N.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){z&&N.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){z&&N.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode===`trace`){z&&N.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){z&&N.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");return}this._endProfiling()}notifyRootSpanActive(e){if(this._lifecycleMode!==`trace`||!this._sessionSampled)return;let t=e.spanContext().spanId;if(!t||this._activeRootSpanIds.has(t))return;this._registerTraceRootSpan(t);let n=this._activeRootSpanIds.size;n===1&&(z&&N.log(`[Profiling] Detected already active root span during setup. Active root spans now:`,n),this._beginProfiling()),this._isRunning&&nj(e)}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,z&&N.log(`[Profiling] Started profiling with profiler ID:`,this._profilerId),la().setContext(`profile`,{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){z&&N.log(`[Profiling] Failed to start JS Profiler; stopping.`),this._resetProfilerInfo();return}this._startPeriodicChunking()}}_endProfiling(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&=(clearTimeout(this._chunkTimer),void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(e=>{z&&N.error("[Profiling] Failed to collect current profile chunk on `stop()`:",e)}),this._lifecycleMode===`manual`&&la().setContext(`profile`,{}))}_setupTraceLifecycleListeners(e){e.on(`spanStart`,e=>{if(!this._sessionSampled){z&&N.log(`[Profiling] Span not profiled because of negative sampling decision for user session.`);return}if(e!==jo(e))return;if(!e.isRecording()){z&&N.log(`[Profiling] Discarding profile because root span was not sampled.`);return}let t=e.spanContext().spanId;if(!t||this._activeRootSpanIds.has(t))return;this._registerTraceRootSpan(t);let n=this._activeRootSpanIds.size;n===1&&(z&&N.log(`[Profiling] Root span ${t} started. Profiling active while there are active root spans (count=${n}).`),this._beginProfiling())}),e.on(`spanEnd`,e=>{if(!this._sessionSampled)return;let t=e.spanContext().spanId;if(!t||!this._activeRootSpanIds.has(t))return;this._activeRootSpanIds.delete(t);let n=this._activeRootSpanIds.size;z&&N.log(`[Profiling] Root span with ID ${t} ended. Will continue profiling for as long as there are active root spans (currently: ${n}).`),n===0&&(this._collectCurrentChunk().catch(e=>{z&&N.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",e)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,la().setContext(`profile`,{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(e=>clearTimeout(e)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(e){this._activeRootSpanIds.add(e);let t=setTimeout(()=>this._onRootSpanTimeout(e),qoe);this._rootSpanTimeouts.set(e,t)}_startProfilerInstance(){if(this._profiler?.stopped===!1)return;let e=ZA();if(!e){z&&N.log(`[Profiling] Failed to start JS Profiler.`);return}this._profiler=e}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(e=>{z&&N.error(`[Profiling] Failed to collect current profile chunk during periodic chunking:`,e)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},Koe))}_onRootSpanTimeout(e){this._rootSpanTimeouts.has(e)&&(this._rootSpanTimeouts.delete(e),this._activeRootSpanIds.has(e)&&(z&&N.log(`[Profiling] Reached 5-minute timeout for root span ${e}. You likely started a manual root span that never called \`.end()\`.`),this._activeRootSpanIds.delete(e),this._activeRootSpanIds.size===0&&this._endProfiling()))}async _collectCurrentChunk(){let e=this._profiler;if(this._profiler=void 0,e)try{let t=Noe(await e.stop(),this._client,this._profilerId),n=Poe(t);if(`reason`in n){z&&N.log(`[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):`,n.reason);return}this._sendProfileChunk(t),z&&N.log(`[Profiling] Collected browser profile chunk.`)}catch(e){z&&N.log(`[Profiling] Error while stopping JS Profiler for chunk:`,e)}}_sendProfileChunk(e){let t=this._client,n=fs(t.getSdkMetadata?.()),r=t.getDsn(),i=t.getOptions().tunnel,a=Qo({event_id:ki(),sent_at:new Date().toISOString(),...n&&{sdk:n},...!!i&&r&&{dsn:qa(r)}},[[{type:`profile_chunk`,platform:`javascript`},e]]);t.sendEnvelope(a).then(null,e=>{z&&N.error(`Error while sending profile chunk envelope:`,e)})}},Yoe=`BrowserProfiling`,Xoe=Ml((()=>({name:Yoe,setup(e){let t=e.getOptions(),n=new Joe;if(!$A(t)&&!t.profileLifecycle&&(t.profileLifecycle=`manual`),$A(t)&&!t.profilesSampleRate){z&&N.log(`[Profiling] Profiling disabled, no profiling options found.`);return}let r=No(),i=r&&jo(r);if($A(t)&&t.profileSessionSampleRate!==void 0&&z&&N.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),$A(t))i&&KA(i)&&QA(i)&&rj(i),e.on(`spanStart`,e=>{let t=jo(e);e===t?QA(e)&&rj(e):tj.has(t)&&nj(e)}),e.on(`beforeEnvelope`,e=>{if(!Uoe())return;let t=Roe(e);if(!t.length)return;let n=[];for(let e of t){let t=e?.contexts,r=t?.profile?.profile_id,i=t?.profile?.start_timestamp;if(typeof r!=`string`){z&&N.log(`[Profiling] cannot find profile for a span without a profile context`);continue}if(!r){z&&N.log(`[Profiling] cannot find profile for a span without a profile context`);continue}t?.profile&&delete t.profile;let a=Woe(r);if(!a){z&&N.log(`[Profiling] Could not retrieve profile for span: ${r}`);continue}let o=Hoe(r,i,a,e);o&&n.push(o)}Loe(e,n)});else{let r=t.profileLifecycle;if(e.on(`startUIProfiler`,()=>n.start()),e.on(`stopUIProfiler`,()=>n.stop()),r===`manual`)n.initialize(e);else if(r===`trace`){if(!Lo(t)){z&&N.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}n.initialize(e),i&&n.notifyRootSpanActive(i),R.setTimeout(()=>{let e=No(),t=e&&jo(e);t&&n.notifyRootSpanActive(t)},0)}}}}))),Zoe=`SpotlightBrowser`,Qoe=[{op:`ui.interaction.click`,name:`#sentry-spotlight`}],$oe=((e={})=>{let t=e.sidecarUrl||`http://localhost:8969/stream`;return{name:Zoe,setup:()=>{z&&N.log(`Using Sidecar URL`,t)},beforeSetup(e){let t=e.getOptions();t.ignoreSpans=[...t.ignoreSpans||[],...Qoe]},afterAllSetup:e=>{ese(e,t)}}});function ese(e,t){let n=Hx(`fetch`),r=0;e.on(`beforeEnvelope`,e=>{if(r>3){N.warn(`[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:`,r);return}n(t,{method:`POST`,body:is(e),headers:{"Content-Type":`application/x-sentry-envelope`},mode:`cors`}).then(e=>{e.status>=200&&e.status<400&&(r=0)},e=>{r++,N.error(`Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/`,e)})})}var tse=Ml($oe),nse=Ml(()=>({name:`LaunchDarkly`,processEvent(e,t,n){return Cp(e)}}));function rse(){return{name:`sentry-flag-auditor`,type:`flag-used`,synchronous:!0,method:(e,t,n)=>{wp(e,t.value),Ep(e,t.value)}}}var ise=Ml(()=>({name:`OpenFeature`,processEvent(e,t,n){return Cp(e)}})),ase=class{after(e,t){wp(t.flagKey,t.value),Ep(t.flagKey,t.value)}error(e,t,n){wp(e.flagKey,e.defaultValue),Ep(e.flagKey,e.defaultValue)}},ose=Ml(({featureFlagClientClass:e})=>({name:`Unleash`,setupOnce(){let t=e.prototype;qr(t,`isEnabled`,sse)},processEvent(e,t,n){return Cp(e)}}));function sse(e){return function(...t){let n=t[0],r=e.apply(this,t);return typeof n==`string`&&typeof r==`boolean`?(wp(n,r),Ep(n,r)):z&&N.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}var cse=(({growthbookClass:e})=>Op({growthbookClass:e})),lse=Ml(({featureFlagClient:e})=>({name:`Statsig`,setup(t){e.on(`gate_evaluation`,e=>{wp(e.gate.name,e.gate.value),Ep(e.gate.name,e.gate.value)})},processEvent(e,t,n){return Cp(e)}}));async function use(){let e=F();if(!e)return`no-client-active`;if(!e.getDsn())return`no-dsn-configured`;let t=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 Bs(()=>fetch(t,{body:`{}`,method:`POST`,mode:`cors`,credentials:`omit`}))}catch{return`sentry-unreachable`}}var dse=`WebWorker`,fse=Ml(({worker:e})=>({name:dse,setupOnce:()=>{(Array.isArray(e)?e:[e]).forEach(e=>ij(e))},addWorker:e=>ij(e)}));function ij(e){e.addEventListener(`message`,e=>{if(hse(e.data)){if(e.stopImmediatePropagation(),e.data._sentryDebugIds&&(z&&N.log(`Sentry debugId web worker message received`,e.data),R._sentryDebugIds={...e.data._sentryDebugIds,...R._sentryDebugIds}),e.data._sentryModuleMetadata&&(z&&N.log(`Sentry module metadata web worker message received`,e.data),R._sentryModuleMetadata={...e.data._sentryModuleMetadata,...R._sentryModuleMetadata}),e.data._sentryWasmImages){z&&N.log(`Sentry WASM images web worker message received`,e.data);let t=R._sentryWasmImages||[],n=e.data._sentryWasmImages.filter(e=>Br(e)&&typeof e.code_file==`string`&&!t.some(t=>t.code_file===e.code_file));R._sentryWasmImages=[...t,...n]}e.data._sentryWorkerError&&(z&&N.log(`Sentry worker rejection message received`,e.data._sentryWorkerError),pse(e.data._sentryWorkerError))}})}function pse(e){let t=F();if(!t)return;let n=t.getOptions().stackParser,r=t.getOptions().attachStacktrace,i=e.reason,a=zr(i)?wS(i):xy(n,i,void 0,r,!0);a.level=`error`,e.filename&&(a.contexts={...a.contexts,worker:{filename:e.filename}}),el(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.web_worker.onunhandledrejection`}}),z&&N.log(`Captured worker unhandled rejection`,i)}function mse({self:e}){e.postMessage({_sentryMessage:!0,_sentryDebugIds:e._sentryDebugIds??void 0,_sentryModuleMetadata:e._sentryModuleMetadata??void 0}),e.addEventListener(`unhandledrejection`,t=>{let n={reason:CS(t),filename:e.location?.href};e.postMessage({_sentryMessage:!0,_sentryWorkerError:n}),z&&N.log(`[Sentry Worker] Forwarding unhandled rejection to parent`,n)}),z&&N.log(`[Sentry Worker] Registered worker with unhandled rejection handling`)}function hse(e){if(!Br(e)||e._sentryMessage!==!0)return!1;let t=`_sentryDebugIds`in e,n=`_sentryModuleMetadata`in e,r=`_sentryWorkerError`in e,i=`_sentryWasmImages`in e;return!(!t&&!n&&!r&&!i||t&&!(Br(e._sentryDebugIds)||e._sentryDebugIds===void 0)||n&&!(Br(e._sentryModuleMetadata)||e._sentryModuleMetadata===void 0)||r&&!Br(e._sentryWorkerError)||i&&(!Array.isArray(e._sentryWasmImages)||!e._sentryWasmImages.every(e=>Br(e)&&typeof e.code_file==`string`)))}function gse(e){return Br(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function aj(e){let t={...e};Od(t,`react`),tl(`react`,{version:k.version});let n=BS(t);return di(_se),n}function _se(e){return gse(e)?`[SyntheticEvent]`:FS(e)}function vse(e){let t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}function yse(e,t){let n=new WeakSet;function r(e,t){if(!n.has(e)){if(e.cause)return n.add(e),r(e.cause,t);e.cause=t}}r(e,t)}function oj(e,{componentStack:t},n){if(vse(k.version)&&Mr(e)&&t){let n=Error(e.message);n.name=`React ErrorBoundary ${e.name}`,n.stack=t,yse(e,n)}return Qc(e,n)}function bse(e){return(t,n)=>{let r=!!e,i=oj(t,n,{mechanism:{handled:r,type:`auto.function.react.error_handler`}});r&&e(t,n,i)}}var sj=`ui.react.render`,xse=`ui.react.update`,cj=`ui.react.mount`,Sse={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Cse={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},wse={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},lj={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Tse=Symbol.for(`react.forward_ref`),uj=Symbol.for(`react.memo`);function Ese(e){return typeof e==`object`&&!!e&&e.$$typeof===uj}var dj={};dj[Tse]=wse,dj[uj]=lj;function fj(e){if(Ese(e))return lj;let t=e.$$typeof;return t&&dj[t]||Sse}var Dse=Object.defineProperty.bind(Object),Ose=Object.getOwnPropertyNames.bind(Object),pj=Object.getOwnPropertySymbols?.bind(Object),mj=Object.getOwnPropertyDescriptor.bind(Object),kse=Object.getPrototypeOf.bind(Object),hj=Object.prototype;function gj(e,t,n){if(typeof t!=`string`){if(hj){let n=kse(t);n&&n!==hj&&gj(e,n)}let n=Ose(t);pj&&(n=n.concat(pj(t)));let r=fj(e),i=fj(t);for(let a of n)if(!Cse[a]&&!i?.[a]&&!r?.[a]&&!mj(e,a)){let n=mj(t,a);if(n)try{Dse(e,a,n)}catch{}}}return e}var _j=class extends k.Component{constructor(e){super(e);let{name:t,disabled:n=!1}=this.props;n||(this._mountSpan=Is({name:`<${t}>`,onlyIfParent:!0,op:cj,attributes:{[I]:`auto.ui.react.profiler`,"ui.component_name":t}}))}componentDidMount(){this._mountSpan&&this._mountSpan.end()}shouldComponentUpdate({updateProps:e,includeUpdates:t=!0}){if(t&&this._mountSpan&&e!==this.props.updateProps){let t=Object.keys(e).filter(t=>e[t]!==this.props.updateProps[t]);if(t.length>0){let e=zi();this._updateSpan=zs(this._mountSpan,()=>Is({name:`<${this.props.name}>`,onlyIfParent:!0,op:xse,startTime:e,attributes:{[I]:`auto.ui.react.profiler`,"ui.component_name":this.props.name,"ui.react.changed_props":t}}))}}return!0}componentDidUpdate(){this._updateSpan&&=(this._updateSpan.end(),void 0)}componentWillUnmount(){let e=zi(),{name:t,includeRender:n=!0}=this.props;if(this._mountSpan&&n){let n=L(this._mountSpan).timestamp;zs(this._mountSpan,()=>{let r=Is({onlyIfParent:!0,name:`<${t}>`,op:sj,startTime:n,attributes:{[I]:`auto.ui.react.profiler`,"ui.component_name":t}});r&&r.end(e)})}}render(){return this.props.children}};Object.assign(_j,{defaultProps:{disabled:!1,includeRender:!0,includeUpdates:!0}});function Ase(e,t){let n=t?.name||e.displayName||e.name||`unknown`,r=r=>k.createElement(_j,{...t,name:n,updateProps:r},k.createElement(e,{...r}));return r.displayName=`profiler(${n})`,gj(r,e),r}function jse(e,t={disabled:!1,hasRenderSpan:!0}){let[n]=k.useState(()=>{if(!t?.disabled)return Is({name:`<${e}>`,onlyIfParent:!0,op:cj,attributes:{[I]:`auto.ui.react.profiler`,"ui.component_name":e}})});k.useEffect(()=>(n&&n.end(),()=>{if(n&&t.hasRenderSpan){let t=L(n).timestamp,r=zi(),i=Is({name:`<${e}>`,onlyIfParent:!0,op:sj,startTime:t,attributes:{[I]:`auto.ui.react.profiler`,"ui.component_name":e}});i&&i.end(r)}}),[])}var vj=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,yj={componentStack:null,error:null,eventId:null},bj=class extends k.Component{constructor(e){super(e),this.state=yj,this._openFallbackReportDialog=!0;let t=F();t&&e.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=t.on(`afterSendEvent`,t=>{!t.type&&this._lastEventId&&t.event_id===this._lastEventId&&US({...e.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(e,t){let{componentStack:n}=t,{beforeCapture:r,onError:i,showDialog:a,dialogOptions:o}=this.props;ua(s=>{r&&r(s,e,n);let c=oj(e,t,{mechanism:{handled:this.props.handled==null?!!this.props.fallback:this.props.handled,type:`auto.function.react.error_boundary`}});i&&i(e,n,c),a&&(this._lastEventId=c,this._openFallbackReportDialog&&US({...o,eventId:c})),this.setState({error:e,componentStack:n,eventId:c})})}componentDidMount(){let{onMount:e}=this.props;e&&e()}componentWillUnmount(){let{error:e,componentStack:t,eventId:n}=this.state,{onUnmount:r}=this.props;r&&(this.state===yj?r(null,null,null):r(e,t,n)),this._cleanupHook&&=(this._cleanupHook(),void 0)}resetErrorBoundary(){let{onReset:e}=this.props,{error:t,componentStack:n,eventId:r}=this.state;e&&e(t,n,r),this.setState(yj)}render(){let{fallback:e,children:t}=this.props,n=this.state;if(n.componentStack===null)return typeof t==`function`?t():t;let r=typeof e==`function`?k.createElement(e,{error:n.error,componentStack:n.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:n.eventId}):e;return k.isValidElement(r)?r:(e&&vj&&N.warn(`fallback did not produce a valid ReactElement`),null)}};function Mse(e,t){let n=e.displayName||e.name||`unknown`,r=k.memo(n=>k.createElement(bj,{...t},k.createElement(e,{...n})));return r.displayName=`errorBoundary(${n})`,gj(r,e),r}var Nse=`redux.action`,Pse=`info`,Fse={attachReduxState:!0,actionTransformer:e=>e,stateTransformer:e=>e||null};function Ise(e){let t={...Fse,...e};return e=>(n,r)=>{t.attachReduxState&&la().addEventProcessor((e,t)=>{try{e.type===void 0&&e.contexts.state.state.type===`redux`&&(t.attachments=[...t.attachments||[],{filename:`redux_state.json`,data:JSON.stringify(e.contexts.state.state.value)}])}catch{}return e});function i(e){return(n,r)=>{let i=e(n,r),a=P(),o=t.actionTransformer(r);o!=null&&Nd({category:Nse,data:o,type:Pse});let s=t.stateTransformer(i);if(s!=null){let e=F()?.getOptions()?.normalizeDepth||3,t={state:{type:`redux`,value:s}};si(t,3+e),a.setContext(`state`,t)}else a.setContext(`state`,null);let{configureScopeWithState:c}=t;return typeof c==`function`&&c(a,i),i}}let a=e(i(n),r);return a.replaceReducer=new Proxy(a.replaceReducer,{apply:function(e,t,n){e.apply(t,[i(n[0])])}}),a}}function Lse(e){let t=TA({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,match:i,instrumentPageLoad:a=!0,instrumentNavigation:o=!0}=e;return{...t,afterAllSetup(e){t.afterAllSetup(e),a&&R.location&&xj(r,R.location,i,(t,n=`url`)=>{EA(e,{name:t,attributes:{[ma]:`pageload`,[I]:`auto.pageload.react.reactrouter_v3`,[fa]:n,...n===`route`&&{"url.template":t}}})}),o&&n.listen&&n.listen(t=>{(t.action===`PUSH`||t.action===`POP`)&&xj(r,t,i,(t,n=`url`)=>{DA(e,{name:t,attributes:{[ma]:`navigation`,[I]:`auto.navigation.react.reactrouter_v3`,[fa]:n,...n===`route`&&{"url.template":t}}})})})}}}function xj(e,t,n,r){let i=t.pathname;n({location:t,routes:e},(e,t,n)=>{if(e||!n)return r(i);let a=Rse(n.routes||[]);return a.length===0||a===`/*`?r(i):(i=a,r(i,`route`))})}function Rse(e){if(!Array.isArray(e)||e.length===0)return``;let t=e.filter(e=>!!e.path),n=-1;for(let e=t.length-1;e>=0;e--)if(t[e].path?.startsWith(`/`)){n=e;break}return t.slice(n).reduce((e,{path:t})=>`${e}${e===`/`||e===``?t:`/${t}`}`,``)}function zse(e,t={}){let n=e,r=TA({...t,instrumentNavigation:!1,instrumentPageLoad:!1}),{instrumentPageLoad:i=!0,instrumentNavigation:a=!0}=t;return{...r,afterAllSetup(e){r.afterAllSetup(e);let t=(e,t)=>{let r=n.matchRoutes(e,t,{preload:!1,throwOnError:!1}),i=r[r.length-1];return i?.routeId===`__root__`?void 0:i},o=(e,t,r,i)=>{e.updateName(t?t.routeId:i),e.setAttribute(fa,t?`route`:`url`),e.setAttributes({...t&&{"url.template":t.routeId},...Bse(n,r),...Cj(t)})},s=R.location;if(i&&s){let r=n.state?.location,i=r?t(r.pathname,r.search):t(s.pathname,n.options.parseSearch(s.search)),a=EA(e,{name:i?i.routeId:s.pathname,attributes:{[ma]:`pageload`,[I]:`auto.pageload.react.tanstack_router`,[fa]:i?`route`:`url`,...i&&{"url.template":i.routeId},...Cj(i)}}),c=n.subscribe(`onResolved`,e=>{if(c(),!a)return;let{toLocation:n}=e,r=t(n.pathname,n.search);o(a,r,n,n.pathname)})}if(a){let r;n.subscribe(`onBeforeLoad`,i=>{let{toLocation:a,fromLocation:s}=i;if(!s||a.state===s.state)return;let c=t(a.pathname,a.search),l=R.location?.pathname||a.pathname;if(r){o(r,c,a,l);return}r=DA(e,{name:c?c.routeId:l,attributes:{[ma]:`navigation`,[I]:`auto.navigation.react.tanstack_router`,[fa]:c?`route`:`url`,...c&&{"url.template":c.routeId},...Cj(c)}},{url:Sj(n,a)})}),n.subscribe(`onResolved`,e=>{let n=r;if(r=void 0,!n)return;let{toLocation:i}=e,a=t(i.pathname,i.search);a&&o(n,a,i,R.location?.pathname||i.pathname)})}}}}function Sj(e,t){let n=e.options.stringifySearch?.(t.search)??``;return Xx(`${t.pathname}${n&&n!==`?`?n:``}`)}function Bse(e,t){let n=Sj(e,t);return{[xte]:t.pathname,[Ic]:n}}function Cj(e){if(!e)return{};let t={};return Object.entries(e.params).forEach(([e,n])=>{t[`url.path.params.${e}`]=n,t[`${Ste}.${e}`]=n,t[`${bte}.${e}`]=n}),t}function Vse(e){let t=TA({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,matchPath:i,instrumentPageLoad:a=!0,instrumentNavigation:o=!0}=e;return{...t,afterAllSetup(e){t.afterAllSetup(e),wj(e,a,o,n,`reactrouter_v4`,r,i)}}}function Hse(e){let t=TA({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,matchPath:i,instrumentPageLoad:a=!0,instrumentNavigation:o=!0}=e;return{...t,afterAllSetup(e){t.afterAllSetup(e),wj(e,a,o,n,`reactrouter_v5`,r,i)}}}function wj(e,t,n,r,i,a=[],o){function s(){if(r.location)return r.location.pathname;if(R.location)return R.location.pathname}function c(e){if(a.length===0||!o)return[e,`url`];let t=Tj(a,e,o);for(let e of t)if(e.match.isExact)return[e.match.path,`route`];return[e,`url`]}if(t){let t=s();if(t){let[n,r]=c(t);EA(e,{name:n,attributes:{[ma]:`pageload`,[I]:`auto.pageload.react.${i}`,[fa]:r,...r===`route`&&{"url.template":n}}})}}n&&r.listen&&r.listen((t,n)=>{if(n&&(n===`PUSH`||n===`POP`)){let[n,r]=c(t.pathname);DA(e,{name:n,attributes:{[ma]:`navigation`,[I]:`auto.navigation.react.${i}`,[fa]:r,...r===`route`&&{"url.template":n}}})}})}function Tj(e,t,n,r=[]){return e.some(e=>{let i=e.path?n(t,e):r.length?r[r.length-1].match:Use(t);return i&&(r.push({route:e,match:i}),e.routes&&Tj(e.routes,t,n,r)),!!i}),r}function Use(e){return{path:`/`,url:`/`,params:{},isExact:e===`/`}}function Wse(e){let t=e.displayName||e.name,n=t=>{if(t?.computedMatch?.isExact){let e=t.computedMatch.path,n=Gse();P().setTransactionName(e),n&&(n.updateName(e),n.setAttributes({[fa]:`route`,[Lc]:e}))}return k.createElement(e,{...t})};return n.displayName=`sentryRoute(${t})`,gj(n,e),n}function Gse(){let e=No(),t=e&&jo(e);if(!t)return;let n=L(t).op;return n===`navigation`||n===`pageload`?t:void 0}function Ej(e,t){if(!t||t===`/`||!e.toLowerCase().startsWith(t.toLowerCase()))return e;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?e:e.slice(n)||`/`}var Dj=new WeakMap;function Kse(e,t,n){if(!e||!t?.length)return null;let r=n?Ej(e,n):e,i=Dj.get(t);i||(i=Qse(t),Dj.set(t,i),vj&&N.log(`[React Router] Sorted route manifest by specificity:`,i.length,`patterns`));for(let e of i)if(qse(r,e))return vj&&N.log(`[React Router] Matched pathname`,r,`to pattern`,e),e;return vj&&N.log(`[React Router] No manifest match found for pathname:`,r),null}function qse(e,t){if(t===`/`)return e===`/`||e===``;let n=kj(e),r=kj(t);if(r.length>0&&r[r.length-1]===`*`){let e=r.slice(0,-1);if(n.length<e.length)return!1;for(let[t,r]of e.entries())if(!Oj(n[t],r))return!1;return!0}if(n.length!==r.length)return!1;for(let[e,t]of r.entries())if(!Oj(n[e],t))return!1;return!0}function Oj(e,t){return e===void 0||t===void 0?!1:Aj.test(t)?!0:e===t}function kj(e){return e.split(`/`).filter(Boolean)}var Aj=/^:[\w-]+$/,Jse=10,Yse=3,Xse=1,Zse=-2;function jj(e){let t=e.split(`/`),n=t.length;t.includes(`*`)&&(n+=Zse);for(let e of t)if(e===`*`)continue;else Aj.test(e)?n+=Yse:n+=e===``?Xse:Jse;return n}function Qse(e){return[...e].sort((e,t)=>{let n=jj(e);return jj(t)-n})}var Mj,Nj=!1,Pj=[],$se=10;function ece(e,t){let n={};return Pj.length>=$se&&(vj&&N.warn(`[React Router] Navigation context stack overflow - removing oldest context`),Pj.shift()),Pj.push({token:n,targetPath:e,span:t}),n}function tce(e){Pj[Pj.length-1]?.token===e&&Pj.pop()}function Fj(){let e=Pj.length;return e>0?Pj[e-1]??null:null}function nce(e,t=!1){Mj=e,Nj=t}function rce(e){return Lj(e.route.path||``)}function Ij(e){return e.params[`*`]||``}function Lj(e){return e[e.length-1]===`*`?e.slice(0,-1):e}function Rj(e){return e[e.length-1]===`/`?e.slice(0,-1):e}function zj(e){return e.endsWith(`*`)}function Bj(e){return e.includes(`/*`)||e.endsWith(`*`)}function Vj(e,t){return zj(e)&&!!t.route.children?.length||!1}function Hj(e){return!!(!e.children&&e.element&&e.path?.endsWith(`/*`))}function ice(e,t,n){let r=e&&e.length>0?e:Nj?Ej(t,n):t,i=r.slice(-2)===`/*`?r.slice(0,-2):r;return i.length>1&&i[i.length-1]===`/`&&(i=i.slice(0,-1)),[i,`route`]}function Uj(e){return e.split(/\\?\//).filter(e=>e.length>0&&e!==`,`).length}function Wj(e){return e[0]===`/`?e:`/${e}`}function Gj(e,t){let n=Mj(e,t);if(!n||n.length===0)return``;for(let r of n)if(r.route.path&&r.route.path!==`*`){let n=rce(r),i=Ej(t.pathname,Wj(r.pathnameBase));return t.pathname===i?Rj(i):Rj(Rj(n||``)+Wj(Gj(e.filter(e=>e!==r.route),{pathname:i})))}return``}function ace(e,t,n){let r=t.filter(Hj);if(!r.length)return;let i=Mj(r,e),a=i?.[i.length-1];if(!a||!Ij(a))return;let o=Rj(Lj(a.route.path||``));if(!o)return;let s=Wj(o),c=o.split(`/`)[0],l=c?.startsWith(`:`)&&n?.split(`/`).includes(c);if(n===s||n?.startsWith(`${s}/`)||l)return;let u=Ej(e.pathname,Wj(a.pathnameBase))||`/`,d=Gj(t.filter(e=>e!==a.route),{pathname:u});return d?Wj(`${o}${Wj(d)}`):void 0}function oce(e,t){let n=Mj(t,e);if(n){for(let e of n)if(Hj(e.route)&&Ij(e))return!0}return!1}function Kj(e,t){return Nj?Ej(e.pathname,t):e.pathname||``}function sce(e,t,n,r=``){if(!e||e.length===0)return[Nj?Ej(t.pathname,r):t.pathname,`url`];if(!n)return[Kj(t,r),`url`];let i=``;for(let e of n){let n=e.route;if(!n)continue;if(n.index)return ice(i,e.pathname,r);let a=n.path;if(!a||Vj(a,e))continue;let o=a[0]===`/`||i[i.length-1]===`/`?a:`/${a}`;if(i=Rj(i)+Wj(o),Rj(t.pathname)===Rj(r+e.pathname))return Uj(i)!==Uj(e.pathname)&&!zj(i)?[(Nj?``:r)+o,`route`]:(Vj(i,e)&&(i=i.slice(0,-1)),[(Nj?``:r)+i,`route`])}return[Kj(t,r),`url`]}function qj(e,t,n,r,i=``,a,o){if(o&&a&&a.length>0){let t=Kse(e.pathname,a,i);if(t)return[(Nj?``:i)+t,`route`]}let s,c=`url`,l=oce(e,n);l&&(s=Wj(Gj(n,e)),c=`route`),(!l||!s)&&([s,c]=sce(t,e,r,i));let u=ace(e,n,s);return u?[u,`route`]:[s||e.pathname,c]}function Jj(){let e=No(),t=e?jo(e):void 0;if(!t)return;let n=L(t).op;return n===`navigation`||n===`pageload`?t:void 0}function cce(){let e=Fj();if(e)return e.targetPath?{pathname:e.targetPath,search:``,hash:``,state:null,key:`default`}:null;if(R!==void 0)try{let e=R.location;if(e)return{pathname:e.pathname,search:e.search||``,hash:e.hash||``,state:null,key:`default`}}catch{vj&&N.warn(`[React Router] Could not access window.location`)}return null}function lce(){let e=Fj();return e?e.span:Jj()}function uce(e,t,n,r){let i=new Proxy(e,{apply(e,i,a){let o=cce(),s=lce(),c=e.apply(i,a);return dce(c,t,n,r,o,s),c}});return Jr(i,`__sentry_proxied__`,!0),i}function dce(e,t,n,r,i,a){Wr(e)?e.then(e=>{Array.isArray(e)&&r(e,t,i??void 0,a)}).catch(e=>{vj&&N.warn(`Error resolving async handler '${n}' for route`,t,e)}):Array.isArray(e)&&r(e,t,i??void 0,a)}function Yj(e,t){if(e.handle&&typeof e.handle==`object`)for(let n of Object.keys(e.handle)){let r=e.handle[n];typeof r==`function`&&!r.__sentry_proxied__&&(e.handle[n]=uce(r,e,n,t))}if(Array.isArray(e.children))for(let n of e.children)Yj(n,t)}var Xj,Zj,Qj,$j,eM,tM=!1,nM=3e3,rM,iM=``,aM=new WeakSet,oM=R?.document?k.useLayoutEffect:k.useEffect,sM=new WeakMap,cM=new Set,lM=new WeakMap,uM=new WeakMap;function dM(e){return R?.requestAnimationFrame?R.requestAnimationFrame(e):setTimeout(e,0)}function fM(e){R?.cancelAnimationFrame?R.cancelAnimationFrame(e):clearTimeout(e)}function pM(e){return`${e.pathname}${e.search||``}${e.hash||``}`}function mM(e){return e.includes(`:`)||e.includes(`*`)}function hM(e,t,n,r){if(!e)return{skip:!1,shouldUpdate:!1};if(e.locationKey===t&&(e.isPlaceholder||!r)){let t=!!e.routeName&&Bj(e.routeName),r=Bj(n),i=!!e.routeName&&mM(e.routeName),a=mM(n),o=t&&!r,s=!i&&a,c=n!==e.routeName&&n.length>(e.routeName?.length||0)&&!r;return{skip:!0,shouldUpdate:!!(e.routeName&&(o||s||c))}}return{skip:!1,shouldUpdate:!1}}function gM(e,t){let n=t.children||[],r=e.filter(e=>!n.some(t=>t===e||e.path&&t.path===e.path||e.id&&t.id===e.id));r.length>0&&(t.children=[...n,...r])}function _M(e,t){let n=lM.get(e);n||(n=new Set,lM.set(e,n)),n.add(t),t.finally(()=>{let n=lM.get(e);n&&n.delete(t)})}function vM(e){_M(e,new Promise(t=>{uM.set(e,t)}))}function yM(e){let t=uM.get(e);t&&(t(),uM.delete(e),e.__sentry_may_have_lazy_routes__&&=!1)}function bM(e,t,n=null,r){e.forEach(e=>{cM.add(e),tM&&Yj(e,bM)}),t&&gM(e,t);let i=r??Jj();if(i){let e=L(i);if(e.timestamp){vj&&N.warn(`[React Router] Lazy handler resolved after span ended - skipping update`);return}let t=e.op,a=n;if(!a&&!r&&R!==void 0){let e=R.location;e?.pathname&&(a={pathname:e.pathname})}a&&(t===`pageload`?MM({activeRootSpan:i,location:{pathname:a.pathname},routes:Array.from(cM),allRoutes:Array.from(cM)}):t===`navigation`&&xM(i,a,Array.from(cM),!1,eM))}}function xM(e,t,n,r=!1,i){let a=L(e),o=a.description,s=e?.__sentry_navigation_name_set__,c=o&&Bj(o);if((!s||r||c)&&!a.timestamp){let[r,l]=qj(t,n,n,i(n,t)||[],iM,rM,tM),u=a.data?.[fa];r&&(!o||!s&&(u!==`route`||l===`route`)||u!==`route`&&l===`route`||u===`route`&&l===`route`&&c)&&(e.updateName(r),e.setAttribute(fa,l),l===`route`&&e.setAttribute(Lc,r),!Bj(r)&&l===`route`&&Jr(e,`__sentry_navigation_name_set__`,!0))}}function SM(e,t,n,r,i){let a=!1,o=!!i&&L(i).op===`pageload`,s=!1,c=null,l=null;e.subscribe(e=>{if(!a){let t=Jj();t&&L(t).op===`pageload`?o=!0:o&&(e.historyAction===`POP`&&!s?s=!0:a=!0)}if(e.historyAction===`PUSH`||e.historyAction===`POP`&&a){let i=pM(e.location),a=()=>{l!==i&&(l=i,c=null,OM({location:e.location,routes:t,navigationType:e.historyAction,version:n,basename:r,allRoutes:Array.from(cM)}))};e.navigation.state===`idle`?(c!==null&&(fM(c),c=null),a()):(l!==i&&(l=null),c!==null&&fM(c),c=dM(a))}})}function CM(e,t){return!Xj||!Zj||!Qj||!eM?(vj&&N.warn(`reactRouter${t?`V${t}`:``}Instrumentation was unable to wrap the \`createRouter\` function because of one or more missing parameters.`),e):function(n,r){if(kM(n),tM)for(let e of n)Yj(e,bM);let i=Jj();r&&`patchRoutesOnNavigation`in r&&typeof r.patchRoutesOnNavigation==`function`&&i&&(Jr(i,`__sentry_may_have_lazy_routes__`,!0),vM(i));let a=e(n,DM(r,!1,i)),o=r?.basename;return a.state.historyAction===`POP`&&i&&MM({activeRootSpan:i,location:a.state.location,routes:n,basename:o,allRoutes:Array.from(cM)}),iM=o||``,SM(a,n,t,o,i),a}}function wM(e,t){return!Xj||!Zj||!Qj||!eM?(vj&&N.warn(`reactRouter${t?`V${t}`:``}Instrumentation was unable to wrap the \`createMemoryRouter\` function because of one or more missing parameters.`),e):function(n,r){if(kM(n),tM)for(let e of n)Yj(e,bM);let i=Jj();r&&`patchRoutesOnNavigation`in r&&typeof r.patchRoutesOnNavigation==`function`&&i&&(Jr(i,`__sentry_may_have_lazy_routes__`,!0),vM(i));let a=e(n,DM(r,!0,i)),o=r?.basename,s,c=r?.initialEntries,l=r?.initialIndex,u=c?.length===1,d=l!==void 0&&c?.[l];s=u?c[0]:d?c[l]:void 0;let f=s?typeof s==`string`?{pathname:s}:s:a.state.location,p=Jj();return a.state.historyAction===`POP`&&p&&MM({activeRootSpan:p,location:f,routes:n,basename:o,allRoutes:Array.from(cM)}),iM=o||``,SM(a,n,t,o,p),a}}function TM(e,t){let n=TA({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:r,useLocation:i,useNavigationType:a,createRoutesFromChildren:o,matchRoutes:s,stripBasename:c,enableAsyncRouteHandlers:l=!1,instrumentPageLoad:u=!0,instrumentNavigation:d=!0,lazyRouteTimeout:f,lazyRouteManifest:p}=e;return{...n,setup(t){n.setup(t);let u=e.finalTimeout??3e4,d=(e.idleTimeout??1e3)*3,m=f??d;m===1/0?(nM=u,vj&&N.log(`[React Router] lazyRouteTimeout set to Infinity, capping at finalTimeout:`,u,`ms to prevent indefinite hangs`)):Number.isNaN(m)?(vj&&N.warn(`[React Router] lazyRouteTimeout must be a number, falling back to default:`,d),nM=d):m<0?(vj&&N.warn(`[React Router] lazyRouteTimeout must be non-negative or Infinity, got:`,m,`falling back to:`,d),nM=d):nM=m,Xj=r,Zj=i,Qj=a,eM=s,$j=o,tM=l,rM=p,nce(s,c||!1)},afterAllSetup(e){n.afterAllSetup(e);let r=R.location?.pathname;u&&r&&EA(e,{name:r,attributes:{[fa]:`url`,[ma]:`pageload`,[I]:`auto.pageload.react.reactrouter${t?`_v${t}`:``}`}}),d&&aM.add(e)}}}function EM(e,t){if(!Xj||!Zj||!Qj||!eM)return vj&&N.warn("reactRouterV6Instrumentation was unable to wrap `useRoutes` because of one or more missing parameters."),e;let n=n=>{let r=k.useRef(!0),{routes:i,locationArg:a}=n,o=e(i,a),s=Zj(),c=Qj(),l=typeof a==`string`||a?.pathname?a:s;return oM(()=>{let e=kM(i);return()=>AM(e)}),oM(()=>{let e=typeof l==`string`?{pathname:l}:l;r.current?(MM({activeRootSpan:Jj(),location:e,routes:i,allRoutes:Array.from(cM)}),r.current=!1):OM({location:e,routes:i,navigationType:c,version:t,allRoutes:Array.from(cM)})},[c,l]),o};return(e,t)=>k.createElement(n,{routes:e,locationArg:t})}function DM(e,t=!1,n){if(!e||!(`patchRoutesOnNavigation`in e)||typeof e.patchRoutesOnNavigation!=`function`)return e||{};let r=e.patchRoutesOnNavigation;return{...e,patchRoutesOnNavigation:async e=>{let i=e?.path,a=Jj()??n;if(!t){let t=e?.patch,n=e?.matches;t&&(e.patch=(e,r)=>{if(kM(r),n&&n.length>0){let t=n[n.length-1]?.route;if(t){let n=Array.from(cM).find(n=>{let r=n.id!==void 0&&n.id===e,i=n===t,a=n.path!==void 0&&t.path!==void 0&&n.path===t.path;return r||i||a});n&&gM(r,n)}}let o=a?L(a):void 0;return i&&a&&o&&!o.timestamp&&o.op===`navigation`&&xM(a,{pathname:i,search:``,hash:``,state:null,key:`default`},Array.from(cM),!0,eM),t(e,r)})}let o=(async()=>{let t=ece(i,a),n;try{n=await r(e)}finally{tce(t),a&&yM(a)}let o=a?L(a):void 0;if(a&&o&&!o.timestamp&&o.op===`navigation`){let e=i;e&&xM(a,{pathname:e,search:``,hash:``,state:null,key:`default`},Array.from(cM),!1,eM)}return n})();return a&&_M(a,o),o}}}function OM(e){let{location:t,routes:n,navigationType:r,version:i,matches:a,basename:o,allRoutes:s}=e,c=Array.isArray(a)?a:eM(s||n,t,o),l=F();if(!l||!aM.has(l))return;let u=Jj();if(!(u&&L(u).op===`pageload`&&r===`POP`)&&(r===`PUSH`||r===`POP`)&&c){let[e,r]=qj(t,s||n,s||n,c,o,rM,tM),a=pM(t),u=sM.get(l),{skip:d,shouldUpdate:f}=hM(u,a,e,u&&!u.isPlaceholder?!!L(u.span).timestamp:!1);if(d){if(f&&u){let t=u.routeName;u.isPlaceholder?(u.routeName=e,vj&&N.log(`[Tracing] Updated placeholder navigation name from "${t}" to "${e}" (will apply to real span)`)):(u.span.updateName(e),u.span.setAttribute(fa,r),r===`route`&&u.span.setAttribute(Lc,e),Jr(u.span,`__sentry_navigation_name_set__`,!0),u.routeName=e,vj&&N.log(`[Tracing] Updated navigation span name from "${t}" to "${e}"`))}else vj&&N.log(`[Tracing] Skipping duplicate navigation for location: ${a}`);return}let p={span:{end:()=>{}},routeName:e,pathname:t.pathname,locationKey:a,isPlaceholder:!0};sM.set(l,p);let m;try{m=DA(l,{name:p.routeName,attributes:{[fa]:r,[ma]:`navigation`,[I]:`auto.navigation.react.reactrouter${i?`_v${i}`:``}`,...r===`route`&&{"url.template":p.routeName}}})}catch(e){throw sM.delete(l),e}m?(sM.set(l,{span:m,routeName:p.routeName,pathname:t.pathname,locationKey:a}),FM(m,t,n,o,`navigation`)):sM.delete(l)}}function kM(e){let t=[];return e.forEach(e=>{jM(e).forEach(e=>{cM.add(e),t.push(e)})}),t}function AM(e){e.forEach(e=>{cM.delete(e)})}function jM(e,t=new Set){return t.has(e)||(t.add(e),e.children&&!e.index&&e.children.forEach(e=>{jM(e,t).forEach(e=>{t.add(e)})})),t}function MM({activeRootSpan:e,location:t,routes:n,matches:r,basename:i,allRoutes:a}){let o=Array.isArray(r)?r:eM(a||n,t,i);if(o){let[r,s]=qj(t,a||n,a||n,o,i,rM,tM);P().setTransactionName(r||`/`),e&&(e.updateName(r),e.setAttribute(fa,s),s===`route`&&e.setAttribute(Lc,r),FM(e,t,n,i,`pageload`))}else e&&FM(e,t,n,i,`pageload`)}function NM(e,t,n,r,i=!1){return n?!!(!e&&i||e&&Bj(e)&&r===`route`&&!Bj(n)||t!==`route`&&r===`route`):!1}function PM(e,t,n,r,i,a,o,s){try{let c=t.data?.[fa];if(c===`route`&&n&&!Bj(n))return;let l=Array.from(s),u=l.length>0?l:i,d=eM(u,r,a);if(!d)return;let[f,p]=qj(r,u,u,d,a,rM,tM),m=NM(n,c,f,p,!0),h=o===`pageload`||!t.timestamp;m&&h&&(e.updateName(f),e.setAttribute(fa,p),p===`route`&&e.setAttribute(Lc,f))}catch(e){vj&&N.warn(`Error updating span details before ending: ${e}`)}}function FM(e,t,n,r,i){let a=`__sentry_${i}_end_patched__`;if(e?.[a]||!e.end)return;let o=e.end.bind(e),s=!1;e.end=function(...a){if(s)return;s=!0;let c=a.length>0?a[0]:Date.now()/1e3,l=L(e),u=l.description,d=l.data?.[fa],f=()=>{let t=F();if(t&&i===`navigation`){let n=sM.get(t);n&&n.span===e&&sM.delete(t)}},p=lM.get(e),m=e.__sentry_may_have_lazy_routes__;if((p&&p.size>0||m)&&u&&(Bj(u)||d!==`route`)){if(nM===0){PM(e,l,u,t,n,r,i,cM),f(),o(c);return}let a=new Promise(e=>setTimeout(e,nM)),s;if(p&&p.size>0){let e=Promise.allSettled(p).then(()=>{});s=nM===1/0?e:Promise.race([e,a])}else s=a;s.then(()=>{let a=L(e);PM(e,a,a.description,t,n,r,i,cM),f(),o(c)}).catch(()=>{f(),o(c)});return}PM(e,l,u,t,n,r,i,cM),f(),o(c)},Jr(e,a,!0)}function IM(e,t){if(!Xj||!Zj||!Qj||!$j||!eM)return vj&&N.warn(`reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters.
|
|
501
|
+
useEffect: ${Xj}. useLocation: ${Zj}. useNavigationType: ${Qj}.
|
|
502
|
+
createRoutesFromChildren: ${$j}. matchRoutes: ${eM}.`),e;let n=n=>{let r=k.useRef(!0),i=Zj(),a=Qj(),o=$j(n.children);return oM(()=>{let e=kM(o);return()=>AM(e)}),oM(()=>{r.current?(MM({activeRootSpan:Jj(),location:i,routes:o,allRoutes:Array.from(cM)}),r.current=!1):OM({location:i,routes:o,navigationType:a,version:t,allRoutes:Array.from(cM)})},[i,a]),k.createElement(e,{...n})};return gj(n,e),n}function LM(e){return TM(e,`6`)}function RM(e){return EM(e,`6`)}function zM(e){return CM(e,`6`)}function BM(e){return wM(e,`6`)}function VM(e){return IM(e,`6`)}function HM(e){return TM(e,`7`)}function UM(e){return IM(e,`7`)}function WM(e){return CM(e,`7`)}function GM(e){return wM(e,`7`)}function KM(e){return EM(e,`7`)}function qM(e){return TM(e,``)}function JM(e){return IM(e,``)}function YM(e){return CM(e,``)}function XM(e){return wM(e,``)}function ZM(e){return EM(e,``)}var QM=e({BrowserClient:()=>Cy,ErrorBoundary:()=>bj,MULTIPLEXED_TRANSPORT_EXTRA_KEY:()=>id,OpenFeatureIntegrationHook:()=>ase,Profiler:()=>_j,SDK_VERSION:()=>$n,SEMANTIC_ATTRIBUTE_SENTRY_OP:()=>ma,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:()=>I,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:()=>pa,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:()=>fa,Scope:()=>Zi,WINDOW:()=>R,addBreadcrumb:()=>Nd,addEventProcessor:()=>ml,addIntegration:()=>jl,bindScopeToEmitter:()=>fc,breadcrumbsIntegration:()=>aS,browserApiErrorsIntegration:()=>cS,browserProfilingIntegration:()=>Xoe,browserSessionIntegration:()=>hS,browserTracingIntegration:()=>TA,buildLaunchDarklyFlagUsedHandler:()=>rse,captureConsoleIntegration:()=>_f,captureEvent:()=>el,captureException:()=>Qc,captureFeedback:()=>Vp,captureMessage:()=>$c,captureReactException:()=>oj,captureSession:()=>vl,chromeStackLineParser:()=>$x,close:()=>dl,consoleLoggingIntegration:()=>nm,contextLinesIntegration:()=>fC,continueTrace:()=>Rs,createConsolaReporter:()=>lm,createLangChainCallbackHandler:()=>Bg,createReduxEnhancer:()=>Ise,createTransport:()=>xu,createUserFeedbackEnvelope:()=>Yie,cultureContextIntegration:()=>_S,dedupeIntegration:()=>bf,defaultRequestInstrumentationOptions:()=>hA,defaultStackLineParsers:()=>tS,defaultStackParser:()=>nS,diagnoseSdkConnectivity:()=>use,elementTimingIntegration:()=>iie,endSession:()=>gl,eventFiltersIntegration:()=>zd,eventFromException:()=>yy,eventFromMessage:()=>by,exceptionFromError:()=>hy,extraErrorDataIntegration:()=>Of,featureFlagsIntegration:()=>Dp,feedbackAsyncIntegration:()=>Vre,feedbackIntegration:()=>my,feedbackSyncIntegration:()=>my,fetchStreamPerformanceIntegration:()=>bA,flush:()=>ul,forceLoad:()=>VS,functionToStringIntegration:()=>Id,geckoStackLineParser:()=>eS,getAbsoluteUrl:()=>Xx,getActiveSpan:()=>No,getClient:()=>F,getCurrentScope:()=>P,getDefaultIntegrations:()=>zS,getFeedback:()=>Cre,getGlobalScope:()=>la,getIsolationScope:()=>ca,getReplay:()=>kae,getRootSpan:()=>jo,getSpanDescendants:()=>Ao,getSpanStatusFromHttpCode:()=>ka,getTraceData:()=>kd,globalHandlersIntegration:()=>bS,graphqlClientIntegration:()=>TC,growthbookIntegration:()=>cse,httpClientIntegration:()=>YS,httpContextIntegration:()=>kS,inboundFiltersIntegration:()=>Bd,init:()=>aj,instrumentAnthropicAiClient:()=>Zte,instrumentCreateReactAgent:()=>Fne,instrumentGoogleGenAIClient:()=>lne,instrumentLangChainEmbeddings:()=>wne,instrumentLangGraph:()=>Ine,instrumentOpenAiClient:()=>cg,instrumentOutgoingRequests:()=>gA,instrumentStateGraph:()=>Kg,instrumentSupabaseClient:()=>rp,isBotUserAgent:()=>wA,isEnabled:()=>pl,isInitialized:()=>fl,lastEventId:()=>ll,launchDarklyIntegration:()=>nse,lazyLoadIntegration:()=>py,linkedErrorsIntegration:()=>NS,logger:()=>Hp,makeBrowserOfflineTransport:()=>Toe,makeFetchTransport:()=>Zx,makeMultiplexedTransport:()=>cd,metrics:()=>rm,moduleMetadataIntegration:()=>uf,normalizeStringifyValue:()=>FS,onLoad:()=>HS,openFeatureIntegration:()=>ise,opera10StackLineParser:()=>Kie,opera11StackLineParser:()=>Jie,parameterize:()=>Td,reactErrorHandler:()=>bse,reactRouterBrowserTracingIntegration:()=>qM,reactRouterV3BrowserTracingIntegration:()=>Lse,reactRouterV4BrowserTracingIntegration:()=>Vse,reactRouterV5BrowserTracingIntegration:()=>Hse,reactRouterV6BrowserTracingIntegration:()=>LM,reactRouterV7BrowserTracingIntegration:()=>HM,registerSpanErrorInstrumentation:()=>Io,registerWebWorker:()=>mse,replayCanvasIntegration:()=>Jae,replayIntegration:()=>zk,reportPageLoaded:()=>goe,reportingObserverIntegration:()=>qS,rewriteFramesIntegration:()=>zf,sendFeedback:()=>g_,setActiveSpanInBrowser:()=>_oe,setAttribute:()=>ol,setAttributes:()=>al,setContext:()=>tl,setConversationId:()=>cl,setCurrentClient:()=>ed,setExtra:()=>nl,setExtras:()=>Vte,setHttpStatus:()=>Aa,setMeasurement:()=>bs,setTag:()=>il,setTags:()=>rl,setUser:()=>sl,showReportDialog:()=>US,spanStreamingIntegration:()=>voe,spanToBaggageHeader:()=>Yo,spanToJSON:()=>L,spanToTraceHeader:()=>fo,spotlightBrowserIntegration:()=>tse,startBrowserTracingNavigationSpan:()=>DA,startBrowserTracingPageLoadSpan:()=>EA,startInactiveSpan:()=>Is,startNewTrace:()=>Hs,startSession:()=>hl,startSpan:()=>Ps,startSpanManual:()=>Fs,statsigIntegration:()=>lse,supabaseIntegration:()=>op,suppressTracing:()=>Bs,tanstackRouterBrowserTracingIntegration:()=>zse,thirdPartyErrorFilterIntegration:()=>hp,uiProfiler:()=>jie,unleashIntegration:()=>ose,updateSpanName:()=>mte,useProfiler:()=>jse,viewHierarchyIntegration:()=>EC,webVitalsIntegration:()=>xA,webWorkerIntegration:()=>fse,winjsStackLineParser:()=>Wie,withActiveSpan:()=>zs,withErrorBoundary:()=>Mse,withIsolationScope:()=>ste,withProfiler:()=>Ase,withScope:()=>ua,withSentryReactRouterV6Routing:()=>VM,withSentryReactRouterV7Routing:()=>UM,withSentryRouting:()=>Wse,withStreamedSpan:()=>Xo,wrapCreateBrowserRouter:()=>YM,wrapCreateBrowserRouterV6:()=>zM,wrapCreateBrowserRouterV7:()=>WM,wrapCreateMemoryRouter:()=>XM,wrapCreateMemoryRouterV6:()=>BM,wrapCreateMemoryRouterV7:()=>GM,wrapReactRouterRouting:()=>JM,wrapUseRoutes:()=>ZM,wrapUseRoutesV6:()=>RM,wrapUseRoutesV7:()=>KM,zodErrorsIntegration:()=>mp}),U=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,W=globalThis,$M=`10.67.0`;function eN(){return tN(W),W}function tN(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||`10.67.0`,t[$M]=t[`10.67.0`]||{}}function nN(e,t,n=W){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[$M]=r[`10.67.0`]||{};return i[e]||(i[e]=t())}var rN=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],iN=`Sentry Logger `,aN={};function oN(e){if(!(`console`in W))return e();let t=W.console,n={},r=Object.keys(aN);r.forEach(e=>{let r=aN[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function sN(){mN().enabled=!0}function cN(){mN().enabled=!1}function lN(){return mN().enabled}function uN(...e){pN(`log`,...e)}function dN(...e){pN(`warn`,...e)}function fN(...e){pN(`error`,...e)}function pN(e,...t){U&&lN()&&oN(()=>{W.console[e](`${iN}[${e}]:`,...t)})}function mN(){return U?nN(`loggerSettings`,()=>({enabled:!1})):{enabled:!1}}var G={enable:sN,disable:cN,isEnabled:lN,log:uN,warn:dN,error:fN},hN=50,gN=/\(error: (.*)\)/,_N=/captureMessage|captureException/;function vN(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{let i=[],a=e.split(`
|
|
503
|
+
`);for(let e=n;e<a.length;e++){let n=a[e];n.length>1024&&(n=n.slice(0,1024));let o=gN.test(n)?n.replace(gN,`$1`):n;if(!o.includes(`Error: `)){for(let e of t){let t=e(o);if(t){i.push(t);break}}if(i.length>=hN+r)break}}return bN(i.slice(r))}}function yN(e){return Array.isArray(e)?vN(...e):e}function bN(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(xN(t).function||``)&&t.pop(),t.reverse(),_N.test(xN(t).function||``)&&(t.pop(),_N.test(xN(t).function||``)&&t.pop()),t.slice(0,hN).map(e=>({...e,filename:e.filename||xN(t).filename,function:e.function||`?`}))}function xN(e){return e[e.length-1]||{}}var SN=`<anonymous>`;function CN(e){try{return!e||typeof e!=`function`?SN:e.name||SN}catch{return SN}}function wN(e){let t=e.exception;if(t){let e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function TN(e){let t=e?.startsWith(`file://`)?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}var EN={},DN={};function ON(e,t){return EN[e]=EN[e]||[],EN[e].push(t),()=>{let n=EN[e];if(n){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}function kN(e,t){if(!DN[e]){DN[e]=!0;try{t()}catch(t){U&&G.error(`Error while instrumenting ${e}`,t)}}}function AN(e,t){let n=e&&EN[e];if(n)for(let r of n)try{r(t)}catch(t){U&&G.error(`Error while triggering instrumentation handler.
|
|
504
|
+
Type: ${e}
|
|
505
|
+
Name: ${CN(r)}
|
|
506
|
+
Error:`,t)}}var jN=null;function MN(e){let t=`error`;ON(t,e),kN(t,NN)}function NN(){jN=W.onerror,W.onerror=function(e,t,n,r,i){return AN(`error`,{column:r,error:i,line:n,msg:e,url:t}),jN?jN.apply(this,arguments):!1},W.onerror.__SENTRY_INSTRUMENTED__=!0}var PN=null;function FN(e){let t=`unhandledrejection`;ON(t,e),kN(t,IN)}function IN(){PN=W.onunhandledrejection,W.onunhandledrejection=function(e){return AN(`unhandledrejection`,e),!PN||PN.apply(this,arguments)},W.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var LN=Object.prototype.toString;function RN(e){switch(LN.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object WebAssembly.Exception]`:return!0;default:return ZN(e,Error)}}function zN(e,t){return LN.call(e)===`[object ${t}]`}function BN(e){return zN(e,`ErrorEvent`)}function VN(e){return zN(e,`DOMError`)}function HN(e){return zN(e,`DOMException`)}function UN(e){return zN(e,`String`)}function WN(e){return typeof e==`object`&&!!e&&`__sentry_template_string__`in e&&`__sentry_template_values__`in e}function GN(e){return e===null||WN(e)||typeof e!=`object`&&typeof e!=`function`}function KN(e){return zN(e,`Object`)}function qN(e){return typeof e==`object`&&!!e}function JN(e){return typeof Event<`u`&&ZN(e,Event)}function YN(e){return zN(e,`RegExp`)}function XN(e){return!!(e?.then&&typeof e.then==`function`)}function ZN(e,t){try{return e instanceof t}catch{return!1}}function QN(e){return typeof Request<`u`&&ZN(e,Request)}function $N(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!=`function`)return;let i=n(r);typeof i==`function`&&tP(i,r);try{e[t]=i}catch{U&&G.log(`Failed to replace method "${t}" in object`,e)}}function eP(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{U&&G.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function tP(e,t){try{e.prototype=t.prototype=t.prototype||{},eP(e,`__sentry_original__`,t)}catch{}}function nP(e){return e.__sentry_original__}function rP(e){if(RN(e))return{message:e.message,name:e.name,stack:e.stack,...iP(e)};if(JN(e)){let{type:t,target:n,currentTarget:r,detail:i}=e;return{type:t,target:n,currentTarget:r,...i?{detail:i}:{},...iP(e)}}return e}function iP(e){return qN(e)?Object.fromEntries(Object.entries(e)):{}}function aP(e){let t=Object.keys(rP(e));return t.sort(),t[0]?t.join(`, `):`[object has no keys]`}var oP;function sP(e){if(oP!==void 0)return oP?oP(e):e();let t=Symbol.for(`__SENTRY_SAFE_RANDOM_ID_WRAPPER__`),n=W;return t in n&&typeof n[t]==`function`?(oP=n[t],oP(e)):(oP=null,e())}function cP(){return sP(()=>Math.random())}function lP(){return sP(()=>Date.now())}var uP=Symbol.for(`sentry.skipNormalization`),dP=Symbol.for(`sentry.overrideNormalizationDepth`);function fP(e){eP(e,uP,!0)}function pP(e){return!!e[uP]}function mP(e){let t=e[dP];return typeof t==`number`?t:void 0}var hP;function gP(e){hP=e}function _P(e,t=100,n=1/0){try{return yP(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function vP(e,t=3,n=102400){let r=_P(e,t);return CP(r)>n?vP(e,t-1,n):r}function yP(e,t,n=1/0,r=1/0,i=wP()){let[a,o]=i;if(t==null||[`boolean`,`string`].includes(typeof t)||typeof t==`number`&&Number.isFinite(t))return t;let s=bP(e,t);if(!s.startsWith(`[object `))return s;if(pP(t))return t;let c=mP(t),l=c===void 0?n:c;if(l===0)return s.replace(`object `,``);if(a(t))return`[Circular ~]`;let u=t;if(u&&typeof u.toJSON==`function`)try{return yP(``,u.toJSON(),l-1,r,i)}catch{}let d=Array.isArray(t)?[]:{},f=0,p=rP(t);for(let e in p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;if(f>=r){d[e]=`[MaxProperties ~]`;break}let t=p[e];d[e]=yP(e,t,l-1,r,i),f++}return o(t),d}function bP(e,t){try{if(hP){let e=hP(t);if(e)return e}return typeof global<`u`&&t===global?`[Global]`:typeof t==`number`&&!Number.isFinite(t)?`[${t}]`:typeof t==`function`?`[Function: ${CN(t)}]`:typeof t==`symbol`?`[${String(t)}]`:typeof t==`bigint`?`[BigInt: ${String(t)}]`:`[object ${xP(t)}]`}catch(e){return`**non-serializable** (${e})`}}function xP(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function SP(e){return~-encodeURI(e).split(/%..|./).length}function CP(e){return SP(JSON.stringify(e))}function wP(){let e=new WeakSet;function t(t){return e.has(t)?!0:(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}function TP(e,t=`[unserializable]`){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return typeof t==`function`?t(e):t}}function EP(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function DP(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let i=Math.max(t-60,0);i<5&&(i=0);let a=Math.min(i+140,r);return a>r-5&&(a=r),a===r&&(i=Math.max(a-140,0)),n=n.slice(i,a),i>0&&(n=`'{snip} ${n}`),a<r&&(n+=` {snip}`),n}function OP(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];GN(r)?n.push(String(r)):r instanceof Error?n.push(r.message?`${r.name}: ${r.message}`:r.name):n.push(bP(void 0,r))}return n.join(t)}function kP(e,t,n=!1){return UN(e)?YN(t)?t.test(e):UN(t)?n?e===t:e.includes(t):typeof t==`function`&&t(e):!1}function AP(e,t=[],n=!1){for(let r of t)if(kP(e,r,n))return!0;return!1}function jP(){let e=W;return e.crypto||e.msCrypto}var MP;function NP(){return cP()*16}function PP(e=jP()){try{if(e?.randomUUID)return sP(()=>e.randomUUID()).replace(/-/g,``)}catch{}return MP||=`10000000100040008000100000000000`,MP.replace(/[018]/g,e=>(e^(NP()&15)>>e/4).toString(16))}function FP(e){return e.exception?.values?.[0]}function IP(e){let{message:t,event_id:n}=e;if(t)return t;let r=FP(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function LP(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||=t||``,a.type||=n||`Error`}function RP(e,t){let n=FP(e);if(!n)return;let r={type:`generic`,handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&`data`in t){let e={...i?.data,...t.data};n.mechanism.data=e}}function zP(e,t,n=5){if(t.lineno===void 0)return;let r=e.length,i=Math.max(Math.min(r-1,t.lineno-1),0);t.pre_context=e.slice(Math.max(0,i-n),i).map(e=>DP(e,0)),t.context_line=DP(e[Math.min(r-1,i)],t.colno||0),t.post_context=e.slice(Math.min(i+1,r),i+1+n).map(e=>DP(e,0))}function BP(e){if(VP(e))return!0;try{eP(e,`__sentry_captured__`,!0)}catch{}return!1}function VP(e){try{return e.__sentry_captured__}catch{}}var HP=1e3;function UP(){return lP()/HP}function WP(){let{performance:e}=W;if(!e?.now||!e.timeOrigin)return UP;let t=e.timeOrigin;return()=>(t+sP(()=>e.now()))/HP}var GP;function KP(){return(GP??=WP())()}var qP=null;function JP(){let{performance:e}=W;if(!e?.now)return;let t=3e5,n=sP(()=>e.now()),r=lP(),i=e.timeOrigin;if(typeof i==`number`&&Math.abs(i+n-r)<t)return i;let a=e.timing?.navigationStart;return typeof a==`number`&&Math.abs(a+n-r)<t?a:r-n}function YP(){return qP===null&&(qP=JP()),qP}function XP(e){let t=KP(),n={sid:PP(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>$P(n)};return e&&ZP(n,e),n}function ZP(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||KP(),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:PP()),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{let t=e.timestamp-e.started;e.duration=t>=0?t: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 QP(e,t){let n={};t?n={status:t}:e.status===`ok`&&(n={status:`exited`}),ZP(e,n)}function $P(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 eF(e,t,n=2){if(!t||typeof t!=`object`||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=eF(r[e],t[e],n-1));return r}function tF(){return PP()}function nF(){return PP().substring(16)}function rF(e){try{let t=W.WeakRef;if(typeof t==`function`)return new t(e)}catch{}return e}function iF(e){if(e){if(typeof e==`object`&&`deref`in e&&typeof e.deref==`function`)try{return e.deref()}catch{return}return e}}var aF=`_sentrySpan`;function oF(e,t){t?eP(e,aF,rF(t)):delete e[aF]}function sF(e){return iF(e[aF])}var cF=100,lF=class e{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:tF(),sampleRand:cP()}}clone(){let t=new e;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,oF(t,sF(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&ZP(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t==`function`?t(this):t,{tags:r,attributes:i,extra:a,user:o,contexts:s,level:c,fingerprint:l=[],propagationContext:u,conversationId:d}=(n instanceof e?n.getScopeData():KN(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),d&&(this._conversationId=d),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,oF(this,void 0),this._attachments=[],this.setPropagationContext({traceId:tF(),sampleRand:cP()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:cF;if(n<=0)return this;let r={timestamp:UP(),...e,message:e.message?EP(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),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(e){return this._attachments.push(e),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:sF(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=eF(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t?.event_id||PP();if(!this._client)return U&&G.warn(`No client configured on scope - will not capture exception!`),n;let r=Error(`Sentry syntheticException`);return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){let r=n?.event_id||PP();if(!this._client)return U&&G.warn(`No client configured on scope - will not capture message!`),r;let i=n?.syntheticException??Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){let n=e.event_id||t?.event_id||PP();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(U&&G.warn(`No client configured on scope - will not capture event!`),n)}_notifyScopeListeners(){this._notifyingListeners||=(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),!1)}};function uF(){return nN(`defaultCurrentScope`,()=>new lF)}function dF(){return nN(`defaultIsolationScope`,()=>new lF)}var fF=e=>e instanceof Promise&&!e[pF],pF=Symbol(`chained PromiseLike`),mF=(e,t,n)=>{let r=e.then(e=>(t(e),e),e=>{throw n(e),e});return fF(r)&&fF(e)?r:hF(e,r)},hF=(e,t)=>{if(!t)return e;let n=!1;for(let r in e){if(r in t)continue;n=!0;let i=e[r];typeof i==`function`?Object.defineProperty(t,r,{value:(...t)=>i.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=i}return n&&Object.assign(t,{[pF]:!0}),t},gF=class{constructor(e,t){let n;n=e||new lF;let r;r=t||new lF,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){let t=this._pushScope(),n;try{n=e(t)}catch(e){throw this._popScope(),e}return XN(n)?mF(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function _F(){let e=tN(eN());return e.stack=e.stack||new gF(uF(),dF())}function vF(e){return _F().withScope(e)}function yF(e,t){let n=_F();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function bF(e){return _F().withScope(()=>e(_F().getIsolationScope()))}function xF(){return{withIsolationScope:bF,withScope:vF,withSetScope:yF,withSetIsolationScope:(e,t)=>bF(t),getCurrentScope:()=>_F().getScope(),getIsolationScope:()=>_F().getIsolationScope()}}function SF(e){let t=tN(e);return t.acs?t.acs:xF()}function CF(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.keys(e).includes(`value`)}function wF(e,t){let{value:n,unit:r}=CF(e)?e:{value:e,unit:void 0},i=OF(n),a=r&&typeof r==`string`?{unit:r}:{};if(i)return{...i,...a};if(!t||t===`skip-undefined`&&n===void 0)return;let o=``;try{o=JSON.stringify(n)??``}catch{}return{value:o,type:`string`,...a}}function TF(e,t=!1){let n={};for(let[r,i]of Object.entries(e??{})){let e=wF(i,t);e&&(n[r]=e)}return n}function EF(e){if(!e)return 0;let t=0;for(let[n,r]of Object.entries(e)){t+=n.length*2,t+=r.type.length*2,t+=(r.unit?.length??0)*2;let e=r.value;Array.isArray(e)?t+=DF(e[0])*e.length:GN(e)?t+=DF(e):t+=100}return t}function DF(e){return typeof e==`string`?e.length*2:typeof e==`boolean`?4:typeof e==`number`?8:0}function OF(e){if(Array.isArray(e))return{value:e,type:`array`};let 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}}var kF;function AF(){return kF?.()}function jF(){return kF!==void 0}function K(){return SF(eN()).getCurrentScope()}function MF(){return SF(eN()).getIsolationScope()}function NF(){return nN(`globalScope`,()=>new lF)}function PF(...e){let t=SF(eN());if(e.length===2){let[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}return t.withScope(e[0])}function FF(...e){let t=SF(eN());if(e.length===2){let[n,r]=e;return n?t.withSetIsolationScope(n,r):t.withIsolationScope(r)}return t.withIsolationScope(e[0])}function q(){return K().getClient()}function IF(e){let t=AF();if(t)return{trace_id:t.traceId,span_id:t.spanId};let{traceId:n,parentSpanId:r,propagationSpanId:i}=e.getPropagationContext(),a={trace_id:n,span_id:i||nF()};return r&&(a.parent_span_id=r),a}var LF=`sentry.source`,RF=`sentry.sample_rate`,zF=`sentry.previous_trace_sample_rate`,BF=`sentry.op`,VF=`sentry.origin`,HF=`sentry.idle_span_finish_reason`,UF=`sentry.measurement_unit`,WF=`sentry.measurement_value`,GF=`sentry.release`,KF=`sentry.environment`,qF=`sentry.sdk.integrations`,JF=`user.id`,YF=`user.email`,XF=`user.ip_address`,ZF=`user.name`,QF=`sentry.custom_span_name`,$F=`sentry.profile_id`,eI=`sentry.exclusive_time`,tI=`url.full`,nI=`sentry.link.type`,rI=`gen_ai.conversation.id`;function iI(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:`unauthenticated`};case 403:return{code:2,message:`permission_denied`};case 404:return{code:2,message:`not_found`};case 409:return{code:2,message:`already_exists`};case 413:return{code:2,message:`failed_precondition`};case 429:return{code:2,message:`resource_exhausted`};case 499:return{code:2,message:`cancelled`};default:return{code:2,message:`invalid_argument`}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:`unimplemented`};case 503:return{code:2,message:`unavailable`};case 504:return{code:2,message:`deadline_exceeded`};default:return{code:2,message:`internal_error`}}return{code:2,message:`internal_error`}}function aI(e,t){e.setAttribute(`http.response.status_code`,t);let n=iI(t);n.message!==`unknown_error`&&e.setStatus(n)}var oI=`_sentryScope`,sI=`_sentryIsolationScope`,cI=Symbol.for(`sentry.otelSourceInference`),lI=Symbol.for(`sentry.otelSourceExplicitlySet`),uI=Symbol.for(`sentry.tracerProviderSpan`);function dI(e,t,n){e&&(eP(e,sI,rF(n)),eP(e,oI,t))}function fI(e){let t=e;return{scope:t[oI],isolationScope:iF(t[sI])}}function pI(e){return e[cI]===!0}function mI(e){eP(e,lI,!0)}function hI(e){return e[uI]===!0}var gI=`sentry-`;function _I(e){let t=yI(e);if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith(`sentry-`)){let r=t.slice(7);e[r]=n}return e},{});if(Object.keys(n).length>0)return n}function vI(e){if(e)return xI(Object.entries(e).reduce((e,[t,n])=>(n&&(e[`${gI}${t}`]=n),e),{}))}function yI(e){if(!(!e||!UN(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{let n=bI(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):bI(e)}function bI(e){return e.split(`,`).map(e=>{let t=e.indexOf(`=`);return t===-1?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}function xI(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((e,[t,n],r)=>{let i=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,a=r===0?i:`${e},${i}`;return a.length>8192?(U&&G.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},``)}var SI=/^o(\d+)\./,CI=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function wI(e){return e===`http`||e===`https`}function TI(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function EI(e){let t=CI.exec(e);if(!t){oN(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i=``,a=``,o=``,s=``]=t.slice(1),c=``,l=s,u=l.split(`/`);if(u.length>1&&(c=u.slice(0,-1).join(`/`),l=u.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return DI({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function DI(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function OI(e){if(!U)return!0;let{port:t,projectId:n,protocol:r}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>!e[t]&&(G.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:n.match(/^\d+$/)?wI(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 kI(e){return e.match(SI)?.[1]}function AI(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=kI(n)),r}function jI(e){let t=typeof e==`string`?EI(e):DI(e);if(!(!t||!OI(t)))return t}function MI(e){if(typeof e==`boolean`)return Number(e);let t=typeof e==`string`?parseFloat(e):e;if(!(typeof t!=`number`||isNaN(t)||t<0||t>1))return t}var NI=RegExp(`^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$`);function PI(e){if(!e)return;let t=e.match(NI);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 FI(e,t){let n=PI(e),r=_I(t);if(!n?.traceId)return{traceId:tF(),sampleRand:cP()};let i=RI(n,r);r&&(r.sample_rand=i.toString());let{traceId:a,parentSpanId:o,parentSampled:s}=n;return{traceId:a,parentSpanId:o,sampled:s,dsc:r||{},sampleRand:i}}function II(e=tF(),t=nF(),n){let r=``;return n!==void 0&&(r=n?`-1`:`-0`),`${e}-${t}${r}`}function LI(e=tF(),t=nF(),n){return`00-${e}-${t}-${n?`01`:`00`}`}function RI(e,t){let n=MI(t?.sample_rand);if(n!==void 0)return n;let r=MI(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?cP()*r:r+cP()*(1-r):cP()}function zI(e,t){let n=AI(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&&(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}var BI=!1;function VI(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:a,status:o,origin:s,links:c}=YI(e);return{parent_span_id:a,span_id:t,trace_id:n,data:r,op:i,status:o,origin:s,links:c}}function HI(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:YI(e).parent_span_id,a=fI(e).scope;return{parent_span_id:i,span_id:r?a?.getPropagationContext().propagationSpanId||nF():t,trace_id:n}}function UI(e){let{traceId:t,spanId:n}=e.spanContext();return II(t,n,tL(e))}function WI(e){let{traceId:t,spanId:n}=e.spanContext();return LI(t,n,tL(e))}function GI(e){if(e&&e.length>0)return e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:i})=>({span_id:e,trace_id:t,sampled:n===1,attributes:i,...r}))}function KI(e){if(e?.length)return e.map(({context:{spanId:e,traceId:t,traceFlags:n},attributes:r})=>({span_id:e,trace_id:t,sampled:n===1,attributes:r}))}function qI(e){return typeof e==`number`?JI(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?JI(e.getTime()):KP()}function JI(e){return e>9999999999?e/1e3:e}function YI(e){if(eL(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if($I(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{span_id:t,trace_id:n,data:r,description:a,parent_span_id:ZI(e),start_timestamp:qI(i),timestamp:qI(o)||void 0,status:nL(s),op:r[BF],origin:r[VF],links:GI(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function XI(e){if(eL(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if($I(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{name:a,span_id:t,trace_id:n,parent_span_id:ZI(e),start_timestamp:qI(i),end_timestamp:qI(o),is_segment:e===dL(e),status:rL(s),attributes:iL(r,s),links:KI(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:``,end_timestamp:0,status:`ok`,is_segment:e===dL(e)}}function ZI(e){return`parentSpanId`in e?e.parentSpanId:`parentSpanContext`in e?e.parentSpanContext?.spanId:void 0}function QI(e){return{...e,attributes:TF(e.attributes),links:e.links?.map(e=>({...e,attributes:TF(e.attributes)}))}}function $I(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function eL(e){return typeof e.getSpanJSON==`function`}function tL(e){let{traceFlags:t}=e.spanContext();return t===1}function nL(e){if(!(!e||e.code===0))return e.code===1?`ok`:e.message||`internal_error`}function rL(e){return!e||e.code===1||e.code===0||e.message===`cancelled`?`ok`:`error`}function iL(e,t){let n=rL(t)===`error`?t?.message:void 0;return{...n&&{"sentry.status.message":n},...e}}var aL=`_sentryChildSpans`,oL=`_sentryRootSpan`;function sL(e,t){eP(t,oL,e[oL]||e),e[aL]?e[aL].add(t):eP(e,aL,new Set([t]))}function cL(e,t){e[aL]&&e[aL].delete(t)}function lL(e){let t=new Set;function n(e){if(!t.has(e)&&tL(e)){t.add(e);let r=e[aL]?Array.from(e[aL]):[];for(let e of r)n(e)}}return n(e),Array.from(t)}var uL=dL;function dL(e){return e[oL]||e}function fL(){let e=SF(eN());return e.getActiveSpan?e.getActiveSpan():sF(K())}function pL(){BI||=(oN(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),!0)}function mL(e,t){e.updateName(t),e.setAttributes({[LF]:`custom`,[QF]:t})}var hL=!1;function gL(){if(hL)return;function e(){let e=fL(),t=e&&uL(e);if(t){let e=`internal_error`;U&&G.log(`[Tracing] Root span: ${e} -> Global error occurred`),t.setStatus({code:2,message:e})}}hL=!0,MN(e),FN(e)}function _L(e){if(typeof __SENTRY_TRACING__==`boolean`&&!__SENTRY_TRACING__)return!1;let t=e||q()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function vL(e){G.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function yL(e,t){if(!t?.length)return!1;for(let n of t){if(SL(n)){if(e.description&&kP(e.description,n))return U&&vL(e),!0;continue}let t=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!t)continue;let r=!n.name||e.description&&kP(e.description,n.name),i=!n.op||e.op&&kP(e.op,n.op),a=!n.attributes||Object.entries(n.attributes).every(([t,n])=>bL(e.attributes?.[t],n));if(r&&i&&a)return U&&vL(e),!0}return!1}function bL(e,t){return typeof e==`string`&&(typeof t==`string`||t instanceof RegExp)?kP(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}function xL(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function SL(e){return typeof e==`string`||e instanceof RegExp}var CL=Symbol.for(`sentry.nonRecordingSpan`),wL=class{constructor(e={}){this._traceId=e.traceId||tF(),this._spanId=e.spanId||nF(),this.dropReason=e.dropReason,eP(this,CL,!0)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}};function TL(e){return!!e&&e[CL]===!0}var EL=`production`,DL=`_frozenDsc`;function OL(e,t){eP(e,DL,t)}function kL(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||`production`,release:n.release,public_key:r,trace_id:e,org_id:AI(t)};return t.emit(`createDsc`,i),i}function AL(e,t){let n=t.getPropagationContext();return n.dsc||kL(n.traceId,e)}function jL(e){let t=q();if(!t)return{};let n=uL(e),r=YI(n),i=r.data,a=n.spanContext().traceState,o=a?.get(`sentry.sample_rate`)??i[`sentry.sample_rate`]??i[`sentry.previous_trace_sample_rate`];function s(e){return(typeof o==`number`||typeof o==`string`)&&(e.sample_rate=`${o}`),e}let c=n[DL];if(c)return s(c);let l=TL(n),u=l&&n.dropReason===`ignored`;if(l&&(!_L(t.getOptions())||u)){let e=fI(n).scope;if(e){let n={...AL(t,e)};return u&&(n.sampled=`false`),s(n)}}let d=a?.get(`sentry.dsc`),f=d&&_I(d);if(f)return s(f);let p=kL(e.spanContext().traceId,t),m=i[`sentry.source`]??i[`sentry.segment.name.source`],h=r.description;return m!==`url`&&h&&(p.transaction=h),_L()&&(p.sampled=String(tL(n)),p.sample_rand=a?.get(`sentry.sample_rand`)??fI(n).scope?.getPropagationContext().sampleRand.toString()),s(p),t.emit(`createDsc`,p,n),p}function ML(e){return vI(jL(e))}function NL(e){return eP(e,`_streamed`,!0),e}function PL(e){return!!e&&typeof e==`function`&&`_streamed`in e&&!!e._streamed}function FL(e,t=[]){return[e,t]}function IL(e,t){let[n,r]=e;return[n,[...r,t]]}function LL(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function RL(e,t){return LL(e,(e,n)=>t.includes(n))}function zL(e){let t=tN(W);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function BL(e){let[t,n]=e,r=JSON.stringify(t);function i(e){typeof r==`string`?r=typeof e==`string`?r+e:[zL(r),e]:r.push(typeof e==`string`?zL(e):e)}for(let e of n){let[t,n]=e;if(i(`
|
|
507
|
+
${JSON.stringify(t)}
|
|
508
|
+
`),typeof n==`string`||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(_P(n))}i(e)}}return typeof r==`string`?r:VL(r)}function VL(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function HL(e){return[{type:`span`},e]}function UL(e){let t=typeof e.data==`string`?zL(e.data):e.data;return[{type:`attachment`,length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var WL={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 GL(e){return e in WL}function KL(e){return GL(e)?WL[e]:e}function qL(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function JL(e,t,n,r){let i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date(lP()).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:TI(r)},...i&&{trace:i}}}function YL(e,t){if(!t)return e;let 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 XL(e,t,n,r){let i=qL(n);return FL({sent_at:new Date(lP()).toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:TI(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function ZL(e,t,n,r){let i=qL(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;YL(e,n?.sdk);let o=JL(e,i,r,t);return delete e.sdkProcessingMetadata,FL(o,[[{type:a},e]])}function QL(e,t){function n(e){return!!e.trace_id&&!!e.public_key}let r=jL(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,o={sent_at:new Date(lP()).toISOString(),...n(r)&&{trace:r},...!!a&&i&&{dsn:TI(i)}},{beforeSendSpan:s,ignoreSpans:c}=t?.getOptions()||{},l=c?.length?e.filter(e=>{let t=YI(e);return!yL({description:t.description,op:t.op,attributes:t.data},c)}):e,u=e.length-l.length;u&&t?.recordDroppedEvent(`before_send`,`span`,u);let d=s?e=>{let t=YI(e);return(PL(s)?t:s(t))||(pL(),t)}:YI,f=[];for(let e of l){let t=d(e);t&&f.push(HL(t))}return FL(o,f)}function $L(e){if(!U)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`,parent_span_id:r}=YI(e),{spanId:i}=e.spanContext(),a=tL(e),o=uL(e),s=o===e,c=`[Tracing] Starting ${a?`sampled`:`unsampled`} ${s?`root `:``}span`,l=[`op: ${n}`,`name: ${t}`,`ID: ${i}`];if(r&&l.push(`parent ID: ${r}`),!s){let{op:e,description:t}=YI(o);l.push(`root ID: ${o.spanContext().spanId}`),e&&l.push(`root op: ${e}`),t&&l.push(`root description: ${t}`)}G.log(`${c}
|
|
509
|
+
${l.join(`
|
|
510
|
+
`)}`)}function eR(e){if(!U)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`}=YI(e),{spanId:r}=e.spanContext(),i=`[Tracing] Finishing "${n}" ${uL(e)===e?`root `:``}span "${t}" with ID ${r}`;G.log(i)}function tR(e,t,n,r=fL()){let i=r&&uL(r);i&&(U&&G.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[WF]:t,[UF]:n}))}function nR(e){if(!e||e.length===0)return;let t={};return e.forEach(e=>{let n=e.attributes||{},r=n[UF],i=n[WF];typeof r==`string`&&typeof i==`number`&&(t[e.name]={value:i,unit:r})}),t}function rR(){return tN(eN()).segmentSpanCaptureStrategy}function iR(e){return e.getOptions().traceLifecycle===`stream`}var aR=1e3,oR=class{constructor(e={}){this._traceId=e.traceId||tF(),this._spanId=e.spanId||nF(),this._startTime=e.startTimestamp||KP(),this._links=e.links,this._attributes={},this.setAttributes({[VF]:`manual`,[BF]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),`sampled`in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._frozen||(this._links?this._links.push(e):this._links=[e]),this}addLinks(e){return this._frozen||(this._links?this._links.push(...e):this._links=e),this}recordException(e,t){}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:+!!n}}setAttribute(e,t){return this._frozen?this:(t===void 0?delete this._attributes[e]:this._attributes[e]=t,e===`sentry.source`&&t!==void 0&&pI(this)&&mI(this),this)}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._frozen||(this._startTime=qI(e))}setStatus(e){return this._frozen||(this._status=e),this}updateName(e){return this._frozen?this:(this._name=e,pI(this)||this.setAttribute(LF,`custom`),this)}end(e){if(this._endTime){this._frozen=hI(this);return}this._endTime=qI(e),eR(this),this._onSpanEnded(),this._frozen=hI(this)}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[BF],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:nL(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[VF],profile_id:this._attributes[$F],exclusive_time:this._attributes[eI],measurements:nR(this._events),is_segment:this._isStandaloneSpan&&uL(this)===this||void 0,segment_id:this._isStandaloneSpan?uL(this).spanContext().spanId:void 0,links:GI(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===uL(this),status:rL(this._status),attributes:iL(this._attributes,this._status),links:KI(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){if(this._frozen)return this;U&&G.log(`[Tracing] Adding an event to span:`,e);let r=sR(t)?t:n||KP(),i=sR(t)?{}:t||{},a={name:e,time:qI(r),attributes:i};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=q();e&&(e.emit(`spanEnd`,this),this._isStandaloneSpan||e.emit(`afterSpanEnd`,this));let t=uL(this),n=this._isStandaloneSpan||this===t;if(this._isStandaloneSpan){this._sampled?uR(QL([this],e)):(U&&G.log(`[Tracing] Discarding standalone span because its trace was not chosen to be sampled.`),e&&e.recordDroppedEvent(`sample_rate`,`span`));return}if(!n){let e=rR();if(e){let n=fI(this).scope||K();e.onChildSpanEnded(this,t,e=>this._convertSpanToTransaction(e),n)}return}if(e&&iR(e)){e.emit(`afterSegmentSpanEnd`,this);return}let r=fI(this).scope||K(),i=rR();if(i)i.onSegmentSpanEnded(e=>this._convertSpanToTransaction(e),r);else{let e=this._convertSpanToTransaction();e&&r.captureEvent(e)}}_convertSpanToTransaction(e={}){if(!cR(YI(this)))return;this._name||=(U&&G.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),`<unlabeled transaction>`);let{scope:t,isolationScope:n}=fI(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;e.onSpanCaptured?.(this);let i=[];for(let t of lL(this)){if(t===this||lR(t)||e.isSpanAlreadyCaptured?.(t))continue;let n=YI(t);cR(n)&&(e.onSpanCaptured?.(t),i.push(n))}let a=this._attributes[LF];delete this._attributes[QF];let o=!1;i.forEach(e=>{delete e.data[QF],e.op?.startsWith(`gen_ai.`)&&(o=!0)});let s={contexts:{trace:VI(this)},spans:i.length>aR?i.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,aR):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:`transaction`,sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:jL(this),hasGenAiSpans:o},request:r,...a&&{transaction_info:{source:a}}},c=nR(this._events);return c&&Object.keys(c).length&&(U&&G.log(`[Measurements] Adding measurements to transaction event`,JSON.stringify(c,void 0,2)),s.measurements=c),s}};function sR(e){return e&&typeof e==`number`||e instanceof Date||Array.isArray(e)}function cR(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function lR(e){return e instanceof oR&&e.isStandaloneSpan()}function uR(e){let t=q();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent(`before_send`,`span`);return}t.sendEnvelope(e)}function dR(e,t,n=()=>{},r=()=>{}){let i;try{i=e()}catch(e){throw t(e),n(),e}return fR(i,t,n,r)}function fR(e,t,n,r){return XN(e)?mF(e,e=>{n(),r(e)},e=>{t(e),n()}):(n(),r(e),e)}function pR(e,t,n){if(!_L(e))return[!1];let r,i;typeof e.tracesSampler==`function`?(i=e.tracesSampler({...t,inheritOrSampleWith:e=>typeof t.parentSampleRate==`number`?t.parentSampleRate:typeof t.parentSampled==`boolean`?Number(t.parentSampled):e}),r=!0):t.parentSampled===void 0?e.tracesSampleRate!==void 0&&(i=e.tracesSampleRate,r=!0):i=t.parentSampled;let a=MI(i);if(a===void 0)return U&&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(i)} of type ${JSON.stringify(typeof i)}.`),[!1];if(!a)return U&&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,a,r];let o=n<a;return o||U&&G.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[o,a,r]}var mR=`__SENTRY_SUPPRESS_TRACING__`;function hR(e,t){let n=DR();if(n.startSpan)return n.startSpan(e,t);let r=ER(e),{forceTransaction:i,parentSpan:a,scope:o}=e,s=o?.clone();return PF(s,()=>jR(a)(()=>{let n=K(),o=AR(n,a),s=q(),c=e.onlyIfParent&&!o?wR(n,s):TR({parentSpan:o,spanArguments:r,forceTransaction:i,scope:n});return(!NR(c)||!o)&&oF(n,c),dR(()=>t(c),()=>{let{status:e}=YI(c);c.isRecording()&&(!e||e===`ok`)&&c.setStatus({code:2,message:`internal_error`})},()=>{c.end()})}))}function gR(e,t){let n=DR();if(n.startSpanManual)return n.startSpanManual(e,t);let r=ER(e),{forceTransaction:i,parentSpan:a,scope:o}=e,s=o?.clone();return PF(s,()=>jR(a)(()=>{let n=K(),o=AR(n,a),s=e.onlyIfParent&&!o?wR(n,q()):TR({parentSpan:o,spanArguments:r,forceTransaction:i,scope:n});return(!NR(s)||!o)&&oF(n,s),dR(()=>t(s,()=>s.end()),()=>{let{status:e}=YI(s);s.isRecording()&&(!e||e===`ok`)&&s.setStatus({code:2,message:`internal_error`})})}))}function _R(e){let t=DR();return t.startInactiveSpan?t.startInactiveSpan(e):vR(e)}function vR(e){let t=ER(e),{forceTransaction:n,parentSpan:r}=e;return(e.scope?t=>PF(e.scope,t):r===void 0?e=>e():e=>bR(r,e))(()=>{let i=K(),a=AR(i,r),o=q();return e.onlyIfParent&&!a?wR(i,o):TR({parentSpan:a,spanArguments:t,forceTransaction:n,scope:i})})}var yR=(e,t)=>{let n=SF(eN());if(n.continueTrace)return n.continueTrace(e,t);let{sentryTrace:r,baggage:i}=e,a=q(),o=_I(i);return a&&!zI(a,o?.org_id)?CR(t):PF(e=>{let n=FI(r,i);return e.setPropagationContext(n),oF(e,void 0),t()})};function bR(e,t){let n=DR();return n.withActiveSpan?n.withActiveSpan(e,t):PF(n=>(oF(n,e||void 0),t(n)))}function xR(e){let t=DR();return t.suppressTracing?t.suppressTracing(e):PF(t=>{t.setSDKProcessingMetadata({[mR]:!0});let n=e();return t.setSDKProcessingMetadata({[mR]:void 0}),n})}function SR(e=K()){let t=DR();return t.isTracingSuppressed?t.isTracingSuppressed(e):e.getScopeData().sdkProcessingMetadata[mR]===!0}function CR(e){let t=DR();return t.startNewTrace?t.startNewTrace(e):PF(t=>(t.setPropagationContext({traceId:tF(),sampleRand:cP()}),U&&G.log(`Starting a new trace with id ${t.getPropagationContext().traceId}`),bR(null,e)))}function wR(e,t){t?.recordDroppedEvent(`no_parent_span`,`span`);let n=new wL({traceId:e.getPropagationContext().traceId});return dI(n,e,MF()),n}function TR({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){let i=MF();if(!_L()){let t={...i.getPropagationContext(),...r.getPropagationContext()},a=new wL({traceId:e?e.spanContext().traceId:t.traceId});return e&&!n&&sL(e,a),dI(a,r,i),a}let a=q();if(MR(a,t)){SR(r)||a?.recordDroppedEvent(`ignored`,`span`);let t=new wL({dropReason:`ignored`,traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});return e&&!n&&sL(e,t),dI(t,r,i),t}let o;if(e&&!n)o=kR(e,r,t,i),sL(e,o);else if(e){let n=jL(e),{traceId:a,spanId:s}=e.spanContext(),c=tL(e);o=OR({traceId:a,parentSpanId:s,...t},r,i,c),OL(o,n)}else{let{traceId:e,dsc:n,parentSpanId:a,sampled:s}={...i.getPropagationContext(),...r.getPropagationContext()};o=OR({traceId:e,parentSpanId:a,...t},r,i,s),n&&OL(o,n)}return $L(o),o}function ER(e){let t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let n={...t};return n.startTimestamp=qI(e.startTime),delete n.startTime,n}return t}function DR(){return SF(eN())}function OR(e,t,n,r){let i=q(),a=i?.getOptions()||{},{name:o=``}=e,s={spanAttributes:{...e.attributes},spanName:o,parentSampled:r};i?.emit(`beforeSampling`,s,{decision:!1});let c=s.parentSampled??r,l=s.spanAttributes,u=t.getPropagationContext(),d=SR(t),[f,p,m]=d?[!1]:pR(a,{name:o,parentSampled:c,attributes:l,normalizedRequest:n.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampleRate:MI(u.dsc?.sample_rate)},u.sampleRand),h=new oR({...e,attributes:{[LF]:`custom`,[RF]:p!==void 0&&m?p:void 0,...l},sampled:f});return!f&&i&&!d&&(U&&G.log(`[Tracing] Discarding root span because its trace was not chosen to be sampled.`),i.recordDroppedEvent(`sample_rate`,iR(i)?`span`:`transaction`)),dI(h,t,n),i&&i.emit(`spanStart`,h),h}function kR(e,t,n,r){let{spanId:i,traceId:a}=e.spanContext(),o=SR(t),s=!o&&tL(e),c=s?new oR({...n,parentSpanId:i,traceId:a,sampled:s}):new wL({traceId:a});sL(e,c),dI(c,t,r);let l=q();return l?(iR(l)&&TL(c)&&(TL(e)&&e.dropReason?(c.dropReason=e.dropReason,l.recordDroppedEvent(e.dropReason,`span`)):o||(c.dropReason=`sample_rate`,l.recordDroppedEvent(`sample_rate`,`span`))),l.emit(`spanStart`,c),n.endTimestamp&&(l.emit(`spanEnd`,c),l.emit(`afterSpanEnd`,c)),c):c}function AR(e,t){if(t)return t;if(t===null)return;let n=sF(e);if(!n)return;let r=q();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?uL(n):n}function jR(e){return e===void 0?e=>e():t=>bR(e,t)}function MR(e,t){let n=e?.getOptions().ignoreSpans;return!e||!iR(e)||!n?.length?!1:yL({description:t.name||``,op:t.attributes?.[`sentry.op`]||t.op,attributes:t.attributes},n)}function NR(e){return TL(e)&&e.dropReason===`ignored`}var PR={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},FR=`heartbeatFailed`,IR=`idleTimeout`,LR=`finalTimeout`,RR=`externalFinish`;function zR(e,t={}){let n=new Map,r=!1,i,a=RR,o=!t.disableAutoFinish,s=[],{idleTimeout:c=PR.idleTimeout,finalTimeout:l=PR.finalTimeout,childSpanTimeout:u=PR.childSpanTimeout,beforeSpanEnd:d,trimIdleSpanEndTimestamp:f=!0}=t,p=q(),m=K();if(!p||!_L()){let e=new wL({traceId:m.getPropagationContext().traceId});return dI(e,m,MF()),e}let h=fL(),g=BR(e);g.end=new Proxy(g.end,{apply(e,t,n){if(d&&d(g),TL(t))return;let[r,...i]=n,a=qI(r||KP()),o=lL(g).filter(e=>e!==g),s=YI(g);if(!o.length||!f)return S(a),Reflect.apply(e,t,[a,...i]);let c=p.getOptions().ignoreSpans,u=o?.reduce((e,t)=>{let n=YI(t);return!n.timestamp||c&&yL({description:n.description,op:n.op,attributes:n.data},c)?e:e?Math.max(e,n.timestamp):n.timestamp},void 0),m=s.start_timestamp,h=Math.min(m?m+l/1e3:1/0,Math.max(m||-1/0,Math.min(a,u||1/0)));return S(h),Reflect.apply(e,t,[h,...i])}});function _(){i&&=(clearTimeout(i),void 0)}function v(e){_(),i=setTimeout(()=>{!r&&n.size===0&&o&&(a=IR,g.end(e))},c)}function y(e){i=setTimeout(()=>{!r&&o&&(a=FR,g.end(e))},u)}function b(e){_(),n.set(e,!0),y(KP()+u/1e3)}function x(e){n.has(e)&&n.delete(e),n.size===0&&v(KP()+c/1e3)}function S(e){r=!0,n.clear(),s.forEach(e=>e()),oF(m,h);let t=YI(g),{start_timestamp:i}=t;if(!i)return;t.data[`sentry.idle_span_finish_reason`]||g.setAttribute(HF,a);let o=t.status;(!o||o===`unknown`)&&g.setStatus({code:1}),G.log(`[Tracing] Idle span "${t.op}" finished`);let u=lL(g).filter(e=>e!==g),d=0;u.forEach(t=>{t.isRecording()&&(t.setStatus({code:2,message:`cancelled`}),t.end(e),U&&G.log(`[Tracing] Cancelling span since span ended early`,JSON.stringify(t,void 0,2)));let{timestamp:n=0,start_timestamp:r=0}=YI(t),i=r<=e,a=(l+c)/1e3,o=n-r<=a;if(U){let e=JSON.stringify(t,void 0,2);i?o||G.log(`[Tracing] Discarding span since it finished after idle span final timeout`,e):G.log(`[Tracing] Discarding span since it happened after idle span was finished`,e)}(!o||!i)&&(cL(g,t),d++)}),d>0&&g.setAttribute(`sentry.idle_span_discarded_spans`,d)}return s.push(p.on(`spanStart`,e=>{r||e===g||YI(e).timestamp||e instanceof oR&&e.isStandaloneSpan()||lL(g).includes(e)&&b(e.spanContext().spanId)})),s.push(p.on(`spanEnd`,e=>{r||x(e.spanContext().spanId)})),s.push(p.on(`idleSpanEnableAutoFinish`,e=>{e===g&&(o=!0,v(),n.size&&y())})),t.disableAutoFinish||v(),setTimeout(()=>{r||(g.setStatus({code:2,message:`deadline_exceeded`}),a=LR,g.end())},l),g}function BR(e){let t=_R(e);return oF(K(),t),U&&G.log(`[Tracing] Started span is an idle span`),t}function VR(e,t,n){let r,i,a,o=n?.maxWait?Math.max(n.maxWait,t):0,s=n?.setTimeoutImpl||setTimeout;function c(){return l(),r=e(),r}function l(){i!==void 0&&clearTimeout(i),a!==void 0&&clearTimeout(a),i=a=void 0}function u(){return i!==void 0||a!==void 0?c():r}function d(){return i&&clearTimeout(i),i=s(c,t),o&&a===void 0&&(a=s(c,o)),r}return d.cancel=l,d.flush=u,d}var HR=[`addListener`,`on`,`once`,`prependListener`,`prependOnceListener`,`addEventListener`],UR=[`removeListener`,`off`,`removeEventListener`],WR=Symbol(`SentryScopeBoundListeners`),GR;function KR(e){return GR!==void 0&&(e===GR||e.listener===GR)}function qR(e,t=K()){let n=e;if(ez(n))return e;$R(n);for(let e of HR)typeof n[e]==`function`&&(n[e]=XR(n,n[e],t));for(let e of UR)typeof n[e]==`function`&&(n[e]=ZR(n,n[e]));return typeof n.removeAllListeners==`function`&&(n.removeAllListeners=QR(n,n.removeAllListeners)),e}function JR(e,t){return function(...n){return PF(t,()=>e.apply(this,n))}}function YR(e){return typeof e==`function`}function XR(e,t,n){return function(...r){let i=r[0],a=r[1],o=r.slice(2);if(!YR(a)||KR(a))return t.apply(this,r);let s=ez(e)||$R(e),c=s.get(i);c||(c=new WeakMap,s.set(i,c));let l=c.get(a);l||(l=JR(a,n),c.set(a,l));let u=GR;GR=l;try{return t.call(this,i,l,...o)}finally{GR=u}}}function ZR(e,t){return function(...n){let r=n[0],i=n[1],a=n.slice(2),o=YR(i)?ez(e)?.get(r)?.get(i):void 0;return o?t.call(this,r,o,...a):t.apply(this,n)}}function QR(e,t){return function(...n){let r=ez(e);if(r)if(n.length===0)$R(e);else{let e=n[0];r.delete(e)}return t.apply(this,n)}}function $R(e){let t=new Map;return e[WR]=t,t}function ez(e){return e[WR]}function tz(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;az(e,t),r&&cz(e,r),lz(e,n),oz(e,i),sz(e,a)}function nz(e,t){let{extra:n,tags:r,attributes:i,user:a,contexts:o,level:s,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:m,span:h}=t;rz(e,`extra`,n),rz(e,`tags`,r),rz(e,`attributes`,i),rz(e,`user`,a),rz(e,`contexts`,o),e.sdkProcessingMetadata=eF(e.sdkProcessingMetadata,c,2),s&&(e.level=s),m&&(e.transactionName=m),h&&(e.span=h),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function rz(e,t,n){e[t]=eF(e[t],n,1)}function iz(e,t){let n=NF().getScopeData();return e&&nz(n,e.getScopeData()),t&&nz(n,t.getScopeData()),n}function az(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),s&&e.type!==`transaction`&&(e.transaction=s)}function oz(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function sz(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function cz(e,t){e.contexts={trace:HI(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:jL(t),...e.sdkProcessingMetadata};let n=YI(uL(t)).description;n&&!e.transaction&&e.type===`transaction`&&(e.transaction=n)}function lz(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 uz(e){let t={},{response:n,profile:r,cloud_resource:i,culture:a,state:o}=e;if(n&&(n.status_code!=null&&(t[`http.response.status_code`]=n.status_code),n.body_size!=null&&(t[`http.response.body.size`]=n.body_size)),r&&(r.profile_id&&(t[`sentry.profile_id`]=r.profile_id),r.profiler_id&&(t[`sentry.profiler_id`]=r.profiler_id)),i)for(let[e,n]of Object.entries(i))n!=null&&(t[e]=n);a&&(a.locale&&(t[`culture.locale`]=a.locale),a.timezone&&(t[`culture.timezone`]=a.timezone)),o?.state&&typeof o.state.type==`string`&&(t[`state.type`]=o.state.type);let s=e.angular;if(s){let e=s.version;(typeof e==`string`||typeof e==`number`)&&(t[`angular.version`]=e)}let c=e.react;if(c){let e=c.version;(typeof e==`string`||typeof e==`number`)&&(t[`react.version`]=e)}return t}function dz(e,t){let n=XI(e),r=dL(e),i=XI(r),{isolationScope:a,scope:o}=fI(e),s=iz(a,o);hz(n,i,t,s);let c=e.kind;t.emit(`preprocessSpan`,n,{spanKind:c}),n.is_segment&&(fz(n,s),mz(n,t),t.emit(`processSegmentSpan`,n)),t.emit(`processSpan`,n);let{beforeSendSpan:l}=t.getOptions(),u=l&&PL(l)?gz(n,l):n,d=u.attributes?.[LF];return n.is_segment&&d&&pz(u,{"sentry.segment.name.source":d}),{...QI(u),_segmentSpan:r}}function fz(e,t){pz(e,uz(t.contexts))}function pz(e,t){let n=e.attributes??={};Object.entries(t).forEach(([e,t])=>{t!=null&&!(e in n)&&(n[e]=t)})}function mz(e,t){let n=t.getIntegrationNames();n.length&&pz(e,{[qF]:n})}function hz(e,t,n,r){let i=n.getSdkMetadata(),{release:a,environment:o}=n.getOptions();pz(e,{[Pc]:`stream`,[Nc]:t.name,[Mc]:t.span_id,[Ac]:i?.sdk?.name,[jc]:i?.sdk?.version,[GF]:a,[KF]:o||`production`,[JF]:r.user?.id,[YF]:r.user?.email,[XF]:r.user?.ip_address,[ZF]:r.user?.username,...r.attributes})}function gz(e,t){return t(e)||(pL(),e)}var _z=0,vz=1,yz=2;function bz(e){return new Sz(t=>{t(e)})}function xz(e){return new Sz((t,n)=>{n(e)})}var Sz=class e{constructor(e){this._state=_z,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(!t)e(n);else try{e(t(n))}catch(e){r(e)}},t=>{if(!n)r(t);else try{e(n(t))}catch(e){r(e)}}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{if(i){n(r);return}e(r)})})}_executeHandlers(){if(this._state===_z)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||=(this._state===vz&&e[1](this._value),this._state===yz&&e[2](this._value),!0)})}_runExecutor(e){let t=(e,t)=>{if(this._state===_z){if(XN(t)){t.then(n,r);return}this._state=e,this._value=t,this._executeHandlers()}},n=e=>{t(vz,e)},r=e=>{t(yz,e)};try{e(n,r)}catch(e){r(e)}}};function Cz(e,t,n,r=0){try{let i=wz(t,n,e,r);return XN(i)?i:bz(i)}catch(e){return xz(e)}}function wz(e,t,n,r){let i=n[r];if(!e||!i)return e;let a=i({...e},t);return U&&a===null&&G.log(`Event processor "${i.id||`?`}" dropped event`),XN(a)?a.then(e=>wz(e,t,n,r+1)):wz(a,t,n,r+1)}var Tz,Ez,Dz,Oz;function kz(e){let t=W._sentryDebugIds,n=W._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(Oz&&r.length===Ez&&i.length===Dz)return Oz;Ez=r.length,Dz=i.length,Oz={},Tz||={};let a=(t,n)=>{for(let r of t){let t=n[r],i=Tz?.[r];if(i&&Oz&&t)Oz[i[0]]=t,Tz&&(Tz[r]=[i[0],t]);else if(t){let n=e(r);for(let e=n.length-1;e>=0;e--){let i=n[e]?.filename;if(i&&Oz&&Tz){Oz[i]=t,Tz[r]=[i,t];break}}}}};return t&&a(r,t),n&&a(i,n),Oz}function Az(e,t){let n=kz(e);if(!n)return[];let r=[];for(let e of t){let t=TN(e);t&&n[t]&&r.push({type:`sourcemap`,code_file:e,debug_id:n[t]})}return r}function jz(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||PP(),timestamp:t.timestamp||UP()},l=n.integrations||e.integrations.map(e=>e.name);Mz(c,e),Fz(c,l),i&&i.emit(`applyFrameMetadata`,t),t.type===void 0&&Nz(c,e.stackParser);let u=Lz(r,n.captureContext);n.mechanism&&RP(c,n.mechanism);let d=i?i.getEventProcessors():[],f=iz(a,u),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),tz(c,f);let m=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?bz(c):Cz(m,c,n)).then(e=>(e&&Pz(e),typeof o==`number`&&o>0?Iz(e,o,s):e))}function Mz(e,t){let{environment:n,release:r,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||`production`,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);let o=e.request;o?.url&&a&&(o.url=EP(o.url,a)),a&&e.exception?.values?.forEach(e=>{e.value&&=EP(e.value,a)})}function Nz(e,t){let n=kz(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}function Pz(e){let t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:`sourcemap`,code_file:e,debug_id:t})})}function Fz(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Iz(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:_P(e.data,t,n)}}))},...e.user&&{user:_P(e.user,t,n)},...e.contexts&&{contexts:_P(e.contexts,t,n)},...e.extra&&{extra:_P(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=_P(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:_P(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=_P(e.contexts.flags,3,n)),r}function Lz(e,t){if(!t)return e;let n=e?e.clone():new lF;return n.update(t),n}function Rz(e){if(e)return zz(e)||Vz(e)?{captureContext:e}:e}function zz(e){return e instanceof lF||typeof e==`function`}var Bz=[`user`,`level`,`extra`,`contexts`,`tags`,`fingerprint`,`propagationContext`];function Vz(e){return Object.keys(e).some(e=>Bz.includes(e))}function Hz(e,t){return K().captureException(e,Rz(t))}function Uz(e,t){let n=typeof t==`string`?t:void 0,r=typeof t==`string`?void 0:{captureContext:t};return K().captureMessage(e,n,r)}function Wz(e,t){return K().captureEvent(e,t)}function Gz(e,t){MF().setContext(e,t)}function Kz(e){MF().setExtras(e)}function qz(e,t){MF().setExtra(e,t)}function Jz(e){MF().setTags(e)}function Yz(e,t){MF().setTag(e,t)}function Xz(e){MF().setAttributes(e)}function Zz(e,t){MF().setAttribute(e,t)}function Qz(e){MF().setUser(e)}function $z(e){MF().setConversationId(e)}function eB(){return MF().lastEventId()}function tB(){return!!q()}function nB(){let e=q();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function rB(e){MF().addEventProcessor(e)}function iB(e){let t=MF(),{user:n}=iz(t,K()),{userAgent:r}=W.navigator||{},i=XP({user:n,...r&&{userAgent:r},...e}),a=t.getSession();return a?.status===`ok`&&ZP(a,{status:`exited`}),aB(),t.setSession(i),i}function aB(){let e=MF(),t=K().getSession()||e.getSession();t&&QP(t),oB(),e.setSession()}function oB(){let e=MF(),t=q(),n=e.getSession();n&&t&&t.captureSession(n)}function sB(e=!1){if(e){aB();return}oB()}function cB(e){return typeof e==`object`&&typeof e.unref==`function`&&e.unref(),e}function lB(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function uB(e){return`${lB(e)}${e.projectId}/envelope/`}function dB(e,t){let n={sentry_version:`7`};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function fB(e,t,n){return t||`${uB(e)}?${dB(e,n)}`}function pB(e,t){let n=jI(e);if(!n)return``;let r=`${lB(n)}embed/error-page/`,i=`dsn=${TI(n)}`;for(let e in t)if(e!==`dsn`&&e!==`onClose`)if(e===`user`){let e=t.user;if(!e)continue;e.name&&(i+=`&name=${encodeURIComponent(e.name)}`),e.email&&(i+=`&email=${encodeURIComponent(e.email)}`)}else i+=`&${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`;return`${r}?${i}`}var mB=[];function hB(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}function gB(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n==`function`){let e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return hB(r)}function _B(e,t){let n={};return t.forEach(t=>{t?.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&yB(e,t,n)}),n}function vB(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function yB(e,t,n){if(n[t.name]){U&&G.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!mB.includes(t.name)&&typeof t.setupOnce==`function`&&(t.setupOnce(),mB.push(t.name)),t.setup&&typeof t.setup==`function`&&t.setup(e),typeof t.preprocessEvent==`function`){let n=t.preprocessEvent.bind(t);e.on(`preprocessEvent`,(t,r)=>n(t,r,e))}if(typeof t.processEvent==`function`){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}[`processSpan`,`processSegmentSpan`].forEach(n=>{let r=t[n];typeof r==`function`&&e.on(n,n=>r.call(t,n,e))}),U&&G.log(`Integration installed: ${t.name}`)}function bB(e){let t=q();if(!t){U&&G.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}function xB(e){return e}var SB=`sentry.timestamp.sequence`,CB=0,wB;function TB(e){let t=Math.floor(e*1e3);wB!==void 0&&t!==wB&&(CB=0);let n=CB;return CB++,wB=t,{key:SB,value:{value:n,type:`integer`}}}function EB(e,t){return t?PF(t,()=>{let n=fL(),r=n?HI(n):IF(t);return[n?jL(n):AL(e,t),r]}):[void 0,void 0]}var DB={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function OB(){return typeof __SENTRY_BROWSER_BUNDLE__<`u`&&!!__SENTRY_BROWSER_BUNDLE__}function kB(){return`npm`}function AB(){return!OB()&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`}function jB(){return typeof window<`u`&&(!AB()||MB())}function MB(){return W.process?.type===`renderer`}function NB(e,t){let n=t?`auto`:`never`;return[{type:`log`,item_count:e.length,content_type:`application/vnd.sentry.items.log+json`},{version:2,...jB()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function PB(e,t,n,r,i){let a={};return t?.sdk&&(a.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(a.dsn=TI(r)),FL(a,[NB(e,i)])}var FB=100;function IB(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function LB(e,t){let n=VB(),r=BB(e);r===void 0?n.set(e,[t]):r.length>=FB?(zB(e,r),n.set(e,[t])):n.set(e,[...r,t])}function RB(e,t=K(),n=LB){let r=t?.getClient()??q();if(!r){U&&G.warn(`No client available to capture log.`);return}let{release:i,environment:a,enableLogs:o=!1,beforeSendLog:s}=r.getOptions();if(!o){U&&G.warn(`logging option not enabled, log will not be captured.`);return}let[,c]=EB(r,t),l={...e.attributes},{user:{id:u,email:d,username:f},attributes:p={}}=iz(MF(),t);IB(l,`user.id`,u,!1),IB(l,`user.email`,d,!1),IB(l,`user.name`,f,!1),IB(l,`sentry.release`,i),IB(l,`sentry.environment`,a);let{name:m,version:h}=r.getSdkMetadata()?.sdk??{};IB(l,`sentry.sdk.name`,m),IB(l,`sentry.sdk.version`,h);let g=r.getIntegrationByName(`Replay`),_=g?.getReplayId(!0);IB(l,`sentry.replay_id`,_),_&&g?.getRecordingMode()===`buffer`&&IB(l,`sentry._internal.replay_is_buffering`,!0);let v=e.message;if(WN(v)){let{__sentry_template_string__:e,__sentry_template_values__:t=[]}=v;t?.length&&(l[`sentry.message.template`]=e),t.forEach((e,t)=>{l[`sentry.message.parameter.${t}`]=e})}IB(l,`sentry.trace.parent_span_id`,sF(t)?.spanContext().spanId);let y={...e,attributes:l};r.emit(`beforeCaptureLog`,y);let b=s?oN(()=>s(y)):y;if(!b){r.recordDroppedEvent(`before_send`,`log_item`,1),U&&G.warn(`beforeSendLog returned null, log will not be captured.`);return}let{level:x,message:S,attributes:C={},severityNumber:w}=b,T=KP(),ee=TB(T);n(r,{timestamp:T,level:x,body:UB(String(S)),trace_id:c?.trace_id,severity_number:w??DB[x],attributes:HB({...TF(p),...TF(C,!0),[ee.key]:ee.value})}),r.emit(`afterCaptureLog`,b)}function zB(e,t){let n=t??BB(e)??[];if(n.length===0)return;let r=e.getOptions(),i=PB(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);VB().set(e,[]),e.emit(`flushLogs`),e.sendEnvelope(i)}function BB(e){return VB().get(e)}function VB(){return nN(`clientToLogBufferMap`,()=>new WeakMap)}function HB(e){let t={};for(let[n,r]of Object.entries(e)){let e=UB(n);t[e]=r.type===`string`?{...r,value:UB(r.value)}:r}return t}function UB(e){let t=Object(e),n=t.isWellFormed,r=t.toWellFormed;return typeof n==`function`&&typeof r==`function`?n.call(e)?e:r.call(e):e}function WB(e,t){let n=t?`auto`:`never`;return[{type:`trace_metric`,item_count:e.length,content_type:`application/vnd.sentry.items.trace-metric+json`},{version:2,...jB()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function GB(e,t,n,r,i){let a={};return t?.sdk&&(a.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(a.dsn=TI(r)),FL(a,[WB(e,i)])}var KB=1e3;function qB(e,t,n,r=!0){n&&(r||!(t in e))&&(e[t]=n)}function JB(e,t){let n=eV(),r=$B(e);r===void 0?n.set(e,[t]):r.length>=KB?(QB(e,r),n.set(e,[t])):n.set(e,[...r,t])}function YB(e,t,n){let{release:r,environment:i}=t.getOptions(),a={...e.attributes};qB(a,`user.id`,n.id,!1),qB(a,`user.email`,n.email,!1),qB(a,`user.name`,n.username,!1),qB(a,`sentry.release`,r),qB(a,`sentry.environment`,i);let{name:o,version:s}=t.getSdkMetadata()?.sdk??{};qB(a,`sentry.sdk.name`,o),qB(a,`sentry.sdk.version`,s);let c=t.getIntegrationByName(`Replay`),l=c?.getReplayId(!0);return qB(a,`sentry.replay_id`,l),l&&c?.getRecordingMode()===`buffer`&&qB(a,`sentry._internal.replay_is_buffering`,!0),{...e,attributes:a}}function XB(e,t,n,r){let[,i]=EB(t,n),a=sF(n),o=a?a.spanContext().traceId:i?.trace_id,s=a?a.spanContext().spanId:void 0,c=KP(),l=TB(c);return{timestamp:c,trace_id:o??``,span_id:s,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...TF(r),...TF(e.attributes,`skip-undefined`),[l.key]:l.value}}}function ZB(e,t){let n=t?.scope??K(),r=t?.captureSerializedMetric??JB,i=n?.getClient()??q();if(!i){U&&G.warn(`No client available to capture metric.`);return}let{_experiments:a,enableMetrics:o,beforeSendMetric:s}=i.getOptions();if(!(o??a?.enableMetrics??!0)){U&&G.warn(`metrics option not enabled, metric will not be captured.`);return}let{user:c,attributes:l}=iz(MF(),n),u=YB(e,i,c);i.emit(`processMetric`,u);let d=s||a?.beforeSendMetric,f=d?d(u):u;if(!f){U&&G.log("`beforeSendMetric` returned `null`, will not send metric.");return}let p=XB(f,i,n,l);U&&G.log(`[Metric]`,p),r(i,p),i.emit(`afterCaptureMetric`,f)}function QB(e,t){let n=t??$B(e)??[];if(n.length===0)return;let r=e.getOptions(),i=GB(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);eV().set(e,[]),e.emit(`flushMetrics`),e.sendEnvelope(i)}function $B(e){return eV().get(e)}function eV(){return nN(`clientToMetricBufferMap`,()=>new WeakMap)}function tV(e){return QI({trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||``,start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:!e.status||e.status===`ok`||e.status===`cancelled`?`ok`:`error`,is_segment:!1,attributes:{...e.data},links:e.links})}function nV(e,t){if(e.type!==`transaction`||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||t.getOptions().streamGenAiSpans===!1||iR(t))return;let n=[],r=[];for(let t of e.spans)t.op?.startsWith(`gen_ai.`)?n.push(tV(t)):r.push(t);if(n.length===0)return;e.spans=r;let i=t.getDataCollectionOptions().userInfo?`auto`:`never`;return[{type:`span`,item_count:n.length,content_type:`application/vnd.sentry.items.span.v2+json`},{version:2,...jB()&&{ingest_settings:{infer_ip:i,infer_user_agent:i}},items:n}]}var rV=Symbol.for(`SentryBufferFullError`);function iV(e=100){let t=new Set;function n(){return t.size<e}function r(e){t.delete(e)}function i(e){if(!n())return xz(rV);let i=e();return t.add(i),i.then(()=>r(i),()=>r(i)),i}function a(e){if(!t.size)return bz(!0);let n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;let r=[n,new Promise(t=>cB(setTimeout(()=>t(!1),e)))];return Promise.race(r)}return{get $(){return Array.from(t)},add:i,drain:a}}var aV=6e4;function oV(e,t=lP()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?aV:r-t}function sV(e,t){return e[t]||e.all||0}function cV(e,t,n=lP()){return sV(e,t)>n}function lV(e,{statusCode:t,headers:n},r=lP()){let i={...e},a=n?.[`x-sentry-rate-limits`],o=n?.[`retry-after`];if(a)for(let e of a.trim().split(`,`)){let[t,n,,,a]=e.split(`:`,5),o=parseInt(t,10),s=(isNaN(o)?60:o)*1e3;if(!n)i.all=r+s;else for(let e of n.split(`;`))e===`metric_bucket`?(!a||a.split(`;`).includes(`custom`))&&(i[e]=r+s):i[e]=r+s}else o?i.all=r+oV(o,r):t===429&&(i.all=r+6e4);return i}function uV(e,t,n=iV(e.bufferSize||64)){let r={},i=e=>n.drain(e);function a(i){let a=[];if(LL(i,(t,n)=>{let i=KL(n);cV(r,i)?e.recordDroppedEvent(`ratelimit_backoff`,i):a.push(t)}),a.length===0)return Promise.resolve({});let o=FL(i[0],a),s=t=>{if(RL(o,[`client_report`])){U&&G.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`);return}LL(o,(n,r)=>{e.recordDroppedEvent(t,KL(r))})};return n.add(()=>t({body:BL(o)}).then(e=>e.statusCode===413?(U&&G.error(`Sentry responded with status code 413. Envelope was discarded due to exceeding size limits.`),s(`send_error`),e):(U&&e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&G.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=lV(r,e),e),e=>{throw s(`network_error`),U&&G.error(`Encountered error running transport request:`,e),e})).then(e=>e,e=>{if(e===rV)return U&&G.error(`Skipped sending event because buffer is full.`),s(`queue_overflow`),Promise.resolve({});throw e})}return{send:a,flush:i}}function dV(e,t,n){let r=[{type:`client_report`},{timestamp:n||UP(),discarded_events:e}];return FL(t?{dsn:t}:{},[r])}function fV(e){let t=[];e.message&&t.push(e.message);try{let 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 pV(e){let{trace_id:t,parent_span_id:n,span_id:r,status:i,origin:a,data:o,op:s}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:s,parent_span_id:n,span_id:r??``,start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??``,origin:a,profile_id:o?.[$F],exclusive_time:o?.[eI],measurements:e.measurements,is_segment:!0}}function mV(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&&{"sentry.profile_id":e.profile_id},...e.exclusive_time&&{"sentry.exclusive_time":e.exclusive_time}}}},measurements:e.measurements}}var hV=`[Filtered]`,gV=[`forwarded`,`-ip`,`remote-`,`via`,`-user`],_V=[`auth`,`token`,`secret`,`session`,`password`,`passwd`,`pwd`,`key`,`jwt`,`bearer`,`sso`,`saml`,`csrf`,`xsrf`,`credentials`,`sid`,`identity`,`set-cookie`,`cookie`],vV=[`.sid`,`sessid`,`remember`,`oidc`,`pkce`,`nonce`,`__secure-`,`__host-`,`awsalb`,`awselb`,`akamai`,`__stripe`,`cognito`,`firebase`,`supabase`,`sb-`,`mfa`,`2fa`];function yV(e){return e===!0?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:[`incomingRequest`,`outgoingRequest`,`incomingResponse`,`outgoingResponse`],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:gV},httpHeaders:{request:{deny:gV},response:{deny:gV}},httpBodies:[],urlQueryParams:{deny:gV},graphQL:{document:!0,variables:!0},genAI:{inputs:!1,outputs:!1},databaseQueryData:!1,stackFrameVariables:!0,frameContextLines:7}}var bV={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:[`incomingRequest`,`outgoingRequest`,`incomingResponse`,`outgoingResponse`],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:5};function xV(e){let t=e.dataCollection==null?yV(e.sendDefaultPii):bV,n=e.dataCollection??{};return{userInfo:n.userInfo??t.userInfo,cookies:n.cookies??t.cookies,httpHeaders:{request:n.httpHeaders?.request??t.httpHeaders.request,response:n.httpHeaders?.response??t.httpHeaders.response},httpBodies:n.httpBodies??t.httpBodies,urlQueryParams:n.urlQueryParams??n.queryParams??t.urlQueryParams,graphQL:{document:n.graphQL?.document??t.graphQL.document,variables:n.graphQL?.variables??t.graphQL.variables},genAI:{inputs:n.genAI?.inputs??t.genAI.inputs,outputs:n.genAI?.outputs??t.genAI.outputs},databaseQueryData:n.databaseQueryData??t.databaseQueryData,stackFrameVariables:n.stackFrameVariables??t.stackFrameVariables,frameContextLines:n.frameContextLines??t.frameContextLines}}var SV=`Not capturing exception because it's already been captured.`,CV=`Discarded session because of missing or non-string release`,wV=Symbol.for(`SentryInternalError`),TV=Symbol.for(`SentryDoNotSendEventError`),EV=5e3;function DV(e){return{message:e,[wV]:!0}}function OV(e){return{message:e,[TV]:!0}}function kV(e){return qN(e)&&wV in e}function AV(e){return qN(e)&&TV in e}function jV(e,t,n,r,i){let a=0,o,s=!1;e.on(n,()=>{a=0,clearTimeout(o),s=!1}),e.on(t,t=>{if(a+=r(t),a>=8e5)i(e);else if(!s){let t=e.getOptions()._flushInterval??EV;t>0&&(s=!0,o=cB(setTimeout(()=>{i(e)},t)))}}),e.on(`flush`,()=>{i(e)})}var MV=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=iV(e.transportOptions?.bufferSize??64),this._dataCollection=xV(e),e.dsn?this._dsn=jI(e.dsn):U&&G.warn(`No DSN provided, client will not send events.`),this._dsn){let t=fB(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&jV(this,`afterCaptureLog`,`flushLogs`,zV,zB),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&jV(this,`afterCaptureMetric`,`flushMetrics`,RV,QB)}captureException(e,t,n){let r=PP();if(BP(e))return U&&G.log(SV),r;let i={event_id:r,...t};return this._process(()=>this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n)).then(e=>e),`error`),i.event_id}captureMessage(e,t,n,r){let i={event_id:PP(),...n},a=WN(e)?e:String(e),o=GN(e),s=o?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process(()=>s.then(e=>this._captureEvent(e,i,r)),o?`unknown`:`error`),i.event_id}captureEvent(e,t,n){let r=PP();if(t?.originalException&&BP(t.originalException))return U&&G.log(SV),r;let i={event_id:r,...t},a=e.sdkProcessingMetadata||{},o=a.capturedSpanScope,s=a.capturedSpanIsolationScope,c=NV(e.type);return this._process(()=>this._captureEvent(e,i,o||n,s),c),i.event_id}captureSession(e){this.sendSession(e),ZP(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){let t=this._transport;if(this.emit(`flush`),!t)return!0;let n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){let t=await this.flush(e);return this.getOptions().enabled=!1,this.emit(`close`),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith(`Spotlight`)))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(e){let t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),yB(this,e,this._integrations),t||vB(this,[e])}sendEvent(e,t={}){this.emit(`beforeSendEvent`,e,t);let n=nV(e,this),r=ZL(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])r=IL(r,UL(e));n&&(r=IL(r,n)),this.sendEnvelope(r).then(t=>this.emit(`afterSendEvent`,e,t))}sendSession(e){let{release:t,environment:n=EL}=this._options;if(`aggregates`in e){let r=e.attrs||{};if(!r.release&&!t){U&&G.warn(CV);return}r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t){U&&G.warn(CV);return}e.release=e.release||t,e.environment=e.environment||n}this.emit(`beforeSendSession`,e);let r=XL(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){let r=`${e}:${t}`;U&&G.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:``}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){let n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return U&&G.error(`Error while sending envelope:`,e),{}}return U&&G.error(`Transport disabled`),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=_B(this,e),vB(this,e)}_updateSessionFromEvent(e,t){let n=t.level===`fatal`,r=!1,i=t.exception?.values;if(i){r=!0,n=!1;for(let e of i)if(e.mechanism?.handled===!1){n=!0;break}}let a=e.status===`ok`;(a&&e.errors===0||a&&n)&&(ZP(e,{...n&&{status:`crashed`},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,n,r){let i=this.getOptions(),a=this.getIntegrationNames();return!t.integrations&&a.length&&(t.integrations=a),this.emit(`preprocessEvent`,e,t),e.type||r.setLastEventId(e.event_id||t.event_id),jz(i,e,t,n,this,r).then(e=>e===null?e:(this.emit(`postprocessEvent`,e,t),e.contexts={trace:{...e.contexts?.trace,...IF(n)},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:AL(this,n),...e.sdkProcessingMetadata},e))}_captureEvent(e,t={},n=K(),r=MF()){return U&&IV(e)&&G.log(`Captured error event \`${fV(e)[0]||`<unknown>`}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{U&&(AV(e)?G.log(e.message):kV(e)?G.warn(e.message):G.warn(e))})}_processEvent(e,t,n,r){let i=this.getOptions(),{sampleRate:a}=i,o=LV(e),s=IV(e),c=`before send for type \`${e.type||`error`}\``,l=a===void 0?void 0:MI(a);if(s&&typeof l==`number`&&cP()>l)return this.recordDroppedEvent(`sample_rate`,`error`),xz(OV(`Discarding event because it's not included in the random sample (sampling rate = ${a})`));let u=NV(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(e===null)throw this.recordDroppedEvent(`event_processor`,u),OV("An event processor returned `null`, will not send event.");return t.data?.__sentry__===!0?e:PV(FV(this,i,e,t),c)}).then(i=>{if(i===null){if(this.recordDroppedEvent(`before_send`,u),o){let t=1+(e.spans||[]).length;this.recordDroppedEvent(`before_send`,`span`,t)}throw OV(`${c} returned \`null\`, will not send event.`)}let a=n.getSession()||r.getSession();if(s&&a&&this._updateSessionFromEvent(a,i),o){let e=(i.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(i.spans?i.spans.length:0);e>0&&this.recordDroppedEvent(`before_send`,`span`,e)}let l=i.transaction_info;return o&&l&&i.transaction!==e.transaction&&(i.transaction_info={...l,source:`custom`}),this.sendEvent(i,t),i}).then(null,e=>{throw AV(e)||kV(e)?e:(this.captureException(e,{mechanism:{handled:!1,type:`internal`},data:{__sentry__:!0},originalException:e}),DV(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
511
|
+
Reason: ${e}`))})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===rV&&this.recordDroppedEvent(`queue_overflow`,t),e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(`:`);return{reason:n,category:r,quantity:t}})}_flushOutcomes(){U&&G.log(`Flushing outcomes...`);let e=this._clearOutcomes();if(e.length===0){U&&G.log(`No outcomes to send`);return}if(!this._dsn){U&&G.log(`No dsn provided, will not send outcomes`);return}U&&G.log(`Sending outcomes:`,e);let t=dV(e,this._options.tunnel&&TI(this._dsn));this.sendEnvelope(t)}};function NV(e){return e===`replay_event`?`replay`:e||`error`}function PV(e,t){let n=`${t} must return \`null\` or a valid event.`;if(XN(e))return e.then(e=>{if(!KN(e)&&e!==null)throw DV(n);return e},e=>{throw DV(`${t} rejected with ${e}`)});if(!KN(e)&&e!==null)throw DV(n);return e}function FV(e,t,n,r){let{beforeSend:i,beforeSendTransaction:a,ignoreSpans:o}=t,s=!PL(t.beforeSendSpan)&&t.beforeSendSpan,c=n;if(IV(c)&&i)return i(c,r);if(LV(c)){if(s||o){let t=pV(c);if(o?.length&&yL({description:t.description,op:t.op,attributes:t.data},o))return null;if(s){let e=s(t);e?c=eF(n,mV(e)):pL()}if(c.spans){let t=[],n=c.spans;for(let e of n){if(o?.length&&yL({description:e.description,op:e.op,attributes:e.data},o)){xL(n,e);continue}if(s){let n=s(e);n?t.push(n):(pL(),t.push(e))}else t.push(e)}let r=c.spans.length-t.length;r&&e.recordDroppedEvent(`before_send`,`span`,r),c.spans=t}}if(a){if(c.spans){let e=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return a(c,r)}}return c}function IV(e){return e.type===void 0}function LV(e){return e.type===`transaction`}function RV(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+BV(e.attributes)}function zV(e){let t=0;return e.message&&(t+=e.message.length*2),t+BV(e.attributes)}function BV(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*VV(e[0]):GN(e)?t+=VV(e):t+=100}),t}function VV(e){return typeof e==`string`?e.length*2:typeof e==`number`?8:typeof e==`boolean`?4:0}function HV(e,t){t.debug===!0&&(U?G.enable():oN(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),K().update(t.initialScope);let n=new e(t);return UV(n),n.init(),n}function UV(e){K().setClient(e)}var WV=`MULTIPLEXED_TRANSPORT_EXTRA_KEY`;function GV(e,t){return t.some(t=>e.includes(t))}function KV(e,t,n){if(t===!1)return{};let r=n==null?_V:[..._V,...n],i={};if(t===!0){for(let t of Object.keys(e))i[t]=GV(t.toLowerCase(),r)?hV:e[t];return i}if(`deny`in t){let n=t.deny.map(e=>e.toLowerCase());for(let t of Object.keys(e)){let a=t.toLowerCase();i[t]=GV(a,r)||n.some(e=>a.includes(e))?hV:e[t]}return i}let a=t.allow.map(e=>e.toLowerCase());for(let t of Object.keys(e)){let n=t.toLowerCase();i[t]=GV(n,r)?hV:a.some(e=>n.includes(e))?e[t]:hV}return i}function qV(e){let t={},n=0;for(;n<e.length;){let r=e.indexOf(`=`,n);if(r===-1)break;let i=e.indexOf(`;`,n);if(i===-1)i=e.length;else if(i<r){n=e.lastIndexOf(`;`,r-1)+1;continue}let a=e.slice(n,r).trim();if(t[a]===void 0){let n=e.slice(r+1,i).trim();n.charCodeAt(0)===34&&(n=n.slice(1,-1));try{t[a]=n.indexOf(`%`)===-1?n:decodeURIComponent(n)}catch{t[a]=n}}n=i+1}return t}function JV(e,t){if(t===!1)return{};try{let n=qV(e);return Object.keys(n).length===0?{}:KV(n,t,vV)}catch{return hV}}var YV=`thismessage:/`;function XV(e){return`isRelative`in e}function ZV(e,t){let n=e.indexOf(`://`)<=0&&e.indexOf(`//`)!==0,r=t??(n?YV:void 0);try{if(`canParse`in URL&&!URL.canParse(e,r))return;let t=new URL(e,r);return n?{isRelative:n,pathname:t.pathname,search:t.search,hash:t.hash}:t}catch{}}function QV(e){if(XV(e))return e.pathname;let t=new URL(e);return t.search=``,t.hash=``,[`80`,`443`].includes(t.port)&&(t.port=``),t.password&&=`%filtered%`,t.username&&=`%filtered%`,t.toString()}function $V(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let 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 eH(e){return e.split(/[?#]/,1)[0]}function tH(e,t=!0){if(e.startsWith(`data:`)){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:`text/plain`,i=e.includes(`;base64,`),a=e.indexOf(`,`),o=``;if(t&&a!==-1){let t=e.slice(a+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${i?`,base64`:``}${o?`,${o}`:``}`}return e}function nH(e,t){let n=t?.getDsn(),r=t?.getOptions().tunnel;return iH(e,n)||rH(e,r)}function rH(e,t){return t?oH(e)===oH(t):!1}function iH(e,t){let n=ZV(e);return!n||XV(n)||!t?!1:aH(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function aH(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function oH(e){return e[e.length-1]===`/`?e.slice(0,-1):e}function sH(e,...t){let 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}var cH=sH;function lH(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 uH(e,t,n=[t],r=`npm`){let i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:$M})),i.version=$M)}function dH(e={}){let t=e.client||q();if(!nB()||!t)return{};let n=SF(eN());if(n.getTraceData)return n.getTraceData(e);let r=e.scope||K(),i=e.span||fL(),a=TL(i)&&!_L(t.getOptions());if(!i&&jF())return{};let o=i&&!a?UI(i):fH(r),s=vI(i?jL(i):AL(t,r));if(!NI.test(o))return G.warn(`Invalid sentry-trace data. Cannot generate trace data`),{};let c={"sentry-trace":o,baggage:s};return e.propagateTraceparent&&(c.traceparent=i&&!a?WI(i):pH(r)),c}function fH(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return II(t,r,n)}function pH(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return LI(t,r,n)}var mH=100;function hH(e,t){let n=q(),r=MF();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=mH}=n.getOptions();if(a<=0)return;let o={timestamp:UP(),...e},s=i?oN(()=>i(o,t)):o;s!==null&&(n.emit&&n.emit(`beforeAddBreadcrumb`,s,t),r.addBreadcrumb(s,a))}var gH=`FunctionToString`,_H=new WeakMap,vH=xB((()=>({name:gH,setupOnce(){let e=Function.prototype.toString;try{Function.prototype.toString=new Proxy(e,{apply(e,t,n){let r=nP(t),i=t;try{_H.has(q())&&r&&(i=r)}catch{}return Reflect.apply(e,i,n)}})}catch{}},setup(e){_H.set(e,!0)}}))),yH=[/^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$/],bH=`EventFilters`,xH=xB((e={})=>{let t;return{name:bH,setup(n){t=CH(e,n.getOptions())},processEvent(n,r,i){return t||=CH(e,i.getOptions()),wH(n,t)?null:n}}}),SH=xB(((e={})=>({...xH(e),name:`InboundFilters`})));function CH(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:yH],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function wH(e,t){if(!e.type){if(TH(e,t.ignoreErrors))return U&&G.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
512
|
+
Event: ${IP(e)}`),!0;if(jH(e))return U&&G.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
513
|
+
Event: ${IP(e)}`),!0;if(DH(e,t.denyUrls))return U&&G.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
514
|
+
Event: ${IP(e)}.
|
|
515
|
+
Url: ${AH(e)}`),!0;if(!OH(e,t.allowUrls))return U&&G.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
516
|
+
Event: ${IP(e)}.
|
|
517
|
+
Url: ${AH(e)}`),!0}else if(e.type===`transaction`&&EH(e,t.ignoreTransactions))return U&&G.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
518
|
+
Event: ${IP(e)}`),!0;return!1}function TH(e,t){return t?.length?fV(e).some(e=>AP(e,t)):!1}function EH(e,t){if(!t?.length)return!1;let n=e.transaction;return n?AP(n,t):!1}function DH(e,t){if(!t?.length)return!1;let n=AH(e);return n?AP(n,t):!1}function OH(e,t){if(!t?.length)return!0;let n=AH(e);return!n||AP(n,t)}function kH(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function AH(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?kH(t):null}catch{return U&&G.error(`Cannot extract url for event ${IP(e)}`),null}}function jH(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function MH(e,t,n,r,i,a){if(!i.exception?.values||!a||!ZN(a.originalException,Error))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=NH(e,t,r,a.originalException,n,i.exception.values,o,0))}function NH(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(ZN(r[i],Error)){FH(o,s,r);let a=e(t,r[i]),l=c.length;IH(a,i,l,s),c=NH(e,t,n,r[i],i,[a,...c],a,l)}return PH(r)&&r.errors.forEach((a,l)=>{if(ZN(a,Error)){FH(o,s,r);let u=e(t,a),d=c.length;IH(u,`errors[${l}]`,d,s),c=NH(e,t,n,a,i,[u,...c],u,d)}}),c}function PH(e){return Array.isArray(e.errors)}function FH(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...PH(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function IH(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function LH(e){return RN(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function RH(e){return LH(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var zH=new Map,BH=new Set;function VH(e){if(W._sentryModuleMetadata)for(let t of Object.keys(W._sentryModuleMetadata)){let n=W._sentryModuleMetadata[t];if(BH.has(t))continue;BH.add(t);let r=e(t);for(let e of r.reverse())if(e.filename){zH.set(e.filename,n);break}}}function HH(e,t){return VH(e),zH.get(t)}function UH(e,t){t.exception?.values?.forEach(t=>{t.stacktrace?.frames?.forEach(t=>{if(!t.filename||t.module_metadata)return;let n=HH(e,t.filename);n&&(t.module_metadata=n)})})}function WH(e){e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{delete e.module_metadata})})}var GH=xB(()=>({name:`ModuleMetadata`,setup(e){e.on(`beforeEnvelope`,e=>{LL(e,(e,t)=>{if(t===`event`){let t=Array.isArray(e)?e[1]:void 0;t&&(WH(t),e[1]=t)}})}),e.on(`applyFrameMetadata`,t=>{if(t.type)return;let n=e.getOptions().stackParser;UH(n,t)})}})),KH=new Set([]);function qH(e){let t=`console`,n=ON(t,e);return kN(t,YH),n}var JH=new Set;function YH(){`console`in W&&rN.forEach(function(e){JH.has(e)||!(e in W.console)||(JH.add(e),$N(W.console,e,function(t){return aN[e]=t,function(...t){let n=t[0],r=aN[e],i=KH.size&&typeof n==`string`&&AP(n,KH);i||AN(`console`,{args:t,level:e}),(!i||U&&G.isEnabled())&&r?.apply(W.console,t)}}))})}function XH(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}var ZH=`CaptureConsole`,QH=xB(((e={})=>{let t=e.levels||rN,n=e.handled??!0;return{name:ZH,setup(e){`console`in W&&qH(({args:r,level:i})=>{q()!==e||!t.includes(i)||$H(r,i,n)})}}}));function $H(e,t,n){let r=XH(t),i=Error(),a={level:XH(t),extra:{arguments:e}};PF(o=>{if(o.addEventProcessor(e=>(e.logger=`console`,RP(e,{handled:n,type:`auto.core.capture_console`}),e)),t===`assert`){if(!e[0]){let t=`Assertion failed: ${OP(e.slice(1),` `)||`console.assert`}`;o.setExtra(`arguments`,e.slice(1)),o.captureMessage(t,r,{captureContext:a,syntheticException:i})}return}let s=e.find(e=>e instanceof Error);if(s){Hz(s,a);return}let c=OP(e,` `);o.captureMessage(c,r,{captureContext:a,syntheticException:i})})}var eU=`Dedupe`,tU=xB((()=>{let e;return{name:eU,processEvent(t){if(t.type)return t;try{if(nU(t,e))return U&&G.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}}));function nU(e,t){return t?!!(rU(e,t)||iU(e,t)):!1}function rU(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!oU(e,t)||!aU(e,t))}function iU(e,t){let n=sU(t),r=sU(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!oU(e,t)||!aU(e,t))}function aU(e,t){let n=wN(e),r=wN(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function oU(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join(``)===r.join(``)}catch{return!1}}function sU(e){return e.exception?.values?.[0]}var cU=`ExtraErrorData`,lU=xB(((e={})=>{let{depth:t=3,captureErrorCause:n=!0}=e;return{name:cU,processEvent(e,r,i){let{maxValueLength:a}=i.getOptions();return uU(e,r,t,n,a)}}}));function uU(e,t={},n,r,i){if(!t.originalException||!RN(t.originalException))return e;let a=t.originalException.name||t.originalException.constructor.name,o=dU(t.originalException,r,i);if(o){let t={...e.contexts},r=_P(o,n);return KN(r)&&(fP(r),t[a]=r),{...e,contexts:t}}return e}function dU(e,t,n){try{let r=[`name`,`message`,`stack`,`line`,`column`,`fileName`,`lineNumber`,`columnNumber`,`toJSON`],i={};for(let t of Object.keys(e)){if(r.indexOf(t)!==-1)continue;let a=e[t];i[t]=RN(a)||typeof a==`string`?n?EP(`${a}`,n):`${a}`:a}if(t&&e.cause!==void 0&&(i.cause=RN(e.cause)?{[e.cause.name||e.cause.constructor.name]:dU(e.cause,!1,n)}:e.cause),typeof e.toJSON==`function`){let t=e.toJSON();for(let e of Object.keys(t)){let n=t[e];i[e]=RN(n)?n.toString():n}}return i}catch(e){U&&G.error(`Unable to extract extra data from the Error object:`,e)}return null}function fU(e,t){let n=0;for(let t=e.length-1;t>=0;t--){let r=e[t];r===`.`?e.splice(t,1):r===`..`?(e.splice(t,1),n++):n&&(e.splice(t,1),n--)}if(t)for(;n--;)e.unshift(`..`);return e}var pU=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function mU(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=pU.exec(t);return n?n.slice(1):[]}function hU(...e){let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:`/`;i&&(t=`${i}/${t}`,n=i.charAt(0)===`/`)}return t=fU(t.split(`/`).filter(e=>!!e),!n).join(`/`),(n?`/`:``)+t||`.`}function gU(e){let t=0;for(;t<e.length&&e[t]===``;t++);let n=e.length-1;for(;n>=0&&e[n]===``;n--);return t>n?[]:e.slice(t,n-t+1)}function _U(e,t){e=hU(e).slice(1),t=hU(t).slice(1);let n=gU(e.split(`/`)),r=gU(t.split(`/`)),i=Math.min(n.length,r.length),a=i;for(let e=0;e<i;e++)if(n[e]!==r[e]){a=e;break}let o=[];for(let e=a;e<n.length;e++)o.push(`..`);return o=o.concat(r.slice(a)),o.join(`/`)}function vU(e,t){let n=mU(e)[2]||``;return t&&n.slice(t.length*-1)===t&&(n=n.slice(0,n.length-t.length)),n}var yU=`RewriteFrames`,bU=xB((e={})=>{let t=e.root,n=e.prefix||`app:///`,r=`window`in W&&!!W.window,i=e.iteratee||xU({isBrowser:r,root:t,prefix:n});function a(e){try{return{...e,exception:{...e.exception,values:e.exception.values.map(e=>({...e,...e.stacktrace&&{stacktrace:o(e.stacktrace)}}))}}}catch{return e}}function o(e){return{...e,frames:e?.frames?.map(e=>i(e))}}return{name:yU,processEvent(e){let t=e;return e.exception&&Array.isArray(e.exception.values)&&(t=a(t)),t}}});function xU({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;let i=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes(`\\`)&&!r.filename.includes(`/`),a=/^\//.test(r.filename);if(e){if(t){let e=r.filename;e.indexOf(t)===0&&(r.filename=e.replace(t,n))}}else if(i||a){let e=i?r.filename.replace(/^[a-zA-Z]:/,``).replace(/\\/g,`/`):r.filename;r.filename=`${n}${t?_U(t,e):vU(e)}`}return r}}var SU=[`reauthenticate`,`signInAnonymously`,`signInWithOAuth`,`signInWithIdToken`,`signInWithOtp`,`signInWithPassword`,`signInWithSSO`,`signOut`,`signUp`,`verifyOtp`],CU=[`createUser`,`deleteUser`,`listUsers`,`getUserById`,`updateUserById`,`inviteUserByEmail`],wU={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`},TU=[`select`,`insert`,`upsert`,`update`,`delete`];function EU(e){try{e.__SENTRY_INSTRUMENTED__=!0}catch{}}function DU(e){try{return e.__SENTRY_INSTRUMENTED__}catch{return!1}}function OU(e,t){if(Object.keys(t).length>0)return t;if(Array.isArray(e)&&e.length>0)return e}function kU(e,t){return OU(e,t)!==void 0}function AU(e,t={}){switch(e){case`GET`:return`select`;case`POST`:return t.Prefer?.includes(`resolution=`)?`upsert`:`insert`;case`PATCH`:return`update`;case`DELETE`:return`delete`;default:return`<unknown-op>`}}function jU(e,t){if(t===``||t===`*`)return`select(*)`;if(e===`select`)return`select(${t})`;if(e===`or`||e.endsWith(`.or`))return`${e}${t}`;let[n,...r]=t.split(`.`),i;return i=n?.startsWith(`fts`)?`textSearch`:n?.startsWith(`plfts`)?`textSearch[plain]`:n?.startsWith(`phfts`)?`textSearch[phrase]`:n?.startsWith(`wfts`)?`textSearch[websearch]`:n&&wU[n]||`filter`,`${i}(${e}, ${r.join(`.`)})`}function MU(e,t=!1){return new Proxy(e,{apply(n,r,i){return hR({name:`auth ${t?`(admin) `:``}${e.name}`,attributes:{[VF]:`auto.db.supabase`,[BF]:`db`,"db.system":`postgresql`,"db.operation":`auth.${t?`admin.`:``}${e.name}`}},e=>Reflect.apply(n,r,i).then(t=>(qN(t)&&`error`in t&&t.error?(e.setStatus({code:2}),Hz(t.error,{mechanism:{handled:!1,type:`auto.db.supabase.auth`}})):e.setStatus({code:1}),e.end(),t)).catch(t=>{throw e.setStatus({code:2}),e.end(),Hz(t,{mechanism:{handled:!1,type:`auto.db.supabase.auth`}}),t}).then(...i))}})}function NU(e){let t=e.auth;if(!(!t||DU(e.auth))){for(let n of SU){let r=t[n];r&&typeof e.auth[n]==`function`&&(e.auth[n]=MU(r))}for(let n of CU){let r=t.admin[n];r&&typeof e.auth.admin[n]==`function`&&(e.auth.admin[n]=MU(r,!0))}EU(e.auth)}}function PU(e,t){DU(e.prototype.from)||(e.prototype.from=new Proxy(e.prototype.from,{apply(e,n,r){let i=Reflect.apply(e,n,r),a=i.constructor;return IU(a,t),i}}),EU(e.prototype.from))}function FU(e,t){DU(e.prototype.then)||(e.prototype.then=new Proxy(e.prototype.then,{apply(e,n,r){let i=TU,a=n,o=AU(a.method,a.headers);if(!i.includes(o)||!a?.url?.pathname||typeof a.url.pathname!=`string`)return Reflect.apply(e,n,r);let s=a.url.pathname.split(`/`),c=s.length>0?s[s.length-1]:``,l=[];for(let[e,t]of a.url.searchParams.entries())l.push(jU(e,t));let u=Object.create(null);if(KN(a.body))for(let[e,t]of Object.entries(a.body))u[e]=t;let d=q(),f=t.sendOperationData??d?.getDataCollectionOptions().databaseQueryData===!0,p=OU(a.body,u),m=o===`select`?``:`${o}${kU(a.body,u)?`(...) `:``}`,h=f?l.join(` `):l.length>0?`[redacted]`:``,g=[m.trimEnd(),h].filter(Boolean).join(` `),_=g?`${g} from(${c})`:`from(${c})`,v={"db.table":c,"db.schema":a.schema,"db.url":a.url.origin,"db.sdk":a.headers[`X-Client-Info`],"db.system":`postgresql`,"db.operation":o,[VF]:`auto.db.supabase`,[BF]:`db`};return l.length&&f&&(v[`db.query`]=l),p!==void 0&&f&&(v[`db.body`]=p),hR({name:_,attributes:v},t=>Reflect.apply(e,n,[]).then(e=>{if(t&&(e&&typeof e==`object`&&`status`in e&&aI(t,e.status||500),t.end()),e?.error){let t=Error(e.error.message);e.error.code&&(t.code=e.error.code),e.error.details&&(t.details=e.error.details);let n={};l.length&&f&&(n.query=l),p!==void 0&&f&&(n.body=p),Hz(t,e=>(e.addEventProcessor(e=>(RP(e,{handled:!1,type:`auto.db.supabase.postgres`}),e)),e.setContext(`supabase`,n),e))}let n={type:`supabase`,category:`db.${o}`,message:_},r={};return l.length&&f&&(r.query=l),p!==void 0&&f&&(r.body=p),Object.keys(r).length&&(n.data=r),hH(n),e},e=>{throw t&&(aI(t,500),t.end()),e}).then(...r))}}),EU(e.prototype.then))}function IU(e,t){for(let n of TU)DU(e.prototype[n])||(e.prototype[n]=new Proxy(e.prototype[n],{apply(e,r,i){let a=Reflect.apply(e,r,i),o=a.constructor;return U&&G.log(`Instrumenting ${n} operation's PostgRESTFilterBuilder`),FU(o,t),a}}),EU(e.prototype[n]))}var LU=(e,t={})=>{if(!e){U&&G.warn(`Supabase integration was not installed because no Supabase client was provided.`);return}PU(e.constructor===Function?e:e.constructor,t),NU(e)},RU=`Supabase`,zU=((e,t)=>({setupOnce(){LU(e,t)},name:RU})),BU=xB(e=>zU(e.supabaseClient,{sendOperationData:e.sendOperationData})),VU=10,HU=`ZodErrors`;function UU(e){return RN(e)&&e.name===`ZodError`&&Array.isArray(e.issues)}function WU(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 GU(e){return e.map(e=>typeof e==`number`?`<array>`:e).join(`.`)}function KU(e){let t=new Set;for(let n of e.issues){let e=GU(n.path);e.length>0&&t.add(e)}let n=Array.from(t);if(n.length===0){let t=`variable`;if(e.issues.length>0){let n=e.issues[0];n!==void 0&&`expected`in n&&typeof n.expected==`string`&&(t=n.expected)}return`Failed to validate ${t}`}return`Failed to validate keys: ${EP(n.join(`, `),100)}`}function qU(e,t=!1,n,r){if(!n.exception?.values||!r.originalException||!UU(r.originalException)||r.originalException.issues.length===0)return n;try{let i=(t?r.originalException.issues:r.originalException.issues.slice(0,e)).map(WU);return t&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({filename:`zod_issues.json`,data:JSON.stringify({issues:i})})),{...n,exception:{...n.exception,values:[{...n.exception.values[0],value:KU(r.originalException)},...n.exception.values.slice(1)]},extra:{...n.extra,"zoderror.issues":i.slice(0,e)}}}catch(e){return{...n,extra:{...n.extra,"zoderrors sentry integration parse error":{message:`an exception was thrown while processing ZodError within applyZodErrorsToEvent()`,error:e instanceof Error?`${e.name}: ${e.message}
|
|
519
|
+
${e.stack}`:`unknown`}}}}}var JU=xB(((e={})=>{let t=e.limit??VU;return{name:HU,processEvent(n,r){return qU(t,e.saveZodIssuesAsAttachment,n,r)}}})),YU=xB(e=>({name:`ThirdPartyErrorsFilter`,setup(e){e.on(`beforeEnvelope`,e=>{LL(e,(e,t)=>{if(t===`event`){let t=Array.isArray(e)?e[1]:void 0;t&&(WH(t),e[1]=t)}})}),e.on(`applyFrameMetadata`,t=>{if(t.type)return;let n=e.getOptions().stackParser;UH(n,t)})},preprocessEvent(t){e.ignoreSentryInternalFrames&&(W._sentryWrappedDepth??0)>0&&(t.sdkProcessingMetadata={...t.sdkProcessingMetadata,insideSentryWrapped:!0})},processEvent(t){let n=e.ignoreSentryInternalFrames?t.sdkProcessingMetadata?.insideSentryWrapped===!0&&t.exception?.values?.length===1:!1,r=ZU(t,e.ignoreSentryInternalFrames,n);if(r&&r[e.behaviour===`drop-error-if-contains-third-party-frames`||e.behaviour===`apply-tag-if-contains-third-party-frames`?`some`:`every`](t=>!t.some(t=>e.filterKeys.includes(t)))){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 XU(e,t,n){if(t!==0)return!1;if(n&&QU(e)||e.function===`sentryWrapped`)return!0;if(!e.context_line||!e.filename||!e.filename.includes(`sentry`)||!e.filename.includes(`helpers`)||!e.context_line.includes(tW))return!1;if(e.pre_context){let t=e.pre_context.length;for(let n=0;n<t;n++)if(e.pre_context[n]?.includes(eW))return!0}return!1}function ZU(e,t,n){let r=wN(e);if(r)return r.filter((e,r)=>!e.filename||e.lineno==null&&e.colno==null&&e.instruction_addr==null?!1:!t||!XU(e,r,!!n)).map(e=>e.module_metadata?Object.keys(e.module_metadata).filter(e=>e.startsWith($U)).map(e=>e.slice($U.length)):[])}function QU(e){return!e.context_line&&!e.pre_context&&!!e.function&&e.function.length<=2}var $U=`_sentryBundlerPluginAppKey:`,eW=`Attempt to invoke user-land function`,tW=`fn.apply(this, wrappedArguments)`,nW=`flag.evaluation.`;function rW(e){if(e.type)return e;let t=K().getScopeData().contexts.flags,n=t?t.values:[];return n.length?(e.contexts===void 0&&(e.contexts={}),e.contexts.flags={values:[...n]},e):e}function iW(e,t,n=100){let r=K().getScopeData().contexts;r.flags||={values:[]};let i=r.flags.values;aW(i,e,t,n)}function aW(e,t,n,r){if(typeof n!=`boolean`)return;if(e.length>r){U&&G.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`);return}let i=e.findIndex(e=>e.flag===t);i!==-1&&e.splice(i,1),e.length===r&&e.shift(),e.push({flag:t,result:n})}function oW(e,t,n=10){if(typeof t!=`boolean`)return;let r=fL();if(!r)return;let i=YI(r).data;if(`${nW}${e}`in i){r.setAttribute(`${nW}${e}`,t);return}Object.keys(i).filter(e=>e.startsWith(nW)).length<n&&r.setAttribute(`${nW}${e}`,t)}var sW=xB(()=>({name:`FeatureFlags`,processEvent(e,t,n){return rW(e)},addFeatureFlag(e,t){iW(e,t),oW(e,t)}})),cW=xB(({growthbookClass:e})=>({name:`GrowthBook`,setupOnce(){let t=e.prototype;typeof t.isOn==`function`&&$N(t,`isOn`,lW),typeof t.getFeatureValue==`function`&&$N(t,`getFeatureValue`,lW)},processEvent(e,t,n){return rW(e)}}));function lW(e){return function(...t){let n=t[0],r=e.apply(this,t);return typeof n==`string`&&typeof r==`boolean`&&(iW(n,r),oW(n,r)),r}}var uW=`ConversationId`,dW=xB((()=>({name:uW,setup(e){e.on(`spanStart`,e=>{let t=K().getScopeData(),n=MF().getScopeData(),r=t.conversationId||n.conversationId;if(r){let{op:t,data:n,description:i}=YI(e);if(!t?.startsWith(`gen_ai.`)&&!n[`ai.operationId`]&&!i?.startsWith(`ai.`))return;e.setAttribute(rI,r)}})}})));function fW(e,t,n,r,i){if(!e.fetchData)return;let{method:a,url:o}=e.fetchData,s=_L()&&t(o);if(e.endTimestamp){let t=e.fetchData.__span;if(!t)return;let n=r[t];n&&(s&&(hW(n,e),pW(n,e,i)),delete r[t]);return}let{spanOrigin:c=`auto.http.browser`,propagateTraceparent:l=!1}=typeof i==`object`?i:{spanOrigin:i},u=q(),d=!!fL(),f=d||!!u&&iR(u),p=s&&f?_R(yW(o,a,c)):new wL,m=NR(p)&&d?void 0:p;if(s&&!f&&u?.recordDroppedEvent(`no_parent_span`,`span`),e.fetchData.__span=p.spanContext().spanId,r[p.spanContext().spanId]=p,n(e.fetchData.url)){let t=e.args[0],n={...e.args[1]||{}},r=mW(t,n,_L()&&f?m:void 0,l);r&&(e.args[1]=n,n.headers=r)}if(u){let t={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};u.emit(`beforeOutgoingRequestSpan`,p,t)}return p}function pW(e,t,n){(typeof n==`object`&&n?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function mW(e,t,n,r){let i=dH({span:n,propagateTraceparent:r}),a=i[`sentry-trace`],o=i.baggage,s=i.traceparent;if(!a)return;let c=t.headers||(QN(e)?e.headers:void 0);if(!c)return{...i};if(_W(c)){let e=new Headers(c);if(e.get(`sentry-trace`)||e.set(`sentry-trace`,a),r&&s&&!e.get(`traceparent`)&&e.set(`traceparent`,s),o){let t=e.get(`baggage`);t?gW(t)||e.set(`baggage`,`${t},${o}`):e.set(`baggage`,o)}return e}if(vW(c)){let e=[...c];e.find(e=>e[0]===`sentry-trace`)||e.push([`sentry-trace`,a]),r&&s&&!e.find(e=>e[0]===`traceparent`)&&e.push([`traceparent`,s]);let t=c.find(e=>e[0]===`baggage`&&typeof e[1]==`string`&&gW(e[1]));return o&&!t&&e.push([`baggage`,o]),e}{let e=`sentry-trace`in c?c[`sentry-trace`]:void 0,t=`traceparent`in c?c.traceparent:void 0,n=`baggage`in c?c.baggage:void 0,i=n?Array.isArray(n)?[...n]:[n]:[],l=n&&(Array.isArray(n)?n.find(e=>gW(e)):gW(n));o&&!l&&i.push(o);let u=Object.assign({},c,{"sentry-trace":e??a,baggage:i.length>0?i.join(`,`):void 0});return r&&s&&!t&&(u.traceparent=s),u}}function hW(e,t){if(t.response){aI(e,t.response.status);let n=t.response?.headers?.get(`content-length`);if(n){let t=parseInt(n);t>0&&e.setAttribute(`http.response_content_length`,t)}}else t.error&&e.setStatus({code:2,message:`internal_error`});e.end()}function gW(e){return typeof e==`string`&&e.split(`,`).some(e=>e.trim().startsWith(gI))}function _W(e){return typeof Headers<`u`&&ZN(e,Headers)}function vW(e){return Array.isArray(e)?e.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]==`string`):!1}function yW(e,t,n){if(e.startsWith(`data:`))return{name:`${t} ${tH(e)}`,attributes:bW(e,void 0,t,n)};let r=ZV(e);return{name:`${t} ${r?QV(r):e}`,attributes:bW(e,r,t,n)}}function bW(e,t,n,r){let i={url:tH(e),type:`fetch`,"http.method":n,[VF]:r,[BF]:`http.client`};return t&&(XV(t)||(i[`http.url`]=tH(t.href),i[`server.address`]=t.host),t.search&&(i[`http.query`]=t.search),t.hash&&(i[`http.fragment`]=t.hash)),i}function xW(e,t={},n=K()){let{message:r,name:i,email:a,url:o,source:s,associatedEventId:c,tags:l}=e,u={contexts:{feedback:{contact_email:a,name:i,message:r,url:o,source:s,associated_event_id:c}},type:`feedback`,level:`info`,tags:l},d=n?.getClient()||q();return d&&d.emit(`beforeSendFeedback`,u,t),n.captureEvent(u,t)}function SW(e,t,n){return`util`in W&&typeof W.util.format==`function`?W.util.format(...e):CW(e,t,n)}function CW(e,t,n){return e.map(e=>GN(e)?String(e):JSON.stringify(_P(e,t,n))).join(` `)}function wW(e){return/%[sdifocO]/.test(e)}function TW(e,t){let n={};return n[`sentry.message.template`]=`${e} ${Array(t.length).fill(`{}`).join(` `)}`,t.forEach((e,t)=>{n[`sentry.message.parameter.${t}`]=e}),n}var EW=`ConsoleLogs`,DW={[VF]:`auto.log.console`},OW=xB(((e={})=>{let t=e.levels||rN;return{name:EW,setup(e){let{enableLogs:n,normalizeDepth:r=3,normalizeMaxBreadth:i=1e3}=e.getOptions();if(!n){U&&G.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}let a=qH(({args:n,level:a})=>{if(q()!==e||!t.includes(a))return;let o=n[0],s=n.slice(1);if(a===`assert`){o||RB({level:`error`,message:s.length>0?`Assertion failed: ${SW(s,r,i)}`:`Assertion failed`,attributes:DW});return}let c=a===`log`,l={...DW};if(KN(o)){Object.assign(l,_P(o,r,i));let e=typeof n[1]==`string`?2:1;n.slice(e).forEach((e,t)=>{l[`sentry.message.parameter.${t}`]=_P(e,r,i)})}else if(s.length>0&&typeof o==`string`&&!wW(o)){let e=TW(o,s);for(let[t,n]of Object.entries(e))l[t]=t.startsWith(`sentry.message.parameter.`)?_P(n,r,i):n}RB({level:c?`info`:a,message:SW(n,r,i),severityNumber:c?10:void 0,attributes:l})});e.registerCleanup(a)}}}));function kW(e,t,n,r){ZB({type:e,name:t,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope})}function AW(e,t,n){kW(`distribution`,e,t,n)}var jW=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`];function MW(e={}){let t=new Set(e.levels??jW),n=e.client;return{log(e){let{type:r,level:i,message:a,args:o,tag:s,date:c,...l}=e,u=n||q();if(!u)return;let d=FW(r,i);if(!t.has(d))return;let{normalizeDepth:f=3,normalizeMaxBreadth:p=1e3}=u.getOptions(),m={};for(let[e,t]of Object.entries(l))m[e]=_P(t,f,p);m[`sentry.origin`]=`auto.log.consola`,s&&(m[`consola.tag`]=s),r&&(m[`consola.type`]=r),i!=null&&typeof i==`number`&&(m[`consola.level`]=i);let h=LW(IW(o,f,p),f,p);h?.attributes&&Object.assign(m,h.attributes),RB({level:d,message:h?.message||a||o&&SW(o,f,p)||``,attributes:m})}}}var NW={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`},PW={0:`fatal`,1:`warn`,2:`info`,3:`info`,4:`debug`,5:`trace`};function FW(e,t){if(e===`verbose`)return`debug`;if(e===`silent`)return`trace`;if(e){let t=NW[e];if(t)return t}if(typeof t==`number`){let e=PW[t];if(e)return e}return`info`}function IW(e,t,n){if(!e?.length)return{message:``};let r=SW(e,t,n),i=e[0];if(KN(i)){let t=typeof e[1]==`string`?2:1;return{message:r,attributes:i,messageParameters:e.slice(t)}}{let t=e.slice(1),n=t.length>0&&typeof i==`string`&&!wW(i);return{message:r,messageTemplate:n?i:void 0,messageParameters:n?t:void 0}}}function LW(e,t,n){let{message:r,attributes:i,messageTemplate:a,messageParameters:o}=e,s={};if(a&&o){let e=TW(a,o);for(let[r,i]of Object.entries(e))s[r]=r.startsWith(`sentry.message.parameter.`)?_P(i,t,n):i}else o&&o.length>0&&o.forEach((e,r)=>{s[`sentry.message.parameter.${r}`]=_P(e,t,n)});return{message:r,attributes:{..._P(i,t,n),...s}}}var RW=`gen_ai.prompt`,zW=`gen_ai.system`,BW=`gen_ai.request.model`,VW=`gen_ai.request.stream`,HW=`gen_ai.request.temperature`,UW=`gen_ai.request.max_tokens`,WW=`gen_ai.request.frequency_penalty`,GW=`gen_ai.request.presence_penalty`,KW=`gen_ai.request.top_p`,qW=`gen_ai.request.top_k`,JW=`gen_ai.request.encoding_format`,YW=`gen_ai.request.dimensions`,XW=`gen_ai.response.finish_reasons`,ZW=`gen_ai.response.model`,QW=`gen_ai.response.id`,$W=`gen_ai.response.stop_reason`,eG=`gen_ai.usage.input_tokens`,tG=`gen_ai.usage.output_tokens`,nG=`gen_ai.usage.total_tokens`,rG=`gen_ai.operation.name`,iG=`sentry.sdk_meta.gen_ai.input.messages.original_length`,aG=`gen_ai.input.messages`,oG=`gen_ai.system_instructions`,sG=`gen_ai.response.text`,cG=`gen_ai.request.available_tools`,lG=`gen_ai.response.streaming`,uG=`gen_ai.response.tool_calls`,dG=`gen_ai.agent.name`,fG=`gen_ai.pipeline.name`,pG=`gen_ai.conversation.id`,mG=`gen_ai.usage.cache_creation_input_tokens`,hG=`gen_ai.usage.cache_read_input_tokens`,gG=`gen_ai.invoke_agent`,_G=`gen_ai.embeddings.input`,vG=`gen_ai.embeddings`,yG=`gen_ai.execute_tool`,bG=`gen_ai.tool.name`,xG=`gen_ai.tool.call.id`,SG=`gen_ai.tool.type`,CG=`gen_ai.tool.input`,wG=`gen_ai.tool.output`,TG=`gen_ai.tool.description`;function EG(e){return!e||typeof e!=`object`?!1:kG(e)||AG(e)||DG(e)||jG(e)||MG(e)||NG(e)||PG(e)||FG(e)||IG(e)||LG(e)||RG(e)||zG(e)}function DG(e){return`image_url`in e?typeof e.image_url==`string`?e.image_url.startsWith(`data:`):OG(e):!1}function OG(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 kG(e){return`type`in e&&typeof e.type==`string`&&`source`in e&&EG(e.source)}function AG(e){return`inlineData`in e&&!!e.inlineData&&typeof e.inlineData==`object`&&`data`in e.inlineData&&typeof e.inlineData.data==`string`}function jG(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 MG(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 NG(e){return`media_type`in e&&typeof e.media_type==`string`&&`data`in e}function PG(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 FG(e){return`type`in e&&e.type===`image`&&`image`in e&&typeof e.image==`string`&&!e.image.startsWith(`http://`)&&!e.image.startsWith(`https://`)}function IG(e){return`type`in e&&(e.type===`blob`||e.type===`base64`)}function LG(e){return`b64_json`in e}function RG(e){return`type`in e&&`result`in e&&e.type===`image_generation`}function zG(e){return`uri`in e&&typeof e.uri==`string`&&e.uri.startsWith(`data:`)}var BG=`[Blob substitute]`,VG=[`image_url`,`data`,`content`,`b64_json`,`result`,`uri`,`image`];function HG(e){let t={...e};EG(t.source)&&(t.source=HG(t.source)),AG(e)&&(t.inlineData={...e.inlineData,data:BG}),OG(e)&&(t.image_url={...e.image_url,url:BG}),jG(e)&&(t.input_audio={...e.input_audio,data:BG}),MG(e)&&(t.file={...e.file,file_data:BG});for(let e of VG)typeof t[e]==`string`&&(t[e]=BG);return t}var UG=2e4,WG=e=>new TextEncoder().encode(e).length,GG=e=>WG(JSON.stringify(e));function KG(e,t){if(WG(e)<=t)return e;let n=0,r=e.length,i=``;for(;n<=r;){let a=Math.floor((n+r)/2),o=e.slice(0,a);WG(o)<=t?(i=o,n=a+1):r=a-1}return i}function qG(e){return typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``}function JG(e,t){return typeof e==`string`?t:{...e,text:t}}function YG(e){return typeof e==`object`&&!!e&&`content`in e&&typeof e.content==`string`}function XG(e){return typeof e==`object`&&!!e&&`content`in e&&Array.isArray(e.content)}function ZG(e){return typeof e==`object`&&!!e&&`parts`in e&&Array.isArray(e.parts)&&e.parts.length>0}function QG(e,t){let n=t-GG({...e,content:``});if(n<=0)return[];let r=KG(e.content,n);return[{...e,content:r}]}function $G(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 eK(e,t){let{key:n,items:r}=$G(e);if(n===null||r.length===0)return[];let i=r.map(e=>JG(e,``)),a=t-GG({...e,[n]:i});if(a<=0)return[];let o=[];for(let e of r){let t=qG(e),n=WG(t);if(n<=a)o.push(e),a-=n;else if(o.length===0){let n=KG(t,a);n&&o.push(JG(e,n));break}else break}return o.length<=0?[]:[{...e,[n]:o}]}function tK(e,t){if(!e)return[];if(typeof e==`string`){let n=KG(e,t);return n?[n]:[]}return typeof e==`object`?YG(e)?QG(e,t):XG(e)||ZG(e)?eK(e,t):[]:[]}function nK(e){return e.map(e=>{let t;return e&&typeof e==`object`&&(XG(e)?t={...e,content:nK(e.content)}:`content`in e&&EG(e.content)&&(t={...e,content:HG(e.content)}),ZG(e)&&(t={...t??e,parts:nK(e.parts)}),EG(t)?t=HG(t):EG(e)&&(t=HG(e))),t??e})}function rK(e,t){if(!Array.isArray(e)||e.length===0)return e;let n=t-2,r=e[e.length-1],i=nK([r]),a=i[0];return GG(a)<=n?i:tK(a,n)}function iK(e){return rK(e,UG)}function aK(e){return KG(e,UG)}function oK(e){let t=q()?.getDataCollectionOptions().genAI;return{...e,recordInputs:e?.recordInputs??t?.inputs??!1,recordOutputs:e?.recordOutputs??t?.outputs??!1}}function sK(e){if(e!==void 0)return e;let t=q();return!t||!iR(t)&&t.getOptions().streamGenAiSpans===!1}function cK(e,t){return e?`${e}.${t}`:t}function lK(e,t,n,r,i){if(t!==void 0&&e.setAttributes({[eG]:t}),n!==void 0&&e.setAttributes({[tG]:n}),t!==void 0||n!==void 0||r!==void 0||i!==void 0){let a=(t??0)+(n??0)+(r??0)+(i??0);e.setAttributes({[nG]:a})}}function uK(e,t,n){if(!e.isRecording())return;let r={[lG]:!0};t.responseId&&(r[QW]=t.responseId),t.responseModel&&(r[ZW]=t.responseModel),t.promptTokens!==void 0&&(r[eG]=t.promptTokens),t.completionTokens!==void 0&&(r[tG]=t.completionTokens),t.totalTokens===void 0?(t.promptTokens!==void 0||t.completionTokens!==void 0||t.cacheCreationInputTokens!==void 0||t.cacheReadInputTokens!==void 0)&&(r[nG]=(t.promptTokens??0)+(t.completionTokens??0)+(t.cacheCreationInputTokens??0)+(t.cacheReadInputTokens??0)):r[nG]=t.totalTokens,t.finishReasons.length&&(r[XW]=JSON.stringify(t.finishReasons)),n&&t.responseTexts.length&&(r[sG]=t.responseTexts.join(``)),n&&t.toolCalls.length&&(r[uG]=JSON.stringify(t.toolCalls)),e.setAttributes(r),e.end()}function dK(e){if(typeof e==`string`)return aK(e);try{return JSON.stringify(Array.isArray(e)?iK(e):e)}catch{return`[unserializable]`}}function fK(e){if(!Array.isArray(e))return{systemInstructions:void 0,filteredMessages:e};let t=e.findIndex(e=>e&&typeof e==`object`&&`role`in e&&e.role===`system`);if(t===-1)return{systemInstructions:void 0,filteredMessages:e};let n=e[t],r=typeof n.content==`string`?n.content:n.content===void 0?void 0:JSON.stringify(n.content);return r?{systemInstructions:JSON.stringify([{type:`text`,content:r}]),filteredMessages:[...e.slice(0,t),...e.slice(t+1)]}:{systemInstructions:void 0,filteredMessages:e}}async function pK(e,t,n){let r=e.catch(e=>{throw Hz(e,{mechanism:{handled:!1,type:n}}),e}),i=await t,a=await r;return a&&typeof a==`object`&&`data`in a?{...a,data:i}:i}function mK(e,t,n){return XN(e)?new Proxy(e,{get(e,r){let i=r in Promise.prototype||r===Symbol.toStringTag?t:e,a=Reflect.get(i,r);return r===`withResponse`&&typeof a==`function`?function(){return pK(a.call(e),t,n)}:typeof a==`function`?a.bind(i):a}}):t}var hK={"responses.create":{operation:`chat`},"chat.completions.create":{operation:`chat`},"embeddings.create":{operation:`embeddings`},"conversations.create":{operation:`chat`}},gK=[`response.created`,`response.in_progress`,`response.failed`,`response.completed`,`response.incomplete`,`response.queued`,`response.output_text.delta`,`response.output_item.added`,`response.function_call_arguments.delta`,`response.function_call_arguments.done`,`response.output_item.done`];function _K(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`&&e.type.startsWith(`response.`)}function vK(e){return typeof e==`object`&&!!e&&`object`in e&&e.object===`chat.completion.chunk`}function yK(e,t,n){if(!t||typeof t!=`object`)return;let r=t,i={};if(typeof r.id==`string`&&(i[QW]=r.id),typeof r.model==`string`&&(i[ZW]=r.model),r.object===`conversation`&&typeof r.id==`string`&&(i[pG]=r.id),r.usage&&typeof r.usage==`object`){let e=r.usage,t=e.prompt_tokens??e.input_tokens;typeof t==`number`&&(i[eG]=t);let n=e.completion_tokens??e.output_tokens;typeof n==`number`&&(i[tG]=n),typeof e.total_tokens==`number`&&(i[nG]=e.total_tokens)}if(Array.isArray(r.choices)){let e=r.choices,t=e.map(e=>e.finish_reason).filter(e=>typeof e==`string`);if(t.length>0&&(i[XW]=JSON.stringify(t)),n){let t=e.map(e=>e.message?.content||``);i[sG]=JSON.stringify(t);let n=e.map(e=>e.message?.tool_calls).filter(e=>Array.isArray(e)&&e.length>0).flat();n.length>0&&(i[uG]=JSON.stringify(n))}}if(typeof r.status==`string`&&(i[`gen_ai.response.finish_reasons`]||(i[XW]=JSON.stringify([r.status]))),n&&(typeof r.output_text==`string`&&!i[`gen_ai.response.text`]&&(i[sG]=r.output_text),Array.isArray(r.output)&&r.output.length>0&&!i[`gen_ai.response.tool_calls`])){let e=r.output.filter(e=>e?.type===`function_call`);e.length>0&&(i[uG]=JSON.stringify(e))}e.setAttributes(i)}function bK(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 xK(e){let t={[BW]:e.model??`unknown`};`temperature`in e&&(t[HW]=e.temperature),`top_p`in e&&(t[KW]=e.top_p),`frequency_penalty`in e&&(t[WW]=e.frequency_penalty),`presence_penalty`in e&&(t[GW]=e.presence_penalty),`stream`in e&&(t[VW]=e.stream),`encoding_format`in e&&(t[JW]=e.encoding_format),`dimensions`in e&&(t[YW]=e.dimensions);let n=bK(e);return n&&(t[pG]=n),t}function SK(e,t){for(let n of e){let e=n.index;if(!(e===void 0||!n.function))if(!(e in t.chatCompletionToolCalls))t.chatCompletionToolCalls[e]={...n,function:{name:n.function.name,arguments:n.function.arguments||``}};else{let r=t.chatCompletionToolCalls[e];n.function.arguments&&r?.function&&(r.function.arguments+=n.function.arguments)}}}function CK(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(let r of e.choices??[])n&&(r.delta?.content&&t.responseTexts.push(r.delta.content),r.delta?.tool_calls&&SK(r.delta.tool_calls,t)),r.finish_reason&&t.finishReasons.push(r.finish_reason)}function wK(e,t,n,r){if(!(e&&typeof e==`object`)){t.eventTypes.push(`unknown:non-object`);return}if(e instanceof Error){r.setStatus({code:2,message:`internal_error`}),Hz(e,{mechanism:{handled:!1,type:`auto.ai.openai.stream-response`}});return}if(!(`type`in e))return;let i=e;if(!gK.includes(i.type)){t.eventTypes.push(i.type);return}if(n&&(i.type===`response.output_item.done`&&`item`in i&&t.responsesApiToolCalls.push(i.item),i.type===`response.output_text.delta`&&`delta`in i&&i.delta)){t.responseTexts.push(i.delta);return}if(`response`in i){let{response:e}=i;t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.input_tokens,t.completionTokens=e.usage.output_tokens,t.totalTokens=e.usage.total_tokens),e.status&&t.finishReasons.push(e.status),n&&e.output_text&&t.responseTexts.push(e.output_text)}}async function*TK(e,t,n){let r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(let i of e)vK(i)?CK(i,r,n):_K(i)&&wK(i,r,n,t),yield i}finally{let e=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];uK(t,{...r,toolCalls:e},n)}}function EK(e){let t=Array.isArray(e.tools)?e.tools:[],n=e.web_search_options&&typeof e.web_search_options==`object`?[{type:`web_search_options`,...e.web_search_options}]:[],r=[...t,...n];if(r.length!==0)try{return JSON.stringify(r)}catch(e){U&&G.error(`Failed to serialize OpenAI tools:`,e);return}}function DK(e,t){let n={[zW]:`openai`,[rG]:t,[VF]:`auto.ai.openai`};if(e.length>0&&typeof e[0]==`object`&&e[0]!==null){let t=e[0],r=EK(t);r&&(n[cG]=r),Object.assign(n,xK(t))}else n[BW]=`unknown`;return n}function OK(e,t,n,r){if(n===`embeddings`&&`input`in t){let n=t.input;if(n==null||typeof n==`string`&&n.length===0||Array.isArray(n)&&n.length===0)return;e.setAttribute(_G,typeof n==`string`?n:JSON.stringify(n));return}let i=`input`in t?t.input:`messages`in t?t.messages:void 0;if(!i||Array.isArray(i)&&i.length===0)return;let{systemInstructions:a,filteredMessages:o}=fK(i);a&&e.setAttribute(oG,a),e.setAttribute(aG,r?dK(o):TP(o)),Array.isArray(o)?e.setAttribute(iG,o.length):e.setAttribute(iG,1)}function kK(e,t,n,r,i){return function(...a){let o=n.operation||`unknown`,s=DK(a,o),c=s[`gen_ai.request.model`]||`unknown`,l=a[0],u=l&&typeof l==`object`&&l.stream===!0,d={name:`${o} ${c}`,op:`gen_ai.${o}`,attributes:s};if(u){let n,s=gR(d,s=>(n=e.apply(r,a),i.recordInputs&&l&&OK(s,l,o,sK(i.enableTruncation)),(async()=>{try{return TK(await n,s,i.recordOutputs??!1)}catch(e){throw s.setStatus({code:2,message:`internal_error`}),Hz(e,{mechanism:{handled:!1,type:`auto.ai.openai.stream`,data:{function:t}}}),s.end(),e}})()));return mK(n,s,`auto.ai.openai`)}let f,p=hR(d,n=>(f=e.apply(r,a),i.recordInputs&&l&&OK(n,l,o,sK(i.enableTruncation)),f.then(e=>(yK(n,e,i.recordOutputs),e),e=>{throw Hz(e,{mechanism:{handled:!1,type:`auto.ai.openai`,data:{function:t}}}),e})));return mK(f,p,`auto.ai.openai`)}}function AK(e,t=``,n){return new Proxy(e,{get(e,r){let i=e[r],a=cK(t,String(r)),o=hK[a];return typeof i==`function`&&o?kK(i,a,o,e,n):typeof i==`function`?i.bind(e):i&&typeof i==`object`?AK(i,a,n):i}})}function jK(e,t){return AK(e,``,oK(t))}var MK={"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 NK(e,t,n){if(Array.isArray(t)&&t.length===0)return;let{systemInstructions:r,filteredMessages:i}=fK(t);r&&e.setAttributes({[oG]:r});let a=Array.isArray(i)?i.length:1;e.setAttributes({[aG]:n?dK(i):TP(i),[iG]:a})}var PK={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 FK(e){return e&&PK[e]||`internal_error`}function IK(e,t){t.error&&(e.setStatus({code:2,message:FK(t.error.type)}),Hz(t.error,{mechanism:{handled:!1,type:`auto.ai.anthropic.anthropic_error`}}))}function LK(e){let{system:t,messages:n,input:r}=e,i=typeof t==`string`?[{role:`system`,content:e.system}]:[],a=(Array.isArray(r)?r:r==null?void 0:[r])??(Array.isArray(n)?n:n==null?[]:[n]);return[...i,...a]}function RK(e,t){return`type`in e&&typeof e.type==`string`&&e.type===`error`&&(t.setStatus({code:2,message:FK(e.error?.type)}),Hz(e.error,{mechanism:{handled:!1,type:`auto.ai.anthropic.anthropic_error`}}),!0)}function zK(e,t){if(e.type===`message_delta`&&(e.usage&&typeof e.usage.output_tokens==`number`&&(t.completionTokens=e.usage.output_tokens),e.delta?.stop_reason&&t.finishReasons.push(e.delta.stop_reason)),e.message){let n=e.message;n.id&&(t.responseId=n.id),n.model&&(t.responseModel=n.model),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 BK(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 VK(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`){let n=t.activeToolBlocks[e.index];n&&n.inputJsonParts.push(e.delta.partial_json)}n&&typeof e.delta.text==`string`&&t.responseTexts.push(e.delta.text)}}function HK(e,t){if(e.type!==`content_block_stop`||typeof e.index!=`number`)return;let n=t.activeToolBlocks[e.index];if(!n)return;let r=n.inputJsonParts.join(``),i;try{i=r?JSON.parse(r):{}}catch{i={__unparsed:r}}t.toolCalls.push({type:`tool_use`,id:n.id,name:n.name,input:i}),delete t.activeToolBlocks[e.index]}function UK(e,t,n,r){e&&typeof e==`object`&&(RK(e,r)||(zK(e,t),BK(e,t),VK(e,t,n),HK(e,t)))}async function*WK(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(let i of e)UK(i,r,n,t),yield i}finally{uK(t,r,n)}}function GK(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on(`streamEvent`,e=>{UK(e,r,n,t)}),e.on(`message`,()=>{uK(t,r,n)}),e.on(`error`,e=>{Hz(e,{mechanism:{handled:!1,type:`auto.ai.anthropic.stream_error`}}),t.isRecording()&&(t.setStatus({code:2,message:`internal_error`}),t.end())}),e}function KK(e,t,n){let r={[zW]:`anthropic`,[rG]:n,[VF]:`auto.ai.anthropic`};if(e.length>0&&typeof e[0]==`object`&&e[0]!==null){let t=e[0];t.tools&&Array.isArray(t.tools)&&(r[cG]=JSON.stringify(t.tools)),r[BW]=t.model??`unknown`,`temperature`in t&&(r[HW]=t.temperature),`top_p`in t&&(r[KW]=t.top_p),`stream`in t&&(r[VW]=t.stream),`top_k`in t&&(r[qW]=t.top_k),`frequency_penalty`in t&&(r[WW]=t.frequency_penalty),`max_tokens`in t&&(r[UW]=t.max_tokens)}else r[BW]=t===`models.retrieve`||t===`models.get`?e[0]:`unknown`;return r}function qK(e,t,n){NK(e,LK(t),n),`prompt`in t&&e.setAttributes({[RW]:JSON.stringify(t.prompt)})}function JK(e,t){if(`content`in t&&Array.isArray(t.content)){e.setAttributes({[sG]:t.content.map(e=>e.text).filter(e=>!!e).join(``)});let n=[];for(let e of t.content)(e.type===`tool_use`||e.type===`server_tool_use`)&&n.push(e);n.length>0&&e.setAttributes({[uG]:JSON.stringify(n)})}`completion`in t&&e.setAttributes({[sG]:t.completion}),`input_tokens`in t&&e.setAttributes({[sG]:JSON.stringify(t.input_tokens)})}function YK(e,t){`id`in t&&`model`in t&&(e.setAttributes({[QW]:t.id,[ZW]:t.model}),`usage`in t&&t.usage&&lK(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}function XK(e,t,n){if(!(!t||typeof t!=`object`)){if(`type`in t&&t.type===`error`){IK(e,t);return}n&&JK(e,t),YK(e,t)}}function ZK(e,t,n){throw Hz(e,{mechanism:{handled:!1,type:`auto.ai.anthropic`,data:{function:n}}}),t.isRecording()&&(t.setStatus({code:2,message:`internal_error`}),t.end()),e}function QK(e,t,n,r,i,a,o,s,c,l,u){let d={name:`${a} ${i[`gen_ai.request.model`]??`unknown`}`,op:`gen_ai.${a}`,attributes:i};if(l&&!u){let t,i=gR(d,i=>(t=e.apply(n,r),c.recordInputs&&s&&qK(i,s,sK(c.enableTruncation)),(async()=>{try{return WK(await t,i,c.recordOutputs??!1)}catch(e){return ZK(e,i,o)}})()));return mK(t,i,`auto.ai.anthropic`)}return gR(d,e=>{try{return c.recordInputs&&s&&qK(e,s,sK(c.enableTruncation)),GK(t.apply(n,r),e,c.recordOutputs??!1)}catch(t){return ZK(t,e,o)}})}function $K(e,t,n,r,i){return new Proxy(e,{apply(a,o,s){let c=n.operation||`unknown`,l=KK(s,t,c),u=l[`gen_ai.request.model`]??`unknown`,d=typeof s[0]==`object`?s[0]:void 0,f=!!d?.stream,p=n.streaming===!0;if(f||p)return QK(e,a,r,s,l,c,t,d,i,f,p);let m,h=hR({name:`${c} ${u}`,op:`gen_ai.${c}`,attributes:l},e=>(m=a.apply(r,s),i.recordInputs&&d&&qK(e,d,sK(i.enableTruncation)),m.then(t=>(XK(e,t,i.recordOutputs),t),e=>{throw Hz(e,{mechanism:{handled:!1,type:`auto.ai.anthropic`,data:{function:t}}}),e})));return mK(m,h,`auto.ai.anthropic`)}})}function eq(e,t=``,n){return new Proxy(e,{get(e,r){let i=e[r],a=cK(t,String(r)),o=MK[a];return typeof i==`function`&&o?$K(i,a,o,e,n):typeof i==`function`?i.bind(e):i&&typeof i==`object`?eq(i,a,n):i}})}function tq(e,t){return eq(e,``,oK(t))}var nq={"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}},rq=`google_genai`;function iq(e,t){let n=e?.promptFeedback;if(n?.blockReason){let e=n.blockReasonMessage??n.blockReason;return t.setStatus({code:2,message:`internal_error`}),Hz(`Content blocked: ${e}`,{mechanism:{handled:!1,type:`auto.ai.google_genai`}}),!0}return!1}function aq(e,t){typeof e.responseId==`string`&&(t.responseId=e.responseId),typeof e.modelVersion==`string`&&(t.responseModel=e.modelVersion);let 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 oq(e,t,n){Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(let r of e.candidates??[]){r?.finishReason&&!t.finishReasons.includes(r.finishReason)&&t.finishReasons.push(r.finishReason);for(let e of r?.content?.parts??[])n&&e.text&&t.responseTexts.push(e.text),e.functionCall&&t.toolCalls.push({type:`function`,id:e.functionCall.id,name:e.functionCall.name,arguments:e.functionCall.args})}}function sq(e,t,n,r){!e||iq(e,r)||(aq(e,t),oq(e,t,n))}async function*cq(e,t,n){let r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let i of e)sq(i,r,n,t),yield i}finally{uK(t,r,n)}}function lq(e,t=`user`){return typeof e==`string`?[{role:t,content:e}]:Array.isArray(e)?e.flatMap(e=>lq(e,t)):typeof e!=`object`||!e?[]:`role`in e&&typeof e.role==`string`?[e]:`parts`in e?[{...e,role:t}]:[{role:t,content:e}]}function uq(e,t){if(`model`in e&&typeof e.model==`string`)return e.model;if(t&&typeof t==`object`){let e=t;if(`model`in e&&typeof e.model==`string`)return e.model;if(`modelVersion`in e&&typeof e.modelVersion==`string`)return e.modelVersion}return`unknown`}function dq(e){let t={};return`temperature`in e&&typeof e.temperature==`number`&&(t[HW]=e.temperature),`topP`in e&&typeof e.topP==`number`&&(t[KW]=e.topP),`topK`in e&&typeof e.topK==`number`&&(t[qW]=e.topK),`maxOutputTokens`in e&&typeof e.maxOutputTokens==`number`&&(t[UW]=e.maxOutputTokens),`frequencyPenalty`in e&&typeof e.frequencyPenalty==`number`&&(t[WW]=e.frequencyPenalty),`presencePenalty`in e&&typeof e.presencePenalty==`number`&&(t[GW]=e.presencePenalty),t}function fq(e,t,n){let r={[zW]:rq,[rG]:e,[VF]:`auto.ai.google_genai`};if(t){if(r[BW]=uq(t,n),`config`in t&&typeof t.config==`object`&&t.config){let e=t.config;if(Object.assign(r,dq(e)),`tools`in e&&Array.isArray(e.tools)){let t=e.tools.flatMap(e=>e.functionDeclarations);r[cG]=JSON.stringify(t)}}}else r[BW]=uq({},n);return r}function pq(e,t,n,r){if(n===`embeddings`){let n=t.contents;n!=null&&e.setAttribute(_G,typeof n==`string`?n:JSON.stringify(n));return}let i=[];if(`config`in t&&t.config&&typeof t.config==`object`&&`systemInstruction`in t.config&&t.config.systemInstruction&&i.push(...lq(t.config.systemInstruction,`system`)),`history`in t&&i.push(...lq(t.history,`user`)),`contents`in t&&i.push(...lq(t.contents,`user`)),`message`in t&&i.push(...lq(t.message,`user`)),Array.isArray(i)&&i.length){let{systemInstructions:t,filteredMessages:n}=fK(i);t&&e.setAttribute(oG,t);let a=Array.isArray(n)?n.length:0;e.setAttributes({[iG]:a,[aG]:r?dK(n):TP(n)})}}function mq(e,t,n){if(!(!t||typeof t!=`object`)){if(t.modelVersion&&e.setAttribute(ZW,t.modelVersion),t.usageMetadata&&typeof t.usageMetadata==`object`){let n=t.usageMetadata;typeof n.promptTokenCount==`number`&&e.setAttributes({[eG]:n.promptTokenCount}),typeof n.candidatesTokenCount==`number`&&e.setAttributes({[tG]:n.candidatesTokenCount}),typeof n.totalTokenCount==`number`&&e.setAttributes({[nG]:n.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){let n=t.candidates.map(e=>e.content?.parts&&Array.isArray(e.content.parts)?e.content.parts.map(e=>typeof e.text==`string`?e.text:``).filter(e=>e.length>0).join(``):``).filter(e=>e.length>0);n.length>0&&e.setAttributes({[sG]:n.join(``)})}if(n&&t.functionCalls){let n=t.functionCalls;Array.isArray(n)&&n.length>0&&e.setAttributes({[uG]:JSON.stringify(n)})}}}function hq(e,t,n,r,i){let a=n.operation===`embeddings`;return new Proxy(e,{apply(e,o,s){let c=n.operation||`unknown`,l=s[0],u=fq(c,l,r),d=u[`gen_ai.request.model`]??`unknown`;return n.streaming?gR({name:`${c} ${d}`,op:`gen_ai.${c}`,attributes:u},async n=>{try{return i.recordInputs&&l&&pq(n,l,c,sK(i.enableTruncation)),cq(await e.apply(r,s),n,!!i.recordOutputs)}catch(e){throw n.setStatus({code:2,message:`internal_error`}),Hz(e,{mechanism:{handled:!1,type:`auto.ai.google_genai`,data:{function:t}}}),n.end(),e}}):hR({name:`${c} ${d}`,op:`gen_ai.${c}`,attributes:u},n=>(i.recordInputs&&l&&pq(n,l,c,sK(i.enableTruncation)),dR(()=>e.apply(r,s),e=>{Hz(e,{mechanism:{handled:!1,type:`auto.ai.google_genai`,data:{function:t}}})},()=>{},e=>{a||mq(n,e,i.recordOutputs)})))}})}function gq(e,t=``,n){return new Proxy(e,{get:(e,r,i)=>{let a=Reflect.get(e,r,i),o=cK(t,String(r)),s=nq[o];if(typeof a==`function`&&s){let t=s.operation?hq(a,o,s,e,n):a.bind(e);return s.proxyResultPath?function(...e){let r=t(...e);return r&&typeof r==`object`?gq(r,s.proxyResultPath,n):r}:t}return typeof a==`function`?a.bind(e):a&&typeof a==`object`?gq(a,o,n):a}})}function _q(e,t){return gq(e,``,oK(t))}var vq=`auto.ai.langchain`,yq={human:`user`,ai:`assistant`,assistant:`assistant`,system:`system`,function:`function`,tool:`tool`},bq=(e,t,n)=>{n!=null&&(e[t]=n)},xq=(e,t,n)=>{let r=Number(n);Number.isNaN(r)||(e[t]=r)};function Sq(e){if(Array.isArray(e))try{let t=e.map(e=>e&&typeof e==`object`&&EG(e)?HG(e):e);return JSON.stringify(t)}catch{return String(e)}return TP(e,String)}function Cq(e){let t=e.toLowerCase();return yq[t]??t}function wq(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 Tq(e){if(!(!e||Array.isArray(e)))return e.invocation_params}function Eq(e){return e.map(e=>{let t=e._getType;if(typeof t==`function`)return{role:Cq(t.call(e)),content:Sq(e.content)};if(e.lc===1&&e.kwargs){let t=e.id,n=Array.isArray(t)&&t.length>0?t[t.length-1]:``;return{role:Cq(typeof n==`string`?wq(n):`user`),content:Sq(e.kwargs?.content)}}if(e.type)return{role:Cq(String(e.type).toLowerCase()),content:Sq(e.content)};if(e.role)return{role:Cq(String(e.role)),content:Sq(e.content)};let n=e.constructor?.name;return n&&n!==`Object`?{role:Cq(wq(n)),content:Sq(e.content)}:{role:`user`,content:Sq(e.content)}})}function Dq(e,t,n){let r={},i=`kwargs`in e?e.kwargs:void 0;xq(r,HW,t?.temperature??n?.ls_temperature??i?.temperature),xq(r,UW,t?.max_tokens??n?.ls_max_tokens??i?.max_tokens),xq(r,KW,t?.top_p??i?.top_p);let a=t?.frequency_penalty;xq(r,WW,a);let o=t?.presence_penalty;return xq(r,GW,o),t&&`stream`in t&&bq(r,VW,!!t.stream),r}function Oq(e,t,n,r,i){return{[zW]:TP(e??`langchain`,String),[rG]:`chat`,[BW]:TP(t,String),[VF]:vq,...Dq(n,r,i)}}function kq(e,t,n,r,i,a){let o=a?.ls_provider,s=Oq(o,i?.model??a?.ls_model_name??`unknown`,e,i,a);if(n&&Array.isArray(t)&&t.length>0){bq(s,iG,t.length);let e=t.map(e=>({role:`user`,content:e}));bq(s,aG,r?dK(e):TP(e))}return s}function Aq(e,t,n,r,i,a){let o=Oq(a?.ls_provider??e.id?.[2],i?.model??a?.ls_model_name??`unknown`,e,i,a);if(n&&Array.isArray(t)&&t.length>0){let{systemInstructions:e,filteredMessages:n}=fK(Eq(t.flat()));e&&bq(o,oG,e),bq(o,iG,Array.isArray(n)?n.length:0),bq(o,aG,r?dK(n):TP(n))}return o}function jq(e,t){let n=[],r=e.flat();for(let e of r){let t=e.message?.tool_calls;if(Array.isArray(t)&&t.length>0)n.push(...t);else{let t=e.message?.content;if(Array.isArray(t))for(let e of t){let t=e;t.type===`tool_use`&&n.push(t)}}}n.length>0&&bq(t,uG,TP(n,String))}function Mq(e,t){if(!e)return;let n=e.tokenUsage,r=e.usage;if(n)xq(t,eG,n.promptTokens),xq(t,tG,n.completionTokens),xq(t,nG,n.totalTokens);else if(r){xq(t,eG,r.input_tokens),xq(t,tG,r.output_tokens);let e=Number(r.input_tokens),n=Number(r.output_tokens),i=(Number.isNaN(e)?0:e)+(Number.isNaN(n)?0:n);i>0&&xq(t,nG,i),r.cache_creation_input_tokens!==void 0&&xq(t,mG,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&xq(t,hG,r.cache_read_input_tokens)}}function Nq(e,t){if(!e)return;let n={};if(Array.isArray(e.generations)){let r=e.generations.flat().map(e=>e.generationInfo?.finish_reason?e.generationInfo.finish_reason:e.generation_info?.finish_reason?e.generation_info.finish_reason:null).filter(e=>typeof e==`string`);if(r.length>0&&bq(n,XW,TP(r,String)),jq(e.generations,n),t){let t=e.generations.flat().map(e=>e.text??e.message?.content).filter(e=>typeof e==`string`);t.length>0&&bq(n,sG,TP(t,String))}}Mq(e.llmOutput,n);let r=e.llmOutput,i=e.generations?.[0]?.[0]?.message,a=r?.model_name??r?.model??i?.response_metadata?.model_name;a&&bq(n,ZW,a);let o=r?.id??i?.id;o&&bq(n,QW,o);let s=r?.stop_reason??i?.response_metadata?.finish_reason;return s&&bq(n,$W,TP(s,String)),n}function Pq(e){let t={},n=e?.lc_agent_name;return typeof n==`string`&&(t[dG]=n),t}function Fq(e){let t=e?.invocation_params?.tools??e?.options?.tools;if(!Array.isArray(t)||t.length===0)return;let n=t.map(e=>{let t=e.function;return{type:`function`,name:e.name??t?.name??``,description:e.description??t?.description}});return JSON.stringify(n)}function Iq(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.addHandler==`function`&&typeof t.copy==`function`}function Lq(e){return typeof e==`object`&&e?.name===`SentryCallbackHandler`}function Rq(e){return e.some(Lq)}function zq(e,t){if(!e)return[t];if(Iq(e)){if(Rq(e.handlers??[]))return e;let n=e.copy();return n.addHandler(t,!0),n}let n=Array.isArray(e)?e:[e];return Rq(n)?e:[...n,t]}function Bq(e={}){let{recordInputs:t,recordOutputs:n}=oK(e),r=sK(e.enableTruncation),i=new Map,a=e=>{let t=i.get(e);t?.isRecording()&&(t.end(),i.delete(e))},o={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(e,n,a,o,s,c,l,u){let d=Tq(c),f=kq(e,n,t,r,d,l),p=f[BW],m=f[rG];gR({name:`${m} ${p}`,op:`gen_ai.chat`,attributes:{...Pq(l),...f,[BF]:`gen_ai.chat`}},e=>(i.set(a,e),e))},handleChatModelStart(e,n,a,o,s,c,l,u){let d=Tq(c),f=Aq(e,n,t,r,d,l),p=Fq(s);p&&(f[cG]=p);let m=f[BW],h=f[rG];gR({name:`${h} ${m}`,op:`gen_ai.chat`,attributes:{...Pq(l),...f,[BF]:`gen_ai.chat`}},e=>(i.set(a,e),e))},handleLLMEnd(e,t,r,o,s){let c=i.get(t);if(c?.isRecording()){let r=Nq(e,n);r&&c.setAttributes(r),a(t)}},handleLLMError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t)),Hz(e,{mechanism:{handled:!1,type:`${vq}.llm_error_handler`}})},handleChainStart(e,n,r,a,o,s,c,l){if(s?.__sentry_langgraph__)return;let u=l||e.name||`unknown_chain`,d={[VF]:`auto.ai.langchain`,"langchain.chain.name":u};t&&(d[`langchain.chain.inputs`]=JSON.stringify(n)),gR({name:`chain ${u}`,op:`gen_ai.invoke_agent`,attributes:{...d,[BF]:`gen_ai.invoke_agent`}},e=>(i.set(r,e),e))},handleChainEnd(e,t){let r=i.get(t);r?.isRecording()&&(n&&r.setAttributes({"langchain.chain.outputs":JSON.stringify(e)}),a(t))},handleChainError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t)),Hz(e,{mechanism:{handled:!1,type:`${vq}.chain_error_handler`}})},handleToolStart(e,n,r,a,o,s,c){if(s?.__sentry_langgraph__)return;let l=c||e.name||`unknown_tool`,u={...Pq(s),[VF]:vq,[rG]:`execute_tool`,[bG]:l};t&&(u[CG]=n),gR({name:`execute_tool ${l}`,op:`gen_ai.execute_tool`,attributes:{...u,[BF]:`gen_ai.execute_tool`}},e=>(i.set(r,e),e))},handleToolEnd(e,t){let r=i.get(t);if(r?.isRecording()){if(n){let t=e,n=t&&typeof t==`object`&&`content`in t?t.content:e;r.setAttributes({[wG]:typeof n==`string`?n:JSON.stringify(n)})}a(t)}},handleToolError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t)),Hz(e,{mechanism:{handled:!1,type:`${vq}.tool_error_handler`}})},copy(){return o},toJSON(){return{lc:1,type:`not_implemented`,id:o.lc_id}},toJSONNotImplemented(){return{lc:1,type:`not_implemented`,id:o.lc_id}}};return o}function Vq(e){let 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 Hq(e){let t=e??{},n={[VF]:vq,[BF]:vG,[rG]:`embeddings`,[BW]:t.model??`unknown`};return n[zW]=Vq(t),`dimensions`in t&&(n[YW]=t.dimensions),`encodingFormat`in t&&(n[JW]=t.encodingFormat),n}function Uq(e,t,n={}){let{recordInputs:r}=oK(n),i=Hq(e),a=i[`gen_ai.request.model`]||`unknown`;return r&&t!=null&&(i[_G]=typeof t==`string`?t:JSON.stringify(t)),{name:`embeddings ${a}`,op:vG,attributes:i}}function Wq(e,t={}){return new Proxy(e,{apply(e,n,r){return hR(Uq(n,r[0],t),()=>Reflect.apply(e,n,r).then(void 0,e=>{throw Hz(e,{mechanism:{handled:!1,type:`auto.ai.langchain`}}),e}))}})}function Gq(e,t){let n=e;return typeof n.embedQuery==`function`&&(n.embedQuery=Wq(n.embedQuery,t)),typeof n.embedDocuments==`function`&&(n.embedDocuments=Wq(n.embedDocuments,t)),e}var Kq=`auto.ai.langgraph`;function qq(e){let t=e[0];if(typeof t!=`object`||!t||!(`llm`in t)||!t.llm||typeof t.llm!=`object`)return null;let n=t.llm;return typeof n.modelName!=`string`&&typeof n.model!=`string`?null:n}function Jq(e){let t=e[0];return typeof t==`object`&&t&&`name`in t&&typeof t.name==`string`?t.name:null}function Yq(e,t,n){let r=`__sentry_tool_wrapped__`;for(let i of e){if(!i||typeof i!=`object`)continue;let e=i,a=e.invoke;if(typeof a!=`function`||Object.prototype.hasOwnProperty.call(e,r))continue;let o=typeof e.name==`string`?e.name:`unknown_tool`,s=typeof e.description==`string`?e.description:void 0;e.invoke=new Proxy(a,{apply(e,r,i){let a={[VF]:Kq,[BF]:yG,[rG]:`execute_tool`,[bG]:o,[SG]:`function`},c=i[1]?.metadata?.lc_agent_name??n;typeof c==`string`&&(a[dG]=c),s&&(a[TG]=s);let l=i[0];if(typeof l==`object`&&l&&(`id`in l&&typeof l.id==`string`&&(a[xG]=l.id),t.recordInputs)){let e=`args`in l&&typeof l.args==`object`?l.args:l;try{a[CG]=JSON.stringify(e)}catch{}}return hR({op:yG,name:`execute_tool ${o}`,attributes:a},async n=>{try{let a=await Reflect.apply(e,r,i);if(t.recordOutputs)try{let e=a,t=e&&typeof e==`object`&&`content`in e?e.content:a;n.setAttribute(wG,typeof t==`string`?t:JSON.stringify(t))}catch{}return a}catch(e){throw n.setStatus({code:2,message:`internal_error`}),Hz(e,{mechanism:{handled:!1,type:`auto.ai.langgraph.error`}}),e}})}}),Object.defineProperty(e,r,{value:!0,enumerable:!1})}return e}function Xq(e){if(!e||e.length===0)return null;let t=[];for(let n of e)if(n&&typeof n==`object`){let e=n.tool_calls;e&&Array.isArray(e)&&t.push(...e)}return t.length>0?t:null}function Zq(e){let t=e,n=0,r=0,i=0;if(t.usage_metadata&&typeof t.usage_metadata==`object`){let e=t.usage_metadata;return typeof e.input_tokens==`number`&&(n=e.input_tokens),typeof e.output_tokens==`number`&&(r=e.output_tokens),typeof e.total_tokens==`number`&&(i=e.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:i}}if(t.response_metadata&&typeof t.response_metadata==`object`){let e=t.response_metadata;if(e.tokenUsage&&typeof e.tokenUsage==`object`){let t=e.tokenUsage;typeof t.promptTokens==`number`&&(n=t.promptTokens),typeof t.completionTokens==`number`&&(r=t.completionTokens),typeof t.totalTokens==`number`&&(i=t.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:i}}function Qq(e,t){let n=t;if(n.response_metadata&&typeof n.response_metadata==`object`){let t=n.response_metadata;t.model_name&&typeof t.model_name==`string`&&e.setAttribute(ZW,t.model_name),t.finish_reason&&typeof t.finish_reason==`string`&&e.setAttribute(XW,[t.finish_reason])}}function $q(e){if(!e.builder?.nodes?.tools?.runnable?.tools)return null;let t=e.builder?.nodes?.tools?.runnable?.tools;return!t||!Array.isArray(t)||t.length===0?null:t.map(e=>({name:e.lc_kwargs?.name,description:e.lc_kwargs?.description,schema:e.lc_kwargs?.schema}))}function eJ(e,t,n){let r=n?.messages;if(!r||!Array.isArray(r))return;let i=t?.length??0,a=r.length>i?r.slice(i):[];if(a.length===0)return;let o=Xq(a);o&&e.setAttribute(uG,JSON.stringify(o));let s=Eq(a);e.setAttribute(sG,JSON.stringify(s));let c=0,l=0,u=0;for(let t of a){let n=Zq(t);c+=n.inputTokens,l+=n.outputTokens,u+=n.totalTokens,Qq(e,t)}c>0&&e.setAttribute(eG,c),l>0&&e.setAttribute(tG,l),u>0&&e.setAttribute(nG,u)}var tJ=!1,nJ=`__sentry_patched__`;function rJ(e){let t={[VF]:Kq,[BF]:`gen_ai.create_agent`,[rG]:`create_agent`};return e&&(t[dG]=e),{op:`gen_ai.create_agent`,name:e?`create_agent ${e}`:`create_agent`,attributes:t}}function iJ(e,t){if(Object.prototype.hasOwnProperty.call(e,nJ))return e;let n=Bq(t),r=new Proxy(e,{apply(e,r,i){return tJ?Reflect.apply(e,r,i):hR(rJ(),a=>{try{let o=Reflect.apply(e,r,i),s=i.length>0?i[0]:{};s?.name&&typeof s.name==`string`&&(a.setAttribute(dG,s.name),a.updateName(`create_agent ${s.name}`));let c=o.invoke;return c&&typeof c==`function`&&(o.invoke=aJ(c.bind(o),o,s,t,void 0,n)),o}catch(e){throw a.setStatus({code:2,message:`internal_error`}),Hz(e,{mechanism:{handled:!1,type:`auto.ai.langgraph.error`}}),e}})}});return Object.defineProperty(r,nJ,{value:!0,enumerable:!1}),r}function aJ(e,t,n,r,i,a){return new Proxy(e,{apply(e,o,s){let c=i?.modelName??i?.model;return hR({op:`gen_ai.invoke_agent`,name:`invoke_agent`,attributes:{[VF]:Kq,[BF]:gG,[rG]:`invoke_agent`}},async i=>{try{let l=n?.name;l&&typeof l==`string`&&(i.setAttribute(fG,l),i.setAttribute(dG,l),i.updateName(`invoke_agent ${l}`)),c&&i.setAttribute(BW,c);let u=(s.length>1?s[1]:void 0)?.configurable?.thread_id;if(u&&typeof u==`string`&&i.setAttribute(pG,u),a){let e=s[1]??{};s[1]=e,e.metadata={...e.metadata??{},__sentry_langgraph__:!0,...typeof l==`string`?{lc_agent_name:l}:{}},e.callbacks=zq(e.callbacks,a)}let d=$q(t);d&&i.setAttribute(cG,JSON.stringify(d));let f=r.recordInputs,p=r.recordOutputs,m=s.length>0?s[0]?.messages??[]:[];if(m&&f){let{systemInstructions:e,filteredMessages:t}=fK(Eq(m));e&&i.setAttribute(oG,e);let n=sK(r.enableTruncation),a=Array.isArray(t)?t.length:0;i.setAttributes({[aG]:n?dK(t):TP(t),[iG]:a})}let h=await Reflect.apply(e,o,s);return p&&eJ(i,m??null,h),h}catch(e){throw i.setStatus({code:2,message:`internal_error`}),Hz(e,{mechanism:{handled:!1,type:`auto.ai.langgraph.error`}}),e}})}})}function oJ(e,t){if(Object.prototype.hasOwnProperty.call(e,nJ))return e;let n=oK(t),r=Bq(n),i=new Proxy(e,{apply(e,t,i){let a=qq(i),o=Jq(i),s=i[0];s&&Array.isArray(s.tools)&&s.tools.length>0&&Yq(s.tools,n,o??void 0),tJ=!0;let c;try{c=Reflect.apply(e,t,i)}finally{tJ=!1}let l=c.invoke;if(l&&typeof l==`function`){let e={};o&&(e.name=o),c.invoke=aJ(l.bind(c),c,e,n,a,r)}return c}});return Object.defineProperty(i,nJ,{value:!0,enumerable:!1}),i}function sJ(e,t){return e.compile=iJ(e.compile,oK(t)),e}function cJ(e,t,n){let r=n.getOptions(),i=n.getDsn(),a=r.tunnel,o=qL(r._metadata),s={sent_at:new Date(lP()).toISOString(),...lJ(t)&&{trace:t},...o&&{sdk:o},...!!a&&i&&{dsn:TI(i)}},c=n.getDataCollectionOptions().userInfo?`auto`:`never`;return FL(s,[[{type:`span`,item_count:e.length,content_type:`application/vnd.sentry.items.span.v2+json`},{version:2,...jB()&&{ingest_settings:{infer_ip:c,infer_user_agent:c}},items:e}]])}function lJ(e){return!!e.trace_id&&!!e.public_key}function uJ(e){let t=156;if(t+=e.name.length*2,t+=EF(e.attributes),e.links&&e.links.length>0){let n=e.links[0]?.attributes,r=100+(n?EF(n):0);t+=r*e.links.length}return t}var dJ=1e3,fJ=5e6,pJ=class{constructor(e,t){this._traceBuckets=new Map,this._client=e;let{maxSpanLimit:n,flushInterval:r,maxTraceWeightInBytes:i}=t??{};this._maxSpanLimit=n&&n>0&&n<=dJ?n:dJ,this._flushInterval=r&&r>0?r:5e3,this._maxTraceWeight=i&&i>0?i:fJ,this._client.on(`flush`,()=>{this.drain()}),this._client.on(`close`,()=>{this._traceBuckets.forEach(e=>{clearTimeout(e.timeout)}),this._traceBuckets.clear()})}add(e){let t=e.trace_id,n=this._traceBuckets.get(t);n||(n={spans:new Set,size:0,timeout:cB(setTimeout(()=>{this.flush(t)},this._flushInterval))},this._traceBuckets.set(t,n)),n.spans.add(e),n.size+=uJ(e),(n.spans.size>=this._maxSpanLimit||n.size>=this._maxTraceWeight)&&this.flush(t)}drain(){this._traceBuckets.size&&(U&&G.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((e,t)=>{this.flush(t)}))}flush(e){let t=this._traceBuckets.get(e);if(!t)return;if(!t.spans.size){this._removeTrace(e);return}let n=Array.from(t.spans),r=n[0]?._segmentSpan;if(!r){U&&G.warn(`No segment span reference found on span JSON, cannot compute DSC`),this._removeTrace(e);return}let i=jL(r),a=n.map(e=>{let{_segmentSpan:t,...n}=e;return n}),o=cJ(a,i,this._client);U&&G.log(`Sending span envelope for trace ${e} with ${a.length} spans`),this._client.sendEnvelope(o).then(null,e=>{U&&G.error(`Error while sending streamed span envelope:`,e)}),this._removeTrace(e)}_removeTrace(e){let t=this._traceBuckets.get(e);t&&clearTimeout(t.timeout),this._traceBuckets.delete(e)}};function mJ(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}var hJ=W;function gJ(){return`history`in hJ&&!!hJ.history}function _J(){if(!(`fetch`in hJ))return!1;try{return new Headers,new Request(`data:,`),new Response,!0}catch{return!1}}function vJ(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function yJ(){if(typeof EdgeRuntime==`string`)return!0;if(!_J())return!1;if(vJ(hJ.fetch))return!0;let e=!1,t=hJ.document;if(t&&typeof t.createElement==`function`)try{let n=t.createElement(`iframe`);n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=vJ(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){U&&G.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return e}function bJ(){return`ReportingObserver`in hJ}function xJ(e,t){let n=`fetch`,r=ON(n,e);return kN(n,()=>CJ(void 0,t)),r}function SJ(e){let t=`fetch-body-resolved`,n=ON(t,e);return kN(t,()=>CJ(TJ)),n}function CJ(e,t=!1){t&&!yJ()||$N(W,`fetch`,function(t){return function(...n){let r=Error(),{method:i,url:a}=OJ(n),o={args:n,fetchData:{method:i,url:a},startTimestamp:KP()*1e3,virtualError:r,headers:kJ(n)};return e||AN(`fetch`,{...o}),t.apply(W,n).then(async t=>(e?e(t):AN(`fetch`,{...o,endTimestamp:KP()*1e3,response:t}),t),e=>{AN(`fetch`,{...o,endTimestamp:KP()*1e3,error:e}),RN(e)&&e.stack===void 0&&(e.stack=r.stack,eP(e,`framesToPop`,1));let t=q()?.getOptions().enhanceFetchErrorMessages??`always`;if(t!==!1&&e instanceof TypeError&&(e.message===`Failed to fetch`||e.message===`Load failed`||e.message===`NetworkError when attempting to fetch resource.`))try{let n=new URL(o.fetchData.url).host;t===`always`?e.message=`${e.message} (${n})`:eP(e,`__sentry_fetch_url_host__`,n)}catch{}throw e})}})}async function wJ(e,t){if(e?.body){let n=e.body,r=n.getReader(),i=setTimeout(()=>{n.cancel().then(null,()=>{})},9e4),a=!0;for(;a;){let e;try{e=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:i}=await r.read();clearTimeout(e),i&&(t(),a=!1)}catch{a=!1}finally{clearTimeout(e)}}clearTimeout(i),r.releaseLock(),n.cancel().then(null,()=>{})}}function TJ(e){let t;try{t=e.clone()}catch{return}wJ(t,()=>{AN(`fetch-body-resolved`,{endTimestamp:KP()*1e3,response:e})})}function EJ(e,t){return qN(e)&&!!e[t]}function DJ(e){return typeof e==`string`?e:e?EJ(e,`url`)?e.url:e.toString?e.toString():``:``}function OJ(e){if(e.length===0)return{method:`GET`,url:``};if(e.length===2){let[t,n]=e;return{url:DJ(t),method:EJ(n,`method`)?String(n.method).toUpperCase():QN(t)&&EJ(t,`method`)?String(t.method).toUpperCase():`GET`}}let t=e[0];return{url:DJ(t),method:EJ(t,`method`)?String(t.method).toUpperCase():`GET`}}function kJ(e){let[t,n]=e;try{if(typeof n==`object`&&n&&`headers`in n&&n.headers)return new Headers(n.headers);if(QN(t))return new Headers(t.headers)}catch{}}function AJ(e,t=!1){return!(t||e&&!e.startsWith(`/`)&&!e.match(/^[A-Z]:/)&&!e.startsWith(`.`)&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes(`node_modules/`)}function jJ(e){let t=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,r=/at (?:async )?(.+?) \(data:(.*?),/;return i=>{let a=i.match(r);if(a)return{filename:`<data:${a[2]}>`,function:a[1]};let o=i.match(n);if(o){let t,n,r,i,a;if(o[1]){r=o[1];let e=r.lastIndexOf(`.`);if(r[e-1]===`.`&&e--,e>0){t=r.slice(0,e),n=r.slice(e+1);let i=t.indexOf(`.Module`);i>0&&(r=r.slice(i+1),t=t.slice(0,i))}i=void 0}n&&(i=t,a=n),n===`<anonymous>`&&(a=void 0,r=void 0),r===void 0&&(a||=`?`,r=i?`${i}.${a}`:a);let s=TN(o[2]),c=o[5]===`native`;!s&&o[5]&&!c&&(s=o[5]);let l=s?PJ(s):void 0;return{filename:l??s,module:l&&e?.(l),function:r,lineno:NJ(o[3]),colno:NJ(o[4]),in_app:AJ(s||``,c)}}if(i.match(t))return{filename:i}}}function MJ(e){return[90,jJ(e)]}function NJ(e){return parseInt(e||``,10)||void 0}function PJ(e){try{return decodeURI(e)}catch{return}}var FJ=W;function IJ(){try{return FJ.document.location.href}catch{return``}}function LJ(e,t=5){if(!FJ.HTMLElement)return null;let n=e;for(let e=0;e<t;e++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}var RJ;(function(e){e[e.Classic=1]=`Classic`,e[e.Protocol=2]=`Protocol`,e[e.Both=3]=`Both`})(RJ||={});function zJ(e){return{createUrl:t=>`${e}://${t}/sentry_key`,urlMatches:function(e,t){return e.startsWith(this.createUrl(t))},createKey:t=>`${e}.${t}`,namespace:e}}var BJ=`sentry-electron-renderer-id`;function VJ(e){let t=zJ(e);if(window.__SENTRY_IPC__?.[t.namespace])return window.__SENTRY_IPC__[t.namespace];{G.log(`IPC was not configured in preload script, falling back to custom protocol and fetch`);let e=window.__SENTRY_RENDERER_ID__=PP(),n={[BJ]:e};return{sendRendererStart:()=>{fetch(t.createUrl(`start`),{method:`POST`,body:``,headers:n}).catch(()=>{console.error(`Sentry SDK failed to establish connection with the Electron main process.
|
|
520
|
+
- Ensure you have initialized the SDK in the main process
|
|
521
|
+
- If your renderers use custom sessions, be sure to set 'getSessions' in the main process options
|
|
522
|
+
- If you are bundling your main process code and using Electron < v5, you'll need to manually configure a preload script`)})},sendScope:e=>{fetch(t.createUrl(`scope`),{method:`POST`,body:e,headers:n}).catch(()=>{})},sendEnvelope:e=>{let r=typeof e==`string`?e:e.buffer instanceof ArrayBuffer?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):Uint8Array.from(e).buffer;fetch(t.createUrl(`envelope`),{method:`POST`,body:r,headers:n}).catch(()=>{})},sendStatus:e=>{fetch(t.createUrl(`status`),{method:`POST`,body:JSON.stringify({status:e}),headers:n}).catch(()=>{})},sendStructuredLog:e=>{fetch(t.createUrl(`structured-log`),{method:`POST`,body:JSON.stringify(e),headers:n}).catch(()=>{})},sendMetric:e=>{fetch(t.createUrl(`metric`),{method:`POST`,body:JSON.stringify(e),headers:n}).catch(()=>{})}}}}var HJ;function UJ(e=q()){if(!e)throw Error(`Could not find client, make sure to call Sentry.init before getIPC`);HJ||=new WeakMap;let t=HJ.get(e);if(t)return t;let n=e.getOptions().ipcNamespace,r=VJ(n);return HJ.set(e,r),r.sendRendererStart(),r}var WJ=e({debug:()=>qJ,error:()=>XJ,fatal:()=>ZJ,fmt:()=>cH,info:()=>JJ,trace:()=>KJ,warn:()=>YJ});function GJ(e,t,n,r){let i=q();RB({level:e,message:t,attributes:n,severityNumber:r},K(),(e,t)=>UJ(i).sendStructuredLog(t))}function KJ(e,t){GJ(`trace`,e,t)}function qJ(e,t){GJ(`debug`,e,t)}function JJ(e,t){GJ(`info`,e,t)}function YJ(e,t){GJ(`warn`,e,t)}function XJ(e,t){GJ(`error`,e,t)}function ZJ(e,t){GJ(`fatal`,e,t)}var QJ=e({count:()=>eY,distribution:()=>nY,gauge:()=>tY});function $J(e,t,n,r){let i=q();ZB({type:e,name:t,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope??K(),captureSerializedMetric:(e,t)=>UJ(i).sendMetric(t)})}function eY(e,t=1,n){$J(`counter`,e,t,n)}function tY(e,t,n){$J(`gauge`,e,t,n)}function nY(e,t,n){$J(`distribution`,e,t,n)}var rY=W,iY=rY.document,aY=rY.navigator,oY=`Report a Bug`,sY=`Cancel`,cY=`Send Bug Report`,lY=`Confirm`,uY=`Report a Bug`,dY=`your.email@example.org`,fY=`Email`,pY=`What's the bug? What did you expect?`,mY=`Description`,hY=`Your Name`,gY=`Name`,_Y=`Thank you for your report!`,vY=`(required)`,yY=`Add a screenshot`,bY=`Remove screenshot`,xY=`Highlight`,SY=`Hide`,CY=`Remove`,wY=`Unable to submit feedback with empty message`,TY=`No client setup, cannot send feedback.`,EY=`Unable to determine if Feedback was correctly sent.`,DY=`Unable to send feedback. This could be because this domain is not in your list of allowed domains.`,OY=`Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.`,kY=`widget`,AY=`api`,jY=5e3,MY={ERROR_EMPTY_MESSAGE:wY,ERROR_NO_CLIENT:TY,ERROR_TIMEOUT:EY,ERROR_FORBIDDEN:DY,ERROR_GENERIC:OY};function NY(e,t){return t?.[e]??MY[e]}function PY(e,t){return Error(NY(e,t))}var FY=(e,t={includeReplay:!0})=>{let n=t.errorMessages;if(!e.message)throw PY(`ERROR_EMPTY_MESSAGE`,n);let r=q();if(!r)throw PY(`ERROR_NO_CLIENT`,n);e.tags&&Object.keys(e.tags).length&&K().setTags(e.tags);let i=xW({source:AY,url:IJ(),...e},t);return new Promise((e,t)=>{let a=setTimeout(()=>{o(),t(NY(`ERROR_TIMEOUT`,n))},3e4),o=r.on(`afterSendEvent`,(r,s)=>{if(r.event_id===i)return clearTimeout(a),o(),s?.statusCode&&s.statusCode>=200&&s.statusCode<300?e(i):s?.statusCode===403?t(NY(`ERROR_FORBIDDEN`,n)):t(NY(`ERROR_GENERIC`,n))})})},IY=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;function LY(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(aY.userAgent)||/Macintosh/i.test(aY.userAgent)&&aY.maxTouchPoints&&aY.maxTouchPoints>1||!isSecureContext)}function RY(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 zY(e){let t=iY.createElement(`style`);return t.textContent=`
|
|
523
|
+
.widget__actor {
|
|
524
|
+
position: fixed;
|
|
525
|
+
z-index: var(--z-index);
|
|
526
|
+
margin: var(--page-margin);
|
|
527
|
+
inset: var(--actor-inset);
|
|
528
|
+
|
|
529
|
+
display: flex;
|
|
530
|
+
align-items: center;
|
|
531
|
+
gap: 8px;
|
|
532
|
+
padding: 16px;
|
|
533
|
+
|
|
534
|
+
font-family: inherit;
|
|
535
|
+
font-size: var(--font-size);
|
|
536
|
+
font-weight: 600;
|
|
537
|
+
line-height: 1.14em;
|
|
538
|
+
text-decoration: none;
|
|
539
|
+
|
|
540
|
+
background: var(--actor-background, var(--background));
|
|
541
|
+
border-radius: var(--actor-border-radius, 1.7em/50%);
|
|
542
|
+
border: var(--actor-border, var(--border));
|
|
543
|
+
box-shadow: var(--actor-box-shadow, var(--box-shadow));
|
|
544
|
+
color: var(--actor-color, var(--foreground));
|
|
545
|
+
fill: var(--actor-color, var(--foreground));
|
|
546
|
+
cursor: pointer;
|
|
547
|
+
opacity: 1;
|
|
548
|
+
transition: transform 0.2s ease-in-out;
|
|
549
|
+
transform: translate(0, 0) scale(1);
|
|
550
|
+
}
|
|
551
|
+
.widget__actor[aria-hidden="true"] {
|
|
552
|
+
opacity: 0;
|
|
553
|
+
pointer-events: none;
|
|
554
|
+
visibility: hidden;
|
|
555
|
+
transform: translate(0, 16px) scale(0.98);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
.widget__actor:hover {
|
|
559
|
+
background: var(--actor-hover-background, var(--background));
|
|
560
|
+
filter: var(--interactive-filter);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.widget__actor svg {
|
|
564
|
+
width: 1.14em;
|
|
565
|
+
height: 1.14em;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
@media (max-width: 600px) {
|
|
569
|
+
.widget__actor span {
|
|
570
|
+
display: none;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
`,e&&t.setAttribute(`nonce`,e),t}function BY(e,t){return Object.entries(t).forEach(([t,n])=>{e.setAttributeNS(null,t,n)}),e}var VY=20,HY=`http://www.w3.org/2000/svg`;function UY(){let e=e=>rY.document.createElementNS(HY,e),t=BY(e(`svg`),{width:`${VY}`,height:`${VY}`,viewBox:`0 0 ${VY} ${VY}`,fill:`var(--actor-color, var(--foreground))`}),n=BY(e(`g`),{clipPath:`url(#clip0_57_80)`}),r=BY(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);let i=e(`defs`),a=BY(e(`clipPath`),{id:`clip0_57_80`}),o=BY(e(`rect`),{width:`${VY}`,height:`${VY}`,fill:`white`});return a.appendChild(o),i.appendChild(a),t.appendChild(i).appendChild(a).appendChild(o),t}function WY({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){let i=iY.createElement(`button`);if(i.type=`button`,i.className=`widget__actor`,i.ariaHidden=`false`,i.ariaLabel=t||e||oY,i.appendChild(UY()),e){let t=iY.createElement(`span`);t.appendChild(iY.createTextNode(e)),i.appendChild(t)}let a=zY(r);return{el:i,appendToDom(){n.appendChild(a),n.appendChild(i)},removeFromDom(){i.remove(),a.remove()},show(){i.ariaHidden=`false`},hide(){i.ariaHidden=`true`}}}var GY=`rgba(88, 74, 192, 1)`,KY={foreground:`#2b2233`,background:`#ffffff`,accentForeground:`white`,accentBackground:GY,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%)`},qY={foreground:`#ebe6ef`,background:`#29232f`,accentForeground:`white`,accentBackground:GY,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 JY(e){return`
|
|
574
|
+
--foreground: ${e.foreground};
|
|
575
|
+
--background: ${e.background};
|
|
576
|
+
--accent-foreground: ${e.accentForeground};
|
|
577
|
+
--accent-background: ${e.accentBackground};
|
|
578
|
+
--success-color: ${e.successColor};
|
|
579
|
+
--error-color: ${e.errorColor};
|
|
580
|
+
--border: ${e.border};
|
|
581
|
+
--box-shadow: ${e.boxShadow};
|
|
582
|
+
--outline: ${e.outline};
|
|
583
|
+
--interactive-filter: ${e.interactiveFilter};
|
|
584
|
+
`}function YY({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){let i=iY.createElement(`style`);return i.textContent=`
|
|
585
|
+
:host {
|
|
586
|
+
--font-family: system-ui, 'Helvetica Neue', Arial, sans-serif;
|
|
587
|
+
--font-size: 14px;
|
|
588
|
+
--z-index: 100000;
|
|
589
|
+
|
|
590
|
+
--page-margin: 16px;
|
|
591
|
+
--inset: auto 0 0 auto;
|
|
592
|
+
--actor-inset: var(--inset);
|
|
593
|
+
|
|
594
|
+
font-family: var(--font-family);
|
|
595
|
+
font-size: var(--font-size);
|
|
596
|
+
|
|
597
|
+
${e===`system`?``:`color-scheme: only ${e};`}
|
|
598
|
+
|
|
599
|
+
${JY(e===`dark`?{...qY,...t}:{...KY,...n})}
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
${e===`system`?`
|
|
603
|
+
@media (prefers-color-scheme: dark) {
|
|
604
|
+
:host {
|
|
605
|
+
color-scheme: only dark;
|
|
606
|
+
|
|
607
|
+
${JY({...qY,...t})}
|
|
608
|
+
}
|
|
609
|
+
}`:``}
|
|
610
|
+
`,r&&i.setAttribute(`nonce`,r),i}var XY=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>(({id:r=`sentry-feedback`,autoInject:i=!0,showBranding:a=!0,isEmailRequired:o=!1,isNameRequired:s=!1,showEmail:c=!0,showName:l=!0,enableScreenshot:u=!0,useSentryUser:d={email:`email`,name:`username`},tags:f,styleNonce:p,scriptNonce:m,colorScheme:h=`system`,themeLight:g={},themeDark:_={},addScreenshotButtonLabel:v=yY,cancelButtonLabel:y=sY,confirmButtonLabel:b=lY,emailLabel:x=fY,emailPlaceholder:S=dY,formTitle:C=uY,isRequiredLabel:w=vY,messageLabel:T=mY,messagePlaceholder:ee=pY,nameLabel:E=gY,namePlaceholder:te=hY,removeScreenshotButtonLabel:ne=bY,submitButtonLabel:re=cY,successMessageText:ie=_Y,triggerLabel:ae=oY,triggerAriaLabel:oe=``,highlightToolText:D=xY,hideToolText:se=SY,removeHighlightText:ce=CY,errorEmptyMessageText:le=wY,errorNoClientText:ue=TY,errorTimeoutText:de=EY,errorForbiddenText:fe=DY,errorGenericText:pe=OY,onFormOpen:me,onFormClose:he,onSubmitSuccess:ge,onSubmitError:_e,onFormSubmitted:ve}={})=>{let ye={id:r,autoInject:i,showBranding:a,isEmailRequired:o,isNameRequired:s,showEmail:c,showName:l,enableScreenshot:u,useSentryUser:d,tags:f,styleNonce:p,scriptNonce:m,colorScheme:h,themeDark:_,themeLight:g,triggerLabel:ae,triggerAriaLabel:oe,cancelButtonLabel:y,submitButtonLabel:re,confirmButtonLabel:b,formTitle:C,emailLabel:x,emailPlaceholder:S,messageLabel:T,messagePlaceholder:ee,nameLabel:E,namePlaceholder:te,successMessageText:ie,isRequiredLabel:w,addScreenshotButtonLabel:v,removeScreenshotButtonLabel:ne,highlightToolText:D,hideToolText:se,removeHighlightText:ce,errorEmptyMessageText:le,errorNoClientText:ue,errorTimeoutText:de,errorForbiddenText:fe,errorGenericText:pe,onFormClose:he,onFormOpen:me,onSubmitError:_e,onSubmitSuccess:ge,onFormSubmitted:ve},O=null,be=null,k=[],xe=e=>{if(!O){let t=iY.createElement(`div`);t.id=String(e.id),iY.body.appendChild(t),O=t.attachShadow({mode:`open`}),be=YY(e),O.appendChild(be)}return O},Se=async r=>{let i=r.enableScreenshot&&LY(),a,o;try{a=(t?t():await e(`feedbackModalIntegration`,m))(),bB(a)}catch{throw IY&&G.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),Error(`[Feedback] Missing feedback modal integration!`)}try{let t=i?n?n():await e(`feedbackScreenshotIntegration`,m):void 0;t&&(o=t(),bB(o))}catch{IY&&G.error(`[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.`)}let s={ERROR_EMPTY_MESSAGE:r.errorEmptyMessageText,ERROR_NO_CLIENT:r.errorNoClientText,ERROR_TIMEOUT:r.errorTimeoutText,ERROR_FORBIDDEN:r.errorForbiddenText,ERROR_GENERIC:r.errorGenericText},c=(e,t)=>FY(e,{includeReplay:!0,...t,errorMessages:s}),l=a.createDialog({options:{...r,onFormClose:()=>{l?.close(),r.onFormClose?.()},onFormSubmitted:()=>{l?.close(),r.onFormSubmitted?.()}},screenshotIntegration:o,sendFeedback:c,shadow:xe(r)});return l},Ce=(e,t={})=>{let n=RY(ye,t),r=typeof e==`string`?iY.querySelector(e):typeof e.addEventListener==`function`?e:null;if(!r)throw IY&&G.error(`[Feedback] Unable to attach to target element`),Error(`Unable to attach to target element`);let i=null,a=async()=>{i||=await Se({...n,onFormSubmitted:()=>{i?.removeFromDom(),n.onFormSubmitted?.()}}),i.appendToDom(),i.open()};r.addEventListener(`click`,a);let o=()=>{k=k.filter(e=>e!==o),i?.removeFromDom(),i=null,r.removeEventListener(`click`,a)};return k.push(o),o},we=(e={})=>{let t=RY(ye,e),n=xe(t),r=WY({triggerLabel:t.triggerLabel,triggerAriaLabel:t.triggerAriaLabel,shadow:n,styleNonce:p});return Ce(r.el,{...t,onFormOpen(){r.hide()},onFormClose(){r.show()},onFormSubmitted(){r.show()}}),r};return{name:`Feedback`,setupOnce(){!jB()||!ye.autoInject||(iY.readyState===`loading`?iY.addEventListener(`DOMContentLoaded`,()=>we().appendToDom()):we().appendToDom())},attachTo:Ce,createWidget(e={}){let t=we(RY(ye,e));return t.appendToDom(),t},async createForm(e={}){return Se(RY(ye,e))},setTheme(e){if(ye.colorScheme=e,O){let e=YY(ye);be?O.replaceChild(e,be):O.prepend(e),be=e}},remove(){O&&(O.parentElement?.remove(),O=null,be=null),k.forEach(e=>e()),k=[]}}});function ZY(){return q()?.getIntegrationByName(`Feedback`)}var QY,$Y,eX,tX,nX,rX,iX,aX={},oX=[],sX=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,cX=Array.isArray;function lX(e,t){for(var n in t)e[n]=t[n];return e}function uX(e){var t=e.parentNode;t&&t.removeChild(e)}function dX(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?QY.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return fX(e,o,r,i,null)}function fX(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++eX,__i:-1,__u:0};return i==null&&$Y.vnode!=null&&$Y.vnode(a),a}function pX(e){return e.children}function mX(e,t){this.props=e,this.context=t}function hX(e,t){if(t==null)return e.__?hX(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?hX(e):null}function gX(e,t,n){var r,i=e.__v,a=i.__e,o=e.__P;if(o)return(r=lX({},i)).__v=i.__v+1,$Y.vnode&&$Y.vnode(r),OX(o,r,i,e.__n,o.ownerSVGElement!==void 0,32&i.__u?[a]:null,t,a??hX(i),!!(32&i.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=a&&_X(r),r}function _X(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return _X(e)}}function vX(e){(!e.__d&&(e.__d=!0)&&tX.push(e)&&!yX.__r++||nX!==$Y.debounceRendering)&&((nX=$Y.debounceRendering)||rX)(yX)}function yX(){var e,t,n,r=[],i=[];for(tX.sort(iX);e=tX.shift();)e.__d&&(n=tX.length,t=gX(e,r,i)||t,n===0||tX.length>n?(kX(r,t,i),i.length=r.length=0,t=void 0,tX.sort(iX)):t&&$Y.__c&&$Y.__c(t,oX));t&&kX(r,t,i),yX.__r=0}function bX(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g=r&&r.__k||oX,_=t.length;for(n.__d=c,xX(n,t,g),c=n.__d,d=0;d<_;d++)(p=n.__k[d])!=null&&typeof p!=`boolean`&&typeof p!=`function`&&(f=p.__i===-1?aX:g[p.__i]||aX,p.__i=d,OX(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&jX(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),65536&p.__u||f.__k===p.__k?c=SX(p,c,e):typeof p.type==`function`&&p.__d!==void 0?c=p.__d:m&&(c=m.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=c,n.__e=h}function xX(e,t,n){var r,i,a,o,s,c=t.length,l=n.length,u=l,d=0;for(e.__k=[],r=0;r<c;r++)(i=e.__k[r]=(i=t[r])==null||typeof i==`boolean`||typeof i==`function`?null:typeof i==`string`||typeof i==`number`||typeof i==`bigint`||i.constructor==String?fX(null,i,null,null,i):cX(i)?fX(pX,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?fX(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)==null?(a=n[r])&&a.key==null&&a.__e&&(a.__e==e.__d&&(e.__d=hX(a)),MX(a,a,!1),n[r]=null,u--):(i.__=e,i.__b=e.__b+1,s=CX(i,n,o=r+d,u),i.__i=s,a=null,s!==-1&&(u--,(a=n[s])&&(a.__u|=131072)),a==null||a.__v===null?(s==-1&&d--,typeof i.type!=`function`&&(i.__u|=65536)):s!==o&&(s===o+1?d++:s>o?u>c-o?d+=s-o:d--:d=s<o&&s==o-1?s-o:0,s!==r+d&&(i.__u|=65536)));if(u)for(r=0;r<l;r++)(a=n[r])!=null&&!(131072&a.__u)&&(a.__e==e.__d&&(e.__d=hX(a)),MX(a,a))}function SX(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=SX(r[i],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType===8);return t}function CX(e,t,n,r){var i=e.key,a=e.type,o=n-1,s=n+1,c=t[n];if(c===null||c&&i==c.key&&a===c.type)return n;if(r>+(c!=null&&!(131072&c.__u)))for(;o>=0||s<t.length;){if(o>=0){if((c=t[o])&&!(131072&c.__u)&&i==c.key&&a===c.type)return o;o--}if(s<t.length){if((c=t[s])&&!(131072&c.__u)&&i==c.key&&a===c.type)return s;s++}}return-1}function wX(e,t,n){t[0]===`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||sX.test(t)?n:n+`px`}function TX(e,t,n,r,i){var a;n:if(t===`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||wX(e.style,t,``);if(n)for(t in n)r&&n[t]===r[t]||wX(e.style,t,n[t])}else if(t[0]===`o`&&t[1]===`n`)a=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,`$1`)),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,a?DX:EX,a)):e.removeEventListener(t,a?DX:EX,a);else{if(i)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!==`width`&&t!==`height`&&t!==`href`&&t!==`list`&&t!==`form`&&t!==`tabIndex`&&t!==`download`&&t!==`rowSpan`&&t!==`colSpan`&&t!==`role`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!==`-`?e.removeAttribute(t):e.setAttribute(t,n))}}function EX(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t($Y.event?$Y.event(e):e)}}function DX(e){if(this.l)return this.l[e.type+!0]($Y.event?$Y.event(e):e)}function OX(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=$Y.__b)&&u(t);n:if(typeof T==`function`)try{if(_=t.props,v=(u=T.contextType)&&r[u.__c],y=u?v?v.props.value:u.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:(`prototype`in T&&T.prototype.render?t.__c=d=new T(_,y):(t.__c=d=new mX(_,y),d.constructor=T,d.render=NX),v&&v.sub(d),d.props=_,d.state||(d.state={}),d.context=y,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),d.__s??(d.__s=d.state),T.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=lX({},d.__s)),lX(d.__s,T.getDerivedStateFromProps(_,d.__s))),p=d.props,m=d.state,d.__v=t,f)T.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(T.getDerivedStateFromProps==null&&_!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(_,y),!d.__e&&(d.shouldComponentUpdate!=null&&!1===d.shouldComponentUpdate(_,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(e){e&&(e.__=t)}),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&o.push(d);break n}d.componentWillUpdate!=null&&d.componentWillUpdate(_,d.__s,y),d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(p,m,h)})}if(d.context=y,d.props=_,d.__P=e,d.__e=!1,x=$Y.__r,S=0,`prototype`in T&&T.prototype.render){for(d.state=d.__s,d.__d=!1,x&&x(t),u=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do d.__d=!1,x&&x(t),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++S<25);d.state=d.__s,d.getChildContext!=null&&(r=lX(lX({},r),d.getChildContext())),f||d.getSnapshotBeforeUpdate==null||(h=d.getSnapshotBeforeUpdate(p,m)),bX(e,cX(w=u!=null&&u.type===pX&&u.key==null?u.props.children:u)?w:[w],t,n,r,i,a,o,s,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),g&&(d.__E=d.__=null)}catch(e){t.__v=null,c||a!=null?(t.__e=s,t.__u|=c?160:32,a[a.indexOf(s)]=null):(t.__e=n.__e,t.__k=n.__k),$Y.__e(e,t,n)}else a==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=AX(n.__e,t,n,r,i,a,o,c,l);(u=$Y.diffed)&&u(t)}function kX(e,t,n){for(var r=0;r<n.length;r++)jX(n[r],n[++r],n[++r]);$Y.__c&&$Y.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){$Y.__e(e,t.__v)}})}function AX(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h,g=n.props,_=t.props,v=t.type;if(v===`svg`&&(i=!0),a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&`setAttribute`in p==!!v&&(v?p.localName===v:p.nodeType===3)){e=p,a[l]=null;break}}if(e==null){if(v===null)return document.createTextNode(_);e=i?document.createElementNS(`http://www.w3.org/2000/svg`,v):document.createElement(v,_.is&&_),a=null,s=!1}if(v===null)g===_||s&&e.data===_||(e.data=_);else{if(a&&=QY.call(e.childNodes),g=n.props||aX,!s&&a!=null)for(g={},l=0;l<e.attributes.length;l++)g[(p=e.attributes[l]).name]=p.value;for(l in g)p=g[l],l==`children`||(l==`dangerouslySetInnerHTML`?d=p:l===`key`||l in _||TX(e,l,null,p,i));for(l in _)p=_[l],l==`children`?f=p:l==`dangerouslySetInnerHTML`?u=p:l==`value`?m=p:l==`checked`?h=p:l===`key`||s&&typeof p!=`function`||g[l]===p||TX(e,l,p,g[l],i);if(u)s||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=``),bX(e,cX(f)?f:[f],t,n,r,i&&v!==`foreignObject`,a,o,a?a[0]:n.__k&&hX(n,0),s,c),a!=null)for(l=a.length;l--;)a[l]!=null&&uX(a[l]);s||(l=`value`,m!==void 0&&(m!==e[l]||v===`progress`&&!m||v===`option`&&m!==g[l])&&TX(e,l,m,g[l],!1),l=`checked`,h!==void 0&&h!==e[l]&&TX(e,l,h,g[l],!1))}return e}function jX(e,t,n){try{typeof e==`function`?e(t):e.current=t}catch(e){$Y.__e(e,n)}}function MX(e,t,n){var r,i;if($Y.unmount&&$Y.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||jX(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){$Y.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&MX(r[i],t,n||typeof e.type!=`function`);n||e.__e==null||uX(e.__e),e.__=e.__e=e.__d=void 0}function NX(e,t,n){return this.constructor(e,n)}function PX(e,t,n){var r,i,a,o;$Y.__&&$Y.__(e,t),i=(r=!1)?null:t.__k,a=[],o=[],OX(t,e=t.__k=dX(pX,null,[e]),i||aX,aX,t.ownerSVGElement!==void 0,i?null:t.firstChild?QY.call(t.childNodes):null,a,i?i.__e:t.firstChild,r,o),e.__d=void 0,kX(a,e,o)}QY=oX.slice,$Y={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},eX=0,mX.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=lX({},this.state);typeof e==`function`&&(e=e(lX({},n),this.props)),e&&lX(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),vX(this))},mX.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),vX(this))},mX.prototype.render=pX,tX=[],rX=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,iX=function(e,t){return e.__v.__b-t.__v.__b},yX.__r=0;var FX,IX,LX,RX,zX=0,BX=[],VX=[],HX=$Y,UX=HX.__b,WX=HX.__r,GX=HX.diffed,KX=HX.__c,qX=HX.unmount,JX=HX.__;function YX(e,t){HX.__h&&HX.__h(IX,e,zX||t),zX=0;var n=IX.__H||(IX.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:VX}),n.__[e]}function XX(e){return zX=1,ZX(mZ,e)}function ZX(e,t,n){var r=YX(FX++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):mZ(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=IX,!IX.u)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=!1;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),!(!o&&r.__c.props===e)&&(!a||a.call(this,e,t,n))};IX.u=!0;var a=IX.shouldComponentUpdate,o=IX.componentWillUpdate;IX.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},IX.shouldComponentUpdate=i}return r.__N||r.__}function QX(e,t){var n=YX(FX++,3);!HX.__s&&pZ(n.__H,t)&&(n.__=e,n.i=t,IX.__H.__h.push(n))}function $X(e,t){var n=YX(FX++,4);!HX.__s&&pZ(n.__H,t)&&(n.__=e,n.i=t,IX.__h.push(n))}function eZ(e){return zX=5,nZ(function(){return{current:e}},[])}function tZ(e,t,n){zX=6,$X(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 nZ(e,t){var n=YX(FX++,7);return pZ(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function rZ(e,t){return zX=8,nZ(function(){return e},t)}function iZ(e){var t=IX.context[e.__c],n=YX(FX++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(IX)),t.props.value):e.__}function aZ(e,t){HX.useDebugValue&&HX.useDebugValue(t?t(e):e)}function oZ(e){var t=YX(FX++,10),n=XX();return t.__=e,IX.componentDidCatch||(IX.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function sZ(){var e=YX(FX++,11);if(!e.__){for(var t=IX.__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 cZ(){for(var e;e=BX.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(dZ),e.__H.__h.forEach(fZ),e.__H.__h=[]}catch(t){e.__H.__h=[],HX.__e(t,e.__v)}}HX.__b=function(e){IX=null,UX&&UX(e)},HX.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),JX&&JX(e,t)},HX.__r=function(e){WX&&WX(e),FX=0;var t=(IX=e.__c).__H;t&&(LX===IX?(t.__h=[],IX.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.__V=VX,e.__N=e.i=void 0})):(t.__h.forEach(dZ),t.__h.forEach(fZ),t.__h=[],FX=0)),LX=IX},HX.diffed=function(e){GX&&GX(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(BX.push(t)!==1&&RX===HX.requestAnimationFrame||((RX=HX.requestAnimationFrame)||uZ)(cZ)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.__V!==VX&&(e.__=e.__V),e.i=void 0,e.__V=VX})),LX=IX=null},HX.__c=function(e,t){t.some(function(e){try{e.__h.forEach(dZ),e.__h=e.__h.filter(function(e){return!e.__||fZ(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],HX.__e(n,e.__v)}}),KX&&KX(e,t)},HX.unmount=function(e){qX&&qX(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{dZ(e)}catch(e){t=e}}),n.__H=void 0,t&&HX.__e(t,n.__v))};var lZ=typeof requestAnimationFrame==`function`;function uZ(e){var t,n=function(){clearTimeout(r),lZ&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);lZ&&(t=requestAnimationFrame(n))}function dZ(e){var t=IX,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),IX=t}function fZ(e){var t=IX;e.__c=e.__(),IX=t}function pZ(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function mZ(e,t){return typeof t==`function`?t(e):t}var hZ=Object.defineProperty({__proto__:null,useCallback:rZ,useContext:iZ,useDebugValue:aZ,useEffect:QX,useErrorBoundary:oZ,useId:sZ,useImperativeHandle:tZ,useLayoutEffect:$X,useMemo:nZ,useReducer:ZX,useRef:eZ,useState:XX},Symbol.toStringTag,{value:`Module`}),gZ=`http://www.w3.org/2000/svg`;function _Z(){let e=e=>iY.createElementNS(gZ,e),t=BY(e(`svg`),{width:`32`,height:`30`,viewBox:`0 0 72 66`,fill:`inherit`}),n=BY(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 vZ({options:e}){let t=nZ(()=>({__html:_Z().outerHTML}),[]);return dX(`h2`,{class:`dialog__header`},dX(`span`,{class:`dialog__title`},e.formTitle),e.showBranding?dX(`a`,{class:`brand-link`,target:`_blank`,href:`https://sentry.io/welcome/`,title:`Powered by Sentry`,rel:`noopener noreferrer`,dangerouslySetInnerHTML:t}):null)}function yZ(e,t){let 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 bZ(e,t){let n=e.get(t);return typeof n==`string`?n.trim():``}function xZ({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:i,onSubmitSuccess:a,onSubmitError:o,showEmail:s,showName:c,screenshotInput:l}){let{tags:u,addScreenshotButtonLabel:d,removeScreenshotButtonLabel:f,cancelButtonLabel:p,emailLabel:m,emailPlaceholder:h,isEmailRequired:g,isNameRequired:_,messageLabel:v,messagePlaceholder:y,nameLabel:b,namePlaceholder:x,submitButtonLabel:S,isRequiredLabel:C}=e,[w,T]=XX(!1),[ee,E]=XX(null),[te,ne]=XX(!1),re=l?.input,[ie,ae]=XX(null),oe=rZ(e=>{ae(e),ne(!1)},[]),D=rZ(e=>{let t=yZ(e,{emailLabel:m,isEmailRequired:g,isNameRequired:_,messageLabel:v,nameLabel:b});return t.length>0?E(`Please enter in the following required fields: ${t.join(`, `)}`):E(null),t.length===0},[m,g,_,v,b]);return dX(`form`,{class:`form`,onSubmit:rZ(async e=>{T(!0);try{if(e.preventDefault(),!(e.target instanceof HTMLFormElement))return;let t=new FormData(e.target),n=await(l&&te?l.value():void 0),r={name:bZ(t,`name`),email:bZ(t,`email`),message:bZ(t,`message`),attachments:n?[n]:void 0};if(!D(r))return;try{a(r,await i({name:r.name,email:r.email,message:r.message,source:kY,tags:u},{attachments:r.attachments}))}catch(e){IY&&G.error(e);let t=e instanceof Error?e:Error(String(e));E(t.message),o(t)}}finally{T(!1)}},[l&&te,a,o])},re&&te?dX(re,{onError:oe}):null,dX(`fieldset`,{class:`form__right`,"data-sentry-feedback":!0,disabled:w},dX(`div`,{class:`form__top`},ee?dX(`div`,{class:`form__error-container`},ee):null,c?dX(`label`,{for:`name`,class:`form__label`},dX(SZ,{label:b,isRequiredLabel:C,isRequired:_}),dX(`input`,{class:`form__input`,defaultValue:n,id:`name`,name:`name`,placeholder:x,required:_,type:`text`})):dX(`input`,{"aria-hidden":!0,value:n,name:`name`,type:`hidden`}),s?dX(`label`,{for:`email`,class:`form__label`},dX(SZ,{label:m,isRequiredLabel:C,isRequired:g}),dX(`input`,{class:`form__input`,defaultValue:t,id:`email`,name:`email`,placeholder:h,required:g,type:`email`})):dX(`input`,{"aria-hidden":!0,value:t,name:`email`,type:`hidden`}),dX(`label`,{for:`message`,class:`form__label`},dX(SZ,{label:v,isRequiredLabel:C,isRequired:!0}),dX(`textarea`,{autoFocus:!0,class:`form__input form__input--textarea`,id:`message`,name:`message`,placeholder:y,required:!0,rows:5})),re?dX(`label`,{for:`screenshot`,class:`form__label`},dX(`button`,{class:`btn btn--default`,disabled:w,type:`button`,onClick:()=>{ae(null),ne(e=>!e)}},te?f:d),ie?dX(`div`,{class:`form__error-container`},ie.message):null):null),dX(`div`,{class:`btn-group`},dX(`button`,{class:`btn btn--primary`,disabled:w,type:`submit`},S),dX(`button`,{class:`btn btn--default`,disabled:w,type:`button`,onClick:r},p))))}function SZ({label:e,isRequired:t,isRequiredLabel:n}){return dX(`span`,{class:`form__label__text`},e,t&&dX(`span`,{class:`form__label__text--required`},n))}var CZ=16,wZ=17,TZ=`http://www.w3.org/2000/svg`;function EZ(){let e=e=>rY.document.createElementNS(TZ,e),t=BY(e(`svg`),{width:`${CZ}`,height:`${wZ}`,viewBox:`0 0 ${CZ} ${wZ}`,fill:`inherit`}),n=BY(e(`g`),{clipPath:`url(#clip0_57_156)`}),r=BY(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`}),i=BY(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(i,r);let a=e(`defs`),o=BY(e(`clipPath`),{id:`clip0_57_156`}),s=BY(e(`rect`),{width:`${CZ}`,height:`${CZ}`,fill:`white`,transform:`translate(0 0.5)`});return o.appendChild(s),a.appendChild(o),t.appendChild(a).appendChild(o).appendChild(s),t}function DZ({open:e,onFormSubmitted:t,...n}){let r=n.options,i=nZ(()=>({__html:EZ().outerHTML}),[]),[a,o]=XX(null),s=rZ(()=>{a&&(clearTimeout(a),o(null)),t()},[a]),c=rZ((e,r)=>{n.onSubmitSuccess(e,r),o(setTimeout(()=>{t(),o(null)},jY))},[t]);return dX(pX,null,a?dX(`div`,{class:`success__position`,onClick:s},dX(`div`,{class:`success__content`},r.successMessageText,dX(`span`,{class:`success__icon`,dangerouslySetInnerHTML:i}))):dX(`dialog`,{class:`dialog`,onClick:r.onFormClose,open:e},dX(`div`,{class:`dialog__position`},dX(`div`,{class:`dialog__content`,onClick:e=>{e.stopPropagation()}},dX(vZ,{options:r}),dX(xZ,{...n,onSubmitSuccess:c})))))}var OZ=`
|
|
611
|
+
.dialog {
|
|
612
|
+
position: fixed;
|
|
613
|
+
z-index: var(--z-index);
|
|
614
|
+
margin: 0;
|
|
615
|
+
inset: 0;
|
|
616
|
+
|
|
617
|
+
display: flex;
|
|
618
|
+
align-items: center;
|
|
619
|
+
justify-content: center;
|
|
620
|
+
padding: 0;
|
|
621
|
+
height: 100vh;
|
|
622
|
+
width: 100vw;
|
|
623
|
+
|
|
624
|
+
color: var(--dialog-color, var(--foreground));
|
|
625
|
+
fill: var(--dialog-color, var(--foreground));
|
|
626
|
+
line-height: 1.75em;
|
|
627
|
+
|
|
628
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
629
|
+
border: none;
|
|
630
|
+
inset: 0;
|
|
631
|
+
opacity: 1;
|
|
632
|
+
transition: opacity 0.2s ease-in-out;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
.dialog__position {
|
|
636
|
+
position: fixed;
|
|
637
|
+
z-index: var(--z-index);
|
|
638
|
+
inset: var(--dialog-inset);
|
|
639
|
+
padding: var(--page-margin);
|
|
640
|
+
display: flex;
|
|
641
|
+
max-height: calc(100vh - (2 * var(--page-margin)));
|
|
642
|
+
}
|
|
643
|
+
@media (max-width: 600px) {
|
|
644
|
+
.dialog__position {
|
|
645
|
+
inset: var(--page-margin);
|
|
646
|
+
padding: 0;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
.dialog__position:has(.editor) {
|
|
651
|
+
inset: var(--page-margin);
|
|
652
|
+
padding: 0;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
.dialog:not([open]) {
|
|
656
|
+
opacity: 0;
|
|
657
|
+
pointer-events: none;
|
|
658
|
+
visibility: hidden;
|
|
659
|
+
}
|
|
660
|
+
.dialog:not([open]) .dialog__content {
|
|
661
|
+
transform: translate(0, -16px) scale(0.98);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
.dialog__content {
|
|
665
|
+
display: flex;
|
|
666
|
+
flex-direction: column;
|
|
667
|
+
gap: 16px;
|
|
668
|
+
padding: var(--dialog-padding, 24px);
|
|
669
|
+
max-width: 100%;
|
|
670
|
+
width: 100%;
|
|
671
|
+
max-height: 100%;
|
|
672
|
+
overflow: auto;
|
|
673
|
+
|
|
674
|
+
background: var(--dialog-background, var(--background));
|
|
675
|
+
border-radius: var(--dialog-border-radius, 20px);
|
|
676
|
+
border: var(--dialog-border, var(--border));
|
|
677
|
+
box-shadow: var(--dialog-box-shadow, var(--box-shadow));
|
|
678
|
+
transform: translate(0, 0) scale(1);
|
|
679
|
+
transition: transform 0.2s ease-in-out;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
`,kZ=`
|
|
683
|
+
.dialog__header {
|
|
684
|
+
display: flex;
|
|
685
|
+
gap: 4px;
|
|
686
|
+
justify-content: space-between;
|
|
687
|
+
font-weight: var(--dialog-header-weight, 600);
|
|
688
|
+
margin: 0;
|
|
689
|
+
}
|
|
690
|
+
.dialog__title {
|
|
691
|
+
align-self: center;
|
|
692
|
+
width: var(--form-width, 272px);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
@media (max-width: 600px) {
|
|
696
|
+
.dialog__title {
|
|
697
|
+
width: auto;
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
.dialog__position:has(.editor) .dialog__title {
|
|
702
|
+
width: auto;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
.brand-link {
|
|
707
|
+
display: inline-flex;
|
|
708
|
+
}
|
|
709
|
+
.brand-link:focus-visible {
|
|
710
|
+
outline: var(--outline);
|
|
711
|
+
}
|
|
712
|
+
`,AZ=`
|
|
713
|
+
.form {
|
|
714
|
+
display: flex;
|
|
715
|
+
overflow: auto;
|
|
716
|
+
flex-direction: row;
|
|
717
|
+
gap: 16px;
|
|
718
|
+
flex: 1 0;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.form fieldset {
|
|
722
|
+
border: none;
|
|
723
|
+
margin: 0;
|
|
724
|
+
padding: 0;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
.form__right {
|
|
728
|
+
flex: 0 0 auto;
|
|
729
|
+
display: flex;
|
|
730
|
+
overflow: auto;
|
|
731
|
+
flex-direction: column;
|
|
732
|
+
justify-content: space-between;
|
|
733
|
+
gap: 20px;
|
|
734
|
+
width: var(--form-width, 100%);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
.dialog__position:has(.editor) .form__right {
|
|
738
|
+
width: var(--form-width, 272px);
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.form__top {
|
|
742
|
+
display: flex;
|
|
743
|
+
flex-direction: column;
|
|
744
|
+
gap: 8px;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
.form__error-container {
|
|
748
|
+
color: var(--error-color);
|
|
749
|
+
fill: var(--error-color);
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.form__label {
|
|
753
|
+
display: flex;
|
|
754
|
+
flex-direction: column;
|
|
755
|
+
gap: 4px;
|
|
756
|
+
margin: 0px;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
.form__label__text {
|
|
760
|
+
display: flex;
|
|
761
|
+
gap: 4px;
|
|
762
|
+
align-items: center;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
.form__label__text--required {
|
|
766
|
+
font-size: 0.85em;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
.form__input {
|
|
770
|
+
font-family: inherit;
|
|
771
|
+
line-height: inherit;
|
|
772
|
+
background: transparent;
|
|
773
|
+
box-sizing: border-box;
|
|
774
|
+
border: var(--input-border, var(--border));
|
|
775
|
+
border-radius: var(--input-border-radius, 6px);
|
|
776
|
+
color: var(--input-color, inherit);
|
|
777
|
+
fill: var(--input-color, inherit);
|
|
778
|
+
font-size: var(--input-font-size, inherit);
|
|
779
|
+
font-weight: var(--input-font-weight, 500);
|
|
780
|
+
padding: 6px 12px;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
.form__input::placeholder {
|
|
784
|
+
opacity: 0.65;
|
|
785
|
+
color: var(--input-placeholder-color, inherit);
|
|
786
|
+
filter: var(--interactive-filter);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
.form__input:focus-visible {
|
|
790
|
+
outline: var(--input-focus-outline, var(--outline));
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
.form__input--textarea {
|
|
794
|
+
font-family: inherit;
|
|
795
|
+
resize: vertical;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
.error {
|
|
799
|
+
color: var(--error-color);
|
|
800
|
+
fill: var(--error-color);
|
|
801
|
+
}
|
|
802
|
+
`,jZ=`
|
|
803
|
+
.btn-group {
|
|
804
|
+
display: grid;
|
|
805
|
+
gap: 8px;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
.btn {
|
|
809
|
+
line-height: inherit;
|
|
810
|
+
border: var(--button-border, var(--border));
|
|
811
|
+
border-radius: var(--button-border-radius, 6px);
|
|
812
|
+
cursor: pointer;
|
|
813
|
+
font-family: inherit;
|
|
814
|
+
font-size: var(--button-font-size, inherit);
|
|
815
|
+
font-weight: var(--button-font-weight, 600);
|
|
816
|
+
padding: var(--button-padding, 6px 16px);
|
|
817
|
+
}
|
|
818
|
+
.btn[disabled] {
|
|
819
|
+
opacity: 0.6;
|
|
820
|
+
pointer-events: none;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
.btn--primary {
|
|
824
|
+
color: var(--button-primary-color, var(--accent-foreground));
|
|
825
|
+
fill: var(--button-primary-color, var(--accent-foreground));
|
|
826
|
+
background: var(--button-primary-background, var(--accent-background));
|
|
827
|
+
border: var(--button-primary-border, var(--border));
|
|
828
|
+
border-radius: var(--button-primary-border-radius, 6px);
|
|
829
|
+
font-weight: var(--button-primary-font-weight, 500);
|
|
830
|
+
}
|
|
831
|
+
.btn--primary:hover {
|
|
832
|
+
color: var(--button-primary-hover-color, var(--accent-foreground));
|
|
833
|
+
fill: var(--button-primary-hover-color, var(--accent-foreground));
|
|
834
|
+
background: var(--button-primary-hover-background, var(--accent-background));
|
|
835
|
+
filter: var(--interactive-filter);
|
|
836
|
+
}
|
|
837
|
+
.btn--primary:focus-visible {
|
|
838
|
+
background: var(--button-primary-hover-background, var(--accent-background));
|
|
839
|
+
filter: var(--interactive-filter);
|
|
840
|
+
outline: var(--button-primary-focus-outline, var(--outline));
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
.btn--default {
|
|
844
|
+
color: var(--button-color, var(--foreground));
|
|
845
|
+
fill: var(--button-color, var(--foreground));
|
|
846
|
+
background: var(--button-background, var(--background));
|
|
847
|
+
border: var(--button-border, var(--border));
|
|
848
|
+
border-radius: var(--button-border-radius, 6px);
|
|
849
|
+
font-weight: var(--button-font-weight, 500);
|
|
850
|
+
}
|
|
851
|
+
.btn--default:hover {
|
|
852
|
+
color: var(--button-color, var(--foreground));
|
|
853
|
+
fill: var(--button-color, var(--foreground));
|
|
854
|
+
background: var(--button-hover-background, var(--background));
|
|
855
|
+
filter: var(--interactive-filter);
|
|
856
|
+
}
|
|
857
|
+
.btn--default:focus-visible {
|
|
858
|
+
background: var(--button-hover-background, var(--background));
|
|
859
|
+
filter: var(--interactive-filter);
|
|
860
|
+
outline: var(--button-focus-outline, var(--outline));
|
|
861
|
+
}
|
|
862
|
+
`,MZ=`
|
|
863
|
+
.success__position {
|
|
864
|
+
position: fixed;
|
|
865
|
+
inset: var(--dialog-inset);
|
|
866
|
+
padding: var(--page-margin);
|
|
867
|
+
z-index: var(--z-index);
|
|
868
|
+
}
|
|
869
|
+
.success__content {
|
|
870
|
+
background: var(--success-background, var(--background));
|
|
871
|
+
border: var(--success-border, var(--border));
|
|
872
|
+
border-radius: var(--success-border-radius, 1.7em/50%);
|
|
873
|
+
box-shadow: var(--success-box-shadow, var(--box-shadow));
|
|
874
|
+
font-weight: var(--success-font-weight, 600);
|
|
875
|
+
color: var(--success-color);
|
|
876
|
+
fill: var(--success-color);
|
|
877
|
+
padding: 12px 24px;
|
|
878
|
+
line-height: 1.75em;
|
|
879
|
+
|
|
880
|
+
display: grid;
|
|
881
|
+
align-items: center;
|
|
882
|
+
grid-auto-flow: column;
|
|
883
|
+
gap: 6px;
|
|
884
|
+
cursor: default;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
.success__icon {
|
|
888
|
+
display: flex;
|
|
889
|
+
}
|
|
890
|
+
`;function NZ(e){let t=iY.createElement(`style`);return t.textContent=`
|
|
891
|
+
:host {
|
|
892
|
+
--dialog-inset: var(--inset);
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
${OZ}
|
|
896
|
+
${kZ}
|
|
897
|
+
${AZ}
|
|
898
|
+
${jZ}
|
|
899
|
+
${MZ}
|
|
900
|
+
`,e&&t.setAttribute(`nonce`,e),t}function PZ(){let e=K().getUser(),t=MF().getUser(),n=NF().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}var FZ=(()=>({name:`FeedbackModal`,setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{let i=r,a=e.useSentryUser,o=PZ(),s=iY.createElement(`div`),c=NZ(e.styleNonce),l=``,u={get el(){return s},appendToDom(){!i.contains(c)&&!i.contains(s)&&(i.appendChild(c),i.appendChild(s))},removeFromDom(){s.remove(),c.remove(),iY.body.style.overflow=l},open(){f(!0),e.onFormOpen?.(),q()?.emit(`openFeedbackWidget`),l=iY.body.style.overflow,iY.body.style.overflow=`hidden`},close(){f(!1),iY.body.style.overflow=l}},d=t?.createInput({h:dX,hooks:hZ,dialog:u,options:e}),f=t=>{PX(dX(DZ,{options:e,screenshotInput:d,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:String(a&&o?.[a.name]||``),defaultEmail:String(a&&o?.[a.email]||``),onFormClose:()=>{f(!1),e.onFormClose?.()},onSubmit:n,onSubmitSuccess:(t,n)=>{f(!1),e.onSubmitSuccess?.(t,n)},onSubmitError:t=>{e.onSubmitError?.(t)},onFormSubmitted:()=>{e.onFormSubmitted?.()},open:t}),s)};return u}}));function IZ({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 LZ(e){let t=iY.createElement(`style`),n=`#1A141F`,r=`#302735`;return t.textContent=`
|
|
901
|
+
.editor {
|
|
902
|
+
display: flex;
|
|
903
|
+
flex-grow: 1;
|
|
904
|
+
flex-direction: column;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
.editor__image-container {
|
|
908
|
+
justify-items: center;
|
|
909
|
+
padding: 15px;
|
|
910
|
+
position: relative;
|
|
911
|
+
height: 100%;
|
|
912
|
+
border-radius: var(--menu-border-radius, 6px);
|
|
913
|
+
|
|
914
|
+
background-color: ${n};
|
|
915
|
+
background-image: repeating-linear-gradient(
|
|
916
|
+
-145deg,
|
|
917
|
+
transparent,
|
|
918
|
+
transparent 8px,
|
|
919
|
+
${n} 8px,
|
|
920
|
+
${n} 11px
|
|
921
|
+
),
|
|
922
|
+
repeating-linear-gradient(
|
|
923
|
+
-45deg,
|
|
924
|
+
transparent,
|
|
925
|
+
transparent 15px,
|
|
926
|
+
${r} 15px,
|
|
927
|
+
${r} 16px
|
|
928
|
+
);
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
.editor__canvas-container {
|
|
932
|
+
width: 100%;
|
|
933
|
+
height: 100%;
|
|
934
|
+
position: relative;
|
|
935
|
+
display: flex;
|
|
936
|
+
align-items: center;
|
|
937
|
+
justify-content: center;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
.editor__canvas-container > * {
|
|
941
|
+
object-fit: contain;
|
|
942
|
+
position: absolute;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
.editor__tool-container {
|
|
946
|
+
padding-top: 8px;
|
|
947
|
+
display: flex;
|
|
948
|
+
justify-content: center;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
.editor__tool-bar {
|
|
952
|
+
display: flex;
|
|
953
|
+
gap: 8px;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
.editor__tool {
|
|
957
|
+
display: flex;
|
|
958
|
+
padding: 8px 12px;
|
|
959
|
+
justify-content: center;
|
|
960
|
+
align-items: center;
|
|
961
|
+
border: var(--button-border, var(--border));
|
|
962
|
+
border-radius: var(--button-border-radius, 6px);
|
|
963
|
+
background: var(--button-background, var(--background));
|
|
964
|
+
color: var(--button-color, var(--foreground));
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
.editor__tool--active {
|
|
968
|
+
background: var(--button-primary-background, var(--accent-background));
|
|
969
|
+
color: var(--button-primary-color, var(--accent-foreground));
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
.editor__rect {
|
|
973
|
+
position: absolute;
|
|
974
|
+
z-index: 2;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
.editor__rect button {
|
|
978
|
+
opacity: 0;
|
|
979
|
+
position: absolute;
|
|
980
|
+
top: -12px;
|
|
981
|
+
right: -12px;
|
|
982
|
+
cursor: pointer;
|
|
983
|
+
padding: 0;
|
|
984
|
+
z-index: 3;
|
|
985
|
+
border: none;
|
|
986
|
+
background: none;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
.editor__rect:hover button {
|
|
990
|
+
opacity: 1;
|
|
991
|
+
}
|
|
992
|
+
`,e&&t.setAttribute(`nonce`,e),t}function RZ({h:e}){return function({action:t,setAction:n,options:r}){return e(`div`,{class:`editor__tool-container`},e(`div`,{class:`editor__tool-bar`},e(`button`,{type:`button`,class:`editor__tool ${t===`highlight`?`editor__tool--active`:``}`,onClick:()=>{n(t===`highlight`?``:`highlight`)}},r.highlightToolText),e(`button`,{type:`button`,class:`editor__tool ${t===`hide`?`editor__tool--active`:``}`,onClick:()=>{n(t===`hide`?``:`hide`)}},r.hideToolText)))}}function zZ({hooks:e}){function t(){let[t,n]=e.useState(rY.devicePixelRatio??1);return e.useEffect(()=>{let e=()=>{n(rY.devicePixelRatio)},t=matchMedia(`(resolution: ${rY.devicePixelRatio}dppx)`);return t.addEventListener(`change`,e),()=>{t.removeEventListener(`change`,e)}},[]),t}return function({onBeforeScreenshot:n,onScreenshot:r,onAfterScreenshot:i,onError:a}){let o=t();e.useEffect(()=>{(async()=>{n();let e=await aY.mediaDevices.getDisplayMedia({video:{width:rY.innerWidth*o,height:rY.innerHeight*o},audio:!1,monitorTypeSurfaces:`exclude`,preferCurrentTab:!0,selfBrowserSurface:`include`,surfaceSwitching:`exclude`}),t=iY.createElement(`video`);await new Promise((n,i)=>{t.srcObject=e,t.onloadedmetadata=()=>{r(t,o),e.getTracks().forEach(e=>e.stop()),n()},t.play().catch(i)}),i()})().catch(a)},[])}}function BZ(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)}}function VZ(e,t,n){if(!e)return;let r=e.getContext(`2d`,t);r&&n(e,r)}function HZ(e,t){VZ(e,{alpha:!0},(e,n)=>{n.drawImage(t,0,0,t.width,t.height,0,0,e.width,e.height)})}function UZ(e,t,n){VZ(e,{alpha:!0},(e,r)=>{n.length&&(r.fillStyle=`rgba(0, 0, 0, 0.25)`,r.fillRect(0,0,e.width,e.height)),n.forEach(e=>{BZ(e,r,t)})})}function WZ({h:e,hooks:t,outputBuffer:n,dialog:r,options:i}){let a=zZ({hooks:t}),o=RZ({h:e}),s=IZ({h:e}),c={__html:LZ(i.styleNonce).innerText},l=r.el.style,u=({screenshot:r})=>{let[a,l]=t.useState(`highlight`),[u,d]=t.useState([]),f=t.useRef(null),p=t.useRef(null),m=t.useRef(null),h=t.useRef(null),[g,_]=t.useState(1),v=t.useMemo(()=>{let e=iY.getElementById(i.id);if(!e)return`white`;let t=getComputedStyle(e);return t.getPropertyValue(`--button-primary-background`)||t.getPropertyValue(`--accent-background`)},[i.id]);t.useLayoutEffect(()=>{let e=()=>{let t=f.current;t&&(VZ(r.canvas,{alpha:!1},e=>{let n=Math.min(t.clientWidth/e.width,t.clientHeight/e.height);_(n)}),(t.clientHeight===0||t.clientWidth===0)&&setTimeout(e,0))};return e(),rY.addEventListener(`resize`,e),()=>{rY.removeEventListener(`resize`,e)}},[r]);let y=t.useCallback((e,t)=>{VZ(e,{alpha:!0},(e,n)=>{n.scale(t,t),e.width=r.canvas.width,e.height=r.canvas.height})},[r]);t.useEffect(()=>{y(p.current,r.dpi),HZ(p.current,r.canvas)},[r]),t.useEffect(()=>{y(m.current,r.dpi),VZ(m.current,{alpha:!0},(e,t)=>{t.clearRect(0,0,e.width,e.height)}),UZ(m.current,v,u)},[u,v]),t.useEffect(()=>{y(n,r.dpi),HZ(n,r.canvas),VZ(iY.createElement(`canvas`),{alpha:!0},(e,t)=>{t.scale(r.dpi,r.dpi),e.width=r.canvas.width,e.height=r.canvas.height,UZ(e,v,u),HZ(n,e)})},[u,r,v]);let b=e=>{if(!a||!h.current)return;let t=h.current.getBoundingClientRect(),n={type:a,x:e.offsetX/g,y:e.offsetY/g},r=(e,n)=>{let r=(n.clientX-t.x)/g,i=(n.clientY-t.y)/g;return{type:e.type,x:Math.min(e.x,r),y:Math.min(e.y,i),w:Math.abs(r-e.x),h:Math.abs(i-e.y)}},i=e=>{VZ(m.current,{alpha:!0},(e,t)=>{t.clearRect(0,0,e.width,e.height)}),UZ(m.current,v,[...u,r(n,e)])},o=e=>{let t=r(n,e);t.w*g>=1&&t.h*g>=1&&d(e=>[...e,t]),iY.removeEventListener(`mousemove`,i),iY.removeEventListener(`mouseup`,o)};iY.addEventListener(`mousemove`,i),iY.addEventListener(`mouseup`,o)},x=t.useCallback(e=>t=>{t.preventDefault(),t.stopPropagation(),d(t=>{let n=[...t];return n.splice(e,1),n})},[]),S={width:`${r.canvas.width*g}px`,height:`${r.canvas.height*g}px`},C=e=>{e.stopPropagation()};return e(`div`,{class:`editor`},e(`style`,{nonce:i.styleNonce,dangerouslySetInnerHTML:c}),e(`div`,{class:`editor__image-container`},e(`div`,{class:`editor__canvas-container`,ref:f},e(`canvas`,{ref:p,id:`background`,style:S}),e(`canvas`,{ref:m,id:`foreground`,style:S}),e(`div`,{ref:h,onMouseDown:b,style:S},u.map((t,n)=>e(`div`,{key:n,class:`editor__rect`,style:{top:`${t.y*g}px`,left:`${t.x*g}px`,width:`${t.w*g}px`,height:`${t.h*g}px`}},e(`button`,{"aria-label":i.removeHighlightText,onClick:x(n),onMouseDown:C,onMouseUp:C,type:`button`},e(s,null))))))),e(o,{options:i,action:a,setAction:l}))};return function({onError:r}){let[i,o]=t.useState();return a({onBeforeScreenshot:t.useCallback(()=>{l.display=`none`},[]),onScreenshot:t.useCallback((e,t)=>{VZ(iY.createElement(`canvas`),{alpha:!1},(n,r)=>{r.scale(t,t),n.width=e.videoWidth,n.height=e.videoHeight,r.drawImage(e,0,0,n.width,n.height),o({canvas:n,dpi:t})}),n.width=e.videoWidth,n.height=e.videoHeight},[]),onAfterScreenshot:t.useCallback(()=>{l.display=`block`},[]),onError:t.useCallback(e=>{l.display=`block`,r(e)},[])}),i?e(u,{screenshot:i}):e(`div`,null)}}var GZ=(()=>({name:`FeedbackScreenshot`,setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{let i=iY.createElement(`canvas`);return{input:WZ({h:e,hooks:t,outputBuffer:i,dialog:n,options:r}),value:async()=>{let e=await new Promise(e=>{i.toBlob(e,`image/png`)});if(e)return{data:new Uint8Array(await e.arrayBuffer()),filename:`screenshot.png`,contentType:`application/png`}}}}})),J=W,KZ=0;function qZ(){return KZ>0}function JZ(){KZ++,setTimeout(()=>{KZ--})}function YZ(e,t={}){function n(e){return typeof e==`function`}if(!n(e))return e;try{if(Object.prototype.hasOwnProperty.call(e,`__sentry_wrapped__`)){let t=e.__sentry_wrapped__;return typeof t==`function`?t:e}if(nP(e))return e}catch{return e}let r=function(...n){W._sentryWrappedDepth=(W._sentryWrappedDepth||0)+1;try{let r=n.map(e=>YZ(e,t));return e.apply(this,r)}catch(e){throw JZ(),PF(r=>{r.addEventProcessor(e=>(t.mechanism&&(LP(e,void 0,void 0),RP(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),Hz(e)}),e}finally{W._sentryWrappedDepth=(W._sentryWrappedDepth||0)-1}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}tP(r,e),eP(e,`__sentry_wrapped__`,r);try{Object.getOwnPropertyDescriptor(r,`name`).configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function XZ(){let e=IJ(),{referrer:t}=J.document||{},{userAgent:n}=J.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}var ZZ=[`replayIntegration`,`replayCanvasIntegration`,`feedbackIntegration`,`feedbackModalIntegration`,`feedbackScreenshotIntegration`,`captureConsoleIntegration`,`contextLinesIntegration`,`linkedErrorsIntegration`,`dedupeIntegration`,`extraErrorDataIntegration`,`graphqlClientIntegration`,`httpClientIntegration`,`reportingObserverIntegration`,`rewriteFramesIntegration`,`browserProfilingIntegration`,`moduleMetadataIntegration`,`instrumentAnthropicAiClient`,`instrumentOpenAiClient`,`instrumentGoogleGenAIClient`,`instrumentLangGraph`,`createLangChainCallbackHandler`,`instrumentLangChainEmbeddings`],QZ={replayCanvasIntegration:`replay-canvas`,feedbackModalIntegration:`feedback-modal`,feedbackScreenshotIntegration:`feedback-screenshot`};function $Z(e){return QZ[e]||e.replace(`Integration`,``).toLowerCase()}var eQ=J;async function tQ(e,t){let n=ZZ.includes(e)?$Z(e):void 0,r=eQ.Sentry=eQ.Sentry||{};if(!n)throw Error(`Cannot lazy load integration: ${e}`);let i=r[e];if(typeof i==`function`&&!(`_isShim`in i))return i;let a=nQ(n),o=J.document.createElement(`script`);o.src=a,o.crossOrigin=`anonymous`,o.referrerPolicy=`strict-origin`,t&&o.setAttribute(`nonce`,t);let s=new Promise((e,t)=>{o.addEventListener(`load`,()=>e()),o.addEventListener(`error`,t)}),c=J.document.currentScript,l=J.document.body||J.document.head||c?.parentElement;if(l)l.appendChild(o);else throw Error(`Could not find parent element to insert lazy-loaded ${e} script`);try{await s}catch{throw Error(`Error when loading integration: ${e}`)}let u=r[e];if(typeof u!=`function`)throw Error(`Could not load integration: ${e}`);return u}function nQ(e){let t=q()?.getOptions()?.cdnBaseUrl||`https://browser.sentry-cdn.com`;return new URL(`/${$M}/${e}.min.js`,t).toString()}var rQ=XY({lazyLoadIntegration:tQ}),iQ=XY({getModalIntegration:()=>FZ,getScreenshotIntegration:()=>GZ});function aQ(e,t){let n=cQ(e,t),r={type:pQ(t),value:mQ(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===``&&(r.value=`Unrecoverable error caught`),r}function oQ(e,t,n,r){let i=q()?.getOptions().normalizeDepth,a=xQ(t),o={__serialized__:vP(t,i)};if(a)return{exception:{values:[aQ(e,a)]},extra:o};let s={exception:{values:[{type:JN(t)?t.constructor.name:r?`UnhandledRejection`:`Error`,value:yQ(t,{isUnhandledRejection:r})}]},extra:o};if(n){let t=cQ(e,n);t.length&&(s.exception.values[0].stacktrace={frames:t})}return s}function sQ(e,t){return{exception:{values:[aQ(e,t)]}}}function cQ(e,t){let n=t.stacktrace||t.stack||``,r=uQ(t),i=dQ(t);try{return e(n,r,i)}catch{}return[]}var lQ=/Minified React error #\d+;/i;function uQ(e){return e&&lQ.test(e.message)?1:0}function dQ(e){return typeof e.framesToPop==`number`?e.framesToPop:0}function fQ(e){return typeof WebAssembly<`u`&&WebAssembly.Exception!==void 0&&e instanceof WebAssembly.Exception}function pQ(e){let t=e?.name;return!t&&fQ(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:`WebAssembly.Exception`:t}function mQ(e){let t=e?.message;return fQ(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:`wasm exception`:t?t.error&&typeof t.error.message==`string`?RH(t.error):RH(e):`No error message`}function hQ(e,t,n,r){let i=_Q(e,t,n?.syntheticException||void 0,r);return RP(i),i.level=`error`,n?.event_id&&(i.event_id=n.event_id),bz(i)}function gQ(e,t,n=`info`,r,i){let a=vQ(e,t,r?.syntheticException||void 0,i);return a.level=n,r?.event_id&&(a.event_id=r.event_id),bz(a)}function _Q(e,t,n,r,i){let a;if(BN(t)&&t.error)return sQ(e,t.error);if(VN(t)||HN(t)){let i=t;if(`stack`in t){a=sQ(e,t);let i=a.exception?.values?.[0];if(r&&n&&i&&!i.stacktrace){let t=cQ(e,n);t.length&&(i.stacktrace={frames:t},RP(a,{synthetic:!0}))}}else{let t=i.name||(VN(i)?`DOMError`:`DOMException`),o=i.message?`${t}: ${i.message}`:t;a=vQ(e,o,n,r),LP(a,o)}return`code`in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}return RN(t)?sQ(e,t):KN(t)||JN(t)?(a=oQ(e,t,n,i),RP(a,{synthetic:!0}),a):(a=vQ(e,t,n,r),LP(a,`${t}`,void 0),RP(a,{synthetic:!0}),a)}function vQ(e,t,n,r){let i={};if(r&&n){let r=cQ(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),RP(i,{synthetic:!0})}if(WN(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function yQ(e,{isUnhandledRejection:t}){let n=aP(e),r=t?`promise rejection`:`exception`;return BN(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:JN(e)?`Event \`${bQ(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function bQ(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function xQ(e){return Object.values(e).find(e=>e instanceof Error)}var SQ=class extends MV{constructor(e){let t=CQ(e);uH(t,`browser`,[`browser`],J.SENTRY_SDK_SOURCE||kB()),super(t);let{userInfo:n}=this.getDataCollectionOptions();t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:n?`auto`:`never`,...t._metadata.sdk.settings});let{sendClientReports:r}=this._options;J.document&&J.document.addEventListener(`visibilitychange`,()=>{J.document.visibilityState===`hidden`&&(r&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}),n&&this.on(`beforeSendSession`,lH)}eventFromException(e,t){return hQ(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t=`info`,n){return gQ(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||`javascript`,super._prepareEvent(e,t,n,r)}};function CQ(e){return{release:typeof __SENTRY_RELEASE__==`string`?__SENTRY_RELEASE__:J.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var wQ=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Y=W,TQ=(e,t)=>e>t[1]?`poor`:e>t[0]?`needs-improvement`:`good`,EQ=(e,t,n,r)=>{let i,a;return o=>{t.value>=0&&(o||r)&&(a=t.value-(i??0),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=TQ(t.value,n),e(t)))}},DQ=(e=!0)=>{let t=Y.performance?.getEntriesByType?.(`navigation`)[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},OQ=()=>DQ()?.activationStart??0;function kQ(e,t,n){Y.document&&Y.addEventListener(e,t,n)}function AQ(e,t,n){Y.document&&Y.removeEventListener(e,t,n)}var jQ=-1,MQ=new Set,NQ=()=>Y.document?.visibilityState===`hidden`&&!Y.document?.prerendering?0:1/0,PQ=e=>{if(IQ(e)&&jQ>-1){if(e.type===`visibilitychange`||e.type===`pagehide`)for(let e of MQ)e();isFinite(jQ)||(jQ=e.type===`visibilitychange`?e.timeStamp:0,AQ(`prerenderingchange`,PQ,!0))}},FQ=()=>{if(Y.document&&jQ<0){let e=OQ();jQ=(Y.document.prerendering?void 0:globalThis.performance.getEntriesByType(`visibility-state`).filter(t=>t.name===`hidden`&&t.startTime>e)[0]?.startTime)??NQ(),kQ(`visibilitychange`,PQ,!0),kQ(`pagehide`,PQ,!0),kQ(`prerenderingchange`,PQ,!0)}return{get firstHiddenTime(){return jQ},onHidden(e){MQ.add(e)}}};function IQ(e){return e.type===`pagehide`||Y.document?.visibilityState===`hidden`}var LQ=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+0xe8d4a51000}`,RQ=(e,t=-1)=>{let n=DQ(),r=`navigate`;return n&&(Y.document?.prerendering||OQ()>0?r=`prerender`:Y.document?.wasDiscarded?r=`restore`:n.type&&(r=n.type.replace(/_/g,`-`))),{name:e,value:t,rating:`good`,delta:0,entries:[],id:LQ(),navigationType:r}},zQ=new WeakMap;function BQ(e,t){try{return zQ.get(e)||zQ.set(e,new t),zQ.get(e)}catch{return new t}}var VQ=class{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(e){if(e.hadRecentInput)return;let t=this._sessionEntries[0],n=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this._sessionValue+=e.value,this._sessionEntries.push(e)):(this._sessionValue=e.value,this._sessionEntries=[e]),this._onAfterProcessingUnexpectedShift?.(e)}},HQ=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},UQ=e=>{let t=!1;return()=>{t||=(e(),!0)}},WQ=e=>{Y.document?.prerendering?addEventListener(`prerenderingchange`,()=>e(),!0):e()},GQ=[1800,3e3],KQ=(e,t={})=>{WQ(()=>{let n=FQ(),r=RQ(`FCP`),i,a=HQ(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-OQ(),0),r.entries.push(t),i(!0)))});a&&(i=EQ(e,r,GQ,t.reportAllChanges))})},qQ=[.1,.25],JQ=(e,t={})=>{KQ(UQ(()=>{let n=RQ(`CLS`,0),r,i=FQ(),a=BQ(t,VQ),o=e=>{for(let t of e)a._processEntry(t);a._sessionValue>n.value&&(n.value=a._sessionValue,n.entries=a._sessionEntries,r())},s=HQ(`layout-shift`,o);s&&(r=EQ(e,n,qQ,t.reportAllChanges),i.onHidden(()=>{o(s.takeRecords()),r(!0)}),Y?.setTimeout?.(r))}))},YQ=0,XQ=1/0,ZQ=0,QQ=e=>{e.forEach(e=>{e.interactionId&&(XQ=Math.min(XQ,e.interactionId),ZQ=Math.max(ZQ,e.interactionId),YQ=ZQ?(ZQ-XQ)/7+1:0)})},$Q,e$=()=>$Q?YQ:performance.interactionCount||0,t$=()=>{`interactionCount`in performance||$Q||($Q=HQ(`event`,QQ,{type:`event`,buffered:!0,durationThreshold:0}))},n$=10,r$=0,i$=()=>e$()-r$,a$=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){r$=e$(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let e=Math.min(this._longestInteractionList.length-1,Math.floor(i$()/50));return this._longestInteractionList[e]}_processEntry(e){if(this._onBeforeProcessingEntry?.(e),!(e.interactionId||e.entryType===`first-input`))return;let t=this._longestInteractionList.at(-1),n=this._longestInteractionMap.get(e.interactionId);if(n||this._longestInteractionList.length<n$||e.duration>t._latency){if(n?e.duration>n._latency?(n.entries=[e],n._latency=e.duration):e.duration===n._latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],_latency:e.duration},this._longestInteractionMap.set(n.id,n),this._longestInteractionList.push(n)),this._longestInteractionList.sort((e,t)=>t._latency-e._latency),this._longestInteractionList.length>n$){let e=this._longestInteractionList.splice(n$);for(let t of e)this._longestInteractionMap.delete(t.id)}this._onAfterProcessingINPCandidate?.(n)}}},o$=e=>{let t=Y.requestIdleCallback||Y.setTimeout;Y.document?.visibilityState===`hidden`?e():(e=UQ(e),kQ(`visibilitychange`,e,{once:!0,capture:!0}),kQ(`pagehide`,e,{once:!0,capture:!0}),t(()=>{e(),AQ(`visibilitychange`,e,{capture:!0}),AQ(`pagehide`,e,{capture:!0})}))},s$=[200,500],c$=40,l$=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&`interactionId`in PerformanceEventTiming.prototype))return;let n=FQ();WQ(()=>{t$();let r=RQ(`INP`),i,a=BQ(t,a$),o=e=>{o$(()=>{for(let t of e)a._processEntry(t);let t=a._estimateP98LongestInteraction();t&&t._latency!==r.value&&(r.value=t._latency,r.entries=t.entries,i())})},s=HQ(`event`,o,{durationThreshold:t.durationThreshold??c$});i=EQ(e,r,s$,t.reportAllChanges),s&&(s.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{o(s.takeRecords()),i(!0)}))})},u$=class{_processEntry(e){this._onBeforeProcessingEntry?.(e)}},d$=[2500,4e3],f$=(e,t={})=>{WQ(()=>{let n=FQ(),r=RQ(`LCP`),i,a=BQ(t,u$),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(let t of e)a._processEntry(t),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-OQ(),0),r.entries=[t],i())},s=HQ(`largest-contentful-paint`,o);if(s){i=EQ(e,r,d$,t.reportAllChanges);let n=UQ(()=>{o(s.takeRecords()),s.disconnect(),i(!0)}),a=e=>{e.isTrusted&&(o$(n),AQ(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])kQ(e,a,{capture:!0})}})},p$=[800,1800],m$=e=>{Y.document?.prerendering?WQ(()=>m$(e)):Y.document?.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>m$(e),!0)},h$=(e,t={})=>{let n=RQ(`TTFB`),r=EQ(e,n,p$,t.reportAllChanges);m$(()=>{let e=DQ();e&&(n.value=Math.max(e.responseStart-OQ(),0),n.entries=[e],r(!0))})},g$={},_$={},v$,y$,b$,x$;function S$(e,t=!1){return M$(`cls`,e,O$,v$,t)}function C$(e,t=!1){return M$(`lcp`,e,k$,y$,t)}function w$(e){return M$(`ttfb`,e,A$,b$)}function T$(e){return M$(`inp`,e,j$,x$)}function E$(e,t){return P$(e,t),_$[e]||(N$(e),_$[e]=!0),F$(e,t)}function D$(e,t){let n=g$[e];if(n?.length)for(let r of n)try{r(t)}catch(t){wQ&&G.error(`Error while triggering instrumentation handler.
|
|
993
|
+
Type: ${e}
|
|
994
|
+
Name: ${CN(r)}
|
|
995
|
+
Error:`,t)}}function O$(){return JQ(e=>{D$(`cls`,{metric:e}),v$=e},{reportAllChanges:!0})}function k$(){return f$(e=>{D$(`lcp`,{metric:e}),y$=e},{reportAllChanges:!0})}function A$(){return h$(e=>{D$(`ttfb`,{metric:e}),b$=e})}function j$(){return l$(e=>{D$(`inp`,{metric:e}),x$=e})}function M$(e,t,n,r,i=!1){P$(e,t);let a;return _$[e]||(a=n(),_$[e]=!0),r&&t({metric:r}),F$(e,t,i?a:void 0)}function N$(e){let t={};e===`event`&&(t.durationThreshold=0),HQ(e,t=>{D$(e,{entries:t})},t)}function P$(e,t){g$[e]=g$[e]||[],g$[e].push(t)}function F$(e,t,n){return()=>{n&&n();let r=g$[e];if(!r)return;let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}function I$(e){return`duration`in e}var L$=80,R$={};try{typeof Node<`u`&&(R$.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,`parentNode`).get),typeof Element<`u`&&(R$.tagName=Object.getOwnPropertyDescriptor(Element.prototype,`tagName`).get,R$.id=Object.getOwnPropertyDescriptor(Element.prototype,`id`).get,R$.className=Object.getOwnPropertyDescriptor(Element.prototype,`className`).get,R$.getAttribute=Element.prototype.getAttribute),typeof HTMLElement<`u`&&(R$.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,`dataset`).get)}catch{}function z$(e,t,n){let r=R$[t];if(r)try{return r.call(e,n)}catch{}let i=e[t];return typeof i==`function`?i.call(e,n):i}function B$(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||L$;for(;n&&i++<5&&(o=V$(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=z$(n,`parentNode`);return r.reverse().join(` > `)}catch{return`<unknown>`}}function V$(e,t){let n=[],r=z$(e,`tagName`);if(!r)return``;if(typeof HTMLElement<`u`&&e instanceof HTMLElement){let t=z$(e,`dataset`);if(t){if(t.sentryComponent)return t.sentryComponent;if(t.sentryElement)return t.sentryElement}}n.push(r.toLowerCase());let i=t?.length?t.filter(t=>z$(e,`getAttribute`,t)).map(t=>[t,z$(e,`getAttribute`,t)]):null;if(i?.length)i.forEach(e=>{n.push(`[${e[0]}="${e[1]}"]`)});else{let t=z$(e,`id`);t&&n.push(`#${t}`);let r=z$(e,`className`);if(r&&UN(r)){let e=r.split(/\s+/);for(let t of e)n.push(`.${t}`)}}for(let t of[`aria-label`,`type`,`name`,`title`,`alt`]){let r=z$(e,`getAttribute`,t);r&&n.push(`[${t}="${r}"]`)}return n.join(``)}var H$=e=>{let t=t=>{(t.type===`pagehide`||Y.document?.visibilityState===`hidden`)&&e(t)};kQ(`visibilitychange`,t,{capture:!0,once:!0}),kQ(`pagehide`,t,{capture:!0,once:!0})};function U$(e){return typeof e==`number`&&isFinite(e)}function W$(e,t,n,{...r}){let i=YI(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime==`function`&&e.updateStartTime(t),bR(e,()=>{let e=_R({startTime:t,...r});return e&&e.end(n),e})}function G$(e){let t=q();if(!t)return;let{name:n,transaction:r,attributes:i,startTime:a}=e,{release:o,environment:s}=t.getOptions(),{userInfo:c}=t.getDataCollectionOptions(),l=t.getIntegrationByName(`Replay`)?.getReplayId(),u=K(),d=u.getUser(),f=d===void 0?void 0:d.email||d.id||d.ip_address,p;try{p=u.getScopeData().contexts.profile.profile_id}catch{}return _R({name:n,attributes:{release:o,environment:s,user:f||void 0,profile_id:p||void 0,replay_id:l||void 0,transaction:r,"user_agent.original":Y.navigator?.userAgent,"client.address":c?`{{auto}}`:void 0,...i},startTime:a,experimental:{standalone:!0}})}function K$(){return Y.addEventListener&&Y.performance}function q$(e){return e/1e3}function J$(e){let t=`unknown`,n=`unknown`,r=``;for(let i of e){if(i===`/`){[t,n]=e.split(`/`);break}if(!isNaN(Number(i))){t=r===`h`?`http`:r,n=e.split(r)[1];break}r+=i}return r===e&&(t=r),{name:t,version:n}}function Y$(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function X$(e,t){let n,r=!1;function i(e){!r&&n&&t(e,n.spanContext().spanId,n),r=!0}H$(()=>{i(`pagehide`)});let a=e.on(`beforeStartNavigationSpan`,(e,t)=>{t?.isRedirect||(i(`navigation`),a(),o())}),o=e.on(`afterStartPageLoadSpan`,e=>{n=e,o()})}function Z$(e){let t=0,n;if(!Y$(`layout-shift`))return;let r=S$(({metric:e})=>{let r=e.entries[e.entries.length-1];r&&(t=e.value,n=r)},!0);X$(e,(e,i)=>{Q$(t,n,i,e),r()})}function Q$(e,t,n,r){wQ&&G.log(`Sending CLS span (${e})`);let i=t?q$((YP()||0)+t.startTime):KP(),a=K().getScopeData().transactionName,o=t?B$(t.sources[0]?.node):`Layout shift`,s={[VF]:`auto.http.browser.cls`,[BF]:`ui.webvital.cls`,[eI]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((e,t)=>{s[`cls.source.${t+1}`]=B$(e.node)});let c=G$({name:o,transaction:a,attributes:s,startTime:i});c&&(c.addEvent(`cls`,{[UF]:``,[WF]:e}),c.end(i))}function $$(e){return e!=null&&e>0&&e<=6e4}function e1(e){let t=0,n;if(!Y$(`largest-contentful-paint`))return;let r=C$(({metric:e})=>{let r=e.entries[e.entries.length-1];!r||!$$(e.value)||(t=e.value,n=r)},!0);X$(e,(e,i)=>{t1(t,n,i,e),r()})}function t1(e,t,n,r){if(!$$(e))return;wQ&&G.log(`Sending LCP span (${e})`);let i=q$((YP()||0)+(t?.startTime||0)),a=K().getScopeData().transactionName,o=t?B$(t.element):`Largest contentful paint`,s={[VF]:`auto.http.browser.lcp`,[BF]:`ui.webvital.lcp`,[eI]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(s[`lcp.element`]=B$(t.element)),t.id&&(s[`lcp.id`]=t.id),t.url&&(s[`lcp.url`]=t.url),t.loadTime!=null&&(s[`lcp.loadTime`]=t.loadTime),t.renderTime!=null&&(s[`lcp.renderTime`]=t.renderTime),t.size!=null&&(s[`lcp.size`]=t.size));let c=G$({name:o,transaction:a,attributes:s,startTime:i});c&&(c.addEvent(`lcp`,{[UF]:`millisecond`,[WF]:e}),c.end(i))}function n1(e){return e&&((YP()||performance.timeOrigin)+e)/1e3}function r1(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=J$(e.nextHopProtocol);t[`network.protocol.version`]=r,t[`network.protocol.name`]=n}return YP()||K$()?.timeOrigin?i1({...t,"http.request.redirect_start":n1(e.redirectStart),"http.request.redirect_end":n1(e.redirectEnd),"http.request.worker_start":n1(e.workerStart),"http.request.fetch_start":n1(e.fetchStart),"http.request.domain_lookup_start":n1(e.domainLookupStart),"http.request.domain_lookup_end":n1(e.domainLookupEnd),"http.request.connect_start":n1(e.connectStart),"http.request.secure_connection_start":n1(e.secureConnectionStart),"http.request.connection_end":n1(e.connectEnd),"http.request.request_start":n1(e.requestStart),"http.request.response_start":n1(e.responseStart),"http.request.response_end":n1(e.responseEnd),"http.request.time_to_first_byte":e.responseStart==null?void 0:e.responseStart/1e3}):t}function i1(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!=null))}var a1=2147483647,o1=0,s1={},c1,l1;function u1({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=K$();if(r&&YP()){r.mark&&Y.performance.mark(`sentry-tracing-init`);let i=t?e1(n):t===!1?h1():void 0,a=e?Z$(n):e===!1?m1():void 0,o=g1(),s=_1();return()=>{o(),s(),i?.(),a?.()}}return()=>void 0}function d1(){E$(`longtask`,({entries:e})=>{let t=fL();if(!t)return;let{op:n,start_timestamp:r}=YI(t);for(let i of e){let e=q$(YP()+i.startTime),a=q$(i.duration);n===`navigation`&&r&&e<r||W$(t,e,e+a,{name:`Main UI thread blocked`,op:`ui.long-task`,attributes:{[VF]:`auto.ui.browser.metrics`}})}})}function f1(){new PerformanceObserver(e=>{let t=fL();if(t)for(let n of e.getEntries()){if(!n.scripts[0])continue;let e=q$(YP()+n.startTime),{start_timestamp:r,op:i}=YI(t);if(i===`navigation`&&r&&e<r)continue;let a=q$(n.duration),o={[VF]:`auto.ui.browser.metrics`},{invoker:s,invokerType:c,sourceURL:l,sourceFunctionName:u,sourceCharPosition:d}=n.scripts[0];o[`browser.script.invoker`]=s,o[`browser.script.invoker_type`]=c,l&&(o[`code.filepath`]=l),u&&(o[`code.function`]=u),d!==-1&&(o[`browser.script.source_char_position`]=d),W$(t,e,e+a,{name:`Main UI thread blocked`,op:`ui.long-animation-frame`,attributes:o})}}).observe({type:`long-animation-frame`,buffered:!0})}function p1(){E$(`event`,({entries:e})=>{let t=fL();if(t){for(let n of e)if(n.name===`click`){let e=q$(YP()+n.startTime),r=q$(n.duration),i={name:B$(n.target),op:`ui.interaction.${n.name}`,startTime:e,attributes:{[VF]:`auto.ui.browser.metrics`}},a=LJ(n.target);a&&(i.attributes[`ui.component_name`]=a),W$(t,e,e+r,i)}}})}function m1(){return S$(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(s1.cls={value:e.value,unit:``},l1=t)},!0)}function h1(){return C$(({metric:e})=>{let t=e.entries[e.entries.length-1];!t||!$$(e.value)||(s1.lcp={value:e.value,unit:`millisecond`},c1=t)},!0)}function g1(){return w$(({metric:e})=>{e.entries[e.entries.length-1]&&(s1.ttfb={value:e.value,unit:`millisecond`})})}function _1(){return E$(`paint`,({entries:e})=>{let t=FQ();for(let n of e){let e=n.startTime<t.firstHiddenTime;n.name===`first-paint`&&e&&(s1.fp={value:n.startTime,unit:`millisecond`}),n.name===`first-contentful-paint`&&e&&(s1.fcp={value:n.startTime,unit:`millisecond`})}})}function v1(e,t){let n=K$(),r=YP();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:i,ignorePerformanceApiSpans:a,ignoreResourceSpans:o}=t,s=q$(r),c=n.getEntries(),{op:l,start_timestamp:u}=YI(e);c.slice(o1).forEach(t=>{let n=q$(t.startTime),r=q$(Math.max(0,t.duration));if(!(l===`navigation`&&u&&s+n<u))switch(t.entryType){case`navigation`:w1(e,t,s);break;case`mark`:case`paint`:case`measure`:S1(e,t,n,r,s,a);break;case`resource`:O1(e,t,t.name,n,r,s,o)}}),o1=Math.max(c.length-1,0),k1(e,i)}function y1(e,t){let n=YP();if(!K$()?.getEntries||!n){b1();return}let{spanStreamingEnabled:r,recordClsOnPageloadSpan:i,recordLcpOnPageloadSpan:a}=t,o=q$(n);if(YI(e).op===`pageload`){if(M1(s1),r){let t=(t,n,r)=>{let i=r??`browser.web_vital.${t}.value`;e.setAttribute(i,n),wQ&&G.log(`Setting web vital attribute`,{[i]:n},`on pageload span`)};[`ttfb`,`fp`,`fcp`].forEach(e=>{s1[e]&&t(e,s1[e].value)}),s1[`ttfb.requestTime`]&&t(`ttfb.requestTime`,s1[`ttfb.requestTime`].value,`browser.web_vital.ttfb.request_time`)}else i||delete s1.cls,a||delete s1.lcp,Object.entries(s1).forEach(([t,n])=>{tR(t,n.value,n.unit,e)}),A1(e,t);e.setAttribute(r?`browser.performance.time_origin`:`performance.timeOrigin`,o),e.setAttribute(r?`browser.performance.navigation.activation_start`:`performance.activationStart`,OQ())}b1()}function b1(){c1=void 0,l1=void 0,s1={}}function x1(e){if(e?.entryType===`measure`)try{return e.detail.devtools.track===`Components ⚛`}catch{return}}function S1(e,t,n,r,i,a){if(x1(t)||[`mark`,`measure`].includes(t.entryType)&&AP(t.name,a))return;let o=DQ(!1),s=q$(o?o.requestStart:0),c=i+Math.max(n,s),l=i+n,u=l+r,d={[VF]:`auto.resource.browser.metrics`};c!==l&&(d[`sentry.browser.measure_happened_before_request`]=!0,d[`sentry.browser.measure_start_time`]=c),C1(d,t),c<=u&&W$(e,c,u,{name:t.name,op:t.entryType,attributes:d})}function C1(e,t){try{let n=t.detail;if(!n)return;if(typeof n==`object`){for(let[t,r]of Object.entries(n))if(r&&GN(r))e[`sentry.browser.measure.detail.${t}`]=r;else if(r!==void 0)try{e[`sentry.browser.measure.detail.${t}`]=JSON.stringify(r)}catch{}return}if(GN(n)){e[`sentry.browser.measure.detail`]=n;return}try{e[`sentry.browser.measure.detail`]=JSON.stringify(n)}catch{}}catch{}}function w1(e,t,n){[`unloadEvent`,`redirect`,`domContentLoadedEvent`,`loadEvent`,`connect`].forEach(r=>{T1(e,t,r,n)}),T1(e,t,`secureConnection`,n,`TLS/SSL`),T1(e,t,`fetch`,n,`cache`),T1(e,t,`domainLookup`,n,`DNS`),D1(e,t,n)}function T1(e,t,n,r,i=n){let a=t[E1(n)],o=t[`${n}Start`];!o||!a||W$(e,r+q$(o),r+q$(a),{op:`browser.${i}`,name:t.name,attributes:{[VF]:`auto.ui.browser.metrics`,...n===`redirect`&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function E1(e){return e===`secureConnection`?`connectEnd`:e===`fetch`?`domainLookupStart`:`${e}End`}function D1(e,t,n){let r=n+q$(t.requestStart),i=n+q$(t.responseEnd),a=n+q$(t.responseStart);t.responseEnd&&(W$(e,r,i,{op:`browser.request`,name:t.name,attributes:{[VF]:`auto.ui.browser.metrics`}}),W$(e,a,i,{op:`browser.response`,name:t.name,attributes:{[VF]:`auto.ui.browser.metrics`}}))}function O1(e,t,n,r,i,a,o){if(t.initiatorType===`xmlhttprequest`||t.initiatorType===`fetch`)return;let s=t.initiatorType?`resource.${t.initiatorType}`:`resource.other`;if(o?.includes(s))return;let c={[VF]:`auto.resource.browser.metrics`},l=$V(n);l.protocol&&(c[`url.scheme`]=l.protocol.split(`:`).pop()),l.host&&(c[`server.address`]=l.host),c[`url.same_origin`]=n.includes(Y.location.origin),c[tI]=n,j1(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`]]);let u={...c,...r1(t)},d=a+r;W$(e,d,d+i,{name:n.replace(Y.location.origin,``),op:s,attributes:u})}function k1(e,t){let n=Y.navigator;if(!n)return;let r=n.connection;r&&(r.effectiveType&&e.setAttribute(t?`network.connection.effective_type`:`effectiveConnectionType`,r.effectiveType),r.type&&e.setAttribute(t?`network.connection.type`:`connectionType`,r.type),U$(r.rtt)&&(t?e.setAttribute(`network.connection.rtt`,r.rtt):YI(e).op===`pageload`&&tR(`connection.rtt`,r.rtt,`millisecond`))),U$(n.deviceMemory)&&(t?e.setAttribute(`device.memory.estimated_capacity`,n.deviceMemory):e.setAttribute(`deviceMemory`,`${n.deviceMemory} GB`)),U$(n.hardwareConcurrency)&&(t?e.setAttribute(`device.processor_count`,n.hardwareConcurrency):e.setAttribute(`hardwareConcurrency`,String(n.hardwareConcurrency)))}function A1(e,t){c1&&t.recordLcpOnPageloadSpan&&(c1.element&&e.setAttribute(`lcp.element`,B$(c1.element)),c1.id&&e.setAttribute(`lcp.id`,c1.id),c1.url&&e.setAttribute(`lcp.url`,c1.url.trim().slice(0,200)),c1.loadTime!=null&&e.setAttribute(`lcp.loadTime`,c1.loadTime),c1.renderTime!=null&&e.setAttribute(`lcp.renderTime`,c1.renderTime),e.setAttribute(`lcp.size`,c1.size)),l1?.sources&&t.recordClsOnPageloadSpan&&l1.sources.forEach((t,n)=>e.setAttribute(`cls.source.${n+1}`,B$(t.node)))}function j1(e,t,n){n.forEach(([n,r])=>{let i=e[n];i!=null&&(typeof i==`number`&&i<a1||typeof i==`string`)&&(t[r]=i)})}function M1(e){let t=DQ(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e[`ttfb.requestTime`]={value:n-r,unit:`millisecond`})}var N1=`ElementTiming`,P1=xB((()=>({name:N1,setup(){!K$()||!YP()||E$(`element`,({entries:e})=>{for(let t of e){let e=t;if(!e.identifier)continue;let n=e.identifier,r=e.name,i=e.renderTime,a=e.loadTime,o={"sentry.origin":`auto.ui.browser.element_timing`,"ui.element.identifier":n};r&&(o[`ui.element.paint_type`]=r),e.id&&(o[`ui.element.id`]=e.id),e.element&&(o[`ui.element.type`]=e.element.tagName.toLowerCase()),e.url&&(o[`ui.element.url`]=e.url),e.naturalWidth&&(o[`ui.element.width`]=e.naturalWidth),e.naturalHeight&&(o[`ui.element.height`]=e.naturalHeight),i>0&&AW(`ui.element.render_time`,i,{unit:`millisecond`,attributes:o}),a>0&&AW(`ui.element.load_time`,a,{unit:`millisecond`,attributes:o})}})}}))),F1=[],I1=new Map,L1=new Map;function R1(){if(K$()&&YP()){let e=B1();return()=>{e()}}return()=>void 0}var z1={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 B1(){return T$(V1)}var V1=({metric:e})=>{if(e.value==null)return;let t=q$(e.value);if(t>60)return;let n=e.entries.find(t=>t.duration===e.value&&z1[t.name]);if(!n)return;let{interactionId:r}=n,i=z1[n.name],a=q$(YP()+n.startTime),o=fL(),s=o?uL(o):void 0,c=r==null?void 0:I1.get(r),l=c?.span||s,u=l?YI(l).description:K().getScopeData().transactionName,d=G$({name:c?.elementName||B$(n.target),transaction:u,attributes:{[VF]:`auto.http.browser.inp`,[BF]:`ui.interaction.${i}`,[eI]:n.duration},startTime:a});d&&(d.addEvent(`inp`,{[UF]:`millisecond`,[WF]:e.value}),d.end(a+t))};function H1(e){return e==null?void 0:I1.get(e)}function U1(){let e=Object.keys(z1);jB()&&e.forEach(e=>{Y.addEventListener(e,t,{capture:!0,passive:!0})});function t(e){let t=e.target;if(!t)return;let n=B$(t),r=Math.round(e.timeStamp);if(L1.set(r,n),L1.size>50){let e=L1.keys().next().value;e!==void 0&&L1.delete(e)}}function n(e){let t=Math.round(e.startTime),n=L1.get(t);if(!n)for(let e=-5;e<=5;e++){let r=L1.get(t+e);if(r){n=r;break}}return n||`<unknown>`}let r=({entries:e})=>{let t=fL(),r=t&&uL(t);e.forEach(e=>{if(!I$(e))return;let t=e.interactionId;if(t==null||I1.has(t))return;let i=e.target?B$(e.target):n(e);if(F1.length>10){let e=F1.shift();I1.delete(e)}F1.push(t),I1.set(t,{span:r,elementName:i})})};E$(`event`,r),E$(`first-input`,r)}function W1(e){let{name:t,op:n,origin:r,metricName:i,value:a,attributes:o,parentSpan:s,reportEvent:c,startTime:l,endTime:u}=e,d=K().getScopeData().transactionName,f={[VF]:r,[BF]:n,[eI]:0,[`browser.web_vital.${i}.value`]:a,[Fc]:d,[Nc]:d,"user_agent.original":Y.navigator?.userAgent,...o};s&&XI(s).attributes?.[`sentry.op`]===`pageload`&&(f[`sentry.pageload.span_id`]=s.spanContext().spanId),c&&(f[`browser.web_vital.${i}.report_event`]=c);let p=_R({name:t,attributes:f,startTime:l,parentSpan:s});p&&p.end(u??l)}function G1(e){let t=0,n;if(!Y$(`largest-contentful-paint`))return;let r=C$(({metric:e})=>{let r=e.entries[e.entries.length-1];!r||!$$(e.value)||(t=e.value,n=r)},!0);X$(e,(e,i,a)=>{K1(t,n,a,e),r()})}function K1(e,t,n,r){if(!$$(e))return;wQ&&G.log(`Sending LCP span (${e})`);let i=YP()||0,a=q$(i),o=q$(i+(t?.startTime||0)),s=t?B$(t.element):`Largest contentful paint`,c={};t?.element&&(c[`browser.web_vital.lcp.element`]=B$(t.element)),t?.id&&(c[`browser.web_vital.lcp.id`]=t.id),t?.url&&(c[`browser.web_vital.lcp.url`]=t.url),t?.loadTime!=null&&(c[`browser.web_vital.lcp.load_time`]=t.loadTime),t?.renderTime!=null&&(c[`browser.web_vital.lcp.render_time`]=t.renderTime),t?.size!=null&&(c[`browser.web_vital.lcp.size`]=t.size),W1({name:s,op:`ui.webvital.lcp`,origin:`auto.http.browser.lcp`,metricName:`lcp`,value:e,attributes:c,parentSpan:n,reportEvent:r,startTime:a,endTime:o})}function q1(e){let t=0,n;if(!Y$(`layout-shift`))return;let r=S$(({metric:e})=>{let r=e.entries[e.entries.length-1];r&&(t=e.value,n=r)},!0);X$(e,(e,i,a)=>{J1(t,n,a,e),r()})}function J1(e,t,n,r){wQ&&G.log(`Sending CLS span (${e})`);let i=t?q$((YP()||0)+t.startTime):KP(),a=t?B$(t.sources[0]?.node):`Layout shift`,o={};t?.sources&&t.sources.forEach((e,t)=>{o[`browser.web_vital.cls.source.${t+1}`]=B$(e.node)}),W1({name:a,op:`ui.webvital.cls`,origin:`auto.http.browser.cls`,metricName:`cls`,value:e,attributes:o,parentSpan:n,reportEvent:r,startTime:i})}function Y1(){!K$()||!YP()||T$(({metric:e})=>{if(e.value==null||q$(e.value)>60)return;let t=e.entries.find(t=>t.duration===e.value&&z1[t.name]);t&&X1(e.value,t)})}function X1(e,t){wQ&&G.log(`Sending INP span (${e})`);let n=q$(YP()+t.startTime),r=q$(e),i=z1[t.name],a=H1(t.interactionId),o=fL(),s=o?uL(o):void 0,c=a?.span||s,l=c?XI(c).name:K().getScopeData().transactionName;W1({name:a?.elementName||B$(t.target),op:`ui.interaction.${i}`,origin:`auto.http.browser.inp`,metricName:`inp`,value:e,attributes:{[eI]:t.duration,[Fc]:l,[Nc]:l},startTime:n,endTime:n+r,parentSpan:c})}var Z1=1e3,Q1,$1,e0;function t0(e){ON(`dom`,e),kN(`dom`,n0)}function n0(){if(!Y.document)return;let e=AN.bind(null,`dom`),t=a0(e,!0);Y.document.addEventListener(`click`,t,!1),Y.document.addEventListener(`keypress`,t,!1),[`EventTarget`,`Node`].forEach(t=>{let n=Y[t]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&($N(n,`addEventListener`,function(t){return function(n,r,i){if(n===`click`||n==`keypress`)try{let r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=r[n]=r[n]||{refCount:0};if(!a.handler){let r=a0(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch{}return t.call(this,n,r,i)}}),$N(n,`removeEventListener`,function(e){return function(t,n,r){if(t===`click`||t==`keypress`)try{let n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),Object.keys(n).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function r0(e){if(e.type!==$1)return!1;try{if(!e.target||e.target._sentryId!==e0)return!1}catch{}return!0}function i0(e,t){return e===`keypress`?!t?.tagName||!(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable):!1}function a0(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=o0(n);if(i0(n.type,r))return;eP(n,`_sentryCaptured`,!0),r&&!r._sentryId&&eP(r,`_sentryId`,PP());let i=n.type===`keypress`?`input`:n.type;r0(n)||(e({event:n,name:i,global:t}),$1=n.type,e0=r?r._sentryId:void 0),clearTimeout(Q1),Q1=Y.setTimeout(()=>{e0=void 0,$1=void 0},Z1)}}function o0(e){try{return e.target}catch{return null}}var s0;function c0(e){let t=`history`;ON(t,e),kN(t,l0)}function l0(){if(Y.addEventListener(`popstate`,()=>{let e=Y.location.href,t=s0;s0=e,t!==e&&AN(`history`,{from:t,to:e})}),!gJ())return;function e(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let r=s0,i=u0(String(n));if(s0=i,r===i)return e.apply(this,t);AN(`history`,{from:r,to:i})}return e.apply(this,t)}}$N(Y.history,`pushState`,e),$N(Y.history,`replaceState`,e)}function u0(e){try{return new URL(e,Y.location.origin).toString()}catch{return e}}var d0={};function f0(e){let t=d0[e];if(t)return t;let n=Y[e];if(vJ(n))return d0[e]=n.bind(Y);let r=Y.document;if(r&&typeof r.createElement==`function`)try{let t=r.createElement(`iframe`);t.hidden=!0,r.head.appendChild(t);let i=t.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(t)}catch(t){wQ&&G.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n&&(d0[e]=n.bind(Y))}function p0(e){d0[e]=void 0}function m0(...e){return f0(`setTimeout`)(...e)}var h0=`__sentry_xhr_v3__`;function g0(e){ON(`xhr`,e),kN(`xhr`,_0)}function _0(){if(!Y.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=Error(),i=KP()*1e3,a=UN(n[0])?n[0].toUpperCase():void 0,o=v0(n[1]);if(!a||!o)return e.apply(t,n);t[h0]={method:a,url:o,request_headers:{}},a===`POST`&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);let s=()=>{let e=t[h0];if(e&&t.readyState===4){try{e.status_code=t.status}catch{}AN(`xhr`,{endTimestamp:KP()*1e3,startTimestamp:i,xhr:t,virtualError:r}),t.removeEventListener(`readystatechange`,s)}};return`onreadystatechange`in t&&typeof t.onreadystatechange==`function`?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply(e,t,n){return s(),e.apply(t,n)}}):t.addEventListener(`readystatechange`,s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){let[r,i]=n,a=t[h0];return a&&UN(r)&&UN(i)&&(a.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){let r=t[h0];return r?(n[0]!==void 0&&(r.body=n[0]),AN(`xhr`,{startTimestamp:KP()*1e3,xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function v0(e){if(UN(e))return e;try{return e.toString()}catch{}}var y0=Symbol.for(`sentry__originalRequestBody`);function b0(e){return new URLSearchParams(e).toString()}function x0(e,t=G){try{if(typeof e==`string`)return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[b0(e)];if(!e)return[void 0]}catch(n){return wQ&&t.error(n,`Failed to serialize body`,e),[void 0,`BODY_PARSE_ERROR`]}return wQ&&t.log(`Skipping network body because of body type`,e),[void 0,`UNPARSEABLE_BODY_TYPE`]}function S0(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){let t=e[0][y0];return t===void 0?void 0:t}}function C0(e){let t;try{t=e.getAllResponseHeaders()}catch(t){return wQ&&G.error(t,`Failed to get xhr response headers`,e),{}}return t?t.split(`\r
|
|
996
|
+
`).reduce((e,t)=>{let[n,r]=t.split(`: `);return r&&(e[n.toLowerCase()]=r),e},{}):{}}function w0(e){if(typeof Element>`u`)return!1;try{return e instanceof Element}catch{return!1}}function T0(e){try{return new URL(e,Y.location.origin).toString()}catch{return e}}var E0=40;function D0(e,t=f0(`fetch`)){let n=0,r=0;async function i(i){let a=i.body.length;n+=a,r++;let o={body:i.body,method:`POST`,referrerPolicy:`strict-origin`,headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{let n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get(`X-Sentry-Rate-Limits`),"retry-after":n.headers.get(`Retry-After`)}}}catch(e){throw p0(`fetch`),e}finally{n-=a,r--}}return uV(e,i,iV(e.bufferSize||E0))}var X=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;function O0(){let e=q();if(!e){X&&G.warn(`No Sentry client available, profiling is not started`);return}if(!e.getIntegrationByName(`BrowserProfiling`)){X&&G.warn(`BrowserProfiling integration is not available`);return}e.emit(`startUIProfiler`)}function k0(){let e=q();if(!e){X&&G.warn(`No Sentry client available, profiling is not started`);return}if(!e.getIntegrationByName(`BrowserProfiling`)){X&&G.warn(`ProfilingIntegration is not available`);return}e.emit(`stopUIProfiler`)}var A0={startProfiler:O0,stopProfiler:k0},j0=30,M0=50;function N0(e,t,n,r){let i={filename:e,function:t===`<anonymous>`?`?`:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var P0=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,F0=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,I0=/\((\S*)(?::(\d+))(?::(\d+))\)/,L0=/at (.+?) ?\(data:(.+?),/,R0=[j0,e=>{let t=e.match(L0);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=P0.exec(e);if(n){let[,e,t,r]=n;return N0(e,`?`,+t,+r)}let r=F0.exec(e);if(r){if(r[2]?.indexOf(`eval`)===0){let e=I0.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}let[e,t]=H0(r[1]||`?`,r[2]);return N0(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],z0=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,B0=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,V0=vN(R0,[M0,e=>{let t=z0.exec(e);if(t){if(t[3]&&t[3].indexOf(` > eval`)>-1){let e=B0.exec(t[3]);e&&(t[1]=t[1]||`eval`,t[3]=e[1],t[4]=e[2],t[5]=``)}let e=t[3],n=t[1]||`?`;return[n,e]=H0(n,e),N0(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),H0=(e,t)=>{let n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?`?`:e.split(`@`)[0],n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};function U0(e,{metadata:t,tunnel:n,dsn:r}){return FL({event_id:e.event_id,sent_at:new Date().toISOString(),...t?.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:TI(r)}},[W0(e)])}function W0(e){return[{type:`user_report`},e]}var G0=1024,fce=`Breadcrumbs`,K0=xB(((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:fce,setup(e){t.console&&qH(hce(e)),t.dom&&t0(mce(e,t.dom)),t.xhr&&g0(gce(e)),t.fetch&&xJ(_ce(e)),t.history&&c0(vce(e)),t.sentry&&e.on(`beforeSendEvent`,pce(e))}}}));function pce(e){return function(t){q()===e&&hH({category:`sentry.${t.type===`transaction`?`transaction`:`event`}`,event_id:t.event_id,level:t.level,message:IP(t)},{event:t})}}function mce(e,t){return function(n){if(q()!==e)return;let r,i,a=typeof t==`object`?t.serializeAttribute:void 0,o=typeof t==`object`&&typeof t.maxStringLength==`number`?t.maxStringLength:void 0;o&&o>G0&&(X&&G.warn(`\`dom.maxStringLength\` cannot exceed ${G0}, but a value of ${o} was configured. Sentry will use ${G0} instead.`),o=G0),typeof a==`string`&&(a=[a]);try{let e=n.event,t=yce(e)?e.target:e;r=B$(t,{keyAttrs:a,maxStringLength:o}),i=LJ(t)}catch{r=`<unknown>`}if(r.length===0)return;let s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),hH(s,{event:n.event,name:n.name,global:n.global})}}function hce(e){return function(t){if(q()!==e)return;let n={category:`console`,data:{arguments:t.args,logger:`console`},level:XH(t.level),message:OP(t.args,` `)};if(t.level===`assert`)if(t.args[0]===!1)n.message=`Assertion failed: ${OP(t.args.slice(1),` `)||`console.assert`}`,n.data.arguments=t.args.slice(1);else return;hH(n,{input:t.args,level:t.level})}}function gce(e){return function(t){if(q()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[h0];if(!n||!r||!i)return;let{method:a,url:o,status_code:s,body:c}=i,l={method:a,url:o,status_code:s},u={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},d={category:`xhr`,data:l,type:`http`,level:mJ(s)};e.emit(`beforeOutgoingRequestBreadcrumb`,d,u),hH(d,u)}}function _ce(e){return function(t){if(q()!==e)return;let{startTimestamp:n,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method===`POST`))if(t.error){let i={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},a={category:`fetch`,data:t.fetchData,level:`error`,type:`http`};e.emit(`beforeOutgoingRequestBreadcrumb`,a,i),hH(a,i)}else{let i=t.response,a={...t.fetchData,status_code:i?.status},o={input:t.args,response:i,startTimestamp:n,endTimestamp:r},s={category:`fetch`,data:a,type:`http`,level:mJ(a.status_code)};e.emit(`beforeOutgoingRequestBreadcrumb`,s,o),hH(s,o)}}}function vce(e){return function(t){if(q()!==e)return;let n=t.from,r=t.to,i=$V(J.location.href),a=n?$V(n):void 0,o=$V(r);a?.path||(a=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),hH({category:`navigation`,data:{from:n,to:r}})}}function yce(e){return!!e&&!!e.target}var bce=`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(`,`),xce=`BrowserApiErrors`,q0=xB(((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:xce,setupOnce(){t.setTimeout&&$N(J,`setTimeout`,J0),t.setInterval&&$N(J,`setInterval`,J0),t.requestAnimationFrame&&$N(J,`requestAnimationFrame`,Sce),t.XMLHttpRequest&&`XMLHttpRequest`in J&&$N(XMLHttpRequest.prototype,`send`,Cce);let e=t.eventTarget;e&&(Array.isArray(e)?e:bce).forEach(e=>wce(e,t))}}}));function J0(e){return function(...t){let n=t[0];return t[0]=YZ(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${CN(e)}`}}),e.apply(this,t)}}function Sce(e){return function(t){return e.apply(this,[YZ(t,{mechanism:{data:{handler:CN(e)},handled:!1,type:`auto.browser.browserapierrors.requestAnimationFrame`}})])}}function Cce(e){return function(...t){let n=this;return[`onload`,`onerror`,`onprogress`,`onreadystatechange`].forEach(e=>{e in n&&typeof n[e]==`function`&&$N(n,e,function(t){let n={mechanism:{data:{handler:CN(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=nP(t);return r&&(n.mechanism.data.handler=CN(r)),YZ(t,n)})}),e.apply(this,t)}}function wce(e,t){let n=J[e]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&($N(n,`addEventListener`,function(n){return function(r,i,a){try{Tce(i)&&(i.handleEvent=YZ(i.handleEvent,{mechanism:{data:{handler:CN(i),target:e},handled:!1,type:`auto.browser.browserapierrors.handleEvent`}}))}catch{}return t.unregisterOriginalCallbacks&&Ece(this,r,i),n.apply(this,[r,YZ(i,{mechanism:{data:{handler:CN(i),target:e},handled:!1,type:`auto.browser.browserapierrors.addEventListener`}}),a])}}),$N(n,`removeEventListener`,function(e){return function(t,n,r){try{if(Object.prototype.hasOwnProperty.call(n,`__sentry_wrapped__`)){let i=n.__sentry_wrapped__;i&&e.call(this,t,i,r)}}catch{}return e.call(this,t,n,r)}}))}function Tce(e){return typeof e.handleEvent==`function`}function Ece(e,t,n){e&&typeof e==`object`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`&&e.removeEventListener(t,n)}var Y0=xB((e={})=>{let t=e.lifecycle??`route`;return{name:`BrowserSession`,setupOnce(){if(J.document===void 0){X&&G.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}iB({ignoreDuration:!0});let e=!1;o$(()=>{e||=(sB(),!0)});let n=MF(),r=n.getUser();n.addScopeListener(t=>{let n=t.getUser();(r?.id!==n?.id||r?.ip_address!==n?.ip_address)&&(r=n,e&&sB())}),t===`route`&&c0(({from:t,to:n})=>{t!==n&&(iB({ignoreDuration:!0}),sB(),e=!0)})}}}),Dce=`CultureContext`,Oce=xB((()=>({name:Dce,preprocessEvent(e){let t=X0();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=X0();t&&pz(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})));function X0(){try{let e=J.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var kce=`GlobalHandlers`,Z0=xB(((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:kce,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(Ace(e),e2(`onerror`)),t.onunhandledrejection&&(jce(e),e2(`onunhandledrejection`))}}}));function Ace(e){MN(t=>{let{stackParser:n,attachStacktrace:r}=t2();if(q()!==e||qZ())return;let{msg:i,url:a,line:o,column:s,error:c}=t,l=Mce(_Q(n,c||i,void 0,r,!1),a,o,s);l.level=`error`,Wz(l,{originalException:c,mechanism:{handled:!1,type:`auto.browser.global_handlers.onerror`}})})}function jce(e){FN(t=>{let{stackParser:n,attachStacktrace:r}=t2();if(q()!==e||qZ())return;let i=Q0(t),a=GN(i)?$0(i):_Q(n,i,void 0,r,!0);a.level=`error`,Wz(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.global_handlers.onunhandledrejection`}})})}function Q0(e){if(GN(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 $0(e){return{exception:{values:[{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Mce(e,t,n,r){let i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},c=s.frames=s.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:Nce(t)??IJ(),function:`?`,in_app:!0}),e}function e2(e){X&&G.log(`Global Handler attached: ${e}`)}function t2(){return q()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function Nce(e){if(!(!UN(e)||e.length===0))return e.startsWith(`data:`)?`<${tH(e,!1)}>`:e}var n2=xB(()=>({name:`HttpContext`,preprocessEvent(e){if(!J.navigator&&!J.location&&!J.document)return;let t=XZ(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){let t=e.attributes?.[BF];if(!J.navigator&&!J.location&&!J.document)return;let n=XZ();pz(e,{"url.full":t===`http.client`?void 0:n.url,"http.request.header.user_agent":n.headers[`User-Agent`],"http.request.header.referer":n.headers.Referer})}})),Pce=`cause`,Fce=5,Ice=`LinkedErrors`,r2=xB(((e={})=>{let t=e.limit||Fce,n=e.key||Pce;return{name:Ice,preprocessEvent(e,r,i){MH(aQ,i.getOptions().stackParser,n,t,e,r)}}})),Lce=/^HTML(\w*)Element$/;function i2(e){if(typeof window<`u`&&e===window)return`[Window]`;if(typeof document<`u`&&e===document)return`[Document]`;if(w0(e)){let t=Rce(e);if(Lce.test(t))return`[HTMLElement: ${B$(e)}]`}}function Rce(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function zce(){return Bce()?(X&&oN(()=>{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 Bce(){if(J.window===void 0)return!1;let e=J;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let t=IJ();return!(J===J.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}function a2(e){return[SH(),vH(),dW(),q0(),K0(),Z0(),r2(),tU(),n2(),Oce(),Y0()]}function Vce(e={}){let t=!e.skipBrowserExtensionCheck&&zce(),n=e.defaultIntegrations==null?a2():e.defaultIntegrations,r={...e,enabled:!t&&e.enabled,stackParser:yN(e.stackParser||V0),integrations:gB({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||D0};return gP(i2),HV(SQ,r)}function Hce(){}function Uce(e){e()}function o2(e={}){let t=J.document,n=t?.head||t?.body;if(!n){X&&G.error(`[showReportDialog] Global document not defined`);return}let r=K(),i=q()?.getDsn();if(!i){X&&G.error(`[showReportDialog] DSN not configured`);return}let a={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||eB()},o=J.document.createElement(`script`);o.async=!0,o.crossOrigin=`anonymous`,o.src=pB(i,a);let{onLoad:s,onClose:c}=a;if(s&&(o.onload=s),c){let e=t=>{if(t.data===`__sentry_reportdialog_closed__`)try{c()}finally{J.removeEventListener(`message`,e)}};J.addEventListener(`message`,e)}n.appendChild(o)}var Wce=W,Gce=`ReportingObserver`,s2=new WeakMap,Kce=xB(((e={})=>{let t=e.types||[`crash`,`deprecation`,`intervention`];function n(e){if(s2.has(q()))for(let t of e)PF(e=>{e.setExtra(`url`,t.url);let n=`ReportingObserver [${t.type}]`,r=`No details available`;if(t.body){let n={};for(let e in t.body)n[e]=t.body[e];if(e.setExtra(`body`,n),t.type===`crash`){let e=t.body;r=[e.crashId||``,e.reason||``].join(` `).trim()||r}else r=t.body.message||r}Uz(`${n}: ${r}`)})}return{name:Gce,setupOnce(){bJ()&&new Wce.ReportingObserver(n,{buffered:!0,types:t}).observe()},setup(e){s2.set(e,!0)}}})),qce=`HttpClient`,Jce=xB(((e={})=>{let t={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...e};return{name:qce,setup(e){tle(e,t),nle(e,t)}}}));function Yce(e,t,n,r,i){if(l2(e,n.status,n.url)){let e=rle(t,r),a,o,s,c,l=d2();if(l.requestHeaders!==!1&&(a=KV(c2(e.headers),l.requestHeaders)),l.responseHeaders!==!1&&(o=KV(c2(n.headers),l.responseHeaders)),l.cookies!==!1){let t=e.headers.get(`Cookie`)||void 0;if(t){let e=JV(t,l.cookies);typeof e==`object`&&(s=e)}let r=n.headers.get(`Set-Cookie`)||void 0;if(r){let e=JV(r,l.cookies);typeof e==`object`&&(c=e)}}Wz(u2({url:e.url,method:e.method,status:n.status,requestHeaders:a,responseHeaders:o,requestCookies:s,responseCookies:c,error:i,type:`fetch`}))}}function Xce(e,t,n,r,i){if(l2(e,t.status,t.responseURL)){let e,a,o,s=d2();if(s.cookies!==!1)try{let e=t.getResponseHeader(`Set-Cookie`)||t.getResponseHeader(`set-cookie`)||void 0;if(e){let t=JV(e,s.cookies);typeof t==`object`&&(a=t)}}catch{}if(s.responseHeaders!==!1)try{o=KV(Qce(t),s.responseHeaders)}catch{}s.requestHeaders!==!1&&(e=KV(r,s.requestHeaders)),Wz(u2({url:t.responseURL,method:n,status:t.status,requestHeaders:e,responseHeaders:o,responseCookies:a,error:i,type:`xhr`}))}}function Zce(e){if(e){let t=e[`Content-Length`]||e[`content-length`];if(t)return parseInt(t,10)}}function c2(e){let t={};return e.forEach((e,n)=>{t[n]=e}),t}function Qce(e){let t=e.getAllResponseHeaders();return t?t.split(`\r
|
|
997
|
+
`).reduce((e,t)=>{let[n,r]=t.split(`: `);return n&&r&&(e[n]=r),e},{}):{}}function $ce(e,t){return e.some(e=>typeof e==`string`?t.includes(e):e.test(t))}function ele(e,t){return e.some(e=>typeof e==`number`?e===t:t>=e[0]&&t<=e[1])}function tle(e,t){yJ()&&xJ(n=>{if(q()!==e)return;let{response:r,args:i,error:a,virtualError:o}=n,[s,c]=i;r&&Yce(t,s,r,c,a||o)},!1)}function nle(e,t){`XMLHttpRequest`in W&&g0(n=>{if(q()!==e)return;let{error:r,virtualError:i}=n,a=n.xhr,o=a[h0];if(!o)return;let{method:s,request_headers:c}=o;try{Xce(t,a,s,c,r||i)}catch(e){X&&G.warn(`Error while extracting response event form XHR response`,e)}})}function l2(e,t,n){return ele(e.failedRequestStatusCodes,t)&&$ce(e.failedRequestTargets,n)&&!nH(n,q())}function u2(e){let t=q(),n=t&&e.error&&e.error instanceof Error?e.error.stack:void 0,r=n&&t?t.getOptions().stackParser(n,0,1):void 0,i=`HTTP Client Error with status code: ${e.status}`,a={message:i,exception:{values:[{type:`Error`,value:i,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:Zce(e.responseHeaders)}}};return RP(a,{type:`auto.http.client.${e.type}`,handled:!1}),a}function rle(e,t){return!t&&e instanceof Request||e instanceof Request&&e.bodyUsed?e:new Request(e,t)}function d2(){let e=q();if(!e)return{cookies:!1,requestHeaders:!1,responseHeaders:!1};let t=e.getOptions();if(t.dataCollection==null){let e=!!t.sendDefaultPii;return{cookies:e,requestHeaders:e,responseHeaders:e}}let{cookies:n,httpHeaders:r}=e.getDataCollectionOptions();return{cookies:n,requestHeaders:r.request,responseHeaders:r.response}}var f2=W,ile=7,ale=`ContextLines`,ole=xB(((e={})=>({name:ale,processEvent(t,n,r){return sle(t,e.frameContextLines??r?.getDataCollectionOptions().frameContextLines??ile)}})));function sle(e,t){let n=f2.document,r=f2.location&&eH(f2.location.href);if(!n||!r)return e;let i=e.exception?.values;if(!i?.length)return e;let a=n.documentElement.innerHTML;if(!a)return e;let o=[`<!DOCTYPE html>`,`<html>`,...a.split(`
|
|
998
|
+
`),`</html>`];return i.forEach(e=>{let n=e.stacktrace;n?.frames&&(n.frames=n.frames.map(e=>cle(e,o,r,t)))}),e}function cle(e,t,n,r){return e.filename!==n||!e.lineno||!t.length||zP(t,e,r),e}var lle=`GraphQLClient`,ule=(e=>({name:lle,setup(t){dle(t,e),fle(t,e)}}));function dle(e,t){e.on(`beforeOutgoingRequestSpan`,(n,r)=>{let i=YI(n).data||{};if(i[`sentry.op`]!==`http.client`)return;let a=i[`url.full`]||i[`http.url`]||i.url,o=i[`http.request.method`]||i[`http.method`];if(!UN(a)||!UN(o))return;let{endpoints:s}=t,c=AP(a,s),l=m2(r);if(c&&l){let t=_2(l);if(t){let r=p2(t);n.updateName(`${o} ${a} (${r})`),h2(t)&&e.getDataCollectionOptions().graphQL.document===!0&&n.setAttribute(Oc,t.query),g2(t)&&(n.setAttribute(`graphql.persisted_query.hash.sha256`,t.extensions.persistedQuery.sha256Hash),n.setAttribute(`graphql.persisted_query.version`,t.extensions.persistedQuery.version))}}})}function fle(e,t){e.on(`beforeOutgoingRequestBreadcrumb`,(n,r)=>{let{category:i,type:a,data:o}=n;if(a===`http`&&(i===`fetch`||i===`xhr`)){let n=o?.url,{endpoints:i}=t,a=AP(n,i),s=m2(r);if(a&&o&&s){let t=_2(s);!o.graphql&&t&&(o[`graphql.operation`]=p2(t),h2(t)&&e.getDataCollectionOptions().graphQL.document===!0&&(o[Oc]=t.query),g2(t)&&(o[`graphql.persisted_query.hash.sha256`]=t.extensions.persistedQuery.sha256Hash,o[`graphql.persisted_query.version`]=t.extensions.persistedQuery.version))}}})}function p2(e){if(g2(e))return`persisted ${e.operationName}`;if(h2(e)){let{query:t,operationName:n}=e,{operationName:r=n,operationType:i}=ple(t);return r?`${i} ${r}`:`${i}`}return`unknown`}function m2(e){let t=`xhr`in e,n;if(t){let t=e.xhr[h0];n=t&&x0(t.body)[0]}else n=x0(S0(e.input))[0];return n}function ple(e){let 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]};let i=e.match(n);return i?{operationType:i[1],operationName:void 0}:{operationType:void 0,operationName:void 0}}function h2(e){return qN(e)&&typeof e.query==`string`}function g2(e){return qN(e)&&typeof e.operationName==`string`&&qN(e.extensions)&&qN(e.extensions.persistedQuery)&&typeof e.extensions.persistedQuery.sha256Hash==`string`&&typeof e.extensions.persistedQuery.version==`number`}function _2(e){try{let t=JSON.parse(e);return h2(t)||g2(t)?t:void 0}catch{return}}var mle=xB(ule),hle=xB((e={})=>{let t=[`script`];function n(r,i,a=0){if(!r)return;let o=`shadowRoot`in r&&r.shadowRoot?r.shadowRoot.children:r.children;for(let r of o){if(!(r instanceof HTMLElement))continue;let o=LJ(r,1)||void 0,s=r.tagName.toLowerCase();if(t.includes(s))continue;let c=e.onElement?.({element:r,componentName:o,tagName:s,depth:a})||{};if(c===`skip`)continue;if(c===`children`){n(r,i,a+1);continue}let{x:l,y:u,width:d,height:f}=r.getBoundingClientRect(),p={identifier:r.id||void 0,type:o||s,visible:!0,alpha:1,height:f,width:d,x:l,y:u,...c};p.children=[],n(r,p.children,a+1),i.push(p)}}return{name:`ViewHierarchy`,processEvent:(t,r)=>{if(t.type!==void 0||e.shouldAttach?.(t,r)===!1)return t;let i={rendering_system:`DOM`,positioning:`absolute`,windows:[]};n(e.rootElement?.()||J.document.body,i.windows);let a={filename:`view-hierarchy.json`,attachmentType:`event.view_hierarchy`,contentType:`application/json`,data:JSON.stringify(i)};return r.attachments=r.attachments||[],r.attachments.push(a),t}}}),v2=W,y2=`sentryReplaySession`,gle=`replay_event`,b2=`Unable to send Replay`,_le=3e5,vle=9e5,yle=5e3,ble=5500,xle=6e4,Sle=5e3,Cle=3,x2=15e4,S2=5e3,wle=3e3,Tle=300,C2=2e7,Ele=4999,Dle=5e4,w2=36e5,Ole=Object.defineProperty,kle=(e,t,n)=>t in e?Ole(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T2=(e,t,n)=>kle(e,typeof t==`symbol`?t:t+``,n),E2=(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))(E2||{});function Ale(e){return e.nodeType===e.ELEMENT_NODE}function D2(e){return e?.host?.shadowRoot===e}function O2(e){return Object.prototype.toString.call(e)===`[object ShadowRoot]`}function jle(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 Mle(e){let{cssText:t}=e;if(t.split(`"`).length<3)return t;let 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 k2(e){try{let t=e.rules||e.cssRules;return t?jle(Array.from(t,A2).join(``)):null}catch{return null}}function Nle(e){let t=``;for(let n=0;n<e.style.length;n++){let r=e.style,i=r[n],a=r.getPropertyPriority(i);t+=`${i}:${r.getPropertyValue(i)}${a?` !important`:``};`}return`${e.selectorText} { ${t} }`}function A2(e){let t;if(Fle(e))try{t=k2(e.styleSheet)||Mle(e)}catch{}else if(Ile(e)){let t=e.cssText,n=e.selectorText.includes(`:`),r=typeof e.style.all==`string`&&e.style.all;if(r&&(t=Nle(e)),n&&(t=Ple(t)),n||r)return t}return t||e.cssText}function Ple(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,`$1\\$2`)}function Fle(e){return`styleSheet`in e}function Ile(e){return`selectorText`in e}var j2=class{constructor(){T2(this,`idNodeMap`,new Map),T2(this,`nodeMetaMap`,new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Lle(){return new j2}function M2({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 N2({isMasked:e,element:t,value:n,maskInputFn:r}){let i=n||``;return e?(r&&(i=r(i,t)),`*`.repeat(i.length)):i}function P2(e){return e.toLowerCase()}function F2(e){return e.toUpperCase()}var I2=`__rrweb_original__`;function Rle(e){let t=e.getContext(`2d`);if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){let i=t.getImageData,a=I2 in i?i[I2]:i;if(new Uint32Array(a.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>e!==0))return!1}return!0}function L2(e){let t=e.type;return e.hasAttribute(`data-rr-is-password`)?`password`:t?P2(t):null}function R2(e,t,n){return t===`INPUT`&&(n===`radio`||n===`checkbox`)?e.getAttribute(`value`)||``:e.value}function z2(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}return n.pathname.match(/\.([0-9a-z]+)(?:$)/i)?.[1]??null}var B2={};function V2(e){let t=B2[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement==`function`)try{let t=n.createElement(`iframe`);t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch{}return B2[e]=r.bind(window)}function H2(...e){return V2(`setTimeout`)(...e)}function U2(...e){return V2(`clearTimeout`)(...e)}function W2(e){try{return e.contentDocument}catch{}}function zle(e){try{return e.contentWindow}catch{}}var Ble=1,Vle=RegExp(`[^a-z0-9-_:]`),G2=-2;function K2(){return Ble++}function Hle(e){if(e instanceof HTMLFormElement)return`form`;let t=P2(e.tagName);return Vle.test(t)?`div`:t}function Ule(e){let t=``;return t=e.indexOf(`//`)>-1?e.split(`/`).slice(0,3).join(`/`):e.split(`/`)[0],t=t.split(`?`)[0],t}var q2,J2,Wle=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Gle=/^(?:[a-z+]+:)?\/\//i,Kle=/^www\..*/i,qle=/^(data:)([^,]*),(.*)/i;function Jle(e,t){if(!e||t.size===0)return e;try{let n=e.split(`;`),r=[];for(let e of n){if(e=e.trim(),!e)continue;let n=e.indexOf(`:`);if(n===-1){r.push(e);continue}let i=e.slice(0,n).trim();t.has(i)||r.push(e)}return r.join(`; `)+(r.length>0&&e.endsWith(`;`)?`;`:``)}catch(t){return console.warn(`Error filtering CSS properties:`,t),e}}function Y2(e,t){return(e||``).replace(Wle,(e,n,r,i,a,o)=>{let s=r||a||o,c=n||i||``;if(!s)return e;if(Gle.test(s)||Kle.test(s)||qle.test(s))return`url(${c}${s}${c})`;if(s[0]===`/`)return`url(${c}${Ule(t)+s}${c})`;let l=t.split(`/`),u=s.split(`/`);l.pop();for(let e of u)if(e===`.`)continue;else e===`..`?l.pop():l.push(e);return`url(${c}${l.join(`/`)}${c})`})}var Yle=/^[^ \t\n\r\u000c]+/,Xle=/^[, \t\n\r\u000c]+/;function Zle(e,t){if(t.trim()===``)return t;let n=0;function r(e){let r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):``}let i=[];for(;r(Xle),!(n>=t.length);){let a=r(Yle);if(a.slice(-1)===`,`)a=Z2(e,a.substring(0,a.length-1)),i.push(a);else{let r=``;a=Z2(e,a);let o=!1;for(;;){let e=t.charAt(n);if(e===``){i.push((a+r).trim());break}if(o)e===`)`&&(o=!1);else{if(e===`,`){n+=1,i.push((a+r).trim());break}e===`(`&&(o=!0)}r+=e,n+=1}}}return i.join(`, `)}var X2=new WeakMap;function Z2(e,t){return!t||t.trim()===``?t:Q2(e,t)}function Qle(e){return!!(e.tagName===`svg`||e.ownerSVGElement)}function Q2(e,t){let n=X2.get(e);if(n||(n=e.createElement(`a`),X2.set(e,n)),!t)t=``;else if(t.startsWith(`blob:`)||t.startsWith(`data:`))return t;return n.setAttribute(`href`,t),n.href}function $2(e,t,n,r,i,a,o){if(!r)return r;if(n===`src`||n===`href`&&(t!==`use`||r[0]!==`#`)||n===`xlink:href`&&r[0]!==`#`||n===`background`&&(t===`table`||t===`td`||t===`th`))return Z2(e,r);if(n===`srcset`)return Zle(e,r);if(n===`style`){let t=Y2(r,Q2(e));return o&&o.size>0&&(t=Jle(t,o)),t}return t===`object`&&n===`data`?Z2(e,r):typeof a==`function`?a(n,r,i):r}function e4(e,t,n){return(e===`video`||e===`audio`)&&t===`autoplay`}function $le(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 n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch{}return!1}function eue(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function t4(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:t4(e.parentNode,t,n,r+1)}function n4(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e==`string`){if(r.matches(`.${e}`))return!0}else if(eue(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function r4(e,t,n,r,i,a){try{let o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(o.tagName===`INPUT`){let e=o.getAttribute(`autocomplete`);if([`current-password`,`new-password`,`cc-number`,`cc-exp`,`cc-exp-month`,`cc-exp-year`,`cc-csc`].includes(e))return!0}let s=-1,c=-1;if(a){if(c=t4(o,n4(r,i)),c<0)return!0;s=t4(o,n4(t,n),c>=0?c:1/0)}else{if(s=t4(o,n4(t,n)),s<0)return!1;c=t4(o,n4(r,i),s>=0?s:1/0)}return s>=0?c>=0?s<=c:!0:c>=0?!1:!!a}catch{}return!!a}function tue(e,t,n){let r=zle(e);if(!r)return;let i=!1,a;try{a=r.document.readyState}catch{return}if(a!==`complete`){let r=H2(()=>{i||=(t(),!0)},n);e.addEventListener(`load`,()=>{U2(r),i=!0,t()});return}let o=`about:blank`;if(r.location.href!==o||e.src===o||e.src===``)return H2(t,0),e.addEventListener(`load`,t);e.addEventListener(`load`,t)}function nue(e,t,n){let r=!1,i;try{i=e.sheet}catch{i=null}if(i)return;let a=H2(()=>{r||=(t(),!0)},n);e.addEventListener(`load`,()=>{U2(a),r=!0,t()})}function rue(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskAttributeFn:c,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:m={},maskTextFn:h,maskInputFn:g,dataURLOptions:_={},inlineImages:v,recordCanvas:y,keepIframeSrcFn:b,newlyAddedElement:x=!1,ignoreCSSAttributes:S}=t,C=iue(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode===`CSS1Compat`?{type:E2.Document,childNodes:[]}:{type:E2.Document,childNodes:[],compatMode:e.compatMode};case e.DOCUMENT_TYPE_NODE:return{type:E2.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return oue(e,{doc:n,blockClass:i,blockSelector:a,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:c,maskInputOptions:m,maskInputFn:g,dataURLOptions:_,inlineImages:v,recordCanvas:y,keepIframeSrcFn:b,newlyAddedElement:x,rootId:C,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,ignoreCSSAttributes:S});case e.TEXT_NODE:return aue(e,{doc:n,maskAllText:s,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,maskTextFn:h,maskInputOptions:m,maskInputFn:g,rootId:C});case e.CDATA_SECTION_NODE:return{type:E2.CDATA,textContent:``,rootId:C};case e.COMMENT_NODE:return{type:E2.Comment,textContent:e.textContent||``,rootId:C};default:return!1}}function iue(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function aue(e,t){let{maskAllText:n,maskTextClass:r,unmaskTextClass:i,maskTextSelector:a,unmaskTextSelector:o,maskTextFn:s,maskInputOptions:c,maskInputFn:l,rootId:u}=t,d=e.parentNode&&e.parentNode.tagName,f=e.textContent,p=d===`STYLE`||void 0,m=d===`SCRIPT`||void 0,h=d===`TEXTAREA`||void 0;if(p&&f){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(f=k2(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}f=Y2(f,Q2(t.doc))}m&&(f=`SCRIPT_PLACEHOLDER`);let g=r4(e,r,a,i,o,n);return!p&&!m&&!h&&f&&g&&(f=s?s(f,e.parentElement):f.replace(/[\S]/g,`*`)),h&&f&&(c.textarea||g)&&(f=l?l(f,e.parentNode):f.replace(/[\S]/g,`*`)),d===`OPTION`&&f&&(f=N2({isMasked:r4(e,r,a,i,o,M2({type:null,tagName:d,maskInputOptions:c})),element:e,value:f,maskInputFn:l})),{type:E2.Text,textContent:f||``,isStyle:p,rootId:u}}function oue(e,t){let{doc:n,blockClass:r,blockSelector:i,unblockSelector:a,inlineStylesheet:o,maskInputOptions:s={},maskAttributeFn:c,maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:h,maskTextClass:g,unmaskTextClass:_,maskTextSelector:v,unmaskTextSelector:y,ignoreCSSAttributes:b}=t,x=$le(e,r,i,a),S=Hle(e),C={},w=e.attributes.length;for(let t=0;t<w;t++){let r=e.attributes[t];r.name&&!e4(S,r.name,r.value)&&(C[r.name]=$2(n,S,P2(r.name),r.value,e,c,b))}if(S===`link`&&o){let t=Array.from(n.styleSheets).find(t=>t.href===e.href),r=null;t&&(r=k2(t)),r&&(C.rel=null,C.href=null,C.crossorigin=null,C._cssText=Y2(r,t.href))}if(S===`style`&&e.sheet&&!(e.innerText||e.textContent||``).trim().length){let t=k2(e.sheet);t&&(C._cssText=Y2(t,Q2(n)))}if(S===`input`||S===`textarea`||S===`select`||S===`option`){let t=e,n=L2(t),r=R2(t,F2(S),n),i=t.checked;if(n!==`submit`&&n!==`button`&&r){let e=r4(t,g,v,_,y,M2({type:n,tagName:F2(S),maskInputOptions:s}));C.value=N2({isMasked:e,element:t,value:r,maskInputFn:l})}i&&(C.checked=i)}if(S===`option`&&(e.selected&&!s.select?C.selected=!0:delete C.selected),S===`canvas`&&f){if(e.__context===`2d`)Rle(e)||(C.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!(`__context`in e)){let t=e.toDataURL(u.type,u.quality),r=n.createElement(`canvas`);r.width=e.width,r.height=e.height,t!==r.toDataURL(u.type,u.quality)&&(C.rr_dataURL=t)}}if(S===`img`&&d){q2||(q2=n.createElement(`canvas`),J2=q2.getContext(`2d`));let t=e,r=t.currentSrc||t.getAttribute(`src`)||`<unknown-src>`,i=t.crossOrigin,a=()=>{t.removeEventListener(`load`,a);try{q2.width=t.naturalWidth,q2.height=t.naturalHeight,J2.drawImage(t,0,0),C.rr_dataURL=q2.toDataURL(u.type,u.quality)}catch(e){if(t.crossOrigin!==`anonymous`){t.crossOrigin=`anonymous`,t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a);return}console.warn(`Cannot inline img src=${r}! Error: ${e}`)}t.crossOrigin===`anonymous`&&(i?C.crossOrigin=i:t.removeAttribute(`crossorigin`))};t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a)}if((S===`audio`||S===`video`)&&(C.rr_mediaState=e.paused?`paused`:`played`,C.rr_mediaCurrentTime=e.currentTime),m||(e.scrollLeft&&(C.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(C.rr_scrollTop=e.scrollTop)),x){let{width:t,height:n}=e.getBoundingClientRect();C={class:C.class,rr_width:`${t}px`,rr_height:`${n}px`}}S===`iframe`&&!p(C.src)&&(!x&&!W2(e)&&(C.rr_src=C.src),delete C.src);let T;try{customElements.get(S)&&(T=!0)}catch{}return{type:E2.Element,tagName:S,attributes:C,childNodes:[],isSVG:Qle(e)||void 0,needBlock:x,rootId:h,isCustom:T}}function i4(e){return e==null?``:e.toLowerCase()}function sue(e,t){return!!(t.comment&&e.type===E2.Comment||e.type===E2.Element&&(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`&&z2(e.attributes.href)===`js`)||t.headFavicon&&(e.tagName===`link`&&e.attributes.rel===`shortcut icon`||e.tagName===`meta`&&(i4(e.attributes.name).match(/^msapplication-tile(image|color)$/)||i4(e.attributes.name)===`application-name`||i4(e.attributes.rel)===`icon`||i4(e.attributes.rel)===`apple-touch-icon`||i4(e.attributes.rel)===`shortcut icon`))||e.tagName===`meta`&&(t.headMetaDescKeywords&&i4(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(i4(e.attributes.property).match(/^(og|twitter|fb):/)||i4(e.attributes.name).match(/^(og|twitter):/)||i4(e.attributes.name)===`pinterest`)||t.headMetaRobots&&(i4(e.attributes.name)===`robots`||i4(e.attributes.name)===`googlebot`||i4(e.attributes.name)===`bingbot`)||t.headMetaHttpEquiv&&e.attributes[`http-equiv`]!==void 0||t.headMetaAuthorship&&(i4(e.attributes.name)===`author`||i4(e.attributes.name)===`generator`||i4(e.attributes.name)===`framework`||i4(e.attributes.name)===`publisher`||i4(e.attributes.name)===`progid`||i4(e.attributes.property).match(/^article:/)||i4(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(i4(e.attributes.name)===`google-site-verification`||i4(e.attributes.name)===`yandex-verification`||i4(e.attributes.name)===`csrf-token`||i4(e.attributes.name)===`p:domain_verify`||i4(e.attributes.name)===`verify-v1`||i4(e.attributes.name)===`verification`||i4(e.attributes.name)===`shopify-checkout-api-token`))))}function a4(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:m={},maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y={},inlineImages:b=!1,recordCanvas:x=!1,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w=5e3,onBlockedImageLoad:T,onStylesheetLoad:ee,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:te=()=>!1,newlyAddedElement:ne=!1,ignoreCSSAttributes:re}=t,{preserveWhiteSpace:ie=!0}=t,ae=rue(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,maskAllText:s,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,dataURLOptions:y,inlineImages:b,recordCanvas:x,keepIframeSrcFn:te,newlyAddedElement:ne,ignoreCSSAttributes:re});if(!ae)return console.warn(e,`not serialized`),null;let oe;oe=r.hasNode(e)?r.getId(e):sue(ae,v)||!ie&&ae.type===E2.Text&&!ae.isStyle&&!ae.textContent.trim().length?G2:K2();let D=Object.assign(ae,{id:oe});if(r.add(e,D),oe===G2)return null;S&&S(e);let se=!f;if(D.type===E2.Element){se&&=!D.needBlock;let t=e.shadowRoot;t&&O2(t)&&(D.isShadowHost=!0)}if((D.type===E2.Document||D.type===E2.Element)&&se){v.headWhitespace&&D.type===E2.Element&&D.tagName===`head`&&(ie=!1);let t={doc:n,mirror:r,blockClass:i,blockSelector:a,maskAllText:s,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:f,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:ie,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onBlockedImageLoad:T,onStylesheetLoad:ee,stylesheetLoadTimeout:E,keepIframeSrcFn:te,ignoreCSSAttributes:re},ne=e.childNodes?Array.from(e.childNodes):[];for(let e of ne){let n=a4(e,t);n&&D.childNodes.push(n)}if(Ale(e)&&e.shadowRoot)for(let n of Array.from(e.shadowRoot.childNodes)){let r=a4(n,t);r&&(O2(e.shadowRoot)&&(r.isShadow=!0),D.childNodes.push(r))}}if(e.parentNode&&D2(e.parentNode)&&O2(e.parentNode)&&(D.isShadow=!0),D.type===E2.Element&&D.tagName===`iframe`&&!D.needBlock&&tue(e,()=>{let t=W2(e);if(t&&C){let n=a4(t,{doc:t,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:ie,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:ee,stylesheetLoadTimeout:E,keepIframeSrcFn:te,ignoreCSSAttributes:re});n&&C(e,n)}},w),D.type===E2.Element&&D.tagName===`img`&&!e.complete&&D.needBlock){let t=e,n=()=>{if(t.isConnected&&!t.complete&&T)try{let e=t.getBoundingClientRect();e.width>0&&e.height>0&&T(t,D,e)}catch{}t.removeEventListener(`load`,n)};t.isConnected&&t.addEventListener(`load`,n)}return D.type===E2.Element&&D.tagName===`link`&&typeof D.attributes.rel==`string`&&(D.attributes.rel===`stylesheet`||D.attributes.rel===`preload`&&typeof D.attributes.href==`string`&&z2(D.attributes.href)===`css`)&&nue(e,()=>{if(ee){let t=a4(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:ie,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:ee,stylesheetLoadTimeout:E,keepIframeSrcFn:te,ignoreCSSAttributes:re});t&&ee(e,t)}},E),D.type===E2.Element&&delete D.needBlock,D}function cue(e,t){let{mirror:n=new j2,blockClass:r=`rr-block`,blockSelector:i=null,unblockSelector:a=null,maskAllText:o=!1,maskTextClass:s=`rr-mask`,unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:u=null,inlineStylesheet:d=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:m=!1,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOM:v=!1,dataURLOptions:y,preserveWhiteSpace:b,onSerialize:x,onIframeLoad:S,iframeLoadTimeout:C,onBlockedImageLoad:w,onStylesheetLoad:T,stylesheetLoadTimeout:ee,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:te=new Set([])}=t||{};return a4(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,maskAllText:o,maskTextClass:s,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions: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}:m===!1?{}:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v===!0||v===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:v===`all`,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:v===!1?{}:v,dataURLOptions:y,inlineImages:f,recordCanvas:p,preserveWhiteSpace:b,onSerialize:x,onIframeLoad:S,iframeLoadTimeout:C,onBlockedImageLoad:w,onStylesheetLoad:T,stylesheetLoadTimeout:ee,keepIframeSrcFn:E,newlyAddedElement:!1,ignoreCSSAttributes:te})}function o4(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var s4=`Please stop import mirror directly. Instead of that,\r
|
|
999
|
+
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
1000
|
+
or you can use record.mirror to access the mirror instance during recording.`,c4={map:{},getId(){return console.error(s4),-1},getNode(){return console.error(s4),null},removeNodeFromMap(){console.error(s4)},has(){return console.error(s4),!1},reset(){console.error(s4)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(c4=new Proxy(c4,{get(e,t,n){return t===`map`&&console.error(s4),Reflect.get(e,t,n)}}));function l4(e,t,n={}){let r=null,i=0;return function(...a){let o=Date.now();!i&&n.leading===!1&&(i=o);let s=t-(o-i),c=this;s<=0||s>t?(r&&=(hue(r),null),i=o,e.apply(c,a)):!r&&n.trailing!==!1&&(r=O4(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(c,a)},s))}}function u4(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){O4(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>u4(e,t,a||{},!0)}function d4(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var f4=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(f4=()=>new Date().getTime());function p4(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset===void 0?t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0:e.pageXOffset,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset===void 0?t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0:e.pageYOffset}}function m4(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function h4(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function g4(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function _4(e,t,n,r,i){if(!e)return!1;let a=g4(e);if(!a)return!1;let o=n4(t,n);if(!i){let e=r&&a.matches(r);return o(a)&&!e}let s=t4(a,o),c=-1;return s<0?!1:(r&&(c=t4(a,n4(null,r))),s>-1&&c<0||s<c)}function lue(e,t){return t.getId(e)!==-1}function v4(e,t){return t.getId(e)===G2}function y4(e,t){if(D2(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:!e.parentNode||y4(e.parentNode,t):!0}function b4(e){return!!e.changedTouches}function uue(e=window){`NodeList`in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw TypeError(`1 argument is required`);do if(this===t)return!0;while(t&&=t.parentNode);return!1})}function x4(e,t){return!!(e.nodeName===`IFRAME`&&t.getMeta(e))}function S4(e,t){return!!(e.nodeName===`LINK`&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute(`rel`)===`stylesheet`&&t.getMeta(e))}function C4(e){return!!e?.shadowRoot}var due=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=t===void 0?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function w4(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function fue(e){let t=e,n;for(;n=w4(t);)t=n;return t}function pue(e){let t=e.ownerDocument;if(!t)return!1;let n=fue(e);return t.contains(n)}function T4(e){let t=e.ownerDocument;return t?t.contains(e)||pue(e):!1}var E4={};function D4(e){let t=E4[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement==`function`)try{let t=n.createElement(`iframe`);t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch{}return E4[e]=r.bind(window)}function mue(...e){return D4(`requestAnimationFrame`)(...e)}function O4(...e){return D4(`setTimeout`)(...e)}function hue(...e){return D4(`clearTimeout`)(...e)}var k4=(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))(k4||{}),Z=(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))(Z||{}),A4=(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))(A4||{}),j4=(e=>(e[e.Mouse=0]=`Mouse`,e[e.Pen=1]=`Pen`,e[e.Touch=2]=`Touch`,e))(j4||{}),M4=(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))(M4||{}),N4;function gue(e){N4=e}function _ue(){N4=void 0}for(var P4=e=>N4?((...t)=>{try{return e(...t)}catch(e){if(N4&&N4(e)===!0)return()=>{};throw e}}):e,F4=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,vue=typeof Uint8Array>`u`?[]:new Uint8Array(256),I4=0;I4<F4.length;I4++)vue[F4.charCodeAt(I4)]=I4;var L4=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function R4(e){try{return e.contentDocument}catch{}}function z4(e){try{return e.contentWindow}catch{}}var yue=class{constructor(e){this.doc=e,this.unattachedDoc=null}parse(e){return this.parseWithConstructableStylesheet(e)||this.parseWithDetachedElement(e)}parseWithConstructableStylesheet(e){if(typeof CSSStyleSheet>`u`||typeof CSSStyleSheet.prototype.replaceSync!=`function`)return null;try{let t=new CSSStyleSheet;t.replaceSync(`x { ${e} }`);let n=t.cssRules[0];return!n||n.type!==CSSRule.STYLE_RULE?null:n.style}catch{return null}}parseWithDetachedElement(e){let t=this.getUnattachedDoc().createElement(`span`);return t.setAttribute(`style`,e),t.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}};function B4(e){return`__ln`in e}var bue=class{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw Error(`Position outside of list range`);let t=this.head;for(let n=0;n<e;n++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&B4(e.previousSibling)){let n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&B4(e.nextSibling)&&e.nextSibling.__ln.previous){let n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},V4=(e,t)=>`${e}@${t}`,xue=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,n=new bue,r=e=>{let t=e,n=G2;for(;n===G2;)t&&=t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{if(!i.parentNode||!T4(i))return;let a=D2(i.parentNode)?this.mirror.getId(w4(i)):this.mirror.getId(i.parentNode),o=r(i);if(a===-1||o===-1)return n.addNode(i);let s=a4(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{x4(e,this.mirror)&&!_4(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(e),S4(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),C4(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{if(_4(e,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(e,t);let n=z4(e);n&&this.canvasManager.addWindow(n),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,{width:n,height:r})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${n}px`,height:`${r}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});s&&(e.push({parentId:a,nextId:o,node:s}),t.add(s.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet)U4(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||i(e);for(let e of this.addedSet)!W4(this.droppedSet,e)&&!U4(this.removes,e,this.mirror)||W4(this.movedSet,e)?i(e):this.droppedSet.add(e);let a=null;for(;n.length;){let e=null;if(a){let t=this.mirror.getId(a.value.parentNode),n=r(a.value);t!==-1&&n!==-1&&(e=a)}if(!e){let t=n.tail;for(;t;){let n=t;if(t=t.previous,n){let t=this.mirror.getId(n.value.parentNode);if(r(n.value)===-1)continue;if(t!==-1){e=n;break}{let t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let r=t.parentNode.host;if(this.mirror.getId(r)!==-1){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}a=e.previous,n.removeNode(e.value),i(e.value)}let o={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{let{attributes:t}=e;if(typeof t.style==`string`){let n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split(`var(`).length===t.style.split(`var(`).length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};!o.texts.length&&!o.attributes.length&&!o.removes.length&&!o.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(o))},this.processMutation=e=>{if(!v4(e.target,this.mirror))switch(e.type){case`characterData`:{let t=e.target.textContent;!_4(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:r4(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t,g4(e.target)):t.replace(/[\S]/g,`*`):t,node:e.target});break}case`attributes`:{let t=e.target,n=e.attributeName,r=e.target.getAttribute(n);if(n===`value`){let n=L2(t),i=t.tagName;r=R2(t,i,n);let a=M2({maskInputOptions:this.maskInputOptions,tagName:i,type:n});r=N2({isMasked:r4(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a),element:t,value:r,maskInputFn:this.maskInputFn})}if(_4(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||r===e.oldValue)return;let i=this.attributeMap.get(e.target);if(t.tagName===`IFRAME`&&n===`src`&&!this.keepIframeSrcFn(r))if(!R4(t))n=`rr_src`;else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),n===`type`&&t.tagName===`INPUT`&&(e.oldValue||``).toLowerCase()===`password`&&t.setAttribute(`data-rr-is-password`,`true`),!e4(t.tagName,n)&&(i.attributes[n]=$2(this.doc,P2(t.tagName),P2(n),r,t,this.maskAttributeFn),n===`style`)){let n=e.oldValue?this.styleDeclarationParser.parse(e.oldValue):null;for(let e of Array.from(t.style)){let r=t.style.getPropertyValue(e),a=t.style.getPropertyPriority(e);r!==(n?.getPropertyValue(e)||``)||a!==(n?.getPropertyPriority(e)||``)?a===``?i.styleDiff[e]=r:i.styleDiff[e]=[r,a]:i._unchangedStyles[e]=[r,a]}if(n)for(let e of Array.from(n))t.style.getPropertyValue(e)===``&&(i.styleDiff[e]=!1)}break}case`childList`:if(_4(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let n=this.mirror.getId(t),r=D2(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);_4(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||v4(t,this.mirror)||!lue(t,this.mirror)||(this.addedSet.has(t)?(H4(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&n===-1||y4(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[V4(n,r)]?H4(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:D2(e.target)&&O2(e.target)?!0:void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(v4(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&n!==-1&&(this.movedMap[V4(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);_4(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes&&e.childNodes.forEach(e=>this.genAdds(e)),C4(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}}init(e){`mutationCb.blockClass.blockSelector.unblockSelector.maskAllText.maskTextClass.unmaskTextClass.maskTextSelector.unmaskTextSelector.inlineStylesheet.maskInputOptions.maskAttributeFn.maskTextFn.maskInputFn.keepIframeSrcFn.recordCanvas.inlineImages.slimDOMOptions.dataURLOptions.doc.mirror.iframeManager.stylesheetManager.shadowDomManager.canvasManager.processedNodeManager.ignoreCSSAttributes`.split(`.`).forEach(t=>{this[t]=e[t]}),this.styleDeclarationParser=new yue(this.doc)}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 H4(e,t){e.delete(t),t.childNodes?.forEach(t=>H4(e,t))}function U4(e,t,n){return e.length!==0&&Sue(e,t,n)}function Sue(e,t,n){let r=t.parentNode;for(;r;){let t=n.getId(r);if(e.some(e=>e.id===t))return!0;r=r.parentNode}return!1}function W4(e,t){return e.size!==0&&G4(e,t)}function G4(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:G4(e,n):!1}var K4=[];function q4(e){try{if(`composedPath`in e){let 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 J4(e,t){let n=new xue;K4.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver,i=window?.Zone?.__symbol__?.(`MutationObserver`);i&&window[i]&&(r=window[i]);let a=new r(P4(t=>{e.onMutation&&e.onMutation(t)===!1||n.processMutations.bind(n)(t)}));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Cue({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove==`number`?t.mousemove:50,a=typeof t.mousemoveCallback==`number`?t.mousemoveCallback:500,o=[],s,c=l4(P4(t=>{let n=Date.now()-s;e(o.map(e=>(e.timeOffset-=n,e)),t),o=[],s=null}),a),l=P4(l4(P4(e=>{let t=q4(e),{clientX:n,clientY:i}=b4(e)?e.changedTouches[0]:e;s||=f4(),o.push({x:n,y:i,id:r.getId(t),timeOffset:f4()-s}),c(typeof DragEvent<`u`&&e instanceof DragEvent?Z.Drag:e instanceof MouseEvent?Z.MouseMove:Z.TouchMove)}),i,{trailing:!1})),u=[o4(`mousemove`,l,n),o4(`touchmove`,l,n),o4(`drag`,l,n)];return P4(()=>{u.forEach(e=>e())})}function wue({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[],l=null,u=t=>o=>{let s=q4(o);if(_4(s,r,i,a,!0))return;let c=null,u=t;if(`pointerType`in o){switch(o.pointerType){case`mouse`:c=j4.Mouse;break;case`touch`:c=j4.Touch;break;case`pen`:c=j4.Pen}c===j4.Touch?A4[t]===A4.MouseDown?u=`TouchStart`:A4[t]===A4.MouseUp&&(u=`TouchEnd`):j4.Pen}else b4(o)&&(c=j4.Touch);c===null?A4[t]===A4.Click&&(c=l,l=null):(l=c,(u.startsWith(`Touch`)&&c===j4.Touch||u.startsWith(`Mouse`)&&c===j4.Mouse)&&(c=null));let d=b4(o)?o.changedTouches[0]:o;if(!d)return;let f=n.getId(s),{clientX:p,clientY:m}=d;P4(e)({type:A4[u],id:f,x:p,y:m,...c!==null&&{pointerType:c}})};return Object.keys(A4).filter(e=>Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&s[e]!==!1).forEach(e=>{let n=P2(e),r=u(e);if(window.PointerEvent)switch(A4[e]){case A4.MouseDown:case A4.MouseUp:n=n.replace(`mouse`,`pointer`);break;case A4.TouchStart:case A4.TouchEnd:return}c.push(o4(n,r,t))}),P4(()=>{c.forEach(e=>e())})}function Y4({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,sampling:o}){return o4(`scroll`,P4(l4(P4(o=>{let s=q4(o);if(!s||_4(s,r,i,a,!0))return;let c=n.getId(s);if(s===t&&t.defaultView){let n=p4(t.defaultView);e({id:c,x:n.left,y:n.top})}else e({id:c,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100)),t)}function Tue({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return o4(`resize`,P4(l4(P4(()=>{let t=m4(),i=h4();(n!==t||r!==i)&&(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}var Eue=[`INPUT`,`TEXTAREA`,`SELECT`],X4=new WeakMap;function Due({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,ignoreClass:o,ignoreSelector:s,maskInputOptions:c,maskInputFn:l,sampling:u,userTriggeredOnInput:d,maskTextClass:f,unmaskTextClass:p,maskTextSelector:m,unmaskTextSelector:h}){function g(e){let n=q4(e),u=e.isTrusted,g=n&&F2(n.tagName);if(g===`OPTION`&&(n=n.parentElement),!n||!g||Eue.indexOf(g)<0||_4(n,r,i,a,!0))return;let v=n;if(v.classList.contains(o)||s&&v.matches(s))return;let y=L2(n),b=R2(v,g,y),x=!1,S=M2({maskInputOptions:c,tagName:g,type:y}),C=r4(n,f,m,p,h,S);(y===`radio`||y===`checkbox`)&&(x=n.checked),b=N2({isMasked:C,element:n,value:b,maskInputFn:l}),_(n,d?{text:b,isChecked:x,userTriggered:u}:{text:b,isChecked:x});let w=n.name;y===`radio`&&w&&x&&t.querySelectorAll(`input[type="radio"][name="${w}"]`).forEach(e=>{if(e!==n){let t=N2({isMasked:C,element:e,value:R2(e,g,y),maskInputFn:l});_(e,d?{text:t,isChecked:!x,userTriggered:!1}:{text:t,isChecked:!x})}})}function _(t,r){let i=X4.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){X4.set(t,r);let i=n.getId(t);P4(e)({...r,id:i})}}let v=(u.input===`last`?[`change`]:[`input`,`change`]).map(e=>o4(e,P4(g),t)),y=t.defaultView;if(!y)return()=>{v.forEach(e=>e())};let b=y.Object.getOwnPropertyDescriptor(y.HTMLInputElement.prototype,`value`),x=[[y.HTMLInputElement.prototype,`value`],[y.HTMLInputElement.prototype,`checked`],[y.HTMLSelectElement.prototype,`value`],[y.HTMLTextAreaElement.prototype,`value`],[y.HTMLSelectElement.prototype,`selectedIndex`],[y.HTMLOptionElement.prototype,`selected`]];return b&&b.set&&v.push(...x.map(e=>u4(e[0],e[1],{set(){P4(g)({target:this,isTrusted:!1})}},!1,y))),P4(()=>{v.forEach(e=>e())})}function Z4(e){let t=[];function n(e,t){if(e3(`CSSGroupingRule`)&&e.parentRule instanceof CSSGroupingRule||e3(`CSSMediaRule`)&&e.parentRule instanceof CSSMediaRule||e3(`CSSSupportsRule`)&&e.parentRule instanceof CSSSupportsRule||e3(`CSSConditionRule`)&&e.parentRule instanceof CSSConditionRule){let n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){let n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}return n(e,t)}function Q4(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function Oue({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:P4((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=Q4(i,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:s}]}),r.apply(i,a)})});let a=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:P4((r,i,a)=>{let[o]=a,{id:s,styleId:c}=Q4(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:o}]}),r.apply(i,a)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:P4((r,i,a)=>{let[o]=a,{id:s,styleId:c}=Q4(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replace:o}),r.apply(i,a)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:P4((r,i,a)=>{let[o]=a,{id:s,styleId:c}=Q4(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replaceSync:o}),r.apply(i,a)})}));let c={};t3(`CSSGroupingRule`)?c.CSSGroupingRule=r.CSSGroupingRule:(t3(`CSSMediaRule`)&&(c.CSSMediaRule=r.CSSMediaRule),t3(`CSSConditionRule`)&&(c.CSSConditionRule=r.CSSConditionRule),t3(`CSSSupportsRule`)&&(c.CSSSupportsRule=r.CSSSupportsRule));let l={};return Object.entries(c).forEach(([r,i])=>{l[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(l[r].insertRule,{apply:P4((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=Q4(i.parentStyleSheet,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:[...Z4(i),s||0]}]}),r.apply(i,a)})}),i.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:P4((r,i,a)=>{let[o]=a,{id:s,styleId:c}=Q4(i.parentStyleSheet,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:[...Z4(i),o]}]}),r.apply(i,a)})})}),P4(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=a,o&&(r.CSSStyleSheet.prototype.replace=o),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}function $4({mirror:e,stylesheetManager:t},n){let r=null;r=n.nodeName===`#document`?e.getId(n):e.getId(n.host);let i=n.nodeName===`#document`?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,a=i?.prototype?Object.getOwnPropertyDescriptor(i?.prototype,`adoptedStyleSheets`):void 0;return r===null||r===-1||!i||!a?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){return a.get?.call(this)},set(e){let n=a.set?.call(this,e);if(r!==null&&r!==-1)try{t.adoptStyleSheets(e,r)}catch{}return n}}),P4(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function kue({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:P4((i,o,s)=>{let[c,l,u]=s;if(n.has(c))return a.apply(o,[c,l,u]);let{id:d,styleId:f}=Q4(o.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:c,value:l,priority:u},index:Z4(o.parentRule)}),i.apply(o,s)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:P4((i,a,s)=>{let[c]=s;if(n.has(c))return o.apply(a,[c]);let{id:l,styleId:u}=Q4(a.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||u&&u!==-1)&&e({id:l,styleId:u,remove:{property:c},index:Z4(a.parentRule)}),i.apply(a,s)})}),P4(()=>{i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Aue({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:i,sampling:a,doc:o}){let s=P4(o=>l4(P4(a=>{let s=q4(a);if(!s||_4(s,t,n,r,!0))return;let{currentTime:c,volume:l,muted:u,playbackRate:d}=s;e({type:o,id:i.getId(s),currentTime:c,volume:l,muted:u,playbackRate:d})}),a.media||500)),c=[o4(`play`,s(M4.Play),o),o4(`pause`,s(M4.Pause),o),o4(`seeked`,s(M4.Seeked),o),o4(`volumechange`,s(M4.VolumeChange),o),o4(`ratechange`,s(M4.RateChange),o)];return P4(()=>{c.forEach(e=>e())})}function jue({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,n){let r=new a(e,t,n);return i.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};let o=d4(t.fonts,`add`,function(t){return function(n){return O4(P4(()=>{let t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=a}),r.push(o),P4(()=>{r.forEach(e=>e())})}function Mue(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,selectionCb:o}=e,s=!0,c=P4(()=>{let e=t.getSelection();if(!e||s&&e?.isCollapsed)return;s=e.isCollapsed||!1;let c=[],l=e.rangeCount||0;for(let t=0;t<l;t++){let{startContainer:o,startOffset:s,endContainer:l,endOffset:u}=e.getRangeAt(t);_4(o,r,i,a,!0)||_4(l,r,i,a,!0)||c.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:c})});return c(),o4(`selectionchange`,c)}function Nue({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:d4(n.customElements,`define`,function(e){return function(n,r,i){try{t({define:{name:n}})}catch{}return e.apply(this,[n,r,i])}})}function Pue(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=J4(e,e.doc));let i=Cue(e),a=wue(e),o=Y4(e),s=Tue(e,{win:n}),c=Due(e),l=Aue(e),u=()=>{},d=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(u=Oue(e,{win:n}),d=$4(e,e.doc),f=kue(e,{win:n}),e.collectFonts&&(p=jue(e)));let m=Mue(e),h=Nue(e),g=[];for(let t of e.plugins)g.push(t.observer(t.callback,n,t.options));return P4(()=>{K4.forEach(e=>e.reset()),r?.disconnect(),i(),a(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h(),g.forEach(e=>e())})}function e3(e){return window[e]!==void 0}function t3(e){return!!(window[e]!==void 0&&window[e].prototype&&`insertRule`in window[e].prototype&&`deleteRule`in window[e].prototype)}var n3=class{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){let i=n||this.getIdToRemoteIdMap(e),a=r||this.getRemoteIdToIdMap(e),o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){let n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){let r=n||this.getRemoteIdToIdMap(e);return typeof t==`number`?r.get(t)||-1:t}getRemoteIds(e,t){let n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},Fue=class{constructor(){this.crossOriginIframeMirror=new n3(K2),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},Iue=class{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new n3(K2),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new n3(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener(`message`,this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0);let t=z4(e);t&&this.crossOriginIframeMap.set(t,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&z4(e)?.addEventListener(`message`,this.handleMessage.bind(this)),this.loadListener?.(e);let n=R4(e);n&&n.adoptedStyleSheets&&n.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(n.adoptedStyleSheets,this.mirror.getId(n))}handleMessage(e){let t=e;if(t.data.type!==`rrweb`||t.origin!==t.data.origin||!e.source)return;let n=this.crossOriginIframeMap.get(e.source);if(!n)return;let r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){switch(t.type){case k4.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:k4.IncrementalSnapshot,data:{source:Z.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case k4.Meta:case k4.Load:case k4.DomContentLoaded:return!1;case k4.Plugin:return t;case k4.Custom:return this.replaceIds(t.data.payload,e,[`id`,`parentId`,`previousId`,`nextId`]),t;case k4.IncrementalSnapshot:switch(t.data.source){case Z.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,[`parentId`,`nextId`,`previousId`]),this.replaceIdOnNode(t.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,[`parentId`,`id`])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,[`id`])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case Z.Drag:case Z.TouchMove:case Z.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case Z.ViewportResize:return!1;case Z.MediaInteraction:case Z.MouseInteraction:case Z.Scroll:case Z.CanvasMutation:case Z.Input:return this.replaceIds(t.data,e,[`id`]),t;case Z.StyleSheetRule:case Z.StyleDeclaration:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleId`]),t;case Z.Font:return t;case Z.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,[`start`,`end`])}),t;case Z.AdoptedStyleSheet:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleIds`]),t.data.styles?.forEach(t=>{this.replaceStyleIds(t,e,[`styleId`])}),t}}return!1}replace(e,t,n,r){for(let i of r)!Array.isArray(t[i])&&typeof t[i]!=`number`||(t[i]=Array.isArray(t[i])?e.getIds(n,t[i]):e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,[`id`,`rootId`]),`childNodes`in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type!==E2.Document&&!e.rootId&&(e.rootId=t),`childNodes`in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},Lue=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},Rue=class{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!O2(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);let n=J4({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Y4({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),O4(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push($4({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){let t=R4(e),n=z4(e);!t||!n||this.patchAttachShadow(n.Element,t)}patchAttachShadow(e,t){let n=this;this.restoreHandlers.push(d4(e.prototype,`attachShadow`,function(e){return function(r){let i=e.call(this,r);return this.shadowRoot&&T4(this)&&n.addShadowRoot(this.shadowRoot,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}},zue=class{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new due,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){`_cssText`in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let n={id:t,styleIds:[]},r=[];for(let t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,t)=>({rule:A2(e),index:t}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},Bue=class{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,t){let n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,mue(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},r3,i3;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement(`iframe`);document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug(`Unable to override Array.from`,e)}var a3=Lle();function o3(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i=`rr-block`,blockSelector:a=null,unblockSelector:o=null,ignoreClass:s=`rr-ignore`,ignoreSelector:c=null,maskAllText:l=!1,maskTextClass:u=`rr-mask`,unmaskTextClass:d=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:m=!0,maskAllInputs:h,maskInputOptions:g,slimDOMOptions:_,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,maxCanvasSize:x=null,packFn:S,sampling:C={},dataURLOptions:w={},mousemoveWait:T,recordDOM:ee=!0,recordCanvas:E=!1,recordCrossOriginIframes:te=!1,recordAfter:ne=e.recordAfter===`DOMContentLoaded`?e.recordAfter:`load`,userTriggeredOnInput:re=!1,collectFonts:ie=!1,inlineImages:ae=!1,plugins:oe,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:se=new Set([]),errorHandler:ce,onMutation:le,getCanvasManager:ue}=e;gue(ce);let de=!te||window.parent===window,fe=!1;if(!de)try{window.parent.document&&(fe=!1)}catch{fe=!0}if(de&&!t)throw Error(`emit function is required`);if(!de&&!fe)return()=>{};T!==void 0&&C.mousemove===void 0&&(C.mousemove=T),a3.reset();let pe=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,radio:!0,checkbox:!0}:g===void 0?{}:g,me=_===!0||_===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:_===`all`,headMetaDescKeywords:_===`all`}:_||{};uue();let he,ge=0,_e=e=>{for(let t of oe||[])t.eventProcessor&&(e=t.eventProcessor(e));return S&&!fe&&(e=S(e)),e};r3=(e,i)=>{let a=e;if(a.timestamp=f4(),K4[0]?.isFrozen()&&a.type!==k4.FullSnapshot&&(a.type!==k4.IncrementalSnapshot||a.data.source!==Z.Mutation)&&K4.forEach(e=>e.unfreeze()),de)t?.(_e(a),i);else if(fe){let e={type:`rrweb`,event:_e(a),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,`*`)}if(a.type===k4.FullSnapshot)he=a,ge=0;else if(a.type===k4.IncrementalSnapshot){if(a.data.source===Z.Mutation&&a.data.isAttachIframe)return;ge++;let e=r&&ge>=r,t=n&&he&&a.timestamp-he.timestamp>n;(e||t)&&we(!0)}};let ve=e=>{r3({type:k4.IncrementalSnapshot,data:{source:Z.Mutation,...e}})},ye=e=>r3({type:k4.IncrementalSnapshot,data:{source:Z.Scroll,...e}}),O=e=>r3({type:k4.IncrementalSnapshot,data:{source:Z.CanvasMutation,...e}}),be=new zue({mutationCb:ve,adoptedStyleSheetCb:e=>r3({type:k4.IncrementalSnapshot,data:{source:Z.AdoptedStyleSheet,...e}})}),k=typeof __RRWEB_EXCLUDE_IFRAME__==`boolean`&&__RRWEB_EXCLUDE_IFRAME__?new Fue:new Iue({mirror:a3,mutationCb:ve,stylesheetManager:be,recordCrossOriginIframes:te,wrappedEmit:r3});for(let e of oe||[])e.getMirror&&e.getMirror({nodeMirror:a3,crossOriginIframeMirror:k.crossOriginIframeMirror,crossOriginIframeStyleMirror:k.crossOriginIframeStyleMirror});let xe=new Bue,Se=Hue(ue,{mirror:a3,win:window,mutationCb:e=>r3({type:k4.IncrementalSnapshot,data:{source:Z.CanvasMutation,...e}}),recordCanvas:E,blockClass:i,blockSelector:a,unblockSelector:o,maxCanvasSize:x,sampling:C.canvas,dataURLOptions:w,errorHandler:ce}),Ce=typeof __RRWEB_EXCLUDE_SHADOW_DOM__==`boolean`&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Lue:new Rue({mutationCb:ve,scrollCb:ye,bypassOptions:{onMutation:le,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskInputOptions:pe,dataURLOptions:w,maskAttributeFn:v,maskTextFn:b,maskInputFn:y,recordCanvas:E,inlineImages:ae,sampling:C,slimDOMOptions:me,iframeManager:k,stylesheetManager:be,canvasManager:Se,keepIframeSrcFn:D,processedNodeManager:xe,ignoreCSSAttributes:se},mirror:a3}),we=(e=!1)=>{if(!ee)return;r3({type:k4.Meta,data:{href:window.location.href,width:h4(),height:m4()}},e),be.reset(),Ce.init(),K4.forEach(e=>e.lock());let t=cue(document,{mirror:a3,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskAllInputs:pe,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,slimDOM:me,dataURLOptions:w,recordCanvas:E,inlineImages:ae,onSerialize:e=>{x4(e,a3)&&k.addIframe(e),S4(e,a3)&&be.trackLinkElement(e),C4(e)&&Ce.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{k.attachIframe(e,t);let n=z4(e);n&&Se.addWindow(n),Ce.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{be.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,{width:n,height:r})=>{ve({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${n}px`,height:`${r}px`}}}]})},keepIframeSrcFn:D,ignoreCSSAttributes:se});if(!t)return console.warn(`Failed to snapshot the document`);r3({type:k4.FullSnapshot,data:{node:t,initialOffset:p4(window)}}),K4.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&be.adoptStyleSheets(document.adoptedStyleSheets,a3.getId(document))};i3=we;try{let e=[],t=e=>P4(Pue)({onMutation:le,mutationCb:ve,mousemoveCb:(e,t)=>r3({type:k4.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>r3({type:k4.IncrementalSnapshot,data:{source:Z.MouseInteraction,...e}}),scrollCb:ye,viewportResizeCb:e=>r3({type:k4.IncrementalSnapshot,data:{source:Z.ViewportResize,...e}}),inputCb:e=>r3({type:k4.IncrementalSnapshot,data:{source:Z.Input,...e}}),mediaInteractionCb:e=>r3({type:k4.IncrementalSnapshot,data:{source:Z.MediaInteraction,...e}}),styleSheetRuleCb:e=>r3({type:k4.IncrementalSnapshot,data:{source:Z.StyleSheetRule,...e}}),styleDeclarationCb:e=>r3({type:k4.IncrementalSnapshot,data:{source:Z.StyleDeclaration,...e}}),canvasMutationCb:O,fontCb:e=>r3({type:k4.IncrementalSnapshot,data:{source:Z.Font,...e}}),selectionCb:e=>{r3({type:k4.IncrementalSnapshot,data:{source:Z.Selection,...e}})},customElementCb:e=>{r3({type:k4.IncrementalSnapshot,data:{source:Z.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:c,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:pe,inlineStylesheet:m,sampling:C,recordDOM:ee,recordCanvas:E,inlineImages:ae,userTriggeredOnInput:re,collectFonts:ie,doc:e,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,keepIframeSrcFn:D,blockSelector:a,unblockSelector:o,slimDOMOptions:me,dataURLOptions:w,mirror:a3,iframeManager:k,stylesheetManager:be,shadowDomManager:Ce,processedNodeManager:xe,canvasManager:Se,ignoreCSSAttributes:se,plugins:oe?.filter(e=>e.observer)?.map(e=>({observer:e.observer,options:e.options,callback:t=>r3({type:k4.Plugin,data:{plugin:e.name,payload:t}})}))||[]},{});k.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});let n=()=>{we(),e.push(t(document))};return document.readyState===`interactive`||document.readyState===`complete`?n():(e.push(o4(`DOMContentLoaded`,()=>{r3({type:k4.DomContentLoaded,data:{}}),ne===`DOMContentLoaded`&&n()})),e.push(o4(`load`,()=>{r3({type:k4.Load,data:{}}),ne===`load`&&n()},window))),()=>{e.forEach(e=>e()),xe.destroy(),i3=void 0,_ue()}}catch(e){console.warn(e)}}function Vue(e){if(!i3)throw Error(`please take full snapshot after start recording`);i3(e)}o3.mirror=a3,o3.takeFullSnapshot=Vue;function Hue(e,t){try{return e?e(t):new L4}catch{return console.warn(`Unable to initialize CanvasManager`),new L4}}var Uue;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})(Uue||={});var Wue=3,Gue=5;function s3(e){return e>9999999999?e:e*1e3}function c3(e){return e>9999999999?e/1e3:e}function l3(e,t){t.category!==`sentry.transaction`&&([`ui.click`,`ui.input`].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:k4.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:`breadcrumb`,payload:_P(t,10,1e3)}}),t.category===`console`)))}var Kue=`button,a`;function u3(e){return e.closest(Kue)||e}function d3(e){let t=f3(e);return!t||!(t instanceof Element)?t:u3(t)}function f3(e){return que(e)?e.target:e}function que(e){return qN(e)&&`target`in e}var p3;function Jue(e){return p3||(p3=[],Yue()),p3.push(e),()=>{let t=p3?p3.indexOf(e):-1;t>-1&&p3.splice(t,1)}}function Yue(){$N(v2,`open`,function(e){return function(...t){if(p3)try{p3.forEach(e=>e())}catch{}return e.apply(v2,t)}})}var Xue=new Set([Z.Mutation,Z.StyleSheetRule,Z.StyleDeclaration,Z.AdoptedStyleSheet,Z.CanvasMutation,Z.Selection,Z.MediaInteraction]);function Zue(e,t,n){e.handleClick(t,n)}var Que=class{constructor(e,t,n=l3){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=t.timeout/1e3,this._threshold=t.threshold/1e3,this._scrollTimeout=t.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=t.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){let e=Jue(()=>{this._lastMutation=m3()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,t){if(ede(t,this._ignoreSelector)||!tde(e))return;let n={timestamp:c3(e.timestamp),clickBreadcrumb:e,clickCount:0,node:t};this._clicks.some(e=>e.node===n.node&&Math.abs(e.timestamp-n.timestamp)<1)||(this._clicks.push(n),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=c3(e)}registerScroll(e=Date.now()){this._lastScroll=c3(e)}registerClick(e){let t=u3(e);this._handleMultiClick(t)}_handleMultiClick(e){this._getClicks(e).forEach(e=>{e.clickCount++})}_getClicks(e){return this._clicks.filter(t=>t.node===e)}_checkClicks(){let e=[],t=m3();this._clicks.forEach(n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=t&&e.push(n)});for(let t of e){let e=this._clicks.indexOf(t);e>-1&&(this._generateBreadcrumbs(t),this._clicks.splice(e,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){let t=this._replay,n=e.scrollAfter&&e.scrollAfter<=this._scrollTimeout,r=e.mutationAfter&&e.mutationAfter<=this._threshold,i=!n&&!r,{clickCount:a,clickBreadcrumb:o}=e;if(i){let n=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,r=n<this._timeout*1e3?`mutation`:`timeout`,i={type:`default`,message:o.message,timestamp:o.timestamp,category:`ui.slowClickDetected`,data:{...o.data,url:v2.location.href,route:t.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:a||1}};this._addBreadcrumbEvent(t,i);return}if(a>1){let e={type:`default`,message:o.message,timestamp:o.timestamp,category:`ui.multiClick`,data:{...o.data,url:v2.location.href,route:t.getCurrentRoute(),clickCount:a,metric:!0}};this._addBreadcrumbEvent(t,e)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=m0(()=>this._checkClicks(),1e3)}},$ue=[`A`,`BUTTON`,`INPUT`];function ede(e,t){return!!(!$ue.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 tde(e){return!!(e.data&&typeof e.data.nodeId==`number`&&e.timestamp)}function m3(){return Date.now()/1e3}function nde(e,t){try{if(!rde(t))return;let{source:n}=t.data;if(Xue.has(n)&&e.registerMutation(t.timestamp),n===Z.Scroll&&e.registerScroll(t.timestamp),ide(t)){let{type:n,id:r}=t.data,i=o3.mirror.getNode(r);i instanceof HTMLElement&&n===A4.Click&&e.registerClick(i)}}catch{}}function rde(e){return e.type===Wue}function ide(e){return e.data.source===Z.MouseInteraction}function h3(e){return{timestamp:Date.now()/1e3,type:`default`,...e}}var g3=(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))(g3||{}),ade=new Set([`id`,`class`,`aria-label`,`role`,`name`,`alt`,`title`,`data-test-id`,`data-testid`,`disabled`,`aria-disabled`,`data-sentry-component`]);function ode(e){let t={};!e[`data-sentry-component`]&&e[`data-sentry-element`]&&(e[`data-sentry-component`]=e[`data-sentry-element`]);for(let n in e)if(ade.has(n)){let r=n;(n===`data-testid`||n===`data-test-id`)&&(r=`testId`),t[r]=e[n]}return t}var sde=e=>t=>{if(!e.isEnabled())return;let n=cde(t);if(!n)return;let r=t.name===`click`,i=r?t.event:void 0;r&&e.clickDetector&&i?.target&&!i.altKey&&!i.metaKey&&!i.ctrlKey&&!i.shiftKey&&Zue(e.clickDetector,n,d3(t.event)),l3(e,n)};function _3(e,t){let n=o3.mirror.getId(e),r=n&&o3.mirror.getNode(n),i=r&&o3.mirror.getMeta(r),a=i&&ude(i)?i:null;return{message:t,data:a?{nodeId:n,node:{id:n,tagName:a.tagName,textContent:Array.from(a.childNodes).map(e=>e.type===g3.Text&&e.textContent).filter(Boolean).map(e=>e.trim()).join(``),attributes:ode(a.attributes)}}:{}}}function cde(e){let{target:t,message:n}=lde(e);return h3({category:`ui.${e.name}`,..._3(t,n)})}function lde(e){let t=e.name===`click`,n,r=null;try{r=t?d3(e.event):f3(e.event),n=B$(r,{maxStringLength:200})||`<unknown>`}catch{n=`<unknown>`}return{target:r,message:n}}function ude(e){return e.type===g3.Element}function dde(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=fde(t);n&&l3(e,n)}function fde(e){let{metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:a,target:o}=e;if(!o||pde(o)||!a)return null;let s=t||r||i,c=a.length===1;if(!s&&c)return null;let l=B$(o,{maxStringLength:200})||`<unknown>`;return h3({category:`ui.keyDown`,message:l,data:{..._3(o,l).data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:a}})}function pde(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable}var mde={resource:yde,paint:_de,navigation:vde};function v3(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function hde(e){return e.map(gde).filter(Boolean)}function gde(e){let t=mde[e.entryType];return t?t(e):null}function y3(e){return((YP()||v2.performance.timeOrigin)+e)/1e3}function _de(e){let{duration:t,entryType:n,name:r,startTime:i}=e,a=y3(i);return{type:n,name:r,start:a,end:a+t,data:void 0}}function vde(e){let{entryType:t,name:n,decodedBodySize:r,duration:i,domComplete:a,encodedBodySize:o,domContentLoadedEventStart:s,domContentLoadedEventEnd:c,domInteractive:l,loadEventStart:u,loadEventEnd:d,redirectCount:f,startTime:p,transferSize:m,type:h}=e;return i===0?null:{type:`${t}.${h}`,start:y3(p),end:y3(a),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:o,duration:i,domInteractive:l,domContentLoadedEventStart:s,domContentLoadedEventEnd:c,loadEventStart:u,loadEventEnd:d,domComplete:a,redirectCount:f}}}function yde(e){let{entryType:t,initiatorType:n,name:r,responseEnd:i,startTime:a,decodedBodySize:o,encodedBodySize:s,responseStatus:c,transferSize:l}=e;return[`fetch`,`xmlhttprequest`].includes(n)?null:{type:`${t}.${n}`,start:y3(a),end:y3(i),name:r,data:{size:l,statusCode:c,decodedBodySize:o,encodedBodySize:s}}}function bde(e){let t=e.entries[e.entries.length-1];return b3(e,`largest-contentful-paint`,t?.element?[t.element]:void 0)}function xde(e){return e.sources!==void 0}function Sde(e){let t=[],n=[];for(let r of e.entries)if(xde(r)){let e=[];for(let t of r.sources)if(t.node){n.push(t.node);let r=o3.mirror.getId(t.node);r&&e.push(r)}t.push({value:r.value,nodeIds:e.length?e:void 0})}return b3(e,`cumulative-layout-shift`,n,t)}function Cde(e){let t=e.entries[e.entries.length-1];return b3(e,`interaction-to-next-paint`,t?.target?[t.target]:void 0)}function b3(e,t,n,r){let i=e.value,a=e.rating,o=y3(i);return{type:`web-vital`,name:t,start:o,end:o,data:{value:i,size:i,rating:a,nodeIds:n?n.map(e=>o3.mirror.getId(e)):void 0,attributions:r}}}function wde(e){function t(t){e.performanceEntries.includes(t)||e.performanceEntries.push(t)}function n({entries:e}){e.forEach(t)}let r=[];return[`navigation`,`paint`,`resource`].forEach(e=>{r.push(E$(e,n))}),r.push(C$(v3(bde,e)),S$(v3(Sde,e)),T$(v3(Cde,e))),()=>{r.forEach(e=>e())}}var Q=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Tde=`var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});`;function Ede(){let e=new Blob([Tde]);return URL.createObjectURL(e)}var x3=[`log`,`warn`,`error`],S3=`[Replay] `;function C3(e,t=`info`){hH({category:`console`,data:{logger:`replay`},level:t,message:`${S3}${e}`},{level:t})}function Dde(){let e=!1,t=!1,n={exception:()=>void 0,infoTick:()=>void 0,setConfig:n=>{e=!!n.captureExceptions,t=!!n.traceInternals}};return Q?(x3.forEach(e=>{n[e]=(...n)=>{G[e](S3,...n),t&&C3(n.join(``),XH(e))}}),n.exception=(r,...i)=>{i.length&&n.error&&n.error(...i),G.error(S3,r),e?Hz(r,{mechanism:{handled:!0,type:`auto.function.replay.debug`}}):t&&C3(r,`error`)},n.infoTick=(...e)=>{G.log(S3,...e),t&&setTimeout(()=>C3(e[0]),0)}):x3.forEach(e=>{n[e]=()=>void 0}),n}var $=Dde(),w3=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${C2}.`)}},T3=class{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return`sync`}destroy(){this.events=[]}async addEvent(e){let t=JSON.stringify(e).length;if(this._totalSize+=t,this._totalSize>C2)throw new w3;this.events.push(e)}finish(){return new Promise(e=>{let t=this.events;this.clear(),e(JSON.stringify(t))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let e=null;for(let{timestamp:t}of this.events)(e===null||t<e)&&(e=t);return e===null?e:s3(e)}},Ode=class{constructor(e){this._onMessage=({data:e})=>{let t=e;if(typeof t.id!=`number`)return;let n=this._pending.get(t.id);if(!(!n||n.method!==t.method)){if(this._pending.delete(t.id),!t.success){Q&&$.error(`Error in compression worker: `,t.response),n.reject(Error(`Error in compression worker`));return}n.resolve(t.response)}},this._worker=e,this._id=0,this._pending=new Map,this._worker.addEventListener(`message`,this._onMessage)}ensureReady(){return this._ensureReadyPromise||=new Promise((e,t)=>{this._worker.addEventListener(`message`,({data:n})=>{n.success?e():(Q&&$.warn(`Received worker message with unsuccessful status`,n),t(Error(`Received worker message with unsuccessful status`)))},{once:!0}),this._worker.addEventListener(`error`,e=>{Q&&$.warn(`Failed to load Replay compression worker`,e),t(Error(`Failed to load Replay compression worker: ${e instanceof ErrorEvent&&e.message?e.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(){Q&&$.log(`Destroying compression worker`),this._worker.removeEventListener(`message`,this._onMessage),this._pending.forEach(e=>e.reject(Error(`Worker destroyed`))),this._pending.clear(),this._worker.terminate()}postMessage(e,t){let n=this._getAndIncrementId();return new Promise((r,i)=>{this._pending.set(n,{method:e,resolve:r,reject:i});try{this._worker.postMessage({id:n,method:e,arg:t})}catch(e){this._pending.delete(n),i(e)}})}_getAndIncrementId(){return this._id++}},kde=class{constructor(e){this._worker=new Ode(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return`worker`}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){let t=s3(e.timestamp);(!this._earliestTimestamp||t<this._earliestTimestamp)&&(this._earliestTimestamp=t);let n=JSON.stringify(e);return this._totalSize+=n.length,this._totalSize>C2?Promise.reject(new w3):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage(`clear`).then(null,e=>{Q&&$.exception(e,`Sending "clear" message to worker failed`,e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage(`addEvent`,e)}async _finishRequest(){let e=await this._worker.postMessage(`finish`);return this._earliestTimestamp=null,this._totalSize=0,e}},Ade=class{constructor(e){this._fallback=new T3,this._compression=new kde(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}set waitForCheckout(e){this._used.waitForCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){Q&&$.exception(e,`Failed to load the compression worker, falling back to simple buffer`);return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:e,hasCheckout:t,waitForCheckout:n}=this._fallback,r=[];for(let t of e)r.push(this._compression.addEvent(t));this._compression.hasCheckout=t,this._compression.waitForCheckout=n,this._used=this._compression;try{await Promise.all(r),this._fallback.clear()}catch(e){Q&&$.exception(e,`Failed to add events when switching buffers.`)}}};function jde({useCompression:e,workerUrl:t}){if(e&&window.Worker){let e=Mde(t);if(e)return e}return Q&&$.log(`Using simple buffer`),new T3}function Mde(e){try{let t=e||Nde();return t?(Q&&$.log(`Using compression worker${e?` from ${e}`:``}`),new Ade(new Worker(t))):void 0}catch(e){Q&&$.exception(e,`Failed to create compression worker`)}}function Nde(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>`u`||!__SENTRY_EXCLUDE_REPLAY_WORKER__?Ede():``}function E3(){try{return`sessionStorage`in v2&&!!v2.sessionStorage}catch{return!1}}function Pde(e){Fde(),e.session=void 0}function Fde(){if(E3())try{v2.sessionStorage.removeItem(y2)}catch{}}function D3(e){return e!==void 0&&Math.random()<e}function O3(e){if(E3())try{v2.sessionStorage.setItem(y2,JSON.stringify(e))}catch{}}function k3(e){let t=Date.now();return{id:e.id||PP(),started:e.started||t,lastActivity:e.lastActivity||t,segmentId:e.segmentId||0,sampled:e.sampled,previousSessionId:e.previousSessionId,dirty:e.dirty||!1}}function Ide(e,t){return D3(e)?`session`:t?`buffer`:!1}function A3({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let i=k3({sampled:Ide(e,t),previousSessionId:r});return n&&O3(i),i}function Lde(){if(!E3())return null;try{let e=v2.sessionStorage.getItem(y2);if(!e)return null;let t=JSON.parse(e);return Q&&$.infoTick(`Loading existing session`),k3(t)}catch{return null}}function j3(e,t,n=+new Date){return e===null||t===void 0||t<0||t!==0&&e+t<=n}function Rde(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return j3(e.started,t,r)||j3(e.lastActivity,n,r)}function M3(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!Rde(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled===`buffer`&&e.segmentId===0)}function N3({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){let i=r.stickySession&&Lde();return i?M3(i,{sessionIdleExpire:e,maxReplayDuration:t})?(Q&&$.infoTick(`Session in sessionStorage is expired, creating new one...`),A3(r,{previousSessionId:i.id})):i:(Q&&$.infoTick(`Creating new session`),A3(r,{previousSessionId:n}))}function zde(e){return e.type===k4.Custom}function P3(e,t,n){return I3(e,t)?(F3(e,t,n),!0):!1}function Bde(e,t,n){return I3(e,t)?F3(e,t,n):Promise.resolve(null)}async function F3(e,t,n){let{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;let i=e.recordingMode===`buffer`;try{n&&i&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);let a=Vde(t,e.getOptions().beforeAddRecordingEvent);return a?await r.addEvent(a):void 0}catch(t){if(!e.isEnabled())return e.handleException(t),null;let n=t&&t instanceof w3,a=n?`eventBufferOverflow`:`eventBufferError`,o=q();if(o){let e=n?`buffer_overflow`:`internal_sdk_error`;o.recordDroppedEvent(e,`replay`)}if(n&&i)return r.clear(),r.waitForCheckout=!0,null;e.handleException(t),await e.stop({reason:a})}}function I3(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=s3(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(Q&&$.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function Vde(e,t){try{if(typeof t==`function`&&zde(e))return t(e)}catch(e){return Q&&$.exception(e,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}var L3=100;function R3(e,t,n){let r=e.getContext();t&&r.traceIds.size<L3&&r.traceIds.add(t),n&&r.segmentNames.size<L3&&r.segmentNames.add(n)}function Hde(e){return t=>{e.isEnabled()&&R3(e,t.trace_id,t.name||void 0)}}function z3(e){return!e.type}function B3(e){return e.type===`transaction`}function Ude(e){return e.type===`replay_event`}function V3(e){return e.type===`feedback`}function Wde(e){return(t,n)=>{if(!e.isEnabled()||!z3(t)&&!B3(t))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(B3(t)){Gde(e,t);return}Kde(e,t)}}}function Gde(e,t){R3(e,t.contexts?.trace?.trace_id,t.transaction)}function Kde(e,t){let n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!==`buffer`||!t.tags?.replayId)return;let{beforeErrorSampling:r}=e.getOptions();typeof r==`function`&&!r(t)||m0(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(t){e.handleException(t)}})}function qde(e){return t=>{!e.isEnabled()||!z3(t)||Jde(e,t)}}function Jde(e,t){let n=t.exception?.values?.[0]?.value;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))&&l3(e,h3({category:`replay.hydrate-error`,data:{url:IJ()}}))}function Yde(e){let t=q();t&&t.on(`beforeAddBreadcrumb`,t=>Xde(e,t))}function Xde(e,t){if(!e.isEnabled()||!H3(t))return;let n=Zde(t);n&&l3(e,n)}function Zde(e){return!H3(e)||[`fetch`,`xhr`,`sentry.event`,`sentry.transaction`].includes(e.category)||e.category.startsWith(`ui.`)?null:e.category===`console`?Qde(e):h3(e)}function Qde(e){let t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return h3(e);let n=!1,r=t.map(e=>{if(!e)return e;if(typeof e==`string`)return e.length>S2?(n=!0,`${e.slice(0,S2)}\u2026`):e;if(typeof e==`object`)try{let t=_P(e,7);return JSON.stringify(t).length>S2?(n=!0,`${JSON.stringify(t,null,2).slice(0,S2)}\u2026`):t}catch{}return e});return h3({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:[`CONSOLE_ARG_TRUNCATED`]}}:{}}})}function H3(e){return!!e.category}function $de(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function U3(){let e=K().getPropagationContext().dsc;e&&delete e.replay_id;let t=fL();if(t){let e=jL(t);delete e.replay_id}}function W3(e){let t=K().getPropagationContext().dsc;t&&(t.replay_id=e);let n=fL();if(n){let t=jL(n);t.replay_id=e}}function efe(e,t){e.triggerUserActivity(),e.addUpdate(()=>!t.timestamp||(e.throttledAddEvent({type:k4.Custom,timestamp:t.timestamp*1e3,data:{tag:`breadcrumb`,payload:{timestamp:t.timestamp,type:`default`,category:`sentry.feedback`,data:{feedbackId:t.event_id}}}}),!1))}function tfe(e,t){return e.recordingMode!==`buffer`||t.message===b2||!t.exception||t.type?!1:D3(e.getOptions().errorSampleRate)}function nfe(e){return Object.assign((t,n)=>{if(e.session&&M3(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&U3(),!e.isEnabled()||e.isPaused())return t;if(Ude(t))return delete t.breadcrumbs,t;if(!z3(t)&&!B3(t)&&!V3(t))return t;if(!e.checkAndHandleExpiredSession())return U3(),t;if(V3(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),efe(e,t),t;if($de(t,n)&&!e.getOptions()._experiments.captureExceptions)return Q&&$.log(`Ignoring error from rrweb internals`,t),null;let r=tfe(e,t);if((r||e.recordingMode===`session`)&&(t.tags={...t.tags,replayId:e.getSessionId()}),r&&e.recordingMode===`buffer`&&e.session?.sampled===`buffer`){let t=e.session;t.dirty=!0,e.getOptions().stickySession&&O3(t)}return t},{id:`Replay`})}function G3(e,t){return t.map(({type:t,start:n,end:r,name:i,data:a})=>{let o=e.throttledAddEvent({type:k4.Custom,timestamp:n,data:{tag:`performanceSpan`,payload:{op:t,description:i,startTimestamp:n,endTimestamp:r,data:a}}});return typeof o==`string`?Promise.resolve(null):o})}function rfe(e){let{from:t,to:n}=e,r=Date.now()/1e3;return{type:`navigation.push`,start:r,end:r,name:n,data:{previous:t}}}function ife(e){return t=>{if(!e.isEnabled())return;let n=rfe(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(G3(e,[n]),!1)))}}function afe(e,t){return Q&&e.getOptions()._experiments.traceInternals?!1:nH(t,q())}function K3(e,t){e.isEnabled()&&t!==null&&(afe(e,t.name)||e.addUpdate(()=>(G3(e,[t]),!0)))}function q3(e){if(!e)return;let 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){let n=b0(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function J3(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function Y3(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};let n={...e._meta};return n.warnings=[...n.warnings||[],t],e._meta=n,e}function X3(e,t){if(!t)return null;let{startTimestamp:n,endTimestamp:r,url:i,method:a,statusCode:o,request:s,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:i,data:{method:a,statusCode:o,request:s,response:c}}}function Z3(e){return{headers:{},size:e,_meta:{warnings:[`URL_SKIPPED`]}}}function Q3(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};let r={headers:e,size:t},{body:i,warnings:a}=ofe(n);return r.body=i,a?.length&&(r._meta={warnings:a}),r}function $3(e,t){return Object.entries(e).reduce((n,[r,i])=>{let a=r.toLowerCase();return t.includes(a)&&e[r]&&(n[a]=i),n},{})}function ofe(e){if(!e||typeof e!=`string`)return{body:e};let t=e.length>x2,n=sfe(e);if(t){let t=e.slice(0,x2);return n?{body:t,warnings:[`MAYBE_JSON_TRUNCATED`]}:{body:`${t}\u2026`,warnings:[`TEXT_TRUNCATED`]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function sfe(e){let t=e[0],n=e[e.length-1];return t===`[`&&n===`]`||t===`{`&&n===`}`}function e6(e,t){return AP(cfe(e),t)}function cfe(e,t=v2.document.baseURI){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(v2.location.origin))return e;let n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;let r=n.href;return!e.endsWith(`/`)&&r.endsWith(`/`)?r.slice(0,-1):r}async function lfe(e,t,n){try{let r=X3(`resource.fetch`,await dfe(e,t,n));K3(n.replay,r)}catch(e){Q&&$.exception(e,`Failed to capture fetch breadcrumb`)}}function ufe(e,t){let{input:n,response:r}=t,i=q3(n?S0(n):void 0),a=r?J3(r.headers.get(`content-length`)):void 0;i!==void 0&&(e.data.request_body_size=i),a!==void 0&&(e.data.response_body_size=a)}async function dfe(e,t,n){let r=Date.now(),{startTimestamp:i=r,endTimestamp:a=r}=t,{url:o,method:s,status_code:c=0,request_body_size:l,response_body_size:u}=e.data,d=e6(o,n.networkDetailAllowUrls)&&!e6(o,n.networkDetailDenyUrls);return{startTimestamp:i,endTimestamp:a,url:o,method:s,statusCode:c,request:d?ffe(n,t.input,l):Z3(l),response:await pfe(d,n,t.response,u)}}function ffe({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let i=n?gfe(n,t):{};if(!e)return Q3(i,r,void 0);let[a,o]=x0(S0(n),$),s=Q3(i,r,a);return o?Y3(s,o):s}async function pfe(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,i){if(!e&&i!==void 0)return Z3(i);let a=r?t6(r.headers,n):{};if(!r||!t&&i!==void 0)return Q3(a,i,void 0);let[o,s]=await hfe(r),c=mfe(o,{networkCaptureBodies:t,responseBodySize:i,captureDetails:e,headers:a});return s?Y3(c,s):c}function mfe(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:i}){try{let a=e?.length&&n===void 0?q3(e):n;return r?t?Q3(i,a,e):Q3(i,a,void 0):Z3(a)}catch(e){return Q&&$.exception(e,`Failed to serialize response body`),Q3(i,n,void 0)}}async function hfe(e){let t=_fe(e);if(!t)return[void 0,`BODY_PARSE_ERROR`];try{return[await vfe(t)]}catch(e){return e instanceof Error&&e.message.indexOf(`Timeout`)>-1?(Q&&$.warn(`Parsing text body from response timed out`),[void 0,`BODY_PARSE_TIMEOUT`]):(Q&&$.exception(e,`Failed to get text body from response`),[void 0,`BODY_PARSE_ERROR`])}}function t6(e,t){let n={};return t.forEach(t=>{e.get(t)&&(n[t]=e.get(t))}),n}function gfe(e,t){return e.length===1&&typeof e[0]!=`string`?n6(e[0],t):e.length===2?n6(e[1],t):{}}function n6(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?t6(n,t):Array.isArray(n)?{}:$3(n,t):{}}function _fe(e){try{return e.clone()}catch(e){Q&&$.exception(e,`Failed to clone response body`)}}function vfe(e){return new Promise((t,n)=>{let r=m0(()=>n(Error(`Timeout while trying to read response body`)),500);yfe(e).then(e=>t(e),e=>n(e)).finally(()=>clearTimeout(r))})}async function yfe(e){return await e.text()}async function bfe(e,t,n){try{let r=X3(`resource.xhr`,Sfe(e,t,n));K3(n.replay,r)}catch(e){Q&&$.exception(e,`Failed to capture xhr breadcrumb`)}}function xfe(e,t){let{xhr:n,input:r}=t;if(!n)return;let i=q3(r),a=n.getResponseHeader(`content-length`)?J3(n.getResponseHeader(`content-length`)):Tfe(n.response,n.responseType);i!==void 0&&(e.data.request_body_size=i),a!==void 0&&(e.data.response_body_size=a)}function Sfe(e,t,n){let r=Date.now(),{startTimestamp:i=r,endTimestamp:a=r,input:o,xhr:s}=t,{url:c,method:l,status_code:u=0,request_body_size:d,response_body_size:f}=e.data;if(!c)return null;if(!s||!e6(c,n.networkDetailAllowUrls)||e6(c,n.networkDetailDenyUrls))return{startTimestamp:i,endTimestamp:a,url:c,method:l,statusCode:u,request:Z3(d),response:Z3(f)};let p=s[h0],m=p?$3(p.request_headers,n.networkRequestHeaders):{},h=$3(C0(s),n.networkResponseHeaders),[g,_]=n.networkCaptureBodies?x0(o,$):[void 0],[v,y]=n.networkCaptureBodies?Cfe(s):[void 0],b=Q3(m,d,g),x=Q3(h,f,v);return{startTimestamp:i,endTimestamp:a,url:c,method:l,statusCode:u,request:_?Y3(b,_):b,response:y?Y3(x,y):x}}function Cfe(e){let t=[];try{return[e.responseText]}catch(e){t.push(e)}try{return wfe(e.response,e.responseType)}catch(e){t.push(e)}return Q&&$.warn(`Failed to get xhr response body`,...t),[void 0]}function wfe(e,t){try{if(typeof e==`string`)return[e];if(e instanceof Document)return[e.body.outerHTML];if(t===`json`&&qN(e))return[JSON.stringify(e)];if(!e)return[void 0]}catch(t){return Q&&$.exception(t,`Failed to serialize body`,e),[void 0,`BODY_PARSE_ERROR`]}return Q&&$.log(`Skipping network body because of body type`,e),[void 0,`UNPARSEABLE_BODY_TYPE`]}function Tfe(e,t){try{return q3(t===`json`&&qN(e)?JSON.stringify(e):e)}catch{return}}function Efe(e){let t=q();try{let{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:i,networkRequestHeaders:a,networkResponseHeaders:o}=e.getOptions(),s={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:i,networkRequestHeaders:a,networkResponseHeaders:o};t&&t.on(`beforeAddBreadcrumb`,(e,t)=>Dfe(s,e,t))}catch{}}function Dfe(e,t,n){if(t.data)try{Ofe(t)&&Afe(n)&&(xfe(t,n),bfe(t,n,e)),kfe(t)&&jfe(n)&&(ufe(t,n),lfe(t,n,e))}catch(e){Q&&$.exception(e,`Error when enriching network breadcrumb`)}}function Ofe(e){return e.category===`xhr`}function kfe(e){return e.category===`fetch`}function Afe(e){return e?.xhr}function jfe(e){return e?.input!==void 0}function Mfe(e){let t=q();t0(sde(e)),c0(ife(e)),Yde(e),Efe(e),rB(nfe(e)),t&&(t.on(`beforeSendEvent`,qde(e)),t.on(`afterSendEvent`,Wde(e)),t.on(`createDsc`,t=>{let n=e.getSessionId();n&&e.isEnabled()&&e.recordingMode===`session`&&e.checkAndHandleExpiredSession()&&(t.replay_id=n)}),t.on(`processSegmentSpan`,Hde(e)),t.on(`spanStart`,t=>{e.lastActiveSpan=t}),t.on(`spanEnd`,t=>{e.lastActiveSpan=t}),t.on(`beforeSendFeedback`,async(t,n)=>{let r=e.getSessionId();n?.includeReplay&&e.isEnabled()&&r&&t.contexts?.feedback&&(t.contexts.feedback.source===`api`&&await e.sendBufferedReplayOrFlush(),t.contexts.feedback.replay_id=r)}),t.on(`openFeedbackWidget`,async()=>{await e.sendBufferedReplayOrFlush()}))}async function Nfe(e){try{return Promise.all(G3(e,[Pfe(v2.performance.memory)]))}catch{return[]}}function Pfe(e){let{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,i=Date.now()/1e3;return{type:`memory`,name:`memory`,start:i,end:i,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function Ffe(e,t,n){return VR(e,t,{...n,setTimeoutImpl:m0})}var r6=W.navigator;function Ife(){return/iPhone|iPad|iPod/i.test(r6?.userAgent??``)||/Macintosh/i.test(r6?.userAgent??``)&&r6?.maxTouchPoints&&r6?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function Lfe(e){let t=!1;return(n,r)=>{try{if(!e.checkAndHandleExpiredSession()){Q&&$.warn(`Received replay event after session expired.`);return}let i=r||!t;t=!0,Rfe(n),e.clickDetector&&nde(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode===`buffer`&&i&&e.setInitialState(),!P3(e,n,i))return!0;if(!i)return!1;let t=e.session;if(Bfe(e,i),e.recordingMode===`buffer`&&t&&e.eventBuffer&&!t.dirty){let n=e.eventBuffer.getEarliestTimestamp();n&&(Q&&$.log(`Updating session start time to earliest event in buffer to ${new Date(n)}`),t.started=n,e.getOptions().stickySession&&O3(t))}return t?.previousSessionId||e.recordingMode===`session`&&e.flush(),!0})}catch(t){e.handleException(t)}}}function Rfe(e){let t=e.data;if(!(e.type!==k4.IncrementalSnapshot||!t||typeof t!=`object`||!(`source`in t)||t.source!==Z.Mutation||!(`attributes`in t)||!Array.isArray(t.attributes)))for(let e of t.attributes){let t=o3.mirror.getNode(e.id),n=t&&o3.mirror.getMeta(t);if(n?.type===g3.Element)for(let[t,r]of Object.entries(e.attributes))r===null?delete n.attributes[t]:n.attributes[t]=r}}function zfe(e){let t=e.getOptions();return{type:k4.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 Bfe(e,t){!t||e.session?.segmentId!==0||P3(e,zfe(e),!1)}function Vfe(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Hfe(e,t,n,r){return FL(JL(e,qL(e),r,n),[[{type:`replay_event`},e],[{type:`replay_recording`,length:typeof t==`string`?new TextEncoder().encode(t).length:t.length},t]])}function Ufe({recordingData:e,headers:t}){let n,r=`${JSON.stringify(t)}
|
|
1001
|
+
`;if(typeof e==`string`)n=`${r}${e}`;else{let t=new TextEncoder().encode(r);n=new Uint8Array(t.length+e.length),n.set(t),n.set(e,t.length)}return n}async function Wfe({client:e,scope:t,replayId:n,event:r}){let i={event_id:n,integrations:typeof e._integrations==`object`&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0};e.emit(`preprocessEvent`,r,i);let a=await jz(e.getOptions(),r,i,t,e,MF());if(!a)return null;e.emit(`postprocessEvent`,a,i),a.platform=a.platform||`javascript`;let{name:o,version:s,settings:c}=e.getSdkMetadata()?.sdk||{};return a.sdk={...a.sdk,name:o||`sentry.javascript.unknown`,version:s||`0.0.0`,settings:c},a}async function Gfe({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:i,session:a}){let o=Ufe({recordingData:e,headers:{segment_id:n}}),{urls:s,errorIds:c,traceIds:l,segmentNames:u,initialTimestamp:d}=r,f=q(),p=K(),m=f?.getTransport(),h=f?.getDsn();if(!f||!m||!h||!a.sampled)return Promise.resolve({});let g=await Wfe({scope:p,client:f,replayId:t,event:{type:gle,replay_start_timestamp:d/1e3,timestamp:i/1e3,error_ids:c,trace_ids:l,segment_names:u,urls:s,replay_id:t,segment_id:n,replay_type:a.sampled}});if(!g)return f.recordDroppedEvent(`event_processor`,`replay`),Q&&$.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete g.sdkProcessingMetadata;let _=Hfe(g,o,h,f.getOptions().tunnel),v;try{v=await m.send(_)}catch(e){let t=Error(b2);try{t.cause=e}catch{}throw t}let y=lV({},v);if(cV(y,`replay`))throw new a6(y);if(typeof v.statusCode==`number`&&(v.statusCode<200||v.statusCode>=300))throw new i6(v.statusCode);return v}var i6=class extends Error{constructor(e){super(`Transport returned status code ${e}`)}},a6=class extends Error{constructor(e){super(`Rate limit hit`),this.rateLimits=e}},o6=class extends Error{constructor(){super(`Session is too long, not sending replay`)}};async function s6(e,t={count:0,interval:Sle}){let{recordingData:n,onError:r}=e;if(n.length)try{return await Gfe(e),!0}catch(n){if(n instanceof i6||n instanceof a6)throw n;if(Gz(`Replays`,{_retryCount:t.count}),r&&r(n),t.count>=Cle){let e=Error(`${b2} - max retries exceeded`);try{e.cause=n}catch{}throw e}return t.interval*=++t.count,new Promise((n,r)=>{m0(async()=>{try{await s6(e,t),n(!0)}catch(e){r(e)}},t.interval)})}}var c6=`__THROTTLED`,Kfe=`__SKIPPED`;function qfe(e,t,n){let r=new Map,i=e=>{let t=e-n;r.forEach((e,n)=>{n<t&&r.delete(n)})},a=()=>[...r.values()].reduce((e,t)=>e+t,0),o=!1;return(...n)=>{let s=Math.floor(Date.now()/1e3);if(i(s),a()>=t){let e=o;return o=!0,e?Kfe:c6}o=!1;let c=r.get(s)||0;return r.set(s,c+1),e(...n)}}var Jfe=class{constructor({options:e,recordingOptions:t}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode=`session`,this.timeouts={sessionIdlePause:_le,sessionIdleExpire:vle},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,segmentNames:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:``},this._recordingOptions=t,this._options=e,this._debouncedFlush=Ffe(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=qfe((e,t)=>Bde(this,e,t),300,5);let{slowClickTimeout:n,slowClickIgnoreSelectors:r}=this.getOptions(),i=n?{threshold:Math.min(wle,n),timeout:n,scrollTimeout:Tle,ignoreSelector:r?r.join(`,`):``}:void 0;if(i&&(this.clickDetector=new Que(this,i)),Q){let t=e._experiments;$.setConfig({captureExceptions:!!t.captureExceptions,traceInternals:!!t.traceInternals})}this._handleVisibilityChange=()=>{v2.document.visibilityState===`visible`?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{let e=h3({category:`ui.blur`});this._doChangeToBackgroundTasks(e)},this._handleWindowFocus=()=>{let e=h3({category:`ui.focus`});this._doChangeToForegroundTasks(e)},this._handleKeyboardEvent=e=>{dde(this,e)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(e){Q&&$.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){let{errorSampleRate:t,sessionSampleRate:n}=this._options,r=t<=0&&n<=0;if(this._requiresManualStart=r,!r){if(this._initializeSessionForSampling(e),!this.session){Q&&$.exception(Error(`Unable to initialize and create session`));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled===`buffer`&&this.session.segmentId===0?`buffer`:`session`,Q&&$.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode===`session`){Q&&$.log(`Recording is already in progress`);return}if(this._isEnabled&&this.recordingMode===`buffer`){Q&&$.log("Buffering is in progress, call `flush()` to save the replay");return}Q&&$.infoTick(`Starting replay in session mode`),this._updateUserActivity();let e=N3({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this.recordingMode=`session`,this._initializeRecording()}startBuffering(){if(this._isEnabled){Q&&$.log("Buffering is in progress, call `flush()` to save the replay");return}Q&&$.infoTick(`Starting replay in buffer mode`);let e=N3({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode=`buffer`,this._initializeRecording()}startRecording(){try{let e=this._canvas;this._stopRecording=o3({...this._recordingOptions,...this.recordingMode===`buffer`?{checkoutEveryNms:xle}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:Lfe(this),...Ife(),onMutation:this._onMutationHandler.bind(this),...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&=(this._stopRecording(),void 0),!0}catch(e){return this.handleException(e),!1}}async stop({forceFlush:e=!1,reason:t}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode=`buffer`;let n=t??`manual`;q()?.emit(`replayEnd`,{sessionId:this.session?.id,reason:n});try{Q&&$.log(`Stopping Replay triggered by ${n}`),U3(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,Pde(this)}catch(e){this.handleException(e)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Q&&$.log(`Pausing replay`))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),Q&&$.log(`Resuming replay`))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode===`session`)return this.flushImmediate();let t=Date.now();Q&&$.log(`Converting buffer to session`),await this.flushImmediate();let n=this.stopRecording();!e||!n||this.recordingMode!==`session`&&(this.recordingMode=`session`,this.session&&(this.session.dirty=!1,this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession(),W3(this.session.id)),this.startRecording())}addUpdate(e){let t=e();this.recordingMode===`buffer`||!this._isEnabled||t!==!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(e){if(!(e&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&j3(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled===`session`){this.pause();return}return!!this._checkSession()}setInitialState(){let e=`${v2.location.pathname}${v2.location.hash}${v2.location.search}`,t=`${v2.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){let n=this._throttledAddEvent(e,t);if(n===c6){let e=h3({category:`replay.throttled`});this.addUpdate(()=>!P3(this,{type:Gue,timestamp:e.timestamp||0,data:{tag:`breadcrumb`,payload:e,metric:!0}}))}return n}getCurrentRoute(){let e=this.lastActiveSpan||fL(),t=e&&uL(e),n=(t&&YI(t).data||{})[LF];if(!(!t||!n||![`route`,`custom`].includes(n)))return YI(t).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=jde({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&q()?.emit(`replayStart`,{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode===`session`&&this.session&&W3(this.session.id)}_initializeSessionForSampling(e){let t=this._options.errorSampleRate>0,n=N3({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t});this.session=n}_checkSession(){if(!this.session)return!1;let e=this.session;return!M3(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(e),!1)}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:`sessionExpired`}),this.initializeSampling(e.id))}_addListeners(){try{v2.document.addEventListener(`visibilitychange`,this._handleVisibilityChange),v2.addEventListener(`blur`,this._handleWindowBlur),v2.addEventListener(`focus`,this._handleWindowFocus),v2.addEventListener(`keydown`,this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||=(Mfe(this),!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=wde(this)}_removeListeners(){try{v2.document.removeEventListener(`visibilitychange`,this._handleVisibilityChange),v2.removeEventListener(`blur`,this._handleWindowBlur),v2.removeEventListener(`focus`,this._handleWindowFocus),v2.removeEventListener(`keydown`,this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}_doChangeToBackgroundTasks(e){if(this.session){if(M3(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){U3();return}e&&this._createCustomBreadcrumb(e),this.conditionalFlush()}}_doChangeToForegroundTasks(e){if(this.session){if(!this.checkAndHandleExpiredSession()){Q&&$.log(`Document has become active, but session has expired`);return}e&&this._createCustomBreadcrumb(e)}}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:k4.Custom,timestamp:e.timestamp||0,data:{tag:`breadcrumb`,payload:e}})})}_addPerformanceEntries(){let e=hde(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){let t=this._context.initialTimestamp/1e3;e=e.filter(e=>e.start>=t)}return Promise.all(G3(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.segmentNames.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:e,eventBuffer:t}=this;if(!e||!t||this._requiresManualStart||e.segmentId)return;let n=t.getEarliestTimestamp();n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}_popEventContext(){let e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),segmentNames:Array.from(this._context.segmentNames),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){let e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){Q&&$.error(`No session or eventBuffer found to flush.`);return}if(await this._addPerformanceEntries(),this.eventBuffer?.hasEvents&&(await Nfe(this),this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let t=Date.now();if(t-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new o6;let n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession(),await s6({replayId:e,recordingData:await this.eventBuffer.finish(),segmentId:r,eventContext:n,session:this.session,timestamp:t,onError:e=>this.handleException(e)})}catch(e){this.handleException(e),this.stop({reason:`sendError`});let t=q();if(t){let n;n=e instanceof a6?`ratelimit_backoff`:e instanceof o6?`invalid`:`send_error`,t.recordDroppedEvent(n,`replay`)}}}async _flush({force:e=!1}={}){if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){Q&&$.error(`Attempting to finish replay event after session expired.`);return}if(!this.session)return;let t=this.session.started,n=Date.now()-t;this._debouncedFlush.cancel();let r=n<this._options.minReplayDuration,i=n>this._options.maxReplayDuration+5e3;if(r||i){Q&&$.log(`Session duration (${Math.floor(n/1e3)}s) is too ${r?`short`:`long`}, not sending replay.`),r&&this._debouncedFlush();return}let a=this.eventBuffer;a&&this.session.segmentId===0&&!a.hasCheckout&&Q&&$.log(`Flushing initial segment without checkout.`);let o=!!this._flushLock;this._flushLock||=this._runFlush();try{await this._flushLock}catch(e){this.handleException(e)}finally{this._flushLock=void 0,o&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&O3(this.session)}_onMutationHandler(e){let{ignoreMutations:t}=this._options._experiments;if(t?.length&&e.some(e=>{let n=Vfe(e.target),r=t.join(`,`);return n?.matches(r)}))return!1;let n=e.length,r=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,a=r&&n>r;if(n>i||a){let e=h3({category:`replay.mutations`,data:{count:n,limit:a}});this._createCustomBreadcrumb(e)}return!a||(this.stop({reason:`mutationLimit`,forceFlush:this.recordingMode===`session`}),!1)}};function l6(e,t){return[...e,...t].join(`,`)}function Yfe({mask:e,unmask:t,block:n,unblock:r,ignore:i}){return{maskTextSelector:l6(e,[`.sentry-mask`,`[data-sentry-mask]`]),unmaskTextSelector:l6(t,[]),blockSelector:l6(n,[`.sentry-block`,`[data-sentry-block]`,`base`,`iframe[srcdoc]:not([src])`]),unblockSelector:l6(r,[]),ignoreSelector:l6(i,[`.sentry-ignore`,`[data-sentry-ignore]`,`input[type="file"]`])}}function Xfe({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:i,value:a}){if(i.unmaskTextSelector&&e.matches(i.unmaskTextSelector))return a;let o=n.includes(t),s=r&&t===`value`&&e.tagName===`INPUT`&&[`submit`,`button`].includes(e.getAttribute(`type`)||``);return o||s?a.replace(/[\S]/g,`*`):a}var u6=`img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]`,Zfe=[`content-length`,`content-type`,`accept`],Qfe=Symbol.for(`sentry__originalRequestBody`),d6=!1,f6=!1;function $fe(){if(typeof Request>`u`||f6)return;let e=Request;try{let t=function(t,n){let r=new e(t,n);return n?.body!=null&&(r[Qfe]=n.body),r};t.prototype=e.prototype,W.Request=t,f6=!0}catch{}}var p6=(e=>new epe(e)),epe=class{constructor({flushMinDelay:e=yle,flushMaxDelay:t=ble,minReplayDuration:n=Ele,maxReplayDuration:r=w2,stickySession:i=!0,useCompression:a=!0,workerUrl:o,_experiments:s={},maskAllText:c=!0,maskAllInputs:l=!0,blockAllMedia:u=!0,mutationBreadcrumbLimit:d=750,mutationLimit:f=1e4,slowClickTimeout:p=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:h=[],networkDetailDenyUrls:g=[],networkCaptureBodies:_=!0,networkRequestHeaders:v=[],networkResponseHeaders:y=[],mask:b=[],maskAttributes:x=[`title`,`placeholder`,`aria-label`],unmask:S=[],block:C=[],unblock:w=[],ignore:T=[],maskFn:ee,beforeAddRecordingEvent:E,beforeErrorSampling:te,onError:ne,attachRawBodyFromRequest:re=!1}={}){this.name=`Replay`;let ie=Yfe({mask:b,unmask:S,block:C,unblock:w,ignore:T});if(this._recordingOptions={maskAllInputs:l,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:ee,maskInputFn:ee,maskAttributeFn:(e,t,n)=>Xfe({maskAttributes:x,maskAllText:c,privacyOptions:ie,key:e,value:t,el:n}),...ie,slimDOMOptions:`all`,inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:e=>{try{e.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!s.recordCrossOriginIframes},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(n,Dle),maxReplayDuration:Math.min(r,w2),stickySession:i,useCompression:a,workerUrl:o,blockAllMedia:u,maskAllInputs:l,maskAllText:c,mutationBreadcrumbLimit:d,mutationLimit:f,slowClickTimeout:p,slowClickIgnoreSelectors:m,networkDetailAllowUrls:h,networkDetailDenyUrls:g,networkCaptureBodies:_,networkRequestHeaders:m6(v),networkResponseHeaders:m6(y),beforeAddRecordingEvent:E,beforeErrorSampling:te,onError:ne,attachRawBodyFromRequest:re,_experiments:s},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${u6}`:u6,this._recordingOptions.ignoreCSSAttributes=new Set([`background-image`])),this._isInitialized&&jB())throw Error(`Multiple Sentry Session Replay instances are not supported`);this._isInitialized=!0}get _isInitialized(){return d6}set _isInitialized(e){d6=e}afterAllSetup(e){!jB()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&$fe(),this._setup(e),this._initialize(e))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(e){return this._replay?this._replay.stop({forceFlush:e?.flush??this._replay.recordingMode===`session`,reason:`manual`}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(e){if(this._replay?.isEnabled())return this._replay.getSessionId(e)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}processSpan(e){let t=this.getReplayId(!0);t&&(pz(e,{"sentry.replay_id":t}),this.getRecordingMode()===`buffer`&&pz(e,{"sentry._internal.replay_is_buffering":!0}))}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){let t=tpe(this._initialOptions,e);this._replay=new Jfe({options:t,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{let t=e.getIntegrationByName(`ReplayCanvas`);if(!t)return;this._replay._canvas=t.getOptions()}catch{}}};function tpe(e,t){let n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},i=MI(n.replaysSessionSampleRate),a=MI(n.replaysOnErrorSampleRate);return i==null&&a==null&&oN(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),i!=null&&(r.sessionSampleRate=i),a!=null&&(r.errorSampleRate=a),r}function m6(e){return[...Zfe,...e.map(e=>e.toLowerCase())]}function npe(){return q()?.getIntegrationByName(`Replay`)}var rpe=Object.defineProperty,ipe=(e,t,n)=>t in e?rpe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,h6=(e,t,n)=>ipe(e,typeof t==`symbol`?t:t+``,n),ape=class{constructor(){h6(this,`idNodeMap`,new Map),h6(this,`nodeMetaMap`,new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function ope(){return new ape}function spe(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function g6(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:g6(e.parentNode,t,n,r+1)}function _6(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e==`string`){if(r.matches(`.${e}`))return!0}else if(spe(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}var v6=`Please stop import mirror directly. Instead of that,\r
|
|
1002
|
+
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
1003
|
+
or you can use record.mirror to access the mirror instance during recording.`,y6={map:{},getId(){return console.error(v6),-1},getNode(){return console.error(v6),null},removeNodeFromMap(){console.error(v6)},has(){return console.error(v6),!1},reset(){console.error(v6)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(y6=new Proxy(y6,{get(e,t,n){return t===`map`&&console.error(v6),Reflect.get(e,t,n)}}));function b6(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){E6(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>b6(e,t,a||{},!0)}function x6(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}Date.now().toString();function cpe(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function S6(e,t,n,r,i){if(!e)return!1;let a=cpe(e);if(!a)return!1;let o=_6(t,n);if(!i){let e=r&&a.matches(r);return o(a)&&!e}let s=g6(a,o),c=-1;return s<0?!1:(r&&(c=g6(a,_6(null,r))),s>-1&&c<0||s<c)}var C6={};function w6(e){let t=C6[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement==`function`)try{let t=n.createElement(`iframe`);t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch{}return C6[e]=r.bind(window)}function T6(...e){return w6(`requestAnimationFrame`)(...e)}function E6(...e){return w6(`setTimeout`)(...e)}var D6=(e=>(e[e[`2D`]=0]=`2D`,e[e.WebGL=1]=`WebGL`,e[e.WebGL2=2]=`WebGL2`,e))(D6||{}),O6;function lpe(e){O6=e}for(var k6=e=>O6?((...t)=>{try{return e(...t)}catch(e){if(O6&&O6(e)===!0)return()=>{};throw e}}):e,A6=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,upe=typeof Uint8Array>`u`?[]:new Uint8Array(256),j6=0;j6<A6.length;j6++)upe[A6.charCodeAt(j6)]=j6;var dpe=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=A6[t[n]>>2],i+=A6[(t[n]&3)<<4|t[n+1]>>4],i+=A6[(t[n+1]&15)<<2|t[n+2]>>6],i+=A6[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i},M6=new Map;function fpe(e,t){let n=M6.get(e);return n||(n=new Map,M6.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var N6=(e,t,n)=>{if(!e||!(I6(e,t)||typeof e==`object`))return;let r=e.constructor.name,i=fpe(n,r),a=i.indexOf(e);return a===-1&&(a=i.length,i.push(e)),a};function P6(e,t,n){if(e instanceof Array)return e.map(e=>P6(e,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)return{rr_type:e.constructor.name,base64:dpe(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[P6(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}return e instanceof HTMLCanvasElement?{rr_type:`HTMLImageElement`,src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[P6(e.data,t,n),e.width,e.height]}:I6(e,t)||typeof e==`object`?{rr_type:e.constructor.name,index:N6(e,t,n)}:e}var F6=(e,t,n)=>e.map(e=>P6(e,t,n)),I6=(e,t)=>!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(e=>typeof t[e]==`function`).find(n=>e instanceof t[n]);function ppe(e,t,n,r,i){let a=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!=`function`)continue;let o=x6(t.CanvasRenderingContext2D.prototype,s,function(a){return function(...o){return S6(this.canvas,n,r,i,!0)||E6(()=>{let n=F6(o,t,this);e(this.canvas,{type:D6[`2D`],property:s,args:n})},0),a.apply(this,o)}});a.push(o)}catch{let n=b6(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:D6[`2D`],property:s,args:[t],setter:!0})}});a.push(n)}return()=>{a.forEach(e=>e())}}function mpe(e){return e===`experimental-webgl`?`webgl`:e}function L6(e,t,n,r,i){let a=[];try{let o=x6(e.HTMLCanvasElement.prototype,`getContext`,function(e){return function(a,...o){if(!S6(this,t,n,r,!0)){let e=mpe(a);if(`__context`in this||(this.__context=e),i&&[`webgl`,`webgl2`].includes(e))if(o[0]&&typeof o[0]==`object`){let e=o[0];e.preserveDrawingBuffer||=!0}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[a,...o])}});a.push(o)}catch{console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return()=>{a.forEach(e=>e())}}function R6(e,t,n,r,i,a,o,s){let c=[],l=Object.getOwnPropertyNames(e);for(let o of l)if(![`isContextLost`,`canvas`,`drawingBufferWidth`,`drawingBufferHeight`].includes(o))try{if(typeof e[o]!=`function`)continue;let l=x6(e,o,function(e){return function(...c){let l=e.apply(this,c);if(N6(l,s,this),`tagName`in this.canvas&&!S6(this.canvas,r,i,a,!0)){let e=F6(c,s,this),r={type:t,property:o,args:e};n(this.canvas,r)}return l}});c.push(l)}catch{let r=b6(e,o,{set(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});c.push(r)}return c}function hpe(e,t,n,r,i,a){let o=[];return o.push(...R6(t.WebGLRenderingContext.prototype,D6.WebGL,e,n,r,i,a,t)),t.WebGL2RenderingContext!==void 0&&o.push(...R6(t.WebGL2RenderingContext.prototype,D6.WebGL2,e,n,r,i,a,t)),()=>{o.forEach(e=>e())}}var gpe=`for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)t[e.charCodeAt(a)]=a;var n=function(t){var a,n=new Uint8Array(t),r=n.length,s="";for(a=0;a<r;a+=3)s+=e[n[a]>>2],s+=e[(3&n[a])<<4|n[a+1]>>4],s+=e[(15&n[a+1])<<2|n[a+2]>>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(e<=n&&t<=r)return[e,t];let s=e,i=t;return s>n&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w?.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};`;function _pe(){let e=new Blob([gpe]);return URL.createObjectURL(e)}var vpe=class{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.shadowDoms=new Set,this.windowsSet=new WeakSet,this.windows=[],this.restoreHandlers=[],this.frozen=!1,this.locked=!1,this.snapshotInProgressMap=new Map,this.worker=null,this.lastSnapshotTime=0,this.processMutation=(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};let{enableManualSnapshot:t,sampling:n=`all`,win:r,recordCanvas:i,errorHandler:a}=e;e.sampling=n,this.mutationCb=e.mutationCb,this.mirror=e.mirror,this.options=e,a&&lpe(a),(i&&typeof n==`number`||t)&&(this.worker=this.initFPSWorker()),this.addWindow(r),!t&&k6(()=>{i&&n===`all`&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),i&&typeof n==`number`&&this.initCanvasFPSObserver()})()}reset(){this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(e=>{try{e()}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(e){let{sampling:t=`all`,blockClass:n,blockSelector:r,unblockSelector:i,recordCanvas:a,enableManualSnapshot:o}=this.options;if(!this.windowsSet.has(e)){if(o){this.windowsSet.add(e),this.windows.push(new WeakRef(e));return}k6(()=>{if(a&&t===`all`&&this.initCanvasMutationObserver(e,n,r,i),a&&typeof t==`number`){let t=L6(e,n,r,i,!0);this.restoreHandlers.push(()=>{t()})}})(),this.windowsSet.add(e),this.windows.push(new WeakRef(e))}}addShadowRoot(e){this.shadowDoms.add(new WeakRef(e))}resetShadowRoots(){this.shadowDoms=new Set}snapshot(e,t){if(t?.skipRequestAnimationFrame){this.takeSnapshot(performance.now(),!0,e);return}T6(t=>this.takeSnapshot(t,!0,e))}initFPSWorker(){let e=new Worker(_pe());return e.onmessage=e=>{let t=e.data,{id:n}=t;if(this.snapshotInProgressMap.set(n,!1),!(`base64`in t))return;let{base64:r,type:i,width:a,height:o}=t;this.mutationCb({id:n,type:D6[`2D`],commands:[{property:`clearRect`,args:[0,0,a,o]},{property:`drawImage`,args:[{rr_type:`ImageBitmap`,args:[{rr_type:`Blob`,data:[{rr_type:`ArrayBuffer`,base64:r}],type:i}]},0,0,a,o]}]})},e}initCanvasFPSObserver(){let e;if(!this.windows.length&&!this.shadowDoms.size)return;let t=n=>{this.takeSnapshot(n,!1),e=T6(t)};e=T6(t),this.restoreHandlers.push(()=>{e&&cancelAnimationFrame(e)})}initCanvasMutationObserver(e,t,n,r){let i=L6(e,t,n,r,!1),a=ppe(this.processMutation.bind(this),e,t,n,r),o=hpe(this.processMutation.bind(this),e,t,n,r,this.mirror);this.restoreHandlers.push(()=>{i(),a(),o()})}getCanvasElements(e,t,n){let r=[],i=i=>{i.querySelectorAll(`canvas`).forEach(i=>{S6(i,e,t,n,!0)||r.push(i)})};for(let e of this.windows){let t=e.deref(),n;try{n=t&&t.document}catch{}n&&i(n)}for(let e of this.shadowDoms){let t=e.deref();t&&i(t)}return r}takeSnapshot(e,t,n){let{sampling:r,blockClass:i,blockSelector:a,unblockSelector:o,dataURLOptions:s,maxCanvasSize:c}=this.options,l=1e3/(r===`all`?2:r||2);return this.lastSnapshotTime&&e-this.lastSnapshotTime<l?!1:(this.lastSnapshotTime=e,(n?[n]:this.getCanvasElements(i,a,o)).forEach(e=>{let n=this.mirror.getId(e);if(!(!this.mirror.hasNode(e)||!e.width||!e.height||this.snapshotInProgressMap.get(n))){if(this.snapshotInProgressMap.set(n,!0),!t&&[`webgl`,`webgl2`].includes(e.__context)){let t=e.getContext(e.__context);t?.getContextAttributes()?.preserveDrawingBuffer===!1&&t.clear(t.COLOR_BUFFER_BIT)}createImageBitmap(e).then(t=>{this.worker?.postMessage({id:n,bitmap:t,width:e.width,height:e.height,dataURLOptions:s,maxCanvasSize:c},[t])}).catch(e=>{k6(()=>{throw this.snapshotInProgressMap.delete(n),e})()})}}),!0)}startPendingCanvasMutationFlusher(){T6(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,T6(e)};T6(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),T6(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(e);if(!n||t===-1)return;let r=n.map(e=>{let{type:t,...n}=e;return n}),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}};try{if(Array.from([1],e=>e*2)[0]!==2){let 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)}ope();var ype;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})(ype||={});var z6={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}}},bpe=`ReplayCanvas`,B6=1280,xpe=xB(((e={})=>{let[t,n]=e.maxCanvasSize||[],r={quality:e.quality||`medium`,enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,B6):B6,n?Math.min(n,B6):B6]},i,a,o=new Promise(e=>a=e);return{name:bpe,getOptions(){let{quality:e,enableManualSnapshot:t,maxCanvasSize:n}=r;return{enableManualSnapshot:t,recordCanvas:!0,getCanvasManager:e=>{let r=new vpe({...e,enableManualSnapshot:t,maxCanvasSize:n,errorHandler:e=>{try{typeof e==`object`&&(e.__rrweb__=!0)}catch{}}});return i=r,a(r),r},...z6[e]||z6.medium}},async snapshot(e,t){(i||await o).snapshot(e,t)}}}));function Spe(e){return e.split(`,`).some(e=>e.trim().startsWith(`sentry-`))}function V6(e){try{return new URL(e,J.location.origin).href}catch{return}}function Cpe(e){return e.entryType===`resource`&&`initiatorType`in e&&typeof e.nextHopProtocol==`string`&&(e.initiatorType===`fetch`||e.initiatorType===`xmlhttprequest`)}function H6(e){try{return new Headers(e)}catch{return}}var U6={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function W6(e,t){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:i,enableHTTPTimings:a,tracePropagationTargets:o,onRequestSpanStart:s,onRequestSpanEnd:c}={...U6,...t},l=typeof i==`function`?i:e=>!0,u=e=>Tpe(e,o),d={},f=e.getOptions().propagateTraceparent;n&&xJ(t=>{let n=fW(t,l,u,d,{propagateTraceparent:f,onRequestSpanEnd:c});if(n){let r=V6(t.fetchData.url),i=r?$V(r).host:void 0,o=r?tH(r):void 0;n.setAttributes({"http.url":o,"url.full":o,"server.address":i}),a&&G6(n,e),s?.(n,{headers:t.headers})}}),r&&g0(t=>{let n=Epe(t,l,u,d,f,c);n&&(a&&G6(n,e),s?.(n,{headers:H6(t.xhr.__sentry_xhr_v3__?.request_headers)}))})}var wpe=300;function G6(e,t){let{url:n}=YI(e).data;if(!n||typeof n!=`string`)return;let r=()=>void setTimeout(i);if(iR(t)){let t=e.end.bind(e);e.end=e=>{let n=e??KP(),a=!1,o=()=>{a||(a=!0,setTimeout(i),t(n),clearTimeout(s))};r=o;let s=setTimeout(o,wpe)}}let i=E$(`resource`,({entries:t})=>{t.forEach(t=>{Cpe(t)&&t.name.endsWith(n)&&(e.setAttributes(r1(t)),r())})})}function Tpe(e,t){let n=IJ();if(n){let r,i;try{r=new URL(e,n),i=new URL(n).origin}catch{return!1}let a=r.origin===i;return t?AP(r.toString(),t)||a&&AP(r.pathname,t):a}{let n=!!e.match(/^\/(?!\/)/);return t?AP(e,t):n}}function Epe(e,t,n,r,i,a){let o=e.xhr,s=o?.[h0];if(!o||o.__sentry_own_request__||!s)return;let{url:c,method:l}=s,u=_L()&&t(c);if(e.endTimestamp){let t=o.__sentry_xhr_span_id__;if(!t)return;let n=r[t];n&&(u&&s.status_code!==void 0&&(aI(n,s.status_code),n.end(),a?.(n,{headers:H6(C0(o)),error:e.error})),delete r[t]);return}let d=V6(c),f=$V(d||c),p=d?tH(d):void 0,m=tH(eH(c)),h=q(),g=!!fL(),_=g||!!h&&iR(h),v=u&&_?_R({name:`${l} ${m}`,attributes:{url:tH(c),type:`xhr`,"http.method":l,"http.url":p,"url.full":p,"server.address":f?.host,[VF]:`auto.http.browser`,[BF]:`http.client`,...f?.search&&{"http.query":f?.search},...f?.hash&&{"http.fragment":f?.hash}}}):new wL,y=NR(v)&&g?void 0:v;return u&&!_&&h?.recordDroppedEvent(`no_parent_span`,`span`),o.__sentry_xhr_span_id__=v.spanContext().spanId,r[o.__sentry_xhr_span_id__]=v,n(c)&&Dpe(o,_L()&&_?y:void 0,i),h&&h.emit(`beforeOutgoingRequestSpan`,v,e),v}function Dpe(e,t,n){let{"sentry-trace":r,baggage:i,traceparent:a}=dH({span:t,propagateTraceparent:n});r&&Ope(e,r,i,a)}function Ope(e,t,n,r){let i=e.__sentry_xhr_v3__?.request_headers;if(!(i?.[`sentry-trace`]||!e.setRequestHeader))try{if(e.setRequestHeader(`sentry-trace`,t),r&&!i?.traceparent&&e.setRequestHeader(`traceparent`,r),n){let t=i?.baggage;(!t||!Spe(t))&&e.setRequestHeader(`baggage`,n)}}catch{}}var K6=new WeakMap,q6=new WeakMap,kpe=9e4,Ape=[`text/event-stream`,`application/x-ndjson`,`application/stream+json`],J6=xB(()=>({name:`FetchStreamPerformance`,setup(){SJ(e=>{if(e.response){let t=K6.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);let n=q6.get(e.response);n&&clearTimeout(n)}}}),xJ(e=>{if(e.endTimestamp&&e.response){let t=e.response.headers?.get(`content-type`)||``;if(e.response.headers?.get(`content-length`)||!Ape.some(e=>t.startsWith(e)))return;let n=e.fetchData?.url||``,r=e.fetchData?.method||`GET`,i=ZV(n),a=_R({name:`${r} ${n.startsWith(`data:`)?tH(n):i?QV(i):n}`,startTime:e.endTimestamp,attributes:{url:tH(n),"http.method":r,type:`fetch`,[BF]:`http.client.stream`,[VF]:`auto.http.browser.stream`}});K6.set(e.response,a);let o=setTimeout(()=>{a.isRecording()&&a.end()},kpe);q6.set(e.response,o)}})}})),jpe=`WebVitals`,Y6=xB((e={})=>{let t=new Set(e.ignore??[]);return{name:jpe,setup(n){let r=iR(n),{enableStandaloneClsSpans:i,enableStandaloneLcpSpans:a}=e._experiments??{},o=r||t.has(`cls`)?void 0:i||!1,s=r||t.has(`lcp`)?void 0:a||!1,c=u1({recordClsStandaloneSpans:o,recordLcpStandaloneSpans:s,client:n}),l=new WeakSet;n.on(`afterStartPageLoadSpan`,e=>{l.add(e)}),n.on(`spanEnd`,e=>{l.delete(e)&&(c(),y1(e,{recordClsOnPageloadSpan:o===!1,recordLcpOnPageloadSpan:s===!1,spanStreamingEnabled:r}))}),r?(t.has(`lcp`)||G1(n),t.has(`cls`)||q1(n),t.has(`inp`)||Y1()):t.has(`inp`)||R1()},afterAllSetup(){t.has(`inp`)||U1()}}});function Mpe(){J.document?J.document.addEventListener(`visibilitychange`,()=>{let e=fL();if(!e)return;let t=uL(e);if(J.document.hidden&&t){let e=`cancelled`,{op:n,status:r}=YI(t);X&&G.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus({code:2,message:e}),t.setAttribute(`sentry.cancellation_reason`,`document.hidden`),t.end()}}):X&&G.warn(`[Tracing] Could not set up background tab detection due to lack of global document`)}var X6=`sentry_previous_trace`,Npe=`sentry.previous_trace`;function Ppe(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t===`session-storage`,i=r?Lpe():void 0;e.on(`spanStart`,e=>{if(uL(e)!==e)return;let t=K().getPropagationContext();i=Fpe(i,e,t),r&&Ipe(i)});let a=!0;n&&e.on(`beforeSampling`,e=>{if(!i)return;let t=K(),n=t.getPropagationContext();if(a&&n.parentSpanId){a=!1;return}t.setPropagationContext({...n,dsc:{...n.dsc,sample_rate:String(i.sampleRate),sampled:String(Z6(i.spanContext))},sampleRand:i.sampleRand}),e.parentSampled=Z6(i.spanContext),e.parentSampleRate=i.sampleRate,e.spanAttributes={...e.spanAttributes,[zF]:i.sampleRate}})}function Fpe(e,t,n){let r=YI(t);function i(){try{let e=Number(r.data?.[`sentry.sample_rate`]??n.dsc?.sample_rate);return Number.isNaN(e)?0:e}catch{return 0}}let a={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:i(),sampleRand:n.sampleRand};if(!e)return a;let o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=3600&&(X&&G.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[nI]:`previous_trace`}}),t.setAttribute(Npe,`${o.traceId}-${o.spanId}-${+!!Z6(o)}`)),a)}function Ipe(e){try{J.sessionStorage.setItem(X6,JSON.stringify(e))}catch(e){X&&G.warn(`Could not store previous trace in sessionStorage`,e)}}function Lpe(){try{let e=J.sessionStorage?.getItem(X6);return JSON.parse(e)}catch{return}}function Z6(e){return e.traceFlags===1}var Rpe=`BrowserTracing`,zpe=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function Q6(){let e=J.navigator;return e?.userAgent?zpe.test(e.userAgent):!1}var Bpe={...PR,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:`in-memory`,consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...U6},$6=((e={})=>{`enableElementTiming`in e&&oN(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});let t={name:void 0,source:void 0},n=J.document,{enableInp:r,enableLongTask:i,enableLongAnimationFrame:a,_experiments:{enableInteractions:o,enableStandaloneClsSpans:s,enableStandaloneLcpSpans:c},beforeStartSpan:l,idleTimeout:u,finalTimeout:d,childSpanTimeout:f,markBackgroundSpan:p,traceFetch:m,traceXHR:h,trackFetchStreamPerformance:g,shouldCreateSpanForRequest:_,enableHTTPTimings:v,ignoreResourceSpans:y,ignorePerformanceApiSpans:b,instrumentPageLoad:x,instrumentNavigation:S,detectRedirects:C,linkPreviousTrace:w,consistentTraceSampling:T,enableReportPageLoaded:ee,onRequestSpanStart:E,onRequestSpanEnd:te}={...Bpe,...e},ne=Q6(),re,ie;function ae(e,r,i=!0,a){let o=r.op===`pageload`,s=r.name,c=l?l(r):r,p=ZV(a||IJ()),m={...p?.pathname&&{"url.path":p.pathname},...p&&!XV(p)&&{"url.full":p.href},...c.attributes};if(s!==c.name&&(m[LF]=`custom`),c.attributes=m,!i){let e=UP();_R({...c,startTime:e}).end(e);return}t.name=c.name,t.source=m[LF];let h=zR(c,{idleTimeout:u,finalTimeout:d,childSpanTimeout:f,disableAutoFinish:o,beforeSpanEnd:t=>{v1(t,{ignoreResourceSpans:y,ignorePerformanceApiSpans:b,spanStreamingEnabled:iR(e)}),o8(e,void 0);let n=K(),r=n.getPropagationContext();n.setPropagationContext({...r,traceId:h.spanContext().traceId,sampled:tL(h),dsc:jL(t)}),o&&(ie=void 0)},trimIdleSpanEndTimestamp:!ee});o&&ee&&(ie=h),o8(e,h);function g(){n&&[`interactive`,`complete`].includes(n.readyState)&&(e.emit(`idleSpanEnableAutoFinish`,h),n.removeEventListener(`readystatechange`,g))}o&&!ee&&n&&(n.addEventListener(`readystatechange`,g),g())}return{name:Rpe,setup(e){if(ne){X&&G.log(`[Tracing] Skipping browserTracingIntegration setup for bot user agent.`);return}if(gL(),a&&W.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes(`long-animation-frame`)?f1():i&&d1(),o&&p1(),C&&n){let e=()=>{re=KP()};addEventListener(`click`,e,{capture:!0}),addEventListener(`keydown`,e,{capture:!0,passive:!0})}function t(){let t=a8(e);t&&!YI(t).timestamp&&(X&&G.log(`[Tracing] Finishing current active span with op: ${YI(t).op}`),t.setAttribute(HF,`cancelled`),t.end())}e.on(`startNavigationSpan`,(n,r)=>{if(q()!==e)return;if(r?.isRedirect){X&&G.warn(`[Tracing] Detected redirect, navigation span will not be the root span, but a child span.`),ae(e,{op:`navigation.redirect`,...n},!1,r.url);return}re=void 0,t(),MF().setPropagationContext({traceId:tF(),sampleRand:Math.random(),propagationSpanId:_L()?void 0:nF()});let i=K();i.setPropagationContext({traceId:tF(),sampleRand:Math.random(),propagationSpanId:_L()?void 0:nF()}),i.setSDKProcessingMetadata({normalizedRequest:void 0}),ae(e,{op:`navigation`,...n,parentSpan:null,forceTransaction:!0},!0,r?.url)}),e.on(`startPageLoadSpan`,(n,r={})=>{if(q()!==e)return;t();let i=FI(r.sentryTrace||n8(`sentry-trace`)||r8(`sentry-trace`),r.baggage||n8(`baggage`)||r8(`baggage`)),a=K();a.setPropagationContext(i),_L()||(a.getPropagationContext().propagationSpanId=nF()),a.setSDKProcessingMetadata({normalizedRequest:XZ()}),ae(e,{op:`pageload`,...n})}),e.on(`endPageloadSpan`,()=>{ee&&ie&&(ie.setAttribute(HF,`reportPageLoaded`),ie.end())})},afterAllSetup(e){if(ne)return;e.addIntegration&&!e.getIntegrationByName?.(`WebVitals`)&&e.addIntegration(Y6({ignore:r?[]:[`inp`],_experiments:{enableStandaloneClsSpans:s,enableStandaloneLcpSpans:c}}));let n=IJ();if(w!==`off`&&Ppe(e,{linkPreviousTrace:w,consistentTraceSampling:T}),J.location){if(x){let t=YP();e8(e,{name:J.location.pathname,startTime:t?t/1e3:void 0,attributes:{[LF]:`url`,[VF]:`auto.pageload.browser`}})}S&&c0(({to:t,from:r})=>{if(r===void 0&&n?.indexOf(t)!==-1){n=void 0;return}n=void 0;let i=ZV(t),a=a8(e),o=a&&C&&Hpe(a,re);t8(e,{name:i?.pathname||J.location.pathname,attributes:{[LF]:`url`,[VF]:`auto.navigation.browser`}},{url:t,isRedirect:o})})}p&&Mpe(),o&&Vpe(e,u,d,f,t),W6(e,{traceFetch:m,traceXHR:h,tracePropagationTargets:e.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:_,enableHTTPTimings:v,onRequestSpanStart:E,onRequestSpanEnd:te}),g&&e.addIntegration(J6())}}});function e8(e,t,n){e.emit(`startPageLoadSpan`,t,n),K().setTransactionName(t.name);let r=a8(e);return r&&e.emit(`afterStartPageLoadSpan`,r),r}function t8(e,t,n){let{url:r,isRedirect:i}=n||{};e.emit(`beforeStartNavigationSpan`,t,{isRedirect:i,url:r}),e.emit(`startNavigationSpan`,t,{isRedirect:i,url:r});let a=K();return a.setTransactionName(t.name),r&&!i&&a.setSDKProcessingMetadata({normalizedRequest:{...XZ(),url:r}}),a8(e)}function n8(e){return(J.document?.querySelector(`meta[name=${e}]`))?.getAttribute(`content`)||void 0}function r8(e){return(J.performance?.getEntriesByType?.(`navigation`)[0])?.serverTiming?.find(t=>t.name===e)?.description}function Vpe(e,t,n,r,i){let a=J.document,o;a&&addEventListener(`click`,()=>{let a=`ui.action.click`,s=a8(e);if(s){let e=YI(s).op;if([`navigation`,`pageload`].includes(e)){X&&G.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&=(o.setAttribute(HF,`interactionInterrupted`),o.end(),void 0),!i.name){X&&G.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=zR({name:i.name,op:a,attributes:{[LF]:i.source||`url`}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})},{capture:!0})}var i8=`_sentry_idleSpan`;function a8(e){return e[i8]}function o8(e,t){eP(e,i8,t)}var s8=1.5;function Hpe(e,t){let n=YI(e),r=UP();return!(r-n.start_timestamp>s8||t&&r-t<=s8)}function Upe(e=q()){e?.emit(`endPageloadSpan`)}function Wpe(e){let t=fL();if(t===e)return;let n=K();e.end=new Proxy(e.end,{apply(e,r,i){return oF(n,t),Reflect.apply(e,r,i)}}),oF(n,e)}var Gpe=xB(()=>({name:`SpanStreaming`,beforeSetup(e){let t=e.getOptions();t.traceLifecycle||=(X&&G.log('[SpanStreaming] setting `traceLifecycle` to "stream"'),`stream`)},setup(e){let t=`SpanStreaming integration requires`,n=`Falling back to static trace lifecycle.`,r=e.getOptions();if(!iR(e)){r.traceLifecycle=`static`,X&&G.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let i=r.beforeSendSpan;if(i&&!PL(i)){r.traceLifecycle=`static`,X&&G.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let a=new pJ(e);e.on(`afterSpanEnd`,t=>{tL(t)&&a.add(dz(t,e))}),e.on(`afterSegmentSpanEnd`,e=>{let t=e.spanContext().traceId;setTimeout(()=>{a.flush(t)},500)})}})),c8=1e6,Kpe=`window`in W&&W.window===W&&typeof importScripts>`u`,l8=`0`,u8=Kpe?`main`:`worker`,d8=J.navigator,f8=``,p8=``,m8=``,h8=d8?.userAgent||``,g8=``,qpe=d8?.language||d8?.languages?.[0]||``;function Jpe(e){return typeof e==`object`&&!!e&&`getHighEntropyValues`in e}var _8=d8?.userAgentData;Jpe(_8)&&_8.getHighEntropyValues([`architecture`,`model`,`platform`,`platformVersion`,`fullVersionList`]).then(e=>{if(f8=e.platform||``,m8=e.architecture||``,g8=e.model||``,p8=e.platformVersion||``,e.fullVersionList?.length){let t=e.fullVersionList[e.fullVersionList.length-1];h8=`${t.brand} ${t.version}`}}).catch(e=>void 0);function Ype(e){return!(`thread_metadata`in e)}function Xpe(e){return Ype(e)?nme(e):e}function Zpe(e){let t=e.contexts?.trace?.trace_id;return typeof t==`string`&&t.length!==32&&X&&G.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t==`string`?t:``}function Qpe(e,t,n,r){if(r.type!==`transaction`)throw TypeError(`Profiling events may only be attached to transactions, this should never occur.`);if(n==null)throw TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);let i=Zpe(r),a=Xpe(n),o=t||(typeof r.start_timestamp==`number`?r.start_timestamp*1e3:KP()*1e3),s=typeof r.timestamp==`number`?r.timestamp*1e3:KP()*1e3;return{event_id:e,timestamp:new Date(o).toISOString(),platform:`javascript`,version:`1`,release:r.release||``,environment:r.environment||`production`,runtime:{name:`javascript`,version:J.navigator.userAgent},os:{name:f8,version:p8,build_number:h8},device:{locale:qpe,model:g8,manufacturer:h8,architecture:m8,is_emulator:!1},debug_meta:{images:y8(n.resources)},profile:a,transactions:[{name:r.transaction||``,id:r.event_id||PP(),trace_id:i,active_thread_id:l8,relative_start_ns:`0`,relative_end_ns:((s-o)*1e6).toFixed(0)}]}}function $pe(e,t,n){if(e==null)throw TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);let r=tme(e),i=t.getOptions(),a=t.getSdkMetadata?.()?.sdk;return{chunk_id:PP(),client_sdk:{name:a?.name??`sentry.javascript.browser`,version:a?.version??`0.0.0`},profiler_id:n||PP(),platform:`javascript`,version:`2`,release:i.release??``,environment:i.environment??`production`,debug_meta:{images:y8(e.resources)},profile:r}}function eme(e){try{if(!e||typeof e!=`object`)return{reason:`chunk is not an object`};let t=e=>typeof e==`string`&&/^[a-f0-9]{32}$/.test(e);if(!t(e.profiler_id))return{reason:`missing or invalid profiler_id`};if(!t(e.chunk_id))return{reason:`missing or invalid chunk_id`};if(!e.client_sdk)return{reason:`missing client_sdk metadata`};let 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(e){return{reason:`unknown validation error: ${e}`}}}function tme(e){let t=[];for(let n=0;n<e.frames.length;n++){let r=e.frames[n];r&&(t[n]={function:r.name,abs_path:typeof r.resourceId==`number`?e.resources[r.resourceId]:void 0,lineno:r.line,colno:r.column})}let n=[];for(let t=0;t<e.stacks.length;t++){let r=e.stacks[t];if(!r)continue;let i=[],a=r;for(;a;)i.push(a.frameId),a=a.parentId===void 0?void 0:e.stacks[a.parentId];n[t]=i}let r=YP(),i=typeof performance.timeOrigin==`number`?performance.timeOrigin:r||0,a=i-(r||i),o=[];for(let t=0;t<e.samples.length;t++){let n=e.samples[t];if(!n)continue;let r=(i+(n.timestamp-a))/1e3;o[t]={stack_id:n.stackId??0,thread_id:l8,timestamp:r}}return{frames:t,stacks:n,samples:o,thread_metadata:{[l8]:{name:u8}}}}function v8(e){return YI(e).op===`pageload`}function nme(e){let t,n=0,r={samples:[],stacks:[],frames:[],thread_metadata:{[l8]:{name:u8}}},i=e.samples[0];if(!i)return r;let a=i.timestamp,o=YP(),s=typeof performance.timeOrigin==`number`?performance.timeOrigin:o||0,c=s-(o||s);return e.samples.forEach((i,o)=>{if(i.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[o]={elapsed_since_start_ns:((i.timestamp+c-a)*c8).toFixed(0),stack_id:t,thread_id:l8};return}let s=e.stacks[i.stackId],l=[];for(;s;){l.push(s.frameId);let t=e.frames[s.frameId];t&&r.frames[s.frameId]===void 0&&(r.frames[s.frameId]={function:t.name,abs_path:typeof t.resourceId==`number`?e.resources[t.resourceId]:void 0,lineno:t.line,colno:t.column}),s=s.parentId===void 0?void 0:e.stacks[s.parentId]}let u={elapsed_since_start_ns:((i.timestamp+c-a)*c8).toFixed(0),stack_id:n,thread_id:l8};r.stacks[n]=l,r.samples[o]=u,n++}),r}function rme(e,t){if(!t.length)return e;for(let n of t)e[1].push([{type:`profile`},n]);return e}function ime(e){let t=[];return LL(e,(e,n)=>{if(n===`transaction`)for(let n=1;n<e.length;n++)e[n]?.contexts?.profile?.profile_id&&t.push(e[n])}),t}function y8(e){let t=q()?.getOptions()?.stackParser;return t?Az(t,e):[]}function b8(e){return typeof e!=`number`&&typeof e!=`boolean`||typeof e==`number`&&isNaN(e)?(X&&G.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):e===!0||e===!1?!0:e<0||e>1?(X&&G.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function ame(e){return e.samples.length<2?(X&&G.log(`[Profiling] Discarding profile because it contains less than 2 samples`),!1):e.frames.length?!0:(X&&G.log(`[Profiling] Discarding profile because it contains no frames`),!1)}var x8=!1,S8=3e4;function ome(e){return typeof e==`function`}function C8(){let e=J.Profiler;if(!ome(e)){X&&G.log(`[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.`);return}let t=Math.floor(S8/10);try{return new e({sampleInterval:10,maxBufferSize:t})}catch{X&&(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.`)),x8=!0}}function w8(e){if(x8)return X&&G.log(`[Profiling] Profiling has been disabled for the duration of the current user session.`),!1;if(!e.isRecording())return X&&G.log(`[Profiling] Discarding profile because root span was not sampled.`),!1;let t=q()?.getOptions();if(!t)return X&&G.log(`[Profiling] Profiling disabled, no options found.`),!1;let n=t.profilesSampleRate;return b8(n)?n?n===!0||Math.random()<n||(X&&G.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(n)})`),!1):(X&&G.log(`[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0`),!1):(X&&G.warn(`[Profiling] Discarding profile because of invalid sample rate.`),!1)}function sme(e){if(x8)return X&&G.log(`[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started.`),!1;if(e.profileLifecycle!==`trace`&&e.profileLifecycle!==`manual`)return X&&G.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;let t=e.profileSessionSampleRate;return b8(t)?t?Math.random()<=t:(X&&G.log(`[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0`),!1):(X&&G.warn(`[Profiling] Discarding profile because of invalid profileSessionSampleRate.`),!1)}function T8(e){return e.profilesSampleRate!==void 0}function cme(e,t,n,r){return ame(n)?Qpe(e,t,n,r):null}var E8=new Map;function lme(){return E8.size}function ume(e){let t=E8.get(e);return t&&E8.delete(e),t}function dme(e,t){if(E8.set(e,t),E8.size>30){let e=E8.keys().next().value;e!==void 0&&E8.delete(e)}}var D8=new WeakSet;function O8(e){e.setAttribute(`thread.id`,l8),e.setAttribute(`thread.name`,u8)}function k8(e){let t;v8(e)&&(t=KP()*1e3);let n=C8();if(!n)return;X&&G.log(`[Profiling] started profiling span: ${YI(e).description}`);let r=PP(),i=null;K().setContext(`profile`,{profile_id:r,start_timestamp:t}),D8.add(e),O8(e);async function a(){if(e&&n){if(i){X&&G.log(`[Profiling] profile for:`,YI(e).description,`already exists, returning early`);return}return n.stop().then(t=>{if(o&&=(J.clearTimeout(o),void 0),X&&G.log(`[Profiling] stopped profiling of span: ${YI(e).description}`),!t){X&&G.log(`[Profiling] profiler returned null profile for: ${YI(e).description}`,`this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started`);return}i=t,dme(r,t)}).catch(e=>{X&&G.log(`[Profiling] error while stopping profiler:`,e)})}}let o=J.setTimeout(()=>{X&&G.log(`[Profiling] max profile duration elapsed, stopping profiling for:`,YI(e).description),a()},S8),s=e.end.bind(e);function c(){return e?(a().then(()=>{s()},()=>{s()}),e):s()}e.end=c}var fme=6e4,pme=3e5,mme=class{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(e){let t=e.getOptions().profileLifecycle,n=sme(e.getOptions());X&&G.log(`[Profiling] Initializing profiler (lifecycle='${t}').`),n||X&&G.log(`[Profiling] Session not sampled. Skipping lifecycle profiler initialization.`),this._profilerId=PP(),this._client=e,this._sessionSampled=n,this._lifecycleMode=t,t===`trace`&&this._setupTraceLifecycleListeners(e),e.on(`spanStart`,e=>{this._isRunning&&O8(e)})}start(){if(this._lifecycleMode===`trace`){X&&G.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){X&&G.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){X&&G.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode===`trace`){X&&G.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){X&&G.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");return}this._endProfiling()}notifyRootSpanActive(e){if(this._lifecycleMode!==`trace`||!this._sessionSampled)return;let t=e.spanContext().spanId;if(!t||this._activeRootSpanIds.has(t))return;this._registerTraceRootSpan(t);let n=this._activeRootSpanIds.size;n===1&&(X&&G.log(`[Profiling] Detected already active root span during setup. Active root spans now:`,n),this._beginProfiling()),this._isRunning&&O8(e)}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,X&&G.log(`[Profiling] Started profiling with profiler ID:`,this._profilerId),NF().setContext(`profile`,{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){X&&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),void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(e=>{X&&G.error("[Profiling] Failed to collect current profile chunk on `stop()`:",e)}),this._lifecycleMode===`manual`&&NF().setContext(`profile`,{}))}_setupTraceLifecycleListeners(e){e.on(`spanStart`,e=>{if(!this._sessionSampled){X&&G.log(`[Profiling] Span not profiled because of negative sampling decision for user session.`);return}if(e!==uL(e))return;if(!e.isRecording()){X&&G.log(`[Profiling] Discarding profile because root span was not sampled.`);return}let t=e.spanContext().spanId;if(!t||this._activeRootSpanIds.has(t))return;this._registerTraceRootSpan(t);let n=this._activeRootSpanIds.size;n===1&&(X&&G.log(`[Profiling] Root span ${t} started. Profiling active while there are active root spans (count=${n}).`),this._beginProfiling())}),e.on(`spanEnd`,e=>{if(!this._sessionSampled)return;let t=e.spanContext().spanId;if(!t||!this._activeRootSpanIds.has(t))return;this._activeRootSpanIds.delete(t);let n=this._activeRootSpanIds.size;X&&G.log(`[Profiling] Root span with ID ${t} ended. Will continue profiling for as long as there are active root spans (currently: ${n}).`),n===0&&(this._collectCurrentChunk().catch(e=>{X&&G.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",e)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,NF().setContext(`profile`,{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(e=>clearTimeout(e)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(e){this._activeRootSpanIds.add(e);let t=setTimeout(()=>this._onRootSpanTimeout(e),pme);this._rootSpanTimeouts.set(e,t)}_startProfilerInstance(){if(this._profiler?.stopped===!1)return;let e=C8();if(!e){X&&G.log(`[Profiling] Failed to start JS Profiler.`);return}this._profiler=e}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(e=>{X&&G.error(`[Profiling] Failed to collect current profile chunk during periodic chunking:`,e)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},fme))}_onRootSpanTimeout(e){this._rootSpanTimeouts.has(e)&&(this._rootSpanTimeouts.delete(e),this._activeRootSpanIds.has(e)&&(X&&G.log(`[Profiling] Reached 5-minute timeout for root span ${e}. You likely started a manual root span that never called \`.end()\`.`),this._activeRootSpanIds.delete(e),this._activeRootSpanIds.size===0&&this._endProfiling()))}async _collectCurrentChunk(){let e=this._profiler;if(this._profiler=void 0,e)try{let t=$pe(await e.stop(),this._client,this._profilerId),n=eme(t);if(`reason`in n){X&&G.log(`[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):`,n.reason);return}this._sendProfileChunk(t),X&&G.log(`[Profiling] Collected browser profile chunk.`)}catch(e){X&&G.log(`[Profiling] Error while stopping JS Profiler for chunk:`,e)}}_sendProfileChunk(e){let t=this._client,n=qL(t.getSdkMetadata?.()),r=t.getDsn(),i=t.getOptions().tunnel,a=FL({event_id:PP(),sent_at:new Date().toISOString(),...n&&{sdk:n},...!!i&&r&&{dsn:TI(r)}},[[{type:`profile_chunk`,platform:`javascript`},e]]);t.sendEnvelope(a).then(null,e=>{X&&G.error(`Error while sending profile chunk envelope:`,e)})}},hme=`BrowserProfiling`,gme=xB((()=>({name:hme,setup(e){let t=e.getOptions(),n=new mme;if(!T8(t)&&!t.profileLifecycle&&(t.profileLifecycle=`manual`),T8(t)&&!t.profilesSampleRate){X&&G.log(`[Profiling] Profiling disabled, no profiling options found.`);return}let r=fL(),i=r&&uL(r);if(T8(t)&&t.profileSessionSampleRate!==void 0&&X&&G.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),T8(t))i&&v8(i)&&w8(i)&&k8(i),e.on(`spanStart`,e=>{let t=uL(e);e===t?w8(e)&&k8(e):D8.has(t)&&O8(e)}),e.on(`beforeEnvelope`,e=>{if(!lme())return;let t=ime(e);if(!t.length)return;let n=[];for(let e of t){let t=e?.contexts,r=t?.profile?.profile_id,i=t?.profile?.start_timestamp;if(typeof r!=`string`){X&&G.log(`[Profiling] cannot find profile for a span without a profile context`);continue}if(!r){X&&G.log(`[Profiling] cannot find profile for a span without a profile context`);continue}t?.profile&&delete t.profile;let a=ume(r);if(!a){X&&G.log(`[Profiling] Could not retrieve profile for span: ${r}`);continue}let o=cme(r,i,a,e);o&&n.push(o)}rme(e,n)});else{let r=t.profileLifecycle;if(e.on(`startUIProfiler`,()=>n.start()),e.on(`stopUIProfiler`,()=>n.stop()),r===`manual`)n.initialize(e);else if(r===`trace`){if(!_L(t)){X&&G.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}n.initialize(e),i&&n.notifyRootSpanActive(i),J.setTimeout(()=>{let e=fL(),t=e&&uL(e);t&&n.notifyRootSpanActive(t)},0)}}}}))),_me=`SpotlightBrowser`,vme=[{op:`ui.interaction.click`,name:`#sentry-spotlight`}],yme=((e={})=>{let t=e.sidecarUrl||`http://localhost:8969/stream`;return{name:_me,setup:()=>{X&&G.log(`Using Sidecar URL`,t)},beforeSetup(e){let t=e.getOptions();t.ignoreSpans=[...t.ignoreSpans||[],...vme]},afterAllSetup:e=>{bme(e,t)}}});function bme(e,t){let n=f0(`fetch`),r=0;e.on(`beforeEnvelope`,e=>{if(r>3){G.warn(`[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:`,r);return}n(t,{method:`POST`,body:BL(e),headers:{"Content-Type":`application/x-sentry-envelope`},mode:`cors`}).then(e=>{e.status>=200&&e.status<400&&(r=0)},e=>{r++,G.error(`Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/`,e)})})}var xme=xB(yme),Sme=xB(()=>({name:`LaunchDarkly`,processEvent(e,t,n){return rW(e)}}));function Cme(){return{name:`sentry-flag-auditor`,type:`flag-used`,synchronous:!0,method:(e,t,n)=>{iW(e,t.value),oW(e,t.value)}}}var wme=xB(()=>({name:`OpenFeature`,processEvent(e,t,n){return rW(e)}})),Tme=class{after(e,t){iW(t.flagKey,t.value),oW(t.flagKey,t.value)}error(e,t,n){iW(e.flagKey,e.defaultValue),oW(e.flagKey,e.defaultValue)}},Eme=xB(({featureFlagClientClass:e})=>({name:`Unleash`,setupOnce(){let t=e.prototype;$N(t,`isEnabled`,Dme)},processEvent(e,t,n){return rW(e)}}));function Dme(e){return function(...t){let n=t[0],r=e.apply(this,t);return typeof n==`string`&&typeof r==`boolean`?(iW(n,r),oW(n,r)):X&&G.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}var Ome=(({growthbookClass:e})=>cW({growthbookClass:e})),kme=xB(({featureFlagClient:e})=>({name:`Statsig`,setup(t){e.on(`gate_evaluation`,e=>{iW(e.gate.name,e.gate.value),oW(e.gate.name,e.gate.value)})},processEvent(e,t,n){return rW(e)}})),Ame=`WebWorker`,jme=xB(({worker:e})=>({name:Ame,setupOnce:()=>{(Array.isArray(e)?e:[e]).forEach(e=>A8(e))},addWorker:e=>A8(e)}));function A8(e){e.addEventListener(`message`,e=>{if(Pme(e.data)){if(e.stopImmediatePropagation(),e.data._sentryDebugIds&&(X&&G.log(`Sentry debugId web worker message received`,e.data),J._sentryDebugIds={...e.data._sentryDebugIds,...J._sentryDebugIds}),e.data._sentryModuleMetadata&&(X&&G.log(`Sentry module metadata web worker message received`,e.data),J._sentryModuleMetadata={...e.data._sentryModuleMetadata,...J._sentryModuleMetadata}),e.data._sentryWasmImages){X&&G.log(`Sentry WASM images web worker message received`,e.data);let t=J._sentryWasmImages||[],n=e.data._sentryWasmImages.filter(e=>KN(e)&&typeof e.code_file==`string`&&!t.some(t=>t.code_file===e.code_file));J._sentryWasmImages=[...t,...n]}e.data._sentryWorkerError&&(X&&G.log(`Sentry worker rejection message received`,e.data._sentryWorkerError),Mme(e.data._sentryWorkerError))}})}function Mme(e){let t=q();if(!t)return;let n=t.getOptions().stackParser,r=t.getOptions().attachStacktrace,i=e.reason,a=GN(i)?$0(i):_Q(n,i,void 0,r,!0);a.level=`error`,e.filename&&(a.contexts={...a.contexts,worker:{filename:e.filename}}),Wz(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.web_worker.onunhandledrejection`}}),X&&G.log(`Captured worker unhandled rejection`,i)}function Nme({self:e}){e.postMessage({_sentryMessage:!0,_sentryDebugIds:e._sentryDebugIds??void 0,_sentryModuleMetadata:e._sentryModuleMetadata??void 0}),e.addEventListener(`unhandledrejection`,t=>{let n={reason:Q0(t),filename:e.location?.href};e.postMessage({_sentryMessage:!0,_sentryWorkerError:n}),X&&G.log(`[Sentry Worker] Forwarding unhandled rejection to parent`,n)}),X&&G.log(`[Sentry Worker] Registered worker with unhandled rejection handling`)}function Pme(e){if(!KN(e)||e._sentryMessage!==!0)return!1;let t=`_sentryDebugIds`in e,n=`_sentryModuleMetadata`in e,r=`_sentryWorkerError`in e,i=`_sentryWasmImages`in e;return!(!t&&!n&&!r&&!i||t&&!(KN(e._sentryDebugIds)||e._sentryDebugIds===void 0)||n&&!(KN(e._sentryModuleMetadata)||e._sentryModuleMetadata===void 0)||r&&!KN(e._sentryWorkerError)||i&&(!Array.isArray(e._sentryWasmImages)||!e._sentryWasmImages.every(e=>KN(e)&&typeof e.code_file==`string`)))}var Fme=50,[,Ime]=R0,[,Lme]=MJ(),j8=(e,t=0)=>{let n=[];for(let r of e.split(`
|
|
1004
|
+
`).slice(t)){let e=Ime(r),t=Lme(r);if(e&&t?.in_app!==!1?n.push(e):t&&(t.module===void 0&&delete t.module,n.push(t)),n.length>=Fme)break}return bN(n)},Rme=xB(e=>{let t=e?.threshold??1e3,n=e?.pollInterval||t/2;return{name:`EventLoopBlockRenderer`,setup(r){let i={pollInterval:n,anrThreshold:t,captureStackTrace:!0,...e},a=UJ(r);a.sendStatus({status:document.visibilityState,config:i}),setInterval(()=>{a.sendStatus({status:`alive`,config:i})},i.pollInterval)}}});function M8(){let e=NF().getScopeData(),t=MF().getScopeData(),n=K().getScopeData();return nz(e,t),nz(e,n),e.eventProcessors=[],e}function zme(e){MF().addScopeListener(t=>{e(M8(),t)}),K().addScopeListener(t=>{e(M8(),t)}),NF().addScopeListener(t=>{e(M8(),t)})}var N8=xB(()=>({name:`ScopeToMain`,setup(e){let t=UJ(e);zme((e,n)=>{t.sendScope(JSON.stringify(_P(e,20,2e3))),n.clearBreadcrumbs(),n.clearAttachments()})}}));function P8(e){let t;return uV(e,async e=>(t||=UJ(),t.sendEnvelope(e.body),{statusCode:200}))}function F8(e){return[...a2(e).filter(e=>e.name!==`BrowserSession`&&e.name!==`CultureContext`),N8()]}function I8(e={},t=Vce){if(window?.__SENTRY__RENDERER_INIT__){G.warn(`The browser SDK has already been initialized.
|
|
1005
|
+
If init has been called in the preload and contextIsolation is disabled, is not required to call init in the renderer`);return}window.__SENTRY__RENDERER_INIT__=!0,e.sendClientReports=!1,e.defaultIntegrations===void 0&&(e.defaultIntegrations=F8(e)),e.stackParser===void 0&&(e.stackParser=j8),e.ipcNamespace===void 0&&(e.ipcNamespace=`sentry-ipc`),e.dsn===void 0&&(e.dsn=`https://12345@dummy.dsn/12345`),e.transport===void 0&&(e.transport=P8),delete e.initialScope,t(e)}var L8=e({BrowserClient:()=>SQ,MULTIPLEXED_TRANSPORT_EXTRA_KEY:()=>WV,OpenFeatureIntegrationHook:()=>Tme,SEMANTIC_ATTRIBUTE_SENTRY_OP:()=>BF,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:()=>VF,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:()=>RF,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:()=>LF,Scope:()=>lF,addBreadcrumb:()=>hH,addEventProcessor:()=>rB,addIntegration:()=>bB,bindScopeToEmitter:()=>qR,breadcrumbsIntegration:()=>K0,browserApiErrorsIntegration:()=>q0,browserProfilingIntegration:()=>gme,browserSessionIntegration:()=>Y0,browserTracingIntegration:()=>$6,buildLaunchDarklyFlagUsedHandler:()=>Cme,captureConsoleIntegration:()=>QH,captureEvent:()=>Wz,captureException:()=>Hz,captureFeedback:()=>xW,captureMessage:()=>Uz,captureSession:()=>sB,chromeStackLineParser:()=>R0,consoleLoggingIntegration:()=>OW,contextLinesIntegration:()=>ole,continueTrace:()=>yR,createConsolaReporter:()=>MW,createLangChainCallbackHandler:()=>Bq,createTransport:()=>uV,createUserFeedbackEnvelope:()=>U0,dedupeIntegration:()=>tU,defaultRequestInstrumentationOptions:()=>U6,defaultStackParser:()=>j8,elementTimingIntegration:()=>P1,endSession:()=>aB,eventFiltersIntegration:()=>xH,eventFromException:()=>hQ,eventFromMessage:()=>gQ,eventLoopBlockIntegration:()=>Rme,exceptionFromError:()=>aQ,extraErrorDataIntegration:()=>lU,featureFlagsIntegration:()=>sW,feedbackAsyncIntegration:()=>rQ,feedbackIntegration:()=>iQ,feedbackSyncIntegration:()=>iQ,fetchStreamPerformanceIntegration:()=>J6,forceLoad:()=>Hce,functionToStringIntegration:()=>vH,getAbsoluteUrl:()=>T0,getActiveSpan:()=>fL,getClient:()=>q,getCurrentScope:()=>K,getDefaultIntegrations:()=>F8,getFeedback:()=>ZY,getGlobalScope:()=>NF,getIsolationScope:()=>MF,getReplay:()=>npe,getRootSpan:()=>uL,getSpanDescendants:()=>lL,getSpanStatusFromHttpCode:()=>iI,getTraceData:()=>dH,globalHandlersIntegration:()=>Z0,graphqlClientIntegration:()=>mle,growthbookIntegration:()=>Ome,httpClientIntegration:()=>Jce,httpContextIntegration:()=>n2,inboundFiltersIntegration:()=>SH,init:()=>I8,instrumentAnthropicAiClient:()=>tq,instrumentCreateReactAgent:()=>oJ,instrumentGoogleGenAIClient:()=>_q,instrumentLangChainEmbeddings:()=>Gq,instrumentLangGraph:()=>sJ,instrumentOpenAiClient:()=>jK,instrumentOutgoingRequests:()=>W6,instrumentSupabaseClient:()=>LU,isBotUserAgent:()=>Q6,isEnabled:()=>nB,isInitialized:()=>tB,lastEventId:()=>eB,launchDarklyIntegration:()=>Sme,linkedErrorsIntegration:()=>r2,logger:()=>WJ,makeRendererTransport:()=>P8,metrics:()=>QJ,moduleMetadataIntegration:()=>GH,normalizeStringifyValue:()=>i2,onLoad:()=>Uce,openFeatureIntegration:()=>wme,parameterize:()=>sH,registerSpanErrorInstrumentation:()=>gL,registerWebWorker:()=>Nme,replayCanvasIntegration:()=>xpe,replayIntegration:()=>p6,reportPageLoaded:()=>Upe,reportingObserverIntegration:()=>Kce,rewriteFramesIntegration:()=>bU,scopeToMainIntegration:()=>N8,sendFeedback:()=>FY,setActiveSpanInBrowser:()=>Wpe,setAttribute:()=>Zz,setAttributes:()=>Xz,setContext:()=>Gz,setConversationId:()=>$z,setCurrentClient:()=>UV,setExtra:()=>qz,setExtras:()=>Kz,setHttpStatus:()=>aI,setMeasurement:()=>tR,setTag:()=>Yz,setTags:()=>Jz,setUser:()=>Qz,showReportDialog:()=>o2,spanStreamingIntegration:()=>Gpe,spanToBaggageHeader:()=>ML,spanToJSON:()=>YI,spanToTraceHeader:()=>UI,spotlightBrowserIntegration:()=>xme,startBrowserTracingNavigationSpan:()=>t8,startBrowserTracingPageLoadSpan:()=>e8,startInactiveSpan:()=>_R,startNewTrace:()=>CR,startSession:()=>iB,startSpan:()=>hR,startSpanManual:()=>gR,statsigIntegration:()=>kme,supabaseIntegration:()=>BU,suppressTracing:()=>xR,thirdPartyErrorFilterIntegration:()=>YU,uiProfiler:()=>A0,unleashIntegration:()=>Eme,updateSpanName:()=>mL,viewHierarchyIntegration:()=>hle,webVitalsIntegration:()=>Y6,webWorkerIntegration:()=>jme,withActiveSpan:()=>bR,withIsolationScope:()=>FF,withScope:()=>PF,withStreamedSpan:()=>NL,zodErrorsIntegration:()=>JU}),Bme=100,Vme=5,Hme=[`ResizeObserver loop completed with undelivered notifications.`,`ResizeObserver loop limit exceeded`,`AbortError`,`The user aborted a request.`,`Network request failed`,`NetworkError when attempting to fetch resource.`,`Failed to fetch`,`ChunkLoadError`,`Loading chunk`,`Loading CSS chunk`,`Non-Error promise rejection captured with value: Object Not Found Matching Id`];function R8(e){if(e)for(let t of Object.keys(e))/token|secret|password|api[_-]?key/i.test(t)&&(e[t]=`[redacted]`)}function Ume(e){e.request?.url&&(e.request.url=e.request.url.replace(/([?&](?:code|token|access_token|state)=)[^&]+/gi,`$1[redacted]`)),R8(e.extra),R8(e.tags)}function Wme(e){let t=B8(e.version)??`0.0.0`,n=B8(e.commitHash);return n?`${e.appName}@${t}+${n}`:`${e.appName}@${t}`}function z8(e,t){for(let n of t){let t=B8(e[n]);if(t)return t}}function Gme(e){return V8(e.enabled)??e.defaultEnabled??!1}function Kme(e){let t=B8(e.dsn);return!t||Gme(e)===!1?null:{dsn:t,environment:B8(e.environment)??B8(e.defaultEnvironment)??`production`,release:B8(e.release)??B8(e.defaultRelease)??void 0,debug:V8(e.debug)??e.defaultDebug??!1,tracesSampleRate:U8(e.tracesSampleRate,e.defaultTracesSampleRate??.1),profilesSampleRate:H8(e.profilesSampleRate,e.defaultProfilesSampleRate),replaysSessionSampleRate:H8(e.replaysSessionSampleRate,e.defaultReplaysSessionSampleRate),replaysOnErrorSampleRate:H8(e.replaysOnErrorSampleRate,e.defaultReplaysOnErrorSampleRate),attachStacktrace:!0,maxBreadcrumbs:Bme,normalizeDepth:Vme,tags:qme(e)}}function qme(e){let t={app:e.appName,runtime:e.runtime};for(let[n,r]of Object.entries(e.tags??{})){let e=B8(r);e&&(t[n]=e)}return t}function B8(e){if(e==null)return null;let t=e.trim();return t.length>0?t:null}function V8(e){if(typeof e==`boolean`)return e;let t=B8(e);if(t){if(t===`1`||t.toLowerCase()===`true`)return!0;if(t===`0`||t.toLowerCase()===`false`)return!1}}function H8(e,t){if(t!==void 0||e!==void 0)return U8(e,t??0)}function U8(e,t){let n=Jme(e);return n===null||n<0||n>1?t:n}function Jme(e){if(typeof e==`number`)return Number.isFinite(e)?e:null;let t=B8(e);if(!t)return null;let n=Number.parseFloat(t);return Number.isFinite(n)?n:null}function Yme(e){let t=(0,He.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=ge(tt,`bg-background text-foreground`),t[0]=n):n=t[0];let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=ge(Qe,`pl-1 md:pl-2.5`),t[1]=r):r=t[1];let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,it.jsx)(ot,{}),t[2]=i):i=t[2];let a;t[3]===e.onGoToNewChat?a=t[4]:(a=(0,it.jsx)(`div`,{className:r,children:(0,it.jsx)(`button`,{type:`button`,"aria-label":`Go to new chat`,onClick:e.onGoToNewChat,className:`${$e} hover:bg-accent/70`,children:i})}),t[3]=e.onGoToNewChat,t[4]=a);let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,it.jsx)(`div`,{}),t[5]=o):o=t[5];let s;t[6]===a?s=t[7]:(s=(0,it.jsxs)(`header`,{className:Ze,children:[a,o]}),t[6]=a,t[7]=s);let c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,it.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-4`,children:(0,it.jsxs)(`div`,{className:`max-w-md rounded-xl border border-border bg-card p-6 text-center shadow-lg`,children:[(0,it.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:`Something went wrong.`}),(0,it.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Forge hit an unexpected error and reported it.`}),(0,it.jsx)(`button`,{className:`mt-4 inline-flex rounded-md border border-border px-3 py-2 text-sm font-medium hover:bg-accent`,onClick:Xme,type:`button`,children:`Reload app`})]})}),t[8]=c):c=t[8];let l;return t[9]===s?l=t[10]:(l=(0,it.jsxs)(`div`,{className:n,children:[s,c]}),t[9]=s,t[10]=l),l}function Xme(){return window.location.reload()}var Zme=[/\bDeepSeek\b/i,/\bKimi\b/i,/\bMoonshot\b/i,/\bdeepseek[-._a-z0-9]*\b/i,/\bkimi[-._a-z0-9]*\b/i,/\bmoonshot[-._a-z0-9]*\b/i,/\bAPEX_API_KEY\b/,/\bDEEPSEEK_API_KEY\b/,/\bKIMI_API_KEY\b/,/\bOPENAI_API_KEY\b/,/\bANTHROPIC_API_KEY\b/,/\bCURSOR_API_KEY\b/,/\bOPENCODE_API_KEY\b/,/\bforge_proxy_[A-Za-z0-9._-]+\b/,/\bProviderValidationError\b/,/\/forge-server\/node_modules\//,/https?:\/\/[^\s'"<>)]*\/api\/provider-egress\/[^\s'"<>)]*/i,/https?:\/\/[^\s'"<>)]*(?:apex|deepseek|moonshot|kimi)[^\s'"<>)]*/i],Qme=`CMMD is temporarily unavailable. Check the workspace AI connection and retry.`;function W8(e){if(!e)return!1;let t=e.toLowerCase();return/\b(rate[\s-]?limit|too\s+many\s+requests|usage[ _-]limit|usage_limit_reached|quota|insufficient_quota)\b/.test(t)||/\b429\b/.test(t)}function $me(e){return/\bbound to provider account\b/.test(e)&&/\bcannot use provider account\b/.test(e)?`Forge could not switch this conversation to the selected AI account. Retry the account switch.`:/\bforge_runtime_repairing\b/.test(e)||/\bthis turn was interrupted because the environment is being repaired\b/.test(e)?`This turn was interrupted because the environment is being repaired. Retry after the repair finishes.`:/\bforge_runtime_stopped\b/.test(e)||/\bthis turn was interrupted because the environment was stopped\b/.test(e)?`This turn was interrupted because the environment was stopped. Start the environment and retry.`:null}function ehe(e){if(!e)return null;let t=e.toLowerCase(),n=$me(t);return n===null?/\bforge_provider_model_not_allowed\b/.test(t)||/\bnot\s+scoped\s+to\s+the\s+requested\s+model\b/.test(t)?`The workspace AI credential does not cover the model this turn asked for. Retry, or pick that model for the thread.`:/\bmodel\b[\s\S]*\b(not\s+(found|available|supported)|does\s+not\s+exist|unsupported|invalid|unknown)\b/.test(t)||/\b(unsupported|unknown|invalid)\b[\s\S]*\bmodel\b/.test(t)||/\b(model_not_found|invalid_model|model_not_supported)\b/.test(t)?`The selected model isn't available right now. Pick a different model and retry.`:W8(t)?`The AI service is rate-limited or out of quota. Wait a moment and retry.`:/_credential_reconnect_required\b/.test(t)?`The workspace AI credential needs to be reconnected. Reconnect it in Settings > Providers, then retry.`:/\b(unauthorized|forbidden|authentication\s+(failed|error|required)|invalid\s+api\s+key|expired\s+(token|credential))\b/.test(t)||/\b40[13]\b/.test(t)?`Workspace AI authentication failed. Reconnect the workspace and retry.`:/\b(timed?\s*out|timeout|overloaded|service\s+unavailable)\b/.test(t)||/\b50[234]\b/.test(t)?`The AI service is temporarily overloaded. Retry in a moment.`:null:n}function the(e){return e?Zme.some(t=>t.test(e)):!1}function G8(e,t={}){if(e==null)return null;let n=e.trim();return n.length===0?null:the(n)?ehe(n)??t.fallback??`CMMD is temporarily unavailable. Check the workspace AI connection and retry.`:n}var nhe=[/\bSocketCloseError\b/i,/\bSocketOpenError\b/i,/\bSocketReadError\b/i,/\bRpcClientDefect:\s*Unknown socket error\b/i,/Unable to connect to the Forge server WebSocket\./i,/\bping timeout\b/i];function K8(e){if(typeof e!=`string`)return!1;let t=e.trim();return t.length!==0&&nhe.some(e=>e.test(t))}function q8(e){return K8(e)?null:G8(e,{fallback:Qme})}var rhe=[/^Transport disposed$/,/WebSocket RPC request timed out after \d+ms\./],ihe=`Lost the connection to this Environment. Your message was not sent.`;function ahe(e){return e instanceof Error?K8(e.message)||rhe.some(t=>t.test(e.message.trim()))?ihe:e.message:`Failed to send message.`}var J8=`forge-web`,Y8=[`VITE_SENTRY_ENVIRONMENT`,`MODE`],X8=[`VITE_SENTRY_RELEASE`],ohe=[`VITE_SENTRY_DSN`],she=[`VITE_SENTRY_DEBUG`],che=[`VITE_SENTRY_ENABLED`],lhe=[`VITE_SENTRY_TRACES_SAMPLE_RATE`],uhe=[`VITE_SENTRY_PROFILES_SAMPLE_RATE`],dhe=[`VITE_SENTRY_REPLAYS_SESSION_SAMPLE_RATE`],fhe=[`VITE_SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE`],phe=[`VITE_SENTRY_COMMIT_SHA`,`VITE_COMMIT_SHA`],Z8=!1,Q8={autoInject:!1,colorScheme:`system`,formTitle:`Report a Bug`,themeLight:{accentBackground:`oklch(0.52 0.19 48)`,accentForeground:`#ffffff`,background:`#ffffff`,boxShadow:`0 24px 80px rgba(0, 0, 0, 0.18)`,foreground:`#262626`,outline:`1px solid oklch(0.52 0.19 48)`},themeDark:{accentBackground:`oklch(0.62 0.2 47)`,accentForeground:`#ffffff`,background:`#171717`,boxShadow:`0 24px 80px rgba(0, 0, 0, 0.45)`,foreground:`#f5f5f5`,outline:`1px solid oklch(0.62 0.2 47)`}};function mhe(e){let t=e.exception&&typeof e.exception==`object`&&`values`in e.exception&&Array.isArray(e.exception.values)?e.exception.values:[];return[typeof e.title==`string`?e.title:void 0,...t.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e;return[typeof t.type==`string`?t.type:void 0,typeof t.value==`string`?t.value:void 0]})]}function hhe(e){return(e.exception&&typeof e.exception==`object`&&`values`in e.exception&&Array.isArray(e.exception.values)?e.exception.values:[]).some(e=>{if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.value!=`string`||!/All fibers interrupted without error/i.test(t.value)?!1:t.stacktrace?.frames?.some(e=>{let t=typeof e.filename==`string`?e.filename:``,n=typeof e.function==`string`?e.function:``;return t.includes(`src/rpc/wsTransport.ts`)&&n===`WsTransport.request`})})}function ghe(e){return mhe(e).some(K8)||hhe(e)}function _he(){let e=new URL(window.location.href);xe?e.hash=`/new`:(e.pathname=`/new`,e.search=``,e.hash=``),window.location.assign(e.toString())}function vhe(){let e=xe?`electron-renderer`:`browser`,t={APP_VERSION:`0.13.4`,BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_INLINE_CSS_ENABLED:`false`,VITE_COMMIT_SHA:``,VITE_HOSTED_APP_CHANNEL:``,VITE_HTTP_URL:``,VITE_SENTRY_COMMIT_SHA:`c7fe2d96f51605b303a42c585157e3bc4d4af889`,VITE_SENTRY_DEBUG:``,VITE_SENTRY_DSN:``,VITE_SENTRY_ENABLED:``,VITE_SENTRY_ENVIRONMENT:`production`,VITE_SENTRY_PROFILES_SAMPLE_RATE:``,VITE_SENTRY_RELEASE:`forge-web@0.13.4+c7fe2d96f51605b303a42c585157e3bc4d4af889`,VITE_SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE:``,VITE_SENTRY_REPLAYS_SESSION_SAMPLE_RATE:``,VITE_SENTRY_TRACES_SAMPLE_RATE:``,VITE_WS_URL:``},n=z8(t,[...X8])??Wme({appName:J8,version:`0.13.4`,commitHash:z8(t,[...phe])});return Kme({appName:J8,runtime:e,defaultEnvironment:z8(t,[...Y8])??`development`,defaultRelease:n,defaultEnabled:!0,defaultTracesSampleRate:0,defaultReplaysSessionSampleRate:0,defaultReplaysOnErrorSampleRate:0,enabled:z8(t,[...che]),dsn:z8(t,[...ohe]),environment:z8(t,[...Y8]),release:z8(t,[...X8]),debug:z8(t,[...she]),tracesSampleRate:z8(t,[...lhe]),profilesSampleRate:z8(t,[...uhe]),replaysSessionSampleRate:z8(t,[...dhe]),replaysOnErrorSampleRate:z8(t,[...fhe]),tags:{platform:xe?`desktop`:`web`}})}function $8(e){return Ume(e),ghe(e)?null:e}function yhe(e){return{...e.replaysOnErrorSampleRate===void 0?{}:{replaysOnErrorSampleRate:e.replaysOnErrorSampleRate},...e.replaysSessionSampleRate===void 0?{}:{replaysSessionSampleRate:e.replaysSessionSampleRate}}}function e5(e){return{attachStacktrace:e.attachStacktrace,debug:e.debug,dsn:e.dsn,environment:e.environment,ignoreErrors:[...Hme],initialScope:{tags:e.tags},maxBreadcrumbs:e.maxBreadcrumbs,normalizeDepth:e.normalizeDepth,sendDefaultPii:!1,tracesSampleRate:e.tracesSampleRate,...e.release===void 0?{}:{release:e.release},...yhe(e)}}function bhe(e){let t=[];e.tracesSampleRate>0&&t.push($6()),((e.replaysSessionSampleRate??0)>0||(e.replaysOnErrorSampleRate??0)>0)&&t.push(p6());let n=iQ(Q8);t.push(n);try{I8({...e5(e),beforeSend:e=>$8(e),integrations:t})}catch{return null}return Z8=!0,L8}function xhe(e){let t=[];e.tracesSampleRate>0&&t.push(TA()),((e.replaysSessionSampleRate??0)>0||(e.replaysOnErrorSampleRate??0)>0)&&t.push(zk());let n=my(Q8);t.push(n);try{aj({...e5(e),beforeSend:e=>$8(e),integrations:t})}catch{return null}return Z8=!0,QM}function t5(){if(Z8)return xe?L8:QM;let e=vhe();return e?xe?bhe(e):xhe(e):null}function n5(e){if(t5()){if(xe){Qz(e);return}sl(e)}}function r5(e,t,n){if(!t5())return;let r=She(e);if(xe){PF(e=>{t&&e.setTags(t);let i=Hz(r);n?.showReportDialog&&o2({eventId:i})});return}ua(e=>{t&&e.setTags(t);let i=Qc(r);n?.showReportDialog&&US({eventId:i})})}function She(e){if(e instanceof Error)return e;if(typeof e==`string`&&e.trim().length>0)return Error(e);try{return Error(JSON.stringify(e))}catch{return Error(`Unknown non-Error exception`)}}var Che=class extends k.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){r5(e,{origin:`react-boundary`},{showReportDialog:!0})}render(){return this.state.hasError?(0,it.jsx)(Yme,{onGoToNewChat:_he}):this.props.children}},i5=!1,a5=!1,o5=null,s5=null,c5=null,l5=!1,u5=new Set;function whe(e){if(i5||a5)return;if(!e.publicKey||!e.host){a5=!0;return}if(o5)return;if(typeof window>`u`||typeof location>`u`){a5=!0;return}let t=e.publicKey,n=e.host;o5=_e(async()=>{let{default:e}=await import(`./module-CPO4cjSm.js`);return{default:e}},[]).then(({default:e})=>{s5=e,e.init(t,{api_host:n,person_profiles:`identified_only`,capture_pageview:!1,capture_pageleave:!1,autocapture:!1,disable_session_recording:!0,loaded:()=>{i5=!0,c5&&d5(c5),f5(),u5.forEach(e=>e())}})}).catch(()=>{a5=!0,s5=null})}function d5(e){if(c5=e,!i5||!s5)return;let t={};e.email!==void 0&&(t.email=e.email),e.displayName!==void 0&&(t.name=e.displayName),s5.identify(e.cmmdUserId,t)}function The(e){return!i5||!s5?!1:s5.isFeatureEnabled(e)===!0}function f5(){!s5||l5||(l5=!0,s5.onFeatureFlags(()=>{u5.forEach(e=>e())}))}function Ehe(e){return u5.add(e),i5&&s5&&(f5(),e()),()=>{u5.delete(e)}}var p5=class extends v(`BootstrapHttpError`){},m5=e=>r(e,`BootstrapHttpError`);function h5(e){return typeof e!=`object`||!e?!1:!!(m5(e)&&e.status===401||e instanceof Error&&e.name===`RemoteEnvironmentAuthHttpError`&&`status`in e&&e.status===401||e instanceof be&&e.kind===`auth`)}function Dhe(e){let t=e.replace(/\s+/g,` `).trim();return t.length===0?`<empty response>`:t.slice(0,120)}async function g5(e,t){let n=await e.text();try{return JSON.parse(n)}catch{throw new p5({message:`${t} returned a non-JSON response (${Dhe(n)}). Ensure the Forge server is running and this route is proxied correctly.`,status:e.status})}}function _5(e){let t=e.start().then(n=>e.getSlot()===t?(e.onSettled(n),n):e.retry(),n=>{if(e.getSlot()!==t)return e.retry();throw n}).finally(()=>{e.getSlot()===t&&e.setSlot(null)});return e.setSlot(t),t}function Ohe(e){if(!e.authenticated||!e.role)throw Error(`Authenticated session is required.`);let t=khe(e.cmmdIdentity??null);return t?{displayName:t,email:e.cmmdIdentity?.email??null,avatarUrl:e.cmmdIdentity?.avatarUrl??null,role:e.role,verified:!0,source:`cmmd-identity`}:{displayName:`CMMD identity unavailable`,email:null,avatarUrl:null,role:e.role,verified:!1,source:`fallback`}}function khe(e){return e&&([e.firstName,e.lastName].map(e=>e?.trim()??``).filter(e=>e.length>0).join(` `)||e.username.trim()||e.email.trim())||null}var v5=null;function Ahe(){if(v5)return v5;let e=new URL(`/api/auth/session`,window.location.origin).toString(),t=fetch(e,{credentials:`include`}).then(async t=>{if(!t.ok)throw new p5({message:`Failed to load current app auth session state (${t.status}).`,status:t.status});return g5(t,e)}).then(Ohe).finally(()=>{v5===t&&(v5=null)});return v5=t,t}var y5=null,b5=null,x5=null,S5=null,C5=new Set,w5=`cmmd-forge.loggedOutLocalBootstrapCredentials.v1`;function jhe(e){let t=`${e.firstName??``} ${e.lastName??``}`.trim();n5({id:e.id,email:e.email,...t.length>0?{username:t}:{}}),d5({cmmdUserId:e.id,...e.email?{email:e.email}:{},...t.length>0?{displayName:t}:{}})}function T5(){if(typeof window>`u`||x5)return;let e=window.desktopBridge?.desktopAuth?.onStateChange;e&&(x5=e(e=>{y5=null,b5=null,S5=null,e.sessionLifecycle.status!==`ready`&&n5(null),(e.sessionLifecycle.status===`expired`||e.sessionLifecycle.status===`signed-out`&&e.sessionLifecycle.reason===`refresh-revoked`)&&ue().catch(e=>{r5(e,{route:`desktop-auth-session-expired`})})}))}function Mhe(){return tn(new URL(window.location.href))}function E5(){let e=new URL(window.location.href),t=nn(e);t.toString()!==e.toString()&&window.history.replaceState({},document.title,t.toString())}async function Nhe(){return P5(async()=>{let e=ae(`/api/auth/session`),t=async()=>{let t=await fetch(e,se({credentials:`include`}));if(!t.ok)throw new p5({message:`Failed to load server auth session state (${t.status}).`,status:t.status});return g5(t,e)},n=await t();return!n.authenticated&&n.auth.sessionMethods.length===1&&n.auth.sessionMethods[0]===`proxy-asserted`&&typeof window<`u`&&!window.desktopBridge&&e.startsWith(`https://`)&&await fe()?t():n})}async function Phe(e){return P5(async()=>{let t={credential:e},n=ae(`/api/auth/bootstrap`),r=await fetch(n,se({body:JSON.stringify(t),credentials:`include`,headers:{"content-type":`application/json`},method:`POST`}));if(!r.ok)throw new p5({message:await r.text()||`Failed to bootstrap auth session (${r.status}).`,status:r.status});return g5(r,n)})}function D5(e){return new URL(e,window.location.origin).toString()}function O5(e){let t=(e?.primaryMode===`cloud`?null:e)?.bootstrapToken?.trim();return t&&t.length>0?t:null}function k5(){return typeof window>`u`?null:O5(window.desktopBridge?.getLocalEnvironmentBootstrap?.()??null)}function Fhe(){return typeof window>`u`?!1:me()===`session-expired`}function A5(){if(typeof window>`u`)return new Set;try{let e=window.sessionStorage.getItem(w5),t=e?JSON.parse(e):[];return Array.isArray(t)?new Set(t.filter(e=>typeof e==`string`)):new Set}catch{return new Set}}function j5(e){if(!(typeof window>`u`))try{if(e.size===0){window.sessionStorage.removeItem(w5);return}window.sessionStorage.setItem(w5,JSON.stringify([...e]))}catch{}}function Ihe(){let e=k5();if(!e)return;let t=new Set(A5());t.add(e),j5(t)}function Lhe(e){return A5().has(e)}function M5(){let e=k5();if(!e){j5(new Set);return}let t=new Set(A5());t.delete(e),j5(t)}async function N5(){let e=D5(`/api/auth/session`),t=await fetch(e,{credentials:`include`});return t.ok?g5(t,e):null}async function Rhe(e){if(typeof window>`u`)return;let t=O5(e);if(!t||Fhe()||C5.has(t)||Lhe(t))return;if((await N5().catch(()=>null))?.authenticated){C5.add(t);return}let n=D5(`/api/auth/bootstrap`),r=await fetch(n,{body:JSON.stringify({credential:t}),credentials:`include`,headers:{"content-type":`application/json`},method:`POST`});if(!r.ok){if(r.status===401)return;throw new p5({message:await r.text()||`Failed to bootstrap local web owner session (${r.status}).`,status:r.status})}await g5(r,n),C5.add(t)}async function zhe(){let e=await Nhe();if(e.authenticated)return e;let t=ce();if(t?.source!==`desktop-managed`||!t.bearerToken)return e;let n=await N5().catch(()=>null);return n?.authenticated?n:e}var Bhe=new Set([404,502,503,504]),Vhe=15e3,Hhe=500;function Uhe(e){ce()?.source===`paired-bearer`&&h5(e)&&ie(`http`)}async function P5(e){let t=Date.now();for(;;)try{return await e()}catch(e){if(Uhe(e),!Ghe(e))throw e;if(Date.now()-t>=Vhe)throw r5(e,{route:`bootstrap-retry-exhausted`}),e;await Whe(Hhe)}}function Whe(e){return new Promise(t=>{setTimeout(t,e)})}function Ghe(e){return m5(e)?Bhe.has(e.status):e instanceof TypeError||e instanceof DOMException&&e.name===`AbortError`}function Khe(e,t){return e.sessionLifecycle.status===`ready`?e.sessionLifecycle.principalId!==t.id||e.cmmd.identity?.id!==t.id?`desktop-principal-mismatch`:null:`desktop-session-required`}async function qhe(e){if(typeof window>`u`||!window.desktopBridge)return null;let t=window.desktopBridge.desktopAuth?.getState;if(!t)return`desktop-state-unavailable`;try{return Khe(await t(),e)}catch(e){return r5(e,{route:`desktop-auth-gate-state`}),`desktop-state-unavailable`}}async function Jhe(e,t){return n5(null),de(t),await D().catch(e=>{r5(e,{route:`desktop-auth-gate-logout`})}),{status:`requires-auth`,auth:e.auth,errorMessage:he(t)??`Forge Desktop requires CMMD authentication.`}}async function Yhe(){let e=await zhe();if(e.authenticated){if(e.cmmdIdentity){let t=await qhe(e.cmmdIdentity);return t?(le(),Jhe(e,t)):(le(),jhe(e.cmmdIdentity),{status:`authenticated`})}return{status:`requires-auth`,auth:e.auth}}return{status:`requires-auth`,auth:e.auth}}async function Xhe(e){let t=e.trim();if(!t)throw Error(`Enter a pairing token to continue.`);b5=null,M5(),await Phe(t),y5=null,E5()}function F5(){M5(),b5=null,y5=null}async function I5(e,t,n){let r=e.trim();if(!r)throw Error(`CMMD (Command) OAuth did not return an access token.`);let i=n?.refreshToken?.trim(),a=n?.mcpToken?.trim(),o=ae(`/api/auth/bootstrap/command`),s=await fetch(o,se({body:JSON.stringify({accessToken:r,...i?{refreshToken:i}:{},...a?{mcpToken:a}:{},...t===void 0?{}:{user:t}}),credentials:`include`,headers:{"content-type":`application/json`},method:`POST`}));if(!s.ok)throw new p5({message:await s.text()||`Failed to bootstrap with CMMD OAuth token (${s.status}).`,status:s.status});await g5(s,o),F5()}async function Zhe(){let e=ae(`/api/auth/ws-token`),t=await fetch(e,se({credentials:`include`,method:`POST`}));if(!t.ok)throw new p5({message:await t.text()||`Failed to issue websocket token (${t.status}).`,status:t.status});return g5(t,e)}async function Qhe(e){let t=await Zhe(),n=new URL(e,window.location.origin);return n.searchParams.set(`wsToken`,t.token),n.toString()}async function L5(e,t){try{return await O({method:`POST`,path:e,body:t,allowRetry:!1},Jn())}catch(e){throw e instanceof be&&e.kind!==`auth`&&e.code!==null&&Yn.has(e.code)?new be({kind:`auth`,message:e.message,status:e.status??401,code:e.code}):e}}async function $he(e){try{return await L5(`/api/cmmd/tasks/update`,e)}catch(t){if(t instanceof be&&(t.kind===`auth`||t.kind===`permission`))throw t;if(t instanceof be||t instanceof Error)return L5(`/api/command/tasks/update`,e);throw t}}async function ege(){typeof window>`u`||await window.desktopBridge?.desktopAuth?.logoutCloud?.()}async function tge(){let e=await Promise.allSettled([D(),ege()]);n5(null),Ihe(),y5=null,b5=null;let t=e.find(e=>e.status===`rejected`);if(t)throw t.reason}async function R5(){return T5(),b5?.status===`authenticated`?(le(),b5):y5||_5({start:z5,getSlot:()=>y5,setSlot:e=>{y5=e},onSettled:e=>{e.status===`authenticated`&&(b5=e)},retry:R5})}async function z5(){return oe().then(e=>Rhe(e)).then(()=>Yhe())}function B5(){return T5(),S5||(y5=null,b5=null,_5({start:z5,getSlot:()=>S5,setSlot:e=>{S5=e},onSettled:e=>{e.status===`authenticated`&&(b5=e,le())},retry:B5}))}function nge(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/u,``)}function rge(e){let t=nge(e).replace(/-/g,`+`).replace(/_/g,`/`);return`-----BEGIN PUBLIC KEY-----\n${((t+`=`.repeat((4-t.length%4)%4)).match(/.{1,64}/gu)??[]).join(`
|
|
1006
|
+
`)}\n-----END PUBLIC KEY-----\n`}function V5(e){return{publicKeyPem:rge(e.publicKeySpkiDer),async sign(t){let n=await crypto.subtle.sign(`Ed25519`,e.privateKey,new TextEncoder().encode(t));return new Uint8Array(n)}}}var ige=`cmmd-session-pop`,H5=`keys`,U5=`device-key`;function age(){return!1}var W5=class extends Error{constructor(e){super(`CMMD session key storage is unavailable (${e}). Session binding is enabled, so login cannot continue without a bound key: allow site data and IndexedDB for this origin, then retry.`),this.name=`CmmdSessionPopKeyStorageError`}};function oge(e){return e===void 0?typeof indexedDB>`u`?null:indexedDB:e}function G5(e){return new Promise((t,n)=>{e.addEventListener(`success`,()=>t(e.result),{once:!0}),e.addEventListener(`error`,()=>n(e.error),{once:!0})})}function sge(e){return new Promise((t,n)=>{e.addEventListener(`complete`,()=>t(),{once:!0}),e.addEventListener(`abort`,()=>n(e.error??new DOMException(`The transaction aborted.`,`AbortError`)),{once:!0}),e.addEventListener(`error`,()=>n(e.error??new DOMException(`The transaction failed.`,`UnknownError`)),{once:!0})})}function cge(e){return new Promise((t,n)=>{let r=e.open(ige,1);r.addEventListener(`upgradeneeded`,()=>{r.result.objectStoreNames.contains(H5)||r.result.createObjectStore(H5)}),r.addEventListener(`success`,()=>t(r.result),{once:!0}),r.addEventListener(`error`,()=>n(r.error),{once:!0})})}function K5(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.privateKey instanceof CryptoKey&&t.publicKeySpkiDer instanceof Uint8Array}async function lge(e){let t=await G5(e.transaction(H5,`readonly`).objectStore(H5).get(U5));return K5(t)?{privateKey:t.privateKey,publicKeySpkiDer:t.publicKeySpkiDer}:null}async function uge(e,t){let n=e.transaction(H5,`readwrite`),r=n.objectStore(H5),i=sge(n);i.catch(()=>void 0);let a=await G5(r.get(U5));return K5(a)?{privateKey:a.privateKey,publicKeySpkiDer:a.publicKeySpkiDer}:(await G5(r.add(t,U5)),await i,t)}var q5=null;async function dge(e={}){return age()?(q5??=fge(e).finally(()=>{q5=null}),q5):null}async function fge(e){let t=oge(e.indexedDB),n=e.subtle??crypto.subtle;if(!t)throw new W5(`IndexedDB is not available in this context`);let r;try{r=await cge(t)}catch{throw new W5(`the key database could not be opened`)}try{let e=await lge(r);if(e)return V5({privateKey:e.privateKey,publicKeySpkiDer:e.publicKeySpkiDer});let t=await n.generateKey({name:`Ed25519`},!1,[`sign`]),i={privateKey:t.privateKey,publicKeySpkiDer:new Uint8Array(await n.exportKey(`spki`,t.publicKey))};return V5(await uge(r,i))}catch(e){throw e instanceof W5?e:new W5(`the session key could not be generated or persisted`)}}function J5(e={}){return dge(e).then(e=>e?.publicKeyPem??null)}async function pge(e,t={}){let n=e.email.trim();if(!n||!e.password)throw Error(`Enter your CMMD email and password.`);let r=await(t.resolvePopPublicKey??J5)(),i=ae(`/api/auth/cmmd-password/token`),a=await fetch(i,se({body:JSON.stringify({email:n,password:e.password,...r?{pop_public_key:r}:{}}),credentials:`include`,headers:{"content-type":`application/json`},method:`POST`}));if(!a.ok)throw new p5({message:await a.text()||`CMMD login failed (${a.status}).`,status:a.status});let o=await g5(a,i);if(o.authenticated===!0)return F5(),{serverEstablishedSession:!0};if(typeof o.access_token!=`string`||o.access_token.trim().length===0)throw Error(`CMMD login did not return an access token.`);return await I5(o.access_token,o.user,{refreshToken:typeof o.refresh_token==`string`?o.refresh_token:void 0,mcpToken:typeof o.mcp_token==`string`?o.mcp_token:void 0}),{serverEstablishedSession:!1}}async function Y5(e,t){return await e.text()||t}async function mge(e,t){let n=e?.trim(),r={...n?{label:n}:{},...t?{role:t}:{}},i=ae(`/api/auth/pairing-token`),a=await fetch(i,se({body:JSON.stringify(r),credentials:`include`,headers:{"content-type":`application/json`},method:`POST`}));if(!a.ok)throw Error(await Y5(a,`Failed to create pairing credential (${a.status}).`));return g5(a,i)}async function hge(){let e=ae(`/api/auth/clients`),t=await fetch(e,se({credentials:`include`}));if(!t.ok)throw Error(await Y5(t,`Failed to load paired clients (${t.status}).`));return g5(t,e)}async function gge(e){let t=ae(`/api/auth/pairing-links/revoke`),n=await fetch(t,se({body:JSON.stringify({id:e}),credentials:`include`,headers:{"content-type":`application/json`},method:`POST`}));if(!n.ok)throw Error(await Y5(n,`Failed to revoke the pairing link (${n.status}).`));return(await g5(n,t)).revoked}var _ge=`/.well-known/forge/environment`,X5=ve()(e=>({descriptor:null,setDescriptor:t=>e({descriptor:t}),reset:()=>e({descriptor:null})})),Z5=null;function vge(e){let t=Q5();return t?Te(Se({id:t.environmentId,label:t.label,source:e.source,target:e.target}),t):null}async function yge(){return P5(async()=>{await oe();let e=ce()?.bearerToken,t=ae(_ge),n=e?await fetch(t,{headers:{Authorization:`Bearer ${e}`}}):await fetch(t);if(!n.ok)throw new p5({message:`Failed to load server environment descriptor (${n.status}).`,status:n.status});let r=await g5(n,t);return $5(r),r})}function Q5(){return X5.getState().descriptor}function bge(){return X5(xge)}function xge(e){return e.descriptor?.environmentId??null}function Sge(){return X5(Cge)}function Cge(e){return e.descriptor}function wge(){return X5(Tge)}function Tge(e){return e.descriptor?.deviceRuntimeId??null}function Ege(){return Q5()?.deviceRuntimeId??null}function Dge(){return X5(Oge)}function Oge(e){return Me(e.descriptor)}function kge(){return X5(Age)}function Age(e){return Ne(e.descriptor)}function $5(e){X5.getState().setDescriptor(e)}function jge(e,t){return t?.primaryMode!==`cloud`||e.environmentId===t.environmentId}function e7(){let e=ce();return e?vge({source:e.source,target:e.target}):null}function Mge(){return Nge()}async function Nge(){let e=await oe(),t=Q5();if(t&&jge(t,e))return Promise.resolve(t);if(t&&$5(null),Z5)return Z5;let n=yge();return Z5=n,n.finally(()=>{Z5===n&&(Z5=null)})}var t7=class e{#e;constructor(e){this.#e=e}static namedByCatalog(t){return new e(t.projectId)}get registrationProjectId(){return this.#e}asConfirmationIdentity(){return{registrationProjectId:this.#e}}};function n7(e){return{match:t=>t.present({target:e})}}function r7(){return{match:e=>e.provablyAbsent()}}function Pge(e){return{match:t=>t.unprovable(e)}}var Fge=class e{#e;#t;capacity;constructor(e,t,n){this.#e=e,this.#t=t,this.capacity=n}static fromValidatedBody(t,n,r){return new e(t,n,r)}listRowsForDisplay(){return this.#e}listEnvironmentsForDisplay(){return this.#t}locate(e){if(e.registrationProjectId!==void 0){let t=this.#e.find(t=>t.projectId===e.registrationProjectId);return t===void 0?r7():n7(t7.namedByCatalog(t))}if(e.runtimeId!==void 0||e.cmmdEnvironmentId!==void 0){let t=this.#e.find(t=>t.runtime!=null&&(e.runtimeId!==void 0&&t.runtime.runtimeId===e.runtimeId||e.cmmdEnvironmentId!==void 0&&t.runtime.environmentId===e.cmmdEnvironmentId));if(t)return n7(t7.namedByCatalog(t))}if(this.#e.length===0)return r7();let t=e.runtimeId??e.cmmdEnvironmentId;return Pge(t===void 0?`no identity this catalog can be matched on`:`the catalog holds ${String(this.#e.length)} row(s) that ${t} cannot be ruled out against`)}};function i7(e){let t=e,n=t&&typeof t==`object`&&`data`in t&&t.data?t.data:t,r=n?.projects;if(!Array.isArray(r))throw Error("Forge Cloud returned a project catalog this version cannot read (no `projects` list).");let i=n?.environments;if(!Array.isArray(i))throw Error("Forge Cloud returned an Environment catalog this version cannot read (invalid `environments` list).");if(!r.every(Ige))throw Error(`Forge Cloud returned a project catalog this version cannot read (invalid project entry).`);if(!i.every(Lge))throw Error(`Forge Cloud returned an Environment catalog this version cannot read (invalid Environment entry).`);return Fge.fromValidatedBody(r,i,n?.capacity??null)}function Ige(e){return!o7(e)||typeof e.organizationId!=`number`||typeof e.projectId!=`number`?!1:e.runtime===void 0||e.runtime===null||a7(e.runtime)}function Lge(e){return o7(e)&&typeof e.organizationId==`number`&&typeof e.userId==`number`&&a7(e.runtime)}function a7(e){return o7(e)&&typeof e.runtimeId==`string`&&typeof e.status==`string`}function o7(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Rge(e,t){let n=new URL(e);return n.pathname=t,n.search=``,n.hash=``,n.toString()}function s7(e){return e.accessToken??e.resolveAccessToken?.()}function c7(e,t,n=t=>Rge(e.cmmdHttpBaseUrl,t)){return O({method:t.method,path:t.path,...t.body===void 0?{}:{body:t.body},...t.signal===void 0?{}:{signal:t.signal}},{resolveUrl:n,resolveBearerToken:()=>s7(e)})}function zge(e,t){return c7(e,{method:`GET`,path:`/api/forge/context/cloud-projects/${encodeURIComponent(String(t.projectId))}/removal-preview`,...t.signal===void 0?{}:{signal:t.signal}},e.cloudProjectRemovalPreviewUrl?()=>e.cloudProjectRemovalPreviewUrl(t.projectId):void 0).then(e=>e.preview)}function Bge(e,t){return c7(e,{method:`POST`,path:`/api/forge/context/cloud-projects/${encodeURIComponent(String(t.projectId))}/removal`,body:{idempotencyKey:t.idempotencyKey,deletePlanningProject:t.deletePlanningProject,...t.deleteCheckoutFiles===void 0?{}:{deleteCheckoutFiles:t.deleteCheckoutFiles},...t.previewToken===void 0?{}:{previewToken:t.previewToken},...t.forceDirty===void 0?{}:{forceDirty:t.forceDirty}},...t.signal===void 0?{}:{signal:t.signal}},e.cloudProjectRemovalUrl?()=>e.cloudProjectRemovalUrl(t.projectId):void 0).then(e=>e.operation)}function l7(e,t=``){return`/api/forge/context/runtimes/${encodeURIComponent(e)}${t}`}async function Vge(e){if(e.ok)return;let{CmmdApiError:t}=await _e(async()=>{let{CmmdApiError:e}=await import(`./transport-CgH8pQK3.js`).then(e=>e.r);return{CmmdApiError:e}},__vite__mapDeps([7,1]));if(e.status===401||e.status===403){let n=null;try{let t=await e.json();n=typeof t?.code==`string`?t.code:null}catch{}throw new t({kind:`auth`,message:`CMMD authentication required. Sign in again to continue.`,status:e.status,code:n})}throw new t({kind:e.status>=500?`server`:`client`,message:`forge-cloud-projects proxy error (${e.status})`,status:e.status})}var u7=class{config;constructor(e){this.config=e}async ensureRuntime(e){return(await c7(this.config,{method:`POST`,path:`/api/forge/context/runtimes/ensure`,body:{...e.projectId===void 0?{}:{projectId:e.projectId},...e.organizationId===void 0?{}:{organizationId:e.organizationId},...e.githubRepoFullName===void 0?{}:{githubRepoFullName:e.githubRepoFullName},...e.workspaceRoot===void 0?{}:{workspaceRoot:e.workspaceRoot}},...e.signal===void 0?{}:{signal:e.signal}},this.config.ensureUrl?()=>this.config.ensureUrl:void 0)).runtime}async connectRuntime(e){return c7(this.config,{method:`POST`,path:l7(e.runtimeId,`/connect`),...e.organizationId===void 0?{}:{body:{organizationId:e.organizationId}},...e.signal===void 0?{}:{signal:e.signal}})}async getRuntime(e){return(await c7(this.config,{method:`GET`,path:l7(e.runtimeId),...e.signal===void 0?{}:{signal:e.signal}})).runtime}async destroyRuntime(e){return(await c7(this.config,{method:`POST`,path:l7(e.runtimeId,`/destroy`),body:{purgeVolume:e.purgeVolume??!1,...e.force===!0?{force:!0}:{},...e.reason===void 0?{}:{reason:e.reason},...e.organizationId===void 0?{}:{organizationId:e.organizationId}},...e.signal===void 0?{}:{signal:e.signal}},this.config.destroyUrl?()=>this.config.destroyUrl(e.runtimeId):void 0)).runtime}async runRuntimeLifecycleAction(e){return(await c7(this.config,{method:`POST`,path:l7(e.runtimeId,`/${e.action}`),body:e.organizationId===void 0?{}:{organizationId:e.organizationId},...e.signal===void 0?{}:{signal:e.signal}},this.config.lifecycleUrl?()=>this.config.lifecycleUrl(e.runtimeId,e.action):void 0)).runtime}async updateRuntimeCommit(e){return(await c7(this.config,{method:`POST`,path:l7(e.runtimeId,`/update-commit`),body:e.organizationId===void 0?{}:{organizationId:e.organizationId},...e.signal===void 0?{}:{signal:e.signal}},this.config.updateCommitUrl?()=>this.config.updateCommitUrl(e.runtimeId):void 0)).operation}async getRuntimeCommitUpdateOperation(e){return(await c7(this.config,{method:`GET`,path:l7(e.runtimeId,`/update-commit/${encodeURIComponent(String(e.operationId))}`),...e.signal===void 0?{}:{signal:e.signal}},this.config.updateCommitOperationUrl?()=>this.config.updateCommitOperationUrl(e.runtimeId,e.operationId):void 0)).operation}async listCloudProjects(e){if(this.config.listUrl){let t=s7(this.config),n=await fetch(this.config.listUrl,{method:`GET`,headers:{Accept:`application/json`,...t?{Authorization:`Bearer ${t}`}:{}},credentials:t?`omit`:`include`,cache:`no-store`,...e?.signal===void 0?{}:{signal:e.signal}});return await Vge(n),i7(await n.json())}return i7(await c7(this.config,{method:`GET`,path:`/api/forge/context/cloud-projects`,...e?.signal===void 0?{}:{signal:e.signal}}))}async previewCloudProjectRemoval(e){return zge(this.config,e)}async requestCloudProjectRemoval(e){return Bge(this.config,e)}async getCloudProjectRemoval(e){return(await c7(this.config,{method:`GET`,path:`/api/forge/context/cloud-projects/removals/${encodeURIComponent(e.operationId)}`,...e.signal===void 0?{}:{signal:e.signal}},this.config.cloudProjectRemovalReceiptUrl?()=>this.config.cloudProjectRemovalReceiptUrl(e.operationId):void 0)).operation}},d7=`/api/attachments/upload/`;function Hge(e){if(!e.relativeUrl.startsWith(d7))throw Error(`Attachment upload URL did not use the expected upload route.`);let t=e.relativeUrl.slice(24);if(!/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(t))throw Error(`Attachment upload URL did not contain a valid signed token.`);if(e.relativeUrl.includes(`?`)||e.relativeUrl.includes(`#`))throw Error(`Attachment upload URL must not include a query or fragment.`);let n=new URL(e.httpBaseUrl),r=n.pathname.endsWith(`/`)?n.pathname.slice(0,-1):n.pathname,i=`${r}${d7}`,a=new URL(`${r}${e.relativeUrl}`,n);if(a.origin!==n.origin||!a.pathname.startsWith(i))throw Error(`Attachment upload URL resolved outside the selected environment.`);return a.toString()}var f7=!1,p7=null;function m7(e){return Object.values(e)}function h7(e){return e.map(e=>s(e))}function g7(e){try{Yt(h7(m7(e))).catch(e=>{console.error(`[SAVED_ENVIRONMENTS] persist failed`,e)})}catch(e){console.error(`[SAVED_ENVIRONMENTS] persist failed`,e)}}function Uge(e){let t=_7.getState().byId,n=Object.fromEntries(e.map(e=>[e.environmentId,e]));_7.setState({byId:{...n,...t}})}async function Wge(){if(f7)return;if(p7)return p7;let e=(async()=>{try{Uge(await Jt())}catch(e){console.error(`[SAVED_ENVIRONMENTS] hydrate failed`,e)}finally{f7=!0,_7.setState({hydrated:!0})}})().finally(()=>{p7===e&&(p7=null)});return p7=e,p7}var _7=ve()(e=>({byId:{},hydrated:f7,upsert:t=>e(e=>{let n={...e.byId,[t.environmentId]:t};return g7(n),{byId:n}}),remove:t=>e(e=>{let{[t]:n,...r}=e.byId;return g7(r),{byId:r}}),markConnected:(t,n)=>e(e=>{let r=e.byId[t];if(!r)return e;let i={...e.byId,[t]:{...r,lastConnectedAt:n}};return g7(i),{byId:i}}),reset:()=>{g7({}),e({byId:{}})}}));function v7(){return f7}function Gge(){return v7()?Promise.resolve():Wge()}function y7(){return Object.values(_7.getState().byId).toSorted((e,t)=>e.label.localeCompare(t.label))}function Kge(){return y7().filter(e=>e.lastAuthenticatedPullRequestCapability===!0)}function b7(e){return _7.getState().byId[e]??null}function x7(e){let t=e7();return t?.environmentId===e?we(t):b7(e)?.httpBaseUrl??null}function S7(e){let t=x7(e.environmentId)??(typeof window<`u`?window.location.origin:null);if(!t)throw Error(`Unable to resolve HTTP base URL for environment ${e.environmentId}.`);let n=new URL(t);return n.pathname=`${n.pathname.endsWith(`/`)?n.pathname.slice(0,-1):n.pathname}${e.pathname.startsWith(`/`)?e.pathname:`/${e.pathname}`}`,e.searchParams&&(n.search=new URLSearchParams(e.searchParams).toString()),n.toString()}function C7(e){if(!x7(e))throw Error(`Unable to resolve HTTP base URL for environment ${e}.`)}function qge(e){return C7(e.environmentId),Hge({httpBaseUrl:x7(e.environmentId),relativeUrl:e.relativeUrl})}async function Jge(e){await Yt(h7(m7({..._7.getState().byId,[e.environmentId]:e})))}async function Yge(e,t){let{[e]:n,...r}=_7.getState().byId,i={...r,[t.environmentId]:t};await Yt(h7(m7(i))),_7.setState({byId:i})}async function Xge(e){return Xt(e)}async function Zge(e,t){return Zt(e,t)}async function Qge(e){await Qt(e)}function $ge(e,t){return e.reasoningEffortLevels.some(e=>e.value===t)}function w7(e){return e.reasoningEffortLevels.find(e=>e.isDefault)?.value??null}function T7(e,t){let n=w7(e),r=typeof t==`string`?t.trim():null;return r&&!e.promptInjectedEffortLevels.includes(r)&&$ge(e,r)?r:n??void 0}function E7(e,t){return e.contextWindowOptions.some(e=>e.value===t)}function D7(e){return e.contextWindowOptions.find(e=>e.isDefault)?.value??null}function e_e(e,t){let n=D7(e);return t&&E7(e,t)?t:n??void 0}function t_e(e,t){let n=T7(e,t?.reasoningEffort),r=e.supportsFastMode?t?.fastMode:void 0,i={...n?{reasoningEffort:n}:{},...r===void 0?{}:{fastMode:r}};return Object.keys(i).length>0?i:void 0}function n_e(e,t){let n=T7(e,t?.effort),r=e.supportsThinkingToggle?t?.thinking:void 0,i=e.supportsFastMode?t?.fastMode:void 0,a=e_e(e,t?.contextWindow),o={...r===void 0?{}:{thinking:r},...n?{effort:n}:{},...i===void 0?{}:{fastMode:i},...a===void 0?{}:{contextWindow:a}};return Object.keys(o).length>0?o:void 0}function r_e(e){return typeof e==`string`&&/\bultrathink\b/i.test(e)}function O7(e,t=`codex`){if(typeof e!=`string`)return null;let n=e.trim();if(!n)return null;let r=g[t],i=Object.prototype.hasOwnProperty.call(r,n)?r[n]:void 0;return typeof i==`string`?i:n}function i_e(e,t,n){if(typeof t!=`string`)return null;let r=t.trim();if(!r)return null;let i=n.find(e=>e.slug===r);if(i)return i.slug;let a=n.find(e=>e.name.toLowerCase()===r.toLowerCase());if(a)return a.slug;let o=O7(r,e),s=n.find(e=>e.slug===o);return s?s.slug:null}var a_e=[`codex`,`claudeAgent`];function k7(e,t){return a_e.filter(e=>e!==t).some(t=>ne(t,e)!==void 0)}function o_e(e,t){let n=O7(e,t);return!n||k7(n,t)?te[t]:n}function A7(e,t){return o_e(t,e)}function s_e(e){return typeof e==`string`&&e.trim()||null}function c_e(e,t){let n=e.trim();return!n||t!==`ultrathink`||n.startsWith(`Ultrathink:`)?n:`Ultrathink:\n${n}`}function j7(e,t){return{id:e.id,environmentId:t,name:e.title,cwd:e.workspaceRoot,repositoryIdentity:e.repositoryIdentity??null,availability:e.availability,defaultThreadEnvMode:e.defaultThreadEnvMode??null,cmmdRegistration:e.cmmdRegistration??null,defaultModelSelection:e.defaultModelSelection?M7(e.defaultModelSelection):null,createdAt:e.createdAt,updatedAt:e.updatedAt,scripts:N7(e.scripts)}}function M7(e){return{...e,model:A7(e.provider,e.model)}}function N7(e){return e.map(e=>({...e}))}function l_e(e,t){return{...e,...t.title===void 0?{}:{name:t.title},...t.workspaceRoot===void 0?{}:{cwd:t.workspaceRoot},...t.repositoryIdentity===void 0?{}:{repositoryIdentity:t.repositoryIdentity??null},...t.defaultThreadEnvMode===void 0?{}:{defaultThreadEnvMode:t.defaultThreadEnvMode},...t.cmmdRegistration===void 0?{}:{cmmdRegistration:t.cmmdRegistration},...t.defaultModelSelection===void 0?{}:{defaultModelSelection:t.defaultModelSelection?M7(t.defaultModelSelection):null},...t.scripts===void 0?{}:{scripts:N7(t.scripts)},updatedAt:t.updatedAt}}function P7(e){let t=q8(e.lastError);return{provider:d_e(e.providerName),status:u_e(e.status),orchestrationStatus:e.status,activeTurnId:e.activeTurnId??void 0,createdAt:e.updatedAt,updatedAt:e.updatedAt,...t?{lastError:t}:{}}}function F7(e,t){let n=t.attachments?.map(t=>{let n=S7({environmentId:e,pathname:f_e(t.id)});return t.type===`image`?{...t,previewUrl:n}:{...t,downloadUrl:n}});return{id:t.id,role:t.role,text:t.text,turnId:t.turnId,createdAt:t.createdAt,streaming:t.streaming,...t.streaming?{}:{completedAt:t.updatedAt},...n&&n.length>0?{attachments:n}:{}}}function I7(e){return{id:e.id,turnId:e.turnId,planMarkdown:e.planMarkdown,implementedAt:e.implementedAt,implementationThreadId:e.implementationThreadId,createdAt:e.createdAt,updatedAt:e.updatedAt}}function L7(e){return{turnId:e.turnId,completedAt:e.completedAt,status:e.status,assistantMessageId:e.assistantMessageId??void 0,checkpointTurnCount:e.checkpointTurnCount,checkpointRef:e.checkpointRef,files:e.files.map(e=>({...e}))}}function u_e(e){switch(e){case`starting`:return`connecting`;case`running`:return`running`;case`error`:return`error`;case`ready`:case`interrupted`:return`ready`;case`idle`:case`stopped`:return`closed`}}function d_e(e){return e===`codex`||e===`claudeAgent`||e===`ollama`||e===`cmmd`||e===`apex`?e:`codex`}function f_e(e){return`/attachments/${encodeURIComponent(e)}`}var p_e=[],m_e=[],h_e=[],g_e=[],__e={},v_e={},y_e={},b_e={},x_e=[],R7=new WeakMap,z7=new WeakMap;function B7(e,t,n){if(!e||e.length===0||!t)return n;let r=R7.get(e),i=r?.get(t);if(i)return i;let a=e.flatMap(e=>{let n=t[e];return n?[n]:[]}),o=r??new WeakMap;return o.set(t,a),r||R7.set(e,o),a}function S_e(e,t){return B7(e.messageIdsByThreadId[t],e.messageByThreadId[t]??__e,p_e)}function C_e(e,t){return B7(e.activityIdsByThreadId[t],e.activityByThreadId[t]??v_e,m_e)}function w_e(e,t){return B7(e.proposedPlanIdsByThreadId[t],e.proposedPlanByThreadId[t]??y_e,h_e)}function T_e(e,t){return B7(e.turnDiffIdsByThreadId[t],e.turnDiffSummaryByThreadId[t]??b_e,g_e)}function V7(e,t){let n=e.threadShellById[t];if(!n)return;let r=e.threadSessionById[t]??null,i=e.threadTurnStateById[t],a=e.threadRateLimitStatusById[t]??x_e,o=S_e(e,t),s=C_e(e,t),c=w_e(e,t),l=T_e(e,t),u=z7.get(n);if(u&&u.session===r&&u.turnState===i&&u.rateLimitStatus===a&&u.messages===o&&u.activities===s&&u.proposedPlans===c&&u.turnDiffSummaries===l)return u.thread;let d={...n,session:r,latestTurn:i?.latestTurn??null,pendingSourceProposedPlan:i?.pendingSourceProposedPlan,rateLimitStatus:a,messages:o,activities:s,proposedPlans:c,turnDiffSummaries:l};return z7.set(n,{session:r,turnState:i,rateLimitStatus:a,messages:o,activities:s,proposedPlans:c,turnDiffSummaries:l,thread:d}),d}function E_e(e,t){let n=t.providerAccountId??null,r=e=>e.provider===t.provider&&(e.providerAccountId??null)===n,i=e.find(r),a={status:t.status,usedPercent:t.usedPercent,resetsAt:t.resetsAt},o={provider:t.provider,providerAccountId:n,fiveHour:t.window===`five_hour`?a:i?.fiveHour??null,sevenDay:t.window===`seven_day`?a:i?.sevenDay??null};return[...e.filter(e=>!r(e)),o]}function H7(e){return{settledAt:e.settledAt??null,settledOverride:e.settledOverride??null}}var U7={projectIds:[],projectById:{},threadIds:[],threadIdsByProjectId:{},threadShellById:{},threadSessionById:{},threadTurnStateById:{},threadRateLimitStatusById:{},messageIdsByThreadId:{},messageByThreadId:{},activityIdsByThreadId:{},activityByThreadId:{},proposedPlanIdsByThreadId:{},proposedPlanByThreadId:{},turnDiffIdsByThreadId:{},turnDiffSummaryByThreadId:{},sidebarThreadSummaryById:{},threadSubscriptionErrorById:{},bootstrapComplete:!1},D_e={activeEnvironmentId:null,environmentStateById:{}},W7=[],G7=[];function K7(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function q7(e,t){return{id:e.id,environmentId:t,codexThreadId:null,projectId:e.projectId,title:e.title,modelSelection:M7(e.modelSelection),runtimeMode:e.runtimeMode,interactionMode:e.interactionMode,session:e.session?P7(e.session):null,messages:e.messages.map(e=>F7(t,e)),proposedPlans:e.proposedPlans.map(I7),error:q8(e.session?.lastError),createdAt:e.createdAt,archivedAt:e.archivedAt,...H7(e),updatedAt:e.updatedAt,latestTurn:e.latestTurn,pendingSourceProposedPlan:e.latestTurn?.sourceProposedPlan,branch:e.branch,worktreePath:e.worktreePath,turnDiffSummaries:e.checkpoints.map(L7),activities:e.activities.map(e=>({...e})),anchorKind:e.anchorKind,anchorCmmdId:e.anchorCmmdId,linkedPullRequest:e.linkedPullRequest??null,goal:e.goal??null,titleRegeneration:e.titleRegeneration??null,kind:e.kind,parentThreadId:e.parentThreadId,status:e.status,workerRole:e.workerRole??null,pendingAutoCreatePrompt:e.pendingAutoCreatePrompt??null,rateLimitStatus:e.rateLimitStatus??[]}}function J7(e,t){let n={id:e.id,environmentId:t,codexThreadId:null,projectId:e.projectId,title:e.title,modelSelection:M7(e.modelSelection),runtimeMode:e.runtimeMode,interactionMode:e.interactionMode,error:q8(e.session?.lastError),createdAt:e.createdAt,archivedAt:e.archivedAt,...H7(e),updatedAt:e.updatedAt,branch:e.branch,worktreePath:e.worktreePath,anchorKind:e.anchorKind,anchorCmmdId:e.anchorCmmdId,linkedPullRequest:e.linkedPullRequest??null,goal:e.goal??null,titleRegeneration:e.titleRegeneration??null,kind:e.kind,parentThreadId:e.parentThreadId,status:e.status,workerRole:e.workerRole??null},r=e.session?P7(e.session):null;return{shell:n,session:r,turnState:{latestTurn:e.latestTurn,pendingSourceProposedPlan:e.latestTurn?.sourceProposedPlan},summary:{id:e.id,modelSelection:n.modelSelection,environmentId:t,projectId:e.projectId,title:e.title,interactionMode:e.interactionMode,session:r,createdAt:e.createdAt,archivedAt:e.archivedAt,...H7(e),updatedAt:e.updatedAt,latestTurn:e.latestTurn,branch:e.branch,worktreePath:e.worktreePath,latestUserMessageAt:e.latestUserMessageAt,hasPendingApprovals:e.hasPendingApprovals,hasPendingUserInput:e.hasPendingUserInput,hasActionableProposedPlan:e.hasActionableProposedPlan,anchorKind:e.anchorKind,anchorCmmdId:e.anchorCmmdId,linkedPullRequest:e.linkedPullRequest??null,goal:e.goal??null,titleRegeneration:e.titleRegeneration??null,kind:e.kind,parentThreadId:e.parentThreadId,status:e.status,workerRole:e.workerRole??null}}}function O_e(e){return{id:e.id,environmentId:e.environmentId,codexThreadId:e.codexThreadId,projectId:e.projectId,title:e.title,modelSelection:e.modelSelection,runtimeMode:e.runtimeMode,interactionMode:e.interactionMode,error:e.error,createdAt:e.createdAt,archivedAt:e.archivedAt,settledAt:e.settledAt,settledOverride:e.settledOverride,updatedAt:e.updatedAt,branch:e.branch,worktreePath:e.worktreePath,anchorKind:e.anchorKind,anchorCmmdId:e.anchorCmmdId,linkedPullRequest:e.linkedPullRequest??null,kind:e.kind,parentThreadId:e.parentThreadId,status:e.status,workerRole:e.workerRole??null,goal:e.goal??null,titleRegeneration:e.titleRegeneration??null}}function k_e(e){return{latestTurn:e.latestTurn,...e.pendingSourceProposedPlan?{pendingSourceProposedPlan:e.pendingSourceProposedPlan}:{}}}function Y7(e,t){return e===t?!0:e===void 0||t===void 0?!1:e.threadId===t.threadId&&e.planId===t.planId}function X7(e,t){return e===t?!0:e==null||t==null?!1:e.turnId===t.turnId&&e.state===t.state&&e.requestedAt===t.requestedAt&&e.startedAt===t.startedAt&&e.completedAt===t.completedAt&&e.assistantMessageId===t.assistantMessageId&&Y7(e.sourceProposedPlan,t.sourceProposedPlan)}function Z7(e,t){return e===t?!0:e==null||t==null?!1:e.provider===t.provider&&e.status===t.status&&e.orchestrationStatus===t.orchestrationStatus&&e.activeTurnId===t.activeTurnId&&e.createdAt===t.createdAt&&e.updatedAt===t.updatedAt&&e.lastError===t.lastError}function Q7(e,t){return e===t?!0:e==null||t==null?!1:e.projectId===t.projectId&&e.projectRepositoryId===t.projectRepositoryId&&e.provider===t.provider&&e.host===t.host&&e.repository===t.repository&&e.number===t.number&&e.url===t.url}function $7(e,t){return e!==void 0&&e.id===t.id&&e.environmentId===t.environmentId&&e.projectId===t.projectId&&e.title===t.title&&e9(e.titleRegeneration,t.titleRegeneration)&&e.interactionMode===t.interactionMode&&Z7(e.session,t.session)&&e.createdAt===t.createdAt&&e.archivedAt===t.archivedAt&&e.settledAt===t.settledAt&&e.settledOverride===t.settledOverride&&e.updatedAt===t.updatedAt&&X7(e.latestTurn,t.latestTurn)&&e.branch===t.branch&&e.worktreePath===t.worktreePath&&e.latestUserMessageAt===t.latestUserMessageAt&&e.hasPendingApprovals===t.hasPendingApprovals&&e.hasPendingUserInput===t.hasPendingUserInput&&e.hasActionableProposedPlan===t.hasActionableProposedPlan&&e.anchorKind===t.anchorKind&&e.anchorCmmdId===t.anchorCmmdId&&Q7(e.linkedPullRequest,t.linkedPullRequest)&&e.kind===t.kind&&e.parentThreadId===t.parentThreadId&&e.status===t.status}function e9(e,t){return e===t?!0:e==null||t==null?!1:e.requestId===t.requestId&&e.startedAt===t.startedAt}function t9(e,t){return e!==void 0&&e.id===t.id&&e.environmentId===t.environmentId&&e.codexThreadId===t.codexThreadId&&e.projectId===t.projectId&&e.title===t.title&&e.modelSelection===t.modelSelection&&e.runtimeMode===t.runtimeMode&&e.interactionMode===t.interactionMode&&e.error===t.error&&e.createdAt===t.createdAt&&e.archivedAt===t.archivedAt&&e.settledAt===t.settledAt&&e.settledOverride===t.settledOverride&&e.updatedAt===t.updatedAt&&e.branch===t.branch&&e.worktreePath===t.worktreePath&&e.anchorKind===t.anchorKind&&e.anchorCmmdId===t.anchorCmmdId&&Q7(e.linkedPullRequest,t.linkedPullRequest)&&e.kind===t.kind&&e.parentThreadId===t.parentThreadId&&e.status===t.status&&e.goal===t.goal&&e9(e.titleRegeneration,t.titleRegeneration)}function n9(e,t){return e!==void 0&&X7(e.latestTurn,t.latestTurn)&&Y7(e.pendingSourceProposedPlan,t.pendingSourceProposedPlan)}function A_e(e,t){return e.includes(t)?[...e]:[...e,t]}function r9(e,t){return e.filter(e=>e!==t)}function j_e(e){return{ids:e.messages.map(e=>e.id),byId:Object.fromEntries(e.messages.map(e=>[e.id,e]))}}function M_e(e){return{ids:e.activities.map(e=>e.id),byId:Object.fromEntries(e.activities.map(e=>[e.id,e]))}}function N_e(e){return{ids:e.proposedPlans.map(e=>e.id),byId:Object.fromEntries(e.proposedPlans.map(e=>[e.id,e]))}}function P_e(e){return{ids:e.turnDiffSummaries.map(e=>e.turnId),byId:Object.fromEntries(e.turnDiffSummaries.map(e=>[e.turnId,e]))}}function F_e(e){return e.projectIds.flatMap(t=>{let n=e.projectById[t];return n?[n]:[]})}function i9(e){return e.threadIds.flatMap(t=>{let n=V7(e,t);return n?[n]:[]})}function a9(e,t,n,r){let i=e;if(e.threadIds.includes(t)||(i={...i,threadIds:[...i.threadIds,t]}),r!==n){let e=i.threadIdsByProjectId;if(r){let n=e[r]??W7,i=r9(n,t);if(i.length===0){let{[r]:t,...n}=e;e=n}else K7(n,i)||(e={...e,[r]:i})}let a=e[n]??W7,o=A_e(a,t);K7(a,o)||(e={...e,[n]:o}),e!==i.threadIdsByProjectId&&(i={...i,threadIdsByProjectId:e})}return i}function o9(e,t,n){let r=O_e(t),i=k_e(t),a=e.threadShellById[t.id],o=e.threadTurnStateById[t.id],s=a9(e,t.id,t.projectId,n?.projectId);t9(a,r)||(s={...s,threadShellById:{...s.threadShellById,[t.id]:r}});let c=e.sidebarThreadSummaryById[t.id];if(c!==void 0){let e={...c,title:t.title,modelSelection:t.modelSelection,interactionMode:t.interactionMode,session:t.session,createdAt:t.createdAt,archivedAt:t.archivedAt,settledAt:t.settledAt,settledOverride:t.settledOverride,updatedAt:t.updatedAt,latestTurn:t.latestTurn,branch:t.branch,worktreePath:t.worktreePath,anchorKind:t.anchorKind,anchorCmmdId:t.anchorCmmdId,linkedPullRequest:t.linkedPullRequest??null,goal:t.goal,titleRegeneration:t.titleRegeneration??null,kind:t.kind,parentThreadId:t.parentThreadId,status:t.status,workerRole:t.workerRole};$7(c,e)||(s={...s,sidebarThreadSummaryById:{...s.sidebarThreadSummaryById,[t.id]:e}})}if(Z7(n?.session??null,t.session)||(s={...s,threadSessionById:{...s.threadSessionById,[t.id]:t.session}}),(n?.rateLimitStatus??G7)!==(t.rateLimitStatus??G7)&&(s={...s,threadRateLimitStatusById:{...s.threadRateLimitStatusById,[t.id]:t.rateLimitStatus??G7}}),n9(o,i)||(s={...s,threadTurnStateById:{...s.threadTurnStateById,[t.id]:i}}),n?.messages!==t.messages){let e=j_e(t);s={...s,messageIdsByThreadId:{...s.messageIdsByThreadId,[t.id]:e.ids},messageByThreadId:{...s.messageByThreadId,[t.id]:e.byId}}}if(n?.activities!==t.activities){let e=M_e(t);s={...s,activityIdsByThreadId:{...s.activityIdsByThreadId,[t.id]:e.ids},activityByThreadId:{...s.activityByThreadId,[t.id]:e.byId}}}if(n?.proposedPlans!==t.proposedPlans){let e=N_e(t);s={...s,proposedPlanIdsByThreadId:{...s.proposedPlanIdsByThreadId,[t.id]:e.ids},proposedPlanByThreadId:{...s.proposedPlanByThreadId,[t.id]:e.byId}}}if(n?.turnDiffSummaries!==t.turnDiffSummaries){let e=P_e(t);s={...s,turnDiffIdsByThreadId:{...s.turnDiffIdsByThreadId,[t.id]:e.ids},turnDiffSummaryByThreadId:{...s.turnDiffSummaryByThreadId,[t.id]:e.byId}}}return s}function s9(e,t){let n=e.threadShellById[t.shell.id],r=a9(e,t.shell.id,t.shell.projectId,n?.projectId);return t9(n,t.shell)||(r={...r,threadShellById:{...r.threadShellById,[t.shell.id]:t.shell}}),Z7(e.threadSessionById[t.shell.id]??null,t.session)||(r={...r,threadSessionById:{...r.threadSessionById,[t.shell.id]:t.session}}),n9(e.threadTurnStateById[t.shell.id],t.turnState)||(r={...r,threadTurnStateById:{...r.threadTurnStateById,[t.shell.id]:t.turnState}}),$7(e.sidebarThreadSummaryById[t.shell.id],t.summary)||(r={...r,sidebarThreadSummaryById:{...r.sidebarThreadSummaryById,[t.shell.id]:t.summary}}),r}function c9(e,t){return Object.fromEntries(Object.entries(e).flatMap(([e,n])=>t.has(e)?[[e,n]]:[]))}function l9(e,t){let n=e.threadShellById[t],r=e.sidebarThreadSummaryById[t],i=n?.projectId??r?.projectId;if(!i)return e;let a=r9(e.threadIds,t),o=r9(e.threadIdsByProjectId[i]??W7,t),s=o.length===0?(()=>{let{[i]:t,...n}=e.threadIdsByProjectId;return n})():{...e.threadIdsByProjectId,[i]:o},{[t]:c,...l}=e.threadShellById,{[t]:u,...d}=e.threadSessionById,{[t]:f,...p}=e.threadTurnStateById,{[t]:m,...h}=e.messageIdsByThreadId,{[t]:g,..._}=e.messageByThreadId,{[t]:v,...y}=e.activityIdsByThreadId,{[t]:b,...x}=e.activityByThreadId,{[t]:S,...C}=e.proposedPlanIdsByThreadId,{[t]:w,...T}=e.proposedPlanByThreadId,{[t]:ee,...E}=e.turnDiffIdsByThreadId,{[t]:te,...ne}=e.turnDiffSummaryByThreadId,{[t]:re,...ie}=e.sidebarThreadSummaryById;return{...e,threadIds:a,threadIdsByProjectId:s,threadShellById:l,threadSessionById:d,threadTurnStateById:p,messageIdsByThreadId:h,messageByThreadId:_,activityIdsByThreadId:y,activityByThreadId:x,proposedPlanIdsByThreadId:C,proposedPlanByThreadId:T,turnDiffIdsByThreadId:E,turnDiffSummaryByThreadId:ne,sidebarThreadSummaryById:ie}}function I_e(e,t){let n=new Set(e.threadIdsByProjectId[t]??W7);for(let[r,i]of Object.entries(e.threadShellById))i.projectId===t&&n.add(r);for(let[r,i]of Object.entries(e.sidebarThreadSummaryById))i.projectId===t&&n.add(r);return[...n]}function u9(e,t){let n=I_e(e,t);if(!e.projectById[t]&&n.length===0&&!e.projectIds.includes(t))return e;let r=e;for(let e of n)r=l9(r,e);let{[t]:i,...a}=r.projectById;return{...r,projectById:a,projectIds:r9(r.projectIds,t)}}function d9(e){return e===`error`?`error`:e===`missing`?`interrupted`:`completed`}function L_e(e,t){if(e.sequence!==void 0&&t.sequence!==void 0){if(e.sequence!==t.sequence)return e.sequence-t.sequence}else if(e.sequence!==void 0)return 1;else if(t.sequence!==void 0)return-1;return e.createdAt.localeCompare(t.createdAt)||e.id.localeCompare(t.id)}function f9(e){let t=e.previous?.turnId===e.turnId?e.previous.sourceProposedPlan:e.sourceProposedPlan;return{turnId:e.turnId,state:e.state,requestedAt:e.requestedAt,startedAt:e.startedAt,completedAt:e.completedAt,assistantMessageId:e.assistantMessageId,...t?{sourceProposedPlan:t}:{}}}function R_e(e,t,n){let r=!1,i=e.map(e=>e.turnId!==t||e.assistantMessageId===n?e:(r=!0,{...e,assistantMessageId:n??void 0}));return r?i:[...e]}function z_e(e,t,n){let r=new Set;for(let n of e){if(n.role===`system`){r.add(n.id);continue}n.turnId!==void 0&&n.turnId!==null&&t.has(n.turnId)&&r.add(n.id)}let i=e.filter(e=>e.role===`user`&&r.has(e.id)).length,a=Math.max(0,n-i);if(a>0){let n=e.filter(e=>e.role===`user`&&!r.has(e.id)&&(e.turnId===void 0||e.turnId===null||t.has(e.turnId))).toSorted((e,t)=>e.createdAt.localeCompare(t.createdAt)||e.id.localeCompare(t.id)).slice(0,a);for(let e of n)r.add(e.id)}let o=e.filter(e=>e.role===`assistant`&&r.has(e.id)).length,s=Math.max(0,n-o);if(s>0){let n=e.filter(e=>e.role===`assistant`&&!r.has(e.id)&&(e.turnId===void 0||e.turnId===null||t.has(e.turnId))).toSorted((e,t)=>e.createdAt.localeCompare(t.createdAt)||e.id.localeCompare(t.id)).slice(0,s);for(let e of n)r.add(e.id)}return e.filter(e=>r.has(e.id))}function B_e(e,t){return e.filter(e=>e.turnId===null||t.has(e.turnId))}function V_e(e,t){return e.filter(e=>e.turnId===null||t.has(e.turnId))}function p9(e,t,n){let r=V7(e,t);if(!r)return e;let i=n(r);return i===r?e:o9(e,i,r)}function m9(e,t,n,r){let i=p9(e,t,e=>({...e,...r,updatedAt:n})),a=i.sidebarThreadSummaryById[t];return!a||Object.keys(r).every(e=>a[e]===r[e])?i:{...i,sidebarThreadSummaryById:{...i.sidebarThreadSummaryById,[t]:{...a,...r}}}}function H_e(e){return{projectIds:e.map(e=>e.id),projectById:Object.fromEntries(e.map(e=>[e.id,e]))}}function h9(e,t){return e.environmentStateById[t]??U7}function g9(e,t,n){let r=e.environmentStateById[t]===n?e.environmentStateById:{...e.environmentStateById,[t]:n};return r===e.environmentStateById?e:{...e,environmentStateById:r}}function U_e(e,t,n){let r=t.projects.map(e=>j7(e,n)),i=new Set(t.threads.map(e=>e.id)),a={...e,...H_e(r),threadIds:[],threadIdsByProjectId:{},threadShellById:{},threadSessionById:{},threadTurnStateById:{},threadRateLimitStatusById:c9(e.threadRateLimitStatusById,i),sidebarThreadSummaryById:{},messageIdsByThreadId:c9(e.messageIdsByThreadId,i),messageByThreadId:c9(e.messageByThreadId,i),activityIdsByThreadId:c9(e.activityIdsByThreadId,i),activityByThreadId:c9(e.activityByThreadId,i),proposedPlanIdsByThreadId:c9(e.proposedPlanIdsByThreadId,i),proposedPlanByThreadId:c9(e.proposedPlanByThreadId,i),turnDiffIdsByThreadId:c9(e.turnDiffIdsByThreadId,i),turnDiffSummaryByThreadId:c9(e.turnDiffSummaryByThreadId,i),bootstrapComplete:!0};for(let e of t.threads)a=s9(a,J7(e,n));return a}function W_e(e,t,n){return g9(e,n,U_e(h9(e,n),t,n))}function G_e(e,t,n){let r=h9(e,n),i=V7(r,t.id);return g9(e,n,o9(r,q7(t,n),i))}function K_e(e,t,n,r){let i=h9(e,t);return g9(e,t,{...i,threadSubscriptionErrorById:{...i.threadSubscriptionErrorById,[n]:r}})}function q_e(e,t,n){let r=h9(e,t);if(!(n in r.threadSubscriptionErrorById))return e;let{[n]:i,...a}=r.threadSubscriptionErrorById;return g9(e,t,{...r,threadSubscriptionErrorById:a})}function _9(e,t,n){switch(t.type){case`project.created`:{let r=j7({id:t.payload.projectId,title:t.payload.title,workspaceRoot:t.payload.workspaceRoot,repositoryIdentity:t.payload.repositoryIdentity??null,defaultModelSelection:t.payload.defaultModelSelection,defaultThreadEnvMode:t.payload.defaultThreadEnvMode??null,cmmdRegistration:t.payload.cmmdRegistration??null,scripts:t.payload.scripts,createdAt:t.payload.createdAt,updatedAt:t.payload.updatedAt,deletedAt:null},n),i=e.projectIds.find(n=>n===t.payload.projectId||e.projectById[n]?.cwd===t.payload.workspaceRoot)??null,a=e.projectById,o=e.projectIds;if(i!==null&&i!==r.id){let{[i]:t,...n}=e.projectById;a={...n,[r.id]:r},o=e.projectIds.map(e=>e===i?r.id:e)}else a={...e.projectById,[r.id]:r},o=i===null&&!e.projectIds.includes(r.id)?[...e.projectIds,r.id]:e.projectIds;return{...e,projectById:a,projectIds:o}}case`project.meta-updated`:{let n=e.projectById[t.payload.projectId];if(!n)return e;let r=l_e(n,t.payload);return{...e,projectById:{...e.projectById,[t.payload.projectId]:r}}}case`project.deleted`:return u9(e,t.payload.projectId);case`thread.created`:{let r=V7(e,t.payload.threadId);return o9(e,q7({id:t.payload.threadId,projectId:t.payload.projectId,title:t.payload.title,modelSelection:t.payload.modelSelection,runtimeMode:t.payload.runtimeMode,interactionMode:t.payload.interactionMode,branch:t.payload.branch,worktreePath:t.payload.worktreePath,latestTurn:null,createdAt:t.payload.createdAt,updatedAt:t.payload.updatedAt,archivedAt:null,deletedAt:null,messages:[],proposedPlans:[],activities:[],checkpoints:[],session:null,anchorKind:t.payload.anchorKind,anchorCmmdId:t.payload.anchorCmmdId,kind:t.payload.kind,parentThreadId:t.payload.parentThreadId,status:t.payload.status,workerRole:t.payload.workerRole,goal:t.payload.goal??null,titleRegeneration:null,pendingAutoCreatePrompt:null},n),r)}case`thread.deleted`:return l9(e,t.payload.threadId);case`thread.archived`:return m9(e,t.payload.threadId,t.payload.updatedAt,{archivedAt:t.payload.archivedAt});case`thread.unarchived`:return m9(e,t.payload.threadId,t.payload.updatedAt,{archivedAt:null});case`thread.settled`:return m9(e,t.payload.threadId,t.payload.updatedAt,{settledAt:t.payload.settledAt,settledOverride:t.payload.settledOverride});case`thread.unsettled`:return m9(e,t.payload.threadId,t.payload.updatedAt,{settledAt:null,settledOverride:`active`});case`thread.meta-updated`:return p9(e,t.payload.threadId,e=>({...e,...t.payload.title===void 0?{}:{title:t.payload.title},...t.payload.modelSelection===void 0?{}:{modelSelection:M7(t.payload.modelSelection)},...t.payload.branch===void 0?{}:{branch:t.payload.branch},...t.payload.worktreePath===void 0?{}:{worktreePath:t.payload.worktreePath},...t.payload.anchorKind===void 0?{}:{anchorKind:t.payload.anchorKind},...t.payload.anchorCmmdId===void 0?{}:{anchorCmmdId:t.payload.anchorCmmdId},...t.payload.status===void 0?{}:{status:t.payload.status},...t.payload.parentThreadId===void 0?{}:{parentThreadId:t.payload.parentThreadId},...t.payload.goal===void 0?{}:{goal:t.payload.goal},...t.payload.linkedPullRequest===void 0?{}:{linkedPullRequest:t.payload.linkedPullRequest},...t.payload.titleRegeneration===void 0?{}:{titleRegeneration:t.payload.titleRegeneration},updatedAt:t.payload.updatedAt}));case`thread.runtime-mode-set`:return p9(e,t.payload.threadId,e=>({...e,runtimeMode:t.payload.runtimeMode,updatedAt:t.payload.updatedAt}));case`thread.interaction-mode-set`:return p9(e,t.payload.threadId,e=>({...e,interactionMode:t.payload.interactionMode,updatedAt:t.payload.updatedAt}));case`thread.turn-start-requested`:return p9(e,t.payload.threadId,e=>({...e,...t.payload.modelSelection===void 0?{}:{modelSelection:M7(t.payload.modelSelection)},runtimeMode:t.payload.runtimeMode,interactionMode:t.payload.interactionMode,pendingSourceProposedPlan:t.payload.sourceProposedPlan,latestTurn:f9({previous:e.latestTurn,turnId:d.make(t.payload.messageId),state:`running`,requestedAt:t.payload.createdAt,startedAt:t.payload.createdAt,completedAt:null,assistantMessageId:null,sourceProposedPlan:t.payload.sourceProposedPlan}),updatedAt:t.occurredAt}));case`thread.turn-interrupt-requested`:return t.payload.turnId===void 0?e:p9(e,t.payload.threadId,e=>{let n=e.latestTurn;return n===null||n.turnId!==t.payload.turnId?e:{...e,latestTurn:f9({previous:n,turnId:t.payload.turnId,state:`interrupted`,requestedAt:n.requestedAt,startedAt:n.startedAt??t.payload.createdAt,completedAt:n.completedAt??t.payload.createdAt,assistantMessageId:n.assistantMessageId}),updatedAt:t.occurredAt}});case`thread.message-sent`:return p9(e,t.payload.threadId,e=>{let n=F7(e.environmentId,{id:t.payload.messageId,role:t.payload.role,text:t.payload.text,...t.payload.attachments===void 0?{}:{attachments:t.payload.attachments},turnId:t.payload.turnId,streaming:t.payload.streaming,createdAt:t.payload.createdAt,updatedAt:t.payload.updatedAt}),r=(e.messages.find(e=>e.id===n.id)?e.messages.map(e=>e.id===n.id?{...e,text:n.streaming?`${e.text}${n.text}`:n.text.length>0?n.text:e.text,streaming:n.streaming,...n.turnId===void 0?{}:{turnId:n.turnId},...n.streaming?e.completedAt===void 0?{}:{completedAt:e.completedAt}:n.completedAt===void 0?{}:{completedAt:n.completedAt},...n.attachments===void 0?{}:{attachments:n.attachments}}:e):[...e.messages,n]).slice(-2e3),i=t.payload.role===`assistant`&&t.payload.turnId!==null?R_e(e.turnDiffSummaries,t.payload.turnId,t.payload.messageId):e.turnDiffSummaries,a=t.payload.role===`assistant`&&t.payload.turnId!==null&&(e.latestTurn===null||e.latestTurn.turnId===t.payload.turnId)?f9({previous:e.latestTurn,turnId:t.payload.turnId,state:t.payload.streaming?`running`:e.latestTurn?.state===`interrupted`?`interrupted`:e.latestTurn?.state===`error`?`error`:`completed`,requestedAt:e.latestTurn?.turnId===t.payload.turnId?e.latestTurn.requestedAt:t.payload.createdAt,startedAt:e.latestTurn?.turnId===t.payload.turnId?e.latestTurn.startedAt??t.payload.createdAt:t.payload.createdAt,sourceProposedPlan:e.pendingSourceProposedPlan,completedAt:t.payload.streaming?e.latestTurn?.turnId===t.payload.turnId?e.latestTurn.completedAt??null:null:t.payload.updatedAt,assistantMessageId:t.payload.messageId}):e.latestTurn;return{...e,messages:r,turnDiffSummaries:i,latestTurn:a,updatedAt:t.occurredAt}});case`thread.session-set`:return p9(e,t.payload.threadId,e=>({...e,session:P7(t.payload.session),error:q8(t.payload.session.lastError),latestTurn:t.payload.session.status===`running`&&t.payload.session.activeTurnId!==null?f9({previous:e.latestTurn,turnId:t.payload.session.activeTurnId,state:`running`,requestedAt:e.latestTurn?.turnId===t.payload.session.activeTurnId?e.latestTurn.requestedAt:t.payload.session.updatedAt,startedAt:e.latestTurn?.turnId===t.payload.session.activeTurnId?e.latestTurn.startedAt??t.payload.session.updatedAt:t.payload.session.updatedAt,completedAt:null,assistantMessageId:e.latestTurn?.turnId===t.payload.session.activeTurnId?e.latestTurn.assistantMessageId:null,sourceProposedPlan:e.pendingSourceProposedPlan}):e.latestTurn,updatedAt:t.occurredAt}));case`thread.session-stop-requested`:return p9(e,t.payload.threadId,e=>e.session===null?e:{...e,session:{...e.session,status:`closed`,orchestrationStatus:`stopped`,activeTurnId:void 0,updatedAt:t.payload.createdAt},updatedAt:t.occurredAt});case`thread.proposed-plan-upserted`:return p9(e,t.payload.threadId,e=>{let n=I7(t.payload.proposedPlan),r=[...e.proposedPlans.filter(e=>e.id!==n.id),n].toSorted((e,t)=>e.createdAt.localeCompare(t.createdAt)||e.id.localeCompare(t.id)).slice(-200);return{...e,proposedPlans:r,updatedAt:t.occurredAt}});case`thread.turn-diff-completed`:return p9(e,t.payload.threadId,e=>{let n=L7({turnId:t.payload.turnId,checkpointTurnCount:t.payload.checkpointTurnCount,checkpointRef:t.payload.checkpointRef,status:t.payload.status,files:t.payload.files,assistantMessageId:t.payload.assistantMessageId,completedAt:t.payload.completedAt}),r=e.turnDiffSummaries.find(e=>e.turnId===n.turnId);if(r&&r.status!==`missing`&&n.status===`missing`)return e;let i=[...e.turnDiffSummaries.filter(e=>e.turnId!==n.turnId),n].toSorted((e,t)=>(e.checkpointTurnCount??2**53-1)-(t.checkpointTurnCount??2**53-1)).slice(-500),a=e.latestTurn===null||e.latestTurn.turnId===t.payload.turnId?f9({previous:e.latestTurn,turnId:t.payload.turnId,state:d9(t.payload.status),requestedAt:e.latestTurn?.requestedAt??t.payload.completedAt,startedAt:e.latestTurn?.startedAt??t.payload.completedAt,completedAt:t.payload.completedAt,assistantMessageId:t.payload.assistantMessageId,sourceProposedPlan:e.pendingSourceProposedPlan}):e.latestTurn;return{...e,turnDiffSummaries:i,latestTurn:a,updatedAt:t.occurredAt}});case`thread.reverted`:return p9(e,t.payload.threadId,e=>{let n=e.turnDiffSummaries.filter(e=>e.checkpointTurnCount!==void 0&&e.checkpointTurnCount<=t.payload.turnCount).toSorted((e,t)=>(e.checkpointTurnCount??2**53-1)-(t.checkpointTurnCount??2**53-1)).slice(-500),r=new Set(n.map(e=>e.turnId)),i=z_e(e.messages,r,t.payload.turnCount).slice(-2e3),a=V_e(e.proposedPlans,r).slice(-200),o=B_e(e.activities,r),s=n.at(-1)??null;return{...e,turnDiffSummaries:n,messages:i,proposedPlans:a,activities:o,pendingSourceProposedPlan:void 0,latestTurn:s===null?null:{turnId:s.turnId,state:d9(s.status??`ready`),requestedAt:s.completedAt,startedAt:s.completedAt,completedAt:s.completedAt,assistantMessageId:s.assistantMessageId??null},updatedAt:t.occurredAt}});case`thread.activity-appended`:return p9(e,t.payload.threadId,e=>{let n=[...e.activities.filter(e=>e.id!==t.payload.activity.id),{...t.payload.activity}].toSorted(L_e).slice(-500);return{...e,activities:n,updatedAt:t.occurredAt}});case`thread.rate-limit-set`:return p9(e,t.payload.threadId,e=>({...e,rateLimitStatus:E_e(e.rateLimitStatus??[],t.payload),updatedAt:t.occurredAt}));case`thread.worker-spawned`:return p9(e,t.payload.workerThreadId,e=>({...e,kind:`worker`,parentThreadId:t.payload.masterThreadId,branch:t.payload.branch,worktreePath:t.payload.worktreePath,workerRole:t.payload.workerRole??e.workerRole??null,updatedAt:t.occurredAt}));case`thread.approval-response-requested`:case`thread.user-input-response-requested`:return e}return e}function J_e(e,t,n){switch(t.kind){case`project-upserted`:{let r=j7(t.project,n),i=e.projectIds.find(n=>n===t.project.id||e.projectById[n]?.cwd===t.project.workspaceRoot)??null,a=e.projectById,o=e.projectIds;if(i!==null&&i!==r.id){let{[i]:t,...n}=e.projectById;a={...n,[r.id]:r},o=e.projectIds.map(e=>e===i?r.id:e)}else a={...e.projectById,[r.id]:r},o=i===null&&!e.projectIds.includes(r.id)?[...e.projectIds,r.id]:e.projectIds;return{...e,projectById:a,projectIds:o}}case`project-removed`:return u9(e,t.projectId);case`thread-upserted`:return s9(e,J7(t.thread,n));case`thread-removed`:return l9(e,t.threadId)}}function Y_e(e,t,n){if(t.length===0)return e;let r=h9(e,n);return g9(e,n,t.reduce((e,t)=>_9(e,t,n),r))}function v9(e){return Object.entries(e.environmentStateById)}function y9(e,t){return t?h9(e,t):U7}function X_e(e,t){return i9(y9(e,t))}function Z_e(e){return v9(e).flatMap(([,e])=>F_e(e))}function Q_e(e){return v9(e).flatMap(([,e])=>i9(e))}function $_e(e){return v9(e).flatMap(([,e])=>b9(e).flatMap(t=>{let n=e.threadShellById[t];return n?[n]:[]}))}function b9(e){let t=[],n=new Set,r=e=>{n.has(e)||(n.add(e),t.push(e))};for(let t of e.threadIds)r(t);for(let t of Object.keys(e.threadShellById))r(t);for(let t of Object.keys(e.sidebarThreadSummaryById))r(t);return t}function x9(e,t,n){let r=t.sidebarThreadSummaryById[n];if(r)return r.environmentId===e?r:{...r,environmentId:e};let i=t.threadShellById[n];return i?{id:i.id,environmentId:e,projectId:i.projectId,title:i.title,modelSelection:i.modelSelection,interactionMode:i.interactionMode,session:t.threadSessionById[n]??null,createdAt:i.createdAt,archivedAt:i.archivedAt,settledAt:i.settledAt,settledOverride:i.settledOverride,updatedAt:i.updatedAt,latestTurn:t.threadTurnStateById[n]?.latestTurn??null,branch:i.branch,worktreePath:i.worktreePath,latestUserMessageAt:null,hasPendingApprovals:!1,hasPendingUserInput:!1,hasActionableProposedPlan:!1,anchorKind:i.anchorKind,anchorCmmdId:i.anchorCmmdId,goal:i.goal,titleRegeneration:i.titleRegeneration,kind:i.kind,parentThreadId:i.parentThreadId,workerRole:i.workerRole,status:i.status}:null}function eve(e){return v9(e).flatMap(([e,t])=>b9(t).flatMap(n=>{let r=x9(e,t,n);return r?[r]:[]}))}function S9(e,t){if(!t)return[];let n=y9(e,t.environmentId),r=n.threadIdsByProjectId[t.projectId]??W7;return(r.length>0?r:b9(n)).flatMap(e=>{let r=x9(t.environmentId,n,e);return!r||r.projectId!==t.projectId?[]:[r]})}function tve(e,t){return t.length===0?[]:t.length===1?S9(e,t[0]):t.flatMap(t=>S9(e,t))}function nve(e){return e.activeEnvironmentId===null?Object.values(e.environmentStateById).some(e=>e.bootstrapComplete):y9(e,e.activeEnvironmentId).bootstrapComplete}function rve(e,t){return t?y9(e,t.environmentId).projectById[t.projectId]:void 0}function ive(e,t){return t?V7(y9(e,t.environmentId),t.threadId):void 0}function ave(e,t){return t?y9(e,t.environmentId).threadShellById[t.threadId]!==void 0:!1}function ove(e,t){return t?x9(t.environmentId,y9(e,t.environmentId),t.threadId)??void 0:void 0}function sve(e,t,n){if(e.activeEnvironmentId===null)return e;let r=p9(h9(e,e.activeEnvironmentId),t,e=>e.error===n?e:{...e,error:n});return g9(e,e.activeEnvironmentId,r)}function cve(e,t,n){return g9(e,n,_9(h9(e,n),t,n))}function lve(e,t,n){return g9(e,n,J_e(h9(e,n),t,n))}function uve(e,t){return e.activeEnvironmentId===t?e:{...e,activeEnvironmentId:t}}function dve(e,t,n,r){let i=p9(h9(e,t.environmentId),t.threadId,e=>{if(e.branch===n&&e.worktreePath===r)return e;let t=e.worktreePath!==r;return{...e,branch:n,worktreePath:r,...t?{session:null}:{}}});return g9(e,t.environmentId,i)}var C9=ve(e=>({...D_e,setActiveEnvironmentId:t=>e(e=>uve(e,t)),syncServerShellSnapshot:(t,n)=>e(e=>W_e(e,t,n)),syncServerThreadDetail:(t,n)=>e(e=>G_e(e,t,n)),setThreadSubscriptionError:(t,n,r)=>e(e=>K_e(e,t,n,r)),clearThreadSubscriptionError:(t,n)=>e(e=>q_e(e,t,n)),applyOrchestrationEvent:(t,n)=>e(e=>cve(e,t,n)),applyOrchestrationEvents:(t,n)=>e(e=>Y_e(e,t,n)),applyShellEvent:(t,n)=>e(e=>lve(e,t,n)),setError:(t,n)=>e(e=>sve(e,t,n)),setThreadBranch:(t,n,r)=>e(e=>dve(e,t,n,r))}));function w9(){let e=new Map;return{getItem:t=>e.get(t)??null,setItem:(t,n)=>{e.set(t,n)},removeItem:t=>{e.delete(t)}}}function fve(e){return e!=null&&typeof e.getItem==`function`&&typeof e.setItem==`function`&&typeof e.removeItem==`function`}function T9(e){return fve(e)?e:w9()}var E9=w9();function D9(){return globalThis.localStorage||globalThis.window?.localStorage}var O9={getItem:e=>{try{let t=D9()?.getItem(e);if(t!==void 0)return t}catch{}return E9.getItem(e)},setItem:(e,t)=>{try{let n=D9();if(n){n.setItem(e,t);return}}catch{}E9.setItem(e,t)},removeItem:e=>{try{let t=D9();if(t){t.removeItem(e);return}}catch{}E9.removeItem(e)}};function pve(e){let t=O9.getItem(e);return typeof t==`string`?t:null}function mve(e,t){O9.setItem(e,t)}function hve(e){O9.removeItem(e)}function gve(e,t=300){let n=T9(e),r=new ye((e,t)=>{n.setItem(e,t)},{wait:t});return{getItem:e=>n.getItem(e),setItem:(e,t)=>{r.maybeExecute(e,t)},removeItem:e=>{r.cancel(),n.removeItem(e)},flush:()=>{r.flush()}}}function _ve(e){switch(e){case`running`:return`green`;case`provisioning`:case`starting`:return`amber-pulse`;case`registered`:return`idle`;case`stopped`:case`suspended`:case`draining`:return`grey`;case`destroyed`:return`idle`;case`error`:return`red-pulse`;default:return`grey`}}function k9(e){let t=e.githubRepoFullName;return t?t.split(`/`)[1]??t:vve(e.projectName)}function vve(e){let t=e.trim().toLowerCase().replaceAll(`'`,``).replaceAll(`"`,``).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``);return t.length>0?t:`project`}function A9(e){if(!e)return null;let t=e.trim().replace(/\/+$/,``);return t.length>0?t:null}function j9(e){let t=A9(e??void 0);return t&&M9(t).length>1?t:null}function M9(e){return e.split(`/`).flatMap(e=>e.split(`\\`)).filter(e=>e.length>0)}function N9(e){return e?M9(e).at(-1)??null:null}function yve(e){let t=e.rows.length>0;return(e.isLoading||e.startupPhase===`auth-refreshing`)&&!t?{kind:`loading`}:e.error&&!t?{kind:`error-no-rows`,message:e.error}:e.error&&t?{kind:`stale-rows`,message:e.error}:t?{kind:`rows`}:{kind:`empty`}}function bve(e,t){if(!t)return!1;let n=e.repositoryIdentity?.canonicalKey;return n!==void 0&&!n.toLowerCase().endsWith(`/${t.toLowerCase()}`)}function xve(e,t){return e?e.cmmdOrganizationId===t.cmmdOrganizationId&&e.cmmdProjectId===t.cmmdProjectId:!1}function Sve(e,t){let n=e.filter(e=>!e.cmmdRegistration),r=j9(t.workspaceRoot),i=r?n.filter(e=>A9(e.cwd)===r):[];if(i.length>0)return i;let a=k9(t).toLowerCase();return n.filter(e=>N9(e.cwd)?.toLowerCase()===a)}function P9(e,t,n){let r=e[t];if(!r)return null;let i=r.projectIds.flatMap(e=>{let t=r.projectById[e];return!t||bve(t,n.githubRepoFullName)?[]:[t]}),a=i.filter(e=>xve(e.cmmdRegistration,n)),o=a.length>0?a:Sve(i,n),s=o.length===1?o[0]:void 0;return s?{environmentId:t,projectId:s.id}:null}function Cve(e){return{cmmdOrganizationId:e.cmmdOrganizationId,cmmdProjectId:e.cmmdProjectId,githubRepoFullName:e.githubRepoFullName,projectName:e.projectName,workspaceRoot:e.workspaceRoot}}function wve(e,t){let n=e.cmmdEnvironmentId??e.environmentId;if(e.runtimeId===null||n===null)return null;let r=P9(t,p.make(n),Cve(e));return r?Pe(r.environmentId,r.projectId):null}function Tve(e,t){return e===t?!0:e===null||t===null?!1:e.environmentId===t.environmentId&&e.projectId===t.projectId}function Eve(e,t){let n=!1,r=e.map(e=>{let r=wve(e,t);return Tve(r,e.resolvedRef)?e:(n=!0,{...e,resolvedRef:r})});return n?r:e}var F9=`registered`,Dve={destroyed:`destroyed`,superseded:`destroyed`,error:`error`,failed:`error`,draining:`draining`,recycling:`draining`,stopped:`stopped`,suspended:`suspended`,provisioning:`provisioning`,created:`provisioning`,starting:`starting`,restarting:`starting`};function I9(e,t){let n=Dve[e];if(n!==void 0)return n;if(e!==`running`)return`stopped`;if(t)switch(t){case`app_ready`:case`server_ready`:case`ready`:case`supervisor_up`:return`running`;case`starting`:case`image_pulling`:case`waiting_state`:return`starting`;case`error`:return`error`;default:return`running`}return`running`}function Ove(e){return e===`destroyed`}function kve(e){switch(e){case`running`:case`starting`:case`provisioning`:return!0;case`suspended`:return!0;case`registered`:case`stopped`:case`draining`:case`error`:case`destroyed`:return!1;default:return!1}}function Ave(e){let t=e.shortName?.trim();if(t)return t;if(e.projectName)return e.projectName;if(e.githubRepoFullName){let t=e.githubRepoFullName.split(`/`),n=t[t.length-1];if(n)return n}return`project ${e.cmmdProjectId}`}var L9={state:`unknown`,label:`Unknown`,detail:`Current Environment availability has not been observed.`,tone:`muted`,automaticWakeAllowed:!1,shellConnected:!1,shellMayEstablishReady:!1};function R9(e,t,n,r,i,a,o=!1){return{state:e,label:t,detail:n,tone:r,automaticWakeAllowed:i,shellConnected:a,shellMayEstablishReady:o}}function jve(e,t){return e.ownerIntent===`paused`?R9(`paused`,`Paused`,`Resume before live work can wake this Environment.`,`warning`,!1,t):e.ownerIntent===`deleting`?R9(`deleting`,`Deleting`,`This Environment is being removed.`,`muted`,!1,t):null}function Mve(e,t){return e.executionAdmission.state===`allowed`?null:R9(`unavailable`,`Unavailable`,`This Environment is not accepting live work while it drains.`,`warning`,!1,t)}function z9(e,t=!1){if(e==null)return L9;let n=jve(e,t);if(n!==null)return n;if(e.ownerIntent!==`active`)return L9;let r=Mve(e,t);if(r!==null)return r;let{provider:i,guestReadiness:a,activeWork:o}=e;return i.observedAt===null||i.failure!==null||i.state===`absent`||i.state===`unknown`?R9(`unknown`,`Unknown`,`Current provider availability has not been observed.`,`muted`,e.automaticWakeAllowed,t):i.state===`sleeping`?R9(`sleeping`,`Sleeping`,`Live work wakes this Environment automatically.`,`muted`,e.automaticWakeAllowed,t):a.observedAt===null||a.failure!==null||a.state===`unknown`?R9(`unknown`,`Unknown`,`Current guest readiness has not been observed.`,`muted`,e.automaticWakeAllowed,t):a.state===`starting`?R9(`starting`,`Starting`,`Preparing live execution.`,`warning`,e.automaticWakeAllowed,t):a.state===`degraded`?R9(`degraded`,`Degraded`,`A required service needs attention.`,`warning`,e.automaticWakeAllowed,t):a.state===`failed`?R9(`needs-attention`,`Needs attention`,`The readiness check failed.`,`destructive`,e.automaticWakeAllowed,t):t?R9(`ready`,`Ready`,null,`success`,e.automaticWakeAllowed,!0):o.state===`active`?R9(`ready`,`Ready`,null,`success`,e.automaticWakeAllowed,t):R9(`unknown`,`Unknown`,`No current execution proof is available.`,`muted`,e.automaticWakeAllowed,t,!0)}function Nve(e,t){return!t||!e.shellMayEstablishReady?e:R9(`ready`,`Ready`,null,`success`,e.automaticWakeAllowed,!0)}function B9(e){return e?I9(e.status,e.readinessPhase??void 0):F9}function Pve(e){return e.runtime?.githubRepoFullName??e.githubRepoFullName??null}function Fve(e,t){return{cmmdOrganizationId:e.organizationId,cmmdProjectId:e.projectId,projectName:Ave({shortName:e.shortName??null,projectName:e.projectName??null,githubRepoFullName:t,cmmdProjectId:e.projectId}),githubRepoFullName:t,iconUrl:e.iconUrl??null,icon:e.icon??null}}function Ive(e){return e?{runtimeId:e.runtimeId,workspaceRoot:e.workspaceRoot??null,status:B9(e),desiredState:V9(e.desiredState),environmentId:gt(e.runtimeId),cmmdEnvironmentId:e.environmentId??null,...e.maintenance===void 0?{}:{maintenance:e.maintenance}}:{runtimeId:null,workspaceRoot:null,status:F9,desiredState:null,environmentId:null,cmmdEnvironmentId:null}}function V9(e){return e===`running`||e===`stopped`||e===`destroyed`?e:null}function Lve(e){return{...Fve(e,Pve(e)),registeredAt:e.registeredAt??null,...Ive(e.runtime),removal:e.removal??null,resolvedRef:null}}function Rve(e){return e.map(Lve)}function zve(e){return e.map(e=>({runtimeId:e.runtime.runtimeId,cmmdOrganizationId:e.organizationId,cmmdUserId:e.userId,displayName:e.displayName??null,userFirstName:e.userFirstName??null,environmentId:gt(e.runtime.runtimeId),cmmdEnvironmentId:e.runtime.environmentId??null,status:B9(e.runtime),desiredState:V9(e.runtime.desiredState),...e.runtime.maintenance===void 0?{}:{maintenance:e.runtime.maintenance},lifecycle:z9(e.lifecycle)}))}var H9=`forge:cmmd-cloud-project-catalog:v5`,Bve=re({runtimeId:b(E),cmmdOrganizationId:y,cmmdProjectId:y,cmmdEnvironmentId:b(E),registeredAt:o(b(E)),projectName:E,githubRepoFullName:b(E),workspaceRoot:b(E),iconUrl:o(b(E)),icon:o(b(E)),status:E,desiredState:o(b(E)),environmentId:b(E),removal:o(b(re({operationId:E,deletePlanningProject:_,status:w([`pending`,`running`,`retryable`]),phase:w([`destroy_runtime`,`purge_execution_state`,`delete_planning_project`,`unregister`,`complete`]),lastErrorCode:b(E),lastErrorMessage:b(E),updatedAt:E})))}),U9=re({rows:T(Bve),environments:T(re({runtimeId:E,cmmdOrganizationId:y,cmmdUserId:y,displayName:o(b(E)),userFirstName:o(b(E)),environmentId:E,cmmdEnvironmentId:b(E),status:E,desiredState:b(E)})),fetchedAt:E});function Vve(){pt(H9)}function Hve(){try{let e=dt(H9,U9);return e?{rows:e.rows.map(e=>({runtimeId:e.runtimeId,cmmdOrganizationId:e.cmmdOrganizationId,cmmdProjectId:e.cmmdProjectId,registeredAt:e.registeredAt??null,projectName:e.projectName,githubRepoFullName:e.githubRepoFullName,workspaceRoot:e.workspaceRoot,iconUrl:e.iconUrl??null,icon:e.icon??null,status:e.runtimeId===null?F9:I9(e.status),desiredState:V9(e.desiredState),environmentId:e.runtimeId===null?null:gt(e.runtimeId),cmmdEnvironmentId:e.cmmdEnvironmentId,resolvedRef:null,removal:e.removal??null})),environments:e.environments.map(e=>({runtimeId:e.runtimeId,cmmdOrganizationId:e.cmmdOrganizationId,cmmdUserId:e.cmmdUserId,displayName:e.displayName??null,userFirstName:e.userFirstName??null,cmmdEnvironmentId:e.cmmdEnvironmentId,status:I9(e.status),desiredState:V9(e.desiredState),environmentId:gt(e.runtimeId)})),fetchedAt:e.fetchedAt}:null}catch{return null}}function Uve(e,t,n){try{ft(H9,{rows:e.map(e=>({runtimeId:e.runtimeId,cmmdOrganizationId:e.cmmdOrganizationId,cmmdProjectId:e.cmmdProjectId,cmmdEnvironmentId:e.cmmdEnvironmentId,registeredAt:e.registeredAt,projectName:e.projectName,githubRepoFullName:e.githubRepoFullName,workspaceRoot:e.workspaceRoot,iconUrl:e.iconUrl,icon:e.icon,status:e.status,environmentId:e.environmentId,removal:e.removal})),environments:t,fetchedAt:n},U9)}catch{}}var W9=1e3;function Wve(e){return e.reconnectPhase===`idle`?`hidden`:e.reconnectPhase===`exhausted`?`actionable`:!e.hasConnected||!e.stableConnectionSeen?`startup-pending`:`actionable`}function G9(e){let t=e.maxAttempts??2,n=e.retryDelayMs??1e3;return e.failedAttempt<t?{kind:`retry`,delayMs:n,nextAttempt:e.failedAttempt+1}:{kind:`terminal`,attempt:e.failedAttempt}}var Gve=`auth-required`,Kve=`cloud-projects`;async function qve(e,t,n){let r=null,i=new u7(e).listCloudProjects({signal:t.signal}).then(e=>({kind:`catalog`,catalog:e})).catch(e=>({kind:`failed`,error:e})),a=new Promise(e=>{r=setTimeout(()=>{t.abort(),e({kind:`timed-out`})},n)});try{return await Promise.race([i,a])}finally{r!==null&&clearTimeout(r)}}function Jve(e){let t=e.accessToken??e.resolveAccessToken?.(),n={Accept:`text/event-stream`};return t&&(n.Authorization=`Bearer ${t}`),n}function Yve(e,t){let n=new URL(e);return n.pathname=t,n.search=``,n.hash=``,n.toString()}async function K9(e){return(e.status===401||e.status===403)&&(await $ve(e)||e.status===401)?`auth-required`:e.status===404||e.status===405||!e.ok||!e.body?`fallback`:e.body.getReader()}async function Xve({reader:e,signal:t,onAuthRequired:n,onCatalog:r}){let i=new TextDecoder,a=``;try{for(;!t.aborted;){let{done:o,value:s}=await e.read();if(t.aborted||o)return;let c=Zve(a,i.decode(s,{stream:!0}));if(a=c.buffer,c.messages.some(e=>Qve(e,n,r)))return}}finally{e.releaseLock()}}function Zve(e,t){let n=`${e}${t}`.split(/\n\n/);return{buffer:n.pop()??``,messages:n}}function Qve(e,t,n){let r=tye(e);if(r.name===Gve)return t(),!0;let i=r.name===Kve?eye(r.data):null;return i&&n(i),!1}async function $ve(e){try{let t=await e.clone().json();return typeof t?.code==`string`&&t.code===`CMMD_AUTH_REQUIRED`}catch{return!1}}function eye(e){try{return i7(JSON.parse(e))}catch{return null}}function tye(e){let t=``,n=``;for(let r of e.split(`
|
|
1007
|
+
`))r.startsWith(`event: `)&&(t=r.slice(7).trim()),r.startsWith(`data: `)&&(n=r.slice(6).trim());return{name:t,data:n}}var nye=`/api/cmmd/forge-cloud-projects`,rye=`/api/cmmd/forge-cloud-projects/events`,iye=15e3,aye=3e4,oye=2e3,sye=3e4,cye=200;function q9(e){return e!==null&&clearTimeout(e),null}function lye({config:e,onEvent:t}){let n=!1,r=!1,i=!1,a=!1,o=!1,s=0,c=null,l=0,u=null,d=null,f=0,p=null,m=null,h=null,g=null;function _(){p=q9(p),g=q9(g)}function v(){f+=1,d?.controller.abort(),d=null}function y(e,t){return d?.controller===e&&d.generation===t&&f===t}function b(e){return u===e}function x(){v(),u?.abort(),u=null,_(),h=q9(h)}function S(){return!r&&!a}function C(e){t({kind:`catalog`,catalog:e,fetchedAt:new Date().toISOString()})}function w(e){a||r||(a=!0,c=null,x(),t({kind:`auth-required`,message:e}))}function T(e,n){if(r||a)return;s+=1,c=n;let i=G9({failedAttempt:s,retryDelayMs:W9});if(i.kind===`terminal`){w(e);return}u?.abort(),u=null,g=q9(g),t({kind:`auth-refreshing`}),o=!0,h=q9(h),h=setTimeout(()=>{h=null,o=!1,he()},i.delayMs)}async function ee(){if(!S())return!1;let n=new AbortController,r=++f;d={controller:n,generation:r},t({kind:`loading`});try{return E(await qve(e,n,iye),n,r)}finally{y(n,r)&&(d=null)}}function E(e,t,n){return!S()||!y(t,n)?!1:e.kind===`catalog`?te(e.catalog):e.kind===`timed-out`?ne():re(e.error)}function te(e){return c!==`sse`&&(s=0,c=null),o=!1,C(e),!0}function ne(){return t({kind:`failed`,message:`Cloud connection refresh timed out. Showing last known connections.`}),!a}function re(e){let n=e instanceof Error?e.message:`Failed to load cloud projects`;return h5(e)||uye(e)||/authentication required/i.test(n)?T(n,`list`):t({kind:`failed`,message:n}),!a}function ie(){S()&&(p=q9(p),p=setTimeout(async()=>{await ee(),S()&&ie()},aye))}function ae(){!S()||o||(i?ie():se(l))}function oe(e){l=e+1;let t=Math.min(oye*2**e,sye);g=q9(g),g=setTimeout(()=>{g=null,se(l)},t)}function D(e){s=0,c=null,l=0,C(e)}async function se(t){if(!S()||u!==null)return;u=new AbortController;let n=u,r=e.eventsUrl??Yve(e.cmmdHttpBaseUrl,`/api/forge/context/runtimes/events`),i=e.eventsUrl?{Accept:`text/event-stream`}:Jve(e);try{await ce(await fetch(r,{headers:i,signal:n.signal,credentials:`include`}),n,t)}catch{pe(n)}}async function ce(e,t,n){if(!le(t))return;let r=await K9(e);if(le(t)){if(typeof r==`string`){fe(r);return}await Xve({reader:r,signal:t.signal,onAuthRequired:()=>ue(t),onCatalog:e=>de(t,e)}),me(t,n)}}function le(e){return S()&&b(e)}function ue(e){le(e)&&T(`CMMD authentication required. Sign in again to continue.`,`sse`)}function de(e,t){le(e)&&D(t)}function fe(e){if(u=null,e===`auth-required`){T(`CMMD authentication required. Sign in again to continue.`,`sse`);return}i=!0,ie()}function pe(e){e.signal.aborted||!le(e)||(u=null,i=!0,ie())}function me(e,t){e.signal.aborted||!le(e)||(u=null,oe(t))}function he(){return ee().then(e=>{e&&S()&&ae()})}return{initialize(){n||r||(n=!0,he())},refresh(){r||(v(),m=q9(m),m=setTimeout(()=>{m=null,a=!1,o=!1,s=0,c=null,x(),he()},cye))},teardown(){r=!0,m=q9(m),x()}}}function uye(e){return typeof e==`object`&&!!e&&`kind`in e&&e.kind===`auth`}var J9={connected:!1,isLoading:!1,error:null,rows:[],environments:[],fetchedAt:null,stale:!1,startupPhase:`idle`,capacity:null};function dye({config:e}){let t=Hve(),n=t?{...J9,isLoading:!0,rows:t.rows,environments:t.environments,fetchedAt:t.fetchedAt,stale:!0}:J9,r=new Set;function i(e){n=e;for(let e of r)e()}function a(e){switch(e.kind){case`loading`:i({...n,isLoading:!0,error:null});return;case`catalog`:{let t=Rve(e.catalog.listRowsForDisplay()),n=zve(e.catalog.listEnvironmentsForDisplay());Uve(t,n,e.fetchedAt),i({connected:!0,isLoading:!1,error:null,rows:t,environments:n,fetchedAt:e.fetchedAt,stale:!1,startupPhase:`idle`,capacity:e.catalog.capacity});return}case`failed`:i({...n,connected:!1,isLoading:!1,error:e.message,stale:n.rows.length>0,startupPhase:`idle`});return;case`auth-refreshing`:i({...n,connected:!1,isLoading:!0,error:null,stale:n.rows.length>0,startupPhase:`auth-refreshing`});return;case`auth-required`:i({...n,connected:!1,isLoading:!1,error:e.message,stale:n.rows.length>0,startupPhase:`idle`}),ie(`cmmd-runtimes`);return}}let o=lye({config:e,onEvent:a});return{subscribe(e){return r.add(e),()=>r.delete(e)},read(){return n},initialize(){o.initialize()},refresh(){o.refresh()},_teardown(){o.teardown()},_setState(e){i(e)}}}var Y9=null;function X9(e){return typeof window<`u`&&window.location?.href?new URL(e,window.location.href).toString():new URL(e,`http://localhost`).toString()}function Z9(){return{cmmdHttpBaseUrl:`https://cmmd.ai`,resolveAccessToken:()=>null,listUrl:nye,eventsUrl:rye,destroyUrl:e=>X9(`/api/cmmd/forge-runtimes/${encodeURIComponent(e)}/destroy`),lifecycleUrl:(e,t)=>X9(`/api/cmmd/forge-runtimes/${encodeURIComponent(e)}/${t}`),updateCommitUrl:e=>X9(`/api/cmmd/forge-runtimes/${encodeURIComponent(e)}/update-commit`),updateCommitOperationUrl:(e,t)=>X9(`/api/cmmd/forge-runtimes/${encodeURIComponent(e)}/update-commit/${encodeURIComponent(String(t))}`),ensureUrl:X9(`/api/cmmd/forge-runtimes/ensure`)}}function Q9(){return Y9===null&&(Y9=dye({config:Z9()})),Y9}function fye(){Q9().refresh()}function pye(e){return Q9().subscribe(e)}function $9(){return Q9().read()}function mye(e){let t=(0,He.c)(9),n=e?.enabled??!0,r,i;t[0]===n?(r=t[1],i=t[2]):(r=()=>{n&&Q9().initialize()},i=[n],t[0]=n,t[1]=r,t[2]=i),(0,k.useEffect)(r,i);let a=(0,k.useSyncExternalStore)(pye,$9,$9),o=C9(hye),s,c;t[3]!==o||t[4]!==a.rows?(c=Eve(a.rows,o),t[3]=o,t[4]=a.rows,t[5]=c):c=t[5],s=c;let l=s,u;return t[6]!==l||t[7]!==a?(u=l===a.rows?a:{...a,rows:l},t[6]=l,t[7]=a,t[8]=u):u=t[8],u}function hye(e){return e.environmentStateById}export{T7 as $,q8 as $t,y9 as A,rt as An,gge as At,Q_e as B,Ve as Bn,Xhe as Bt,gve as C,pt as Cn,Sge as Ct,T9 as D,at as Dn,$5 as Dt,hve as E,ot as En,kge as Et,S9 as F,nee as Fn,Mhe as Ft,k7 as G,je as Gn,whe as Gt,C9 as H,Fe as Hn,$he as Ht,tve as I,Ye as In,B5 as It,E7 as J,xe as Jn,Che as Jt,D7 as K,Se as Kn,The as Kt,ive as L,Xe as Ln,R5 as Lt,Z_e as M,Ze as Mn,J5 as Mt,ove as N,Qe as Nn,M5 as Nt,mve as O,tt as On,mge as Ot,eve as P,$e as Pn,tge as Pt,O7 as Q,K8 as Qt,ave as R,Ke as Rn,Qhe as Rt,O9 as S,dt as Sn,Dge as St,pve as T,iee as Tn,bge as Tt,V7 as U,eee as Un,Ahe as Ut,X_e as V,Pe as Vn,I5 as Vt,c_e as W,tee as Wn,h5 as Wt,n_e as X,t5 as Xt,r_e as Y,r5 as Yt,t_e as Z,ahe as Zt,N9 as _,jt as _n,u7 as _t,K9 as a,mn as an,v7 as at,yve as b,ht as bn,Ege as bt,Wve as c,uee as cn,Jge as ct,Nve as d,Xt as dn,Yge as dt,W8 as en,A7 as et,kve as f,Qt as fn,qge as ft,k9 as g,xt as gn,Zge as gt,P9 as h,Zt as hn,Gge as ht,mye as i,Kn as in,b7 as it,rve as j,et as jn,pge as jt,nve as k,nt as kn,hge as kt,Vve as l,Kt as ln,Xge as lt,I9 as m,Yt as mn,_7 as mt,fye as n,Qn as nn,s_e as nt,W9 as o,cee as on,Kge as ot,Ove as p,qt as pn,S7 as pt,w7 as q,Ce as qn,Ehe as qt,Z9 as r,qn as rn,C7 as rt,G9 as s,an as sn,y7 as st,$9 as t,G8 as tn,i_e as tt,z9 as u,Jt as un,Qge as ut,j9 as v,aee as vn,e7 as vt,w9 as w,ft as wn,wge as wt,_ve as x,gt as xn,Mge as xt,A9 as y,bt as yn,Q5 as yt,$_e as z,Be as zn,E5 as zt};
|
|
1008
|
+
//# sourceMappingURL=cmmdForgeRuntimeListResource-lbV63vQg.js.map
|