(()=>{var Fi=Object.defineProperty,$i=Object.defineProperties;var Bi=Object.getOwnPropertyDescriptors;var sr=Object.getOwnPropertySymbols;var ji=Object.prototype.hasOwnProperty,Hi=Object.prototype.propertyIsEnumerable;var Bt=(t,e,n)=>e in t?Fi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,c=(t,e)=>{for(var n in e||(e={}))ji.call(e,n)&&Bt(t,n,e[n]);if(sr)for(var n of sr(e))Hi.call(e,n)&&Bt(t,n,e[n]);return t},v=(t,e)=>$i(t,Bi(e));var j=(t,e,n)=>Bt(t,typeof e!="symbol"?e+"":e,n);var x=(t,e,n)=>new Promise((r,i)=>{var s=u=>{try{a(n.next(u))}catch(p){i(p)}},o=u=>{try{a(n.throw(u))}catch(p){i(p)}},a=u=>u.done?r(u.value):Promise.resolve(u.value).then(s,o);a((n=n.apply(t,e)).next())});var Ya=new RegExp("^(?:[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}))*)+$","u");var jt;function Gi(t){return jt==null?void 0:jt.get(t)}var Ht;function qi(t){return Ht==null?void 0:Ht.get(t)}var Gt;function zi(t,e){var n;return(n=Gt==null?void 0:Gt.get(t))==null?void 0:n.get(e)}function ar(t){var n,r,i;let e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(i=t&&((r=(n=Object.getPrototypeOf(t))==null?void 0:n.constructor)==null?void 0:r.name))!=null?i:"null":e}function Se(t,e,n,r,i){var f,h,g,y,L,b,F,B;let s=i&&"input"in i?i.input:n.value,o=(h=(f=i==null?void 0:i.expected)!=null?f:t.expects)!=null?h:null,a=(g=i==null?void 0:i.received)!=null?g:ar(s),u={kind:t.kind,type:t.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:i==null?void 0:i.path,issues:i==null?void 0:i.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},p=t.kind==="schema",l=(B=(F=(b=(L=(y=i==null?void 0:i.message)!=null?y:t.message)!=null?L:zi(t.reference,u.lang))!=null?b:p?qi(u.lang):null)!=null?F:r.message)!=null?B:Gi(u.lang);l&&(u.message=typeof l=="function"?l(u):l),p&&(n.typed=!1),n.issues?n.issues.push(u):n.issues=[u]}function Wi(t,e){var r;let n=[...new Set(t)];return n.length>1?`(${n.join(` ${e} `)})`:(r=n[0])!=null?r:"never"}function qt(t,e){return{kind:"schema",type:"array",reference:qt,expects:"Array",async:!1,item:t,message:e,_run(n,r){var s;let i=n.value;if(Array.isArray(i)){n.typed=!0,n.value=[];for(let o=0;on.expects),"|"),async:!1,options:t,message:e,_run(n,r){let i,s,o;for(let a of this.options){let u=a._run({typed:!1,value:n.value},r);if(u.typed)if(u.issues)s?s.push(u):s=[u];else{i=u;break}else o?o.push(u):o=[u]}if(i)return i;if(s){if(s.length===1)return s[0];Se(this,"type",n,r,{issues:or(s)}),n.typed=!0}else{if((o==null?void 0:o.length)===1)return o[0];Se(this,"type",n,r,{issues:or(o)})}return n}}}var et=class{constructor(e){j(this,"browser");j(this,"sessionStorageKey");j(this,"sessionCartIdentifier");j(this,"blank");this.browser=e,this.sessionStorageKey="orderediting-storage",this.sessionCartIdentifier="orderediting-cart-identifier",this.blank={searchedItems:[],removeItem:[],viewedItems:[],checkoutStarted:[],CartIds:null},this.initialize()}initialize(){this.get().then(e=>{e===null&&this.browser.sessionStorage.setItem(this.sessionStorageKey,JSON.stringify(this.blank))}).catch(()=>this.browser.sessionStorage.setItem(this.sessionStorageKey,JSON.stringify(this.blank)))}setCartIdentifier(e){return x(this,null,function*(){try{yield this.browser.sessionStorage.setItem(this.sessionCartIdentifier,e)}catch(n){console.error(n)}})}getCartIdentifier(){return x(this,null,function*(){try{let e=yield this.browser.sessionStorage.getItem(this.sessionCartIdentifier);return e||null}catch(e){return console.error(e),null}})}clear(){try{this.browser.sessionStorage.setItem(this.sessionStorageKey,JSON.stringify(this.blank))}catch(e){console.error(e)}}upsert(e,n){return x(this,null,function*(){var r;try{let i=(r=yield this.get())!=null?r:this.blank;i===null&&this.set(this.blank);let s=i;Array.isArray(e)?s[n].push(...e):s[n].push(e),this.set(s)}catch(i){console.error(i)}})}set(e){return x(this,null,function*(){try{yield this.browser.sessionStorage.setItem(this.sessionStorageKey,JSON.stringify(e))}catch(n){console.error(n)}})}get(){return x(this,null,function*(){try{let e=yield this.browser.sessionStorage.getItem(this.sessionStorageKey);return e?JSON.parse(e):null}catch(e){return console.error(e),null}})}};var ur="WebPixel::Render";var Yt=t=>shopify.extend(ur,t);var Vi={"orderediting-customer-accounts.myshopify.com":{appUrl:"https://f67f-184-175-34-174.ngrok-free.app",namespace:"app--221449486337--orderediting",appNamespace:"app--221449486337--",checkout_namespace:"strategy",table:"order-edits"},"andrej-orderediting-staging.myshopify.com":{appUrl:"https://andrej-oe.ngrok.app",namespace:"app--218911539201--orderediting",appNamespace:"app--218911539201--",checkout_namespace:"strategy",table:"order-edits-priority"},"orderediting-customer-accounts-staging.myshopify.com":{appUrl:"https://viaglamourca-order-editing-env-staging-via-glamour.vercel.app",namespace:"app--253594402817--orderediting",appNamespace:"app--253594402817--",checkout_namespace:"strategy",table:"order-edits"},"orderediting-customer-accounts":{appUrl:"https://f67f-184-175-34-174.ngrok-free.app",namespace:"app--221449486337--orderediting",appNamespace:"app--221449486337--",checkout_namespace:"strategy",table:"order-edits"},"andrej-orderediting-staging":{appUrl:"https://andrej-oe.ngrok.app",namespace:"app--218911539201--orderediting",appNamespace:"app--218911539201--",checkout_namespace:"strategy",table:"order-edits-priority"},"orderediting-customer-accounts-staging":{appUrl:"https://viaglamourca-order-editing-env-staging-via-glamour.vercel.app",namespace:"app--253594402817--orderediting",appNamespace:"app--253594402817--",checkout_namespace:"strategy",table:"order-edits"},"andrej-oe-plus":{appUrl:"https://andrej-oe.ngrok.app",namespace:"app--286257840129--orderediting",appNamespace:"app--286257840129--",checkout_namespace:"strategy",table:"order-edits-priority"},"andrej-oe-plus.myshopify.com":{appUrl:"https://andrej-oe.ngrok.app",namespace:"app--286257840129--orderediting",appNamespace:"app--286257840129--",checkout_namespace:"strategy",table:"order-edits-priority"},developer:{appUrl:"https://f67f-184-175-34-174.ngrok-free.app",namespace:"$app:orderediting",appNamespace:"app--221449486337--",checkout_namespace:"strategy",table:"order-edits"},default:{appUrl:"https://app.orderediting.com",namespace:"$app:orderediting",appNamespace:"app--34646425601--",checkout_namespace:"strategy",table:"order-edits"},production:{appUrl:"https://app.orderediting.com",namespace:"$app:orderediting",appNamespace:"app--34646425601--",checkout_namespace:"strategy",table:"order-edits"}},Vt=Vi;var _=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__;var W="8.55.0";var m=globalThis;function le(t,e,n){let r=n||m,i=r.__SENTRY__=r.__SENTRY__||{},s=i[W]=i[W]||{};return s[t]||(s[t]=e())}var H=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__;var Ki="Sentry Logger ",Be=["debug","info","warn","error","log","assert","trace"],be={};function M(t){if(!("console"in m))return t();let e=m.console,n={},r=Object.keys(be);r.forEach(i=>{let s=be[i];n[i]=e[i],e[i]=s});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}function Xi(){let t=!1,e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return H?Be.forEach(n=>{e[n]=(...r)=>{t&&M(()=>{m.console[n](`${Ki}[${n}]:`,...r)})}}):Be.forEach(n=>{e[n]=()=>{}}),e}var d=le("logger",Xi);var J="?",cr=/\(error: (.*)\)/,pr=/captureMessage|captureException/;function nt(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,i=0)=>{let s=[],o=n.split(` `);for(let a=r;a1024)continue;let p=cr.test(u)?u.replace(cr,"$1"):u;if(!p.match(/\S*Error: /)){for(let l of e){let f=l(p);if(f){s.push(f);break}}if(s.length>=50+i)break}}return lr(s.slice(i))}}function Xt(t){return Array.isArray(t)?nt(...t):t}function lr(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(tt(e).function||"")&&e.pop(),e.reverse(),pr.test(tt(e).function||"")&&(e.pop(),pr.test(tt(e).function||"")&&e.pop()),e.slice(0,50).map(n=>v(c({},n),{filename:n.filename||tt(e).filename,function:n.function||J}))}function tt(t){return t[t.length-1]||{}}var Kt="";function G(t){try{return!t||typeof t!="function"?Kt:t.name||Kt}catch(e){return Kt}}function rt(t){let e=t.exception;if(e){let n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch(r){return}}}var it={},fr={};function N(t,e){it[t]=it[t]||[],it[t].push(e)}function R(t,e){if(!fr[t]){fr[t]=!0;try{e()}catch(n){H&&d.error(`Error while instrumenting ${t}`,n)}}}function k(t,e){let n=t&&it[t];if(n)for(let r of n)try{r(e)}catch(i){H&&d.error(`Error while triggering instrumentation handler. Type: ${t} Name: ${G(r)} Error:`,i)}}var Jt=null;function Zt(t){let e="error";N(e,t),R(e,Ji)}function Ji(){Jt=m.onerror,m.onerror=function(t,e,n,r,i){return k("error",{column:r,error:i,line:n,msg:t,url:e}),Jt?Jt.apply(this,arguments):!1},m.onerror.__SENTRY_INSTRUMENTED__=!0}var Qt=null;function en(t){let e="unhandledrejection";N(e,t),R(e,Zi)}function Zi(){Qt=m.onunhandledrejection,m.onunhandledrejection=function(t){return k("unhandledrejection",t),Qt?Qt.apply(this,arguments):!0},m.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function de(){return je(m),m}function je(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||W,e[W]=e[W]||{}}var dr=Object.prototype.toString;function me(t){switch(dr.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Z(t,Error)}}function Ie(t,e){return dr.call(t)===`[object ${e}]`}function st(t){return Ie(t,"ErrorEvent")}function ot(t){return Ie(t,"DOMError")}function tn(t){return Ie(t,"DOMException")}function C(t){return Ie(t,"String")}function xe(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function he(t){return t===null||xe(t)||typeof t!="object"&&typeof t!="function"}function Y(t){return Ie(t,"Object")}function ye(t){return typeof Event!="undefined"&&Z(t,Event)}function nn(t){return typeof Element!="undefined"&&Z(t,Element)}function rn(t){return Ie(t,"RegExp")}function oe(t){return!!(t&&t.then&&typeof t.then=="function")}function sn(t){return Y(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Z(t,e){try{return t instanceof e}catch(n){return!1}}function He(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}var on=m,Qi=80;function Ge(t,e={}){if(!t)return"";try{let n=t,r=5,i=[],s=0,o=0,a=" > ",u=a.length,p,l=Array.isArray(e)?e:e.keyAttrs,f=!Array.isArray(e)&&e.maxStringLength||Qi;for(;n&&s++1&&o+i.length*u+p.length>=f));)i.push(p),o+=p.length,n=n.parentNode;return i.reverse().join(a)}catch(n){return""}}function es(t,e){let n=t,r=[];if(!n||!n.tagName)return"";if(on.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let i=e&&e.length?e.filter(o=>n.getAttribute(o)).map(o=>[o,n.getAttribute(o)]):null;if(i&&i.length)i.forEach(o=>{r.push(`[${o[0]}="${o[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let o=n.className;if(o&&C(o)){let a=o.split(/\s+/);for(let u of a)r.push(`.${u}`)}}let s=["aria-label","type","name","title","alt"];for(let o of s){let a=n.getAttribute(o);a&&r.push(`[${o}="${a}"]`)}return r.join("")}function an(){try{return on.document.location.href}catch(t){return""}}function un(t){if(!on.HTMLElement)return null;let e=t,n=5;for(let r=0;rmr(t,r,n))}function T(t,e,n){if(!(e in t))return;let r=t[e],i=n(r);typeof i=="function"&&ut(i,r);try{t[e]=i}catch(s){H&&d.log(`Failed to replace method "${e}" in object`,t)}}function O(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch(r){H&&d.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function ut(t,e){try{let n=e.prototype||{};t.prototype=e.prototype=n,O(t,"__sentry_original__",e)}catch(n){}}function ge(t){return t.__sentry_original__}function ct(t){if(me(t))return c({message:t.message,name:t.name,stack:t.stack},yr(t));if(ye(t)){let e=c({type:t.type,target:hr(t.target),currentTarget:hr(t.currentTarget)},yr(t));return typeof CustomEvent!="undefined"&&Z(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function hr(t){try{return nn(t)?Ge(t):Object.prototype.toString.call(t)}catch(e){return""}}function yr(t){if(typeof t=="object"&&t!==null){let e={};for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function pn(t,e=40){let n=Object.keys(ct(t));n.sort();let r=n[0];if(!r)return"[object has no keys]";if(r.length>=e)return Q(r,e);for(let i=n.length;i>0;i--){let s=n.slice(0,i).join(", ");if(!(s.length>e))return i===n.length?s:Q(s,e)}return""}function I(t){return cn(t,new Map)}function cn(t,e){if(ts(t)){let n=e.get(t);if(n!==void 0)return n;let r={};e.set(t,r);for(let i of Object.getOwnPropertyNames(t))typeof t[i]!="undefined"&&(r[i]=cn(t[i],e));return r}if(Array.isArray(t)){let n=e.get(t);if(n!==void 0)return n;let r=[];return e.set(t,r),t.forEach(i=>{r.push(cn(i,e))}),r}return t}function ts(t){if(!Y(t))return!1;try{let e=Object.getPrototypeOf(t).constructor.name;return!e||e==="Object"}catch(e){return!0}}var gr=1e3;function ee(){return Date.now()/gr}function ns(){let{performance:t}=m;if(!t||!t.now)return ee;let e=Date.now()-t.now(),n=t.timeOrigin==null?e:t.timeOrigin;return()=>(n+t.now())/gr}var U=ns(),qe,rs=(()=>{let{performance:t}=m;if(!t||!t.now){qe="none";return}let e=3600*1e3,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,s=iMath.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{let r=new Uint8Array(1);return e.getRandomValues(r),r[0]})}catch(r){}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function _r(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function V(t){let{message:e,event_id:n}=t;if(e)return e;let r=_r(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"":n||""}function Te(t,e,n){let r=t.exception=t.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=e||""),s.type||(s.type=n||"Error")}function te(t,e){let n=_r(t);if(!n)return;let r={type:"generic",handled:!0},i=n.mechanism;if(n.mechanism=c(c(c({},r),i),e),e&&"data"in e){let s=c(c({},i&&i.data),e.data);n.mechanism.data=s}}function pt(t){if(is(t))return!0;try{O(t,"__sentry_captured__",!0)}catch(e){}return!1}function is(t){try{return t.__sentry_captured__}catch(e){}}var ae;(function(t){t[t.PENDING=0]="PENDING";let n=1;t[t.RESOLVED=n]="RESOLVED";let r=2;t[t.REJECTED=r]="REJECTED"})(ae||(ae={}));function q(t){return new K(e=>{e(t)})}function fe(t){return new K((e,n)=>{n(t)})}var K=class t{constructor(e){t.prototype.__init.call(this),t.prototype.__init2.call(this),t.prototype.__init3.call(this),t.prototype.__init4.call(this),this._state=ae.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new t((r,i)=>{this._handlers.push([!1,s=>{if(!e)r(s);else try{r(e(s))}catch(o){i(o)}},s=>{if(!n)i(s);else try{r(n(s))}catch(o){i(o)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new t((n,r)=>{let i,s;return this.then(o=>{s=!1,i=o,e&&e()},o=>{s=!0,i=o,e&&e()}).then(()=>{if(s){r(i);return}n(i)})})}__init(){this._resolve=e=>{this._setResult(ae.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(ae.REJECTED,e)}}__init3(){this._setResult=(e,n)=>{if(this._state===ae.PENDING){if(oe(n)){n.then(this._resolve,this._reject);return}this._state=e,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===ae.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===ae.RESOLVED&&n[1](this._value),this._state===ae.REJECTED&&n[2](this._value),n[0]=!0)})}}};function Er(t){let e=U(),n={sid:A(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>ss(n)};return t&&ue(n,t),n}function ue(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||U(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:A()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function vr(t,e){let n={};e?n={status:e}:t.status==="ok"&&(n={status:"exited"}),ue(t,n)}function ss(t){return I({sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}function ln(){return A()}function ze(){return A().substring(16)}function Ae(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&e&&Object.keys(e).length===0)return t;let r=c({},t);for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=Ae(r[i],e[i],n-1));return r}var fn="_sentrySpan";function dn(t,e){e?O(t,fn,e):delete t[fn]}function mn(t){return t[fn]}var os=100,hn=class t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:ln(),spanId:ze()}}clone(){let e=new t;return e._breadcrumbs=[...this._breadcrumbs],e._tags=c({},this._tags),e._extra=c({},this._extra),e._contexts=c({},this._contexts),this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata=c({},this._sdkProcessingMetadata),e._propagationContext=c({},this._propagationContext),e._client=this._client,e._lastEventId=this._lastEventId,dn(e,mn(this)),e}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&&ue(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags=c(c({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,n){return this._tags=v(c({},this._tags),{[e]:n}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=c(c({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,n){return this._extra=v(c({},this._extra),{[e]:n}),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,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;let n=typeof e=="function"?e(this):e,[r,i]=n instanceof $?[n.getScopeData(),n.getRequestSession()]:Y(n)?[e,e.requestSession]:[],{tags:s,extra:o,user:a,contexts:u,level:p,fingerprint:l=[],propagationContext:f}=r||{};return this._tags=c(c({},this._tags),s),this._extra=c(c({},this._extra),o),this._contexts=c(c({},this._contexts),u),a&&Object.keys(a).length&&(this._user=a),p&&(this._level=p),l.length&&(this._fingerprint=l),f&&(this._propagationContext=f),i&&(this._requestSession=i),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,dn(this,void 0),this._attachments=[],this.setPropagationContext({traceId:ln()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){let r=typeof n=="number"?n:os;if(r<=0)return this;let i=c({timestamp:ee()},e);return this._breadcrumbs.push(i),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client&&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,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:mn(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Ae(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=c({spanId:ze()},e),this}getPropagationContext(){return this._propagationContext}captureException(e,n){let r=n&&n.event_id?n.event_id:A();if(!this._client)return d.warn("No client configured on scope - will not capture exception!"),r;let i=new Error("Sentry syntheticException");return this._client.captureException(e,v(c({originalException:e,syntheticException:i},n),{event_id:r}),this),r}captureMessage(e,n,r){let i=r&&r.event_id?r.event_id:A();if(!this._client)return d.warn("No client configured on scope - will not capture message!"),i;let s=new Error(e);return this._client.captureMessage(e,n,v(c({originalException:e,syntheticException:s},r),{event_id:i}),this),i}captureEvent(e,n){let r=n&&n.event_id?n.event_id:A();return this._client?(this._client.captureEvent(e,v(c({},n),{event_id:r}),this),r):(d.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}},$=hn;function Sr(){return le("defaultCurrentScope",()=>new $)}function br(){return le("defaultIsolationScope",()=>new $)}var yn=class{constructor(e,n){let r;e?r=e:r=new $;let i;n?i=n:i=new $,this._stack=[{scope:r}],this._isolationScope=i}withScope(e){let n=this._pushScope(),r;try{r=e(n)}catch(i){throw this._popScope(),i}return oe(r)?r.then(i=>(this._popScope(),i),i=>{throw this._popScope(),i}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){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 we(){let t=de(),e=je(t);return e.stack=e.stack||new yn(Sr(),br())}function as(t){return we().withScope(t)}function us(t,e){let n=we();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function Ir(t){return we().withScope(()=>t(we().getIsolationScope()))}function xr(){return{withIsolationScope:Ir,withScope:as,withSetScope:us,withSetIsolationScope:(t,e)=>Ir(e),getCurrentScope:()=>we().getScope(),getIsolationScope:()=>we().getIsolationScope()}}function lt(t){let e=je(t);return e.acs?e.acs:xr()}function P(){let t=de();return lt(t).getCurrentScope()}function ne(){let t=de();return lt(t).getIsolationScope()}function ft(){return le("globalScope",()=>new $)}function dt(...t){let e=de(),n=lt(e);if(t.length===2){let[r,i]=t;return r?n.withSetScope(r,i):n.withScope(i)}return n.withScope(t[0])}function S(){return P().getClient()}function gn(t){let e=t.getPropagationContext(),{traceId:n,spanId:r,parentSpanId:i}=e;return I({trace_id:n,span_id:r,parent_span_id:i})}var cs="_sentryMetrics";function kr(t){let e=t[cs];if(!e)return;let n={};for(let[,[r,i]]of e)(n[r]||(n[r]=[])).push(I(i));return n}var mt="sentry.source",_n="sentry.sample_rate",En="sentry.op",vn="sentry.origin";var ps="sentry-",ls=/^sentry-/;function Ar(t){let e=fs(t);if(!e)return;let n=Object.entries(e).reduce((r,[i,s])=>{if(i.match(ls)){let o=i.slice(ps.length);r[o]=s}return r},{});if(Object.keys(n).length>0)return n}function fs(t){if(!(!t||!C(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{let r=Tr(n);return Object.entries(r).forEach(([i,s])=>{e[i]=s}),e},{}):Tr(t)}function Tr(t){return t.split(",").map(e=>e.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}var ds=1,wr=!1;function Rr(t){let{spanId:e,traceId:n,isRemote:r}=t.spanContext(),i=r?e:De(t).parent_span_id,s=r?ze():e;return I({parent_span_id:i,span_id:s,trace_id:n})}function Dr(t){return typeof t=="number"?Nr(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Nr(t.getTime()):U()}function Nr(t){return t>9999999999?t/1e3:t}function De(t){if(hs(t))return t.getSpanJSON();try{let{spanId:e,traceId:n}=t.spanContext();if(ms(t)){let{attributes:r,startTime:i,name:s,endTime:o,parentSpanId:a,status:u}=t;return I({span_id:e,trace_id:n,data:r,description:s,parent_span_id:a,start_timestamp:Dr(i),timestamp:Dr(o)||void 0,status:ys(u),op:r[En],origin:r[vn],_metrics_summary:kr(t)})}return{span_id:e,trace_id:n}}catch(e){return{}}}function ms(t){let e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function hs(t){return typeof t.getSpanJSON=="function"}function Cr(t){let{traceFlags:e}=t.spanContext();return e===ds}function ys(t){if(!(!t||t.code===0))return t.code===1?"ok":t.message||"unknown_error"}var gs="_sentryRootSpan";function We(t){return t[gs]||t}function Or(){wr||(M(()=>{console.warn("[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.")}),wr=!0)}function Pr(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=S(),n=t||e&&e.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}var Ne="production";var _s="_frozenDsc";function Mr(t,e){let n=e.getOptions(),{publicKey:r}=e.getDsn()||{},i=I({environment:n.environment||Ne,release:n.release,public_key:r,trace_id:t});return e.emit("createDsc",i),i}function Ur(t,e){let n=e.getPropagationContext();return n.dsc||Mr(n.traceId,t)}function Lr(t){let e=S();if(!e)return{};let n=We(t),r=n[_s];if(r)return r;let i=n.spanContext().traceState,s=i&&i.get("sentry.dsc"),o=s&&Ar(s);if(o)return o;let a=Mr(t.spanContext().traceId,e),u=De(n),p=u.data||{},l=p[_n];l!=null&&(a.sample_rate=`${l}`);let f=p[mt],h=u.description;return f!=="url"&&h&&(a.transaction=h),Pr()&&(a.sampled=String(Cr(n))),e.emit("createDsc",a,n),a}function Fr(t){if(typeof t=="boolean")return Number(t);let e=typeof t=="string"?parseFloat(t):t;if(typeof e!="number"||isNaN(e)||e<0||e>1){_&&d.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`);return}return e}var Es=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function vs(t){return t==="http"||t==="https"}function ce(t,e=!1){let{host:n,path:r,pass:i,port:s,projectId:o,protocol:a,publicKey:u}=t;return`${a}://${u}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${o}`}function $r(t){let e=Es.exec(t);if(!e){M(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}let[n,r,i="",s="",o="",a=""]=e.slice(1),u="",p=a,l=p.split("/");if(l.length>1&&(u=l.slice(0,-1).join("/"),p=l.pop()),p){let f=p.match(/^\d+/);f&&(p=f[0])}return Br({host:s,pass:i,path:u,projectId:p,port:o,protocol:n,publicKey:r})}function Br(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function Ss(t){if(!H)return!0;let{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(o=>t[o]?!1:(d.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?vs(r)?e&&isNaN(parseInt(e,10))?(d.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(d.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(d.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Sn(t){let e=typeof t=="string"?$r(t):Br(t);if(!(!e||!Ss(e)))return e}function jr(){let t=typeof WeakSet=="function",e=t?new WeakSet:[];function n(i){if(t)return e.has(i)?!0:(e.add(i),!1);for(let s=0;sn?ht(t,e-1,n):r}function bn(t,e,n=1/0,r=1/0,i=jr()){let[s,o]=i;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;let a=bs(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;let u=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(u===0)return a.replace("object ","");if(s(e))return"[Circular ~]";let p=e;if(p&&typeof p.toJSON=="function")try{let g=p.toJSON();return bn("",g,u-1,r,i)}catch(g){}let l=Array.isArray(e)?[]:{},f=0,h=ct(e);for(let g in h){if(!Object.prototype.hasOwnProperty.call(h,g))continue;if(f>=r){l[g]="[MaxProperties ~]";break}let y=h[g];l[g]=bn(g,y,u-1,r,i),f++}return o(e),l}function bs(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global!="undefined"&&e===global)return"[Global]";if(typeof window!="undefined"&&e===window)return"[Window]";if(typeof document!="undefined"&&e===document)return"[Document]";if(He(e))return"[VueViewModel]";if(sn(e))return"[SyntheticEvent]";if(typeof e=="number"&&!Number.isFinite(e))return`[${e}]`;if(typeof e=="function")return`[Function: ${G(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;let n=Is(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Is(t){let e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}function xs(t){return~-encodeURI(t).split(/%..|./).length}function ks(t){return xs(JSON.stringify(t))}function re(t,e=[]){return[t,e]}function xn(t,e){let[n,r]=t;return[n,[...r,e]]}function yt(t,e){let n=t[1];for(let r of n){let i=r[0].type;if(e(r,i))return!0}return!1}function In(t){return m.__SENTRY__&&m.__SENTRY__.encodePolyfill?m.__SENTRY__.encodePolyfill(t):new TextEncoder().encode(t)}function kn(t){let[e,n]=t,r=JSON.stringify(e);function i(s){typeof r=="string"?r=typeof s=="string"?r+s:[In(r),s]:r.push(typeof s=="string"?In(s):s)}for(let s of n){let[o,a]=s;if(i(` ${JSON.stringify(o)} `),typeof a=="string"||a instanceof Uint8Array)i(a);else{let u;try{u=JSON.stringify(a)}catch(p){u=JSON.stringify(z(a))}i(u)}}return typeof r=="string"?r:Ts(r)}function Ts(t){let e=t.reduce((i,s)=>i+s.length,0),n=new Uint8Array(e),r=0;for(let i of t)n.set(i,r),r+=i.length;return n}function Tn(t){let e=typeof t.data=="string"?In(t.data):t.data;return[I({type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),e]}var As={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket",raw_security:"security"};function gt(t){return As[t]}function _t(t){if(!t||!t.sdk)return;let{name:e,version:n}=t.sdk;return{name:e,version:n}}function An(t,e,n,r){let i=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return c(c(c({event_id:t.event_id,sent_at:new Date().toISOString()},e&&{sdk:e}),!!n&&r&&{dsn:ce(r)}),i&&{trace:I(c({},i))})}function Ds(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function Hr(t,e,n,r){let i=_t(n),s=c(c({sent_at:new Date().toISOString()},i&&{sdk:i}),!!r&&e&&{dsn:ce(e)}),o="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return re(s,[o])}function Gr(t,e,n,r){let i=_t(n),s=t.type&&t.type!=="replay_event"?t.type:"event";Ds(t,n&&n.sdk);let o=An(t,i,r,e);return delete t.sdkProcessingMetadata,re(o,[[{type:s},t]])}function Et(t,e,n,r=0){return new K((i,s)=>{let o=t[r];if(e===null||typeof o!="function")i(e);else{let a=o(c({},e),n);_&&o.id&&a===null&&d.log(`Event processor "${o.id}" dropped event`),oe(a)?a.then(u=>Et(t,u,n,r+1).then(i)).then(null,s):Et(t,a,n,r+1).then(i).then(null,s)}})}var vt,qr,St;function zr(t){let e=m._sentryDebugIds;if(!e)return{};let n=Object.keys(e);return St&&n.length===qr||(qr=n.length,St=n.reduce((r,i)=>{vt||(vt={});let s=vt[i];if(s)r[s[0]]=s[1];else{let o=t(i);for(let a=o.length-1;a>=0;a--){let u=o[a],p=u&&u.filename,l=e[i];if(p&&l){r[p]=l,vt[i]=[p,l];break}}}return r},{})),St}function Wr(t,e){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:s}=e;Ns(t,e),r&&Os(t,r),Ps(t,n),Rs(t,i),Cs(t,s)}function wn(t,e){let{extra:n,tags:r,user:i,contexts:s,level:o,sdkProcessingMetadata:a,breadcrumbs:u,fingerprint:p,eventProcessors:l,attachments:f,propagationContext:h,transactionName:g,span:y}=e;bt(t,"extra",n),bt(t,"tags",r),bt(t,"user",i),bt(t,"contexts",s),t.sdkProcessingMetadata=Ae(t.sdkProcessingMetadata,a,2),o&&(t.level=o),g&&(t.transactionName=g),y&&(t.span=y),u.length&&(t.breadcrumbs=[...t.breadcrumbs,...u]),p.length&&(t.fingerprint=[...t.fingerprint,...p]),l.length&&(t.eventProcessors=[...t.eventProcessors,...l]),f.length&&(t.attachments=[...t.attachments,...f]),t.propagationContext=c(c({},t.propagationContext),h)}function bt(t,e,n){t[e]=Ae(t[e],n,1)}function Ns(t,e){let{extra:n,tags:r,user:i,contexts:s,level:o,transactionName:a}=e,u=I(n);u&&Object.keys(u).length&&(t.extra=c(c({},u),t.extra));let p=I(r);p&&Object.keys(p).length&&(t.tags=c(c({},p),t.tags));let l=I(i);l&&Object.keys(l).length&&(t.user=c(c({},l),t.user));let f=I(s);f&&Object.keys(f).length&&(t.contexts=c(c({},f),t.contexts)),o&&(t.level=o),a&&t.type!=="transaction"&&(t.transaction=a)}function Rs(t,e){let n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function Cs(t,e){t.sdkProcessingMetadata=c(c({},t.sdkProcessingMetadata),e)}function Os(t,e){t.contexts=c({trace:Rr(e)},t.contexts),t.sdkProcessingMetadata=c({dynamicSamplingContext:Lr(e)},t.sdkProcessingMetadata);let n=We(e),r=De(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function Ps(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}function Yr(t,e,n,r,i,s){let{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=t,u=v(c({},e),{event_id:e.event_id||n.event_id||A(),timestamp:e.timestamp||ee()}),p=n.integrations||t.integrations.map(b=>b.name);Ms(u,t),Fs(u,p),i&&i.emit("applyFrameMetadata",e),e.type===void 0&&Us(u,t.stackParser);let l=Bs(r,n.captureContext);n.mechanism&&te(u,n.mechanism);let f=i?i.getEventProcessors():[],h=ft().getScopeData();if(s){let b=s.getScopeData();wn(h,b)}if(l){let b=l.getScopeData();wn(h,b)}let g=[...n.attachments||[],...h.attachments];g.length&&(n.attachments=g),Wr(u,h);let y=[...f,...h.eventProcessors];return Et(y,u,n).then(b=>(b&&Ls(b),typeof o=="number"&&o>0?$s(b,o,a):b))}function Ms(t,e){let{environment:n,release:r,dist:i,maxValueLength:s=250}=e;t.environment=t.environment||n||Ne,!t.release&&r&&(t.release=r),!t.dist&&i&&(t.dist=i),t.message&&(t.message=Q(t.message,s));let o=t.exception&&t.exception.values&&t.exception.values[0];o&&o.value&&(o.value=Q(o.value,s));let a=t.request;a&&a.url&&(a.url=Q(a.url,s))}function Us(t,e){let n=zr(e);try{t.exception.values.forEach(r=>{r.stacktrace.frames.forEach(i=>{n&&i.filename&&(i.debug_id=n[i.filename])})})}catch(r){}}function Ls(t){let e={};try{t.exception.values.forEach(r=>{r.stacktrace.frames.forEach(i=>{i.debug_id&&(i.abs_path?e[i.abs_path]=i.debug_id:i.filename&&(e[i.filename]=i.debug_id),delete i.debug_id)})})}catch(r){}if(Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let n=t.debug_meta.images;Object.entries(e).forEach(([r,i])=>{n.push({type:"sourcemap",code_file:r,debug_id:i})})}function Fs(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function $s(t,e,n){if(!t)return null;let r=c(c(c(c(c({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(i=>c(c({},i),i.data&&{data:z(i.data,e,n)}))}),t.user&&{user:z(t.user,e,n)}),t.contexts&&{contexts:z(t.contexts,e,n)}),t.extra&&{extra:z(t.extra,e,n)});return t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=z(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(i=>c(c({},i),i.data&&{data:z(i.data,e,n)}))),t.contexts&&t.contexts.flags&&r.contexts&&(r.contexts.flags=z(t.contexts.flags,3,n)),r}function Bs(t,e){if(!e)return t;let n=t?t.clone():new $;return n.update(e),n}function Vr(t){if(t)return js(t)?{captureContext:t}:Gs(t)?{captureContext:t}:t}function js(t){return t instanceof $||typeof t=="function"}var Hs=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function Gs(t){return Object.keys(t).some(e=>Hs.includes(e))}function It(t,e){return P().captureException(t,Vr(e))}function _e(t,e){return P().captureEvent(t,e)}function Ye(t){let e=S(),n=ne(),r=P(),{release:i,environment:s=Ne}=e&&e.getOptions()||{},{userAgent:o}=m.navigator||{},a=Er(c(c({release:i,environment:s,user:r.getUser()||n.getUser()},o&&{userAgent:o}),t)),u=n.getSession();return u&&u.status==="ok"&&ue(u,{status:"exited"}),xt(),n.setSession(a),r.setSession(a),a}function xt(){let t=ne(),e=P(),n=e.getSession()||t.getSession();n&&vr(n),Xr(),t.setSession(),e.setSession()}function Xr(){let t=ne(),e=P(),n=S(),r=e.getSession()||t.getSession();r&&n&&n.captureSession(r)}function Ve(t=!1){if(t){xt();return}Xr()}var qs="7";function zs(t){let e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function Ws(t){return`${zs(t)}${t.projectId}/envelope/`}function Ys(t,e){let n={sentry_version:qs};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}function Jr(t,e,n){return e||`${Ws(t)}?${Ys(t,n)}`}var Zr=[];function Vs(t){let e={};return t.forEach(n=>{let{name:r}=n,i=e[r];i&&!i.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.values(e)}function Dn(t){let e=t.defaultIntegrations||[],n=t.integrations;e.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...e,...n];else if(typeof n=="function"){let o=n(e);r=Array.isArray(o)?o:[o]}else r=e;let i=Vs(r),s=i.findIndex(o=>o.name==="Debug");if(s>-1){let[o]=i.splice(s,1);i.push(o)}return i}function Qr(t,e){let n={};return e.forEach(r=>{r&&Rn(t,r,n)}),n}function Nn(t,e){for(let n of e)n&&n.afterAllSetup&&n.afterAllSetup(t)}function Rn(t,e,n){if(n[e.name]){_&&d.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,Zr.indexOf(e.name)===-1&&typeof e.setupOnce=="function"&&(e.setupOnce(),Zr.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){let r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(i,s)=>r(i,s,t))}if(typeof e.processEvent=="function"){let r=e.processEvent.bind(e),i=Object.assign((s,o)=>r(s,o,t),{id:e.name});t.addEventProcessor(i)}_&&d.log(`Integration installed: ${e.name}`)}function ei(t,e,n){let r=[{type:"client_report"},{timestamp:n||ee(),discarded_events:t}];return re(e?{dsn:e}:{},[r])}var D=class extends Error{constructor(e,n="warn"){super(e),this.message=e,this.logLevel=n}};var ti="Not capturing exception because it's already been captured.",Ke=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=Sn(e.dsn):_&&d.warn("No DSN provided, client will not send events."),this._dsn){let i=Jr(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport(v(c({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{url:i}))}let r=["enableTracing","tracesSampleRate","tracesSampler"].find(i=>i in e&&e[i]==null);r&&M(()=>{console.warn(`[Sentry] Deprecation warning: \`${r}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`)})}captureException(e,n,r){let i=A();if(pt(e))return _&&d.log(ti),i;let s=c({event_id:i},n);return this._process(this.eventFromException(e,s).then(o=>this._captureEvent(o,s,r))),s.event_id}captureMessage(e,n,r,i){let s=c({event_id:A()},r),o=xe(e)?e:String(e),a=he(e)?this.eventFromMessage(o,n,s):this.eventFromException(e,s);return this._process(a.then(u=>this._captureEvent(u,s,i))),s.event_id}captureEvent(e,n,r){let i=A();if(n&&n.originalException&&pt(n.originalException))return _&&d.log(ti),i;let s=c({event_id:i},n),a=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,s,a||r)),s.event_id}captureSession(e){typeof e.release!="string"?_&&d.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),ue(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let n=this._transport;return n?(this.emit("flush"),this._isClientDoneProcessing(e).then(r=>n.flush(e).then(i=>r&&i))):q(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,this.emit("close"),n))}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]}addIntegration(e){let n=this._integrations[e.name];Rn(this,e,this._integrations),n||Nn(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=Gr(e,this._dsn,this._options._metadata,this._options.tunnel);for(let s of n.attachments||[])r=xn(r,Tn(s));let i=this.sendEnvelope(r);i&&i.then(s=>this.emit("afterSendEvent",e,s),null)}sendSession(e){let n=Hr(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(n)}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){let i=typeof r=="number"?r:1,s=`${e}:${n}`;_&&d.log(`Recording outcome: "${s}"${i>1?` (${i} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+i}}on(e,n){let r=this._hooks[e]=this._hooks[e]||[];return r.push(n),()=>{let i=r.indexOf(n);i>-1&&r.splice(i,1)}}emit(e,...n){let r=this._hooks[e];r&&r.forEach(i=>i(...n))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,n=>(_&&d.error("Error while sending envelope:",n),n)):(_&&d.error("Transport disabled"),q({}))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=Qr(this,e),Nn(this,e)}_updateSessionFromEvent(e,n){let r=n.level==="fatal",i=!1,s=n.exception&&n.exception.values;if(s){i=!0;for(let u of s){let p=u.mechanism;if(p&&p.handled===!1){r=!0;break}}}let o=e.status==="ok";(o&&e.errors===0||o&&r)&&(ue(e,v(c({},r&&{status:"crashed"}),{errors:e.errors||Number(i||r)})),this.captureSession(e))}_isClientDoneProcessing(e){return new K(n=>{let r=0,i=1,s=setInterval(()=>{this._numProcessing==0?(clearInterval(s),n(!0)):(r+=i,e&&r>=e&&(clearInterval(s),n(!1)))},i)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r=P(),i=ne()){let s=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&o.length>0&&(n.integrations=o),this.emit("preprocessEvent",e,n),e.type||i.setLastEventId(e.event_id||n.event_id),Yr(s,e,n,r,this,i).then(a=>{if(a===null)return a;a.contexts=c({trace:gn(r)},a.contexts);let u=Ur(this,r);return a.sdkProcessingMetadata=c({dynamicSamplingContext:u},a.sdkProcessingMetadata),a})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(i=>i.event_id,i=>{_&&(i instanceof D&&i.logLevel==="log"?d.log(i.message):d.warn(i))})}_processEvent(e,n,r){let i=this.getOptions(),{sampleRate:s}=i,o=ri(e),a=ni(e),u=e.type||"error",p=`before send for type \`${u}\``,l=typeof s=="undefined"?void 0:Fr(s);if(a&&typeof l=="number"&&Math.random()>l)return this.recordDroppedEvent("sample_rate","error",e),fe(new D(`Discarding event because it's not included in the random sample (sampling rate = ${s})`,"log"));let f=u==="replay_event"?"replay":u,g=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,n,r,g).then(y=>{if(y===null)throw this.recordDroppedEvent("event_processor",f,e),new D("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return y;let b=Xs(this,i,y,n);return Ks(b,p)}).then(y=>{if(y===null){if(this.recordDroppedEvent("before_send",f,e),o){let B=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",B)}throw new D(`${p} returned \`null\`, will not send event.`,"log")}let L=r&&r.getSession();if(!o&&L&&this._updateSessionFromEvent(L,y),o){let F=y.sdkProcessingMetadata&&y.sdkProcessingMetadata.spanCountBeforeProcessing||0,B=y.spans?y.spans.length:0,pe=F-B;pe>0&&this.recordDroppedEvent("before_send","span",pe)}let b=y.transaction_info;if(o&&b&&y.transaction!==e.transaction){let F="custom";y.transaction_info=v(c({},b),{source:F})}return this.sendEvent(y,n),y}).then(null,y=>{throw y instanceof D?y:(this.captureException(y,{data:{__sentry__:!0},originalException:y}),new D(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. Reason: ${y}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{let[i,s]=n.split(":");return{reason:i,category:s,quantity:r}})}_flushOutcomes(){_&&d.log("Flushing outcomes...");let e=this._clearOutcomes();if(e.length===0){_&&d.log("No outcomes to send");return}if(!this._dsn){_&&d.log("No dsn provided, will not send outcomes");return}_&&d.log("Sending outcomes:",e);let n=ei(e,this._options.tunnel&&ce(this._dsn));this.sendEnvelope(n)}};function Ks(t,e){let n=`${e} must return \`null\` or a valid event.`;if(oe(t))return t.then(r=>{if(!Y(r)&&r!==null)throw new D(n);return r},r=>{throw new D(`${e} rejected with ${r}`)});if(!Y(t)&&t!==null)throw new D(n);return t}function Xs(t,e,n,r){let{beforeSend:i,beforeSendTransaction:s,beforeSendSpan:o}=e;if(ni(n)&&i)return i(n,r);if(ri(n)){if(n.spans&&o){let a=[];for(let u of n.spans){let p=o(u);p?a.push(p):(Or(),t.recordDroppedEvent("before_send","span"))}n.spans=a}if(s){if(n.spans){let a=n.spans.length;n.sdkProcessingMetadata=v(c({},n.sdkProcessingMetadata),{spanCountBeforeProcessing:a})}return s(n,r)}}return n}function ni(t){return t.type===void 0}function ri(t){return t.type==="transaction"}function Cn(t,e){e.debug===!0&&(_?d.enable():M(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),P().update(e.initialScope);let r=new t(e);return On(r),r.init(),r}function On(t){P().setClient(t)}function ii(t){let e=[];function n(){return t===void 0||e.lengthr(a)).then(null,()=>r(a).then(null,()=>{})),a}function s(o){return new K((a,u)=>{let p=e.length;if(!p)return a(!0);let l=setTimeout(()=>{o&&o>0&&a(!1)},o);e.forEach(f=>{q(f).then(()=>{--p||(clearTimeout(l),a(!0))},u)})})}return{$:e,add:i,drain:s}}function Js(t,e=Date.now()){let n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${t}`);return isNaN(r)?6e4:r-e}function Zs(t,e){return t[e]||t.all||0}function si(t,e,n=Date.now()){return Zs(t,e)>n}function oi(t,{statusCode:e,headers:n},r=Date.now()){let i=c({},t),s=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(s)for(let a of s.trim().split(",")){let[u,p,,,l]=a.split(":",5),f=parseInt(u,10),h=(isNaN(f)?60:f)*1e3;if(!p)i.all=r+h;else for(let g of p.split(";"))g==="metric_bucket"?(!l||l.split(";").includes("custom"))&&(i[g]=r+h):i[g]=r+h}else o?i.all=r+Js(o,r):e===429&&(i.all=r+60*1e3);return i}var Qs=64;function kt(t,e,n=ii(t.bufferSize||Qs)){let r={},i=o=>n.drain(o);function s(o){let a=[];if(yt(o,(f,h)=>{let g=gt(h);if(si(r,g)){let y=ai(f,h);t.recordDroppedEvent("ratelimit_backoff",g,y)}else a.push(f)}),a.length===0)return q({});let u=re(o[0],a),p=f=>{yt(u,(h,g)=>{let y=ai(h,g);t.recordDroppedEvent(f,gt(g),y)})},l=()=>e({body:kn(u)}).then(f=>(f.statusCode!==void 0&&(f.statusCode<200||f.statusCode>=300)&&_&&d.warn(`Sentry responded with status code ${f.statusCode} to sent event.`),r=oi(r,f),f),f=>{throw p("network_error"),f});return n.add(l).then(f=>f,f=>{if(f instanceof D)return _&&d.error("Skipped sending event because buffer is full."),p("queue_overflow"),q({});throw f})}return{send:s,flush:i}}function ai(t,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(t)?t[1]:void 0}function Pn(t,e,n=[e],r="npm"){let i=t._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${e}`,packages:n.map(s=>({name:`${r}:@sentry/${s}`,version:W})),version:W}),t._metadata=i}var eo=100;function ie(t,e){let n=S(),r=ne();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:s=eo}=n.getOptions();if(s<=0)return;let o=ee(),a=c({timestamp:o},t),u=i?M(()=>i(a,e)):a;u!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",u,e),r.addBreadcrumb(u,s))}var ui,to="FunctionToString",ci=new WeakMap,no=()=>({name:to,setupOnce(){ui=Function.prototype.toString;try{Function.prototype.toString=function(...t){let e=ge(this),n=ci.has(S())&&e!==void 0?e:this;return ui.apply(n,t)}}catch(t){}},setup(t){ci.set(t,!0)}}),Tt=no;var ro=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,"undefined is not an object (evaluating 'a.L')",`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/],io="InboundFilters",so=(t={})=>({name:io,processEvent(e,n,r){let i=r.getOptions(),s=oo(t,i);return ao(e,s)?null:e}}),wt=so;function oo(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:ro],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]],ignoreInternal:t.ignoreInternal!==void 0?t.ignoreInternal:!0}}function ao(t,e){return e.ignoreInternal&&mo(t)?(_&&d.warn(`Event dropped due to being internal Sentry Error. Event: ${V(t)}`),!0):uo(t,e.ignoreErrors)?(_&&d.warn(`Event dropped due to being matched by \`ignoreErrors\` option. Event: ${V(t)}`),!0):yo(t)?(_&&d.warn(`Event dropped due to not having an error message, error type or stacktrace. Event: ${V(t)}`),!0):co(t,e.ignoreTransactions)?(_&&d.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. Event: ${V(t)}`),!0):po(t,e.denyUrls)?(_&&d.warn(`Event dropped due to being matched by \`denyUrls\` option. Event: ${V(t)}. Url: ${At(t)}`),!0):lo(t,e.allowUrls)?!1:(_&&d.warn(`Event dropped due to not being matched by \`allowUrls\` option. Event: ${V(t)}. Url: ${At(t)}`),!0)}function uo(t,e){return t.type||!e||!e.length?!1:fo(t).some(n=>ke(n,e))}function co(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;let n=t.transaction;return n?ke(n,e):!1}function po(t,e){if(!e||!e.length)return!1;let n=At(t);return n?ke(n,e):!1}function lo(t,e){if(!e||!e.length)return!0;let n=At(t);return n?ke(n,e):!0}function fo(t){let e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch(r){}return n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`)),e}function mo(t){try{return t.exception.values[0].type==="SentryError"}catch(e){}return!1}function ho(t=[]){for(let e=t.length-1;e>=0;e--){let n=t[e];if(n&&n.filename!==""&&n.filename!=="[native code]")return n.filename||null}return null}function At(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch(n){}return e?ho(e):null}catch(e){return _&&d.error(`Cannot extract url for event ${V(t)}`),null}}function yo(t){return t.type||!t.exception||!t.exception.values||t.exception.values.length===0?!1:!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value)}function Un(t,e,n=250,r,i,s,o){if(!s.exception||!s.exception.values||!o||!Z(o.originalException,Error))return;let a=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;a&&(s.exception.values=go(Mn(t,e,i,o.originalException,r,s.exception.values,a,0),n))}function Mn(t,e,n,r,i,s,o,a){if(s.length>=n+1)return s;let u=[...s];if(Z(r[i],Error)){pi(o,a);let p=t(e,r[i]),l=u.length;li(p,i,l,a),u=Mn(t,e,n,r[i],i,[p,...u],p,l)}return Array.isArray(r.errors)&&r.errors.forEach((p,l)=>{if(Z(p,Error)){pi(o,a);let f=t(e,p),h=u.length;li(f,`errors[${l}]`,h,a),u=Mn(t,e,n,p,i,[f,...u],f,h)}}),u}function pi(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism=v(c(c({},t.mechanism),t.type==="AggregateError"&&{is_exception_group:!0}),{exception_id:e})}function li(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism=v(c({},t.mechanism),{type:"chained",source:e,exception_id:n,parent_id:r})}function go(t,e){return t.map(n=>(n.value&&(n.value=Q(n.value,e)),n))}function Xe(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function Ln(t){let e="console";N(e,t),R(e,_o)}function _o(){"console"in m&&Be.forEach(function(t){t in m.console&&T(m.console,t,function(e){return be[t]=e,function(...n){k("console",{args:n,level:t});let i=be[t];i&&i.apply(m.console,n)}})})}function Fn(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var Eo="Dedupe",vo=()=>{let t;return{name:Eo,processEvent(e){if(e.type)return e;try{if(So(e,t))return _&&d.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(n){}return t=e}}},Dt=vo;function So(t,e){return e?!!(bo(t,e)||Io(t,e)):!1}function bo(t,e){let n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!mi(t,e)||!di(t,e))}function Io(t,e){let n=fi(e),r=fi(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!mi(t,e)||!di(t,e))}function di(t,e){let n=rt(t),r=rt(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let i=0;i=400&&t<500?"warning":t>=500?"error":void 0}var $n=m;function Rt(){if(!("fetch"in $n))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(t){return!1}}function Je(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Bn(){if(typeof EdgeRuntime=="string")return!0;if(!Rt())return!1;if(Je($n.fetch))return!0;let t=!1,e=$n.document;if(e&&typeof e.createElement=="function")try{let n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=Je(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){H&&d.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function Hn(t,e){let n="fetch";N(n,t),R(n,()=>xo(void 0,e))}function xo(t,e=!1){e&&!Bn()||T(m,"fetch",function(n){return function(...r){let i=new Error,{method:s,url:o}=ko(r),a={args:r,fetchData:{method:s,url:o},startTimestamp:U()*1e3,virtualError:i};return t||k("fetch",c({},a)),n.apply(m,r).then(u=>x(null,null,function*(){return t?t(u):k("fetch",v(c({},a),{endTimestamp:U()*1e3,response:u})),u}),u=>{throw k("fetch",v(c({},a),{endTimestamp:U()*1e3,error:u})),me(u)&&u.stack===void 0&&(u.stack=i.stack,O(u,"framesToPop",1)),u})}})}function jn(t,e){return!!t&&typeof t=="object"&&!!t[e]}function hi(t){return typeof t=="string"?t:t?jn(t,"url")?t.url:t.toString?t.toString():"":""}function ko(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[n,r]=t;return{url:hi(n),method:jn(r,"method")?String(r.method).toUpperCase():"GET"}}let e=t[0];return{url:hi(e),method:jn(e,"method")?String(e.method).toUpperCase():"GET"}}function Gn(){return"npm"}var Ct=m;function qn(){let t=Ct.chrome,e=t&&t.app&&t.app.runtime,n="history"in Ct&&!!Ct.history.pushState&&!!Ct.history.replaceState;return!e&&n}var E=m,zn=0;function Wn(){return zn>0}function Fo(){zn++,setTimeout(()=>{zn--})}function Ee(t,e={}){function n(i){return typeof i=="function"}if(!n(t))return t;try{let i=t.__sentry_wrapped__;if(i)return typeof i=="function"?i:t;if(ge(t))return t}catch(i){return t}let r=function(...i){try{let s=i.map(o=>Ee(o,e));return t.apply(this,s)}catch(s){throw Fo(),dt(o=>{o.addEventProcessor(a=>(e.mechanism&&(Te(a,void 0,void 0),te(a,e.mechanism)),a.extra=v(c({},a.extra),{arguments:i}),a)),It(s)}),s}};try{for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch(i){}ut(r,t),O(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch(i){}return r}var se=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__;function Ot(t,e){let n=Kn(t,e),r={type:Go(e),value:qo(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function $o(t,e,n,r){let i=S(),s=i&&i.getOptions().normalizeDepth,o=Yo(e),a={__serialized__:ht(e,s)};if(o)return{exception:{values:[Ot(t,o)]},extra:a};let u={exception:{values:[{type:ye(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:zo(e,{isUnhandledRejection:r})}]},extra:a};if(n){let p=Kn(t,n);p.length&&(u.exception.values[0].stacktrace={frames:p})}return u}function Yn(t,e){return{exception:{values:[Ot(t,e)]}}}function Kn(t,e){let n=e.stacktrace||e.stack||"",r=jo(e),i=Ho(e);try{return t(n,r,i)}catch(s){}return[]}var Bo=/Minified React error #\d+;/i;function jo(t){return t&&Bo.test(t.message)?1:0}function Ho(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function gi(t){return typeof WebAssembly!="undefined"&&typeof WebAssembly.Exception!="undefined"?t instanceof WebAssembly.Exception:!1}function Go(t){let e=t&&t.name;return!e&&gi(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function qo(t){let e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:gi(t)&&Array.isArray(t.message)&&t.message.length==2?t.message[1]:e:"No error message"}function _i(t,e,n,r){let i=n&&n.syntheticException||void 0,s=Pt(t,e,i,r);return te(s),s.level="error",n&&n.event_id&&(s.event_id=n.event_id),q(s)}function Ei(t,e,n="info",r,i){let s=r&&r.syntheticException||void 0,o=Vn(t,e,s,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),q(o)}function Pt(t,e,n,r,i){let s;if(st(e)&&e.error)return Yn(t,e.error);if(ot(e)||tn(e)){let o=e;if("stack"in e)s=Yn(t,e);else{let a=o.name||(ot(o)?"DOMError":"DOMException"),u=o.message?`${a}: ${o.message}`:a;s=Vn(t,u,n,r),Te(s,u)}return"code"in o&&(s.tags=v(c({},s.tags),{"DOMException.code":`${o.code}`})),s}return me(e)?Yn(t,e):Y(e)||ye(e)?(s=$o(t,e,n,i),te(s,{synthetic:!0}),s):(s=Vn(t,e,n,r),Te(s,`${e}`,void 0),te(s,{synthetic:!0}),s)}function Vn(t,e,n,r){let i={};if(r&&n){let s=Kn(t,n);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]}),te(i,{synthetic:!0})}if(xe(e)){let{__sentry_template_string__:s,__sentry_template_values__:o}=e;return i.logentry={message:s,params:o},i}return i.message=e,i}function zo(t,{isUnhandledRejection:e}){let n=pn(t),r=e?"promise rejection":"exception";return st(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:ye(t)?`Event \`${Wo(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Wo(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(e){}}function Yo(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let n=t[e];if(n instanceof Error)return n}}function vi(t,{metadata:e,tunnel:n,dsn:r}){let i=c(c({event_id:t.event_id,sent_at:new Date().toISOString()},e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}}),!!n&&!!r&&{dsn:ce(r)}),s=Vo(t);return re(i,[s])}function Vo(t){return[{type:"user_report"},t]}var Mt=class extends Ke{constructor(e){let n=c({parentSpanIsAlwaysRootSpan:!0},e),r=E.SENTRY_SDK_SOURCE||Gn();Pn(n,"browser",["browser"],r),super(n),n.sendClientReports&&E.document&&E.document.addEventListener("visibilitychange",()=>{E.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return _i(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return Ei(this._options.stackParser,e,n,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){se&&d.warn("SDK not enabled, will not capture user feedback.");return}let n=vi(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}};var Si=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__;var w=m;var Ko=1e3,bi,Xn,Jn;function Zn(t){let e="dom";N(e,t),R(e,Xo)}function Xo(){if(!w.document)return;let t=k.bind(null,"dom"),e=Ii(t,!0);w.document.addEventListener("click",e,!1),w.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{let i=w[n],s=i&&i.prototype;!s||!s.hasOwnProperty||!s.hasOwnProperty("addEventListener")||(T(s,"addEventListener",function(o){return function(a,u,p){if(a==="click"||a=="keypress")try{let l=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},f=l[a]=l[a]||{refCount:0};if(!f.handler){let h=Ii(t);f.handler=h,o.call(this,a,h,p)}f.refCount++}catch(l){}return o.call(this,a,u,p)}}),T(s,"removeEventListener",function(o){return function(a,u,p){if(a==="click"||a=="keypress")try{let l=this.__sentry_instrumentation_handlers__||{},f=l[a];f&&(f.refCount--,f.refCount<=0&&(o.call(this,a,f.handler,p),f.handler=void 0,delete l[a]),Object.keys(l).length===0&&delete this.__sentry_instrumentation_handlers__)}catch(l){}return o.call(this,a,u,p)}}))})}function Jo(t){if(t.type!==Xn)return!1;try{if(!t.target||t.target._sentryId!==Jn)return!1}catch(e){}return!0}function Zo(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function Ii(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;let r=Qo(n);if(Zo(n.type,r))return;O(n,"_sentryCaptured",!0),r&&!r._sentryId&&O(r,"_sentryId",A());let i=n.type==="keypress"?"input":n.type;Jo(n)||(t({event:n,name:i,global:e}),Xn=n.type,Jn=r?r._sentryId:void 0),clearTimeout(bi),bi=w.setTimeout(()=>{Jn=void 0,Xn=void 0},Ko)}}function Qo(t){try{return t.target}catch(e){return null}}var Ut;function Qe(t){let e="history";N(e,t),R(e,ea)}function ea(){if(!qn())return;let t=w.onpopstate;w.onpopstate=function(...n){let r=w.location.href,i=Ut;if(Ut=r,k("history",{from:i,to:r}),t)try{return t.apply(this,n)}catch(o){}};function e(n){return function(...r){let i=r.length>2?r[2]:void 0;if(i){let s=Ut,o=String(i);Ut=o,k("history",{from:s,to:o})}return n.apply(this,r)}}T(w.history,"pushState",e),T(w.history,"replaceState",e)}var Lt={};function Qn(t){let e=Lt[t];if(e)return e;let n=w[t];if(Je(n))return Lt[t]=n.bind(w);let r=w.document;if(r&&typeof r.createElement=="function")try{let i=r.createElement("iframe");i.hidden=!0,r.head.appendChild(i);let s=i.contentWindow;s&&s[t]&&(n=s[t]),r.head.removeChild(i)}catch(i){Si&&d.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,i)}return n&&(Lt[t]=n.bind(w))}function Ft(t){Lt[t]=void 0}var ve="__sentry_xhr_v3__";function er(t){let e="xhr";N(e,t),R(e,ta)}function ta(){if(!w.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){let i=new Error,s=U()*1e3,o=C(r[0])?r[0].toUpperCase():void 0,a=na(r[1]);if(!o||!a)return e.apply(n,r);n[ve]={method:o,url:a,request_headers:{}},o==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);let u=()=>{let p=n[ve];if(p&&n.readyState===4){try{p.status_code=n.status}catch(f){}let l={endTimestamp:U()*1e3,startTimestamp:s,xhr:n,virtualError:i};k("xhr",l)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(p,l,f){return u(),p.apply(l,f)}}):n.addEventListener("readystatechange",u),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(p,l,f){let[h,g]=f,y=l[ve];return y&&C(h)&&C(g)&&(y.request_headers[h.toLowerCase()]=g),p.apply(l,f)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){let i=n[ve];if(!i)return e.apply(n,r);r[0]!==void 0&&(i.body=r[0]);let s={startTimestamp:U()*1e3,xhr:n};return k("xhr",s),e.apply(n,r)}})}function na(t){if(C(t))return t;try{return t.toString()}catch(e){}}function xi(t,e=Qn("fetch")){let n=0,r=0;function i(s){let o=s.body.length;n+=o,r++;let a=c({body:s.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15},t.fetchOptions);if(!e)return Ft("fetch"),fe("No fetch implementation available");try{return e(t.url,a).then(u=>(n-=o,r--,{statusCode:u.status,headers:{"x-sentry-rate-limits":u.headers.get("X-Sentry-Rate-Limits"),"retry-after":u.headers.get("Retry-After")}}))}catch(u){return Ft("fetch"),n-=o,r--,fe(u)}}return kt(t,i)}var ra=30;var ia=50;function tr(t,e,n,r){let i={filename:t,function:e===""?J:e,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var sa=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,oa=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,aa=/\((\S*)(?::(\d+))(?::(\d+))\)/,ua=t=>{let e=sa.exec(t);if(e){let[,r,i,s]=e;return tr(r,J,+i,+s)}let n=oa.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){let o=aa.exec(n[2]);o&&(n[2]=o[1],n[3]=o[2],n[4]=o[3])}let[i,s]=Ti(n[1]||J,n[2]);return tr(s,i,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},ca=[ra,ua],pa=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,la=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,fa=t=>{let e=pa.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let s=la.exec(e[3]);s&&(e[1]=e[1]||"eval",e[3]=s[1],e[4]=s[2],e[5]="")}let r=e[3],i=e[1]||J;return[i,r]=Ti(i,r),tr(r,i,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},da=[ia,fa];var ma=[ca,da],ki=nt(...ma),Ti=(t,e)=>{let n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:J,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};var $t=1024,ha="Breadcrumbs",ya=(t={})=>{let e=c({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t);return{name:ha,setup(n){e.console&&Ln(Ea(n)),e.dom&&Zn(_a(n,e.dom)),e.xhr&&er(va(n)),e.fetch&&Hn(Sa(n)),e.history&&Qe(ba(n)),e.sentry&&n.on("beforeSendEvent",ga(n))}}},Ai=ya;function ga(t){return function(n){S()===t&&ie({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:V(n)},{event:n})}}function _a(t,e){return function(r){if(S()!==t)return;let i,s,o=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>$t&&(se&&d.warn(`\`dom.maxStringLength\` cannot exceed ${$t}, but a value of ${a} was configured. Sentry will use ${$t} instead.`),a=$t),typeof o=="string"&&(o=[o]);try{let p=r.event,l=Ia(p)?p.target:p;i=Ge(l,{keyAttrs:o,maxStringLength:a}),s=un(l)}catch(p){i=""}if(i.length===0)return;let u={category:`ui.${r.name}`,message:i};s&&(u.data={"ui.component_name":s}),ie(u,{event:r.event,name:r.name,global:r.global})}}function Ea(t){return function(n){if(S()!==t)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:Fn(n.level),message:at(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${at(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;ie(r,{input:n.args,level:n.level})}}function va(t){return function(n){if(S()!==t)return;let{startTimestamp:r,endTimestamp:i}=n,s=n.xhr[ve];if(!r||!i||!s)return;let{method:o,url:a,status_code:u,body:p}=s,l={method:o,url:a,status_code:u},f={xhr:n.xhr,input:p,startTimestamp:r,endTimestamp:i},h=Nt(u);ie({category:"xhr",data:l,type:"http",level:h},f)}}function Sa(t){return function(n){if(S()!==t)return;let{startTimestamp:r,endTimestamp:i}=n;if(i&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){let s=n.fetchData,o={data:n.error,input:n.args,startTimestamp:r,endTimestamp:i};ie({category:"fetch",data:s,level:"error",type:"http"},o)}else{let s=n.response,o=v(c({},n.fetchData),{status_code:s&&s.status}),a={input:n.args,response:s,startTimestamp:r,endTimestamp:i},u=Nt(o.status_code);ie({category:"fetch",data:o,type:"http",level:u},a)}}}function ba(t){return function(n){if(S()!==t)return;let r=n.from,i=n.to,s=Xe(E.location.href),o=r?Xe(r):void 0,a=Xe(i);(!o||!o.path)&&(o=s),s.protocol===a.protocol&&s.host===a.host&&(i=a.relative),s.protocol===o.protocol&&s.host===o.host&&(r=o.relative),ie({category:"navigation",data:{from:r,to:i}})}}function Ia(t){return!!t&&!!t.target}var xa=["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"],ka="BrowserApiErrors",Ta=(t={})=>{let e=c({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t);return{name:ka,setupOnce(){e.setTimeout&&T(E,"setTimeout",wi),e.setInterval&&T(E,"setInterval",wi),e.requestAnimationFrame&&T(E,"requestAnimationFrame",Aa),e.XMLHttpRequest&&"XMLHttpRequest"in E&&T(XMLHttpRequest.prototype,"send",wa);let n=e.eventTarget;n&&(Array.isArray(n)?n:xa).forEach(Da)}}},Di=Ta;function wi(t){return function(...e){let n=e[0];return e[0]=Ee(n,{mechanism:{data:{function:G(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function Aa(t){return function(e){return t.apply(this,[Ee(e,{mechanism:{data:{function:"requestAnimationFrame",handler:G(t)},handled:!1,type:"instrument"}})])}}function wa(t){return function(...e){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&T(n,i,function(s){let o={mechanism:{data:{function:i,handler:G(s)},handled:!1,type:"instrument"}},a=ge(s);return a&&(o.mechanism.data.handler=G(a)),Ee(s,o)})}),t.apply(this,e)}}function Da(t){let n=E[t],r=n&&n.prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(T(r,"addEventListener",function(i){return function(s,o,a){try{Na(o)&&(o.handleEvent=Ee(o.handleEvent,{mechanism:{data:{function:"handleEvent",handler:G(o),target:t},handled:!1,type:"instrument"}}))}catch(u){}return i.apply(this,[s,Ee(o,{mechanism:{data:{function:"addEventListener",handler:G(o),target:t},handled:!1,type:"instrument"}}),a])}}),T(r,"removeEventListener",function(i){return function(s,o,a){try{let u=o.__sentry_wrapped__;u&&i.call(this,s,u,a)}catch(u){}return i.call(this,s,o,a)}}))}function Na(t){return typeof t.handleEvent=="function"}var Ni=()=>({name:"BrowserSession",setupOnce(){if(typeof E.document=="undefined"){se&&d.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Ye({ignoreDuration:!0}),Ve(),Qe(({from:t,to:e})=>{t!==void 0&&t!==e&&(Ye({ignoreDuration:!0}),Ve())})}});var Ra="GlobalHandlers",Ca=(t={})=>{let e=c({onerror:!0,onunhandledrejection:!0},t);return{name:Ra,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(Oa(n),Ri("onerror")),e.onunhandledrejection&&(Pa(n),Ri("onunhandledrejection"))}}},Ci=Ca;function Oa(t){Zt(e=>{let{stackParser:n,attachStacktrace:r}=Oi();if(S()!==t||Wn())return;let{msg:i,url:s,line:o,column:a,error:u}=e,p=La(Pt(n,u||i,void 0,r,!1),s,o,a);p.level="error",_e(p,{originalException:u,mechanism:{handled:!1,type:"onerror"}})})}function Pa(t){en(e=>{let{stackParser:n,attachStacktrace:r}=Oi();if(S()!==t||Wn())return;let i=Ma(e),s=he(i)?Ua(i):Pt(n,i,void 0,r,!0);s.level="error",_e(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function Ma(t){if(he(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(e){}return t}function Ua(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function La(t,e,n,r){let i=t.exception=t.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},a=o.stacktrace=o.stacktrace||{},u=a.frames=a.frames||[],p=r,l=n,f=C(e)&&e.length>0?e:an();return u.length===0&&u.push({colno:p,filename:f,function:J,in_app:!0,lineno:l}),t}function Ri(t){se&&d.log(`Global Handler attached: ${t}`)}function Oi(){let t=S();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var Pi=()=>({name:"HttpContext",preprocessEvent(t){if(!E.navigator&&!E.location&&!E.document)return;let e=t.request&&t.request.url||E.location&&E.location.href,{referrer:n}=E.document||{},{userAgent:r}=E.navigator||{},i=c(c(c({},t.request&&t.request.headers),n&&{Referer:n}),r&&{"User-Agent":r}),s=v(c(c({},t.request),e&&{url:e}),{headers:i});t.request=s}});var Fa="cause",$a=5,Ba="LinkedErrors",ja=(t={})=>{let e=t.limit||$a,n=t.key||Fa;return{name:Ba,preprocessEvent(r,i,s){let o=s.getOptions();Un(Ot,o.stackParser,o.maxValueLength,n,e,r,i)}}},Mi=ja;function Ui(t){let e=[wt(),Tt(),Di(),Ai(),Ci(),Mi(),Dt(),Pi()];return t.autoSessionTracking!==!1&&e.push(Ni()),e}function Ha(t={}){let e={defaultIntegrations:Ui(t),release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:E.SENTRY_RELEASE&&E.SENTRY_RELEASE.id?E.SENTRY_RELEASE.id:void 0,autoSessionTracking:!0,sendClientReports:!0};return t.defaultIntegrations==null&&delete t.defaultIntegrations,c(c({},e),t)}function Ga(){let t=typeof E.window!="undefined"&&E;if(!t)return!1;let e=t.chrome?"chrome":"browser",n=t[e],r=n&&n.runtime&&n.runtime.id,i=E.location&&E.location.href||"",s=["chrome-extension:","moz-extension:","ms-browser-extension:","safari-web-extension:"],o=!!r&&E===E.top&&s.some(u=>i.startsWith(`${u}//`)),a=typeof t.nw!="undefined";return!!r&&!o&&!a}function nr(t={}){let e=Ha(t);if(!e.skipBrowserExtensionCheck&&Ga()){M(()=>{console.error("[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")});return}se&&(Rt()||d.warn("No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill."));let n=v(c({},e),{stackParser:Xt(e.stackParser||ki),integrations:Dn(e),transport:e.transport||xi});return Cn(Mt,n)}function Li(t){if(!t)return"EN";let e=t.split("-")[0].toUpperCase();return e.length===2&&/^[A-Z]{2}$/.test(e)?e:"EN"}nr({dsn:"https://6c0ff6a487ebf368351a9ffbaf3d52a8@o4509006129397760.ingest.us.sentry.io/4509006130708480",defaultIntegrations:!1,environment:"checkout-extension"});var za=Wt([$e("checkout_started"),$e("checkout_completed"),$e("cart_viewed")]),Ey=zt({eventName:za,clientId:X(),shopDomain:X(),viewedNotPurchasedProductVariantsIds:qt(X()),cartId:X(),checkoutToken:X(),countryCode:X(),marketId:X(),languageCode:X()}),rr=class{constructor(e,n){j(this,"storage");j(this,"api");j(this,"serverUrl");j(this,"developerPreview");j(this,"cart");var s,o,a,u,p,l;this.api=e,this.storage=n;let r=e.init.data.shop.myshopifyDomain||"";this.cart=((s=e.init.data.cart)==null?void 0:s.id)||null;let i=(l=(p=(a=(o=Vt)==null?void 0:o[r])==null?void 0:a.appUrl)!=null?p:(u=Vt.default)==null?void 0:u.appUrl)!=null?l:"https://app.orderediting.com";this.serverUrl=i,r.includes("andrej-orderediting-staging")||r.includes("andrej-oe-staging")?this.developerPreview=!0:r.includes("orderediting-customer-accounts")?this.developerPreview=!0:(this.serverUrl="https://app.orderediting.com",this.developerPreview=!1)}extractUsername(e){var n;return(n=e==null?void 0:e.replace(".myshopify.com",""))==null?void 0:n.replace("https://","")}sendToServer(e){return x(this,null,function*(){var i;let n=this.api.init.data.shop.myshopifyDomain,r=this.extractUsername(n);try{(((i=this.api.settings.Enabled)==null?void 0:i.toLowerCase())==="true"||this.developerPreview)&&(yield fetch(`${this.serverUrl}/api/v1/${r}/edges/pixel?uid=${e.clientId}&cid=${this.api.init.data.cart.id}`,{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Shop-Domain":n||""},body:JSON.stringify(e),keepalive:!0}))}catch(s){console.error("Failed to send the pixel event to the OrderEditing service.",s)}})}logStorage(){return x(this,null,function*(){let e=yield this.storage.get(),n=yield this.storage.getCartIdentifier()})}registerEventListeners(e){this.api.analytics.subscribe("page_viewed",n=>x(this,null,function*(){var i,s,o;this.developerPreview&&this.logStorage();let r=(o=(s=(i=e==null?void 0:e.init)==null?void 0:i.data)==null?void 0:s.cart)==null?void 0:o.id;r&&(yield this.storage.setCartIdentifier(r))})),this.api.analytics.subscribe("product_viewed",n=>x(this,null,function*(){var r,i,s,o,a,u,p,l,f,h,g,y,L,b,F,B,pe,Re,Ce,Oe,Pe,Me,Ue,Le,Fe;if((r=n==null?void 0:n.data)!=null&&r.productVariant){if(((o=(s=(i=n==null?void 0:n.data)==null?void 0:i.productVariant)==null?void 0:s.price)==null?void 0:o.amount)===0)return;if(((p=(u=(a=n==null?void 0:n.data)==null?void 0:a.productVariant)==null?void 0:u.image)==null?void 0:p.src)===void 0)return;if((g=(h=(f=(l=n==null?void 0:n.data)==null?void 0:l.productVariant)==null?void 0:f.product)==null?void 0:h.title)!=null&&g.toLowerCase().includes("insurance"))return;if((F=(b=(L=(y=n==null?void 0:n.data)==null?void 0:y.productVariant)==null?void 0:L.product)==null?void 0:b.title)!=null&&F.toLowerCase().includes("bundle"))return;if((Ce=(Re=(pe=(B=n==null?void 0:n.data)==null?void 0:B.productVariant)==null?void 0:pe.product)==null?void 0:Re.title)!=null&&Ce.toLowerCase().includes("pre-order"))return;if((Ue=(Me=(Pe=(Oe=n==null?void 0:n.data)==null?void 0:Oe.productVariant)==null?void 0:Pe.product)==null?void 0:Me.title)!=null&&Ue.toLowerCase().includes("gift"))return}else return;yield this.storage.upsert((Fe=(Le=n==null?void 0:n.data)==null?void 0:Le.productVariant)==null?void 0:Fe.id,"viewedItems"),this.developerPreview&&this.logStorage()})),this.api.analytics.subscribe("product_removed_from_cart",n=>x(this,null,function*(){var r,i,s,o,a;(i=(r=n.data)==null?void 0:r.cartLine)!=null&&i.merchandise&&(yield this.storage.upsert((a=(o=(s=n.data)==null?void 0:s.cartLine)==null?void 0:o.merchandise)==null?void 0:a.id,"removeItem"),this.developerPreview&&this.logStorage())})),this.api.analytics.subscribe("checkout_started",n=>x(this,null,function*(){var r,i,s,o,a;(i=(r=n==null?void 0:n.data)==null?void 0:r.checkout)!=null&&i.token&&(yield this.storage.upsert((a=(o=(s=n==null?void 0:n.data)==null?void 0:s.checkout)==null?void 0:o.lineItems)==null?void 0:a.map(u=>u==null?void 0:u.id),"checkoutStarted"),this.developerPreview&&this.logStorage(),yield this.handleCheckoutStartedEvent(n))})),this.api.analytics.subscribe("ui_extension_errored",n=>x(this,null,function*(){let{apiVersion:r,appId:i,appName:s,appVersion:o,trace:a}=n.data.error,u={event_name:n.name,event_data:{apiVersion:r,appId:i,appName:s,appVersion:o,trace:a}};try{_e({level:"error",message:"UI Extension Error",extra:u})}catch(p){console.error("Failed to send ui_extension_errored event to the OrderEditing service.",p)}}))}handleCheckoutStartedEvent(e){return x(this,null,function*(){var l,f,h,g,y,L,b,F,B,pe,Re,Ce,Oe,Pe,Me,Ue,Le;if(e.name!=="checkout_started")return;let n=yield this.storage.get(),r=yield this.api.browser.cookie.get("cart");if(!n)return;let i=n,s=(i==null?void 0:i.viewedItems)||[],o=(i==null?void 0:i.removeItem)||[];if(s.length===0&&o.length===0)return;let a=(i==null?void 0:i.checkoutStarted)||[],u=(l=s==null?void 0:s.concat(o))==null?void 0:l.filter(Fe=>!a.some(ir=>typeof Fe=="string"&&typeof ir=="string"?Fe===ir:!1));if(u.length===0)return;let p={cartId:r,clientId:e.clientId,eventName:"checkout_started",checkoutToken:(h=(f=e==null?void 0:e.data)==null?void 0:f.checkout)==null?void 0:h.token,marketId:(b=(L=(y=(g=e==null?void 0:e.data)==null?void 0:g.checkout)==null?void 0:y.localization)==null?void 0:L.market)==null?void 0:b.id,shopDomain:((pe=(B=(F=this.api.init)==null?void 0:F.data)==null?void 0:B.shop)==null?void 0:pe.myshopifyDomain)||"",countryCode:(Oe=(Ce=(Re=e==null?void 0:e.data)==null?void 0:Re.checkout)==null?void 0:Ce.shippingAddress)==null?void 0:Oe.countryCode,languageCode:Li((Le=(Ue=(Me=(Pe=e==null?void 0:e.data)==null?void 0:Pe.checkout)==null?void 0:Me.localization)==null?void 0:Ue.language)==null?void 0:Le.isoCode),viewedNotPurchasedProductVariantsIds:u};yield this.sendToServer(p),this.storage.clear()})}};Yt(t=>{let e=new et(t.browser);new rr(t,e).registerEventListeners(t)});})();