chromatic
Version:
Automate visual testing across browsers. Gather UI feedback. Versioned documentation.
5 lines (4 loc) • 725 kB
JavaScript
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="855cb33f-9872-5d20-86d7-f3f716a3bb23")}catch(e){}}();
const e=require(`./chunk-gGpyby2o.cjs`),t=require(`./node-src-bfL9hQHJ.cjs`),n=require(`./turbosnap-BUT48EFm.cjs`),r=require(`./src-C0CbP6lv.cjs`),i=require(`./meow-BJmmmeH9.cjs`),a=require(`./strip-ansi-DWzhKQ1g.cjs`);let o=require(`url`);o=e.a(o,1);let s=require(`module`);s=e.a(s,1);let c=require(`worker_threads`),l=require(`node:util`);l=e.a(l,1);let u=require(`node:child_process`),d=require(`node:fs`),f=require(`node:os`);f=e.a(f,1);let p=require(`node:path`),m=require(`node:readline`),h=require(`node:worker_threads`),g=require(`node:http`);g=e.a(g,1);let _=require(`node:diagnostics_channel`);_=e.a(_,1);let v=require(`node:https`);v=e.a(v,1);let y=require(`node:stream`),b=require(`node:zlib`),x=require(`node:net`);x=e.a(x,1);let S=require(`node:tls`);S=e.a(S,1);const C={},w={};function T(e,t){C[e]=C[e]||[],C[e].push(t)}function ee(e,t){if(!w[e]){w[e]=!0;try{t()}catch(t){n.Kn&&n.Wn.error(`Error while instrumenting ${e}`,t)}}}function te(e,t){let r=e&&C[e];if(r)for(let i of r)try{i(t)}catch(t){n.Kn&&n.Wn.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${n.Bn(i)}\nError:`,t)}}let ne=null;function eee(e){let t=`error`;T(t,e),ee(t,tee)}function tee(){ne=n.qn.onerror,n.qn.onerror=function(e,t,n,r,i){return te(`error`,{column:r,error:i,line:n,msg:e,url:t}),ne?ne.apply(this,arguments):!1},n.qn.onerror.__SENTRY_INSTRUMENTED__=!0}let re=null;function nee(e){let t=`unhandledrejection`;T(t,e),ee(t,ree)}function ree(){re=n.qn.onunhandledrejection,n.qn.onunhandledrejection=function(e){return te(`unhandledrejection`,e),re?re.apply(this,arguments):!0},n.qn.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}let iee=!1;function aee(){iee||(iee=!0,eee(ie),nee(ie))}function ie(){let e=n.vt(),t=e&&n.yt(e);if(t){let e=`internal_error`;n.Yn&&n.Wn.log(`[Tracing] Root span: ${e} -> Global error occurred`),t.setStatus({code:2,message:e})}}ie.tag=`sentry_tracingErrorCallback`;const ae=`_sentryScope`,oe=`_sentryIsolationScope`;function se(e,t,r){e&&(n.Sn(e,oe,r),n.Sn(e,ae,t))}function ce(e){return{scope:e[ae],isolationScope:e[oe]}}var le=class{constructor(e={}){this._traceId=e.traceId||n.ln(),this._spanId=e.spanId||n.cn()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}};function ue(e,t,n=()=>{}){let r;try{r=e()}catch(e){throw t(e),n(),e}return oee(r,t,n)}function oee(e,t,r){return n.Ln(e)?e.then(e=>(r(),e),e=>{throw t(e),r(),e}):(r(),e)}function see(e){if(!n.Yn)return;let{description:t=`< unknown name >`,op:r=`< unknown op >`,parent_span_id:i}=n.Tt(e),{spanId:a}=e.spanContext(),o=n.Ct(e),s=n.yt(e),c=s===e,l=`[Tracing] Starting ${o?`sampled`:`unsampled`} ${c?`root `:``}span`,u=[`op: ${r}`,`name: ${t}`,`ID: ${a}`];if(i&&u.push(`parent ID: ${i}`),!c){let{op:e,description:t}=n.Tt(s);u.push(`root ID: ${s.spanContext().spanId}`),e&&u.push(`root op: ${e}`),t&&u.push(`root description: ${t}`)}n.Wn.log(`${l}
${u.join(`
`)}`)}function cee(e){if(!n.Yn)return;let{description:t=`< unknown name >`,op:r=`< unknown op >`}=n.Tt(e),{spanId:i}=e.spanContext(),a=`[Tracing] Finishing "${r}" ${n.yt(e)===e?`root `:``}span "${t}" with ID ${i}`;n.Wn.log(a)}function lee(e){if(typeof e==`boolean`)return Number(e);let t=typeof e==`string`?parseFloat(e):e;if(typeof t!=`number`||isNaN(t)||t<0||t>1){n.Yn&&n.Wn.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`);return}return t}function uee(e,t){if(!n.gt(e))return[!1];let r=n.Qt().getScopeData().sdkProcessingMetadata.normalizedRequest,i={...t,normalizedRequest:t.normalizedRequest||r},a;a=typeof e.tracesSampler==`function`?e.tracesSampler(i):i.parentSampled===void 0?e.tracesSampleRate===void 0?1:e.tracesSampleRate:i.parentSampled;let o=lee(a);return o===void 0?(n.Yn&&n.Wn.warn(`[Tracing] Discarding transaction because of invalid sample rate.`),[!1]):o?Math.random()<o?[!0,o]:(n.Yn&&n.Wn.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(a)})`),[!1,o]):(n.Yn&&n.Wn.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler==`function`?`tracesSampler returned 0 or false`:`a negative sampling decision was inherited or tracesSampleRate is set to 0`}`),[!1,o])}const dee=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function fee(e){return e===`http`||e===`https`}function de(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function pee(e){let t=dee.exec(e);if(!t){n.Un(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[r,i,a=``,o=``,s=``,c=``]=t.slice(1),l=``,u=c,d=u.split(`/`);if(d.length>1&&(l=d.slice(0,-1).join(`/`),u=d.pop()),u){let e=u.match(/^\d+/);e&&(u=e[0])}return mee({host:o,pass:a,path:l,projectId:u,port:s,protocol:r,publicKey:i})}function mee(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function hee(e){if(!n.Kn)return!0;let{port:t,projectId:r,protocol:i}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>e[t]?!1:(n.Wn.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:r.match(/^\d+$/)?fee(i)?t&&isNaN(parseInt(t,10))?(n.Wn.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(n.Wn.error(`Invalid Sentry Dsn: Invalid protocol ${i}`),!1):(n.Wn.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function gee(e){let t=typeof e==`string`?pee(e):mee(e);if(!(!t||!hee(t)))return t}function fe(e,t=[]){return[e,t]}function _ee(e,t){let[n,r]=e;return[n,[...r,t]]}function pe(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function me(e){return n.qn.__SENTRY__&&n.qn.__SENTRY__.encodePolyfill?n.qn.__SENTRY__.encodePolyfill(e):new TextEncoder().encode(e)}function he(e){let[t,r]=e,i=JSON.stringify(t);function a(e){typeof i==`string`?i=typeof e==`string`?i+e:[me(i),e]:i.push(typeof e==`string`?me(e):e)}for(let e of r){let[t,r]=e;if(a(`\n${JSON.stringify(t)}\n`),typeof r==`string`||r instanceof Uint8Array)a(r);else{let e;try{e=JSON.stringify(r)}catch{e=JSON.stringify(n.dt(r))}a(e)}}return typeof i==`string`?i:vee(i)}function vee(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function yee(e){return[{type:`span`},e]}function bee(e){let t=typeof e.data==`string`?me(e.data):e.data;return[n.Cn({type:`attachment`,length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),t]}const xee={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 ge(e){return xee[e]}function _e(e){if(!e||!e.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function See(e,t,r,i){let a=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!r&&i&&{dsn:de(i)},...a&&{trace:n.Cn({...a})}}}function Cee(e,t){return t?(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]],e):e}function wee(e,t,n,r){let i=_e(n);return fe({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:de(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function Tee(e,t,n,r){let i=_e(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;Cee(e,n&&n.sdk);let o=See(e,i,r,t);return delete e.sdkProcessingMetadata,fe(o,[[{type:a},e]])}function Eee(e,t){function r(e){return!!e.trace_id&&!!e.public_key}let i=n.ht(e[0]),a=t&&t.getDsn(),o=t&&t.getOptions().tunnel,s={sent_at:new Date().toISOString(),...r(i)&&{trace:i},...!!o&&a&&{dsn:de(a)}},c=t&&t.getOptions().beforeSendSpan,l=c?e=>{let t=c(n.Tt(e));return t||n.St(),t}:e=>n.Tt(e),u=[];for(let t of e){let e=l(t);e&&u.push(yee(e))}return fe(s,u)}function ve(e){if(!e||e.length===0)return;let t={};return e.forEach(e=>{let r=e.attributes||{},i=r[n.Ut],a=r[n.Wt];typeof i==`string`&&typeof a==`number`&&(t[e.name]={value:a,unit:i})}),t}const ye=1e3;var be=class{constructor(e={}){this._traceId=e.traceId||n.ln(),this._spanId=e.spanId||n.cn(),this._startTime=e.startTimestamp||n.xn(),this._attributes={},this.setAttributes({[n.Kt]:`manual`,[n.Gt]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),`sampled`in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this}addLinks(e){return this}recordException(e,t){}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:+!!n}}setAttribute(e,t){return t===void 0?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._startTime=n.wt(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(n.Jt,`custom`),this}end(e){this._endTime||(this._endTime=n.wt(e),cee(this),this._onSpanEnded())}getSpanJSON(){return n.Cn({data:this._attributes,description:this._name,op:this._attributes[n.Gt],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:n.xt(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[n.Kt],_metrics_summary:n.Yt(this),profile_id:this._attributes[n.Vt],exclusive_time:this._attributes[n.Bt],measurements:ve(this._events),is_segment:this._isStandaloneSpan&&n.yt(this)===this||void 0,segment_id:this._isStandaloneSpan?n.yt(this).spanContext().spanId:void 0})}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,r){n.Yn&&n.Wn.log(`[Tracing] Adding an event to span:`,e);let i=xe(t)?t:r||n.xn(),a=xe(t)?{}:t||{},o={name:e,time:n.wt(i),attributes:a};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=n.Xt();if(e&&e.emit(`spanEnd`,this),!(this._isStandaloneSpan||this===n.yt(this)))return;if(this._isStandaloneSpan){this._sampled?Oee(Eee([this],e)):(n.Yn&&n.Wn.log(`[Tracing] Discarding standalone span because its trace was not chosen to be sampled.`),e&&e.recordDroppedEvent(`sample_rate`,`span`));return}let t=this._convertSpanToTransaction();t&&(ce(this).scope||n.Zt()).captureEvent(t)}_convertSpanToTransaction(){if(!Se(n.Tt(this)))return;this._name||=(n.Yn&&n.Wn.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),`<unlabeled transaction>`);let{scope:e,isolationScope:t}=ce(this),r=(e||n.Zt()).getClient()||n.Xt();if(this._sampled!==!0){n.Yn&&n.Wn.log(`[Tracing] Discarding transaction because its trace was not chosen to be sampled.`),r&&r.recordDroppedEvent(`sample_rate`,`transaction`);return}let i=n.bt(this).filter(e=>e!==this&&!Dee(e)).map(e=>n.Tt(e)).filter(Se),a=this._attributes[n.Jt];delete this._attributes[n.Ht],i.forEach(e=>{e.data&&delete e.data[`sentry.custom_span_name`]});let o={contexts:{trace:n.Ot(this)},spans:i.length>ye?i.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,ye):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:`transaction`,sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:t,...n.Cn({dynamicSamplingContext:n.ht(this)})},_metrics_summary:n.Yt(this),...a&&{transaction_info:{source:a}}},s=ve(this._events);return s&&Object.keys(s).length&&(n.Yn&&n.Wn.log(`[Measurements] Adding measurements to transaction event`,JSON.stringify(s,void 0,2)),o.measurements=s),o}};function xe(e){return e&&typeof e==`number`||e instanceof Date||Array.isArray(e)}function Se(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function Dee(e){return e instanceof be&&e.isStandaloneSpan()}function Oee(e){let t=n.Xt();if(!t)return;let r=e[1];if(!r||r.length===0){t.recordDroppedEvent(`before_send`,`span`);return}t.sendEnvelope(e)}const Ce=`__SENTRY_SUPPRESS_TRACING__`;function we(e,t){let r=ke();if(r.startSpan)return r.startSpan(e,t);let i=Oe(e),{forceTransaction:a,parentSpan:o}=e;return n.tn(e.scope,()=>Nee(o)(()=>{let r=n.Zt(),o=Ae(r),s=e.onlyIfParent&&!o?new le:De({parentSpan:o,spanArguments:i,forceTransaction:a,scope:r});return n.sn(r,s),ue(()=>t(s),()=>{let{status:e}=n.Tt(s);s.isRecording()&&(!e||e===`ok`)&&s.setStatus({code:2,message:`internal_error`})},()=>s.end())}))}function Te(e,t){let r=ke();if(r.startSpanManual)return r.startSpanManual(e,t);let i=Oe(e),{forceTransaction:a,parentSpan:o}=e;return n.tn(e.scope,()=>Nee(o)(()=>{let r=n.Zt(),o=Ae(r),s=e.onlyIfParent&&!o?new le:De({parentSpan:o,spanArguments:i,forceTransaction:a,scope:r});n.sn(r,s);function c(){s.end()}return ue(()=>t(s,c),()=>{let{status:e}=n.Tt(s);s.isRecording()&&(!e||e===`ok`)&&s.setStatus({code:2,message:`internal_error`})})}))}function kee(e){let t=ke();if(t.startInactiveSpan)return t.startInactiveSpan(e);let r=Oe(e),{forceTransaction:i,parentSpan:a}=e;return(e.scope?t=>n.tn(e.scope,t):a===void 0?e=>e():e=>Ee(a,e))(()=>{let t=n.Zt(),a=Ae(t);return e.onlyIfParent&&!a?new le:De({parentSpan:a,spanArguments:r,forceTransaction:i,scope:t})})}function Ee(e,t){let r=ke();return r.withActiveSpan?r.withActiveSpan(e,t):n.tn(r=>(n.sn(r,e||void 0),t(r)))}function Aee(e){let t=ke();return t.suppressTracing?t.suppressTracing(e):n.tn(t=>(t.setSDKProcessingMetadata({[Ce]:!0}),e()))}function De({parentSpan:e,spanArguments:t,forceTransaction:r,scope:i}){if(!n.gt())return new le;let a=n.Qt(),o;if(e&&!r)o=Mee(e,i,t),n._t(e,o);else if(e){let r=n.ht(e),{traceId:a,spanId:s}=e.spanContext(),c=n.Ct(e);o=jee({traceId:a,parentSpanId:s,...t},i,c),n.pt(o,r)}else{let{traceId:e,dsc:r,parentSpanId:s,sampled:c}={...a.getPropagationContext(),...i.getPropagationContext()};o=jee({traceId:e,parentSpanId:s,...t},i,c),r&&n.pt(o,r)}return see(o),se(o,i,a),o}function Oe(e){let t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let r={...t};return r.startTimestamp=n.wt(e.startTime),delete r.startTime,r}return t}function ke(){return n.nn(n.Rn())}function jee(e,t,r){let i=n.Xt(),a=i&&i.getOptions()||{},{name:o=``,attributes:s}=e,[c,l]=t.getScopeData().sdkProcessingMetadata[Ce]?[!1]:uee(a,{name:o,parentSampled:r,attributes:s,transactionContext:{name:o,parentSampled:r}}),u=new be({...e,attributes:{[n.Jt]:`custom`,...e.attributes},sampled:c});return l!==void 0&&u.setAttribute(n.qt,l),i&&i.emit(`spanStart`,u),u}function Mee(e,t,r){let{spanId:i,traceId:a}=e.spanContext(),o=t.getScopeData().sdkProcessingMetadata[Ce]?!1:n.Ct(e),s=o?new be({...r,parentSpanId:i,traceId:a,sampled:o}):new le({traceId:a});n._t(e,s);let c=n.Xt();return c&&(c.emit(`spanStart`,s),r.endTimestamp&&c.emit(`spanEnd`,s)),s}function Ae(e){let t=n.on(e);if(!t)return;let r=n.Xt();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?n.yt(t):t}function Nee(e){return e===void 0?e=>e():t=>Ee(e,t)}var Pee=class{constructor(e,t){this._client=e,this.flushTimeout=60,this._pendingAggregates=new Map,this._isEnabled=!0,this._intervalId=setInterval(()=>this.flush(),this.flushTimeout*1e3),this._intervalId.unref&&this._intervalId.unref(),this._sessionAttrs=t}flush(){let e=this.getSessionAggregates();e.aggregates.length!==0&&(this._pendingAggregates=new Map,this._client.sendSession(e))}getSessionAggregates(){let e=Array.from(this._pendingAggregates.values());return n.Cn({attrs:this._sessionAttrs,aggregates:e})}close(){clearInterval(this._intervalId),this._isEnabled=!1,this.flush()}incrementSessionStatusCount(){if(!this._isEnabled)return;let e=n.Qt(),t=e.getRequestSession();t&&t.status&&(this._incrementSessionStatusCount(t.status,new Date),e.setRequestSession(void 0))}_incrementSessionStatusCount(e,t){let n=new Date(t).setSeconds(0,0),r=this._pendingAggregates.get(n);switch(r||(r={started:new Date(n).toISOString()},this._pendingAggregates.set(n,r)),e){case`errored`:return r.errored=(r.errored||0)+1,r.errored;case`ok`:return r.exited=(r.exited||0)+1,r.exited;default:return r.crashed=(r.crashed||0)+1,r.crashed}}};function Fee(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function Iee(e){return`${Fee(e)}${e.projectId}/envelope/`}function Lee(e,t){let n={sentry_version:`7`};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Ree(e,t,n){return t||`${Iee(e)}?${Lee(e,n)}`}const zee=[];function Bee(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}function Vee(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n==`function`){let e=n(t);r=Array.isArray(e)?e:[e]}else r=t;let i=Bee(r),a=i.findIndex(e=>e.name===`Debug`);if(a>-1){let[e]=i.splice(a,1);i.push(e)}return i}function Hee(e,t){let n={};return t.forEach(t=>{t&&Wee(e,t,n)}),n}function Uee(e,t){for(let n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function Wee(e,t,r){if(r[t.name]){n.Yn&&n.Wn.log(`Integration skipped because it was already installed: ${t.name}`);return}if(r[t.name]=t,zee.indexOf(t.name)===-1&&typeof t.setupOnce==`function`&&(t.setupOnce(),zee.push(t.name)),t.setup&&typeof t.setup==`function`&&t.setup(e),typeof t.preprocessEvent==`function`){let n=t.preprocessEvent.bind(t);e.on(`preprocessEvent`,(t,r)=>n(t,r,e))}if(typeof t.processEvent==`function`){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}n.Yn&&n.Wn.log(`Integration installed: ${t.name}`)}function E(e){return e}function Gee(e,t,r){let i=[{type:`client_report`},{timestamp:r||n.bn(),discarded_events:e}];return fe(t?{dsn:t}:{},[i])}var D=class extends Error{constructor(e,t=`warn`){super(e),this.message=e,this.logLevel=t}};const Kee=`Not capturing exception because it's already been captured.`;var qee=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=gee(e.dsn):n.Yn&&n.Wn.warn(`No DSN provided, client will not send events.`),this._dsn){let t=Ree(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}let t=[`enableTracing`,`tracesSampleRate`,`tracesSampler`].find(t=>t in e&&e[t]==null);t&&n.Un(()=>{console.warn(`[Sentry] Deprecation warning: \`${t}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`)})}captureException(e,t,r){let i=n.yn();if(n.gn(e))return n.Yn&&n.Wn.log(Kee),i;let a={event_id:i,...t};return this._process(this.eventFromException(e,a).then(e=>this._captureEvent(e,a,r))),a.event_id}captureMessage(e,t,r,i){let a={event_id:n.yn(),...r},o=n.Nn(e)?e:String(e),s=n.Fn(e)?this.eventFromMessage(o,t,a):this.eventFromException(e,a);return this._process(s.then(e=>this._captureEvent(e,a,i))),a.event_id}captureEvent(e,t,r){let i=n.yn();if(t&&t.originalException&&n.gn(t.originalException))return n.Yn&&n.Wn.log(Kee),i;let a={event_id:i,...t},o=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,a,o||r)),a.event_id}captureSession(e){typeof e.release==`string`?(this.sendSession(e),n.un(e,{init:!1})):n.Yn&&n.Wn.warn(`Discarded session because of missing or non-string release`)}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let t=this._transport;return t?(this.emit(`flush`),this._isClientDoneProcessing(e).then(n=>t.flush(e).then(e=>n&&e))):n.pn(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,this.emit(`close`),e))}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 t=this._integrations[e.name];Wee(this,e,this._integrations),t||Uee(this,[e])}sendEvent(e,t={}){this.emit(`beforeSendEvent`,e,t);let n=Tee(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])n=_ee(n,bee(e));let r=this.sendEnvelope(n);r&&r.then(t=>this.emit(`afterSendEvent`,e,t),null)}sendSession(e){let t=wee(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(t)}recordDroppedEvent(e,t,r){if(this._options.sendClientReports){let i=typeof r==`number`?r:1,a=`${e}:${t}`;n.Yn&&n.Wn.log(`Recording outcome: "${a}"${i>1?` (${i} times)`:``}`),this._outcomes[a]=(this._outcomes[a]||0)+i}}on(e,t){let n=this._hooks[e]=this._hooks[e]||[];return n.push(t),()=>{let e=n.indexOf(t);e>-1&&n.splice(e,1)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}sendEnvelope(e){return this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,e=>(n.Yn&&n.Wn.error(`Error while sending envelope:`,e),e)):(n.Yn&&n.Wn.error(`Transport disabled`),n.pn({}))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=Hee(this,e),Uee(this,e)}_updateSessionFromEvent(e,t){let r=t.level===`fatal`,i=!1,a=t.exception&&t.exception.values;if(a){i=!0;for(let e of a){let t=e.mechanism;if(t&&t.handled===!1){r=!0;break}}}let o=e.status===`ok`;(o&&e.errors===0||o&&r)&&(n.un(e,{...r&&{status:`crashed`},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new n.dn(t=>{let n=0,r=setInterval(()=>{this._numProcessing==0?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,r=n.Zt(),i=n.Qt()){let a=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit(`preprocessEvent`,e,t),e.type||i.setLastEventId(e.event_id||t.event_id),n.ut(a,e,t,r,this,i).then(e=>e===null?e:(e.contexts={trace:n.$t(r),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:n.mt(this,r),...e.sdkProcessingMetadata},e))}_captureEvent(e,t={},r){return this._processEvent(e,t,r).then(e=>e.event_id,e=>{n.Yn&&(e instanceof D&&e.logLevel===`log`?n.Wn.log(e.message):n.Wn.warn(e))})}_processEvent(e,t,r){let i=this.getOptions(),{sampleRate:a}=i,o=Zee(e),s=Xee(e),c=e.type||`error`,l=`before send for type \`${c}\``,u=a===void 0?void 0:lee(a);if(s&&typeof u==`number`&&Math.random()>u)return this.recordDroppedEvent(`sample_rate`,`error`,e),n.fn(new D(`Discarding event because it's not included in the random sample (sampling rate = ${a})`,`log`));let d=c===`replay_event`?`replay`:c,f=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,r,f).then(n=>{if(n===null)throw this.recordDroppedEvent(`event_processor`,d,e),new D("An event processor returned `null`, will not send event.",`log`);return t.data&&t.data.__sentry__===!0?n:Jee(Yee(this,i,n,t),l)}).then(n=>{if(n===null){if(this.recordDroppedEvent(`before_send`,d,e),o){let t=1+(e.spans||[]).length;this.recordDroppedEvent(`before_send`,`span`,t)}throw new D(`${l} returned \`null\`, will not send event.`,`log`)}let i=r&&r.getSession();if(!o&&i&&this._updateSessionFromEvent(i,n),o){let e=(n.sdkProcessingMetadata&&n.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(n.spans?n.spans.length:0);e>0&&this.recordDroppedEvent(`before_send`,`span`,e)}let a=n.transaction_info;return o&&a&&n.transaction!==e.transaction&&(n.transaction_info={...a,source:`custom`}),this.sendEvent(n,t),n}).then(null,e=>{throw e instanceof D?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),new D(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e){this._numProcessing++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(`:`);return{reason:n,category:r,quantity:t}})}_flushOutcomes(){n.Yn&&n.Wn.log(`Flushing outcomes...`);let e=this._clearOutcomes();if(e.length===0){n.Yn&&n.Wn.log(`No outcomes to send`);return}if(!this._dsn){n.Yn&&n.Wn.log(`No dsn provided, will not send outcomes`);return}n.Yn&&n.Wn.log(`Sending outcomes:`,e);let t=Gee(e,this._options.tunnel&&de(this._dsn));this.sendEnvelope(t)}};function Jee(e,t){let r=`${t} must return \`null\` or a valid event.`;if(n.Ln(e))return e.then(e=>{if(!n.Pn(e)&&e!==null)throw new D(r);return e},e=>{throw new D(`${t} rejected with ${e}`)});if(!n.Pn(e)&&e!==null)throw new D(r);return e}function Yee(e,t,r,i){let{beforeSend:a,beforeSendTransaction:o,beforeSendSpan:s}=t;if(Xee(r)&&a)return a(r,i);if(Zee(r)){if(r.spans&&s){let t=[];for(let i of r.spans){let r=s(i);r?t.push(r):(n.St(),e.recordDroppedEvent(`before_send`,`span`))}r.spans=t}if(o){if(r.spans){let e=r.spans.length;r.sdkProcessingMetadata={...r.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return o(r,i)}}return r}function Xee(e){return e.type===void 0}function Zee(e){return e.type===`transaction`}function Qee(e,t,r,i,a){let o={sent_at:new Date().toISOString()};return r&&r.sdk&&(o.sdk={name:r.sdk.name,version:r.sdk.version}),i&&a&&(o.dsn=de(a)),t&&(o.trace=n.Cn(t)),fe(o,[$ee(e)])}function $ee(e){return[{type:`check_in`},e]}function ete(e,t){return e(t.stack||``,1)}function tte(e,t){let n={type:t.name||t.constructor.name,value:t.message},r=ete(e,t);return r.length&&(n.stacktrace={frames:r}),n}function nte(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(n instanceof Error)return n}}function rte(e){if(`name`in e&&typeof e.name==`string`){let t=`'${e.name}' captured as exception`;return`message`in e&&typeof e.message==`string`&&(t+=` with message '${e.message}'`),t}else if(`message`in e&&typeof e.message==`string`)return e.message;let t=n.wn(e);if(n.jn(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let r=ite(e);return`${r&&r!==`Object`?`'${r}'`:`Object`} captured as exception with keys: ${t}`}function ite(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function ate(e,t,r,i){if(n.An(r))return[r,void 0];if(t.synthetic=!0,n.Pn(r)){let t=e&&e.getOptions().normalizeDepth,a={__serialized__:n.ft(r,t)},o=nte(r);if(o)return[o,a];let s=rte(r),c=i&&i.syntheticException||Error(s);return c.message=s,[c,a]}let a=i&&i.syntheticException||Error(r);return a.message=`${r}`,[a,void 0]}function ote(e,t,r,i){let a=i&&i.data&&i.data.mechanism||{handled:!0,type:`generic`},[o,s]=ate(e,a,r,i),c={exception:{values:[tte(t,o)]}};return s&&(c.extra=s),n.hn(c,void 0,void 0),n.mn(c,a),{...c,event_id:i&&i.event_id}}function ste(e,t,r=`info`,i,a){let o={event_id:i&&i.event_id,level:r};if(a&&i&&i.syntheticException){let r=ete(e,i.syntheticException);r.length&&(o.exception={values:[{value:t,stacktrace:{frames:r}}]},n.mn(o,{synthetic:!0}))}if(n.Nn(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return o.logentry={message:e,params:n},o}return o.message=t,o}var cte=class extends qee{constructor(e){aee(),super(e)}eventFromException(e,t){let r=ote(this,this._options.stackParser,e,t);return r.level=`error`,n.pn(r)}eventFromMessage(e,t=`info`,r){return n.pn(ste(this._options.stackParser,e,t,r,this._options.attachStacktrace))}captureException(e,t,r){if(this._options.autoSessionTracking&&this._sessionFlusher){let e=n.Qt().getRequestSession();e&&e.status===`ok`&&(e.status=`errored`)}return super.captureException(e,t,r)}captureEvent(e,t,r){if(this._options.autoSessionTracking&&this._sessionFlusher&&(e.type||`exception`)===`exception`&&e.exception&&e.exception.values&&e.exception.values.length>0){let e=n.Qt().getRequestSession();e&&e.status===`ok`&&(e.status=`errored`)}return super.captureEvent(e,t,r)}close(e){return this._sessionFlusher&&this._sessionFlusher.close(),super.close(e)}initSessionFlusher(){let{release:e,environment:t}=this._options;e?this._sessionFlusher=new Pee(this,{release:e,environment:t}):n.Yn&&n.Wn.warn(`Cannot initialize an instance of SessionFlusher if no release is provided!`)}captureCheckIn(e,t,r){let i=`checkInId`in e&&e.checkInId?e.checkInId:n.yn();if(!this._isEnabled())return n.Yn&&n.Wn.warn(`SDK not enabled, will not capture checkin.`),i;let{release:a,environment:o,tunnel:s}=this.getOptions(),c={check_in_id:i,monitor_slug:e.monitorSlug,status:e.status,release:a,environment:o};`duration`in e&&(c.duration=e.duration),t&&(c.monitor_config={schedule:t.schedule,checkin_margin:t.checkinMargin,max_runtime:t.maxRuntime,timezone:t.timezone,failure_issue_threshold:t.failureIssueThreshold,recovery_threshold:t.recoveryThreshold});let[l,u]=this._getTraceInfoFromScope(r);u&&(c.contexts={trace:u});let d=Qee(c,l,this.getSdkMetadata(),s,this.getDsn());return n.Yn&&n.Wn.info(`Sending checkin:`,e.monitorSlug,e.status),this.sendEnvelope(d),i}_captureRequestSession(){this._sessionFlusher?this._sessionFlusher.incrementSessionStatusCount():n.Yn&&n.Wn.warn(`Discarded request mode session because autoSessionTracking option was disabled`)}_prepareEvent(e,t,n,r){return this._options.platform&&(e.platform=e.platform||this._options.platform),this._options.runtime&&(e.contexts={...e.contexts,runtime:(e.contexts||{}).runtime||this._options.runtime}),this._options.serverName&&(e.server_name=e.server_name||this._options.serverName),super._prepareEvent(e,t,n,r)}_getTraceInfoFromScope(e){if(!e)return[void 0,void 0];let t=n.on(e),r=t?n.Et(t):n.$t(e);return[t?n.ht(t):n.mt(this,e),r]}};function lte(e){let t=[];function r(){return e===void 0||t.length<e}function i(e){return t.splice(t.indexOf(e),1)[0]||Promise.resolve(void 0)}function a(e){if(!r())return n.fn(new D(`Not adding Promise because buffer limit was reached.`));let a=e();return t.indexOf(a)===-1&&t.push(a),a.then(()=>i(a)).then(null,()=>i(a).then(null,()=>{})),a}function o(e){return new n.dn((r,i)=>{let a=t.length;if(!a)return r(!0);let o=setTimeout(()=>{e&&e>0&&r(!1)},e);t.forEach(e=>{n.pn(e).then(()=>{--a||(clearTimeout(o),r(!0))},i)})})}return{$:t,add:a,drain:o}}function ute(e,t=Date.now()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}function dte(e,t){return e[t]||e.all||0}function fte(e,t,n=Date.now()){return dte(e,t)>n}function pte(e,{statusCode:t,headers:n},r=Date.now()){let i={...e},a=n&&n[`x-sentry-rate-limits`],o=n&&n[`retry-after`];if(a)for(let e of a.trim().split(`,`)){let[t,n,,,a]=e.split(`:`,5),o=parseInt(t,10),s=(isNaN(o)?60:o)*1e3;if(!n)i.all=r+s;else for(let e of n.split(`;`))e===`metric_bucket`?(!a||a.split(`;`).includes(`custom`))&&(i[e]=r+s):i[e]=r+s}else o?i.all=r+ute(o,r):t===429&&(i.all=r+60*1e3);return i}function mte(e,t,r=lte(e.bufferSize||64)){let i={},a=e=>r.drain(e);function o(a){let o=[];if(pe(a,(t,n)=>{let r=ge(n);if(fte(i,r)){let i=hte(t,n);e.recordDroppedEvent(`ratelimit_backoff`,r,i)}else o.push(t)}),o.length===0)return n.pn({});let s=fe(a[0],o),c=t=>{pe(s,(n,r)=>{let i=hte(n,r);e.recordDroppedEvent(t,ge(r),i)})};return r.add(()=>t({body:he(s)}).then(e=>(e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&n.Yn&&n.Wn.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),i=pte(i,e),e),e=>{throw c(`network_error`),e})).then(e=>e,e=>{if(e instanceof D)return n.Yn&&n.Wn.error(`Skipped sending event because buffer is full.`),c(`queue_overflow`),n.pn({});throw e})}return{send:o,flush:a}}function hte(e,t){if(!(t!==`event`&&t!==`transaction`))return Array.isArray(e)?e[1]:void 0}function gte(e,t,r=[t],i=`npm`){let a=e._metadata||{};a.sdk||={name:`sentry.javascript.${t}`,packages:r.map(e=>({name:`${i}:@sentry/${e}`,version:n.Jn})),version:n.Jn},e._metadata=a}function _te(e={}){let t=n.Xt();if(!n.ot()||!t)return{};let r=n.nn(n.Rn());if(r.getTraceData)return r.getTraceData(e);let i=n.Zt(),a=e.span||n.vt(),o=a?n.Dt(a):vte(i),s=n.Pt(a?n.ht(a):n.mt(t,i));return n.kt.test(o)?{"sentry-trace":o,baggage:s}:(n.Wn.warn(`Invalid sentry-trace data. Cannot generate trace data`),{})}function vte(e){let{traceId:t,sampled:r,spanId:i}=e.getPropagationContext();return n.At(t,i,r)}function je(e,t){let r=n.Xt(),i=n.Qt();if(!r)return;let{beforeBreadcrumb:a=null,maxBreadcrumbs:o=100}=r.getOptions();if(o<=0)return;let s={timestamp:n.bn(),...e},c=a?n.Un(()=>a(s,t)):s;c!==null&&(r.emit&&r.emit(`beforeAddBreadcrumb`,c,t),i.addBreadcrumb(c,o))}let yte;const bte=new WeakMap,xte=E((()=>({name:`FunctionToString`,setupOnce(){yte=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=n.En(this),r=bte.has(n.Xt())&&t!==void 0?t:this;return yte.apply(r,e)}}catch{}},setup(e){bte.set(e,!0)}}))),Ste=[/^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.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+$/,/^Java exception was raised during method invocation$/],Cte=E(((e={})=>({name:`InboundFilters`,processEvent(t,n,r){return Tte(t,wte(e,r.getOptions()))?null:t}})));function wte(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Ste],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]],ignoreInternal:e.ignoreInternal===void 0?!0:e.ignoreInternal}}function Tte(e,t){return t.ignoreInternal&&jte(e)?(n.Yn&&n.Wn.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${n._n(e)}`),!0):Ete(e,t.ignoreErrors)?(n.Yn&&n.Wn.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${n._n(e)}`),!0):Nte(e)?(n.Yn&&n.Wn.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${n._n(e)}`),!0):Dte(e,t.ignoreTransactions)?(n.Yn&&n.Wn.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${n._n(e)}`),!0):Ote(e,t.denyUrls)?(n.Yn&&n.Wn.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${n._n(e)}.\nUrl: ${Me(e)}`),!0):kte(e,t.allowUrls)?!1:(n.Yn&&n.Wn.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${n._n(e)}.\nUrl: ${Me(e)}`),!0)}function Ete(e,t){return e.type||!t||!t.length?!1:Ate(e).some(e=>n.On(e,t))}function Dte(e,t){if(e.type!==`transaction`||!t||!t.length)return!1;let r=e.transaction;return r?n.On(r,t):!1}function Ote(e,t){if(!t||!t.length)return!1;let r=Me(e);return r?n.On(r,t):!1}function kte(e,t){if(!t||!t.length)return!0;let r=Me(e);return r?n.On(r,t):!0}function Ate(e){let t=[];e.message&&t.push(e.message);let n;try{n=e.exception.values[e.exception.values.length-1]}catch{}return n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`)),t}function jte(e){try{return e.exception.values[0].type===`SentryError`}catch{}return!1}function Mte(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function Me(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?Mte(t):null}catch{return n.Yn&&n.Wn.error(`Cannot extract url for event ${n._n(e)}`),null}}function Nte(e){return e.type||!e.exception||!e.exception.values||e.exception.values.length===0?!1:!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value)}function Pte(e,t,r=250,i,a,o,s){if(!o.exception||!o.exception.values||!s||!n.Mn(s.originalException,Error))return;let c=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;c&&(o.exception.values=Lte(Ne(e,t,a,s.originalException,i,o.exception.values,c,0),r))}function Ne(e,t,r,i,a,o,s,c){if(o.length>=r+1)return o;let l=[...o];if(n.Mn(i[a],Error)){Fte(s,c);let n=e(t,i[a]),o=l.length;Ite(n,a,o,c),l=Ne(e,t,r,i[a],a,[n,...l],n,o)}return Array.isArray(i.errors)&&i.errors.forEach((i,o)=>{if(n.Mn(i,Error)){Fte(s,c);let n=e(t,i),u=l.length;Ite(n,`errors[${o}]`,u,c),l=Ne(e,t,r,i,a,[n,...l],n,u)}}),l}function Fte(e,t){e.mechanism=e.mechanism||{type:`generic`,handled:!0},e.mechanism={...e.mechanism,...e.type===`AggregateError`&&{is_exception_group:!0},exception_id:t}}function Ite(e,t,n,r){e.mechanism=e.mechanism||{type:`generic`,handled:!0},e.mechanism={...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function Lte(e,t){return e.map(e=>(e.value&&=n.kn(e.value,t),e))}const Rte=E(((e={})=>{let t=e.limit||5,n=e.key||`cause`;return{name:`LinkedErrors`,preprocessEvent(e,r,i){let a=i.getOptions();Pte(tte,a.stackParser,a.maxValueLength,n,t,e,r)}}}));function zte(e){let t={},n=0;for(;n<e.length;){let r=e.indexOf(`=`,n);if(r===-1)break;let i=e.indexOf(`;`,n);if(i===-1)i=e.length;else if(i<r){n=e.lastIndexOf(`;`,r-1)+1;continue}let a=e.slice(n,r).trim();if(t[a]===void 0){let n=e.slice(r+1,i).trim();n.charCodeAt(0)===34&&(n=n.slice(1,-1));try{t[a]=n.indexOf(`%`)===-1?n:decodeURIComponent(n)}catch{t[a]=n}}n=i+1}return t}function Pe(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||``,r=t[8]||``;return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Fe(e){return e.split(/[?#]/,1)[0]}function Ie(e){let{protocol:t,host:n,path:r}=e,i=n&&n.replace(/^.*@/,`[filtered]:[filtered]@`).replace(/(:80)$/,``).replace(/(:443)$/,``)||``;return`${t?`${t}://`:``}${i}${r}`}const Le=[`X-Client-IP`,`X-Forwarded-For`,`Fly-Client-IP`,`CF-Connecting-IP`,`Fastly-Client-Ip`,`True-Client-Ip`,`X-Real-IP`,`X-Cluster-Client-IP`,`X-Forwarded`,`Forwarded-For`,`Forwarded`,`X-Vercel-Forwarded-For`];function Bte(e){return Le.map(t=>{let n=e[t],r=Array.isArray(n)?n.join(`;`):n;return t===`Forwarded`?Vte(r):r&&r.split(`,`).map(e=>e.trim())}).reduce((e,t)=>t?e.concat(t):e,[]).find(e=>e!==null&&Hte(e))||null}function Vte(e){if(!e)return null;for(let t of e.split(`;`))if(t.startsWith(`for=`))return t.slice(4);return null}function Hte(e){return/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/.test(e)}const Ute={ip:!1,request:!0,user:!0},Re=[`cookies`,`data`,`headers`,`method`,`query_string`,`url`],Wte=[`id`,`username`,`email`];function Gte(e,t){let n={};return(Array.isArray(t)?t:Wte).forEach(t=>{e&&t in e&&(n[t]=e[t])}),n}function Kte(e,t={}){let{include:r=Re}=t,i={},a=e.headers||{},o=e.method,s=a.host||e.hostname||e.host||`<no host>`,c=e.protocol===`https`||e.socket&&e.socket.encrypted?`https`:`http`,l=e.originalUrl||e.url||``,u=l.startsWith(c)?l:`${c}://${s}${l}`;return r.forEach(t=>{switch(t){case`headers`:i.headers=a,r.includes(`cookies`)||delete i.headers.cookie,r.includes(`ip`)||Le.forEach(e=>{delete i.headers[e]});break;case`method`:i.method=o;break;case`url`:i.url=u;break;case`cookies`:i.cookies=e.cookies||a.cookie&&zte(a.cookie)||{};break;case`query_string`:i.query_string=Yte(e);break;case`data`:{if(o===`GET`||o===`HEAD`)break;let t=e.body;if(t!==void 0){let e=n.In(t)?t:n.Pn(t)?JSON.stringify(n.dt(t)):n.kn(`${t}`,1024);e&&(i.data=e)}break}default:({}).hasOwnProperty.call(e,t)&&(i[t]=e[t])}}),i}function qte(e,t,r,i){let a={...Ute,...i&&i.include};if(a.request){let n=Array.isArray(a.request)?[...a.request]:[...Re];a.ip&&n.push(`ip`);let r=$te(t,{include:n});e.request={...e.request,...r}}if(a.user){let t=r.user&&n.Pn(r.user)?Gte(r.user,a.user):{};Object.keys(t).length&&(e.user={...t,...e.user})}if(a.ip){let n=t.headers&&Bte(t.headers)||r.ipAddress;n&&(e.user={...e.user,ip_address:n})}}function Jte(e,t,r){let i={...Ute,...r&&r.include};if(i.request){let n=Array.isArray(i.request)?[...i.request]:[...Re];i.ip&&n.push(`ip`);let r=Kte(t,{include:n});e.request={...e.request,...r}}if(i.user){let r=t.user&&n.Pn(t.user)?Gte(t.user,i.user):{};Object.keys(r).length&&(e.user={...e.user,...r})}if(i.ip){let n=t.headers&&Bte(t.headers)||t.ip||t.socket&&t.socket.remoteAddress;n&&(e.user={...e.user,ip_address:n})}return e}function Yte(e){let t=e.originalUrl||e.url||``;if(t){t.startsWith(`/`)&&(t=`http://dogs.are.great${t}`);try{let n=e.query||new URL(t).search.slice(1);return n.length?n:void 0}catch{return}}}function Xte(e){let t=Object.create(null);try{Object.entries(e).forEach(([e,n])=>{typeof n==`string`&&(t[e]=n)})}catch{n.Kn&&n.Wn.warn(`Sentry failed extracting headers from a request object. If you see this, please file an issue.`)}return t}function Zte(e){let t=e.headers||{},r=t.host||`<no host>`,i=e.socket&&e.socket.encrypted?`https`:`http`,a=e.url||``,o=a.startsWith(i)?a:`${i}://${r}${a}`,s=e.body||void 0,c=e.cookies;return n.Cn({url:o,method:e.method,query_string:Qte(a),headers:Xte(t),cookies:c,data:s})}function Qte(e){if(e)try{let t=new URL(e,`http://dogs.are.great`).search.slice(1);return t.length?t:void 0}catch{return}}function $te(e,{include:t}){let n=t?Array.isArray(t)?t:Re:[],r={},i={...e.headers};return n.includes(`headers`)&&(r.headers=i,t.includes(`cookies`)||delete i.cookie,t.includes(`ip`)||Le.forEach(e=>{delete i[e]})),n.includes(`method`)&&(r.method=e.method),n.includes(`url`)&&(r.url=e.url),n.includes(`cookies`)&&(r.cookies=e.cookies||(i&&i.cookie?zte(i.cookie):void 0)||{}),n.includes(`query_string`)&&(r.query_string=e.query_string),n.includes(`data`)&&(r.data=e.data),r}const ze={include:{cookies:!0,data:!0,headers:!0,ip:!1,query_string:!0,url:!0,user:{id:!0,username:!0,email:!0}},transactionNamingScheme:`methodPath`},ene=E(((e={})=>{let t={...ze,...e,include:{...ze.include,...e.include,user:e.include&&typeof e.include.user==`boolean`?e.include.user:{...ze.include.user,...(e.include||{}).user}}};return{name:`RequestData`,processEvent(e){let{sdkProcessingMetadata:n={}}=e,{request:r,normalizedRequest:i}=n,a=tne(t);return i?(qte(e,i,{ipAddress:r?r.ip||r.socket&&r.socket.remoteAddress:void 0,user:r?r.user:void 0},a),e):r?Jte(e,r,a):e}}}));function tne(e){let{transactionNamingScheme:t,include:{ip:n,user:r,...i}}=e,a=[`method`];for(let[e,t]of Object.entries(i))t&&a.push(e);let o;if(r===void 0)o=!0;else if(typeof r==`boolean`)o=r;else{let e=[];for(let[t,n]of Object.entries(r))n&&e.push(t);o=e}return{include:{ip:n,user:o,request:a.length===0?void 0:a,transaction:t}}}function nne(e){let t=`console`;T(t,e),ee(t,rne)}function rne(){`console`in n.qn&&n.Hn.forEach(function(e){e in n.qn.console&&n.Tn(n.qn.console,e,function(t){return n.Gn[e]=t,function(...t){te(`console`,{args:t,level:e});let r=n.Gn[e];r&&r.apply(n.qn.console,t)}})})}function ine(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}const ane=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function one(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=ane.exec(t);return n?n.slice(1):[]}function sne(e){let t=one(e),n=t[0]||``,r=t[1];return!n&&!r?`.`:(r&&=r.slice(0,r.length-1),n+r)}function Be(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}function cne(e,t=!1){return!(t||e&&!e.startsWith(`/`)&&!e.match(/^[A-Z]:/)&&!e.startsWith(`.`)&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes(`node_modules/`)}function lne(e){let t=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return r=>{let i=r.match(n);if(i){let t,n,r,a,o;if(i[1]){r=i[1];let e=r.lastIndexOf(`.`);if(r[e-1]===`.`&&e--,e>0){t=r.slice(0,e),n=r.slice(e+1);let i=t.indexOf(`.Module`);i>0&&(r=r.slice(i+1),t=t.slice(0,i))}a=void 0}n&&(a=t,o=n),n===`<anonymous>`&&(o=void 0,r=void 0),r===void 0&&(o||=`?`,r=a?`${a}.${o}`:o);let s=i[2]&&i[2].startsWith(`file://`)?i[2].slice(7):i[2],c=i[5]===`native`;return s&&s.match(/\/[A-Z]:/)&&(s=s.slice(1)),!s&&i[5]&&!c&&(s=i[5]),{filename:s?decodeURI(s):void 0,module:e?e(s):void 0,function:r,lineno:Ve(i[3]),colno:Ve(i[4]),in_app:cne(s||``,c)}}if(r.match(t))return{filename:r}}}function une(e){return[90,lne(e)]}function Ve(e){return parseInt(e||``,10)||void 0}var He=class{constructor(e){this._maxSize=e,this._cache=new Map}get size(){return this._cache.size}get(e){let t=this._cache.get(e);if(t!==void 0)return this._cache.delete(e),this._cache.set(e,t),t}set(e,t){this._cache.size>=this._maxSize&&this._cache.delete(this._cache.keys().next().value),this._cache.set(e,t)}remove(e){let t=this._cache.get(e);return t&&this._cache.delete(e),t}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let e=[];return this._cache.forEach(t=>e.push(t)),e}};function O(e,t){return e??t()}function k(e){let t,n=e[0],r=1;for(;r<e.length;){let i=e[r],a=e[r+1];if(r+=2,(i===`optionalAccess`||i===`optionalCall`)&&n==null)return;i===`access`||i===`optionalAccess`?(t=n,n=a(n)):(i===`call`||i===`optionalCall`)&&(n=a((...e)=>n.call(t,...e)),t=void 0)}return n}var Ue,We=e.n((()=>{Ue=`1.9.1`}));function dne(e){let t=new Set([e]),n=new Set,r=e.match(Ge);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(Ge);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}var Ge,Ke,fne=e.n((()=>{We(),Ge=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,Ke=dne(Ue)}));function qe(e,t,n,r=!1){let i=Qe[Ze]=Qe[Ze]??{version:Ue};if(!r&&i[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(i.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${Ue}`);return n.error(t.stack||t.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${Ue}.`),!0}function Je(e){let t=Qe[Ze]?.version;if(!(!t||!Ke(t)))return Qe[Ze]?.[e]}function Ye(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Ue}.`);let n=Qe[Ze];n&&delete n[e]}var Xe,Ze,Qe,$e=e.n((()=>{We(),fne(),Xe=Ue.split(`.`)[0],Ze=Symbol.for(`opentelemetry.js.api.${Xe}`),Qe=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{}}));function et(e,t,n){let r=Je(`diag`);if(r)return r[e](t,...n)}var tt,pne=e.n((()=>{$e(),tt=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return et(`debug`,this._namespace,e)}error(...e){return et(`error`,this._namespace,e)}info(...e){return et(`info`,this._namespace,e)}warn(...e){return et(`warn`,this._namespace,e)}verbose(...e){return et(`verbose`,this._namespace,e)}}})),A,nt=e.n((()=>{(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})(A||={})}));function mne(e,t){e<A.NONE?e=A.NONE:e>A.ALL&&(e=A.ALL),t||={};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,A.ERROR),warn:n(`warn`,A.WARN),info:n(`info`,A.INFO),debug:n(`debug`,A.DEBUG),verbose:n(`verbose`,A.VERBOSE)}}var hne=e.n((()=>{nt()})),rt,j,it=e.n((()=>{pne(),hne(),nt(),$e(),rt=`diag`,j=class e{static instance(){return this._instance||=new e,this._instance}constructor(){function e(e){return function(...t){let n=Je(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:A.INFO})=>{if(e===t){let e=Error(`Cannot use di