@monoscopetech/browser 0.4.4 → 0.5.0
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.
- package/dist/monoscope.min.js +1 -1
- package/dist/monoscope.min.js.map +1 -1
- package/dist/monoscope.umd.js +1 -1
- package/dist/monoscope.umd.js.map +1 -1
- package/dist/tracing.js +1 -1
- package/package.json +7 -7
- package/dist/browser.js +0 -21
- package/dist/browser.js.map +0 -1
package/dist/monoscope.umd.js
CHANGED
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
* @license Angular v<unknown>
|
|
18
18
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
19
19
|
* License: MIT
|
|
20
|
-
*/const Wd=globalThis;function Hd(e){return(Wd.__Zone_symbol_prefix||"__zone_symbol__")+e}const Yd=Object.getOwnPropertyDescriptor,Kd=Object.defineProperty,Jd=Object.getPrototypeOf,Xd=Object.create,qd=Array.prototype.slice,Qd="addEventListener",$d="removeEventListener",ef=Hd(Qd),tf=Hd($d),rf="true",nf="false",sf=Hd("");function of(e,t){return Zone.current.wrap(e,t)}function af(e,t,r,n,s){return Zone.current.scheduleMacroTask(e,t,r,n,s)}const lf=Hd,cf="undefined"!=typeof window,uf=cf?window:void 0,hf=cf&&uf||globalThis;function pf(e,t){for(let r=e.length-1;r>=0;r--)"function"==typeof e[r]&&(e[r]=of(e[r],t+"_"+r));return e}function df(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&void 0===e.set)}const ff="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,mf=!("nw"in hf)&&void 0!==hf.process&&"[object process]"===hf.process.toString(),gf=!mf&&!ff&&!(!cf||!uf.HTMLElement),yf=void 0!==hf.process&&"[object process]"===hf.process.toString()&&!ff&&!(!cf||!uf.HTMLElement),bf={},vf=lf("enable_beforeunload"),wf=function(e){if(!(e=e||hf.event))return;let t=bf[e.type];t||(t=bf[e.type]=lf("ON_PROPERTY"+e.type));const r=this||e.target||hf,n=r[t];let s;if(gf&&r===uf&&"error"===e.type){const t=e;s=n&&n.call(this,t.message,t.filename,t.lineno,t.colno,t.error),!0===s&&e.preventDefault()}else s=n&&n.apply(this,arguments),"beforeunload"===e.type&&hf[vf]&&"string"==typeof s?e.returnValue=s:null==s||s||e.preventDefault();return s};function Cf(e,t,r){let n=Yd(e,t);if(!n&&r){Yd(r,t)&&(n={enumerable:!0,configurable:!0})}if(!n||!n.configurable)return;const s=lf("on"+t+"patched");if(e.hasOwnProperty(s)&&e[s])return;delete n.writable,delete n.value;const o=n.get,i=n.set,a=t.slice(2);let l=bf[a];l||(l=bf[a]=lf("ON_PROPERTY"+a)),n.set=function(t){let r=this;if(r||e!==hf||(r=hf),!r)return;"function"==typeof r[l]&&r.removeEventListener(a,wf),i?.call(r,null),r[l]=t,"function"==typeof t&&r.addEventListener(a,wf,!1)},n.get=function(){let r=this;if(r||e!==hf||(r=hf),!r)return null;const s=r[l];if(s)return s;if(o){let e=o.call(this);if(e)return n.set.call(this,e),"function"==typeof r.removeAttribute&&r.removeAttribute(t),e}return null},Kd(e,t,n),e[s]=!0}function Sf(e,t,r){if(t)for(let n=0;n<t.length;n++)Cf(e,"on"+t[n],r);else{const t=[];for(const r in e)"on"==r.slice(0,2)&&t.push(r);for(let n=0;n<t.length;n++)Cf(e,t[n],r)}}const _f=lf("originalInstance");function If(e){const t=hf[e];if(!t)return;hf[lf(e)]=t,hf[e]=function(){const r=pf(arguments,e);switch(r.length){case 0:this[_f]=new t;break;case 1:this[_f]=new t(r[0]);break;case 2:this[_f]=new t(r[0],r[1]);break;case 3:this[_f]=new t(r[0],r[1],r[2]);break;case 4:this[_f]=new t(r[0],r[1],r[2],r[3]);break;default:throw new Error("Arg list too long.")}},Tf(hf[e],t);const r=new t(function(){});let n;for(n in r)"XMLHttpRequest"===e&&"responseBlob"===n||function(t){"function"==typeof r[t]?hf[e].prototype[t]=function(){return this[_f][t].apply(this[_f],arguments)}:Kd(hf[e].prototype,t,{set:function(r){"function"==typeof r?(this[_f][t]=of(r,e+"."+t),Tf(this[_f][t],r)):this[_f][t]=r},get:function(){return this[_f][t]}})}(n);for(n in t)"prototype"!==n&&t.hasOwnProperty(n)&&(hf[e][n]=t[n])}function Af(e,t,r){let n=e;for(;n&&!n.hasOwnProperty(t);)n=Jd(n);!n&&e[t]&&(n=e);const s=lf(t);let o=null;if(n&&(!(o=n[s])||!n.hasOwnProperty(s))){o=n[s]=n[t];if(df(n&&Yd(n,t))){const e=r(o,s,t);n[t]=function(){return e(this,arguments)},Tf(n[t],o)}}return o}function Ef(e,t,r){let n=null;function s(e){const t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},n.apply(t.target,t.args),e}n=Af(e,t,e=>function(t,n){const o=r(t,n);return o.cbIdx>=0&&"function"==typeof n[o.cbIdx]?af(o.name,n[o.cbIdx],o,s):e.apply(t,n)})}function Tf(e,t){e[lf("OriginalDelegate")]=t}let kf=!1,Of=!1;function Rf(){if(kf)return Of;kf=!0;try{const e=uf.navigator.userAgent;-1===e.indexOf("MSIE ")&&-1===e.indexOf("Trident/")&&-1===e.indexOf("Edge/")||(Of=!0)}catch(e){}return Of}function xf(e){return"function"==typeof e}function Nf(e){return"number"==typeof e}const Mf={useG:!0},Lf={},Df={},Pf=new RegExp("^"+sf+"(\\w+)(true|false)$"),Ff=lf("propagationStopped");function Bf(e,t){const r=(t?t(e):e)+nf,n=(t?t(e):e)+rf,s=sf+r,o=sf+n;Lf[e]={},Lf[e][nf]=s,Lf[e][rf]=o}function Uf(e,t,r,n){const s=n&&n.add||Qd,o=n&&n.rm||$d,i=n&&n.listeners||"eventListeners",a=n&&n.rmAll||"removeAllListeners",l=lf(s),c="."+s+":",u="prependListener",h="."+u+":",p=function(e,t,r){if(e.isRemoved)return;const n=e.callback;let s;"object"==typeof n&&n.handleEvent&&(e.callback=e=>n.handleEvent(e),e.originalDelegate=n);try{e.invoke(e,t,[r])}catch(e){s=e}const i=e.options;if(i&&"object"==typeof i&&i.once){const n=e.originalDelegate?e.originalDelegate:e.callback;t[o].call(t,r.type,n,i)}return s};function d(r,n,s){if(!(n=n||e.event))return;const o=r||n.target||e,i=o[Lf[n.type][s?rf:nf]];if(i){const e=[];if(1===i.length){const t=p(i[0],o,n);t&&e.push(t)}else{const t=i.slice();for(let r=0;r<t.length&&(!n||!0!==n[Ff]);r++){const s=p(t[r],o,n);s&&e.push(s)}}if(1===e.length)throw e[0];for(let r=0;r<e.length;r++){const n=e[r];t.nativeScheduleMicroTask(()=>{throw n})}}}const f=function(e){return d(this,e,!1)},m=function(e){return d(this,e,!0)};function g(t,r){if(!t)return!1;let n=!0;r&&void 0!==r.useG&&(n=r.useG);const p=r&&r.vh;let d=!0;r&&void 0!==r.chkDup&&(d=r.chkDup);let g=!1;r&&void 0!==r.rt&&(g=r.rt);let y=t;for(;y&&!y.hasOwnProperty(s);)y=Jd(y);if(!y&&t[s]&&(y=t),!y)return!1;if(y[l])return!1;const b=r&&r.eventNameToString,v={},w=y[l]=y[s],C=y[lf(o)]=y[o],S=y[lf(i)]=y[i],_=y[lf(a)]=y[a];let I;r&&r.prepend&&(I=y[lf(r.prepend)]=y[r.prepend]);const A=function(e){return I.call(v.target,v.eventName,e.invoke,v.options)},E=n?function(e){if(!v.isExisting)return w.call(v.target,v.eventName,v.capture?m:f,v.options)}:function(e){return w.call(v.target,v.eventName,e.invoke,v.options)},T=n?function(e){if(!e.isRemoved){const t=Lf[e.eventName];let r;t&&(r=t[e.capture?rf:nf]);const n=r&&e.target[r];if(n)for(let t=0;t<n.length;t++){if(n[t]===e){n.splice(t,1),e.isRemoved=!0,e.removeAbortListener&&(e.removeAbortListener(),e.removeAbortListener=null),0===n.length&&(e.allRemoved=!0,e.target[r]=null);break}}}if(e.allRemoved)return C.call(e.target,e.eventName,e.capture?m:f,e.options)}:function(e){return C.call(e.target,e.eventName,e.invoke,e.options)},k=r?.diff||function(e,t){const r=typeof t;return"function"===r&&e.callback===t||"object"===r&&e.originalDelegate===t},O=Zone[lf("UNPATCHED_EVENTS")],R=e[lf("PASSIVE_EVENTS")];const x=function(t,s,o,i,a=!1,l=!1){return function(){const c=this||e;let u=arguments[0];r&&r.transferEventName&&(u=r.transferEventName(u));let h=arguments[1];if(!h)return t.apply(this,arguments);if(mf&&"uncaughtException"===u)return t.apply(this,arguments);let f=!1;if("function"!=typeof h){if(!h.handleEvent)return t.apply(this,arguments);f=!0}if(p&&!p(t,h,c,arguments))return;const m=!!R&&-1!==R.indexOf(u),g=function(e){if("object"==typeof e&&null!==e){const t={...e};return e.signal&&(t.signal=e.signal),t}return e}(function(e,t){return t?"boolean"==typeof e?{capture:e,passive:!0}:e?"object"==typeof e&&!1!==e.passive?{...e,passive:!0}:e:{passive:!0}:e}(arguments[2],m)),y=g?.signal;if(y?.aborted)return;if(O)for(let e=0;e<O.length;e++)if(u===O[e])return m?t.call(c,u,h,g):t.apply(this,arguments);const w=!!g&&("boolean"==typeof g||g.capture),C=!(!g||"object"!=typeof g)&&g.once,S=Zone.current;let _=Lf[u];_||(Bf(u,b),_=Lf[u]);const I=_[w?rf:nf];let A,E=c[I],T=!1;if(E){if(T=!0,d)for(let e=0;e<E.length;e++)if(k(E[e],h))return}else E=c[I]=[];const x=c.constructor.name,N=Df[x];N&&(A=N[u]),A||(A=x+s+(b?b(u):u)),v.options=g,C&&(v.options.once=!1),v.target=c,v.capture=w,v.eventName=u,v.isExisting=T;const M=n?Mf:void 0;M&&(M.taskData=v),y&&(v.options.signal=void 0);const L=S.scheduleEventTask(A,h,M,o,i);if(y){v.options.signal=y;const e=()=>L.zone.cancelTask(L);t.call(y,"abort",e,{once:!0}),L.removeAbortListener=()=>y.removeEventListener("abort",e)}return v.target=null,M&&(M.taskData=null),C&&(v.options.once=!0),"boolean"!=typeof L.options&&(L.options=g),L.target=c,L.capture=w,L.eventName=u,f&&(L.originalDelegate=h),l?E.unshift(L):E.push(L),a?c:void 0}};return y[s]=x(w,c,E,T,g),I&&(y[u]=x(I,h,A,T,g,!0)),y[o]=function(){const t=this||e;let n=arguments[0];r&&r.transferEventName&&(n=r.transferEventName(n));const s=arguments[2],o=!!s&&("boolean"==typeof s||s.capture),i=arguments[1];if(!i)return C.apply(this,arguments);if(p&&!p(C,i,t,arguments))return;const a=Lf[n];let l;a&&(l=a[o?rf:nf]);const c=l&&t[l];if(c)for(let e=0;e<c.length;e++){const r=c[e];if(k(r,i)){if(c.splice(e,1),r.isRemoved=!0,0===c.length&&(r.allRemoved=!0,t[l]=null,!o&&"string"==typeof n)){t[sf+"ON_PROPERTY"+n]=null}return r.zone.cancelTask(r),g?t:void 0}}return C.apply(this,arguments)},y[i]=function(){const t=this||e;let n=arguments[0];r&&r.transferEventName&&(n=r.transferEventName(n));const s=[],o=Zf(t,b?b(n):n);for(let e=0;e<o.length;e++){const t=o[e];let r=t.originalDelegate?t.originalDelegate:t.callback;s.push(r)}return s},y[a]=function(){const t=this||e;let n=arguments[0];if(n){r&&r.transferEventName&&(n=r.transferEventName(n));const e=Lf[n];if(e){const r=e[nf],s=e[rf],i=t[r],a=t[s];if(i){const e=i.slice();for(let t=0;t<e.length;t++){const r=e[t];let s=r.originalDelegate?r.originalDelegate:r.callback;this[o].call(this,n,s,r.options)}}if(a){const e=a.slice();for(let t=0;t<e.length;t++){const r=e[t];let s=r.originalDelegate?r.originalDelegate:r.callback;this[o].call(this,n,s,r.options)}}}}else{const e=Object.keys(t);for(let t=0;t<e.length;t++){const r=e[t],n=Pf.exec(r);let s=n&&n[1];s&&"removeListener"!==s&&this[a].call(this,s)}this[a].call(this,"removeListener")}if(g)return this},Tf(y[s],w),Tf(y[o],C),_&&Tf(y[a],_),S&&Tf(y[i],S),!0}let y=[];for(let e=0;e<r.length;e++)y[e]=g(r[e],n);return y}function Zf(e,t){if(!t){const r=[];for(let n in e){const s=Pf.exec(n);let o=s&&s[1];if(o&&(!t||o===t)){const t=e[n];if(t)for(let e=0;e<t.length;e++)r.push(t[e])}}return r}let r=Lf[t];r||(Bf(t),r=Lf[t]);const n=e[r[nf]],s=e[r[rf]];return n?s?n.concat(s):n.slice():s?s.slice():[]}function jf(e,t){const r=e.Event;r&&r.prototype&&t.patchMethod(r.prototype,"stopImmediatePropagation",e=>function(t,r){t[Ff]=!0,e&&e.apply(t,r)})}function zf(e,t){t.patchMethod(e,"queueMicrotask",e=>function(e,t){Zone.current.scheduleMicroTask("queueMicrotask",t[0])})}const Vf=lf("zoneTask");function Gf(e,t,r,n){let s=null,o=null;r+=n;const i={};function a(t){const r=t.data;r.args[0]=function(){return t.invoke.apply(this,arguments)};const n=s.apply(e,r.args);return Nf(n)?r.handleId=n:(r.handle=n,r.isRefreshable=xf(n.refresh)),t}function l(t){const{handle:r,handleId:n}=t.data;return o.call(e,r??n)}s=Af(e,t+=n,r=>function(s,o){if(xf(o[0])){const e={isRefreshable:!1,isPeriodic:"Interval"===n,delay:"Timeout"===n||"Interval"===n?o[1]||0:void 0,args:o},r=o[0];o[0]=function(){try{return r.apply(this,arguments)}finally{const{handle:t,handleId:r,isPeriodic:n,isRefreshable:s}=e;n||s||(r?delete i[r]:t&&(t[Vf]=null))}};const s=af(t,o[0],e,a,l);if(!s)return s;const{handleId:c,handle:u,isRefreshable:h,isPeriodic:p}=s.data;if(c)i[c]=s;else if(u&&(u[Vf]=s,h&&!p)){const e=u.refresh;u.refresh=function(){const{zone:t,state:r}=s;return"notScheduled"===r?(s._state="scheduled",t._updateTaskCount(s,1)):"running"===r&&(s._state="scheduling"),e.call(this)}}return u??c??s}return r.apply(e,o)}),o=Af(e,r,t=>function(r,n){const s=n[0];let o;Nf(s)?(o=i[s],delete i[s]):(o=s?.[Vf],o?s[Vf]=null:o=s),o?.type?o.cancelFn&&o.zone.cancelTask(o):t.apply(e,n)})}function Wf(e,t){if(Zone[t.symbol("patchEventTarget")])return;const{eventNames:r,zoneSymbolEventNames:n,TRUE_STR:s,FALSE_STR:o,ZONE_SYMBOL_PREFIX:i}=t.getGlobalObjects();for(let e=0;e<r.length;e++){const t=r[e],a=i+(t+o),l=i+(t+s);n[t]={},n[t][o]=a,n[t][s]=l}const a=e.EventTarget;return a&&a.prototype?(t.patchEventTarget(e,t,[a&&a.prototype]),!0):void 0}function Hf(e,t,r){if(!r||0===r.length)return t;const n=r.filter(t=>t.target===e);if(0===n.length)return t;const s=n[0].ignoreProperties;return t.filter(e=>-1===s.indexOf(e))}function Yf(e,t,r,n){if(!e)return;Sf(e,Hf(e,t,r),n)}function Kf(e){return Object.getOwnPropertyNames(e).filter(e=>e.startsWith("on")&&e.length>2).map(e=>e.substring(2))}function Jf(e,t){if(mf&&!yf)return;if(Zone[e.symbol("patchEvents")])return;const r=t.__Zone_ignore_on_properties;let n=[];if(gf){const e=window;n=n.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);const t=[];Yf(e,Kf(e),r?r.concat(t):r,Jd(e))}n=n.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let e=0;e<n.length;e++){const s=t[n[e]];s?.prototype&&Yf(s.prototype,Kf(s.prototype),r)}}function Xf(e){e.__load_patch("ZoneAwarePromise",(e,t,r)=>{const n=Object.getOwnPropertyDescriptor,s=Object.defineProperty;const o=r.symbol,i=[],a=!1!==e[o("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],l=o("Promise"),c=o("then");r.onUnhandledError=e=>{if(r.showUncaughtError()){const t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},r.microtaskDrainDone=()=>{for(;i.length;){const e=i.shift();try{e.zone.runGuarded(()=>{if(e.throwOriginal)throw e.rejection;throw e})}catch(e){h(e)}}};const u=o("unhandledPromiseRejectionHandler");function h(e){r.onUnhandledError(e);try{const r=t[u];"function"==typeof r&&r.call(this,e)}catch(e){}}function p(e){return e&&"function"==typeof e.then}function d(e){return e}function f(e){return M.reject(e)}const m=o("state"),g=o("value"),y=o("finally"),b=o("parentPromiseValue"),v=o("parentPromiseState"),w=null,C=!0,S=!1;function _(e,t){return r=>{try{T(e,t,r)}catch(t){T(e,!1,t)}}}const I=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},A="Promise resolved with itself",E=o("currentTaskTrace");function T(e,n,o){const l=I();if(e===o)throw new TypeError(A);if(e[m]===w){let c=null;try{"object"!=typeof o&&"function"!=typeof o||(c=o&&o.then)}catch(t){return l(()=>{T(e,!1,t)})(),e}if(n!==S&&o instanceof M&&o.hasOwnProperty(m)&&o.hasOwnProperty(g)&&o[m]!==w)O(o),T(e,o[m],o[g]);else if(n!==S&&"function"==typeof c)try{c.call(o,l(_(e,n)),l(_(e,!1)))}catch(t){l(()=>{T(e,!1,t)})()}else{e[m]=n;const l=e[g];if(e[g]=o,e[y]===y&&n===C&&(e[m]=e[v],e[g]=e[b]),n===S&&o instanceof Error){const e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&s(o,E,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t<l.length;)R(e,l[t++],l[t++],l[t++],l[t++]);if(0==l.length&&n==S){e[m]=0;let n=o;try{throw new Error("Uncaught (in promise): "+function(e){if(e&&e.toString===Object.prototype.toString){return(e.constructor&&e.constructor.name||"")+": "+JSON.stringify(e)}return e?e.toString():Object.prototype.toString.call(e)}(o)+(o&&o.stack?"\n"+o.stack:""))}catch(e){n=e}a&&(n.throwOriginal=!0),n.rejection=o,n.promise=e,n.zone=t.current,n.task=t.currentTask,i.push(n),r.scheduleMicroTask()}}}return e}const k=o("rejectionHandledHandler");function O(e){if(0===e[m]){try{const r=t[k];r&&"function"==typeof r&&r.call(this,{rejection:e[g],promise:e})}catch(e){}e[m]=S;for(let t=0;t<i.length;t++)e===i[t].promise&&i.splice(t,1)}}function R(e,t,r,n,s){O(e);const o=e[m],i=o?"function"==typeof n?n:d:"function"==typeof s?s:f;t.scheduleMicroTask("Promise.then",()=>{try{const n=e[g],s=!!r&&y===r[y];s&&(r[b]=n,r[v]=o);const a=t.run(i,void 0,s&&i!==f&&i!==d?[]:[n]);T(r,!0,a)}catch(e){T(r,!1,e)}},r)}const x=function(){},N=e.AggregateError;class M{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(e){return e instanceof M?e:T(new this(null),C,e)}static reject(e){return T(new this(null),S,e)}static withResolvers(){const e={};return e.promise=new M((t,r)=>{e.resolve=t,e.reject=r}),e}static any(e){if(!e||"function"!=typeof e[Symbol.iterator])return Promise.reject(new N([],"All promises were rejected"));const t=[];let r=0;try{for(let n of e)r++,t.push(M.resolve(n))}catch(e){return Promise.reject(new N([],"All promises were rejected"))}if(0===r)return Promise.reject(new N([],"All promises were rejected"));let n=!1;const s=[];return new M((e,o)=>{for(let i=0;i<t.length;i++)t[i].then(t=>{n||(n=!0,e(t))},e=>{s.push(e),r--,0===r&&(n=!0,o(new N(s,"All promises were rejected")))})})}static race(e){let t,r,n=new this((e,n)=>{t=e,r=n});function s(e){t(e)}function o(e){r(e)}for(let t of e)p(t)||(t=this.resolve(t)),t.then(s,o);return n}static all(e){return M.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof M?this:M).allWithCallback(e,{thenCallback:e=>({status:"fulfilled",value:e}),errorCallback:e=>({status:"rejected",reason:e})})}static allWithCallback(e,t){let r,n,s=new this((e,t)=>{r=e,n=t}),o=2,i=0;const a=[];for(let s of e){p(s)||(s=this.resolve(s));const e=i;try{s.then(n=>{a[e]=t?t.thenCallback(n):n,o--,0===o&&r(a)},s=>{t?(a[e]=t.errorCallback(s),o--,0===o&&r(a)):n(s)})}catch(e){n(e)}o++,i++}return o-=2,0===o&&r(a),s}constructor(e){const t=this;if(!(t instanceof M))throw new Error("Must be an instanceof Promise.");t[m]=w,t[g]=[];try{const r=I();e&&e(r(_(t,C)),r(_(t,S)))}catch(e){T(t,!1,e)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return M}then(e,r){let n=this.constructor?.[Symbol.species];n&&"function"==typeof n||(n=this.constructor||M);const s=new n(x),o=t.current;return this[m]==w?this[g].push(o,s,e,r):R(this,o,s,e,r),s}catch(e){return this.then(null,e)}finally(e){let r=this.constructor?.[Symbol.species];r&&"function"==typeof r||(r=M);const n=new r(x);n[y]=y;const s=t.current;return this[m]==w?this[g].push(s,n,e,e):R(this,s,n,e,e),n}}M.resolve=M.resolve,M.reject=M.reject,M.race=M.race,M.all=M.all;const L=e[l]=e.Promise;e.Promise=M;const D=o("thenPatched");function P(e){const t=e.prototype,r=n(t,"then");if(r&&(!1===r.writable||!r.configurable))return;const s=t.then;t[c]=s,e.prototype.then=function(e,t){const r=new M((e,t)=>{s.call(this,e,t)});return r.then(e,t)},e[D]=!0}return r.patchThen=P,L&&(P(L),Af(e,"fetch",e=>{return t=e,function(e,r){let n=t.apply(e,r);if(n instanceof M)return n;let s=n.constructor;return s[D]||P(s),n};var t})),Promise[t.__symbol__("uncaughtPromiseErrors")]=i,M})}function qf(e,t,r,n,s){const o=Zone.__symbol__(n);if(t[o])return;const i=t[o]=t[n];t[n]=function(o,a,l){return a&&a.prototype&&s.forEach(function(t){const s=`${r}.${n}::`+t,o=a.prototype;try{if(o.hasOwnProperty(t)){const r=e.ObjectGetOwnPropertyDescriptor(o,t);r&&r.value?(r.value=e.wrapWithCurrentZone(r.value,s),e._redefineProperty(a.prototype,t,r)):o[t]&&(o[t]=e.wrapWithCurrentZone(o[t],s))}else o[t]&&(o[t]=e.wrapWithCurrentZone(o[t],s))}catch{}}),i.call(t,o,a,l)},e.attachOriginToPatched(t[n],i)}const Qf=function(){const e=globalThis,t=!0===e[Hd("forceDuplicateZoneCheck")];if(e.Zone&&(t||"function"!=typeof e.Zone.__symbol__))throw new Error("Zone already loaded.");return e.Zone??=function(){const e=Wd.performance;function t(t){e&&e.mark&&e.mark(t)}function r(t,r){e&&e.measure&&e.measure(t,r)}t("Zone");class n{static __symbol__=Hd;static assertZonePatched(){if(Wd.Promise!==E.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let e=n.current;for(;e.parent;)e=e.parent;return e}static get current(){return k.zone}static get currentTask(){return O}static __load_patch(e,s,o=!1){if(E.hasOwnProperty(e)){const t=!0===Wd[Hd("forceDuplicateZoneCheck")];if(!o&&t)throw Error("Already loaded patch: "+e)}else if(!Wd["__Zone_disable_"+e]){const o="Zone:"+e;t(o),E[e]=s(Wd,n,T),r(o,o)}}get parent(){return this._parent}get name(){return this._name}_parent;_name;_properties;_zoneDelegate;constructor(e,t){this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new o(this,this._parent&&this._parent._zoneDelegate,t)}get(e){const t=this.getZoneWith(e);if(t)return t._properties[e]}getZoneWith(e){let t=this;for(;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}fork(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}wrap(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);const r=this._zoneDelegate.intercept(this,e,t),n=this;return function(){return n.runGuarded(r,this,arguments,t)}}run(e,t,r,n){k={parent:k,zone:this};try{return this._zoneDelegate.invoke(this,e,t,r,n)}finally{k=k.parent}}runGuarded(e,t=null,r,n){k={parent:k,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,r,n)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{k=k.parent}}runTask(e,t,r){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||g).name+"; Execution: "+this.name+")");const n=e,{type:s,data:{isPeriodic:o=!1,isRefreshable:i=!1}={}}=e;if(e.state===y&&(s===A||s===I))return;const a=e.state!=w;a&&n._transitionTo(w,v);const l=O;O=n,k={parent:k,zone:this};try{s!=I||!e.data||o||i||(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,n,t,r)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{const t=e.state;if(t!==y&&t!==S)if(s==A||o||i&&t===b)a&&n._transitionTo(v,w,b);else{const e=n._zoneDelegates;this._updateTaskCount(n,-1),a&&n._transitionTo(y,w,y),i&&(n._zoneDelegates=e)}k=k.parent,O=l}}scheduleTask(e){if(e.zone&&e.zone!==this){let t=this;for(;t;){if(t===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);t=t.parent}}e._transitionTo(b,y);const t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(t){throw e._transitionTo(S,b,y),this._zoneDelegate.handleError(this,t),t}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==b&&e._transitionTo(v,b),e}scheduleMicroTask(e,t,r,n){return this.scheduleTask(new i(_,e,t,r,n,void 0))}scheduleMacroTask(e,t,r,n,s){return this.scheduleTask(new i(I,e,t,r,n,s))}scheduleEventTask(e,t,r,n,s){return this.scheduleTask(new i(A,e,t,r,n,s))}cancelTask(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||g).name+"; Execution: "+this.name+")");if(e.state===v||e.state===w){e._transitionTo(C,v,w);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(S,C),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(y,C),e.runCount=-1,e}}_updateTaskCount(e,t){const r=e._zoneDelegates;-1==t&&(e._zoneDelegates=null);for(let n=0;n<r.length;n++)r[n]._updateTaskCount(e.type,t)}}const s={name:"",onHasTask:(e,t,r,n)=>e.hasTask(r,n),onScheduleTask:(e,t,r,n)=>e.scheduleTask(r,n),onInvokeTask:(e,t,r,n,s,o)=>e.invokeTask(r,n,s,o),onCancelTask:(e,t,r,n)=>e.cancelTask(r,n)};class o{get zone(){return this._zone}_zone;_taskCounts={microTask:0,macroTask:0,eventTask:0};_parentDelegate;_forkDlgt;_forkZS;_forkCurrZone;_interceptDlgt;_interceptZS;_interceptCurrZone;_invokeDlgt;_invokeZS;_invokeCurrZone;_handleErrorDlgt;_handleErrorZS;_handleErrorCurrZone;_scheduleTaskDlgt;_scheduleTaskZS;_scheduleTaskCurrZone;_invokeTaskDlgt;_invokeTaskZS;_invokeTaskCurrZone;_cancelTaskDlgt;_cancelTaskZS;_cancelTaskCurrZone;_hasTaskDlgt;_hasTaskDlgtOwner;_hasTaskZS;_hasTaskCurrZone;constructor(e,t,r){this._zone=e,this._parentDelegate=t,this._forkZS=r&&(r&&r.onFork?r:t._forkZS),this._forkDlgt=r&&(r.onFork?t:t._forkDlgt),this._forkCurrZone=r&&(r.onFork?this._zone:t._forkCurrZone),this._interceptZS=r&&(r.onIntercept?r:t._interceptZS),this._interceptDlgt=r&&(r.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=r&&(r.onIntercept?this._zone:t._interceptCurrZone),this._invokeZS=r&&(r.onInvoke?r:t._invokeZS),this._invokeDlgt=r&&(r.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=r&&(r.onInvoke?this._zone:t._invokeCurrZone),this._handleErrorZS=r&&(r.onHandleError?r:t._handleErrorZS),this._handleErrorDlgt=r&&(r.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=r&&(r.onHandleError?this._zone:t._handleErrorCurrZone),this._scheduleTaskZS=r&&(r.onScheduleTask?r:t._scheduleTaskZS),this._scheduleTaskDlgt=r&&(r.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=r&&(r.onScheduleTask?this._zone:t._scheduleTaskCurrZone),this._invokeTaskZS=r&&(r.onInvokeTask?r:t._invokeTaskZS),this._invokeTaskDlgt=r&&(r.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=r&&(r.onInvokeTask?this._zone:t._invokeTaskCurrZone),this._cancelTaskZS=r&&(r.onCancelTask?r:t._cancelTaskZS),this._cancelTaskDlgt=r&&(r.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=r&&(r.onCancelTask?this._zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const n=r&&r.onHasTask,o=t&&t._hasTaskZS;(n||o)&&(this._hasTaskZS=n?r:s,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,r.onScheduleTask||(this._scheduleTaskZS=s,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this._zone),r.onInvokeTask||(this._invokeTaskZS=s,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this._zone),r.onCancelTask||(this._cancelTaskZS=s,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this._zone))}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new n(e,t)}intercept(e,t,r){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,r):t}invoke(e,t,r,n,s){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,r,n,s):t.apply(r,n)}handleError(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)}scheduleTask(e,t){let r=t;if(this._scheduleTaskZS)this._hasTaskZS&&r._zoneDelegates.push(this._hasTaskDlgtOwner),r=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),r||(r=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=_)throw new Error("Task is missing scheduleFn.");f(t)}return r}invokeTask(e,t,r,n){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,r,n):t.callback.apply(r,n)}cancelTask(e,t){let r;if(this._cancelTaskZS)r=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");r=t.cancelFn(t)}return r}hasTask(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(t){this.handleError(e,t)}}_updateTaskCount(e,t){const r=this._taskCounts,n=r[e],s=r[e]=n+t;if(s<0)throw new Error("More tasks executed then were scheduled.");if(0==n||0==s){const t={microTask:r.microTask>0,macroTask:r.macroTask>0,eventTask:r.eventTask>0,change:e};this.hasTask(this._zone,t)}}}class i{type;source;invoke;callback;data;scheduleFn;cancelFn;_zone=null;runCount=0;_zoneDelegates=null;_state="notScheduled";constructor(e,t,r,n,s,o){if(this.type=e,this.source=t,this.data=n,this.scheduleFn=s,this.cancelFn=o,!r)throw new Error("callback is not defined");this.callback=r;const a=this;e===A&&n&&n.useG?this.invoke=i.invokeTask:this.invoke=function(){return i.invokeTask.call(Wd,a,this,arguments)}}static invokeTask(e,t,r){e||(e=this),R++;try{return e.runCount++,e.zone.runTask(e,t,r)}finally{1==R&&m(),R--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(y,b)}_transitionTo(e,t,r){if(this._state!==t&&this._state!==r)throw new Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${r?" or '"+r+"'":""}, was '${this._state}'.`);this._state=e,e==y&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const a=Hd("setTimeout"),l=Hd("Promise"),c=Hd("then");let u,h=[],p=!1;function d(e){if(u||Wd[l]&&(u=Wd[l].resolve(0)),u){let t=u[c];t||(t=u.then),t.call(u,e)}else Wd[a](e,0)}function f(e){0===R&&0===h.length&&d(m),e&&h.push(e)}function m(){if(!p){for(p=!0;h.length;){const e=h;h=[];for(let t=0;t<e.length;t++){const r=e[t];try{r.zone.runTask(r,null,null)}catch(e){T.onUnhandledError(e)}}}T.microtaskDrainDone(),p=!1}}const g={name:"NO ZONE"},y="notScheduled",b="scheduling",v="scheduled",w="running",C="canceling",S="unknown",_="microTask",I="macroTask",A="eventTask",E={},T={symbol:Hd,currentZoneFrame:()=>k,onUnhandledError:x,microtaskDrainDone:x,scheduleMicroTask:f,showUncaughtError:()=>!n[Hd("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:x,patchMethod:()=>x,bindArguments:()=>[],patchThen:()=>x,patchMacroTask:()=>x,patchEventPrototype:()=>x,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>x,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>x,wrapWithCurrentZone:()=>x,filterProperties:()=>[],attachOriginToPatched:()=>x,_redefineProperty:()=>x,patchCallbacks:()=>x,nativeScheduleMicroTask:d};let k={parent:null,zone:new n(null,null)},O=null,R=0;function x(){}return r("Zone","Zone"),n}(),e.Zone}();!function(e){Xf(e),function(e){e.__load_patch("toString",e=>{const t=Function.prototype.toString,r=lf("OriginalDelegate"),n=lf("Promise"),s=lf("Error"),o=function(){if("function"==typeof this){const o=this[r];if(o)return"function"==typeof o?t.call(o):Object.prototype.toString.call(o);if(this===Promise){const r=e[n];if(r)return t.call(r)}if(this===Error){const r=e[s];if(r)return t.call(r)}}return t.call(this)};o[r]=t,Function.prototype.toString=o;const i=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":i.call(this)}})}(e),function(e){e.__load_patch("util",(e,t,r)=>{const n=Kf(e);r.patchOnProperties=Sf,r.patchMethod=Af,r.bindArguments=pf,r.patchMacroTask=Ef;const s=t.__symbol__("BLACK_LISTED_EVENTS"),o=t.__symbol__("UNPATCHED_EVENTS");e[o]&&(e[s]=e[o]),e[s]&&(t[s]=t[o]=e[s]),r.patchEventPrototype=jf,r.patchEventTarget=Uf,r.isIEOrEdge=Rf,r.ObjectDefineProperty=Kd,r.ObjectGetOwnPropertyDescriptor=Yd,r.ObjectCreate=Xd,r.ArraySlice=qd,r.patchClass=If,r.wrapWithCurrentZone=of,r.filterProperties=Hf,r.attachOriginToPatched=Tf,r._redefineProperty=Object.defineProperty,r.patchCallbacks=qf,r.getGlobalObjects=()=>({globalSources:Df,zoneSymbolEventNames:Lf,eventNames:n,isBrowser:gf,isMix:yf,isNode:mf,TRUE_STR:rf,FALSE_STR:nf,ZONE_SYMBOL_PREFIX:sf,ADD_EVENT_LISTENER_STR:Qd,REMOVE_EVENT_LISTENER_STR:$d})})}(e)}(Qf),function(e){e.__load_patch("legacy",t=>{const r=t[e.__symbol__("legacyPatch")];r&&r()}),e.__load_patch("timers",e=>{const t="set",r="clear";Gf(e,t,r,"Timeout"),Gf(e,t,r,"Interval"),Gf(e,t,r,"Immediate")}),e.__load_patch("requestAnimationFrame",e=>{Gf(e,"request","cancel","AnimationFrame"),Gf(e,"mozRequest","mozCancel","AnimationFrame"),Gf(e,"webkitRequest","webkitCancel","AnimationFrame")}),e.__load_patch("blocking",(e,t)=>{const r=["alert","prompt","confirm"];for(let n=0;n<r.length;n++){Af(e,r[n],(r,n,s)=>function(n,o){return t.current.run(r,e,o,s)})}}),e.__load_patch("EventTarget",(e,t,r)=>{!function(e,t){t.patchEventPrototype(e,t)}(e,r),Wf(e,r);const n=e.XMLHttpRequestEventTarget;n&&n.prototype&&r.patchEventTarget(e,r,[n.prototype])}),e.__load_patch("MutationObserver",(e,t,r)=>{If("MutationObserver"),If("WebKitMutationObserver")}),e.__load_patch("IntersectionObserver",(e,t,r)=>{If("IntersectionObserver")}),e.__load_patch("FileReader",(e,t,r)=>{If("FileReader")}),e.__load_patch("on_property",(e,t,r)=>{Jf(r,e)}),e.__load_patch("customElements",(e,t,r)=>{!function(e,t){const{isBrowser:r,isMix:n}=t.getGlobalObjects();if(!r&&!n||!e.customElements||!("customElements"in e))return;t.patchCallbacks(t,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"])}(e,r)}),e.__load_patch("XHR",(e,t)=>{!function(e){const l=e.XMLHttpRequest;if(!l)return;const c=l.prototype;let u=c[ef],h=c[tf];if(!u){const t=e.XMLHttpRequestEventTarget;if(t){const e=t.prototype;u=e[ef],h=e[tf]}}const p="readystatechange",d="scheduled";function f(e){const n=e.data,i=n.target;i[o]=!1,i[a]=!1;const l=i[s];u||(u=i[ef],h=i[tf]),l&&h.call(i,p,l);const c=i[s]=()=>{if(i.readyState===i.DONE)if(!n.aborted&&i[o]&&e.state===d){const r=i[t.__symbol__("loadfalse")];if(0!==i.status&&r&&r.length>0){const s=e.invoke;e.invoke=function(){const r=i[t.__symbol__("loadfalse")];for(let t=0;t<r.length;t++)r[t]===e&&r.splice(t,1);n.aborted||e.state!==d||s.call(e)},r.push(e)}else e.invoke()}else n.aborted||!1!==i[o]||(i[a]=!0)};u.call(i,p,c);return i[r]||(i[r]=e),w.apply(i,n.args),i[o]=!0,e}function m(){}function g(e){const t=e.data;return t.aborted=!0,C.apply(t.target,t.args)}const y=Af(c,"open",()=>function(e,t){return e[n]=0==t[2],e[i]=t[1],y.apply(e,t)}),b=lf("fetchTaskAborting"),v=lf("fetchTaskScheduling"),w=Af(c,"send",()=>function(e,r){if(!0===t.current[v])return w.apply(e,r);if(e[n])return w.apply(e,r);{const t={target:e,url:e[i],isPeriodic:!1,args:r,aborted:!1},n=af("XMLHttpRequest.send",m,t,f,g);e&&!0===e[a]&&!t.aborted&&n.state===d&&n.invoke()}}),C=Af(c,"abort",()=>function(e,n){const s=e[r];if(s&&"string"==typeof s.type){if(null==s.cancelFn||s.data&&s.data.aborted)return;s.zone.cancelTask(s)}else if(!0===t.current[b])return C.apply(e,n)})}(e);const r=lf("xhrTask"),n=lf("xhrSync"),s=lf("xhrListener"),o=lf("xhrScheduled"),i=lf("xhrURL"),a=lf("xhrErrorBeforeScheduled")}),e.__load_patch("geolocation",e=>{e.navigator&&e.navigator.geolocation&&function(e,t){const r=e.constructor.name;for(let n=0;n<t.length;n++){const s=t[n],o=e[s];if(o){if(!df(Yd(e,s)))continue;e[s]=(e=>{const t=function(){return e.apply(this,pf(arguments,r+"."+s))};return Tf(t,e),t})(o)}}}(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),e.__load_patch("PromiseRejectionEvent",(e,t)=>{function r(t){return function(r){Zf(e,t).forEach(n=>{const s=e.PromiseRejectionEvent;if(s){const e=new s(t,{promise:r.promise,reason:r.rejection});n.invoke(e)}})}}e.PromiseRejectionEvent&&(t[lf("unhandledPromiseRejectionHandler")]=r("unhandledrejection"),t[lf("rejectionHandledHandler")]=r("rejectionhandled"))}),e.__load_patch("queueMicrotask",(e,t,r)=>{zf(e,r)})}(Qf);var $f;!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"}($f||($f={}));const em=sh.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function tm(e){return t=e,"undefined"!=typeof Document&&t instanceof Document?(new XMLSerializer).serializeToString(document).length:"string"==typeof e?nm(e):e instanceof Blob?e.size:e instanceof FormData?function(e){let t=0;for(const[r,n]of e.entries())t+=r.length,n instanceof Blob?t+=n.size:t+=n.length;return t}(e):e instanceof URLSearchParams?nm(e.toString()):void 0!==e.byteLength?e.byteLength:void em.warn("unknown body type");var t}const rm=new TextEncoder;function nm(e){return rm.encode(e).byteLength}function sm(e){const t=function(){void 0===im&&(im=om);return im}(),r=e.toUpperCase();return r in t?r:"_OTHER"}const om={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let im;const am={"https:":"443","http:":"80"};const lm="0.203.0";var cm;!function(e){e.HTTP_STATUS_TEXT="http.status_text"}(cm||(cm={}));class um extends Ld{component="xml-http-request";version=lm;moduleName=this.component;_tasksCount=0;_xhrMem=new WeakMap;_usedResources=new WeakSet;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-xml-http-request",lm,e),this._semconvStability=Ud("http",e?.semconvStabilityOptIn)}init(){}_addHeaders(e,t){if(!gd(md(t).href,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return yh.inject(nh.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}const r={};yh.inject(nh.active(),r),Object.keys(r).forEach(t=>{e.setRequestHeader(t,String(r[t]))})}_addChildSpan(e,t){nh.with(vh.setSpan(nh.active(),e),()=>{const e=this.tracer.startSpan("CORS Preflight",{startTime:t[od.FETCH_START]}),r=!(this._semconvStability&Fd.OLD);pd(e,t,this.getConfig().ignoreNetworkEvents,void 0,r),e.end(t[od.RESPONSE_END])})}_addFinalSpanAttributes(e,t,r){if(this._semconvStability&Fd.OLD){if(void 0!==t.status&&e.setAttribute("http.status_code",t.status),void 0!==t.statusText&&e.setAttribute(cm.HTTP_STATUS_TEXT,t.statusText),"string"==typeof r){const t=md(r);e.setAttribute("http.host",t.host),e.setAttribute("http.scheme",t.protocol.replace(":",""))}e.setAttribute("http.user_agent",navigator.userAgent)}this._semconvStability&Fd.STABLE&&t.status&&e.setAttribute(Uh,t.status)}_applyAttributesAfterXHR(e,t){const r=this.getConfig().applyCustomAttributesOnSpan;"function"==typeof r&&Dd(()=>r(e,t),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_addResourceObserver(e,t){const r=this._xhrMem.get(e);r&&"function"==typeof PerformanceObserver&&"function"==typeof PerformanceResourceTiming&&(r.createdResources={observer:new PerformanceObserver(e=>{const n=e.getEntries(),s=md(t);n.forEach(e=>{"xmlhttprequest"===e.initiatorType&&e.name===s.href&&r.createdResources&&r.createdResources.entries.push(e)})}),entries:[]},r.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(Nh.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,r,n,s){if(!(r&&n&&s&&e.createdResources))return;let o=e.createdResources.entries;o&&o.length||(o=Nh.getEntriesByType("resource"));const i=fd(md(r).href,n,s,o,this._usedResources);if(i.mainRequest){const e=i.mainRequest;this._markResourceAsUsed(e);const r=i.corsPreFlightRequest;r&&(this._addChildSpan(t,r),this._markResourceAsUsed(r));const n=!(this._semconvStability&Fd.OLD);pd(t,e,this.getConfig().ignoreNetworkEvents,void 0,n)}}_cleanPreviousSpanInformation(e){const t=this._xhrMem.get(e);if(t){const r=t.callbackToRemoveEvents;r&&r(),this._xhrMem.delete(e)}}_createSpan(e,t,r){if(Lp(t,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let n="";const s=md(t),o={};if(this._semconvStability&Fd.OLD&&(n=r.toUpperCase(),o["http.method"]=r,o["http.url"]=s.toString()),this._semconvStability&Fd.STABLE){const e=r,t=sm(r);n||(n=t),o[Fh]=t,t!==e&&(o[Bh]=e),o[Hh]=s.toString(),o[Zh]=s.hostname;const i=function(e){const t=Number(e.port||am[e.protocol]);return t&&!isNaN(t)?t:void 0}(s);i&&(o[jh]=i)}const i=this.tracer.startSpan(n,{kind:qu.CLIENT,attributes:o});return i.addEvent($f.METHOD_OPEN),this._cleanPreviousSpanInformation(e),this._xhrMem.set(e,{span:i,spanUrl:t}),i}_markResourceAsUsed(e){this._usedResources.add(e)}_patchOpen(){return e=>{const t=this;return function(...r){const n=r[0],s=r[1];return t._createSpan(this,s,n),e.apply(this,r)}}}_patchSend(){const e=this;function t(t,r,n,s){const o=e._xhrMem.get(r);if(!o)return;if(o.status=r.status,o.statusText=r.statusText,e._xhrMem.delete(r),o.span){const t=o.span;e._applyAttributesAfterXHR(t,r),e._semconvStability&Fd.STABLE&&(n?s&&(t.setStatus({code:Qu.ERROR,message:s}),t.setAttribute(Lh,s)):o.status&&o.status>=400&&(t.setStatus({code:Qu.ERROR}),t.setAttribute(Lh,String(o.status))))}const i=$h(),a=Date.now();setTimeout(()=>{!function(t,r,n,s){const o=r.callbackToRemoveEvents;"function"==typeof o&&o();const{span:i,spanUrl:a,sendStartTime:l}=r;i&&(e._findResourceAndAddNetworkEvents(r,i,a,l,n),i.addEvent(t,s),e._addFinalSpanAttributes(i,r,a),i.end(s),e._tasksCount--),e._clearResources()}(t,o,i,a)},300)}function r(){t($f.EVENT_ERROR,this,!0,"error")}function n(){t($f.EVENT_ABORT,this,!1)}function s(){t($f.EVENT_TIMEOUT,this,!0,"timeout")}function o(){this.status<299?t($f.EVENT_LOAD,this,!1):t($f.EVENT_ERROR,this,!1)}return t=>function(...i){const a=e._xhrMem.get(this);if(!a)return t.apply(this,i);const l=a.span,c=a.spanUrl;if(l&&c){if(e.getConfig().measureRequestSize&&i?.[0]){const t=tm(i[0]);void 0!==t&&(e._semconvStability&Fd.OLD&&l.setAttribute("http.request_content_length_uncompressed",t),e._semconvStability&Fd.STABLE&&l.setAttribute("http.request.body.size",t))}nh.with(vh.setSpan(nh.active(),l),()=>{e._tasksCount++,a.sendStartTime=$h(),l.addEvent($f.METHOD_SEND),this.addEventListener("abort",n),this.addEventListener("error",r),this.addEventListener("load",o),this.addEventListener("timeout",s),a.callbackToRemoveEvents=()=>{!function(t){t.removeEventListener("abort",n),t.removeEventListener("error",r),t.removeEventListener("load",o),t.removeEventListener("timeout",s);const i=e._xhrMem.get(t);i&&(i.callbackToRemoveEvents=void 0)}(this),a.createdResources&&a.createdResources.observer.disconnect()},e._addHeaders(this,c),e._addResourceObserver(this,c)})}return t.apply(this,i)}}enable(){this._diag.debug("applying patch to",this.moduleName,this.version),Pd(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),Pd(XMLHttpRequest.prototype.send)&&(this._unwrap(XMLHttpRequest.prototype,"send"),this._diag.debug("removing previous patch from method send")),this._wrap(XMLHttpRequest.prototype,"open",this._patchOpen()),this._wrap(XMLHttpRequest.prototype,"send",this._patchSend())}disable(){this._diag.debug("removing patch from",this.moduleName,this.version),this._unwrap(XMLHttpRequest.prototype,"open"),this._unwrap(XMLHttpRequest.prototype,"send"),this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet}}var hm;!function(e){e.COMPONENT="component",e.HTTP_STATUS_TEXT="http.status_text"}(hm||(hm={}));var pm={};Object.defineProperty(pm,"__esModule",{value:!0});var dm=pm.ATTR_HTTP_USER_AGENT=pm.ATTR_HTTP_URL=pm.ATTR_HTTP_STATUS_CODE=pm.ATTR_HTTP_SCHEME=pm.ATTR_HTTP_RESPONSE_CONTENT_LENGTH=pm.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=pm.ATTR_HTTP_REQUEST_BODY_SIZE=pm.ATTR_HTTP_METHOD=pm.ATTR_HTTP_HOST=void 0,fm=pm.ATTR_HTTP_HOST="http.host",mm=pm.ATTR_HTTP_METHOD="http.method",gm=pm.ATTR_HTTP_REQUEST_BODY_SIZE="http.request.body.size",ym=pm.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED="http.request_content_length_uncompressed";pm.ATTR_HTTP_RESPONSE_CONTENT_LENGTH="http.response_content_length";var bm=pm.ATTR_HTTP_SCHEME="http.scheme",vm=pm.ATTR_HTTP_STATUS_CODE="http.status_code",wm=pm.ATTR_HTTP_URL="http.url";dm=pm.ATTR_HTTP_USER_AGENT="http.user_agent";const Cm=sh.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function Sm(...e){if(e[0]instanceof URL||"string"==typeof e[0]){const t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){const{body:e,length:r}=function(e){if(!e.pipeThrough)return Cm.warn("Platform has ReadableStream but not pipeThrough!"),{body:e,length:Promise.resolve(void 0)};let t,r=0;const n=new Promise(e=>{t=e}),s=new TransformStream({start(){},async transform(e,t){const n=await e;r+=n.byteLength,t.enqueue(e)},flush(){t(r)}});return{body:e.pipeThrough(s),length:n}}(t.body);return t.body=e,r}return Promise.resolve(function(e){if(t=e,"undefined"!=typeof Document&&t instanceof Document)return(new XMLSerializer).serializeToString(document).length;var t;if("string"==typeof e)return Im(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return function(e){let t=0;for(const[r,n]of e.entries())t+=r.length,n instanceof Blob?t+=n.size:t+=n.length;return t}(e);if(e instanceof URLSearchParams)return Im(e.toString());if(void 0!==e.byteLength)return e.byteLength;return void Cm.warn("unknown body type")}(t.body))}{const t=e[0];return t?.body?t.clone().text().then(e=>Im(e)):Promise.resolve()}}const _m=new TextEncoder;function Im(e){return _m.encode(e).byteLength}const Am={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let Em;function Tm(){return void 0===Em&&(Em=Am),Em}const km={"https:":"443","http:":"80"};const Om="0.203.0",Rm="object"==typeof process&&"node"===process.release?.name;class xm extends Ld{component="fetch";version=Om;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-fetch",Om,e),this._semconvStability=Ud("http",e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){const r=this.tracer.startSpan("CORS Preflight",{startTime:t[od.FETCH_START]},vh.setSpan(nh.active(),e)),n=!(this._semconvStability&Fd.OLD);pd(r,t,this.getConfig().ignoreNetworkEvents,void 0,n),r.end(t[od.RESPONSE_END])}_addFinalSpanAttributes(e,t){const r=md(t.url);if(this._semconvStability&Fd.OLD&&(e.setAttribute(vm,t.status),null!=t.statusText&&e.setAttribute(hm.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(fm,r.host),e.setAttribute(bm,r.protocol.replace(":","")),"undefined"!=typeof navigator&&e.setAttribute(dm,navigator.userAgent)),this._semconvStability&Fd.STABLE){e.setAttribute(Uh,t.status),e.setAttribute(Zh,r.hostname);const n=function(e){const t=Number(e.port||km[e.protocol]);return t&&!isNaN(t)?t:void 0}(r);n&&e.setAttribute(jh,n)}}_addHeaders(e,t){if(!gd(t,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return yh.inject(nh.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(e instanceof Request)yh.inject(nh.active(),e.headers,{set:(e,t,r)=>e.set(t,"string"==typeof r?r:String(r))});else if(e.headers instanceof Headers)yh.inject(nh.active(),e.headers,{set:(e,t,r)=>e.set(t,"string"==typeof r?r:String(r))});else if(e.headers instanceof Map)yh.inject(nh.active(),e.headers,{set:(e,t,r)=>e.set(t,"string"==typeof r?r:String(r))});else{const t={};yh.inject(nh.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(Lp(e,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let r="";const n={};if(this._semconvStability&Fd.OLD){const s=(t.method||"GET").toUpperCase();r=`HTTP ${s}`,n[hm.COMPONENT]=this.moduleName,n[mm]=s,n[wm]=e}if(this._semconvStability&Fd.STABLE){const s=t.method,o=function(e){const t=Tm(),r=e.toUpperCase();return r in t?r:"_OTHER"}(t.method||"GET");r||(r=o),n[Fh]=o,o!==s&&(n[Bh]=s),n[Hh]=e}return this.tracer.startSpan(r,{kind:qu.CLIENT,attributes:n})}_findResourceAndAddNetworkEvents(e,t,r){let n=t.entries;if(!n.length){if(!performance.getEntriesByType)return;n=performance.getEntriesByType("resource")}const s=fd(t.spanUrl,t.startTime,r,n,this._usedResources,"fetch");if(s.mainRequest){const t=s.mainRequest;this._markResourceAsUsed(t);const r=s.corsPreFlightRequest;r&&(this._addChildSpan(e,r),this._markResourceAsUsed(r));const n=!(this._semconvStability&Fd.OLD);pd(e,t,this.getConfig().ignoreNetworkEvents,void 0,n)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,r){const n=qh(Date.now()),s=$h();this._addFinalSpanAttributes(e,r),this._semconvStability&Fd.STABLE&&r.status>=400&&(e.setStatus({code:Qu.ERROR}),e.setAttribute(Lh,String(r.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,s),this._tasksCount--,this._clearResources(),e.end(n)},300)}_patchConstructor(){return e=>{const t=this;return function(...r){const n=this,s=md(r[0]instanceof Request?r[0].url:String(r[0])).href,o=r[0]instanceof Request?r[0]:r[1]||{},i=t._createSpan(s,o);if(!i)return e.apply(this,r);const a=t._prepareSpanData(s);function l(e,r){t._applyAttributesAfterFetch(e,o,r),t._endSpan(e,a,{status:r.status||0,statusText:r.message,url:s})}function c(e,r){t._applyAttributesAfterFetch(e,o,r),r.status>=200&&r.status<400?t._endSpan(e,a,r):t._endSpan(e,a,{status:r.status,statusText:r.statusText,url:s})}function u(e,t,r){try{const t=r.clone().body;if(t){const n=t.getReader(),s=()=>{n.read().then(({done:t})=>{t?c(e,r):s()},t=>{l(e,t)})};s()}else c(e,r)}finally{t(r)}}function h(e,t,r){try{l(e,r)}finally{t(r)}}return t.getConfig().measureRequestSize&&Sm(...r).then(e=>{e&&(t._semconvStability&Fd.OLD&&i.setAttribute(ym,e),t._semconvStability&Fd.STABLE&&i.setAttribute(gm,e))}).catch(e=>{t._diag.warn("getFetchBodyLength",e)}),new Promise((r,a)=>nh.with(vh.setSpan(nh.active(),i),()=>(t._addHeaders(o,s),t._callRequestHook(i,o),t._tasksCount++,e.apply(n,o instanceof Request?[o]:[s,o]).then(u.bind(n,i,r),h.bind(n,i,a)))))}}}_applyAttributesAfterFetch(e,t,r){const n=this.getConfig().applyCustomAttributesOnSpan;n&&Dd(()=>n(e,t,r),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_callRequestHook(e,t){const r=this.getConfig().requestHook;r&&Dd(()=>r(e,t),e=>{e&&this._diag.error("requestHook",e)})}_prepareSpanData(e){const t=$h(),r=[];if("function"!=typeof PerformanceObserver)return{entries:r,startTime:t,spanUrl:e};const n=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{"fetch"===t.initiatorType&&t.name===e&&r.push(t)})});return n.observe({entryTypes:["resource"]}),{entries:r,observer:n,startTime:t,spanUrl:e}}enable(){Rm?this._diag.warn("this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()"):(Pd(fetch)&&(this._unwrap(xh,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(xh,"fetch",this._patchConstructor()))}disable(){Rm||(this._unwrap(xh,"fetch"),this._usedResources=new WeakSet)}}class Nm{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class Mm extends Error{code;name="OTLPExporterError";data;constructor(e,t,r){super(e),this.data=r,this.code=t}}function Lm(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function Dm(e){if(null!=e)return()=>e}function Pm(e,t,r){return{timeoutMillis:Lm(e.timeoutMillis??t.timeoutMillis??r.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??r.concurrencyLimit,compression:e.compression??t.compression??r.compression}}class Fm{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);const t=()=>{const t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function Bm(e){return new Fm(e.concurrencyLimit)}function Um(){return{handleResponse(e){null!=e&&function(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}(e)&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&sh.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}class Zm{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,r,n,s){this._transport=e,this._serializer=t,this._responseHandler=r,this._promiseQueue=n,this._timeout=s,this._diagLogger=sh.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit())return void t({code:op.FAILED,error:new Error("Concurrent export limit reached")});const r=this._serializer.serializeRequest(e);null!=r?this._promiseQueue.pushPromise(this._transport.send(r,this._timeout).then(e=>{if("success"!==e.status)"failure"===e.status&&e.error?t({code:op.FAILED,error:e.error}):"retryable"===e.status?t({code:op.FAILED,error:new Mm("Export failed with retryable status")}):t({code:op.FAILED,error:new Mm("Export failed with unknown error")});else{if(null!=e.data)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:op.SUCCESS})}},e=>t({code:op.FAILED,error:e}))):t({code:op.FAILED,error:new Error("Nothing to send")})}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function jm(e,t,r){return n={transport:r,serializer:t,promiseHandler:Bm(e)},s={timeout:e.timeoutMillis},new Zm(n.transport,n.serializer,Um(),n.promiseHandler,s.timeout);var n,s}function zm(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Vm(e){const t=new Uint8Array(e.length/2);let r=0;for(let n=0;n<e.length;n+=2){const s=zm(e.charCodeAt(n)),o=zm(e.charCodeAt(n+1));t[r++]=s<<4|o}return t}function Gm(e){const t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}const Wm="undefined"!=typeof BigInt?function(e){return Gm(e).toString()}:tp;function Hm(e){return e}const Ym={encodeHrTime:function(e){const t=Gm(e);return r=t,{low:Number(BigInt.asUintN(32,r)),high:Number(BigInt.asUintN(32,r>>BigInt(32)))};var r},encodeSpanContext:Vm,encodeOptionalSpanContext:function(e){if(void 0!==e)return Vm(e)}};function Km(e){return{attributes:Xm(e.attributes),droppedAttributesCount:0}}function Jm(e){return{name:e.name,version:e.version}}function Xm(e){return Object.keys(e).map(t=>qm(t,e[t]))}function qm(e,t){return{key:e,value:Qm(t)}}function Qm(e){const t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(Qm)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map(([e,t])=>qm(e,t))}}:{}}function $m(e,t){const r=e.spanContext(),n=e.status,s=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(r.traceId),spanId:t.encodeSpanContext(r.spanId),parentSpanId:s,traceState:r.traceState?.serialize(),name:e.name,kind:null==e.kind?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:Xm(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>function(e,t){return{attributes:e.attributes?Xm(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:n.code,message:n.message},links:e.links.map(e=>function(e,t){return{attributes:e.attributes?Xm(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}(e,t)),droppedLinksCount:e.droppedLinksCount}}function eg(e,t){const r=function(e){return void 0===e?Ym:{encodeHrTime:Wm,encodeSpanContext:Hm,encodeOptionalSpanContext:Hm}}(t);return{resourceSpans:tg(e,r)}}function tg(e,t){const r=function(e){const t=new Map;for(const r of e){let e=t.get(r.resource);e||(e=new Map,t.set(r.resource,e));const n=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`;let s=e.get(n);s||(s=[],e.set(n,s)),s.push(r)}return t}(e),n=[],s=r.entries();let o=s.next();for(;!o.done;){const[e,r]=o.value,i=[],a=r.values();let l=a.next();for(;!l.done;){const e=l.value;if(e.length>0){const r=e.map(e=>$m(e,t));i.push({scope:Jm(e[0].instrumentationScope),spans:r,schemaUrl:e[0].instrumentationScope.schemaUrl})}l=a.next()}const c={resource:Km(e),scopeSpans:i,schemaUrl:void 0};n.push(c),o=s.next()}return n}const rg={serializeRequest:e=>{const t=eg(e,{});return(new TextEncoder).encode(JSON.stringify(t))},deserializeResponse:e=>{if(0===e.length)return{};const t=new TextDecoder;return JSON.parse(t.decode(e))}};function ng(){return.4*Math.random()-.2}class sg{_transport;constructor(e){this._transport=e}retry(e,t,r){return new Promise((n,s)=>{setTimeout(()=>{this._transport.send(e,t).then(n,s)},r)})}async send(e,t){const r=Date.now()+t;let n=await this._transport.send(e,t),s=5,o=1e3;for(;"retryable"===n.status&&s>0;){s--;const t=Math.max(Math.min(o,5e3)+ng(),0);o*=1.5;const i=n.retryInMillis??t,a=r-Date.now();if(i>a)return n;n=await this.retry(e,a,i)}return n}shutdown(){return this._transport.shutdown()}}function og(e){return new sg(e.transport)}function ig(e){if(null==e)return;const t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?1e3*t:-1;const r=new Date(e).getTime()-Date.now();return r>=0?r:0}class ag{_parameters;constructor(e){this._parameters=e}send(e,t){return new Promise(r=>{const n=new XMLHttpRequest;n.timeout=t,n.open("POST",this._parameters.url);const s=this._parameters.headers();Object.entries(s).forEach(([e,t])=>{n.setRequestHeader(e,t)}),n.ontimeout=e=>{r({status:"failure",error:new Error("XHR request timed out")})},n.onreadystatechange=()=>{var e;n.status>=200&&n.status<=299?(sh.debug("XHR success"),r({status:"success"})):n.status&&(e=n.status,[429,502,503,504].includes(e))?r({status:"retryable",retryInMillis:ig(n.getResponseHeader("Retry-After"))}):0!==n.status&&r({status:"failure",error:new Error("XHR request failed with non-retryable status")})},n.onabort=()=>{r({status:"failure",error:new Error("XHR request aborted")})},n.onerror=()=>{r({status:"failure",error:new Error("XHR request errored")})},n.send(e)})}shutdown(){}}class lg{_params;constructor(e){this._params=e}send(e){return new Promise(t=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(sh.debug("SendBeacon success"),t({status:"success"})):t({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function cg(e,t,r){const n={...r()},s={};return()=>(null!=t&&Object.assign(s,t()),null!=e&&Object.assign(s,e()),Object.assign(s,n))}function ug(e){if(null!=e)try{return new URL(e),e}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function hg(e,t,r){return n={url:e.url,timeoutMillis:e.timeoutMillis,headers:Dm(e.headers),concurrencyLimit:e.concurrencyLimit},s={},o=function(e,t){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none",headers:()=>e,url:"http://localhost:4318/"+t,agentOptions:{keepAlive:!0}}}(r,t),{...Pm(n,s,o),headers:cg((i=n.headers,()=>{const e={};return Object.entries(i?.()??{}).forEach(([t,r])=>{void 0!==r?e[t]=String(r):sh.warn(`Header "${t}" has invalid value (${r}) and will be ignored`)}),e}),s.headers,o.headers),url:ug(n.url)??s.url??o.url,agentOptions:n.agentOptions??s.agentOptions??o.agentOptions};var n,s,o,i}function pg(e,t,r,n){const s=!!e.headers||"function"!=typeof navigator.sendBeacon,o=hg(e,r,n);return s?function(e,t){return jm(e,t,og({transport:(r=e,new ag(r))}));var r}(o,t):function(e,t){return jm(e,t,og({transport:(r={url:e.url,blobType:e.headers()["Content-Type"]},new lg(r))}));var r}(o,t)}class dg extends Nm{constructor(e={}){super(pg(e,rg,"v1/traces",{"Content-Type":"application/json"}))}}class fg{constructor(e,t){this.config=e,this.sessionId=t,this.provider=this.createProvider()}createProvider(){const{serviceName:e,resourceAttributes:t,exporterEndpoint:r,projectId:n}=this.config,s=Up({[zh]:e,"at-project-id":n,...t||{}}),o=new dg({url:r||"http://otelcol.apitoolkit.io:4318/v1/traces",headers:{}});return new ld({resource:s,spanProcessors:[new Qp(o)]})}configure(){this.provider.register({contextManager:new Gd,propagator:new mp});const e=this.config.propagateTraceHeaderCorsUrls||[/^https?:\/\/.*/],t=[/^https?:\/\/(?:[^\/]+\.)?apitoolkit\.io\//,/^https?:\/\/(?:[^\/]+\.)?monoscope\.tech\//];!function(e){const t=e.tracerProvider||vh.getTracerProvider(),r=e.meterProvider||ah.getMeterProvider(),n=e.loggerProvider||Ed.getLoggerProvider(),s=e.instrumentations?.flat()??[];(function(e,t,r,n){for(let s=0,o=e.length;s<o;s++){const o=e[s];t&&o.setTracerProvider(t),r&&o.setMeterProvider(r),n&&o.setLoggerProvider&&o.setLoggerProvider(n),o.getConfig().enabled||o.enable()}})(s,t,r,n)}({tracerProvider:this.provider,instrumentations:[...this.config.instrumentations||[],new zd({applyCustomAttributesOnSpan:{documentLoad:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)},documentFetch:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)},resourceFetch:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)}}}),new um({propagateTraceHeaderCorsUrls:e,ignoreUrls:t,applyCustomAttributesOnSpan:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)}}),new xm({propagateTraceHeaderCorsUrls:e,ignoreUrls:t,applyCustomAttributesOnSpan:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)}})]})}setUserAttributes(e){if(this.config.user)for(let t in this.config.user)e.setAttribute(`user.${t}`,this.config.user[t])}async shutdown(){await this.provider.shutdown()}setUser(e){this.config={...this.config,user:{...this.config.user,...e}}}}const mg=[];for(let e=0;e<256;++e)mg.push((e+256).toString(16).slice(1));let gg;const yg=new Uint8Array(16);var bg={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function vg(e,t,r){if(bg.randomUUID&&!e)return bg.randomUUID();const n=(e=e||{}).random??e.rng?.()??function(){if(!gg){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");gg=crypto.getRandomValues.bind(crypto)}return gg(yg)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e,t=0){return(mg[e[t+0]]+mg[e[t+1]]+mg[e[t+2]]+mg[e[t+3]]+"-"+mg[e[t+4]]+mg[e[t+5]]+"-"+mg[e[t+6]]+mg[e[t+7]]+"-"+mg[e[t+8]]+mg[e[t+9]]+"-"+mg[e[t+10]]+mg[e[t+11]]+mg[e[t+12]]+mg[e[t+13]]+mg[e[t+14]]+mg[e[t+15]]).toLowerCase()}(n)}return class{constructor(e){if(!e.projectId)throw new Error("MonoscopeConfig must include projectId");const t=sessionStorage.getItem("monoscope-session-id");t?this.sessionId=t:(this.sessionId=vg(),sessionStorage.setItem("monoscope-session-id",this.sessionId)),this.config=e,this.replay=new Tc(e,this.sessionId),this.otel=new fg(e,this.sessionId),this.otel.configure(),this.replay.configure()}getSessionId(){return this.sessionId}setUser(e){this.otel.setUser(e)}}});
|
|
20
|
+
*/const Wd=globalThis;function Hd(e){return(Wd.__Zone_symbol_prefix||"__zone_symbol__")+e}const Yd=Object.getOwnPropertyDescriptor,Kd=Object.defineProperty,Jd=Object.getPrototypeOf,Xd=Object.create,qd=Array.prototype.slice,Qd="addEventListener",$d="removeEventListener",ef=Hd(Qd),tf=Hd($d),rf="true",nf="false",sf=Hd("");function of(e,t){return Zone.current.wrap(e,t)}function af(e,t,r,n,s){return Zone.current.scheduleMacroTask(e,t,r,n,s)}const lf=Hd,cf="undefined"!=typeof window,uf=cf?window:void 0,hf=cf&&uf||globalThis;function pf(e,t){for(let r=e.length-1;r>=0;r--)"function"==typeof e[r]&&(e[r]=of(e[r],t+"_"+r));return e}function df(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&void 0===e.set)}const ff="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,mf=!("nw"in hf)&&void 0!==hf.process&&"[object process]"===hf.process.toString(),gf=!mf&&!ff&&!(!cf||!uf.HTMLElement),yf=void 0!==hf.process&&"[object process]"===hf.process.toString()&&!ff&&!(!cf||!uf.HTMLElement),bf={},vf=lf("enable_beforeunload"),wf=function(e){if(!(e=e||hf.event))return;let t=bf[e.type];t||(t=bf[e.type]=lf("ON_PROPERTY"+e.type));const r=this||e.target||hf,n=r[t];let s;if(gf&&r===uf&&"error"===e.type){const t=e;s=n&&n.call(this,t.message,t.filename,t.lineno,t.colno,t.error),!0===s&&e.preventDefault()}else s=n&&n.apply(this,arguments),"beforeunload"===e.type&&hf[vf]&&"string"==typeof s?e.returnValue=s:null==s||s||e.preventDefault();return s};function Cf(e,t,r){let n=Yd(e,t);if(!n&&r){Yd(r,t)&&(n={enumerable:!0,configurable:!0})}if(!n||!n.configurable)return;const s=lf("on"+t+"patched");if(e.hasOwnProperty(s)&&e[s])return;delete n.writable,delete n.value;const o=n.get,i=n.set,a=t.slice(2);let l=bf[a];l||(l=bf[a]=lf("ON_PROPERTY"+a)),n.set=function(t){let r=this;if(r||e!==hf||(r=hf),!r)return;"function"==typeof r[l]&&r.removeEventListener(a,wf),i?.call(r,null),r[l]=t,"function"==typeof t&&r.addEventListener(a,wf,!1)},n.get=function(){let r=this;if(r||e!==hf||(r=hf),!r)return null;const s=r[l];if(s)return s;if(o){let e=o.call(this);if(e)return n.set.call(this,e),"function"==typeof r.removeAttribute&&r.removeAttribute(t),e}return null},Kd(e,t,n),e[s]=!0}function Sf(e,t,r){if(t)for(let n=0;n<t.length;n++)Cf(e,"on"+t[n],r);else{const t=[];for(const r in e)"on"==r.slice(0,2)&&t.push(r);for(let n=0;n<t.length;n++)Cf(e,t[n],r)}}const _f=lf("originalInstance");function If(e){const t=hf[e];if(!t)return;hf[lf(e)]=t,hf[e]=function(){const r=pf(arguments,e);switch(r.length){case 0:this[_f]=new t;break;case 1:this[_f]=new t(r[0]);break;case 2:this[_f]=new t(r[0],r[1]);break;case 3:this[_f]=new t(r[0],r[1],r[2]);break;case 4:this[_f]=new t(r[0],r[1],r[2],r[3]);break;default:throw new Error("Arg list too long.")}},Tf(hf[e],t);const r=new t(function(){});let n;for(n in r)"XMLHttpRequest"===e&&"responseBlob"===n||function(t){"function"==typeof r[t]?hf[e].prototype[t]=function(){return this[_f][t].apply(this[_f],arguments)}:Kd(hf[e].prototype,t,{set:function(r){"function"==typeof r?(this[_f][t]=of(r,e+"."+t),Tf(this[_f][t],r)):this[_f][t]=r},get:function(){return this[_f][t]}})}(n);for(n in t)"prototype"!==n&&t.hasOwnProperty(n)&&(hf[e][n]=t[n])}function Af(e,t,r){let n=e;for(;n&&!n.hasOwnProperty(t);)n=Jd(n);!n&&e[t]&&(n=e);const s=lf(t);let o=null;if(n&&(!(o=n[s])||!n.hasOwnProperty(s))){o=n[s]=n[t];if(df(n&&Yd(n,t))){const e=r(o,s,t);n[t]=function(){return e(this,arguments)},Tf(n[t],o)}}return o}function Ef(e,t,r){let n=null;function s(e){const t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},n.apply(t.target,t.args),e}n=Af(e,t,e=>function(t,n){const o=r(t,n);return o.cbIdx>=0&&"function"==typeof n[o.cbIdx]?af(o.name,n[o.cbIdx],o,s):e.apply(t,n)})}function Tf(e,t){e[lf("OriginalDelegate")]=t}let kf=!1,Of=!1;function Rf(){if(kf)return Of;kf=!0;try{const e=uf.navigator.userAgent;-1===e.indexOf("MSIE ")&&-1===e.indexOf("Trident/")&&-1===e.indexOf("Edge/")||(Of=!0)}catch(e){}return Of}function xf(e){return"function"==typeof e}function Nf(e){return"number"==typeof e}const Mf={useG:!0},Lf={},Df={},Pf=new RegExp("^"+sf+"(\\w+)(true|false)$"),Ff=lf("propagationStopped");function Bf(e,t){const r=(t?t(e):e)+nf,n=(t?t(e):e)+rf,s=sf+r,o=sf+n;Lf[e]={},Lf[e][nf]=s,Lf[e][rf]=o}function Uf(e,t,r,n){const s=n&&n.add||Qd,o=n&&n.rm||$d,i=n&&n.listeners||"eventListeners",a=n&&n.rmAll||"removeAllListeners",l=lf(s),c="."+s+":",u="prependListener",h="."+u+":",p=function(e,t,r){if(e.isRemoved)return;const n=e.callback;let s;"object"==typeof n&&n.handleEvent&&(e.callback=e=>n.handleEvent(e),e.originalDelegate=n);try{e.invoke(e,t,[r])}catch(e){s=e}const i=e.options;if(i&&"object"==typeof i&&i.once){const n=e.originalDelegate?e.originalDelegate:e.callback;t[o].call(t,r.type,n,i)}return s};function d(r,n,s){if(!(n=n||e.event))return;const o=r||n.target||e,i=o[Lf[n.type][s?rf:nf]];if(i){const e=[];if(1===i.length){const t=p(i[0],o,n);t&&e.push(t)}else{const t=i.slice();for(let r=0;r<t.length&&(!n||!0!==n[Ff]);r++){const s=p(t[r],o,n);s&&e.push(s)}}if(1===e.length)throw e[0];for(let r=0;r<e.length;r++){const n=e[r];t.nativeScheduleMicroTask(()=>{throw n})}}}const f=function(e){return d(this,e,!1)},m=function(e){return d(this,e,!0)};function g(t,r){if(!t)return!1;let n=!0;r&&void 0!==r.useG&&(n=r.useG);const p=r&&r.vh;let d=!0;r&&void 0!==r.chkDup&&(d=r.chkDup);let g=!1;r&&void 0!==r.rt&&(g=r.rt);let y=t;for(;y&&!y.hasOwnProperty(s);)y=Jd(y);if(!y&&t[s]&&(y=t),!y)return!1;if(y[l])return!1;const b=r&&r.eventNameToString,v={},w=y[l]=y[s],C=y[lf(o)]=y[o],S=y[lf(i)]=y[i],_=y[lf(a)]=y[a];let I;r&&r.prepend&&(I=y[lf(r.prepend)]=y[r.prepend]);const A=function(e){return I.call(v.target,v.eventName,e.invoke,v.options)},E=n?function(e){if(!v.isExisting)return w.call(v.target,v.eventName,v.capture?m:f,v.options)}:function(e){return w.call(v.target,v.eventName,e.invoke,v.options)},T=n?function(e){if(!e.isRemoved){const t=Lf[e.eventName];let r;t&&(r=t[e.capture?rf:nf]);const n=r&&e.target[r];if(n)for(let t=0;t<n.length;t++){if(n[t]===e){n.splice(t,1),e.isRemoved=!0,e.removeAbortListener&&(e.removeAbortListener(),e.removeAbortListener=null),0===n.length&&(e.allRemoved=!0,e.target[r]=null);break}}}if(e.allRemoved)return C.call(e.target,e.eventName,e.capture?m:f,e.options)}:function(e){return C.call(e.target,e.eventName,e.invoke,e.options)},k=r?.diff||function(e,t){const r=typeof t;return"function"===r&&e.callback===t||"object"===r&&e.originalDelegate===t},O=Zone[lf("UNPATCHED_EVENTS")],R=e[lf("PASSIVE_EVENTS")];const x=function(t,s,o,i,a=!1,l=!1){return function(){const c=this||e;let u=arguments[0];r&&r.transferEventName&&(u=r.transferEventName(u));let h=arguments[1];if(!h)return t.apply(this,arguments);if(mf&&"uncaughtException"===u)return t.apply(this,arguments);let f=!1;if("function"!=typeof h){if(!h.handleEvent)return t.apply(this,arguments);f=!0}if(p&&!p(t,h,c,arguments))return;const m=!!R&&-1!==R.indexOf(u),g=function(e){if("object"==typeof e&&null!==e){const t={...e};return e.signal&&(t.signal=e.signal),t}return e}(function(e,t){return t?"boolean"==typeof e?{capture:e,passive:!0}:e?"object"==typeof e&&!1!==e.passive?{...e,passive:!0}:e:{passive:!0}:e}(arguments[2],m)),y=g?.signal;if(y?.aborted)return;if(O)for(let e=0;e<O.length;e++)if(u===O[e])return m?t.call(c,u,h,g):t.apply(this,arguments);const w=!!g&&("boolean"==typeof g||g.capture),C=!(!g||"object"!=typeof g)&&g.once,S=Zone.current;let _=Lf[u];_||(Bf(u,b),_=Lf[u]);const I=_[w?rf:nf];let A,E=c[I],T=!1;if(E){if(T=!0,d)for(let e=0;e<E.length;e++)if(k(E[e],h))return}else E=c[I]=[];const x=c.constructor.name,N=Df[x];N&&(A=N[u]),A||(A=x+s+(b?b(u):u)),v.options=g,C&&(v.options.once=!1),v.target=c,v.capture=w,v.eventName=u,v.isExisting=T;const M=n?Mf:void 0;M&&(M.taskData=v),y&&(v.options.signal=void 0);const L=S.scheduleEventTask(A,h,M,o,i);if(y){v.options.signal=y;const e=()=>L.zone.cancelTask(L);t.call(y,"abort",e,{once:!0}),L.removeAbortListener=()=>y.removeEventListener("abort",e)}return v.target=null,M&&(M.taskData=null),C&&(v.options.once=!0),"boolean"!=typeof L.options&&(L.options=g),L.target=c,L.capture=w,L.eventName=u,f&&(L.originalDelegate=h),l?E.unshift(L):E.push(L),a?c:void 0}};return y[s]=x(w,c,E,T,g),I&&(y[u]=x(I,h,A,T,g,!0)),y[o]=function(){const t=this||e;let n=arguments[0];r&&r.transferEventName&&(n=r.transferEventName(n));const s=arguments[2],o=!!s&&("boolean"==typeof s||s.capture),i=arguments[1];if(!i)return C.apply(this,arguments);if(p&&!p(C,i,t,arguments))return;const a=Lf[n];let l;a&&(l=a[o?rf:nf]);const c=l&&t[l];if(c)for(let e=0;e<c.length;e++){const r=c[e];if(k(r,i)){if(c.splice(e,1),r.isRemoved=!0,0===c.length&&(r.allRemoved=!0,t[l]=null,!o&&"string"==typeof n)){t[sf+"ON_PROPERTY"+n]=null}return r.zone.cancelTask(r),g?t:void 0}}return C.apply(this,arguments)},y[i]=function(){const t=this||e;let n=arguments[0];r&&r.transferEventName&&(n=r.transferEventName(n));const s=[],o=Zf(t,b?b(n):n);for(let e=0;e<o.length;e++){const t=o[e];let r=t.originalDelegate?t.originalDelegate:t.callback;s.push(r)}return s},y[a]=function(){const t=this||e;let n=arguments[0];if(n){r&&r.transferEventName&&(n=r.transferEventName(n));const e=Lf[n];if(e){const r=e[nf],s=e[rf],i=t[r],a=t[s];if(i){const e=i.slice();for(let t=0;t<e.length;t++){const r=e[t];let s=r.originalDelegate?r.originalDelegate:r.callback;this[o].call(this,n,s,r.options)}}if(a){const e=a.slice();for(let t=0;t<e.length;t++){const r=e[t];let s=r.originalDelegate?r.originalDelegate:r.callback;this[o].call(this,n,s,r.options)}}}}else{const e=Object.keys(t);for(let t=0;t<e.length;t++){const r=e[t],n=Pf.exec(r);let s=n&&n[1];s&&"removeListener"!==s&&this[a].call(this,s)}this[a].call(this,"removeListener")}if(g)return this},Tf(y[s],w),Tf(y[o],C),_&&Tf(y[a],_),S&&Tf(y[i],S),!0}let y=[];for(let e=0;e<r.length;e++)y[e]=g(r[e],n);return y}function Zf(e,t){if(!t){const r=[];for(let n in e){const s=Pf.exec(n);let o=s&&s[1];if(o&&(!t||o===t)){const t=e[n];if(t)for(let e=0;e<t.length;e++)r.push(t[e])}}return r}let r=Lf[t];r||(Bf(t),r=Lf[t]);const n=e[r[nf]],s=e[r[rf]];return n?s?n.concat(s):n.slice():s?s.slice():[]}function jf(e,t){const r=e.Event;r&&r.prototype&&t.patchMethod(r.prototype,"stopImmediatePropagation",e=>function(t,r){t[Ff]=!0,e&&e.apply(t,r)})}function zf(e,t){t.patchMethod(e,"queueMicrotask",e=>function(e,t){Zone.current.scheduleMicroTask("queueMicrotask",t[0])})}const Vf=lf("zoneTask");function Gf(e,t,r,n){let s=null,o=null;r+=n;const i={};function a(t){const r=t.data;r.args[0]=function(){return t.invoke.apply(this,arguments)};const n=s.apply(e,r.args);return Nf(n)?r.handleId=n:(r.handle=n,r.isRefreshable=xf(n.refresh)),t}function l(t){const{handle:r,handleId:n}=t.data;return o.call(e,r??n)}s=Af(e,t+=n,r=>function(s,o){if(xf(o[0])){const e={isRefreshable:!1,isPeriodic:"Interval"===n,delay:"Timeout"===n||"Interval"===n?o[1]||0:void 0,args:o},r=o[0];o[0]=function(){try{return r.apply(this,arguments)}finally{const{handle:t,handleId:r,isPeriodic:n,isRefreshable:s}=e;n||s||(r?delete i[r]:t&&(t[Vf]=null))}};const s=af(t,o[0],e,a,l);if(!s)return s;const{handleId:c,handle:u,isRefreshable:h,isPeriodic:p}=s.data;if(c)i[c]=s;else if(u&&(u[Vf]=s,h&&!p)){const e=u.refresh;u.refresh=function(){const{zone:t,state:r}=s;return"notScheduled"===r?(s._state="scheduled",t._updateTaskCount(s,1)):"running"===r&&(s._state="scheduling"),e.call(this)}}return u??c??s}return r.apply(e,o)}),o=Af(e,r,t=>function(r,n){const s=n[0];let o;Nf(s)?(o=i[s],delete i[s]):(o=s?.[Vf],o?s[Vf]=null:o=s),o?.type?o.cancelFn&&o.zone.cancelTask(o):t.apply(e,n)})}function Wf(e,t){if(Zone[t.symbol("patchEventTarget")])return;const{eventNames:r,zoneSymbolEventNames:n,TRUE_STR:s,FALSE_STR:o,ZONE_SYMBOL_PREFIX:i}=t.getGlobalObjects();for(let e=0;e<r.length;e++){const t=r[e],a=i+(t+o),l=i+(t+s);n[t]={},n[t][o]=a,n[t][s]=l}const a=e.EventTarget;return a&&a.prototype?(t.patchEventTarget(e,t,[a&&a.prototype]),!0):void 0}function Hf(e,t,r){if(!r||0===r.length)return t;const n=r.filter(t=>t.target===e);if(0===n.length)return t;const s=n[0].ignoreProperties;return t.filter(e=>-1===s.indexOf(e))}function Yf(e,t,r,n){if(!e)return;Sf(e,Hf(e,t,r),n)}function Kf(e){return Object.getOwnPropertyNames(e).filter(e=>e.startsWith("on")&&e.length>2).map(e=>e.substring(2))}function Jf(e,t){if(mf&&!yf)return;if(Zone[e.symbol("patchEvents")])return;const r=t.__Zone_ignore_on_properties;let n=[];if(gf){const e=window;n=n.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);const t=[];Yf(e,Kf(e),r?r.concat(t):r,Jd(e))}n=n.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let e=0;e<n.length;e++){const s=t[n[e]];s?.prototype&&Yf(s.prototype,Kf(s.prototype),r)}}function Xf(e){e.__load_patch("ZoneAwarePromise",(e,t,r)=>{const n=Object.getOwnPropertyDescriptor,s=Object.defineProperty;const o=r.symbol,i=[],a=!1!==e[o("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],l=o("Promise"),c=o("then");r.onUnhandledError=e=>{if(r.showUncaughtError()){const t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},r.microtaskDrainDone=()=>{for(;i.length;){const e=i.shift();try{e.zone.runGuarded(()=>{if(e.throwOriginal)throw e.rejection;throw e})}catch(e){h(e)}}};const u=o("unhandledPromiseRejectionHandler");function h(e){r.onUnhandledError(e);try{const r=t[u];"function"==typeof r&&r.call(this,e)}catch(e){}}function p(e){return e&&"function"==typeof e.then}function d(e){return e}function f(e){return M.reject(e)}const m=o("state"),g=o("value"),y=o("finally"),b=o("parentPromiseValue"),v=o("parentPromiseState"),w=null,C=!0,S=!1;function _(e,t){return r=>{try{T(e,t,r)}catch(t){T(e,!1,t)}}}const I=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},A="Promise resolved with itself",E=o("currentTaskTrace");function T(e,n,o){const l=I();if(e===o)throw new TypeError(A);if(e[m]===w){let c=null;try{"object"!=typeof o&&"function"!=typeof o||(c=o&&o.then)}catch(t){return l(()=>{T(e,!1,t)})(),e}if(n!==S&&o instanceof M&&o.hasOwnProperty(m)&&o.hasOwnProperty(g)&&o[m]!==w)O(o),T(e,o[m],o[g]);else if(n!==S&&"function"==typeof c)try{c.call(o,l(_(e,n)),l(_(e,!1)))}catch(t){l(()=>{T(e,!1,t)})()}else{e[m]=n;const l=e[g];if(e[g]=o,e[y]===y&&n===C&&(e[m]=e[v],e[g]=e[b]),n===S&&o instanceof Error){const e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&s(o,E,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t<l.length;)R(e,l[t++],l[t++],l[t++],l[t++]);if(0==l.length&&n==S){e[m]=0;let n=o;try{throw new Error("Uncaught (in promise): "+function(e){if(e&&e.toString===Object.prototype.toString){return(e.constructor&&e.constructor.name||"")+": "+JSON.stringify(e)}return e?e.toString():Object.prototype.toString.call(e)}(o)+(o&&o.stack?"\n"+o.stack:""))}catch(e){n=e}a&&(n.throwOriginal=!0),n.rejection=o,n.promise=e,n.zone=t.current,n.task=t.currentTask,i.push(n),r.scheduleMicroTask()}}}return e}const k=o("rejectionHandledHandler");function O(e){if(0===e[m]){try{const r=t[k];r&&"function"==typeof r&&r.call(this,{rejection:e[g],promise:e})}catch(e){}e[m]=S;for(let t=0;t<i.length;t++)e===i[t].promise&&i.splice(t,1)}}function R(e,t,r,n,s){O(e);const o=e[m],i=o?"function"==typeof n?n:d:"function"==typeof s?s:f;t.scheduleMicroTask("Promise.then",()=>{try{const n=e[g],s=!!r&&y===r[y];s&&(r[b]=n,r[v]=o);const a=t.run(i,void 0,s&&i!==f&&i!==d?[]:[n]);T(r,!0,a)}catch(e){T(r,!1,e)}},r)}const x=function(){},N=e.AggregateError;class M{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(e){return e instanceof M?e:T(new this(null),C,e)}static reject(e){return T(new this(null),S,e)}static withResolvers(){const e={};return e.promise=new M((t,r)=>{e.resolve=t,e.reject=r}),e}static any(e){if(!e||"function"!=typeof e[Symbol.iterator])return Promise.reject(new N([],"All promises were rejected"));const t=[];let r=0;try{for(let n of e)r++,t.push(M.resolve(n))}catch(e){return Promise.reject(new N([],"All promises were rejected"))}if(0===r)return Promise.reject(new N([],"All promises were rejected"));let n=!1;const s=[];return new M((e,o)=>{for(let i=0;i<t.length;i++)t[i].then(t=>{n||(n=!0,e(t))},e=>{s.push(e),r--,0===r&&(n=!0,o(new N(s,"All promises were rejected")))})})}static race(e){let t,r,n=new this((e,n)=>{t=e,r=n});function s(e){t(e)}function o(e){r(e)}for(let t of e)p(t)||(t=this.resolve(t)),t.then(s,o);return n}static all(e){return M.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof M?this:M).allWithCallback(e,{thenCallback:e=>({status:"fulfilled",value:e}),errorCallback:e=>({status:"rejected",reason:e})})}static allWithCallback(e,t){let r,n,s=new this((e,t)=>{r=e,n=t}),o=2,i=0;const a=[];for(let s of e){p(s)||(s=this.resolve(s));const e=i;try{s.then(n=>{a[e]=t?t.thenCallback(n):n,o--,0===o&&r(a)},s=>{t?(a[e]=t.errorCallback(s),o--,0===o&&r(a)):n(s)})}catch(e){n(e)}o++,i++}return o-=2,0===o&&r(a),s}constructor(e){const t=this;if(!(t instanceof M))throw new Error("Must be an instanceof Promise.");t[m]=w,t[g]=[];try{const r=I();e&&e(r(_(t,C)),r(_(t,S)))}catch(e){T(t,!1,e)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return M}then(e,r){let n=this.constructor?.[Symbol.species];n&&"function"==typeof n||(n=this.constructor||M);const s=new n(x),o=t.current;return this[m]==w?this[g].push(o,s,e,r):R(this,o,s,e,r),s}catch(e){return this.then(null,e)}finally(e){let r=this.constructor?.[Symbol.species];r&&"function"==typeof r||(r=M);const n=new r(x);n[y]=y;const s=t.current;return this[m]==w?this[g].push(s,n,e,e):R(this,s,n,e,e),n}}M.resolve=M.resolve,M.reject=M.reject,M.race=M.race,M.all=M.all;const L=e[l]=e.Promise;e.Promise=M;const D=o("thenPatched");function P(e){const t=e.prototype,r=n(t,"then");if(r&&(!1===r.writable||!r.configurable))return;const s=t.then;t[c]=s,e.prototype.then=function(e,t){const r=new M((e,t)=>{s.call(this,e,t)});return r.then(e,t)},e[D]=!0}return r.patchThen=P,L&&(P(L),Af(e,"fetch",e=>{return t=e,function(e,r){let n=t.apply(e,r);if(n instanceof M)return n;let s=n.constructor;return s[D]||P(s),n};var t})),Promise[t.__symbol__("uncaughtPromiseErrors")]=i,M})}function qf(e,t,r,n,s){const o=Zone.__symbol__(n);if(t[o])return;const i=t[o]=t[n];t[n]=function(o,a,l){return a&&a.prototype&&s.forEach(function(t){const s=`${r}.${n}::`+t,o=a.prototype;try{if(o.hasOwnProperty(t)){const r=e.ObjectGetOwnPropertyDescriptor(o,t);r&&r.value?(r.value=e.wrapWithCurrentZone(r.value,s),e._redefineProperty(a.prototype,t,r)):o[t]&&(o[t]=e.wrapWithCurrentZone(o[t],s))}else o[t]&&(o[t]=e.wrapWithCurrentZone(o[t],s))}catch{}}),i.call(t,o,a,l)},e.attachOriginToPatched(t[n],i)}const Qf=function(){const e=globalThis,t=!0===e[Hd("forceDuplicateZoneCheck")];if(e.Zone&&(t||"function"!=typeof e.Zone.__symbol__))throw new Error("Zone already loaded.");return e.Zone??=function(){const e=Wd.performance;function t(t){e&&e.mark&&e.mark(t)}function r(t,r){e&&e.measure&&e.measure(t,r)}t("Zone");class n{static __symbol__=Hd;static assertZonePatched(){if(Wd.Promise!==E.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let e=n.current;for(;e.parent;)e=e.parent;return e}static get current(){return k.zone}static get currentTask(){return O}static __load_patch(e,s,o=!1){if(E.hasOwnProperty(e)){const t=!0===Wd[Hd("forceDuplicateZoneCheck")];if(!o&&t)throw Error("Already loaded patch: "+e)}else if(!Wd["__Zone_disable_"+e]){const o="Zone:"+e;t(o),E[e]=s(Wd,n,T),r(o,o)}}get parent(){return this._parent}get name(){return this._name}_parent;_name;_properties;_zoneDelegate;constructor(e,t){this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new o(this,this._parent&&this._parent._zoneDelegate,t)}get(e){const t=this.getZoneWith(e);if(t)return t._properties[e]}getZoneWith(e){let t=this;for(;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}fork(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}wrap(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);const r=this._zoneDelegate.intercept(this,e,t),n=this;return function(){return n.runGuarded(r,this,arguments,t)}}run(e,t,r,n){k={parent:k,zone:this};try{return this._zoneDelegate.invoke(this,e,t,r,n)}finally{k=k.parent}}runGuarded(e,t=null,r,n){k={parent:k,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,r,n)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{k=k.parent}}runTask(e,t,r){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||g).name+"; Execution: "+this.name+")");const n=e,{type:s,data:{isPeriodic:o=!1,isRefreshable:i=!1}={}}=e;if(e.state===y&&(s===A||s===I))return;const a=e.state!=w;a&&n._transitionTo(w,v);const l=O;O=n,k={parent:k,zone:this};try{s!=I||!e.data||o||i||(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,n,t,r)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{const t=e.state;if(t!==y&&t!==S)if(s==A||o||i&&t===b)a&&n._transitionTo(v,w,b);else{const e=n._zoneDelegates;this._updateTaskCount(n,-1),a&&n._transitionTo(y,w,y),i&&(n._zoneDelegates=e)}k=k.parent,O=l}}scheduleTask(e){if(e.zone&&e.zone!==this){let t=this;for(;t;){if(t===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);t=t.parent}}e._transitionTo(b,y);const t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(t){throw e._transitionTo(S,b,y),this._zoneDelegate.handleError(this,t),t}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==b&&e._transitionTo(v,b),e}scheduleMicroTask(e,t,r,n){return this.scheduleTask(new i(_,e,t,r,n,void 0))}scheduleMacroTask(e,t,r,n,s){return this.scheduleTask(new i(I,e,t,r,n,s))}scheduleEventTask(e,t,r,n,s){return this.scheduleTask(new i(A,e,t,r,n,s))}cancelTask(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||g).name+"; Execution: "+this.name+")");if(e.state===v||e.state===w){e._transitionTo(C,v,w);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(S,C),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(y,C),e.runCount=-1,e}}_updateTaskCount(e,t){const r=e._zoneDelegates;-1==t&&(e._zoneDelegates=null);for(let n=0;n<r.length;n++)r[n]._updateTaskCount(e.type,t)}}const s={name:"",onHasTask:(e,t,r,n)=>e.hasTask(r,n),onScheduleTask:(e,t,r,n)=>e.scheduleTask(r,n),onInvokeTask:(e,t,r,n,s,o)=>e.invokeTask(r,n,s,o),onCancelTask:(e,t,r,n)=>e.cancelTask(r,n)};class o{get zone(){return this._zone}_zone;_taskCounts={microTask:0,macroTask:0,eventTask:0};_parentDelegate;_forkDlgt;_forkZS;_forkCurrZone;_interceptDlgt;_interceptZS;_interceptCurrZone;_invokeDlgt;_invokeZS;_invokeCurrZone;_handleErrorDlgt;_handleErrorZS;_handleErrorCurrZone;_scheduleTaskDlgt;_scheduleTaskZS;_scheduleTaskCurrZone;_invokeTaskDlgt;_invokeTaskZS;_invokeTaskCurrZone;_cancelTaskDlgt;_cancelTaskZS;_cancelTaskCurrZone;_hasTaskDlgt;_hasTaskDlgtOwner;_hasTaskZS;_hasTaskCurrZone;constructor(e,t,r){this._zone=e,this._parentDelegate=t,this._forkZS=r&&(r&&r.onFork?r:t._forkZS),this._forkDlgt=r&&(r.onFork?t:t._forkDlgt),this._forkCurrZone=r&&(r.onFork?this._zone:t._forkCurrZone),this._interceptZS=r&&(r.onIntercept?r:t._interceptZS),this._interceptDlgt=r&&(r.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=r&&(r.onIntercept?this._zone:t._interceptCurrZone),this._invokeZS=r&&(r.onInvoke?r:t._invokeZS),this._invokeDlgt=r&&(r.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=r&&(r.onInvoke?this._zone:t._invokeCurrZone),this._handleErrorZS=r&&(r.onHandleError?r:t._handleErrorZS),this._handleErrorDlgt=r&&(r.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=r&&(r.onHandleError?this._zone:t._handleErrorCurrZone),this._scheduleTaskZS=r&&(r.onScheduleTask?r:t._scheduleTaskZS),this._scheduleTaskDlgt=r&&(r.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=r&&(r.onScheduleTask?this._zone:t._scheduleTaskCurrZone),this._invokeTaskZS=r&&(r.onInvokeTask?r:t._invokeTaskZS),this._invokeTaskDlgt=r&&(r.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=r&&(r.onInvokeTask?this._zone:t._invokeTaskCurrZone),this._cancelTaskZS=r&&(r.onCancelTask?r:t._cancelTaskZS),this._cancelTaskDlgt=r&&(r.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=r&&(r.onCancelTask?this._zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const n=r&&r.onHasTask,o=t&&t._hasTaskZS;(n||o)&&(this._hasTaskZS=n?r:s,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,r.onScheduleTask||(this._scheduleTaskZS=s,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this._zone),r.onInvokeTask||(this._invokeTaskZS=s,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this._zone),r.onCancelTask||(this._cancelTaskZS=s,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this._zone))}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new n(e,t)}intercept(e,t,r){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,r):t}invoke(e,t,r,n,s){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,r,n,s):t.apply(r,n)}handleError(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)}scheduleTask(e,t){let r=t;if(this._scheduleTaskZS)this._hasTaskZS&&r._zoneDelegates.push(this._hasTaskDlgtOwner),r=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),r||(r=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=_)throw new Error("Task is missing scheduleFn.");f(t)}return r}invokeTask(e,t,r,n){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,r,n):t.callback.apply(r,n)}cancelTask(e,t){let r;if(this._cancelTaskZS)r=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");r=t.cancelFn(t)}return r}hasTask(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(t){this.handleError(e,t)}}_updateTaskCount(e,t){const r=this._taskCounts,n=r[e],s=r[e]=n+t;if(s<0)throw new Error("More tasks executed then were scheduled.");if(0==n||0==s){const t={microTask:r.microTask>0,macroTask:r.macroTask>0,eventTask:r.eventTask>0,change:e};this.hasTask(this._zone,t)}}}class i{type;source;invoke;callback;data;scheduleFn;cancelFn;_zone=null;runCount=0;_zoneDelegates=null;_state="notScheduled";constructor(e,t,r,n,s,o){if(this.type=e,this.source=t,this.data=n,this.scheduleFn=s,this.cancelFn=o,!r)throw new Error("callback is not defined");this.callback=r;const a=this;e===A&&n&&n.useG?this.invoke=i.invokeTask:this.invoke=function(){return i.invokeTask.call(Wd,a,this,arguments)}}static invokeTask(e,t,r){e||(e=this),R++;try{return e.runCount++,e.zone.runTask(e,t,r)}finally{1==R&&m(),R--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(y,b)}_transitionTo(e,t,r){if(this._state!==t&&this._state!==r)throw new Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${r?" or '"+r+"'":""}, was '${this._state}'.`);this._state=e,e==y&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const a=Hd("setTimeout"),l=Hd("Promise"),c=Hd("then");let u,h=[],p=!1;function d(e){if(u||Wd[l]&&(u=Wd[l].resolve(0)),u){let t=u[c];t||(t=u.then),t.call(u,e)}else Wd[a](e,0)}function f(e){0===R&&0===h.length&&d(m),e&&h.push(e)}function m(){if(!p){for(p=!0;h.length;){const e=h;h=[];for(let t=0;t<e.length;t++){const r=e[t];try{r.zone.runTask(r,null,null)}catch(e){T.onUnhandledError(e)}}}T.microtaskDrainDone(),p=!1}}const g={name:"NO ZONE"},y="notScheduled",b="scheduling",v="scheduled",w="running",C="canceling",S="unknown",_="microTask",I="macroTask",A="eventTask",E={},T={symbol:Hd,currentZoneFrame:()=>k,onUnhandledError:x,microtaskDrainDone:x,scheduleMicroTask:f,showUncaughtError:()=>!n[Hd("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:x,patchMethod:()=>x,bindArguments:()=>[],patchThen:()=>x,patchMacroTask:()=>x,patchEventPrototype:()=>x,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>x,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>x,wrapWithCurrentZone:()=>x,filterProperties:()=>[],attachOriginToPatched:()=>x,_redefineProperty:()=>x,patchCallbacks:()=>x,nativeScheduleMicroTask:d};let k={parent:null,zone:new n(null,null)},O=null,R=0;function x(){}return r("Zone","Zone"),n}(),e.Zone}();!function(e){Xf(e),function(e){e.__load_patch("toString",e=>{const t=Function.prototype.toString,r=lf("OriginalDelegate"),n=lf("Promise"),s=lf("Error"),o=function(){if("function"==typeof this){const o=this[r];if(o)return"function"==typeof o?t.call(o):Object.prototype.toString.call(o);if(this===Promise){const r=e[n];if(r)return t.call(r)}if(this===Error){const r=e[s];if(r)return t.call(r)}}return t.call(this)};o[r]=t,Function.prototype.toString=o;const i=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":i.call(this)}})}(e),function(e){e.__load_patch("util",(e,t,r)=>{const n=Kf(e);r.patchOnProperties=Sf,r.patchMethod=Af,r.bindArguments=pf,r.patchMacroTask=Ef;const s=t.__symbol__("BLACK_LISTED_EVENTS"),o=t.__symbol__("UNPATCHED_EVENTS");e[o]&&(e[s]=e[o]),e[s]&&(t[s]=t[o]=e[s]),r.patchEventPrototype=jf,r.patchEventTarget=Uf,r.isIEOrEdge=Rf,r.ObjectDefineProperty=Kd,r.ObjectGetOwnPropertyDescriptor=Yd,r.ObjectCreate=Xd,r.ArraySlice=qd,r.patchClass=If,r.wrapWithCurrentZone=of,r.filterProperties=Hf,r.attachOriginToPatched=Tf,r._redefineProperty=Object.defineProperty,r.patchCallbacks=qf,r.getGlobalObjects=()=>({globalSources:Df,zoneSymbolEventNames:Lf,eventNames:n,isBrowser:gf,isMix:yf,isNode:mf,TRUE_STR:rf,FALSE_STR:nf,ZONE_SYMBOL_PREFIX:sf,ADD_EVENT_LISTENER_STR:Qd,REMOVE_EVENT_LISTENER_STR:$d})})}(e)}(Qf),function(e){e.__load_patch("legacy",t=>{const r=t[e.__symbol__("legacyPatch")];r&&r()}),e.__load_patch("timers",e=>{const t="set",r="clear";Gf(e,t,r,"Timeout"),Gf(e,t,r,"Interval"),Gf(e,t,r,"Immediate")}),e.__load_patch("requestAnimationFrame",e=>{Gf(e,"request","cancel","AnimationFrame"),Gf(e,"mozRequest","mozCancel","AnimationFrame"),Gf(e,"webkitRequest","webkitCancel","AnimationFrame")}),e.__load_patch("blocking",(e,t)=>{const r=["alert","prompt","confirm"];for(let n=0;n<r.length;n++){Af(e,r[n],(r,n,s)=>function(n,o){return t.current.run(r,e,o,s)})}}),e.__load_patch("EventTarget",(e,t,r)=>{!function(e,t){t.patchEventPrototype(e,t)}(e,r),Wf(e,r);const n=e.XMLHttpRequestEventTarget;n&&n.prototype&&r.patchEventTarget(e,r,[n.prototype])}),e.__load_patch("MutationObserver",(e,t,r)=>{If("MutationObserver"),If("WebKitMutationObserver")}),e.__load_patch("IntersectionObserver",(e,t,r)=>{If("IntersectionObserver")}),e.__load_patch("FileReader",(e,t,r)=>{If("FileReader")}),e.__load_patch("on_property",(e,t,r)=>{Jf(r,e)}),e.__load_patch("customElements",(e,t,r)=>{!function(e,t){const{isBrowser:r,isMix:n}=t.getGlobalObjects();if(!r&&!n||!e.customElements||!("customElements"in e))return;t.patchCallbacks(t,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"])}(e,r)}),e.__load_patch("XHR",(e,t)=>{!function(e){const l=e.XMLHttpRequest;if(!l)return;const c=l.prototype;let u=c[ef],h=c[tf];if(!u){const t=e.XMLHttpRequestEventTarget;if(t){const e=t.prototype;u=e[ef],h=e[tf]}}const p="readystatechange",d="scheduled";function f(e){const n=e.data,i=n.target;i[o]=!1,i[a]=!1;const l=i[s];u||(u=i[ef],h=i[tf]),l&&h.call(i,p,l);const c=i[s]=()=>{if(i.readyState===i.DONE)if(!n.aborted&&i[o]&&e.state===d){const r=i[t.__symbol__("loadfalse")];if(0!==i.status&&r&&r.length>0){const s=e.invoke;e.invoke=function(){const r=i[t.__symbol__("loadfalse")];for(let t=0;t<r.length;t++)r[t]===e&&r.splice(t,1);n.aborted||e.state!==d||s.call(e)},r.push(e)}else e.invoke()}else n.aborted||!1!==i[o]||(i[a]=!0)};u.call(i,p,c);return i[r]||(i[r]=e),w.apply(i,n.args),i[o]=!0,e}function m(){}function g(e){const t=e.data;return t.aborted=!0,C.apply(t.target,t.args)}const y=Af(c,"open",()=>function(e,t){return e[n]=0==t[2],e[i]=t[1],y.apply(e,t)}),b=lf("fetchTaskAborting"),v=lf("fetchTaskScheduling"),w=Af(c,"send",()=>function(e,r){if(!0===t.current[v])return w.apply(e,r);if(e[n])return w.apply(e,r);{const t={target:e,url:e[i],isPeriodic:!1,args:r,aborted:!1},n=af("XMLHttpRequest.send",m,t,f,g);e&&!0===e[a]&&!t.aborted&&n.state===d&&n.invoke()}}),C=Af(c,"abort",()=>function(e,n){const s=e[r];if(s&&"string"==typeof s.type){if(null==s.cancelFn||s.data&&s.data.aborted)return;s.zone.cancelTask(s)}else if(!0===t.current[b])return C.apply(e,n)})}(e);const r=lf("xhrTask"),n=lf("xhrSync"),s=lf("xhrListener"),o=lf("xhrScheduled"),i=lf("xhrURL"),a=lf("xhrErrorBeforeScheduled")}),e.__load_patch("geolocation",e=>{e.navigator&&e.navigator.geolocation&&function(e,t){const r=e.constructor.name;for(let n=0;n<t.length;n++){const s=t[n],o=e[s];if(o){if(!df(Yd(e,s)))continue;e[s]=(e=>{const t=function(){return e.apply(this,pf(arguments,r+"."+s))};return Tf(t,e),t})(o)}}}(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),e.__load_patch("PromiseRejectionEvent",(e,t)=>{function r(t){return function(r){Zf(e,t).forEach(n=>{const s=e.PromiseRejectionEvent;if(s){const e=new s(t,{promise:r.promise,reason:r.rejection});n.invoke(e)}})}}e.PromiseRejectionEvent&&(t[lf("unhandledPromiseRejectionHandler")]=r("unhandledrejection"),t[lf("rejectionHandledHandler")]=r("rejectionhandled"))}),e.__load_patch("queueMicrotask",(e,t,r)=>{zf(e,r)})}(Qf);var $f;!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"}($f||($f={}));const em=sh.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function tm(e){return t=e,"undefined"!=typeof Document&&t instanceof Document?(new XMLSerializer).serializeToString(document).length:"string"==typeof e?nm(e):e instanceof Blob?e.size:e instanceof FormData?function(e){let t=0;for(const[r,n]of e.entries())t+=r.length,n instanceof Blob?t+=n.size:t+=n.length;return t}(e):e instanceof URLSearchParams?nm(e.toString()):void 0!==e.byteLength?e.byteLength:void em.warn("unknown body type");var t}const rm=new TextEncoder;function nm(e){return rm.encode(e).byteLength}function sm(e){const t=function(){void 0===im&&(im=om);return im}(),r=e.toUpperCase();return r in t?r:"_OTHER"}const om={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let im;const am={"https:":"443","http:":"80"};const lm="0.203.0";var cm;!function(e){e.HTTP_STATUS_TEXT="http.status_text"}(cm||(cm={}));class um extends Ld{component="xml-http-request";version=lm;moduleName=this.component;_tasksCount=0;_xhrMem=new WeakMap;_usedResources=new WeakSet;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-xml-http-request",lm,e),this._semconvStability=Ud("http",e?.semconvStabilityOptIn)}init(){}_addHeaders(e,t){if(!gd(md(t).href,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return yh.inject(nh.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}const r={};yh.inject(nh.active(),r),Object.keys(r).forEach(t=>{e.setRequestHeader(t,String(r[t]))})}_addChildSpan(e,t){nh.with(vh.setSpan(nh.active(),e),()=>{const e=this.tracer.startSpan("CORS Preflight",{startTime:t[od.FETCH_START]}),r=!(this._semconvStability&Fd.OLD);pd(e,t,this.getConfig().ignoreNetworkEvents,void 0,r),e.end(t[od.RESPONSE_END])})}_addFinalSpanAttributes(e,t,r){if(this._semconvStability&Fd.OLD){if(void 0!==t.status&&e.setAttribute("http.status_code",t.status),void 0!==t.statusText&&e.setAttribute(cm.HTTP_STATUS_TEXT,t.statusText),"string"==typeof r){const t=md(r);e.setAttribute("http.host",t.host),e.setAttribute("http.scheme",t.protocol.replace(":",""))}e.setAttribute("http.user_agent",navigator.userAgent)}this._semconvStability&Fd.STABLE&&t.status&&e.setAttribute(Uh,t.status)}_applyAttributesAfterXHR(e,t){const r=this.getConfig().applyCustomAttributesOnSpan;"function"==typeof r&&Dd(()=>r(e,t),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_addResourceObserver(e,t){const r=this._xhrMem.get(e);r&&"function"==typeof PerformanceObserver&&"function"==typeof PerformanceResourceTiming&&(r.createdResources={observer:new PerformanceObserver(e=>{const n=e.getEntries(),s=md(t);n.forEach(e=>{"xmlhttprequest"===e.initiatorType&&e.name===s.href&&r.createdResources&&r.createdResources.entries.push(e)})}),entries:[]},r.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(Nh.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,r,n,s){if(!(r&&n&&s&&e.createdResources))return;let o=e.createdResources.entries;o&&o.length||(o=Nh.getEntriesByType("resource"));const i=fd(md(r).href,n,s,o,this._usedResources);if(i.mainRequest){const e=i.mainRequest;this._markResourceAsUsed(e);const r=i.corsPreFlightRequest;r&&(this._addChildSpan(t,r),this._markResourceAsUsed(r));const n=!(this._semconvStability&Fd.OLD);pd(t,e,this.getConfig().ignoreNetworkEvents,void 0,n)}}_cleanPreviousSpanInformation(e){const t=this._xhrMem.get(e);if(t){const r=t.callbackToRemoveEvents;r&&r(),this._xhrMem.delete(e)}}_createSpan(e,t,r){if(Lp(t,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let n="";const s=md(t),o={};if(this._semconvStability&Fd.OLD&&(n=r.toUpperCase(),o["http.method"]=r,o["http.url"]=s.toString()),this._semconvStability&Fd.STABLE){const e=r,t=sm(r);n||(n=t),o[Fh]=t,t!==e&&(o[Bh]=e),o[Hh]=s.toString(),o[Zh]=s.hostname;const i=function(e){const t=Number(e.port||am[e.protocol]);return t&&!isNaN(t)?t:void 0}(s);i&&(o[jh]=i)}const i=this.tracer.startSpan(n,{kind:qu.CLIENT,attributes:o});return i.addEvent($f.METHOD_OPEN),this._cleanPreviousSpanInformation(e),this._xhrMem.set(e,{span:i,spanUrl:t}),i}_markResourceAsUsed(e){this._usedResources.add(e)}_patchOpen(){return e=>{const t=this;return function(...r){const n=r[0],s=r[1];return t._createSpan(this,s,n),e.apply(this,r)}}}_patchSend(){const e=this;function t(t,r,n,s){const o=e._xhrMem.get(r);if(!o)return;if(o.status=r.status,o.statusText=r.statusText,e._xhrMem.delete(r),o.span){const t=o.span;e._applyAttributesAfterXHR(t,r),e._semconvStability&Fd.STABLE&&(n?s&&(t.setStatus({code:Qu.ERROR,message:s}),t.setAttribute(Lh,s)):o.status&&o.status>=400&&(t.setStatus({code:Qu.ERROR}),t.setAttribute(Lh,String(o.status))))}const i=$h(),a=Date.now();setTimeout(()=>{!function(t,r,n,s){const o=r.callbackToRemoveEvents;"function"==typeof o&&o();const{span:i,spanUrl:a,sendStartTime:l}=r;i&&(e._findResourceAndAddNetworkEvents(r,i,a,l,n),i.addEvent(t,s),e._addFinalSpanAttributes(i,r,a),i.end(s),e._tasksCount--),e._clearResources()}(t,o,i,a)},300)}function r(){t($f.EVENT_ERROR,this,!0,"error")}function n(){t($f.EVENT_ABORT,this,!1)}function s(){t($f.EVENT_TIMEOUT,this,!0,"timeout")}function o(){this.status<299?t($f.EVENT_LOAD,this,!1):t($f.EVENT_ERROR,this,!1)}return t=>function(...i){const a=e._xhrMem.get(this);if(!a)return t.apply(this,i);const l=a.span,c=a.spanUrl;if(l&&c){if(e.getConfig().measureRequestSize&&i?.[0]){const t=tm(i[0]);void 0!==t&&(e._semconvStability&Fd.OLD&&l.setAttribute("http.request_content_length_uncompressed",t),e._semconvStability&Fd.STABLE&&l.setAttribute("http.request.body.size",t))}nh.with(vh.setSpan(nh.active(),l),()=>{e._tasksCount++,a.sendStartTime=$h(),l.addEvent($f.METHOD_SEND),this.addEventListener("abort",n),this.addEventListener("error",r),this.addEventListener("load",o),this.addEventListener("timeout",s),a.callbackToRemoveEvents=()=>{!function(t){t.removeEventListener("abort",n),t.removeEventListener("error",r),t.removeEventListener("load",o),t.removeEventListener("timeout",s);const i=e._xhrMem.get(t);i&&(i.callbackToRemoveEvents=void 0)}(this),a.createdResources&&a.createdResources.observer.disconnect()},e._addHeaders(this,c),e._addResourceObserver(this,c)})}return t.apply(this,i)}}enable(){this._diag.debug("applying patch to",this.moduleName,this.version),Pd(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),Pd(XMLHttpRequest.prototype.send)&&(this._unwrap(XMLHttpRequest.prototype,"send"),this._diag.debug("removing previous patch from method send")),this._wrap(XMLHttpRequest.prototype,"open",this._patchOpen()),this._wrap(XMLHttpRequest.prototype,"send",this._patchSend())}disable(){this._diag.debug("removing patch from",this.moduleName,this.version),this._unwrap(XMLHttpRequest.prototype,"open"),this._unwrap(XMLHttpRequest.prototype,"send"),this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet}}var hm;!function(e){e.COMPONENT="component",e.HTTP_STATUS_TEXT="http.status_text"}(hm||(hm={}));var pm={};Object.defineProperty(pm,"__esModule",{value:!0});var dm=pm.ATTR_HTTP_USER_AGENT=pm.ATTR_HTTP_URL=pm.ATTR_HTTP_STATUS_CODE=pm.ATTR_HTTP_SCHEME=pm.ATTR_HTTP_RESPONSE_CONTENT_LENGTH=pm.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=pm.ATTR_HTTP_REQUEST_BODY_SIZE=pm.ATTR_HTTP_METHOD=pm.ATTR_HTTP_HOST=void 0,fm=pm.ATTR_HTTP_HOST="http.host",mm=pm.ATTR_HTTP_METHOD="http.method",gm=pm.ATTR_HTTP_REQUEST_BODY_SIZE="http.request.body.size",ym=pm.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED="http.request_content_length_uncompressed";pm.ATTR_HTTP_RESPONSE_CONTENT_LENGTH="http.response_content_length";var bm=pm.ATTR_HTTP_SCHEME="http.scheme",vm=pm.ATTR_HTTP_STATUS_CODE="http.status_code",wm=pm.ATTR_HTTP_URL="http.url";dm=pm.ATTR_HTTP_USER_AGENT="http.user_agent";const Cm=sh.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function Sm(...e){if(e[0]instanceof URL||"string"==typeof e[0]){const t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){const{body:e,length:r}=function(e){if(!e.pipeThrough)return Cm.warn("Platform has ReadableStream but not pipeThrough!"),{body:e,length:Promise.resolve(void 0)};let t,r=0;const n=new Promise(e=>{t=e}),s=new TransformStream({start(){},async transform(e,t){const n=await e;r+=n.byteLength,t.enqueue(e)},flush(){t(r)}});return{body:e.pipeThrough(s),length:n}}(t.body);return t.body=e,r}return Promise.resolve(function(e){if(t=e,"undefined"!=typeof Document&&t instanceof Document)return(new XMLSerializer).serializeToString(document).length;var t;if("string"==typeof e)return Im(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return function(e){let t=0;for(const[r,n]of e.entries())t+=r.length,n instanceof Blob?t+=n.size:t+=n.length;return t}(e);if(e instanceof URLSearchParams)return Im(e.toString());if(void 0!==e.byteLength)return e.byteLength;return void Cm.warn("unknown body type")}(t.body))}{const t=e[0];return t?.body?t.clone().text().then(e=>Im(e)):Promise.resolve()}}const _m=new TextEncoder;function Im(e){return _m.encode(e).byteLength}const Am={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let Em;function Tm(){return void 0===Em&&(Em=Am),Em}const km={"https:":"443","http:":"80"};const Om="0.203.0",Rm="object"==typeof process&&"node"===process.release?.name;class xm extends Ld{component="fetch";version=Om;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-fetch",Om,e),this._semconvStability=Ud("http",e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){const r=this.tracer.startSpan("CORS Preflight",{startTime:t[od.FETCH_START]},vh.setSpan(nh.active(),e)),n=!(this._semconvStability&Fd.OLD);pd(r,t,this.getConfig().ignoreNetworkEvents,void 0,n),r.end(t[od.RESPONSE_END])}_addFinalSpanAttributes(e,t){const r=md(t.url);if(this._semconvStability&Fd.OLD&&(e.setAttribute(vm,t.status),null!=t.statusText&&e.setAttribute(hm.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(fm,r.host),e.setAttribute(bm,r.protocol.replace(":","")),"undefined"!=typeof navigator&&e.setAttribute(dm,navigator.userAgent)),this._semconvStability&Fd.STABLE){e.setAttribute(Uh,t.status),e.setAttribute(Zh,r.hostname);const n=function(e){const t=Number(e.port||km[e.protocol]);return t&&!isNaN(t)?t:void 0}(r);n&&e.setAttribute(jh,n)}}_addHeaders(e,t){if(!gd(t,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return yh.inject(nh.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(e instanceof Request)yh.inject(nh.active(),e.headers,{set:(e,t,r)=>e.set(t,"string"==typeof r?r:String(r))});else if(e.headers instanceof Headers)yh.inject(nh.active(),e.headers,{set:(e,t,r)=>e.set(t,"string"==typeof r?r:String(r))});else if(e.headers instanceof Map)yh.inject(nh.active(),e.headers,{set:(e,t,r)=>e.set(t,"string"==typeof r?r:String(r))});else{const t={};yh.inject(nh.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(Lp(e,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let r="";const n={};if(this._semconvStability&Fd.OLD){const s=(t.method||"GET").toUpperCase();r=`HTTP ${s}`,n[hm.COMPONENT]=this.moduleName,n[mm]=s,n[wm]=e}if(this._semconvStability&Fd.STABLE){const s=t.method,o=function(e){const t=Tm(),r=e.toUpperCase();return r in t?r:"_OTHER"}(t.method||"GET");r||(r=o),n[Fh]=o,o!==s&&(n[Bh]=s),n[Hh]=e}return this.tracer.startSpan(r,{kind:qu.CLIENT,attributes:n})}_findResourceAndAddNetworkEvents(e,t,r){let n=t.entries;if(!n.length){if(!performance.getEntriesByType)return;n=performance.getEntriesByType("resource")}const s=fd(t.spanUrl,t.startTime,r,n,this._usedResources,"fetch");if(s.mainRequest){const t=s.mainRequest;this._markResourceAsUsed(t);const r=s.corsPreFlightRequest;r&&(this._addChildSpan(e,r),this._markResourceAsUsed(r));const n=!(this._semconvStability&Fd.OLD);pd(e,t,this.getConfig().ignoreNetworkEvents,void 0,n)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,r){const n=qh(Date.now()),s=$h();this._addFinalSpanAttributes(e,r),this._semconvStability&Fd.STABLE&&r.status>=400&&(e.setStatus({code:Qu.ERROR}),e.setAttribute(Lh,String(r.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,s),this._tasksCount--,this._clearResources(),e.end(n)},300)}_patchConstructor(){return e=>{const t=this;return function(...r){const n=this,s=md(r[0]instanceof Request?r[0].url:String(r[0])).href,o=r[0]instanceof Request?r[0]:r[1]||{},i=t._createSpan(s,o);if(!i)return e.apply(this,r);const a=t._prepareSpanData(s);function l(e,r){t._applyAttributesAfterFetch(e,o,r),t._endSpan(e,a,{status:r.status||0,statusText:r.message,url:s})}function c(e,r){t._applyAttributesAfterFetch(e,o,r),r.status>=200&&r.status<400?t._endSpan(e,a,r):t._endSpan(e,a,{status:r.status,statusText:r.statusText,url:s})}function u(e,t,r){try{const t=r.clone().body;if(t){const n=t.getReader(),s=()=>{n.read().then(({done:t})=>{t?c(e,r):s()},t=>{l(e,t)})};s()}else c(e,r)}finally{t(r)}}function h(e,t,r){try{l(e,r)}finally{t(r)}}return t.getConfig().measureRequestSize&&Sm(...r).then(e=>{e&&(t._semconvStability&Fd.OLD&&i.setAttribute(ym,e),t._semconvStability&Fd.STABLE&&i.setAttribute(gm,e))}).catch(e=>{t._diag.warn("getFetchBodyLength",e)}),new Promise((r,a)=>nh.with(vh.setSpan(nh.active(),i),()=>(t._addHeaders(o,s),t._callRequestHook(i,o),t._tasksCount++,e.apply(n,o instanceof Request?[o]:[s,o]).then(u.bind(n,i,r),h.bind(n,i,a)))))}}}_applyAttributesAfterFetch(e,t,r){const n=this.getConfig().applyCustomAttributesOnSpan;n&&Dd(()=>n(e,t,r),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_callRequestHook(e,t){const r=this.getConfig().requestHook;r&&Dd(()=>r(e,t),e=>{e&&this._diag.error("requestHook",e)})}_prepareSpanData(e){const t=$h(),r=[];if("function"!=typeof PerformanceObserver)return{entries:r,startTime:t,spanUrl:e};const n=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{"fetch"===t.initiatorType&&t.name===e&&r.push(t)})});return n.observe({entryTypes:["resource"]}),{entries:r,observer:n,startTime:t,spanUrl:e}}enable(){Rm?this._diag.warn("this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()"):(Pd(fetch)&&(this._unwrap(xh,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(xh,"fetch",this._patchConstructor()))}disable(){Rm||(this._unwrap(xh,"fetch"),this._usedResources=new WeakSet)}}class Nm{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class Mm extends Error{code;name="OTLPExporterError";data;constructor(e,t,r){super(e),this.data=r,this.code=t}}function Lm(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function Dm(e){if(null!=e)return()=>e}function Pm(e,t,r){return{timeoutMillis:Lm(e.timeoutMillis??t.timeoutMillis??r.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??r.concurrencyLimit,compression:e.compression??t.compression??r.compression}}class Fm{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);const t=()=>{const t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function Bm(e){return new Fm(e.concurrencyLimit)}function Um(){return{handleResponse(e){null!=e&&function(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}(e)&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&sh.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}class Zm{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,r,n,s){this._transport=e,this._serializer=t,this._responseHandler=r,this._promiseQueue=n,this._timeout=s,this._diagLogger=sh.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit())return void t({code:op.FAILED,error:new Error("Concurrent export limit reached")});const r=this._serializer.serializeRequest(e);null!=r?this._promiseQueue.pushPromise(this._transport.send(r,this._timeout).then(e=>{if("success"!==e.status)"failure"===e.status&&e.error?t({code:op.FAILED,error:e.error}):"retryable"===e.status?t({code:op.FAILED,error:new Mm("Export failed with retryable status")}):t({code:op.FAILED,error:new Mm("Export failed with unknown error")});else{if(null!=e.data)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:op.SUCCESS})}},e=>t({code:op.FAILED,error:e}))):t({code:op.FAILED,error:new Error("Nothing to send")})}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function jm(e,t,r){return n={transport:r,serializer:t,promiseHandler:Bm(e)},s={timeout:e.timeoutMillis},new Zm(n.transport,n.serializer,Um(),n.promiseHandler,s.timeout);var n,s}function zm(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Vm(e){const t=new Uint8Array(e.length/2);let r=0;for(let n=0;n<e.length;n+=2){const s=zm(e.charCodeAt(n)),o=zm(e.charCodeAt(n+1));t[r++]=s<<4|o}return t}function Gm(e){const t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}const Wm="undefined"!=typeof BigInt?function(e){return Gm(e).toString()}:tp;function Hm(e){return e}const Ym={encodeHrTime:function(e){const t=Gm(e);return r=t,{low:Number(BigInt.asUintN(32,r)),high:Number(BigInt.asUintN(32,r>>BigInt(32)))};var r},encodeSpanContext:Vm,encodeOptionalSpanContext:function(e){if(void 0!==e)return Vm(e)}};function Km(e){return{attributes:Xm(e.attributes),droppedAttributesCount:0}}function Jm(e){return{name:e.name,version:e.version}}function Xm(e){return Object.keys(e).map(t=>qm(t,e[t]))}function qm(e,t){return{key:e,value:Qm(t)}}function Qm(e){const t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(Qm)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map(([e,t])=>qm(e,t))}}:{}}function $m(e,t){const r=e.spanContext(),n=e.status,s=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(r.traceId),spanId:t.encodeSpanContext(r.spanId),parentSpanId:s,traceState:r.traceState?.serialize(),name:e.name,kind:null==e.kind?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:Xm(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>function(e,t){return{attributes:e.attributes?Xm(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:n.code,message:n.message},links:e.links.map(e=>function(e,t){return{attributes:e.attributes?Xm(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}(e,t)),droppedLinksCount:e.droppedLinksCount}}function eg(e,t){const r=function(e){return void 0===e?Ym:{encodeHrTime:Wm,encodeSpanContext:Hm,encodeOptionalSpanContext:Hm}}(t);return{resourceSpans:tg(e,r)}}function tg(e,t){const r=function(e){const t=new Map;for(const r of e){let e=t.get(r.resource);e||(e=new Map,t.set(r.resource,e));const n=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`;let s=e.get(n);s||(s=[],e.set(n,s)),s.push(r)}return t}(e),n=[],s=r.entries();let o=s.next();for(;!o.done;){const[e,r]=o.value,i=[],a=r.values();let l=a.next();for(;!l.done;){const e=l.value;if(e.length>0){const r=e.map(e=>$m(e,t));i.push({scope:Jm(e[0].instrumentationScope),spans:r,schemaUrl:e[0].instrumentationScope.schemaUrl})}l=a.next()}const c={resource:Km(e),scopeSpans:i,schemaUrl:void 0};n.push(c),o=s.next()}return n}const rg={serializeRequest:e=>{const t=eg(e,{});return(new TextEncoder).encode(JSON.stringify(t))},deserializeResponse:e=>{if(0===e.length)return{};const t=new TextDecoder;return JSON.parse(t.decode(e))}};function ng(){return.4*Math.random()-.2}class sg{_transport;constructor(e){this._transport=e}retry(e,t,r){return new Promise((n,s)=>{setTimeout(()=>{this._transport.send(e,t).then(n,s)},r)})}async send(e,t){const r=Date.now()+t;let n=await this._transport.send(e,t),s=5,o=1e3;for(;"retryable"===n.status&&s>0;){s--;const t=Math.max(Math.min(o,5e3)+ng(),0);o*=1.5;const i=n.retryInMillis??t,a=r-Date.now();if(i>a)return n;n=await this.retry(e,a,i)}return n}shutdown(){return this._transport.shutdown()}}function og(e){return new sg(e.transport)}function ig(e){if(null==e)return;const t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?1e3*t:-1;const r=new Date(e).getTime()-Date.now();return r>=0?r:0}class ag{_parameters;constructor(e){this._parameters=e}send(e,t){return new Promise(r=>{const n=new XMLHttpRequest;n.timeout=t,n.open("POST",this._parameters.url);const s=this._parameters.headers();Object.entries(s).forEach(([e,t])=>{n.setRequestHeader(e,t)}),n.ontimeout=e=>{r({status:"failure",error:new Error("XHR request timed out")})},n.onreadystatechange=()=>{var e;n.status>=200&&n.status<=299?(sh.debug("XHR success"),r({status:"success"})):n.status&&(e=n.status,[429,502,503,504].includes(e))?r({status:"retryable",retryInMillis:ig(n.getResponseHeader("Retry-After"))}):0!==n.status&&r({status:"failure",error:new Error("XHR request failed with non-retryable status")})},n.onabort=()=>{r({status:"failure",error:new Error("XHR request aborted")})},n.onerror=()=>{r({status:"failure",error:new Error("XHR request errored")})},n.send(e)})}shutdown(){}}class lg{_params;constructor(e){this._params=e}send(e){return new Promise(t=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(sh.debug("SendBeacon success"),t({status:"success"})):t({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function cg(e,t,r){const n={...r()},s={};return()=>(null!=t&&Object.assign(s,t()),null!=e&&Object.assign(s,e()),Object.assign(s,n))}function ug(e){if(null!=e)try{return new URL(e),e}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function hg(e,t,r){return n={url:e.url,timeoutMillis:e.timeoutMillis,headers:Dm(e.headers),concurrencyLimit:e.concurrencyLimit},s={},o=function(e,t){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none",headers:()=>e,url:"http://localhost:4318/"+t,agentOptions:{keepAlive:!0}}}(r,t),{...Pm(n,s,o),headers:cg((i=n.headers,()=>{const e={};return Object.entries(i?.()??{}).forEach(([t,r])=>{void 0!==r?e[t]=String(r):sh.warn(`Header "${t}" has invalid value (${r}) and will be ignored`)}),e}),s.headers,o.headers),url:ug(n.url)??s.url??o.url,agentOptions:n.agentOptions??s.agentOptions??o.agentOptions};var n,s,o,i}function pg(e,t,r,n){const s=!!e.headers||"function"!=typeof navigator.sendBeacon,o=hg(e,r,n);return s?function(e,t){return jm(e,t,og({transport:(r=e,new ag(r))}));var r}(o,t):function(e,t){return jm(e,t,og({transport:(r={url:e.url,blobType:e.headers()["Content-Type"]},new lg(r))}));var r}(o,t)}class dg extends Nm{constructor(e={}){super(pg(e,rg,"v1/traces",{"Content-Type":"application/json"}))}}class fg{constructor(e,t){this.config=e,this.sessionId=t,this.provider=this.createProvider()}createProvider(){const{serviceName:e,resourceAttributes:t,exporterEndpoint:r,projectId:n}=this.config,s=Up({[zh]:e,"at-project-id":n,...t||{}}),o=new dg({url:r||"https://otelcol.s.past3.tech/v1/traces",headers:{}});return new ld({resource:s,spanProcessors:[new Qp(o)]})}configure(){this.provider.register({contextManager:new Gd,propagator:new mp});const e=this.config.propagateTraceHeaderCorsUrls||[/^https?:\/\/.*/],t=[/^https?:\/\/(?:[^\/]+\.)?apitoolkit\.io\//,/^https?:\/\/(?:[^\/]+\.)?monoscope\.tech\//];!function(e){const t=e.tracerProvider||vh.getTracerProvider(),r=e.meterProvider||ah.getMeterProvider(),n=e.loggerProvider||Ed.getLoggerProvider(),s=e.instrumentations?.flat()??[];(function(e,t,r,n){for(let s=0,o=e.length;s<o;s++){const o=e[s];t&&o.setTracerProvider(t),r&&o.setMeterProvider(r),n&&o.setLoggerProvider&&o.setLoggerProvider(n),o.getConfig().enabled||o.enable()}})(s,t,r,n)}({tracerProvider:this.provider,instrumentations:[...this.config.instrumentations||[],new zd({applyCustomAttributesOnSpan:{documentLoad:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)},documentFetch:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)},resourceFetch:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)}}}),new um({propagateTraceHeaderCorsUrls:e,ignoreUrls:t,applyCustomAttributesOnSpan:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)}}),new xm({propagateTraceHeaderCorsUrls:e,ignoreUrls:t,applyCustomAttributesOnSpan:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)}})]})}setUserAttributes(e){if(this.config.user)for(let t in this.config.user)e.setAttribute(`user.${t}`,this.config.user[t])}async shutdown(){await this.provider.shutdown()}setUser(e){this.config={...this.config,user:{...this.config.user,...e}}}}const mg=[];for(let e=0;e<256;++e)mg.push((e+256).toString(16).slice(1));let gg;const yg=new Uint8Array(16);var bg={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function vg(e,t,r){if(bg.randomUUID&&!e)return bg.randomUUID();const n=(e=e||{}).random??e.rng?.()??function(){if(!gg){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");gg=crypto.getRandomValues.bind(crypto)}return gg(yg)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e,t=0){return(mg[e[t+0]]+mg[e[t+1]]+mg[e[t+2]]+mg[e[t+3]]+"-"+mg[e[t+4]]+mg[e[t+5]]+"-"+mg[e[t+6]]+mg[e[t+7]]+"-"+mg[e[t+8]]+mg[e[t+9]]+"-"+mg[e[t+10]]+mg[e[t+11]]+mg[e[t+12]]+mg[e[t+13]]+mg[e[t+14]]+mg[e[t+15]]).toLowerCase()}(n)}return class{constructor(e){if(!e.projectId)throw new Error("MonoscopeConfig must include projectId");const t=sessionStorage.getItem("monoscope-session-id");t?this.sessionId=t:(this.sessionId=vg(),sessionStorage.setItem("monoscope-session-id",this.sessionId)),this.config=e,this.replay=new Tc(e,this.sessionId),this.otel=new fg(e,this.sessionId),this.otel.configure(),this.replay.configure()}getSessionId(){return this.sessionId}setUser(e){this.otel.setUser(e)}}});
|
|
21
21
|
//# sourceMappingURL=monoscope.umd.js.map
|