UNPKG

chromatic

Version:

Automate visual testing across browsers. Gather UI feedback. Versioned documentation.

5 lines (4 loc) • 725 kB
!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]="c57fc738-38ad-576d-b922-93bf8ef3693f")}catch(e){}}(); const e=require(`./chunk-gGpyby2o.cjs`),t=require(`./node-src-sDIzIkBG.cjs`),n=require(`./turbosnap-B8yyYIGt.cjs`),r=require(`./src-D7cFgg32.cjs`),i=require(`./meow-CSiqYQZC.cjs`),a=require(`./strip-ansi-C98qOCYJ.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.nr&&n.er.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.nr&&n.er.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${n.Xn(i)}\nError:`,t)}}let ne=null;function eee(e){let t=`error`;T(t,e),ee(t,tee)}function tee(){ne=n.rr.onerror,n.rr.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.rr.onerror.__SENTRY_INSTRUMENTED__=!0}let re=null;function nee(e){let t=`unhandledrejection`;T(t,e),ee(t,ree)}function ree(){re=n.rr.onunhandledrejection,n.rr.onunhandledrejection=function(e){return te(`unhandledrejection`,e),re?re.apply(this,arguments):!0},n.rr.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}let iee=!1;function aee(){iee||(iee=!0,eee(ie),nee(ie))}function ie(){let e=n.Ot(),t=e&&n.kt(e);if(t){let e=`internal_error`;n.ar&&n.er.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.Mn(e,oe,r),n.Mn(e,ae,t))}function ce(e){return{scope:e[ae],isolationScope:e[oe]}}var le=class{constructor(e={}){this._traceId=e.traceId||n.yn(),this._spanId=e.spanId||n.vn()}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.qn(e)?e.then(e=>(r(),e),e=>{throw t(e),r(),e}):(r(),e)}function see(e){if(!n.ar)return;let{description:t=`< unknown name >`,op:r=`< unknown op >`,parent_span_id:i}=n.Ft(e),{spanId:a}=e.spanContext(),o=n.Nt(e),s=n.kt(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.Ft(s);u.push(`root ID: ${s.spanContext().spanId}`),e&&u.push(`root op: ${e}`),t&&u.push(`root description: ${t}`)}n.er.log(`${l} ${u.join(` `)}`)}function cee(e){if(!n.ar)return;let{description:t=`< unknown name >`,op:r=`< unknown op >`}=n.Ft(e),{spanId:i}=e.spanContext(),a=`[Tracing] Finishing "${r}" ${n.kt(e)===e?`root `:``}span "${t}" with ID ${i}`;n.er.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.ar&&n.er.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.Et(e))return[!1];let r=n.cn().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.ar&&n.er.warn(`[Tracing] Discarding transaction because of invalid sample rate.`),[!1]):o?Math.random()<o?[!0,o]:(n.ar&&n.er.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(a)})`),[!1,o]):(n.ar&&n.er.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.$n(()=>{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.nr)return!0;let{port:t,projectId:r,protocol:i}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>e[t]?!1:(n.er.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:r.match(/^\d+$/)?fee(i)?t&&isNaN(parseInt(t,10))?(n.er.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(n.er.error(`Invalid Sentry Dsn: Invalid protocol ${i}`),!1):(n.er.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.rr.__SENTRY__&&n.rr.__SENTRY__.encodePolyfill?n.rr.__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.xt(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.Nn({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.Nn({...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.Tt(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.Ft(e));return t||n.Mt(),t}:e=>n.Ft(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.$t],a=r[n.en];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.yn(),this._spanId=e.spanId||n.vn(),this._startTime=e.startTimestamp||n.jn(),this._attributes={},this.setAttributes({[n.nn]:`manual`,[n.tn]: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.Pt(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(n.in,`custom`),this}end(e){this._endTime||(this._endTime=n.Pt(e),cee(this),this._onSpanEnded())}getSpanJSON(){return n.Nn({data:this._attributes,description:this._name,op:this._attributes[n.tn],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:n.jt(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[n.nn],_metrics_summary:n.an(this),profile_id:this._attributes[n.Zt],exclusive_time:this._attributes[n.Xt],measurements:ve(this._events),is_segment:this._isStandaloneSpan&&n.kt(this)===this||void 0,segment_id:this._isStandaloneSpan?n.kt(this).spanContext().spanId:void 0})}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,r){n.ar&&n.er.log(`[Tracing] Adding an event to span:`,e);let i=xe(t)?t:r||n.jn(),a=xe(t)?{}:t||{},o={name:e,time:n.Pt(i),attributes:a};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=n.on();if(e&&e.emit(`spanEnd`,this),!(this._isStandaloneSpan||this===n.kt(this)))return;if(this._isStandaloneSpan){this._sampled?Oee(Eee([this],e)):(n.ar&&n.er.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.sn()).captureEvent(t)}_convertSpanToTransaction(){if(!Se(n.Ft(this)))return;this._name||=(n.ar&&n.er.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),`<unlabeled transaction>`);let{scope:e,isolationScope:t}=ce(this),r=(e||n.sn()).getClient()||n.on();if(this._sampled!==!0){n.ar&&n.er.log(`[Tracing] Discarding transaction because its trace was not chosen to be sampled.`),r&&r.recordDroppedEvent(`sample_rate`,`transaction`);return}let i=n.At(this).filter(e=>e!==this&&!Dee(e)).map(e=>n.Ft(e)).filter(Se),a=this._attributes[n.in];delete this._attributes[n.Qt],i.forEach(e=>{e.data&&delete e.data[`sentry.custom_span_name`]});let o={contexts:{trace:n.Rt(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.Nn({dynamicSamplingContext:n.Tt(this)})},_metrics_summary:n.an(this),...a&&{transaction_info:{source:a}}},s=ve(this._events);return s&&Object.keys(s).length&&(n.ar&&n.er.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.on();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=Oe();if(r.startSpan)return r.startSpan(e,t);let i=De(e),{forceTransaction:a,parentSpan:o}=e;return n.dn(e.scope,()=>Pee(o)(()=>{let r=n.sn(),o=ke(r),s=e.onlyIfParent&&!o?new le:Ee({parentSpan:o,spanArguments:i,forceTransaction:a,scope:r});return n._n(r,s),ue(()=>t(s),()=>{let{status:e}=n.Ft(s);s.isRecording()&&(!e||e===`ok`)&&s.setStatus({code:2,message:`internal_error`})},()=>s.end())}))}function kee(e,t){let r=Oe();if(r.startSpanManual)return r.startSpanManual(e,t);let i=De(e),{forceTransaction:a,parentSpan:o}=e;return n.dn(e.scope,()=>Pee(o)(()=>{let r=n.sn(),o=ke(r),s=e.onlyIfParent&&!o?new le:Ee({parentSpan:o,spanArguments:i,forceTransaction:a,scope:r});n._n(r,s);function c(){s.end()}return ue(()=>t(s,c),()=>{let{status:e}=n.Ft(s);s.isRecording()&&(!e||e===`ok`)&&s.setStatus({code:2,message:`internal_error`})})}))}function Aee(e){let t=Oe();if(t.startInactiveSpan)return t.startInactiveSpan(e);let r=De(e),{forceTransaction:i,parentSpan:a}=e;return(e.scope?t=>n.dn(e.scope,t):a===void 0?e=>e():e=>Te(a,e))(()=>{let t=n.sn(),a=ke(t);return e.onlyIfParent&&!a?new le:Ee({parentSpan:a,spanArguments:r,forceTransaction:i,scope:t})})}function Te(e,t){let r=Oe();return r.withActiveSpan?r.withActiveSpan(e,t):n.dn(r=>(n._n(r,e||void 0),t(r)))}function jee(e){let t=Oe();return t.suppressTracing?t.suppressTracing(e):n.dn(t=>(t.setSDKProcessingMetadata({[Ce]:!0}),e()))}function Ee({parentSpan:e,spanArguments:t,forceTransaction:r,scope:i}){if(!n.Et())return new le;let a=n.cn(),o;if(e&&!r)o=Nee(e,i,t),n.Dt(e,o);else if(e){let r=n.Tt(e),{traceId:a,spanId:s}=e.spanContext(),c=n.Nt(e);o=Mee({traceId:a,parentSpanId:s,...t},i,c),n.Ct(o,r)}else{let{traceId:e,dsc:r,parentSpanId:s,sampled:c}={...a.getPropagationContext(),...i.getPropagationContext()};o=Mee({traceId:e,parentSpanId:s,...t},i,c),r&&n.Ct(o,r)}return see(o),se(o,i,a),o}function De(e){let t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let r={...t};return r.startTimestamp=n.Pt(e.startTime),delete r.startTime,r}return t}function Oe(){return n.fn(n.Jn())}function Mee(e,t,r){let i=n.on(),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.in]:`custom`,...e.attributes},sampled:c});return l!==void 0&&u.setAttribute(n.rn,l),i&&i.emit(`spanStart`,u),u}function Nee(e,t,r){let{spanId:i,traceId:a}=e.spanContext(),o=t.getScopeData().sdkProcessingMetadata[Ce]?!1:n.Nt(e),s=o?new be({...r,parentSpanId:i,traceId:a,sampled:o}):new le({traceId:a});n.Dt(e,s);let c=n.on();return c&&(c.emit(`spanStart`,s),r.endTimestamp&&c.emit(`spanEnd`,s)),s}function ke(e){let t=n.gn(e);if(!t)return;let r=n.on();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?n.kt(t):t}function Pee(e){return e===void 0?e=>e():t=>Te(e,t)}var Fee=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.Nn({attrs:this._sessionAttrs,aggregates:e})}close(){clearInterval(this._intervalId),this._isEnabled=!1,this.flush()}incrementSessionStatusCount(){if(!this._isEnabled)return;let e=n.cn(),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 Iee(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function Lee(e){return`${Iee(e)}${e.projectId}/envelope/`}function Ree(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 zee(e,t,n){return t||`${Lee(e)}?${Ree(e,n)}`}const Bee=[];function Vee(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 Hee(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=Vee(r),a=i.findIndex(e=>e.name===`Debug`);if(a>-1){let[e]=i.splice(a,1);i.push(e)}return i}function Uee(e,t){let n={};return t.forEach(t=>{t&&Gee(e,t,n)}),n}function Wee(e,t){for(let n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function Gee(e,t,r){if(r[t.name]){n.ar&&n.er.log(`Integration skipped because it was already installed: ${t.name}`);return}if(r[t.name]=t,Bee.indexOf(t.name)===-1&&typeof t.setupOnce==`function`&&(t.setupOnce(),Bee.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.ar&&n.er.log(`Integration installed: ${t.name}`)}function E(e){return e}function Kee(e,t,r){let i=[{type:`client_report`},{timestamp:r||n.An(),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 qee=`Not capturing exception because it's already been captured.`;var Jee=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.ar&&n.er.warn(`No DSN provided, client will not send events.`),this._dsn){let t=zee(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.$n(()=>{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.kn();if(n.En(e))return n.ar&&n.er.log(qee),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.kn(),...r},o=n.Un(e)?e:String(e),s=n.Gn(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.kn();if(t&&t.originalException&&n.En(t.originalException))return n.ar&&n.er.log(qee),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.bn(e,{init:!1})):n.ar&&n.er.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.Cn(!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];Gee(this,e,this._integrations),t||Wee(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.ar&&n.er.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.ar&&n.er.error(`Error while sending envelope:`,e),e)):(n.ar&&n.er.error(`Transport disabled`),n.Cn({}))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=Uee(this,e),Wee(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.bn(e,{...r&&{status:`crashed`},errors:e.errors||Number(i||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new n.xn(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.sn(),i=n.cn()){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.bt(a,e,t,r,this,i).then(e=>e===null?e:(e.contexts={trace:n.ln(r),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:n.wt(this,r),...e.sdkProcessingMetadata},e))}_captureEvent(e,t={},r){return this._processEvent(e,t,r).then(e=>e.event_id,e=>{n.ar&&(e instanceof D&&e.logLevel===`log`?n.er.log(e.message):n.er.warn(e))})}_processEvent(e,t,r){let i=this.getOptions(),{sampleRate:a}=i,o=Qee(e),s=Zee(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.Sn(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:Yee(Xee(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.ar&&n.er.log(`Flushing outcomes...`);let e=this._clearOutcomes();if(e.length===0){n.ar&&n.er.log(`No outcomes to send`);return}if(!this._dsn){n.ar&&n.er.log(`No dsn provided, will not send outcomes`);return}n.ar&&n.er.log(`Sending outcomes:`,e);let t=Kee(e,this._options.tunnel&&de(this._dsn));this.sendEnvelope(t)}};function Yee(e,t){let r=`${t} must return \`null\` or a valid event.`;if(n.qn(e))return e.then(e=>{if(!n.Wn(e)&&e!==null)throw new D(r);return e},e=>{throw new D(`${t} rejected with ${e}`)});if(!n.Wn(e)&&e!==null)throw new D(r);return e}function Xee(e,t,r,i){let{beforeSend:a,beforeSendTransaction:o,beforeSendSpan:s}=t;if(Zee(r)&&a)return a(r,i);if(Qee(r)){if(r.spans&&s){let t=[];for(let i of r.spans){let r=s(i);r?t.push(r):(n.Mt(),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 Zee(e){return e.type===void 0}function Qee(e){return e.type===`transaction`}function $ee(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.Nn(t)),fe(o,[ete(e)])}function ete(e){return[{type:`check_in`},e]}function tte(e,t){return e(t.stack||``,1)}function nte(e,t){let n={type:t.name||t.constructor.name,value:t.message},r=tte(e,t);return r.length&&(n.stacktrace={frames:r}),n}function rte(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(n instanceof Error)return n}}function ite(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.Pn(e);if(n.Vn(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let r=ate(e);return`${r&&r!==`Object`?`'${r}'`:`Object`} captured as exception with keys: ${t}`}function ate(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function ote(e,t,r,i){if(n.Bn(r))return[r,void 0];if(t.synthetic=!0,n.Wn(r)){let t=e&&e.getOptions().normalizeDepth,a={__serialized__:n.St(r,t)},o=rte(r);if(o)return[o,a];let s=ite(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 ste(e,t,r,i){let a=i&&i.data&&i.data.mechanism||{handled:!0,type:`generic`},[o,s]=ote(e,a,r,i),c={exception:{values:[nte(t,o)]}};return s&&(c.extra=s),n.Tn(c,void 0,void 0),n.wn(c,a),{...c,event_id:i&&i.event_id}}function cte(e,t,r=`info`,i,a){let o={event_id:i&&i.event_id,level:r};if(a&&i&&i.syntheticException){let r=tte(e,i.syntheticException);r.length&&(o.exception={values:[{value:t,stacktrace:{frames:r}}]},n.wn(o,{synthetic:!0}))}if(n.Un(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 lte=class extends Jee{constructor(e){aee(),super(e)}eventFromException(e,t){let r=ste(this,this._options.stackParser,e,t);return r.level=`error`,n.Cn(r)}eventFromMessage(e,t=`info`,r){return n.Cn(cte(this._options.stackParser,e,t,r,this._options.attachStacktrace))}captureException(e,t,r){if(this._options.autoSessionTracking&&this._sessionFlusher){let e=n.cn().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.cn().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 Fee(this,{release:e,environment:t}):n.ar&&n.er.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.kn();if(!this._isEnabled())return n.ar&&n.er.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=$ee(c,l,this.getSdkMetadata(),s,this.getDsn());return n.ar&&n.er.info(`Sending checkin:`,e.monitorSlug,e.status),this.sendEnvelope(d),i}_captureRequestSession(){this._sessionFlusher?this._sessionFlusher.incrementSessionStatusCount():n.ar&&n.er.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.gn(e),r=t?n.It(t):n.ln(e);return[t?n.Tt(t):n.wt(this,e),r]}};function ute(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.Sn(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.xn((r,i)=>{let a=t.length;if(!a)return r(!0);let o=setTimeout(()=>{e&&e>0&&r(!1)},e);t.forEach(e=>{n.Cn(e).then(()=>{--a||(clearTimeout(o),r(!0))},i)})})}return{$:t,add:a,drain:o}}function dte(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 fte(e,t){return e[t]||e.all||0}function pte(e,t,n=Date.now()){return fte(e,t)>n}function mte(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+dte(o,r):t===429&&(i.all=r+60*1e3);return i}function hte(e,t,r=ute(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(pte(i,r)){let i=gte(t,n);e.recordDroppedEvent(`ratelimit_backoff`,r,i)}else o.push(t)}),o.length===0)return n.Cn({});let s=fe(a[0],o),c=t=>{pe(s,(n,r)=>{let i=gte(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.ar&&n.er.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),i=mte(i,e),e),e=>{throw c(`network_error`),e})).then(e=>e,e=>{if(e instanceof D)return n.ar&&n.er.error(`Skipped sending event because buffer is full.`),c(`queue_overflow`),n.Cn({});throw e})}return{send:o,flush:a}}function gte(e,t){if(!(t!==`event`&&t!==`transaction`))return Array.isArray(e)?e[1]:void 0}function _te(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.ir})),version:n.ir},e._metadata=a}function vte(e={}){let t=n.on();if(!n.gt()||!t)return{};let r=n.fn(n.Jn());if(r.getTraceData)return r.getTraceData(e);let i=n.sn(),a=e.span||n.Ot(),o=a?n.Lt(a):yte(i),s=n.Wt(a?n.Tt(a):n.wt(t,i));return n.zt.test(o)?{"sentry-trace":o,baggage:s}:(n.er.warn(`Invalid sentry-trace data. Cannot generate trace data`),{})}function yte(e){let{traceId:t,sampled:r,spanId:i}=e.getPropagationContext();return n.Bt(t,i,r)}let bte;const xte=new WeakMap,Ste=E((()=>({name:`FunctionToString`,setupOnce(){bte=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=n.In(this),r=xte.has(n.on())&&t!==void 0?t:this;return bte.apply(r,e)}}catch{}},setup(e){xte.set(e,!0)}}))),Cte=[/^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$/],wte=E(((e={})=>({name:`InboundFilters`,processEvent(t,n,r){return Ete(t,Tte(e,r.getOptions()))?null:t}})));function Tte(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Cte],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]],ignoreInternal:e.ignoreInternal===void 0?!0:e.ignoreInternal}}function Ete(e,t){return t.ignoreInternal&&Mte(e)?(n.ar&&n.er.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${n.Dn(e)}`),!0):Dte(e,t.ignoreErrors)?(n.ar&&n.er.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${n.Dn(e)}`),!0):Pte(e)?(n.ar&&n.er.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${n.Dn(e)}`),!0):Ote(e,t.ignoreTransactions)?(n.ar&&n.er.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${n.Dn(e)}`),!0):kte(e,t.denyUrls)?(n.ar&&n.er.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${n.Dn(e)}.\nUrl: ${Ae(e)}`),!0):Ate(e,t.allowUrls)?!1:(n.ar&&n.er.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${n.Dn(e)}.\nUrl: ${Ae(e)}`),!0)}function Dte(e,t){return e.type||!t||!t.length?!1:jte(e).some(e=>n.Rn(e,t))}function Ote(e,t){if(e.type!==`transaction`||!t||!t.length)return!1;let r=e.transaction;return r?n.Rn(r,t):!1}function kte(e,t){if(!t||!t.length)return!1;let r=Ae(e);return r?n.Rn(r,t):!1}function Ate(e,t){if(!t||!t.length)return!0;let r=Ae(e);return r?n.Rn(r,t):!0}function jte(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 Mte(e){try{return e.exception.values[0].type===`SentryError`}catch{}return!1}function Nte(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 Ae(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?Nte(t):null}catch{return n.ar&&n.er.error(`Cannot extract url for event ${n.Dn(e)}`),null}}function Pte(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 Fte(e,t,r=250,i,a,o,s){if(!o.exception||!o.exception.values||!s||!n.Hn(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=Rte(je(e,t,a,s.originalException,i,o.exception.values,c,0),r))}function je(e,t,r,i,a,o,s,c){if(o.length>=r+1)return o;let l=[...o];if(n.Hn(i[a],Error)){Ite(s,c);let n=e(t,i[a]),o=l.length;Lte(n,a,o,c),l=je(e,t,r,i[a],a,[n,...l],n,o)}return Array.isArray(i.errors)&&i.errors.forEach((i,o)=>{if(n.Hn(i,Error)){Ite(s,c);let n=e(t,i),u=l.length;Lte(n,`errors[${o}]`,u,c),l=je(e,t,r,i,a,[n,...l],n,u)}}),l}function Ite(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 Lte(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 Rte(e,t){return e.map(e=>(e.value&&=n.zn(e.value,t),e))}const zte=E(((e={})=>{let t=e.limit||5,n=e.key||`cause`;return{name:`LinkedErrors`,preprocessEvent(e,r,i){let a=i.getOptions();Fte(nte,a.stackParser,a.maxValueLength,n,t,e,r)}}}));function Bte(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 Me(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 Ne(e){return e.split(/[?#]/,1)[0]}function Pe(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 Fe=[`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 Vte(e){return Fe.map(t=>{let n=e[t],r=Array.isArray(n)?n.join(`;`):n;return t===`Forwarded`?Hte(r):r&&r.split(`,`).map(e=>e.trim())}).reduce((e,t)=>t?e.concat(t):e,[]).find(e=>e!==null&&Ute(e))||null}function Hte(e){if(!e)return null;for(let t of e.split(`;`))if(t.startsWith(`for=`))return t.slice(4);return null}function Ute(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 Wte={ip:!1,request:!0,user:!0},Ie=[`cookies`,`data`,`headers`,`method`,`query_string`,`url`],Gte=[`id`,`username`,`email`];function Kte(e,t){let n={};return(Array.isArray(t)?t:Gte).forEach(t=>{e&&t in e&&(n[t]=e[t])}),n}function qte(e,t={}){let{include:r=Ie}=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`)||Fe.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&&Bte(a.cookie)||{};break;case`query_string`:i.query_string=Xte(e);break;case`data`:{if(o===`GET`||o===`HEAD`)break;let t=e.body;if(t!==void 0){let e=n.Kn(t)?t:n.Wn(t)?JSON.stringify(n.xt(t)):n.zn(`${t}`,1024);e&&(i.data=e)}break}default:({}).hasOwnProperty.call(e,t)&&(i[t]=e[t])}}),i}function Jte(e,t,r,i){let a={...Wte,...i&&i.include};if(a.request){let n=Array.isArray(a.request)?[...a.request]:[...Ie];a.ip&&n.push(`ip`);let r=ene(t,{include:n});e.request={...e.request,...r}}if(a.user){let t=r.user&&n.Wn(r.user)?Kte(r.user,a.user):{};Object.keys(t).length&&(e.user={...t,...e.user})}if(a.ip){let n=t.headers&&Vte(t.headers)||r.ipAddress;n&&(e.user={...e.user,ip_address:n})}}function Yte(e,t,r){let i={...Wte,...r&&r.include};if(i.request){let n=Array.isArray(i.request)?[...i.request]:[...Ie];i.ip&&n.push(`ip`);let r=qte(t,{include:n});e.request={...e.request,...r}}if(i.user){let r=t.user&&n.Wn(t.user)?Kte(t.user,i.user):{};Object.keys(r).length&&(e.user={...e.user,...r})}if(i.ip){let n=t.headers&&Vte(t.headers)||t.ip||t.socket&&t.socket.remoteAddress;n&&(e.user={...e.user,ip_address:n})}return e}function Xte(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 Zte(e){let t=Object.create(null);try{Object.entries(e).forEach(([e,n])=>{typeof n==`string`&&(t[e]=n)})}catch{n.nr&&n.er.warn(`Sentry failed extracting headers from a request object. If you see this, please file an issue.`)}return t}function Qte(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.Nn({url:o,method:e.method,query_string:$te(a),headers:Zte(t),cookies:c,data:s})}function $te(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 ene(e,{include:t}){let n=t?Array.isArray(t)?t:Ie:[],r={},i={...e.headers};return n.includes(`headers`)&&(r.headers=i,t.includes(`cookies`)||delete i.cookie,t.includes(`ip`)||Fe.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?Bte(i.cookie):void 0)||{}),n.includes(`query_string`)&&(r.query_string=e.query_string),n.includes(`data`)&&(r.data=e.data),r}const Le={include:{cookies:!0,data:!0,headers:!0,ip:!1,query_string:!0,url:!0,user:{id:!0,username:!0,email:!0}},transactionNamingScheme:`methodPath`},tne=E(((e={})=>{let t={...Le,...e,include:{...Le.include,...e.include,user:e.include&&typeof e.include.user==`boolean`?e.include.user:{...Le.include.user,...(e.include||{}).user}}};return{name:`RequestData`,processEvent(e){let{sdkProcessingMetadata:n={}}=e,{request:r,normalizedRequest:i}=n,a=nne(t);return i?(Jte(e,i,{ipAddress:r?r.ip||r.socket&&r.socket.remoteAddress:void 0,user:r?r.user:void 0},a),e):r?Yte(e,r,a):e}}}));function nne(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 rne(e){let t=`console`;T(t,e),ee(t,ine)}function ine(){`console`in n.rr&&n.Qn.forEach(function(e){e in n.rr.console&&n.Fn(n.rr.console,e,function(t){return n.tr[e]=t,function(...t){te(`console`,{args:t,level:e});let r=n.tr[e];r&&r.apply(n.rr.console,t)}})})}function ane(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}const one=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function sne(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=one.exec(t);return n?n.slice(1):[]}function cne(e){let t=sne(e),n=t[0]||``,r=t[1];return!n&&!r?`.`:(r&&=r.slice(0,r.length-1),n+r)}function Re(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}function lne(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 une(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:ze(i[3]),colno:ze(i[4]),in_app:lne(s||``,c)}}if(r.match(t))return{filename:r}}}function dne(e){return[90,une(e)]}function ze(e){return parseInt(e||``,10)||void 0}var Be=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 Ve,He=e.n((()=>{Ve=`1.9.1`}));function fne(e){let t=new Set([e]),n=new Set,r=e.match(Ue);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(Ue);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 Ue,We,pne=e.n((()=>{He(),Ue=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,We=fne(Ve)}));function Ge(e,t,n,r=!1){let i=Xe[Ye]=Xe[Ye]??{version:Ve};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${Ve}`);return n.error(t.stack||t.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${Ve}.`),!0}function Ke(e){let t=Xe[Ye]?.version;if(!(!t||!We(t)))return Xe[Ye]?.[e]}function qe(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Ve}.`);let n=Xe[Ye];n&&delete n[e]}var Je,Ye,Xe,Ze=e.n((()=>{He(),pne(),Je=Ve.split(`.`)[0],Ye=Symbol.for(`opentelemetry.js.api.${Je}`),Xe=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{}}));function Qe(e,t,n){let r=Ke(`diag`);if(r)return r[e](t,...n)}var $e,mne=e.n((()=>{Ze(),$e=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return Qe(`debug`,this._namespace,e)}error(...e){return Qe(`error`,this._namespace,e)}info(...e){return Qe(`info`,this._namespace,e)}warn(...e){return Qe(`warn`,this._namespace,e)}verbose(...e){return Qe(`verbose`,this._namespace,e)}}})),A,et=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 hne(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 gne=e.n((()=>{et()})),tt,j,nt=e.n((()=>{mne(),gne(),et(),Ze(),tt=`diag`,j=class e{static instance(){return this._instance||=new e,this._instance}constructor(){function e(e){return function(...t){let n=Ke(`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 diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error(e.stack??e.message),!1}typeof n==`number`&&(n={logLevel:n});let r=Ke(`diag`),i=hne(n.logLevel??A.INFO,e);if(r&&!n.suppressOv