@safaricom-mxl/web-sdk 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";window.MXLWebSdk=window.MXLWebSdk||(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},l=(e,r,i)=>(i=e==null?{}:t(a(e)),c(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e));let u=`1.9.1`,d=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function f(e){let t=new Set([e]),n=new Set,r=e.match(d);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(d);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)}}let p=f(u),m=u.split(`.`)[0],h=Symbol.for(`opentelemetry.js.api.${m}`),g=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function _(e,t,n,r=!1){var i;let a=g[h]=(i=g[h])==null?{version:u}:i;if(!r&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(a.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${u}`);return n.error(t.stack||t.message),!1}return a[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${u}.`),!0}function v(e){var t,n;let r=(t=g[h])==null?void 0:t.version;if(!(!r||!p(r)))return(n=g[h])==null?void 0:n[e]}function y(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${u}.`);let n=g[h];n&&delete n[e]}var b=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return x(`debug`,this._namespace,e)}error(...e){return x(`error`,this._namespace,e)}info(...e){return x(`info`,this._namespace,e)}warn(...e){return x(`warn`,this._namespace,e)}verbose(...e){return x(`verbose`,this._namespace,e)}};function x(e,t,n){let r=v(`diag`);if(r)return r[e](t,...n)}var S;(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`})(S||(S={}));function C(e,t){e<S.NONE?e=S.NONE:e>S.ALL&&(e=S.ALL),t=t||{};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,S.ERROR),warn:n(`warn`,S.WARN),info:n(`info`,S.INFO),debug:n(`debug`,S.DEBUG),verbose:n(`verbose`,S.VERBOSE)}}var w=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function e(e){return function(...t){let n=v(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:S.INFO})=>{var r,i,a;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((r=e.stack)==null?e.message:r),!1}typeof n==`number`&&(n={logLevel:n});let o=v(`diag`),s=C((i=n.logLevel)==null?S.INFO:i,e);if(o&&!n.suppressOverrideMessage){let e=(a=Error().stack)==null?`<failed to generate stacktrace>`:a;o.warn(`Current logger will be overwritten from ${e}`),s.warn(`Current logger will overwrite one already registered from ${e}`)}return _(`diag`,s,t,!0)},t.disable=()=>{y(`diag`,t)},t.createComponentLogger=e=>new b(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}},ee=class e{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let e of t)n._entries.delete(e);return n}clear(){return new e}};let T=Symbol(`BaggageEntryMetadata`),te=w.instance();function E(e={}){return new ee(new Map(Object.entries(e)))}function ne(e){return typeof e!=`string`&&(te.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:T,toString(){return e}}}function D(e){return Symbol.for(e)}let O=new class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},k=[{n:`error`,c:`error`},{n:`warn`,c:`warn`},{n:`info`,c:`info`},{n:`debug`,c:`debug`},{n:`verbose`,c:`trace`}],A={};if(typeof console<`u`)for(let e of[`error`,`warn`,`info`,`debug`,`trace`,`log`])typeof console[e]==`function`&&(A[e]=console[e]);var re=class{constructor(){function e(e){return function(...t){let n=A[e];if(typeof n!=`function`&&(n=A.log),typeof n!=`function`&&console&&(n=console[e],typeof n!=`function`&&(n=console.log)),typeof n==`function`)return n.apply(console,t)}}for(let t=0;t<k.length;t++)this[k[t].n]=e(k[t].c)}},ie=class{constructor(){}createGauge(e,t){return fe}createHistogram(e,t){return pe}createCounter(e,t){return de}createUpDownCounter(e,t){return me}createObservableGauge(e,t){return ge}createObservableCounter(e,t){return he}createObservableUpDownCounter(e,t){return _e}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},ae=class{},j=class extends ae{add(e,t){}},oe=class extends ae{add(e,t){}},M=class extends ae{record(e,t){}},N=class extends ae{record(e,t){}},P=class{addCallback(e){}removeCallback(e){}},se=class extends P{},ce=class extends P{},le=class extends P{};let ue=new ie,de=new j,fe=new M,pe=new N,me=new oe,he=new se,ge=new ce,_e=new le;function ve(){return ue}let ye={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},be={set(e,t,n){e!=null&&(e[t]=n)}};var xe=class{active(){return O}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}};let Se=`context`,Ce=new xe;var we=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(e){return _(Se,e,w.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return v(Se)||Ce}disable(){this._getContextManager().disable(),y(Se,w.instance())}},Te;(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(Te||(Te={}));let Ee={traceId:`00000000000000000000000000000000`,spanId:`0000000000000000`,traceFlags:Te.NONE};var De=class{constructor(e=Ee){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}};let Oe=D(`OpenTelemetry Context Key SPAN`);function ke(e){return e.getValue(Oe)||void 0}function Ae(){return ke(we.getInstance().active())}function je(e,t){return e.setValue(Oe,t)}function Me(e){return e.deleteValue(Oe)}function Ne(e,t){return je(e,new De(t))}function Pe(e){var t;return(t=ke(e))==null?void 0:t.spanContext()}let Fe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function Ie(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(Fe[e.charCodeAt(t)]|0)+(Fe[e.charCodeAt(t+1)]|0)+(Fe[e.charCodeAt(t+2)]|0)+(Fe[e.charCodeAt(t+3)]|0);return n===t}function Le(e){return Ie(e,32)&&e!==`00000000000000000000000000000000`}function Re(e){return Ie(e,16)&&e!==`0000000000000000`}function ze(e){return Le(e.traceId)&&Re(e.spanId)}function Be(e){return new De(e)}let Ve=we.getInstance();var He=class{startSpan(e,t,n=Ve.active()){if(t!=null&&t.root)return new De;let r=n&&Pe(n);return Ue(r)&&ze(r)?new De(r):new De}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a==null?Ve.active():a,c=this.startSpan(e,i,s),l=je(s,c);return Ve.with(l,o,void 0,c)}};function Ue(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}let We=new He;var Ge=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):We}};let Ke=new class{getTracer(e,t,n){return new He}};var qe=class{getTracer(e,t,n){var r;return(r=this.getDelegateTracer(e,t,n))==null?new Ge(this,e,t,n):r}getDelegate(){var e;return(e=this._delegate)==null?Ke:e}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getTracer(e,t,n)}},Je;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(Je||(Je={}));var Ye;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(Ye||(Ye={}));var Xe;(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(Xe||(Xe={}));let F=we.getInstance(),I=w.instance(),Ze=new class{getMeter(e,t,n){return ue}},Qe=`metrics`,$e=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(e){return _(Qe,e,w.instance())}getMeterProvider(){return v(Qe)||Ze}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){y(Qe,w.instance())}}.getInstance();var et=class{inject(e,t){}extract(e,t){return e}fields(){return[]}};let tt=D(`OpenTelemetry Baggage Key`);function nt(e){return e.getValue(tt)||void 0}function rt(){return nt(we.getInstance().active())}function it(e,t){return e.setValue(tt,t)}function at(e){return e.deleteValue(tt)}let ot=`propagation`,st=new et,ct=class e{constructor(){this.createBaggage=E,this.getBaggage=nt,this.getActiveBaggage=rt,this.setBaggage=it,this.deleteBaggage=at}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(e){return _(ot,e,w.instance())}inject(e,t,n=be){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=ye){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){y(ot,w.instance())}_getGlobalPropagator(){return v(ot)||st}}.getInstance(),lt=`trace`,L=class e{constructor(){this._proxyTracerProvider=new qe,this.wrapSpanContext=Be,this.isSpanContextValid=ze,this.deleteSpan=Me,this.getSpan=ke,this.getActiveSpan=Ae,this.getSpanContext=Pe,this.setSpan=je,this.setSpanContext=Ne}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(e){let t=_(lt,this._proxyTracerProvider,w.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return v(lt)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){y(lt,w.instance()),this._proxyTracerProvider=new qe}}.getInstance(),ut=({target:e,events:t,callback:n})=>{t.forEach(t=>{e.addEventListener(t,n)})},dt=({target:e,events:t,callback:n})=>{t.forEach(t=>{e.removeEventListener(t,n)})};function ft(e,t,n,r=new Set){return new Proxy(e,{get(e,i,a){let o=Reflect.get(e,i,a);return typeof o!=`function`||r.has(i)?o:(...r)=>{try{return o.apply(e,r)}catch(e){let a=e instanceof Error?e.message:`Unknown error`;n.error(`${String(i)}: ${a}`);let o=t[i];return typeof o==`function`?o.apply(t,r):void 0}}}})}let pt=new Uint8Array(16),mt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`).toUpperCase()),ht=()=>{crypto.getRandomValues(pt);let e=``;for(let t=0;t<16;t++)e+=mt[pt[t]];return e},gt=()=>`mxlv2-${Date.now()}-${Math.floor(Math.random()*8999999999999)+0xe8d4a51000}`,_t=(e,t,n)=>{try{let r=e.getItem(t),i=r?parseInt(r,10):0;return Number.isNaN(i)&&(n.warn(`Non-numeric value stored at ${t} (${String(r)}); resetting counter.`),i=0),i++,e.setItem(t,i.toString()),i}catch(e){return n.warn(`Failed to retrieve ${t} from storage: `,e),1}},vt=`mxl.type`,yt=`mxl.state`,bt=`mxl.properties.`,xt=`mxl.instrumentation`,St=`mxl.js_file_bundle_ids`,Ct=`browser.url.full`,wt=`app.surface.name`,Tt=`app.surface.id`,Et=`app.surface.label`,Dt=e=>e.visibilityState===`hidden`?`background`:`foreground`,Ot=globalThis,kt=(e,t)=>!t||t<=0||t>100?!1:t>=At(e),At=e=>{if(e.length<6)return 0;let t=e.slice(-6),n=Math.pow(16,6)-1;return parseInt(t,16)/n*100},jt=D(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function Mt(e){return e.setValue(jt,!0)}function Nt(e){return e.getValue(jt)===!0}let Pt=`baggage`;function Ft(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function It(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function Lt(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,s;try{o=decodeURIComponent(i),s=decodeURIComponent(a)}catch(e){return}let c;return t!==-1&&t<e.length-1&&(c=ne(e.substring(t+1))),{key:o,value:s,metadata:c}}var Rt=class{inject(e,t,n){let r=ct.getBaggage(e);if(!r||Nt(e))return;let i=Ft(It(r).filter(e=>e.length<=4096).slice(0,180));i.length>0&&n.set(t,Pt,i)}extract(e,t,n){let r=n.get(t,Pt),i=Array.isArray(r)?r.join(`,`):r;if(!i)return e;let a={};return i.length===0||(i.split(`,`).forEach(e=>{let t=Lt(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),a[t.key]=e}}),Object.entries(a).length===0)?e:ct.setBaggage(e,ct.createBaggage(a))}fields(){return[Pt]}};function zt(e){"@babel/helpers - typeof";return zt=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},zt(e)}function Bt(e,t){if(zt(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(zt(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Vt(e){var t=Bt(e,`string`);return zt(t)==`symbol`?t:t+``}function R(e,t,n){return(t=Vt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ht(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Ut(n)){I.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Wt(r)){I.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Ut(e){return typeof e==`string`&&e!==``}function Wt(e){return e==null?!0:Array.isArray(e)?Gt(e):Kt(typeof e)}function Gt(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Kt(e)){t=e;continue}return!1}return!1}}return!0}function Kt(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function qt(){return e=>{I.error(Jt(e))}}function Jt(e){return typeof e==`string`?e:JSON.stringify(Yt(e))}function Yt(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}let Xt=qt();function Zt(e){try{Xt(e)}catch(e){}}let Qt=`http.url`,$t=`error.type`,en=`exception.message`,tn=`exception.stacktrace`,nn=`exception.type`,rn=`http.request.method`,an=`http.request.method_original`,on=`http.response.status_code`,sn=`server.address`,cn=`server.port`,ln=`service.name`,un=`telemetry.sdk.language`,dn=`telemetry.sdk.name`,fn=`telemetry.sdk.version`,pn=`url.full`,mn=`user_agent.original`,hn={[dn]:`opentelemetry`,"process.runtime.name":`browser`,[un]:`webjs`,[fn]:`2.7.1`},gn=performance,_n=Math.pow(10,6),vn=Math.pow(10,9);function yn(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*_n)]}function bn(e){return Dn(yn(gn.timeOrigin),yn(typeof e==`number`?e:gn.now()))}function xn(e){if(Tn(e))return e;if(typeof e==`number`)return e<gn.timeOrigin?bn(e):yn(e);if(e instanceof Date)return yn(e.getTime());throw TypeError(`Invalid input type`)}function Sn(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=vn),[n,r]}function Cn(e){return e[0]*vn+e[1]}function wn(e){return e[0]*1e3+e[1]/1e6}function Tn(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function En(e){return Tn(e)||typeof e==`number`||e instanceof Date}function Dn(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=vn&&(n[1]-=vn,n[0]+=1),n}var On;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(On||(On={}));var kn=class{constructor(e={}){var t;R(this,`_propagators`,void 0),R(this,`_fields`,void 0),this._propagators=(t=e.propagators)==null?[]:t;let n=new Set;for(let e of this._propagators){let t=typeof e.fields==`function`?e.fields():[];for(let e of t)n.add(e)}this._fields=Array.from(n)}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){I.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){I.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}};let An=`[_0-9a-z-*/]`,jn=`[a-z]${An}{0,255}`,Mn=`[a-z0-9]${An}{0,240}@[a-z]${An}{0,13}`,Nn=RegExp(`^(?:${jn}|${Mn})$`),Pn=/^[ -~]{0,255}[!-~]$/,Fn=/,|=/;function In(e){return Nn.test(e)}function Ln(e){return Pn.test(e)&&!Fn.test(e)}var Rn=class e{constructor(e){R(this,`_length`,void 0),R(this,`_rawTraceState`,void 0),R(this,`_internalState`,void 0),this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!In(e)||!Ln(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>512)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=`,`+e),e=`${n[0]}=${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(`,`),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(`=`);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!In(a)||!Ln(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>512)&&(t.set(a,o),n=s,t.size>=32))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}};let zn=`traceparent`,Bn=`tracestate`,Vn=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function Hn(e){let t=Vn.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Un=class{inject(e,t,n){let r=L.getSpanContext(e);if(!r||Nt(e)||!ze(r))return;let i=`00-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||Te.NONE).toString(16)}`;n.set(t,zn,i),r.traceState&&n.set(t,Bn,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,zn);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=Hn(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,Bn);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new Rn(typeof e==`string`?e:void 0)}return L.setSpanContext(e,a)}fields(){return[zn,Bn]}};let Wn=Function.prototype.toString,Gn=Wn.call(Object),Kn=Object.getPrototypeOf,qn=Object.prototype,Jn=qn.hasOwnProperty,Yn=Symbol?Symbol.toStringTag:void 0,Xn=qn.toString;function Zn(e){if(!Qn(e)||$n(e)!==`[object Object]`)return!1;let t=Kn(e);if(t===null)return!0;let n=Jn.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Wn.call(n)===Gn}function Qn(e){return typeof e==`object`&&!!e}function $n(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Yn&&Yn in Object(e)?er(e):tr(e)}function er(e){let t=Jn.call(e,Yn),n=e[Yn],r=!1;try{e[Yn]=void 0,r=!0}catch(e){}let i=Xn.call(e);return r&&(t?e[Yn]=n:delete e[Yn]),i}function tr(e){return Xn.call(e)}function nr(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=ir(t,e.shift(),0,n);return t}function rr(e){return or(e)?e.slice():e}function ir(e,t,n=0,r){let i;if(!(n>20)){if(n++,lr(e)||lr(t)||sr(t))i=rr(t);else if(or(e)){if(i=e.slice(),or(t))for(let e=0,n=t.length;e<n;e++)i.push(rr(t[e]));else if(cr(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=rr(t[r]))}}}else if(cr(e))if(cr(t)){if(!ur(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(lr(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(ar(e,s,r)||ar(t,s,r))delete i[s];else{if(cr(a)&&cr(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=ir(i[s],c,n,r)}}}}else i=t;return i}}function ar(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function or(e){return Array.isArray(e)}function sr(e){return typeof e==`function`}function cr(e){return!lr(e)&&!or(e)&&!sr(e)&&typeof e==`object`}function lr(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function ur(e,t){return!(!Zn(e)||!Zn(t))}var dr=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};function fr(e,t){let n,r=new Promise(function(e,r){n=setTimeout(function(){r(new dr(`Operation timed out.`))},t)});return Promise.race([e,r]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})}function pr(e,t){return typeof t==`string`?e===t:!!e.match(t)}function mr(e,t){if(!t)return!1;for(let n of t)if(pr(e,n))return!0;return!1}var hr=class{constructor(){R(this,`_promise`,void 0),R(this,`_resolve`,void 0),R(this,`_reject`,void 0),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}},gr=class{constructor(e,t){R(this,`_isCalled`,!1),R(this,`_deferred`,new hr),R(this,`_callback`,void 0),R(this,`_that`,void 0),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}};function _r(e,t){return new Promise(n=>{F.with(Mt(F.active()),()=>{e.export(t,n)})})}let vr={_export:_r},yr;function br(){if(yr===void 0)try{let e=globalThis.process.argv0;yr=e?`unknown_service:${e}`:`unknown_service`}catch(e){yr=`unknown_service`}return yr}let xr=e=>typeof e==`object`&&!!e&&typeof e.then==`function`;function Sr(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function z(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){Sr(a,r,i,o,s,`next`,e)}function s(e){Sr(a,r,i,o,s,`throw`,e)}o(void 0)})}}var Cr=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=Dr(t),r._asyncAttributesPending=t.filter(([e,t])=>xr(t)).length>0,r}constructor(e,t){var n;R(this,`_rawAttributes`,void 0),R(this,`_asyncAttributesPending`,!1),R(this,`_schemaUrl`,void 0),R(this,`_memoizedAttributes`,void 0);let r=(n=e.attributes)==null?{}:n;this._rawAttributes=Object.entries(r).map(([e,t])=>(xr(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Dr(this._rawAttributes),this._schemaUrl=Or(t==null?void 0:t.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}waitForAsyncAttributes(){var e=this;return z(function*(){if(e.asyncAttributesPending){for(let t=0;t<e._rawAttributes.length;t++){let[n,r]=e._rawAttributes[t];e._rawAttributes[t]=[n,xr(r)?yield r:r]}e._asyncAttributesPending=!1}})()}get attributes(){if(this.asyncAttributesPending&&I.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(xr(n)){I.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]!=null||(e[t]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=kr(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function wr(e,t){return Cr.FromAttributeList(Object.entries(e),t)}function Tr(){return wr({})}function Er(){return wr({[ln]:br(),[un]:hn[un],[dn]:hn[dn],[fn]:hn[fn]})}function Dr(e){return e.map(([e,t])=>xr(t)?[e,t.catch(t=>{I.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Or(e){if(typeof e==`string`||e===void 0)return e;I.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function kr(e,t){let n=e==null?void 0:e.schemaUrl,r=t==null?void 0:t.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;I.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var Ar=class{constructor(e){var t,n;R(this,`_spanContext`,void 0),R(this,`kind`,void 0),R(this,`parentSpanContext`,void 0),R(this,`attributes`,{}),R(this,`links`,[]),R(this,`events`,[]),R(this,`startTime`,void 0),R(this,`resource`,void 0),R(this,`instrumentationScope`,void 0),R(this,`_droppedAttributesCount`,0),R(this,`_droppedEventsCount`,0),R(this,`_droppedLinksCount`,0),R(this,`_attributesCount`,0),R(this,`name`,void 0),R(this,`status`,{code:Xe.UNSET}),R(this,`endTime`,[0,0]),R(this,`_ended`,!1),R(this,`_duration`,[-1,-1]),R(this,`_spanProcessor`,void 0),R(this,`_spanLimits`,void 0),R(this,`_attributeValueLengthLimit`,void 0),R(this,`_recordEndMetrics`,void 0),R(this,`_performanceStartTime`,void 0),R(this,`_performanceOffset`,void 0),R(this,`_startTimeProvided`,void 0);let r=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=gn.now(),this._performanceOffset=r-(this._performanceStartTime+gn.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=(t=this._spanLimits.attributeValueLengthLimit)==null?0:t,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime((n=e.startTime)==null?r:n),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return I.warn(`Invalid attribute key: ${e}`),this;if(!Wt(t))return I.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return I.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&I.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),En(t)&&(En(n)||(n=t),t=void 0);let i=Ht(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&I.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=Ht(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===Xe.UNSET||this.status.code===Xe.OK)return this;let t={code:e.code};return e.code===Xe.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&I.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){var t;if(this._isSpanEnded()){I.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=Sn(this.startTime,this.endTime),this._duration[0]<0&&(I.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&I.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&I.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),(t=this._recordEndMetrics)==null||t.call(this),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=gn.now())return bn(e+this._performanceOffset);if(typeof e==`number`)return yn(e);if(e instanceof Date)return yn(e.getTime());if(Tn(e))return e;if(this._startTimeProvided)return yn(Date.now());let t=gn.now()-this._performanceStartTime;return Dn(this.startTime,yn(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[en]=e:e&&(e.code?n[nn]=e.code.toString():e.name&&(n[nn]=e.name),e.message&&(n[en]=e.message),e.stack&&(n[tn]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(`exception`,n,t):I.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);I.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(I.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}},jr;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(jr||(jr={}));var Mr=class{shouldSample(){return{decision:jr.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},Nr=class{shouldSample(){return{decision:jr.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},Pr=class{constructor(e){var t,n,r,i;R(this,`_root`,void 0),R(this,`_remoteParentSampled`,void 0),R(this,`_remoteParentNotSampled`,void 0),R(this,`_localParentSampled`,void 0),R(this,`_localParentNotSampled`,void 0),this._root=e.root,this._root||(Zt(Error(`ParentBasedSampler must have a root sampler configured`)),this._root=new Nr),this._remoteParentSampled=(t=e.remoteParentSampled)==null?new Nr:t,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)==null?new Mr:n,this._localParentSampled=(r=e.localParentSampled)==null?new Nr:r,this._localParentNotSampled=(i=e.localParentNotSampled)==null?new Mr:i}shouldSample(e,t,n,r,i,a){let o=L.getSpanContext(e);return!o||!ze(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&Te.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&Te.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},Fr=class{constructor(e=0){R(this,`_ratio`,void 0),R(this,`_upperBound`,void 0),this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Le(t)&&this._accumulate(t)<this._upperBound?jr.RECORD_AND_SAMPLED:jr.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}},Ir;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(Ir||(Ir={}));function Lr(){var e,t,n,r,i,a,o,s;return{sampler:Rr(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(e=void 0)==null?1/0:e,attributeCountLimit:(t=void 0)==null?128:t},spanLimits:{attributeValueLengthLimit:(n=void 0)==null?1/0:n,attributeCountLimit:(r=void 0)==null?128:r,linkCountLimit:(i=void 0)==null?128:i,eventCountLimit:(a=void 0)==null?128:a,attributePerEventCountLimit:(o=void 0)==null?128:o,attributePerLinkCountLimit:(s=void 0)==null?128:s}}}function Rr(){var e;let t=(e=void 0)==null?Ir.ParentBasedAlwaysOn:e;switch(t){case Ir.AlwaysOn:return new Nr;case Ir.AlwaysOff:return new Mr;case Ir.ParentBasedAlwaysOn:return new Pr({root:new Nr});case Ir.ParentBasedAlwaysOff:return new Pr({root:new Mr});case Ir.TraceIdRatio:return new Fr(zr());case Ir.ParentBasedTraceIdRatio:return new Pr({root:new Fr(zr())});default:return I.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${Ir.ParentBasedAlwaysOn}".`),new Pr({root:new Nr})}}function zr(){return I.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1.`),1}function Br(e){let t={sampler:Rr()},n=Lr(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}function Vr(e){var t,n,r,i,a,o,s,c,l,u,d,f;let p=Object.assign({},e.spanLimits);return p.attributeCountLimit=(t=(n=(r=(i=(a=e.spanLimits)==null?void 0:a.attributeCountLimit)==null?(o=e.generalLimits)==null?void 0:o.attributeCountLimit:i)==null?void 0:r)==null?void 0:n)==null?128:t,p.attributeValueLengthLimit=(s=(c=(l=(u=(d=e.spanLimits)==null?void 0:d.attributeValueLengthLimit)==null?(f=e.generalLimits)==null?void 0:f.attributeValueLengthLimit:u)==null?void 0:l)==null?void 0:c)==null?1/0:s,Object.assign({},e,{spanLimits:p})}var Hr=class{constructor(e,t){var n,r,i,a;R(this,`_maxExportBatchSize`,void 0),R(this,`_maxQueueSize`,void 0),R(this,`_scheduledDelayMillis`,void 0),R(this,`_exportTimeoutMillis`,void 0),R(this,`_exporter`,void 0),R(this,`_isExporting`,!1),R(this,`_finishedSpans`,[]),R(this,`_timer`,void 0),R(this,`_shutdownOnce`,void 0),R(this,`_droppedSpansCount`,0),this._exporter=e,this._maxExportBatchSize=typeof(t==null?void 0:t.maxExportBatchSize)==`number`?t.maxExportBatchSize:(n=void 0)==null?512:n,this._maxQueueSize=typeof(t==null?void 0:t.maxQueueSize)==`number`?t.maxQueueSize:(r=void 0)==null?2048:r,this._scheduledDelayMillis=typeof(t==null?void 0:t.scheduledDelayMillis)==`number`?t.scheduledDelayMillis:(i=void 0)==null?5e3:i,this._exportTimeoutMillis=typeof(t==null?void 0:t.exportTimeoutMillis)==`number`?t.exportTimeoutMillis:(a=void 0)==null?3e4:a,this._shutdownOnce=new gr(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(I.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&Te.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&I.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(I.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);F.with(Mt(F.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,r=>{if(clearTimeout(n),r.code===On.SUCCESS)e();else{var i;t((i=r.error)==null?Error(`BatchSpanProcessor: span export failed`):i)}}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a!=null||(a=[]),a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{Zt(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,Zt(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},Ur=class extends Hr{constructor(e,t){super(e,t),R(this,`_visibilityChangeListener`,void 0),R(this,`_pageHideListener`,void 0),this.onInit(t)}onInit(e){(e==null?void 0:e.disableAutoFlushOnDocumentHide)!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{Zt(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{Zt(e)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}};let Wr=new Uint8Array(16),Gr=new Uint8Array(8),Kr=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function qr(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function Jr(e){let t=``;for(let n=0;n<e.length;n++)t+=Kr[e[n]];return t}var Yr=class{generateTraceId(){return qr(Wr),Jr(Wr)}generateSpanId(){return qr(Gr),Jr(Gr)}};let Xr=`otel.span.sampling_result`;var Zr=class{constructor(e){R(this,`startedSpans`,void 0),R(this,`liveSpans`,void 0),this.startedSpans=e.createCounter(`otel.sdk.span.started`,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(`otel.sdk.span.live`,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=$r(t);if(this.startedSpans.add(1,{"otel.span.parent.origin":Qr(e),[Xr]:n}),t===jr.NOT_RECORD)return()=>{};let r={[Xr]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function Qr(e){return e?e.isRemote?`remote`:`local`:`none`}function $r(e){switch(e){case jr.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case jr.RECORD:return`RECORD_ONLY`;case jr.NOT_RECORD:return`DROP`}}var ei=class{constructor(e,t,n,r){R(this,`_sampler`,void 0),R(this,`_generalLimits`,void 0),R(this,`_spanLimits`,void 0),R(this,`_idGenerator`,void 0),R(this,`instrumentationScope`,void 0),R(this,`_resource`,void 0),R(this,`_spanProcessor`,void 0),R(this,`_tracerMetrics`,void 0);let i=Br(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Yr,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e;let a=i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,`2.7.1`):ve();this._tracerMetrics=new Zr(a)}startSpan(e,t={},n=F.active()){var r,i,a;t.root&&(n=L.deleteSpan(n));let o=L.getSpan(n);if(Nt(n))return I.debug(`Instrumentation suppressed, returning Noop Span`),L.wrapSpanContext(Ee);let s=o==null?void 0:o.spanContext(),c=this._idGenerator.generateSpanId(),l,u,d;!s||!L.isSpanContextValid(s)?u=this._idGenerator.generateTraceId():(u=s.traceId,d=s.traceState,l=s);let f=(r=t.kind)==null?Ye.INTERNAL:r,p=((i=t.links)==null?[]:i).map(e=>({context:e.context,attributes:Ht(e.attributes)})),m=Ht(t.attributes),h=this._sampler.shouldSample(n,u,e,f,m,p),g=this._tracerMetrics.startSpan(s,h.decision);d=(a=h.traceState)==null?d:a;let _=h.decision===Je.RECORD_AND_SAMPLED?Te.SAMPLED:Te.NONE,v={traceId:u,spanId:c,traceFlags:_,traceState:d};if(h.decision===Je.NOT_RECORD)return I.debug(`Recording is off, propagating context in a non-recording span`),L.wrapSpanContext(v);let y=Ht(Object.assign(m,h.attributes));return new Ar({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:v,name:e,kind:f,links:p,parentSpanContext:l,attributes:y,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:g})}startActiveSpan(e,t,n,r){var i;let a,o,s;if(arguments.length<2)return;arguments.length===2?s=t:arguments.length===3?(a=t,s=n):(a=t,o=n,s=r);let c=(i=o)==null?F.active():i,l=this.startSpan(e,a,c),u=L.setSpan(c,l);return F.with(u,s,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}},ti=class{constructor(e){R(this,`_spanProcessors`,void 0),this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{Zt(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},ni;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(ni||(ni={}));var ri=class{constructor(e={}){var t,n;R(this,`_config`,void 0),R(this,`_tracers`,new Map),R(this,`_resource`,void 0),R(this,`_activeSpanProcessor`,void 0);let r=nr({},Lr(),Vr(e));this._resource=(t=r.resource)==null?Er():t,this._config=Object.assign({},r,{resource:this._resource});let i=[];(n=e.spanProcessors)!=null&&n.length&&i.push(...e.spanProcessors),this._activeSpanProcessor=new ti(i)}getTracer(e,t,n){let r=`${e}@${t||``}:${(n==null?void 0:n.schemaUrl)||``}`;return this._tracers.has(r)||this._tracers.set(r,new ei({name:e,version:t,schemaUrl:n==null?void 0:n.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=ni.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==ni.timeout&&(r=ni.resolved,n(r))}).catch(e=>{clearTimeout(i),r=ni.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==ni.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}},ii=class{constructor(){R(this,`_enabled`,!1),R(this,`_currentContext`,O)}_bindFunction(e=O,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=O,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=O,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||O;try{return t.call(n,...r)}finally{this._currentContext=i}}};function ai(e){if(e!==null){if(e===void 0){let e=new ii;e.enable(),F.setGlobalContextManager(e);return}e.enable(),F.setGlobalContextManager(e)}}function oi(e){if(e!==null){if(e===void 0){ct.setGlobalPropagator(new kn({propagators:[new Un,new Rt]}));return}ct.setGlobalPropagator(e)}}var si=class extends ri{constructor(e={}){super(e)}register(e={}){L.setGlobalTracerProvider(this),oi(e.propagator),ai(e.contextManager)}},B;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(B||(B={}));let ci;function li(){return ci||(ci=document.createElement(`a`)),ci}function ui(e,t){return t in e}function di(e,t,n,r=!0){if(ui(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function fi(e,t,n=!1,r,i){if(r===void 0&&(r=t[B.START_TIME]!==0),n||(di(e,B.FETCH_START,t,r),di(e,B.DOMAIN_LOOKUP_START,t,r),di(e,B.DOMAIN_LOOKUP_END,t,r),di(e,B.CONNECT_START,t,r),di(e,B.SECURE_CONNECTION_START,t,r),di(e,B.CONNECT_END,t,r),di(e,B.REQUEST_START,t,r),di(e,B.RESPONSE_START,t,r),di(e,B.RESPONSE_END,t,r)),!i){let n=t[B.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(`http.response_content_length`,n);let r=t[B.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(`http.response_content_length_uncompressed`,r)}}function pi(e){return e.slice().sort((e,t)=>{let n=e[B.FETCH_START],r=t[B.FETCH_START];return n>r?1:n<r?-1:0})}function mi(){return typeof location<`u`?location.origin:void 0}function hi(e,t,n,r,i=new WeakSet,a){let o=vi(e);e=o.toString();let s=_i(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=pi(s);if(o.origin!==mi()&&c.length>1){let e=c[0],t=gi(c,e[B.RESPONSE_END],n),r=e[B.RESPONSE_END];return t[B.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}else return{mainRequest:s[0]}}function gi(e,t,n){let r=Cn(n),i=Cn(xn(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=Cn(xn(n[B.FETCH_START])),c=r-Cn(xn(n[B.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function _i(e,t,n,r,i,a){let o=Cn(t),s=Cn(n),c=r.filter(t=>{let n=Cn(xn(t[B.FETCH_START])),r=Cn(xn(t[B.RESPONSE_END]));return t.initiatorType.toLowerCase()===(a||`xmlhttprequest`)&&t.name===e&&n>=o&&r<=s});return c.length>0&&(c=c.filter(e=>!i.has(e))),c}function vi(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=li();return t.href=e,t}function yi(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),vi(e).origin===mi()?!0:n.some(t=>pr(e,t))}let bi=`mxl_pending_`;var xi=class{constructor({resource:e=Tr(),storage:t=window.localStorage,diag:n=I.createComponentLogger({namespace:`MXLSpanStorage`}),storedSpansExpireTimeoutMS:r=3600*1e3,onExpiredSpansExport:i,spanSessionManager:a}){R(this,`_noExportTracer`,void 0),R(this,`_storage`,void 0),R(this,`_diag`,void 0),R(this,`_onExpiredSpansExport`,void 0),R(this,`_storedSpansExpireTimeoutMS`,void 0),R(this,`_spanSessionManager`,void 0),R(this,`_checkExpiredSpansInterval`,void 0),this._noExportTracer=new ri({resource:e}).getTracer(`mxl-web-sdk-sessions`),this._storage=t,this._diag=n,this._storedSpansExpireTimeoutMS=r,this._onExpiredSpansExport=i,this._spanSessionManager=a,this.startExpiredSpansCheck()}storePendingSpans(e,t,n){try{if(this.clearStoredSpans(e),this._getPendingSpansKeys().length>=10){this._spanSessionManager.incrSessionCountForKey(`mxl.max_pending_spans_reached`),this._diag.warn(`Not storing pending spans as the max number of items was reached`);return}let r=`${bi}${e}_${Date.now()}`;this._storage.setItem(r,JSON.stringify([t,...n],(e,t)=>e.startsWith(`_`)?void 0:t)),this._diag.debug(`Stored pending span: ${r}`)}catch(e){this._diag.error(`Failed to store spans to storage:`,e)}}clearStoredSpans(e){try{let t=`${bi}${e}_`;this._getPendingSpansKeys().forEach(e=>{e.startsWith(t)&&this._storage.removeItem(e)})}catch(e){this._diag.error(`Failed to clear stored spans from storage:`,e)}}startExpiredSpansCheck(){this._checkExpiredSpansInterval=setInterval(()=>{this.checkAndExportExpiredSpans()},300*1e3)}stopExpiredSpansCheck(){this._checkExpiredSpansInterval&&(clearInterval(this._checkExpiredSpansInterval),this._checkExpiredSpansInterval=void 0)}checkAndExportExpiredSpans(){try{let e=this._getPendingSpansKeys();if(e.length===0)return;let t=Date.now();e.forEach(e=>{let n=e.split(`_`),r=parseInt(n[n.length-1],10);if(Number.isNaN(r)&&(this._diag.error(`Found invalid timestamp in stored span:`,r),this._storage.removeItem(e)),t-r<=this._storedSpansExpireTimeoutMS)return;let i=this._storage.getItem(e);if(i){try{let e=[];for(let t of JSON.parse(i)){let n=this._noExportTracer.startSpan(t.name,{kind:t.kind,attributes:t.attributes,links:t.links,startTime:t.startTime});n.setStatus(t.status),n.end(t.endTime),e.push(n)}this._onExpiredSpansExport&&e.length>0&&this._onExpiredSpansExport(e)}catch(e){this._diag.error(`Failed to process expired spans:`,e)}this._storage.removeItem(e)}})}catch(e){this._diag.error(`Failed to check and export expired spans:`,e)}}_getPendingSpansKeys(){let e=[];for(let t=0;t<this._storage.length;t++){let n=this._storage.key(t);n!=null&&n.startsWith(bi)&&e.push(n)}return e}destroy(){this.stopExpiredSpansCheck()}},Si=class{constructor(e,t){R(this,`_keyPrefix`,void 0),R(this,`_storage`,void 0),this._keyPrefix=`${e}_`,this._storage=t}getNamespacedKeys(){let e=[];for(let t=0;t<this._storage.length;t++){let n=this._storage.key(t);n!=null&&n.startsWith(this._keyPrefix)&&e.push(n.substring(this._keyPrefix.length))}return e}get length(){return this.getNamespacedKeys().length}clear(){this.getNamespacedKeys().forEach(e=>{this._storage.removeItem(`${this._keyPrefix}${e}`)})}getItem(e){return this._storage.getItem(`${this._keyPrefix}${e}`)}key(e){return this.getNamespacedKeys()[e]||null}removeItem(e){this._storage.removeItem(`${this._keyPrefix}${e}`)}setItem(e,t){this._storage.setItem(`${this._keyPrefix}${e}`,t)}getStorageEventKey(e){return`${this._keyPrefix}${e}`}};let Ci=({diag:e,featureManager:t,registerGlobally:n,propagator:r,defaultInstrumentationConfig:i})=>{var a;if(!t.isNetworkSpanForwardingEnabled())return!1;let o=[];return n||o.push("Network span forwarding cannot be used when `registerGlobally` is set to false. Turning off network span forwarding."),r&&o.push("Network span forwarding cannot be used alongside a custom `propagator`. Turning off network span forwarding."),!(i==null||(a=i.omit)==null)&&a.has(`@opentelemetry/instrumentation-xml-http-request`)&&i.omit.has(`@opentelemetry/instrumentation-fetch`)&&o.push(`Network span forwarding cannot be used when both '@opentelemetry/instrumentation-xml-http-request' and '@opentelemetry/instrumentation-fetch' are omitted. Turning off network span forwarding.`),o.forEach(t=>{e.warn(t)}),o.length===0};var wi=class{constructor(e=window.performance){R(this,`_clock`,void 0),R(this,`epochMillisFromOriginOffset`,e=>this._clock.timeOrigin+e),R(this,`getNowHRTime`,()=>yn(this.getNowMillis())),R(this,`getNowMillis`,()=>this.epochMillisFromOriginOffset(this._clock.now())),R(this,`millisSinceHRTime`,e=>this.getNowMillis()-wn(e)),R(this,`millisFromZeroTime`,e=>e),this._clock=e}};function Ti(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Ei(e,t){if(e==null)return{};var n,r,i=Ti(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Di(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Di(Object(n),!0).forEach(function(t){R(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Di(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let Oi=[`diag`];function ki(e){var t,n;return typeof PerformanceObserver<`u`&&((t=(n=PerformanceObserver.supportedEntryTypes)==null?void 0:n.includes(e))==null?!1:t)}function Ai(e,t,n){let r=n==null?{}:n,{diag:i}=r,a=Ei(r,Oi);if(!ki(e))return i==null||i.debug(`${e} not supported, skipping observer`),null;try{let n=new PerformanceObserver(n=>{for(let r of n.getEntries())try{t(r)}catch(t){i==null||i.error(`error processing ${e} entry`,t)}});return n.observe(V({type:e,buffered:!0},a)),n}catch(e){return null}}let ji=(e,t=1e3)=>{let n=!1;return(...r)=>{n||(e(...r),setTimeout(()=>{n=!1},t),n=!0)}};var Mi=class{logException(e,t){}message(e,t,n){}};let Ni=new Mi;var Pi=class{constructor(){R(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?Ni:e}setDelegate(e){this._delegate=e}logException(e,t){this.getDelegate().logException(e,t)}message(e,t,n){this.getDelegate().message(e,t,n)}};let Fi=new Mi,Ii=new Set([`setDelegate`,`getDelegate`]);var Li=class e{static getInstance(){if(!e._instance){let t=new Pi,n=ft(t,Fi,I.createComponentLogger({namespace:`LogAPI`}),Ii);e._instance=Object.assign(n,{setGlobalLogManager(e){t.setDelegate(e)},getLogManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};R(Li,`_instance`,void 0);let Ri=Li.getInstance();var zi=class{setCurrentRoute(e){}getCurrentRoute(){return null}getCurrentPageId(){return``}setPageLabel(e){}getPageLabel(){return null}clearCurrentRoute(){}};let Bi=new zi;var Vi=class{constructor(){R(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?Bi:e}setDelegate(e){this._delegate=e}setCurrentRoute(e){this.getDelegate().setCurrentRoute(e)}getCurrentRoute(){return this.getDelegate().getCurrentRoute()}getCurrentPageId(){return this.getDelegate().getCurrentPageId()}setPageLabel(e){this.getDelegate().setPageLabel(e)}getPageLabel(){return this.getDelegate().getPageLabel()}clearCurrentRoute(){this.getDelegate().clearCurrentRoute()}};let Hi=new zi,Ui=new Set([`setDelegate`,`getDelegate`]);var Wi=class e{static getInstance(){if(!e._instance){let t=new Vi,n=ft(t,Hi,I.createComponentLogger({namespace:`PageAPI`}),Ui);e._instance=Object.assign(n,{setGlobalPageManager(e){t.setDelegate(e)},getPageManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};R(Wi,`_instance`,void 0);let Gi=Wi.getInstance();var Ki=class{constructor(){R(this,`getSessionId`,()=>null),R(this,`getPreviousSessionId`,()=>null)}addBreadcrumb(e){}addProperty(e,t,n){}removeProperty(e){}endSessionSpan(){}endSessionSpanInternal(e){}currentSessionAsReadableSpan(e){return null}getSessionSpan(){return null}getSessionStartTime(){return null}startSessionSpan(){}addSessionStartedListener(e){return()=>{}}addSessionEndedListener(e){return()=>{}}};let qi=new Ki;var Ji=class{constructor(){R(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?qi:e}setDelegate(e){this._delegate=e}addBreadcrumb(e){this.getDelegate().addBreadcrumb(e)}addProperty(e,t,n){this.getDelegate().addProperty(e,t,n)}removeProperty(e){this.getDelegate().removeProperty(e)}endSessionSpan(){this.getDelegate().endSessionSpan()}endSessionSpanInternal(e){this.getDelegate().endSessionSpanInternal(e)}currentSessionAsReadableSpan(e){return this.getDelegate().currentSessionAsReadableSpan(e)}getSessionId(){return this.getDelegate().getSessionId()}getPreviousSessionId(){return this.getDelegate().getPreviousSessionId()}getSessionSpan(){return this.getDelegate().getSessionSpan()}getSessionStartTime(){return this.getDelegate().getSessionStartTime()}startSessionSpan(e){this.getDelegate().startSessionSpan(e)}addSessionStartedListener(e){return this.getDelegate().addSessionStartedListener(e)}addSessionEndedListener(e){return this.getDelegate().addSessionEndedListener(e)}};let Yi=new Ki,Xi=new Set([`setDelegate`,`getDelegate`]);var Zi=class e{static getInstance(){if(!e._instance){let t=new Ji,n=ft(t,Yi,I.createComponentLogger({namespace:`SessionAPI`}),Xi);e._instance=Object.assign(n,{setGlobalSessionManager(e){t.setDelegate(e)},getSpanSessionManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};R(Zi,`_instance`,void 0);let Qi=Zi.getInstance();var $i=class{constructor(e=Ee){R(this,`_spanContext`,void 0),R(this,`attributes`,{}),this._spanContext=e}fail(e){}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}removeAttribute(e){return this}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}},ea=class{startSpan(e,t){return new $i}setSpan(e,t){return O}getSpan(e){}};let ta=new ea;var na=class{constructor(){R(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?ta:e}setDelegate(e){this._delegate=e}startSpan(e,t,n){return this.getDelegate().startSpan(e,t,n)}setSpan(e,t){return this.getDelegate().setSpan(e,t)}getSpan(e){return this.getDelegate().getSpan(e)}};let ra=new ea,ia=new Set([`setDelegate`,`getDelegate`]);var aa=class e{static getInstance(){if(!e._instance){let t=new na,n=ft(t,ra,I.createComponentLogger({namespace:`TraceAPI`}),ia);e._instance=Object.assign(n,{setGlobalTraceManager(e){t.setDelegate(e)},getTraceManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};R(aa,`_instance`,void 0);let oa=aa.getInstance();var sa=class{getMXLUserId(){return``}getUserId(){return null}setUserId(){}clearUserId(){}};let ca=new sa;var la=class{constructor(){R(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?ca:e}setDelegate(e){this._delegate=e}getMXLUserId(){return this.getDelegate().getMXLUserId()}getUserId(){return this.getDelegate().getUserId()}setUserId(e){this.getDelegate().setUserId(e)}clearUserId(){this.getDelegate().clearUserId()}};let ua=new sa,da=new Set([`setDelegate`,`getDelegate`]);var fa=class e{static getInstance(){if(!e._instance){let t=new la,n=ft(t,ua,I.createComponentLogger({namespace:`UserAPI`}),da);e._instance=Object.assign(n,{setGlobalUserManager(e){t.setDelegate(e)},getUserManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};R(fa,`_instance`,void 0);let pa=fa.getInstance(),ma={pageLabel:Et};var ha=class{emit(e){}enabled(){return!1}};let ga=new ha,_a=Symbol.for(`io.opentelemetry.js.api.logs`),va=globalThis;function ya(e,t,n){return r=>r===e?t:n}let ba=new class{getLogger(e,t,n){return new ha}};var xa=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):ga}},Sa=class{getLogger(e,t,n){var r;return(r=this._getDelegateLogger(e,t,n))==null?new xa(this,e,t,n):r}_getDelegate(){var e;return(e=this._delegate)==null?ba:e}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getLogger(e,t,n)}};let Ca=class e{constructor(){this._proxyLoggerProvider=new Sa}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return va[_a]?this.getLoggerProvider():(va[_a]=ya(1,e,ba),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=va[_a])==null?void 0:e.call(va,1))==null?this._proxyLoggerProvider:t}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete va[_a],this._proxyLoggerProvider=new Sa}}.getInstance();function wa(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function Ta(e){e.forEach(e=>e.disable())}function Ea(e){var t,n;let r=e.tracerProvider||L.getTracerProvider(),i=e.meterProvider||$e.getMeterProvider(),a=e.loggerProvider||Ca.getLoggerProvider(),o=(t=(n=e.instrumentations)==null?void 0:n.flat())==null?[]:t;return wa(o,r,i,a),()=>{Ta(o)}}let Da=console.error.bind(console);function Oa(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}let ka=(e,t,n)=>{if(!e||!e[t]){Da(`no original function `+String(t)+` to wrap`);return}if(!n){Da(`no wrapper function`),Da(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){Da(`original object and wrapper must be functions`);return}let i=n(r,t);return Oa(i,`__original`,r),Oa(i,`__unwrap`,()=>{e[t]===i&&Oa(e,t,r)}),Oa(i,`__wrapped`,!0),Oa(e,t,i),i},Aa=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Da(`must provide one or more modules to patch`),Da(Error().stack);return}if(!(t&&Array.isArray(t))){Da(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{ka(e,t,n)})})},ja=(e,t)=>{if(!e||!e[t]){Da(`no function to unwrap.`),Da(Error().stack);return}let n=e[t];if(!n.__unwrap)Da(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},Ma=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Da(`must provide one or more modules to patch`),Da(Error().stack);return}if(!(t&&Array.isArray(t))){Da(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{ja(e,t)})})};function Na(e){e&&e.logger&&(typeof e.logger==`function`?Da=e.logger:Da(`new logger isn't a function, not replacing`))}Na.wrap=ka,Na.massWrap=Aa,Na.unwrap=ja,Na.massUnwrap=Ma;var Pa=class{constructor(e,t,n){R(this,`_config`,{}),R(this,`_tracer`,void 0),R(this,`_meter`,void 0),R(this,`_logger`,void 0),R(this,`_diag`,void 0),R(this,`instrumentationName`,void 0),R(this,`instrumentationVersion`,void 0),R(this,`_wrap`,ka),R(this,`_unwrap`,ja),R(this,`_massWrap`,Aa),R(this,`_massUnwrap`,Ma),this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=I.createComponentLogger({namespace:e}),this._tracer=L.getTracer(e,t),this._meter=$e.getMeter(e,t),this._logger=Ca.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var e;let t=(e=this.init())==null?[]:e;return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config=V({enabled:!0},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},Fa=class extends Pa{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function Ia(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}var H;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(H||(H={}));function La(e,t){let n=H.OLD,r=t==null?void 0:t.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r==null?[]:r)if(t.toLowerCase()===e+`/dup`){n=H.DUPLICATE;break}else t.toLowerCase()===e&&(n=H.STABLE);return n}let Ra=`session.id`,za=`user.id`;var Ba;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRACE=1]=`TRACE`,e[e.TRACE2=2]=`TRACE2`,e[e.TRACE3=3]=`TRACE3`,e[e.TRACE4=4]=`TRACE4`,e[e.DEBUG=5]=`DEBUG`,e[e.DEBUG2=6]=`DEBUG2`,e[e.DEBUG3=7]=`DEBUG3`,e[e.DEBUG4=8]=`DEBUG4`,e[e.INFO=9]=`INFO`,e[e.INFO2=10]=`INFO2`,e[e.INFO3=11]=`INFO3`,e[e.INFO4=12]=`INFO4`,e[e.WARN=13]=`WARN`,e[e.WARN2=14]=`WARN2`,e[e.WARN3=15]=`WARN3`,e[e.WARN4=16]=`WARN4`,e[e.ERROR=17]=`ERROR`,e[e.ERROR2=18]=`ERROR2`,e[e.ERROR3=19]=`ERROR3`,e[e.ERROR4=20]=`ERROR4`,e[e.FATAL=21]=`FATAL`,e[e.FATAL2=22]=`FATAL2`,e[e.FATAL3=23]=`FATAL3`,e[e.FATAL4=24]=`FATAL4`})(Ba||(Ba={}));var Va=class{emit(e){}enabled(){return!1}};let Ha=new Va,Ua=Symbol.for(`io.opentelemetry.js.api.logs`),Wa=globalThis;function Ga(e,t,n){return r=>r===e?t:n}let Ka=new class{getLogger(e,t,n){return new Va}};var qa=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Ha}},Ja=class{getLogger(e,t,n){var r;return(r=this._getDelegateLogger(e,t,n))==null?new qa(this,e,t,n):r}_getDelegate(){var e;return(e=this._delegate)==null?Ka:e}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getLogger(e,t,n)}};let Ya=class e{constructor(){this._proxyLoggerProvider=new Ja}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return Wa[Ua]?this.getLoggerProvider():(Wa[Ua]=Ga(1,e,Ka),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=Wa[Ua])==null?void 0:e.call(Wa,1))==null?this._proxyLoggerProvider:t}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete Wa[Ua],this._proxyLoggerProvider=new Ja}}.getInstance();var Xa=class{constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,R(this,`_config`,{}),R(this,`_diag`,void 0),R(this,`_tracer`,void 0),R(this,`_meter`,void 0),R(this,`_logger`,void 0),this.setConfig(n),this._diag=I.createComponentLogger({namespace:e}),this._tracer=L.getTracer(e,t),this._meter=$e.getMeter(e,t),this._logger=Ya.getLogger(e,t),this._updateMetricInstruments()}get tracer(){return this._tracer}get meter(){return this._meter}get logger(){return this._logger}getModuleDefinitions(){var e;let t=(e=this.init())==null?[]:e;return Array.isArray(t)?t:[t]}getConfig(){return this._config}setConfig(e){this._config=V({enabled:!0},e)}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}_updateMetricInstruments(){}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},Za=class extends Xa{constructor({instrumentationName:e,instrumentationVersion:t,config:n,diag:r,perf:i,limitManager:a}){super(e,t,n),R(this,`_sessionManager`,void 0),R(this,`_logManager`,void 0),R(this,`_limitManager`,void 0),R(this,`_perf`,void 0),r&&(this._diag=r),this._perf=i==null?new wi:i,this._sessionManager=Qi.getSpanSessionManager(),this._logManager=Ri.getLogManager(),this._limitManager=a}get limitManager(){return this._limitManager}get sessionManager(){return this._sessionManager}get logManager(){return this._logManager}get perf(){return this._perf}init(){}setLimitManager(e){this._limitManager=e}setLogManager(e){this._logManager=e}setSessionManager(e){this._sessionManager=e}};let Qa=()=>{let e={},t=window.performance.getEntriesByType(`navigation`)[0];return Object.values(B).forEach(n=>{if(ui(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}}),e},$a={"first-paint":`firstPaint`,"first-contentful-paint":`firstContentfulPaint`},eo=e=>{window.performance.getEntriesByType(`paint`).forEach(({name:t,startTime:n})=>{ui($a,t)&&e.addEvent($a[t],n)})};var to=class extends Za{constructor({diag:e,perf:t,enabled:n,applyCustomAttributesOnSpan:r,ignorePerformancePaintEvents:i=!1,ignoreNetworkEvents:a=!1}={}){super({instrumentationName:`DocumentLoadInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{enabled:n,applyCustomAttributesOnSpan:r,ignorePerformancePaintEvents:i,ignoreNetworkEvents:a}}),R(this,`_onDocumentLoaded`,void 0),R(this,`_performanceCollected`,!1),this._onDocumentLoaded=()=>{window.setTimeout(()=>{this._collectPerformance()},0)},this._config.enabled&&this.enable()}init(){this._diag.debug(`Initializing document load instrumentation`)}_addResourcesSpans(e){performance.getEntriesByType(`resource`).forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){if(this._performanceCollected)return;this._performanceCollected=!0;let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===zn),t=Qa(),n=(e==null?void 0:e.content)||``;F.with(ct.extract(O,{traceparent:n}),()=>{var e;let n=this._startSpan(`documentLoad`,B.FETCH_START,t);n&&(F.with(L.setSpan(F.active(),n),()=>{let e=this._startSpan(`documentFetch`,B.FETCH_START,t);e&&(e.setAttribute(pn,location.href),F.with(L.setSpan(F.active(),e),()=>{var n;fi(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,(n=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:n.documentFetch),this._endSpan(e,B.RESPONSE_END,t)}))}),n.setAttribute(vt,`ux.document_load`),n.setAttribute(pn,location.href),n.setAttribute(mn,navigator.userAgent),this._addResourcesSpans(n),this.getConfig().ignoreNetworkEvents||(di(n,B.FETCH_START,t),di(n,B.UNLOAD_EVENT_START,t),di(n,B.UNLOAD_EVENT_END,t),di(n,B.DOM_INTERACTIVE,t),di(n,B.DOM_CONTENT_LOADED_EVENT_START,t),di(n,B.DOM_CONTENT_LOADED_EVENT_END,t),di(n,B.DOM_COMPLETE,t),di(n,B.LOAD_EVENT_START,t),di(n,B.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||eo(n),this._addCustomAttributesOnSpan(n,(e=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:e.documentLoad),this._endSpan(n,B.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(ui(n,t)&&typeof n[t]==`number`?e.end(n[t]):e.end())}_initResourceSpan(e,t){var n;let r=this._startSpan(`resourceFetch`,B.FETCH_START,e,t);r&&(r.setAttribute(vt,`ux.resource_fetch`),r.setAttribute(pn,e.name),fi(r,e,this.getConfig().ignoreNetworkEvents),e.deliveryType&&r.setAttribute(`http.response.delivery_type`,e.deliveryType),e.initiatorType&&r.setAttribute(`http.request.initiator_type`,e.initiatorType),e.renderBlockingStatus&&r.setAttribute(`http.request.render_blocking_status`,e.renderBlockingStatus),e.responseStatus&&r.setAttribute(on,e.responseStatus),typeof e.encodedBodySize==`number`&&e.encodedBodySize>=0&&r.setAttribute(`http.response.body.size`,e.encodedBodySize),typeof e.transferSize==`number`&&e.transferSize>=0&&r.setAttribute(`http.response.size`,e.transferSize),typeof e.decodedBodySize==`number`&&e.decodedBodySize>=0&&r.setAttribute(`http.response.decoded_body_size`,e.decodedBodySize),this._addResourceDiagnosticAttributes(r,e),this._addCustomAttributesOnResourceSpan(r,e,(n=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:n.resourceFetch),this._endSpan(r,B.RESPONSE_END,e))}_startSpan(e,t,n,r){if(ui(n,t)&&typeof n[t]==`number`)return this.tracer.startSpan(e,{startTime:n[t]},r?L.setSpan(F.active(),r):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():window.addEventListener(`load`,this._onDocumentLoaded)}_addCustomAttributesOnSpan(e,t){t&&Ia(()=>{t(e)},e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&Ia(()=>{n(e,t)},e=>{e&&this._diag.error(`addCustomAttributesOnResourceSpan`,e)},!0)}_hasNoSizeData(e){let t=typeof e.transferSize==`number`?e.transferSize:0,n=typeof e.decodedBodySize==`number`?e.decodedBodySize:0,r=typeof e.encodedBodySize==`number`?e.encodedBodySize:0;return t===0&&n===0&&r===0}_hasTimingData(e){let t=typeof e.fetchStart==`number`?e.fetchStart:0,n=typeof e.responseEnd==`number`?e.responseEnd:0;return t>0&&n>0}_isCorsRestricted(e){return this._hasNoSizeData(e)&&this._hasTimingData(e)}_isFetchIncomplete(e){let t=typeof e.fetchStart==`number`?e.fetchStart:0,n=typeof e.responseEnd==`number`?e.responseEnd:0;return this._hasNoSizeData(e)&&t>0&&n===0}_isFetchPrevented(e){let t=typeof e.fetchStart==`number`?e.fetchStart:0;return this._hasNoSizeData(e)&&t===0}_isCacheValidated(e){let t=typeof e.transferSize==`number`?e.transferSize:0,n=typeof e.deliveryType==`string`?e.deliveryType:``;return t===300&&n!==`cache`}_addResourceDiagnosticAttributes(e,t){this._isCorsRestricted(t)?e.setAttribute(`http.response.cors_opaque`,!0):this._isFetchIncomplete(t)?e.setAttribute(`http.request.incomplete`,!0):this._isFetchPrevented(t)&&e.setAttribute(`http.request.prevented`,!0),this._isCacheValidated(t)&&e.setAttribute(`http.response.cache_revalidated`,!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}},no=class extends Za{constructor({diag:e,perf:t,rootNode:n,emptyCheckDelayMs:r=500}){super({instrumentationName:`EmptyRootInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),R(this,`_observer`,void 0),R(this,`_emptyCheckDelayMs`,void 0),R(this,`_rootNode`,void 0),this._rootNode=n,this._emptyCheckDelayMs=r,this._observer=new MutationObserver((e,t)=>{this._observerCallback(e)}),this._config.enabled&&this._rootNode?this.enable():this._rootNode||this._diag.warn(`supplied root node was null, this instrumentation won't be enabled`)}disable(){this._observer.disconnect()}enable(){this._rootNode&&this._observer.observe(this._rootNode,{childList:!0})}_observerCallback(e){let t=!1,n=!1;for(let r of e)r.target===this._rootNode&&(r.removedNodes.length>0&&(t=!0),r.addedNodes.length>0&&(n=!0));t&&!n&&(this._diag.debug(`root node had child nodes removed without new ones being added, checking if it's empty in ${this._emptyCheckDelayMs}ms`),window.setTimeout(()=>{this._checkForEmptyRootNode()},this._emptyCheckDelayMs))}_checkForEmptyRootNode(){var e;if(((e=this._rootNode)==null?void 0:e.childNodes.length)===0){this._diag.debug(`root node was found to be empty`);let e=this.sessionManager.getSessionSpan();e?e.addEvent(`empty-root-node`,{"mxl.type":`ux.empty_root_node`}):this._diag.debug(`no active session found to emit event on`)}}};let ro=(e,t)=>{let n=e.nodeName.toLowerCase(),r=t.substring(0,30),i=t.length>30?`...`:``;return`<${n}${e.className?` class="${e.className}"`:``}>${r}${i}</${n}>`};var io=class extends Za{constructor({diag:e,perf:t,shouldTrack:n,innerTextForElement:r}={}){super({instrumentationName:`ClicksInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),R(this,`_onClickHandler`,void 0),this._onClickHandler=e=>{let t=e.target;if(t instanceof HTMLElement&&!t.hasAttribute(`disabled`)&&!(n&&!n(t)))try{let n=this.sessionManager.getSessionSpan();n&&n.addEvent(`click`,{"mxl.type":`ux.tap`,"view.name":ro(t,r?r(t):t.innerText),"tap.coords":`${e.x.toString()},${e.y.toString()}`},this.perf.epochMillisFromOriginOffset(e.timeStamp))}catch(e){this._diag.error(`failed to create new user interaction span event`,e)}},this._config.enabled&&this.enable()}disable(){document.removeEventListener(`click`,this._onClickHandler)}enable(){document.addEventListener(`click`,this._onClickHandler)}},ao=class extends Za{constructor({diag:e,perf:t,limitManager:n}={}){super({instrumentationName:`ElementTimingInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,limitManager:n,config:{}}),R(this,`_observer`,null),R(this,`_isEnabled`,!1),this._config.enabled&&this.enable()}enable(){if(!this._isEnabled){if(!ki(`element`)){this._diag.debug(`element not supported, skipping`);return}if(this._isEnabled=!0,this._observer&&this._observer.disconnect(),this._observer=Ai(`element`,e=>this._processEntry(e),{diag:this._diag}),!this._observer){this._isEnabled=!1,this._diag.error(`failed to enable`);return}}}disable(){this._isEnabled=!1,this._observer&&(this._observer.disconnect(),this._observer=null)}_processEntry(e){var t,n;if(!this._isEnabled||(t=this.limitManager)!=null&&t.limitElementTimingEntry())return;let r=this.tracer.startSpan(e.identifier,{startTime:this.perf.epochMillisFromOriginOffset(0),attributes:{[vt]:`ux.element_timing`,"mxl.element_timing.identifier":e.identifier,"mxl.element_timing.element":(n=e.element)==null||(n=n.tagName)==null?void 0:n.toLowerCase(),"mxl.element_timing.render_time":e.renderTime,"mxl.element_timing.load_time":e.loadTime,"mxl.element_timing.start_time":e.startTime,"mxl.element_timing.url":e.url,"mxl.element_timing.natural_width":e.naturalWidth,"mxl.element_timing.natural_height":e.naturalHeight}});e.loadTime>0&&r.addEvent(`load`,this.perf.epochMillisFromOriginOffset(e.loadTime)),r.end(this.perf.epochMillisFromOriginOffset(e.startTime))}},oo=class extends Za{constructor({diag:e,perf:t}={}){super({instrumentationName:`GlobalExceptionInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),R(this,`_onErrorHandler`,void 0),R(this,`_onUnhandledRejectionHandler`,void 0),this._onErrorHandler=e=>{this.logManager.logException(e.error||e.message,{handled:!1,timestamp:this.perf.epochMillisFromOriginOffset(e.timeStamp),handler:`global_exception`})},this._onUnhandledRejectionHandler=e=>{this.logManager.logException(e.reason,{handled:!1,timestamp:this.perf.epochMillisFromOriginOffset(e.timeStamp),handler:`promise_rejection`})},this._config.enabled&&this.enable()}disable(){window.removeEventListener(`error`,this._onErrorHandler),window.removeEventListener(`unhandledrejection`,this._onUnhandledRejectionHandler)}enable(){window.addEventListener(`error`,this._onErrorHandler),window.addEventListener(`unhandledrejection`,this._onUnhandledRejectionHandler)}},so=class extends Za{constructor({diag:e,perf:t}={}){super({instrumentationName:`LoafInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),R(this,`_observer`,null),R(this,`_isFirstEntry`,!0),R(this,`_removeSessionEndListener`,null),R(this,`_isEnabled`,!1),R(this,`_totalDuration`,0),R(this,`_workDuration`,0),R(this,`_styleLayoutDuration`,0),R(this,`_count`,0),R(this,`_longestDuration`,0),R(this,`_longestDurationExcludingFirst`,0),R(this,`_totalBlockingDuration`,0),R(this,`_scriptSummaries`,new Map),this._config.enabled&&this.enable()}enable(){if(!this._isEnabled){if(!ki(`long-animation-frame`)){this._diag.debug(`long-animation-frame not supported, skipping`);return}if(this._isEnabled=!0,this._observer&&this._observer.disconnect(),this._observer=Ai(`long-animation-frame`,e=>this._processEntry(e),{diag:this._diag}),!this._observer){this._isEnabled=!1,this._diag.error(`failed to enable`);return}this._registerSessionEndListener()}}_registerSessionEndListener(){this._isEnabled&&(this._removeSessionEndListener&&this._removeSessionEndListener(),this._removeSessionEndListener=this.sessionManager.addSessionEndedListener(()=>{try{this._flushReport()}catch(e){this._diag.error(`error flushing report`,e)}}))}setSessionManager(e){super.setSessionManager(e),this._registerSessionEndListener()}disable(){this._isEnabled=!1,this._resetAccumulators(),this._observer&&(this._observer.disconnect(),this._observer=null),this._removeSessionEndListener&&(this._removeSessionEndListener(),this._removeSessionEndListener=null)}_processEntry(e){if(this._isEnabled){this._count++,this._totalDuration+=e.duration,this._workDuration+=e.renderStart?e.renderStart-e.startTime:e.duration,e.styleAndLayoutStart&&(this._styleLayoutDuration+=Math.max(0,e.startTime+e.duration-e.styleAndLayoutStart)),this._longestDuration=Math.max(this._longestDuration,e.duration),this._isFirstEntry&&this._count===1?this._isFirstEntry=!1:(this._longestDurationExcludingFirst=Math.max(this._longestDurationExcludingFirst,e.duration),e.firstUIEventTimestamp===0&&(this._totalBlockingDuration+=e.blockingDuration));try{for(let t of e.scripts){let e=t.sourceURL||`(inline)`;e.length>2048&&(e=`${e.substring(0,2048)}...`);let n=this._scriptSummaries.get(e);n?(n.totalDuration+=t.duration,n.styleAndLayoutDuration+=t.forcedStyleAndLayoutDuration,n.count++):this._scriptSummaries.set(e,{totalDuration:t.duration,styleAndLayoutDuration:t.forcedStyleAndLayoutDuration,count:1})}}catch(e){this._diag.error(`error processing scripts for entry`,e)}}}_flushReport(){if(this._count===0)return;let e;e=this._totalBlockingDuration<=200?`good`:this._totalBlockingDuration<=600?`needs-improvement`:`poor`;let t={[vt]:`ux.web_vital`,"mxl.web_vital.id":gt(),"mxl.web_vital.name":`TBD`,"mxl.web_vital.value":Math.round(this._totalBlockingDuration),"mxl.web_vital.rating":e,"mxl.tbd.loaf_total_duration":Math.round(this._totalDuration),"mxl.tbd.loaf_work_duration":Math.round(this._workDuration),"mxl.tbd.loaf_style_and_layout_duration":Math.round(this._styleLayoutDuration),"mxl.tbd.loaf_count":this._count,"mxl.tbd.loaf_longest_duration":Math.round(this._longestDuration),"mxl.tbd.loaf_longest_duration_excluding_first":Math.round(this._longestDurationExcludingFirst)};try{this.logger.emit({eventName:`mxl-loaf-report`,severityNumber:Ba.INFO,attributes:t})}catch(e){this._diag.error(`error emitting loaf report`,e)}try{if(this._scriptSummaries.size>0){let e=[...this._scriptSummaries].sort((e,t)=>t[1].totalDuration-e[1].totalDuration).slice(0,250).map(([e,t])=>[e,{total_duration:Math.round(t.totalDuration),style_and_layout_duration:Math.round(t.styleAndLayoutDuration),count:t.count}]);this.logger.emit({eventName:`mxl-loaf-scripts`,severityNumber:Ba.INFO,body:JSON.stringify(Object.fromEntries(e)),attributes:{[vt]:`ux.loaf_scripts`}})}}catch(e){this._diag.error(`error emitting loaf script summary`,e)}this._resetAccumulators()}_resetAccumulators(){this._totalDuration=0,this._workDuration=0,this._styleLayoutDuration=0,this._count=0,this._longestDuration=0,this._longestDurationExcludingFirst=0,this._totalBlockingDuration=0,this._scriptSummaries=new Map}};let co=/\([^()]+\)/g;var lo=class extends Za{constructor({diag:e,shouldCleanupPathOptionsFromRouteName:t=!0}){super({instrumentationName:`NavigationInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,config:{}}),R(this,`_shouldCleanupPathOptionsFromRouteName`,!0),R(this,`_currentRouteSpan`,null),R(this,`_instrumentationType`,`manual`),R(this,`_removeSessionStartedFn`,null),R(this,`_removeSessionEndedFn`,null),R(this,`setInstrumentationType`,e=>{this._instrumentationType=e}),R(this,`setCurrentRoute`,e=>{if(!this._config.enabled)return;let t=Gi.getCurrentRoute();e.url!==(t==null?void 0:t.url)&&(Gi.setCurrentRoute(e),this._endRouteSpan(t),this._startRouteSpan(e))}),R(this,`_setupSessionListeners`,()=>{this._removeSessionStartedFn||(this._removeSessionStartedFn=this.sessionManager.addSessionStartedListener(()=>{let e=Gi.getCurrentRoute();e&&!this._currentRouteSpan&&(this._diag.debug(`Session started, starting route span.`),this._startRouteSpan(e))})),this._removeSessionEndedFn||(this._removeSessionEndedFn=this.sessionManager.addSessionEndedListener(()=>{this._currentRouteSpan&&(this._diag.debug(`Session ended, ending route span.`),this._endRouteSpan(Gi.getCurrentRoute()))}))}),R(this,`_cleanUpSessionListeners`,()=>{this._removeSessionStartedFn&&(this._removeSessionStartedFn(),this._removeSessionStartedFn=null),this._removeSessionEndedFn&&(this._removeSessionEndedFn(),this._removeSessionEndedFn=null)}),R(this,`_startRouteSpan`,e=>{this._diag.debug(`Starting route span for url: ${e.url}`),this._setupSessionListeners();let t=this._shouldCleanupPathOptionsFromRouteName?e.path.replace(co,``):e.path;return this._currentRouteSpan=this.tracer.startSpan(t,{attributes:{[vt]:`ux.surface`,[wt]:t,[Tt]:Gi.getCurrentPageId()||void 0}}),this._currentRouteSpan.setAttribute(xt,this._instrumentationType),this._currentRouteSpan}),R(this,`_endRouteSpan`,e=>{this._currentRouteSpan&&(e&&this._diag.debug(`Ending route span for url: ${e.url}`),this._currentRouteSpan.end(),this._currentRouteSpan=null)}),R(this,`enable`,()=>{this.setConfig({enabled:!0}),this._diag.debug(`NavigationInstrumentation enabled, listening for navigation events.`)}),R(this,`disable`,()=>{this._cleanUpSessionListeners(),this.setConfig({enabled:!1}),this._diag.debug(`NavigationInstrumentation disabled, stopped listening for navigation events.`)}),this._shouldCleanupPathOptionsFromRouteName=t,this._config.enabled&&this.enable()}};let uo,fo=(e={})=>(uo||(uo=new lo(e)),uo);var po=class extends Za{constructor({diag:e,perf:t,limitManager:n}={}){super({instrumentationName:`ServerTimingInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,limitManager:n,config:{}}),R(this,`_onLoad`,void 0),R(this,`_performanceCollected`,!1),this._onLoad=()=>{this._readServerTiming()},this._config.enabled&&this.enable()}enable(){if(window.removeEventListener(`load`,this._onLoad),window.document.readyState===`complete`){this._readServerTiming();return}window.addEventListener(`load`,this._onLoad)}disable(){window.removeEventListener(`load`,this._onLoad)}_readServerTiming(){var e;if(this._performanceCollected)return;this._performanceCollected=!0;let t=(e=performance.getEntriesByType(`navigation`)[0])==null?void 0:e.serverTiming;if(t!=null&&t.length)for(let e of t){var n;if((n=this.limitManager)!=null&&n.limitServerTimingEntry())return;this.logger.emit({eventName:`mxl-server-timing`,severityNumber:Ba.INFO,attributes:{[vt]:`ux.server_timing`,"mxl.server_timing.name":e.name,"mxl.server_timing.duration":e.duration,"mxl.server_timing.description":e.description}})}}};let mo={samplingPct:100,networkSpansForwardingThreshold:0},ho=`mxl_remote_config`,go=`0.0.12`,_o=`mxl_app_instance_id`,vo=(e,t)=>{let n=null;try{n=e.getItem(_o)}catch(e){t.warn(`Failed to retrieve app instance ID from session storage`,e)}if(!n){t.debug(`No existing app instance ID found in session storage, creating a new one`),n=ht();try{e.setItem(_o,n)}catch(e){t.warn(`Failed to persist app instance ID to session storage`,e)}}return n},yo=`unknown_service`,bo=({serviceName:e})=>wr({[ln]:e}),xo=({diagLogger:e,appVersion:t,pageSessionStorage:n})=>wr({[dn]:`mxl-web-sdk`,app_version:t,app_framework:1,sdk_version:go,[fn]:go,sdk_simple_version:1,sdk_platform:`web`,[un]:`webjs`,"mxl.app_instance_id":vo(n,e),[mn]:window.navigator.userAgent,screen_resolution:`${window.screen.width}x${window.screen.height}`}),So=(e,{osVersion:t,appVersion:n,deviceId:r},i)=>`${i||`https://mxl-basket.apps.ocpthikadev01.safaricom.net`}/config?appId=${e}&osVersion=${t}&appVersion=${n}&deviceId=${r}`,Co=e=>{let t={samplingPct:e.threshold};return e.network_span_forwarding!==void 0&&(t.networkSpansForwardingThreshold=e.network_span_forwarding.pct_enabled),e.empty_session_avoidance_enabled_pct!==void 0&&(t.emptySessionAvoidanceEnabledPct=e.empty_session_avoidance_enabled_pct),e.service_name!==void 0&&e.service_name!==``&&(t.serviceName=e.service_name),t};var wo=class{constructor({appID:e,appVersion:t,deviceId:n,diag:r=I.createComponentLogger({namespace:`mxl-config-manager`}),storage:i=window.localStorage,defaultConfig:a={},mxlConfigURL:o}={}){R(this,`_remoteConfigURL`,null),R(this,`_diag`,void 0),R(this,`_storage`,void 0),R(this,`_baseConfig`,void 0),R(this,`_sdkConfig`,void 0),R(this,`_etag`,null),R(this,`_remoteSourceServiceName`,void 0),e&&t&&n&&(this._remoteConfigURL=So(e,{appVersion:t,deviceId:n,osVersion:`1`},o)),this._diag=r,this._storage=i;let s=this._getRemoteConfigFromStorage();s&&(this._etag=s.etag,this._captureRemoteServiceName(s.config)),this._baseConfig=V(V({},mo),a),this._sdkConfig=V(V({},this._baseConfig),s?Co(s.config):{})}setConfig(e){this._sdkConfig=V(V({},this._sdkConfig),e)}getConfig(){return this._sdkConfig}resolveApplicationServiceName(e){var t,n;return((t=this._remoteSourceServiceName)==null?void 0:t.trim())||(e==null?void 0:e.trim())||((n=this._baseConfig.serviceName)==null?void 0:n.trim())||yo}_captureRemoteServiceName(e){if(e.service_name===void 0)return;let t=e.service_name.trim();this._remoteSourceServiceName=t.length>0?t:void 0}refreshRemoteConfig(){var e=this;return z(function*(){if(e._remoteConfigURL)try{let t=yield e._fetchRemoteConfig(e._remoteConfigURL);if(!t){e._diag.debug(`No changes in remote config, skipping update`);return}let[n,r]=t;e._captureRemoteServiceName(n),e._storage.setItem(ho,JSON.stringify({config:n,etag:r})),e._sdkConfig=V(V({},e._baseConfig),Co(n)),e._etag=r}catch(t){e._diag.warn(`Failed to refresh remote config: ${t instanceof Error?t.message:String(t)}`)}})()}_getRemoteConfigFromStorage(){try{let e=this._storage.getItem(ho);return e?JSON.parse(e):null}catch(e){return this._diag.warn(`Failed to parse remote config from storage: ${e instanceof Error?e.message:String(e)}`),null}}_fetchRemoteConfig(e){var t=this;return z(function*(){let n=yield fetch(e,{headers:t._etag?{"If-None-Match":t._etag}:{}}),r=n.headers.get(`etag`);return n.status===304?null:n.ok?[yield n.json(),r]:(t._diag.warn(`Failed to fetch remote config from ${e}: ${n.statusText}`),null)})()}};let To={maxAllowed:{error_log:500,warning_log:200,info_log:100,exception:500,breadcrumb:100,session_property:100,span:1e3,network_request:1e4,element_timing:500,server_timing:500,user_timing_mark:500,user_timing_measure:500},maxLength:{error_log:128,warning_log:128,info_log:128,exception:1024,breadcrumb:256,session_property_key:128,session_property_value:256,log_attribute_key:128,log_attribute_value:256,exception_attribute_key:128,exception_attribute_value:256},maxAttributes:{error_log:50,warning_log:50,info_log:50,exception:50}},Eo={info:`info_log`,warning:`warning_log`,error:`error_log`};var Do=class{constructor({diag:e,maxAllowed:t,maxLength:n,maxAttributes:r}){R(this,`_diag`,void 0),R(this,`_diagnosticCounts`,{}),R(this,`_currentCount`,{exception:0,error_log:0,warning_log:0,info_log:0,breadcrumb:0,session_property:0,span:0,network_request:0,element_timing:0,server_timing:0,user_timing_mark:0,user_timing_measure:0}),R(this,`_maxAllowed`,void 0),R(this,`_maxLength`,void 0),R(this,`_maxAttributes`,void 0),this._diag=e==null?I.createComponentLogger({namespace:`MXLLimitManager`}):e,this._maxAllowed=t,this._maxLength=n,this._maxAttributes=r}_dropIfMaxReached(e){return this._currentCount[e]>=this._maxAllowed[e]?(this._diag.warn(`disallowing ${e} because the maximum number of ${this._maxAllowed[e].toString()} has already been reached for this session`),this._incrDiagnosticCount(e,`drop`),!0):(this._currentCount[e]=(this._currentCount[e]||0)+1,!1)}truncateString(e,t){return t.length>this._maxLength[e]?(this._diag.warn(`truncating ${e} because it is longer than ${this._maxLength[e].toString()} characters: "${t}"`),this._incrDiagnosticCount(e,`truncate_string`),t.substring(0,this._maxLength[e])):t}_truncateAttributes(e,t,n,r){let i=Object.keys(t);i.length>this._maxAttributes[e]&&(this._diag.warn(`truncating ${e} attributes because there are more than ${this._maxAttributes[e].toString()} set`),this._incrDiagnosticCount(e,`truncate_attributes`));let a={};for(let s=0;s<Math.min(i.length,this._maxAttributes[e]);s++){var o;let e=this.truncateString(n,i[s]);a[e]=this.truncateString(r,((o=t[i[s]])==null?void 0:o.toString())||``)}return a}limitBreadcrumb(e){return this._dropIfMaxReached(`breadcrumb`)?`dropped`:{name:this.truncateString(`breadcrumb`,e)}}limitException(e,t){return this._dropIfMaxReached(`exception`)?`dropped`:{message:this.truncateString(`exception`,e),attributes:this._truncateAttributes(`exception`,t,`exception_attribute_key`,`exception_attribute_value`)}}limitLog(e,t,n){let r=Eo[t];return this._dropIfMaxReached(r)?`dropped`:{message:this.truncateString(r,e),attributes:this._truncateAttributes(r,n,`log_attribute_key`,`log_attribute_value`)}}limitSessionProperty(e,t){return this._dropIfMaxReached(`session_property`)?`dropped`:{key:this.truncateString(`session_property_key`,e),value:this.truncateString(`session_property_value`,t)}}limitElementTimingEntry(){return this._dropIfMaxReached(`element_timing`)}limitServerTimingEntry(){return this._dropIfMaxReached(`server_timing`)}limitUserTimingEntry(e){return this._dropIfMaxReached(e===`mark`?`user_timing_mark`:`user_timing_measure`)}dropReadableSpan(e){let t=e.attributes[`mxl.type`]===`perf.network_request`?`network_request`:`span`;return this._dropIfMaxReached(t)}reset(){this._diagnosticCounts={},this._currentCount={exception:0,error_log:0,warning_log:0,info_log:0,breadcrumb:0,session_property:0,span:0,network_request:0,element_timing:0,server_timing:0,user_timing_mark:0,user_timing_measure:0}}_incrDiagnosticCount(e,t){let n=`mxl.app.applied_limit.${e}.${t}.count`;this._diagnosticCounts[n]=(this._diagnosticCounts[n]||0)+1}getDiagnosticCounts(){return this._diagnosticCounts}};let Oo=()=>JSON.stringify(Ot._MXLFileBundleIDs||Ot._MXLFileBundleIDs||{});var ko=class e{constructor({diag:e,perf:t,spanSessionManager:n,limitManager:r,loggerProvider:i,visibilityDoc:a=window.document,storage:o=window.localStorage}){R(this,`_diag`,void 0),R(this,`_perf`,void 0),R(this,`_logger`,void 0),R(this,`_spanSessionManager`,void 0),R(this,`_limitManager`,void 0),R(this,`_visibilityDoc`,void 0),R(this,`_storage`,void 0);let s=i==null?Ya:i;this._diag=e==null?I.createComponentLogger({namespace:`MXLLogManager`}):e,this._perf=t==null?new wi:t,this._logger=s.getLogger(`mxl-web-sdk-logs`),this._spanSessionManager=n,this._limitManager=r,this._visibilityDoc=a,this._storage=o}_validateAttributes(e){return Object.prototype.toString.call(e)===`[object Object]`?e:(this._diag.warn(`attributes must be a plain object`,e),{})}static _logSeverityToSeverityNumber(e){switch(e){case`info`:return Ba.INFO;case`warning`:return Ba.WARN;default:return Ba.ERROR}}logException(t,{handled:n=!0,attributes:r={},timestamp:i=this._perf.getNowMillis(),handler:a=`manual`}={}){var o;let s=this._validateAttributes(r);n||this._spanSessionManager.incrSessionCountForKey(`mxl.unhandled_exceptions_count`);let c=(t==null||(o=t.constructor)==null?void 0:o.name)||typeof t,l=``,u=c,d=``,f=``;if(t instanceof Error)l=String(t.message||``).trim(),u=t.name||``,d=t.stack||``,f=t.cause?`present`:``;else if(t&&typeof t==`object`)try{l=JSON.stringify(t)}catch(e){l=String(t).trim()}else l=String(t).trim();let p=this._limitManager.limitException(l,s);p!==`dropped`&&this._logger.emit({timestamp:i,severityNumber:Ba.ERROR,severityText:`ERROR`,body:p.message,attributes:V(V({},p.attributes),{},{[vt]:`sys.exception`,"mxl.exception_handling":e._exceptionHandlingType(n,a),"mxl.exception_cause":f,[nn]:c,"exception.name":u,[en]:p.message,[tn]:d,[St]:Oo(),[yt]:Dt(this._visibilityDoc),"mxl.exception_number":_t(this._storage,`mxl_exception_number`,this._diag)})})}message(e,t,{attributes:n={},includeStacktrace:r=!0,stacktrace:i}={}){if(typeof e!=`string`||!e.trim()){this._diag.warn(`Message must be a non-empty string`);return}if(![`info`,`warning`,`error`].includes(t)){this._diag.warn(`Severity must be info, warning, or error`);return}let a=this._validateAttributes(n);t===`error`&&this._spanSessionManager.incrSessionCountForKey(`mxl.error_log_count`);let o=``;t!==`info`&&(typeof i==`string`?o=i:r&&(o=Error().stack||``)),this._logMessage({message:e.trim(),severity:t,timestamp:this._perf.getNowMillis(),attributes:a,stack:o})}_logMessage({message:t,severity:n,timestamp:r,attributes:i={},stack:a}){let o=this._limitManager.limitLog(t,n,i);o!==`dropped`&&this._logger.emit({timestamp:r,severityNumber:e._logSeverityToSeverityNumber(n),severityText:n.toUpperCase(),body:o.message,attributes:V(V(V({},o.attributes),{},{[vt]:`sys.log`},a?{"mxl.stacktrace.js":a,[St]:Oo()}:{}),{},{[yt]:Dt(this._visibilityDoc)})})}static _exceptionHandlingType(e,t){return e?`handled`:t===`global_exception`?`unhandled_error`:t===`promise_rejection`?`unhandled_rejection`:`unhandled`}},Ao=class{constructor({useDocumentTitleAsPageLabel:e=!0,titleDocument:t=window.document}={}){R(this,`_currentRoute`,null),R(this,`_currentPageId`,null),R(this,`_pageLabel`,null),R(this,`_titleDocument`,void 0),R(this,`_useDocumentTitleAsPageLabel`,void 0),R(this,`getCurrentPageId`,()=>this._currentPageId),R(this,`getCurrentRoute`,()=>this._currentRoute),R(this,`setPageLabel`,e=>{this._pageLabel=e}),R(this,`getPageLabel`,()=>this._pageLabel||(!this._useDocumentTitleAsPageLabel||!this._titleDocument?null:this._titleDocument.title)),R(this,`setCurrentRoute`,e=>{(!this._currentRoute||this._currentRoute.url!==e.url)&&(this._currentPageId=ht()),this._currentRoute=e,e.label?this._pageLabel=e.label:this._pageLabel=null}),R(this,`clearCurrentRoute`,()=>{this._currentRoute=null,this._currentPageId=null,this._pageLabel=null}),this._useDocumentTitleAsPageLabel=e,this._titleDocument=t}},jo=class{constructor({dynamicConfigManager:e,deviceId:t,blockNetworkSpanForwarding:n}){R(this,`_dynamicConfigManager`,void 0),R(this,`_deviceId`,void 0),R(this,`_blockNetworkSpanForwarding`,void 0),this._dynamicConfigManager=e,this._deviceId=t,this._blockNetworkSpanForwarding=n}isSDKEnabled(){let e=this._dynamicConfigManager.getConfig();return kt(this._deviceId,e.samplingPct)}isNetworkSpanForwardingEnabled(){if(this._blockNetworkSpanForwarding)return!1;let e=this._dynamicConfigManager.getConfig();return kt(this._deviceId,e.networkSpansForwardingThreshold)}isEmptySessionAvoidanceEnabled(){let e=this._dynamicConfigManager.getConfig();return kt(this._deviceId,e.emptySessionAvoidanceEnabledPct)}},Mo=class{constructor(e){R(this,`_span`,void 0),this._span=e}get attributes(){return this._span.attributes}addEvent(e,t,n){return this._span.addEvent(e,t,n),this}addLink(e){return this._span.addLink(e),this}addLinks(e){return this._span.addLinks(e),this}end(e){this._span.end(e)}isRecording(){return this._span.isRecording()}recordException(e,t){this._span.recordException(e,t)}setAttribute(e,t){return this._span.setAttribute(e,t),this}setAttributes(e){return this._span.setAttributes(e),this}removeAttribute(e){let t=this._span.attributes,{[e]:n}=t,r=Ei(t,[e].map(Vt));return this._span.attributes=r,this}setStatus(e){return this._span.setStatus(e),this}spanContext(){return this._span.spanContext()}updateName(e){return this._span.updateName(e),this}fail(e={code:`failure`}){e.code&&this._span.setAttribute(`mxl.error_code`,e.code.toUpperCase()),this._span.end(e.endTime)}};let No=`mxl_tab`,Po=`mxl_tab_activity`;var Fo=class{constructor({diag:e,perf:t,visibilityDoc:n=window.document,storage:r=window.localStorage,sessionStorage:i=window.sessionStorage,limitManager:a,referrer:o=document.referrer,navigationPerformance:s=window.performance}){R(this,`_previousSessionId`,null),R(this,`_activeSessionId`,null),R(this,`_activeSessionStartTime`,null),R(this,`_sessionSpan`,null),R(this,`_activeSessionCounts`,null),R(this,`_nextSessionCounts`,{}),R(this,`_coldStart`,!0),R(this,`_sdkStartupDuration`,0),R(this,`_sessionStartedListeners`,[]),R(this,`_sessionEndedListeners`,[]),R(this,`_tab`,void 0),R(this,`_navigationSource`,void 0),R(this,`_referrerInfo`,void 0),R(this,`_tracer`,void 0),R(this,`_noExportTracer`,void 0),R(this,`_diag`,void 0),R(this,`_perf`,void 0),R(this,`_visibilityDoc`,void 0),R(this,`_storage`,void 0),R(this,`_sessionStorage`,void 0),R(this,`_limitManager`,void 0),R(this,`_referrer`,void 0),R(this,`_navigationPerformance`,void 0),this._diag=e==null?I.createComponentLogger({namespace:`MXLSpanSessionManager`}):e,this._perf=t==null?new wi:t,this._visibilityDoc=n,this._storage=r,this._sessionStorage=i,this._limitManager=a,this._referrer=o,this._navigationPerformance=s,this._tracer=L.getTracer(`mxl-web-sdk-sessions`),this._noExportTracer=new ri().getTracer(`mxl-web-sdk-sessions`),this._referrerInfo=this._processReferrer();let c=this._initTab();this._tab=c.tab,this._navigationSource=c.navigationSource,this._setupNewTabClickListeners()}_getPermanentAttributes(){let e=new Map;try{for(let t=0;t<this._storage.length;t++){let n=this._storage.key(t);if(n!=null&&n.startsWith(`mxl.properties.`)){let t=this._storage.getItem(n);t&&e.set(n,t)}}}catch(e){this._diag.warn(`Error loading permanent session properties`,e)}return Object.fromEntries(e.entries())}addBreadcrumb(e){if(!this._sessionSpan){this._diag.debug(`trying to add breadcrumb to a session, but there is no session in progress. This is a no-op.`);return}let t=this._limitManager.limitBreadcrumb(e);t!==`dropped`&&this._sessionSpan.addEvent(`mxl-breadcrumb`,{message:t.name},this._perf.getNowMillis())}addProperty(e,t,n){if(!this._sessionSpan){this._diag.debug(`trying to add properties to a session, but there is no session in progress. This is a no-op.`);return}let r=this._limitManager.limitSessionProperty(e,t);if(r===`dropped`)return;let i=bt+r.key;if(this._sessionSpan.setAttribute(i,r.value),(n==null?void 0:n.lifespan)===`permanent`)try{this._storage.setItem(i,t)}catch(e){this._diag.warn(`Failed to set permanent session property`,e)}}removeProperty(e){if(!this._sessionSpan){this._diag.debug(`trying to remove a session property, but there is no session in progress. This is a no-op.`);return}let t=bt+this._limitManager.truncateString(`session_property_key`,e);this._sessionSpan.removeAttribute(t);try{this._storage.getItem(t)&&this._storage.removeItem(t)}catch(e){this._diag.warn(`Error removing permanent session property`,e)}}endSessionSpan(){this.endSessionSpanInternal(`manual`)}endSessionSpanInternal(e){if(!this._sessionSpan){this._diag.debug(`trying to end a session, but there is no session in progress. This is a no-op.`);return}for(let e of this._sessionEndedListeners)try{e()}catch(e){this._diag.warn(`Error while executing session ended listener`,e)}this._sessionSpan.setAttributes(this._endSessionSpanAttributes(e)),this._sessionSpan.end(),this._sessionSpan=null,this._activeSessionStartTime=null,this._previousSessionId=this._activeSessionId,this._activeSessionId=null,this._activeSessionCounts=null,this._limitManager.reset()}_endSessionSpanAttributes(e){return V(V(V(V({},this._getPermanentAttributes()),{},{"mxl.session_end_type":e},this._activeSessionCounts),this._limitManager.getDiagnosticCounts()),{},{"mxl.sdk_startup_duration":this._sdkStartupDuration})}currentSessionAsReadableSpan(e){if(!this._sessionSpan||!this._activeSessionStartTime)return this._diag.debug(`trying to end a session, but there is no session in progress. This is a no-op.`),null;let t=this._noExportTracer.startSpan(`mxl-session`,{startTime:this._activeSessionStartTime,attributes:V(V(V({},this._sessionSpan.attributes),this._endSessionSpanAttributes(e)),{},{"mxl.from_storage":!0})});return t.end(),t}getSessionId(){return this._activeSessionId}getPreviousSessionId(){return this._previousSessionId}getSessionSpan(){return this._sessionSpan}getSessionStartTime(){return this._activeSessionStartTime}startSessionSpan(e){var t;this._sessionSpan&&this.endSessionSpanInternal(`manual`),this._activeSessionId=ht(),this._activeSessionStartTime=this._perf.getNowHRTime(),this._activeSessionCounts={};let n=this._nextSessionCounts;this._nextSessionCounts={};let r=V(V({},this._getPermanentAttributes()),{},{[vt]:`ux.session`,[yt]:Dt(this._visibilityDoc),[Ra]:this._activeSessionId,"mxl.cold_start":this._coldStart,"mxl.session_number":_t(this._storage,`mxl_session_number`,this._diag),"mxl.experience_id":this._tab.experienceId,"mxl.tab_id":this._tab.tabId,"mxl.navigation_source":this._navigationSource},n);this._referrerInfo.isValid&&this._referrerInfo.scrubbedUrl&&(r[`mxl.referrer_url`]=this._referrerInfo.scrubbedUrl),this._tab.sourceTabId&&(r[`mxl.source_tab_id`]=this._tab.sourceTabId),r[`mxl.session_start_type`]=(t=e==null?void 0:e.reason)==null?`manual`:t,this._sessionSpan=new Mo(this._tracer.startSpan(`mxl-session`,{attributes:r})),this._coldStart=!1;for(let e of this._sessionStartedListeners)try{e()}catch(e){this._diag.warn(`Error while executing session started listener`,e)}}incrSessionCountForKey(e){if(!this._sessionSpan||!this._activeSessionCounts){this._diag.debug(`trying to increment a count for the active session, but there is no session in progress. This is a no-op.`);return}this._activeSessionCounts[e]=(this._activeSessionCounts[e]||0)+1}incrNextSessionCountForKey(e){this._nextSessionCounts[e]=(this._nextSessionCounts[e]||0)+1}addSessionStartedListener(e){let t=this._sessionStartedListeners.push(e);return()=>{this._sessionStartedListeners.splice(t-1,1)}}addSessionEndedListener(e){let t=this._sessionEndedListeners.push(e);return()=>{this._sessionEndedListeners.splice(t-1,1)}}recordSDKStartupDuration(e){this._sdkStartupDuration=Math.ceil(e)}setTracerProvider(e){this._tracer=e.getTracer(`mxl-web-sdk-sessions`)}_determineNavigationSource(){try{let e=this._navigationPerformance.getEntriesByType(`navigation`);if(e.length>0&&e[0]){let t=e[0];if(t.type===`reload`)return`reload`;if(t.type===`back_forward`)return`back_forward`}}catch(e){this._diag.warn(`Failed to get navigation type`,e)}return this._referrerInfo.isValid?this._referrerInfo.isSameOrigin?`same_origin`:`external`:`direct`}_processReferrer(){if(!this._referrer)return{isValid:!1,isSameOrigin:!1};try{let e=new URL(this._referrer),t=window.location.origin;return{isValid:!0,isSameOrigin:e.origin===t,scrubbedUrl:e.origin+e.pathname}}catch(e){return{isValid:!1,isSameOrigin:!1}}}_getTabContext(e){let t=vo(this._sessionStorage,this._diag),n,r;if(e===`same_origin`){let e=this._getTabActivity();e&&Date.now()-e.lastActivityMs<=1e4&&(n=e.tabId,r=e.experienceId)}return r!=null||(r=ht()),{sourceTabId:n,experienceId:r,tabId:t}}_initTab(){let e=this._determineNavigationSource();try{let t=this._sessionStorage.getItem(No);if(t)return{tab:JSON.parse(t),navigationSource:e}}catch(e){this._diag.warn(`Failed to retrieve tab data`,e)}let t=this._getTabContext(e),n={experienceId:t.experienceId,sourceTabId:t.sourceTabId,tabId:t.tabId};try{this._sessionStorage.setItem(No,JSON.stringify(n))}catch(e){this._diag.warn(`Failed to store tab data`,e)}return{tab:n,navigationSource:e}}_getTabActivity(){try{let e=this._storage.getItem(Po);return e?JSON.parse(e):null}catch(e){return this._diag.warn(`Failed to retrieve tab activity`,e),null}}_storeTabActivity(e){try{this._storage.setItem(Po,JSON.stringify(e))}catch(e){this._diag.warn(`Failed to save tab activity`,e)}}_storeCurrentTabAsSource(){let e={tabId:this._tab.tabId,experienceId:this._tab.experienceId,lastActivityMs:Date.now()};this._storeTabActivity(e)}_setupNewTabClickListeners(){let e=e=>{var t;if(e.button===1||e.ctrlKey||e.metaKey||e.shiftKey){this._storeCurrentTabAsSource();return}(t=e.target)!=null&&t.closest(`a[target="_blank"], form[target="_blank"], a[rel*="noopener"], a[rel*="noreferrer"]`)&&this._storeCurrentTabAsSource()},t={capture:!0,passive:!0};document.addEventListener(`auxclick`,e,t),document.addEventListener(`click`,e,t)}},Io=class{constructor({tracerProvider:e}={}){R(this,`_tracer`,void 0),R(this,`setSpan`,L.setSpan);let t=e==null?L:e;this._tracer=t.getTracer(`mxl-web-sdk-traces`)}startSpan(e,t={},n){t.attributes=t.attributes?t.attributes:{},t.attributes[vt]=`perf`;let r=t.parentSpan?L.setSpan(F.active(),t.parentSpan):n;return new Mo(this._tracer.startSpan(e,t,r))}getSpan(e){let t=L.getSpan(e);if(t)return new Mo(t)}};let Lo=`mxl_user`,Ro=`mxl_user_id`,zo=`mxl_external_user_id`,Bo=e=>typeof e[`enduser.pseudo.id`]==`string`&&e[`enduser.pseudo.id`].length===32,Vo=e=>typeof e==`string`&&e.length===32;var Ho=class{constructor({diag:e,storage:t=window.localStorage}={}){R(this,`_diag`,void 0),R(this,`_storage`,void 0),R(this,`_mxlUserId`,null),this._diag=e==null?I.createComponentLogger({namespace:`MXLUserManager`}):e,this._storage=t,this._migrateOldLocalStorageKey(),this._initialSetup()}getMXLUserId(){return this._mxlUserId||this._generateNewMXLUserId()}setMXLUserId(e){this._mxlUserId=e;try{this._storage.setItem(Ro,e)}catch(e){this._diag.warn(`Failed to persist user object for storage, keeping it in-memory only`,e)}}clearMXLUserId(){this._mxlUserId=null;try{this._storage.removeItem(Ro)}catch(e){this._diag.warn(`Failed to remove mxl user in storage`,e)}}_migrateOldLocalStorageKey(){try{let e=this._storage.getItem(Lo);if(e){let t=JSON.parse(e);Bo(t)?(this._diag.debug(`Migrating old user data from storage`),this._storage.setItem(Ro,t[`enduser.pseudo.id`]),this._storage.removeItem(Lo)):(this._diag.warn(`Invalid user data found in storage, clearing old user data`),this._storage.removeItem(Lo))}}catch(e){this._diag.warn(`Failed to get old user data from storage`,e)}}_initialSetup(){try{let e=this._storage.getItem(Ro);e?Vo(e)?this._mxlUserId=e:(this._diag.warn(`Invalid mxl user id, generating a new one`),this.clearMXLUserId()):this._diag.debug(`No existing user found in storage, creating a new one`)}catch(e){this._diag.warn(`Failed to get mxl user id from storage, defaulting to a new one`,e)}this._mxlUserId||(this._mxlUserId=this._generateNewMXLUserId())}_generateNewMXLUserId(){let e=ht();return this.setMXLUserId(e),e}getUserId(){try{return this._storage.getItem(zo)}catch(e){return this._diag.warn(`Failed to retrieve user id from storage`,e),null}}setUserId(e){try{this._storage.setItem(zo,e)}catch(e){this._diag.warn(`Failed to store user id`,e)}}clearUserId(){try{this._storage.removeItem(zo)}catch(e){this._diag.warn(`Failed to clear user id`,e)}}};let Uo=[`keydown`,`mousedown`,`mousemove`,`scroll`];var Wo=class extends Za{constructor({diag:e}={}){super({instrumentationName:`SpanSessionBrowserActivityInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,config:{}}),R(this,`_onActivityThrottled`,void 0),R(this,`_activityTimeout`,void 0),R(this,`disable`,()=>{dt({target:window,events:Uo,callback:this._onActivityThrottled}),this._activityTimeout&&clearTimeout(this._activityTimeout),this._activityTimeout=null}),R(this,`enable`,()=>{ut({target:window,events:Uo,callback:this._onActivityThrottled})}),R(this,`_onInactivity`,()=>{this._diag.debug(`Inactivity detected`),this._activityTimeout&&clearTimeout(this._activityTimeout),this._activityTimeout=null,this.sessionManager.endSessionSpanInternal(`inactivity`)}),R(this,`_onActivity`,()=>{this._diag.debug(`Activity detected`),this._activityTimeout&&clearTimeout(this._activityTimeout),this.sessionManager.getSessionId()||this.sessionManager.startSessionSpan({reason:`activity`}),this._activityTimeout=setTimeout(this._onInactivity,18e5)}),this._activityTimeout=null,this._onActivityThrottled=ji(this._onActivity,3e4),this._config.enabled&&this.enable()}},Go=class extends Za{constructor({diag:e,perf:t,visibilityDoc:n=window.document}={}){super({instrumentationName:`SpanSessionVisibilityInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),R(this,`_onVisibilityChange`,void 0),this._onVisibilityChange=()=>{this._diag.debug(`Visibility change detected: ${n.visibilityState}`);try{this.sessionManager.endSessionSpanInternal(`state_changed`),n.visibilityState===`visible`&&(this._diag.debug(`Starting a session since document visibility switched to visible`),this.sessionManager.startSessionSpan({reason:`visible`}))}catch(e){this._diag.error(`Failed to rotate session on visibility change to ${n.visibilityState}`,e)}},this._config.enabled&&this.enable()}disable(){window.removeEventListener(`visibilitychange`,this._onVisibilityChange)}enable(){window.addEventListener(`visibilitychange`,this._onVisibilityChange)}};let Ko=`mxl.user_timing.start_time`,qo=`mxl.user_timing.duration`,Jo=`mxl.user_timing.entry_type`;var Yo=class extends Za{constructor({diag:e,perf:t,limitManager:n,allowedEntries:r}={}){super({instrumentationName:`UserTimingInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,limitManager:n,config:{}}),R(this,`_markObserver`,null),R(this,`_measureObserver`,null),R(this,`_seenEntries`,new Set),R(this,`_isEnabled`,!1),R(this,`_allowedEntries`,void 0),this._allowedEntries=r,this._config.enabled&&this.enable()}enable(){this._isEnabled||(this._isEnabled=!0,this._seenEntries=new Set,this._markObserver&&this._markObserver.disconnect(),this._measureObserver&&this._measureObserver.disconnect(),this._markObserver=Ai(`mark`,this._processEntry.bind(this),{diag:this._diag}),this._markObserver||this._diag.error(`failed to enable mark observer`),this._measureObserver=Ai(`measure`,e=>this._processEntry(e),{diag:this._diag}),this._measureObserver||this._diag.error(`failed to enable measure observer`),!this._markObserver&&!this._measureObserver&&(this._isEnabled=!1))}disable(){this._isEnabled=!1,this._markObserver&&(this._markObserver.disconnect(),this._markObserver=null),this._measureObserver&&(this._measureObserver.disconnect(),this._measureObserver=null),this._seenEntries=new Set}_processEntry(e){var t;if(!this._isEnabled||this._allowedEntries!==void 0&&!(Array.isArray(this._allowedEntries)?this._allowedEntries.includes(e.name):this._allowedEntries(e)))return;let n=`${location.href}::${e.name}`;if(this._seenEntries.has(n)||(this._seenEntries.add(n),(t=this.limitManager)!=null&&t.limitUserTimingEntry(e.entryType)))return;if(e.entryType===`measure`){let t=e.detail;this.tracer.startSpan(e.name,{startTime:this.perf.epochMillisFromOriginOffset(e.startTime),attributes:V({[vt]:`ux.user_timing`,[xt]:`user_timing`,[Jo]:e.entryType,[Ko]:this.perf.millisFromZeroTime(e.startTime),[qo]:e.duration},t!=null&&{"mxl.user_timing.detail":JSON.stringify(t)})}).end(this.perf.epochMillisFromOriginOffset(e.startTime+e.duration));return}let r=e.detail,i=r==null?void 0:JSON.stringify(r);this.logger.emit({timestamp:this.perf.epochMillisFromOriginOffset(e.startTime),eventName:`mxl-user-timing`,severityNumber:Ba.INFO,attributes:{[vt]:`ux.user_timing`,"mxl.user_timing.name":e.name,[Ko]:this.perf.millisFromZeroTime(e.startTime),[qo]:e.duration,[Jo]:e.entryType},body:i})}};let Xo=`mxl.web_vital.attribution.`;var Zo=class{constructor(){R(this,`t`,void 0),R(this,`o`,0),R(this,`i`,[])}u(e){var t;if(e.hadRecentInput)return;let n=this.i[0],r=this.i.at(-1);this.o&&n&&r&&e.startTime-r.startTime<1e3&&e.startTime-n.startTime<5e3?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),(t=this.t)==null||t.call(this,e)}};let Qo=()=>{let e=performance.getEntriesByType(`navigation`)[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},$o=e=>{if(document.readyState===`loading`)return`loading`;let t=Qo();if(t){if(e<t.domInteractive)return`loading`;if(t.domContentLoadedEventStart===0||e<t.domContentLoadedEventStart)return`dom-interactive`;if(t.domComplete===0||e<t.domComplete)return`dom-content-loaded`}return`complete`},es=e=>{let t=e.nodeName;return e.nodeType===1?t.toLowerCase():t.toUpperCase().replace(/^#/,``)},ts=e=>{let t=``;try{for(;(e==null?void 0:e.nodeType)!==9;){let n=e,r=n.id?`#`+n.id:[es(n),...Array.from(n.classList).sort()].join(`.`);if(t.length+r.length>99)return t||r;if(t=t?r+`>`+t:r,n.id)break;e=n.parentNode}}catch(e){}return t},ns=new WeakMap;function rs(e,t){return ns.get(e)||ns.set(e,new t),ns.get(e)}let is=-1,as=()=>is,os=e=>{addEventListener(`pageshow`,t=>{t.persisted&&(is=t.timeStamp,e(t))},!0)},ss=(e,t,n,r)=>{let i,a;return o=>{var s;t.value>=0&&(o||r)&&(a=t.value-((s=i)==null?0:s),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?`poor`:e>t[0]?`needs-improvement`:`good`)(t.value,n),e(t)))}},cs=e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},ls=()=>{var e,t;return(e=(t=Qo())==null?void 0:t.activationStart)==null?0:e},us=(e,t=-1)=>{let n=Qo(),r=`navigate`;return as()>=0?r=`back-forward-cache`:n&&(document.prerendering||ls()>0?r=`prerender`:document.wasDiscarded?r=`restore`:n.type&&(r=n.type.replace(/_/g,`-`))),{name:e,value:t,rating:`good`,delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+0xe8d4a51000}`,navigationType:r}},ds=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{queueMicrotask(()=>{t(e.getEntries())})});return r.observe(V({type:e,buffered:!0},n)),r}}catch(e){}},fs=e=>{let t=!1;return()=>{t||(e(),t=!0)}},ps=-1,ms=new Set,hs=()=>document.visibilityState!==`hidden`||document.prerendering?1/0:0,gs=e=>{if(document.visibilityState===`hidden`){if(e.type===`visibilitychange`)for(let e of ms)e();isFinite(ps)||(ps=e.type===`visibilitychange`?e.timeStamp:0,removeEventListener(`prerenderingchange`,gs,!0))}},_s=()=>{if(ps<0){var e;let t=ls(),n=document.prerendering||(e=globalThis.performance.getEntriesByType(`visibility-state`).find(e=>e.name===`hidden`&&e.startTime>=t))==null?void 0:e.startTime;ps=n==null?hs():n,addEventListener(`visibilitychange`,gs,!0),addEventListener(`prerenderingchange`,gs,!0),os(()=>{setTimeout(()=>{ps=hs()})})}return{get firstHiddenTime(){return ps},onHidden(e){ms.add(e)}}},vs=e=>{document.prerendering?addEventListener(`prerenderingchange`,e,!0):e()},ys=[1800,3e3],bs=(e,t={})=>{vs(()=>{let n=_s(),r,i=us(`FCP`),a=ds(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-ls(),0),i.entries.push(t),r(!0)))});a&&(r=ss(e,i,ys,t.reportAllChanges),os(n=>{i=us(`FCP`),r=ss(e,i,ys,t.reportAllChanges),cs(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},xs=[.1,.25],Ss=e=>e.find(e=>{var t;return((t=e.node)==null?void 0:t.nodeType)===1})||e[0],Cs=(e,t={})=>{let n=rs(t=Object.assign({},t),Zo),r=new WeakMap;n.t=e=>{var n;if(!(e==null||(n=e.sources)==null)&&n.length){let n=Ss(e.sources),o=n==null?void 0:n.node;if(o){var i,a;let e=(i=(a=t.generateTarget)==null?void 0:a.call(t,o))==null?ts(o):i;r.set(n,e)}}},((e,t={})=>{let n=_s();bs(fs(()=>{let r,i=us(`CLS`,0),a=rs(t,Zo),o=e=>{for(let t of e)a.u(t);a.o>i.value&&(i.value=a.o,i.entries=a.i,r())},s=ds(`layout-shift`,o);s&&(r=ss(e,i,xs,t.reportAllChanges),n.onHidden(()=>{o(s.takeRecords()),r(!0)}),os(()=>{a.o=0,i=us(`CLS`,0),r=ss(e,i,xs,t.reportAllChanges),cs(r)}),setTimeout(r))}))})(t=>{e((e=>{let t={};if(e.entries.length){var n;let i=e.entries.reduce((e,t)=>e.value>t.value?e:t);if(!(i==null||(n=i.sources)==null)&&n.length){let e=Ss(i.sources);e&&(t={largestShiftTarget:r.get(e),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:e,largestShiftEntry:i,loadState:$o(i.startTime)})}}return Object.assign(e,{attribution:t})})(t))},t)},ws=(e,t={})=>{bs(t=>{e((e=>{let t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:$o(as())};if(e.entries.length){let n=Qo(),r=e.entries.at(-1);if(n){let i=n.activationStart||0,a=Math.max(0,n.responseStart-i);t={timeToFirstByte:a,firstByteToFCP:e.value-a,loadState:$o(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})})(t))},t)},Ts=0,Es=1/0,Ds=0,Os=e=>{for(let t of e)t.interactionId&&(Es=Math.min(Es,t.interactionId),Ds=Math.max(Ds,t.interactionId),Ts=Ds?(Ds-Es)/7+1:0)},ks,As=()=>{var e;return ks?Ts:(e=performance.interactionCount)==null?0:e},js=()=>{`interactionCount`in performance||ks||(ks=ds(`event`,Os,{durationThreshold:0}))},Ms=0;var Ns=class{constructor(){R(this,`l`,[]),R(this,`h`,new Map),R(this,`m`,void 0),R(this,`p`,void 0)}v(){Ms=As(),this.l.length=0,this.h.clear()}M(){let e=Math.min(this.l.length-1,Math.floor((As()-Ms)/50));return this.l[e]}u(e){var t;if((t=this.m)==null||t.call(this,e),!e.interactionId&&e.entryType!==`first-input`)return;let n=this.l.at(-1),r=this.h.get(e.interactionId);if(r||this.l.length<10||e.duration>n.T){var i;if(r?e.duration>r.T?(r.entries=[e],r.T=e.duration):e.duration===r.T&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],T:e.duration},this.h.set(r.id,r),this.l.push(r)),this.l.sort((e,t)=>t.T-e.T),this.l.length>10){let e=this.l.splice(10);for(let t of e)this.h.delete(t.id)}(i=this.p)==null||i.call(this,r)}}};let Ps=e=>{let t=globalThis.requestIdleCallback||setTimeout,n=globalThis.cancelIdleCallback||clearTimeout;if(document.visibilityState===`hidden`)e();else{let r=fs(e),i=-1,a=()=>{n(i),r()};addEventListener(`visibilitychange`,a,{once:!0,capture:!0}),i=t(()=>{removeEventListener(`visibilitychange`,a,{capture:!0}),r()})}},Fs=[200,500],Is=(e,t={})=>{let n=rs(t=Object.assign({},t),Ns),r=[],i=[],a=0,o=new WeakMap,s=new WeakMap,c=!1,l=()=>{c||(Ps(u),c=!0)},u=()=>{let e=new Set(n.l.map(e=>o.get(e.entries[0]))),t=i.length-10;i=i.filter((n,r)=>r>=t||e.has(n));let s=new Set;for(let e of i){let t=d(e.startTime,e.processingEnd);for(let e of t)s.add(e)}r=r.filter(e=>e.startTime>a||s.has(e)),c=!1};n.m=e=>{let n=e.startTime+e.duration,r;a=Math.max(a,e.processingEnd);for(let a=i.length-1;a>=0;a--){let o=i[a];if(Math.abs(n-o.renderTime)<=8){r=o,r.startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),!1!==t.includeProcessedEventEntries&&r.entries.push(e);break}}r||(r={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:!1===t.includeProcessedEventEntries?[]:[e]},i.push(r)),(e.interactionId||e.entryType===`first-input`)&&o.set(e,r),l()},n.p=e=>{if(!s.get(e)){let i=e.entries[0].target;if(i){var n,r;let a=(n=(r=t.generateTarget)==null?void 0:r.call(t,i))==null?ts(i):n;s.set(e,a)}}};let d=(e,t)=>{let n=[];for(let i of r)if(!(i.startTime+i.duration<e)){if(i.startTime>t)break;n.push(i)}return n},f=e=>{let t=e.entries[0],r=o.get(t),i=t.processingStart,a=Math.max(t.startTime+t.duration,i),c=Math.min(r.processingEnd,a),l=r.entries.sort((e,t)=>e.processingStart-t.processingStart),u=d(t.startTime,c),f=n.h.get(t.interactionId),p={interactionTarget:s.get(f),interactionType:t.name.startsWith(`key`)?`keyboard`:`pointer`,interactionTime:t.startTime,nextPaintTime:a,processedEventEntries:l,longAnimationFrameEntries:u,inputDelay:i-t.startTime,processingDuration:c-i,presentationDelay:a-c,loadState:$o(t.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(e=>{var t;if(!((t=e.longAnimationFrameEntries)!=null&&t.length))return;let n=e.interactionTime,r=e.inputDelay,i=e.processingDuration,a,o,s=0,c=0,l=0,u=0;for(let t of e.longAnimationFrameEntries){c=c+t.startTime+t.duration-t.styleAndLayoutStart;for(let e of t.scripts){let t=e.startTime+e.duration;if(t<n)continue;let l=t-Math.max(n,e.startTime),d=e.duration?l/e.duration*e.forcedStyleAndLayoutDuration:0;s+=l-d,c+=d,l>u&&(o=e.startTime<n+r?`input-delay`:e.startTime>=n+r+i?`presentation-delay`:`processing-duration`,a=e,u=l)}}let d=e.longAnimationFrameEntries.at(-1),f=d?d.startTime+d.duration:0;f>=n+r+i&&(l=e.nextPaintTime-f),a&&o&&(e.longestScript={entry:a,subpart:o,intersectingDuration:u}),e.totalScriptDuration=s,e.totalStyleAndLayoutDuration=c,e.totalPaintDuration=l,e.totalUnattributedDuration=e.nextPaintTime-n-s-c-l})(p),Object.assign(e,{attribution:p})};ds(`long-animation-frame`,e=>{r=r.concat(e),l()}),((e,t={})=>{if(!globalThis.PerformanceEventTiming||!(`interactionId`in PerformanceEventTiming.prototype))return;let n=_s();vs(()=>{var r;js();let i,a=us(`INP`),o=rs(t,Ns),s=e=>{Ps(()=>{for(let t of e)o.u(t);let t=o.M();t&&t.T!==a.value&&(a.value=t.T,a.entries=t.entries,i())})},c=ds(`event`,s,{durationThreshold:(r=t.durationThreshold)==null?40:r});i=ss(e,a,Fs,t.reportAllChanges),c&&(c.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{s(c.takeRecords()),i(!0)}),os(()=>{o.v(),a=us(`INP`),i=ss(e,a,Fs,t.reportAllChanges)}))})})(t=>{e(f(t))},t)};var Ls=class{constructor(){R(this,`m`,void 0)}u(e){var t;(t=this.m)==null||t.call(this,e)}};let Rs=[2500,4e3],zs=(e,t={})=>{let n=rs(t=Object.assign({},t),Ls),r=new WeakMap;n.m=e=>{let n=e.element;if(n){var i,a;let o=(i=(a=t.generateTarget)==null?void 0:a.call(t,n))==null?ts(n):i;r.set(e,o)}else e.id&&r.set(e,`#${e.id}`)},((e,t={})=>{vs(()=>{let n=_s(),r,i=us(`LCP`),a=rs(t,Ls),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(let t of e)a.u(t),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-ls(),0),i.entries=[t],r())},s=ds(`largest-contentful-paint`,o);if(s){r=ss(e,i,Rs,t.reportAllChanges);let n=fs(()=>{o(s.takeRecords()),s.disconnect(),r(!0)}),a=e=>{e.isTrusted&&(Ps(n),removeEventListener(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])addEventListener(e,a,{capture:!0});os(n=>{i=us(`LCP`),r=ss(e,i,Rs,t.reportAllChanges),cs(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})})(t=>{e((e=>{let t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){let n=e.entries.at(-1),i=n.url&&performance.getEntriesByType(`resource`).find(e=>e.name===n.url);t.target=r.get(n),t.lcpEntry=n,n.url&&(t.url=n.url),i&&(t.lcpResourceEntry=i);let a=Qo();if(a){let n=a.activationStart||0,r=Math.max(0,a.responseStart-n),o=Math.max(r,i?(i.requestStart||i.startTime)-n:0),s=Math.min(e.value,Math.max(o,i?i.responseEnd-n:0));t=V(V({},t),{},{timeToFirstByte:r,resourceLoadDelay:o-r,resourceLoadDuration:s-o,elementRenderDelay:e.value-s,navigationEntry:a})}}return Object.assign(e,{attribution:t})})(t))},t)},Bs=[800,1800],Vs=e=>{document.prerendering?vs(()=>Vs(e)):document.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>Vs(e),!0)},Hs=(e,t={})=>{((e,t={})=>{let n=us(`TTFB`),r=ss(e,n,Bs,t.reportAllChanges);Vs(()=>{let i=Qo();i&&(n.value=Math.max(i.responseStart-ls(),0),n.entries=[i],r(!0),os(()=>{n=us(`TTFB`,0),r=ss(e,n,Bs,t.reportAllChanges),r(!0)}))})})(t=>{e((e=>{let t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){let n=e.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),a=Math.max(n.domainLookupStart-r,0),o=Math.max(n.connectStart-r,0),s=Math.max(n.connectEnd-r,0);t={waitingDuration:i,cacheDuration:a-i,dnsDuration:o-a,connectionDuration:s-o,requestDuration:e.value-s,navigationEntry:n}}return Object.assign(e,{attribution:t})})(t))},t)},Us=[`CLS`,`INP`,`LCP`,`FCP`,`TTFB`],Ws={CLS:Cs,FCP:ws,LCP:zs,INP:Is,TTFB:Hs,FID:void 0},Gs=e=>{let t=typeof e;return t===`number`||t===`string`||t===`boolean`},Ks=e=>Math.round(Math.max(0,e)),qs=e=>{let t={},n=e.attribution;if(!n||typeof n!=`object`)return t;for(let[e,r]of Object.entries(n))Gs(r)&&(t[`${Xo}${e}`]=r);return t},Js=(e,t)=>{let n={},r=e.attribution;try{if(r.longAnimationFrameEntries.length>0){let e=new Map;for(let t of r.longAnimationFrameEntries)for(let n of t.scripts){let t=n.sourceURL||`(inline)`;t.length>2048&&(t=`${t.substring(0,2048)}...`);let r=e.get(t);r?(r.totalDuration+=n.duration,r.styleAndLayoutDuration+=n.forcedStyleAndLayoutDuration,r.count++):e.set(t,{totalDuration:n.duration,styleAndLayoutDuration:n.forcedStyleAndLayoutDuration,count:1})}e.size>0&&(n[`${Xo}loaf_scripts`]=JSON.stringify(Object.fromEntries([...e].sort((e,t)=>t[1].totalDuration-e[1].totalDuration).slice(0,250).map(([e,t])=>[e,{total_duration:Math.round(t.totalDuration),style_and_layout_duration:Math.round(t.styleAndLayoutDuration),count:t.count}]))))}}catch(e){t.error(`error building loaf scripts for INP`,e)}return n},Ys=(e,t)=>{let n={},r=e.attribution.navigationEntry;if(r)try{var i;let e=Ks(r.redirectEnd-r.redirectStart),t=Ks(r.domainLookupEnd-r.domainLookupStart),a=Ks(r.secureConnectionStart>0?r.secureConnectionStart-r.connectStart:r.connectEnd-r.connectStart),o=Ks(r.secureConnectionStart>0?r.connectEnd-r.secureConnectionStart:0),s=Ks(Math.max((i=r.finalResponseHeadersStart)==null?0:i,r.responseStart)-r.requestStart),c=Ks(Math.round(r.responseEnd-r.startTime)-e-t-a-o-s),l=Xo;n[`${l}redirect`]=e,n[`${l}domainLookup`]=t,n[`${l}tcpConnection`]=a,n[`${l}tlsNegotiation`]=o,n[`${l}serverResponse`]=s,n[`${l}unattributed`]=c}catch(e){t.error(`error computing TTFB timing breakdown`,e)}else t.debug(`TTFB navigationEntry unavailable, skipping timing breakdown`);return n};var Xs=class extends Za{constructor({diag:e,perf:t,listeners:n=Ws,urlDocument:r=window.document,urlAttribution:i=!0,pageManager:a}={}){super({instrumentationName:`WebVitalsInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),R(this,`_listeners`,void 0),R(this,`_urlDocument`,void 0),R(this,`_urlAttribution`,void 0),R(this,`_pageManager`,void 0),R(this,`_attributedPage`,{INP:void 0,LCP:void 0,CLS:void 0,FCP:void 0,TTFB:void 0}),R(this,`_largestShiftTargetForCLS`,void 0),R(this,`_listenersRegistered`,!1),R(this,`_isEnabled`,!1),this._listeners=n,this._urlDocument=r,this._urlAttribution=i,this._pageManager=a==null?Gi.getPageManager():a,this._config.enabled&&this.enable()}disable(){this._isEnabled=!1,this._diag.debug(`WebVitalsInstrumentation disabled, pausing emission`)}enable(){if(this._isEnabled=!0,this._listenersRegistered){this._diag.debug(`WebVitalsInstrumentation listeners already registered, resuming emission`);return}if(this._listenersRegistered=!0,Us.forEach(e=>{var t,n;(t=(n=this._listeners)[e])==null||t.call(n,t=>{if(!this._isEnabled)return;let n=this.sessionManager.getSessionSpan();if(!n)return;let r=this._getTimeForMetric(t),i=this._getAttributedPageForMetric(t),a=V(V(V({"mxl.type":`ux.web_vital`,"url.full":i.fullURL,"browser.url.full":i.fullURL,"mxl.web_vital.navigation_type":t.navigationType,"mxl.web_vital.name":t.name,"mxl.web_vital.rating":t.rating,"mxl.web_vital.id":t.id,"mxl.web_vital.delta":t.delta,"mxl.web_vital.value":t.value},qs(t)),e===`INP`?Js(t,this._diag):{}),e===`TTFB`?Ys(t,this._diag):{});i.path&&i.pageID&&(a[`app.surface.name`]=i.path,a[`app.surface.id`]=i.pageID),i.label&&(a[`app.surface.label`]=i.label),n.addEvent(`mxl-web-vitals-report-${e}`,a,r)})}),this._urlAttribution){var e,t,n,r,i,a,o,s,c,l;(e=(t=this._listeners).TTFB)==null||e.call(t,()=>{this._attributedPage.TTFB=this._currentAttributedPage()},{reportAllChanges:!0}),(n=(r=this._listeners).FCP)==null||n.call(r,()=>{this._attributedPage.FCP=this._currentAttributedPage()},{reportAllChanges:!0}),(i=(a=this._listeners).INP)==null||i.call(a,()=>{this._attributedPage.INP=this._currentAttributedPage()},{reportAllChanges:!0}),(o=(s=this._listeners).LCP)==null||o.call(s,()=>{this._attributedPage.LCP=this._currentAttributedPage()},{reportAllChanges:!0}),(c=(l=this._listeners).CLS)==null||c.call(l,e=>{let t=e;this._largestShiftTargetForCLS!==t.attribution.largestShiftTarget&&(this._largestShiftTargetForCLS=t.attribution.largestShiftTarget,this._attributedPage.CLS=this._currentAttributedPage())},{reportAllChanges:!0})}}_getTimeForMetric(e){return e.name===`CLS`&&e.attribution.largestShiftTime?this.perf.epochMillisFromOriginOffset(e.attribution.largestShiftTime):e.name===`INP`&&e.attribution.interactionTime?this.perf.epochMillisFromOriginOffset(e.attribution.interactionTime):this.perf.getNowMillis()}_currentAttributedPage(){let e={fullURL:this._urlDocument.URL},t=this._pageManager.getCurrentRoute(),n=this._pageManager.getCurrentPageId();t&&n&&(e.path=t.path,e.pageID=n);let r=this._pageManager.getPageLabel();return r&&(e.label=r),e}_getAttributedPageForMetric(e){return e.name===`FCP`&&this._attributedPage.FCP?this._attributedPage.FCP:e.name===`TTFB`&&this._attributedPage.TTFB?this._attributedPage.TTFB:e.name===`INP`&&this._attributedPage.INP?this._attributedPage.INP:e.name===`LCP`&&this._attributedPage.LCP?this._attributedPage.LCP:e.name===`CLS`&&this._attributedPage.CLS&&e.attribution.largestShiftTarget===this._largestShiftTargetForCLS?this._attributedPage.CLS:this._currentAttributedPage()}};function Zs(e){return Qs(e,new WeakSet)}function Qs(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>Qs(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>Qs(e,t))}return!1}var $s=class{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){R(this,`hrTime`,void 0),R(this,`hrTimeObserved`,void 0),R(this,`spanContext`,void 0),R(this,`resource`,void 0),R(this,`instrumentationScope`,void 0),R(this,`attributes`,{}),R(this,`_severityText`,void 0),R(this,`_severityNumber`,void 0),R(this,`_body`,void 0),R(this,`_eventName`,void 0),R(this,`_attributesCount`,0),R(this,`_droppedAttributesCount`,0),R(this,`_isReadonly`,!1),R(this,`_logRecordLimits`,void 0);let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:o,severityText:s,body:c,attributes:l={},exception:u,context:d}=n,f=Date.now();if(this.hrTime=xn(r==null?f:r),this.hrTimeObserved=xn(i==null?f:i),d){let e=L.getSpanContext(d);e&&ze(e)&&(this.spanContext=e)}this.severityNumber=o,this.severityText=s,this.body=c,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(l),u!=null&&this._setException(u)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return I.warn(`Invalid attribute key: ${e}`),this;if(!Zs(t))return I.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&I.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return I.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(en,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(nn,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(nn,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(en,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(tn,n.stack),t=!0)}t||I.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&I.warn(`Can not execute the operation on emitted log record`),this._isReadonly}},ec=class{constructor(e,t){R(this,`instrumentationScope`,void 0),R(this,`_sharedState`,void 0),R(this,`_loggerConfig`,void 0),this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){var t;let n=this._loggerConfig,r=e.context||F.active(),i=(t=e.severityNumber)==null?Ba.UNSPECIFIED:t;if(i!==Ba.UNSPECIFIED&&i<n.minimumSeverity)return;if(n.traceBased){let e=L.getSpanContext(r);if(e&&ze(e)&&(e.traceFlags&Te.SAMPLED)!==Te.SAMPLED)return}let a=new $s(this._sharedState,this.instrumentationScope,V({context:r},e));this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(a,r),a._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e==null?void 0:e.severityNumber;if(typeof n==`number`&&n!==Ba.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=(e==null?void 0:e.context)||F.active();if(t.traceBased){let e=L.getSpanContext(r);if(e&&ze(e)&&(e.traceFlags&Te.SAMPLED)!==Te.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e==null?void 0:e.severityNumber,eventName:e==null?void 0:e.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}},tc=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}},nc=class{constructor(e,t){R(this,`processors`,void 0),R(this,`forceFlushTimeoutMillis`,void 0),this.processors=e,this.forceFlushTimeoutMillis=t}forceFlush(){var e=this;return z(function*(){let t=e.forceFlushTimeoutMillis;yield Promise.all(e.processors.map(e=>fr(e.forceFlush(),t)))})()}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}shutdown(){var e=this;return z(function*(){yield Promise.all(e.processors.map(e=>e.shutdown()))})()}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}};function rc(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var ic=class{constructor(e){R(this,`createdLogs`,void 0),this.createdLogs=e.createCounter(`otel.sdk.log.created`,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}};let ac={disabled:!1,minimumSeverity:Ba.UNSPECIFIED,traceBased:!1},oc=()=>V({},ac);var sc=class{constructor(e,t,n,r,i,a){R(this,`loggers`,new Map),R(this,`activeProcessor`,void 0),R(this,`registeredLogRecordProcessors`,[]),R(this,`resource`,void 0),R(this,`forceFlushTimeoutMillis`,void 0),R(this,`logRecordLimits`,void 0),R(this,`processors`,void 0),R(this,`loggerMetrics`,void 0),R(this,`_loggerConfigurator`,void 0),R(this,`_loggerConfigs`,new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new nc(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new tc,this._loggerConfigurator=i==null?oc:i;let o=a?a.getMeter(`@opentelemetry/sdk-logs`,`0.217.0`):ve();this.loggerMetrics=new ic(o)}getLoggerConfig(e){let t=rc(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}},cc=class{constructor(e={}){var t,n,r,i,a,o,s,c;R(this,`_shutdownOnce`,void 0),R(this,`_sharedState`,void 0);let l={resource:(t=e.resource)==null?Er():t,forceFlushTimeoutMillis:(n=e.forceFlushTimeoutMillis)==null?3e4:n,logRecordLimits:{attributeCountLimit:(r=(i=e.logRecordLimits)==null?void 0:i.attributeCountLimit)==null?128:r,attributeValueLengthLimit:(a=(o=e.logRecordLimits)==null?void 0:o.attributeValueLengthLimit)==null?1/0:a},loggerConfigurator:(s=e.loggerConfigurator)==null?oc:s,processors:(c=e.processors)==null?[]:c,meterProvider:e.meterProvider};this._sharedState=new sc(l.resource,l.forceFlushTimeoutMillis,l.logRecordLimits,l.processors,l.loggerConfigurator,l.meterProvider),this._shutdownOnce=new gr(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return I.warn(`A shutdown LoggerProvider cannot provide a Logger`),Ha;e||I.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${(n==null?void 0:n.schemaUrl)||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new ec({name:r,version:t,schemaUrl:n==null?void 0:n.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(I.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(I.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}};function lc(e){return uc.apply(this,arguments)}function uc(){return uc=z(function*(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.resource.asyncAttributesPending&&r.resource.waitForAsyncAttributes&&t.push(r.resource.waitForAsyncAttributes())}t!=null&&t.length>0&&(yield Promise.all(t))}),uc.apply(this,arguments)}var dc=class{constructor(e,t,n){R(this,`_exportCompleted`,void 0),R(this,`_exportScheduledPromise`,void 0),R(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,n)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}_executeExport(e,t,n){var r=this;return z(function*(){try{yield lc(t),yield F.with(Mt(F.active()),z(function*(){return r._exportWithTimeout(e,t,n)}))}catch(e){Zt(e),r._exportScheduledResolve()}})()}_exportWithTimeout(e,t,n){var r=this;return z(function*(){return new Promise((i,a)=>{let o=setTimeout(()=>{a(Error(`Timeout`))},n);e.export(t,e=>{if(clearTimeout(o),e.code===On.SUCCESS)i();else{var t;a((t=e.error)==null?Error(`BatchLogRecordProcessor: log record export failed`):t)}}),r._exportScheduledResolve()})})()}},fc=class{constructor(e,t){var n,r,i,a;R(this,`_maxExportBatchSize`,void 0),R(this,`_maxQueueSize`,void 0),R(this,`_scheduledDelayMillis`,void 0),R(this,`_exportTimeoutMillis`,void 0),R(this,`_exporter`,void 0),R(this,`_currentExport`,null),R(this,`_finishedLogRecords`,[]),R(this,`_timer`,void 0),R(this,`_shutdownOnce`,void 0),R(this,`_flushing`,!1),this._exporter=e,this._maxExportBatchSize=(n=t==null?void 0:t.maxExportBatchSize)==null?512:n,this._maxQueueSize=(r=t==null?void 0:t.maxQueueSize)==null?2048:r,this._scheduledDelayMillis=(i=t==null?void 0:t.scheduledDelayMillis)==null?5e3:i,this._exportTimeoutMillis=(a=t==null?void 0:t.exportTimeoutMillis)==null?3e4:a,this._shutdownOnce=new gr(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(I.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}_shutdown(){var e=this;return z(function*(){e.onShutdown(),yield e._flushAll(),yield e._exporter.shutdown()})()}_flushAll(){var e=this;return z(function*(){if(e._flushing)return;e._flushing=!0;let t=e._finishedLogRecords;for(e._finishedLogRecords=[],e._clearTimer(),e._currentExport!==null&&(yield e._exporter.forceFlush(),yield e._currentExport.exportCompleted,e._currentExport=null);t.length>0;){let n;t.length<=e._maxExportBatchSize?(n=t,t=[]):n=t.splice(0,e._maxExportBatchSize);let r=new dc(e._exporter,n,e._exportTimeoutMillis);e._currentExport=r;try{yield r.exportScheduled,yield e._exporter.forceFlush(),yield r.exportCompleted}catch(e){Zt(e)}finally{e._currentExport=null}}e._flushing=!1,e._maybeStartTimer()})()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(e===null)return;let t=new dc(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,Zt(e),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},pc=class extends fc{constructor(e,t){super(e,t),R(this,`_visibilityChangeListener`,void 0),R(this,`_pageHideListener`,void 0),this._onInit(t)}onShutdown(){typeof document>`u`||(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}_onInit(e){(e==null?void 0:e.disableAutoFlushOnDocumentHide)===!0||typeof document>`u`||(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush()},this._pageHideListener=()=>{this.forceFlush()},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}},mc=class{constructor(e){R(this,`_sessionIdProvider`,void 0),this._sessionIdProvider=e}forceFlush(){return z(function*(){})()}onStart(e,t){var n;let r=(n=this._sessionIdProvider)==null?void 0:n.getSessionId();r&&e.setAttribute(`session.id`,r)}onEnd(e){}shutdown(){return z(function*(){})()}};function hc(e){return new mc(e)}let gc={compression:`gzip`,keepalive:!0,concurrencyLimit:5,timeoutMillis:30*1e3},_c=(e,t)=>({"X-MXL-AID":e,"X-MXL-DID":t}),vc=(e,t)=>t||`http://mxl-otelcol.service-availability.apps.ocpthikadev01.safaricom.net`,yc=`1.9.1`,bc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function xc(e){let t=new Set([e]),n=new Set,r=e.match(bc);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(bc);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)}}let Sc=xc(yc),Cc=yc.split(`.`)[0],wc=Symbol.for(`opentelemetry.js.api.${Cc}`),Tc=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function Ec(e,t,n,r=!1){var i;let a=Tc[wc]=(i=Tc[wc])==null?{version:yc}:i;if(!r&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(a.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${yc}`);return n.error(t.stack||t.message),!1}return a[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${yc}.`),!0}function Dc(e){var t,n;let r=(t=Tc[wc])==null?void 0:t.version;if(!(!r||!Sc(r)))return(n=Tc[wc])==null?void 0:n[e]}function Oc(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${yc}.`);let n=Tc[wc];n&&delete n[e]}var kc=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return Ac(`debug`,this._namespace,e)}error(...e){return Ac(`error`,this._namespace,e)}info(...e){return Ac(`info`,this._namespace,e)}warn(...e){return Ac(`warn`,this._namespace,e)}verbose(...e){return Ac(`verbose`,this._namespace,e)}};function Ac(e,t,n){let r=Dc(`diag`);if(r)return r[e](t,...n)}var jc;(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`})(jc||(jc={}));function Mc(e,t){e<jc.NONE?e=jc.NONE:e>jc.ALL&&(e=jc.ALL),t=t||{};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,jc.ERROR),warn:n(`warn`,jc.WARN),info:n(`info`,jc.INFO),debug:n(`debug`,jc.DEBUG),verbose:n(`verbose`,jc.VERBOSE)}}let Nc=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function e(e){return function(...t){let n=Dc(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:jc.INFO})=>{var r,i,a;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((r=e.stack)==null?e.message:r),!1}typeof n==`number`&&(n={logLevel:n});let o=Dc(`diag`),s=Mc((i=n.logLevel)==null?jc.INFO:i,e);if(o&&!n.suppressOverrideMessage){let e=(a=Error().stack)==null?`<failed to generate stacktrace>`:a;o.warn(`Current logger will be overwritten from ${e}`),s.warn(`Current logger will overwrite one already registered from ${e}`)}return Ec(`diag`,s,t,!0)},t.disable=()=>{Oc(`diag`,t)},t.createComponentLogger=e=>new kc(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}}.instance(),Pc=Math.pow(10,9);function Fc(e){return e[0]*Pc+e[1]}function Ic(e,t){let n={attributes:Rc(e.attributes,t),droppedAttributesCount:0},r=e.schemaUrl;return r&&r!==``&&(n.schemaUrl=r),n}function Lc(e){return{name:e.name,version:e.version}}function Rc(e,t){return Object.keys(e).map(n=>zc(n,e[n],t))}function zc(e,t,n){return{key:e,value:Bc(t,n)}}function Bc(e,t){let n=typeof e;if(n===`string`)return{stringValue:e};if(n===`number`)return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(n===`boolean`)return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=Bc(e[r],t);return{arrayValue:{values:n}}}if(n===`object`&&e!=null){let n=Object.keys(e),r=Array(n.length);for(let i=0;i<n.length;i++)r[i]={key:n[i],value:Bc(e[n[i]],t)};return{kvlistValue:{values:r}}}return{}}function Vc(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Hc(e){return Vc(e).toString()}let Uc=typeof BigInt<`u`?Hc:Fc;function Wc(e){return e}let Gc={encodeHrTime:Uc,encodeSpanContext:Wc,encodeOptionalSpanContext:Wc,encodeUint8Array:e=>{if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return btoa(t.join(``))}};function Kc(e,t){return{resourceLogs:Jc(e,t)}}function qc(e){let t=new Map;for(let n of e){let{resource:e,instrumentationScope:{name:r,version:i=``,schemaUrl:a=``}}=n,o=t.get(e);o||(o=new Map,t.set(e,o));let s=`${r}@${i}:${a}`,c=o.get(s);c||(c=[],o.set(s,c)),c.push(n)}return t}function Jc(e,t){let n=qc(e);return Array.from(n,([e,n])=>{let r=Ic(e,t);return{resource:r,scopeLogs:Array.from(n,([,e])=>({scope:Lc(e[0].instrumentationScope),logRecords:e.map(e=>Yc(e,t)),schemaUrl:e[0].instrumentationScope.schemaUrl})),schemaUrl:r.schemaUrl}})}function Yc(e,t){var n,r,i;return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:Xc(e.severityNumber),severityText:e.severityText,body:Bc(e.body,t),eventName:e.eventName,attributes:Zc(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,flags:(n=e.spanContext)==null?void 0:n.traceFlags,traceId:t.encodeOptionalSpanContext((r=e.spanContext)==null?void 0:r.traceId),spanId:t.encodeOptionalSpanContext((i=e.spanContext)==null?void 0:i.spanId)}}function Xc(e){return e}function Zc(e,t){return Object.keys(e).map(n=>zc(n,e[n],t))}let Qc={serializeRequest:e=>{let t=Kc(e,Gc);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return Nc.warn(`Failed to parse logs export response: ${e.message}. Returning empty response`),{}}}};function $c(e,t){let n=e&255|256;return t&&(n|=512),n}function el(e,t){var n,r,i,a;let o=e.spanContext(),s=e.status,c=(n=e.parentSpanContext)!=null&&n.spanId?t.encodeSpanContext((r=e.parentSpanContext)==null?void 0:r.spanId):void 0;return{traceId:t.encodeSpanContext(o.traceId),spanId:t.encodeSpanContext(o.spanId),parentSpanId:c,traceState:(i=o.traceState)==null?void 0:i.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:Rc(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>nl(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:s.code,message:s.message},links:e.links.map(e=>tl(e,t)),droppedLinksCount:e.droppedLinksCount,flags:$c(o.traceFlags,(a=e.parentSpanContext)==null?void 0:a.isRemote)}}function tl(e,t){var n;return{attributes:e.attributes?Rc(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:(n=e.context.traceState)==null?void 0:n.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:$c(e.context.traceFlags,e.context.isRemote)}}function nl(e,t){return{attributes:e.attributes?Rc(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function rl(e,t){return{resourceSpans:al(e,t)}}function il(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function al(e,t){let n=il(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>el(e,t));o.push({scope:Lc(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=Ic(e,t),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}let ol={serializeRequest:e=>{let t=rl(e,Gc);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return Nc.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}};var sl=class{constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}},cl=class extends Error{constructor(e,t,n){super(e),R(this,`code`,void 0),R(this,`name`,`OTLPExporterError`),R(this,`data`,void 0),this.data=n,this.code=t}},ll=class{constructor(e){R(this,`_concurrencyLimit`,void 0),R(this,`_sendingPromises`,[]),this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}awaitAll(){var e=this;return z(function*(){yield Promise.all(e._sendingPromises)})()}};function ul(e){return new ll(e.concurrencyLimit)}function dl(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function fl(){return{handleResponse(e){e==null||!dl(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||I.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var pl=class{constructor(e,t,n,r,i){R(this,`_diagLogger`,void 0),R(this,`_transport`,void 0),R(this,`_serializer`,void 0),R(this,`_responseHandler`,void 0),R(this,`_promiseQueue`,void 0),R(this,`_timeout`,void 0),this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=I.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:On.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:On.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:On.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:On.FAILED,error:e.error});return}else if(e.status===`retryable`){var n;t({code:On.FAILED,error:(n=e.error)==null?new cl(`Export failed with retryable status`):n})}else t({code:On.FAILED,error:new cl(`Export failed with unknown error`)})},e=>t({code:On.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}shutdown(){var e=this;return z(function*(){e._diagLogger.debug(`shutdown started`),yield e.forceFlush(),e._transport.shutdown()})()}};function ml(e,t){return new pl(e.transport,e.serializer,fl(),e.promiseHandler,t.timeout)}function hl(e,t,n){return ml({transport:n,serializer:t,promiseHandler:ul(e)},{timeout:e.timeoutMillis})}let gl=49152,_l=0,vl=0;var yl=class e{constructor(e){this._config=e}static _compressRequest(e){return z(function*(){let t=new CompressionStream(`gzip`),n=t.writable.getWriter();n.write(e),n.close();let r=[],i=t.readable.getReader(),a=!1;for(;!a;){let e=yield i.read();e.value&&r.push(e.value),a=e.done}let o=new Uint8Array(r.reduce((e,t)=>e+t.length,0)),s=0;for(let e of r)o.set(e,s),s+=e.length;return o})()}send(e,t){return this._asyncSend(e,t)}shutdown(){}_asyncSend(t,n){var r=this;return z(function*(){let i=t,a=V({"Content-Type":`application/json`},r._config.headers),o,s;if(`timeout`in AbortSignal)o=AbortSignal.timeout(n);else{let e=new AbortController;o=e.signal,s=setTimeout(()=>{e.abort(new DOMException(`TimeoutError`,`TimeoutError`))},n)}let c=!1;try{if(r._config.compression===`gzip`){try{i=yield e._compressRequest(t)}catch(e){let t=e instanceof Error?e:Error(String(e));return I.warn(`Fetch transport gzip compression failed: ${t.message}`),{status:`failure`,error:t}}a[`Content-Encoding`]=`gzip`,a[`Content-Length`]=i.length.toString()}let n=_l+i.byteLength>gl;if(c=!n&&!(vl>=9),c)_l+=i.byteLength,vl++;else{let e=n?`inflight bytes (${_l} + ${i.byteLength}) would exceed ${gl}B budget`:`concurrent count (${vl}) at limit of 9`;I.debug(`Sending without keepalive: ${e}`)}let s=yield fetch(r._config.url,{method:`POST`,keepalive:c,headers:a,body:i,signal:o});if(s.ok)return{status:`success`};let l=Error(`${s.status} Fetch request failed`),u=`Fetch transport received HTTP ${s.status} (keepalive=${c})`;return s.status>=500?(I.debug(u),{status:`retryable`,error:l}):(I.warn(u),{status:`failure`,error:l})}catch(e){let t=e instanceof Error?e:Error(String(e)),n=t instanceof TypeError||t instanceof DOMException&&t.name===`TimeoutError`,r=`Fetch transport failed (keepalive=${c}): ${t.message}`;return n?I.debug(r):I.warn(r),{status:n?`retryable`:`failure`,error:t}}finally{s!==void 0&&clearTimeout(s),c&&(_l-=i.byteLength,vl--)}})()}};let bl=e=>new yl(e),xl=()=>Math.random()*40-20;var Sl=class{constructor(e,t=new wi){this._transport=e,this._perf=t}send(e,t){var n=this;return z(function*(){let r=n._perf.getNowMillis()+t,i=yield n._transport.send(e,t),a=5,o=1e3;for(;i.status===`retryable`&&a>0;){var s;a--;let t=Math.max(Math.min(o,5e3)+xl(),0);o*=1.5;let c=(s=i.retryInMillis)==null?t:s,l=r-n._perf.getNowMillis();if(c>l)return i;i=yield n._retry(e,l,c)}return i})()}shutdown(){this._transport.shutdown()}_retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}};let Cl=e=>{var t;return new Sl(e.transport,(t=e.perf)==null?new wi:t)},wl=(e,t)=>hl(e,t,Cl({transport:bl(e)}));var Tl=class extends sl{constructor(e){super(wl(e,Qc))}};let El=(e,t)=>`${vc(e,t)}/v1/logs`;var Dl=class extends Tl{constructor({appID:e,userID:t,mxlDataURL:n}){super(V(V({},gc),{},{headers:_c(e,t),url:El(e,n)}))}},Ol=class extends sl{constructor(e){super(wl(V(V({},e),{},{compression:`gzip`}),ol))}};let kl=(e,t)=>`${vc(e,t)}/v1/traces`;var Al=class extends Ol{constructor({appID:e,userID:t,mxlDataURL:n}){super(V(V({},gc),{},{headers:_c(e,t),url:kl(e,n)}))}},jl=class{constructor({urlDocument:e=window.document}={}){R(this,`_urlDocument`,void 0),this._urlDocument=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){e.attributes[`browser.url.full`]||e.setAttribute(Ct,this._urlDocument.URL)}shutdown(){return Promise.resolve(void 0)}},Ml=class{constructor({urlDocument:e=window.document}={}){R(this,`_urlDocument`,void 0),this._urlDocument=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){e.attributes[`browser.url.full`]||(e.attributes[Ct]=this._urlDocument.URL)}onStart(){}shutdown(){return Promise.resolve(void 0)}},Nl=class{constructor({spanSessionManager:e}){R(this,`_spanSessionManager`,void 0),this._spanSessionManager=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){e.setAttributes({"log.record.uid":ht(),[Ra]:this._spanSessionManager.getSessionId(),"session.previous_id":this._spanSessionManager.getPreviousSessionId()})}shutdown(){return Promise.resolve(void 0)}},Pl=class{constructor({attributeScrubbers:e}){R(this,`_attributeScrubbers`,void 0),this._attributeScrubbers=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){this._attributeScrubbers.forEach(t=>{let n=e.attributes[t.key];n&&typeof n==`string`&&e.setAttribute(t.key,t.scrub(n))})}shutdown(){return Promise.resolve(void 0)}},Fl=class{constructor({urlDocument:e=window.document}={}){R(this,`_urlDocument`,void 0),this._urlDocument=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){e.attributes[`mxl.type`]||e.setAttribute(vt,`sys.log`),e.setAttribute(pn,this._urlDocument.URL)}shutdown(){return Promise.resolve(void 0)}};let Il=e=>{if((e.attributes[`http.request.method`]||e.attributes[`http.method`])&&(typeof e.attributes[`http.response.status_code`]==`number`||typeof e.attributes[`http.status_code`]==`number`)){var t;let n=(t=e.attributes[`url.full`])==null?e.attributes[Qt]:t;return typeof n==`string`&&n.includes(`://`)}return!1};var Ll=class{forceFlush(){return Promise.resolve(void 0)}onEnd(e){if(Il(e)){var t,n,r,i,a;e.attributes[vt]=`perf.network_request`,(t=e.attributes)[`url.full`]!=null||(t[`url.full`]=e.attributes[`http.url`]),(n=e.attributes)[`http.response.status_code`]!=null||(n[`http.response.status_code`]=e.attributes[`http.status_code`]),(r=e.attributes)[`http.request.method`]!=null||(r[`http.request.method`]=e.attributes[`http.method`]),(i=e.attributes)[`http.response.body.size`]!=null||(i[`http.response.body.size`]=e.attributes[`http.response_content_length`]),(a=e.attributes)[`http.request.body.size`]!=null||(a[`http.request.body.size`]=e.attributes[`http.request_content_length`])}}onStart(){}shutdown(){return Promise.resolve(void 0)}};let Rl=e=>e.attributes[vt]===`ux.session`,zl=(e,t)=>`mxl.${t===`current`?`export_failed`:`previous_export_failed`}.${e}`;var Bl=class{constructor({resource:e,exporter:t,limitManager:n,spanSessionManager:r,storage:i=window.localStorage,storedSpansExpireTimeoutMS:a,diag:o=I.createComponentLogger({namespace:`MXLSessionBatchedSpanProcessor`})}){R(this,`_shutdownOnce`,void 0),R(this,`_pendingSpans`,[]),R(this,`_exporter`,void 0),R(this,`_limitManager`,void 0),R(this,`_spanStorage`,void 0),R(this,`_spanSessionManager`,void 0),R(this,`_diag`,void 0),R(this,`_shutdown`,()=>(this._spanStorage.destroy(),this._exporter.shutdown())),this._diag=o,this._exporter=t,this._shutdownOnce=new gr(this._shutdown,this),this._limitManager=n,this._spanSessionManager=r,this._spanStorage=new xi({resource:e,storage:i,diag:o,onExpiredSpansExport:e=>{this._exportSpans(e)},storedSpansExpireTimeoutMS:a,spanSessionManager:r})}forceFlush(){return this._diag.debug(`forceFlush called for MXLSessionBatchedSpanProcessor. This is a no op`),Promise.resolve(void 0)}onEnd(e){if(this._shutdownOnce.isCalled){this._diag.debug(`span ended after processor shutdown. Ignoring span.`);return}if(Rl(e))this._diag.debug(`session span ended. Exporting all pending spans.`),this._exportSpans([e,...this._pendingSpans]),this._pendingSpans=[];else{if(this._diag.debug(`non-session span ended. Adding to pending spans queue.`),this._limitManager.dropReadableSpan(e))return;this._pendingSpans.push(e)}}_exportSpans(e){vr._export(this._exporter,e).then(e=>{if(e.code===On.FAILED){var t;let n=((t=e.error)==null?void 0:t.message)||`unknown error`,r=`unknown`;n===`Concurrent export limit reached`?r=`concurrent_limit`:n===`Fetch request errored`&&(r=`fetch_error`),this._spanSessionManager.incrSessionCountForKey(zl(r,`current`)),this._spanSessionManager.incrNextSessionCountForKey(zl(r,`previous`)),this._diag.error(`spans failed to export: ${n}`)}}).catch(e=>{let t=`unknown error`;e&&e instanceof Error?t=e.message:typeof e==`string`&&(t=e),this._spanSessionManager.incrSessionCountForKey(zl(`unknown`,`current`)),this._spanSessionManager.incrNextSessionCountForKey(zl(`unknown`,`previous`)),this._diag.error(`spans failed to export: ${t}`)})}onStart(){}getPendingSpansCount(){return this._pendingSpans.length}storePendingSpans(e,t){this._spanStorage.storePendingSpans(e,t,this._pendingSpans)}clearStoredSpans(e){this._spanStorage.clearStoredSpans(e)}shutdown(){return this._shutdownOnce.call()}},Vl=class{constructor({pageManager:e}){R(this,`_pageManager`,void 0),this._pageManager=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){if(!e.attributes[`app.surface.name`]||!e.attributes[`app.surface.id`]){let t=this._pageManager.getCurrentRoute();t&&(e.setAttribute(wt,t.path),e.setAttribute(Tt,this._pageManager.getCurrentPageId()))}let t=this._pageManager.getPageLabel();t&&!e.attributes[`app.surface.label`]&&e.setAttribute(Et,t)}shutdown(){return Promise.resolve(void 0)}},Hl=class{constructor({pageManager:e}){R(this,`_pageManager`,void 0),this._pageManager=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){if(!e.attributes[`app.surface.name`]||!e.attributes[`app.surface.id`]){let t=this._pageManager.getCurrentRoute(),n=this._pageManager.getCurrentPageId();t&&n&&(e.attributes[wt]=t.path,e.attributes[Tt]=n)}let t=this._pageManager.getPageLabel();t&&!e.attributes[`app.surface.label`]&&(e.attributes[Et]=t)}onStart(){}shutdown(){return Promise.resolve(void 0)}},Ul=class{constructor({attributeScrubbers:e}){R(this,`_attributeScrubbers`,void 0),this._attributeScrubbers=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){this._attributeScrubbers.forEach(t=>{let n=e.attributes[t.key];n&&typeof n==`string`&&(e.attributes[t.key]=t.scrub(n))})}onStart(){}shutdown(){return Promise.resolve(void 0)}},Wl=class{constructor({userManager:e}){R(this,`_userManager`,void 0),this._userManager=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){this._userManager.getUserId()&&e.setAttributes({[za]:this._userManager.getUserId()})}shutdown(){return Promise.resolve(void 0)}},Gl=class{constructor({userManager:e}){R(this,`_userManager`,void 0),this._userManager=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){let t=this._userManager.getUserId();t&&(e.attributes[za]=t)}onStart(){}shutdown(){return Promise.resolve(void 0)}},Kl=class extends Un{inject(e,t,n){super.inject(e,t,n);let r=L.getSpan(e);if(r){let e=t instanceof Headers?t.get(`traceparent`):ye.get(t,`traceparent`);e&&r.setAttribute(`mxl.w3c_traceparent`,e)}}};let ql=/\/\/(.+):(.+)@(.+)\//,Jl=[`AWSAccessKeyId`,`Signature`,`sig`,"`X-Goog-Signature",`password`,`auth`,`pw`,`token`],Yl=({value:e,queryParamRegex:t,scrubPath:n,scrubQuery:r})=>{let i=e;return n&&(i=i.replace(ql,`//REDACTED:REDACTED@$3/`)),r&&(i=i.replaceAll(t,`$1$2=REDACTED`)),i},Xl=e=>{let t=[...Jl,...e||[]],n=RegExp(`(^|&|\\?)(${t.join(`|`)})=[^&]+`,`g`);return[{key:pn,scrub:e=>Yl({value:e,queryParamRegex:n,scrubPath:!0,scrubQuery:!0})},{key:Qt,scrub:e=>Yl({value:e,queryParamRegex:n,scrubPath:!0,scrubQuery:!0})},{key:`url.path`,scrub:e=>Yl({value:e,queryParamRegex:n,scrubPath:!0,scrubQuery:!1})},{key:`url.query`,scrub:e=>Yl({value:e,queryParamRegex:n,scrubPath:!1,scrubQuery:!0})}]},Zl=new class{constructor({diagLogger:e=I.createComponentLogger({namespace:`mxl-registry`})}={}){R(this,`_sdk`,null),R(this,`_diag`,void 0),R(this,`register`,e=>{this._sdk!==null&&this._diag.warn(`previously registered sdk will be overwritten`),this._sdk=e}),R(this,`clear`,()=>{this._sdk===null&&this._diag.warn(`sdk already cleared, this is a no-op`),this._sdk=null}),R(this,`registered`,()=>this._sdk),this._diag=e}};
1
+ "use strict";window.MXLWebSdk=window.MXLWebSdk||(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},l=(e,r,i)=>(i=e==null?{}:t(a(e)),c(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e));let u=`1.9.1`,d=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function f(e){let t=new Set([e]),n=new Set,r=e.match(d);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(d);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)}}let p=f(u),m=u.split(`.`)[0],h=Symbol.for(`opentelemetry.js.api.${m}`),g=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function _(e,t,n,r=!1){var i;let a=g[h]=(i=g[h])==null?{version:u}:i;if(!r&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(a.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${u}`);return n.error(t.stack||t.message),!1}return a[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${u}.`),!0}function v(e){var t,n;let r=(t=g[h])==null?void 0:t.version;if(!(!r||!p(r)))return(n=g[h])==null?void 0:n[e]}function y(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${u}.`);let n=g[h];n&&delete n[e]}var b=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return x(`debug`,this._namespace,e)}error(...e){return x(`error`,this._namespace,e)}info(...e){return x(`info`,this._namespace,e)}warn(...e){return x(`warn`,this._namespace,e)}verbose(...e){return x(`verbose`,this._namespace,e)}};function x(e,t,n){let r=v(`diag`);if(r)return r[e](t,...n)}var S;(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`})(S||(S={}));function C(e,t){e<S.NONE?e=S.NONE:e>S.ALL&&(e=S.ALL),t=t||{};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,S.ERROR),warn:n(`warn`,S.WARN),info:n(`info`,S.INFO),debug:n(`debug`,S.DEBUG),verbose:n(`verbose`,S.VERBOSE)}}var w=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function e(e){return function(...t){let n=v(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:S.INFO})=>{var r,i,a;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((r=e.stack)==null?e.message:r),!1}typeof n==`number`&&(n={logLevel:n});let o=v(`diag`),s=C((i=n.logLevel)==null?S.INFO:i,e);if(o&&!n.suppressOverrideMessage){let e=(a=Error().stack)==null?`<failed to generate stacktrace>`:a;o.warn(`Current logger will be overwritten from ${e}`),s.warn(`Current logger will overwrite one already registered from ${e}`)}return _(`diag`,s,t,!0)},t.disable=()=>{y(`diag`,t)},t.createComponentLogger=e=>new b(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}},ee=class e{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let e of t)n._entries.delete(e);return n}clear(){return new e}};let T=Symbol(`BaggageEntryMetadata`),E=w.instance();function D(e={}){return new ee(new Map(Object.entries(e)))}function te(e){return typeof e!=`string`&&(E.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:T,toString(){return e}}}function O(e){return Symbol.for(e)}let k=new class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},A=[{n:`error`,c:`error`},{n:`warn`,c:`warn`},{n:`info`,c:`info`},{n:`debug`,c:`debug`},{n:`verbose`,c:`trace`}],j={};if(typeof console<`u`)for(let e of[`error`,`warn`,`info`,`debug`,`trace`,`log`])typeof console[e]==`function`&&(j[e]=console[e]);var ne=class{constructor(){function e(e){return function(...t){let n=j[e];if(typeof n!=`function`&&(n=j.log),typeof n!=`function`&&console&&(n=console[e],typeof n!=`function`&&(n=console.log)),typeof n==`function`)return n.apply(console,t)}}for(let t=0;t<A.length;t++)this[A[t].n]=e(A[t].c)}},re=class{constructor(){}createGauge(e,t){return de}createHistogram(e,t){return fe}createCounter(e,t){return ue}createUpDownCounter(e,t){return pe}createObservableGauge(e,t){return he}createObservableCounter(e,t){return me}createObservableUpDownCounter(e,t){return ge}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},ie=class{},M=class extends ie{add(e,t){}},ae=class extends ie{add(e,t){}},N=class extends ie{record(e,t){}},P=class extends ie{record(e,t){}},F=class{addCallback(e){}removeCallback(e){}},oe=class extends F{},se=class extends F{},ce=class extends F{};let le=new re,ue=new M,de=new N,fe=new P,pe=new ae,me=new oe,he=new se,ge=new ce;function _e(){return le}let ve={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},ye={set(e,t,n){e!=null&&(e[t]=n)}};var be=class{active(){return k}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}};let xe=`context`,Se=new be;var Ce=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(e){return _(xe,e,w.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return v(xe)||Se}disable(){this._getContextManager().disable(),y(xe,w.instance())}},we;(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(we||(we={}));let Te={traceId:`00000000000000000000000000000000`,spanId:`0000000000000000`,traceFlags:we.NONE};var Ee=class{constructor(e=Te){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}};let De=O(`OpenTelemetry Context Key SPAN`);function Oe(e){return e.getValue(De)||void 0}function ke(){return Oe(Ce.getInstance().active())}function Ae(e,t){return e.setValue(De,t)}function je(e){return e.deleteValue(De)}function Me(e,t){return Ae(e,new Ee(t))}function Ne(e){var t;return(t=Oe(e))==null?void 0:t.spanContext()}let Pe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function Fe(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(Pe[e.charCodeAt(t)]|0)+(Pe[e.charCodeAt(t+1)]|0)+(Pe[e.charCodeAt(t+2)]|0)+(Pe[e.charCodeAt(t+3)]|0);return n===t}function Ie(e){return Fe(e,32)&&e!==`00000000000000000000000000000000`}function Le(e){return Fe(e,16)&&e!==`0000000000000000`}function Re(e){return Ie(e.traceId)&&Le(e.spanId)}function ze(e){return new Ee(e)}let Be=Ce.getInstance();var Ve=class{startSpan(e,t,n=Be.active()){if(t!=null&&t.root)return new Ee;let r=n&&Ne(n);return He(r)&&Re(r)?new Ee(r):new Ee}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a==null?Be.active():a,c=this.startSpan(e,i,s),l=Ae(s,c);return Be.with(l,o,void 0,c)}};function He(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}let Ue=new Ve;var We=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Ue}};let Ge=new class{getTracer(e,t,n){return new Ve}};var Ke=class{getTracer(e,t,n){var r;return(r=this.getDelegateTracer(e,t,n))==null?new We(this,e,t,n):r}getDelegate(){var e;return(e=this._delegate)==null?Ge:e}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getTracer(e,t,n)}},qe;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(qe||(qe={}));var Je;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(Je||(Je={}));var Ye;(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(Ye||(Ye={}));let I=Ce.getInstance(),L=w.instance(),Xe=new class{getMeter(e,t,n){return le}},Ze=`metrics`,Qe=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(e){return _(Ze,e,w.instance())}getMeterProvider(){return v(Ze)||Xe}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){y(Ze,w.instance())}}.getInstance();var $e=class{inject(e,t){}extract(e,t){return e}fields(){return[]}};let et=O(`OpenTelemetry Baggage Key`);function tt(e){return e.getValue(et)||void 0}function nt(){return tt(Ce.getInstance().active())}function rt(e,t){return e.setValue(et,t)}function it(e){return e.deleteValue(et)}let at=`propagation`,ot=new $e,st=class e{constructor(){this.createBaggage=D,this.getBaggage=tt,this.getActiveBaggage=nt,this.setBaggage=rt,this.deleteBaggage=it}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(e){return _(at,e,w.instance())}inject(e,t,n=ye){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=ve){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){y(at,w.instance())}_getGlobalPropagator(){return v(at)||ot}}.getInstance(),ct=`trace`,R=class e{constructor(){this._proxyTracerProvider=new Ke,this.wrapSpanContext=ze,this.isSpanContextValid=Re,this.deleteSpan=je,this.getSpan=Oe,this.getActiveSpan=ke,this.getSpanContext=Ne,this.setSpan=Ae,this.setSpanContext=Me}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(e){let t=_(ct,this._proxyTracerProvider,w.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return v(ct)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){y(ct,w.instance()),this._proxyTracerProvider=new Ke}}.getInstance(),lt=({target:e,events:t,callback:n})=>{t.forEach(t=>{e.addEventListener(t,n)})},ut=({target:e,events:t,callback:n})=>{t.forEach(t=>{e.removeEventListener(t,n)})};function dt(e,t,n,r=new Set){return new Proxy(e,{get(e,i,a){let o=Reflect.get(e,i,a);return typeof o!=`function`||r.has(i)?o:(...r)=>{try{return o.apply(e,r)}catch(e){let a=e instanceof Error?e.message:`Unknown error`;n.error(`${String(i)}: ${a}`);let o=t[i];return typeof o==`function`?o.apply(t,r):void 0}}}})}let ft=new Uint8Array(16),pt=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`).toUpperCase()),mt=()=>{crypto.getRandomValues(ft);let e=``;for(let t=0;t<16;t++)e+=pt[ft[t]];return e},ht=()=>`mxlv2-${Date.now()}-${Math.floor(Math.random()*8999999999999)+0xe8d4a51000}`,gt=(e,t,n)=>{try{let r=e.getItem(t),i=r?parseInt(r,10):0;return Number.isNaN(i)&&(n.warn(`Non-numeric value stored at ${t} (${String(r)}); resetting counter.`),i=0),i++,e.setItem(t,i.toString()),i}catch(e){return n.warn(`Failed to retrieve ${t} from storage: `,e),1}},_t=`mxl.type`,vt=`mxl.state`,yt=`mxl.properties.`,bt=`mxl.instrumentation`,xt=`mxl.js_file_bundle_ids`,St=`browser.url.full`,Ct=`app.surface.name`,wt=`app.surface.id`,Tt=`app.surface.label`,Et=e=>e.visibilityState===`hidden`?`background`:`foreground`,Dt=globalThis,Ot=(e,t)=>!t||t<=0||t>100?!1:t>=kt(e),kt=e=>{if(e.length<6)return 0;let t=e.slice(-6),n=Math.pow(16,6)-1;return parseInt(t,16)/n*100},At=O(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function jt(e){return e.setValue(At,!0)}function Mt(e){return e.getValue(At)===!0}let Nt=`baggage`;function Pt(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function Ft(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function It(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,s;try{o=decodeURIComponent(i),s=decodeURIComponent(a)}catch(e){return}let c;return t!==-1&&t<e.length-1&&(c=te(e.substring(t+1))),{key:o,value:s,metadata:c}}var Lt=class{inject(e,t,n){let r=st.getBaggage(e);if(!r||Mt(e))return;let i=Pt(Ft(r).filter(e=>e.length<=4096).slice(0,180));i.length>0&&n.set(t,Nt,i)}extract(e,t,n){let r=n.get(t,Nt),i=Array.isArray(r)?r.join(`,`):r;if(!i)return e;let a={};return i.length===0||(i.split(`,`).forEach(e=>{let t=It(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),a[t.key]=e}}),Object.entries(a).length===0)?e:st.setBaggage(e,st.createBaggage(a))}fields(){return[Nt]}};function Rt(e){"@babel/helpers - typeof";return Rt=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Rt(e)}function zt(e,t){if(Rt(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Rt(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Bt(e){var t=zt(e,`string`);return Rt(t)==`symbol`?t:t+``}function z(e,t,n){return(t=Bt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vt(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Ht(n)){L.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Ut(r)){L.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Ht(e){return typeof e==`string`&&e!==``}function Ut(e){return e==null?!0:Array.isArray(e)?Wt(e):Gt(typeof e)}function Wt(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Gt(e)){t=e;continue}return!1}return!1}}return!0}function Gt(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Kt(){return e=>{L.error(qt(e))}}function qt(e){return typeof e==`string`?e:JSON.stringify(Jt(e))}function Jt(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}let Yt=Kt();function Xt(e){try{Yt(e)}catch(e){}}let Zt=`http.url`,Qt=`error.type`,$t=`exception.message`,en=`exception.stacktrace`,tn=`exception.type`,nn=`http.request.method`,rn=`http.request.method_original`,an=`http.response.status_code`,on=`server.address`,sn=`server.port`,cn=`service.name`,ln=`telemetry.sdk.language`,un=`telemetry.sdk.name`,dn=`telemetry.sdk.version`,fn=`url.full`,pn=`user_agent.original`,mn={[un]:`opentelemetry`,"process.runtime.name":`browser`,[ln]:`webjs`,[dn]:`2.7.1`},hn=performance,gn=Math.pow(10,6),_n=Math.pow(10,9);function vn(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*gn)]}function yn(e){return En(vn(hn.timeOrigin),vn(typeof e==`number`?e:hn.now()))}function bn(e){if(wn(e))return e;if(typeof e==`number`)return e<hn.timeOrigin?yn(e):vn(e);if(e instanceof Date)return vn(e.getTime());throw TypeError(`Invalid input type`)}function xn(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=_n),[n,r]}function Sn(e){return e[0]*_n+e[1]}function Cn(e){return e[0]*1e3+e[1]/1e6}function wn(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function Tn(e){return wn(e)||typeof e==`number`||e instanceof Date}function En(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=_n&&(n[1]-=_n,n[0]+=1),n}var Dn;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(Dn||(Dn={}));var On=class{constructor(e={}){var t;z(this,`_propagators`,void 0),z(this,`_fields`,void 0),this._propagators=(t=e.propagators)==null?[]:t;let n=new Set;for(let e of this._propagators){let t=typeof e.fields==`function`?e.fields():[];for(let e of t)n.add(e)}this._fields=Array.from(n)}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){L.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){L.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}};let kn=`[_0-9a-z-*/]`,An=`[a-z]${kn}{0,255}`,jn=`[a-z0-9]${kn}{0,240}@[a-z]${kn}{0,13}`,Mn=RegExp(`^(?:${An}|${jn})$`),Nn=/^[ -~]{0,255}[!-~]$/,Pn=/,|=/;function Fn(e){return Mn.test(e)}function In(e){return Nn.test(e)&&!Pn.test(e)}var Ln=class e{constructor(e){z(this,`_length`,void 0),z(this,`_rawTraceState`,void 0),z(this,`_internalState`,void 0),this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!Fn(e)||!In(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>512)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=`,`+e),e=`${n[0]}=${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(`,`),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(`=`);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!Fn(a)||!In(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>512)&&(t.set(a,o),n=s,t.size>=32))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}};let Rn=`traceparent`,zn=`tracestate`,Bn=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function Vn(e){let t=Bn.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Hn=class{inject(e,t,n){let r=R.getSpanContext(e);if(!r||Mt(e)||!Re(r))return;let i=`00-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||we.NONE).toString(16)}`;n.set(t,Rn,i),r.traceState&&n.set(t,zn,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,Rn);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=Vn(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,zn);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new Ln(typeof e==`string`?e:void 0)}return R.setSpanContext(e,a)}fields(){return[Rn,zn]}};let Un=Function.prototype.toString,Wn=Un.call(Object),Gn=Object.getPrototypeOf,Kn=Object.prototype,qn=Kn.hasOwnProperty,Jn=Symbol?Symbol.toStringTag:void 0,Yn=Kn.toString;function Xn(e){if(!Zn(e)||Qn(e)!==`[object Object]`)return!1;let t=Gn(e);if(t===null)return!0;let n=qn.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Un.call(n)===Wn}function Zn(e){return typeof e==`object`&&!!e}function Qn(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Jn&&Jn in Object(e)?$n(e):er(e)}function $n(e){let t=qn.call(e,Jn),n=e[Jn],r=!1;try{e[Jn]=void 0,r=!0}catch(e){}let i=Yn.call(e);return r&&(t?e[Jn]=n:delete e[Jn]),i}function er(e){return Yn.call(e)}function tr(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=rr(t,e.shift(),0,n);return t}function nr(e){return ar(e)?e.slice():e}function rr(e,t,n=0,r){let i;if(!(n>20)){if(n++,cr(e)||cr(t)||or(t))i=nr(t);else if(ar(e)){if(i=e.slice(),ar(t))for(let e=0,n=t.length;e<n;e++)i.push(nr(t[e]));else if(sr(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=nr(t[r]))}}}else if(sr(e))if(sr(t)){if(!lr(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(cr(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(ir(e,s,r)||ir(t,s,r))delete i[s];else{if(sr(a)&&sr(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=rr(i[s],c,n,r)}}}}else i=t;return i}}function ir(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function ar(e){return Array.isArray(e)}function or(e){return typeof e==`function`}function sr(e){return!cr(e)&&!ar(e)&&!or(e)&&typeof e==`object`}function cr(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function lr(e,t){return!(!Xn(e)||!Xn(t))}var ur=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};function dr(e,t){let n,r=new Promise(function(e,r){n=setTimeout(function(){r(new ur(`Operation timed out.`))},t)});return Promise.race([e,r]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})}function fr(e,t){return typeof t==`string`?e===t:!!e.match(t)}function pr(e,t){if(!t)return!1;for(let n of t)if(fr(e,n))return!0;return!1}var mr=class{constructor(){z(this,`_promise`,void 0),z(this,`_resolve`,void 0),z(this,`_reject`,void 0),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}},hr=class{constructor(e,t){z(this,`_isCalled`,!1),z(this,`_deferred`,new mr),z(this,`_callback`,void 0),z(this,`_that`,void 0),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}};function gr(e,t){return new Promise(n=>{I.with(jt(I.active()),()=>{e.export(t,n)})})}let _r={_export:gr},vr;function yr(){if(vr===void 0)try{let e=globalThis.process.argv0;vr=e?`unknown_service:${e}`:`unknown_service`}catch(e){vr=`unknown_service`}return vr}let br=e=>typeof e==`object`&&!!e&&typeof e.then==`function`;function xr(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function B(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){xr(a,r,i,o,s,`next`,e)}function s(e){xr(a,r,i,o,s,`throw`,e)}o(void 0)})}}var Sr=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=Er(t),r._asyncAttributesPending=t.filter(([e,t])=>br(t)).length>0,r}constructor(e,t){var n;z(this,`_rawAttributes`,void 0),z(this,`_asyncAttributesPending`,!1),z(this,`_schemaUrl`,void 0),z(this,`_memoizedAttributes`,void 0);let r=(n=e.attributes)==null?{}:n;this._rawAttributes=Object.entries(r).map(([e,t])=>(br(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Er(this._rawAttributes),this._schemaUrl=Dr(t==null?void 0:t.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}waitForAsyncAttributes(){var e=this;return B(function*(){if(e.asyncAttributesPending){for(let t=0;t<e._rawAttributes.length;t++){let[n,r]=e._rawAttributes[t];e._rawAttributes[t]=[n,br(r)?yield r:r]}e._asyncAttributesPending=!1}})()}get attributes(){if(this.asyncAttributesPending&&L.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(br(n)){L.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]!=null||(e[t]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=Or(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function Cr(e,t){return Sr.FromAttributeList(Object.entries(e),t)}function wr(){return Cr({})}function Tr(){return Cr({[cn]:yr(),[ln]:mn[ln],[un]:mn[un],[dn]:mn[dn]})}function Er(e){return e.map(([e,t])=>br(t)?[e,t.catch(t=>{L.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Dr(e){if(typeof e==`string`||e===void 0)return e;L.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function Or(e,t){let n=e==null?void 0:e.schemaUrl,r=t==null?void 0:t.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;L.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var kr=class{constructor(e){var t,n;z(this,`_spanContext`,void 0),z(this,`kind`,void 0),z(this,`parentSpanContext`,void 0),z(this,`attributes`,{}),z(this,`links`,[]),z(this,`events`,[]),z(this,`startTime`,void 0),z(this,`resource`,void 0),z(this,`instrumentationScope`,void 0),z(this,`_droppedAttributesCount`,0),z(this,`_droppedEventsCount`,0),z(this,`_droppedLinksCount`,0),z(this,`_attributesCount`,0),z(this,`name`,void 0),z(this,`status`,{code:Ye.UNSET}),z(this,`endTime`,[0,0]),z(this,`_ended`,!1),z(this,`_duration`,[-1,-1]),z(this,`_spanProcessor`,void 0),z(this,`_spanLimits`,void 0),z(this,`_attributeValueLengthLimit`,void 0),z(this,`_recordEndMetrics`,void 0),z(this,`_performanceStartTime`,void 0),z(this,`_performanceOffset`,void 0),z(this,`_startTimeProvided`,void 0);let r=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=hn.now(),this._performanceOffset=r-(this._performanceStartTime+hn.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=(t=this._spanLimits.attributeValueLengthLimit)==null?0:t,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime((n=e.startTime)==null?r:n),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return L.warn(`Invalid attribute key: ${e}`),this;if(!Ut(t))return L.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return L.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&L.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),Tn(t)&&(Tn(n)||(n=t),t=void 0);let i=Vt(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&L.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=Vt(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===Ye.UNSET||this.status.code===Ye.OK)return this;let t={code:e.code};return e.code===Ye.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&L.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){var t;if(this._isSpanEnded()){L.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=xn(this.startTime,this.endTime),this._duration[0]<0&&(L.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&L.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&L.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),(t=this._recordEndMetrics)==null||t.call(this),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=hn.now())return yn(e+this._performanceOffset);if(typeof e==`number`)return vn(e);if(e instanceof Date)return vn(e.getTime());if(wn(e))return e;if(this._startTimeProvided)return vn(Date.now());let t=hn.now()-this._performanceStartTime;return En(this.startTime,vn(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[$t]=e:e&&(e.code?n[tn]=e.code.toString():e.name&&(n[tn]=e.name),e.message&&(n[$t]=e.message),e.stack&&(n[en]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(`exception`,n,t):L.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);L.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(L.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}},Ar;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(Ar||(Ar={}));var jr=class{shouldSample(){return{decision:Ar.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},Mr=class{shouldSample(){return{decision:Ar.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},Nr=class{constructor(e){var t,n,r,i;z(this,`_root`,void 0),z(this,`_remoteParentSampled`,void 0),z(this,`_remoteParentNotSampled`,void 0),z(this,`_localParentSampled`,void 0),z(this,`_localParentNotSampled`,void 0),this._root=e.root,this._root||(Xt(Error(`ParentBasedSampler must have a root sampler configured`)),this._root=new Mr),this._remoteParentSampled=(t=e.remoteParentSampled)==null?new Mr:t,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)==null?new jr:n,this._localParentSampled=(r=e.localParentSampled)==null?new Mr:r,this._localParentNotSampled=(i=e.localParentNotSampled)==null?new jr:i}shouldSample(e,t,n,r,i,a){let o=R.getSpanContext(e);return!o||!Re(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&we.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&we.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},Pr=class{constructor(e=0){z(this,`_ratio`,void 0),z(this,`_upperBound`,void 0),this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Ie(t)&&this._accumulate(t)<this._upperBound?Ar.RECORD_AND_SAMPLED:Ar.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}},Fr;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(Fr||(Fr={}));function Ir(){var e,t,n,r,i,a,o,s;return{sampler:Lr(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(e=void 0)==null?1/0:e,attributeCountLimit:(t=void 0)==null?128:t},spanLimits:{attributeValueLengthLimit:(n=void 0)==null?1/0:n,attributeCountLimit:(r=void 0)==null?128:r,linkCountLimit:(i=void 0)==null?128:i,eventCountLimit:(a=void 0)==null?128:a,attributePerEventCountLimit:(o=void 0)==null?128:o,attributePerLinkCountLimit:(s=void 0)==null?128:s}}}function Lr(){var e;let t=(e=void 0)==null?Fr.ParentBasedAlwaysOn:e;switch(t){case Fr.AlwaysOn:return new Mr;case Fr.AlwaysOff:return new jr;case Fr.ParentBasedAlwaysOn:return new Nr({root:new Mr});case Fr.ParentBasedAlwaysOff:return new Nr({root:new jr});case Fr.TraceIdRatio:return new Pr(Rr());case Fr.ParentBasedTraceIdRatio:return new Nr({root:new Pr(Rr())});default:return L.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${Fr.ParentBasedAlwaysOn}".`),new Nr({root:new Mr})}}function Rr(){return L.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1.`),1}function zr(e){let t={sampler:Lr()},n=Ir(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}function Br(e){var t,n,r,i,a,o,s,c,l,u,d,f;let p=Object.assign({},e.spanLimits);return p.attributeCountLimit=(t=(n=(r=(i=(a=e.spanLimits)==null?void 0:a.attributeCountLimit)==null?(o=e.generalLimits)==null?void 0:o.attributeCountLimit:i)==null?void 0:r)==null?void 0:n)==null?128:t,p.attributeValueLengthLimit=(s=(c=(l=(u=(d=e.spanLimits)==null?void 0:d.attributeValueLengthLimit)==null?(f=e.generalLimits)==null?void 0:f.attributeValueLengthLimit:u)==null?void 0:l)==null?void 0:c)==null?1/0:s,Object.assign({},e,{spanLimits:p})}var Vr=class{constructor(e,t){var n,r,i,a;z(this,`_maxExportBatchSize`,void 0),z(this,`_maxQueueSize`,void 0),z(this,`_scheduledDelayMillis`,void 0),z(this,`_exportTimeoutMillis`,void 0),z(this,`_exporter`,void 0),z(this,`_isExporting`,!1),z(this,`_finishedSpans`,[]),z(this,`_timer`,void 0),z(this,`_shutdownOnce`,void 0),z(this,`_droppedSpansCount`,0),this._exporter=e,this._maxExportBatchSize=typeof(t==null?void 0:t.maxExportBatchSize)==`number`?t.maxExportBatchSize:(n=void 0)==null?512:n,this._maxQueueSize=typeof(t==null?void 0:t.maxQueueSize)==`number`?t.maxQueueSize:(r=void 0)==null?2048:r,this._scheduledDelayMillis=typeof(t==null?void 0:t.scheduledDelayMillis)==`number`?t.scheduledDelayMillis:(i=void 0)==null?5e3:i,this._exportTimeoutMillis=typeof(t==null?void 0:t.exportTimeoutMillis)==`number`?t.exportTimeoutMillis:(a=void 0)==null?3e4:a,this._shutdownOnce=new hr(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(L.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&we.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&L.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(L.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);I.with(jt(I.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,r=>{if(clearTimeout(n),r.code===Dn.SUCCESS)e();else{var i;t((i=r.error)==null?Error(`BatchSpanProcessor: span export failed`):i)}}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a!=null||(a=[]),a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{Xt(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,Xt(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},Hr=class extends Vr{constructor(e,t){super(e,t),z(this,`_visibilityChangeListener`,void 0),z(this,`_pageHideListener`,void 0),this.onInit(t)}onInit(e){(e==null?void 0:e.disableAutoFlushOnDocumentHide)!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{Xt(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{Xt(e)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}};let Ur=new Uint8Array(16),Wr=new Uint8Array(8),Gr=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Kr(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function qr(e){let t=``;for(let n=0;n<e.length;n++)t+=Gr[e[n]];return t}var Jr=class{generateTraceId(){return Kr(Ur),qr(Ur)}generateSpanId(){return Kr(Wr),qr(Wr)}};let Yr=`otel.span.sampling_result`;var Xr=class{constructor(e){z(this,`startedSpans`,void 0),z(this,`liveSpans`,void 0),this.startedSpans=e.createCounter(`otel.sdk.span.started`,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(`otel.sdk.span.live`,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=Qr(t);if(this.startedSpans.add(1,{"otel.span.parent.origin":Zr(e),[Yr]:n}),t===Ar.NOT_RECORD)return()=>{};let r={[Yr]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function Zr(e){return e?e.isRemote?`remote`:`local`:`none`}function Qr(e){switch(e){case Ar.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case Ar.RECORD:return`RECORD_ONLY`;case Ar.NOT_RECORD:return`DROP`}}var $r=class{constructor(e,t,n,r){z(this,`_sampler`,void 0),z(this,`_generalLimits`,void 0),z(this,`_spanLimits`,void 0),z(this,`_idGenerator`,void 0),z(this,`instrumentationScope`,void 0),z(this,`_resource`,void 0),z(this,`_spanProcessor`,void 0),z(this,`_tracerMetrics`,void 0);let i=zr(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Jr,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e;let a=i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,`2.7.1`):_e();this._tracerMetrics=new Xr(a)}startSpan(e,t={},n=I.active()){var r,i,a;t.root&&(n=R.deleteSpan(n));let o=R.getSpan(n);if(Mt(n))return L.debug(`Instrumentation suppressed, returning Noop Span`),R.wrapSpanContext(Te);let s=o==null?void 0:o.spanContext(),c=this._idGenerator.generateSpanId(),l,u,d;!s||!R.isSpanContextValid(s)?u=this._idGenerator.generateTraceId():(u=s.traceId,d=s.traceState,l=s);let f=(r=t.kind)==null?Je.INTERNAL:r,p=((i=t.links)==null?[]:i).map(e=>({context:e.context,attributes:Vt(e.attributes)})),m=Vt(t.attributes),h=this._sampler.shouldSample(n,u,e,f,m,p),g=this._tracerMetrics.startSpan(s,h.decision);d=(a=h.traceState)==null?d:a;let _=h.decision===qe.RECORD_AND_SAMPLED?we.SAMPLED:we.NONE,v={traceId:u,spanId:c,traceFlags:_,traceState:d};if(h.decision===qe.NOT_RECORD)return L.debug(`Recording is off, propagating context in a non-recording span`),R.wrapSpanContext(v);let y=Vt(Object.assign(m,h.attributes));return new kr({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:v,name:e,kind:f,links:p,parentSpanContext:l,attributes:y,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:g})}startActiveSpan(e,t,n,r){var i;let a,o,s;if(arguments.length<2)return;arguments.length===2?s=t:arguments.length===3?(a=t,s=n):(a=t,o=n,s=r);let c=(i=o)==null?I.active():i,l=this.startSpan(e,a,c),u=R.setSpan(c,l);return I.with(u,s,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}},ei=class{constructor(e){z(this,`_spanProcessors`,void 0),this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{Xt(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},ti;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(ti||(ti={}));var ni=class{constructor(e={}){var t,n;z(this,`_config`,void 0),z(this,`_tracers`,new Map),z(this,`_resource`,void 0),z(this,`_activeSpanProcessor`,void 0);let r=tr({},Ir(),Br(e));this._resource=(t=r.resource)==null?Tr():t,this._config=Object.assign({},r,{resource:this._resource});let i=[];(n=e.spanProcessors)!=null&&n.length&&i.push(...e.spanProcessors),this._activeSpanProcessor=new ei(i)}getTracer(e,t,n){let r=`${e}@${t||``}:${(n==null?void 0:n.schemaUrl)||``}`;return this._tracers.has(r)||this._tracers.set(r,new $r({name:e,version:t,schemaUrl:n==null?void 0:n.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=ti.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==ti.timeout&&(r=ti.resolved,n(r))}).catch(e=>{clearTimeout(i),r=ti.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==ti.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}},ri=class{constructor(){z(this,`_enabled`,!1),z(this,`_currentContext`,k)}_bindFunction(e=k,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=k,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=k,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||k;try{return t.call(n,...r)}finally{this._currentContext=i}}};function ii(e){if(e!==null){if(e===void 0){let e=new ri;e.enable(),I.setGlobalContextManager(e);return}e.enable(),I.setGlobalContextManager(e)}}function ai(e){if(e!==null){if(e===void 0){st.setGlobalPropagator(new On({propagators:[new Hn,new Lt]}));return}st.setGlobalPropagator(e)}}var oi=class extends ni{constructor(e={}){super(e)}register(e={}){R.setGlobalTracerProvider(this),ai(e.propagator),ii(e.contextManager)}},V;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(V||(V={}));let si;function ci(){return si||(si=document.createElement(`a`)),si}function li(e,t){return t in e}function ui(e,t,n,r=!0){if(li(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function di(e,t,n=!1,r,i){if(r===void 0&&(r=t[V.START_TIME]!==0),n||(ui(e,V.FETCH_START,t,r),ui(e,V.DOMAIN_LOOKUP_START,t,r),ui(e,V.DOMAIN_LOOKUP_END,t,r),ui(e,V.CONNECT_START,t,r),ui(e,V.SECURE_CONNECTION_START,t,r),ui(e,V.CONNECT_END,t,r),ui(e,V.REQUEST_START,t,r),ui(e,V.RESPONSE_START,t,r),ui(e,V.RESPONSE_END,t,r)),!i){let n=t[V.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(`http.response_content_length`,n);let r=t[V.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(`http.response_content_length_uncompressed`,r)}}function fi(e){return e.slice().sort((e,t)=>{let n=e[V.FETCH_START],r=t[V.FETCH_START];return n>r?1:n<r?-1:0})}function pi(){return typeof location<`u`?location.origin:void 0}function mi(e,t,n,r,i=new WeakSet,a){let o=_i(e);e=o.toString();let s=gi(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=fi(s);if(o.origin!==pi()&&c.length>1){let e=c[0],t=hi(c,e[V.RESPONSE_END],n),r=e[V.RESPONSE_END];return t[V.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}else return{mainRequest:s[0]}}function hi(e,t,n){let r=Sn(n),i=Sn(bn(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=Sn(bn(n[V.FETCH_START])),c=r-Sn(bn(n[V.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function gi(e,t,n,r,i,a){let o=Sn(t),s=Sn(n),c=r.filter(t=>{let n=Sn(bn(t[V.FETCH_START])),r=Sn(bn(t[V.RESPONSE_END]));return t.initiatorType.toLowerCase()===(a||`xmlhttprequest`)&&t.name===e&&n>=o&&r<=s});return c.length>0&&(c=c.filter(e=>!i.has(e))),c}function _i(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=ci();return t.href=e,t}function vi(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),_i(e).origin===pi()?!0:n.some(t=>fr(e,t))}let yi=`mxl_pending_`;var bi=class{constructor({resource:e=wr(),storage:t=window.localStorage,diag:n=L.createComponentLogger({namespace:`MXLSpanStorage`}),storedSpansExpireTimeoutMS:r=3600*1e3,onExpiredSpansExport:i,spanSessionManager:a}){z(this,`_noExportTracer`,void 0),z(this,`_storage`,void 0),z(this,`_diag`,void 0),z(this,`_onExpiredSpansExport`,void 0),z(this,`_storedSpansExpireTimeoutMS`,void 0),z(this,`_spanSessionManager`,void 0),z(this,`_checkExpiredSpansInterval`,void 0),this._noExportTracer=new ni({resource:e}).getTracer(`mxl-web-sdk-sessions`),this._storage=t,this._diag=n,this._storedSpansExpireTimeoutMS=r,this._onExpiredSpansExport=i,this._spanSessionManager=a,this.startExpiredSpansCheck()}storePendingSpans(e,t,n){try{if(this.clearStoredSpans(e),this._getPendingSpansKeys().length>=10){this._spanSessionManager.incrSessionCountForKey(`mxl.max_pending_spans_reached`),this._diag.warn(`Not storing pending spans as the max number of items was reached`);return}let r=`${yi}${e}_${Date.now()}`;this._storage.setItem(r,JSON.stringify([t,...n],(e,t)=>e.startsWith(`_`)?void 0:t)),this._diag.debug(`Stored pending span: ${r}`)}catch(e){this._diag.error(`Failed to store spans to storage:`,e)}}clearStoredSpans(e){try{let t=`${yi}${e}_`;this._getPendingSpansKeys().forEach(e=>{e.startsWith(t)&&this._storage.removeItem(e)})}catch(e){this._diag.error(`Failed to clear stored spans from storage:`,e)}}startExpiredSpansCheck(){this._checkExpiredSpansInterval=setInterval(()=>{this.checkAndExportExpiredSpans()},300*1e3)}stopExpiredSpansCheck(){this._checkExpiredSpansInterval&&(clearInterval(this._checkExpiredSpansInterval),this._checkExpiredSpansInterval=void 0)}checkAndExportExpiredSpans(){try{let e=this._getPendingSpansKeys();if(e.length===0)return;let t=Date.now();e.forEach(e=>{let n=e.split(`_`),r=parseInt(n[n.length-1],10);if(Number.isNaN(r)&&(this._diag.error(`Found invalid timestamp in stored span:`,r),this._storage.removeItem(e)),t-r<=this._storedSpansExpireTimeoutMS)return;let i=this._storage.getItem(e);if(i){try{let e=[];for(let t of JSON.parse(i)){let n=this._noExportTracer.startSpan(t.name,{kind:t.kind,attributes:t.attributes,links:t.links,startTime:t.startTime});n.setStatus(t.status),n.end(t.endTime),e.push(n)}this._onExpiredSpansExport&&e.length>0&&this._onExpiredSpansExport(e)}catch(e){this._diag.error(`Failed to process expired spans:`,e)}this._storage.removeItem(e)}})}catch(e){this._diag.error(`Failed to check and export expired spans:`,e)}}_getPendingSpansKeys(){let e=[];for(let t=0;t<this._storage.length;t++){let n=this._storage.key(t);n!=null&&n.startsWith(yi)&&e.push(n)}return e}destroy(){this.stopExpiredSpansCheck()}},xi=class{constructor(e,t){z(this,`_keyPrefix`,void 0),z(this,`_storage`,void 0),this._keyPrefix=`${e}_`,this._storage=t}getNamespacedKeys(){let e=[];for(let t=0;t<this._storage.length;t++){let n=this._storage.key(t);n!=null&&n.startsWith(this._keyPrefix)&&e.push(n.substring(this._keyPrefix.length))}return e}get length(){return this.getNamespacedKeys().length}clear(){this.getNamespacedKeys().forEach(e=>{this._storage.removeItem(`${this._keyPrefix}${e}`)})}getItem(e){return this._storage.getItem(`${this._keyPrefix}${e}`)}key(e){return this.getNamespacedKeys()[e]||null}removeItem(e){this._storage.removeItem(`${this._keyPrefix}${e}`)}setItem(e,t){this._storage.setItem(`${this._keyPrefix}${e}`,t)}getStorageEventKey(e){return`${this._keyPrefix}${e}`}};let Si=({diag:e,featureManager:t,registerGlobally:n,propagator:r,defaultInstrumentationConfig:i})=>{var a;if(!t.isNetworkSpanForwardingEnabled())return!1;let o=[];return n||o.push("Network span forwarding cannot be used when `registerGlobally` is set to false. Turning off network span forwarding."),r&&o.push("Network span forwarding cannot be used alongside a custom `propagator`. Turning off network span forwarding."),!(i==null||(a=i.omit)==null)&&a.has(`@opentelemetry/instrumentation-xml-http-request`)&&i.omit.has(`@opentelemetry/instrumentation-fetch`)&&o.push(`Network span forwarding cannot be used when both '@opentelemetry/instrumentation-xml-http-request' and '@opentelemetry/instrumentation-fetch' are omitted. Turning off network span forwarding.`),o.forEach(t=>{e.warn(t)}),o.length===0};var Ci=class{constructor(e=window.performance){z(this,`_clock`,void 0),z(this,`epochMillisFromOriginOffset`,e=>this._clock.timeOrigin+e),z(this,`getNowHRTime`,()=>vn(this.getNowMillis())),z(this,`getNowMillis`,()=>this.epochMillisFromOriginOffset(this._clock.now())),z(this,`millisSinceHRTime`,e=>this.getNowMillis()-Cn(e)),z(this,`millisFromZeroTime`,e=>e),this._clock=e}};function wi(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Ti(e,t){if(e==null)return{};var n,r,i=wi(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ei(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ei(Object(n),!0).forEach(function(t){z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ei(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let Di=[`diag`];function Oi(e){var t,n;return typeof PerformanceObserver<`u`&&((t=(n=PerformanceObserver.supportedEntryTypes)==null?void 0:n.includes(e))==null?!1:t)}function ki(e,t,n){let r=n==null?{}:n,{diag:i}=r,a=Ti(r,Di);if(!Oi(e))return i==null||i.debug(`${e} not supported, skipping observer`),null;try{let n=new PerformanceObserver(n=>{for(let r of n.getEntries())try{t(r)}catch(t){i==null||i.error(`error processing ${e} entry`,t)}});return n.observe(H({type:e,buffered:!0},a)),n}catch(e){return null}}let Ai=(e,t=1e3)=>{let n=!1;return(...r)=>{n||(e(...r),setTimeout(()=>{n=!1},t),n=!0)}};var ji=class{logException(e,t){}message(e,t,n){}};let Mi=new ji;var Ni=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?Mi:e}setDelegate(e){this._delegate=e}logException(e,t){this.getDelegate().logException(e,t)}message(e,t,n){this.getDelegate().message(e,t,n)}};let Pi=new ji,Fi=new Set([`setDelegate`,`getDelegate`]);var Ii=class e{static getInstance(){if(!e._instance){let t=new Ni,n=dt(t,Pi,L.createComponentLogger({namespace:`LogAPI`}),Fi);e._instance=Object.assign(n,{setGlobalLogManager(e){t.setDelegate(e)},getLogManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(Ii,`_instance`,void 0);let Li=Ii.getInstance();var Ri=class{setCurrentRoute(e){}getCurrentRoute(){return null}getCurrentPageId(){return``}setPageLabel(e){}getPageLabel(){return null}clearCurrentRoute(){}};let zi=new Ri;var Bi=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?zi:e}setDelegate(e){this._delegate=e}setCurrentRoute(e){this.getDelegate().setCurrentRoute(e)}getCurrentRoute(){return this.getDelegate().getCurrentRoute()}getCurrentPageId(){return this.getDelegate().getCurrentPageId()}setPageLabel(e){this.getDelegate().setPageLabel(e)}getPageLabel(){return this.getDelegate().getPageLabel()}clearCurrentRoute(){this.getDelegate().clearCurrentRoute()}};let Vi=new Ri,Hi=new Set([`setDelegate`,`getDelegate`]);var Ui=class e{static getInstance(){if(!e._instance){let t=new Bi,n=dt(t,Vi,L.createComponentLogger({namespace:`PageAPI`}),Hi);e._instance=Object.assign(n,{setGlobalPageManager(e){t.setDelegate(e)},getPageManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(Ui,`_instance`,void 0);let Wi=Ui.getInstance();var Gi=class{constructor(){z(this,`getSessionId`,()=>null),z(this,`getPreviousSessionId`,()=>null)}addBreadcrumb(e){}addProperty(e,t,n){}removeProperty(e){}endSessionSpan(){}endSessionSpanInternal(e){}currentSessionAsReadableSpan(e){return null}getSessionSpan(){return null}getSessionStartTime(){return null}startSessionSpan(){}addSessionStartedListener(e){return()=>{}}addSessionEndedListener(e){return()=>{}}};let Ki=new Gi;var qi=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?Ki:e}setDelegate(e){this._delegate=e}addBreadcrumb(e){this.getDelegate().addBreadcrumb(e)}addProperty(e,t,n){this.getDelegate().addProperty(e,t,n)}removeProperty(e){this.getDelegate().removeProperty(e)}endSessionSpan(){this.getDelegate().endSessionSpan()}endSessionSpanInternal(e){this.getDelegate().endSessionSpanInternal(e)}currentSessionAsReadableSpan(e){return this.getDelegate().currentSessionAsReadableSpan(e)}getSessionId(){return this.getDelegate().getSessionId()}getPreviousSessionId(){return this.getDelegate().getPreviousSessionId()}getSessionSpan(){return this.getDelegate().getSessionSpan()}getSessionStartTime(){return this.getDelegate().getSessionStartTime()}startSessionSpan(e){this.getDelegate().startSessionSpan(e)}addSessionStartedListener(e){return this.getDelegate().addSessionStartedListener(e)}addSessionEndedListener(e){return this.getDelegate().addSessionEndedListener(e)}};let Ji=new Gi,Yi=new Set([`setDelegate`,`getDelegate`]);var Xi=class e{static getInstance(){if(!e._instance){let t=new qi,n=dt(t,Ji,L.createComponentLogger({namespace:`SessionAPI`}),Yi);e._instance=Object.assign(n,{setGlobalSessionManager(e){t.setDelegate(e)},getSpanSessionManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(Xi,`_instance`,void 0);let Zi=Xi.getInstance();var Qi=class{constructor(e=Te){z(this,`_spanContext`,void 0),z(this,`attributes`,{}),this._spanContext=e}fail(e){}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}removeAttribute(e){return this}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}},$i=class{startSpan(e,t){return new Qi}setSpan(e,t){return k}getSpan(e){}};let ea=new $i;var ta=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?ea:e}setDelegate(e){this._delegate=e}startSpan(e,t,n){return this.getDelegate().startSpan(e,t,n)}setSpan(e,t){return this.getDelegate().setSpan(e,t)}getSpan(e){return this.getDelegate().getSpan(e)}};let na=new $i,ra=new Set([`setDelegate`,`getDelegate`]);var ia=class e{static getInstance(){if(!e._instance){let t=new ta,n=dt(t,na,L.createComponentLogger({namespace:`TraceAPI`}),ra);e._instance=Object.assign(n,{setGlobalTraceManager(e){t.setDelegate(e)},getTraceManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(ia,`_instance`,void 0);let aa=ia.getInstance();var oa=class{getMXLUserId(){return``}getUserId(){return null}setUserId(){}clearUserId(){}};let sa=new oa;var ca=class{constructor(){z(this,`_delegate`,void 0)}getDelegate(){var e;return(e=this._delegate)==null?sa:e}setDelegate(e){this._delegate=e}getMXLUserId(){return this.getDelegate().getMXLUserId()}getUserId(){return this.getDelegate().getUserId()}setUserId(e){this.getDelegate().setUserId(e)}clearUserId(){this.getDelegate().clearUserId()}};let la=new oa,ua=new Set([`setDelegate`,`getDelegate`]);var da=class e{static getInstance(){if(!e._instance){let t=new ca,n=dt(t,la,L.createComponentLogger({namespace:`UserAPI`}),ua);e._instance=Object.assign(n,{setGlobalUserManager(e){t.setDelegate(e)},getUserManager(){return t}})}return e._instance}static resetInstance(){e._instance=void 0}};z(da,`_instance`,void 0);let fa=da.getInstance(),pa={pageLabel:Tt};var ma=class{emit(e){}enabled(){return!1}};let ha=new ma,ga=Symbol.for(`io.opentelemetry.js.api.logs`),_a=globalThis;function va(e,t,n){return r=>r===e?t:n}let ya=new class{getLogger(e,t,n){return new ma}};var ba=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):ha}},xa=class{getLogger(e,t,n){var r;return(r=this._getDelegateLogger(e,t,n))==null?new ba(this,e,t,n):r}_getDelegate(){var e;return(e=this._delegate)==null?ya:e}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getLogger(e,t,n)}};let Sa=class e{constructor(){this._proxyLoggerProvider=new xa}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return _a[ga]?this.getLoggerProvider():(_a[ga]=va(1,e,ya),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=_a[ga])==null?void 0:e.call(_a,1))==null?this._proxyLoggerProvider:t}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete _a[ga],this._proxyLoggerProvider=new xa}}.getInstance();function Ca(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function wa(e){e.forEach(e=>e.disable())}function Ta(e){var t,n;let r=e.tracerProvider||R.getTracerProvider(),i=e.meterProvider||Qe.getMeterProvider(),a=e.loggerProvider||Sa.getLoggerProvider(),o=(t=(n=e.instrumentations)==null?void 0:n.flat())==null?[]:t;return Ca(o,r,i,a),()=>{wa(o)}}let Ea=console.error.bind(console);function Da(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}let Oa=(e,t,n)=>{if(!e||!e[t]){Ea(`no original function `+String(t)+` to wrap`);return}if(!n){Ea(`no wrapper function`),Ea(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){Ea(`original object and wrapper must be functions`);return}let i=n(r,t);return Da(i,`__original`,r),Da(i,`__unwrap`,()=>{e[t]===i&&Da(e,t,r)}),Da(i,`__wrapped`,!0),Da(e,t,i),i},ka=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Ea(`must provide one or more modules to patch`),Ea(Error().stack);return}if(!(t&&Array.isArray(t))){Ea(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Oa(e,t,n)})})},Aa=(e,t)=>{if(!e||!e[t]){Ea(`no function to unwrap.`),Ea(Error().stack);return}let n=e[t];if(!n.__unwrap)Ea(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},ja=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Ea(`must provide one or more modules to patch`),Ea(Error().stack);return}if(!(t&&Array.isArray(t))){Ea(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{Aa(e,t)})})};function Ma(e){e&&e.logger&&(typeof e.logger==`function`?Ea=e.logger:Ea(`new logger isn't a function, not replacing`))}Ma.wrap=Oa,Ma.massWrap=ka,Ma.unwrap=Aa,Ma.massUnwrap=ja;var Na=class{constructor(e,t,n){z(this,`_config`,{}),z(this,`_tracer`,void 0),z(this,`_meter`,void 0),z(this,`_logger`,void 0),z(this,`_diag`,void 0),z(this,`instrumentationName`,void 0),z(this,`instrumentationVersion`,void 0),z(this,`_wrap`,Oa),z(this,`_unwrap`,Aa),z(this,`_massWrap`,ka),z(this,`_massUnwrap`,ja),this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=L.createComponentLogger({namespace:e}),this._tracer=R.getTracer(e,t),this._meter=Qe.getMeter(e,t),this._logger=Sa.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var e;let t=(e=this.init())==null?[]:e;return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config=H({enabled:!0},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},Pa=class extends Na{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function Fa(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}var U;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(U||(U={}));function Ia(e,t){let n=U.OLD,r=t==null?void 0:t.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r==null?[]:r)if(t.toLowerCase()===e+`/dup`){n=U.DUPLICATE;break}else t.toLowerCase()===e&&(n=U.STABLE);return n}let La=`session.id`,Ra=`user.id`;var za;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRACE=1]=`TRACE`,e[e.TRACE2=2]=`TRACE2`,e[e.TRACE3=3]=`TRACE3`,e[e.TRACE4=4]=`TRACE4`,e[e.DEBUG=5]=`DEBUG`,e[e.DEBUG2=6]=`DEBUG2`,e[e.DEBUG3=7]=`DEBUG3`,e[e.DEBUG4=8]=`DEBUG4`,e[e.INFO=9]=`INFO`,e[e.INFO2=10]=`INFO2`,e[e.INFO3=11]=`INFO3`,e[e.INFO4=12]=`INFO4`,e[e.WARN=13]=`WARN`,e[e.WARN2=14]=`WARN2`,e[e.WARN3=15]=`WARN3`,e[e.WARN4=16]=`WARN4`,e[e.ERROR=17]=`ERROR`,e[e.ERROR2=18]=`ERROR2`,e[e.ERROR3=19]=`ERROR3`,e[e.ERROR4=20]=`ERROR4`,e[e.FATAL=21]=`FATAL`,e[e.FATAL2=22]=`FATAL2`,e[e.FATAL3=23]=`FATAL3`,e[e.FATAL4=24]=`FATAL4`})(za||(za={}));var Ba=class{emit(e){}enabled(){return!1}};let Va=new Ba,Ha=Symbol.for(`io.opentelemetry.js.api.logs`),Ua=globalThis;function Wa(e,t,n){return r=>r===e?t:n}let Ga=new class{getLogger(e,t,n){return new Ba}};var Ka=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Va}},qa=class{getLogger(e,t,n){var r;return(r=this._getDelegateLogger(e,t,n))==null?new Ka(this,e,t,n):r}_getDelegate(){var e;return(e=this._delegate)==null?Ga:e}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){var r;return(r=this._delegate)==null?void 0:r.getLogger(e,t,n)}};let Ja=class e{constructor(){this._proxyLoggerProvider=new qa}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return Ua[Ha]?this.getLoggerProvider():(Ua[Ha]=Wa(1,e,Ga),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return(t=(e=Ua[Ha])==null?void 0:e.call(Ua,1))==null?this._proxyLoggerProvider:t}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete Ua[Ha],this._proxyLoggerProvider=new qa}}.getInstance();var Ya=class{constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,z(this,`_config`,{}),z(this,`_diag`,void 0),z(this,`_tracer`,void 0),z(this,`_meter`,void 0),z(this,`_logger`,void 0),this.setConfig(n),this._diag=L.createComponentLogger({namespace:e}),this._tracer=R.getTracer(e,t),this._meter=Qe.getMeter(e,t),this._logger=Ja.getLogger(e,t),this._updateMetricInstruments()}get tracer(){return this._tracer}get meter(){return this._meter}get logger(){return this._logger}getModuleDefinitions(){var e;let t=(e=this.init())==null?[]:e;return Array.isArray(t)?t:[t]}getConfig(){return this._config}setConfig(e){this._config=H({enabled:!0},e)}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}_updateMetricInstruments(){}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},Xa=class extends Ya{constructor({instrumentationName:e,instrumentationVersion:t,config:n,diag:r,perf:i,limitManager:a}){super(e,t,n),z(this,`_sessionManager`,void 0),z(this,`_logManager`,void 0),z(this,`_limitManager`,void 0),z(this,`_perf`,void 0),r&&(this._diag=r),this._perf=i==null?new Ci:i,this._sessionManager=Zi.getSpanSessionManager(),this._logManager=Li.getLogManager(),this._limitManager=a}get limitManager(){return this._limitManager}get sessionManager(){return this._sessionManager}get logManager(){return this._logManager}get perf(){return this._perf}init(){}setLimitManager(e){this._limitManager=e}setLogManager(e){this._logManager=e}setSessionManager(e){this._sessionManager=e}};let Za=()=>{let e={},t=window.performance.getEntriesByType(`navigation`)[0];return Object.values(V).forEach(n=>{if(li(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}}),e},Qa={"first-paint":`firstPaint`,"first-contentful-paint":`firstContentfulPaint`},$a=e=>{window.performance.getEntriesByType(`paint`).forEach(({name:t,startTime:n})=>{li(Qa,t)&&e.addEvent(Qa[t],n)})};var eo=class extends Xa{constructor({diag:e,perf:t,enabled:n,applyCustomAttributesOnSpan:r,ignorePerformancePaintEvents:i=!1,ignoreNetworkEvents:a=!1}={}){super({instrumentationName:`DocumentLoadInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{enabled:n,applyCustomAttributesOnSpan:r,ignorePerformancePaintEvents:i,ignoreNetworkEvents:a}}),z(this,`_onDocumentLoaded`,void 0),z(this,`_performanceCollected`,!1),this._onDocumentLoaded=()=>{window.setTimeout(()=>{this._collectPerformance()},0)},this._config.enabled&&this.enable()}init(){this._diag.debug(`Initializing document load instrumentation`)}_addResourcesSpans(e){performance.getEntriesByType(`resource`).forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){if(this._performanceCollected)return;this._performanceCollected=!0;let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===Rn),t=Za(),n=(e==null?void 0:e.content)||``;I.with(st.extract(k,{traceparent:n}),()=>{var e;let n=this._startSpan(`documentLoad`,V.FETCH_START,t);n&&(I.with(R.setSpan(I.active(),n),()=>{let e=this._startSpan(`documentFetch`,V.FETCH_START,t);e&&(e.setAttribute(fn,location.href),I.with(R.setSpan(I.active(),e),()=>{var n;di(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,(n=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:n.documentFetch),this._endSpan(e,V.RESPONSE_END,t)}))}),n.setAttribute(_t,`ux.document_load`),n.setAttribute(fn,location.href),n.setAttribute(pn,navigator.userAgent),this._addResourcesSpans(n),this.getConfig().ignoreNetworkEvents||(ui(n,V.FETCH_START,t),ui(n,V.UNLOAD_EVENT_START,t),ui(n,V.UNLOAD_EVENT_END,t),ui(n,V.DOM_INTERACTIVE,t),ui(n,V.DOM_CONTENT_LOADED_EVENT_START,t),ui(n,V.DOM_CONTENT_LOADED_EVENT_END,t),ui(n,V.DOM_COMPLETE,t),ui(n,V.LOAD_EVENT_START,t),ui(n,V.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||$a(n),this._addCustomAttributesOnSpan(n,(e=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:e.documentLoad),this._endSpan(n,V.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(li(n,t)&&typeof n[t]==`number`?e.end(n[t]):e.end())}_initResourceSpan(e,t){var n;let r=this._startSpan(`resourceFetch`,V.FETCH_START,e,t);r&&(r.setAttribute(_t,`ux.resource_fetch`),r.setAttribute(fn,e.name),di(r,e,this.getConfig().ignoreNetworkEvents),e.deliveryType&&r.setAttribute(`http.response.delivery_type`,e.deliveryType),e.initiatorType&&r.setAttribute(`http.request.initiator_type`,e.initiatorType),e.renderBlockingStatus&&r.setAttribute(`http.request.render_blocking_status`,e.renderBlockingStatus),e.responseStatus&&r.setAttribute(an,e.responseStatus),typeof e.encodedBodySize==`number`&&e.encodedBodySize>=0&&r.setAttribute(`http.response.body.size`,e.encodedBodySize),typeof e.transferSize==`number`&&e.transferSize>=0&&r.setAttribute(`http.response.size`,e.transferSize),typeof e.decodedBodySize==`number`&&e.decodedBodySize>=0&&r.setAttribute(`http.response.decoded_body_size`,e.decodedBodySize),this._addResourceDiagnosticAttributes(r,e),this._addCustomAttributesOnResourceSpan(r,e,(n=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:n.resourceFetch),this._endSpan(r,V.RESPONSE_END,e))}_startSpan(e,t,n,r){if(li(n,t)&&typeof n[t]==`number`)return this.tracer.startSpan(e,{startTime:n[t]},r?R.setSpan(I.active(),r):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():window.addEventListener(`load`,this._onDocumentLoaded)}_addCustomAttributesOnSpan(e,t){t&&Fa(()=>{t(e)},e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&Fa(()=>{n(e,t)},e=>{e&&this._diag.error(`addCustomAttributesOnResourceSpan`,e)},!0)}_hasNoSizeData(e){let t=typeof e.transferSize==`number`?e.transferSize:0,n=typeof e.decodedBodySize==`number`?e.decodedBodySize:0,r=typeof e.encodedBodySize==`number`?e.encodedBodySize:0;return t===0&&n===0&&r===0}_hasTimingData(e){let t=typeof e.fetchStart==`number`?e.fetchStart:0,n=typeof e.responseEnd==`number`?e.responseEnd:0;return t>0&&n>0}_isCorsRestricted(e){return this._hasNoSizeData(e)&&this._hasTimingData(e)}_isFetchIncomplete(e){let t=typeof e.fetchStart==`number`?e.fetchStart:0,n=typeof e.responseEnd==`number`?e.responseEnd:0;return this._hasNoSizeData(e)&&t>0&&n===0}_isFetchPrevented(e){let t=typeof e.fetchStart==`number`?e.fetchStart:0;return this._hasNoSizeData(e)&&t===0}_isCacheValidated(e){let t=typeof e.transferSize==`number`?e.transferSize:0,n=typeof e.deliveryType==`string`?e.deliveryType:``;return t===300&&n!==`cache`}_addResourceDiagnosticAttributes(e,t){this._isCorsRestricted(t)?e.setAttribute(`http.response.cors_opaque`,!0):this._isFetchIncomplete(t)?e.setAttribute(`http.request.incomplete`,!0):this._isFetchPrevented(t)&&e.setAttribute(`http.request.prevented`,!0),this._isCacheValidated(t)&&e.setAttribute(`http.response.cache_revalidated`,!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}},to=class extends Xa{constructor({diag:e,perf:t,rootNode:n,emptyCheckDelayMs:r=500}){super({instrumentationName:`EmptyRootInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_observer`,void 0),z(this,`_emptyCheckDelayMs`,void 0),z(this,`_rootNode`,void 0),this._rootNode=n,this._emptyCheckDelayMs=r,this._observer=new MutationObserver((e,t)=>{this._observerCallback(e)}),this._config.enabled&&this._rootNode?this.enable():this._rootNode||this._diag.warn(`supplied root node was null, this instrumentation won't be enabled`)}disable(){this._observer.disconnect()}enable(){this._rootNode&&this._observer.observe(this._rootNode,{childList:!0})}_observerCallback(e){let t=!1,n=!1;for(let r of e)r.target===this._rootNode&&(r.removedNodes.length>0&&(t=!0),r.addedNodes.length>0&&(n=!0));t&&!n&&(this._diag.debug(`root node had child nodes removed without new ones being added, checking if it's empty in ${this._emptyCheckDelayMs}ms`),window.setTimeout(()=>{this._checkForEmptyRootNode()},this._emptyCheckDelayMs))}_checkForEmptyRootNode(){var e;if(((e=this._rootNode)==null?void 0:e.childNodes.length)===0){this._diag.debug(`root node was found to be empty`);let e=this.sessionManager.getSessionSpan();e?e.addEvent(`empty-root-node`,{"mxl.type":`ux.empty_root_node`}):this._diag.debug(`no active session found to emit event on`)}}};let no=(e,t)=>{let n=e.nodeName.toLowerCase(),r=t.substring(0,30),i=t.length>30?`...`:``;return`<${n}${e.className?` class="${e.className}"`:``}>${r}${i}</${n}>`};var ro=class extends Xa{constructor({diag:e,perf:t,shouldTrack:n,innerTextForElement:r}={}){super({instrumentationName:`ClicksInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_onClickHandler`,void 0),this._onClickHandler=e=>{let t=e.target;if(t instanceof HTMLElement&&!t.hasAttribute(`disabled`)&&!(n&&!n(t)))try{let n=this.sessionManager.getSessionSpan();n&&n.addEvent(`click`,{"mxl.type":`ux.tap`,"view.name":no(t,r?r(t):t.innerText),"tap.coords":`${e.x.toString()},${e.y.toString()}`},this.perf.epochMillisFromOriginOffset(e.timeStamp))}catch(e){this._diag.error(`failed to create new user interaction span event`,e)}},this._config.enabled&&this.enable()}disable(){document.removeEventListener(`click`,this._onClickHandler)}enable(){document.addEventListener(`click`,this._onClickHandler)}},io=class extends Xa{constructor({diag:e,perf:t,limitManager:n}={}){super({instrumentationName:`ElementTimingInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,limitManager:n,config:{}}),z(this,`_observer`,null),z(this,`_isEnabled`,!1),this._config.enabled&&this.enable()}enable(){if(!this._isEnabled){if(!Oi(`element`)){this._diag.debug(`element not supported, skipping`);return}if(this._isEnabled=!0,this._observer&&this._observer.disconnect(),this._observer=ki(`element`,e=>this._processEntry(e),{diag:this._diag}),!this._observer){this._isEnabled=!1,this._diag.error(`failed to enable`);return}}}disable(){this._isEnabled=!1,this._observer&&(this._observer.disconnect(),this._observer=null)}_processEntry(e){var t,n;if(!this._isEnabled||(t=this.limitManager)!=null&&t.limitElementTimingEntry())return;let r=this.tracer.startSpan(e.identifier,{startTime:this.perf.epochMillisFromOriginOffset(0),attributes:{[_t]:`ux.element_timing`,"mxl.element_timing.identifier":e.identifier,"mxl.element_timing.element":(n=e.element)==null||(n=n.tagName)==null?void 0:n.toLowerCase(),"mxl.element_timing.render_time":e.renderTime,"mxl.element_timing.load_time":e.loadTime,"mxl.element_timing.start_time":e.startTime,"mxl.element_timing.url":e.url,"mxl.element_timing.natural_width":e.naturalWidth,"mxl.element_timing.natural_height":e.naturalHeight}});e.loadTime>0&&r.addEvent(`load`,this.perf.epochMillisFromOriginOffset(e.loadTime)),r.end(this.perf.epochMillisFromOriginOffset(e.startTime))}},ao=class extends Xa{constructor({diag:e,perf:t}={}){super({instrumentationName:`GlobalExceptionInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_onErrorHandler`,void 0),z(this,`_onUnhandledRejectionHandler`,void 0),this._onErrorHandler=e=>{this.logManager.logException(e.error||e.message,{handled:!1,timestamp:this.perf.epochMillisFromOriginOffset(e.timeStamp),handler:`global_exception`})},this._onUnhandledRejectionHandler=e=>{this.logManager.logException(e.reason,{handled:!1,timestamp:this.perf.epochMillisFromOriginOffset(e.timeStamp),handler:`promise_rejection`})},this._config.enabled&&this.enable()}disable(){window.removeEventListener(`error`,this._onErrorHandler),window.removeEventListener(`unhandledrejection`,this._onUnhandledRejectionHandler)}enable(){window.addEventListener(`error`,this._onErrorHandler),window.addEventListener(`unhandledrejection`,this._onUnhandledRejectionHandler)}},oo=class extends Xa{constructor({diag:e,perf:t}={}){super({instrumentationName:`LoafInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_observer`,null),z(this,`_isFirstEntry`,!0),z(this,`_removeSessionEndListener`,null),z(this,`_isEnabled`,!1),z(this,`_totalDuration`,0),z(this,`_workDuration`,0),z(this,`_styleLayoutDuration`,0),z(this,`_count`,0),z(this,`_longestDuration`,0),z(this,`_longestDurationExcludingFirst`,0),z(this,`_totalBlockingDuration`,0),z(this,`_scriptSummaries`,new Map),this._config.enabled&&this.enable()}enable(){if(!this._isEnabled){if(!Oi(`long-animation-frame`)){this._diag.debug(`long-animation-frame not supported, skipping`);return}if(this._isEnabled=!0,this._observer&&this._observer.disconnect(),this._observer=ki(`long-animation-frame`,e=>this._processEntry(e),{diag:this._diag}),!this._observer){this._isEnabled=!1,this._diag.error(`failed to enable`);return}this._registerSessionEndListener()}}_registerSessionEndListener(){this._isEnabled&&(this._removeSessionEndListener&&this._removeSessionEndListener(),this._removeSessionEndListener=this.sessionManager.addSessionEndedListener(()=>{try{this._flushReport()}catch(e){this._diag.error(`error flushing report`,e)}}))}setSessionManager(e){super.setSessionManager(e),this._registerSessionEndListener()}disable(){this._isEnabled=!1,this._resetAccumulators(),this._observer&&(this._observer.disconnect(),this._observer=null),this._removeSessionEndListener&&(this._removeSessionEndListener(),this._removeSessionEndListener=null)}_processEntry(e){if(this._isEnabled){this._count++,this._totalDuration+=e.duration,this._workDuration+=e.renderStart?e.renderStart-e.startTime:e.duration,e.styleAndLayoutStart&&(this._styleLayoutDuration+=Math.max(0,e.startTime+e.duration-e.styleAndLayoutStart)),this._longestDuration=Math.max(this._longestDuration,e.duration),this._isFirstEntry&&this._count===1?this._isFirstEntry=!1:(this._longestDurationExcludingFirst=Math.max(this._longestDurationExcludingFirst,e.duration),e.firstUIEventTimestamp===0&&(this._totalBlockingDuration+=e.blockingDuration));try{for(let t of e.scripts){let e=t.sourceURL||`(inline)`;e.length>2048&&(e=`${e.substring(0,2048)}...`);let n=this._scriptSummaries.get(e);n?(n.totalDuration+=t.duration,n.styleAndLayoutDuration+=t.forcedStyleAndLayoutDuration,n.count++):this._scriptSummaries.set(e,{totalDuration:t.duration,styleAndLayoutDuration:t.forcedStyleAndLayoutDuration,count:1})}}catch(e){this._diag.error(`error processing scripts for entry`,e)}}}_flushReport(){if(this._count===0)return;let e;e=this._totalBlockingDuration<=200?`good`:this._totalBlockingDuration<=600?`needs-improvement`:`poor`;let t={[_t]:`ux.web_vital`,"mxl.web_vital.id":ht(),"mxl.web_vital.name":`TBD`,"mxl.web_vital.value":Math.round(this._totalBlockingDuration),"mxl.web_vital.rating":e,"mxl.tbd.loaf_total_duration":Math.round(this._totalDuration),"mxl.tbd.loaf_work_duration":Math.round(this._workDuration),"mxl.tbd.loaf_style_and_layout_duration":Math.round(this._styleLayoutDuration),"mxl.tbd.loaf_count":this._count,"mxl.tbd.loaf_longest_duration":Math.round(this._longestDuration),"mxl.tbd.loaf_longest_duration_excluding_first":Math.round(this._longestDurationExcludingFirst)};try{this.logger.emit({eventName:`mxl-loaf-report`,severityNumber:za.INFO,attributes:t})}catch(e){this._diag.error(`error emitting loaf report`,e)}try{if(this._scriptSummaries.size>0){let e=[...this._scriptSummaries].sort((e,t)=>t[1].totalDuration-e[1].totalDuration).slice(0,250).map(([e,t])=>[e,{total_duration:Math.round(t.totalDuration),style_and_layout_duration:Math.round(t.styleAndLayoutDuration),count:t.count}]);this.logger.emit({eventName:`mxl-loaf-scripts`,severityNumber:za.INFO,body:JSON.stringify(Object.fromEntries(e)),attributes:{[_t]:`ux.loaf_scripts`}})}}catch(e){this._diag.error(`error emitting loaf script summary`,e)}this._resetAccumulators()}_resetAccumulators(){this._totalDuration=0,this._workDuration=0,this._styleLayoutDuration=0,this._count=0,this._longestDuration=0,this._longestDurationExcludingFirst=0,this._totalBlockingDuration=0,this._scriptSummaries=new Map}};let so=/\([^()]+\)/g;var co=class extends Xa{constructor({diag:e,shouldCleanupPathOptionsFromRouteName:t=!0}){super({instrumentationName:`NavigationInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,config:{}}),z(this,`_shouldCleanupPathOptionsFromRouteName`,!0),z(this,`_currentRouteSpan`,null),z(this,`_instrumentationType`,`manual`),z(this,`_removeSessionStartedFn`,null),z(this,`_removeSessionEndedFn`,null),z(this,`setInstrumentationType`,e=>{this._instrumentationType=e}),z(this,`setCurrentRoute`,e=>{if(!this._config.enabled)return;let t=Wi.getCurrentRoute();e.url!==(t==null?void 0:t.url)&&(Wi.setCurrentRoute(e),this._endRouteSpan(t),this._startRouteSpan(e))}),z(this,`_setupSessionListeners`,()=>{this._removeSessionStartedFn||(this._removeSessionStartedFn=this.sessionManager.addSessionStartedListener(()=>{let e=Wi.getCurrentRoute();e&&!this._currentRouteSpan&&(this._diag.debug(`Session started, starting route span.`),this._startRouteSpan(e))})),this._removeSessionEndedFn||(this._removeSessionEndedFn=this.sessionManager.addSessionEndedListener(()=>{this._currentRouteSpan&&(this._diag.debug(`Session ended, ending route span.`),this._endRouteSpan(Wi.getCurrentRoute()))}))}),z(this,`_cleanUpSessionListeners`,()=>{this._removeSessionStartedFn&&(this._removeSessionStartedFn(),this._removeSessionStartedFn=null),this._removeSessionEndedFn&&(this._removeSessionEndedFn(),this._removeSessionEndedFn=null)}),z(this,`_startRouteSpan`,e=>{this._diag.debug(`Starting route span for url: ${e.url}`),this._setupSessionListeners();let t=this._shouldCleanupPathOptionsFromRouteName?e.path.replace(so,``):e.path;return this._currentRouteSpan=this.tracer.startSpan(t,{attributes:{[_t]:`ux.surface`,[Ct]:t,[wt]:Wi.getCurrentPageId()||void 0}}),this._currentRouteSpan.setAttribute(bt,this._instrumentationType),this._currentRouteSpan}),z(this,`_endRouteSpan`,e=>{this._currentRouteSpan&&(e&&this._diag.debug(`Ending route span for url: ${e.url}`),this._currentRouteSpan.end(),this._currentRouteSpan=null)}),z(this,`enable`,()=>{this.setConfig({enabled:!0}),this._diag.debug(`NavigationInstrumentation enabled, listening for navigation events.`)}),z(this,`disable`,()=>{this._cleanUpSessionListeners(),this.setConfig({enabled:!1}),this._diag.debug(`NavigationInstrumentation disabled, stopped listening for navigation events.`)}),this._shouldCleanupPathOptionsFromRouteName=t,this._config.enabled&&this.enable()}};let lo,uo=(e={})=>(lo||(lo=new co(e)),lo);var fo=class extends Xa{constructor({diag:e,perf:t,limitManager:n}={}){super({instrumentationName:`ServerTimingInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,limitManager:n,config:{}}),z(this,`_onLoad`,void 0),z(this,`_performanceCollected`,!1),this._onLoad=()=>{this._readServerTiming()},this._config.enabled&&this.enable()}enable(){if(window.removeEventListener(`load`,this._onLoad),window.document.readyState===`complete`){this._readServerTiming();return}window.addEventListener(`load`,this._onLoad)}disable(){window.removeEventListener(`load`,this._onLoad)}_readServerTiming(){var e;if(this._performanceCollected)return;this._performanceCollected=!0;let t=(e=performance.getEntriesByType(`navigation`)[0])==null?void 0:e.serverTiming;if(t!=null&&t.length)for(let e of t){var n;if((n=this.limitManager)!=null&&n.limitServerTimingEntry())return;this.logger.emit({eventName:`mxl-server-timing`,severityNumber:za.INFO,attributes:{[_t]:`ux.server_timing`,"mxl.server_timing.name":e.name,"mxl.server_timing.duration":e.duration,"mxl.server_timing.description":e.description}})}}};let po={samplingPct:100,networkSpansForwardingThreshold:0},mo=`mxl_remote_config`,ho=`0.0.14`,go=`mxl_app_instance_id`,_o=(e,t)=>{let n=null;try{n=e.getItem(go)}catch(e){t.warn(`Failed to retrieve app instance ID from session storage`,e)}if(!n){t.debug(`No existing app instance ID found in session storage, creating a new one`),n=mt();try{e.setItem(go,n)}catch(e){t.warn(`Failed to persist app instance ID to session storage`,e)}}return n},vo=`unknown_service`,yo=({serviceName:e})=>Cr({[cn]:e}),bo=({diagLogger:e,appVersion:t,pageSessionStorage:n})=>Cr({[un]:`mxl-web-sdk`,app_version:t,app_framework:1,sdk_version:ho,[dn]:ho,sdk_simple_version:1,sdk_platform:`web`,[ln]:`webjs`,"mxl.app_instance_id":_o(n,e),[pn]:window.navigator.userAgent,screen_resolution:`${window.screen.width}x${window.screen.height}`}),xo=(e,{osVersion:t,appVersion:n,deviceId:r},i)=>`${i||`https://mxl-basket.apps.ocpthikadev01.safaricom.net`}/config?appId=${e}&osVersion=${t}&appVersion=${n}&deviceId=${r}`,So=e=>{let t={samplingPct:e.threshold};return e.network_span_forwarding!==void 0&&(t.networkSpansForwardingThreshold=e.network_span_forwarding.pct_enabled),e.empty_session_avoidance_enabled_pct!==void 0&&(t.emptySessionAvoidanceEnabledPct=e.empty_session_avoidance_enabled_pct),e.service_name!==void 0&&e.service_name!==``&&(t.serviceName=e.service_name),t};var Co=class{constructor({appID:e,appVersion:t,deviceId:n,diag:r=L.createComponentLogger({namespace:`mxl-config-manager`}),storage:i=window.localStorage,defaultConfig:a={},mxlConfigURL:o}={}){z(this,`_remoteConfigURL`,null),z(this,`_diag`,void 0),z(this,`_storage`,void 0),z(this,`_baseConfig`,void 0),z(this,`_sdkConfig`,void 0),z(this,`_etag`,null),z(this,`_remoteSourceServiceName`,void 0),e&&t&&n&&(this._remoteConfigURL=xo(e,{appVersion:t,deviceId:n,osVersion:`1`},o)),this._diag=r,this._storage=i;let s=this._getRemoteConfigFromStorage();s&&(this._etag=s.etag,this._captureRemoteServiceName(s.config)),this._baseConfig=H(H({},po),a),this._sdkConfig=H(H({},this._baseConfig),s?So(s.config):{})}setConfig(e){this._sdkConfig=H(H({},this._sdkConfig),e)}getConfig(){return this._sdkConfig}resolveApplicationServiceName(e){var t,n;return((t=this._remoteSourceServiceName)==null?void 0:t.trim())||(e==null?void 0:e.trim())||((n=this._baseConfig.serviceName)==null?void 0:n.trim())||vo}_captureRemoteServiceName(e){if(e.service_name===void 0)return;let t=e.service_name.trim();this._remoteSourceServiceName=t.length>0?t:void 0}refreshRemoteConfig(){var e=this;return B(function*(){if(e._remoteConfigURL)try{let t=yield e._fetchRemoteConfig(e._remoteConfigURL);if(!t){e._diag.debug(`No changes in remote config, skipping update`);return}let[n,r]=t;e._captureRemoteServiceName(n),e._storage.setItem(mo,JSON.stringify({config:n,etag:r})),e._sdkConfig=H(H({},e._baseConfig),So(n)),e._etag=r}catch(t){e._diag.warn(`Failed to refresh remote config: ${t instanceof Error?t.message:String(t)}`)}})()}_getRemoteConfigFromStorage(){try{let e=this._storage.getItem(mo);return e?JSON.parse(e):null}catch(e){return this._diag.warn(`Failed to parse remote config from storage: ${e instanceof Error?e.message:String(e)}`),null}}_fetchRemoteConfig(e){var t=this;return B(function*(){let n=yield fetch(e,{headers:t._etag?{"If-None-Match":t._etag}:{}}),r=n.headers.get(`etag`);return n.status===304?null:n.ok?[yield n.json(),r]:(t._diag.warn(`Failed to fetch remote config from ${e}: ${n.statusText}`),null)})()}};let wo={maxAllowed:{error_log:500,warning_log:200,info_log:100,exception:500,breadcrumb:100,session_property:100,span:1e3,network_request:1e4,element_timing:500,server_timing:500,user_timing_mark:500,user_timing_measure:500},maxLength:{error_log:128,warning_log:128,info_log:128,exception:1024,breadcrumb:256,session_property_key:128,session_property_value:256,log_attribute_key:128,log_attribute_value:256,exception_attribute_key:128,exception_attribute_value:256},maxAttributes:{error_log:50,warning_log:50,info_log:50,exception:50}},To={info:`info_log`,warning:`warning_log`,error:`error_log`};var Eo=class{constructor({diag:e,maxAllowed:t,maxLength:n,maxAttributes:r}){z(this,`_diag`,void 0),z(this,`_diagnosticCounts`,{}),z(this,`_currentCount`,{exception:0,error_log:0,warning_log:0,info_log:0,breadcrumb:0,session_property:0,span:0,network_request:0,element_timing:0,server_timing:0,user_timing_mark:0,user_timing_measure:0}),z(this,`_maxAllowed`,void 0),z(this,`_maxLength`,void 0),z(this,`_maxAttributes`,void 0),this._diag=e==null?L.createComponentLogger({namespace:`MXLLimitManager`}):e,this._maxAllowed=t,this._maxLength=n,this._maxAttributes=r}_dropIfMaxReached(e){return this._currentCount[e]>=this._maxAllowed[e]?(this._diag.warn(`disallowing ${e} because the maximum number of ${this._maxAllowed[e].toString()} has already been reached for this session`),this._incrDiagnosticCount(e,`drop`),!0):(this._currentCount[e]=(this._currentCount[e]||0)+1,!1)}truncateString(e,t){return t.length>this._maxLength[e]?(this._diag.warn(`truncating ${e} because it is longer than ${this._maxLength[e].toString()} characters: "${t}"`),this._incrDiagnosticCount(e,`truncate_string`),t.substring(0,this._maxLength[e])):t}_truncateAttributes(e,t,n,r){let i=Object.keys(t);i.length>this._maxAttributes[e]&&(this._diag.warn(`truncating ${e} attributes because there are more than ${this._maxAttributes[e].toString()} set`),this._incrDiagnosticCount(e,`truncate_attributes`));let a={};for(let s=0;s<Math.min(i.length,this._maxAttributes[e]);s++){var o;let e=this.truncateString(n,i[s]);a[e]=this.truncateString(r,((o=t[i[s]])==null?void 0:o.toString())||``)}return a}limitBreadcrumb(e){return this._dropIfMaxReached(`breadcrumb`)?`dropped`:{name:this.truncateString(`breadcrumb`,e)}}limitException(e,t){return this._dropIfMaxReached(`exception`)?`dropped`:{message:this.truncateString(`exception`,e),attributes:this._truncateAttributes(`exception`,t,`exception_attribute_key`,`exception_attribute_value`)}}limitLog(e,t,n){let r=To[t];return this._dropIfMaxReached(r)?`dropped`:{message:this.truncateString(r,e),attributes:this._truncateAttributes(r,n,`log_attribute_key`,`log_attribute_value`)}}limitSessionProperty(e,t){return this._dropIfMaxReached(`session_property`)?`dropped`:{key:this.truncateString(`session_property_key`,e),value:this.truncateString(`session_property_value`,t)}}limitElementTimingEntry(){return this._dropIfMaxReached(`element_timing`)}limitServerTimingEntry(){return this._dropIfMaxReached(`server_timing`)}limitUserTimingEntry(e){return this._dropIfMaxReached(e===`mark`?`user_timing_mark`:`user_timing_measure`)}dropReadableSpan(e){let t=e.attributes[`mxl.type`]===`perf.network_request`?`network_request`:`span`;return this._dropIfMaxReached(t)}reset(){this._diagnosticCounts={},this._currentCount={exception:0,error_log:0,warning_log:0,info_log:0,breadcrumb:0,session_property:0,span:0,network_request:0,element_timing:0,server_timing:0,user_timing_mark:0,user_timing_measure:0}}_incrDiagnosticCount(e,t){let n=`mxl.app.applied_limit.${e}.${t}.count`;this._diagnosticCounts[n]=(this._diagnosticCounts[n]||0)+1}getDiagnosticCounts(){return this._diagnosticCounts}};let Do=()=>JSON.stringify(Dt._MXLFileBundleIDs||Dt._MXLFileBundleIDs||{});var Oo=class e{constructor({diag:e,perf:t,spanSessionManager:n,limitManager:r,loggerProvider:i,visibilityDoc:a=window.document,storage:o=window.localStorage}){z(this,`_diag`,void 0),z(this,`_perf`,void 0),z(this,`_logger`,void 0),z(this,`_spanSessionManager`,void 0),z(this,`_limitManager`,void 0),z(this,`_visibilityDoc`,void 0),z(this,`_storage`,void 0);let s=i==null?Ja:i;this._diag=e==null?L.createComponentLogger({namespace:`MXLLogManager`}):e,this._perf=t==null?new Ci:t,this._logger=s.getLogger(`mxl-web-sdk-logs`),this._spanSessionManager=n,this._limitManager=r,this._visibilityDoc=a,this._storage=o}_validateAttributes(e){return Object.prototype.toString.call(e)===`[object Object]`?e:(this._diag.warn(`attributes must be a plain object`,e),{})}static _logSeverityToSeverityNumber(e){switch(e){case`info`:return za.INFO;case`warning`:return za.WARN;default:return za.ERROR}}logException(t,{handled:n=!0,attributes:r={},timestamp:i=this._perf.getNowMillis(),handler:a=`manual`}={}){var o;let s=this._validateAttributes(r);n||this._spanSessionManager.incrSessionCountForKey(`mxl.unhandled_exceptions_count`);let c=(t==null||(o=t.constructor)==null?void 0:o.name)||typeof t,l=``,u=c,d=``,f=``;if(t instanceof Error)l=String(t.message||``).trim(),u=t.name||``,d=t.stack||``,f=t.cause?`present`:``;else if(t&&typeof t==`object`)try{l=JSON.stringify(t)}catch(e){l=String(t).trim()}else l=String(t).trim();let p=this._limitManager.limitException(l,s);p!==`dropped`&&this._logger.emit({timestamp:i,severityNumber:za.ERROR,severityText:`ERROR`,body:p.message,attributes:H(H({},p.attributes),{},{[_t]:`sys.exception`,"mxl.exception_handling":e._exceptionHandlingType(n,a),"mxl.exception_cause":f,[tn]:c,"exception.name":u,[$t]:p.message,[en]:d,[xt]:Do(),[vt]:Et(this._visibilityDoc),"mxl.exception_number":gt(this._storage,`mxl_exception_number`,this._diag)})})}message(e,t,{attributes:n={},includeStacktrace:r=!0,stacktrace:i}={}){if(typeof e!=`string`||!e.trim()){this._diag.warn(`Message must be a non-empty string`);return}if(![`info`,`warning`,`error`].includes(t)){this._diag.warn(`Severity must be info, warning, or error`);return}let a=this._validateAttributes(n);t===`error`&&this._spanSessionManager.incrSessionCountForKey(`mxl.error_log_count`);let o=``;t!==`info`&&(typeof i==`string`?o=i:r&&(o=Error().stack||``)),this._logMessage({message:e.trim(),severity:t,timestamp:this._perf.getNowMillis(),attributes:a,stack:o})}_logMessage({message:t,severity:n,timestamp:r,attributes:i={},stack:a}){let o=this._limitManager.limitLog(t,n,i);o!==`dropped`&&this._logger.emit({timestamp:r,severityNumber:e._logSeverityToSeverityNumber(n),severityText:n.toUpperCase(),body:o.message,attributes:H(H(H({},o.attributes),{},{[_t]:`sys.log`},a?{"mxl.stacktrace.js":a,[xt]:Do()}:{}),{},{[vt]:Et(this._visibilityDoc)})})}static _exceptionHandlingType(e,t){return e?`handled`:t===`global_exception`?`unhandled_error`:t===`promise_rejection`?`unhandled_rejection`:`unhandled`}},ko=class{constructor({useDocumentTitleAsPageLabel:e=!0,titleDocument:t=window.document}={}){z(this,`_currentRoute`,null),z(this,`_currentPageId`,null),z(this,`_pageLabel`,null),z(this,`_titleDocument`,void 0),z(this,`_useDocumentTitleAsPageLabel`,void 0),z(this,`getCurrentPageId`,()=>this._currentPageId),z(this,`getCurrentRoute`,()=>this._currentRoute),z(this,`setPageLabel`,e=>{this._pageLabel=e}),z(this,`getPageLabel`,()=>this._pageLabel||(!this._useDocumentTitleAsPageLabel||!this._titleDocument?null:this._titleDocument.title)),z(this,`setCurrentRoute`,e=>{(!this._currentRoute||this._currentRoute.url!==e.url)&&(this._currentPageId=mt()),this._currentRoute=e,e.label?this._pageLabel=e.label:this._pageLabel=null}),z(this,`clearCurrentRoute`,()=>{this._currentRoute=null,this._currentPageId=null,this._pageLabel=null}),this._useDocumentTitleAsPageLabel=e,this._titleDocument=t}},Ao=class{constructor({dynamicConfigManager:e,deviceId:t,blockNetworkSpanForwarding:n}){z(this,`_dynamicConfigManager`,void 0),z(this,`_deviceId`,void 0),z(this,`_blockNetworkSpanForwarding`,void 0),this._dynamicConfigManager=e,this._deviceId=t,this._blockNetworkSpanForwarding=n}isSDKEnabled(){let e=this._dynamicConfigManager.getConfig();return Ot(this._deviceId,e.samplingPct)}isNetworkSpanForwardingEnabled(){if(this._blockNetworkSpanForwarding)return!1;let e=this._dynamicConfigManager.getConfig();return Ot(this._deviceId,e.networkSpansForwardingThreshold)}isEmptySessionAvoidanceEnabled(){let e=this._dynamicConfigManager.getConfig();return Ot(this._deviceId,e.emptySessionAvoidanceEnabledPct)}},jo=class{constructor(e){z(this,`_span`,void 0),this._span=e}get attributes(){return this._span.attributes}addEvent(e,t,n){return this._span.addEvent(e,t,n),this}addLink(e){return this._span.addLink(e),this}addLinks(e){return this._span.addLinks(e),this}end(e){this._span.end(e)}isRecording(){return this._span.isRecording()}recordException(e,t){this._span.recordException(e,t)}setAttribute(e,t){return this._span.setAttribute(e,t),this}setAttributes(e){return this._span.setAttributes(e),this}removeAttribute(e){let t=this._span.attributes,{[e]:n}=t,r=Ti(t,[e].map(Bt));return this._span.attributes=r,this}setStatus(e){return this._span.setStatus(e),this}spanContext(){return this._span.spanContext()}updateName(e){return this._span.updateName(e),this}fail(e={code:`failure`}){e.code&&this._span.setAttribute(`mxl.error_code`,e.code.toUpperCase()),this._span.end(e.endTime)}};let Mo=`mxl_tab`,No=`mxl_tab_activity`;var Po=class{constructor({diag:e,perf:t,visibilityDoc:n=window.document,storage:r=window.localStorage,sessionStorage:i=window.sessionStorage,limitManager:a,referrer:o=document.referrer,navigationPerformance:s=window.performance}){z(this,`_previousSessionId`,null),z(this,`_activeSessionId`,null),z(this,`_activeSessionStartTime`,null),z(this,`_sessionSpan`,null),z(this,`_activeSessionCounts`,null),z(this,`_nextSessionCounts`,{}),z(this,`_coldStart`,!0),z(this,`_sdkStartupDuration`,0),z(this,`_sessionStartedListeners`,[]),z(this,`_sessionEndedListeners`,[]),z(this,`_tab`,void 0),z(this,`_navigationSource`,void 0),z(this,`_referrerInfo`,void 0),z(this,`_tracer`,void 0),z(this,`_noExportTracer`,void 0),z(this,`_diag`,void 0),z(this,`_perf`,void 0),z(this,`_visibilityDoc`,void 0),z(this,`_storage`,void 0),z(this,`_sessionStorage`,void 0),z(this,`_limitManager`,void 0),z(this,`_referrer`,void 0),z(this,`_navigationPerformance`,void 0),this._diag=e==null?L.createComponentLogger({namespace:`MXLSpanSessionManager`}):e,this._perf=t==null?new Ci:t,this._visibilityDoc=n,this._storage=r,this._sessionStorage=i,this._limitManager=a,this._referrer=o,this._navigationPerformance=s,this._tracer=R.getTracer(`mxl-web-sdk-sessions`),this._noExportTracer=new ni().getTracer(`mxl-web-sdk-sessions`),this._referrerInfo=this._processReferrer();let c=this._initTab();this._tab=c.tab,this._navigationSource=c.navigationSource,this._setupNewTabClickListeners()}_getPermanentAttributes(){let e=new Map;try{for(let t=0;t<this._storage.length;t++){let n=this._storage.key(t);if(n!=null&&n.startsWith(`mxl.properties.`)){let t=this._storage.getItem(n);t&&e.set(n,t)}}}catch(e){this._diag.warn(`Error loading permanent session properties`,e)}return Object.fromEntries(e.entries())}addBreadcrumb(e){if(!this._sessionSpan){this._diag.debug(`trying to add breadcrumb to a session, but there is no session in progress. This is a no-op.`);return}let t=this._limitManager.limitBreadcrumb(e);t!==`dropped`&&this._sessionSpan.addEvent(`mxl-breadcrumb`,{message:t.name},this._perf.getNowMillis())}addProperty(e,t,n){if(!this._sessionSpan){this._diag.debug(`trying to add properties to a session, but there is no session in progress. This is a no-op.`);return}let r=this._limitManager.limitSessionProperty(e,t);if(r===`dropped`)return;let i=yt+r.key;if(this._sessionSpan.setAttribute(i,r.value),(n==null?void 0:n.lifespan)===`permanent`)try{this._storage.setItem(i,t)}catch(e){this._diag.warn(`Failed to set permanent session property`,e)}}removeProperty(e){if(!this._sessionSpan){this._diag.debug(`trying to remove a session property, but there is no session in progress. This is a no-op.`);return}let t=yt+this._limitManager.truncateString(`session_property_key`,e);this._sessionSpan.removeAttribute(t);try{this._storage.getItem(t)&&this._storage.removeItem(t)}catch(e){this._diag.warn(`Error removing permanent session property`,e)}}endSessionSpan(){this.endSessionSpanInternal(`manual`)}endSessionSpanInternal(e){if(!this._sessionSpan){this._diag.debug(`trying to end a session, but there is no session in progress. This is a no-op.`);return}for(let e of this._sessionEndedListeners)try{e()}catch(e){this._diag.warn(`Error while executing session ended listener`,e)}this._sessionSpan.setAttributes(this._endSessionSpanAttributes(e)),this._sessionSpan.end(),this._sessionSpan=null,this._activeSessionStartTime=null,this._previousSessionId=this._activeSessionId,this._activeSessionId=null,this._activeSessionCounts=null,this._limitManager.reset()}_endSessionSpanAttributes(e){return H(H(H(H({},this._getPermanentAttributes()),{},{"mxl.session_end_type":e},this._activeSessionCounts),this._limitManager.getDiagnosticCounts()),{},{"mxl.sdk_startup_duration":this._sdkStartupDuration})}currentSessionAsReadableSpan(e){if(!this._sessionSpan||!this._activeSessionStartTime)return this._diag.debug(`trying to end a session, but there is no session in progress. This is a no-op.`),null;let t=this._noExportTracer.startSpan(`mxl-session`,{startTime:this._activeSessionStartTime,attributes:H(H(H({},this._sessionSpan.attributes),this._endSessionSpanAttributes(e)),{},{"mxl.from_storage":!0})});return t.end(),t}getSessionId(){return this._activeSessionId}getPreviousSessionId(){return this._previousSessionId}getSessionSpan(){return this._sessionSpan}getSessionStartTime(){return this._activeSessionStartTime}startSessionSpan(e){var t;this._sessionSpan&&this.endSessionSpanInternal(`manual`),this._activeSessionId=mt(),this._activeSessionStartTime=this._perf.getNowHRTime(),this._activeSessionCounts={};let n=this._nextSessionCounts;this._nextSessionCounts={};let r=H(H({},this._getPermanentAttributes()),{},{[_t]:`ux.session`,[vt]:Et(this._visibilityDoc),[La]:this._activeSessionId,"mxl.cold_start":this._coldStart,"mxl.session_number":gt(this._storage,`mxl_session_number`,this._diag),"mxl.experience_id":this._tab.experienceId,"mxl.tab_id":this._tab.tabId,"mxl.navigation_source":this._navigationSource},n);this._referrerInfo.isValid&&this._referrerInfo.scrubbedUrl&&(r[`mxl.referrer_url`]=this._referrerInfo.scrubbedUrl),this._tab.sourceTabId&&(r[`mxl.source_tab_id`]=this._tab.sourceTabId),r[`mxl.session_start_type`]=(t=e==null?void 0:e.reason)==null?`manual`:t,this._sessionSpan=new jo(this._tracer.startSpan(`mxl-session`,{attributes:r})),this._coldStart=!1;for(let e of this._sessionStartedListeners)try{e()}catch(e){this._diag.warn(`Error while executing session started listener`,e)}}incrSessionCountForKey(e){if(!this._sessionSpan||!this._activeSessionCounts){this._diag.debug(`trying to increment a count for the active session, but there is no session in progress. This is a no-op.`);return}this._activeSessionCounts[e]=(this._activeSessionCounts[e]||0)+1}incrNextSessionCountForKey(e){this._nextSessionCounts[e]=(this._nextSessionCounts[e]||0)+1}addSessionStartedListener(e){let t=this._sessionStartedListeners.push(e);return()=>{this._sessionStartedListeners.splice(t-1,1)}}addSessionEndedListener(e){let t=this._sessionEndedListeners.push(e);return()=>{this._sessionEndedListeners.splice(t-1,1)}}recordSDKStartupDuration(e){this._sdkStartupDuration=Math.ceil(e)}setTracerProvider(e){this._tracer=e.getTracer(`mxl-web-sdk-sessions`)}_determineNavigationSource(){try{let e=this._navigationPerformance.getEntriesByType(`navigation`);if(e.length>0&&e[0]){let t=e[0];if(t.type===`reload`)return`reload`;if(t.type===`back_forward`)return`back_forward`}}catch(e){this._diag.warn(`Failed to get navigation type`,e)}return this._referrerInfo.isValid?this._referrerInfo.isSameOrigin?`same_origin`:`external`:`direct`}_processReferrer(){if(!this._referrer)return{isValid:!1,isSameOrigin:!1};try{let e=new URL(this._referrer),t=window.location.origin;return{isValid:!0,isSameOrigin:e.origin===t,scrubbedUrl:e.origin+e.pathname}}catch(e){return{isValid:!1,isSameOrigin:!1}}}_getTabContext(e){let t=_o(this._sessionStorage,this._diag),n,r;if(e===`same_origin`){let e=this._getTabActivity();e&&Date.now()-e.lastActivityMs<=1e4&&(n=e.tabId,r=e.experienceId)}return r!=null||(r=mt()),{sourceTabId:n,experienceId:r,tabId:t}}_initTab(){let e=this._determineNavigationSource();try{let t=this._sessionStorage.getItem(Mo);if(t)return{tab:JSON.parse(t),navigationSource:e}}catch(e){this._diag.warn(`Failed to retrieve tab data`,e)}let t=this._getTabContext(e),n={experienceId:t.experienceId,sourceTabId:t.sourceTabId,tabId:t.tabId};try{this._sessionStorage.setItem(Mo,JSON.stringify(n))}catch(e){this._diag.warn(`Failed to store tab data`,e)}return{tab:n,navigationSource:e}}_getTabActivity(){try{let e=this._storage.getItem(No);return e?JSON.parse(e):null}catch(e){return this._diag.warn(`Failed to retrieve tab activity`,e),null}}_storeTabActivity(e){try{this._storage.setItem(No,JSON.stringify(e))}catch(e){this._diag.warn(`Failed to save tab activity`,e)}}_storeCurrentTabAsSource(){let e={tabId:this._tab.tabId,experienceId:this._tab.experienceId,lastActivityMs:Date.now()};this._storeTabActivity(e)}_setupNewTabClickListeners(){let e=e=>{var t;if(e.button===1||e.ctrlKey||e.metaKey||e.shiftKey){this._storeCurrentTabAsSource();return}(t=e.target)!=null&&t.closest(`a[target="_blank"], form[target="_blank"], a[rel*="noopener"], a[rel*="noreferrer"]`)&&this._storeCurrentTabAsSource()},t={capture:!0,passive:!0};document.addEventListener(`auxclick`,e,t),document.addEventListener(`click`,e,t)}},Fo=class{constructor({tracerProvider:e}={}){z(this,`_tracer`,void 0),z(this,`setSpan`,R.setSpan);let t=e==null?R:e;this._tracer=t.getTracer(`mxl-web-sdk-traces`)}startSpan(e,t={},n){t.attributes=t.attributes?t.attributes:{},t.attributes[_t]=`perf`;let r=t.parentSpan?R.setSpan(I.active(),t.parentSpan):n;return new jo(this._tracer.startSpan(e,t,r))}getSpan(e){let t=R.getSpan(e);if(t)return new jo(t)}};let Io=`mxl_user`,Lo=`mxl_user_id`,Ro=`mxl_external_user_id`,zo=e=>typeof e[`enduser.pseudo.id`]==`string`&&e[`enduser.pseudo.id`].length===32,Bo=e=>typeof e==`string`&&e.length===32;var Vo=class{constructor({diag:e,storage:t=window.localStorage}={}){z(this,`_diag`,void 0),z(this,`_storage`,void 0),z(this,`_mxlUserId`,null),this._diag=e==null?L.createComponentLogger({namespace:`MXLUserManager`}):e,this._storage=t,this._migrateOldLocalStorageKey(),this._initialSetup()}getMXLUserId(){return this._mxlUserId||this._generateNewMXLUserId()}setMXLUserId(e){this._mxlUserId=e;try{this._storage.setItem(Lo,e)}catch(e){this._diag.warn(`Failed to persist user object for storage, keeping it in-memory only`,e)}}clearMXLUserId(){this._mxlUserId=null;try{this._storage.removeItem(Lo)}catch(e){this._diag.warn(`Failed to remove mxl user in storage`,e)}}_migrateOldLocalStorageKey(){try{let e=this._storage.getItem(Io);if(e){let t=JSON.parse(e);zo(t)?(this._diag.debug(`Migrating old user data from storage`),this._storage.setItem(Lo,t[`enduser.pseudo.id`]),this._storage.removeItem(Io)):(this._diag.warn(`Invalid user data found in storage, clearing old user data`),this._storage.removeItem(Io))}}catch(e){this._diag.warn(`Failed to get old user data from storage`,e)}}_initialSetup(){try{let e=this._storage.getItem(Lo);e?Bo(e)?this._mxlUserId=e:(this._diag.warn(`Invalid mxl user id, generating a new one`),this.clearMXLUserId()):this._diag.debug(`No existing user found in storage, creating a new one`)}catch(e){this._diag.warn(`Failed to get mxl user id from storage, defaulting to a new one`,e)}this._mxlUserId||(this._mxlUserId=this._generateNewMXLUserId())}_generateNewMXLUserId(){let e=mt();return this.setMXLUserId(e),e}getUserId(){try{return this._storage.getItem(Ro)}catch(e){return this._diag.warn(`Failed to retrieve user id from storage`,e),null}}setUserId(e){try{this._storage.setItem(Ro,e)}catch(e){this._diag.warn(`Failed to store user id`,e)}}clearUserId(){try{this._storage.removeItem(Ro)}catch(e){this._diag.warn(`Failed to clear user id`,e)}}};let Ho=[`keydown`,`mousedown`,`mousemove`,`scroll`];var Uo=class extends Xa{constructor({diag:e}={}){super({instrumentationName:`SpanSessionBrowserActivityInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,config:{}}),z(this,`_onActivityThrottled`,void 0),z(this,`_activityTimeout`,void 0),z(this,`disable`,()=>{ut({target:window,events:Ho,callback:this._onActivityThrottled}),this._activityTimeout&&clearTimeout(this._activityTimeout),this._activityTimeout=null}),z(this,`enable`,()=>{lt({target:window,events:Ho,callback:this._onActivityThrottled})}),z(this,`_onInactivity`,()=>{this._diag.debug(`Inactivity detected`),this._activityTimeout&&clearTimeout(this._activityTimeout),this._activityTimeout=null,this.sessionManager.endSessionSpanInternal(`inactivity`)}),z(this,`_onActivity`,()=>{this._diag.debug(`Activity detected`),this._activityTimeout&&clearTimeout(this._activityTimeout),this.sessionManager.getSessionId()||this.sessionManager.startSessionSpan({reason:`activity`}),this._activityTimeout=setTimeout(this._onInactivity,18e5)}),this._activityTimeout=null,this._onActivityThrottled=Ai(this._onActivity,3e4),this._config.enabled&&this.enable()}},Wo=class extends Xa{constructor({diag:e,perf:t,visibilityDoc:n=window.document}={}){super({instrumentationName:`SpanSessionVisibilityInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_onVisibilityChange`,void 0),this._onVisibilityChange=()=>{this._diag.debug(`Visibility change detected: ${n.visibilityState}`);try{this.sessionManager.endSessionSpanInternal(`state_changed`),n.visibilityState===`visible`&&(this._diag.debug(`Starting a session since document visibility switched to visible`),this.sessionManager.startSessionSpan({reason:`visible`}))}catch(e){this._diag.error(`Failed to rotate session on visibility change to ${n.visibilityState}`,e)}},this._config.enabled&&this.enable()}disable(){window.removeEventListener(`visibilitychange`,this._onVisibilityChange)}enable(){window.addEventListener(`visibilitychange`,this._onVisibilityChange)}};let Go=`mxl.user_timing.start_time`,Ko=`mxl.user_timing.duration`,qo=`mxl.user_timing.entry_type`;var Jo=class extends Xa{constructor({diag:e,perf:t,limitManager:n,allowedEntries:r}={}){super({instrumentationName:`UserTimingInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,limitManager:n,config:{}}),z(this,`_markObserver`,null),z(this,`_measureObserver`,null),z(this,`_seenEntries`,new Set),z(this,`_isEnabled`,!1),z(this,`_allowedEntries`,void 0),this._allowedEntries=r,this._config.enabled&&this.enable()}enable(){this._isEnabled||(this._isEnabled=!0,this._seenEntries=new Set,this._markObserver&&this._markObserver.disconnect(),this._measureObserver&&this._measureObserver.disconnect(),this._markObserver=ki(`mark`,this._processEntry.bind(this),{diag:this._diag}),this._markObserver||this._diag.error(`failed to enable mark observer`),this._measureObserver=ki(`measure`,e=>this._processEntry(e),{diag:this._diag}),this._measureObserver||this._diag.error(`failed to enable measure observer`),!this._markObserver&&!this._measureObserver&&(this._isEnabled=!1))}disable(){this._isEnabled=!1,this._markObserver&&(this._markObserver.disconnect(),this._markObserver=null),this._measureObserver&&(this._measureObserver.disconnect(),this._measureObserver=null),this._seenEntries=new Set}_processEntry(e){var t;if(!this._isEnabled||this._allowedEntries!==void 0&&!(Array.isArray(this._allowedEntries)?this._allowedEntries.includes(e.name):this._allowedEntries(e)))return;let n=`${location.href}::${e.name}`;if(this._seenEntries.has(n)||(this._seenEntries.add(n),(t=this.limitManager)!=null&&t.limitUserTimingEntry(e.entryType)))return;if(e.entryType===`measure`){let t=e.detail;this.tracer.startSpan(e.name,{startTime:this.perf.epochMillisFromOriginOffset(e.startTime),attributes:H({[_t]:`ux.user_timing`,[bt]:`user_timing`,[qo]:e.entryType,[Go]:this.perf.millisFromZeroTime(e.startTime),[Ko]:e.duration},t!=null&&{"mxl.user_timing.detail":JSON.stringify(t)})}).end(this.perf.epochMillisFromOriginOffset(e.startTime+e.duration));return}let r=e.detail,i=r==null?void 0:JSON.stringify(r);this.logger.emit({timestamp:this.perf.epochMillisFromOriginOffset(e.startTime),eventName:`mxl-user-timing`,severityNumber:za.INFO,attributes:{[_t]:`ux.user_timing`,"mxl.user_timing.name":e.name,[Go]:this.perf.millisFromZeroTime(e.startTime),[Ko]:e.duration,[qo]:e.entryType},body:i})}};let Yo=`mxl.web_vital.attribution.`;var Xo=class{constructor(){z(this,`t`,void 0),z(this,`o`,0),z(this,`i`,[])}u(e){var t;if(e.hadRecentInput)return;let n=this.i[0],r=this.i.at(-1);this.o&&n&&r&&e.startTime-r.startTime<1e3&&e.startTime-n.startTime<5e3?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),(t=this.t)==null||t.call(this,e)}};let Zo=()=>{let e=performance.getEntriesByType(`navigation`)[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Qo=e=>{if(document.readyState===`loading`)return`loading`;let t=Zo();if(t){if(e<t.domInteractive)return`loading`;if(t.domContentLoadedEventStart===0||e<t.domContentLoadedEventStart)return`dom-interactive`;if(t.domComplete===0||e<t.domComplete)return`dom-content-loaded`}return`complete`},$o=e=>{let t=e.nodeName;return e.nodeType===1?t.toLowerCase():t.toUpperCase().replace(/^#/,``)},es=e=>{let t=``;try{for(;(e==null?void 0:e.nodeType)!==9;){let n=e,r=n.id?`#`+n.id:[$o(n),...Array.from(n.classList).sort()].join(`.`);if(t.length+r.length>99)return t||r;if(t=t?r+`>`+t:r,n.id)break;e=n.parentNode}}catch(e){}return t},ts=new WeakMap;function ns(e,t){return ts.get(e)||ts.set(e,new t),ts.get(e)}let rs=-1,is=()=>rs,as=e=>{addEventListener(`pageshow`,t=>{t.persisted&&(rs=t.timeStamp,e(t))},!0)},os=(e,t,n,r)=>{let i,a;return o=>{var s;t.value>=0&&(o||r)&&(a=t.value-((s=i)==null?0:s),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?`poor`:e>t[0]?`needs-improvement`:`good`)(t.value,n),e(t)))}},ss=e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},cs=()=>{var e,t;return(e=(t=Zo())==null?void 0:t.activationStart)==null?0:e},ls=(e,t=-1)=>{let n=Zo(),r=`navigate`;return is()>=0?r=`back-forward-cache`:n&&(document.prerendering||cs()>0?r=`prerender`:document.wasDiscarded?r=`restore`:n.type&&(r=n.type.replace(/_/g,`-`))),{name:e,value:t,rating:`good`,delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+0xe8d4a51000}`,navigationType:r}},us=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{queueMicrotask(()=>{t(e.getEntries())})});return r.observe(H({type:e,buffered:!0},n)),r}}catch(e){}},ds=e=>{let t=!1;return()=>{t||(e(),t=!0)}},fs=-1,ps=new Set,ms=()=>document.visibilityState!==`hidden`||document.prerendering?1/0:0,hs=e=>{if(document.visibilityState===`hidden`){if(e.type===`visibilitychange`)for(let e of ps)e();isFinite(fs)||(fs=e.type===`visibilitychange`?e.timeStamp:0,removeEventListener(`prerenderingchange`,hs,!0))}},gs=()=>{if(fs<0){var e;let t=cs(),n=document.prerendering||(e=globalThis.performance.getEntriesByType(`visibility-state`).find(e=>e.name===`hidden`&&e.startTime>=t))==null?void 0:e.startTime;fs=n==null?ms():n,addEventListener(`visibilitychange`,hs,!0),addEventListener(`prerenderingchange`,hs,!0),as(()=>{setTimeout(()=>{fs=ms()})})}return{get firstHiddenTime(){return fs},onHidden(e){ps.add(e)}}},_s=e=>{document.prerendering?addEventListener(`prerenderingchange`,e,!0):e()},vs=[1800,3e3],ys=(e,t={})=>{_s(()=>{let n=gs(),r,i=ls(`FCP`),a=us(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-cs(),0),i.entries.push(t),r(!0)))});a&&(r=os(e,i,vs,t.reportAllChanges),as(n=>{i=ls(`FCP`),r=os(e,i,vs,t.reportAllChanges),ss(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},bs=[.1,.25],xs=e=>e.find(e=>{var t;return((t=e.node)==null?void 0:t.nodeType)===1})||e[0],Ss=(e,t={})=>{let n=ns(t=Object.assign({},t),Xo),r=new WeakMap;n.t=e=>{var n;if(!(e==null||(n=e.sources)==null)&&n.length){let n=xs(e.sources),o=n==null?void 0:n.node;if(o){var i,a;let e=(i=(a=t.generateTarget)==null?void 0:a.call(t,o))==null?es(o):i;r.set(n,e)}}},((e,t={})=>{let n=gs();ys(ds(()=>{let r,i=ls(`CLS`,0),a=ns(t,Xo),o=e=>{for(let t of e)a.u(t);a.o>i.value&&(i.value=a.o,i.entries=a.i,r())},s=us(`layout-shift`,o);s&&(r=os(e,i,bs,t.reportAllChanges),n.onHidden(()=>{o(s.takeRecords()),r(!0)}),as(()=>{a.o=0,i=ls(`CLS`,0),r=os(e,i,bs,t.reportAllChanges),ss(r)}),setTimeout(r))}))})(t=>{e((e=>{let t={};if(e.entries.length){var n;let i=e.entries.reduce((e,t)=>e.value>t.value?e:t);if(!(i==null||(n=i.sources)==null)&&n.length){let e=xs(i.sources);e&&(t={largestShiftTarget:r.get(e),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:e,largestShiftEntry:i,loadState:Qo(i.startTime)})}}return Object.assign(e,{attribution:t})})(t))},t)},Cs=(e,t={})=>{ys(t=>{e((e=>{let t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:Qo(is())};if(e.entries.length){let n=Zo(),r=e.entries.at(-1);if(n){let i=n.activationStart||0,a=Math.max(0,n.responseStart-i);t={timeToFirstByte:a,firstByteToFCP:e.value-a,loadState:Qo(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})})(t))},t)},ws=0,Ts=1/0,Es=0,Ds=e=>{for(let t of e)t.interactionId&&(Ts=Math.min(Ts,t.interactionId),Es=Math.max(Es,t.interactionId),ws=Es?(Es-Ts)/7+1:0)},Os,ks=()=>{var e;return Os?ws:(e=performance.interactionCount)==null?0:e},As=()=>{`interactionCount`in performance||Os||(Os=us(`event`,Ds,{durationThreshold:0}))},js=0;var Ms=class{constructor(){z(this,`l`,[]),z(this,`h`,new Map),z(this,`m`,void 0),z(this,`p`,void 0)}v(){js=ks(),this.l.length=0,this.h.clear()}M(){let e=Math.min(this.l.length-1,Math.floor((ks()-js)/50));return this.l[e]}u(e){var t;if((t=this.m)==null||t.call(this,e),!e.interactionId&&e.entryType!==`first-input`)return;let n=this.l.at(-1),r=this.h.get(e.interactionId);if(r||this.l.length<10||e.duration>n.T){var i;if(r?e.duration>r.T?(r.entries=[e],r.T=e.duration):e.duration===r.T&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],T:e.duration},this.h.set(r.id,r),this.l.push(r)),this.l.sort((e,t)=>t.T-e.T),this.l.length>10){let e=this.l.splice(10);for(let t of e)this.h.delete(t.id)}(i=this.p)==null||i.call(this,r)}}};let Ns=e=>{let t=globalThis.requestIdleCallback||setTimeout,n=globalThis.cancelIdleCallback||clearTimeout;if(document.visibilityState===`hidden`)e();else{let r=ds(e),i=-1,a=()=>{n(i),r()};addEventListener(`visibilitychange`,a,{once:!0,capture:!0}),i=t(()=>{removeEventListener(`visibilitychange`,a,{capture:!0}),r()})}},Ps=[200,500],Fs=(e,t={})=>{let n=ns(t=Object.assign({},t),Ms),r=[],i=[],a=0,o=new WeakMap,s=new WeakMap,c=!1,l=()=>{c||(Ns(u),c=!0)},u=()=>{let e=new Set(n.l.map(e=>o.get(e.entries[0]))),t=i.length-10;i=i.filter((n,r)=>r>=t||e.has(n));let s=new Set;for(let e of i){let t=d(e.startTime,e.processingEnd);for(let e of t)s.add(e)}r=r.filter(e=>e.startTime>a||s.has(e)),c=!1};n.m=e=>{let n=e.startTime+e.duration,r;a=Math.max(a,e.processingEnd);for(let a=i.length-1;a>=0;a--){let o=i[a];if(Math.abs(n-o.renderTime)<=8){r=o,r.startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),!1!==t.includeProcessedEventEntries&&r.entries.push(e);break}}r||(r={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:!1===t.includeProcessedEventEntries?[]:[e]},i.push(r)),(e.interactionId||e.entryType===`first-input`)&&o.set(e,r),l()},n.p=e=>{if(!s.get(e)){let i=e.entries[0].target;if(i){var n,r;let a=(n=(r=t.generateTarget)==null?void 0:r.call(t,i))==null?es(i):n;s.set(e,a)}}};let d=(e,t)=>{let n=[];for(let i of r)if(!(i.startTime+i.duration<e)){if(i.startTime>t)break;n.push(i)}return n},f=e=>{let t=e.entries[0],r=o.get(t),i=t.processingStart,a=Math.max(t.startTime+t.duration,i),c=Math.min(r.processingEnd,a),l=r.entries.sort((e,t)=>e.processingStart-t.processingStart),u=d(t.startTime,c),f=n.h.get(t.interactionId),p={interactionTarget:s.get(f),interactionType:t.name.startsWith(`key`)?`keyboard`:`pointer`,interactionTime:t.startTime,nextPaintTime:a,processedEventEntries:l,longAnimationFrameEntries:u,inputDelay:i-t.startTime,processingDuration:c-i,presentationDelay:a-c,loadState:Qo(t.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(e=>{var t;if(!((t=e.longAnimationFrameEntries)!=null&&t.length))return;let n=e.interactionTime,r=e.inputDelay,i=e.processingDuration,a,o,s=0,c=0,l=0,u=0;for(let t of e.longAnimationFrameEntries){c=c+t.startTime+t.duration-t.styleAndLayoutStart;for(let e of t.scripts){let t=e.startTime+e.duration;if(t<n)continue;let l=t-Math.max(n,e.startTime),d=e.duration?l/e.duration*e.forcedStyleAndLayoutDuration:0;s+=l-d,c+=d,l>u&&(o=e.startTime<n+r?`input-delay`:e.startTime>=n+r+i?`presentation-delay`:`processing-duration`,a=e,u=l)}}let d=e.longAnimationFrameEntries.at(-1),f=d?d.startTime+d.duration:0;f>=n+r+i&&(l=e.nextPaintTime-f),a&&o&&(e.longestScript={entry:a,subpart:o,intersectingDuration:u}),e.totalScriptDuration=s,e.totalStyleAndLayoutDuration=c,e.totalPaintDuration=l,e.totalUnattributedDuration=e.nextPaintTime-n-s-c-l})(p),Object.assign(e,{attribution:p})};us(`long-animation-frame`,e=>{r=r.concat(e),l()}),((e,t={})=>{if(!globalThis.PerformanceEventTiming||!(`interactionId`in PerformanceEventTiming.prototype))return;let n=gs();_s(()=>{var r;As();let i,a=ls(`INP`),o=ns(t,Ms),s=e=>{Ns(()=>{for(let t of e)o.u(t);let t=o.M();t&&t.T!==a.value&&(a.value=t.T,a.entries=t.entries,i())})},c=us(`event`,s,{durationThreshold:(r=t.durationThreshold)==null?40:r});i=os(e,a,Ps,t.reportAllChanges),c&&(c.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{s(c.takeRecords()),i(!0)}),as(()=>{o.v(),a=ls(`INP`),i=os(e,a,Ps,t.reportAllChanges)}))})})(t=>{e(f(t))},t)};var Is=class{constructor(){z(this,`m`,void 0)}u(e){var t;(t=this.m)==null||t.call(this,e)}};let Ls=[2500,4e3],Rs=(e,t={})=>{let n=ns(t=Object.assign({},t),Is),r=new WeakMap;n.m=e=>{let n=e.element;if(n){var i,a;let o=(i=(a=t.generateTarget)==null?void 0:a.call(t,n))==null?es(n):i;r.set(e,o)}else e.id&&r.set(e,`#${e.id}`)},((e,t={})=>{_s(()=>{let n=gs(),r,i=ls(`LCP`),a=ns(t,Is),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(let t of e)a.u(t),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-cs(),0),i.entries=[t],r())},s=us(`largest-contentful-paint`,o);if(s){r=os(e,i,Ls,t.reportAllChanges);let n=ds(()=>{o(s.takeRecords()),s.disconnect(),r(!0)}),a=e=>{e.isTrusted&&(Ns(n),removeEventListener(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])addEventListener(e,a,{capture:!0});as(n=>{i=ls(`LCP`),r=os(e,i,Ls,t.reportAllChanges),ss(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})})(t=>{e((e=>{let t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){let n=e.entries.at(-1),i=n.url&&performance.getEntriesByType(`resource`).find(e=>e.name===n.url);t.target=r.get(n),t.lcpEntry=n,n.url&&(t.url=n.url),i&&(t.lcpResourceEntry=i);let a=Zo();if(a){let n=a.activationStart||0,r=Math.max(0,a.responseStart-n),o=Math.max(r,i?(i.requestStart||i.startTime)-n:0),s=Math.min(e.value,Math.max(o,i?i.responseEnd-n:0));t=H(H({},t),{},{timeToFirstByte:r,resourceLoadDelay:o-r,resourceLoadDuration:s-o,elementRenderDelay:e.value-s,navigationEntry:a})}}return Object.assign(e,{attribution:t})})(t))},t)},zs=[800,1800],Bs=e=>{document.prerendering?_s(()=>Bs(e)):document.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>Bs(e),!0)},Vs=(e,t={})=>{((e,t={})=>{let n=ls(`TTFB`),r=os(e,n,zs,t.reportAllChanges);Bs(()=>{let i=Zo();i&&(n.value=Math.max(i.responseStart-cs(),0),n.entries=[i],r(!0),as(()=>{n=ls(`TTFB`,0),r=os(e,n,zs,t.reportAllChanges),r(!0)}))})})(t=>{e((e=>{let t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){let n=e.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),a=Math.max(n.domainLookupStart-r,0),o=Math.max(n.connectStart-r,0),s=Math.max(n.connectEnd-r,0);t={waitingDuration:i,cacheDuration:a-i,dnsDuration:o-a,connectionDuration:s-o,requestDuration:e.value-s,navigationEntry:n}}return Object.assign(e,{attribution:t})})(t))},t)},Hs=[`CLS`,`INP`,`LCP`,`FCP`,`TTFB`],Us={CLS:Ss,FCP:Cs,LCP:Rs,INP:Fs,TTFB:Vs,FID:void 0},Ws=e=>{let t=typeof e;return t===`number`||t===`string`||t===`boolean`},Gs=e=>Math.round(Math.max(0,e)),Ks=e=>{let t={},n=e.attribution;if(!n||typeof n!=`object`)return t;for(let[e,r]of Object.entries(n))Ws(r)&&(t[`${Yo}${e}`]=r);return t},qs=(e,t)=>{let n={},r=e.attribution;try{if(r.longAnimationFrameEntries.length>0){let e=new Map;for(let t of r.longAnimationFrameEntries)for(let n of t.scripts){let t=n.sourceURL||`(inline)`;t.length>2048&&(t=`${t.substring(0,2048)}...`);let r=e.get(t);r?(r.totalDuration+=n.duration,r.styleAndLayoutDuration+=n.forcedStyleAndLayoutDuration,r.count++):e.set(t,{totalDuration:n.duration,styleAndLayoutDuration:n.forcedStyleAndLayoutDuration,count:1})}e.size>0&&(n[`${Yo}loaf_scripts`]=JSON.stringify(Object.fromEntries([...e].sort((e,t)=>t[1].totalDuration-e[1].totalDuration).slice(0,250).map(([e,t])=>[e,{total_duration:Math.round(t.totalDuration),style_and_layout_duration:Math.round(t.styleAndLayoutDuration),count:t.count}]))))}}catch(e){t.error(`error building loaf scripts for INP`,e)}return n},Js=(e,t)=>{let n={},r=e.attribution.navigationEntry;if(r)try{var i;let e=Gs(r.redirectEnd-r.redirectStart),t=Gs(r.domainLookupEnd-r.domainLookupStart),a=Gs(r.secureConnectionStart>0?r.secureConnectionStart-r.connectStart:r.connectEnd-r.connectStart),o=Gs(r.secureConnectionStart>0?r.connectEnd-r.secureConnectionStart:0),s=Gs(Math.max((i=r.finalResponseHeadersStart)==null?0:i,r.responseStart)-r.requestStart),c=Gs(Math.round(r.responseEnd-r.startTime)-e-t-a-o-s),l=Yo;n[`${l}redirect`]=e,n[`${l}domainLookup`]=t,n[`${l}tcpConnection`]=a,n[`${l}tlsNegotiation`]=o,n[`${l}serverResponse`]=s,n[`${l}unattributed`]=c}catch(e){t.error(`error computing TTFB timing breakdown`,e)}else t.debug(`TTFB navigationEntry unavailable, skipping timing breakdown`);return n};var Ys=class extends Xa{constructor({diag:e,perf:t,listeners:n=Us,urlDocument:r=window.document,urlAttribution:i=!0,pageManager:a}={}){super({instrumentationName:`WebVitalsInstrumentation`,instrumentationVersion:`1.0.0`,diag:e,perf:t,config:{}}),z(this,`_listeners`,void 0),z(this,`_urlDocument`,void 0),z(this,`_urlAttribution`,void 0),z(this,`_pageManager`,void 0),z(this,`_attributedPage`,{INP:void 0,LCP:void 0,CLS:void 0,FCP:void 0,TTFB:void 0}),z(this,`_largestShiftTargetForCLS`,void 0),z(this,`_listenersRegistered`,!1),z(this,`_isEnabled`,!1),this._listeners=n,this._urlDocument=r,this._urlAttribution=i,this._pageManager=a==null?Wi.getPageManager():a,this._config.enabled&&this.enable()}disable(){this._isEnabled=!1,this._diag.debug(`WebVitalsInstrumentation disabled, pausing emission`)}enable(){if(this._isEnabled=!0,this._listenersRegistered){this._diag.debug(`WebVitalsInstrumentation listeners already registered, resuming emission`);return}if(this._listenersRegistered=!0,Hs.forEach(e=>{var t,n;(t=(n=this._listeners)[e])==null||t.call(n,t=>{if(!this._isEnabled)return;let n=this.sessionManager.getSessionSpan();if(!n)return;let r=this._getTimeForMetric(t),i=this._getAttributedPageForMetric(t),a=H(H(H({"mxl.type":`ux.web_vital`,"url.full":i.fullURL,"browser.url.full":i.fullURL,"mxl.web_vital.navigation_type":t.navigationType,"mxl.web_vital.name":t.name,"mxl.web_vital.rating":t.rating,"mxl.web_vital.id":t.id,"mxl.web_vital.delta":t.delta,"mxl.web_vital.value":t.value},Ks(t)),e===`INP`?qs(t,this._diag):{}),e===`TTFB`?Js(t,this._diag):{});i.path&&i.pageID&&(a[`app.surface.name`]=i.path,a[`app.surface.id`]=i.pageID),i.label&&(a[`app.surface.label`]=i.label),n.addEvent(`mxl-web-vitals-report-${e}`,a,r)})}),this._urlAttribution){var e,t,n,r,i,a,o,s,c,l;(e=(t=this._listeners).TTFB)==null||e.call(t,()=>{this._attributedPage.TTFB=this._currentAttributedPage()},{reportAllChanges:!0}),(n=(r=this._listeners).FCP)==null||n.call(r,()=>{this._attributedPage.FCP=this._currentAttributedPage()},{reportAllChanges:!0}),(i=(a=this._listeners).INP)==null||i.call(a,()=>{this._attributedPage.INP=this._currentAttributedPage()},{reportAllChanges:!0}),(o=(s=this._listeners).LCP)==null||o.call(s,()=>{this._attributedPage.LCP=this._currentAttributedPage()},{reportAllChanges:!0}),(c=(l=this._listeners).CLS)==null||c.call(l,e=>{let t=e;this._largestShiftTargetForCLS!==t.attribution.largestShiftTarget&&(this._largestShiftTargetForCLS=t.attribution.largestShiftTarget,this._attributedPage.CLS=this._currentAttributedPage())},{reportAllChanges:!0})}}_getTimeForMetric(e){return e.name===`CLS`&&e.attribution.largestShiftTime?this.perf.epochMillisFromOriginOffset(e.attribution.largestShiftTime):e.name===`INP`&&e.attribution.interactionTime?this.perf.epochMillisFromOriginOffset(e.attribution.interactionTime):this.perf.getNowMillis()}_currentAttributedPage(){let e={fullURL:this._urlDocument.URL},t=this._pageManager.getCurrentRoute(),n=this._pageManager.getCurrentPageId();t&&n&&(e.path=t.path,e.pageID=n);let r=this._pageManager.getPageLabel();return r&&(e.label=r),e}_getAttributedPageForMetric(e){return e.name===`FCP`&&this._attributedPage.FCP?this._attributedPage.FCP:e.name===`TTFB`&&this._attributedPage.TTFB?this._attributedPage.TTFB:e.name===`INP`&&this._attributedPage.INP?this._attributedPage.INP:e.name===`LCP`&&this._attributedPage.LCP?this._attributedPage.LCP:e.name===`CLS`&&this._attributedPage.CLS&&e.attribution.largestShiftTarget===this._largestShiftTargetForCLS?this._attributedPage.CLS:this._currentAttributedPage()}};function Xs(e){return Zs(e,new WeakSet)}function Zs(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>Zs(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>Zs(e,t))}return!1}var Qs=class{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){z(this,`hrTime`,void 0),z(this,`hrTimeObserved`,void 0),z(this,`spanContext`,void 0),z(this,`resource`,void 0),z(this,`instrumentationScope`,void 0),z(this,`attributes`,{}),z(this,`_severityText`,void 0),z(this,`_severityNumber`,void 0),z(this,`_body`,void 0),z(this,`_eventName`,void 0),z(this,`_attributesCount`,0),z(this,`_droppedAttributesCount`,0),z(this,`_isReadonly`,!1),z(this,`_logRecordLimits`,void 0);let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:o,severityText:s,body:c,attributes:l={},exception:u,context:d}=n,f=Date.now();if(this.hrTime=bn(r==null?f:r),this.hrTimeObserved=bn(i==null?f:i),d){let e=R.getSpanContext(d);e&&Re(e)&&(this.spanContext=e)}this.severityNumber=o,this.severityText=s,this.body=c,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(l),u!=null&&this._setException(u)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return L.warn(`Invalid attribute key: ${e}`),this;if(!Xs(t))return L.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&L.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return L.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute($t,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(tn,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(tn,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute($t,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(en,n.stack),t=!0)}t||L.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&L.warn(`Can not execute the operation on emitted log record`),this._isReadonly}},$s=class{constructor(e,t){z(this,`instrumentationScope`,void 0),z(this,`_sharedState`,void 0),z(this,`_loggerConfig`,void 0),this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){let t=e.context||I.active();if(!this.enabled(e))return;let n=new Qs(this._sharedState,this.instrumentationScope,H({context:t},e));this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(n,t),n._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e==null?void 0:e.severityNumber;if(typeof n==`number`&&n!==za.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=(e==null?void 0:e.context)||I.active();if(t.traceBased){let e=R.getSpanContext(r);if(e&&Re(e)&&(e.traceFlags&we.SAMPLED)!==we.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e==null?void 0:e.severityNumber,eventName:e==null?void 0:e.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}},ec=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}},tc=class{constructor(e,t){z(this,`processors`,void 0),z(this,`forceFlushTimeoutMillis`,void 0),this.processors=e,this.forceFlushTimeoutMillis=t}forceFlush(){var e=this;return B(function*(){let t=e.forceFlushTimeoutMillis;yield Promise.all(e.processors.map(e=>dr(e.forceFlush(),t)))})()}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}shutdown(){var e=this;return B(function*(){yield Promise.all(e.processors.map(e=>e.shutdown()))})()}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}};function nc(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var rc=class{constructor(e){z(this,`createdLogs`,void 0),this.createdLogs=e.createCounter(`otel.sdk.log.created`,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}};let ic={disabled:!1,minimumSeverity:za.UNSPECIFIED,traceBased:!1},ac=()=>H({},ic);var oc=class{constructor(e,t,n,r,i,a){z(this,`loggers`,new Map),z(this,`activeProcessor`,void 0),z(this,`registeredLogRecordProcessors`,[]),z(this,`resource`,void 0),z(this,`forceFlushTimeoutMillis`,void 0),z(this,`logRecordLimits`,void 0),z(this,`processors`,void 0),z(this,`loggerMetrics`,void 0),z(this,`_loggerConfigurator`,void 0),z(this,`_loggerConfigs`,new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new tc(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new ec,this._loggerConfigurator=i==null?ac:i;let o=a?a.getMeter(`@opentelemetry/sdk-logs`,`0.218.0`):_e();this.loggerMetrics=new rc(o)}getLoggerConfig(e){let t=nc(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}},sc=class{constructor(e={}){var t,n,r,i,a,o,s,c;z(this,`_shutdownOnce`,void 0),z(this,`_sharedState`,void 0);let l={resource:(t=e.resource)==null?Tr():t,forceFlushTimeoutMillis:(n=e.forceFlushTimeoutMillis)==null?3e4:n,logRecordLimits:{attributeCountLimit:(r=(i=e.logRecordLimits)==null?void 0:i.attributeCountLimit)==null?128:r,attributeValueLengthLimit:(a=(o=e.logRecordLimits)==null?void 0:o.attributeValueLengthLimit)==null?1/0:a},loggerConfigurator:(s=e.loggerConfigurator)==null?ac:s,processors:(c=e.processors)==null?[]:c,meterProvider:e.meterProvider};this._sharedState=new oc(l.resource,l.forceFlushTimeoutMillis,l.logRecordLimits,l.processors,l.loggerConfigurator,l.meterProvider),this._shutdownOnce=new hr(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return L.warn(`A shutdown LoggerProvider cannot provide a Logger`),Va;e||L.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${(n==null?void 0:n.schemaUrl)||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new $s({name:r,version:t,schemaUrl:n==null?void 0:n.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(L.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(L.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}};function cc(e){return lc.apply(this,arguments)}function lc(){return lc=B(function*(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.resource.asyncAttributesPending&&r.resource.waitForAsyncAttributes&&t.push(r.resource.waitForAsyncAttributes())}t!=null&&t.length>0&&(yield Promise.all(t))}),lc.apply(this,arguments)}var uc=class{constructor(e,t,n){z(this,`_exportCompleted`,void 0),z(this,`_exportScheduledPromise`,void 0),z(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,n)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}_executeExport(e,t,n){var r=this;return B(function*(){try{yield cc(t),yield I.with(jt(I.active()),B(function*(){return r._exportWithTimeout(e,t,n)}))}catch(e){Xt(e),r._exportScheduledResolve()}})()}_exportWithTimeout(e,t,n){var r=this;return B(function*(){return new Promise((i,a)=>{let o=setTimeout(()=>{a(Error(`Timeout`))},n);e.export(t,e=>{if(clearTimeout(o),e.code===Dn.SUCCESS)i();else{var t;a((t=e.error)==null?Error(`BatchLogRecordProcessor: log record export failed`):t)}}),r._exportScheduledResolve()})})()}},dc=class{constructor(e,t){var n,r,i,a;z(this,`_maxExportBatchSize`,void 0),z(this,`_maxQueueSize`,void 0),z(this,`_scheduledDelayMillis`,void 0),z(this,`_exportTimeoutMillis`,void 0),z(this,`_exporter`,void 0),z(this,`_currentExport`,null),z(this,`_finishedLogRecords`,[]),z(this,`_timer`,void 0),z(this,`_shutdownOnce`,void 0),z(this,`_flushing`,!1),this._exporter=e,this._maxExportBatchSize=(n=t==null?void 0:t.maxExportBatchSize)==null?512:n,this._maxQueueSize=(r=t==null?void 0:t.maxQueueSize)==null?2048:r,this._scheduledDelayMillis=(i=t==null?void 0:t.scheduledDelayMillis)==null?5e3:i,this._exportTimeoutMillis=(a=t==null?void 0:t.exportTimeoutMillis)==null?3e4:a,this._shutdownOnce=new hr(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(L.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}_shutdown(){var e=this;return B(function*(){e.onShutdown(),yield e._flushAll(),yield e._exporter.shutdown()})()}_flushAll(){var e=this;return B(function*(){if(e._flushing)return;e._flushing=!0;let t=e._finishedLogRecords;for(e._finishedLogRecords=[],e._clearTimer(),e._currentExport!==null&&(yield e._exporter.forceFlush(),yield e._currentExport.exportCompleted,e._currentExport=null);t.length>0;){let n;t.length<=e._maxExportBatchSize?(n=t,t=[]):n=t.splice(0,e._maxExportBatchSize);let r=new uc(e._exporter,n,e._exportTimeoutMillis);e._currentExport=r;try{yield r.exportScheduled,yield e._exporter.forceFlush(),yield r.exportCompleted}catch(e){Xt(e)}finally{e._currentExport=null}}e._flushing=!1,e._maybeStartTimer()})()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(e===null)return;let t=new uc(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,Xt(e),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},fc=class extends dc{constructor(e,t){super(e,t),z(this,`_visibilityChangeListener`,void 0),z(this,`_pageHideListener`,void 0),this._onInit(t)}onShutdown(){typeof document>`u`||(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}_onInit(e){(e==null?void 0:e.disableAutoFlushOnDocumentHide)===!0||typeof document>`u`||(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush()},this._pageHideListener=()=>{this.forceFlush()},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}},pc=class{constructor(e){z(this,`_sessionIdProvider`,void 0),this._sessionIdProvider=e}forceFlush(){return B(function*(){})()}onStart(e,t){var n;let r=(n=this._sessionIdProvider)==null?void 0:n.getSessionId();r&&e.setAttribute(`session.id`,r)}onEnd(e){}shutdown(){return B(function*(){})()}};function mc(e){return new pc(e)}let hc={compression:`gzip`,keepalive:!0,concurrencyLimit:5,timeoutMillis:30*1e3},gc=(e,t)=>({"X-MXL-AID":e,"X-MXL-DID":t}),_c=(e,t)=>t||`http://mxl-otelcol.service-availability.apps.ocpthikadev01.safaricom.net`,vc=`1.9.1`,yc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function bc(e){let t=new Set([e]),n=new Set,r=e.match(yc);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(yc);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)}}let xc=bc(vc),Sc=vc.split(`.`)[0],Cc=Symbol.for(`opentelemetry.js.api.${Sc}`),wc=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function Tc(e,t,n,r=!1){var i;let a=wc[Cc]=(i=wc[Cc])==null?{version:vc}:i;if(!r&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(a.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${vc}`);return n.error(t.stack||t.message),!1}return a[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${vc}.`),!0}function Ec(e){var t,n;let r=(t=wc[Cc])==null?void 0:t.version;if(!(!r||!xc(r)))return(n=wc[Cc])==null?void 0:n[e]}function Dc(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${vc}.`);let n=wc[Cc];n&&delete n[e]}var Oc=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return kc(`debug`,this._namespace,e)}error(...e){return kc(`error`,this._namespace,e)}info(...e){return kc(`info`,this._namespace,e)}warn(...e){return kc(`warn`,this._namespace,e)}verbose(...e){return kc(`verbose`,this._namespace,e)}};function kc(e,t,n){let r=Ec(`diag`);if(r)return r[e](t,...n)}var Ac;(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`})(Ac||(Ac={}));function jc(e,t){e<Ac.NONE?e=Ac.NONE:e>Ac.ALL&&(e=Ac.ALL),t=t||{};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,Ac.ERROR),warn:n(`warn`,Ac.WARN),info:n(`info`,Ac.INFO),debug:n(`debug`,Ac.DEBUG),verbose:n(`verbose`,Ac.VERBOSE)}}let Mc=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function e(e){return function(...t){let n=Ec(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:Ac.INFO})=>{var r,i,a;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((r=e.stack)==null?e.message:r),!1}typeof n==`number`&&(n={logLevel:n});let o=Ec(`diag`),s=jc((i=n.logLevel)==null?Ac.INFO:i,e);if(o&&!n.suppressOverrideMessage){let e=(a=Error().stack)==null?`<failed to generate stacktrace>`:a;o.warn(`Current logger will be overwritten from ${e}`),s.warn(`Current logger will overwrite one already registered from ${e}`)}return Tc(`diag`,s,t,!0)},t.disable=()=>{Dc(`diag`,t)},t.createComponentLogger=e=>new Oc(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}}.instance(),Nc=Math.pow(10,9);function Pc(e){return e[0]*Nc+e[1]}function Fc(e,t){let n={attributes:Lc(e.attributes,t),droppedAttributesCount:0},r=e.schemaUrl;return r&&r!==``&&(n.schemaUrl=r),n}function Ic(e){return{name:e.name,version:e.version}}function Lc(e,t){return Object.keys(e).map(n=>Rc(n,e[n],t))}function Rc(e,t,n){return{key:e,value:zc(t,n)}}function zc(e,t){let n=typeof e;if(n===`string`)return{stringValue:e};if(n===`number`)return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(n===`boolean`)return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=zc(e[r],t);return{arrayValue:{values:n}}}if(n===`object`&&e!=null){let n=Object.keys(e),r=Array(n.length);for(let i=0;i<n.length;i++)r[i]={key:n[i],value:zc(e[n[i]],t)};return{kvlistValue:{values:r}}}return{}}function Bc(e,t){return{resourceLogs:Hc(e,t)}}function Vc(e){let t=new Map;for(let n of e){let{resource:e,instrumentationScope:{name:r,version:i=``,schemaUrl:a=``}}=n,o=t.get(e);o||(o=new Map,t.set(e,o));let s=`${r}@${i}:${a}`,c=o.get(s);c||(c=[],o.set(s,c)),c.push(n)}return t}function Hc(e,t){let n=Vc(e);return Array.from(n,([e,n])=>{let r=Fc(e,t);return{resource:r,scopeLogs:Array.from(n,([,e])=>({scope:Ic(e[0].instrumentationScope),logRecords:e.map(e=>Uc(e,t)),schemaUrl:e[0].instrumentationScope.schemaUrl})),schemaUrl:r.schemaUrl}})}function Uc(e,t){var n,r,i;return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:Wc(e.severityNumber),severityText:e.severityText,body:zc(e.body,t),eventName:e.eventName,attributes:Gc(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,flags:(n=e.spanContext)==null?void 0:n.traceFlags,traceId:t.encodeOptionalSpanContext((r=e.spanContext)==null?void 0:r.traceId),spanId:t.encodeOptionalSpanContext((i=e.spanContext)==null?void 0:i.spanId)}}function Wc(e){return e}function Gc(e,t){return Object.keys(e).map(n=>Rc(n,e[n],t))}function Kc(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function qc(e){return Kc(e).toString()}let Jc=typeof BigInt<`u`?qc:Pc;function Yc(e){return e}let Xc={encodeHrTime:Jc,encodeSpanContext:Yc,encodeOptionalSpanContext:Yc,encodeUint8Array:e=>{if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return btoa(t.join(``))}},Zc={serializeRequest:e=>{let t=Bc(e,Xc);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return Mc.warn(`Failed to parse logs export response: ${e.message}. Returning empty response`),{}}}};function Qc(e,t){let n=e&255|256;return t&&(n|=512),n}function $c(e,t){var n,r,i,a;let o=e.spanContext(),s=e.status,c=(n=e.parentSpanContext)!=null&&n.spanId?t.encodeSpanContext((r=e.parentSpanContext)==null?void 0:r.spanId):void 0;return{traceId:t.encodeSpanContext(o.traceId),spanId:t.encodeSpanContext(o.spanId),parentSpanId:c,traceState:(i=o.traceState)==null?void 0:i.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:Lc(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>tl(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:s.code,message:s.message},links:e.links.map(e=>el(e,t)),droppedLinksCount:e.droppedLinksCount,flags:Qc(o.traceFlags,(a=e.parentSpanContext)==null?void 0:a.isRemote)}}function el(e,t){var n;return{attributes:e.attributes?Lc(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:(n=e.context.traceState)==null?void 0:n.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:Qc(e.context.traceFlags,e.context.isRemote)}}function tl(e,t){return{attributes:e.attributes?Lc(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function nl(e,t){return{resourceSpans:il(e,t)}}function rl(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function il(e,t){let n=rl(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>$c(e,t));o.push({scope:Ic(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=Fc(e,t),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}let al={serializeRequest:e=>{let t=nl(e,Xc);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return Mc.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}};var ol=class{constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}},sl=class extends Error{constructor(e,t,n){super(e),z(this,`code`,void 0),z(this,`name`,`OTLPExporterError`),z(this,`data`,void 0),this.data=n,this.code=t}},cl=class{constructor(e){z(this,`_concurrencyLimit`,void 0),z(this,`_sendingPromises`,[]),this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}awaitAll(){var e=this;return B(function*(){yield Promise.all(e._sendingPromises)})()}};function ll(e){return new cl(e.concurrencyLimit)}function ul(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function dl(){return{handleResponse(e){e==null||!ul(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||L.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var fl=class{constructor(e,t,n,r,i){z(this,`_diagLogger`,void 0),z(this,`_transport`,void 0),z(this,`_serializer`,void 0),z(this,`_responseHandler`,void 0),z(this,`_promiseQueue`,void 0),z(this,`_timeout`,void 0),this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=L.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:Dn.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:Dn.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:Dn.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:Dn.FAILED,error:e.error});return}else if(e.status===`retryable`){var n;t({code:Dn.FAILED,error:(n=e.error)==null?new sl(`Export failed with retryable status`):n})}else t({code:Dn.FAILED,error:new sl(`Export failed with unknown error`)})},e=>t({code:Dn.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}shutdown(){var e=this;return B(function*(){e._diagLogger.debug(`shutdown started`),yield e.forceFlush(),e._transport.shutdown()})()}};function pl(e,t){return new fl(e.transport,e.serializer,dl(),e.promiseHandler,t.timeout)}function ml(e,t,n){return pl({transport:n,serializer:t,promiseHandler:ll(e)},{timeout:e.timeoutMillis})}let hl=49152,gl=0,_l=0;var vl=class e{constructor(e){this._config=e}static _compressRequest(e){return B(function*(){let t=new CompressionStream(`gzip`),n=t.writable.getWriter();n.write(e),n.close();let r=[],i=t.readable.getReader(),a=!1;for(;!a;){let e=yield i.read();e.value&&r.push(e.value),a=e.done}let o=new Uint8Array(r.reduce((e,t)=>e+t.length,0)),s=0;for(let e of r)o.set(e,s),s+=e.length;return o})()}send(e,t){return this._asyncSend(e,t)}shutdown(){}_asyncSend(t,n){var r=this;return B(function*(){let i=t,a=H({"Content-Type":`application/json`},r._config.headers),o,s;if(`timeout`in AbortSignal)o=AbortSignal.timeout(n);else{let e=new AbortController;o=e.signal,s=setTimeout(()=>{e.abort(new DOMException(`TimeoutError`,`TimeoutError`))},n)}let c=!1;try{if(r._config.compression===`gzip`){try{i=yield e._compressRequest(t)}catch(e){let t=e instanceof Error?e:Error(String(e));return L.warn(`Fetch transport gzip compression failed: ${t.message}`),{status:`failure`,error:t}}a[`Content-Encoding`]=`gzip`,a[`Content-Length`]=i.length.toString()}let n=gl+i.byteLength>hl;if(c=!n&&!(_l>=9),c)gl+=i.byteLength,_l++;else{let e=n?`inflight bytes (${gl} + ${i.byteLength}) would exceed ${hl}B budget`:`concurrent count (${_l}) at limit of 9`;L.debug(`Sending without keepalive: ${e}`)}let s=yield fetch(r._config.url,{method:`POST`,keepalive:c,headers:a,body:i,signal:o});if(s.ok)return{status:`success`};let l=Error(`${s.status} Fetch request failed`),u=`Fetch transport received HTTP ${s.status} (keepalive=${c})`;return s.status>=500?(L.debug(u),{status:`retryable`,error:l}):(L.warn(u),{status:`failure`,error:l})}catch(e){let t=e instanceof Error?e:Error(String(e)),n=t instanceof TypeError||t instanceof DOMException&&t.name===`TimeoutError`,r=`Fetch transport failed (keepalive=${c}): ${t.message}`;return n?L.debug(r):L.warn(r),{status:n?`retryable`:`failure`,error:t}}finally{s!==void 0&&clearTimeout(s),c&&(gl-=i.byteLength,_l--)}})()}};let yl=e=>new vl(e),bl=()=>Math.random()*40-20;var xl=class{constructor(e,t=new Ci){this._transport=e,this._perf=t}send(e,t){var n=this;return B(function*(){let r=n._perf.getNowMillis()+t,i=yield n._transport.send(e,t),a=5,o=1e3;for(;i.status===`retryable`&&a>0;){var s;a--;let t=Math.max(Math.min(o,5e3)+bl(),0);o*=1.5;let c=(s=i.retryInMillis)==null?t:s,l=r-n._perf.getNowMillis();if(c>l)return i;i=yield n._retry(e,l,c)}return i})()}shutdown(){this._transport.shutdown()}_retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}};let Sl=e=>{var t;return new xl(e.transport,(t=e.perf)==null?new Ci:t)},Cl=(e,t)=>ml(e,t,Sl({transport:yl(e)}));var wl=class extends ol{constructor(e){super(Cl(e,Zc))}};let Tl=(e,t)=>`${_c(e,t)}/v1/logs`;var El=class extends wl{constructor({appID:e,userID:t,mxlDataURL:n}){super(H(H({},hc),{},{headers:gc(e,t),url:Tl(e,n)}))}},Dl=class extends ol{constructor(e){super(Cl(H(H({},e),{},{compression:`gzip`}),al))}};let Ol=(e,t)=>`${_c(e,t)}/v1/traces`;var kl=class extends Dl{constructor({appID:e,userID:t,mxlDataURL:n}){super(H(H({},hc),{},{headers:gc(e,t),url:Ol(e,n)}))}},Al=class{constructor({urlDocument:e=window.document}={}){z(this,`_urlDocument`,void 0),this._urlDocument=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){e.attributes[`browser.url.full`]||e.setAttribute(St,this._urlDocument.URL)}shutdown(){return Promise.resolve(void 0)}},jl=class{constructor({urlDocument:e=window.document}={}){z(this,`_urlDocument`,void 0),this._urlDocument=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){e.attributes[`browser.url.full`]||(e.attributes[St]=this._urlDocument.URL)}onStart(){}shutdown(){return Promise.resolve(void 0)}},Ml=class{constructor({spanSessionManager:e}){z(this,`_spanSessionManager`,void 0),this._spanSessionManager=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){e.setAttributes({"log.record.uid":mt(),[La]:this._spanSessionManager.getSessionId(),"session.previous_id":this._spanSessionManager.getPreviousSessionId()})}shutdown(){return Promise.resolve(void 0)}},Nl=class{constructor({attributeScrubbers:e}){z(this,`_attributeScrubbers`,void 0),this._attributeScrubbers=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){this._attributeScrubbers.forEach(t=>{let n=e.attributes[t.key];n&&typeof n==`string`&&e.setAttribute(t.key,t.scrub(n))})}shutdown(){return Promise.resolve(void 0)}},Pl=class{constructor({urlDocument:e=window.document}={}){z(this,`_urlDocument`,void 0),this._urlDocument=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){e.attributes[`mxl.type`]||e.setAttribute(_t,`sys.log`),e.setAttribute(fn,this._urlDocument.URL)}shutdown(){return Promise.resolve(void 0)}};let Fl=e=>{if((e.attributes[`http.request.method`]||e.attributes[`http.method`])&&(typeof e.attributes[`http.response.status_code`]==`number`||typeof e.attributes[`http.status_code`]==`number`)){var t;let n=(t=e.attributes[`url.full`])==null?e.attributes[Zt]:t;return typeof n==`string`&&n.includes(`://`)}return!1};var Il=class{forceFlush(){return Promise.resolve(void 0)}onEnd(e){if(Fl(e)){var t,n,r,i,a;e.attributes[_t]=`perf.network_request`,(t=e.attributes)[`url.full`]!=null||(t[`url.full`]=e.attributes[`http.url`]),(n=e.attributes)[`http.response.status_code`]!=null||(n[`http.response.status_code`]=e.attributes[`http.status_code`]),(r=e.attributes)[`http.request.method`]!=null||(r[`http.request.method`]=e.attributes[`http.method`]),(i=e.attributes)[`http.response.body.size`]!=null||(i[`http.response.body.size`]=e.attributes[`http.response_content_length`]),(a=e.attributes)[`http.request.body.size`]!=null||(a[`http.request.body.size`]=e.attributes[`http.request_content_length`])}}onStart(){}shutdown(){return Promise.resolve(void 0)}};let Ll=e=>e.attributes[_t]===`ux.session`,Rl=(e,t)=>`mxl.${t===`current`?`export_failed`:`previous_export_failed`}.${e}`;var zl=class{constructor({resource:e,exporter:t,limitManager:n,spanSessionManager:r,storage:i=window.localStorage,storedSpansExpireTimeoutMS:a,diag:o=L.createComponentLogger({namespace:`MXLSessionBatchedSpanProcessor`})}){z(this,`_shutdownOnce`,void 0),z(this,`_pendingSpans`,[]),z(this,`_exporter`,void 0),z(this,`_limitManager`,void 0),z(this,`_spanStorage`,void 0),z(this,`_spanSessionManager`,void 0),z(this,`_diag`,void 0),z(this,`_shutdown`,()=>(this._spanStorage.destroy(),this._exporter.shutdown())),this._diag=o,this._exporter=t,this._shutdownOnce=new hr(this._shutdown,this),this._limitManager=n,this._spanSessionManager=r,this._spanStorage=new bi({resource:e,storage:i,diag:o,onExpiredSpansExport:e=>{this._exportSpans(e)},storedSpansExpireTimeoutMS:a,spanSessionManager:r})}forceFlush(){return this._diag.debug(`forceFlush called for MXLSessionBatchedSpanProcessor. This is a no op`),Promise.resolve(void 0)}onEnd(e){if(this._shutdownOnce.isCalled){this._diag.debug(`span ended after processor shutdown. Ignoring span.`);return}if(Ll(e))this._diag.debug(`session span ended. Exporting all pending spans.`),this._exportSpans([e,...this._pendingSpans]),this._pendingSpans=[];else{if(this._diag.debug(`non-session span ended. Adding to pending spans queue.`),this._limitManager.dropReadableSpan(e))return;this._pendingSpans.push(e)}}_exportSpans(e){_r._export(this._exporter,e).then(e=>{if(e.code===Dn.FAILED){var t;let n=((t=e.error)==null?void 0:t.message)||`unknown error`,r=`unknown`;n===`Concurrent export limit reached`?r=`concurrent_limit`:n===`Fetch request errored`&&(r=`fetch_error`),this._spanSessionManager.incrSessionCountForKey(Rl(r,`current`)),this._spanSessionManager.incrNextSessionCountForKey(Rl(r,`previous`)),this._diag.error(`spans failed to export: ${n}`)}}).catch(e=>{let t=`unknown error`;e&&e instanceof Error?t=e.message:typeof e==`string`&&(t=e),this._spanSessionManager.incrSessionCountForKey(Rl(`unknown`,`current`)),this._spanSessionManager.incrNextSessionCountForKey(Rl(`unknown`,`previous`)),this._diag.error(`spans failed to export: ${t}`)})}onStart(){}getPendingSpansCount(){return this._pendingSpans.length}storePendingSpans(e,t){this._spanStorage.storePendingSpans(e,t,this._pendingSpans)}clearStoredSpans(e){this._spanStorage.clearStoredSpans(e)}shutdown(){return this._shutdownOnce.call()}},Bl=class{constructor({pageManager:e}){z(this,`_pageManager`,void 0),this._pageManager=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){if(!e.attributes[`app.surface.name`]||!e.attributes[`app.surface.id`]){let t=this._pageManager.getCurrentRoute();t&&(e.setAttribute(Ct,t.path),e.setAttribute(wt,this._pageManager.getCurrentPageId()))}let t=this._pageManager.getPageLabel();t&&!e.attributes[`app.surface.label`]&&e.setAttribute(Tt,t)}shutdown(){return Promise.resolve(void 0)}},Vl=class{constructor({pageManager:e}){z(this,`_pageManager`,void 0),this._pageManager=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){if(!e.attributes[`app.surface.name`]||!e.attributes[`app.surface.id`]){let t=this._pageManager.getCurrentRoute(),n=this._pageManager.getCurrentPageId();t&&n&&(e.attributes[Ct]=t.path,e.attributes[wt]=n)}let t=this._pageManager.getPageLabel();t&&!e.attributes[`app.surface.label`]&&(e.attributes[Tt]=t)}onStart(){}shutdown(){return Promise.resolve(void 0)}},Hl=class{constructor({attributeScrubbers:e}){z(this,`_attributeScrubbers`,void 0),this._attributeScrubbers=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){this._attributeScrubbers.forEach(t=>{let n=e.attributes[t.key];n&&typeof n==`string`&&(e.attributes[t.key]=t.scrub(n))})}onStart(){}shutdown(){return Promise.resolve(void 0)}},Ul=class{constructor({userManager:e}){z(this,`_userManager`,void 0),this._userManager=e}forceFlush(){return Promise.resolve(void 0)}onEmit(e){this._userManager.getUserId()&&e.setAttributes({[Ra]:this._userManager.getUserId()})}shutdown(){return Promise.resolve(void 0)}},Wl=class{constructor({userManager:e}){z(this,`_userManager`,void 0),this._userManager=e}forceFlush(){return Promise.resolve(void 0)}onEnd(e){let t=this._userManager.getUserId();t&&(e.attributes[Ra]=t)}onStart(){}shutdown(){return Promise.resolve(void 0)}},Gl=class extends Hn{inject(e,t,n){super.inject(e,t,n);let r=R.getSpan(e);if(r){let e=t instanceof Headers?t.get(`traceparent`):ve.get(t,`traceparent`);e&&r.setAttribute(`mxl.w3c_traceparent`,e)}}};let Kl=/\/\/(.+):(.+)@(.+)\//,ql=[`AWSAccessKeyId`,`Signature`,`sig`,"`X-Goog-Signature",`password`,`auth`,`pw`,`token`],Jl=({value:e,queryParamRegex:t,scrubPath:n,scrubQuery:r})=>{let i=e;return n&&(i=i.replace(Kl,`//REDACTED:REDACTED@$3/`)),r&&(i=i.replaceAll(t,`$1$2=REDACTED`)),i},Yl=e=>{let t=[...ql,...e||[]],n=RegExp(`(^|&|\\?)(${t.join(`|`)})=[^&]+`,`g`);return[{key:fn,scrub:e=>Jl({value:e,queryParamRegex:n,scrubPath:!0,scrubQuery:!0})},{key:Zt,scrub:e=>Jl({value:e,queryParamRegex:n,scrubPath:!0,scrubQuery:!0})},{key:`url.path`,scrub:e=>Jl({value:e,queryParamRegex:n,scrubPath:!0,scrubQuery:!1})},{key:`url.query`,scrub:e=>Jl({value:e,queryParamRegex:n,scrubPath:!1,scrubQuery:!0})}]},Xl=new class{constructor({diagLogger:e=L.createComponentLogger({namespace:`mxl-registry`})}={}){z(this,`_sdk`,null),z(this,`_diag`,void 0),z(this,`register`,e=>{this._sdk!==null&&this._diag.warn(`previously registered sdk will be overwritten`),this._sdk=e}),z(this,`clear`,()=>{this._sdk===null&&this._diag.warn(`sdk already cleared, this is a no-op`),this._sdk=null}),z(this,`registered`,()=>this._sdk),this._diag=e}};
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -13,9 +13,9 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
- var U=function(){return U=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},U.apply(this,arguments)};function Ql(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function $l(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function W(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function G(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var eu;(function(e){e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`})(eu||(eu={}));function tu(e){return e.nodeType===e.ELEMENT_NODE}function nu(e){var t,n=(t=e)==null?void 0:t.host;return!!(n&&n.shadowRoot&&n.shadowRoot===e)}function ru(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,i=e.value,a=e.maskInputFn,o=i||``;return(t[n.toLowerCase()]||t[r])&&(o=a?a(o):`*`.repeat(o.length)),o}var iu=`__rrweb_original__`;function au(e){var t=e.getContext(`2d`);if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var i=0;i<e.height;i+=n){var a=t.getImageData,o=iu in a?a[iu]:a;if(new Uint32Array(o.call(t,r,i,Math.min(n,e.width-r),Math.min(n,e.height-i)).data.buffer).some(function(e){return e!==0}))return!1}return!0}var ou=1,su=RegExp(`[^a-z0-9-_:]`);function cu(){return ou++}function lu(e){if(e instanceof HTMLFormElement)return`form`;var t=e.tagName.toLowerCase().trim();return su.test(t)?`div`:t}function uu(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(du).join(``):null}catch(e){return null}}function du(e){var t=e.cssText;if(fu(e))try{t=uu(e.styleSheet)||t}catch(e){}return t}function fu(e){return`styleSheet`in e}function pu(e){return e.cssRules?Array.from(e.cssRules).map(function(e){return e.cssText||``}).join(``):``}function mu(e){var t=``;return t=e.indexOf(`//`)>-1?e.split(`/`).slice(0,3).join(`/`):e.split(`/`)[0],t=t.split(`?`)[0],t}var hu,gu,_u=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,vu=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,yu=/^(data:)([^,]*),(.*)/i;function bu(e,t){return(e||``).replace(_u,function(e,n,r,i,a,o){var s=r||a||o,c=n||i||``;if(!s)return e;if(!vu.test(s)||yu.test(s))return`url(`+c+s+c+`)`;if(s[0]===`/`)return`url(`+c+(mu(t)+s)+c+`)`;var l=t.split(`/`),u=s.split(`/`);l.pop();for(var d=0,f=u;d<f.length;d++){var p=f[d];p!==`.`&&(p===`..`?l.pop():l.push(p))}return`url(`+c+l.join(`/`)+c+`)`})}var xu=/^[^ \t\n\r\u000c]+/,Su=/^[, \t\n\r\u000c]+/;function Cu(e,t){if(t.trim()===``)return t;var n=0;function r(e){var r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):``}for(var i=[];r(Su),!(n>=t.length);){var a=r(xu);if(a.slice(-1)===`,`)a=wu(e,a.substring(0,a.length-1)),i.push(a);else{var o=``;a=wu(e,a);for(var s=!1;;){var c=t.charAt(n);if(c===``){i.push((a+o).trim());break}else if(s)c===`)`&&(s=!1);else if(c===`,`){n+=1,i.push((a+o).trim());break}else c===`(`&&(s=!0);o+=c,n+=1}}}return i.join(`, `)}function wu(e,t){if(!t||t.trim()===``)return t;var n=e.createElement(`a`);return n.href=t,n.href}function Tu(e){return!!(e.tagName===`svg`||e.ownerSVGElement)}function Eu(){var e=document.createElement(`a`);return e.href=``,e.href}function Du(e,t,n,r){return n===`src`||n===`href`&&r||n===`xlink:href`&&r&&r[0]!==`#`||n===`background`&&r&&(t===`table`||t===`td`||t===`th`)?wu(e,r):n===`srcset`&&r?Cu(e,r):n===`style`&&r?bu(r,Eu()):t===`object`&&n===`data`&&r?wu(e,r):r}function Ou(e,t,n){if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return n?e.matches(n):!1}function ku(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return n&&e.matches(n)?!0:ku(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,ku(e.parentNode,t,n)}function Au(e,t,n){var r=e.contentWindow;if(r){var i=!1,a;try{a=r.document.readyState}catch(e){return}if(a!==`complete`){var o=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener(`load`,function(){clearTimeout(o),i=!0,t()});return}var s=`about:blank`;if(r.location.href!==s||e.src===s||e.src===``){setTimeout(t,0);return}e.addEventListener(`load`,t)}}function ju(e,t){var n,r=t.doc,i=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,c=t.inlineStylesheet,l=t.maskInputOptions,u=l===void 0?{}:l,d=t.maskTextFn,f=t.maskInputFn,p=t.dataURLOptions,m=p===void 0?{}:p,h=t.inlineImages,g=t.recordCanvas,_=t.keepIframeSrcFn,v;if(r.__sn){var y=r.__sn.id;v=y===1?void 0:y}switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode===`CSS1Compat`?{type:eu.Document,childNodes:[],rootId:v}:{type:eu.Document,childNodes:[],compatMode:e.compatMode,rootId:v};case e.DOCUMENT_TYPE_NODE:return{type:eu.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:for(var b=Ou(e,i,a),x=lu(e),S={},C=0,w=Array.from(e.attributes);C<w.length;C++){var ee=w[C],T=ee.name,te=ee.value;S[T]=Du(r,x,T,te)}if(x===`link`&&c){var E=Array.from(r.styleSheets).find(function(t){return t.href===e.href}),ne=null;E&&(ne=uu(E)),ne&&(delete S.rel,delete S.href,S._cssText=bu(ne,E.href))}if(x===`style`&&e.sheet&&!(e.innerText||e.textContent||``).trim().length){var ne=uu(e.sheet);ne&&(S._cssText=bu(ne,Eu()))}if(x===`input`||x===`textarea`||x===`select`){var te=e.value;S.type!==`radio`&&S.type!==`checkbox`&&S.type!==`submit`&&S.type!==`button`&&te?S.value=ru({type:S.type,tagName:x,value:te,maskInputOptions:u,maskInputFn:f}):e.checked&&(S.checked=e.checked)}if(x===`option`&&(e.selected&&!u.select?S.selected=!0:delete S.selected),x===`canvas`&&g){if(e.__context===`2d`)au(e)||(S.rr_dataURL=e.toDataURL(m.type,m.quality));else if(!(`__context`in e)){var D=e.toDataURL(m.type,m.quality),O=document.createElement(`canvas`);O.width=e.width,O.height=e.height,D!==O.toDataURL(m.type,m.quality)&&(S.rr_dataURL=D)}}if(x===`img`&&h){hu||(hu=r.createElement(`canvas`),gu=hu.getContext(`2d`));var k=e,A=k.crossOrigin;k.crossOrigin=`anonymous`;var re=function(){try{hu.width=k.naturalWidth,hu.height=k.naturalHeight,gu.drawImage(k,0,0),S.rr_dataURL=hu.toDataURL(m.type,m.quality)}catch(e){console.warn(`Cannot inline img src=`+k.currentSrc+`! Error: `+e)}A?S.crossOrigin=A:delete S.crossOrigin};k.complete&&k.naturalWidth!==0?re():k.onload=re}if((x===`audio`||x===`video`)&&(S.rr_mediaState=e.paused?`paused`:`played`,S.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(S.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(S.rr_scrollTop=e.scrollTop),b){var ie=e.getBoundingClientRect(),ae=ie.width,j=ie.height;S={class:S.class,rr_width:ae+`px`,rr_height:j+`px`}}return x===`iframe`&&!_(S.src)&&(e.contentDocument||(S.rr_src=S.src),delete S.src),{type:eu.Element,tagName:x,attributes:S,childNodes:[],isSVG:Tu(e)||void 0,needBlock:b,rootId:v};case e.TEXT_NODE:var oe=e.parentNode&&e.parentNode.tagName,M=e.textContent,N=oe===`STYLE`?!0:void 0,P=oe===`SCRIPT`?!0:void 0;if(N&&M){try{e.nextSibling||e.previousSibling||(n=e.parentNode.sheet)!=null&&n.cssRules&&(M=pu(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: `+t,e)}M=bu(M,Eu())}return P&&(M=`SCRIPT_PLACEHOLDER`),!N&&!P&&ku(e,o,s)&&M&&(M=d?d(M):M.replace(/[\S]/g,`*`)),{type:eu.Text,textContent:M||``,isStyle:N,rootId:v};case e.CDATA_SECTION_NODE:return{type:eu.CDATA,textContent:``,rootId:v};case e.COMMENT_NODE:return{type:eu.Comment,textContent:e.textContent||``,rootId:v};default:return!1}}function K(e){return e===void 0?``:e.toLowerCase()}function Mu(e,t){return!!(t.comment&&e.type===eu.Comment||e.type===eu.Element&&(t.script&&(e.tagName===`script`||e.tagName===`link`&&e.attributes.rel===`preload`&&e.attributes.as===`script`||e.tagName===`link`&&e.attributes.rel===`prefetch`&&typeof e.attributes.href==`string`&&e.attributes.href.endsWith(`.js`))||t.headFavicon&&(e.tagName===`link`&&e.attributes.rel===`shortcut icon`||e.tagName===`meta`&&(K(e.attributes.name).match(/^msapplication-tile(image|color)$/)||K(e.attributes.name)===`application-name`||K(e.attributes.rel)===`icon`||K(e.attributes.rel)===`apple-touch-icon`||K(e.attributes.rel)===`shortcut icon`))||e.tagName===`meta`&&(t.headMetaDescKeywords&&K(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(K(e.attributes.property).match(/^(og|twitter|fb):/)||K(e.attributes.name).match(/^(og|twitter):/)||K(e.attributes.name)===`pinterest`)||t.headMetaRobots&&(K(e.attributes.name)===`robots`||K(e.attributes.name)===`googlebot`||K(e.attributes.name)===`bingbot`)||t.headMetaHttpEquiv&&e.attributes[`http-equiv`]!==void 0||t.headMetaAuthorship&&(K(e.attributes.name)===`author`||K(e.attributes.name)===`generator`||K(e.attributes.name)===`framework`||K(e.attributes.name)===`publisher`||K(e.attributes.name)===`progid`||K(e.attributes.property).match(/^article:/)||K(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(K(e.attributes.name)===`google-site-verification`||K(e.attributes.name)===`yandex-verification`||K(e.attributes.name)===`csrf-token`||K(e.attributes.name)===`p:domain_verify`||K(e.attributes.name)===`verify-v1`||K(e.attributes.name)===`verification`||K(e.attributes.name)===`shopify-checkout-api-token`))))}function Nu(e,t){var n=t.doc,r=t.map,i=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,c=t.skipChild,l=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,f=t.maskInputOptions,p=f===void 0?{}:f,m=t.maskTextFn,h=t.maskInputFn,g=t.slimDOMOptions,_=t.dataURLOptions,v=_===void 0?{}:_,y=t.inlineImages,b=y===void 0?!1:y,x=t.recordCanvas,S=x===void 0?!1:x,C=t.onSerialize,w=t.onIframeLoad,ee=t.iframeLoadTimeout,T=ee===void 0?5e3:ee,te=t.keepIframeSrcFn,E=te===void 0?function(){return!1}:te,ne=t.preserveWhiteSpace,D=ne===void 0?!0:ne,O=ju(e,{doc:n,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:h,dataURLOptions:v,inlineImages:b,recordCanvas:S,keepIframeSrcFn:E});if(!O)return console.warn(e,`not serialized`),null;var k=`__sn`in e?e.__sn.id:Mu(O,g)||!D&&O.type===eu.Text&&!O.isStyle&&!O.textContent.replace(/^\s+|\s+$/gm,``).length?-2:cu(),A=Object.assign(O,{id:k});if(e.__sn=A,k===-2)return null;r[k]=e,C&&C(e);var re=!l;if(A.type===eu.Element&&(re=re&&!A.needBlock,delete A.needBlock,e.shadowRoot&&(A.isShadowHost=!0)),(A.type===eu.Document||A.type===eu.Element)&&re){g.headWhitespace&&O.type===eu.Element&&O.tagName===`head`&&(D=!1);for(var ie={doc:n,map:r,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,skipChild:l,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:h,slimDOMOptions:g,dataURLOptions:v,inlineImages:b,recordCanvas:S,preserveWhiteSpace:D,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:T,keepIframeSrcFn:E},ae=0,j=Array.from(e.childNodes);ae<j.length;ae++){var oe=j[ae],M=Nu(oe,ie);M&&A.childNodes.push(M)}if(tu(e)&&e.shadowRoot)for(var N=0,P=Array.from(e.shadowRoot.childNodes);N<P.length;N++){var oe=P[N],M=Nu(oe,ie);M&&(M.isShadow=!0,A.childNodes.push(M))}}return e.parentNode&&nu(e.parentNode)&&(A.isShadow=!0),A.type===eu.Element&&A.tagName===`iframe`&&Au(e,function(){var t=e.contentDocument;if(t&&w){var n=Nu(t,{doc:t,map:r,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:h,slimDOMOptions:g,dataURLOptions:v,inlineImages:b,recordCanvas:S,preserveWhiteSpace:D,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:T,keepIframeSrcFn:E});n&&w(e,n)}},T),A}function Pu(e,t){var n=t||{},r=n.blockClass,i=r===void 0?`rr-block`:r,a=n.blockSelector,o=a===void 0?null:a,s=n.maskTextClass,c=s===void 0?`rr-mask`:s,l=n.maskTextSelector,u=l===void 0?null:l,d=n.inlineStylesheet,f=d===void 0?!0:d,p=n.inlineImages,m=p===void 0?!1:p,h=n.recordCanvas,g=h===void 0?!1:h,_=n.maskAllInputs,v=_===void 0?!1:_,y=n.maskTextFn,b=n.maskInputFn,x=n.slimDOM,S=x===void 0?!1:x,C=n.dataURLOptions,w=n.preserveWhiteSpace,ee=n.onSerialize,T=n.onIframeLoad,te=n.iframeLoadTimeout,E=n.keepIframeSrcFn,ne=E===void 0?function(){return!1}:E,D={};return[Nu(e,{doc:e,map:D,blockClass:i,blockSelector:o,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:v===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:v===!1?{password:!0}:v,maskTextFn:y,maskInputFn:b,slimDOMOptions:S===!0||S===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:S===`all`,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:S===!1?{}:S,dataURLOptions:C,inlineImages:m,recordCanvas:g,preserveWhiteSpace:w,onSerialize:ee,onIframeLoad:T,iframeLoadTimeout:te,keepIframeSrcFn:ne}),D]}var q;(function(e){e[e.DomContentLoaded=0]=`DomContentLoaded`,e[e.Load=1]=`Load`,e[e.FullSnapshot=2]=`FullSnapshot`,e[e.IncrementalSnapshot=3]=`IncrementalSnapshot`,e[e.Meta=4]=`Meta`,e[e.Custom=5]=`Custom`,e[e.Plugin=6]=`Plugin`})(q||(q={}));var Fu;(function(e){e[e.Mutation=0]=`Mutation`,e[e.MouseMove=1]=`MouseMove`,e[e.MouseInteraction=2]=`MouseInteraction`,e[e.Scroll=3]=`Scroll`,e[e.ViewportResize=4]=`ViewportResize`,e[e.Input=5]=`Input`,e[e.TouchMove=6]=`TouchMove`,e[e.MediaInteraction=7]=`MediaInteraction`,e[e.StyleSheetRule=8]=`StyleSheetRule`,e[e.CanvasMutation=9]=`CanvasMutation`,e[e.Font=10]=`Font`,e[e.Log=11]=`Log`,e[e.Drag=12]=`Drag`,e[e.StyleDeclaration=13]=`StyleDeclaration`})(Fu||(Fu={}));var Iu;(function(e){e[e.MouseUp=0]=`MouseUp`,e[e.MouseDown=1]=`MouseDown`,e[e.Click=2]=`Click`,e[e.ContextMenu=3]=`ContextMenu`,e[e.DblClick=4]=`DblClick`,e[e.Focus=5]=`Focus`,e[e.Blur=6]=`Blur`,e[e.TouchStart=7]=`TouchStart`,e[e.TouchMove_Departed=8]=`TouchMove_Departed`,e[e.TouchEnd=9]=`TouchEnd`,e[e.TouchCancel=10]=`TouchCancel`})(Iu||(Iu={}));var Lu;(function(e){e[e[`2D`]=0]=`2D`,e[e.WebGL=1]=`WebGL`,e[e.WebGL2=2]=`WebGL2`})(Lu||(Lu={}));var Ru;(function(e){e[e.Play=0]=`Play`,e[e.Pause=1]=`Pause`,e[e.Seeked=2]=`Seeked`,e[e.VolumeChange=3]=`VolumeChange`})(Ru||(Ru={}));var zu;(function(e){e.Start=`start`,e.Pause=`pause`,e.Resume=`resume`,e.Resize=`resize`,e.Finish=`finish`,e.FullsnapshotRebuilded=`fullsnapshot-rebuilded`,e.LoadStylesheetStart=`load-stylesheet-start`,e.LoadStylesheetEnd=`load-stylesheet-end`,e.SkipStart=`skip-start`,e.SkipEnd=`skip-end`,e.MouseInteraction=`mouse-interaction`,e.EventCast=`event-cast`,e.CustomEvent=`custom-event`,e.Flush=`flush`,e.StateChange=`state-change`,e.PlayBack=`play-back`})(zu||(zu={}));function Bu(e,t,n){n===void 0&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}function Vu(){return{map:{},getId:function(e){return!e||!e.__sn?-1:e.__sn.id},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}}}var Hu=`Please stop import mirror directly. Instead of that,\r
16
+ var W=function(){return W=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},W.apply(this,arguments)};function Zl(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ql(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function G(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function K(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var $l;(function(e){e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`})($l||($l={}));function eu(e){return e.nodeType===e.ELEMENT_NODE}function tu(e){var t,n=(t=e)==null?void 0:t.host;return!!(n&&n.shadowRoot&&n.shadowRoot===e)}function nu(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,i=e.value,a=e.maskInputFn,o=i||``;return(t[n.toLowerCase()]||t[r])&&(o=a?a(o):`*`.repeat(o.length)),o}var ru=`__rrweb_original__`;function iu(e){var t=e.getContext(`2d`);if(!t)return!0;for(var n=50,r=0;r<e.width;r+=n)for(var i=0;i<e.height;i+=n){var a=t.getImageData,o=ru in a?a[ru]:a;if(new Uint32Array(o.call(t,r,i,Math.min(n,e.width-r),Math.min(n,e.height-i)).data.buffer).some(function(e){return e!==0}))return!1}return!0}var au=1,ou=RegExp(`[^a-z0-9-_:]`);function su(){return au++}function cu(e){if(e instanceof HTMLFormElement)return`form`;var t=e.tagName.toLowerCase().trim();return ou.test(t)?`div`:t}function lu(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(uu).join(``):null}catch(e){return null}}function uu(e){var t=e.cssText;if(du(e))try{t=lu(e.styleSheet)||t}catch(e){}return t}function du(e){return`styleSheet`in e}function fu(e){return e.cssRules?Array.from(e.cssRules).map(function(e){return e.cssText||``}).join(``):``}function pu(e){var t=``;return t=e.indexOf(`//`)>-1?e.split(`/`).slice(0,3).join(`/`):e.split(`/`)[0],t=t.split(`?`)[0],t}var mu,hu,gu=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,_u=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,vu=/^(data:)([^,]*),(.*)/i;function yu(e,t){return(e||``).replace(gu,function(e,n,r,i,a,o){var s=r||a||o,c=n||i||``;if(!s)return e;if(!_u.test(s)||vu.test(s))return`url(`+c+s+c+`)`;if(s[0]===`/`)return`url(`+c+(pu(t)+s)+c+`)`;var l=t.split(`/`),u=s.split(`/`);l.pop();for(var d=0,f=u;d<f.length;d++){var p=f[d];p!==`.`&&(p===`..`?l.pop():l.push(p))}return`url(`+c+l.join(`/`)+c+`)`})}var bu=/^[^ \t\n\r\u000c]+/,xu=/^[, \t\n\r\u000c]+/;function Su(e,t){if(t.trim()===``)return t;var n=0;function r(e){var r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):``}for(var i=[];r(xu),!(n>=t.length);){var a=r(bu);if(a.slice(-1)===`,`)a=Cu(e,a.substring(0,a.length-1)),i.push(a);else{var o=``;a=Cu(e,a);for(var s=!1;;){var c=t.charAt(n);if(c===``){i.push((a+o).trim());break}else if(s)c===`)`&&(s=!1);else if(c===`,`){n+=1,i.push((a+o).trim());break}else c===`(`&&(s=!0);o+=c,n+=1}}}return i.join(`, `)}function Cu(e,t){if(!t||t.trim()===``)return t;var n=e.createElement(`a`);return n.href=t,n.href}function wu(e){return!!(e.tagName===`svg`||e.ownerSVGElement)}function Tu(){var e=document.createElement(`a`);return e.href=``,e.href}function Eu(e,t,n,r){return n===`src`||n===`href`&&r||n===`xlink:href`&&r&&r[0]!==`#`||n===`background`&&r&&(t===`table`||t===`td`||t===`th`)?Cu(e,r):n===`srcset`&&r?Su(e,r):n===`style`&&r?yu(r,Tu()):t===`object`&&n===`data`&&r?Cu(e,r):r}function Du(e,t,n){if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return n?e.matches(n):!1}function Ou(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return n&&e.matches(n)?!0:Ou(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,Ou(e.parentNode,t,n)}function ku(e,t,n){var r=e.contentWindow;if(r){var i=!1,a;try{a=r.document.readyState}catch(e){return}if(a!==`complete`){var o=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener(`load`,function(){clearTimeout(o),i=!0,t()});return}var s=`about:blank`;if(r.location.href!==s||e.src===s||e.src===``){setTimeout(t,0);return}e.addEventListener(`load`,t)}}function Au(e,t){var n,r=t.doc,i=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,c=t.inlineStylesheet,l=t.maskInputOptions,u=l===void 0?{}:l,d=t.maskTextFn,f=t.maskInputFn,p=t.dataURLOptions,m=p===void 0?{}:p,h=t.inlineImages,g=t.recordCanvas,_=t.keepIframeSrcFn,v;if(r.__sn){var y=r.__sn.id;v=y===1?void 0:y}switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode===`CSS1Compat`?{type:$l.Document,childNodes:[],rootId:v}:{type:$l.Document,childNodes:[],compatMode:e.compatMode,rootId:v};case e.DOCUMENT_TYPE_NODE:return{type:$l.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:for(var b=Du(e,i,a),x=cu(e),S={},C=0,w=Array.from(e.attributes);C<w.length;C++){var ee=w[C],T=ee.name,E=ee.value;S[T]=Eu(r,x,T,E)}if(x===`link`&&c){var D=Array.from(r.styleSheets).find(function(t){return t.href===e.href}),te=null;D&&(te=lu(D)),te&&(delete S.rel,delete S.href,S._cssText=yu(te,D.href))}if(x===`style`&&e.sheet&&!(e.innerText||e.textContent||``).trim().length){var te=lu(e.sheet);te&&(S._cssText=yu(te,Tu()))}if(x===`input`||x===`textarea`||x===`select`){var E=e.value;S.type!==`radio`&&S.type!==`checkbox`&&S.type!==`submit`&&S.type!==`button`&&E?S.value=nu({type:S.type,tagName:x,value:E,maskInputOptions:u,maskInputFn:f}):e.checked&&(S.checked=e.checked)}if(x===`option`&&(e.selected&&!u.select?S.selected=!0:delete S.selected),x===`canvas`&&g){if(e.__context===`2d`)iu(e)||(S.rr_dataURL=e.toDataURL(m.type,m.quality));else if(!(`__context`in e)){var O=e.toDataURL(m.type,m.quality),k=document.createElement(`canvas`);k.width=e.width,k.height=e.height,O!==k.toDataURL(m.type,m.quality)&&(S.rr_dataURL=O)}}if(x===`img`&&h){mu||(mu=r.createElement(`canvas`),hu=mu.getContext(`2d`));var A=e,j=A.crossOrigin;A.crossOrigin=`anonymous`;var ne=function(){try{mu.width=A.naturalWidth,mu.height=A.naturalHeight,hu.drawImage(A,0,0),S.rr_dataURL=mu.toDataURL(m.type,m.quality)}catch(e){console.warn(`Cannot inline img src=`+A.currentSrc+`! Error: `+e)}j?S.crossOrigin=j:delete S.crossOrigin};A.complete&&A.naturalWidth!==0?ne():A.onload=ne}if((x===`audio`||x===`video`)&&(S.rr_mediaState=e.paused?`paused`:`played`,S.rr_mediaCurrentTime=e.currentTime),e.scrollLeft&&(S.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(S.rr_scrollTop=e.scrollTop),b){var re=e.getBoundingClientRect(),ie=re.width,M=re.height;S={class:S.class,rr_width:ie+`px`,rr_height:M+`px`}}return x===`iframe`&&!_(S.src)&&(e.contentDocument||(S.rr_src=S.src),delete S.src),{type:$l.Element,tagName:x,attributes:S,childNodes:[],isSVG:wu(e)||void 0,needBlock:b,rootId:v};case e.TEXT_NODE:var ae=e.parentNode&&e.parentNode.tagName,N=e.textContent,P=ae===`STYLE`?!0:void 0,F=ae===`SCRIPT`?!0:void 0;if(P&&N){try{e.nextSibling||e.previousSibling||(n=e.parentNode.sheet)!=null&&n.cssRules&&(N=fu(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: `+t,e)}N=yu(N,Tu())}return F&&(N=`SCRIPT_PLACEHOLDER`),!P&&!F&&Ou(e,o,s)&&N&&(N=d?d(N):N.replace(/[\S]/g,`*`)),{type:$l.Text,textContent:N||``,isStyle:P,rootId:v};case e.CDATA_SECTION_NODE:return{type:$l.CDATA,textContent:``,rootId:v};case e.COMMENT_NODE:return{type:$l.Comment,textContent:e.textContent||``,rootId:v};default:return!1}}function q(e){return e===void 0?``:e.toLowerCase()}function ju(e,t){return!!(t.comment&&e.type===$l.Comment||e.type===$l.Element&&(t.script&&(e.tagName===`script`||e.tagName===`link`&&e.attributes.rel===`preload`&&e.attributes.as===`script`||e.tagName===`link`&&e.attributes.rel===`prefetch`&&typeof e.attributes.href==`string`&&e.attributes.href.endsWith(`.js`))||t.headFavicon&&(e.tagName===`link`&&e.attributes.rel===`shortcut icon`||e.tagName===`meta`&&(q(e.attributes.name).match(/^msapplication-tile(image|color)$/)||q(e.attributes.name)===`application-name`||q(e.attributes.rel)===`icon`||q(e.attributes.rel)===`apple-touch-icon`||q(e.attributes.rel)===`shortcut icon`))||e.tagName===`meta`&&(t.headMetaDescKeywords&&q(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(q(e.attributes.property).match(/^(og|twitter|fb):/)||q(e.attributes.name).match(/^(og|twitter):/)||q(e.attributes.name)===`pinterest`)||t.headMetaRobots&&(q(e.attributes.name)===`robots`||q(e.attributes.name)===`googlebot`||q(e.attributes.name)===`bingbot`)||t.headMetaHttpEquiv&&e.attributes[`http-equiv`]!==void 0||t.headMetaAuthorship&&(q(e.attributes.name)===`author`||q(e.attributes.name)===`generator`||q(e.attributes.name)===`framework`||q(e.attributes.name)===`publisher`||q(e.attributes.name)===`progid`||q(e.attributes.property).match(/^article:/)||q(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(q(e.attributes.name)===`google-site-verification`||q(e.attributes.name)===`yandex-verification`||q(e.attributes.name)===`csrf-token`||q(e.attributes.name)===`p:domain_verify`||q(e.attributes.name)===`verify-v1`||q(e.attributes.name)===`verification`||q(e.attributes.name)===`shopify-checkout-api-token`))))}function Mu(e,t){var n=t.doc,r=t.map,i=t.blockClass,a=t.blockSelector,o=t.maskTextClass,s=t.maskTextSelector,c=t.skipChild,l=c===void 0?!1:c,u=t.inlineStylesheet,d=u===void 0?!0:u,f=t.maskInputOptions,p=f===void 0?{}:f,m=t.maskTextFn,h=t.maskInputFn,g=t.slimDOMOptions,_=t.dataURLOptions,v=_===void 0?{}:_,y=t.inlineImages,b=y===void 0?!1:y,x=t.recordCanvas,S=x===void 0?!1:x,C=t.onSerialize,w=t.onIframeLoad,ee=t.iframeLoadTimeout,T=ee===void 0?5e3:ee,E=t.keepIframeSrcFn,D=E===void 0?function(){return!1}:E,te=t.preserveWhiteSpace,O=te===void 0?!0:te,k=Au(e,{doc:n,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:h,dataURLOptions:v,inlineImages:b,recordCanvas:S,keepIframeSrcFn:D});if(!k)return console.warn(e,`not serialized`),null;var A=`__sn`in e?e.__sn.id:ju(k,g)||!O&&k.type===$l.Text&&!k.isStyle&&!k.textContent.replace(/^\s+|\s+$/gm,``).length?-2:su(),j=Object.assign(k,{id:A});if(e.__sn=j,A===-2)return null;r[A]=e,C&&C(e);var ne=!l;if(j.type===$l.Element&&(ne=ne&&!j.needBlock,delete j.needBlock,e.shadowRoot&&(j.isShadowHost=!0)),(j.type===$l.Document||j.type===$l.Element)&&ne){g.headWhitespace&&k.type===$l.Element&&k.tagName===`head`&&(O=!1);for(var re={doc:n,map:r,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,skipChild:l,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:h,slimDOMOptions:g,dataURLOptions:v,inlineImages:b,recordCanvas:S,preserveWhiteSpace:O,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:T,keepIframeSrcFn:D},ie=0,M=Array.from(e.childNodes);ie<M.length;ie++){var ae=M[ie],N=Mu(ae,re);N&&j.childNodes.push(N)}if(eu(e)&&e.shadowRoot)for(var P=0,F=Array.from(e.shadowRoot.childNodes);P<F.length;P++){var ae=F[P],N=Mu(ae,re);N&&(N.isShadow=!0,j.childNodes.push(N))}}return e.parentNode&&tu(e.parentNode)&&(j.isShadow=!0),j.type===$l.Element&&j.tagName===`iframe`&&ku(e,function(){var t=e.contentDocument;if(t&&w){var n=Mu(t,{doc:t,map:r,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:m,maskInputFn:h,slimDOMOptions:g,dataURLOptions:v,inlineImages:b,recordCanvas:S,preserveWhiteSpace:O,onSerialize:C,onIframeLoad:w,iframeLoadTimeout:T,keepIframeSrcFn:D});n&&w(e,n)}},T),j}function Nu(e,t){var n=t||{},r=n.blockClass,i=r===void 0?`rr-block`:r,a=n.blockSelector,o=a===void 0?null:a,s=n.maskTextClass,c=s===void 0?`rr-mask`:s,l=n.maskTextSelector,u=l===void 0?null:l,d=n.inlineStylesheet,f=d===void 0?!0:d,p=n.inlineImages,m=p===void 0?!1:p,h=n.recordCanvas,g=h===void 0?!1:h,_=n.maskAllInputs,v=_===void 0?!1:_,y=n.maskTextFn,b=n.maskInputFn,x=n.slimDOM,S=x===void 0?!1:x,C=n.dataURLOptions,w=n.preserveWhiteSpace,ee=n.onSerialize,T=n.onIframeLoad,E=n.iframeLoadTimeout,D=n.keepIframeSrcFn,te=D===void 0?function(){return!1}:D,O={};return[Mu(e,{doc:e,map:O,blockClass:i,blockSelector:o,maskTextClass:c,maskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:v===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:v===!1?{password:!0}:v,maskTextFn:y,maskInputFn:b,slimDOMOptions:S===!0||S===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:S===`all`,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:S===!1?{}:S,dataURLOptions:C,inlineImages:m,recordCanvas:g,preserveWhiteSpace:w,onSerialize:ee,onIframeLoad:T,iframeLoadTimeout:E,keepIframeSrcFn:te}),O]}var J;(function(e){e[e.DomContentLoaded=0]=`DomContentLoaded`,e[e.Load=1]=`Load`,e[e.FullSnapshot=2]=`FullSnapshot`,e[e.IncrementalSnapshot=3]=`IncrementalSnapshot`,e[e.Meta=4]=`Meta`,e[e.Custom=5]=`Custom`,e[e.Plugin=6]=`Plugin`})(J||(J={}));var Pu;(function(e){e[e.Mutation=0]=`Mutation`,e[e.MouseMove=1]=`MouseMove`,e[e.MouseInteraction=2]=`MouseInteraction`,e[e.Scroll=3]=`Scroll`,e[e.ViewportResize=4]=`ViewportResize`,e[e.Input=5]=`Input`,e[e.TouchMove=6]=`TouchMove`,e[e.MediaInteraction=7]=`MediaInteraction`,e[e.StyleSheetRule=8]=`StyleSheetRule`,e[e.CanvasMutation=9]=`CanvasMutation`,e[e.Font=10]=`Font`,e[e.Log=11]=`Log`,e[e.Drag=12]=`Drag`,e[e.StyleDeclaration=13]=`StyleDeclaration`})(Pu||(Pu={}));var Fu;(function(e){e[e.MouseUp=0]=`MouseUp`,e[e.MouseDown=1]=`MouseDown`,e[e.Click=2]=`Click`,e[e.ContextMenu=3]=`ContextMenu`,e[e.DblClick=4]=`DblClick`,e[e.Focus=5]=`Focus`,e[e.Blur=6]=`Blur`,e[e.TouchStart=7]=`TouchStart`,e[e.TouchMove_Departed=8]=`TouchMove_Departed`,e[e.TouchEnd=9]=`TouchEnd`,e[e.TouchCancel=10]=`TouchCancel`})(Fu||(Fu={}));var Iu;(function(e){e[e[`2D`]=0]=`2D`,e[e.WebGL=1]=`WebGL`,e[e.WebGL2=2]=`WebGL2`})(Iu||(Iu={}));var Lu;(function(e){e[e.Play=0]=`Play`,e[e.Pause=1]=`Pause`,e[e.Seeked=2]=`Seeked`,e[e.VolumeChange=3]=`VolumeChange`})(Lu||(Lu={}));var Ru;(function(e){e.Start=`start`,e.Pause=`pause`,e.Resume=`resume`,e.Resize=`resize`,e.Finish=`finish`,e.FullsnapshotRebuilded=`fullsnapshot-rebuilded`,e.LoadStylesheetStart=`load-stylesheet-start`,e.LoadStylesheetEnd=`load-stylesheet-end`,e.SkipStart=`skip-start`,e.SkipEnd=`skip-end`,e.MouseInteraction=`mouse-interaction`,e.EventCast=`event-cast`,e.CustomEvent=`custom-event`,e.Flush=`flush`,e.StateChange=`state-change`,e.PlayBack=`play-back`})(Ru||(Ru={}));function zu(e,t,n){n===void 0&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}function Bu(){return{map:{},getId:function(e){return!e||!e.__sn?-1:e.__sn.id},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}}}var Vu=`Please stop import mirror directly. Instead of that,\r
17
17
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
18
- or you can use record.mirror to access the mirror instance during recording.`,Uu={map:{},getId:function(){return console.error(Hu),-1},getNode:function(){return console.error(Hu),null},removeNodeFromMap:function(){console.error(Hu)},has:function(){return console.error(Hu),!1},reset:function(){console.error(Hu)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(Uu=new Proxy(Uu,{get:function(e,t,n){return t===`map`&&console.error(Hu),Reflect.get(e,t,n)}}));function Wu(e,t,n){n===void 0&&(n={});var r=null,i=0;return function(a){var o=Date.now();!i&&n.leading===!1&&(i=o);var s=t-(o-i),c=this,l=arguments;s<=0||s>t?(r&&(clearTimeout(r),r=null),i=o,e.apply(c,l)):!r&&n.trailing!==!1&&(r=setTimeout(function(){i=n.leading===!1?0:Date.now(),r=null,e.apply(c,l)},s))}}function Gu(e,t,n,r,i){i===void 0&&(i=window);var a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),a&&a.set&&a.set.call(this,e)}}),function(){return Gu(e,t,a||{},!0)}}function Ku(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}function qu(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ju(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Yu(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;if(typeof t==`string`){if(e.closest!==void 0)return e.closest(`.`+t)!==null;n=e.classList.contains(t)}else e.classList.forEach(function(e){t.test(e)&&(n=!0)});return n||Yu(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,Yu(e.parentNode,t)}function Xu(e){return`__sn`in e?e.__sn.id===-2:!1}function Zu(e,t){if(nu(e))return!1;var n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Zu(e.parentNode,t):!0:!0}function Qu(e){return!!e.changedTouches}function $u(e){e===void 0&&(e=window),`NodeList`in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw TypeError(`1 argument is required`);do if(this===e)return!0;while(e=e&&e.parentNode);return!1})}(function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},e.prototype.remove=function(e,t){var n=this,r=this.indexes.get(e.parentId),i=this.indexes.get(e.id),a=function(e){n.removeIdSet.add(e);var r=t.getNode(e);r==null||r.childNodes.forEach(function(e){`__sn`in e&&a(e.__sn.id)})},o=function(t){n.removeIdSet.add(t.id),Object.values(t.children).forEach(function(e){return o(e)});var r=n.indexes.get(t.id);if(r){var i=r.parent;i&&(delete r.parent,delete i.children[r.id],n.indexes.delete(e.id))}};i?r?(delete i.parent,delete r.children[i.id],this.indexes.delete(e.id),o(i)):(delete this.tree[i.id],this.indexes.delete(i.id),o(i)):(this.removeNodeMutations.push(e),a(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,n,r,i=this,a=this,o=a.tree,s=a.removeNodeMutations,c=a.textMutations,l=a.attributeMutations,u={source:Fu.Mutation,removes:s,texts:c,attributes:l,adds:[]},d=function(e,t){t&&i.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter(function(e){return!i.removeIdSet.has(e.id)}),u.attributes=u.attributes.concat(t?[]:e.attributes).filter(function(e){return!i.removeIdSet.has(e.id)}),!i.removeIdSet.has(e.id)&&!i.removeIdSet.has(e.mutation.parentId)&&!t?(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach(function(e){return d(e,!1)})):Object.values(e.children).forEach(function(e){return d(e,!0)})};Object.values(o).forEach(function(e){return d(e,!1)});try{for(var f=$l(this.scrollMap.keys()),p=f.next();!p.done;p=f.next()){var m=p.value;this.removeIdSet.has(m)&&this.scrollMap.delete(m)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var h=$l(this.inputMap.keys()),g=h.next();!g.done;g=h.next()){var m=g.value;this.removeIdSet.has(m)&&this.inputMap.delete(m)}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var _=new Map(this.scrollMap),v=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:_,inputMap:v}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e.prototype.idRemoved=function(e){return this.removeIdSet.has(e)},e})();function ed(e){return`__sn`in e?e.__sn.type===eu.Element&&e.__sn.tagName===`iframe`:!1}function td(e){return!!(e!=null&&e.shadowRoot)}function nd(e){return`__ln`in e}var rd=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw Error(`Position outside of list range`);for(var t=this.head,n=0;n<e;n++)t=(t==null?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&nd(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&nd(e.nextSibling)&&e.nextSibling.__ln.previous){var n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),id=function(e,t){return`${e}@${t}`};function ad(e){return`__sn`in e}var od=function(){function e(){var e=this;this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,n,r,i;if(!(e.frozen||e.locked)){for(var a=[],o=new rd,s=function(t){for(var n=t,r=-2;r===-2;)n=n&&n.nextSibling,r=n&&e.mirror.getId(n);return r},c=function(t){for(var n,r,i,c,l,u=t.getRootNode?(n=t.getRootNode())==null?void 0:n.host:null,d=u;(i=(r=d==null?void 0:d.getRootNode)==null?void 0:r.call(d))!=null&&i.host;)d=((l=(c=d==null?void 0:d.getRootNode)==null?void 0:c.call(d))==null?void 0:l.host)||null;var f=!e.doc.contains(t)&&(d===null||!e.doc.contains(d));if(!(!t.parentNode||f)){var p=nu(t.parentNode)?e.mirror.getId(u):e.mirror.getId(t.parentNode),m=s(t);if(p===-1||m===-1)return o.addNode(t);var h=Nu(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(n){ed(n)&&e.iframeManager.addIframe(n),td(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)}});h&&a.push({parentId:p,nextId:m,node:h})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var l=$l(e.movedSet),u=l.next();!u.done;u=l.next()){var d=u.value;cd(e.removes,d,e.mirror)&&!e.movedSet.has(d.parentNode)||c(d)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}try{for(var f=$l(e.addedSet),p=f.next();!p.done;p=f.next()){var d=p.value;!ld(e.droppedSet,d)&&!cd(e.removes,d,e.mirror)||ld(e.movedSet,d)?c(d):e.droppedSet.add(d)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}for(var m=null;o.length;){var h=null;if(m){var g=e.mirror.getId(m.value.parentNode),_=s(m.value);g!==-1&&_!==-1&&(h=m)}if(!h)for(var v=o.length-1;v>=0;v--){var y=o.get(v);if(y){var g=e.mirror.getId(y.value.parentNode),_=s(y.value);if(g!==-1&&_!==-1){h=y;break}}}if(!h){for(;o.head;)o.removeNode(o.head.value);break}m=h.previous,o.removeNode(h.value),c(h.value)}var b={texts:e.texts.map(function(t){return{id:e.mirror.getId(t.node),value:t.value}}).filter(function(t){return e.mirror.has(t.id)}),attributes:e.attributes.map(function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}}).filter(function(t){return e.mirror.has(t.id)}),removes:e.removes,adds:a};!b.texts.length&&!b.attributes.length&&!b.removes.length&&!b.adds.length||(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(b))}},this.processMutation=function(t){var n,r,i,a;if(!Xu(t.target))switch(t.type){case`characterData`:var o=t.target.textContent;!Yu(t.target,e.blockClass)&&o!==t.oldValue&&e.texts.push({value:ku(t.target,e.maskTextClass,e.maskTextSelector)&&o?e.maskTextFn?e.maskTextFn(o):o.replace(/[\S]/g,`*`):o,node:t.target});break;case`attributes`:var s=t.target,o=t.target.getAttribute(t.attributeName);if(t.attributeName===`value`&&(o=ru({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute(`type`),value:o,maskInputFn:e.maskInputFn})),Yu(t.target,e.blockClass)||o===t.oldValue)return;var c=e.attributes.find(function(e){return e.node===t.target});if(c||(c={node:t.target,attributes:{}},e.attributes.push(c)),t.attributeName===`style`){var l=e.doc.createElement(`span`);t.oldValue&&l.setAttribute(`style`,t.oldValue),(c.attributes.style===void 0||c.attributes.style===null)&&(c.attributes.style={});var u=c.attributes.style;try{for(var d=$l(Array.from(s.style)),f=d.next();!f.done;f=d.next()){var p=f.value,m=s.style.getPropertyValue(p),h=s.style.getPropertyPriority(p);(m!==l.style.getPropertyValue(p)||h!==l.style.getPropertyPriority(p))&&(h===``?u[p]=m:u[p]=[m,h])}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}try{for(var g=$l(Array.from(l.style)),_=g.next();!_.done;_=g.next()){var p=_.value;s.style.getPropertyValue(p)===``&&(u[p]=!1)}}catch(e){i={error:e}}finally{try{_&&!_.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}}else c.attributes[t.attributeName]=Du(e.doc,t.target.tagName,t.attributeName,o);break;case`childList`:t.addedNodes.forEach(function(n){return e.genAdds(n,t.target)}),t.removedNodes.forEach(function(n){var r=e.mirror.getId(n),i=nu(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);Yu(t.target,e.blockClass)||Xu(n)||(e.addedSet.has(n)?(sd(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&r===-1||Zu(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[id(r,i)]?sd(e.movedSet,n):e.removes.push({parentId:i,id:r,isShadow:nu(t.target)?!0:void 0})),e.mapRemoves.push(n))});break}},this.genAdds=function(t,n){if(!(n&&Yu(n,e.blockClass))){if(ad(t)){if(Xu(t))return;e.movedSet.add(t);var r=null;n&&ad(n)&&(r=n.__sn.id),r&&(e.movedMap[id(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);Yu(t,e.blockClass)||t.childNodes.forEach(function(t){return e.genAdds(t)})}}}return e.prototype.init=function(e){var t=this;[`mutationCb`,`blockClass`,`blockSelector`,`maskTextClass`,`maskTextSelector`,`inlineStylesheet`,`maskInputOptions`,`maskTextFn`,`maskInputFn`,`recordCanvas`,`inlineImages`,`slimDOMOptions`,`doc`,`mirror`,`iframeManager`,`shadowDomManager`,`canvasManager`].forEach(function(n){t[n]=e[n]})},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function sd(e,t){e.delete(t),t.childNodes.forEach(function(t){return sd(e,t)})}function cd(e,t,n){var r=t.parentNode;if(!r)return!1;var i=n.getId(r);return e.some(function(e){return e.id===i})?!0:cd(e,r,n)}function ld(e,t){var n=t.parentNode;return n?e.has(n)?!0:ld(e,n):!1}var ud=[],dd=typeof CSSGroupingRule<`u`,fd=typeof CSSMediaRule<`u`,pd=typeof CSSSupportsRule<`u`,md=typeof CSSConditionRule<`u`;function hd(e){try{if(`composedPath`in e){var t=e.composedPath();if(t.length)return t[0]}else if(`path`in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function gd(e,t){var n,r,i=new od;ud.push(i),i.init(e);var a=window.MutationObserver||window.__rrMutationObserver,o=(r=(n=window==null?void 0:window.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,`MutationObserver`);o&&window[o]&&(a=window[o]);var s=new a(i.processMutations.bind(i));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function _d(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,i=e.mirror;if(n.mousemove===!1)return function(){};var a=typeof n.mousemove==`number`?n.mousemove:50,o=typeof n.mousemoveCallback==`number`?n.mousemoveCallback:500,s=[],c,l=Wu(function(e){var n=Date.now()-c;t(s.map(function(e){return e.timeOffset-=n,e}),e),s=[],c=null},o),u=Wu(function(e){var t=hd(e),n=Qu(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;c||(c=Date.now()),s.push({x:r,y:a,id:i.getId(t),timeOffset:Date.now()-c}),l(typeof DragEvent<`u`&&e instanceof DragEvent?Fu.Drag:e instanceof MouseEvent?Fu.MouseMove:Fu.TouchMove)},a,{trailing:!1}),d=[Bu(`mousemove`,u,r),Bu(`touchmove`,u,r),Bu(`drag`,u,r)];return function(){d.forEach(function(e){return e()})}}function vd(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,i=e.blockClass,a=e.sampling;if(a.mouseInteraction===!1)return function(){};var o=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,s=[],c=function(e){return function(n){var a=hd(n);if(!Yu(a,i)){var o=Qu(n)?n.changedTouches[0]:n;if(o){var s=r.getId(a),c=o.clientX,l=o.clientY;t({type:Iu[e],id:s,x:c,y:l})}}}};return Object.keys(Iu).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&o[e]!==!1}).forEach(function(e){var t=e.toLowerCase(),r=c(e);s.push(Bu(t,r,n))}),function(){s.forEach(function(e){return e()})}}function yd(e){var t=e.scrollCb,n=e.doc,r=e.mirror,i=e.blockClass,a=e.sampling;return Bu(`scroll`,Wu(function(e){var a=hd(e);if(!(!a||Yu(a,i))){var o=r.getId(a);if(a===n){var s=n.scrollingElement||n.documentElement;t({id:o,x:s.scrollLeft,y:s.scrollTop})}else t({id:o,x:a.scrollLeft,y:a.scrollTop})}},a.scroll||100),n)}function bd(e){var t=e.viewportResizeCb,n=-1,r=-1;return Bu(`resize`,Wu(function(){var e=qu(),i=Ju();(n!==e||r!==i)&&(t({width:Number(i),height:Number(e)}),n=e,r=i)},200),window)}function xd(e,t){var n=U({},e);return t||delete n.userTriggered,n}var Sd=[`INPUT`,`TEXTAREA`,`SELECT`],Cd=new WeakMap;function wd(e){var t=e.inputCb,n=e.doc,r=e.mirror,i=e.blockClass,a=e.ignoreClass,o=e.maskInputOptions,s=e.maskInputFn,c=e.sampling,l=e.userTriggeredOnInput;function u(e){var t=hd(e),r=e.isTrusted;if(t&&t.tagName===`OPTION`&&(t=t.parentElement),!(!t||!t.tagName||Sd.indexOf(t.tagName)<0||Yu(t,i))){var c=t.type;if(!t.classList.contains(a)){var u=t.value,f=!1;c===`radio`||c===`checkbox`?f=t.checked:(o[t.tagName.toLowerCase()]||o[c])&&(u=ru({maskInputOptions:o,tagName:t.tagName,type:c,value:u,maskInputFn:s})),d(t,xd({text:u,isChecked:f,userTriggered:r},l));var p=t.name;c===`radio`&&p&&f&&n.querySelectorAll(`input[type="radio"][name="${p}"]`).forEach(function(e){e!==t&&d(e,xd({text:e.value,isChecked:!f,userTriggered:!1},l))})}}}function d(e,n){var i=Cd.get(e);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){Cd.set(e,n);var a=r.getId(e);t(U(U({},n),{id:a}))}}var f=(c.input===`last`?[`change`]:[`input`,`change`]).map(function(e){return Bu(e,u,n)}),p=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`),m=[[HTMLInputElement.prototype,`value`],[HTMLInputElement.prototype,`checked`],[HTMLSelectElement.prototype,`value`],[HTMLTextAreaElement.prototype,`value`],[HTMLSelectElement.prototype,`selectedIndex`],[HTMLOptionElement.prototype,`selected`]];return p&&p.set&&f.push.apply(f,G([],W(m.map(function(e){return Gu(e[0],e[1],{set:function(){u({target:this})}})})),!1)),function(){f.forEach(function(e){return e()})}}function Td(e){var t=[];function n(e,t){if(dd&&e.parentRule instanceof CSSGroupingRule||fd&&e.parentRule instanceof CSSMediaRule||pd&&e.parentRule instanceof CSSSupportsRule||md&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules),r=n.indexOf(e);t.unshift(r)}else{var n=Array.from(e.parentStyleSheet.cssRules),r=n.indexOf(e);t.unshift(r)}return t}return n(e,t)}function Ed(e,t){var n=e.styleSheetRuleCb,r=e.mirror,i=t.win,a=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=function(e,t){var i=r.getId(this.ownerNode);return i!==-1&&n({id:i,adds:[{rule:e,index:t}]}),a.apply(this,arguments)};var o=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=function(e){var t=r.getId(this.ownerNode);return t!==-1&&n({id:t,removes:[{index:e}]}),o.apply(this,arguments)};var s={};dd?s.CSSGroupingRule=i.CSSGroupingRule:(fd&&(s.CSSMediaRule=i.CSSMediaRule),md&&(s.CSSConditionRule=i.CSSConditionRule),pd&&(s.CSSSupportsRule=i.CSSSupportsRule));var c={};return Object.entries(s).forEach(function(e){var t=W(e,2),i=t[0],a=t[1];c[i]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=function(e,t){var a=r.getId(this.parentStyleSheet.ownerNode);return a!==-1&&n({id:a,adds:[{rule:e,index:G(G([],W(Td(this)),!1),[t||0],!1)}]}),c[i].insertRule.apply(this,arguments)},a.prototype.deleteRule=function(e){var t=r.getId(this.parentStyleSheet.ownerNode);return t!==-1&&n({id:t,removes:[{index:G(G([],W(Td(this)),!1),[e],!1)}]}),c[i].deleteRule.apply(this,arguments)}}),function(){i.CSSStyleSheet.prototype.insertRule=a,i.CSSStyleSheet.prototype.deleteRule=o,Object.entries(s).forEach(function(e){var t=W(e,2),n=t[0],r=t[1];r.prototype.insertRule=c[n].insertRule,r.prototype.deleteRule=c[n].deleteRule})}}function Dd(e,t){var n=e.styleDeclarationCb,r=e.mirror,i=t.win,a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(e,t,i){var o,s,c=r.getId((s=(o=this.parentRule)==null?void 0:o.parentStyleSheet)==null?void 0:s.ownerNode);return c!==-1&&n({id:c,set:{property:e,value:t,priority:i},index:Td(this.parentRule)}),a.apply(this,arguments)};var o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(e){var t,i,a=r.getId((i=(t=this.parentRule)==null?void 0:t.parentStyleSheet)==null?void 0:i.ownerNode);return a!==-1&&n({id:a,remove:{property:e},index:Td(this.parentRule)}),o.apply(this,arguments)},function(){i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o}}function Od(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.mirror,i=e.sampling,a=function(e){return Wu(function(i){var a=hd(i);if(!(!a||Yu(a,n))){var o=a,s=o.currentTime,c=o.volume,l=o.muted;t({type:e,id:r.getId(a),currentTime:s,volume:c,muted:l})}},i.media||500)},o=[Bu(`play`,a(0)),Bu(`pause`,a(1)),Bu(`seeked`,a(2)),Bu(`volumechange`,a(3))];return function(){o.forEach(function(e){return e()})}}function kd(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var i=[],a=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,n){var r=new o(e,t,n);return a.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=Ku(n.fonts,`add`,function(e){return function(n){return setTimeout(function(){var e=a.get(n);e&&(t(e),a.delete(n))},0),e.apply(this,[n])}});return i.push(function(){r.FontFace=o}),i.push(s),function(){i.forEach(function(e){return e()})}}function Ad(e,t){var n=e.mutationCb,r=e.mousemoveCb,i=e.mouseInteractionCb,a=e.scrollCb,o=e.viewportResizeCb,s=e.inputCb,c=e.mediaInteractionCb,l=e.styleSheetRuleCb,u=e.styleDeclarationCb,d=e.canvasMutationCb,f=e.fontCb;e.mutationCb=function(){var e=[...arguments];t.mutation&&t.mutation.apply(t,G([],W(e),!1)),n.apply(void 0,G([],W(e),!1))},e.mousemoveCb=function(){var e=[...arguments];t.mousemove&&t.mousemove.apply(t,G([],W(e),!1)),r.apply(void 0,G([],W(e),!1))},e.mouseInteractionCb=function(){var e=[...arguments];t.mouseInteraction&&t.mouseInteraction.apply(t,G([],W(e),!1)),i.apply(void 0,G([],W(e),!1))},e.scrollCb=function(){var e=[...arguments];t.scroll&&t.scroll.apply(t,G([],W(e),!1)),a.apply(void 0,G([],W(e),!1))},e.viewportResizeCb=function(){var e=[...arguments];t.viewportResize&&t.viewportResize.apply(t,G([],W(e),!1)),o.apply(void 0,G([],W(e),!1))},e.inputCb=function(){var e=[...arguments];t.input&&t.input.apply(t,G([],W(e),!1)),s.apply(void 0,G([],W(e),!1))},e.mediaInteractionCb=function(){var e=[...arguments];t.mediaInteaction&&t.mediaInteaction.apply(t,G([],W(e),!1)),c.apply(void 0,G([],W(e),!1))},e.styleSheetRuleCb=function(){var e=[...arguments];t.styleSheetRule&&t.styleSheetRule.apply(t,G([],W(e),!1)),l.apply(void 0,G([],W(e),!1))},e.styleDeclarationCb=function(){var e=[...arguments];t.styleDeclaration&&t.styleDeclaration.apply(t,G([],W(e),!1)),u.apply(void 0,G([],W(e),!1))},e.canvasMutationCb=function(){var e=[...arguments];t.canvasMutation&&t.canvasMutation.apply(t,G([],W(e),!1)),d.apply(void 0,G([],W(e),!1))},e.fontCb=function(){var e=[...arguments];t.font&&t.font.apply(t,G([],W(e),!1)),f.apply(void 0,G([],W(e),!1))}}function jd(e,t){var n,r;t===void 0&&(t={});var i=e.doc.defaultView;if(!i)return function(){};Ad(e,t);var a=gd(e,e.doc),o=_d(e),s=vd(e),c=yd(e),l=bd(e),u=wd(e),d=Od(e),f=Ed(e,{win:i}),p=Dd(e,{win:i}),m=e.collectFonts?kd(e):function(){},h=[];try{for(var g=$l(e.plugins),_=g.next();!_.done;_=g.next()){var v=_.value;h.push(v.observer(v.callback,i,v.options))}}catch(e){n={error:e}}finally{try{_&&!_.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}return function(){ud.forEach(function(e){return e.reset()}),a.disconnect(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h.forEach(function(e){return e()})}}var Md=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(n=this.loadListener)==null||n.call(this,e)},e}(),Nd=function(){function e(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var t=this;this.restorePatches.push(Ku(HTMLElement.prototype,`attachShadow`,function(e){return function(){var n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}}))}return e.prototype.addShadowRoot=function(e,t){gd(U(U({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),yd(U(U({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))},e.prototype.observeAttachShadow=function(e){if(e.contentWindow){var t=this;this.restorePatches.push(Ku(e.contentWindow.HTMLElement.prototype,`attachShadow`,function(n){return function(){var r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}}))}},e.prototype.reset=function(){this.restorePatches.forEach(function(e){return e()})},e}();function Pd(e,t,n,r){var i,a,o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),c=function(r){try{if(typeof t.CanvasRenderingContext2D.prototype[r]!=`function`)return`continue`;var i=Ku(t.CanvasRenderingContext2D.prototype,r,function(t){return function(){for(var i=this,a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];return Yu(this.canvas,n)||setTimeout(function(){var t=G([],W(a),!1);if(r===`drawImage`&&t[0]&&t[0]instanceof HTMLCanvasElement){var n=t[0],o=n.getContext(`2d`),s=o==null?void 0:o.getImageData(0,0,n.width,n.height),c=s==null?void 0:s.data;t[0]=JSON.stringify(c)}e(i.canvas,{type:Lu[`2D`],property:r,args:t})},0),t.apply(this,a)}});o.push(i)}catch(n){var a=Gu(t.CanvasRenderingContext2D.prototype,r,{set:function(t){e(this.canvas,{type:Lu[`2D`],property:r,args:[t],setter:!0})}});o.push(a)}};try{for(var l=$l(s),u=l.next();!u.done;u=l.next()){var d=u.value;c(d)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return function(){o.forEach(function(e){return e()})}}function Fd(e,t){var n=[];try{var r=Ku(e.HTMLCanvasElement.prototype,`getContext`,function(e){return function(n){var r=[...arguments].slice(1);return Yu(this,t)||`__context`in this||(this.__context=n),e.apply(this,G([n],W(r),!1))}});n.push(r)}catch(e){console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return function(){n.forEach(function(e){return e()})}}for(var Id=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Ld=typeof Uint8Array>`u`?[]:new Uint8Array(256),Rd=0;Rd<Id.length;Rd++)Ld[Id.charCodeAt(Rd)]=Rd;var zd=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=Id[t[n]>>2],i+=Id[(t[n]&3)<<4|t[n+1]>>4],i+=Id[(t[n+1]&15)<<2|t[n+2]>>6],i+=Id[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i},Bd=new Map;function Vd(e,t){var n=Bd.get(e);return n||(n=new Map,Bd.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var Hd=function(e,t,n){if(!(!e||!(Gd(e,t)||typeof e==`object`))){var r=e.constructor.name,i=Vd(n,r),a=i.indexOf(e);return a===-1&&(a=i.length,i.push(e)),a}};function Ud(e,t,n){return e instanceof Array?e.map(function(e){return Ud(e,t,n)}):e===null?e:e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:zd(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[Ud(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Ud(e.data,t,n),e.width,e.height]}:Gd(e,t)||typeof e==`object`?{rr_type:e.constructor.name,index:Hd(e,t,n)}:e}var Wd=function(e,t,n){return G([],W(e),!1).map(function(e){return Ud(e,t,n)})},Gd=function(e,t){return!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(function(e){return typeof t[e]==`function`}).find(function(n){return e instanceof t[n]})};function Kd(e,t,n,r,i,a){var o,s,c=[],l=Object.getOwnPropertyNames(e),u=function(o){try{if(typeof e[o]!=`function`)return`continue`;var s=Ku(e,o,function(s){return function(){var c=[...arguments],l=s.apply(this,c);if(Hd(l,a,e),!Yu(this.canvas,r)){i.getId(this.canvas);var u={type:t,property:o,args:Wd(G([],W(c),!1),a,e)};n(this.canvas,u)}return l}});c.push(s)}catch(r){var l=Gu(e,o,{set:function(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});c.push(l)}};try{for(var d=$l(l),f=d.next();!f.done;f=d.next()){var p=f.value;u(p)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(o)throw o.error}}return c}function qd(e,t,n,r){var i=[];return i.push.apply(i,G([],W(Kd(t.WebGLRenderingContext.prototype,Lu.WebGL,e,n,r,t)),!1)),t.WebGL2RenderingContext!==void 0&&i.push.apply(i,G([],W(Kd(t.WebGL2RenderingContext.prototype,Lu.WebGL2,e,n,r,t)),!1)),function(){i.forEach(function(e){return e()})}}var Jd=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,e.recordCanvas===!0&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Fd(e,t),r=Pd(this.processMutation.bind(this),e,t,this.mirror),i=qd(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){n(),r(),i()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},e.prototype.startRAFTimestamping=function(){var e=this,t=function(n){e.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach(function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!(this.frozen||this.locked)){var n=this.pendingCanvasMutations.get(e);if(!(!n||t===-1)){var r=n.map(function(e){return e.type,Ql(e,[`type`])}),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}();function Yd(e){return U(U({},e),{timestamp:Date.now()})}var J,Xd,Zd=Vu();function Qd(e){e===void 0&&(e={});var t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,a=i===void 0?`rr-block`:i,o=e.blockSelector,s=o===void 0?null:o,c=e.ignoreClass,l=c===void 0?`rr-ignore`:c,u=e.maskTextClass,d=u===void 0?`rr-mask`:u,f=e.maskTextSelector,p=f===void 0?null:f,m=e.inlineStylesheet,h=m===void 0?!0:m,g=e.maskAllInputs,_=e.maskInputOptions,v=e.slimDOMOptions,y=e.maskInputFn,b=e.maskTextFn,x=e.hooks,S=e.packFn,C=e.sampling,w=C===void 0?{}:C,ee=e.mousemoveWait,T=e.recordCanvas,te=T===void 0?!1:T,E=e.userTriggeredOnInput,ne=E===void 0?!1:E,D=e.collectFonts,O=D===void 0?!1:D,k=e.inlineImages,A=k===void 0?!1:k,re=e.plugins,ie=e.keepIframeSrcFn,ae=ie===void 0?function(){return!1}:ie;if(!t)throw Error(`emit function is required`);ee!==void 0&&w.mousemove===void 0&&(w.mousemove=ee);var j=g===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:_===void 0?{password:!0}:_,oe=v===!0||v===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:v===`all`,headMetaDescKeywords:v===`all`}:v||{};$u();var M,N=0,P=function(e){var t,n;try{for(var r=$l(re||[]),i=r.next();!i.done;i=r.next()){var a=i.value;a.eventProcessor&&(e=a.eventProcessor(e))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return S&&(e=S(e)),e};J=function(e,i){var a;if((a=ud[0])!=null&&a.isFrozen()&&e.type!==q.FullSnapshot&&!(e.type===q.IncrementalSnapshot&&e.data.source===Fu.Mutation)&&ud.forEach(function(e){return e.unfreeze()}),t(P(e),i),e.type===q.FullSnapshot)M=e,N=0;else if(e.type===q.IncrementalSnapshot){if(e.data.source===Fu.Mutation&&e.data.isAttachIframe)return;N++;var o=r&&N>=r,s=n&&e.timestamp-M.timestamp>n;(o||s)&&Xd(!0)}};var se=function(e){J(Yd({type:q.IncrementalSnapshot,data:U({source:Fu.Mutation},e)}))},ce=function(e){return J(Yd({type:q.IncrementalSnapshot,data:U({source:Fu.Scroll},e)}))},le=function(e){return J(Yd({type:q.IncrementalSnapshot,data:U({source:Fu.CanvasMutation},e)}))},ue=new Md({mutationCb:se}),de=new Jd({recordCanvas:te,mutationCb:le,win:window,blockClass:a,mirror:Zd}),fe=new Nd({mutationCb:se,scrollCb:ce,bypassOptions:{blockClass:a,blockSelector:s,maskTextClass:d,maskTextSelector:p,inlineStylesheet:h,maskInputOptions:j,maskTextFn:b,maskInputFn:y,recordCanvas:te,inlineImages:A,sampling:w,slimDOMOptions:oe,iframeManager:ue,canvasManager:de},mirror:Zd});Xd=function(e){var t,n,r,i;e===void 0&&(e=!1),J(Yd({type:q.Meta,data:{href:window.location.href,width:Ju(),height:qu()}}),e),ud.forEach(function(e){return e.lock()});var o=W(Pu(document,{blockClass:a,blockSelector:s,maskTextClass:d,maskTextSelector:p,inlineStylesheet:h,maskAllInputs:j,maskTextFn:b,slimDOM:oe,recordCanvas:te,inlineImages:A,onSerialize:function(e){ed(e)&&ue.addIframe(e),td(e)&&fe.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){ue.attachIframe(e,t),fe.observeAttachShadow(e)},keepIframeSrcFn:ae}),2),c=o[0],l=o[1];if(!c)return console.warn(`Failed to snapshot the document`);Zd.map=l,J(Yd({type:q.FullSnapshot,data:{node:c,initialOffset:{left:window.pageXOffset===void 0?(document==null?void 0:document.documentElement.scrollLeft)||((n=(t=document==null?void 0:document.body)==null?void 0:t.parentElement)==null?void 0:n.scrollLeft)||(document==null?void 0:document.body.scrollLeft)||0:window.pageXOffset,top:window.pageYOffset===void 0?(document==null?void 0:document.documentElement.scrollTop)||((i=(r=document==null?void 0:document.body)==null?void 0:r.parentElement)==null?void 0:i.scrollTop)||(document==null?void 0:document.body.scrollTop)||0:window.pageYOffset}}})),ud.forEach(function(e){return e.unlock()})};try{var pe=[];pe.push(Bu(`DOMContentLoaded`,function(){J(Yd({type:q.DomContentLoaded,data:{}}))}));var me=function(e){var t;return jd({mutationCb:se,mousemoveCb:function(e,t){return J(Yd({type:q.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return J(Yd({type:q.IncrementalSnapshot,data:U({source:Fu.MouseInteraction},e)}))},scrollCb:ce,viewportResizeCb:function(e){return J(Yd({type:q.IncrementalSnapshot,data:U({source:Fu.ViewportResize},e)}))},inputCb:function(e){return J(Yd({type:q.IncrementalSnapshot,data:U({source:Fu.Input},e)}))},mediaInteractionCb:function(e){return J(Yd({type:q.IncrementalSnapshot,data:U({source:Fu.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return J(Yd({type:q.IncrementalSnapshot,data:U({source:Fu.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return J(Yd({type:q.IncrementalSnapshot,data:U({source:Fu.StyleDeclaration},e)}))},canvasMutationCb:le,fontCb:function(e){return J(Yd({type:q.IncrementalSnapshot,data:U({source:Fu.Font},e)}))},blockClass:a,ignoreClass:l,maskTextClass:d,maskTextSelector:p,maskInputOptions:j,inlineStylesheet:h,sampling:w,recordCanvas:te,inlineImages:A,userTriggeredOnInput:ne,collectFonts:O,doc:e,maskInputFn:y,maskTextFn:b,blockSelector:s,slimDOMOptions:oe,mirror:Zd,iframeManager:ue,shadowDomManager:fe,canvasManager:de,plugins:((t=re==null?void 0:re.filter(function(e){return e.observer}))==null?void 0:t.map(function(e){return{observer:e.observer,options:e.options,callback:function(t){return J(Yd({type:q.Plugin,data:{plugin:e.name,payload:t}}))}}}))||[]},x)};ue.addLoadListener(function(e){pe.push(me(e.contentDocument))});var he=function(){Xd(),pe.push(me(document))};return document.readyState===`interactive`||document.readyState===`complete`?he():pe.push(Bu(`load`,function(){J(Yd({type:q.Load,data:{}})),he()},window)),function(){pe.forEach(function(e){return e()})}}catch(e){console.warn(e)}}Qd.addCustomEvent=function(e,t){if(!J)throw Error(`please add custom event after start recording`);J(Yd({type:q.Custom,data:{tag:e,payload:t}}))},Qd.freezePage=function(){ud.forEach(function(e){return e.freeze()})},Qd.takeFullSnapshot=function(e){if(!Xd)throw Error(`please take full snapshot after start recording`);Xd(e)},Qd.mirror=Zd;var $d=Uint8Array,ef=Uint16Array,tf=Uint32Array,nf=new $d([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),rf=new $d([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),af=new $d([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),of=function(e,t){for(var n=new ef(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new tf(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return[n,i]},sf=of(nf,2),cf=sf[0],lf=sf[1];cf[28]=258,lf[258]=28;var uf=of(rf,0);uf[0];for(var df=uf[1],ff=new ef(32768),Y=0;Y<32768;++Y){var pf=(Y&43690)>>>1|(Y&21845)<<1;pf=(pf&52428)>>>2|(pf&13107)<<2,pf=(pf&61680)>>>4|(pf&3855)<<4,ff[Y]=((pf&65280)>>>8|(pf&255)<<8)>>>1}for(var mf=(function(e,t,n){for(var r=e.length,i=0,a=new ef(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new ef(t);for(i=0;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new ef(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[ff[d]>>>c]=l}else for(s=new ef(r),i=0;i<r;++i)e[i]&&(s[i]=ff[o[e[i]-1]++]>>>15-e[i]);return s}),hf=new $d(288),Y=0;Y<144;++Y)hf[Y]=8;for(var Y=144;Y<256;++Y)hf[Y]=9;for(var Y=256;Y<280;++Y)hf[Y]=7;for(var Y=280;Y<288;++Y)hf[Y]=8;for(var gf=new $d(32),Y=0;Y<32;++Y)gf[Y]=5;var _f=mf(hf,9,0),vf=mf(gf,5,0),yf=function(e){return(e+7)/8|0},bf=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e.BYTES_PER_ELEMENT==2?ef:e.BYTES_PER_ELEMENT==4?tf:$d)(n-t);return r.set(e.subarray(t,n)),r},xf=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},Sf=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Cf=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[Af,0];if(i==1){var o=new $d(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};for(var f=a[0].s,r=1;r<i;++r)a[r].s>f&&(f=a[r].s);var p=new ef(f+1),m=wf(n[u-1],p,0);if(m>t){var r=0,h=0,g=m-t,_=1<<g;for(a.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r<i;++r){var v=a[r].s;if(p[v]>t)h+=_-(1<<m-p[v]),p[v]=t;else break}for(h>>>=g;h>0;){var y=a[r].s;p[y]<t?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=a[r].s;p[b]==t&&(--p[b],++h)}m=t}return[new $d(p),m]},wf=function(e,t,n){return e.s==-1?Math.max(wf(e.l,t,n+1),wf(e.r,t,n+1)):t[e.s]=n},Tf=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ef(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},Ef=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Df=function(e,t,n){var r=n.length,i=yf(t+2);e[i]=r&255,e[i+1]=r>>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},Of=function(e,t,n,r,i,a,o,s,c,l,u){xf(t,u++,n),++i[256];for(var d=Cf(i,15),f=d[0],p=d[1],m=Cf(a,15),h=m[0],g=m[1],_=Tf(f),v=_[0],y=_[1],b=Tf(h),x=b[0],S=b[1],C=new ef(19),w=0;w<v.length;++w)C[v[w]&31]++;for(var w=0;w<x.length;++w)C[x[w]&31]++;for(var ee=Cf(C,7),T=ee[0],te=ee[1],E=19;E>4&&!T[af[E-1]];--E);var ne=l+5<<3,D=Ef(i,hf)+Ef(a,gf)+o,O=Ef(i,f)+Ef(a,h)+o+14+3*E+Ef(C,T)+(2*C[16]+3*C[17]+7*C[18]);if(ne<=D&&ne<=O)return Df(t,u,e.subarray(c,c+l));var k,A,re,ie;if(xf(t,u,1+(O<D)),u+=2,O<D){k=mf(f,p,0),A=f,re=mf(h,g,0),ie=h;var ae=mf(T,te,0);xf(t,u,y-257),xf(t,u+5,S-1),xf(t,u+10,E-4),u+=14;for(var w=0;w<E;++w)xf(t,u+3*w,T[af[w]]);u+=3*E;for(var j=[v,x],oe=0;oe<2;++oe)for(var M=j[oe],w=0;w<M.length;++w){var N=M[w]&31;xf(t,u,ae[N]),u+=T[N],N>15&&(xf(t,u,M[w]>>>5&127),u+=M[w]>>>12)}}else k=_f,A=hf,re=vf,ie=gf;for(var w=0;w<s;++w)if(r[w]>255){var N=r[w]>>>18&31;Sf(t,u,k[N+257]),u+=A[N+257],N>7&&(xf(t,u,r[w]>>>23&31),u+=nf[N]);var P=r[w]&31;Sf(t,u,re[P]),u+=ie[P],P>3&&(Sf(t,u,r[w]>>>5&8191),u+=rf[P])}else Sf(t,u,k[r[w]]),u+=A[r[w]];return Sf(t,u,k[256]),u+A[256]},kf=new tf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Af=new $d(0),jf=function(e,t,n,r,i,a){var o=e.length,s=new $d(r+o+5*(1+Math.ceil(o/7e3))+i),c=s.subarray(r,s.length-i),l=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var d=u+65535;d>=o&&(c[l>>3]=a),l=Df(c,l+1,e.subarray(u,d))}else{for(var f=kf[t-1],p=f>>>13,m=f&8191,h=(1<<n)-1,g=new ef(32768),_=new ef(h+1),v=Math.ceil(n/3),y=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&h},x=new tf(25e3),S=new ef(288),C=new ef(32),w=0,ee=0,u=0,T=0,te=0,E=0;u<o;++u){var ne=b(u),D=u&32767,O=_[ne];if(g[D]=O,_[ne]=D,te<=u){var k=o-u;if((w>7e3||T>24576)&&k>423){l=Of(e,c,0,x,S,C,ee,T,E,u-E,l),T=w=ee=0,E=u;for(var A=0;A<286;++A)S[A]=0;for(var A=0;A<30;++A)C[A]=0}var re=2,ie=0,ae=m,j=D-O&32767;if(k>2&&ne==b(u-j))for(var oe=Math.min(p,k)-1,M=Math.min(32767,u),N=Math.min(258,k);j<=M&&--ae&&D!=O;){if(e[u+re]==e[u+re-j]){for(var P=0;P<N&&e[u+P]==e[u+P-j];++P);if(P>re){if(re=P,ie=j,P>oe)break;for(var se=Math.min(j,P-2),ce=0,A=0;A<se;++A){var le=u-j+A+32768&32767,ue=le-g[le]+32768&32767;ue>ce&&(ce=ue,O=le)}}}D=O,O=g[D],j+=D-O+32768&32767}if(ie){x[T++]=268435456|lf[re]<<18|df[ie];var de=lf[re]&31,fe=df[ie]&31;ee+=nf[de]+rf[fe],++S[257+de],++C[fe],te=u+re,++w}else x[T++]=e[u],++S[e[u]]}}l=Of(e,c,a,x,S,C,ee,T,E,u-E,l),!a&&l&7&&(l=Df(c,l+1,Af))}return bf(s,0,r+yf(l)+i)},Mf=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),Nf=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Mf[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},Pf=function(e,t,n,r,i){return jf(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,n,r,!i)},Ff=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},If=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Ff(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},Lf=function(e){return 10+(e.filename&&e.filename.length+1||0)};function Rf(e,t){t||(t={});var n=Nf(),r=e.length;n.p(e);var i=Pf(e,t,Lf(t),8),a=i.length;return If(i,t),Ff(i,a-8,n.d()),Ff(i,a-4,r),i}var zf=typeof TextDecoder<`u`&&new TextDecoder;try{zf.decode(Af,{stream:!0})}catch(e){}
18
+ or you can use record.mirror to access the mirror instance during recording.`,Hu={map:{},getId:function(){return console.error(Vu),-1},getNode:function(){return console.error(Vu),null},removeNodeFromMap:function(){console.error(Vu)},has:function(){return console.error(Vu),!1},reset:function(){console.error(Vu)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(Hu=new Proxy(Hu,{get:function(e,t,n){return t===`map`&&console.error(Vu),Reflect.get(e,t,n)}}));function Uu(e,t,n){n===void 0&&(n={});var r=null,i=0;return function(a){var o=Date.now();!i&&n.leading===!1&&(i=o);var s=t-(o-i),c=this,l=arguments;s<=0||s>t?(r&&(clearTimeout(r),r=null),i=o,e.apply(c,l)):!r&&n.trailing!==!1&&(r=setTimeout(function(){i=n.leading===!1?0:Date.now(),r=null,e.apply(c,l)},s))}}function Wu(e,t,n,r,i){i===void 0&&(i=window);var a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),a&&a.set&&a.set.call(this,e)}}),function(){return Wu(e,t,a||{},!0)}}function Gu(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}function Ku(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function qu(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ju(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;if(typeof t==`string`){if(e.closest!==void 0)return e.closest(`.`+t)!==null;n=e.classList.contains(t)}else e.classList.forEach(function(e){t.test(e)&&(n=!0)});return n||Ju(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,Ju(e.parentNode,t)}function Yu(e){return`__sn`in e?e.__sn.id===-2:!1}function Xu(e,t){if(tu(e))return!1;var n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Xu(e.parentNode,t):!0:!0}function Zu(e){return!!e.changedTouches}function Qu(e){e===void 0&&(e=window),`NodeList`in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw TypeError(`1 argument is required`);do if(this===e)return!0;while(e=e&&e.parentNode);return!1})}(function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},e.prototype.remove=function(e,t){var n=this,r=this.indexes.get(e.parentId),i=this.indexes.get(e.id),a=function(e){n.removeIdSet.add(e);var r=t.getNode(e);r==null||r.childNodes.forEach(function(e){`__sn`in e&&a(e.__sn.id)})},o=function(t){n.removeIdSet.add(t.id),Object.values(t.children).forEach(function(e){return o(e)});var r=n.indexes.get(t.id);if(r){var i=r.parent;i&&(delete r.parent,delete i.children[r.id],n.indexes.delete(e.id))}};i?r?(delete i.parent,delete r.children[i.id],this.indexes.delete(e.id),o(i)):(delete this.tree[i.id],this.indexes.delete(i.id),o(i)):(this.removeNodeMutations.push(e),a(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,n,r,i=this,a=this,o=a.tree,s=a.removeNodeMutations,c=a.textMutations,l=a.attributeMutations,u={source:Pu.Mutation,removes:s,texts:c,attributes:l,adds:[]},d=function(e,t){t&&i.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter(function(e){return!i.removeIdSet.has(e.id)}),u.attributes=u.attributes.concat(t?[]:e.attributes).filter(function(e){return!i.removeIdSet.has(e.id)}),!i.removeIdSet.has(e.id)&&!i.removeIdSet.has(e.mutation.parentId)&&!t?(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach(function(e){return d(e,!1)})):Object.values(e.children).forEach(function(e){return d(e,!0)})};Object.values(o).forEach(function(e){return d(e,!1)});try{for(var f=Ql(this.scrollMap.keys()),p=f.next();!p.done;p=f.next()){var m=p.value;this.removeIdSet.has(m)&&this.scrollMap.delete(m)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var h=Ql(this.inputMap.keys()),g=h.next();!g.done;g=h.next()){var m=g.value;this.removeIdSet.has(m)&&this.inputMap.delete(m)}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var _=new Map(this.scrollMap),v=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:_,inputMap:v}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e.prototype.idRemoved=function(e){return this.removeIdSet.has(e)},e})();function $u(e){return`__sn`in e?e.__sn.type===$l.Element&&e.__sn.tagName===`iframe`:!1}function ed(e){return!!(e!=null&&e.shadowRoot)}function td(e){return`__ln`in e}var nd=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw Error(`Position outside of list range`);for(var t=this.head,n=0;n<e;n++)t=(t==null?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&td(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&td(e.nextSibling)&&e.nextSibling.__ln.previous){var n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),rd=function(e,t){return`${e}@${t}`};function id(e){return`__sn`in e}var ad=function(){function e(){var e=this;this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,n,r,i;if(!(e.frozen||e.locked)){for(var a=[],o=new nd,s=function(t){for(var n=t,r=-2;r===-2;)n=n&&n.nextSibling,r=n&&e.mirror.getId(n);return r},c=function(t){for(var n,r,i,c,l,u=t.getRootNode?(n=t.getRootNode())==null?void 0:n.host:null,d=u;(i=(r=d==null?void 0:d.getRootNode)==null?void 0:r.call(d))!=null&&i.host;)d=((l=(c=d==null?void 0:d.getRootNode)==null?void 0:c.call(d))==null?void 0:l.host)||null;var f=!e.doc.contains(t)&&(d===null||!e.doc.contains(d));if(!(!t.parentNode||f)){var p=tu(t.parentNode)?e.mirror.getId(u):e.mirror.getId(t.parentNode),m=s(t);if(p===-1||m===-1)return o.addNode(t);var h=Mu(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(n){$u(n)&&e.iframeManager.addIframe(n),ed(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)}});h&&a.push({parentId:p,nextId:m,node:h})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var l=Ql(e.movedSet),u=l.next();!u.done;u=l.next()){var d=u.value;sd(e.removes,d,e.mirror)&&!e.movedSet.has(d.parentNode)||c(d)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}try{for(var f=Ql(e.addedSet),p=f.next();!p.done;p=f.next()){var d=p.value;!cd(e.droppedSet,d)&&!sd(e.removes,d,e.mirror)||cd(e.movedSet,d)?c(d):e.droppedSet.add(d)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}for(var m=null;o.length;){var h=null;if(m){var g=e.mirror.getId(m.value.parentNode),_=s(m.value);g!==-1&&_!==-1&&(h=m)}if(!h)for(var v=o.length-1;v>=0;v--){var y=o.get(v);if(y){var g=e.mirror.getId(y.value.parentNode),_=s(y.value);if(g!==-1&&_!==-1){h=y;break}}}if(!h){for(;o.head;)o.removeNode(o.head.value);break}m=h.previous,o.removeNode(h.value),c(h.value)}var b={texts:e.texts.map(function(t){return{id:e.mirror.getId(t.node),value:t.value}}).filter(function(t){return e.mirror.has(t.id)}),attributes:e.attributes.map(function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}}).filter(function(t){return e.mirror.has(t.id)}),removes:e.removes,adds:a};!b.texts.length&&!b.attributes.length&&!b.removes.length&&!b.adds.length||(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(b))}},this.processMutation=function(t){var n,r,i,a;if(!Yu(t.target))switch(t.type){case`characterData`:var o=t.target.textContent;!Ju(t.target,e.blockClass)&&o!==t.oldValue&&e.texts.push({value:Ou(t.target,e.maskTextClass,e.maskTextSelector)&&o?e.maskTextFn?e.maskTextFn(o):o.replace(/[\S]/g,`*`):o,node:t.target});break;case`attributes`:var s=t.target,o=t.target.getAttribute(t.attributeName);if(t.attributeName===`value`&&(o=nu({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute(`type`),value:o,maskInputFn:e.maskInputFn})),Ju(t.target,e.blockClass)||o===t.oldValue)return;var c=e.attributes.find(function(e){return e.node===t.target});if(c||(c={node:t.target,attributes:{}},e.attributes.push(c)),t.attributeName===`style`){var l=e.doc.createElement(`span`);t.oldValue&&l.setAttribute(`style`,t.oldValue),(c.attributes.style===void 0||c.attributes.style===null)&&(c.attributes.style={});var u=c.attributes.style;try{for(var d=Ql(Array.from(s.style)),f=d.next();!f.done;f=d.next()){var p=f.value,m=s.style.getPropertyValue(p),h=s.style.getPropertyPriority(p);(m!==l.style.getPropertyValue(p)||h!==l.style.getPropertyPriority(p))&&(h===``?u[p]=m:u[p]=[m,h])}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}try{for(var g=Ql(Array.from(l.style)),_=g.next();!_.done;_=g.next()){var p=_.value;s.style.getPropertyValue(p)===``&&(u[p]=!1)}}catch(e){i={error:e}}finally{try{_&&!_.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}}else c.attributes[t.attributeName]=Eu(e.doc,t.target.tagName,t.attributeName,o);break;case`childList`:t.addedNodes.forEach(function(n){return e.genAdds(n,t.target)}),t.removedNodes.forEach(function(n){var r=e.mirror.getId(n),i=tu(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);Ju(t.target,e.blockClass)||Yu(n)||(e.addedSet.has(n)?(od(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&r===-1||Xu(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[rd(r,i)]?od(e.movedSet,n):e.removes.push({parentId:i,id:r,isShadow:tu(t.target)?!0:void 0})),e.mapRemoves.push(n))});break}},this.genAdds=function(t,n){if(!(n&&Ju(n,e.blockClass))){if(id(t)){if(Yu(t))return;e.movedSet.add(t);var r=null;n&&id(n)&&(r=n.__sn.id),r&&(e.movedMap[rd(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);Ju(t,e.blockClass)||t.childNodes.forEach(function(t){return e.genAdds(t)})}}}return e.prototype.init=function(e){var t=this;[`mutationCb`,`blockClass`,`blockSelector`,`maskTextClass`,`maskTextSelector`,`inlineStylesheet`,`maskInputOptions`,`maskTextFn`,`maskInputFn`,`recordCanvas`,`inlineImages`,`slimDOMOptions`,`doc`,`mirror`,`iframeManager`,`shadowDomManager`,`canvasManager`].forEach(function(n){t[n]=e[n]})},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function od(e,t){e.delete(t),t.childNodes.forEach(function(t){return od(e,t)})}function sd(e,t,n){var r=t.parentNode;if(!r)return!1;var i=n.getId(r);return e.some(function(e){return e.id===i})?!0:sd(e,r,n)}function cd(e,t){var n=t.parentNode;return n?e.has(n)?!0:cd(e,n):!1}var ld=[],ud=typeof CSSGroupingRule<`u`,dd=typeof CSSMediaRule<`u`,fd=typeof CSSSupportsRule<`u`,pd=typeof CSSConditionRule<`u`;function md(e){try{if(`composedPath`in e){var t=e.composedPath();if(t.length)return t[0]}else if(`path`in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function hd(e,t){var n,r,i=new ad;ld.push(i),i.init(e);var a=window.MutationObserver||window.__rrMutationObserver,o=(r=(n=window==null?void 0:window.Zone)==null?void 0:n.__symbol__)==null?void 0:r.call(n,`MutationObserver`);o&&window[o]&&(a=window[o]);var s=new a(i.processMutations.bind(i));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function gd(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,i=e.mirror;if(n.mousemove===!1)return function(){};var a=typeof n.mousemove==`number`?n.mousemove:50,o=typeof n.mousemoveCallback==`number`?n.mousemoveCallback:500,s=[],c,l=Uu(function(e){var n=Date.now()-c;t(s.map(function(e){return e.timeOffset-=n,e}),e),s=[],c=null},o),u=Uu(function(e){var t=md(e),n=Zu(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;c||(c=Date.now()),s.push({x:r,y:a,id:i.getId(t),timeOffset:Date.now()-c}),l(typeof DragEvent<`u`&&e instanceof DragEvent?Pu.Drag:e instanceof MouseEvent?Pu.MouseMove:Pu.TouchMove)},a,{trailing:!1}),d=[zu(`mousemove`,u,r),zu(`touchmove`,u,r),zu(`drag`,u,r)];return function(){d.forEach(function(e){return e()})}}function _d(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,i=e.blockClass,a=e.sampling;if(a.mouseInteraction===!1)return function(){};var o=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,s=[],c=function(e){return function(n){var a=md(n);if(!Ju(a,i)){var o=Zu(n)?n.changedTouches[0]:n;if(o){var s=r.getId(a),c=o.clientX,l=o.clientY;t({type:Fu[e],id:s,x:c,y:l})}}}};return Object.keys(Fu).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&o[e]!==!1}).forEach(function(e){var t=e.toLowerCase(),r=c(e);s.push(zu(t,r,n))}),function(){s.forEach(function(e){return e()})}}function vd(e){var t=e.scrollCb,n=e.doc,r=e.mirror,i=e.blockClass,a=e.sampling;return zu(`scroll`,Uu(function(e){var a=md(e);if(!(!a||Ju(a,i))){var o=r.getId(a);if(a===n){var s=n.scrollingElement||n.documentElement;t({id:o,x:s.scrollLeft,y:s.scrollTop})}else t({id:o,x:a.scrollLeft,y:a.scrollTop})}},a.scroll||100),n)}function yd(e){var t=e.viewportResizeCb,n=-1,r=-1;return zu(`resize`,Uu(function(){var e=Ku(),i=qu();(n!==e||r!==i)&&(t({width:Number(i),height:Number(e)}),n=e,r=i)},200),window)}function bd(e,t){var n=W({},e);return t||delete n.userTriggered,n}var xd=[`INPUT`,`TEXTAREA`,`SELECT`],Sd=new WeakMap;function Cd(e){var t=e.inputCb,n=e.doc,r=e.mirror,i=e.blockClass,a=e.ignoreClass,o=e.maskInputOptions,s=e.maskInputFn,c=e.sampling,l=e.userTriggeredOnInput;function u(e){var t=md(e),r=e.isTrusted;if(t&&t.tagName===`OPTION`&&(t=t.parentElement),!(!t||!t.tagName||xd.indexOf(t.tagName)<0||Ju(t,i))){var c=t.type;if(!t.classList.contains(a)){var u=t.value,f=!1;c===`radio`||c===`checkbox`?f=t.checked:(o[t.tagName.toLowerCase()]||o[c])&&(u=nu({maskInputOptions:o,tagName:t.tagName,type:c,value:u,maskInputFn:s})),d(t,bd({text:u,isChecked:f,userTriggered:r},l));var p=t.name;c===`radio`&&p&&f&&n.querySelectorAll(`input[type="radio"][name="${p}"]`).forEach(function(e){e!==t&&d(e,bd({text:e.value,isChecked:!f,userTriggered:!1},l))})}}}function d(e,n){var i=Sd.get(e);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){Sd.set(e,n);var a=r.getId(e);t(W(W({},n),{id:a}))}}var f=(c.input===`last`?[`change`]:[`input`,`change`]).map(function(e){return zu(e,u,n)}),p=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`),m=[[HTMLInputElement.prototype,`value`],[HTMLInputElement.prototype,`checked`],[HTMLSelectElement.prototype,`value`],[HTMLTextAreaElement.prototype,`value`],[HTMLSelectElement.prototype,`selectedIndex`],[HTMLOptionElement.prototype,`selected`]];return p&&p.set&&f.push.apply(f,K([],G(m.map(function(e){return Wu(e[0],e[1],{set:function(){u({target:this})}})})),!1)),function(){f.forEach(function(e){return e()})}}function wd(e){var t=[];function n(e,t){if(ud&&e.parentRule instanceof CSSGroupingRule||dd&&e.parentRule instanceof CSSMediaRule||fd&&e.parentRule instanceof CSSSupportsRule||pd&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules),r=n.indexOf(e);t.unshift(r)}else{var n=Array.from(e.parentStyleSheet.cssRules),r=n.indexOf(e);t.unshift(r)}return t}return n(e,t)}function Td(e,t){var n=e.styleSheetRuleCb,r=e.mirror,i=t.win,a=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=function(e,t){var i=r.getId(this.ownerNode);return i!==-1&&n({id:i,adds:[{rule:e,index:t}]}),a.apply(this,arguments)};var o=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=function(e){var t=r.getId(this.ownerNode);return t!==-1&&n({id:t,removes:[{index:e}]}),o.apply(this,arguments)};var s={};ud?s.CSSGroupingRule=i.CSSGroupingRule:(dd&&(s.CSSMediaRule=i.CSSMediaRule),pd&&(s.CSSConditionRule=i.CSSConditionRule),fd&&(s.CSSSupportsRule=i.CSSSupportsRule));var c={};return Object.entries(s).forEach(function(e){var t=G(e,2),i=t[0],a=t[1];c[i]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=function(e,t){var a=r.getId(this.parentStyleSheet.ownerNode);return a!==-1&&n({id:a,adds:[{rule:e,index:K(K([],G(wd(this)),!1),[t||0],!1)}]}),c[i].insertRule.apply(this,arguments)},a.prototype.deleteRule=function(e){var t=r.getId(this.parentStyleSheet.ownerNode);return t!==-1&&n({id:t,removes:[{index:K(K([],G(wd(this)),!1),[e],!1)}]}),c[i].deleteRule.apply(this,arguments)}}),function(){i.CSSStyleSheet.prototype.insertRule=a,i.CSSStyleSheet.prototype.deleteRule=o,Object.entries(s).forEach(function(e){var t=G(e,2),n=t[0],r=t[1];r.prototype.insertRule=c[n].insertRule,r.prototype.deleteRule=c[n].deleteRule})}}function Ed(e,t){var n=e.styleDeclarationCb,r=e.mirror,i=t.win,a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(e,t,i){var o,s,c=r.getId((s=(o=this.parentRule)==null?void 0:o.parentStyleSheet)==null?void 0:s.ownerNode);return c!==-1&&n({id:c,set:{property:e,value:t,priority:i},index:wd(this.parentRule)}),a.apply(this,arguments)};var o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(e){var t,i,a=r.getId((i=(t=this.parentRule)==null?void 0:t.parentStyleSheet)==null?void 0:i.ownerNode);return a!==-1&&n({id:a,remove:{property:e},index:wd(this.parentRule)}),o.apply(this,arguments)},function(){i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o}}function Dd(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.mirror,i=e.sampling,a=function(e){return Uu(function(i){var a=md(i);if(!(!a||Ju(a,n))){var o=a,s=o.currentTime,c=o.volume,l=o.muted;t({type:e,id:r.getId(a),currentTime:s,volume:c,muted:l})}},i.media||500)},o=[zu(`play`,a(0)),zu(`pause`,a(1)),zu(`seeked`,a(2)),zu(`volumechange`,a(3))];return function(){o.forEach(function(e){return e()})}}function Od(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var i=[],a=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,n){var r=new o(e,t,n);return a.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=Gu(n.fonts,`add`,function(e){return function(n){return setTimeout(function(){var e=a.get(n);e&&(t(e),a.delete(n))},0),e.apply(this,[n])}});return i.push(function(){r.FontFace=o}),i.push(s),function(){i.forEach(function(e){return e()})}}function kd(e,t){var n=e.mutationCb,r=e.mousemoveCb,i=e.mouseInteractionCb,a=e.scrollCb,o=e.viewportResizeCb,s=e.inputCb,c=e.mediaInteractionCb,l=e.styleSheetRuleCb,u=e.styleDeclarationCb,d=e.canvasMutationCb,f=e.fontCb;e.mutationCb=function(){var e=[...arguments];t.mutation&&t.mutation.apply(t,K([],G(e),!1)),n.apply(void 0,K([],G(e),!1))},e.mousemoveCb=function(){var e=[...arguments];t.mousemove&&t.mousemove.apply(t,K([],G(e),!1)),r.apply(void 0,K([],G(e),!1))},e.mouseInteractionCb=function(){var e=[...arguments];t.mouseInteraction&&t.mouseInteraction.apply(t,K([],G(e),!1)),i.apply(void 0,K([],G(e),!1))},e.scrollCb=function(){var e=[...arguments];t.scroll&&t.scroll.apply(t,K([],G(e),!1)),a.apply(void 0,K([],G(e),!1))},e.viewportResizeCb=function(){var e=[...arguments];t.viewportResize&&t.viewportResize.apply(t,K([],G(e),!1)),o.apply(void 0,K([],G(e),!1))},e.inputCb=function(){var e=[...arguments];t.input&&t.input.apply(t,K([],G(e),!1)),s.apply(void 0,K([],G(e),!1))},e.mediaInteractionCb=function(){var e=[...arguments];t.mediaInteaction&&t.mediaInteaction.apply(t,K([],G(e),!1)),c.apply(void 0,K([],G(e),!1))},e.styleSheetRuleCb=function(){var e=[...arguments];t.styleSheetRule&&t.styleSheetRule.apply(t,K([],G(e),!1)),l.apply(void 0,K([],G(e),!1))},e.styleDeclarationCb=function(){var e=[...arguments];t.styleDeclaration&&t.styleDeclaration.apply(t,K([],G(e),!1)),u.apply(void 0,K([],G(e),!1))},e.canvasMutationCb=function(){var e=[...arguments];t.canvasMutation&&t.canvasMutation.apply(t,K([],G(e),!1)),d.apply(void 0,K([],G(e),!1))},e.fontCb=function(){var e=[...arguments];t.font&&t.font.apply(t,K([],G(e),!1)),f.apply(void 0,K([],G(e),!1))}}function Ad(e,t){var n,r;t===void 0&&(t={});var i=e.doc.defaultView;if(!i)return function(){};kd(e,t);var a=hd(e,e.doc),o=gd(e),s=_d(e),c=vd(e),l=yd(e),u=Cd(e),d=Dd(e),f=Td(e,{win:i}),p=Ed(e,{win:i}),m=e.collectFonts?Od(e):function(){},h=[];try{for(var g=Ql(e.plugins),_=g.next();!_.done;_=g.next()){var v=_.value;h.push(v.observer(v.callback,i,v.options))}}catch(e){n={error:e}}finally{try{_&&!_.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}return function(){ld.forEach(function(e){return e.reset()}),a.disconnect(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h.forEach(function(e){return e()})}}var jd=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(n=this.loadListener)==null||n.call(this,e)},e}(),Md=function(){function e(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var t=this;this.restorePatches.push(Gu(HTMLElement.prototype,`attachShadow`,function(e){return function(){var n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}}))}return e.prototype.addShadowRoot=function(e,t){hd(W(W({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),vd(W(W({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))},e.prototype.observeAttachShadow=function(e){if(e.contentWindow){var t=this;this.restorePatches.push(Gu(e.contentWindow.HTMLElement.prototype,`attachShadow`,function(n){return function(){var r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}}))}},e.prototype.reset=function(){this.restorePatches.forEach(function(e){return e()})},e}();function Nd(e,t,n,r){var i,a,o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),c=function(r){try{if(typeof t.CanvasRenderingContext2D.prototype[r]!=`function`)return`continue`;var i=Gu(t.CanvasRenderingContext2D.prototype,r,function(t){return function(){for(var i=this,a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];return Ju(this.canvas,n)||setTimeout(function(){var t=K([],G(a),!1);if(r===`drawImage`&&t[0]&&t[0]instanceof HTMLCanvasElement){var n=t[0],o=n.getContext(`2d`),s=o==null?void 0:o.getImageData(0,0,n.width,n.height),c=s==null?void 0:s.data;t[0]=JSON.stringify(c)}e(i.canvas,{type:Iu[`2D`],property:r,args:t})},0),t.apply(this,a)}});o.push(i)}catch(n){var a=Wu(t.CanvasRenderingContext2D.prototype,r,{set:function(t){e(this.canvas,{type:Iu[`2D`],property:r,args:[t],setter:!0})}});o.push(a)}};try{for(var l=Ql(s),u=l.next();!u.done;u=l.next()){var d=u.value;c(d)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return function(){o.forEach(function(e){return e()})}}function Pd(e,t){var n=[];try{var r=Gu(e.HTMLCanvasElement.prototype,`getContext`,function(e){return function(n){var r=[...arguments].slice(1);return Ju(this,t)||`__context`in this||(this.__context=n),e.apply(this,K([n],G(r),!1))}});n.push(r)}catch(e){console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return function(){n.forEach(function(e){return e()})}}for(var Fd=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Id=typeof Uint8Array>`u`?[]:new Uint8Array(256),Ld=0;Ld<Fd.length;Ld++)Id[Fd.charCodeAt(Ld)]=Ld;var Rd=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=Fd[t[n]>>2],i+=Fd[(t[n]&3)<<4|t[n+1]>>4],i+=Fd[(t[n+1]&15)<<2|t[n+2]>>6],i+=Fd[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i},zd=new Map;function Bd(e,t){var n=zd.get(e);return n||(n=new Map,zd.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var Vd=function(e,t,n){if(!(!e||!(Wd(e,t)||typeof e==`object`))){var r=e.constructor.name,i=Bd(n,r),a=i.indexOf(e);return a===-1&&(a=i.length,i.push(e)),a}};function Hd(e,t,n){return e instanceof Array?e.map(function(e){return Hd(e,t,n)}):e===null?e:e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:Rd(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[Hd(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Hd(e.data,t,n),e.width,e.height]}:Wd(e,t)||typeof e==`object`?{rr_type:e.constructor.name,index:Vd(e,t,n)}:e}var Ud=function(e,t,n){return K([],G(e),!1).map(function(e){return Hd(e,t,n)})},Wd=function(e,t){return!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(function(e){return typeof t[e]==`function`}).find(function(n){return e instanceof t[n]})};function Gd(e,t,n,r,i,a){var o,s,c=[],l=Object.getOwnPropertyNames(e),u=function(o){try{if(typeof e[o]!=`function`)return`continue`;var s=Gu(e,o,function(s){return function(){var c=[...arguments],l=s.apply(this,c);if(Vd(l,a,e),!Ju(this.canvas,r)){i.getId(this.canvas);var u={type:t,property:o,args:Ud(K([],G(c),!1),a,e)};n(this.canvas,u)}return l}});c.push(s)}catch(r){var l=Wu(e,o,{set:function(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});c.push(l)}};try{for(var d=Ql(l),f=d.next();!f.done;f=d.next()){var p=f.value;u(p)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(o)throw o.error}}return c}function Kd(e,t,n,r){var i=[];return i.push.apply(i,K([],G(Gd(t.WebGLRenderingContext.prototype,Iu.WebGL,e,n,r,t)),!1)),t.WebGL2RenderingContext!==void 0&&i.push.apply(i,K([],G(Gd(t.WebGL2RenderingContext.prototype,Iu.WebGL2,e,n,r,t)),!1)),function(){i.forEach(function(e){return e()})}}var qd=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,e.recordCanvas===!0&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Pd(e,t),r=Nd(this.processMutation.bind(this),e,t,this.mirror),i=Kd(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){n(),r(),i()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},e.prototype.startRAFTimestamping=function(){var e=this,t=function(n){e.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach(function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!(this.frozen||this.locked)){var n=this.pendingCanvasMutations.get(e);if(!(!n||t===-1)){var r=n.map(function(e){return e.type,Zl(e,[`type`])}),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}();function Jd(e){return W(W({},e),{timestamp:Date.now()})}var Yd,Xd,Zd=Bu();function Qd(e){e===void 0&&(e={});var t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,a=i===void 0?`rr-block`:i,o=e.blockSelector,s=o===void 0?null:o,c=e.ignoreClass,l=c===void 0?`rr-ignore`:c,u=e.maskTextClass,d=u===void 0?`rr-mask`:u,f=e.maskTextSelector,p=f===void 0?null:f,m=e.inlineStylesheet,h=m===void 0?!0:m,g=e.maskAllInputs,_=e.maskInputOptions,v=e.slimDOMOptions,y=e.maskInputFn,b=e.maskTextFn,x=e.hooks,S=e.packFn,C=e.sampling,w=C===void 0?{}:C,ee=e.mousemoveWait,T=e.recordCanvas,E=T===void 0?!1:T,D=e.userTriggeredOnInput,te=D===void 0?!1:D,O=e.collectFonts,k=O===void 0?!1:O,A=e.inlineImages,j=A===void 0?!1:A,ne=e.plugins,re=e.keepIframeSrcFn,ie=re===void 0?function(){return!1}:re;if(!t)throw Error(`emit function is required`);ee!==void 0&&w.mousemove===void 0&&(w.mousemove=ee);var M=g===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:_===void 0?{password:!0}:_,ae=v===!0||v===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:v===`all`,headMetaDescKeywords:v===`all`}:v||{};Qu();var N,P=0,F=function(e){var t,n;try{for(var r=Ql(ne||[]),i=r.next();!i.done;i=r.next()){var a=i.value;a.eventProcessor&&(e=a.eventProcessor(e))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return S&&(e=S(e)),e};Yd=function(e,i){var a;if((a=ld[0])!=null&&a.isFrozen()&&e.type!==J.FullSnapshot&&!(e.type===J.IncrementalSnapshot&&e.data.source===Pu.Mutation)&&ld.forEach(function(e){return e.unfreeze()}),t(F(e),i),e.type===J.FullSnapshot)N=e,P=0;else if(e.type===J.IncrementalSnapshot){if(e.data.source===Pu.Mutation&&e.data.isAttachIframe)return;P++;var o=r&&P>=r,s=n&&e.timestamp-N.timestamp>n;(o||s)&&Xd(!0)}};var oe=function(e){Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.Mutation},e)}))},se=function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.Scroll},e)}))},ce=function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.CanvasMutation},e)}))},le=new jd({mutationCb:oe}),ue=new qd({recordCanvas:E,mutationCb:ce,win:window,blockClass:a,mirror:Zd}),de=new Md({mutationCb:oe,scrollCb:se,bypassOptions:{blockClass:a,blockSelector:s,maskTextClass:d,maskTextSelector:p,inlineStylesheet:h,maskInputOptions:M,maskTextFn:b,maskInputFn:y,recordCanvas:E,inlineImages:j,sampling:w,slimDOMOptions:ae,iframeManager:le,canvasManager:ue},mirror:Zd});Xd=function(e){var t,n,r,i;e===void 0&&(e=!1),Yd(Jd({type:J.Meta,data:{href:window.location.href,width:qu(),height:Ku()}}),e),ld.forEach(function(e){return e.lock()});var o=G(Nu(document,{blockClass:a,blockSelector:s,maskTextClass:d,maskTextSelector:p,inlineStylesheet:h,maskAllInputs:M,maskTextFn:b,slimDOM:ae,recordCanvas:E,inlineImages:j,onSerialize:function(e){$u(e)&&le.addIframe(e),ed(e)&&de.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){le.attachIframe(e,t),de.observeAttachShadow(e)},keepIframeSrcFn:ie}),2),c=o[0],l=o[1];if(!c)return console.warn(`Failed to snapshot the document`);Zd.map=l,Yd(Jd({type:J.FullSnapshot,data:{node:c,initialOffset:{left:window.pageXOffset===void 0?(document==null?void 0:document.documentElement.scrollLeft)||((n=(t=document==null?void 0:document.body)==null?void 0:t.parentElement)==null?void 0:n.scrollLeft)||(document==null?void 0:document.body.scrollLeft)||0:window.pageXOffset,top:window.pageYOffset===void 0?(document==null?void 0:document.documentElement.scrollTop)||((i=(r=document==null?void 0:document.body)==null?void 0:r.parentElement)==null?void 0:i.scrollTop)||(document==null?void 0:document.body.scrollTop)||0:window.pageYOffset}}})),ld.forEach(function(e){return e.unlock()})};try{var fe=[];fe.push(zu(`DOMContentLoaded`,function(){Yd(Jd({type:J.DomContentLoaded,data:{}}))}));var pe=function(e){var t;return Ad({mutationCb:oe,mousemoveCb:function(e,t){return Yd(Jd({type:J.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.MouseInteraction},e)}))},scrollCb:se,viewportResizeCb:function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.ViewportResize},e)}))},inputCb:function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.Input},e)}))},mediaInteractionCb:function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.StyleDeclaration},e)}))},canvasMutationCb:ce,fontCb:function(e){return Yd(Jd({type:J.IncrementalSnapshot,data:W({source:Pu.Font},e)}))},blockClass:a,ignoreClass:l,maskTextClass:d,maskTextSelector:p,maskInputOptions:M,inlineStylesheet:h,sampling:w,recordCanvas:E,inlineImages:j,userTriggeredOnInput:te,collectFonts:k,doc:e,maskInputFn:y,maskTextFn:b,blockSelector:s,slimDOMOptions:ae,mirror:Zd,iframeManager:le,shadowDomManager:de,canvasManager:ue,plugins:((t=ne==null?void 0:ne.filter(function(e){return e.observer}))==null?void 0:t.map(function(e){return{observer:e.observer,options:e.options,callback:function(t){return Yd(Jd({type:J.Plugin,data:{plugin:e.name,payload:t}}))}}}))||[]},x)};le.addLoadListener(function(e){fe.push(pe(e.contentDocument))});var me=function(){Xd(),fe.push(pe(document))};return document.readyState===`interactive`||document.readyState===`complete`?me():fe.push(zu(`load`,function(){Yd(Jd({type:J.Load,data:{}})),me()},window)),function(){fe.forEach(function(e){return e()})}}catch(e){console.warn(e)}}Qd.addCustomEvent=function(e,t){if(!Yd)throw Error(`please add custom event after start recording`);Yd(Jd({type:J.Custom,data:{tag:e,payload:t}}))},Qd.freezePage=function(){ld.forEach(function(e){return e.freeze()})},Qd.takeFullSnapshot=function(e){if(!Xd)throw Error(`please take full snapshot after start recording`);Xd(e)},Qd.mirror=Zd;var $d=Uint8Array,ef=Uint16Array,tf=Uint32Array,nf=new $d([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),rf=new $d([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),af=new $d([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),of=function(e,t){for(var n=new ef(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new tf(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return[n,i]},sf=of(nf,2),cf=sf[0],lf=sf[1];cf[28]=258,lf[258]=28;var uf=of(rf,0);uf[0];for(var df=uf[1],ff=new ef(32768),Y=0;Y<32768;++Y){var pf=(Y&43690)>>>1|(Y&21845)<<1;pf=(pf&52428)>>>2|(pf&13107)<<2,pf=(pf&61680)>>>4|(pf&3855)<<4,ff[Y]=((pf&65280)>>>8|(pf&255)<<8)>>>1}for(var mf=(function(e,t,n){for(var r=e.length,i=0,a=new ef(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new ef(t);for(i=0;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new ef(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[ff[d]>>>c]=l}else for(s=new ef(r),i=0;i<r;++i)e[i]&&(s[i]=ff[o[e[i]-1]++]>>>15-e[i]);return s}),hf=new $d(288),Y=0;Y<144;++Y)hf[Y]=8;for(var Y=144;Y<256;++Y)hf[Y]=9;for(var Y=256;Y<280;++Y)hf[Y]=7;for(var Y=280;Y<288;++Y)hf[Y]=8;for(var gf=new $d(32),Y=0;Y<32;++Y)gf[Y]=5;var _f=mf(hf,9,0),vf=mf(gf,5,0),yf=function(e){return(e+7)/8|0},bf=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e.BYTES_PER_ELEMENT==2?ef:e.BYTES_PER_ELEMENT==4?tf:$d)(n-t);return r.set(e.subarray(t,n)),r},xf=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},Sf=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Cf=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[Af,0];if(i==1){var o=new $d(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};for(var f=a[0].s,r=1;r<i;++r)a[r].s>f&&(f=a[r].s);var p=new ef(f+1),m=wf(n[u-1],p,0);if(m>t){var r=0,h=0,g=m-t,_=1<<g;for(a.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r<i;++r){var v=a[r].s;if(p[v]>t)h+=_-(1<<m-p[v]),p[v]=t;else break}for(h>>>=g;h>0;){var y=a[r].s;p[y]<t?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=a[r].s;p[b]==t&&(--p[b],++h)}m=t}return[new $d(p),m]},wf=function(e,t,n){return e.s==-1?Math.max(wf(e.l,t,n+1),wf(e.r,t,n+1)):t[e.s]=n},Tf=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ef(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},Ef=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Df=function(e,t,n){var r=n.length,i=yf(t+2);e[i]=r&255,e[i+1]=r>>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},Of=function(e,t,n,r,i,a,o,s,c,l,u){xf(t,u++,n),++i[256];for(var d=Cf(i,15),f=d[0],p=d[1],m=Cf(a,15),h=m[0],g=m[1],_=Tf(f),v=_[0],y=_[1],b=Tf(h),x=b[0],S=b[1],C=new ef(19),w=0;w<v.length;++w)C[v[w]&31]++;for(var w=0;w<x.length;++w)C[x[w]&31]++;for(var ee=Cf(C,7),T=ee[0],E=ee[1],D=19;D>4&&!T[af[D-1]];--D);var te=l+5<<3,O=Ef(i,hf)+Ef(a,gf)+o,k=Ef(i,f)+Ef(a,h)+o+14+3*D+Ef(C,T)+(2*C[16]+3*C[17]+7*C[18]);if(te<=O&&te<=k)return Df(t,u,e.subarray(c,c+l));var A,j,ne,re;if(xf(t,u,1+(k<O)),u+=2,k<O){A=mf(f,p,0),j=f,ne=mf(h,g,0),re=h;var ie=mf(T,E,0);xf(t,u,y-257),xf(t,u+5,S-1),xf(t,u+10,D-4),u+=14;for(var w=0;w<D;++w)xf(t,u+3*w,T[af[w]]);u+=3*D;for(var M=[v,x],ae=0;ae<2;++ae)for(var N=M[ae],w=0;w<N.length;++w){var P=N[w]&31;xf(t,u,ie[P]),u+=T[P],P>15&&(xf(t,u,N[w]>>>5&127),u+=N[w]>>>12)}}else A=_f,j=hf,ne=vf,re=gf;for(var w=0;w<s;++w)if(r[w]>255){var P=r[w]>>>18&31;Sf(t,u,A[P+257]),u+=j[P+257],P>7&&(xf(t,u,r[w]>>>23&31),u+=nf[P]);var F=r[w]&31;Sf(t,u,ne[F]),u+=re[F],F>3&&(Sf(t,u,r[w]>>>5&8191),u+=rf[F])}else Sf(t,u,A[r[w]]),u+=j[r[w]];return Sf(t,u,A[256]),u+j[256]},kf=new tf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Af=new $d(0),jf=function(e,t,n,r,i,a){var o=e.length,s=new $d(r+o+5*(1+Math.ceil(o/7e3))+i),c=s.subarray(r,s.length-i),l=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var d=u+65535;d>=o&&(c[l>>3]=a),l=Df(c,l+1,e.subarray(u,d))}else{for(var f=kf[t-1],p=f>>>13,m=f&8191,h=(1<<n)-1,g=new ef(32768),_=new ef(h+1),v=Math.ceil(n/3),y=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&h},x=new tf(25e3),S=new ef(288),C=new ef(32),w=0,ee=0,u=0,T=0,E=0,D=0;u<o;++u){var te=b(u),O=u&32767,k=_[te];if(g[O]=k,_[te]=O,E<=u){var A=o-u;if((w>7e3||T>24576)&&A>423){l=Of(e,c,0,x,S,C,ee,T,D,u-D,l),T=w=ee=0,D=u;for(var j=0;j<286;++j)S[j]=0;for(var j=0;j<30;++j)C[j]=0}var ne=2,re=0,ie=m,M=O-k&32767;if(A>2&&te==b(u-M))for(var ae=Math.min(p,A)-1,N=Math.min(32767,u),P=Math.min(258,A);M<=N&&--ie&&O!=k;){if(e[u+ne]==e[u+ne-M]){for(var F=0;F<P&&e[u+F]==e[u+F-M];++F);if(F>ne){if(ne=F,re=M,F>ae)break;for(var oe=Math.min(M,F-2),se=0,j=0;j<oe;++j){var ce=u-M+j+32768&32767,le=ce-g[ce]+32768&32767;le>se&&(se=le,k=ce)}}}O=k,k=g[O],M+=O-k+32768&32767}if(re){x[T++]=268435456|lf[ne]<<18|df[re];var ue=lf[ne]&31,de=df[re]&31;ee+=nf[ue]+rf[de],++S[257+ue],++C[de],E=u+ne,++w}else x[T++]=e[u],++S[e[u]]}}l=Of(e,c,a,x,S,C,ee,T,D,u-D,l),!a&&l&7&&(l=Df(c,l+1,Af))}return bf(s,0,r+yf(l)+i)},Mf=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),Nf=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Mf[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},Pf=function(e,t,n,r,i){return jf(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,n,r,!i)},Ff=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},If=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Ff(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},Lf=function(e){return 10+(e.filename&&e.filename.length+1||0)};function Rf(e,t){t||(t={});var n=Nf(),r=e.length;n.p(e);var i=Pf(e,t,Lf(t),8),a=i.length;return If(i,t),Ff(i,a-8,n.d()),Ff(i,a-4,r),i}var zf=typeof TextDecoder<`u`&&new TextDecoder;try{zf.decode(Af,{stream:!0})}catch(e){}
19
19
  /**
20
20
  * @license
21
21
  * Copyright 2009 The Closure Library Authors
@@ -35,5 +35,25 @@ or you can use record.mirror to access the mirror instance during recording.`,Uu
35
35
  *
36
36
  * SPDX-License-Identifier: Apache-2.0
37
37
  */
38
- var Bf=null;try{Bf=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function X(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}X.prototype.__isLong__,Object.defineProperty(X.prototype,`__isLong__`,{value:!0});function Vf(e){return(e&&e.__isLong__)===!0}function Hf(e){var t=Math.clz32(e&-e);return e?31-t:t}X.isLong=Vf;var Uf={},Wf={};function Gf(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=Wf[e],r)?r:(n=Z(e,0,!0),i&&(Wf[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=Uf[e],r)?r:(n=Z(e,e<0?-1:0,!1),i&&(Uf[e]=n),n))}X.fromInt=Gf;function Kf(e,t){if(isNaN(e))return t?rp:np;if(t){if(e<0)return rp;if(e>=$f)return cp}else{if(e<=-ep)return lp;if(e+1>=ep)return sp}return e<0?Kf(-e,t).neg():Z(e%Qf|0,e/Qf|0,t)}X.fromNumber=Kf;function Z(e,t,n){return new X(e,t,n)}X.fromBits=Z;var qf=Math.pow;function Jf(e,t,n){if(e.length===0)throw Error(`empty string`);if(typeof t==`number`?(n=t,t=!1):t=!!t,e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return t?rp:np;if(n=n||10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return Jf(e.substring(1),t,n).neg();for(var i=Kf(qf(n,8)),a=np,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),c=parseInt(e.substring(o,o+s),n);if(s<8){var l=Kf(qf(n,s));a=a.mul(l).add(Kf(c))}else a=a.mul(i),a=a.add(Kf(c))}return a.unsigned=t,a}X.fromString=Jf;function Yf(e,t){return typeof e==`number`?Kf(e,t):typeof e==`string`?Jf(e,t):Z(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}X.fromValue=Yf;var Xf=65536,Zf=1<<24,Qf=Xf*Xf,$f=Qf*Qf,ep=$f/2,tp=Gf(Zf),np=Gf(0);X.ZERO=np;var rp=Gf(0,!0);X.UZERO=rp;var ip=Gf(1);X.ONE=ip;var ap=Gf(1,!0);X.UONE=ap;var op=Gf(-1);X.NEG_ONE=op;var sp=Z(-1,2147483647,!1);X.MAX_VALUE=sp;var cp=Z(-1,-1,!0);X.MAX_UNSIGNED_VALUE=cp;var lp=Z(0,-2147483648,!1);X.MIN_VALUE=lp;var Q=X.prototype;Q.toInt=function(){return this.unsigned?this.low>>>0:this.low},Q.toNumber=function(){return this.unsigned?(this.high>>>0)*Qf+(this.low>>>0):this.high*Qf+(this.low>>>0)},Q.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(lp)){var t=Kf(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=Kf(qf(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),c=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return c+o;for(;c.length<6;)c=`0`+c;o=``+c+o}},Q.getHighBits=function(){return this.high},Q.getHighBitsUnsigned=function(){return this.high>>>0},Q.getLowBits=function(){return this.low},Q.getLowBitsUnsigned=function(){return this.low>>>0},Q.getNumBitsAbs=function(){if(this.isNegative())return this.eq(lp)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},Q.isSafeInteger=function(){var e=this.high>>21;return e?this.unsigned?!1:e===-1&&!(this.low===0&&this.high===-2097152):!0},Q.isZero=function(){return this.high===0&&this.low===0},Q.eqz=Q.isZero,Q.isNegative=function(){return!this.unsigned&&this.high<0},Q.isPositive=function(){return this.unsigned||this.high>=0},Q.isOdd=function(){return(this.low&1)==1},Q.isEven=function(){return(this.low&1)==0},Q.equals=function(e){return Vf(e)||(e=Yf(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},Q.eq=Q.equals,Q.notEquals=function(e){return!this.eq(e)},Q.neq=Q.notEquals,Q.ne=Q.notEquals,Q.lessThan=function(e){return this.comp(e)<0},Q.lt=Q.lessThan,Q.lessThanOrEqual=function(e){return this.comp(e)<=0},Q.lte=Q.lessThanOrEqual,Q.le=Q.lessThanOrEqual,Q.greaterThan=function(e){return this.comp(e)>0},Q.gt=Q.greaterThan,Q.greaterThanOrEqual=function(e){return this.comp(e)>=0},Q.gte=Q.greaterThanOrEqual,Q.ge=Q.greaterThanOrEqual,Q.compare=function(e){if(Vf(e)||(e=Yf(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},Q.comp=Q.compare,Q.negate=function(){return!this.unsigned&&this.eq(lp)?lp:this.not().add(ip)},Q.neg=Q.negate,Q.add=function(e){Vf(e)||(e=Yf(e));var t=this.high>>>16,n=this.high&65535,r=this.low>>>16,i=this.low&65535,a=e.high>>>16,o=e.high&65535,s=e.low>>>16,c=e.low&65535,l=0,u=0,d=0,f=0;return f+=i+c,d+=f>>>16,f&=65535,d+=r+s,u+=d>>>16,d&=65535,u+=n+o,l+=u>>>16,u&=65535,l+=t+a,l&=65535,Z(d<<16|f,l<<16|u,this.unsigned)},Q.subtract=function(e){return Vf(e)||(e=Yf(e)),this.add(e.neg())},Q.sub=Q.subtract,Q.multiply=function(e){if(this.isZero())return this;if(Vf(e)||(e=Yf(e)),Bf)return Z(Bf.mul(this.low,this.high,e.low,e.high),Bf.get_high(),this.unsigned);if(e.isZero())return this.unsigned?rp:np;if(this.eq(lp))return e.isOdd()?lp:np;if(e.eq(lp))return this.isOdd()?lp:np;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(tp)&&e.lt(tp))return Kf(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=this.high&65535,r=this.low>>>16,i=this.low&65535,a=e.high>>>16,o=e.high&65535,s=e.low>>>16,c=e.low&65535,l=0,u=0,d=0,f=0;return f+=i*c,d+=f>>>16,f&=65535,d+=r*c,u+=d>>>16,d&=65535,d+=i*s,u+=d>>>16,d&=65535,u+=n*c,l+=u>>>16,u&=65535,u+=r*s,l+=u>>>16,u&=65535,u+=i*o,l+=u>>>16,u&=65535,l+=t*c+n*s+r*o+i*a,l&=65535,Z(d<<16|f,l<<16|u,this.unsigned)},Q.mul=Q.multiply,Q.divide=function(e){if(Vf(e)||(e=Yf(e)),e.isZero())throw Error(`division by zero`);if(Bf)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:Z((this.unsigned?Bf.div_u:Bf.div_s)(this.low,this.high,e.low,e.high),Bf.get_high(),this.unsigned);if(this.isZero())return this.unsigned?rp:np;var t,n,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return rp;if(e.gt(this.shru(1)))return ap;r=rp}else{if(this.eq(lp))return e.eq(ip)||e.eq(op)?lp:e.eq(lp)?ip:(t=this.shr(1).div(e).shl(1),t.eq(np)?e.isNegative()?ip:op:(n=this.sub(e.mul(t)),r=t.add(n.div(e)),r));if(e.eq(lp))return this.unsigned?rp:np;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=np}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var i=Math.ceil(Math.log(t)/Math.LN2),a=i<=48?1:qf(2,i-48),o=Kf(t),s=o.mul(e);s.isNegative()||s.gt(n);)t-=a,o=Kf(t,this.unsigned),s=o.mul(e);o.isZero()&&(o=ip),r=r.add(o),n=n.sub(s)}return r},Q.div=Q.divide,Q.modulo=function(e){return Vf(e)||(e=Yf(e)),Bf?Z((this.unsigned?Bf.rem_u:Bf.rem_s)(this.low,this.high,e.low,e.high),Bf.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},Q.mod=Q.modulo,Q.rem=Q.modulo,Q.not=function(){return Z(~this.low,~this.high,this.unsigned)},Q.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},Q.clz=Q.countLeadingZeros,Q.countTrailingZeros=function(){return this.low?Hf(this.low):Hf(this.high)+32},Q.ctz=Q.countTrailingZeros,Q.and=function(e){return Vf(e)||(e=Yf(e)),Z(this.low&e.low,this.high&e.high,this.unsigned)},Q.or=function(e){return Vf(e)||(e=Yf(e)),Z(this.low|e.low,this.high|e.high,this.unsigned)},Q.xor=function(e){return Vf(e)||(e=Yf(e)),Z(this.low^e.low,this.high^e.high,this.unsigned)},Q.shiftLeft=function(e){return Vf(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?Z(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):Z(0,this.low<<e-32,this.unsigned)},Q.shl=Q.shiftLeft,Q.shiftRight=function(e){return Vf(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?Z(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):Z(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},Q.shr=Q.shiftRight,Q.shiftRightUnsigned=function(e){return Vf(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?Z(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):Z(e===32?this.high:this.high>>>e-32,0,this.unsigned)},Q.shru=Q.shiftRightUnsigned,Q.shr_u=Q.shiftRightUnsigned,Q.rotateLeft=function(e){var t;return Vf(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?Z(this.high,this.low,this.unsigned):e<32?(t=32-e,Z(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(e-=32,t=32-e,Z(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},Q.rotl=Q.rotateLeft,Q.rotateRight=function(e){var t;return Vf(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?Z(this.high,this.low,this.unsigned):e<32?(t=32-e,Z(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(e-=32,t=32-e,Z(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},Q.rotr=Q.rotateRight,Q.toSigned=function(){return this.unsigned?Z(this.low,this.high,!1):this},Q.toUnsigned=function(){return this.unsigned?this:Z(this.low,this.high,!0)},Q.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},Q.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},Q.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},X.fromBytes=function(e,t,n){return n?X.fromBytesLE(e,t):X.fromBytesBE(e,t)},X.fromBytesLE=function(e,t){return new X(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},X.fromBytesBE=function(e,t){return new X(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},typeof BigInt==`function`&&(X.fromBigInt=function(e,t){return Z(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},X.fromValue=function(e,t){return typeof e==`bigint`?X.fromBigInt(e,t):Yf(e,t)},Q.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e});var up=s(((e,t)=>{t.exports=n;function n(e,t){for(var n=Array(arguments.length-1),r=0,i=2,a=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise(function(i,o){n[r]=function(e){if(a)if(a=!1,e)o(e);else{for(var t=Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){a&&(a=!1,o(e))}})}})),dp=s((e=>{var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&e.charAt(t)===`=`;)++n;return Math.ceil(e.length*3)/4-n};for(var n=Array(64),r=Array(123),i=0;i<64;)r[n[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;t.encode=function(e,t,r){for(var i=null,a=[],o=0,s=0,c;t<r;){var l=e[t++];switch(s){case 0:a[o++]=n[l>>2],c=(l&3)<<4,s=1;break;case 1:a[o++]=n[c|l>>4],c=(l&15)<<2,s=2;break;case 2:a[o++]=n[c|l>>6],a[o++]=n[l&63],s=0;break}o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),o=0)}return s&&(a[o++]=n[c],a[o++]=61,s===1&&(a[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join(``)):String.fromCharCode.apply(String,a.slice(0,o))};var a=`invalid encoding`;t.decode=function(e,t,n){for(var i=n,o=0,s,c=0;c<e.length;){var l=e.charCodeAt(c++);if(l===61&&o>1)break;if((l=r[l])===void 0)throw Error(a);switch(o){case 0:s=l,o=1;break;case 1:t[n++]=s<<2|(l&48)>>4,s=l,o=2;break;case 2:t[n++]=(s&15)<<4|(l&60)>>2,s=l,o=3;break;case 3:t[n++]=(s&3)<<6|l,o=0;break}}if(o===1)throw Error(a);return n-i},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}})),fp=s(((e,t)=>{t.exports=n;function n(){this._listeners={}}n.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},n.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},n.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}})),pp=s(((e,t)=>{t.exports=n(n);function n(e){return typeof Float32Array<`u`?(function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=n[3]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function a(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}e.writeFloatLE=r?i:a,e.writeFloatBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.readFloatLE=r?o:s,e.readFloatBE=r?s:o})():(function(){function t(e,t,n,r){var i=+(t<0);if(i&&(t=-t),t===0)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var a=Math.floor(Math.log(t)/Math.LN2),o=Math.round(t*Math.pow(2,-a)*8388608)&8388607;e((i<<31|a+127<<23|o)>>>0,n,r)}}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,i);function n(e,t,n){var r=e(t,n),i=(r>>31)*2+1,a=r>>>23&255,o=r&8388607;return a===255?o?NaN:i*(1/0):a===0?i*1401298464324817e-60*o:i*Math.pow(2,a-150)*(o+8388608)}e.readFloatLE=n.bind(null,a),e.readFloatBE=n.bind(null,o)})(),typeof Float64Array<`u`?(function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=n[7]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function a(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}e.writeDoubleLE=r?i:a,e.writeDoubleBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.readDoubleLE=r?o:s,e.readDoubleBE=r?s:o})():(function(){function t(e,t,n,r,i,a){var o=+(r<0);if(o&&(r=-r),r===0)e(0,i,a+t),e(1/r>0?0:2147483648,i,a+n);else if(isNaN(r))e(0,i,a+t),e(2146959360,i,a+n);else if(r>17976931348623157e292)e(0,i,a+t),e((o<<31|2146435072)>>>0,i,a+n);else{var s;if(r<22250738585072014e-324)s=r/5e-324,e(s>>>0,i,a+t),e((o<<31|s/4294967296)>>>0,i,a+n);else{var c=Math.floor(Math.log(r)/Math.LN2);c===1024&&(c=1023),s=r*Math.pow(2,-c),e(s*4503599627370496>>>0,i,a+t),e((o<<31|c+1023<<20|s*1048576&1048575)>>>0,i,a+n)}}}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,i,4,0);function n(e,t,n,r,i){var a=e(r,i+t),o=e(r,i+n),s=(o>>31)*2+1,c=o>>>20&2047,l=4294967296*(o&1048575)+a;return c===2047?l?NaN:s*(1/0):c===0?s*5e-324*l:s*Math.pow(2,c-1075)*(l+4503599627370496)}e.readDoubleLE=n.bind(null,a,0,4),e.readDoubleBE=n.bind(null,o,4,0)})(),e}function r(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function i(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=e&255}function a(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}})),mp=s(((e,t)=>{t.exports=n;function n(e){try{if(typeof require!=`function`)return null;var t=require(e);return t&&(t.length||Object.keys(t).length)?t:null}catch(e){return null}}})),hp=s((e=>{var t=e,n=`�`;t.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:(n&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320?(++r,t+=4):t+=3;return t},t.read=function(e,t,r){if(r-t<1)return``;for(var i=``,a=t;a<r;){var o=e[a++];if(o<=127)i+=String.fromCharCode(o);else if(o>=192&&o<224){var s=(o&31)<<6|e[a++]&63;i+=s>=128?String.fromCharCode(s):n}else if(o>=224&&o<240){var c=(o&15)<<12|(e[a++]&63)<<6|e[a++]&63;i+=c>=2048?String.fromCharCode(c):n}else if(o>=240){var l=(o&7)<<18|(e[a++]&63)<<12|(e[a++]&63)<<6|e[a++]&63;l<65536||l>1114111?i+=n:(l-=65536,i+=String.fromCharCode(55296+(l>>10)),i+=String.fromCharCode(56320+(l&1023)))}}return i},t.write=function(e,t,n){for(var r=n,i,a,o=0;o<e.length;++o)i=e.charCodeAt(o),i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&((a=e.charCodeAt(o+1))&64512)==56320?(i=65536+((i&1023)<<10)+(a&1023),++o,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128);return n-r}})),gp=s(((e,t)=>{t.exports=n;function n(e,t,n){var r=n||8192,i=r>>>1,a=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(a=e(r),o=0);var s=t.call(a,o,o+=n);return o&7&&(o=(o|7)+1),s}}})),_p=s(((e,t)=>{t.exports=r;var n=vp();function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=r.zero=new r(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=r.zeroHash=`\0\0\0\0\0\0\0\0`;r.fromNumber=function(e){if(e===0)return i;var t=e<0;t&&(e=-e);var n=e>>>0,a=(e-n)/4294967296>>>0;return t&&(a=~a>>>0,n=~n>>>0,++n>4294967295&&(n=0,++a>4294967295&&(a=0))),new r(n,a)},r.from=function(e){if(typeof e==`number`)return r.fromNumber(e);if(n.isString(e))if(n.Long)e=n.Long.fromString(e);else return r.fromNumber(parseInt(e,10));return e.low||e.high?new r(e.low>>>0,e.high>>>0):i},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(e){return n.Long?new n.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var o=String.prototype.charCodeAt;r.fromHash=function(e){return e===a?i:new r((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}})),vp=s((e=>{var t=e;t.asPromise=up(),t.base64=dp(),t.EventEmitter=fp(),t.float=pp(),t.inquire=mp(),t.utf8=hp(),t.pool=gp(),t.LongBits=_p(),t.isNode=!!(typeof global<`u`&&global&&global.process&&global.process.versions&&global.process.versions.node),t.global=t.isNode&&global||typeof window<`u`&&window||typeof self<`u`&&self||e,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return typeof e==`string`||e instanceof String},t.isObject=function(e){return e&&typeof e==`object`},t.isset=t.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!=`object`||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},t.Buffer=(function(){try{var e=t.inquire(`buffer`).Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return typeof e==`number`?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):typeof Uint8Array>`u`?e:new Uint8Array(e)},t.Array=typeof Uint8Array<`u`?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire(`long`),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(!!n)};function n(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)(e[r[i]]===void 0||!n)&&r[i]!==`__proto__`&&(e[r[i]]=t[r[i]]);return e}t.merge=n,t.recursionLimit=100,t.makeProp=function(e,t){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,writable:!0})},t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function r(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,`message`,{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,`stack`,{value:Error().stack||``}),r&&n(this,r)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+`: `+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}t.newError=r,t.ProtocolError=r(`ProtocolError`),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(t[e[n]]===1&&this[e[n]]!==void 0&&this[e[n]]!==null)return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;if(!e){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}})),yp=s(((e,t)=>{t.exports=u;var n=vp(),r,i=n.LongBits,a=n.base64,o=n.utf8;function s(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function u(){this.len=0,this.head=new s(c,0,0),this.tail=this.head,this.states=null}var d=function(){return n.Buffer?function(){return(u.create=function(){return new r})()}:function(){return new u}};u.create=d(),u.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(e,t,n){return this.tail=this.tail.next=new s(e,t,n),this.len+=t,this};function f(e,t,n){t[n]=e&255}function p(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function m(e,t){this.len=e,this.next=void 0,this.val=t}m.prototype=Object.create(s.prototype),m.prototype.fn=p,u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new m((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},u.prototype.int32=function(e){return e<0?this._push(h,10,i.fromNumber(e)):this.uint32(e)},u.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function h(e,t,n){for(;e.hi;)t[n++]=e.lo&127|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=e.lo&127|128,e.lo>>>=7;t[n++]=e.lo}u.prototype.uint64=function(e){var t=i.from(e);return this._push(h,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(h,t.length(),t)},u.prototype.bool=function(e){return this._push(f,1,+!!e)};function g(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}u.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=i.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var _=n.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};u.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(n.isString(e)){var r=u.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(_,t,e)},u.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(o.write,t,e):this._push(f,1,0)},u.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new s(c,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new s(c,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},u.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},u._configure=function(e){r=e,u.create=d(),r._configure()}})),bp=s(((e,t)=>{t.exports=i;var n=yp();(i.prototype=Object.create(n.prototype)).constructor=i;var r=vp();function i(){n.call(this)}i._configure=function(){i.alloc=r._Buffer_allocUnsafe,i.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name===`set`?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},i.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,`base64`));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this};function a(e,t,n){e.length<40?r.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}i.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},i._configure()})),xp=s(((e,t)=>{t.exports=s;var n=vp(),r,i=n.LongBits,a=n.utf8;function o(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}function s(e){this.buf=e,this.pos=0,this.len=e.length}var c=typeof Uint8Array<`u`?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new s(e);throw Error(`illegal buffer`)}:function(e){if(Array.isArray(e))return new s(e);throw Error(`illegal buffer`)},l=function(){return n.Buffer?function(e){return(s.create=function(e){return n.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};s.create=l(),s.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,s.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return e}})(),s.prototype.int32=function(){return this.uint32()|0},s.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function u(){var e=new i(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(`invalid varint encoding`)}s.prototype.bool=function(){return this.uint32()!==0};function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}s.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)|0};function f(){if(this.pos+8>this.len)throw o(this,8);return new i(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}s.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},s.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},s.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw o(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,r);if(t===r){var i=n.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,r)},s.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},s.prototype.skip=function(e){if(typeof e==`number`){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do if(this.pos>=this.len)throw o(this);while(this.buf[this.pos++]&128);return this},s.recursionLimit=n.recursionLimit,s.prototype.skipType=function(e,t){if(t===void 0&&(t=0),t>s.recursionLimit)throw Error(`maximum nesting depth exceeded`);switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!=4;)this.skipType(e,t+1);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this},s._configure=function(e){r=e,s.create=l(),r._configure();var t=n.Long?`toLong`:`toNumber`;n.merge(s.prototype,{int64:function(){return u.call(this)[t](!1)},uint64:function(){return u.call(this)[t](!0)},sint64:function(){return u.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}})),Sp=s(((e,t)=>{t.exports=i;var n=xp();(i.prototype=Object.create(n.prototype)).constructor=i;var r=vp();function i(e){n.call(this,e)}i._configure=function(){r.Buffer&&(i.prototype._slice=r.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString(`utf-8`,this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()})),Cp=s(((e,t)=>{t.exports=r;var n=vp();(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r;function r(e,t,r){if(typeof e!=`function`)throw TypeError(`rpcImpl must be a function`);n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}r.prototype.rpcCall=function e(t,r,i,a,o){if(!a)throw TypeError(`request must be specified`);var s=this;if(!o)return n.asPromise(e,s,t,r,i,a);if(!s.rpcImpl){setTimeout(function(){o(Error(`already ended`))},0);return}try{return s.rpcImpl(t,r[s.requestDelimited?`encodeDelimited`:`encode`](a).finish(),function(e,n){if(e)return s.emit(`error`,e,t),o(e);if(n===null){s.end(!0);return}if(!(n instanceof i))try{n=i[s.responseDelimited?`decodeDelimited`:`decode`](n)}catch(e){return s.emit(`error`,e,t),o(e)}return s.emit(`data`,n,t),o(null,n)})}catch(e){s.emit(`error`,e,t),setTimeout(function(){o(e)},0);return}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(`end`).off()),this}})),wp=s((e=>{var t=e;t.Service=Cp()})),Tp=s(((e,t)=>{t.exports={}})),Ep=s((e=>{var t=e;t.build=`minimal`,t.Writer=yp(),t.BufferWriter=bp(),t.Reader=xp(),t.BufferReader=Sp(),t.util=vp(),t.rpc=wp(),t.roots=Tp(),t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})),$=l(s(((e,t)=>{t.exports=Ep()}))(),1);let Dp=[`resource`,`getSessionId`,`tracer`,`url`,`debug`,`apiKey`,`headers`];var Op=class{constructor(e,t){R(this,`logs`,[]),R(this,`scheduledDelayMillis`,void 0),R(this,`timeout`,void 0),R(this,`exporter`,void 0),R(this,`lastBatchSent`,0),this.scheduledDelayMillis=(t==null?void 0:t.scheduledDelayMillis)||5e3,this.exporter=e,typeof window<`u`&&window.addEventListener(`unload`,()=>{this._flushAll()})}onLog(e){this.logs.push(e),this.timeout===void 0&&(this.timeout=setTimeout(()=>{this.timeout=void 0,this._flushAll()},this.scheduledDelayMillis))}_flushAll(){this.lastBatchSent=Date.now(),F.with(Mt(F.active()),()=>{let e=this.logs.splice(0,this.logs.length);this.exporter.export(e)})}};function kp(e,t,n){return{body:e,timeUnixNano:t,attributes:n}}function Ap(){return Reflect.get(globalThis,`Buffer`)||void 0}function jp(e){let t=Ap();if(t)return Uint8Array.from(t.from(e,`base64`));let n=globalThis.atob(e),r=new Uint8Array(n.length);for(let e=0;e<n.length;++e)r[e]=n.charCodeAt(e);return r}function Mp(e){let t=Ap();if(t)return t.from(e).toString(`base64`);let n=[];return e.forEach(e=>{n.push(globalThis.String.fromCharCode(e))}),globalThis.btoa(n.join(``))}function Np(){return{stringValue:void 0,boolValue:void 0,intValue:void 0,doubleValue:void 0,arrayValue:void 0,kvlistValue:void 0,bytesValue:void 0}}let Pp={encode(e,t=$.default.Writer.create()){return e.stringValue!==void 0&&t.uint32(10).string(e.stringValue),e.boolValue!==void 0&&t.uint32(16).bool(e.boolValue),e.intValue!==void 0&&t.uint32(24).int64(e.intValue),e.doubleValue!==void 0&&t.uint32(33).double(e.doubleValue),e.arrayValue!==void 0&&Ip.encode(e.arrayValue,t.uint32(42).fork()).ldelim(),e.kvlistValue!==void 0&&Rp.encode(e.kvlistValue,t.uint32(50).fork()).ldelim(),e.bytesValue!==void 0&&t.uint32(58).bytes(e.bytesValue),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Np();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.stringValue=n.string();continue;case 2:if(e!==16)break;i.boolValue=n.bool();continue;case 3:if(e!==24)break;i.intValue=Gp(n.int64());continue;case 4:if(e!==33)break;i.doubleValue=n.double();continue;case 5:if(e!==42)break;i.arrayValue=Ip.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.kvlistValue=Rp.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.bytesValue=n.bytes();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{stringValue:Kp(e.stringValue)?globalThis.String(e.stringValue):void 0,boolValue:Kp(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,intValue:Kp(e.intValue)?globalThis.Number(e.intValue):void 0,doubleValue:Kp(e.doubleValue)?globalThis.Number(e.doubleValue):void 0,arrayValue:Kp(e.arrayValue)?Ip.fromJSON(e.arrayValue):void 0,kvlistValue:Kp(e.kvlistValue)?Rp.fromJSON(e.kvlistValue):void 0,bytesValue:Kp(e.bytesValue)?jp(e.bytesValue):void 0}},toJSON(e){let t={};return e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.intValue!==void 0&&(t.intValue=Math.round(e.intValue)),e.doubleValue!==void 0&&(t.doubleValue=e.doubleValue),e.arrayValue!==void 0&&(t.arrayValue=Ip.toJSON(e.arrayValue)),e.kvlistValue!==void 0&&(t.kvlistValue=Rp.toJSON(e.kvlistValue)),e.bytesValue!==void 0&&(t.bytesValue=Mp(e.bytesValue)),t},create(e){return Pp.fromPartial(e==null?{}:e)},fromPartial(e){var t,n,r,i,a;let o=Np();return o.stringValue=(t=e.stringValue)==null?void 0:t,o.boolValue=(n=e.boolValue)==null?void 0:n,o.intValue=(r=e.intValue)==null?void 0:r,o.doubleValue=(i=e.doubleValue)==null?void 0:i,o.arrayValue=e.arrayValue!==void 0&&e.arrayValue!==null?Ip.fromPartial(e.arrayValue):void 0,o.kvlistValue=e.kvlistValue!==void 0&&e.kvlistValue!==null?Rp.fromPartial(e.kvlistValue):void 0,o.bytesValue=(a=e.bytesValue)==null?void 0:a,o}};function Fp(){return{values:[]}}let Ip={encode(e,t=$.default.Writer.create()){if(e.values!==void 0&&e.values.length!==0)for(let n of e.values)Pp.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Fp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.values.push(Pp.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e==null?void 0:e.values)?e.values.map(e=>Pp.fromJSON(e)):[]}},toJSON(e){var t;let n={};return(t=e.values)!=null&&t.length&&(n.values=e.values.map(e=>Pp.toJSON(e))),n},create(e){return Ip.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=Fp();return n.values=((t=e.values)==null?void 0:t.map(e=>Pp.fromPartial(e)))||[],n}};function Lp(){return{values:[]}}let Rp={encode(e,t=$.default.Writer.create()){if(e.values!==void 0&&e.values.length!==0)for(let n of e.values)Bp.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Lp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.values.push(Bp.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e==null?void 0:e.values)?e.values.map(e=>Bp.fromJSON(e)):[]}},toJSON(e){var t;let n={};return(t=e.values)!=null&&t.length&&(n.values=e.values.map(e=>Bp.toJSON(e))),n},create(e){return Rp.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=Lp();return n.values=((t=e.values)==null?void 0:t.map(e=>Bp.fromPartial(e)))||[],n}};function zp(){return{key:``,value:void 0}}let Bp={encode(e,t=$.default.Writer.create()){return e.key!==void 0&&e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&Pp.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=zp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=Pp.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{key:Kp(e.key)?globalThis.String(e.key):``,value:Kp(e.value)?Pp.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==void 0&&e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=Pp.toJSON(e.value)),t},create(e){return Bp.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=zp();return n.key=(t=e.key)==null?``:t,n.value=e.value!==void 0&&e.value!==null?Pp.fromPartial(e.value):void 0,n}};function Vp(){return{name:``,version:``}}let Hp={encode(e,t=$.default.Writer.create()){return e.name!==void 0&&e.name!==``&&t.uint32(10).string(e.name),e.version!==void 0&&e.version!==``&&t.uint32(18).string(e.version),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Vp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.version=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{name:Kp(e.name)?globalThis.String(e.name):``,version:Kp(e.version)?globalThis.String(e.version):``}},toJSON(e){let t={};return e.name!==void 0&&e.name!==``&&(t.name=e.name),e.version!==void 0&&e.version!==``&&(t.version=e.version),t},create(e){return Hp.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=Vp();return r.name=(t=e.name)==null?``:t,r.version=(n=e.version)==null?``:n,r}};function Up(){return{name:``,version:``}}let Wp={encode(e,t=$.default.Writer.create()){return e.name!==void 0&&e.name!==``&&t.uint32(10).string(e.name),e.version!==void 0&&e.version!==``&&t.uint32(18).string(e.version),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Up();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.version=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{name:Kp(e.name)?globalThis.String(e.name):``,version:Kp(e.version)?globalThis.String(e.version):``}},toJSON(e){let t={};return e.name!==void 0&&e.name!==``&&(t.name=e.name),e.version!==void 0&&e.version!==``&&(t.version=e.version),t},create(e){return Wp.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=Up();return r.name=(t=e.name)==null?``:t,r.version=(n=e.version)==null?``:n,r}};function Gp(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);return e.toNumber()}$.default.util.Long!==X&&($.default.util.Long=X,$.default.configure());function Kp(e){return e!=null}function qp(){return{attributes:[],droppedAttributesCount:0}}let Jp={encode(e,t=$.default.Writer.create()){if(e.attributes!==void 0&&e.attributes.length!==0)for(let n of e.attributes)Bp.encode(n,t.uint32(10).fork()).ldelim();return e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&t.uint32(16).uint32(e.droppedAttributesCount),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=qp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.attributes.push(Bp.decode(n,n.uint32()));continue;case 2:if(e!==16)break;i.droppedAttributesCount=n.uint32();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{attributes:globalThis.Array.isArray(e==null?void 0:e.attributes)?e.attributes.map(e=>Bp.fromJSON(e)):[],droppedAttributesCount:Yp(e.droppedAttributesCount)?globalThis.Number(e.droppedAttributesCount):0}},toJSON(e){var t;let n={};return(t=e.attributes)!=null&&t.length&&(n.attributes=e.attributes.map(e=>Bp.toJSON(e))),e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&(n.droppedAttributesCount=Math.round(e.droppedAttributesCount)),n},create(e){return Jp.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=qp();return r.attributes=((t=e.attributes)==null?void 0:t.map(e=>Bp.fromPartial(e)))||[],r.droppedAttributesCount=(n=e.droppedAttributesCount)==null?0:n,r}};function Yp(e){return e!=null}function Xp(e){switch(e){case 0:case`SEVERITY_NUMBER_UNSPECIFIED`:return 0;case 1:case`SEVERITY_NUMBER_TRACE`:return 1;case 2:case`SEVERITY_NUMBER_TRACE2`:return 2;case 3:case`SEVERITY_NUMBER_TRACE3`:return 3;case 4:case`SEVERITY_NUMBER_TRACE4`:return 4;case 5:case`SEVERITY_NUMBER_DEBUG`:return 5;case 6:case`SEVERITY_NUMBER_DEBUG2`:return 6;case 7:case`SEVERITY_NUMBER_DEBUG3`:return 7;case 8:case`SEVERITY_NUMBER_DEBUG4`:return 8;case 9:case`SEVERITY_NUMBER_INFO`:return 9;case 10:case`SEVERITY_NUMBER_INFO2`:return 10;case 11:case`SEVERITY_NUMBER_INFO3`:return 11;case 12:case`SEVERITY_NUMBER_INFO4`:return 12;case 13:case`SEVERITY_NUMBER_WARN`:return 13;case 14:case`SEVERITY_NUMBER_WARN2`:return 14;case 15:case`SEVERITY_NUMBER_WARN3`:return 15;case 16:case`SEVERITY_NUMBER_WARN4`:return 16;case 17:case`SEVERITY_NUMBER_ERROR`:return 17;case 18:case`SEVERITY_NUMBER_ERROR2`:return 18;case 19:case`SEVERITY_NUMBER_ERROR3`:return 19;case 20:case`SEVERITY_NUMBER_ERROR4`:return 20;case 21:case`SEVERITY_NUMBER_FATAL`:return 21;case 22:case`SEVERITY_NUMBER_FATAL2`:return 22;case 23:case`SEVERITY_NUMBER_FATAL3`:return 23;case 24:case`SEVERITY_NUMBER_FATAL4`:return 24;default:return-1}}function Zp(e){switch(e){case 0:return`SEVERITY_NUMBER_UNSPECIFIED`;case 1:return`SEVERITY_NUMBER_TRACE`;case 2:return`SEVERITY_NUMBER_TRACE2`;case 3:return`SEVERITY_NUMBER_TRACE3`;case 4:return`SEVERITY_NUMBER_TRACE4`;case 5:return`SEVERITY_NUMBER_DEBUG`;case 6:return`SEVERITY_NUMBER_DEBUG2`;case 7:return`SEVERITY_NUMBER_DEBUG3`;case 8:return`SEVERITY_NUMBER_DEBUG4`;case 9:return`SEVERITY_NUMBER_INFO`;case 10:return`SEVERITY_NUMBER_INFO2`;case 11:return`SEVERITY_NUMBER_INFO3`;case 12:return`SEVERITY_NUMBER_INFO4`;case 13:return`SEVERITY_NUMBER_WARN`;case 14:return`SEVERITY_NUMBER_WARN2`;case 15:return`SEVERITY_NUMBER_WARN3`;case 16:return`SEVERITY_NUMBER_WARN4`;case 17:return`SEVERITY_NUMBER_ERROR`;case 18:return`SEVERITY_NUMBER_ERROR2`;case 19:return`SEVERITY_NUMBER_ERROR3`;case 20:return`SEVERITY_NUMBER_ERROR4`;case 21:return`SEVERITY_NUMBER_FATAL`;case 22:return`SEVERITY_NUMBER_FATAL2`;case 23:return`SEVERITY_NUMBER_FATAL3`;case 24:return`SEVERITY_NUMBER_FATAL4`;default:return`UNRECOGNIZED`}}function Qp(){return{resourceLogs:[]}}let $p={encode(e,t=$.default.Writer.create()){if(e.resourceLogs!==void 0&&e.resourceLogs.length!==0)for(let n of e.resourceLogs)tm.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Qp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.resourceLogs.push(tm.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{resourceLogs:globalThis.Array.isArray(e==null?void 0:e.resourceLogs)?e.resourceLogs.map(e=>tm.fromJSON(e)):[]}},toJSON(e){var t;let n={};return(t=e.resourceLogs)!=null&&t.length&&(n.resourceLogs=e.resourceLogs.map(e=>tm.toJSON(e))),n},create(e){return $p.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=Qp();return n.resourceLogs=((t=e.resourceLogs)==null?void 0:t.map(e=>tm.fromPartial(e)))||[],n}};function em(){return{resource:void 0,scopeLogs:[],instrumentationLibraryLogs:[],schemaUrl:``}}let tm={encode(e,t=$.default.Writer.create()){if(e.resource!==void 0&&Jp.encode(e.resource,t.uint32(10).fork()).ldelim(),e.scopeLogs!==void 0&&e.scopeLogs.length!==0)for(let n of e.scopeLogs)rm.encode(n,t.uint32(18).fork()).ldelim();if(e.instrumentationLibraryLogs!==void 0&&e.instrumentationLibraryLogs.length!==0)for(let n of e.instrumentationLibraryLogs)am.encode(n,t.uint32(8002).fork()).ldelim();return e.schemaUrl!==void 0&&e.schemaUrl!==``&&t.uint32(26).string(e.schemaUrl),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=em();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.resource=Jp.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.scopeLogs.push(rm.decode(n,n.uint32()));continue;case 1e3:if(e!==8002)break;i.instrumentationLibraryLogs.push(am.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.schemaUrl=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{resource:lm(e.resource)?Jp.fromJSON(e.resource):void 0,scopeLogs:globalThis.Array.isArray(e==null?void 0:e.scopeLogs)?e.scopeLogs.map(e=>rm.fromJSON(e)):[],instrumentationLibraryLogs:globalThis.Array.isArray(e==null?void 0:e.instrumentationLibraryLogs)?e.instrumentationLibraryLogs.map(e=>am.fromJSON(e)):[],schemaUrl:lm(e.schemaUrl)?globalThis.String(e.schemaUrl):``}},toJSON(e){var t,n;let r={};return e.resource!==void 0&&(r.resource=Jp.toJSON(e.resource)),(t=e.scopeLogs)!=null&&t.length&&(r.scopeLogs=e.scopeLogs.map(e=>rm.toJSON(e))),(n=e.instrumentationLibraryLogs)!=null&&n.length&&(r.instrumentationLibraryLogs=e.instrumentationLibraryLogs.map(e=>am.toJSON(e))),e.schemaUrl!==void 0&&e.schemaUrl!==``&&(r.schemaUrl=e.schemaUrl),r},create(e){return tm.fromPartial(e==null?{}:e)},fromPartial(e){var t,n,r;let i=em();return i.resource=e.resource!==void 0&&e.resource!==null?Jp.fromPartial(e.resource):void 0,i.scopeLogs=((t=e.scopeLogs)==null?void 0:t.map(e=>rm.fromPartial(e)))||[],i.instrumentationLibraryLogs=((n=e.instrumentationLibraryLogs)==null?void 0:n.map(e=>am.fromPartial(e)))||[],i.schemaUrl=(r=e.schemaUrl)==null?``:r,i}};function nm(){return{scope:void 0,logRecords:[],schemaUrl:``}}let rm={encode(e,t=$.default.Writer.create()){if(e.scope!==void 0&&Wp.encode(e.scope,t.uint32(10).fork()).ldelim(),e.logRecords!==void 0&&e.logRecords.length!==0)for(let n of e.logRecords)sm.encode(n,t.uint32(18).fork()).ldelim();return e.schemaUrl!==void 0&&e.schemaUrl!==``&&t.uint32(26).string(e.schemaUrl),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=nm();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.scope=Wp.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.logRecords.push(sm.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.schemaUrl=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{scope:lm(e.scope)?Wp.fromJSON(e.scope):void 0,logRecords:globalThis.Array.isArray(e==null?void 0:e.logRecords)?e.logRecords.map(e=>sm.fromJSON(e)):[],schemaUrl:lm(e.schemaUrl)?globalThis.String(e.schemaUrl):``}},toJSON(e){var t;let n={};return e.scope!==void 0&&(n.scope=Wp.toJSON(e.scope)),(t=e.logRecords)!=null&&t.length&&(n.logRecords=e.logRecords.map(e=>sm.toJSON(e))),e.schemaUrl!==void 0&&e.schemaUrl!==``&&(n.schemaUrl=e.schemaUrl),n},create(e){return rm.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=nm();return r.scope=e.scope!==void 0&&e.scope!==null?Wp.fromPartial(e.scope):void 0,r.logRecords=((t=e.logRecords)==null?void 0:t.map(e=>sm.fromPartial(e)))||[],r.schemaUrl=(n=e.schemaUrl)==null?``:n,r}};function im(){return{instrumentationLibrary:void 0,logRecords:[],schemaUrl:``}}let am={encode(e,t=$.default.Writer.create()){if(e.instrumentationLibrary!==void 0&&Hp.encode(e.instrumentationLibrary,t.uint32(10).fork()).ldelim(),e.logRecords!==void 0&&e.logRecords.length!==0)for(let n of e.logRecords)sm.encode(n,t.uint32(18).fork()).ldelim();return e.schemaUrl!==void 0&&e.schemaUrl!==``&&t.uint32(26).string(e.schemaUrl),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=im();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.instrumentationLibrary=Hp.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.logRecords.push(sm.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.schemaUrl=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{instrumentationLibrary:lm(e.instrumentationLibrary)?Hp.fromJSON(e.instrumentationLibrary):void 0,logRecords:globalThis.Array.isArray(e==null?void 0:e.logRecords)?e.logRecords.map(e=>sm.fromJSON(e)):[],schemaUrl:lm(e.schemaUrl)?globalThis.String(e.schemaUrl):``}},toJSON(e){var t;let n={};return e.instrumentationLibrary!==void 0&&(n.instrumentationLibrary=Hp.toJSON(e.instrumentationLibrary)),(t=e.logRecords)!=null&&t.length&&(n.logRecords=e.logRecords.map(e=>sm.toJSON(e))),e.schemaUrl!==void 0&&e.schemaUrl!==``&&(n.schemaUrl=e.schemaUrl),n},create(e){return am.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=im();return r.instrumentationLibrary=e.instrumentationLibrary!==void 0&&e.instrumentationLibrary!==null?Hp.fromPartial(e.instrumentationLibrary):void 0,r.logRecords=((t=e.logRecords)==null?void 0:t.map(e=>sm.fromPartial(e)))||[],r.schemaUrl=(n=e.schemaUrl)==null?``:n,r}};function om(){return{timeUnixNano:0,observedTimeUnixNano:0,severityNumber:0,severityText:``,body:void 0,attributes:[],droppedAttributesCount:0,flags:0,traceId:new Uint8Array,spanId:new Uint8Array}}let sm={encode(e,t=$.default.Writer.create()){if(e.timeUnixNano!==void 0&&e.timeUnixNano!==0&&t.uint32(9).fixed64(e.timeUnixNano),e.observedTimeUnixNano!==void 0&&e.observedTimeUnixNano!==0&&t.uint32(89).fixed64(e.observedTimeUnixNano),e.severityNumber!==void 0&&e.severityNumber!==0&&t.uint32(16).int32(e.severityNumber),e.severityText!==void 0&&e.severityText!==``&&t.uint32(26).string(e.severityText),e.body!==void 0&&Pp.encode(e.body,t.uint32(42).fork()).ldelim(),e.attributes!==void 0&&e.attributes.length!==0)for(let n of e.attributes)Bp.encode(n,t.uint32(50).fork()).ldelim();return e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&t.uint32(56).uint32(e.droppedAttributesCount),e.flags!==void 0&&e.flags!==0&&t.uint32(69).fixed32(e.flags),e.traceId!==void 0&&e.traceId.length!==0&&t.uint32(74).bytes(e.traceId),e.spanId!==void 0&&e.spanId.length!==0&&t.uint32(82).bytes(e.spanId),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=om();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==9)break;i.timeUnixNano=cm(n.fixed64());continue;case 11:if(e!==89)break;i.observedTimeUnixNano=cm(n.fixed64());continue;case 2:if(e!==16)break;i.severityNumber=n.int32();continue;case 3:if(e!==26)break;i.severityText=n.string();continue;case 5:if(e!==42)break;i.body=Pp.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.attributes.push(Bp.decode(n,n.uint32()));continue;case 7:if(e!==56)break;i.droppedAttributesCount=n.uint32();continue;case 8:if(e!==69)break;i.flags=n.fixed32();continue;case 9:if(e!==74)break;i.traceId=n.bytes();continue;case 10:if(e!==82)break;i.spanId=n.bytes();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{timeUnixNano:lm(e.timeUnixNano)?globalThis.Number(e.timeUnixNano):0,observedTimeUnixNano:lm(e.observedTimeUnixNano)?globalThis.Number(e.observedTimeUnixNano):0,severityNumber:lm(e.severityNumber)?Xp(e.severityNumber):0,severityText:lm(e.severityText)?globalThis.String(e.severityText):``,body:lm(e.body)?Pp.fromJSON(e.body):void 0,attributes:globalThis.Array.isArray(e==null?void 0:e.attributes)?e.attributes.map(e=>Bp.fromJSON(e)):[],droppedAttributesCount:lm(e.droppedAttributesCount)?globalThis.Number(e.droppedAttributesCount):0,flags:lm(e.flags)?globalThis.Number(e.flags):0,traceId:lm(e.traceId)?jp(e.traceId):new Uint8Array,spanId:lm(e.spanId)?jp(e.spanId):new Uint8Array}},toJSON(e){var t;let n={};return e.timeUnixNano!==void 0&&e.timeUnixNano!==0&&(n.timeUnixNano=Math.round(e.timeUnixNano)),e.observedTimeUnixNano!==void 0&&e.observedTimeUnixNano!==0&&(n.observedTimeUnixNano=Math.round(e.observedTimeUnixNano)),e.severityNumber!==void 0&&e.severityNumber!==0&&(n.severityNumber=Zp(e.severityNumber)),e.severityText!==void 0&&e.severityText!==``&&(n.severityText=e.severityText),e.body!==void 0&&(n.body=Pp.toJSON(e.body)),(t=e.attributes)!=null&&t.length&&(n.attributes=e.attributes.map(e=>Bp.toJSON(e))),e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&(n.droppedAttributesCount=Math.round(e.droppedAttributesCount)),e.flags!==void 0&&e.flags!==0&&(n.flags=Math.round(e.flags)),e.traceId!==void 0&&e.traceId.length!==0&&(n.traceId=Mp(e.traceId)),e.spanId!==void 0&&e.spanId.length!==0&&(n.spanId=Mp(e.spanId)),n},create(e){return sm.fromPartial(e==null?{}:e)},fromPartial(e){var t,n,r,i,a,o,s,c,l;let u=om();return u.timeUnixNano=(t=e.timeUnixNano)==null?0:t,u.observedTimeUnixNano=(n=e.observedTimeUnixNano)==null?0:n,u.severityNumber=(r=e.severityNumber)==null?0:r,u.severityText=(i=e.severityText)==null?``:i,u.body=e.body!==void 0&&e.body!==null?Pp.fromPartial(e.body):void 0,u.attributes=((a=e.attributes)==null?void 0:a.map(e=>Bp.fromPartial(e)))||[],u.droppedAttributesCount=(o=e.droppedAttributesCount)==null?0:o,u.flags=(s=e.flags)==null?0:s,u.traceId=(c=e.traceId)==null?new Uint8Array:c,u.spanId=(l=e.spanId)==null?new Uint8Array:l,u}};function cm(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);return e.toNumber()}$.default.util.Long!==X&&($.default.util.Long=X,$.default.configure());function lm(e){return e!=null}let um=`0.0.12`,dm={"Content-Type":`application/x-protobuf`,"Content-Encoding":`gzip`},fm=$p;function pm(e){return Array.isArray(e)}function mm(e){return!!e&&typeof e==`object`&&!pm(e)}function hm(e){return mm(e)?{kvlistValue:{values:Object.entries(e).map(([e,t])=>({key:e,value:hm(t)}))}}:pm(e)?{arrayValue:{values:e.map(e=>hm(e))}}:typeof e==`string`?{stringValue:e}:typeof e==`number`?{doubleValue:e}:typeof e==`boolean`?{boolValue:e}:{}}var gm=class{constructor(e){R(this,`config`,void 0),this.config=e}constructLogData(e){var t,n,r;return{resourceLogs:[{resource:{attributes:(t=hm(V({},Object.fromEntries(Object.entries((n=(r=this.config.resource)==null?void 0:r.attributes)==null?{}:n)))))==null||(t=t.kvlistValue)==null?void 0:t.values},scopeLogs:[{scope:{name:`rum.rr-web`,version:um},logRecords:e.map(e=>{var t,n;return{body:hm((t=e.body)==null?null:t),timeUnixNano:e.timeUnixNano*1e6,attributes:(n=hm(e.attributes||{}).kvlistValue)==null?void 0:n.values}})}]}]}}export(e){if(e.length===0)return;let t=this.constructLogData(e);this.config.debug&&console.log(`otlp request`,t);let n=Rf(fm.encode(t).finish()),r=this.config.headers?Object.assign({},dm,this.config.headers):dm;fetch(this.config.beaconUrl,{method:`POST`,body:new Uint8Array(n),headers:r}).catch(()=>{})}};function _m(e){if(e.length>5e6){let t=e.matchAll(/data:([\w/\-.]+);(\w+),([^)"]*)/gim);for(let n of t)e=n[1].toLocaleLowerCase().slice(0,6)===`image/`?e.replace(n[0],`data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==`):e.replace(n[0],``)}return e}var vm=class{constructor(e,t={}){var n,r;R(this,`bucketSize`,100),R(this,`refillRate`,10),R(this,`mutationBuckets`,{}),R(this,`loggedTracker`,{}),R(this,`refillBuckets`,()=>{Object.keys(this.mutationBuckets).forEach(e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]})}),R(this,`getNodeOrRelevantParent`,e=>{let t=this.rrweb.mirror.getNode(e);if((t==null?void 0:t.nodeName)!==`svg`&&t instanceof Element){let e=t.closest(`svg`);if(e)return[this.rrweb.mirror.getId(e),e]}return[e,t]}),R(this,`numberOfChanges`,e=>{var t,n,r,i,a,o,s,c;return((t=(n=e.removes)==null?void 0:n.length)==null?0:t)+((r=(i=e.attributes)==null?void 0:i.length)==null?0:r)+((a=(o=e.texts)==null?void 0:o.length)==null?0:a)+((s=(c=e.adds)==null?void 0:c.length)==null?0:s)}),R(this,`throttleMutations`,e=>{if(e.type!==3||e.data.source!==0)return e;let t=e.data,n=this.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter(e=>{var t;let[n,r]=this.getNodeOrRelevantParent(e.id);if(this.mutationBuckets[n]===0)return!1;if(this.mutationBuckets[n]=(t=this.mutationBuckets[n])==null?this.bucketSize:t,this.mutationBuckets[n]=Math.max(this.mutationBuckets[n]-1,0),this.mutationBuckets[n]===0&&!this.loggedTracker[n]){var i,a;this.loggedTracker[n]=!0,(i=(a=this.options).onBlockedNode)==null||i.call(a,n,r)}return e}));let r=this.numberOfChanges(t);if(!(r===0&&n!==r))return e}),this.rrweb=e,this.options=t,this.refillRate=(n=this.options.refillRate)==null?this.refillRate:n,this.bucketSize=(r=this.options.bucketSize)==null?this.bucketSize:r,setInterval(()=>{this.refillBuckets()},1e3)}};let ym=950*1024,bm=new TextEncoder,xm=new TextDecoder,Sm=!1,Cm,wm,Tm=0,Em=!1,Dm=1,Om=1,km,Am,jm,Mm={get inited(){return!!Sm},isRecording(){return!!Sm&&!Em},setEnabled(e){e?Mm.resume():Mm.stop()},init(e){var t,n;if(Sm)return;if(typeof window>`u`){console.error(`Session recorder can't be ran in non-browser environments`);return}let{resource:r,getSessionId:i,tracer:a,url:o,debug:s,apiKey:c,headers:l}=e,u=Ei(e,Dp);Am=i,Cm=a;let d=Cm.startSpan(`record init`);if(!d.isRecording())return;d.end();let f=o,p=V({},l);c&&(p.authorization=c);let m=new Op(new gm({beaconUrl:f,debug:s,headers:p,resource:r}),{});wm=(t=i())==null?``:t,Tm=Date.now(),km=(n=km)==null?new vm(Qd,{onBlockedNode:(e,t)=>{let n=`OpenTelemetry Session Recorder: Rate limiting recording mutations on node ${e}. This can be due to excessive animations.`,r=Date.now(),i=Cm.startSpan(`console.warn`,{kind:Ye.INTERNAL,startTime:r});i.setAttribute(`component`,`console`),i.setAttribute(`level`,`warn`),i.setAttribute(`message`,n),i.end(r),s&&console.warn(n,t),clearTimeout(jm),jm=setTimeout(()=>{Qd.takeFullSnapshot()},1e3)}}):n,Sm=Qd(V(V({maskAllInputs:!0,maskTextSelector:`*`},u),{},{emit(e){var t;if(Em)return;let n=(t=Am==null?void 0:Am())==null?``:t;if(n!==wm){if(document.hidden)return;wm=n,Tm=Date.now(),Dm=1,Om=1,Qd.takeFullSnapshot()}if(e.timestamp>Tm+1446e4)return;let r=km?km.throttleMutations(e):e;if(!r)return;let i=r.timestamp,a=Dm++,o=bm.encode(_m(JSON.stringify(r))),c=Math.ceil(o.byteLength/ym);for(let e=0;e<c;e++){let t=e*ym,n=(e+1)*ym,r=kp(xm.decode(o.slice(t,n)),i,{"rr-web.offset":Om++,"rr-web.event":a,"rr-web.chunk":e+1,"rr-web.total-chunks":c});s&&console.log(r),m.onLog(r)}}}))},resume(){if(!Sm)return;let e=Em;Em=!1,e||(Qd.takeFullSnapshot(),Cm.startSpan(`record resume`).end())},stop(){Sm&&(Em&&Cm.startSpan(`record stop`).end(),Em=!0)},deinit(){Sm&&(Sm(),Sm=!1,Am=void 0)}},Nm={isRecording:()=>!1,setEnabled:()=>{}};function Pm({resource:e,spanSessionManager:t,tracerProvider:n,appID:r,userID:i,mxlDataURL:a,sessionRecorder:o}){return V({resource:e,getSessionId:()=>t.getSessionId(),tracer:n.getTracer(`mxl.session-recorder`,um),url:El(r,a),headers:_c(r,i)},o)}function Fm(e){let t=()=>Pm(e);return e.recordUserSessions?(Mm.init(t()),{isRecording:()=>Mm.isRecording(),setEnabled:e=>{Mm.setEnabled(e)}}):{isRecording:()=>Mm.isRecording(),setEnabled:e=>{e?Mm.inited?Mm.resume():Mm.init(t()):Mm.inited&&Mm.stop()}}}var Im;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(Im||(Im={}));let Lm=I.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function Rm(...e){if(e[0]instanceof URL||typeof e[0]==`string`){let t=e[1];if(!(t!=null&&t.body))return Promise.resolve();if(t.body instanceof ReadableStream){let{body:e,length:n}=zm(t.body);return t.body=e,n}else return Promise.resolve(Vm(t.body))}else{let t=e[0];return t!=null&&t.body?t.clone().text().then(e=>Um(e)):Promise.resolve()}}function zm(e){if(!e.pipeThrough)return Lm.warn(`Platform has ReadableStream but not pipeThrough!`),{body:e,length:Promise.resolve(void 0)};let t=0,n,r=new Promise(e=>{n=e}),i=new TransformStream({start(){},transform(e,n){return z(function*(){let r=yield e;t+=r.byteLength,n.enqueue(e)})()},flush(){n(t)}});return{body:e.pipeThrough(i),length:r}}function Bm(e){return typeof Document<`u`&&e instanceof Document}function Vm(e){if(Bm(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Um(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return Wm(e);if(e instanceof URLSearchParams)return Um(e.toString());if(e.byteLength!==void 0)return e.byteLength;Lm.warn(`unknown body type`)}let Hm=new TextEncoder;function Um(e){return Hm.encode(e).byteLength}function Wm(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function Gm(e){let t=Jm(),n=e.toUpperCase();return n in t?n:`_OTHER`}let Km={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},qm;function Jm(){return qm===void 0&&(qm=Km),qm}let Ym={"https:":`443`,"http:":`80`};function Xm(e){let t=Number(e.port||Ym[e.protocol]);if(t&&!isNaN(t))return t}let Zm=`0.217.0`,Qm=typeof PerformanceObserver<`u`;var $m=class extends Fa{constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,Zm,e),R(this,`component`,`fetch`),R(this,`version`,Zm),R(this,`moduleName`,this.component),R(this,`_usedResources`,new WeakSet),R(this,`_tasksCount`,0),R(this,`_semconvStability`,void 0),this._semconvStability=La(`http`,e==null?void 0:e.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[B.FETCH_START]},L.setSpan(F.active(),e)),r=!(this._semconvStability&H.OLD);fi(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[B.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=vi(t.url);if(this._semconvStability&H.OLD&&(e.setAttribute(`http.status_code`,t.status),t.statusText!=null&&e.setAttribute(Im.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(`http.host`,n.host),e.setAttribute(`http.scheme`,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(`http.user_agent`,navigator.userAgent)),this._semconvStability&H.STABLE){e.setAttribute(on,t.status),e.setAttribute(sn,n.hostname);let r=Xm(n);r&&e.setAttribute(cn,r)}}_addHeaders(e,t){if(!yi(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};ct.inject(F.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)ct.inject(F.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t=new Headers(e.headers);ct.inject(F.active(),t,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))}),e.headers=t}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(mr(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&H.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[Im.COMPONENT]=this.moduleName,r[`http.method`]=i,r[`http.url`]=e}if(this._semconvStability&H.STABLE){let i=t.method,a=Gm(t.method||`GET`);n||(n=a),r[rn]=a,a!==i&&(r[an]=i),r[pn]=e}return this.tracer.startSpan(n,{kind:Ye.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=hi(t.spanUrl,t.startTime,n,r,this._usedResources,`fetch`);if(i.mainRequest){let t=i.mainRequest;this._markResourceAsUsed(t);let n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&H.OLD);fi(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=yn(Date.now()),i=bn();this._addFinalSpanAttributes(e,n),this._semconvStability&H.STABLE&&n.status>=400&&(e.setStatus({code:Xe.ERROR}),e.setAttribute($t,String(n.status))),setTimeout(()=>{var n;(n=t.observer)==null||n.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},300)}_patchConstructor(){return e=>{let t=this;return function(...n){if(!t._isEnabled)return e.apply(this,n);let r=this,i=vi(n[0]instanceof Request?n[0].url:String(n[0])).href,a;a=n[0]instanceof Request?n[1]==null?n[0]:new Request(n[0],n[1]):n[1]||{};let o=t._createSpan(i,a);if(!o)return e.apply(this,n);let s=t._prepareSpanData(i);t.getConfig().measureRequestSize&&Rm(...n).then(e=>{e&&(t._semconvStability&H.OLD&&o.setAttribute(`http.request_content_length_uncompressed`,e),t._semconvStability&H.STABLE&&o.setAttribute(`http.request.body.size`,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function c(e,n){t._applyAttributesAfterFetch(e,a,n),t._endSpan(e,s,{status:n.status||0,statusText:n.message,url:i})}function l(e,n){t._applyAttributesAfterFetch(e,a,n),n.status>=200&&n.status<400?t._endSpan(e,s,n):t._endSpan(e,s,{status:n.status,statusText:n.statusText,url:i})}function u(e,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?l(e,n):i()},t=>{c(e,t)})};i()}else l(e,n)}catch(n){t._diag.error(`Failed to read fetch response body`,n),t._endSpan(e,s,{status:0,url:i})}return n}function d(e,n){try{c(e,n)}catch(r){t._diag.error(`Failed to end span on fetch error`,r),t._endSpan(e,s,{status:n.status||0,url:i})}throw n}return F.with(L.setSpan(F.active(),o),()=>(t._callRequestHook(o,a),t._addHeaders(a,i),t._tasksCount++,e.apply(r,a instanceof Request?[a]:[i,a]).then(u.bind(r,o),d.bind(r,o))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&Ia(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&Ia(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=bn(),n=[];if(typeof PerformanceObserver!=`function`)return{entries:n,startTime:t,spanUrl:e};let r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.initiatorType===`fetch`&&t.name===e&&n.push(t)})});return r.observe({entryTypes:[`resource`]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){if(!Qm){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument server-side fetch()`);return}if(!this._isEnabled){if(this._isFetchPatched){this._diag.debug(`fetch constructor already patched`),this._isEnabled=!0;return}try{this._wrap(globalThis,`fetch`,this._patchConstructor()),this._isFetchPatched=!0,this._isEnabled=!0}catch(e){this._diag.warn(`Failed to patch globalThis.fetch; instrumentation will not be enabled. Another script may have locked globalThis.fetch via Object.defineProperty.`,e)}}}disable(){Qm&&this._isEnabled&&(this._isEnabled=!1,this._usedResources=new WeakSet)}},eh;(function(e){e.METHOD_OPEN=`open`,e.METHOD_SEND=`send`,e.EVENT_ABORT=`abort`,e.EVENT_ERROR=`error`,e.EVENT_LOAD=`loaded`,e.EVENT_TIMEOUT=`timeout`})(eh||(eh={}));let th=I.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils`});function nh(e){return typeof Document<`u`&&e instanceof Document}function rh(e){if(nh(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return ah(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return oh(e);if(e instanceof URLSearchParams)return ah(e.toString());if(e.byteLength!==void 0)return e.byteLength;th.warn(`unknown body type`)}let ih=new TextEncoder;function ah(e){return ih.encode(e).byteLength}function oh(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function sh(e){let t=uh(),n=e.toUpperCase();return n in t?n:`_OTHER`}let ch={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},lh;function uh(){return lh===void 0&&(lh=ch),lh}let dh={"https:":`443`,"http:":`80`};function fh(e){let t=Number(e.port||dh[e.protocol]);if(t&&!isNaN(t))return t}let ph=`0.217.0`;var mh;(function(e){e.HTTP_STATUS_TEXT=`http.status_text`})(mh||(mh={}));var hh=class extends Fa{constructor(e={}){super(`@opentelemetry/instrumentation-xml-http-request`,ph,e),R(this,`component`,`xml-http-request`),R(this,`version`,ph),R(this,`moduleName`,this.component),R(this,`_tasksCount`,0),R(this,`_xhrMem`,new WeakMap),R(this,`_usedResources`,new WeakSet),R(this,`_semconvStability`,void 0),this._semconvStability=La(`http`,e==null?void 0:e.semconvStabilityOptIn)}init(){}_addHeaders(e,t){let n=vi(t).href;if(!yi(n,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};ct.inject(F.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}let r={};ct.inject(F.active(),r),Object.keys(r).forEach(t=>{e.setRequestHeader(t,String(r[t]))})}_addChildSpan(e,t){F.with(L.setSpan(F.active(),e),()=>{let e=this.tracer.startSpan(`CORS Preflight`,{startTime:t[B.FETCH_START]}),n=!(this._semconvStability&H.OLD);fi(e,t,this.getConfig().ignoreNetworkEvents,void 0,n),e.end(t[B.RESPONSE_END])})}_addFinalSpanAttributes(e,t,n){if(this._semconvStability&H.OLD){if(t.status!==void 0&&e.setAttribute(`http.status_code`,t.status),t.statusText!==void 0&&e.setAttribute(mh.HTTP_STATUS_TEXT,t.statusText),typeof n==`string`){let t=vi(n);e.setAttribute(`http.host`,t.host),e.setAttribute(`http.scheme`,t.protocol.replace(`:`,``))}e.setAttribute(`http.user_agent`,navigator.userAgent)}this._semconvStability&H.STABLE&&t.status&&e.setAttribute(on,t.status)}_applyAttributesAfterXHR(e,t){let n=this.getConfig().applyCustomAttributesOnSpan;typeof n==`function`&&Ia(()=>n(e,t),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_addResourceObserver(e,t){let n=this._xhrMem.get(e);!n||typeof PerformanceObserver!=`function`||typeof PerformanceResourceTiming!=`function`||(n.createdResources={observer:new PerformanceObserver(e=>{let r=e.getEntries(),i=vi(t);r.forEach(e=>{e.initiatorType===`xmlhttprequest`&&e.name===i.href&&n.createdResources&&n.createdResources.entries.push(e)})}),entries:[]},n.createdResources.observer.observe({entryTypes:[`resource`]}))}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(gn.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,n,r,i){if(!n||!r||!i||!e.createdResources)return;let a=e.createdResources.entries;(!a||!a.length)&&(a=gn.getEntriesByType(`resource`));let o=hi(vi(n).href,r,i,a,this._usedResources);if(o.mainRequest){let e=o.mainRequest;this._markResourceAsUsed(e);let n=o.corsPreFlightRequest;n&&(this._addChildSpan(t,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&H.OLD);fi(t,e,this.getConfig().ignoreNetworkEvents,void 0,r)}}_cleanPreviousSpanInformation(e){let t=this._xhrMem.get(e);if(t){let n=t.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(e)}}_createSpan(e,t,n){let r=vi(t);if(mr(r.href,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let i=``,a={};if(this._semconvStability&H.OLD&&(i=n.toUpperCase(),a[`http.method`]=n,a[`http.url`]=r.toString()),this._semconvStability&H.STABLE){let e=n,t=sh(n);i||(i=t),a[rn]=t,t!==e&&(a[an]=e),a[pn]=r.toString(),a[sn]=r.hostname;let o=fh(r);o&&(a[cn]=o)}let o=this.tracer.startSpan(i,{kind:Ye.CLIENT,attributes:a});return o.addEvent(eh.METHOD_OPEN),this._cleanPreviousSpanInformation(e),this._xhrMem.set(e,{span:o,spanUrl:t}),o}_markResourceAsUsed(e){this._usedResources.add(e)}_patchOpen(){return e=>{let t=this;return function(...n){if(!t._isEnabled)return e.apply(this,n);let r=n[0],i=n[1];return t._createSpan(this,i,r),e.apply(this,n)}}}_patchSend(){let e=this;function t(t,n,r,i){let a=n.callbackToRemoveEvents;typeof a==`function`&&a();let{span:o,spanUrl:s,sendStartTime:c}=n;o&&(e._findResourceAndAddNetworkEvents(n,o,s,c,r),o.addEvent(t,i),e._addFinalSpanAttributes(o,n,s),o.end(i),e._tasksCount--),e._clearResources()}function n(n,r,i,a){let o=e._xhrMem.get(r);if(!o)return;if(o.status=r.status,o.statusText=r.statusText,e._xhrMem.delete(r),o.span){let t=o.span;e._applyAttributesAfterXHR(t,r),e._semconvStability&H.STABLE&&(i?a&&(t.setStatus({code:Xe.ERROR,message:a}),t.setAttribute($t,a)):o.status&&o.status>=400&&(t.setStatus({code:Xe.ERROR}),t.setAttribute($t,String(o.status))))}let s=bn(),c=Date.now();setTimeout(()=>{t(n,o,s,c)},300)}function r(){n(eh.EVENT_ERROR,this,!0,`error`)}function i(){n(eh.EVENT_ABORT,this,!1)}function a(){n(eh.EVENT_TIMEOUT,this,!0,`timeout`)}function o(){this.status<299?n(eh.EVENT_LOAD,this,!1):n(eh.EVENT_ERROR,this,!1)}function s(t){t.removeEventListener(`abort`,i),t.removeEventListener(`error`,r),t.removeEventListener(`load`,o),t.removeEventListener(`timeout`,a);let n=e._xhrMem.get(t);n&&(n.callbackToRemoveEvents=void 0)}return t=>function(...n){if(!e._isEnabled)return t.apply(this,n);let c=e._xhrMem.get(this);if(!c)return t.apply(this,n);let l=c.span,u=c.spanUrl;if(l&&u){if(e.getConfig().measureRequestSize&&n!=null&&n[0]){let t=n[0],r=rh(t);r!==void 0&&(e._semconvStability&H.OLD&&l.setAttribute(`http.request_content_length_uncompressed`,r),e._semconvStability&H.STABLE&&l.setAttribute(`http.request.body.size`,r))}F.with(L.setSpan(F.active(),l),()=>{e._tasksCount++,c.sendStartTime=bn(),l.addEvent(eh.METHOD_SEND),this.addEventListener(`abort`,i),this.addEventListener(`error`,r),this.addEventListener(`load`,o),this.addEventListener(`timeout`,a),c.callbackToRemoveEvents=()=>{s(this),c.createdResources&&c.createdResources.observer.disconnect()},e._addHeaders(this,u),e._addResourceObserver(this,u)})}return t.apply(this,n)}}enable(){if(!this._isEnabled){if(this._isXhrPatched){this._diag.debug(`reactivating existing patch on`,this.moduleName,this.version),this._isEnabled=!0;return}try{this._diag.debug(`applying patch to`,this.moduleName,this.version),this._wrap(XMLHttpRequest.prototype,`open`,this._patchOpen()),this._wrap(XMLHttpRequest.prototype,`send`,this._patchSend()),this._isXhrPatched=!0,this._isEnabled=!0}catch(e){this._unwrap(XMLHttpRequest.prototype,`open`),this._unwrap(XMLHttpRequest.prototype,`send`),this._diag.warn(`Failed to patch globalThis.XMLHttpRequest; instrumentation will not be enabled. Another script may have locked globalThis.XMLHttpRequest via Object.defineProperty.`,e)}}}disable(){this._isEnabled&&(this._isEnabled=!1,this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}};let gh=(e={},{logManager:t,spanSessionManager:n,pageManager:r,limitManager:i})=>{var a,o,s,c,l,u,d,f,p,m;let h=[new Go(e[`session-visibility`]),new Wo(e[`session-activity`])];if((a=e.omit)!=null&&a.has(`exception`)||h.push(new oo(e.exception)),(o=e.omit)!=null&&o.has(`click`)||h.push(new io(e.click)),(s=e.omit)!=null&&s.has(`web-vital`)||h.push(new Xs(V(V({},e[`web-vital`]),{},{pageManager:r}))),(c=e.omit)!=null&&c.has(`loaf`)||h.push(new so(V({},e.loaf))),(l=e.omit)!=null&&l.has(`user-timing`)||h.push(new Yo(e[`user-timing`])),(u=e.omit)!=null&&u.has(`element-timing`)||h.push(new ao(V(V({},e[`element-timing`]),{},{limitManager:i}))),(d=e.omit)!=null&&d.has(`document-load`)||h.push(new to(e[`document-load`])),(f=e.omit)!=null&&f.has(`server-timing`)||h.push(new po(V(V({},e[`server-timing`]),{},{limitManager:i}))),!((p=e.omit)!=null&&p.has(`@opentelemetry/instrumentation-fetch`))){var g,_,v,y;h.push(new $m(V(V({},e[`@opentelemetry/instrumentation-fetch`]),{},{ignoreUrls:[...(g=(_=e.network)==null?void 0:_.ignoreUrls)==null?[]:g,...(v=(y=e[`@opentelemetry/instrumentation-fetch`])==null?void 0:y.ignoreUrls)==null?[]:v]})))}if(!((m=e.omit)!=null&&m.has(`@opentelemetry/instrumentation-xml-http-request`))){var b,x,S,C;h.push(new hh(V(V({},e[`@opentelemetry/instrumentation-xml-http-request`]),{},{ignoreUrls:[...(b=(x=e.network)==null?void 0:x.ignoreUrls)==null?[]:b,...(S=(C=e[`@opentelemetry/instrumentation-xml-http-request`])==null?void 0:C.ignoreUrls)==null?[]:S]})))}e[`empty-root`]&&h.push(new no(V({},e[`empty-root`])));for(let e of h)e instanceof Za&&(n&&e.setSessionManager(n),t&&e.setLogManager(t),i&&e.setLimitManager(i));return h},_h=e=>{if(e!==void 0){if(typeof e!=`string`)throw Error(`appID must be a string, or omitted if not using MXL. Received ${String(e)}`);return e}},vh=e=>{if(e===void 0){let e=`MXLAppVersionX.X.X`;return e===``?`unspecified`:e}if(typeof e!=`string`)throw Error(`if appVersion is specified, it must be a string. Received ${String(e)}`);let t=e.trim();if(t===``)throw Error(`if appVersion is specified, it cannot be an empty string.`);return t},yh=({appID:e,appVersion:t,resource:n=Tr(),spanExporters:r=[],logExporters:i=[],spanProcessors:a=[],propagator:o=null,defaultInstrumentationConfig:s,instrumentations:c=[],contextManager:l=null,logProcessors:u=[],attributeScrubbers:d=[],enableDefaultAttributeScrubbing:f=!0,additionalQueryParamsToScrub:p=[],logLevel:m=S.ERROR,mxlDataURL:h,mxlConfigURL:g,diagLogger:_=I.createComponentLogger({namespace:`mxl-sdk`}),dynamicSDKConfigManager:v,dynamicSDKConfig:y,registerGlobally:b=!0,blockNetworkSpanForwarding:x=!1,restrictedProtocols:C=new Set([`file:`]),useDocumentTitleAsPageLabel:w=!0,recordUserSessions:ee=!0,sessionRecorder:T,serviceName:te}={})=>{try{var E,ne;if(b){let e=Zl.registered();if(e!==null)return _.warn(`SDK has already been successfully initialized, skipping this invocation of initSDK`),e}if(I.setLogger(new re,{logLevel:m}),typeof window>`u`)return _.warn(`browser not detected, skipping initialization`),!1;let S=new wi,O=S.getNowMillis(),k=_h(e),A=vh(t),ie=k!==void 0;if(!ie&&!i.length&&!r.length)throw Error(`when appID is omitted, at least one logExporter or spanExporter must be set`);if(C.has(window.location.protocol))throw Error(`not initializing due to restricted protocol: ${window.location.protocol}`);if(ie&&typeof CompressionStream>`u`)throw Error(`CompressionStream is not supported in this browser and required for data compression.`);let ae=!b&&e,j=ae?new Si(e,window.localStorage):window.localStorage,oe=ae?new Si(e,window.sessionStorage):window.sessionStorage,M=bh({registerGlobally:b,sdkLocalStorage:j}),N=M.getMXLUserId();if(ie&&!N)throw Error(`userID is required when using MXL exporter`);let P=V({},y),se=v==null?new wo({appID:k,appVersion:A,mxlConfigURL:g,defaultConfig:P,deviceId:N,storage:j}):v;se.refreshRemoteConfig();let ce=bo({serviceName:(E=(ne=se.resolveApplicationServiceName)==null?void 0:ne.call(se,te))==null?(()=>{var e;return(te==null?void 0:te.trim())||((e=se.getConfig().serviceName)==null?void 0:e.trim())||yo})():E}).merge(n).merge(xo({diagLogger:_,appVersion:A,pageSessionStorage:oe})),le=new jo({dynamicConfigManager:se,deviceId:N,blockNetworkSpanForwarding:x});if(!le.isSDKEnabled())return _.debug(`SDK is disabled, skipping initialization.`),!1;let ue=Ci({featureManager:le,diag:_,registerGlobally:b,defaultInstrumentationConfig:s,propagator:o}),de=new Do(To),fe=[...f?Xl(p):[],...d],pe=xh({limitManager:de,registerGlobally:b,sdkLocalStorage:j,sdkSessionStorage:oe}),me,he;if(ie){var D;me=new Bl({resource:ce,exporter:new Al({appID:k,mxlDataURL:h,userID:N}),limitManager:de,storedSpansExpireTimeoutMS:s==null||(D=s[`session-visibility`])==null?void 0:D.storedSpansExpireTimeoutMS,storage:j,spanSessionManager:pe}),he=new pc(new Dl({appID:k,mxlDataURL:h,userID:N}))}let ge=wh({useDocumentTitleAsPageLabel:w,registerGlobally:b}),{tracerProvider:_e,mxlTraceManager:ve}=Sh({resource:ce,spanSessionManager:pe,userManager:M,spanExporters:r,spanProcessors:a,propagator:ue?new Kl:o,contextManager:l,attributeScrubbers:fe,registerGlobally:b,mxlSpanProcessor:me,pageManager:ge});pe.setTracerProvider(_e);let{loggerProvider:ye,mxlLogManager:be}=Ch({resource:ce,userManager:M,logExporters:i,logProcessors:u,spanSessionManager:pe,limitManager:de,attributeScrubbers:fe,registerGlobally:b,mxlLogProcessor:he,sdkLocalStorage:j,pageManager:ge});pe.startSessionSpan({reason:`init`}),Ea(b?{instrumentations:[gh(s,{spanSessionManager:pe,pageManager:ge,limitManager:de}),...c]}:{tracerProvider:_e,loggerProvider:ye,instrumentations:[gh(s,{logManager:be,spanSessionManager:pe,pageManager:ge,limitManager:de}),...c]});let xe=typeof window<`u`&&window.__MXL_DISABLE_SESSION_RECORDER===!0,Se=ie&&k&&N&&!xe?Fm({resource:ce,spanSessionManager:pe,tracerProvider:_e,appID:k,userID:N,mxlDataURL:h,recordUserSessions:ee,sessionRecorder:T}):Nm;_.info(`successfully initialized the SDK`);let Ce={setDynamicConfig:e=>{se.setConfig(e)},flush:function(){var e=z(function*(){yield _e.forceFlush(),yield ye.forceFlush()});return function(){return e.apply(this,arguments)}}(),log:be,trace:ve,session:pe,user:M,page:ge,sessionRecording:Se};return b&&Zl.register(Ce),pe.recordSDKStartupDuration(S.getNowMillis()-O),Ce}catch(e){let t=e instanceof Error?e.message:`Unknown error.`;return _.error(`failed to initialize the SDK: ${t}`),!1}},bh=({registerGlobally:e,sdkLocalStorage:t})=>{let n=new Ho({storage:t});return e&&pa.setGlobalUserManager(n),n},xh=({limitManager:e,registerGlobally:t,sdkLocalStorage:n,sdkSessionStorage:r})=>{let i=new Fo({limitManager:e,storage:n,sessionStorage:r});return t&&Qi.setGlobalSessionManager(i),i},Sh=({resource:e,spanSessionManager:t,userManager:n,spanExporters:r,spanProcessors:i=[],propagator:a=null,contextManager:o=null,attributeScrubbers:s,registerGlobally:c,mxlSpanProcessor:l,pageManager:u})=>{let d=[...i,hc(t),new Ml,new Ll,new Gl({userManager:n}),new Hl({pageManager:u}),new Ul({attributeScrubbers:s})];r==null||r.forEach(e=>{d.push(new Ur(e))}),l&&d.push(l);let f=new si({resource:e,spanProcessors:d,spanLimits:{attributeCountLimit:To.maxAllowed.session_property*2,eventCountLimit:To.maxAllowed.breadcrumb*2}}),p=new Io({tracerProvider:c?void 0:f});return c&&(oa.setGlobalTraceManager(p),f.register({contextManager:o||new ii,propagator:a})),{tracerProvider:f,mxlTraceManager:p}},Ch=({resource:e,userManager:t,logExporters:n,logProcessors:r,spanSessionManager:i,limitManager:a,attributeScrubbers:o,registerGlobally:s,mxlLogProcessor:c,sdkLocalStorage:l,pageManager:u})=>{let d=[...r,new Nl({spanSessionManager:i}),new jl,new Fl,new Wl({userManager:t}),new Pl({attributeScrubbers:o}),new Vl({pageManager:u})];n==null||n.forEach(e=>{d.push(new pc(e))}),c&&d.push(c);let f=new cc({resource:e,processors:d}),p=new ko({spanSessionManager:i,limitManager:a,loggerProvider:s?void 0:f,storage:l});return s&&(Ya.setGlobalLoggerProvider(f),Ri.setGlobalLogManager(p)),{loggerProvider:f,mxlLogManager:p}},wh=({useDocumentTitleAsPageLabel:e,registerGlobally:t})=>{let n=new Ao({useDocumentTitleAsPageLabel:e});return t&&Gi.setGlobalPageManager(n),n};return Object.defineProperty(e,`DiagLogLevel`,{enumerable:!0,get:function(){return S}}),e.attributes=ma,e.getNavigationInstrumentation=fo,e.initSDK=yh,e.log=Ri,e.page=Gi,e.session=Qi,e.trace=oa,e.user=pa,e})({});
38
+ var Bf=null;try{Bf=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function X(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}X.prototype.__isLong__,Object.defineProperty(X.prototype,`__isLong__`,{value:!0});function Vf(e){return(e&&e.__isLong__)===!0}function Hf(e){var t=Math.clz32(e&-e);return e?31-t:t}X.isLong=Vf;var Uf={},Wf={};function Gf(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=Wf[e],r)?r:(n=Z(e,0,!0),i&&(Wf[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=Uf[e],r)?r:(n=Z(e,e<0?-1:0,!1),i&&(Uf[e]=n),n))}X.fromInt=Gf;function Kf(e,t){if(isNaN(e))return t?rp:np;if(t){if(e<0)return rp;if(e>=$f)return cp}else{if(e<=-ep)return lp;if(e+1>=ep)return sp}return e<0?Kf(-e,t).neg():Z(e%Qf|0,e/Qf|0,t)}X.fromNumber=Kf;function Z(e,t,n){return new X(e,t,n)}X.fromBits=Z;var qf=Math.pow;function Jf(e,t,n){if(e.length===0)throw Error(`empty string`);if(typeof t==`number`?(n=t,t=!1):t=!!t,e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return t?rp:np;if(n=n||10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return Jf(e.substring(1),t,n).neg();for(var i=Kf(qf(n,8)),a=np,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),c=parseInt(e.substring(o,o+s),n);if(s<8){var l=Kf(qf(n,s));a=a.mul(l).add(Kf(c))}else a=a.mul(i),a=a.add(Kf(c))}return a.unsigned=t,a}X.fromString=Jf;function Yf(e,t){return typeof e==`number`?Kf(e,t):typeof e==`string`?Jf(e,t):Z(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}X.fromValue=Yf;var Xf=65536,Zf=1<<24,Qf=Xf*Xf,$f=Qf*Qf,ep=$f/2,tp=Gf(Zf),np=Gf(0);X.ZERO=np;var rp=Gf(0,!0);X.UZERO=rp;var ip=Gf(1);X.ONE=ip;var ap=Gf(1,!0);X.UONE=ap;var op=Gf(-1);X.NEG_ONE=op;var sp=Z(-1,2147483647,!1);X.MAX_VALUE=sp;var cp=Z(-1,-1,!0);X.MAX_UNSIGNED_VALUE=cp;var lp=Z(0,-2147483648,!1);X.MIN_VALUE=lp;var Q=X.prototype;Q.toInt=function(){return this.unsigned?this.low>>>0:this.low},Q.toNumber=function(){return this.unsigned?(this.high>>>0)*Qf+(this.low>>>0):this.high*Qf+(this.low>>>0)},Q.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(lp)){var t=Kf(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=Kf(qf(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),c=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return c+o;for(;c.length<6;)c=`0`+c;o=``+c+o}},Q.getHighBits=function(){return this.high},Q.getHighBitsUnsigned=function(){return this.high>>>0},Q.getLowBits=function(){return this.low},Q.getLowBitsUnsigned=function(){return this.low>>>0},Q.getNumBitsAbs=function(){if(this.isNegative())return this.eq(lp)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},Q.isSafeInteger=function(){var e=this.high>>21;return e?this.unsigned?!1:e===-1&&!(this.low===0&&this.high===-2097152):!0},Q.isZero=function(){return this.high===0&&this.low===0},Q.eqz=Q.isZero,Q.isNegative=function(){return!this.unsigned&&this.high<0},Q.isPositive=function(){return this.unsigned||this.high>=0},Q.isOdd=function(){return(this.low&1)==1},Q.isEven=function(){return(this.low&1)==0},Q.equals=function(e){return Vf(e)||(e=Yf(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},Q.eq=Q.equals,Q.notEquals=function(e){return!this.eq(e)},Q.neq=Q.notEquals,Q.ne=Q.notEquals,Q.lessThan=function(e){return this.comp(e)<0},Q.lt=Q.lessThan,Q.lessThanOrEqual=function(e){return this.comp(e)<=0},Q.lte=Q.lessThanOrEqual,Q.le=Q.lessThanOrEqual,Q.greaterThan=function(e){return this.comp(e)>0},Q.gt=Q.greaterThan,Q.greaterThanOrEqual=function(e){return this.comp(e)>=0},Q.gte=Q.greaterThanOrEqual,Q.ge=Q.greaterThanOrEqual,Q.compare=function(e){if(Vf(e)||(e=Yf(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},Q.comp=Q.compare,Q.negate=function(){return!this.unsigned&&this.eq(lp)?lp:this.not().add(ip)},Q.neg=Q.negate,Q.add=function(e){Vf(e)||(e=Yf(e));var t=this.high>>>16,n=this.high&65535,r=this.low>>>16,i=this.low&65535,a=e.high>>>16,o=e.high&65535,s=e.low>>>16,c=e.low&65535,l=0,u=0,d=0,f=0;return f+=i+c,d+=f>>>16,f&=65535,d+=r+s,u+=d>>>16,d&=65535,u+=n+o,l+=u>>>16,u&=65535,l+=t+a,l&=65535,Z(d<<16|f,l<<16|u,this.unsigned)},Q.subtract=function(e){return Vf(e)||(e=Yf(e)),this.add(e.neg())},Q.sub=Q.subtract,Q.multiply=function(e){if(this.isZero())return this;if(Vf(e)||(e=Yf(e)),Bf)return Z(Bf.mul(this.low,this.high,e.low,e.high),Bf.get_high(),this.unsigned);if(e.isZero())return this.unsigned?rp:np;if(this.eq(lp))return e.isOdd()?lp:np;if(e.eq(lp))return this.isOdd()?lp:np;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(tp)&&e.lt(tp))return Kf(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=this.high&65535,r=this.low>>>16,i=this.low&65535,a=e.high>>>16,o=e.high&65535,s=e.low>>>16,c=e.low&65535,l=0,u=0,d=0,f=0;return f+=i*c,d+=f>>>16,f&=65535,d+=r*c,u+=d>>>16,d&=65535,d+=i*s,u+=d>>>16,d&=65535,u+=n*c,l+=u>>>16,u&=65535,u+=r*s,l+=u>>>16,u&=65535,u+=i*o,l+=u>>>16,u&=65535,l+=t*c+n*s+r*o+i*a,l&=65535,Z(d<<16|f,l<<16|u,this.unsigned)},Q.mul=Q.multiply,Q.divide=function(e){if(Vf(e)||(e=Yf(e)),e.isZero())throw Error(`division by zero`);if(Bf)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:Z((this.unsigned?Bf.div_u:Bf.div_s)(this.low,this.high,e.low,e.high),Bf.get_high(),this.unsigned);if(this.isZero())return this.unsigned?rp:np;var t,n,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return rp;if(e.gt(this.shru(1)))return ap;r=rp}else{if(this.eq(lp))return e.eq(ip)||e.eq(op)?lp:e.eq(lp)?ip:(t=this.shr(1).div(e).shl(1),t.eq(np)?e.isNegative()?ip:op:(n=this.sub(e.mul(t)),r=t.add(n.div(e)),r));if(e.eq(lp))return this.unsigned?rp:np;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=np}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var i=Math.ceil(Math.log(t)/Math.LN2),a=i<=48?1:qf(2,i-48),o=Kf(t),s=o.mul(e);s.isNegative()||s.gt(n);)t-=a,o=Kf(t,this.unsigned),s=o.mul(e);o.isZero()&&(o=ip),r=r.add(o),n=n.sub(s)}return r},Q.div=Q.divide,Q.modulo=function(e){return Vf(e)||(e=Yf(e)),Bf?Z((this.unsigned?Bf.rem_u:Bf.rem_s)(this.low,this.high,e.low,e.high),Bf.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},Q.mod=Q.modulo,Q.rem=Q.modulo,Q.not=function(){return Z(~this.low,~this.high,this.unsigned)},Q.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},Q.clz=Q.countLeadingZeros,Q.countTrailingZeros=function(){return this.low?Hf(this.low):Hf(this.high)+32},Q.ctz=Q.countTrailingZeros,Q.and=function(e){return Vf(e)||(e=Yf(e)),Z(this.low&e.low,this.high&e.high,this.unsigned)},Q.or=function(e){return Vf(e)||(e=Yf(e)),Z(this.low|e.low,this.high|e.high,this.unsigned)},Q.xor=function(e){return Vf(e)||(e=Yf(e)),Z(this.low^e.low,this.high^e.high,this.unsigned)},Q.shiftLeft=function(e){return Vf(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?Z(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):Z(0,this.low<<e-32,this.unsigned)},Q.shl=Q.shiftLeft,Q.shiftRight=function(e){return Vf(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?Z(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):Z(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},Q.shr=Q.shiftRight,Q.shiftRightUnsigned=function(e){return Vf(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?Z(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):Z(e===32?this.high:this.high>>>e-32,0,this.unsigned)},Q.shru=Q.shiftRightUnsigned,Q.shr_u=Q.shiftRightUnsigned,Q.rotateLeft=function(e){var t;return Vf(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?Z(this.high,this.low,this.unsigned):e<32?(t=32-e,Z(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(e-=32,t=32-e,Z(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},Q.rotl=Q.rotateLeft,Q.rotateRight=function(e){var t;return Vf(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?Z(this.high,this.low,this.unsigned):e<32?(t=32-e,Z(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(e-=32,t=32-e,Z(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},Q.rotr=Q.rotateRight,Q.toSigned=function(){return this.unsigned?Z(this.low,this.high,!1):this},Q.toUnsigned=function(){return this.unsigned?this:Z(this.low,this.high,!0)},Q.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},Q.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},Q.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},X.fromBytes=function(e,t,n){return n?X.fromBytesLE(e,t):X.fromBytesBE(e,t)},X.fromBytesLE=function(e,t){return new X(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},X.fromBytesBE=function(e,t){return new X(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},typeof BigInt==`function`&&(X.fromBigInt=function(e,t){return Z(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},X.fromValue=function(e,t){return typeof e==`bigint`?X.fromBigInt(e,t):Yf(e,t)},Q.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e});var up=s(((e,t)=>{t.exports=n;function n(e,t){for(var n=Array(arguments.length-1),r=0,i=2,a=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise(function(i,o){n[r]=function(e){if(a)if(a=!1,e)o(e);else{for(var t=Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){a&&(a=!1,o(e))}})}})),dp=s((e=>{var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(;t>0&&e.charAt(t-1)===`=`;)--t;return Math.floor(t*3/4)};for(var n=Array(64),r=Array(123),i=0;i<64;)r[n[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;r[45]=62,r[95]=63,t.encode=function(e,t,r){for(var i=null,a=[],o=0,s=0,c;t<r;){var l=e[t++];switch(s){case 0:a[o++]=n[l>>2],c=(l&3)<<4,s=1;break;case 1:a[o++]=n[c|l>>4],c=(l&15)<<2,s=2;break;case 2:a[o++]=n[c|l>>6],a[o++]=n[l&63],s=0;break}o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),o=0)}return s&&(a[o++]=n[c],a[o++]=61,s===1&&(a[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join(``)):String.fromCharCode.apply(String,a.slice(0,o))};var a=`invalid encoding`;t.decode=function(e,t,n){for(var i=n,o=0,s,c=0;c<e.length;){var l=e.charCodeAt(c++);if(l===61&&o>1)break;if((l=r[l])===void 0)throw Error(a);switch(o){case 0:s=l,o=1;break;case 1:t[n++]=s<<2|(l&48)>>4,s=l,o=2;break;case 2:t[n++]=(s&15)<<4|(l&60)>>2,s=l,o=3;break;case 3:t[n++]=(s&3)<<6|l,o=0;break}}if(o===1)throw Error(a);return n-i};var o=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,s=/[-_]/,c=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;t.test=function(e){return o.test(e)||s.test(e)&&c.test(e)}})),fp=s(((e,t)=>{t.exports=n;function n(){this._listeners=Object.create(null)}n.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},n.prototype.off=function(e,t){if(e===void 0)this._listeners=Object.create(null);else if(t===void 0)this._listeners[e]=[];else{var n=this._listeners[e];if(!n)return this;for(var r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r}return this},n.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}})),pp=s(((e,t)=>{t.exports=n(n);function n(e){return typeof Float32Array<`u`?(function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=n[3]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function a(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}e.writeFloatLE=r?i:a,e.writeFloatBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.readFloatLE=r?o:s,e.readFloatBE=r?s:o})():(function(){function t(e,t,n,r){var i=+(t<0);if(i&&(t=-t),t===0)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var a=Math.floor(Math.log(t)/Math.LN2),o=Math.round(t*Math.pow(2,-a)*8388608)&8388607;e((i<<31|a+127<<23|o)>>>0,n,r)}}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,i);function n(e,t,n){var r=e(t,n),i=(r>>31)*2+1,a=r>>>23&255,o=r&8388607;return a===255?o?NaN:i*(1/0):a===0?i*1401298464324817e-60*o:i*Math.pow(2,a-150)*(o+8388608)}e.readFloatLE=n.bind(null,a),e.readFloatBE=n.bind(null,o)})(),typeof Float64Array<`u`?(function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=n[7]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function a(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}e.writeDoubleLE=r?i:a,e.writeDoubleBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.readDoubleLE=r?o:s,e.readDoubleBE=r?s:o})():(function(){function t(e,t,n,r,i,a){var o=+(r<0);if(o&&(r=-r),r===0)e(0,i,a+t),e(1/r>0?0:2147483648,i,a+n);else if(isNaN(r))e(0,i,a+t),e(2146959360,i,a+n);else if(r>17976931348623157e292)e(0,i,a+t),e((o<<31|2146435072)>>>0,i,a+n);else{var s;if(r<22250738585072014e-324)s=r/5e-324,e(s>>>0,i,a+t),e((o<<31|s/4294967296)>>>0,i,a+n);else{var c=Math.floor(Math.log(r)/Math.LN2);c===1024&&(c=1023),s=r*Math.pow(2,-c),e(s*4503599627370496>>>0,i,a+t),e((o<<31|c+1023<<20|s*1048576&1048575)>>>0,i,a+n)}}}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,i,4,0);function n(e,t,n,r,i){var a=e(r,i+t),o=e(r,i+n),s=(o>>31)*2+1,c=o>>>20&2047,l=4294967296*(o&1048575)+a;return c===2047?l?NaN:s*(1/0):c===0?s*5e-324*l:s*Math.pow(2,c-1075)*(l+4503599627370496)}e.readDoubleLE=n.bind(null,a,0,4),e.readDoubleBE=n.bind(null,o,4,0)})(),e}function r(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function i(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=e&255}function a(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}})),mp=s(((e,t)=>{t.exports=n;function n(e){try{if(typeof require!=`function`)return null;var t=require(e);return t&&(t.length||Object.keys(t).length)?t:null}catch(e){return null}}})),hp=s((e=>{var t=e,n=`�`;t.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:(n&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320?(++r,t+=4):t+=3;return t};function r(e,t,r,i){for(var a=t;a<r;){var o=e[a++];if(o<=127)i+=String.fromCharCode(o);else if(o>=192&&o<224){var s=(o&31)<<6|e[a++]&63;i+=s>=128?String.fromCharCode(s):n}else if(o>=224&&o<240){var c=(o&15)<<12|(e[a++]&63)<<6|e[a++]&63;i+=c>=2048?String.fromCharCode(c):n}else if(o>=240){var l=(o&7)<<18|(e[a++]&63)<<12|(e[a++]&63)<<6|e[a++]&63;l<65536||l>1114111?i+=n:(l-=65536,i+=String.fromCharCode(55296+(l>>10)),i+=String.fromCharCode(56320+(l&1023)))}}return i}t.read=function(e,t,n){if(n-t<1)return``;for(var i=``,a=t,o,s,c,l,u,d,f,p;a+7<n;a+=8){if(o=e[a],s=e[a+1],c=e[a+2],l=e[a+3],u=e[a+4],d=e[a+5],f=e[a+6],p=e[a+7],(o|s|c|l|u|d|f|p)&128)return r(e,a,n,i);i+=String.fromCharCode(o,s,c,l,u,d,f,p)}for(;a<n;++a){if(o=e[a],o&128)return r(e,a,n,i);i+=String.fromCharCode(o)}return i},t.write=function(e,t,n){for(var r=n,i,a,o=0;o<e.length;++o)i=e.charCodeAt(o),i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&((a=e.charCodeAt(o+1))&64512)==56320?(i=65536+((i&1023)<<10)+(a&1023),++o,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128);return n-r}})),gp=s(((e,t)=>{t.exports=n;function n(e,t,n){var r=n||8192,i=r>>>1,a=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(a=e(r),o=0);var s=t.call(a,o,o+=n);return o&7&&(o=(o|7)+1),s}}})),_p=s(((e,t)=>{t.exports=r;var n=yp();function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=r.zero=new r(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=r.zeroHash=`\0\0\0\0\0\0\0\0`;r.fromNumber=function(e){if(e===0)return i;var t=e<0;t&&(e=-e);var n=e>>>0,a=(e-n)/4294967296>>>0;return t&&(a=~a>>>0,n=~n>>>0,++n>4294967295&&(n=0,++a>4294967295&&(a=0))),new r(n,a)},r.from=function(e){if(typeof e==`number`)return r.fromNumber(e);if(n.isString(e))if(n.Long)e=n.Long.fromString(e);else return r.fromNumber(parseInt(e,10));return e.low||e.high?new r(e.low>>>0,e.high>>>0):i},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(e){return n.Long?new n.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var o=String.prototype.charCodeAt;r.fromHash=function(e){return e===a?i:new r((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}})),vp=s(((e,t)=>{(function(n,r){function i(e){return e.default||e}typeof define==`function`&&define.amd?define([],function(){var e={};return r(e),i(e)}):typeof e==`object`?(r(e),typeof t==`object`&&(t.exports=i(e))):(function(){var e={};r(e),n.Long=i(e)})()})(typeof globalThis<`u`?globalThis:typeof self<`u`?self:e,function(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.default=void 0;
39
+ /**
40
+ * @license
41
+ * Copyright 2009 The Closure Library Authors
42
+ * Copyright 2020 Daniel Wirtz / The long.js Authors.
43
+ *
44
+ * Licensed under the Apache License, Version 2.0 (the "License");
45
+ * you may not use this file except in compliance with the License.
46
+ * You may obtain a copy of the License at
47
+ *
48
+ * http://www.apache.org/licenses/LICENSE-2.0
49
+ *
50
+ * Unless required by applicable law or agreed to in writing, software
51
+ * distributed under the License is distributed on an "AS IS" BASIS,
52
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53
+ * See the License for the specific language governing permissions and
54
+ * limitations under the License.
55
+ *
56
+ * SPDX-License-Identifier: Apache-2.0
57
+ */
58
+ var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}n.prototype.__isLong__,Object.defineProperty(n.prototype,`__isLong__`,{value:!0});function r(e){return(e&&e.__isLong__)===!0}function i(e){var t=Math.clz32(e&-e);return e?31-t:t}n.isLong=r;var a={},o={};function s(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=o[e],r)?r:(n=l(e,0,!0),i&&(o[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=a[e],r)?r:(n=l(e,e<0?-1:0,!1),i&&(a[e]=n),n))}n.fromInt=s;function c(e,t){if(isNaN(e))return t?b:y;if(t){if(e<0)return b;if(e>=g)return ee}else{if(e<=-_)return T;if(e+1>=_)return w}return e<0?c(-e,t).neg():l(e%h|0,e/h|0,t)}n.fromNumber=c;function l(e,t,r){return new n(e,t,r)}n.fromBits=l;var u=Math.pow;function d(e,t,n){if(e.length===0)throw Error(`empty string`);if(typeof t==`number`?(n=t,t=!1):t=!!t,e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return t?b:y;if(n=n||10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return d(e.substring(1),t,n).neg();for(var i=c(u(n,8)),a=y,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=parseInt(e.substring(o,o+s),n);if(s<8){var f=c(u(n,s));a=a.mul(f).add(c(l))}else a=a.mul(i),a=a.add(c(l))}return a.unsigned=t,a}n.fromString=d;function f(e,t){return typeof e==`number`?c(e,t):typeof e==`string`?d(e,t):l(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}n.fromValue=f;var p=65536,m=1<<24,h=p*p,g=h*h,_=g/2,v=s(m),y=s(0);n.ZERO=y;var b=s(0,!0);n.UZERO=b;var x=s(1);n.ONE=x;var S=s(1,!0);n.UONE=S;var C=s(-1);n.NEG_ONE=C;var w=l(-1,2147483647,!1);n.MAX_VALUE=w;var ee=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=ee;var T=l(0,-2147483648,!1);n.MIN_VALUE=T;var E=n.prototype;E.toInt=function(){return this.unsigned?this.low>>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},E.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(T)){var t=c(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=c(u(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),l=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return l+o;for(;l.length<6;)l=`0`+l;o=``+l+o}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},E.isSafeInteger=function(){var e=this.high>>21;return e?this.unsigned?!1:e===-1&&!(this.low===0&&this.high===-2097152):!0},E.isZero=function(){return this.high===0&&this.low===0},E.eqz=E.isZero,E.isNegative=function(){return!this.unsigned&&this.high<0},E.isPositive=function(){return this.unsigned||this.high>=0},E.isOdd=function(){return(this.low&1)==1},E.isEven=function(){return(this.low&1)==0},E.equals=function(e){return r(e)||(e=f(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},E.eq=E.equals,E.notEquals=function(e){return!this.eq(e)},E.neq=E.notEquals,E.ne=E.notEquals,E.lessThan=function(e){return this.comp(e)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(e){return this.comp(e)<=0},E.lte=E.lessThanOrEqual,E.le=E.lessThanOrEqual,E.greaterThan=function(e){return this.comp(e)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(e){return this.comp(e)>=0},E.gte=E.greaterThanOrEqual,E.ge=E.greaterThanOrEqual,E.compare=function(e){if(r(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(x)},E.neg=E.negate,E.add=function(e){r(e)||(e=f(e));var t=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=e.high>>>16,s=e.high&65535,c=e.low>>>16,u=e.low&65535,d=0,p=0,m=0,h=0;return h+=a+u,m+=h>>>16,h&=65535,m+=i+c,p+=m>>>16,m&=65535,p+=n+s,d+=p>>>16,p&=65535,d+=t+o,d&=65535,l(m<<16|h,d<<16|p,this.unsigned)},E.subtract=function(e){return r(e)||(e=f(e)),this.add(e.neg())},E.sub=E.subtract,E.multiply=function(e){if(this.isZero())return this;if(r(e)||(e=f(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return this.unsigned?b:y;if(this.eq(T))return e.isOdd()?T:y;if(e.eq(T))return this.isOdd()?T:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(v)&&e.lt(v))return c(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=e.high>>>16,u=e.high&65535,d=e.low>>>16,p=e.low&65535,m=0,h=0,g=0,_=0;return _+=o*p,g+=_>>>16,_&=65535,g+=a*p,h+=g>>>16,g&=65535,g+=o*d,h+=g>>>16,g&=65535,h+=i*p,m+=h>>>16,h&=65535,h+=a*d,m+=h>>>16,h&=65535,h+=o*u,m+=h>>>16,h&=65535,m+=n*p+i*d+a*u+o*s,m&=65535,l(g<<16|_,m<<16|h,this.unsigned)},E.mul=E.multiply,E.divide=function(e){if(r(e)||(e=f(e)),e.isZero())throw Error(`division by zero`);if(t)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(this.isZero())return this.unsigned?b:y;var n,i,a;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return S;a=b}else{if(this.eq(T))return e.eq(x)||e.eq(C)?T:e.eq(T)?x:(n=this.shr(1).div(e).shl(1),n.eq(y)?e.isNegative()?x:C:(i=this.sub(e.mul(n)),a=n.add(i.div(e)),a));if(e.eq(T))return this.unsigned?b:y;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=y}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),s=o<=48?1:u(2,o-48),d=c(n),p=d.mul(e);p.isNegative()||p.gt(i);)n-=s,d=c(n,this.unsigned),p=d.mul(e);d.isZero()&&(d=x),a=a.add(d),i=i.sub(p)}return a},E.div=E.divide,E.modulo=function(e){return r(e)||(e=f(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},E.mod=E.modulo,E.rem=E.modulo,E.not=function(){return l(~this.low,~this.high,this.unsigned)},E.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},E.clz=E.countLeadingZeros,E.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},E.ctz=E.countTrailingZeros,E.and=function(e){return r(e)||(e=f(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},E.or=function(e){return r(e)||(e=f(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},E.xor=function(e){return r(e)||(e=f(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},E.shiftLeft=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},E.shl=E.shiftLeft,E.shiftRight=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):l(e===32?this.high:this.high>>>e-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.shr_u=E.shiftRightUnsigned,E.rotateLeft=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(e-=32,t=32-e,l(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},E.rotl=E.rotateLeft,E.rotateRight=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(e-=32,t=32-e,l(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},E.rotr=E.rotateRight,E.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},E.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},E.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},typeof BigInt==`function`&&(n.fromBigInt=function(e,t){return l(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},n.fromValue=function(e,t){return typeof e==`bigint`?n.fromBigInt(e,t):f(e,t)},E.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e}),e.default=n})})),yp=s((e=>{var t=e;t.asPromise=up(),t.base64=dp(),t.EventEmitter=fp(),t.float=pp(),t.inquire=mp(),t.utf8=hp(),t.pool=gp(),t.LongBits=_p();function n(e){return e===`__proto__`||e===`prototype`||e===`constructor`}t.isUnsafeProperty=n,t.isNode=!!(typeof global<`u`&&global&&global.process&&global.process.versions&&global.process.versions.node),t.global=t.isNode&&global||typeof window<`u`&&window||typeof self<`u`&&self||e,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return typeof e==`string`||e instanceof String},t.isObject=function(e){return e&&typeof e==`object`},t.isset=t.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!=`object`||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},t.Buffer=(function(){try{var e=t.global.Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return typeof e==`number`?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):typeof Uint8Array>`u`?e:new Uint8Array(e)},t.Array=typeof Uint8Array<`u`?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||(function(){try{var e=vp();return e&&e.isLong?e:null}catch(e){return null}})(),t.key2Re=/^(?:true|false|0|1)$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(!!n)},t.longFromKey=function(e,n){return t.key64Re.test(e)&&!t.key32Re.test(e)?t.longFromHash(e,n):e},t.boolFromKey=function(e){return e===`true`||e===`1`};function r(e){var t=typeof arguments[arguments.length-1]==`boolean`,r=t?arguments.length-1:arguments.length;t=t&&arguments[arguments.length-1];for(var i=1;i<r;++i){var a=arguments[i];if(a)for(var o=Object.keys(a),s=0;s<o.length;++s)!n(o[s])&&(e[o[s]]===void 0||!t)&&(e[o[s]]=a[o[s]])}return e}t.merge=r,t.nestingLimit=32,t.recursionLimit=100,t.makeProp=function(e,t,n){Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:n===void 0?!0:n,configurable:!0,writable:!0})},t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function i(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,`message`,{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,`stack`,{value:Error().stack||``}),n&&r(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+`: `+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}t.newError=i,t.ProtocolError=i(`ProtocolError`),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(t[e[n]]===1&&this[e[n]]!==void 0&&this[e[n]]!==null)return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;if(!e){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}})),bp=s(((e,t)=>{t.exports=u;var n=yp(),r,i=n.LongBits,a=n.base64,o=n.utf8;function s(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function u(){this.len=0,this.head=new s(c,0,0),this.tail=this.head,this.states=null}var d=function(){return n.Buffer?function(){return(u.create=function(){return new r})()}:function(){return new u}};u.create=d(),u.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(e,t,n){return this.tail=this.tail.next=new s(e,t,n),this.len+=t,this};function f(e,t,n){t[n]=e&255}function p(e,t,n){for(var r=0;r<e.length;)t[n++]=e.charCodeAt(r++)}function m(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function h(e,t){this.len=e,this.next=void 0,this.val=t}h.prototype=Object.create(s.prototype),h.prototype.fn=m,u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new h((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},u.prototype.int32=function(e){return(e|=0)<0?this._push(g,10,i.fromNumber(e)):this.uint32(e)},u.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function g(e,t,n){for(var r=e.lo,i=e.hi;i;)t[n++]=r&127|128,r=(r>>>7|i<<25)>>>0,i>>>=7;for(;r>127;)t[n++]=r&127|128,r>>>=7;t[n++]=r}u.prototype.uint64=function(e){var t=i.from(e);return this._push(g,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(g,t.length(),t)},u.prototype.bool=function(e){return this._push(f,1,+!!e)};function _(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}u.prototype.fixed32=function(e){return this._push(_,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=i.from(e);return this._push(_,4,t.lo)._push(_,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var v=n.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};u.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(n.isString(e)){var r=u.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(v,t,e)},u.prototype.raw=function(e){var t=e.length>>>0;return t?this._push(v,t,e):this},u.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(t===e.length?p:o.write,t,e):this._push(f,1,0)},u.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new s(c,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new s(c,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},u.prototype.finish=function(){return this.finishInto(this.constructor.alloc(this.len),0)},u.prototype.finishInto=function(e,t){t===void 0&&(t=0);for(var n=this.head.next,r=t;n;)n.fn(n.val,e,r),r+=n.len,n=n.next;return e},u._configure=function(e){r=e,u.create=d(),r._configure()}})),xp=s(((e,t)=>{t.exports=i;var n=bp();(i.prototype=Object.create(n.prototype)).constructor=i;var r=yp();function i(){n.call(this)}i._configure=function(){i.alloc=r._Buffer_allocUnsafe,i.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name===`set`?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},i.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,`base64`));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.raw=function(e){var t=e.length>>>0;return t?this._push(i.writeBytesBuffer,t,e):this};function a(e,t,n){for(var r=0;r<e.length;)t[n++]=e.charCodeAt(r++)}function o(e,t,n){e.length<40?r.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}i.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(t===e.length&&t<40?a:o,t,e),this},i._configure()})),Sp=s(((e,t)=>{t.exports=s;var n=yp(),r,i=n.LongBits,a=n.utf8;function o(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}function s(e){this.buf=e,this.pos=0,this.len=e.length}var c=typeof Uint8Array<`u`?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new s(e);throw Error(`illegal buffer`)}:function(e){if(Array.isArray(e))return new s(e);throw Error(`illegal buffer`)},l=function(){return n.Buffer?function(e){return(s.create=function(e){return n.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};s.create=l(),s.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,s.prototype.raw=function(e,t){return Array.isArray(this.buf)?this.buf.slice(e,t):e===t?new this.buf.constructor(0):this._slice.call(this.buf,e,t)},s.prototype.uint32=function(){var e=this.buf,t=this.pos,n=(e[t]&127)>>>0;if(e[t++]<128||(n=(n|(e[t]&127)<<7)>>>0,e[t++]<128)||(n=(n|(e[t]&127)<<14)>>>0,e[t++]<128)||(n=(n|(e[t]&127)<<21)>>>0,e[t++]<128)||(n=(n|(e[t]&15)<<28)>>>0,e[t++]<128))return this.pos=t,n;for(var r=0;r<5;++r){if(t>=this.len)throw this.pos=t,o(this);if(e[t++]<128)return this.pos=t,n}throw this.pos=t,Error(`invalid varint encoding`)},s.prototype.tag=function(){var e=this.buf,t=this.pos,n=(e[t]&127)>>>0;if(e[t++]<128||(n=(n|(e[t]&127)<<7)>>>0,e[t++]<128)||(n=(n|(e[t]&127)<<14)>>>0,e[t++]<128)||(n=(n|(e[t]&127)<<21)>>>0,e[t++]<128))return this.pos=t,n;if(n=(n|(e[t]&15)<<28)>>>0,e[t]<128&&!(e[t]&112))return this.pos=t+1,n;throw this.pos=t+1,Error(`invalid tag encoding`)},s.prototype.int32=function(){return this.uint32()|0},s.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function u(){var e=new i(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(`invalid varint encoding`)}s.prototype.bool=function(){for(var e=!1,t,n=0;n<10;++n){if(this.pos>=this.len)throw o(this);if(t=this.buf[this.pos++],t&127&&(e=!0),t<128)return e}throw Error(`invalid varint encoding`)};function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}s.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)|0};function f(){if(this.pos+8>this.len)throw o(this,8);return new i(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}s.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},s.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},s.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);return this.pos=n,this.raw(t,n)},s.prototype.string=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);return this.pos=n,a.read(this.buf,t,n)},s.prototype.skip=function(e){if(typeof e==`number`){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do if(this.pos>=this.len)throw o(this);while(this.buf[this.pos++]&128);return this},s.recursionLimit=n.recursionLimit,s.prototype.skipType=function(e,t,n){if(t===void 0&&(t=0),t>s.recursionLimit)throw Error(`max depth exceeded`);if(n===0)throw Error(`illegal tag: field number 0`);switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var r=this.tag(),i=r>>>3;if(e=r&7,!i)throw Error(`illegal tag: field number 0`);if(e===4){if(n!==void 0&&i!==n)throw Error(`invalid end group tag`);break}this.skipType(e,t+1,i)}break;case 5:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this},s._configure=function(e){r=e,s.create=l(),r._configure();var t=n.Long?`toLong`:`toNumber`;n.merge(s.prototype,{int64:function(){return u.call(this)[t](!1)},uint64:function(){return u.call(this)[t](!0)},sint64:function(){return u.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}})),Cp=s(((e,t)=>{t.exports=i;var n=Sp();(i.prototype=Object.create(n.prototype)).constructor=i;var r=yp();function i(e){n.call(this,e)}i._configure=function(){r.Buffer&&(i.prototype._slice=r.Buffer.prototype.slice)},i.prototype.raw=function(e,t){return e===t?r.Buffer.alloc(0):this._slice.call(this.buf,e,t)},i.prototype.string=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw RangeError(`index out of range: `+this.pos+` + `+e+` > `+this.len);return this.pos=n,this.buf.utf8Slice?this.buf.utf8Slice(t,n):this.buf.toString(`utf-8`,t,n)},i._configure()})),wp=s(((e,t)=>{t.exports=r;var n=yp();(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r;function r(e,t,r){if(typeof e!=`function`)throw TypeError(`rpcImpl must be a function`);n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}r.prototype.rpcCall=function e(t,r,i,a,o){if(!a)throw TypeError(`request must be specified`);var s=this;if(!o)return n.asPromise(e,s,t,r,i,a);if(!s.rpcImpl){setTimeout(function(){o(Error(`already ended`))},0);return}try{return s.rpcImpl(t,r[s.requestDelimited?`encodeDelimited`:`encode`](a).finish(),function(e,n){if(e)return s.emit(`error`,e,t),o(e);if(n===null){s.end(!0);return}if(!(n instanceof i))try{n=i[s.responseDelimited?`decodeDelimited`:`decode`](n)}catch(e){return s.emit(`error`,e,t),o(e)}return s.emit(`data`,n,t),o(null,n)})}catch(e){s.emit(`error`,e,t),setTimeout(function(){o(e)},0);return}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(`end`).off()),this}})),Tp=s((e=>{var t=e;t.Service=wp()})),Ep=s(((e,t)=>{t.exports={}})),Dp=s((e=>{var t=e;t.build=`minimal`,t.Writer=bp(),t.BufferWriter=xp(),t.Reader=Sp(),t.BufferReader=Cp(),t.util=yp(),t.rpc=Tp(),t.roots=Ep(),t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})),$=l(s(((e,t)=>{t.exports=Dp()}))(),1);let Op=[`resource`,`getSessionId`,`tracer`,`url`,`debug`,`apiKey`,`headers`];var kp=class{constructor(e,t){z(this,`logs`,[]),z(this,`scheduledDelayMillis`,void 0),z(this,`timeout`,void 0),z(this,`exporter`,void 0),z(this,`lastBatchSent`,0),this.scheduledDelayMillis=(t==null?void 0:t.scheduledDelayMillis)||5e3,this.exporter=e,typeof window<`u`&&window.addEventListener(`unload`,()=>{this._flushAll()})}onLog(e){this.logs.push(e),this.timeout===void 0&&(this.timeout=setTimeout(()=>{this.timeout=void 0,this._flushAll()},this.scheduledDelayMillis))}_flushAll(){this.lastBatchSent=Date.now(),I.with(jt(I.active()),()=>{let e=this.logs.splice(0,this.logs.length);this.exporter.export(e)})}};function Ap(e,t,n){return{body:e,timeUnixNano:t,attributes:n}}function jp(){return Reflect.get(globalThis,`Buffer`)||void 0}function Mp(e){let t=jp();if(t)return Uint8Array.from(t.from(e,`base64`));let n=globalThis.atob(e),r=new Uint8Array(n.length);for(let e=0;e<n.length;++e)r[e]=n.charCodeAt(e);return r}function Np(e){let t=jp();if(t)return t.from(e).toString(`base64`);let n=[];return e.forEach(e=>{n.push(globalThis.String.fromCharCode(e))}),globalThis.btoa(n.join(``))}function Pp(){return{stringValue:void 0,boolValue:void 0,intValue:void 0,doubleValue:void 0,arrayValue:void 0,kvlistValue:void 0,bytesValue:void 0}}let Fp={encode(e,t=$.default.Writer.create()){return e.stringValue!==void 0&&t.uint32(10).string(e.stringValue),e.boolValue!==void 0&&t.uint32(16).bool(e.boolValue),e.intValue!==void 0&&t.uint32(24).int64(e.intValue),e.doubleValue!==void 0&&t.uint32(33).double(e.doubleValue),e.arrayValue!==void 0&&Lp.encode(e.arrayValue,t.uint32(42).fork()).ldelim(),e.kvlistValue!==void 0&&zp.encode(e.kvlistValue,t.uint32(50).fork()).ldelim(),e.bytesValue!==void 0&&t.uint32(58).bytes(e.bytesValue),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Pp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.stringValue=n.string();continue;case 2:if(e!==16)break;i.boolValue=n.bool();continue;case 3:if(e!==24)break;i.intValue=Kp(n.int64());continue;case 4:if(e!==33)break;i.doubleValue=n.double();continue;case 5:if(e!==42)break;i.arrayValue=Lp.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.kvlistValue=zp.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.bytesValue=n.bytes();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{stringValue:qp(e.stringValue)?globalThis.String(e.stringValue):void 0,boolValue:qp(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,intValue:qp(e.intValue)?globalThis.Number(e.intValue):void 0,doubleValue:qp(e.doubleValue)?globalThis.Number(e.doubleValue):void 0,arrayValue:qp(e.arrayValue)?Lp.fromJSON(e.arrayValue):void 0,kvlistValue:qp(e.kvlistValue)?zp.fromJSON(e.kvlistValue):void 0,bytesValue:qp(e.bytesValue)?Mp(e.bytesValue):void 0}},toJSON(e){let t={};return e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.intValue!==void 0&&(t.intValue=Math.round(e.intValue)),e.doubleValue!==void 0&&(t.doubleValue=e.doubleValue),e.arrayValue!==void 0&&(t.arrayValue=Lp.toJSON(e.arrayValue)),e.kvlistValue!==void 0&&(t.kvlistValue=zp.toJSON(e.kvlistValue)),e.bytesValue!==void 0&&(t.bytesValue=Np(e.bytesValue)),t},create(e){return Fp.fromPartial(e==null?{}:e)},fromPartial(e){var t,n,r,i,a;let o=Pp();return o.stringValue=(t=e.stringValue)==null?void 0:t,o.boolValue=(n=e.boolValue)==null?void 0:n,o.intValue=(r=e.intValue)==null?void 0:r,o.doubleValue=(i=e.doubleValue)==null?void 0:i,o.arrayValue=e.arrayValue!==void 0&&e.arrayValue!==null?Lp.fromPartial(e.arrayValue):void 0,o.kvlistValue=e.kvlistValue!==void 0&&e.kvlistValue!==null?zp.fromPartial(e.kvlistValue):void 0,o.bytesValue=(a=e.bytesValue)==null?void 0:a,o}};function Ip(){return{values:[]}}let Lp={encode(e,t=$.default.Writer.create()){if(e.values!==void 0&&e.values.length!==0)for(let n of e.values)Fp.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Ip();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.values.push(Fp.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e==null?void 0:e.values)?e.values.map(e=>Fp.fromJSON(e)):[]}},toJSON(e){var t;let n={};return(t=e.values)!=null&&t.length&&(n.values=e.values.map(e=>Fp.toJSON(e))),n},create(e){return Lp.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=Ip();return n.values=((t=e.values)==null?void 0:t.map(e=>Fp.fromPartial(e)))||[],n}};function Rp(){return{values:[]}}let zp={encode(e,t=$.default.Writer.create()){if(e.values!==void 0&&e.values.length!==0)for(let n of e.values)Vp.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Rp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.values.push(Vp.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{values:globalThis.Array.isArray(e==null?void 0:e.values)?e.values.map(e=>Vp.fromJSON(e)):[]}},toJSON(e){var t;let n={};return(t=e.values)!=null&&t.length&&(n.values=e.values.map(e=>Vp.toJSON(e))),n},create(e){return zp.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=Rp();return n.values=((t=e.values)==null?void 0:t.map(e=>Vp.fromPartial(e)))||[],n}};function Bp(){return{key:``,value:void 0}}let Vp={encode(e,t=$.default.Writer.create()){return e.key!==void 0&&e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&Fp.encode(e.value,t.uint32(18).fork()).ldelim(),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Bp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=Fp.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{key:qp(e.key)?globalThis.String(e.key):``,value:qp(e.value)?Fp.fromJSON(e.value):void 0}},toJSON(e){let t={};return e.key!==void 0&&e.key!==``&&(t.key=e.key),e.value!==void 0&&(t.value=Fp.toJSON(e.value)),t},create(e){return Vp.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=Bp();return n.key=(t=e.key)==null?``:t,n.value=e.value!==void 0&&e.value!==null?Fp.fromPartial(e.value):void 0,n}};function Hp(){return{name:``,version:``}}let Up={encode(e,t=$.default.Writer.create()){return e.name!==void 0&&e.name!==``&&t.uint32(10).string(e.name),e.version!==void 0&&e.version!==``&&t.uint32(18).string(e.version),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Hp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.version=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{name:qp(e.name)?globalThis.String(e.name):``,version:qp(e.version)?globalThis.String(e.version):``}},toJSON(e){let t={};return e.name!==void 0&&e.name!==``&&(t.name=e.name),e.version!==void 0&&e.version!==``&&(t.version=e.version),t},create(e){return Up.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=Hp();return r.name=(t=e.name)==null?``:t,r.version=(n=e.version)==null?``:n,r}};function Wp(){return{name:``,version:``}}let Gp={encode(e,t=$.default.Writer.create()){return e.name!==void 0&&e.name!==``&&t.uint32(10).string(e.name),e.version!==void 0&&e.version!==``&&t.uint32(18).string(e.version),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Wp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.version=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{name:qp(e.name)?globalThis.String(e.name):``,version:qp(e.version)?globalThis.String(e.version):``}},toJSON(e){let t={};return e.name!==void 0&&e.name!==``&&(t.name=e.name),e.version!==void 0&&e.version!==``&&(t.version=e.version),t},create(e){return Gp.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=Wp();return r.name=(t=e.name)==null?``:t,r.version=(n=e.version)==null?``:n,r}};function Kp(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);return e.toNumber()}$.default.util.Long!==X&&($.default.util.Long=X,$.default.configure());function qp(e){return e!=null}function Jp(){return{attributes:[],droppedAttributesCount:0}}let Yp={encode(e,t=$.default.Writer.create()){if(e.attributes!==void 0&&e.attributes.length!==0)for(let n of e.attributes)Vp.encode(n,t.uint32(10).fork()).ldelim();return e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&t.uint32(16).uint32(e.droppedAttributesCount),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=Jp();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.attributes.push(Vp.decode(n,n.uint32()));continue;case 2:if(e!==16)break;i.droppedAttributesCount=n.uint32();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{attributes:globalThis.Array.isArray(e==null?void 0:e.attributes)?e.attributes.map(e=>Vp.fromJSON(e)):[],droppedAttributesCount:Xp(e.droppedAttributesCount)?globalThis.Number(e.droppedAttributesCount):0}},toJSON(e){var t;let n={};return(t=e.attributes)!=null&&t.length&&(n.attributes=e.attributes.map(e=>Vp.toJSON(e))),e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&(n.droppedAttributesCount=Math.round(e.droppedAttributesCount)),n},create(e){return Yp.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=Jp();return r.attributes=((t=e.attributes)==null?void 0:t.map(e=>Vp.fromPartial(e)))||[],r.droppedAttributesCount=(n=e.droppedAttributesCount)==null?0:n,r}};function Xp(e){return e!=null}function Zp(e){switch(e){case 0:case`SEVERITY_NUMBER_UNSPECIFIED`:return 0;case 1:case`SEVERITY_NUMBER_TRACE`:return 1;case 2:case`SEVERITY_NUMBER_TRACE2`:return 2;case 3:case`SEVERITY_NUMBER_TRACE3`:return 3;case 4:case`SEVERITY_NUMBER_TRACE4`:return 4;case 5:case`SEVERITY_NUMBER_DEBUG`:return 5;case 6:case`SEVERITY_NUMBER_DEBUG2`:return 6;case 7:case`SEVERITY_NUMBER_DEBUG3`:return 7;case 8:case`SEVERITY_NUMBER_DEBUG4`:return 8;case 9:case`SEVERITY_NUMBER_INFO`:return 9;case 10:case`SEVERITY_NUMBER_INFO2`:return 10;case 11:case`SEVERITY_NUMBER_INFO3`:return 11;case 12:case`SEVERITY_NUMBER_INFO4`:return 12;case 13:case`SEVERITY_NUMBER_WARN`:return 13;case 14:case`SEVERITY_NUMBER_WARN2`:return 14;case 15:case`SEVERITY_NUMBER_WARN3`:return 15;case 16:case`SEVERITY_NUMBER_WARN4`:return 16;case 17:case`SEVERITY_NUMBER_ERROR`:return 17;case 18:case`SEVERITY_NUMBER_ERROR2`:return 18;case 19:case`SEVERITY_NUMBER_ERROR3`:return 19;case 20:case`SEVERITY_NUMBER_ERROR4`:return 20;case 21:case`SEVERITY_NUMBER_FATAL`:return 21;case 22:case`SEVERITY_NUMBER_FATAL2`:return 22;case 23:case`SEVERITY_NUMBER_FATAL3`:return 23;case 24:case`SEVERITY_NUMBER_FATAL4`:return 24;default:return-1}}function Qp(e){switch(e){case 0:return`SEVERITY_NUMBER_UNSPECIFIED`;case 1:return`SEVERITY_NUMBER_TRACE`;case 2:return`SEVERITY_NUMBER_TRACE2`;case 3:return`SEVERITY_NUMBER_TRACE3`;case 4:return`SEVERITY_NUMBER_TRACE4`;case 5:return`SEVERITY_NUMBER_DEBUG`;case 6:return`SEVERITY_NUMBER_DEBUG2`;case 7:return`SEVERITY_NUMBER_DEBUG3`;case 8:return`SEVERITY_NUMBER_DEBUG4`;case 9:return`SEVERITY_NUMBER_INFO`;case 10:return`SEVERITY_NUMBER_INFO2`;case 11:return`SEVERITY_NUMBER_INFO3`;case 12:return`SEVERITY_NUMBER_INFO4`;case 13:return`SEVERITY_NUMBER_WARN`;case 14:return`SEVERITY_NUMBER_WARN2`;case 15:return`SEVERITY_NUMBER_WARN3`;case 16:return`SEVERITY_NUMBER_WARN4`;case 17:return`SEVERITY_NUMBER_ERROR`;case 18:return`SEVERITY_NUMBER_ERROR2`;case 19:return`SEVERITY_NUMBER_ERROR3`;case 20:return`SEVERITY_NUMBER_ERROR4`;case 21:return`SEVERITY_NUMBER_FATAL`;case 22:return`SEVERITY_NUMBER_FATAL2`;case 23:return`SEVERITY_NUMBER_FATAL3`;case 24:return`SEVERITY_NUMBER_FATAL4`;default:return`UNRECOGNIZED`}}function $p(){return{resourceLogs:[]}}let em={encode(e,t=$.default.Writer.create()){if(e.resourceLogs!==void 0&&e.resourceLogs.length!==0)for(let n of e.resourceLogs)nm.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=$p();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.resourceLogs.push(nm.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{resourceLogs:globalThis.Array.isArray(e==null?void 0:e.resourceLogs)?e.resourceLogs.map(e=>nm.fromJSON(e)):[]}},toJSON(e){var t;let n={};return(t=e.resourceLogs)!=null&&t.length&&(n.resourceLogs=e.resourceLogs.map(e=>nm.toJSON(e))),n},create(e){return em.fromPartial(e==null?{}:e)},fromPartial(e){var t;let n=$p();return n.resourceLogs=((t=e.resourceLogs)==null?void 0:t.map(e=>nm.fromPartial(e)))||[],n}};function tm(){return{resource:void 0,scopeLogs:[],instrumentationLibraryLogs:[],schemaUrl:``}}let nm={encode(e,t=$.default.Writer.create()){if(e.resource!==void 0&&Yp.encode(e.resource,t.uint32(10).fork()).ldelim(),e.scopeLogs!==void 0&&e.scopeLogs.length!==0)for(let n of e.scopeLogs)im.encode(n,t.uint32(18).fork()).ldelim();if(e.instrumentationLibraryLogs!==void 0&&e.instrumentationLibraryLogs.length!==0)for(let n of e.instrumentationLibraryLogs)om.encode(n,t.uint32(8002).fork()).ldelim();return e.schemaUrl!==void 0&&e.schemaUrl!==``&&t.uint32(26).string(e.schemaUrl),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=tm();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.resource=Yp.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.scopeLogs.push(im.decode(n,n.uint32()));continue;case 1e3:if(e!==8002)break;i.instrumentationLibraryLogs.push(om.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.schemaUrl=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{resource:um(e.resource)?Yp.fromJSON(e.resource):void 0,scopeLogs:globalThis.Array.isArray(e==null?void 0:e.scopeLogs)?e.scopeLogs.map(e=>im.fromJSON(e)):[],instrumentationLibraryLogs:globalThis.Array.isArray(e==null?void 0:e.instrumentationLibraryLogs)?e.instrumentationLibraryLogs.map(e=>om.fromJSON(e)):[],schemaUrl:um(e.schemaUrl)?globalThis.String(e.schemaUrl):``}},toJSON(e){var t,n;let r={};return e.resource!==void 0&&(r.resource=Yp.toJSON(e.resource)),(t=e.scopeLogs)!=null&&t.length&&(r.scopeLogs=e.scopeLogs.map(e=>im.toJSON(e))),(n=e.instrumentationLibraryLogs)!=null&&n.length&&(r.instrumentationLibraryLogs=e.instrumentationLibraryLogs.map(e=>om.toJSON(e))),e.schemaUrl!==void 0&&e.schemaUrl!==``&&(r.schemaUrl=e.schemaUrl),r},create(e){return nm.fromPartial(e==null?{}:e)},fromPartial(e){var t,n,r;let i=tm();return i.resource=e.resource!==void 0&&e.resource!==null?Yp.fromPartial(e.resource):void 0,i.scopeLogs=((t=e.scopeLogs)==null?void 0:t.map(e=>im.fromPartial(e)))||[],i.instrumentationLibraryLogs=((n=e.instrumentationLibraryLogs)==null?void 0:n.map(e=>om.fromPartial(e)))||[],i.schemaUrl=(r=e.schemaUrl)==null?``:r,i}};function rm(){return{scope:void 0,logRecords:[],schemaUrl:``}}let im={encode(e,t=$.default.Writer.create()){if(e.scope!==void 0&&Gp.encode(e.scope,t.uint32(10).fork()).ldelim(),e.logRecords!==void 0&&e.logRecords.length!==0)for(let n of e.logRecords)cm.encode(n,t.uint32(18).fork()).ldelim();return e.schemaUrl!==void 0&&e.schemaUrl!==``&&t.uint32(26).string(e.schemaUrl),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=rm();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.scope=Gp.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.logRecords.push(cm.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.schemaUrl=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{scope:um(e.scope)?Gp.fromJSON(e.scope):void 0,logRecords:globalThis.Array.isArray(e==null?void 0:e.logRecords)?e.logRecords.map(e=>cm.fromJSON(e)):[],schemaUrl:um(e.schemaUrl)?globalThis.String(e.schemaUrl):``}},toJSON(e){var t;let n={};return e.scope!==void 0&&(n.scope=Gp.toJSON(e.scope)),(t=e.logRecords)!=null&&t.length&&(n.logRecords=e.logRecords.map(e=>cm.toJSON(e))),e.schemaUrl!==void 0&&e.schemaUrl!==``&&(n.schemaUrl=e.schemaUrl),n},create(e){return im.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=rm();return r.scope=e.scope!==void 0&&e.scope!==null?Gp.fromPartial(e.scope):void 0,r.logRecords=((t=e.logRecords)==null?void 0:t.map(e=>cm.fromPartial(e)))||[],r.schemaUrl=(n=e.schemaUrl)==null?``:n,r}};function am(){return{instrumentationLibrary:void 0,logRecords:[],schemaUrl:``}}let om={encode(e,t=$.default.Writer.create()){if(e.instrumentationLibrary!==void 0&&Up.encode(e.instrumentationLibrary,t.uint32(10).fork()).ldelim(),e.logRecords!==void 0&&e.logRecords.length!==0)for(let n of e.logRecords)cm.encode(n,t.uint32(18).fork()).ldelim();return e.schemaUrl!==void 0&&e.schemaUrl!==``&&t.uint32(26).string(e.schemaUrl),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=am();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==10)break;i.instrumentationLibrary=Up.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.logRecords.push(cm.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.schemaUrl=n.string();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{instrumentationLibrary:um(e.instrumentationLibrary)?Up.fromJSON(e.instrumentationLibrary):void 0,logRecords:globalThis.Array.isArray(e==null?void 0:e.logRecords)?e.logRecords.map(e=>cm.fromJSON(e)):[],schemaUrl:um(e.schemaUrl)?globalThis.String(e.schemaUrl):``}},toJSON(e){var t;let n={};return e.instrumentationLibrary!==void 0&&(n.instrumentationLibrary=Up.toJSON(e.instrumentationLibrary)),(t=e.logRecords)!=null&&t.length&&(n.logRecords=e.logRecords.map(e=>cm.toJSON(e))),e.schemaUrl!==void 0&&e.schemaUrl!==``&&(n.schemaUrl=e.schemaUrl),n},create(e){return om.fromPartial(e==null?{}:e)},fromPartial(e){var t,n;let r=am();return r.instrumentationLibrary=e.instrumentationLibrary!==void 0&&e.instrumentationLibrary!==null?Up.fromPartial(e.instrumentationLibrary):void 0,r.logRecords=((t=e.logRecords)==null?void 0:t.map(e=>cm.fromPartial(e)))||[],r.schemaUrl=(n=e.schemaUrl)==null?``:n,r}};function sm(){return{timeUnixNano:0,observedTimeUnixNano:0,severityNumber:0,severityText:``,body:void 0,attributes:[],droppedAttributesCount:0,flags:0,traceId:new Uint8Array,spanId:new Uint8Array}}let cm={encode(e,t=$.default.Writer.create()){if(e.timeUnixNano!==void 0&&e.timeUnixNano!==0&&t.uint32(9).fixed64(e.timeUnixNano),e.observedTimeUnixNano!==void 0&&e.observedTimeUnixNano!==0&&t.uint32(89).fixed64(e.observedTimeUnixNano),e.severityNumber!==void 0&&e.severityNumber!==0&&t.uint32(16).int32(e.severityNumber),e.severityText!==void 0&&e.severityText!==``&&t.uint32(26).string(e.severityText),e.body!==void 0&&Fp.encode(e.body,t.uint32(42).fork()).ldelim(),e.attributes!==void 0&&e.attributes.length!==0)for(let n of e.attributes)Vp.encode(n,t.uint32(50).fork()).ldelim();return e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&t.uint32(56).uint32(e.droppedAttributesCount),e.flags!==void 0&&e.flags!==0&&t.uint32(69).fixed32(e.flags),e.traceId!==void 0&&e.traceId.length!==0&&t.uint32(74).bytes(e.traceId),e.spanId!==void 0&&e.spanId.length!==0&&t.uint32(82).bytes(e.spanId),t},decode(e,t){let n=e instanceof $.default.Reader?e:$.default.Reader.create(e),r=t===void 0?n.len:n.pos+t,i=sm();for(;n.pos<r;){let e=n.uint32();switch(e>>>3){case 1:if(e!==9)break;i.timeUnixNano=lm(n.fixed64());continue;case 11:if(e!==89)break;i.observedTimeUnixNano=lm(n.fixed64());continue;case 2:if(e!==16)break;i.severityNumber=n.int32();continue;case 3:if(e!==26)break;i.severityText=n.string();continue;case 5:if(e!==42)break;i.body=Fp.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.attributes.push(Vp.decode(n,n.uint32()));continue;case 7:if(e!==56)break;i.droppedAttributesCount=n.uint32();continue;case 8:if(e!==69)break;i.flags=n.fixed32();continue;case 9:if(e!==74)break;i.traceId=n.bytes();continue;case 10:if(e!==82)break;i.spanId=n.bytes();continue}if((e&7)==4||e===0)break;n.skipType(e&7)}return i},fromJSON(e){return{timeUnixNano:um(e.timeUnixNano)?globalThis.Number(e.timeUnixNano):0,observedTimeUnixNano:um(e.observedTimeUnixNano)?globalThis.Number(e.observedTimeUnixNano):0,severityNumber:um(e.severityNumber)?Zp(e.severityNumber):0,severityText:um(e.severityText)?globalThis.String(e.severityText):``,body:um(e.body)?Fp.fromJSON(e.body):void 0,attributes:globalThis.Array.isArray(e==null?void 0:e.attributes)?e.attributes.map(e=>Vp.fromJSON(e)):[],droppedAttributesCount:um(e.droppedAttributesCount)?globalThis.Number(e.droppedAttributesCount):0,flags:um(e.flags)?globalThis.Number(e.flags):0,traceId:um(e.traceId)?Mp(e.traceId):new Uint8Array,spanId:um(e.spanId)?Mp(e.spanId):new Uint8Array}},toJSON(e){var t;let n={};return e.timeUnixNano!==void 0&&e.timeUnixNano!==0&&(n.timeUnixNano=Math.round(e.timeUnixNano)),e.observedTimeUnixNano!==void 0&&e.observedTimeUnixNano!==0&&(n.observedTimeUnixNano=Math.round(e.observedTimeUnixNano)),e.severityNumber!==void 0&&e.severityNumber!==0&&(n.severityNumber=Qp(e.severityNumber)),e.severityText!==void 0&&e.severityText!==``&&(n.severityText=e.severityText),e.body!==void 0&&(n.body=Fp.toJSON(e.body)),(t=e.attributes)!=null&&t.length&&(n.attributes=e.attributes.map(e=>Vp.toJSON(e))),e.droppedAttributesCount!==void 0&&e.droppedAttributesCount!==0&&(n.droppedAttributesCount=Math.round(e.droppedAttributesCount)),e.flags!==void 0&&e.flags!==0&&(n.flags=Math.round(e.flags)),e.traceId!==void 0&&e.traceId.length!==0&&(n.traceId=Np(e.traceId)),e.spanId!==void 0&&e.spanId.length!==0&&(n.spanId=Np(e.spanId)),n},create(e){return cm.fromPartial(e==null?{}:e)},fromPartial(e){var t,n,r,i,a,o,s,c,l;let u=sm();return u.timeUnixNano=(t=e.timeUnixNano)==null?0:t,u.observedTimeUnixNano=(n=e.observedTimeUnixNano)==null?0:n,u.severityNumber=(r=e.severityNumber)==null?0:r,u.severityText=(i=e.severityText)==null?``:i,u.body=e.body!==void 0&&e.body!==null?Fp.fromPartial(e.body):void 0,u.attributes=((a=e.attributes)==null?void 0:a.map(e=>Vp.fromPartial(e)))||[],u.droppedAttributesCount=(o=e.droppedAttributesCount)==null?0:o,u.flags=(s=e.flags)==null?0:s,u.traceId=(c=e.traceId)==null?new Uint8Array:c,u.spanId=(l=e.spanId)==null?new Uint8Array:l,u}};function lm(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);return e.toNumber()}$.default.util.Long!==X&&($.default.util.Long=X,$.default.configure());function um(e){return e!=null}let dm=`0.0.12`,fm={"Content-Type":`application/x-protobuf`,"Content-Encoding":`gzip`},pm=em;function mm(e){return Array.isArray(e)}function hm(e){return!!e&&typeof e==`object`&&!mm(e)}function gm(e){return hm(e)?{kvlistValue:{values:Object.entries(e).map(([e,t])=>({key:e,value:gm(t)}))}}:mm(e)?{arrayValue:{values:e.map(e=>gm(e))}}:typeof e==`string`?{stringValue:e}:typeof e==`number`?{doubleValue:e}:typeof e==`boolean`?{boolValue:e}:{}}var _m=class{constructor(e){z(this,`config`,void 0),this.config=e}constructLogData(e){var t,n,r;return{resourceLogs:[{resource:{attributes:(t=gm(H({},Object.fromEntries(Object.entries((n=(r=this.config.resource)==null?void 0:r.attributes)==null?{}:n)))))==null||(t=t.kvlistValue)==null?void 0:t.values},scopeLogs:[{scope:{name:`rum.rr-web`,version:dm},logRecords:e.map(e=>{var t,n;return{body:gm((t=e.body)==null?null:t),timeUnixNano:e.timeUnixNano*1e6,attributes:(n=gm(e.attributes||{}).kvlistValue)==null?void 0:n.values}})}]}]}}export(e){if(e.length===0)return;let t=this.constructLogData(e);this.config.debug&&console.log(`otlp request`,t);let n=Rf(pm.encode(t).finish()),r=this.config.headers?Object.assign({},fm,this.config.headers):fm;fetch(this.config.beaconUrl,{method:`POST`,body:new Uint8Array(n),headers:r}).catch(()=>{})}};function vm(e){if(e.length>5e6){let t=e.matchAll(/data:([\w/\-.]+);(\w+),([^)"]*)/gim);for(let n of t)e=n[1].toLocaleLowerCase().slice(0,6)===`image/`?e.replace(n[0],`data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==`):e.replace(n[0],``)}return e}var ym=class{constructor(e,t={}){var n,r;z(this,`bucketSize`,100),z(this,`refillRate`,10),z(this,`mutationBuckets`,{}),z(this,`loggedTracker`,{}),z(this,`refillBuckets`,()=>{Object.keys(this.mutationBuckets).forEach(e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]})}),z(this,`getNodeOrRelevantParent`,e=>{let t=this.rrweb.mirror.getNode(e);if((t==null?void 0:t.nodeName)!==`svg`&&t instanceof Element){let e=t.closest(`svg`);if(e)return[this.rrweb.mirror.getId(e),e]}return[e,t]}),z(this,`numberOfChanges`,e=>{var t,n,r,i,a,o,s,c;return((t=(n=e.removes)==null?void 0:n.length)==null?0:t)+((r=(i=e.attributes)==null?void 0:i.length)==null?0:r)+((a=(o=e.texts)==null?void 0:o.length)==null?0:a)+((s=(c=e.adds)==null?void 0:c.length)==null?0:s)}),z(this,`throttleMutations`,e=>{if(e.type!==3||e.data.source!==0)return e;let t=e.data,n=this.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter(e=>{var t;let[n,r]=this.getNodeOrRelevantParent(e.id);if(this.mutationBuckets[n]===0)return!1;if(this.mutationBuckets[n]=(t=this.mutationBuckets[n])==null?this.bucketSize:t,this.mutationBuckets[n]=Math.max(this.mutationBuckets[n]-1,0),this.mutationBuckets[n]===0&&!this.loggedTracker[n]){var i,a;this.loggedTracker[n]=!0,(i=(a=this.options).onBlockedNode)==null||i.call(a,n,r)}return e}));let r=this.numberOfChanges(t);if(!(r===0&&n!==r))return e}),this.rrweb=e,this.options=t,this.refillRate=(n=this.options.refillRate)==null?this.refillRate:n,this.bucketSize=(r=this.options.bucketSize)==null?this.bucketSize:r,setInterval(()=>{this.refillBuckets()},1e3)}};let bm=950*1024,xm=new TextEncoder,Sm=new TextDecoder,Cm=!1,wm,Tm,Em=0,Dm=!1,Om=1,km=1,Am,jm,Mm,Nm={get inited(){return!!Cm},isRecording(){return!!Cm&&!Dm},setEnabled(e){e?Nm.resume():Nm.stop()},init(e){var t,n;if(Cm)return;if(typeof window>`u`){console.error(`Session recorder can't be ran in non-browser environments`);return}let{resource:r,getSessionId:i,tracer:a,url:o,debug:s,apiKey:c,headers:l}=e,u=Ti(e,Op);jm=i,wm=a;let d=wm.startSpan(`record init`);if(!d.isRecording())return;d.end();let f=o,p=H({},l);c&&(p.authorization=c);let m=new kp(new _m({beaconUrl:f,debug:s,headers:p,resource:r}),{});Tm=(t=i())==null?``:t,Em=Date.now(),Am=(n=Am)==null?new ym(Qd,{onBlockedNode:(e,t)=>{let n=`OpenTelemetry Session Recorder: Rate limiting recording mutations on node ${e}. This can be due to excessive animations.`,r=Date.now(),i=wm.startSpan(`console.warn`,{kind:Je.INTERNAL,startTime:r});i.setAttribute(`component`,`console`),i.setAttribute(`level`,`warn`),i.setAttribute(`message`,n),i.end(r),s&&console.warn(n,t),clearTimeout(Mm),Mm=setTimeout(()=>{Qd.takeFullSnapshot()},1e3)}}):n,Cm=Qd(H(H({maskAllInputs:!0,maskTextSelector:`*`},u),{},{emit(e){var t;if(Dm)return;let n=(t=jm==null?void 0:jm())==null?``:t;if(n!==Tm){if(document.hidden)return;Tm=n,Em=Date.now(),Om=1,km=1,Qd.takeFullSnapshot()}if(e.timestamp>Em+1446e4)return;let r=Am?Am.throttleMutations(e):e;if(!r)return;let i=r.timestamp,a=Om++,o=xm.encode(vm(JSON.stringify(r))),c=Math.ceil(o.byteLength/bm);for(let e=0;e<c;e++){let t=e*bm,n=(e+1)*bm,r=Ap(Sm.decode(o.slice(t,n)),i,{"rr-web.offset":km++,"rr-web.event":a,"rr-web.chunk":e+1,"rr-web.total-chunks":c});s&&console.log(r),m.onLog(r)}}}))},resume(){if(!Cm)return;let e=Dm;Dm=!1,e||(Qd.takeFullSnapshot(),wm.startSpan(`record resume`).end())},stop(){Cm&&(Dm&&wm.startSpan(`record stop`).end(),Dm=!0)},deinit(){Cm&&(Cm(),Cm=!1,jm=void 0)}},Pm={isRecording:()=>!1,setEnabled:()=>{}};function Fm({resource:e,spanSessionManager:t,tracerProvider:n,appID:r,userID:i,mxlDataURL:a,sessionRecorder:o}){return H({resource:e,getSessionId:()=>t.getSessionId(),tracer:n.getTracer(`mxl.session-recorder`,dm),url:Tl(r,a),headers:gc(r,i)},o)}function Im(e){let t=()=>Fm(e);return e.recordUserSessions?(Nm.init(t()),{isRecording:()=>Nm.isRecording(),setEnabled:e=>{Nm.setEnabled(e)}}):{isRecording:()=>Nm.isRecording(),setEnabled:e=>{e?Nm.inited?Nm.resume():Nm.init(t()):Nm.inited&&Nm.stop()}}}var Lm;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(Lm||(Lm={}));let Rm=L.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function zm(...e){if(e[0]instanceof URL||typeof e[0]==`string`){let t=e[1];if(!(t!=null&&t.body))return Promise.resolve();if(t.body instanceof ReadableStream){let{body:e,length:n}=Bm(t.body);return t.body=e,n}else return Promise.resolve(Hm(t.body))}else{let t=e[0];return t!=null&&t.body?t.clone().text().then(e=>Wm(e)):Promise.resolve()}}function Bm(e){if(!e.pipeThrough)return Rm.warn(`Platform has ReadableStream but not pipeThrough!`),{body:e,length:Promise.resolve(void 0)};let t=0,n,r=new Promise(e=>{n=e}),i=new TransformStream({start(){},transform(e,n){return B(function*(){let r=yield e;t+=r.byteLength,n.enqueue(e)})()},flush(){n(t)}});return{body:e.pipeThrough(i),length:r}}function Vm(e){return typeof Document<`u`&&e instanceof Document}function Hm(e){if(Vm(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Wm(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return Gm(e);if(e instanceof URLSearchParams)return Wm(e.toString());if(e.byteLength!==void 0)return e.byteLength;Rm.warn(`unknown body type`)}let Um=new TextEncoder;function Wm(e){return Um.encode(e).byteLength}function Gm(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function Km(e){let t=Ym(),n=e.toUpperCase();return n in t?n:`_OTHER`}let qm={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},Jm;function Ym(){return Jm===void 0&&(Jm=qm),Jm}let Xm={"https:":`443`,"http:":`80`};function Zm(e){let t=Number(e.port||Xm[e.protocol]);if(t&&!isNaN(t))return t}let Qm=`0.218.0`,$m=typeof PerformanceObserver<`u`;var eh=class extends Pa{constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,Qm,e),z(this,`component`,`fetch`),z(this,`version`,Qm),z(this,`moduleName`,this.component),z(this,`_usedResources`,new WeakSet),z(this,`_tasksCount`,0),z(this,`_semconvStability`,void 0),this._semconvStability=Ia(`http`,e==null?void 0:e.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[V.FETCH_START]},R.setSpan(I.active(),e)),r=!(this._semconvStability&U.OLD);di(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[V.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=_i(t.url);if(this._semconvStability&U.OLD&&(e.setAttribute(`http.status_code`,t.status),t.statusText!=null&&e.setAttribute(Lm.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(`http.host`,n.host),e.setAttribute(`http.scheme`,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(`http.user_agent`,navigator.userAgent)),this._semconvStability&U.STABLE){e.setAttribute(an,t.status),e.setAttribute(on,n.hostname);let r=Zm(n);r&&e.setAttribute(sn,r)}}_addHeaders(e,t){if(!vi(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};st.inject(I.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)st.inject(I.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t=new Headers(e.headers);st.inject(I.active(),t,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))}),e.headers=t}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(pr(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&U.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[Lm.COMPONENT]=this.moduleName,r[`http.method`]=i,r[`http.url`]=e}if(this._semconvStability&U.STABLE){let i=t.method,a=Km(t.method||`GET`);n||(n=a),r[nn]=a,a!==i&&(r[rn]=i),r[fn]=e}return this.tracer.startSpan(n,{kind:Je.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=mi(t.spanUrl,t.startTime,n,r,this._usedResources,`fetch`);if(i.mainRequest){let t=i.mainRequest;this._markResourceAsUsed(t);let n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&U.OLD);di(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=vn(Date.now()),i=yn();this._addFinalSpanAttributes(e,n),this._semconvStability&U.STABLE&&n.status>=400&&(e.setStatus({code:Ye.ERROR}),e.setAttribute(Qt,String(n.status))),setTimeout(()=>{var n;(n=t.observer)==null||n.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},300)}_patchConstructor(){return e=>{let t=this;return function(...n){if(!t._isEnabled)return e.apply(this,n);let r=this,i=_i(n[0]instanceof Request?n[0].url:String(n[0])).href,a;a=n[0]instanceof Request?n[1]==null?n[0]:new Request(n[0],n[1]):n[1]||{};let o=t._createSpan(i,a);if(!o)return e.apply(this,n);let s=t._prepareSpanData(i);t.getConfig().measureRequestSize&&zm(...n).then(e=>{e&&(t._semconvStability&U.OLD&&o.setAttribute(`http.request_content_length_uncompressed`,e),t._semconvStability&U.STABLE&&o.setAttribute(`http.request.body.size`,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function c(e,n){t._applyAttributesAfterFetch(e,a,n),t._endSpan(e,s,{status:n.status||0,statusText:n.message,url:i})}function l(e,n){t._applyAttributesAfterFetch(e,a,n),n.status>=200&&n.status<400?t._endSpan(e,s,n):t._endSpan(e,s,{status:n.status,statusText:n.statusText,url:i})}function u(e,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?l(e,n):i()},t=>{c(e,t)})};i()}else l(e,n)}catch(n){t._diag.error(`Failed to read fetch response body`,n),t._endSpan(e,s,{status:0,url:i})}return n}function d(e,n){try{c(e,n)}catch(r){t._diag.error(`Failed to end span on fetch error`,r),t._endSpan(e,s,{status:n.status||0,url:i})}throw n}return I.with(R.setSpan(I.active(),o),()=>(t._callRequestHook(o,a),t._addHeaders(a,i),t._tasksCount++,e.apply(r,a instanceof Request?[a]:[i,a]).then(u.bind(r,o),d.bind(r,o))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&Fa(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&Fa(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=yn(),n=[];if(typeof PerformanceObserver!=`function`)return{entries:n,startTime:t,spanUrl:e};let r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.initiatorType===`fetch`&&t.name===e&&n.push(t)})});return r.observe({entryTypes:[`resource`]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){if(!$m){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument server-side fetch()`);return}if(!this._isEnabled){if(this._isFetchPatched){this._diag.debug(`fetch constructor already patched`),this._isEnabled=!0;return}try{this._wrap(globalThis,`fetch`,this._patchConstructor()),this._isFetchPatched=!0,this._isEnabled=!0}catch(e){this._diag.warn(`Failed to patch globalThis.fetch; instrumentation will not be enabled. Another script may have locked globalThis.fetch via Object.defineProperty.`,e)}}}disable(){$m&&this._isEnabled&&(this._isEnabled=!1,this._usedResources=new WeakSet)}},th;(function(e){e.METHOD_OPEN=`open`,e.METHOD_SEND=`send`,e.EVENT_ABORT=`abort`,e.EVENT_ERROR=`error`,e.EVENT_LOAD=`loaded`,e.EVENT_TIMEOUT=`timeout`})(th||(th={}));let nh=L.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils`});function rh(e){return typeof Document<`u`&&e instanceof Document}function ih(e){if(rh(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return oh(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return sh(e);if(e instanceof URLSearchParams)return oh(e.toString());if(e.byteLength!==void 0)return e.byteLength;nh.warn(`unknown body type`)}let ah=new TextEncoder;function oh(e){return ah.encode(e).byteLength}function sh(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function ch(e){let t=dh(),n=e.toUpperCase();return n in t?n:`_OTHER`}let lh={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},uh;function dh(){return uh===void 0&&(uh=lh),uh}let fh={"https:":`443`,"http:":`80`};function ph(e){let t=Number(e.port||fh[e.protocol]);if(t&&!isNaN(t))return t}let mh=`0.218.0`;var hh;(function(e){e.HTTP_STATUS_TEXT=`http.status_text`})(hh||(hh={}));var gh=class extends Pa{constructor(e={}){super(`@opentelemetry/instrumentation-xml-http-request`,mh,e),z(this,`component`,`xml-http-request`),z(this,`version`,mh),z(this,`moduleName`,this.component),z(this,`_tasksCount`,0),z(this,`_xhrMem`,new WeakMap),z(this,`_usedResources`,new WeakSet),z(this,`_semconvStability`,void 0),this._semconvStability=Ia(`http`,e==null?void 0:e.semconvStabilityOptIn)}init(){}_addHeaders(e,t){let n=_i(t).href;if(!vi(n,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};st.inject(I.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}let r={};st.inject(I.active(),r),Object.keys(r).forEach(t=>{e.setRequestHeader(t,String(r[t]))})}_addChildSpan(e,t){I.with(R.setSpan(I.active(),e),()=>{let e=this.tracer.startSpan(`CORS Preflight`,{startTime:t[V.FETCH_START]}),n=!(this._semconvStability&U.OLD);di(e,t,this.getConfig().ignoreNetworkEvents,void 0,n),e.end(t[V.RESPONSE_END])})}_addFinalSpanAttributes(e,t,n){if(this._semconvStability&U.OLD){if(t.status!==void 0&&e.setAttribute(`http.status_code`,t.status),t.statusText!==void 0&&e.setAttribute(hh.HTTP_STATUS_TEXT,t.statusText),typeof n==`string`){let t=_i(n);e.setAttribute(`http.host`,t.host),e.setAttribute(`http.scheme`,t.protocol.replace(`:`,``))}e.setAttribute(`http.user_agent`,navigator.userAgent)}this._semconvStability&U.STABLE&&t.status&&e.setAttribute(an,t.status)}_applyAttributesAfterXHR(e,t){let n=this.getConfig().applyCustomAttributesOnSpan;typeof n==`function`&&Fa(()=>n(e,t),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_addResourceObserver(e,t){let n=this._xhrMem.get(e);!n||typeof PerformanceObserver!=`function`||typeof PerformanceResourceTiming!=`function`||(n.createdResources={observer:new PerformanceObserver(e=>{let r=e.getEntries(),i=_i(t);r.forEach(e=>{e.initiatorType===`xmlhttprequest`&&e.name===i.href&&n.createdResources&&n.createdResources.entries.push(e)})}),entries:[]},n.createdResources.observer.observe({entryTypes:[`resource`]}))}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(hn.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,n,r,i){if(!n||!r||!i||!e.createdResources)return;let a=e.createdResources.entries;(!a||!a.length)&&(a=hn.getEntriesByType(`resource`));let o=mi(_i(n).href,r,i,a,this._usedResources);if(o.mainRequest){let e=o.mainRequest;this._markResourceAsUsed(e);let n=o.corsPreFlightRequest;n&&(this._addChildSpan(t,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&U.OLD);di(t,e,this.getConfig().ignoreNetworkEvents,void 0,r)}}_cleanPreviousSpanInformation(e){let t=this._xhrMem.get(e);if(t){let n=t.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(e)}}_createSpan(e,t,n){let r=_i(t);if(pr(r.href,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let i=``,a={};if(this._semconvStability&U.OLD&&(i=n.toUpperCase(),a[`http.method`]=n,a[`http.url`]=r.toString()),this._semconvStability&U.STABLE){let e=n,t=ch(n);i||(i=t),a[nn]=t,t!==e&&(a[rn]=e),a[fn]=r.toString(),a[on]=r.hostname;let o=ph(r);o&&(a[sn]=o)}let o=this.tracer.startSpan(i,{kind:Je.CLIENT,attributes:a});return o.addEvent(th.METHOD_OPEN),this._cleanPreviousSpanInformation(e),this._xhrMem.set(e,{span:o,spanUrl:t}),o}_markResourceAsUsed(e){this._usedResources.add(e)}_patchOpen(){return e=>{let t=this;return function(...n){if(!t._isEnabled)return e.apply(this,n);let r=n[0],i=n[1];return t._createSpan(this,i,r),e.apply(this,n)}}}_patchSend(){let e=this;function t(t,n,r,i){let a=n.callbackToRemoveEvents;typeof a==`function`&&a();let{span:o,spanUrl:s,sendStartTime:c}=n;o&&(e._findResourceAndAddNetworkEvents(n,o,s,c,r),o.addEvent(t,i),e._addFinalSpanAttributes(o,n,s),o.end(i),e._tasksCount--),e._clearResources()}function n(n,r,i,a){let o=e._xhrMem.get(r);if(!o)return;if(o.status=r.status,o.statusText=r.statusText,e._xhrMem.delete(r),o.span){let t=o.span;e._applyAttributesAfterXHR(t,r),e._semconvStability&U.STABLE&&(i?a&&(t.setStatus({code:Ye.ERROR,message:a}),t.setAttribute(Qt,a)):o.status&&o.status>=400&&(t.setStatus({code:Ye.ERROR}),t.setAttribute(Qt,String(o.status))))}let s=yn(),c=Date.now();setTimeout(()=>{t(n,o,s,c)},300)}function r(){n(th.EVENT_ERROR,this,!0,`error`)}function i(){n(th.EVENT_ABORT,this,!1)}function a(){n(th.EVENT_TIMEOUT,this,!0,`timeout`)}function o(){this.status<299?n(th.EVENT_LOAD,this,!1):n(th.EVENT_ERROR,this,!1)}function s(t){t.removeEventListener(`abort`,i),t.removeEventListener(`error`,r),t.removeEventListener(`load`,o),t.removeEventListener(`timeout`,a);let n=e._xhrMem.get(t);n&&(n.callbackToRemoveEvents=void 0)}return t=>function(...n){if(!e._isEnabled)return t.apply(this,n);let c=e._xhrMem.get(this);if(!c)return t.apply(this,n);let l=c.span,u=c.spanUrl;if(l&&u){if(e.getConfig().measureRequestSize&&n!=null&&n[0]){let t=n[0],r=ih(t);r!==void 0&&(e._semconvStability&U.OLD&&l.setAttribute(`http.request_content_length_uncompressed`,r),e._semconvStability&U.STABLE&&l.setAttribute(`http.request.body.size`,r))}I.with(R.setSpan(I.active(),l),()=>{e._tasksCount++,c.sendStartTime=yn(),l.addEvent(th.METHOD_SEND),this.addEventListener(`abort`,i),this.addEventListener(`error`,r),this.addEventListener(`load`,o),this.addEventListener(`timeout`,a),c.callbackToRemoveEvents=()=>{s(this),c.createdResources&&c.createdResources.observer.disconnect()},e._addHeaders(this,u),e._addResourceObserver(this,u)})}return t.apply(this,n)}}enable(){if(!this._isEnabled){if(this._isXhrPatched){this._diag.debug(`reactivating existing patch on`,this.moduleName,this.version),this._isEnabled=!0;return}try{this._diag.debug(`applying patch to`,this.moduleName,this.version),this._wrap(XMLHttpRequest.prototype,`open`,this._patchOpen()),this._wrap(XMLHttpRequest.prototype,`send`,this._patchSend()),this._isXhrPatched=!0,this._isEnabled=!0}catch(e){this._unwrap(XMLHttpRequest.prototype,`open`),this._unwrap(XMLHttpRequest.prototype,`send`),this._diag.warn(`Failed to patch globalThis.XMLHttpRequest; instrumentation will not be enabled. Another script may have locked globalThis.XMLHttpRequest via Object.defineProperty.`,e)}}}disable(){this._isEnabled&&(this._isEnabled=!1,this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}};let _h=(e={},{logManager:t,spanSessionManager:n,pageManager:r,limitManager:i})=>{var a,o,s,c,l,u,d,f,p,m;let h=[new Wo(e[`session-visibility`]),new Uo(e[`session-activity`])];if((a=e.omit)!=null&&a.has(`exception`)||h.push(new ao(e.exception)),(o=e.omit)!=null&&o.has(`click`)||h.push(new ro(e.click)),(s=e.omit)!=null&&s.has(`web-vital`)||h.push(new Ys(H(H({},e[`web-vital`]),{},{pageManager:r}))),(c=e.omit)!=null&&c.has(`loaf`)||h.push(new oo(H({},e.loaf))),(l=e.omit)!=null&&l.has(`user-timing`)||h.push(new Jo(e[`user-timing`])),(u=e.omit)!=null&&u.has(`element-timing`)||h.push(new io(H(H({},e[`element-timing`]),{},{limitManager:i}))),(d=e.omit)!=null&&d.has(`document-load`)||h.push(new eo(e[`document-load`])),(f=e.omit)!=null&&f.has(`server-timing`)||h.push(new fo(H(H({},e[`server-timing`]),{},{limitManager:i}))),!((p=e.omit)!=null&&p.has(`@opentelemetry/instrumentation-fetch`))){var g,_,v,y;h.push(new eh(H(H({},e[`@opentelemetry/instrumentation-fetch`]),{},{ignoreUrls:[...(g=(_=e.network)==null?void 0:_.ignoreUrls)==null?[]:g,...(v=(y=e[`@opentelemetry/instrumentation-fetch`])==null?void 0:y.ignoreUrls)==null?[]:v]})))}if(!((m=e.omit)!=null&&m.has(`@opentelemetry/instrumentation-xml-http-request`))){var b,x,S,C;h.push(new gh(H(H({},e[`@opentelemetry/instrumentation-xml-http-request`]),{},{ignoreUrls:[...(b=(x=e.network)==null?void 0:x.ignoreUrls)==null?[]:b,...(S=(C=e[`@opentelemetry/instrumentation-xml-http-request`])==null?void 0:C.ignoreUrls)==null?[]:S]})))}e[`empty-root`]&&h.push(new to(H({},e[`empty-root`])));for(let e of h)e instanceof Xa&&(n&&e.setSessionManager(n),t&&e.setLogManager(t),i&&e.setLimitManager(i));return h},vh=e=>{if(e!==void 0){if(typeof e!=`string`)throw Error(`appID must be a string, or omitted if not using MXL. Received ${String(e)}`);return e}},yh=e=>{if(e===void 0){let e=`MXLAppVersionX.X.X`;return e===``?`unspecified`:e}if(typeof e!=`string`)throw Error(`if appVersion is specified, it must be a string. Received ${String(e)}`);let t=e.trim();if(t===``)throw Error(`if appVersion is specified, it cannot be an empty string.`);return t},bh=({appID:e,appVersion:t,resource:n=wr(),spanExporters:r=[],logExporters:i=[],spanProcessors:a=[],propagator:o=null,defaultInstrumentationConfig:s,instrumentations:c=[],contextManager:l=null,logProcessors:u=[],attributeScrubbers:d=[],enableDefaultAttributeScrubbing:f=!0,additionalQueryParamsToScrub:p=[],logLevel:m=S.ERROR,mxlDataURL:h,mxlConfigURL:g,diagLogger:_=L.createComponentLogger({namespace:`mxl-sdk`}),dynamicSDKConfigManager:v,dynamicSDKConfig:y,registerGlobally:b=!0,blockNetworkSpanForwarding:x=!1,restrictedProtocols:C=new Set([`file:`]),useDocumentTitleAsPageLabel:w=!0,recordUserSessions:ee=!0,sessionRecorder:T,serviceName:E}={})=>{try{var D,te;if(b){let e=Xl.registered();if(e!==null)return _.warn(`SDK has already been successfully initialized, skipping this invocation of initSDK`),e}if(L.setLogger(new ne,{logLevel:m}),typeof window>`u`)return _.warn(`browser not detected, skipping initialization`),!1;let S=new Ci,k=S.getNowMillis(),A=vh(e),j=yh(t),re=A!==void 0;if(!re&&!i.length&&!r.length)throw Error(`when appID is omitted, at least one logExporter or spanExporter must be set`);if(C.has(window.location.protocol))throw Error(`not initializing due to restricted protocol: ${window.location.protocol}`);if(re&&typeof CompressionStream>`u`)throw Error(`CompressionStream is not supported in this browser and required for data compression.`);let ie=!b&&e,M=ie?new xi(e,window.localStorage):window.localStorage,ae=ie?new xi(e,window.sessionStorage):window.sessionStorage,N=xh({registerGlobally:b,sdkLocalStorage:M}),P=N.getMXLUserId();if(re&&!P)throw Error(`userID is required when using MXL exporter`);let F=H({},y),oe=v==null?new Co({appID:A,appVersion:j,mxlConfigURL:g,defaultConfig:F,deviceId:P,storage:M}):v;oe.refreshRemoteConfig();let se=yo({serviceName:(D=(te=oe.resolveApplicationServiceName)==null?void 0:te.call(oe,E))==null?(()=>{var e;return(E==null?void 0:E.trim())||((e=oe.getConfig().serviceName)==null?void 0:e.trim())||vo})():D}).merge(n).merge(bo({diagLogger:_,appVersion:j,pageSessionStorage:ae})),ce=new Ao({dynamicConfigManager:oe,deviceId:P,blockNetworkSpanForwarding:x});if(!ce.isSDKEnabled())return _.debug(`SDK is disabled, skipping initialization.`),!1;let le=Si({featureManager:ce,diag:_,registerGlobally:b,defaultInstrumentationConfig:s,propagator:o}),ue=new Eo(wo),de=[...f?Yl(p):[],...d],fe=Sh({limitManager:ue,registerGlobally:b,sdkLocalStorage:M,sdkSessionStorage:ae}),pe,me;if(re){var O;pe=new zl({resource:se,exporter:new kl({appID:A,mxlDataURL:h,userID:P}),limitManager:ue,storedSpansExpireTimeoutMS:s==null||(O=s[`session-visibility`])==null?void 0:O.storedSpansExpireTimeoutMS,storage:M,spanSessionManager:fe}),me=new fc(new El({appID:A,mxlDataURL:h,userID:P}))}let he=Th({useDocumentTitleAsPageLabel:w,registerGlobally:b}),{tracerProvider:ge,mxlTraceManager:_e}=Ch({resource:se,spanSessionManager:fe,userManager:N,spanExporters:r,spanProcessors:a,propagator:le?new Gl:o,contextManager:l,attributeScrubbers:de,registerGlobally:b,mxlSpanProcessor:pe,pageManager:he});fe.setTracerProvider(ge);let{loggerProvider:ve,mxlLogManager:ye}=wh({resource:se,userManager:N,logExporters:i,logProcessors:u,spanSessionManager:fe,limitManager:ue,attributeScrubbers:de,registerGlobally:b,mxlLogProcessor:me,sdkLocalStorage:M,pageManager:he});fe.startSessionSpan({reason:`init`}),Ta(b?{instrumentations:[_h(s,{spanSessionManager:fe,pageManager:he,limitManager:ue}),...c]}:{tracerProvider:ge,loggerProvider:ve,instrumentations:[_h(s,{logManager:ye,spanSessionManager:fe,pageManager:he,limitManager:ue}),...c]});let be=typeof window<`u`&&window.__MXL_DISABLE_SESSION_RECORDER===!0,xe=re&&A&&P&&!be?Im({resource:se,spanSessionManager:fe,tracerProvider:ge,appID:A,userID:P,mxlDataURL:h,recordUserSessions:ee,sessionRecorder:T}):Pm;_.info(`successfully initialized the SDK`);let Se={setDynamicConfig:e=>{oe.setConfig(e)},flush:function(){var e=B(function*(){yield ge.forceFlush(),yield ve.forceFlush()});return function(){return e.apply(this,arguments)}}(),log:ye,trace:_e,session:fe,user:N,page:he,sessionRecording:xe};return b&&Xl.register(Se),fe.recordSDKStartupDuration(S.getNowMillis()-k),Se}catch(e){let t=e instanceof Error?e.message:`Unknown error.`;return _.error(`failed to initialize the SDK: ${t}`),!1}},xh=({registerGlobally:e,sdkLocalStorage:t})=>{let n=new Vo({storage:t});return e&&fa.setGlobalUserManager(n),n},Sh=({limitManager:e,registerGlobally:t,sdkLocalStorage:n,sdkSessionStorage:r})=>{let i=new Po({limitManager:e,storage:n,sessionStorage:r});return t&&Zi.setGlobalSessionManager(i),i},Ch=({resource:e,spanSessionManager:t,userManager:n,spanExporters:r,spanProcessors:i=[],propagator:a=null,contextManager:o=null,attributeScrubbers:s,registerGlobally:c,mxlSpanProcessor:l,pageManager:u})=>{let d=[...i,mc(t),new jl,new Il,new Wl({userManager:n}),new Vl({pageManager:u}),new Hl({attributeScrubbers:s})];r==null||r.forEach(e=>{d.push(new Hr(e))}),l&&d.push(l);let f=new oi({resource:e,spanProcessors:d,spanLimits:{attributeCountLimit:wo.maxAllowed.session_property*2,eventCountLimit:wo.maxAllowed.breadcrumb*2}}),p=new Fo({tracerProvider:c?void 0:f});return c&&(aa.setGlobalTraceManager(p),f.register({contextManager:o||new ri,propagator:a})),{tracerProvider:f,mxlTraceManager:p}},wh=({resource:e,userManager:t,logExporters:n,logProcessors:r,spanSessionManager:i,limitManager:a,attributeScrubbers:o,registerGlobally:s,mxlLogProcessor:c,sdkLocalStorage:l,pageManager:u})=>{let d=[...r,new Ml({spanSessionManager:i}),new Al,new Pl,new Ul({userManager:t}),new Nl({attributeScrubbers:o}),new Bl({pageManager:u})];n==null||n.forEach(e=>{d.push(new fc(e))}),c&&d.push(c);let f=new sc({resource:e,processors:d}),p=new Oo({spanSessionManager:i,limitManager:a,loggerProvider:s?void 0:f,storage:l});return s&&(Ja.setGlobalLoggerProvider(f),Li.setGlobalLogManager(p)),{loggerProvider:f,mxlLogManager:p}},Th=({useDocumentTitleAsPageLabel:e,registerGlobally:t})=>{let n=new ko({useDocumentTitleAsPageLabel:e});return t&&Wi.setGlobalPageManager(n),n};return Object.defineProperty(e,`DiagLogLevel`,{enumerable:!0,get:function(){return S}}),e.attributes=pa,e.getNavigationInstrumentation=uo,e.initSDK=bh,e.log=Li,e.page=Wi,e.session=Zi,e.trace=aa,e.user=fa,e})({});
39
59
  //# sourceMappingURL=mxl-web-sdk.js.map