UNPKG

@chargebee/atomicpricing

Version:

JS wrapper for your Atomic Pricing hosted page

8 lines 84.2 kB
(function(y,h){typeof exports=="object"&&typeof module!="undefined"?module.exports=h():typeof define=="function"&&define.amd?define(h):(y=typeof globalThis!="undefined"?globalThis:y||self,y["@chargebee/atomicpricing"]=h())})(this,function(){"use strict";var Fa=Object.defineProperty,Ua=Object.defineProperties;var Ba=Object.getOwnPropertyDescriptors;var $t=Object.getOwnPropertySymbols;var Zn=Object.prototype.hasOwnProperty,tr=Object.prototype.propertyIsEnumerable;var Qn=(y,h,E)=>h in y?Fa(y,h,{enumerable:!0,configurable:!0,writable:!0,value:E}):y[h]=E,f=(y,h)=>{for(var E in h||(h={}))Zn.call(h,E)&&Qn(y,E,h[E]);if($t)for(var E of $t(h))tr.call(h,E)&&Qn(y,E,h[E]);return y},S=(y,h)=>Ua(y,Ba(h));var er=(y,h)=>{var E={};for(var m in y)Zn.call(y,m)&&h.indexOf(m)<0&&(E[m]=y[m]);if(y!=null&&$t)for(var m of $t(y))h.indexOf(m)<0&&tr.call(y,m)&&(E[m]=y[m]);return E};var ye=(y,h,E)=>new Promise((m,V)=>{var et=k=>{try{rt(E.next(k))}catch(C){V(C)}},nt=k=>{try{rt(E.throw(k))}catch(C){V(C)}},rt=k=>k.done?m(k.value):Promise.resolve(k.value).then(et,nt);rt((E=E.apply(y,h)).next())});const y={THEME_UPDATED:"pricify.theme.updated",PAGE_LOAD:"pricify.hosted.page.load",DIMENSION:"pricify.hosted.page.dimension",SET_VISITOR:"pricify.hosted.page.setVisitor",SET_QUANTITY:"pricify.hosted.page.setQuantity",SET_BILLING_ADDRESS:"pricify.hosted.page.setBillingAddress",SET_SHIPPING_ADDRESS:"pricify.hosted.page.setShippingAddress",SET_BUSINESS_ENTITY:"pricify.hosted.page.setBusinessEntity",SET_PRICE_VARIANT:"pricify.hosted.page.setPriceVariant",SET_SUBSCRIPTION_ATTRIBUTES:"pricify.hosted.page.setSubscriptionAttributes"},h=typeof __SENTRY_DEBUG__=="undefined"||__SENTRY_DEBUG__,E="9.30.0",m=globalThis;function V(){return et(m),m}function et(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||E,e[E]=e[E]||{}}function nt(t,e,n=m){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[E]=r[E]||{};return s[t]||(s[t]=e())}const rt=Object.prototype.toString;function k(t){switch(rt.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return G(t,Error)}}function C(t,e){return rt.call(t)===`[object ${e}]`}function Ee(t){return C(t,"ErrorEvent")}function Se(t){return C(t,"DOMError")}function nr(t){return C(t,"DOMException")}function M(t){return C(t,"String")}function Ft(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function Ut(t){return t===null||Ft(t)||typeof t!="object"&&typeof t!="function"}function ut(t){return C(t,"Object")}function _t(t){return typeof Event!="undefined"&&G(t,Event)}function rr(t){return typeof Element!="undefined"&&G(t,Element)}function sr(t){return C(t,"RegExp")}function mt(t){return!!(t!=null&&t.then&&typeof t.then=="function")}function ir(t){return ut(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function G(t,e){try{return t instanceof e}catch(n){return!1}}function Ie(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function or(t){return typeof Request!="undefined"&&G(t,Request)}const Bt=m,ar=80;function be(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,s=[];let i=0,o=0;const a=" > ",c=a.length;let u;const d=Array.isArray(e)?e:e.keyAttrs,l=!Array.isArray(e)&&e.maxStringLength||ar;for(;n&&i++<r&&(u=cr(n,d),!(u==="html"||i>1&&o+s.length*c+u.length>=l));)s.push(u),o+=u.length,n=n.parentNode;return s.reverse().join(a)}catch(n){return"<unknown>"}}function cr(t,e){const n=t,r=[];if(!(n!=null&&n.tagName))return"";if(Bt.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=e!=null&&e.length?e.filter(o=>n.getAttribute(o)).map(o=>[o,n.getAttribute(o)]):null;if(s!=null&&s.length)s.forEach(o=>{r.push(`[${o[0]}="${o[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const o=n.className;if(o&&M(o)){const a=o.split(/\s+/);for(const c of a)r.push(`.${c}`)}}const i=["aria-label","type","name","title","alt"];for(const o of i){const a=n.getAttribute(o);a&&r.push(`[${o}="${a}"]`)}return r.join("")}function jt(){try{return Bt.document.location.href}catch(t){return""}}function ur(t){if(!Bt.HTMLElement)return null;let e=t;const n=5;for(let r=0;r<n;r++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null}const fr="Sentry Logger ",Ht=["debug","info","warn","error","log","assert","trace"],yt={};function st(t){if(!("console"in m))return t();const e=m.console,n={},r=Object.keys(yt);r.forEach(s=>{const i=yt[s];n[s]=e[s],e[s]=i});try{return t()}finally{r.forEach(s=>{e[s]=n[s]})}}function dr(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return h?Ht.forEach(n=>{e[n]=(...r)=>{t&&st(()=>{m.console[n](`${fr}[${n}]:`,...r)})}}):Ht.forEach(n=>{e[n]=()=>{}}),e}const _=nt("logger",dr);function Et(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function Te(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const s=t[r];try{Ie(s)?n.push("[VueViewModel]"):n.push(String(s))}catch(i){n.push("[value cannot be serialized]")}}return n.join(e)}function lr(t,e,n=!1){return M(t)?sr(e)?e.test(t):M(e)?n?t===e:t.includes(e):!1:!1}function St(t,e=[],n=!1){return e.some(r=>lr(t,r,n))}function P(t,e,n){if(!(e in t))return;const r=t[e];if(typeof r!="function")return;const s=n(r);typeof s=="function"&&ve(s,r);try{t[e]=s}catch(i){h&&_.log(`Failed to replace method "${e}" in object`,t)}}function q(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch(r){h&&_.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function ve(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,q(t,"__sentry_original__",e)}catch(n){}}function Gt(t){return t.__sentry_original__}function we(t){if(k(t))return f({message:t.message,name:t.name,stack:t.stack},Ne(t));if(_t(t)){const e=f({type:t.type,target:Re(t.target),currentTarget:Re(t.currentTarget)},Ne(t));return typeof CustomEvent!="undefined"&&G(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function Re(t){try{return rr(t)?be(t):Object.prototype.toString.call(t)}catch(e){return"<unknown>"}}function Ne(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function pr(t,e=40){const n=Object.keys(we(t));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=e)return Et(r,e);for(let s=n.length;s>0;s--){const i=n.slice(0,s).join(", ");if(!(i.length>e))return s===n.length?i:Et(i,e)}return""}function hr(){const t=m;return t.crypto||t.msCrypto}function D(t=hr()){let e=()=>Math.random()*16;try{if(t!=null&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t!=null&&t.getRandomValues&&(e=()=>{const n=new Uint8Array(1);return t.getRandomValues(n),n[0]})}catch(n){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,n=>(n^(e()&15)>>n/4).toString(16))}function Pe(t){var e,n;return(n=(e=t.exception)==null?void 0:e.values)==null?void 0:n[0]}function z(t){const{message:e,event_id:n}=t;if(e)return e;const r=Pe(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Wt(t,e,n){const r=t.exception=t.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=e||""),i.type||(i.type=n||"Error")}function it(t,e){const n=Pe(t);if(!n)return;const r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism=f(f(f({},r),s),e),e&&"data"in e){const i=f(f({},s==null?void 0:s.data),e.data);n.mechanism.data=i}}function Ae(t){if(gr(t))return!0;try{q(t,"__sentry_captured__",!0)}catch(e){}return!1}function gr(t){try{return t.__sentry_captured__}catch(e){}}const De=1e3;function ft(){return Date.now()/De}function _r(){const{performance:t}=m;if(!(t!=null&&t.now))return ft;const e=Date.now()-t.now(),n=t.timeOrigin==null?e:t.timeOrigin;return()=>(n+t.now())/De}const $=_r();function mr(t){const e=$(),n={sid:D(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Er(n)};return t&&ot(n,t),n}function ot(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||$(),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:D()),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{const 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 yr(t,e){let n={};e?n={status:e}:t.status==="ok"&&(n={status:"exited"}),ot(t,n)}function Er(t){return{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 dt(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&Object.keys(e).length===0)return t;const r=f({},t);for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=dt(r[s],e[s],n-1));return r}const Yt="_sentrySpan";function ke(t,e){e?q(t,Yt,e):delete t[Yt]}function Oe(t){return t[Yt]}function Ce(){return D()}function xe(){return D().substring(16)}const Sr=100;class x{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:Ce(),sampleRand:Math.random()}}clone(){const e=new x;return e._breadcrumbs=[...this._breadcrumbs],e._tags=f({},this._tags),e._extra=f({},this._extra),e._contexts=f({},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._attachments=[...this._attachments],e._sdkProcessingMetadata=f({},this._sdkProcessingMetadata),e._propagationContext=f({},this._propagationContext),e._client=this._client,e._lastEventId=this._lastEventId,ke(e,Oe(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&&ot(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags=f(f({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,n){return this._tags=S(f({},this._tags),{[e]:n}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=f(f({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,n){return this._extra=S(f({},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;const n=typeof e=="function"?e(this):e,r=n instanceof x?n.getScopeData():ut(n)?e:void 0,{tags:s,extra:i,user:o,contexts:a,level:c,fingerprint:u=[],propagationContext:d}=r||{};return this._tags=f(f({},this._tags),s),this._extra=f(f({},this._extra),i),this._contexts=f(f({},this._contexts),a),o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),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._session=void 0,ke(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ce(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){var i;const r=typeof n=="number"?n:Sr;if(r<=0)return this;const s=S(f({timestamp:ft()},e),{message:e.message?Et(e.message,2048):e.message});return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),(i=this._client)==null||i.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(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:Oe(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=dt(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=(n==null?void 0:n.event_id)||D();if(!this._client)return _.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(e,S(f({originalException:e,syntheticException:s},n),{event_id:r}),this),r}captureMessage(e,n,r){const s=(r==null?void 0:r.event_id)||D();if(!this._client)return _.warn("No client configured on scope - will not capture message!"),s;const i=new Error(e);return this._client.captureMessage(e,n,S(f({originalException:e,syntheticException:i},r),{event_id:s}),this),s}captureEvent(e,n){const r=(n==null?void 0:n.event_id)||D();return this._client?(this._client.captureEvent(e,S(f({},n),{event_id:r}),this),r):(_.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)}}function Ir(){return nt("defaultCurrentScope",()=>new x)}function br(){return nt("defaultIsolationScope",()=>new x)}class Tr{constructor(e,n){let r;e?r=e:r=new x;let s;n?s=n:s=new x,this._stack=[{scope:r}],this._isolationScope=s}withScope(e){const n=this._pushScope();let r;try{r=e(n)}catch(s){throw this._popScope(),s}return mt(r)?r.then(s=>(this._popScope(),s),s=>{throw this._popScope(),s}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const 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 at(){const t=V(),e=et(t);return e.stack=e.stack||new Tr(Ir(),br())}function vr(t){return at().withScope(t)}function wr(t,e){const n=at();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function Le(t){return at().withScope(()=>t(at().getIsolationScope()))}function Rr(){return{withIsolationScope:Le,withScope:vr,withSetScope:wr,withSetIsolationScope:(t,e)=>Le(e),getCurrentScope:()=>at().getScope(),getIsolationScope:()=>at().getIsolationScope()}}function Vt(t){const e=et(t);return e.acs?e.acs:Rr()}function F(){const t=V();return Vt(t).getCurrentScope()}function lt(){const t=V();return Vt(t).getIsolationScope()}function Nr(){return nt("globalScope",()=>new x)}function Pr(...t){const e=V(),n=Vt(e);if(t.length===2){const[r,s]=t;return r?n.withSetScope(r,s):n.withScope(s)}return n.withScope(t[0])}function w(){return F().getClient()}function Ar(t){const e=t.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:s}=e,i={trace_id:n,span_id:s||xe()};return r&&(i.parent_span_id=r),i}const Dr="sentry.source",kr="sentry.sample_rate",Or="sentry.previous_trace_sample_rate",Cr="sentry.op",xr="sentry.origin",Me="sentry.profile_id",$e="sentry.exclusive_time",Lr=0,Mr=1,$r="_sentryScope",Fr="_sentryIsolationScope";function Fe(t){return{scope:t[$r],isolationScope:t[Fr]}}function Ur(t){if(typeof t=="boolean")return Number(t);const e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}const Br="sentry-",jr=/^sentry-/;function Hr(t){const e=Gr(t);if(!e)return;const n=Object.entries(e).reduce((r,[s,i])=>{if(s.match(jr)){const o=s.slice(Br.length);r[o]=i}return r},{});if(Object.keys(n).length>0)return n}function Gr(t){if(!(!t||!M(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{const r=Ue(n);return Object.entries(r).forEach(([s,i])=>{e[s]=i}),e},{}):Ue(t)}function Ue(t){return t.split(",").map(e=>e.split("=").map(n=>{try{return decodeURIComponent(n.trim())}catch(r){return}})).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}const Be=1;let je=!1;function Wr(t){const{spanId:e,traceId:n,isRemote:r}=t.spanContext(),s=r?e:qt(t).parent_span_id,i=Fe(t).scope,o=r?(i==null?void 0:i.getPropagationContext().propagationSpanId)||xe():e;return{parent_span_id:s,span_id:o,trace_id:n}}function Yr(t){if(t&&t.length>0)return t.map(o=>{var a=o,{context:c}=a,u=c,{spanId:e,traceId:n,traceFlags:r}=u,s=er(u,["spanId","traceId","traceFlags"]),{attributes:i}=a;return f({span_id:e,trace_id:n,sampled:r===Be,attributes:i},s)})}function He(t){return typeof t=="number"?Ge(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Ge(t.getTime()):$()}function Ge(t){return t>9999999999?t/1e3:t}function qt(t){var r;if(qr(t))return t.getSpanJSON();const{spanId:e,traceId:n}=t.spanContext();if(Vr(t)){const{attributes:s,startTime:i,name:o,endTime:a,status:c,links:u}=t,d="parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?(r=t.parentSpanContext)==null?void 0:r.spanId:void 0;return{span_id:e,trace_id:n,data:s,description:o,parent_span_id:d,start_timestamp:He(i),timestamp:He(a)||void 0,status:Kr(c),op:s[Cr],origin:s[xr],links:Yr(u)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function Vr(t){const e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function qr(t){return typeof t.getSpanJSON=="function"}function zr(t){const{traceFlags:e}=t.spanContext();return e===Be}function Kr(t){if(!(!t||t.code===Lr))return t.code===Mr?"ok":t.message||"unknown_error"}const Xr="_sentryRootSpan";function We(t){return t[Xr]||t}function Ye(){je||(st(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),je=!0)}const Ve=50,K="?",qe=/\(error: (.*)\)/,ze=/captureMessage|captureException/;function Ke(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,s=0)=>{const i=[],o=n.split(` `);for(let a=r;a<o.length;a++){const c=o[a];if(c.length>1024)continue;const u=qe.test(c)?c.replace(qe,"$1"):c;if(!u.match(/\S*Error: /)){for(const d of e){const l=d(u);if(l){i.push(l);break}}if(i.length>=Ve+s)break}}return Qr(i.slice(s))}}function Jr(t){return Array.isArray(t)?Ke(...t):t}function Qr(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(It(e).function||"")&&e.pop(),e.reverse(),ze.test(It(e).function||"")&&(e.pop(),ze.test(It(e).function||"")&&e.pop()),e.slice(0,Ve).map(n=>S(f({},n),{filename:n.filename||It(e).filename,function:n.function||K}))}function It(t){return t[t.length-1]||{}}const zt="<anonymous>";function W(t){try{return!t||typeof t!="function"?zt:t.name||zt}catch(e){return zt}}function Xe(t){const e=t.exception;if(e){const n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch(r){return}}}const bt={},Je={};function X(t,e){bt[t]=bt[t]||[],bt[t].push(e)}function J(t,e){if(!Je[t]){Je[t]=!0;try{e()}catch(n){h&&_.error(`Error while instrumenting ${t}`,n)}}}function O(t,e){const n=t&&bt[t];if(n)for(const r of n)try{r(e)}catch(s){h&&_.error(`Error while triggering instrumentation handler. Type: ${t} Name: ${W(r)} Error:`,s)}}let Kt=null;function Zr(t){const e="error";X(e,t),J(e,ts)}function ts(){Kt=m.onerror,m.onerror=function(t,e,n,r,s){return O("error",{column:r,error:s,line:n,msg:t,url:e}),Kt?Kt.apply(this,arguments):!1},m.onerror.__SENTRY_INSTRUMENTED__=!0}let Xt=null;function es(t){const e="unhandledrejection";X(e,t),J(e,ns)}function ns(){Xt=m.onunhandledrejection,m.onunhandledrejection=function(t){return O("unhandledrejection",t),Xt?Xt.apply(this,arguments):!0},m.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function rs(t){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=t||((n=w())==null?void 0:n.getOptions());return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}const Jt="production",ss=/^o(\d+)\./,is=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function os(t){return t==="http"||t==="https"}function Tt(t,e=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${o}`}function as(t){const e=is.exec(t);if(!e){st(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,s="",i="",o="",a=""]=e.slice(1);let c="",u=a;const d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){const l=u.match(/^\d+/);l&&(u=l[0])}return Qe({host:i,pass:s,path:c,projectId:u,port:o,protocol:n,publicKey:r})}function Qe(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function cs(t){if(!h)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(o=>t[o]?!1:(_.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?os(r)?e&&isNaN(parseInt(e,10))?(_.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(_.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(_.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function us(t){const e=t.match(ss);return e==null?void 0:e[1]}function fs(t){const e=typeof t=="string"?as(t):Qe(t);if(!(!e||!cs(e)))return e}const ds="_frozenDsc";function Ze(t,e){const n=e.getOptions(),{publicKey:r,host:s}=e.getDsn()||{};let i;n.orgId?i=String(n.orgId):s&&(i=us(s));const o={environment:n.environment||Jt,release:n.release,public_key:r,trace_id:t,org_id:i};return e.emit("createDsc",o),o}function ls(t,e){const n=e.getPropagationContext();return n.dsc||Ze(n.traceId,t)}function ps(t){var b,A,T,L;const e=w();if(!e)return{};const n=We(t),r=qt(n),s=r.data,i=n.spanContext().traceState,o=(A=(b=i==null?void 0:i.get("sentry.sample_rate"))!=null?b:s[kr])!=null?A:s[Or];function a(H){return(typeof o=="number"||typeof o=="string")&&(H.sample_rate=`${o}`),H}const c=n[ds];if(c)return a(c);const u=i==null?void 0:i.get("sentry.dsc"),d=u&&Hr(u);if(d)return a(d);const l=Ze(t.spanContext().traceId,e),g=s[Dr],p=r.description;return g!=="url"&&p&&(l.transaction=p),rs()&&(l.sampled=String(zr(n)),l.sample_rand=(L=i==null?void 0:i.get("sentry.sample_rand"))!=null?L:(T=Fe(n).scope)==null?void 0:T.getPropagationContext().sampleRand.toString()),a(l),e.emit("createDsc",l,n),l}function U(t,e=100,n=1/0){try{return Qt("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function tn(t,e=3,n=100*1024){const r=U(t,e);return ms(r)>n?tn(t,e-1,n):r}function Qt(t,e,n=1/0,r=1/0,s=ys()){const[i,o]=s;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;const a=hs(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;const c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(i(e))return"[Circular ~]";const u=e;if(u&&typeof u.toJSON=="function")try{const p=u.toJSON();return Qt("",p,c-1,r,s)}catch(p){}const d=Array.isArray(e)?[]:{};let l=0;const g=we(e);for(const p in g){if(!Object.prototype.hasOwnProperty.call(g,p))continue;if(l>=r){d[p]="[MaxProperties ~]";break}const b=g[p];d[p]=Qt(p,b,c-1,r,s),l++}return o(e),d}function hs(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(Ie(e))return"[VueViewModel]";if(ir(e))return"[SyntheticEvent]";if(typeof e=="number"&&!Number.isFinite(e))return`[${e}]`;if(typeof e=="function")return`[Function: ${W(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;const n=gs(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function gs(t){const e=Object.getPrototypeOf(t);return e!=null&&e.constructor?e.constructor.name:"null prototype"}function _s(t){return~-encodeURI(t).split(/%..|./).length}function ms(t){return _s(JSON.stringify(t))}function ys(){const t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function n(r){t.delete(r)}return[e,n]}function pt(t,e=[]){return[t,e]}function Es(t,e){const[n,r]=t;return[n,[...r,e]]}function en(t,e){const n=t[1];for(const r of n){const s=r[0].type;if(e(r,s))return!0}return!1}function Zt(t){const e=et(m);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function Ss(t){const[e,n]=t;let r=JSON.stringify(e);function s(i){typeof r=="string"?r=typeof i=="string"?r+i:[Zt(r),i]:r.push(typeof i=="string"?Zt(i):i)}for(const i of n){const[o,a]=i;if(s(` ${JSON.stringify(o)} `),typeof a=="string"||a instanceof Uint8Array)s(a);else{let c;try{c=JSON.stringify(a)}catch(u){c=JSON.stringify(U(a))}s(c)}}return typeof r=="string"?r:Is(r)}function Is(t){const e=t.reduce((s,i)=>s+i.length,0),n=new Uint8Array(e);let r=0;for(const s of t)n.set(s,r),r+=s.length;return n}function bs(t){const e=typeof t.data=="string"?Zt(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}const Ts={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",raw_security:"security",log:"log_item"};function nn(t){return Ts[t]}function rn(t){if(!(t!=null&&t.sdk))return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function vs(t,e,n,r){var i;const s=(i=t.sdkProcessingMetadata)==null?void 0:i.dynamicSamplingContext;return f(f(f({event_id:t.event_id,sent_at:new Date().toISOString()},e&&{sdk:e}),!!n&&r&&{dsn:Tt(r)}),s&&{trace:s})}function ws(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 Rs(t,e,n,r){const s=rn(n),i=f(f({sent_at:new Date().toISOString()},s&&{sdk:s}),!!r&&e&&{dsn:Tt(e)}),o="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return pt(i,[o])}function Ns(t,e,n,r){const s=rn(n),i=t.type&&t.type!=="replay_event"?t.type:"event";ws(t,n==null?void 0:n.sdk);const o=vs(t,s,r,e);return delete t.sdkProcessingMetadata,pt(o,[[{type:i},t]])}var B;(function(t){t[t.PENDING=0]="PENDING";const n=1;t[t.RESOLVED=n]="RESOLVED";const r=2;t[t.REJECTED=r]="REJECTED"})(B||(B={}));function Q(t){return new Y(e=>{e(t)})}function vt(t){return new Y((e,n)=>{n(t)})}class Y{constructor(e){this._state=B.PENDING,this._handlers=[],this._runExecutor(e)}then(e,n){return new Y((r,s)=>{this._handlers.push([!1,i=>{if(!e)r(i);else try{r(e(i))}catch(o){s(o)}},i=>{if(!n)s(i);else try{r(n(i))}catch(o){s(o)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new Y((n,r)=>{let s,i;return this.then(o=>{i=!1,s=o,e&&e()},o=>{i=!0,s=o,e&&e()}).then(()=>{if(i){r(s);return}n(s)})})}_executeHandlers(){if(this._state===B.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===B.RESOLVED&&n[1](this._value),this._state===B.REJECTED&&n[2](this._value),n[0]=!0)})}_runExecutor(e){const n=(i,o)=>{if(this._state===B.PENDING){if(mt(o)){o.then(r,s);return}this._state=i,this._value=o,this._executeHandlers()}},r=i=>{n(B.RESOLVED,i)},s=i=>{n(B.REJECTED,i)};try{e(r,s)}catch(i){s(i)}}}function te(t,e,n,r=0){return new Y((s,i)=>{const o=t[r];if(e===null||typeof o!="function")s(e);else{const a=o(f({},e),n);h&&o.id&&a===null&&_.log(`Event processor "${o.id}" dropped event`),mt(a)?a.then(c=>te(t,c,n,r+1).then(s)).then(null,i):te(t,a,n,r+1).then(s).then(null,i)}})}let wt,sn,Rt;function Ps(t){const e=m._sentryDebugIds;if(!e)return{};const n=Object.keys(e);return Rt&&n.length===sn||(sn=n.length,Rt=n.reduce((r,s)=>{wt||(wt={});const i=wt[s];if(i)r[i[0]]=i[1];else{const o=t(s);for(let a=o.length-1;a>=0;a--){const c=o[a],u=c==null?void 0:c.filename,d=e[s];if(u&&d){r[u]=d,wt[s]=[u,d];break}}}return r},{})),Rt}function As(t,e){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=e;Ds(t,e),r&&Cs(t,r),xs(t,n),ks(t,s),Os(t,i)}function on(t,e){const{extra:n,tags:r,user:s,contexts:i,level:o,sdkProcessingMetadata:a,breadcrumbs:c,fingerprint:u,eventProcessors:d,attachments:l,propagationContext:g,transactionName:p,span:b}=e;Nt(t,"extra",n),Nt(t,"tags",r),Nt(t,"user",s),Nt(t,"contexts",i),t.sdkProcessingMetadata=dt(t.sdkProcessingMetadata,a,2),o&&(t.level=o),p&&(t.transactionName=p),b&&(t.span=b),c.length&&(t.breadcrumbs=[...t.breadcrumbs,...c]),u.length&&(t.fingerprint=[...t.fingerprint,...u]),d.length&&(t.eventProcessors=[...t.eventProcessors,...d]),l.length&&(t.attachments=[...t.attachments,...l]),t.propagationContext=f(f({},t.propagationContext),g)}function Nt(t,e,n){t[e]=dt(t[e],n,1)}function Ds(t,e){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:a}=e;Object.keys(n).length&&(t.extra=f(f({},n),t.extra)),Object.keys(r).length&&(t.tags=f(f({},r),t.tags)),Object.keys(s).length&&(t.user=f(f({},s),t.user)),Object.keys(i).length&&(t.contexts=f(f({},i),t.contexts)),o&&(t.level=o),a&&t.type!=="transaction"&&(t.transaction=a)}function ks(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function Os(t,e){t.sdkProcessingMetadata=f(f({},t.sdkProcessingMetadata),e)}function Cs(t,e){t.contexts=f({trace:Wr(e)},t.contexts),t.sdkProcessingMetadata=f({dynamicSamplingContext:ps(e)},t.sdkProcessingMetadata);const n=We(e),r=qt(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function xs(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}function Ls(t,e,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=t,c=S(f({},e),{event_id:e.event_id||n.event_id||D(),timestamp:e.timestamp||ft()}),u=n.integrations||t.integrations.map(T=>T.name);Ms(c,t),Us(c,u),s&&s.emit("applyFrameMetadata",e),e.type===void 0&&$s(c,t.stackParser);const d=js(r,n.captureContext);n.mechanism&&it(c,n.mechanism);const l=s?s.getEventProcessors():[],g=Nr().getScopeData();if(i){const T=i.getScopeData();on(g,T)}if(d){const T=d.getScopeData();on(g,T)}const p=[...n.attachments||[],...g.attachments];p.length&&(n.attachments=p),As(c,g);const b=[...l,...g.eventProcessors];return te(b,c,n).then(T=>(T&&Fs(T),typeof o=="number"&&o>0?Bs(T,o,a):T))}function Ms(t,e){const{environment:n,release:r,dist:s,maxValueLength:i=250}=e;t.environment=t.environment||n||Jt,!t.release&&r&&(t.release=r),!t.dist&&s&&(t.dist=s);const o=t.request;o!=null&&o.url&&(o.url=Et(o.url,i))}function $s(t,e){var r,s;const n=Ps(e);(s=(r=t.exception)==null?void 0:r.values)==null||s.forEach(i=>{var o,a;(a=(o=i.stacktrace)==null?void 0:o.frames)==null||a.forEach(c=>{c.filename&&(c.debug_id=n[c.filename])})})}function Fs(t){var r,s;const e={};if((s=(r=t.exception)==null?void 0:r.values)==null||s.forEach(i=>{var o,a;(a=(o=i.stacktrace)==null?void 0:o.frames)==null||a.forEach(c=>{c.debug_id&&(c.abs_path?e[c.abs_path]=c.debug_id:c.filename&&(e[c.filename]=c.debug_id),delete c.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.entries(e).forEach(([i,o])=>{n.push({type:"sourcemap",code_file:i,debug_id:o})})}function Us(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function Bs(t,e,n){var s,i;if(!t)return null;const r=f(f(f(f(f({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(o=>f(f({},o),o.data&&{data:U(o.data,e,n)}))}),t.user&&{user:U(t.user,e,n)}),t.contexts&&{contexts:U(t.contexts,e,n)}),t.extra&&{extra:U(t.extra,e,n)});return(s=t.contexts)!=null&&s.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=U(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(o=>f(f({},o),o.data&&{data:U(o.data,e,n)}))),(i=t.contexts)!=null&&i.flags&&r.contexts&&(r.contexts.flags=U(t.contexts.flags,3,n)),r}function js(t,e){if(!e)return t;const n=t?t.clone():new x;return n.update(e),n}function Hs(t){if(t)return Gs(t)?{captureContext:t}:Ys(t)?{captureContext:t}:t}function Gs(t){return t instanceof x||typeof t=="function"}const Ws=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Ys(t){return Object.keys(t).some(e=>Ws.includes(e))}function an(t,e){return F().captureException(t,Hs(e))}function Vs(t,e){const n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return F().captureMessage(t,n,r)}function cn(t,e){return F().captureEvent(t,e)}function un(t){const e=lt(),n=F(),{userAgent:r}=m.navigator||{},s=mr(f(f({user:n.getUser()||e.getUser()},r&&{userAgent:r}),t)),i=e.getSession();return(i==null?void 0:i.status)==="ok"&&ot(i,{status:"exited"}),fn(),e.setSession(s),s}function fn(){const t=lt(),n=F().getSession()||t.getSession();n&&yr(n),dn(),t.setSession()}function dn(){const t=lt(),e=w(),n=t.getSession();n&&e&&e.captureSession(n)}function ln(t=!1){if(t){fn();return}dn()}const qs="7";function zs(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function Ks(t){return`${zs(t)}${t.projectId}/envelope/`}function Xs(t,e){const 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 Js(t,e,n){return e||`${Ks(t)}?${Xs(t,n)}`}const pn=[];function Qs(t){const e={};return t.forEach(n=>{const{name:r}=n,s=e[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.values(e)}function Zs(t){const e=t.defaultIntegrations||[],n=t.integrations;e.forEach(s=>{s.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...e,...n];else if(typeof n=="function"){const s=n(e);r=Array.isArray(s)?s:[s]}else r=e;return Qs(r)}function ti(t,e){const n={};return e.forEach(r=>{r&&gn(t,r,n)}),n}function hn(t,e){for(const n of e)n!=null&&n.afterAllSetup&&n.afterAllSetup(t)}function gn(t,e,n){if(n[e.name]){h&&_.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,pn.indexOf(e.name)===-1&&typeof e.setupOnce=="function"&&(e.setupOnce(),pn.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(s,i)=>r(s,i,t))}if(typeof e.processEvent=="function"){const r=e.processEvent.bind(e),s=Object.assign((i,o)=>r(i,o,t),{id:e.name});t.addEventProcessor(s)}h&&_.log(`Integration installed: ${e.name}`)}function ja(t){return t}function _n(t){const e=[];t.message&&e.push(t.message);try{const n=t.exception.values[t.exception.values.length-1];n!=null&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`))}catch(n){}return e}function ei(t){var c,u,d;const{trace_id:e,parent_span_id:n,span_id:r,status:s,origin:i,data:o,op:a}=(u=(c=t.contexts)==null?void 0:c.trace)!=null?u:{};return{data:o!=null?o:{},description:t.transaction,op:a,parent_span_id:n,span_id:r!=null?r:"",start_timestamp:(d=t.start_timestamp)!=null?d:0,status:s,timestamp:t.timestamp,trace_id:e!=null?e:"",origin:i,profile_id:o==null?void 0:o[Me],exclusive_time:o==null?void 0:o[$e],measurements:t.measurements,is_segment:!0}}function ni(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:f(f(f({},t.data),t.profile_id&&{[Me]:t.profile_id}),t.exclusive_time&&{[$e]:t.exclusive_time})}},measurements:t.measurements}}function ri(t,e,n){const r=[{type:"client_report"},{timestamp:n||ft(),discarded_events:t}];return pt(e?{dsn:e}:{},[r])}const mn="Not capturing exception because it's already been captured.",yn="Discarded session because of missing or non-string release",En=Symbol.for("SentryInternalError"),Sn=Symbol.for("SentryDoNotSendEventError");function Pt(t){return{message:t,[En]:!0}}function ee(t){return{message:t,[Sn]:!0}}function In(t){return!!t&&typeof t=="object"&&En in t}function bn(t){return!!t&&typeof t=="object"&&Sn in t}class si{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=fs(e.dsn):h&&_.warn("No DSN provided, client will not send events."),this._dsn){const n=Js(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport(S(f({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{url:n}))}}captureException(e,n,r){const s=D();if(Ae(e))return h&&_.log(mn),s;const i=f({event_id:s},n);return this._process(this.eventFromException(e,i).then(o=>this._captureEvent(o,i,r))),i.event_id}captureMessage(e,n,r,s){const i=f({event_id:D()},r),o=Ft(e)?e:String(e),a=Ut(e)?this.eventFromMessage(o,n,i):this.eventFromException(e,i);return this._process(a.then(c=>this._captureEvent(c,i,s))),i.event_id}captureEvent(e,n,r){const s=D();if(n!=null&&n.originalException&&Ae(n.originalException))return h&&_.log(mn),s;const i=f({event_id:s},n),o=e.sdkProcessingMetadata||{},a=o.capturedSpanScope,c=o.capturedSpanIsolationScope;return this._process(this._captureEvent(e,i,a||r,c)),i.event_id}captureSession(e){this.sendSession(e),ot(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const n=this._transport;return n?(this.emit("flush"),this._isClientDoneProcessing(e).then(r=>n.flush(e).then(s=>r&&s))):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){const n=this._integrations[e.name];gn(this,e,this._integrations),n||hn(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=Ns(e,this._dsn,this._options._metadata,this._options.tunnel);for(const i of n.attachments||[])r=Es(r,bs(i));const s=this.sendEnvelope(r);s&&s.then(i=>this.emit("afterSendEvent",e,i),null)}sendSession(e){const{release:n,environment:r=Jt}=this._options;if("aggregates"in e){const i=e.attrs||{};if(!i.release&&!n){h&&_.warn(yn);return}i.release=i.release||n,i.environment=i.environment||r,e.attrs=i}else{if(!e.release&&!n){h&&_.warn(yn);return}e.release=e.release||n,e.environment=e.environment||r}this.emit("beforeSendSession",e);const s=Rs(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(s)}recordDroppedEvent(e,n,r=1){if(this._options.sendClientReports){const s=`${e}:${n}`;h&&_.log(`Recording outcome: "${s}"${r>1?` (${r} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+r}}on(e,n){const r=this._hooks[e]=this._hooks[e]||[];return r.push(n),()=>{const s=r.indexOf(n);s>-1&&r.splice(s,1)}}emit(e,...n){const r=this._hooks[e];r&&r.forEach(s=>s(...n))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,n=>(h&&_.error("Error while sending envelope:",n),n)):(h&&_.error("Transport disabled"),Q({}))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=ti(this,e),hn(this,e)}_updateSessionFromEvent(e,n){var c;let r=n.level==="fatal",s=!1;const i=(c=n.exception)==null?void 0:c.values;if(i){s=!0;for(const u of i){const d=u.mechanism;if((d==null?void 0:d.handled)===!1){r=!0;break}}}const o=e.status==="ok";(o&&e.errors===0||o&&r)&&(ot(e,S(f({},r&&{status:"crashed"}),{errors:e.errors||Number(s||r)})),this.captureSession(e))}_isClientDoneProcessing(e){return new Y(n=>{let r=0;const s=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),n(!0)):(r+=s,e&&r>=e&&(clearInterval(i),n(!1)))},s)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,s){const i=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&(o!=null&&o.length)&&(n.integrations=o),this.emit("preprocessEvent",e,n),e.type||s.setLastEventId(e.event_id||n.event_id),Ls(i,e,n,r,this,s).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts=f({trace:Ar(r)},a.contexts);const c=ls(this,r);return a.sdkProcessingMetadata=f({dynamicSamplingContext:c},a.sdkProcessingMetadata),a})}_captureEvent(e,n={},r=F(),s=lt()){return h&&ne(e)&&_.log(`Captured error event \`${_n(e)[0]||"<unknown>"}\``),this._processEvent(e,n,r,s).then(i=>i.event_id,i=>{h&&(bn(i)?_.log(i.message):In(i)?_.warn(i.message):_.warn(i))})}_processEvent(e,n,r,s){const i=this.getOptions(),{sampleRate:o}=i,a=Tn(e),c=ne(e),u=e.type||"error",d=`before send for type \`${u}\``,l=typeof o=="undefined"?void 0:Ur(o);if(c&&typeof l=="number"&&Math.random()>l)return this.recordDroppedEvent("sample_rate","error"),vt(ee(`Discarding event because it's not included in the random sample (sampling rate = ${o})`));const g=u==="replay_event"?"replay":u;return this._prepareEvent(e,n,r,s).then(p=>{if(p===null)throw this.recordDroppedEvent("event_processor",g),ee("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return p;const A=oi(this,i,p,n);return ii(A,d)}).then(p=>{var T;if(p===null){if(this.recordDroppedEvent("before_send",g),a){const H=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",H)}throw ee(`${d} returned \`null\`, will not send event.`)}const b=r.getSession()||s.getSession();if(c&&b&&this._updateSessionFromEvent(b,p),a){const L=((T=p.sdkProcessingMetadata)==null?void 0:T.spanCountBeforeProcessing)||0,H=p.spans?p.spans.length:0,Jn=L-H;Jn>0&&this.recordDroppedEvent("before_send","span",Jn)}const A=p.transaction_info;if(a&&A&&p.transaction!==e.transaction){const L="custom";p.transaction_info=S(f({},A),{source:L})}return this.sendEvent(p,n),p}).then(null,p=>{throw bn(p)||In(p)?p:(this.captureException(p,{data:{__sentry__:!0},originalException:p}),Pt(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. Reason: ${p}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{const[s,i]=n.split(":");return{reason:s,category:i,quantity:r}})}_flushOutcomes(){h&&_.log("Flushing outcomes...");const e=this._clearOutcomes();if(e.length===0){h&&_.log("No outcomes to send");return}if(!this._dsn){h&&_.log("No dsn provided, will not send outcomes");return}h&&_.log("Sending outcomes:",e);const n=ri(e,this._options.tunnel&&Tt(this._dsn));this.sendEnvelope(n)}}function ii(t,e){const n=`${e} must return \`null\` or a valid event.`;if(mt(t))return t.then(r=>{if(!ut(r)&&r!==null)throw Pt(n);return r},r=>{throw Pt(`${e} rejected with ${r}`)});if(!ut(t)&&t!==null)throw Pt(n);return t}function oi(t,e,n,r){const{beforeSend:s,beforeSendTransaction:i,beforeSendSpan:o}=e;let a=n;if(ne(a)&&s)return s(a,r);if(Tn(a)){if(o){const c=o(ei(a));if(c?a=dt(n,ni(c)):Ye(),a.spans){const u=[];for(const d of a.spans){const l=o(d);l?u.push(l):(Ye(),u.push(d))}a.spans=u}}if(i){if(a.spans){const c=a.spans.length;a.sdkProcessingMetadata=S(f({},n.sdkProcessingMetadata),{spanCountBeforeProcessing:c})}return i(a,r)}}return a}function ne(t){return t.type===void 0}function Tn(t){return t.type==="transaction"}function ai(t){return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},{items:t}]}function ci(t,e,n,r){const s={};return e!=null&&e.sdk&&(s.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(s.dsn=Tt(r)),pt(s,[ai(t)])}m._sentryClientToLogBufferMap=new WeakMap;function re(t,e){var i,o;const n=(i=e!=null?e:ui(t))!=null?i:[];if(n.length===0)return;const r=t.getOptions(),s=ci(n,r._metadata,r.tunnel,t.getDsn());(o=m._sentryClientToLogBufferMap)==null||o.set(t,[]),t.emit("flushLogs"),t.sendEnvelope(s)}function ui(t){var e;return(e=m._sentryClientToLogBufferMap)==null?void 0:e.get(t)}function fi(t,e){e.debug===!0&&(h?_.enable():st(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),F().update(e.initialScope);const r=new t(e);return di(r),r.init(),r}function di(t){F().setClient(t)}const vn=Symbol.for("SentryBufferFullError");function li(t){const e=[];function n(){return t===void 0||e.length<t}function r(o){return e.splice(e.indexOf(o),1)[0]||Promise.resolve(void 0)}function s(o){if(!n())return vt(vn);const a=o();return e.indexOf(a)===-1&&e.push(a),a.then(()=>r(a)).then(null,()=>r(a).then(null,()=>{})),a}function i(o){return new Y((a,c)=>{let u=e.length;if(!u)return a(!0);const d=setTimeout(()=>{o&&o>0&&a(!1)},o);e.forEach(l=>{Q(l).then(()=>{--u||(clearTimeout(d),a(!0))},c)})})}return{$:e,add:s,drain:i}}const pi=60*1e3;function hi(t,e=Date.now()){const n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${t}`);return isNaN(r)?pi:r-e}function gi(t,e){return t[e]||t.all||0}function _i(t,e,n=Date.now()){return gi(t,e)>n}function mi(t,{statusCode:e,headers:n},r=Date.now()){const s=f({},t),i=n==null?void 0:n["x-sentry-rate-limits"],o=n==null?void 0:n["retry-after"];if(i)for(const a of i.trim().split(",")){const[c,u,,,d]=a.split(":",5),l=parseInt(c,10),g=(isNaN(l)?60:l)*1e3;if(!u)s.all=r+g;else for(const p of u.split(";"))p==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(s[p]=r+g):s[p]=r+g}else o?s.all=r+hi(o,r):e===429&&(s.all=r+60*1e3);return s}const yi=64;function Ei(t,e,n=li(t.bufferSize||yi)){let r={};const s=o=>n.drain(o);function i(o){const a=[];if(en(o,(l,g)=>{const p=nn(g);_i(r,p)?t.recordDroppedEvent("ratelimit_backoff",p):a.push(l)}),a.length===0)return Q({});const c=pt(o[0],a),u=l=>{en(c,(g,p)=>{t.recordDroppedEvent(l,nn(p))})},d=()=>e({body:Ss(c)}).then(l=>(l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&h&&_.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=mi(r,l),l),l=>{throw u("network_error"),h&&_.error("Encountered error running transport request:",l),l});return n.add(d).then(l=>l,l=>{if(l===vn)return h&&_.error("Skipped sending event because buffer is full."),u("queue_overflow"),Q({});throw l})}return{send:i,flush:s}}function Si(t){var e;((e=t.user)==null?void 0:e.ip_address)===void 0&&(t.user=S(f({},t.user),{ip_address:"{{auto}}"}))}function Ii(t){var e;"aggregates"in t?((e=t.attrs)==null?void 0:e.ip_address)===void 0&&(t.attrs=S(f({},t.attrs),{ip_address:"{{auto}}"})):t.ipAddress===void 0&&(t.ipAddress="{{auto}}")}function bi(t,e,n=[e],r="npm"){const s=t._metadata||{};s.sdk||(s.sdk={name:`sentry.javascript.${e}`,packages:n.map(i=>({name:`${r}:@sentry/${i}`,version:E})),version:E}),t._metadata=s}const Ti=100;function Z(t,e){const n=w(),r=lt();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=Ti}=n.getOptions();if(i<=0)return;const o=ft(),a=f({timestamp:o},t),c=s?st(()=>s(a,e)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,e),r.addBreadcrumb(c,i))}let wn;const vi="FunctionToString",Rn=new WeakMap,wi=()=>({name:vi,setupOnce(){wn=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=Gt(this),n=Rn.has(w())&&e!==void 0?e:this;return wn.apply(n,t)}}catch(t){}},setup(t){Rn.set(t,!0)}}),Ri=[/^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().getRestri