PageSourceSearch

https://khealth.com/_next/static/chunks/1exq4mh40toi5.js

js khealth.com collected 2026-10-03 19:31:22 UTC 212,724 bytes, 8 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,56749,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.defineProperties,s=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,c=(e,t,r)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,u=(e,t)=>{for(var r in t||(t={}))a.call(t,r)&&c(e,r,t[r]);if(o)for(var r of o(t))l.call(t,r)&&c(e,r,t[r]);return e},h=(e,t,r)=>(c(e,"symbol"!=typeof t?t+"":t,r),r),d=globalThis;function p(e){return(d.__Zone_symbol_prefix||"__zone_symbol__")+e}var _=Object.getOwnPropertyDescriptor,g=Object.defineProperty,m=Object.getPrototypeOf,f=Object.create,T=Array.prototype.slice,E="addEventListener",b="removeEventListener",y=p(E),v=p(b),S="true",w="false",A=p("");function L(e,t){return Zone.current.wrap(e,t)}function C(e,t,r,i,n){return Zone.current.scheduleMacroTask(e,t,r,i,n)}var O="u">typeof window,R=O?window:void 0,k=O&&R||globalThis;function x(e,t){for(let r=e.length-1;r>=0;r--)"function"==typeof e[r]&&(e[r]=L(e[r],t+"_"+r));return e}function N(e){return!e||!1!==e.writable&&("function"!=typeof e.get||void 0!==e.set)}var P="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,D=!("nw"in k)&&void 0!==k.process&&"[object process]"===k.process.toString(),M=!D&&!P&&!!(O&&R.HTMLElement),I=void 0!==k.process&&"[object process]"===k.process.toString()&&!P&&!!(O&&R.HTMLElement),U={},B=p("enable_beforeunload"),F=function(e){let t;if(!(e=e||k.event))return;let r=U[e.type];r||(r=U[e.type]=p("ON_PROPERTY"+e.type));let i=this||e.target||k,n=i[r];if(M&&i===R&&"error"===e.type){let r=e;!0===(t=n&&n.call(this,r.message,r.filename,r.lineno,r.colno,r.error))&&e.preventDefault()}else t=n&&n.apply(this,arguments),"beforeunload"===e.type&&k[B]&&"string"==typeof t?e.returnValue=t:void 0==t||t||e.preventDefault();return t};function z(e,t,r){let i=_(e,t);if(!i&&r&&_(r,t)&&(i={enumerable:!0,configurable:!0}),!i||!i.configurable)return;let n=p("on"+t+"patched");if(e.hasOwnProperty(n)&&e[n])return;delete i.writable,delete i.value;let s=i.get,o=i.set,a=t.slice(2),l=U[a];l||(l=U[a]=p("ON_PROPERTY"+a)),i.set=function(t){let r=this;r||e!==k||(r=k),r&&("function"==typeof r[l]&&r.removeEventListener(a,F),null==o||o.call(r,null),r[l]=t,"function"==typeof t&&r.addEventListener(a,F,!1))},i.get=function(){let r=this;if(r||e!==k||(r=k),!r)return null;let n=r[l];if(n)return n;if(s){let e=s.call(this);if(e)return i.set.call(this,e),"function"==typeof r.removeAttribute&&r.removeAttribute(t),e}return null},g(e,t,i),e[n]=!0}function V(e,t,r){if(t)for(let i=0;i<t.length;i++)z(e,"on"+t[i],r);else{let t=[];for(let r in e)"on"==r.slice(0,2)&&t.push(r);for(let i=0;i<t.length;i++)z(e,t[i],r)}}var j=p("originalInstance");function $(e){let t,r=k[e];if(!r)return;k[p(e)]=r,k[e]=function(){let t=x(arguments,e);switch(t.length){case 0:this[j]=new r;break;case 1:this[j]=new r(t[0]);break;case 2:this[j]=new r(t[0],t[1]);break;case 3:this[j]=new r(t[0],t[1],t[2]);break;case 4:this[j]=new r(t[0],t[1],t[2],t[3]);break;default:throw Error("Arg list too long.")}},Z(k[e],r);let i=new r(function(){});for(t in i)("XMLHttpRequest"!==e||"responseBlob"!==t)&&function(t){"function"==typeof i[t]?k[e].prototype[t]=function(){return this[j][t].apply(this[j],arguments)}
1:g(k[e].prototype,t,{set:function(r){"function"==typeof r?(this[j][t]=L(r,e+"."+t),Z(this[j][t],r)):this[j][t]=r},get:function(){return this[j][t]}})}(t);for(t in r)"prototype"!==t&&r.hasOwnProperty(t)&&(k[e][t]=r[t])}function H(e,t,r){let i=e;for(;i&&!i.hasOwnProperty(t);)i=m(i);!i&&e[t]&&(i=e);let n=p(t),s=null;if(i&&(!(s=i[n])||!i.hasOwnProperty(n))&&(s=i[n]=i[t],N(i&&_(i,t)))){let e=r(s,n,t);i[t]=function(){return e(this,arguments)},Z(i[t],s)}return s}function G(e,t,r){let i=null;function n(e){let t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},i.apply(t.target,t.args),e}i=H(e,t,e=>function(t,i){let s=r(t,i);return s.cbIdx>=0&&"function"==typeof i[s.cbIdx]?C(s.name,i[s.cbIdx],s,n):e.apply(t,i)})}function Z(e,t){e[p("OriginalDelegate")]=t}function W(e){return"function"==typeof e}function q(e){return"number"==typeof e}var X={useG:!0},Y={},Q={},K=RegExp("^"+A+"(\\w+)(true|false)$"),J=p("propagationStopped");function ee(e,t){let r=(t?t(e):e)+w,i=(t?t(e):e)+S;Y[e]={},Y[e][w]=A+r,Y[e][S]=A+i}function et(e,t,r,i){let o=i&&i.add||E,a=i&&i.rm||b,l=i&&i.listeners||"eventListeners",c=i&&i.rmAll||"removeAllListeners",h=p(o),d="."+o+":",_="prependListener",g="."+_+":",f=function(e,t,r){let i;if(e.isRemoved)return;let n=e.callback;"object"==typeof n&&n.handleEvent&&(e.callback=e=>n.handleEvent(e),e.originalDelegate=n);try{e.invoke(e,t,[r])}catch(e){i=e}let s=e.options;if(s&&"object"==typeof s&&s.once){let i=e.originalDelegate?e.originalDelegate:e.callback;t[a].call(t,r.type,i,s)}return i};function T(r,i,n){if(!(i=i||e.event))return;let s=r||i.target||e,o=s[Y[i.type][n?S:w]];if(o){let e=[];
1if(1===o.length){let t=f(o[0],s,i);t&&e.push(t)}else{let t=o.slice();for(let r=0;r<t.length&&(!i||!0!==i[J]);r++){let n=f(t[r],s,i);n&&e.push(n)}}if(1===e.length)throw e[0];for(let r=0;r<e.length;r++){let i=e[r];t.nativeScheduleMicroTask(()=>{throw i})}}}let y=function(e){return T(this,e,!1)},v=function(e){return T(this,e,!0)},L=[];for(let t=0;t<r.length;t++)L[t]=function(t,r){let i;if(!t)return!1;let f=!0;r&&void 0!==r.useG&&(f=r.useG);let T=r&&r.vh,E=!0;r&&void 0!==r.chkDup&&(E=r.chkDup);let b=!1;r&&void 0!==r.rt&&(b=r.rt);let L=t;for(;L&&!L.hasOwnProperty(o);)L=m(L);if(!L&&t[o]&&(L=t),!L||L[h])return!1;let C=r&&r.eventNameToString,O={},R=L[h]=L[o],k=L[p(a)]=L[a],x=L[p(l)]=L[l],N=L[p(c)]=L[c];r&&r.prepend&&(i=L[p(r.prepend)]=L[r.prepend]);let P=f?function(e){if(!O.isExisting)return R.call(O.target,O.eventName,O.capture?v:y,O.options)}:function(e){return R.call(O.target,O.eventName,e.invoke,O.options)},M=f?function(e){if(!e.isRemoved){let t,r=Y[e.eventName];r&&(t=r[e.capture?S:w]);let i=t&&e.target[t];if(i){for(let r=0;r<i.length;r++)if(i[r]===e){i.splice(r,1),e.isRemoved=!0,e.removeAbortListener&&(e.removeAbortListener(),e.removeAbortListener=null),0===i.length&&(e.allRemoved=!0,e.target[t]=null);break}}}if(e.allRemoved)return k.call(e.target,e.eventName,e.capture?v:y,e.options)}:function(e){return k.call(e.target,e.eventName,e.invoke,e.options)},I=(null==r?void 0:r.diff)||function(e,t){let r=typeof t;return"function"===r&&e.callback===t||"object"===r&&e.originalDelegate===t},U=Zone[p("UNPATCHED_EVENTS")],B=e[p("PASSIVE_EVENTS")],F=function(t,i,o,a,l=!1,c=!1){return function(){let h,d=this||e,p=arguments[0];r&&r.transferEventName&&(p=r.transferEventName(p));let _=arguments[1];if(!_||D&&"uncaughtException"===p)return t.apply(this,arguments);let g=!1;if("function"!=typeof _){if(!_.handleEvent)return t.apply(this,arguments);g=!0}if(T&&!T(t,_,d,arguments))return;let m=!!B&&-1!==B.indexOf(p),b=function(e){if("object"==typeof e&&null!==e){let t=u({},e);return e.signal&&(t.signal=e.signal),t}return e}(function(e,t){if(!t)return e;if("boolean"==typeof e)return{capture:e,passive:!0};if(!e)return{passive:!0};if("object"==typeof e&&!1!==e.passive)return n(u({},e),s({passive:!0}));return e}(arguments[2],m)),y=null==b?void 0:b.signal;if(null==y?void 0:y.aborted)return;if(U){for(let e=0;e<U.length;e++)if(p===U[e])if(m)return t.call(d,p,_,b);else return t.apply(this,arguments)}let v=!!b&&("boolean"==typeof b||b.capture),A=!!b&&"object"==typeof b&&b.once,L=Zone.current,R=Y[p];R||(ee(p,C),R=Y[p]);let k=R[v?S:w],x=d[k],N=!1;if(x){if(N=!0,E){for(let e=0;e<x.length;e++)if(I(x[e],_))return}}else x=d[k]=[];let P=d.constructor.name,M=Q[P];M&&(h=M[p]),h||(h=P+i+(C?C(p):p)),O.options=b,A&&(O.options.once=!1),O.target=d,O.capture=v,O.eventName=p,O.isExisting=N;let F=f?X:void 0;F&&(F.taskData=O),y&&(O.options.signal=void 0);let z=L.scheduleEventTask(h,_,F,o,a);if(y){O.options.signal=y;let e=()=>z.zone.cancelTask(z);t.call(y,"abort",e,{once:!0}),z.removeAbortListener=()=>y.removeEventListener("abort",e)}if(O.target=null,F&&(F.taskData=null),A&&(O.options.once=!0),"boolean"!=typeof z.options&&(z.options=b),z.target=d,z.capture=v,z.eventName=p,g&&(z.originalDelegate=_),c?x.unshift(z):x.push(z),l)return d}};return L[o]=F(R,d,P,M,b),i&&(L[_]=F(i,g,function(e){return i.call(O.target,O.eventName,e.invoke,O.options)},M,b,!0)),L[a]=function(){let t,i=this||e,n=arguments[0];r&&r.transferEventName&&(n=r.transferEventName(n));let s=arguments[2],o=!!s&&("boolean"==typeof s||s.capture),a=arguments[1];if(!a)return k.apply(this,arguments);if(T&&!T(k,a,i,arguments))return;let l=Y[n];l&&(t=l[o?S:w]);let c=t&&i[t];if(c)for(let e=0;e<c.length;e++){let r=c[e];if(I(r,a)){if(c.splice(e,1),r.isRemoved=!0,0===c.length&&(r.allRemoved=!0,i[t]=null,o||"string"!=typeof n||(i[A+"ON_PROPERTY"+n]=null)),r.zone.cancelTask(r),b)return i;return}}return k.apply(this,arguments)},L[l]=function(){let t=this||e,i=arguments[0];r&&r.transferEventName&&(i=r.transferEventName(i));let n=[],s=er(t,C?C(i):i);for(let e=0;e<s.length;e++){let t=s[e],r=t.originalDelegate?t.originalDelegate:t.callback;n.push(r)}return n},L[c]=function(){let t=this||e,i=arguments[0];if(i){r&&r.transferEventName&&(i=r.transferEventName(i));let e=Y[i];if(e){let r=e[w],n=e[S],s=t[r],o=t[n];if(s){let e=s.slice();for(let t=0;t<e.length;t++){let r=e[t],n=r.originalDelegate?r.originalDelegate:r.callback;this[a].call(this,i,n,r.options)}}if(o){let e=o.slice();for(let t=0;t<e.length;t++){let r=e[t],n=r.originalDelegate?r.originalDelegate:r.callback;this[a].call(this,i,n,r.options)}}}}else{let e=Object.keys(t);for(let t=0;t<e.length;t++){let r=e[t],i=K.exec(r),n=i&&i[1];n&&"removeListener"!==n&&this[c].call(this,n)}this[c].call(this,"removeListener")}if(b)return this},Z(L[o],R),Z(L[a],k),N&&Z(L[c],N),x&&Z(L[l],x),!0}(r[t],i);return L}function er(e,t){if(!t){let r=[];for(let i in e){let n=K.exec(i),s=n&&n[1];if(s&&(!t||s===t)){let t=e[i];if(t)for(let e=0;e<t.length;e++)r.push(t[e])}}return r}let r=Y[t];r||(ee(t),r=Y[t]);let i=e[r[w]],n=e[r[S]];return i?n?i.concat(n):i.slice():n?n.slice():[]}function ei(e,t){let r=e.Event;r&&r.prototype&&t.patchMethod(r.prototype,"stopImmediatePropagation",e=>function(t,r){t[J]=!0,e&&e.apply(t,r)}
1)}var en=p("zoneTask");function es(e,t,r,i){let n=null,s=null;t+=i,r+=i;let o={};function a(t){let r=t.data;r.args[0]=function(){return t.invoke.apply(this,arguments)};let i=n.apply(e,r.args);return q(i)?r.handleId=i:(r.handle=i,r.isRefreshable=W(i.refresh)),t}function l(t){let{handle:r,handleId:i}=t.data;return s.call(e,null!=r?r:i)}n=H(e,t,r=>function(n,s){var c;if(!W(s[0]))return r.apply(e,s);{let e={isRefreshable:!1,isPeriodic:"Interval"===i,delay:"Timeout"===i||"Interval"===i?s[1]||0:void 0,args:s},r=s[0];s[0]=function(){try{return r.apply(this,arguments)}finally{let{handle:t,handleId:r,isPeriodic:i,isRefreshable:n}=e;i||n||(r?delete o[r]:t&&(t[en]=null))}};let n=C(t,s[0],e,a,l);if(!n)return n;let{handleId:u,handle:h,isRefreshable:d,isPeriodic:p}=n.data;if(u)o[u]=n;else if(h&&(h[en]=n,d&&!p)){let e=h.refresh;h.refresh=function(){let{zone:t,state:r}=n;return"notScheduled"===r?(n._state="scheduled",t._updateTaskCount(n,1)):"running"===r&&(n._state="scheduling"),e.call(this)}}return null!=(c=null!=h?h:u)?c:n}}),s=H(e,r,t=>function(r,i){let n,s=i[0];q(s)?(n=o[s],delete o[s]):(n=null==s?void 0:s[en])?s[en]=null:n=s,(null==n?void 0:n.type)?n.cancelFn&&n.zone.cancelTask(n):t.apply(e,i)})}function eo(e,t,r){if(!r||0===r.length)return t;let i=r.filter(t=>t.target===e);if(0===i.length)return t;let n=i[0].ignoreProperties;return t.filter(e=>-1===n.indexOf(e))}function ea(e,t,r,i){if(!e)return;let n=eo(e,t,r);V(e,n,i)}function el(e){return Object.getOwnPropertyNames(e).filter(e=>e.startsWith("on")&&e.length>2).map(e=>e.substring(2))}function ec(e,t,r,i,n){let s=Zone.__symbol__(i);if(t[s])return;let o=t[s]=t[i];
1t[i]=function(s,a,l){return a&&a.prototype&&n.forEach(function(t){let n=`${r}.${i}::`+t,s=a.prototype;try{if(s.hasOwnProperty(t)){let r=e.ObjectGetOwnPropertyDescriptor(s,t);r&&r.value?(r.value=e.wrapWithCurrentZone(r.value,n),e._redefineProperty(a.prototype,t,r)):s[t]&&(s[t]=e.wrapWithCurrentZone(s[t],n))}else s[t]&&(s[t]=e.wrapWithCurrentZone(s[t],n))}catch(e){}}),o.call(t,s,a,l)},e.attachOriginToPatched(t[i],o)}var eu=function(){let e=globalThis,t=!0===e[p("forceDuplicateZoneCheck")];if(e.Zone&&(t||"function"!=typeof e.Zone.__symbol__))throw Error("Zone already loaded.");return null!=e.Zone||(e.Zone=function(){let e,t=d.performance;function r(e){t&&t.mark&&t.mark(e)}function i(e,r){t&&t.measure&&t.measure(e,r)}r("Zone");let n=class e{constructor(e,t){h(this,"_parent"),h(this,"_name"),h(this,"_properties"),h(this,"_zoneDelegate"),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)}static assertZonePatched(){if(d.Promise!==k.ZoneAwarePromise)throw 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 t=e.current;for(;t.parent;)t=t.parent;return t}static get current(){return N.zone}static get currentTask(){return P}static __load_patch(t,n,s=!1){if(k.hasOwnProperty(t)){let e=!0===d[p("forceDuplicateZoneCheck")];if(!s&&e)throw Error("Already loaded patch: "+t)}else if(!d["__Zone_disable_"+t]){let s="Zone:"+t;r(s),k[t]=n(d,e,x),i(s,s)}}get parent(){return this._parent}get name(){return this._name}get(e){let 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 Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}wrap(e,t){if("function"!=typeof e)throw Error("Expecting function got: "+e);let r=this._zoneDelegate.intercept(this,e,t),i=this;return function(){return i.runGuarded(r,this,arguments,t)}}run(e,t,r,i){N={parent:N,zone:this};try{return this._zoneDelegate.invoke(this,e,t,r,i)}finally{N=N.parent}}runGuarded(e,t=null,r,i){N={parent:N,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,r,i)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{N=N.parent}}runTask(e,t,r){if(e.zone!=this)throw Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||b).name+"; Execution: "+this.name+")");let{type:i,data:{isPeriodic:n=!1,isRefreshable:s=!1}={}}=e;if(e.state===y&&(i===R||i===O))return;let o=e.state!=w;o&&e._transitionTo(w,S);let a=P;P=e,N={parent:N,zone:this};try{i!=O||!e.data||n||s||(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,e,t,r)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{let t=e.state;if(t!==y&&t!==L)if(i==R||n||s&&t===v)o&&e._transitionTo(S,w,v);else{let t=e._zoneDelegates;this._updateTaskCount(e,-1),o&&e._transitionTo(y,w,y),s&&(e._zoneDelegates=t)}N=N.parent,P=a}}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(v,y);let t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(t){throw e._transitionTo(L,v,y),this._zoneDelegate.handleError(this,t),t}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==v&&e._transitionTo(S,v),e}scheduleMicroTask(e,t,r,i){return this.scheduleTask(new a(C,e,t,r,i,void 0))}scheduleMacroTask(e,t,r,i,n){return this.scheduleTask(new a(O,e,t,r,i,n))}scheduleEventTask(e,t,r,i,n){return this.scheduleTask(new a(R,e,t,r,i,n))}cancelTask(e){if(e.zone!=this)throw Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||b).name+"; Execution: "+this.name+")");if(e.state===S||e.state===w){e._transitionTo(A,S,w);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(L,A),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(y,A),e.runCount=-1,e}}_updateTaskCount(e,t){let r=e._zoneDelegates;-1==t&&(e._zoneDelegates=null);for(let i=0;i<r.length;i++)r[i]._updateTaskCount(e.type,t)}};h(n,"__symbol__",p);let s={name:"",onHasTask:(e,t,r,i)=>e.hasTask(r,i),onScheduleTask:(e,t,r,i)=>e.scheduleTask(r,i),onInvokeTask:(e,t,r,i,n,s)=>e.invokeTask(r,i,n,s),onCancelTask:(e,t,r,i)=>e.cancelTask(r,i)};class o{constructor(e,t,r){h(this,"_zone"),h(this,"_taskCounts",{microTask:0,macroTask:0,eventTask:0}),h(this,"_forkDlgt"),h(this,"_forkZS"),h(this,"_forkCurrZone"),h(this,"_interceptDlgt"),h(this,"_interceptZS"),h(this,"_interceptCurrZone"),h(this,"_invokeDlgt"),h(this,"_invokeZS"),h(this,"_invokeCurrZone"),h(this,"_handleErrorDlgt"),h(this,"_handleErrorZS"),h(this,"_handleErrorCurrZone"),h(this,"_scheduleTaskDlgt"),h(this,"_scheduleTaskZS"),h(this,"_scheduleTaskCurrZone"),h(this,"_invokeTaskDlgt"),h(this,"_invokeTaskZS"),h(this,"_invokeTaskCurrZone"),h(this,"_cancelTaskDlgt"),h(this,"_cancelTaskZS"),h(this,"_cancelTaskCurrZone"),h(this,"_hasTaskDlgt"),h(this,"_hasTaskDlgtOwner"),h(this,"_hasTaskZS"),h(this,"_hasTaskCurrZone"),this._zone=e,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 i=r&&r.onHasTask,n=t&&t._hasTaskZS;(i||n)&&(this._hasTaskZS=i?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))}get zone(){return 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,i,n){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,r,i,n):t.apply(r,i)}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=t);else if(t.scheduleFn)t.scheduleFn(t);else if(t.type==C)T(t);else throw Error("Task is missing scheduleFn.");return r}invokeTask(e,t,r,i){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,r,i):t.callback.apply(r,i)}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){let r=this._taskCounts,i=r[e],n=r[e]=i+t;if(n<0)throw Error("More tasks executed then were scheduled.");
1if(0==i||0==n){let t={microTask:r.microTask>0,macroTask:r.macroTask>0,eventTask:r.eventTask>0,change:e};this.hasTask(this._zone,t)}}}class a{constructor(e,t,r,i,n,s){if(h(this,"type"),h(this,"source"),h(this,"invoke"),h(this,"callback"),h(this,"data"),h(this,"scheduleFn"),h(this,"cancelFn"),h(this,"_zone",null),h(this,"runCount",0),h(this,"_zoneDelegates",null),h(this,"_state","notScheduled"),this.type=e,this.source=t,this.data=i,this.scheduleFn=n,this.cancelFn=s,!r)throw Error("callback is not defined");this.callback=r;const o=this;e===R&&i&&i.useG?this.invoke=a.invokeTask:this.invoke=function(){return a.invokeTask.call(d,o,this,arguments)}}static invokeTask(e,t,r){e||(e=this),D++;try{return e.runCount++,e.zone.runTask(e,t,r)}finally{1!==D||d[_]||E(),D--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(y,v)}_transitionTo(e,t,r){if(this._state===t||this._state===r)this._state=e,e==y&&(this._zoneDelegates=null);else throw Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${r?" or '"+r+"'":""}, was '${this._state}'.`)}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}}}let l=p("setTimeout"),c=p("Promise"),u=p("then"),_=p("enable_native_microtask_draining"),g=[],m=!1;function f(t){var r;!e&&d[c]&&(e=d[c].resolve(0)),e?(null!=(r=e[u])?r:e.then).call(e,t):d[l](t,0)}function T(e){let t=d[_],r=t&&0===g.length&&!m,i=!t&&0===D&&0===g.length;(r||i)&&f(E),e&&g.push(e)}function E(){if(!m){for(m=!0;g.length;){let e=g;for(let t of(g=[],e))try{t.zone.runTask(t,null,null)}catch(e){x.onUnhandledError(e)}}d[_]?(m=!1,x.microtaskDrainDone()):(x.microtaskDrainDone(),m=!1)}}let b={name:"NO ZONE"},y="notScheduled",v="scheduling",S="scheduled",w="running",A="canceling",L="unknown",C="microTask",O="macroTask",R="eventTask",k={},x={symbol:p,currentZoneFrame:()=>N,onUnhandledError:M,microtaskDrainDone:M,scheduleMicroTask:T,showUncaughtError:()=>!n[p("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:M,patchMethod:()=>M,bindArguments:()=>[],patchThen:()=>M,patchMacroTask:()=>M,patchEventPrototype:()=>M,getGlobalObjects:()=>void 0,ObjectDefineProperty:()=>M,ObjectGetOwnPropertyDescriptor:()=>void 0,ObjectCreate:()=>void 0,ArraySlice:()=>[],patchClass:()=>M,wrapWithCurrentZone:()=>M,filterProperties:()=>[],attachOriginToPatched:()=>M,_redefineProperty:()=>M,patchCallbacks:()=>M,nativeScheduleMicroTask:f},N={parent:null,zone:new n(null,null)},P=null,D=0;function M(){}return i("Zone","Zone"),n}()),e.Zone}();eu.__load_patch("ZoneAwarePromise",(e,t,r)=>{let i=Object.getOwnPropertyDescriptor,n=Object.defineProperty,s=r.symbol,o=[],a=!1!==e[s("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],l=s("Promise"),c=s("then");r.onUnhandledError=e=>{if(r.showUncaughtError()){let 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(;o.length;){let e=o.shift();try{e.zone.runGuarded(()=>{if(e.throwOriginal)throw e.rejection;throw e})}catch(e){!function(e){r.onUnhandledError(e);try{let r=t[u];"function"==typeof r&&r.call(this,e)}catch(e){}}(e)}}};let u=s("unhandledPromiseRejectionHandler");function h(e){return e&&"function"==typeof e.then}function d(e){return e}function p(e){return O.reject(e)}let _=s("state"),g=s("value"),m=s("finally"),f=s("parentPromiseValue"),T=s("parentPromiseState");function E(e,t){return r=>{try{v(e,t,r)}catch(t){v(e,!1,t)}}}let b=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},y=s("currentTaskTrace");function v(e,i,s){let l=b();if(e===s)throw TypeError("Promise resolved with itself");if(null===e[_]){let u=null;try{("object"==typeof s||"function"==typeof s)&&(u=s&&s.then)}catch(t){return l(()=>{v(e,!1,t)})(),e}if(!1!==i&&s instanceof O&&s.hasOwnProperty(_)&&s.hasOwnProperty(g)&&null!==s[_])w(s),v(e,s[_],s[g]);else if(!1!==i&&"function"==typeof u)try{u.call(s,l(E(e,i)),l(E(e,!1)))}catch(t){l(()=>
1{v(e,!1,t)})()}else{e[_]=i;let l=e[g];if(e[g]=s,e[m]===m&&!0===i&&(e[_]=e[T],e[g]=e[f]),!1===i&&s instanceof Error){let e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&n(s,y,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t<l.length;)A(e,l[t++],l[t++],l[t++],l[t++]);if(0==l.length&&!1==i){e[_]=0;let i=s;try{var c;throw Error("Uncaught (in promise): "+((c=s)&&c.toString===Object.prototype.toString?(c.constructor&&c.constructor.name||"")+": "+JSON.stringify(c):c?c.toString():Object.prototype.toString.call(c))+(s&&s.stack?"\n"+s.stack:""))}catch(e){i=e}a&&(i.throwOriginal=!0),i.rejection=s,i.promise=e,i.zone=t.current,i.task=t.currentTask,o.push(i),r.scheduleMicroTask()}}}return e}let S=s("rejectionHandledHandler");function w(e){if(0===e[_]){try{let r=t[S];r&&"function"==typeof r&&r.call(this,{rejection:e[g],promise:e})}catch(e){}e[_]=!1;for(let t=0;t<o.length;t++)e===o[t].promise&&o.splice(t,1)}}function A(e,t,r,i,n){w(e);let s=e[_],o=s?"function"==typeof i?i:d:"function"==typeof n?n:p;t.scheduleMicroTask("Promise.then",()=>{try{let i=e[g],n=!!r&&m===r[m];n&&(r[f]=i,r[T]=s);let a=t.run(o,void 0,n&&o!==p&&o!==d?[]:[i]);v(r,!0,a)}catch(e){v(r,!1,e)}},r)}let L=function(){},C=e.AggregateError;class O{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(e){return e instanceof O?e:v(new this(null),!0,e)}static reject(e){return v(new this(null),!1,e)}static withResolvers(){let e={};return e.promise=new O((t,r)=>{e.resolve=t,e.reject=r}),e}static any(e){if(!e||"function"!=typeof e[Symbol.iterator])return Promise.reject(new C([],"All promises were rejected"));let t=[],r=0;try{for(let i of e)r++,t.push(O.resolve(i))}catch(e){return Promise.reject(new C([],"All promises were rejected"))}if(0===r)return Promise.reject(new C([],"All promises were rejected"));let i=!1,n=[];return new O((e,s)=>{for(let o=0;o<t.length;o++)t[o].then(t=>{i||(i=!0,e(t))},e=>{n.push(e),0==--r&&(i=!0,s(new C(n,"All promises were rejected")))})})}static race(e){let t,r,i=new this((e,i)=>{t=e,r=i});function n(e){t(e)}function s(e){r(e)}for(let t of e)h(t)||(t=this.resolve(t)),t.then(n,s);return i}static all(e){return O.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof O?this:O).allWithCallback(e,{thenCallback:e=>({status:"fulfilled",value:e}),errorCallback:e=>({status:"rejected",reason:e})})}static allWithCallback(e,t){let r,i,n=new this((e,t)=>{r=e,i=t}),s=2,o=0,a=[];for(let n of e){h(n)||(n=this.resolve(n));let e=o;try{n.then(i=>{a[e]=t?t.thenCallback(i):i,s--,0===s&&r(a)},n=>{t?(a[e]=t.errorCallback(n),s--,0===s&&r(a)):i(n)})}catch(e){i(e)}s++,o++}return 0==(s-=2)&&r(a),n}constructor(e){if(!(this instanceof O))throw Error("Must be an instanceof Promise.");this[_]=null,this[g]=[];try{const t=b();e&&e(t(E(this,!0)),t(E(this,!1)))}catch(e){v(this,!1,e)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return O}then(e,r){var i;let n=null==(i=this.constructor)?void 0:i[Symbol.species];n&&"function"==typeof n||(n=this.constructor||O);let s=new n(L),o=t.current;return null==this[_]?this[g].push(o,s,e,r):A(this,o,s,e,r),s}catch(e){return this.then(null,e)}finally(e){var r;let i=null==(r=this.constructor)?void 0:r[Symbol.species];i&&"function"==typeof i||(i=O);let n=new i(L);n[m]=m;let s=t.current;return null==this[_]?this[g].push(s,n,e,e):A(this,s,n,e,e),n}}O.resolve=O.resolve,O.reject=O.reject,O.race=O.race,O.all=O.all;let R=e[l]=e.Promise;e.Promise=O;let k=s("thenPatched");function x(e){let t=e.prototype,r=i(t,"then");if(r&&(!1===r.writable||!r.configurable))return;let n=t.then;t[c]=n,e.prototype.then=function(e,t){return new O((e,t)=>{n.call(this,e,t)}).then(e,t)},e[k]=!0}if(r.patchThen=x,R){x(R);let t=R.try;t&&"function"==typeof t&&(O.try=t),H(e,"fetch",e=>function(t,r){let i=e.apply(t,r);if(i instanceof O)return i;let n=i.constructor;return n[k]||x(n),i})}return Promise[t.__symbol__("uncaughtPromiseErrors")]=o,O}),eu.__load_patch("toString",e=>{let t=Function.prototype.toString,r=p("OriginalDelegate"),i=p("Promise"),n=p("Error"),s=function(){if("function"==typeof this){let s=this[r];if(s)if("function"==typeof s)return t.call(s);else return Object.prototype.toString.call(s);if(this===Promise){let r=e[i];if(r)return t.call(r)}if(this===Error){let r=e[n];if(r)return t.call(r)}}return t.call(this)};s[r]=t,Function.prototype.toString=s;let o=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":o.call(this)}}),eu.__load_patch("util",(e,t,r)=>{let i=el(e);r.patchOnProperties=V,r.patchMethod=H,r.bindArguments=x,r.patchMacroTask=G;let n=t.__symbol__("BLACK_LISTED_EVENTS"),s=t.__symbol__("UNPATCHED_EVENTS");e[s]&&(e[n]=e[s]),e[n]&&(t[n]=t[s]=e[n]),r.patchEventPrototype=ei,r.patchEventTarget=et,r.ObjectDefineProperty=g,r.ObjectGetOwnPropertyDescriptor=_,r.ObjectCreate=f,r.ArraySlice=T,r.patchClass=$,r.wrapWithCurrentZone=L,r.f
1ilterProperties=eo,r.attachOriginToPatched=Z,r._redefineProperty=Object.defineProperty,r.patchCallbacks=ec,r.getGlobalObjects=()=>({globalSources:Q,zoneSymbolEventNames:Y,eventNames:i,isBrowser:M,isMix:I,isNode:D,TRUE_STR:S,FALSE_STR:w,ZONE_SYMBOL_PREFIX:A,ADD_EVENT_LISTENER_STR:E,REMOVE_EVENT_LISTENER_STR:b})}),eu.__load_patch("timers",e=>{let t="clear";es(e,"set",t,"Timeout"),es(e,"set",t,"Interval"),es(e,"set",t,"Immediate")}),eu.__load_patch("requestAnimationFrame",e=>{es(e,"request","cancel","AnimationFrame"),es(e,"mozRequest","mozCancel","AnimationFrame"),es(e,"webkitRequest","webkitCancel","AnimationFrame")}),eu.__load_patch("blocking",(e,t)=>{let r=["alert","prompt","confirm"];for(let i=0;i<r.length;i++)H(e,r[i],(r,i,n)=>function(i,s){return t.current.run(r,e,s,n)})}),eu.__load_patch("EventTarget",(e,t,r)=>{r.patchEventPrototype(e,r),function(e,t){if(Zone[t.symbol("patchEventTarget")])return;let{eventNames:r,zoneSymbolEventNames:i,TRUE_STR:n,FALSE_STR:s,ZONE_SYMBOL_PREFIX:o}=t.getGlobalObjects();for(let e=0;e<r.length;e++){let t=r[e],a=o+(t+s),l=o+(t+n);i[t]={},i[t][s]=a,i[t][n]=l}let a=e.EventTarget;a&&a.prototype&&t.patchEventTarget(e,t,[a&&a.prototype])}(e,r);let i=e.XMLHttpRequestEventTarget;i&&i.prototype&&r.patchEventTarget(e,r,[i.prototype])}),eu.__load_patch("MutationObserver",(e,t,r)=>{$("MutationObserver"),$("WebKitMutationObserver")}),eu.__load_patch("IntersectionObserver",(e,t,r)=>{$("IntersectionObserver")}),eu.__load_patch("FileReader",(e,t,r)=>{$("FileReader")}),eu.__load_patch("on_property",(e,t,r)=>{!function(e,t){if(D&&!I||Zone[e.symbol("patchEvents")])return;let r=t.__Zone_ignore_on_properties,i=[];if(M){let e=window;i=i.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]),ea(e,el(e),r,m(e))}i=i.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let e=0;e<i.length;e++){let n=t[i[e]];(null==n?void 0:n.prototype)&&ea(n.prototype,el(n.prototype),r)}}(r,e)}),eu.__load_patch("customElements",(e,t,r)=>{!function(e,t){let{isBrowser:r,isMix:i}=t.getGlobalObjects();(r||i)&&e.customElements&&"customElements"in e&&t.patchCallbacks(t,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"])}(e,r)}),eu.__load_patch("XHR",(e,t)=>{!function(e){let l=e.XMLHttpRequest;if(!l)return;let c=l.prototype,u=c[y],h=c[v];if(!u){let t=e.XMLHttpRequestEventTarget;if(t){let e=t.prototype;u=e[y],h=e[v]}}let d="readystatechange",_="scheduled";function g(e){let i=e.data,o=i.target;o[s]=!1,o[a]=!1;let l=o[n];u||(u=o[y],h=o[v]),l&&h.call(o,d,l);let c=o[n]=()=>
1{if(o.readyState===o.DONE)if(!i.aborted&&o[s]&&e.state===_){let r=o[t.__symbol__("loadfalse")];if(0!==o.status&&r&&r.length>0){let n=e.invoke;e.invoke=function(){let r=o[t.__symbol__("loadfalse")];for(let t=0;t<r.length;t++)r[t]===e&&r.splice(t,1);i.aborted||e.state!==_||n.call(e)},r.push(e)}else e.invoke()}else i.aborted||!1!==o[s]||(o[a]=!0)};return u.call(o,d,c),o[r]||(o[r]=e),S.apply(o,i.args),o[s]=!0,e}function m(){}function f(e){let t=e.data;return t.aborted=!0,w.apply(t.target,t.args)}let T=H(c,"open",()=>function(e,t){return e[i]=!1==t[2],e[o]=t[1],T.apply(e,t)}),E=p("fetchTaskAborting"),b=p("fetchTaskScheduling"),S=H(c,"send",()=>function(e,r){if(!0===t.current[b]||e[i])return S.apply(e,r);{let t={target:e,url:e[o],isPeriodic:!1,args:r,aborted:!1},i=C("XMLHttpRequest.send",m,t,g,f);e&&!0===e[a]&&!t.aborted&&i.state===_&&i.invoke()}}),w=H(c,"abort",()=>function(e,i){let n=e[r];if(n&&"string"==typeof n.type){if(null==n.cancelFn||n.data&&n.data.aborted)return;n.zone.cancelTask(n)}else if(!0===t.current[E])return w.apply(e,i)})}(e);let r=p("xhrTask"),i=p("xhrSync"),n=p("xhrListener"),s=p("xhrScheduled"),o=p("xhrURL"),a=p("xhrErrorBeforeScheduled")}),eu.__load_patch("geolocation",e=>{e.navigator&&e.navigator.geolocation&&function(e,t){let r=e.constructor.name;for(let i=0;i<t.length;i++){let n=t[i],s=e[n];if(s){if(!N(_(e,n)))continue;e[n]=(e=>{let t=function(){return e.apply(this,x(arguments,r+"."+n))};return Z(t,e),t})(s)}}}(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),eu.__load_patch("PromiseRejectionEvent",(e,t)=>{function r(t){return function(r){er(e,t).forEach(i=>{let n=e.PromiseRejectionEvent;if(n){let e=new n(t,{promise:r.promise,reason:r.rejection});i.invoke(e)}})}}e.PromiseRejectionEvent&&(t[p("unhandledPromiseRejectionHandler")]=r("unhandledrejection"),t[p("rejectionHandledHandler")]=r("rejectionhandled"))}),eu.__load_patch("queueMicrotask",(e,t,r)=>{r.patchMethod(e,"queueMicrotask",e=>function(e,t){Zone.current.scheduleMicroTask("queueMicrotask",t[0])})})},17804,e=>{"use strict";let t,r,i,n,s;function o(e){return Symbol.for(e)}let a=new class e{constructor(t){const r=this;r._currentContext=t?new Map(t):new Map,r.getValue=e=>r._currentContext.get(e),r.setValue=(t,i)=>{let n=new e(r._currentContext);return n._currentContext.set(t,i),n},r.deleteValue=t=>{let i=new e(r._currentContext);return i._currentContext.delete(t),i}}},l="1.9.1",c=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,u=function(e){let t=new Set([e]),r=new Set,i=e.match(c);if(!i)return()=>!1;let n={major:+i[1],minor:+i[2],patch:+i[3],prerelease:i[4]};if(null!=n.prerelease)return function(t){return t===e};function s(e){return r.add(e),!1}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;let i=e.match(c);if(!i)return s(e);let o={major:+i[1],minor:+i[2],patch:+i[3],prerelease:i[4]};if(null!=o.prerelease||n.major!==o.major)return s(e);if(0===n.major)return n.minor===o.minor&&n.patch<=o.patch?(t.add(e),!0):s(e);return n.minor<=o.minor?(t.add(e),!0):s(e)}}(l),h=l.split(".")[0],d=Symbol.for(`opentelemetry.js.api.${h}`),p="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:e.g;function _(e,t,r,i=!1){var n;let s=p[d]=null!=(n=p[d])?n:{version:l};if(!i&&s[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return r.error(t.stack||t.message),!1}if(s.version!==l){let t=Error(`@opentelemetry/api: Registration of version v${s.version} for ${e} does not match previously registered API v${l}`);return r.error(t.stack||t.message),!1}return s[e]=t,r.debug(`@opentelemetry/api: Registered a global for ${e} v${l}.`),!0}function g(e){var t,r;let i=null==(t=p[d])?void 0:t.version;if(i&&u(i))return null==(r=p[d])?void 0:r[e]}function m(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${l}.`);let r=p[d];r&&delete r[e]}class f{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return T("debug",this._namespace,e)}error(...e){return T("error",this._namespace,e)}info(...e){return T("info",this._namespace,e)}warn(...e){return T("warn",this._namespace,e)}verbose(...e){return T("verbose",this._namespace,e)}}function T(e,t,r){let i=g("diag");if(i)return i[e](t,...r)}(tO=tF||(tF={}))[tO.NONE=0]="NONE",tO[tO.ERROR=30]="ERROR",tO[tO.WARN=50]="WARN",tO[tO.INFO=60]="INFO",tO[tO.DEBUG=70]="DEBUG",tO[tO.VERBOSE=80]="VERBOSE",tO[tO.ALL=9999]="ALL";class E{static instance(){return this._instance||(this._instance=new E),this._instance}constructor(){function e(e){return function(...t){let r=g("diag");if(r)return r[e](...t)}}const t=this;t.setLogger=(e,r={logLevel:tF.INFO})=>{var i,n,s;if(e===t){let e=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!=(i=e.stack)?i:e.message),!1}"number"==typeof r&&(r={logLevel:r});let o=g("diag"),a=function(e,t){function r(r,i){let n=t[r];return"function"==typeof n&&e>=i?n.bind(t):function(){}}return e<tF.NONE?e=tF.NONE:e>tF.ALL&&(e=tF.ALL),t=t||{},{error:r("error",tF.ERROR),warn:r("warn",tF.WARN),info:r("info",tF.INFO),debug:r("debug",tF.DEBUG),verbose
1:r("verbose",tF.VERBOSE)}}(null!=(n=r.logLevel)?n:tF.INFO,e);if(o&&!r.suppressOverrideMessage){let e=null!=(s=Error().stack)?s:"<failed to generate stacktrace>";o.warn(`Current logger will be overwritten from ${e}`),a.warn(`Current logger will overwrite one already registered from ${e}`)}return _("diag",a,t,!0)},t.disable=()=>{m("diag",t)},t.createComponentLogger=e=>new f(e),t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}}let b="context",y=new class{active(){return a}with(e,t,r,...i){return t.call(r,...i)}bind(e,t){return t}enable(){return this}disable(){return this}};class v{static getInstance(){return this._instance||(this._instance=new v),this._instance}setGlobalContextManager(e){return _(b,e,E.instance())}active(){return this._getContextManager().active()}with(e,t,r,...i){return this._getContextManager().with(e,t,r,...i)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return g(b)||y}disable(){this._getContextManager().disable(),m(b,E.instance())}}let S=v.getInstance(),w=E.instance();(tR=tz||(tz={}))[tR.NONE=0]="NONE",tR[tR.SAMPLED=1]="SAMPLED";class A{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class L{_isCalled=!1;_deferred=new A;_callback;_that;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}function C(e){}function O(e){}function R(e){try{var t;w.error((t=e,"string"==typeof t?t:JSON.stringify(function(e){let t={},r=e;for(;null!==r;)Object.getOwnPropertyNames(r).forEach(e=>{if(t[e])return;let i=r[e];i&&(t[e]=String(i))}),r=Object.getPrototypeOf(r);return t}(t))))}catch{}}(tk=tV||(tV={}))[tk.SUCCESS=0]="SUCCESS",tk[tk.FAILED=1]="FAILED";let k=o("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function x(e){return e.setValue(k,!0)}function N(e){return!0===e.getValue(k)}class P{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,t){this._exporter=e,this._maxExportBatchSize="number"==typeof t?.maxExportBatchSize?t.maxExportBatchSize:O("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize="number"==typeof t?.maxQueueSize?t.maxQueueSize:O("OTEL_BSP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis="number"==typeof t?.scheduledDelayMillis?t.scheduledDelayMillis:O("OTEL_BSP_SCHEDULE_DELAY")??5e3,this._exportTimeoutMillis="number"==typeof t?.exportTimeoutMillis?t.exportTimeoutMillis:O("OTEL_BSP_EXPORT_TIMEOUT")??3e4,this._shutdownOnce=new L(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(w.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&tz.SAMPLED)!=0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){0===this._droppedSpansCount&&w.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(w.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let r=[],i=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0;e<i;e++)r.push(this._flushOneBatch());Promise.all(r).then(()=>{e()}).catch(t)})}_flushOneBatch(){return(this._clearTimer(),0===this._finishedSpans.length)?Promise.resolve():new Promise((e,t)=>
1{let r=setTimeout(()=>{t(Error("Timeout"))},this._exportTimeoutMillis);S.with(x(S.active()),()=>{let i;this._finishedSpans.length<=this._maxExportBatchSize?(i=this._finishedSpans,this._finishedSpans=[]):i=this._finishedSpans.splice(0,this._maxExportBatchSize);let n=()=>this._exporter.export(i,i=>{clearTimeout(r),i.code===tV.SUCCESS?e():t(i.error??Error("BatchSpanProcessor: span export failed"))}),s=null;for(let e=0,t=i.length;e<t;e++){let t=i[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(s??=[]).push(t.resource.waitForAsyncAttributes())}null===s?n():Promise.all(s).then(n,e=>{R(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,R(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),"number"!=typeof this._timer&&this._timer.unref())}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}class D extends P{_visibilityChangeListener;_pageHideListener;constructor(e,t){super(e,t),this.onInit(t)}onInit(e){e?.disableAutoFlushOnDocumentHide!==!0&&"u">typeof document&&(this._visibilityChangeListener=()=>{"hidden"===document.visibilityState&&this.forceFlush().catch(e=>{R(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{R(e)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}onShutdown(){"u">typeof document&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}}let M="error.type",I="exception.message",U="exception.stacktrace",B="exception.type",F="http.request.method",z="http.request.method_original",V="http.response.status_code",j="server.address",$="server.port",H="telemetry.sdk.language",G="telemetry.sdk.name",Z="telemetry.sdk.version",W="url.full",q={[G]:"opentelemetry","process.runtime.name":"browser",[H]:"webjs",[Z]:"2.7.1"},X=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class Y{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(e,t){let r=new Y({},t);return r._rawAttributes=J(e),r._asyncAttributesPending=e.filter(([e,t])=>X(t)).length>0,r}constructor(e,t){const r=e.attributes??{};this._rawAttributes=Object.entries(r).map(([e,t])=>(X(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=J(this._rawAttributes),this._schemaUrl=function(e){if("string"==typeof e||void 0===e)return e;w.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,r]=this._rawAttributes[e];this._rawAttributes[e]=[t,X(r)?await r:r]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&w.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,r]of this._rawAttributes){if(X(r)){w.debug(`Unsettled resource attribute ${t} skipped`);continue}null!=r&&(e[t]??=r)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(e){var t,r;let i,n,s;if(null==e)return this;let o=(t=this,r=e,i=t?.schemaUrl,s=void 0===(n=r?.schemaUrl)||""===n,void 0===i||""===i?n:s||i===n?i:void w.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',i,n));return Y.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],o?{schemaUrl:o}:void 0)}}function Q(e,t){return Y.FromAttributeList(Object.entries(e),t)}function K(){return Q({"service.name":function(){if(void 0===t)try{let e=globalThis.process.argv0;t=e?`unknown_service:${e}`:"unknown_service"}catch{t="unknown_service"}return t}(),[H]:q[H],[G]:q[G],[Z]:q[Z]})}function J(e){return e.map(([e,t])=>X(t)?[e,t.catch(t=>{w.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,t])}class ee{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}function et(e){return e<0?10:e<128?1:e<16384?2:e<2097152?3:e<0x10000000?4:e<0x800000000?5:e<0x40000000000?6:e<0x2000000000000?7:e<0x100000000000000?8:9}class er{_buffer;_textEncoder;_dataView;pos=0;constructor(e=65536){this._buffer=new Uint8Array(e),this._textEncoder=new TextEncoder,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}_ensureCapacity(e){let t=this.pos+e;if(t<=this._buffer.length)return;w.debug("ProtobufWriter: estimated size was too small, growing buffer.");let r=2*this._buffer.length;for(;r<t;)r*=2;let i=new Uint8Array(r);i.set(this._buffer),this._buffer=i,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}finish(){return this._buffer.subarray(0,this.pos)}startLengthDelimited(){let e=this.pos;return this._ensureCapacity(1),this.pos+=1,e}finishLengthDelimited(e,t){let r=t>>>0,i=et(r);if(i>1){let t=i-1;this._ensureCapacity(t),this._buffer.copyWithin(e+i,e+1,this.pos),this.pos+=t}let n=e;
1r<128?this._buffer[n]=r:r<16384?(this._buffer[n++]=127&r|128,this._buffer[n]=r>>>7):r<2097152?(this._buffer[n++]=127&r|128,this._buffer[n++]=r>>>7&127|128,this._buffer[n]=r>>>14):r<0x10000000?(this._buffer[n++]=127&r|128,this._buffer[n++]=r>>>7&127|128,this._buffer[n++]=r>>>14&127|128,this._buffer[n]=r>>>21):(this._buffer[n++]=127&r|128,this._buffer[n++]=r>>>7&127|128,this._buffer[n++]=r>>>14&127|128,this._buffer[n++]=r>>>21&127|128,this._buffer[n]=r>>>28)}writeSint32(e){this.writeVarint((e<<1^e>>31)>>>0)}writeSfixed64(e){let t,r;if(e>=0)t=e>>>0,r=e/0x100000000>>>0;else{let i=Math.abs(e);t=~(t=i>>>0)>>>0,r=~(r=i/0x100000000>>>0)>>>0,0==(t=t+1>>>0)&&(r=r+1>>>0)}this.writeFixed64(t,r)}writeVarint(e){if(this._ensureCapacity(et(e)),e>=0&&e<=0xffffffff){let t=e>>>0;for(;t>127;)this._buffer[this.pos++]=127&t|128,t>>>=7;this._buffer[this.pos++]=t}else{let t,r;if(e>=0)t=e>>>0,r=e/0x100000000>>>0;else{let i=Math.abs(e);t=~(t=i>>>0)>>>0,r=~(r=i/0x100000000>>>0)>>>0,0==(t=t+1>>>0)&&(r=r+1>>>0)}for(;r>0||t>127;)this._buffer[this.pos++]=127&t|128,t=(t>>>7|r<<25)>>>0,r>>>=7;this._buffer[this.pos++]=127&t}}writeFixed32(e){this._ensureCapacity(4);let t=e>>>0;this._buffer[this.pos++]=255&t,this._buffer[this.pos++]=t>>>8&255,this._buffer[this.pos++]=t>>>16&255,this._buffer[this.pos++]=t>>>24&255}writeFixed64(e,t){this._ensureCapacity(8);let r=e>>>0,i=t>>>0;this._buffer[this.pos++]=255&r,this._buffer[this.pos++]=r>>>8&255,this._buffer[this.pos++]=r>>>16&255,this._buffer[this.pos++]=r>>>24&255,this._buffer[this.pos++]=255&i,this._buffer[this.pos++]=i>>>8&255,this._buffer[this.pos++]=i>>>16&255,this._buffer[this.pos++]=i>>>24&255}writeBytes(e){this.writeVarint(e.length),this._ensureCapacity(e.length),this._buffer.set(e,this.pos),this.pos+=e.length}writeTag(e,t){this.writeVarint(e<<3|t)}writeDouble(e){this._ensureCapacity(8),this._dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeString(e){let t=!0,r=e.length;for(let i=0;i<r;i++)if(e.charCodeAt(i)>127){t=!1;break}if(t){this.writeVarint(r),this._ensureCapacity(r);for(let t=0;t<r;t++)this._buffer[this.pos++]=e.charCodeAt(t)}else{let t=this._textEncoder.encode(e);this.writeBytes(t)}}}function ei(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function en(e){let t=new Uint8Array(e.length/2),r=0;for(let i=0;i<e.length;i+=2){let n=ei(e.charCodeAt(i)),s=ei(e.charCodeAt(i+1));t[r++]=n<<4|s}return t}function es(e,t){let r=t[0],i=t[1],n=(65535&r)*1e9,s=(r/65536>>>0)*1e9,o=Math.floor(n/0x100000000),a=(n>>>0)+((65535&s)*65536>>>0)+i,l=Math.floor(a/0x100000000);e.writeFixed64(a>>>0,o+(s/65536>>>0)+l>>>0)}function eo(e,t,r){for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let n=t[i];e.writeTag(r,2);let s=e.startLengthDelimited(),o=e.pos;(function(e,t,r){e.writeTag(1,2),e.writeString(t),e.writeTag(2,2);let i=e.startLengthDelimited(),n=e.pos;ea(e,r),e.finishLengthDelimited(i,e.pos-n)})(e,i,n),e.finishLengthDelimited(s,e.pos-o)}}function ea(e,t){let r=typeof t;if("string"===r)e.writeTag(1,2),e.writeString(t);else if("boolean"===r)e.writeTag(2,0),e.writeVarint(+!!t);else if("number"===r)Number.isInteger(t)&&t>=-0x8000000000000000&&t<0x8000000000000000?(e.writeTag(3,0),e.writeVarint(t)):(e.writeTag(4,1),e.writeDouble(t));else if(t instanceof Uint8Array)e.writeTag(7,2),e.writeBytes(t);else if(Array.isArray(t)){e.writeTag(5,2);let r=e.startLengthDelimited(),i=e.pos;for(let r of t){e.writeTag(1,2);let t=e.startLengthDelimited(),i=e.pos;ea(e,r),e.finishLengthDelimited(t,e.pos-i)}e.finishLengthDelimited(r,e.pos-i)}else if("object"===r&&null!=t){e.writeTag(6,2);let r=e.startLengthDelimited(),i=e.pos;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let i=t[r];e.writeTag(1,2);let n=e.startLengthDelimited(),s=e.pos;e.writeTag(1,2),e.writeString(r),e.writeTag(2,2);let o=e.startLengthDelimited(),a=e.pos;ea(e,i),e.finishLengthDelimited(o,e.pos-a),e.finishLengthDelimited(n,e.pos-s)}e.finishLengthDelimited(r,e.pos-i)}}function el(e,t,r){e.writeTag(r,2);let i=e.startLengthDelimited(),n=e.pos;e.writeTag(1,2),e.writeString(t.name),t.version&&(e.writeTag(2,2),e.writeString(t.version)),e.finishLengthDelimited(i,e.pos-n)}function ec(e,t,r){e.writeTag(r,2);let i=e.startLengthDelimited(),n=e.pos;t.attributes&&eo(e,t.attributes,1),e.writeTag(2,0),e.writeVarint(0),e.finishLengthDelimited(i,e.pos-n)}class eu{pos=0;startLengthDelimited(){return this.pos}finishLengthDelimited(e,t){this.pos+=et(t)}writeVarint(e){this.pos+=et(e)}writeSint32(e){this.pos+=et((e<<1^e>>31)>>>0)}writeSfixed64(e){this.pos+=8}writeFixed32(e){this.pos+=4}
1writeFixed64(e,t){this.pos+=8}writeBytes(e){this.pos+=et(e.length),this.pos+=e.length}writeTag(e,t){this.writeVarint(e<<3|t)}writeDouble(e){this.pos+=8}writeString(e){let t=function(e){let t=e.length,r=0;for(let i=0;i<t;i++){let t=e.charCodeAt(i);t<128?r+=1:t<2048?r+=2:t<55296||t>=57344?r+=3:(i++,r+=4)}return r}(e);this.pos+=et(t),this.pos+=t}}function eh(e,t){let r=255&e|256;return t&&(r|=512),r}function ed(e,t,r){let i=e.startLengthDelimited(),n=e.pos;for(let i of(ec(e,t,1),r.values()))e.writeTag(2,2),function(e,t,r){let i=e.startLengthDelimited(),n=e.pos;for(let i of(el(e,t,1),r))e.writeTag(2,2),function(e,t){var r;let i,n,s=e.startLengthDelimited(),o=e.pos,a=t.spanContext();e.writeTag(1,2),e.writeBytes(en(a.traceId)),e.writeTag(2,2),e.writeBytes(en(a.spanId));let l=a.traceState?.serialize();l&&(e.writeTag(3,2),e.writeString(l)),t.parentSpanContext?.spanId&&(e.writeTag(4,2),e.writeBytes(en(t.parentSpanContext.spanId))),e.writeTag(5,2),e.writeString(t.name);let c=null==t.kind?0:t.kind+1;for(let r of(0!==c&&(e.writeTag(6,0),e.writeVarint(c)),e.writeTag(7,1),es(e,t.startTime),e.writeTag(8,1),es(e,t.endTime),t.attributes&&eo(e,t.attributes,9),e.writeTag(10,0),e.writeVarint(t.droppedAttributesCount),t.events))e.writeTag(11,2),function(e,t){let r=e.startLengthDelimited(),i=e.pos;e.writeTag(1,1),es(e,t.time),e.writeTag(2,2),e.writeString(t.name),t.attributes&&eo(e,t.attributes,3),e.writeTag(4,0),e.writeVarint(t.droppedAttributesCount||0),e.finishLengthDelimited(r,e.pos-i)}(e,r);for(let r of(e.writeTag(12,0),e.writeVarint(t.droppedEventsCount),t.links))e.writeTag(13,2),function(e,t){let r=e.startLengthDelimited(),i=e.pos,n=t.context;e.writeTag(1,2),e.writeBytes(en(n.traceId)),e.writeTag(2,2),e.writeBytes(en(n.spanId));let s=n.traceState?.serialize();s&&(e.writeTag(3,2),e.writeString(s)),t.attributes&&eo(e,t.attributes,4),e.writeTag(5,0),e.writeVarint(t.droppedAttributesCount||0);let o=eh(n.traceFlags,n.isRemote);o&&(e.writeTag(6,5),e.writeFixed32(o)),e.finishLengthDelimited(r,e.pos-i)}(e,r);e.writeTag(14,0),e.writeVarint(t.droppedLinksCount),e.writeTag(15,2),r=t.status,i=e.startLengthDelimited(),n=e.pos,r.message&&(e.writeTag(2,2),e.writeString(r.message)),e.writeTag(3,0),e.writeVarint(r.code),e.finishLengthDelimited(i,e.pos-n);let u=eh(a.traceFlags,t.parentSpanContext?.isRemote);u&&(e.writeTag(16,5),e.writeFixed32(u)),e.finishLengthDelimited(s,e.pos-o)}(e,i);t.schemaUrl&&(e.writeTag(3,2),e.writeString(t.schemaUrl)),e.finishLengthDelimited(i,e.pos-n)}(e,i[0].instrumentationScope,i);t.schemaUrl&&(e.writeTag(3,2),e.writeString(t.schemaUrl)),e.finishLengthDelimited(i,e.pos-n)}class ep{pos=0;_buf;_textDecoder;constructor(e){this._buf=e,this._textDecoder=new TextDecoder}isAtEnd(){return this.pos>=this._buf.length}readTag(){let e=this.readVarint();return{fieldNumber:e>>>3,wireType:7&e}}readVarint(){let e=0,t=0,r=!1;for(;this.pos<this._buf.length;){let i=this._buf[this.pos++];if(e+=(127&i)*Math.pow(2,t),t+=7,(128&i)==0){r=!0;break}}if(!r)throw Error("Truncated buffer: unexpected end of data while reading varint");return e}readBytes(){let e=this.readVarint();if(this.pos+e>this._buf.length)throw Error(`Truncated buffer: expected ${e} bytes at position ${this.pos}, but only ${this._buf.length-this.pos} available`);let t=this._buf.subarray(this.pos,this.pos+e);return this.pos+=e,t}readString(){return this._textDecoder.decode(this.readBytes())}skip(e){switch(e){case 0:this.readVarint();break;case 1:this.pos+=8;break;case 2:this.readBytes();break;case 3:for(;!this.isAtEnd();){let{wireType:e}=this.readTag();if(4===e)break;this.skip(e)}break;case 4:break;case 5:this.pos+=4;break;default:throw Error(`Unknown wire type ${e}, cannot safely skip`)}}}let e_={serializeRequest:e=>(function(e){let t=function(e){let t=new Map;for(let r of e){let e=r.resource,i=r.instrumentationScope,n=t.get(e);n||(n=new Map,t.set(e,n));let s=n.get(i);s||(s=[],n.set(i,s)),s.push(r)}return t}(e),r=new eu;for(let[e,i]of t)r.writeTag(1,2),ed(r,e,i);let i=new er(r.pos);for(let[e,r]of t)i.writeTag(1,2),ed(i,e,r);return i.finish()})(e),deserializeResponse:e=>(function(e){let t=new ep(e),r={};for(;!t.isAtEnd();){let{fieldNumber:e,wireType:i}=t.readTag();1===e&&2===i?r.partialSuccess=function(e){let t=new ep(e),r={};for(;!t.isAtEnd();){let{fieldNumber:e,wireType:i}=t.readTag();switch(e){case 1:0===i?r.rejectedSpans=t.readVarint():t.skip(i);break;case 2:2===i?r.errorMessage=t.readString():t.skip(i);break;default:t.skip(i)}}return r}(t.readBytes()):t.skip(i)}return r})(e)};class eg{_transport;constructor(e){this._transport=e}retry(e,t,r){return new Promise((i,n)=>{setTimeout(()=>{this._transport.send(e,t).then(i,n)},r)})}async send(e,t){let r=5,i=1e3,n=Date.now()+t,s=await this._transport.send(e,t);for(;"retryable"===s.status&&r>0;){r--;let t=Math.max(Math.min(i*(1+(.4*Math.random()-.2)),5e3),0);i*=1.5;let o=s.retryInMillis??t,a=n-Date.now();if(o>a)return w.info(`Export retry time ${Math.round(o)}ms exceeds remaining timeout ${Math.round(a)}ms, not retrying further.`),s;w.verbose(`Scheduling export retry in ${Math.round(o)}ms`),s=await this.retry(e,a,o)}return"success"===s.status?w.verbose(`Export succeeded after ${5-r} retry attempts.`):"retryable"===s.status?w.info("Export failed after maximum retry attempts (5)."):w.info(`Export failed with non-retryable error: ${s.error}`),s}shutdown(){return this._transport.shutdown()}}class em{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error("Concurrency Limit reached");this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}
1class ef extends Error{code;name="OTLPExporterError";data;constructor(e,t,r){super(e),this.data=r,this.code=t}}class eT{_diagLogger;_transport;_serializer;_responseHandler;_promiseQueue;_timeout;constructor(e,t,r,i,n){this._transport=e,this._serializer=t,this._responseHandler=r,this._promiseQueue=i,this._timeout=n,this._diagLogger=w.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit())return void t({code:tV.FAILED,error:Error("Concurrent export limit reached")});let r=this._serializer.serializeRequest(e);null==r?t({code:tV.FAILED,error:Error("Nothing to send")}):this._promiseQueue.pushPromise(this._transport.send(r,this._timeout).then(e=>{if("success"===e.status){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:tV.SUCCESS});return}"failure"===e.status&&e.error?t({code:tV.FAILED,error:e.error}):"retryable"===e.status?t({code:tV.FAILED,error:e.error??new ef("Export failed with retryable status")}):t({code:tV.FAILED,error:new ef("Export failed with unknown error")})},e=>t({code:tV.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}let eE=0,eb=0;class ey{_parameters;constructor(e){this._parameters=e}async send(e,t){var r,i;let n=new AbortController,s=setTimeout(()=>n.abort(),t),o=globalThis.fetch;"function"==typeof o.__original&&(o=o.__original);let a=e.byteLength,l=eE+a>61440,c=eb>=9,u=!l&&!c;u?(eE+=a,eb++):w.debug(`keepalive disabled: ${(a/1024).toFixed(1)}KB payload, ${eb} pending (${l?"size limit":"count limit"})`);try{let t=new URL(this._parameters.url),i=await o(t.href,{method:"POST",headers:await this._parameters.headers(),body:e,signal:n.signal,keepalive:u,mode:globalThis.location?globalThis.location.origin===t.origin?"same-origin":"cors":"no-cors"});if(i.status>=200&&i.status<=299)return w.debug(`export response success (status: ${i.status})`),{status:"success"};if(r=i.status,429===r||502===r||503===r||504===r){w.warn(`export response retryable (status: ${i.status})`);let e=i.headers.get("Retry-After"),t=function(e){if(null==e)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?1e3*t:-1;let r=new Date(e).getTime()-Date.now();return r>=0?r:0}(e);return{status:"retryable",retryInMillis:t}}return w.error(`export response failure (status: ${i.status})`),{status:"failure",error:Error(`Fetch request failed with non-retryable status ${i.status}`)}}catch(e){if((i=e)instanceof TypeError&&!i.cause)return w.warn(`export request retryable (network error: ${e})`),{status:"retryable",error:Error("Fetch request encountered a network error",{cause:e})};return w.error(`export request failure (error: ${e})`),{status:"failure",error:Error("Fetch request errored",{cause:e})}}finally{clearTimeout(s),u&&(eE-=a,eb--)}}shutdown(){}}function ev(e,t,r,i){var n,s,o,a,l,c,u,h,d,p;return u=(n={url:e.url,timeoutMillis:e.timeoutMillis,headers:function(e){if("function"==typeof e.headers)return e.headers;var t=e.headers;return null!=t?async()=>t:void 0}(e),concurrencyLimit:e.concurrencyLimit},{...(s={},o={timeoutMillis:1e4,concurrencyLimit:30,compression:"none",headers:async()=>i,url:"http://localhost:4318/"+r},{timeoutMillis:function(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}(n.timeoutMillis??s.timeoutMillis??o.timeoutMillis),concurrencyLimit:n.concurrencyLimit??s.concurrencyLimit??o.concurrencyLimit,compression:n.compression??s.compression??o.compression}),headers:(a=n.headers,l=s.headers,c=o.headers,async()=>{var e;let t,r={...await c()},i={};return null!=l&&Object.assign(i,await l()),null!=a&&Object.assign(i,(e=await a(),t={},Object.entries(e??{}).forEach(([e,r])=>{void 0!==r?t[e]=String(r):w.warn(`Header "${e}
1" has invalid value (${r}) and will be ignored`)}),t)),Object.assign(i,r)}),url:function(e){if(null!=e)try{let t=globalThis.location?.href;return new URL(e,t).href}catch{throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}(n.url)??s.url??o.url}),h=t,d={transport:new eg({transport:new ey(u)}.transport),serializer:h,promiseHandler:new em(u.concurrencyLimit)},p={timeout:u.timeoutMillis},new eT(d.transport,d.serializer,{handleResponse(e){null!=e&&Object.prototype.hasOwnProperty.call(e,"partialSuccess")&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&w.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}},d.promiseHandler,p.timeout)}class eS extends ee{constructor(e={}){super(ev(e,e_,"v1/traces",{"Content-Type":"application/x-protobuf"}))}}(tx=tj||(tj={}))[tx.DELTA=0]="DELTA",tx[tx.CUMULATIVE=1]="CUMULATIVE",(tN=t$||(t$={})).COUNTER="COUNTER",tN.GAUGE="GAUGE",tN.HISTOGRAM="HISTOGRAM",tN.UP_DOWN_COUNTER="UP_DOWN_COUNTER",tN.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",tN.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",tN.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER",(tP=tH||(tH={}))[tP.HISTOGRAM=0]="HISTOGRAM",tP[tP.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",tP[tP.GAUGE=2]="GAUGE",tP[tP.SUM=3]="SUM",(tD=tG||(tG={}))[tD.DROP=0]="DROP",tD[tD.SUM=1]="SUM",tD[tD.LAST_VALUE=2]="LAST_VALUE",tD[tD.HISTOGRAM=3]="HISTOGRAM",tD[tD.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM";class ew{startTime;monotonic;_current;reset;constructor(e,t,r=0,i=!1){this.startTime=e,this.monotonic=t,this._current=r,this.reset=i}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}}class eA{kind=tG.SUM;monotonic;constructor(e){this.monotonic=e}createAccumulation(e){return new ew(e,this.monotonic)}merge(e,t){let r=e.toPointValue(),i=t.toPointValue();return t.reset?new ew(t.startTime,this.monotonic,i,t.reset):new ew(e.startTime,this.monotonic,r+i)}diff(e,t){let r=e.toPointValue(),i=t.toPointValue();return this.monotonic&&r>i?new ew(t.startTime,this.monotonic,i,!0):new ew(t.startTime,this.monotonic,i-r)}toMetricData(e,t,r,i){return{descriptor:e,aggregationTemporality:t,dataPointType:tH.SUM,dataPoints:r.map(([e,t])=>({attributes:e,startTime:t.startTime,endTime:i,value:t.toPointValue()})),isMonotonic:this.monotonic}}}class eL{kind=tG.DROP;createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,r,i){}}let eC=performance;function eO(e){return[Math.trunc(e/1e3),Math.round(e%1e3*1e6)]}function eR(e){return eD(eO(eC.timeOrigin),eO("number"==typeof e?e:eC.now()))}function ek(e){if(eN(e))return e;if("number"==typeof e)if(e<eC.timeOrigin)return eR(e);else return eO(e);if(e instanceof Date)return eO(e.getTime());throw TypeError("Invalid input type")}function ex(e){return 1e6*e[0]+e[1]/1e3}function eN(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function eP(e){return eN(e)||"number"==typeof e||e instanceof Date}function eD(e,t){let r=[e[0]+t[0],e[1]+t[1]];return r[1]>=1e9&&(r[1]-=1e9,r[0]+=1),r}class eM{startTime;_current;sampleTime;constructor(e,t=0,r=[0,0]){this.startTime=e,this._current=t,this.sampleTime=r}record(e){this._current=e,this.sampleTime=eO(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}}class eI{kind=tG.LAST_VALUE;createAccumulation(e){return new eM(e)}merge(e,t){let r=ex(t.sampleTime)>=ex(e.sampleTime)?t:e;return new eM(e.startTime,r.toPointValue(),r.sampleTime)}diff(e,t){let r=ex(t.sampleTime)>=ex(e.sampleTime)?t:e;return new eM(t.startTime,r.toPointValue(),r.sampleTime)}toMetricData(e,t,r,i){return{descriptor:e,aggregationTemporality:t,dataPointType:tH.GAUGE,dataPoints:r.map(([e,t])=>({attributes:e,startTime:t.startTime,endTime:i,value:t.toPointValue()}))}}}function eU(e){let t=Object.keys(e);return 0===t.length?"":JSON.stringify((t=t.sort()).map(t=>[t,e[t]]))}class eB extends Error{constructor(e){super(e),Object.setPrototypeOf(this,eB.prototype)}}function eF(e,t){let r;return Promise.race([e,new Promise(function(e,i){r=setTimeout(function(){i(new eB("Operation timed out."))},t)})]).then(e=>(clearTimeout(r),e),e=>{throw clearTimeout(r),e})}class ez{startTime;_boundaries;_recordMinMax;_current;constructor(e,t,r=!0,i=function(e){let t=e.map(()=>0);return t.push(0),{buckets:{boundaries:e,counts:t},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}(t)){this.startTime=e,this._boundaries=t,this._recordMinMax=r,this._current=i}record(e){if(Number.isNaN(e))return;this._current.count+=1,this._current.sum+=e,this._recordMinMax&&(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=function(e,t){let r=0,i=e.length-1,n=e.length;for(;i>=r;){let s=r+Math.trunc((i-r)/2);e[s]<t?r=s+1:(n=s,i=s-1)}return n}(this._boundaries,e);this._current.buckets.counts[t]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}}class eV{kind=tG.HISTOGRAM;_boundaries;_recordMinMax;constructor(e,t){this._boundaries=e,this._recordMinMax=t}createAccumulation(e){return new ez(e,this._boundaries,this._recordMinMax)}merge(e,t){let r=e.toPointValue(),i=t.toPointValue(),n=r.buckets.counts,s=i.buckets.counts,o=Array(n.length);for(let e=0;e<n.length;e++)o[e]=n[e]+s[e];let a=1/0,l=-1/0;return this._recordMinMax&&(r.hasMinMax&&i.hasMinMax?(a=Math.min(r.min,i.min),l=Math.max(r.max,i.max)):r.hasMinMax?(a=r.min,l=r.max):i.hasMinMax&&(a=i.min,l=i.max)),new ez(e.startTime,r.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:r.buckets.boundaries,counts:o},count:r.count+i.count,sum:r.sum+i.sum,hasMinMax:this._recordMinMax&&(r.hasMinMax||i.hasMinMax),min:a,max:l})}diff(e,t){let r=e.toPointValue(),i=t.toPointValue(),n=r.buckets.counts,s=i.buckets.counts,o=Array(n.length);for(let e=0;e<n.length;e++)o[e]=s[e]-n[e];return new ez(t.startTime,r.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:r.buckets.boundaries,counts:o},count:i.count-r.count,sum:i.sum-r.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,r,i){return{descriptor:e,aggregationTemporality:t,dataPointType:tH.HISTOGRAM,dataPoints:r.map(([t,r])=>{let n=r.toPointValue(),s=e.type===t$.GAUGE||e.type===t$.UP_DOWN_COUNTER||e.type===t$.OBSERVABLE_GAUGE||e.type===t$.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:t,startTime:r.startTime,endTime:i,value:{min:n.hasMinMax?n.min:void 0,max:n.hasMinMax?n.max:void 0,sum:s?void 0:n.sum,buckets:n.buckets,count:n.count}}})}}}class ej{backing;indexBase;indexStart;indexEnd;constructor(e=new e$,t=0,r=0,i=0){this.backing=e,this.indexBase=t,this.indexStart=r,this.indexEnd=i}get offset(){return this.indexStart}get length(){return 0===this.backing.length||this.indexEnd===this.indexStart&&0===this.at(0)?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=>this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e<t&&(e+=this.backing.length),e-=t,this.backing.countAt(e)}incrementBucket(e,t){this.backing.increment(e,t)}
1decrementBucket(e,t){this.backing.decrement(e,t)}trim(){for(let e=0;e<this.length;e++)if(0!==this.at(e)){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e>=0;e--)if(0!==this.at(e)){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,r=1<<e,i=0,n=0;for(let e=this.indexStart;e<=this.indexEnd;){let s=e%r;s<0&&(s+=r);for(let o=s;o<r&&i<t;o++)this._relocateBucket(n,i),i++,e++;n++}this.indexStart>>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new ej(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;0!==e&&(e>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&&this.incrementBucket(e,this.backing.emptyBucket(t))}}class e${_counts;constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,r){let i=Array(e).fill(0);i.splice(r,this._counts.length-t,...this._counts.slice(t)),i.splice(0,t,...this._counts.slice(0,t)),this._counts=i}reverse(e,t){let r=Math.floor((e+t)/2)-e;for(let i=0;i<r;i++){let r=this._counts[e+i];this._counts[e+i]=this._counts[t-i-1],this._counts[t-i-1]=r}}emptyBucket(e){let t=this._counts[e];return this._counts[e]=0,t}increment(e,t){this._counts[e]+=t}decrement(e,t){this._counts[e]>=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new e$([...this._counts])}}function eH(e){let t=new DataView(new ArrayBuffer(8));return t.setFloat64(0,e),((0x7ff00000&t.getUint32(0))>>20)-1023}function eG(e){let t=new DataView(new ArrayBuffer(8));return t.setFloat64(0,e),(1048575&t.getUint32(0))*0x100000000+t.getUint32(4)}function eZ(e,t){return 0===e||e===1/0||e===-1/0||Number.isNaN(e)?e:e*Math.pow(2,t)}class eW extends Error{}class eq{_shift;constructor(e){this._shift=-e}mapToIndex(e){return e<22250738585072014e-324?this._minNormalLowerBoundaryIndex():eH(e)+this._rightShift(eG(e)-1,52)>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e<t)throw new eW(`underflow: ${e} is < minimum lower boundary: ${t}`);let r=this._maxNormalLowerBoundaryIndex();if(e>r)throw new eW(`overflow: ${e} is > maximum lower boundary: ${r}`);return eZ(1,e<<this._shift)}get scale(){return 0===this._shift?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=-1022>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return 1023>>this._shift}_rightShift(e,t){return Math.floor(e*Math.pow(2,-t))}}class eX{_scale;_scaleFactor;_inverseFactor;constructor(e){this._scale=e,this._scaleFactor=eZ(Math.LOG2E,e),this._inverseFactor=eZ(Math.LN2,-e)}mapToIndex(e){if(e<=22250738585072014e-324)return this._minNormalLowerBoundaryIndex()-1;if(0===eG(e))return(eH(e)<<this._scale)-1;let t=Math.floor(Math.log(e)*this._scaleFactor),r=this._maxNormalLowerBoundaryIndex();return t>=r?r:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e>=t){if(e===t)return 2*Math.exp((e-(1<<this._scale))/this._scaleFactor);throw new eW(`overflow: ${e} is > maximum lower boundary: ${t}`)}let r=this._minNormalLowerBoundaryIndex();if(e<=r){if(e===r)return 22250738585072014e-324;if(e===r-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new eW(`overflow: ${e} is < minimum lower boundary: ${r}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return -1022<<this._scale}_maxNormalLowerBoundaryIndex(){return(1024<<this._scale)-1}}let eY=Array.from({length:31},(e,t)=>t>10?new eX(t-10):new eq(t-10));function eQ(e){if(e>20||e<-10)throw new eW(`expected scale >= -10 && <= 20, got: ${e}`);return eY[e+10]}class eK{static combine(e,t){return new eK(Math.min(e.low,t.low),Math.max(e.high,t.high))}low;high;constructor(e,t){this.low=e,this.high=t}}class eJ{startTime;_maxSize;_recordMinMax;_sum;_count;_zeroCount;_min;_max;_positive;_negative;_mapping;constructor(e,t=160,r=!0,i=0,n=0,s=0,o=1/0,a=-1/0,l=new ej,c=new ej,u=eQ(20)){this.startTime=e,this._maxSize=t,this._recordMinMax=r,this._sum=i,this._count=n,this._zeroCount=s,this._min=o,this._max=a,this._positive=l,this._negative=c,this._mapping=u,this._maxSize<2&&(w.warn(`Exponential Histogram Max Size set to ${this._maxSize}, \
2                changing to the minimum size of: 2`),this._maxSize=2)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}
2get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(!Number.isNaN(e)){if(e>this._max&&(this._max=e),e<this._min&&(this._min=e),this._count+=t,0===e){this._zeroCount+=t;return}this._sum+=e*t,e>0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}}merge(e){0===this._count?(this._min=e.min,this._max=e.max):0!==e.count&&(e.min<this.min&&(this._min=e.min),e.max>this.max&&(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new eJ(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,r){let i=this._mapping.mapToIndex(t),n=!1,s=0,o=0;if(0===e.length?(e.indexStart=i,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):i<e.indexStart&&e.indexEnd-i>=this._maxSize?(n=!0,o=i,s=e.indexEnd):i>e.indexEnd&&i-e.indexStart>=this._maxSize&&(n=!0,o=e.indexStart,s=i),n){let e=this._changeScale(s,o);this._downscale(e),i=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,i,r)}_incrementIndexBy(e,t,r){if(0===r)return;if(0===e.length&&(e.indexStart=e.indexEnd=e.indexBase=t),t<e.indexStart){let r=e.indexEnd-t;r>=e.backing.length&&this._grow(e,r+1),e.indexStart=t}else if(t>e.indexEnd){let r=t-e.indexStart;r>=e.backing.length&&this._grow(e,r+1),e.indexEnd=t}let i=t-e.indexBase;i<0&&(i+=e.backing.length),e.incrementBucket(i,r)}_grow(e,t){var r;let i=e.backing.length,n=e.indexBase-e.indexStart,s=(r=t,r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,++r);s>this._maxSize&&(s=this._maxSize);let o=s-n;e.backing.growTo(s,i-n,o)}_changeScale(e,t){let r=0;for(;e-t>=this._maxSize;)e>>=1,t>>=1,r++;return r}_downscale(e){if(0===e)return;if(e<0)throw Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=eQ(t)}_minScale(e){let t=Math.min(this.scale,e.scale),r=eK.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),i=eK.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(r.high,r.low),t-this._changeScale(i.high,i.low))}_highLowAtScale(e,t,r){if(0===e.length)return new eK(0,-1);let i=t-r;return new eK(e.indexStart>>i,e.indexEnd>>i)}_mergeBuckets(e,t,r,i){let n=r.offset,s=t.scale-i;for(let t=0;t<r.length;t++)this._incrementIndexBy(e,n+t>>s,r.at(t))}_diffBuckets(e,t,r,i){let n=r.offset,s=t.scale-i;for(let t=0;t<r.length;t++){let i=(n+t>>s)-e.indexBase;i<0&&(i+=e.backing.length),e.decrementBucket(i,r.at(t))}e.trim()}}class e0{kind=tG.EXPONENTIAL_HISTOGRAM;_maxSize;_recordMinMax;constructor(e,t){this._maxSize=e,this._recordMinMax=t}createAccumulation(e){return new eJ(e,this._maxSize,this._recordMinMax)}merge(e,t){let r=t.clone();return r.merge(e),r}diff(e,t){let r=t.clone();return r.diff(e),r}toMetricData(e,t,r,i){return{descriptor:e,aggregationTemporality:t,dataPointType:tH.EXPONENTIAL_HISTOGRAM,dataPoints:r.map(([t,r])=>{let n=r.toPointValue(),s=e.type===t$.GAUGE||e.type===t$.UP_DOWN_COUNTER||e.type===t$.OBSERVABLE_GAUGE||e.type===t$.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:t,startTime:r.startTime,endTime:i,value:{min:n.hasMinMax?n.min:void 0,max:n.hasMinMax?n.max:void 0,sum:s?void 0:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bu
2cketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},count:n.count,scale:n.scale,zeroCount:n.zeroCount}}})}}}class e1{static DEFAULT_INSTANCE=new eL;createAggregator(e){return e1.DEFAULT_INSTANCE}}class e2{static MONOTONIC_INSTANCE=new eA(!0);static NON_MONOTONIC_INSTANCE=new eA(!1);createAggregator(e){switch(e.type){case t$.COUNTER:case t$.OBSERVABLE_COUNTER:case t$.HISTOGRAM:return e2.MONOTONIC_INSTANCE;default:return e2.NON_MONOTONIC_INSTANCE}}}class e5{static DEFAULT_INSTANCE=new eI;createAggregator(e){return e5.DEFAULT_INSTANCE}}class e3{static DEFAULT_INSTANCE=new eV([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);createAggregator(e){return e3.DEFAULT_INSTANCE}}class e4{_boundaries;_recordMinMax;constructor(e,t=!0){if(null==e)throw Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array");const r=(e=(e=e.concat()).sort((e,t)=>e-t)).lastIndexOf(-1/0);let i=e.indexOf(1/0);-1===i&&(i=void 0),this._boundaries=e.slice(r+1,i),this._recordMinMax=t}createAggregator(e){return new eV(this._boundaries,this._recordMinMax)}}class e8{_maxSize;_recordMinMax;constructor(e=160,t=!0){this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new e0(this._maxSize,this._recordMinMax)}}let e6=new e1,e7=new e2,e9=new e5,te=new e3;new e8;let tt=new class{_resolve(e){switch(e.type){case t$.COUNTER:case t$.UP_DOWN_COUNTER:case t$.OBSERVABLE_COUNTER:case t$.OBSERVABLE_UP_DOWN_COUNTER:return e7;case t$.GAUGE:case t$.OBSERVABLE_GAUGE:return e9;case t$.HISTOGRAM:if(e.advice.explicitBucketBoundaries)return new e4(e.advice.explicitBucketBoundaries);return te}return w.warn(`Unable to recognize instrument type: ${e.type}`),e6}createAggregator(e){return this._resolve(e).createAggregator(e)}};function tr(e){switch(e.type){case tZ.DEFAULT:return tt;case tZ.DROP:return e6;case tZ.SUM:return e7;case tZ.LAST_VALUE:return e9;case tZ.EXPONENTIAL_HISTOGRAM:return new e8(e.options?.maxSize,e.options?.recordMinMax);case tZ.EXPLICIT_BUCKET_HISTOGRAM:if(null==e.options)return te;return new e4(e.options?.boundaries,e.options?.recordMinMax);default:throw Error("Unsupported Aggregation")}}(tM=tZ||(tZ={}))[tM.DEFAULT=0]="DEFAULT",tM[tM.DROP=1]="DROP",tM[tM.SUM=2]="SUM",tM[tM.LAST_VALUE=3]="LAST_VALUE",tM[tM.EXPLICIT_BUCKET_HISTOGRAM=4]="EXPLICIT_BUCKET_HISTOGRAM",tM[tM.EXPONENTIAL_HISTOGRAM=5]="EXPONENTIAL_HISTOGRAM",(tI=tW||(tW={}))[tI.DELTA=0]="DELTA",tI[tI.CUMULATIVE=1]="CUMULATIVE",tI[tI.LOWMEMORY=2]="LOWMEMORY";let ti=()=>tj.CUMULATIVE,tn=e=>{switch(e){case t$.COUNTER:case t$.OBSERVABLE_COUNTER:case t$.GAUGE:case t$.HISTOGRAM:case t$.OBSERVABLE_GAUGE:return tj.DELTA;case t$.UP_DOWN_COUNTER:case t$.OBSERVABLE_UP_DOWN_COUNTER:return tj.CUMULATIVE}},ts=e=>{switch(e){case t$.COUNTER:case t$.HISTOGRAM:return tj.DELTA;case t$.GAUGE:case t$.UP_DOWN_COUNTER:case t$.OBSERVABLE_UP_DOWN_COUNTER:case t$.OBSERVABLE_COUNTER:case t$.OBSERVABLE_GAUGE:return tj.CUMULATIVE}},to=Object.freeze({type:tZ.DEFAULT});class ta extends ee{_aggregationTemporalitySelector;_aggregationSelector;constructor(e,t){super(e),this._aggregationSelector=function(e){return e?.aggregationPreference??(()=>to)}(t),this._aggregationTemporalitySelector=function(e){let t;return null!=e?e===tW.DELTA?tn:e===tW.LOWMEMORY?ts:ti:"cumulative"===(t=(C("OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE")??"cumulative").toLowerCase())?ti:"delta"===t?tn:"lowmemory"===t?ts:(w.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${t}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`),ti)}(t?.temporalityPreference)}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}}function tl(e,t){return Object.keys(e).map(r=>{var i,n;return i=r,n=e[r],{key:i,value:function e(t,r){let i=typeof t;if("string"===i)return{stringValue:t};if("number"===i)return Number.isInteger(t)?{intValue:t}:{doubleValue:t};if("boolean"===i)return{boolValue:t};if(t instanceof Uint8Array)return{bytesValue:r.encodeUint8Array(t)};if(Array.isArray(t)){let i=Array(t.length);for(let n=0;n<t.length;n++)i[n]=e(t[n],r);return{arrayValue:{values:i}}}if("object"===i&&null!=t){let i=Object.keys(t),n=Array(i.length);for(let s=0;s<i.length;s++)n[s]={key:i[s],value:e(t[i[s]],r)};return{kvlistValue:{values:n}}}return{}}(n,t)}})}function tc(e,t){return e.dataPoints.map(r=>(function(e,t,r){let i={attributes:tl(e.attributes,r),startTimeUnixNano:r.encodeHrTime(e.startTime),timeUnixNano:r.encodeHrTime(e.endTime)};switch(t){case tq.INT:i.asInt=e.value;break;case tq.DOUBLE:i.asDouble=e.value}return i})(r,e.descriptor.valueType,t))}(tU=tq||(tq={}))[tU.INT=0]="INT",tU[tU.DOUBLE=1]="DOUBLE",(tB=tX||(tX={}))[tB.AGGREGATION_TEMPORALITY_UNSPECIFIED=0]="AGGREGATION_TEMPORALITY_UNSPECIFIED",tB[tB.AGGREGATION_TEMPORALITY_DELTA=1]="AGGREGATION_TEMPORALITY_DELTA",tB[tB.AGGREGATION_TEMPORALITY_CUMULATIVE=2]="AGGREGATION_TEMPORALITY_CUMULATIVE";var tu,th,td,tp,t_,tg,tm,tf,tT,tE,tb,ty,tv,tS,tw,tA,tL,tC,tO,tR,tk,tx,tN,tP,tD,tM,tI,tU,tB,tF,tz,tV,tj,t$,tH,tG,tZ,tW,tq,tX,tY,tQ,tK,tJ,t0,t1,t2,t5,t3,t4,t8,t6,t7,t9,re,rt,rr,ri,rn,rs=e.i(67034);function ro(e){return e}let ra={encodeHrTime:"u">typeof BigInt?function(e){let t;return(t=BigInt(1e9),BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))).toString()}:function(e){return 1e9*e[0]+e[1]},encodeSpanContext:ro,encodeOptionalSpanContext:ro,encodeUint8Array:e=>{if(void 0!==rs.Buffer)return rs.Buffer.from(e).toString("base64");let t=Array(e.length);for(let r=0;r<e.length;r++)t[r]=String.fromCharCode(e[r]);return btoa(t.join(""))}},rl={serializeRequest:e=>{let t={resourceMetrics:[e].map(e=>{var t,r,i;let n,s,o;return t=e.resource,n={attributes:tl(t.attributes,ra),droppedAttributesCount:0},(s=t.schemaUrl)&&""!==s&&(n.schemaUrl=s),{resource:o=n,schemaUrl:o.schemaUrl,scopeMetrics:(r=e.scopeMetrics,i=ra,Array.from(r.map(e=>{var t;return{scope:{name:(t=e.scope).name,version:t.version},metrics:e.metrics.map(e=>(function(e,t){var r,i,n,s;
2let o={name:e.descriptor.name,description:e.descriptor.description,unit:e.descriptor.unit},a=function(e){switch(e){case tj.DELTA:return tX.AGGREGATION_TEMPORALITY_DELTA;case tj.CUMULATIVE:return tX.AGGREGATION_TEMPORALITY_CUMULATIVE}}(e.aggregationTemporality);switch(e.dataPointType){case tH.SUM:o.sum={aggregationTemporality:a,isMonotonic:e.isMonotonic,dataPoints:tc(e,t)};break;case tH.GAUGE:o.gauge={dataPoints:tc(e,t)};break;case tH.HISTOGRAM:o.histogram={aggregationTemporality:a,dataPoints:(r=e,i=t,r.dataPoints.map(e=>{let t=e.value;return{attributes:tl(e.attributes,i),bucketCounts:t.buckets.counts,explicitBounds:t.buckets.boundaries,count:t.count,sum:t.sum,min:t.min,max:t.max,startTimeUnixNano:i.encodeHrTime(e.startTime),timeUnixNano:i.encodeHrTime(e.endTime)}}))};break;case tH.EXPONENTIAL_HISTOGRAM:o.exponentialHistogram={aggregationTemporality:a,dataPoints:(n=e,s=t,n.dataPoints.map(e=>{let t=e.value;return{attributes:tl(e.attributes,s),count:t.count,min:t.min,max:t.max,sum:t.sum,positive:{offset:t.positive.offset,bucketCounts:t.positive.bucketCounts},negative:{offset:t.negative.offset,bucketCounts:t.negative.bucketCounts},scale:t.scale,zeroCount:t.zeroCount,startTimeUnixNano:s.encodeHrTime(e.startTime),timeUnixNano:s.encodeHrTime(e.endTime)}}))}}return o})(e,i)),schemaUrl:e.scope.schemaUrl}})))}})};return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(0===e.length)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return w.warn(`Failed to parse metrics export response: ${e.message}. Returning empty response`),{}}}};class rc extends ta{constructor(e){super(ev(e??{},rl,"v1/metrics",{"Content-Type":"application/json"}),e)}}let ru=Symbol.for("io.opentelemetry.js.api.logs"),rh=globalThis;class rd{emit(e){}enabled(){return!1}}let rp=new rd,r_=new class{getLogger(e,t,r){return new rd}};
2class rg{constructor(e,t,r,i){this._provider=e,this.name=t,this.version=r,this.options=i}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):rp}}class rm{getLogger(e,t,r){var i;return null!=(i=this._getDelegateLogger(e,t,r))?i:new rg(this,e,t,r)}_getDelegate(){var e;return null!=(e=this._delegate)?e:r_}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,r){var i;return null==(i=this._delegate)?void 0:i.getLogger(e,t,r)}}let rf=(class e{constructor(){this._proxyLoggerProvider=new rm}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return rh[ru]?this.getLoggerProvider():(rh[ru]=t=>1===t?e:r_,this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return null!=(t=null==(e=rh[ru])?void 0:e.call(rh,1))?t:this._proxyLoggerProvider}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete rh[ru],this._proxyLoggerProvider=new rm}}).getInstance();async function rT(e){let t=[];for(let r=0,i=e.length;r<i;r++){let i=e[r];i.resource.asyncAttributesPending&&i.resource.waitForAsyncAttributes&&t.push(i.resource.waitForAsyncAttributes())}null!=t&&t.length>0&&await Promise.all(t)}class rE{_exportCompleted;_exportScheduledPromise;_exportScheduledResolve;constructor(e,t,r){this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,r)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}async _executeExport(e,t,r){try{await rT(t),await S.with(x(S.active()),async()=>this._exportWithTimeout(e,t,r))}catch(e){R(e),this._exportScheduledResolve()}}async _exportWithTimeout(e,t,r){return new Promise((i,n)=>{let s=setTimeout(()=>{n(Error("Timeout"))},r);e.export(t,e=>{clearTimeout(s),e.code===tV.SUCCESS?i():n(e.error??Error("BatchLogRecordProcessor: log record export failed"))}),this._exportScheduledResolve()})}}class rb{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_currentExport=null;_finishedLogRecords=[];_timer;_shutdownOnce;_flushing=!1;constructor(e,t){this._exporter=e,this._maxExportBatchSize=t?.maxExportBatchSize??512,this._maxQueueSize=t?.maxQueueSize??2048,this._scheduledDelayMillis=t?.scheduledDelayMillis??5e3,this._exportTimeoutMillis=t?.exportTimeoutMillis??3e4,this._shutdownOnce=new L(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(w.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}async _flushAll(){if(this._flushing)return;this._flushing=!0;let e=this._finishedLogRecords;for(this._finishedLogRecords=[],this._clearTimer(),null!==this._currentExport&&(await this._exporter.forceFlush(),await this._currentExport.exportCompleted,this._currentExport=null);e.length>0;){let t;e.length<=this._maxExportBatchSize?(t=e,e=[]):t=e.splice(0,this._maxExportBatchSize);let r=new rE(this._exporter,t,this._exportTimeoutMillis);this._currentExport=r;try{await r.exportScheduled,await this._exporter.forceFlush(),await r.exportCompleted}catch(e){R(e)}finally{this._currentExport=null}}this._flushing=!1,this._maybeStartTimer()}_extractBatch(){if(0===this._finishedLogRecords.length)return null;if(!(this._finishedLogRecords.length<=this._maxExportBatchSize))return this._finishedLogRecords.splice(0,this._maxExportBatchSize);{let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}}
2_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(null===e)return;let t=new rE(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,R(e),this._maybeStartTimer()})}_maybeStartTimer(){this._shutdownOnce.isCalled||this._flushing||0===this._finishedLogRecords.length||null!==this._currentExport||(this._finishedLogRecords.length>=this._maxExportBatchSize?this._exportOneBatch():void 0===this._timer&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),"number"!=typeof this._timer&&this._timer.unref()))}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}class ry extends rb{_visibilityChangeListener;_pageHideListener;constructor(e,t){super(e,t),this._onInit(t)}onShutdown(){"u">typeof document&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}_onInit(e){e?.disableAutoFlushOnDocumentHide!==!0&&"u">typeof document&&(this._visibilityChangeListener=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this._pageHideListener=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}}(tu=tY||(tY={}))[tu.UNSPECIFIED=0]="UNSPECIFIED",tu[tu.TRACE=1]="TRACE",tu[tu.TRACE2=2]="TRACE2",tu[tu.TRACE3=3]="TRACE3",tu[tu.TRACE4=4]="TRACE4",tu[tu.DEBUG=5]="DEBUG",tu[tu.DEBUG2=6]="DEBUG2",tu[tu.DEBUG3=7]="DEBUG3",tu[tu.DEBUG4=8]="DEBUG4",tu[tu.INFO=9]="INFO",tu[tu.INFO2=10]="INFO2",tu[tu.INFO3=11]="INFO3",tu[tu.INFO4=12]="INFO4",tu[tu.WARN=13]="WARN",tu[tu.WARN2=14]="WARN2",tu[tu.WARN3=15]="WARN3",tu[tu.WARN4=16]="WARN4",tu[tu.ERROR=17]="ERROR",tu[tu.ERROR2=18]="ERROR2",tu[tu.ERROR3=19]="ERROR3",tu[tu.ERROR4=20]="ERROR4",tu[tu.FATAL=21]="FATAL",tu[tu.FATAL2=22]="FATAL2",tu[tu.FATAL3=23]="FATAL3",tu[tu.FATAL4=24]="FATAL4";let rv="0000000000000000",rS="00000000000000000000000000000000",rw={traceId:rS,spanId:rv,traceFlags:tz.NONE};class rA{constructor(e=rw){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}let rL=o("OpenTelemetry Context Key SPAN");function rC(e){return e.getValue(rL)||void 0}function rO(){return rC(v.getInstance().active())}function rR(e,t){return e.setValue(rL,t)}function rk(e){return e.deleteValue(rL)}function rx(e,t){return rR(e,new rA(t))}function rN(e){var t;return null==(t=rC(e))?void 0:t.spanContext()}let rP=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function rD(e,t){if("string"!=typeof e||e.length!==t)return!1;let r=0;for(let t=0;t<e.length;t+=4)r+=(0|rP[e.charCodeAt(t)])+(0|rP[e.charCodeAt(t+1)])+(0|rP[e.charCodeAt(t+2)])+(0|rP[e.charCodeAt(t+3)]);return r===t}function rM(e){return rD(e,32)&&e!==rS}function rI(e){var t;return rM(e.traceId)&&rD(t=e.spanId,16)&&t!==rv}function rU(e){return new rA(e)}let rB=v.getInstance();class rF{startSpan(e,t,r=rB.active()){var i;if(null==t?void 0:t.root)return new rA;let n=r&&rN(r);return null!==(i=n)&&"object"==typeof i&&"spanId"in i&&"string"==typeof i.spanId&&"traceId"in i&&"string"==typeof i.traceId&&"traceFlags"in i&&"number"==typeof i.traceFlags&&rI(n)?new rA(n):new rA}startActiveSpan(e,t,r,i){let n,s,o;if(arguments.length<2)return;2==arguments.length?o=t:3==arguments.length?(n=t,o=r):(n=t,s=r,o=i);let a=null!=s?s:rB.active(),l=this.startSpan(e,n,a),c=rR(a,l);return rB.with(c,o,void 0,l)}}let rz=new rF;
2class rV{constructor(e,t,r,i){this._provider=e,this.name=t,this.version=r,this.options=i}startSpan(e,t,r){return this._getTracer().startSpan(e,t,r)}startActiveSpan(e,t,r,i){let n=this._getTracer();return Reflect.apply(n.startActiveSpan,n,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):rz}}let rj=new class{getTracer(e,t,r){return new rF}};class r${getTracer(e,t,r){var i;return null!=(i=this.getDelegateTracer(e,t,r))?i:new rV(this,e,t,r)}getDelegate(){var e;return null!=(e=this._delegate)?e:rj}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,r){var i;return null==(i=this._delegate)?void 0:i.getTracer(e,t,r)}}let rH="trace",rG=(class e{constructor(){this._proxyTracerProvider=new r$,this.wrapSpanContext=rU,this.isSpanContextValid=rI,this.deleteSpan=rk,this.getSpan=rC,this.getActiveSpan=rO,this.getSpanContext=rN,this.setSpan=rR,this.setSpanContext=rx}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(e){let t=_(rH,this._proxyTracerProvider,E.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return g(rH)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){m(rH,E.instance()),this._proxyTracerProvider=new r$}}).getInstance();class rZ{hrTime;hrTimeObserved;spanContext;resource;instrumentationScope;attributes={};_severityText;_severityNumber;_body;_eventName;_attributesCount=0;_droppedAttributesCount=0;_isReadonly=!1;_logRecordLimits;set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,r){const{timestamp:i,observedTimestamp:n,eventName:s,severityNumber:o,severityText:a,body:l,attributes:c={},exception:u,context:h}=r,d=Date.now();if(this.hrTime=ek(i??d),this.hrTimeObserved=ek(n??d),h){const e=rG.getSpanContext(h);e&&rI(e)&&(this.spanContext=e)}this.severityNumber=o,this.severityText=a,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=s,this.setAttributes(c),null!=u&&this._setException(u)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(0===e.length)return w.warn(`Invalid attribute key: ${e}`),this;if(!function e(t,r){return!!(null==t||"string"==typeof t||"number"==typeof t||"boolean"==typeof t||t instanceof Uint8Array)||"object"==typeof t&&!r.has(t)&&((r.add(t),Array.isArray(t))?t.every(t=>e(t,r)):(t.constructor===Object||void 0===t.constructor)&&Object.values(t).every(t=>e(t,r)))}(t,new WeakSet))return w.warn(`Invalid attribute value set for key: ${e}`),this;let r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return r&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,1===this._droppedAttributesCount&&w.warn("Dropping extra attributes.")):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++),this}setAttributes(e){for(let[t,r]of Object.entries(e))this.setAttribute(t,r);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return w.warn(`Attribute value limit must be positive, got ${t}`),e;if(null==e)return e;if("string"==typeof e)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if("object"==typeof e){let t={};for(let[r,i]of Object.entries(e))t[r]=this._truncateToSize(i);return t}return e}_setException(e){let t=!1;"string"==typeof e||"number"==typeof e?(Object.hasOwn(this.attributes,I)||this.setAttribute(I,String(e)),t=!0):e&&"object"==typeof e&&(e.code?(Object.hasOwn(this.attributes,B)||this.setAttribute(B,e.code.toString()),t=!0):e.name&&(Object.hasOwn(this.attributes,B)||this.setAttribute(B,e.name),t=!0),e.message&&(Object.hasOwn(this.attributes,I)||this.setAttribute(I,e.message),t=!0),e.stack&&(Object.hasOwn(this.attributes,U)||this.setAttribute(U,e.stack),t=!0)),t||w.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&w.warn("Can not execute the operation on emitted log record"),this._isReadonly}}class rW{instrumentationScope;_sharedState;_loggerConfig;constructor(e,t){this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){let t=e.context||S.active();if(!this.enabled(e))return;let r=new rZ(this._sharedState,this.instrumentationScope,{context:t,...e});this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(r,t),r._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let r=e?.severityNumber;if("number"==typeof r&&r!==tY.UNSPECIFIED&&r<t.minimumSeverity)return!1;let i=e?.context||S.active();if(t.traceBased){let e=rG.getSpanContext(i);if(e&&rI(e)&&(e.traceFlags&tz.SAMPLED)!==tz.SAMPLED)return!1}let n={context:i,instrumentationScope:this.instrumentationScope,severityNumber:e?.severityNumber,eventName:e?.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(n))return!0;return!1}}class rq{}class rX{addCallback(e){}removeCallback(e){}}let rY=new class{createGauge(e,t){return rK}createHistogram(e,t){return rJ}createCounter(e,t){return rQ}createUpDownCounter(e,t){return r0}createObservableGauge(e,t){return r2}createObservableCounter(e,t){return r1}createObservableUpDownCounter(e,t){return r5}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},rQ=new class extends rq{add(e,t){}},rK=new class extends rq{record(e,t){}},rJ=new class extends rq{record(e,t){}},r0=new class extends rq{add(e,t){}},r1=new class extends rX{},r2=new class extends rX{},r5=new class extends rX{};class r3{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}}
2class r4 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r4.prototype)}}class r8{processors;forceFlushTimeoutMillis;constructor(e,t){this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>{var r;let i;return r=t.forceFlush(),Promise.race([r,new Promise(function(t,r){i=setTimeout(function(){r(new r4("Operation timed out."))},e)})]).then(e=>(clearTimeout(i),e),e=>{throw clearTimeout(i),e})}))}onEmit(e,t){this.processors.forEach(r=>r.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}}class r6{createdLogs;constructor(e){this.createdLogs=e.createCounter("otel.sdk.log.created",{unit:"{log_record}",description:"The number of logs submitted to enabled SDK Loggers."})}emitLog(){this.createdLogs.add(1)}}let r7={disabled:!1,minimumSeverity:tY.UNSPECIFIED,traceBased:!1},r9=()=>({...r7});class ie{loggers=new Map;activeProcessor;registeredLogRecordProcessors=[];resource;forceFlushTimeoutMillis;logRecordLimits;processors;loggerMetrics;_loggerConfigurator;_loggerConfigs=new Map;constructor(e,t,r,i,n,s){this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=r,this.processors=i,i.length>0?(this.registeredLogRecordProcessors=i,this.activeProcessor=new r8(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new r3,this._loggerConfigurator=n??r9;const o=s?s.getMeter("@opentelemetry/sdk-logs","0.218.0"):rY;this.loggerMetrics=new r6(o)}getLoggerConfig(e){let t=`${e.name}@${e.version||""}:${e.schemaUrl||""}`,r=this._loggerConfigs.get(t);return r||(r=this._loggerConfigurator(e),this._loggerConfigs.set(t,r)),r}}class it{_shutdownOnce;_sharedState;constructor(e={}){const t={resource:e.resource??K(),forceFlushTimeoutMillis:e.forceFlushTimeoutMillis??3e4,logRecordLimits:{attributeCountLimit:e.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:e.loggerConfigurator??r9,processors:e.processors??[],meterProvider:e.meterProvider};this._sharedState=new ie(t.resource,t.forceFlushTimeoutMillis,t.logRecordLimits,t.processors,t.loggerConfigurator,t.meterProvider),this._shutdownOnce=new L(this._shutdown,this)}getLogger(e,t,r){if(this._shutdownOnce.isCalled)return w.warn("A shutdown LoggerProvider cannot provide a Logger"),rp;e||w.warn("Logger requested without instrumentation scope name.");let i=e||"unknown",n=`${i}@${t||""}:${r?.schemaUrl||""}`;return this._sharedState.loggers.has(n)||this._sharedState.loggers.set(n,new rW({name:i,version:t,schemaUrl:r?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(n)}forceFlush(){return this._shutdownOnce.isCalled?(w.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(w.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}function ir(e,t,r){let i=e.startLengthDelimited(),n=e.pos;for(let i of(ec(e,t,1),r.values()))e.writeTag(2,2),function(e,t,r){let i=e.startLengthDelimited(),n=e.pos;for(let i of(el(e,t,1),r))e.writeTag(2,2),function(e,t){let r=e.startLengthDelimited(),i=e.pos;if(e.writeTag(1,1),es(e,t.hrTime),void 0!==t.severityNumber&&t.severityNumber!==tY.UNSPECIFIED&&(e.writeTag(2,0),e.writeVarint(t.severityNumber)),t.severityText&&(e.writeTag(3,2),e.writeString(t.severityText)),void 0!==t.body){e.writeTag(5,2);let r=e.startLengthDelimited(),i=e.pos;ea(e,t.body),e.finishLengthDelimited(r,e.pos-i)}t.attributes&&eo(e,t.attributes,6),e.writeTag(7,0),e.writeVarint(t.droppedAttributesCount),t.spanContext?.traceFlags&&(e.writeTag(8,5),e.writeFixed32(t.spanContext.traceFlags)),t.spanContext?.traceId&&(e.writeTag(9,2),e.writeBytes(en(t.spanContext.traceId))),t.spanContext?.spanId&&(e.writeTag(10,2),e.writeBytes(en(t.spanContext.spanId))),e.writeTag(11,1),es(e,t.hrTimeObserved),t.eventName&&(e.writeTag(12,2),e.writeString(t.eventName)),e.finishLengthDelimited(r,e.pos-i)}(e,i);t.schemaUrl&&(e.writeTag(3,2),e.writeString(t.schemaUrl)),e.finishLengthDelimited(i,e.pos-n)}
2(e,i[0].instrumentationScope,i);t.schemaUrl&&(e.writeTag(3,2),e.writeString(t.schemaUrl)),e.finishLengthDelimited(i,e.pos-n)}let ii={serializeRequest:e=>(function(e){let t=function(e){let t=new Map;for(let r of e){let e=r.resource,i=r.instrumentationScope,n=t.get(e);n||(n=new Map,t.set(e,n));let s=n.get(i);s||(s=[],n.set(i,s)),s.push(r)}return t}(e),r=new eu;for(let[e,i]of t)r.writeTag(1,2),ir(r,e,i);let i=new er(r.pos);for(let[e,r]of t)i.writeTag(1,2),ir(i,e,r);return i.finish()})(e),deserializeResponse:e=>(function(e){let t=new ep(e),r={};for(;!t.isAtEnd();){let{fieldNumber:e,wireType:i}=t.readTag();1===e&&2===i?r.partialSuccess=function(e){let t=new ep(e),r={};for(;!t.isAtEnd();){let{fieldNumber:e,wireType:i}=t.readTag();switch(e){case 1:0===i?r.rejectedLogRecords=t.readVarint():t.skip(i);break;case 2:2===i?r.errorMessage=t.readString():t.skip(i);break;default:t.skip(i)}}return r}(t.readBytes()):t.skip(i)}return r})(e)};class is extends ee{constructor(e={}){super(ev(e,ii,"v1/logs",{"Content-Type":"application/x-protobuf"}))}}let io=Function.prototype.toString,ia=io.call(Object),il=Object.getPrototypeOf,ic=Object.prototype,iu=ic.hasOwnProperty,ih=Symbol?Symbol.toStringTag:void 0,id=ic.toString;function ip(e){var t,r,i;if(null==(t=e)||"object"!=typeof t||"[object Object]"!==(null==(r=e)?void 0===r?"[object Undefined]":"[object Null]":ih&&ih in Object(r)?function(e){let t=iu.call(e,ih),r=e[ih],i=!1;try{e[ih]=void 0,i=!0}catch{}let n=id.call(e);return i&&(t?e[ih]=r:delete e[ih]),n}(r):(i=r,id.call(i))))return!1;let n=il(e);if(null===n)return!0;let s=iu.call(n,"constructor")&&n.constructor;return"function"==typeof s&&s instanceof s&&io.call(s)===ia}function i_(e){return im(e)?e.slice():e}function ig(e,t,r){let i=r.get(e[t])||[];for(let r=0,n=i.length;r<n;r++){let n=i[r];if(n.key===t&&n.obj===e)return!0}return!1}function im(e){return Array.isArray(e)}function iT(e){return"function"==typeof e}function iE(e){return!ib(e)&&!im(e)&&!iT(e)&&"object"==typeof e}function ib(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}function iy(e){let t={};if("object"!=typeof e||null==e)return t;for(let i in e){var r;if(!Object.prototype.hasOwnProperty.call(e,i))continue;if("string"!=typeof(r=i)||""===r){w.warn(`Invalid attribute key: ${i}`);continue}let n=e[i];if(!iv(n)){w.warn(`Invalid attribute value set for key: ${i}`);continue}
2Array.isArray(n)?t[i]=n.slice():t[i]=n}return t}function iv(e){return null==e||(Array.isArray(e)?function(e){let t;for(let r of e){if(null==r)continue;let e=typeof r;if(e!==t){if(!t&&iS(e)){t=e;continue}return!1}}return!0}(e):iS(typeof e))}function iS(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}(th=tQ||(tQ={}))[th.INTERNAL=0]="INTERNAL",th[th.SERVER=1]="SERVER",th[th.CLIENT=2]="CLIENT",th[th.PRODUCER=3]="PRODUCER",th[th.CONSUMER=4]="CONSUMER",(td=tK||(tK={}))[td.NOT_RECORD=0]="NOT_RECORD",td[td.RECORD=1]="RECORD",td[td.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED",(tp=tJ||(tJ={}))[tp.UNSET=0]="UNSET",tp[tp.OK=1]="OK",tp[tp.ERROR=2]="ERROR";class iw{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:tJ.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){const t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=eC.now(),this._performanceOffset=t-(this._performanceStartTime+eC.timeOrigin),this._startTimeProvided=null!=e.startTime,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(const t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,null!=e.attributes&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(null==t||this._isSpanEnded())return this;if(0===e.length)return w.warn(`Invalid attribute key: ${e}`),this;if(!iv(t))return w.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:r}=this._spanLimits,i=!Object.prototype.hasOwnProperty.call(this.attributes,e);return void 0!==r&&this._attributesCount>=r&&i?this._droppedAttributesCount++:(this.attributes[e]=this._truncateToSize(t),i&&this._attributesCount++),this}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,r){if(this._isSpanEnded())return this;let{eventCountLimit:i}=this._spanLimits;if(0===i)return w.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==i&&this.events.length>=i&&(0===this._droppedEventsCount&&w.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),eP(t)&&(eP(r)||(r=t),t=void 0);let n=iy(t),{attributePerEventCountLimit:s}=this._spanLimits,o={},a=0,l=0;for(let e in n){if(!Object.prototype.hasOwnProperty.call(n,e))continue;let t=n[e];if(void 0!==s&&l>=s){a++;continue}o[e]=this._truncateToSize(t),l++}return this.events.push({name:e,attributes:o,time:this._getTime(r),droppedAttributesCount:a}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(0===t)return this._droppedLinksCount++,this;void 0!==t&&this.links.length>=t&&(0===this._droppedLinksCount&&w.debug("Dropping extra links."),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:r}=this._spanLimits,i=iy(e.attributes),n={},s=0,o=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(void 0!==r&&o>=r){s++;continue}n[e]=this._truncateToSize(t),o++}let a={context:e.context};return o>0&&(a.attributes=n),s>0&&(a.droppedAttributesCount=s),this.links.push(a),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===tJ.UNSET||this.status.code===tJ.OK)return this;let t={code:e.code};return e.code===tJ.ERROR&&("string"==typeof e.message?t.message=e.message:null!=e.message&&w.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){var t,r;let i,n;this._isSpanEnded()?w.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`):(this.endTime=this._getTime(e),this._duration=(t=this.startTime,i=(r=this.endTime)[0]-t[0],(n=r[1]-t[1])<0&&(i-=1,n+=1e9),[i,n]),this._duration[0]<0&&(w.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&w.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&w.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this))}_getTime(e){if("number"==typeof e&&e<=eC.now())return eR(e+this._performanceOffset);if("number"==typeof e)return eO(e);if(e instanceof Date)return eO(e.getTime());if(eN(e))return e;if(this._startTimeProvided)return eO(Date.now());let t=eC.now()-this._performanceStartTime;return eD(this.startTime,eO(t))}isRecording(){return!1===this._ended}recordException(e,t){let r={};
2"string"==typeof e?r[I]=e:e&&(e.code?r[B]=e.code.toString():e.name&&(r[B]=e.name),e.message&&(r[I]=e.message),e.stack&&(r[U]=e.stack)),r[B]||r[I]?this.addEvent("exception",r,t):w.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);w.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(w.warn(`Attribute value limit must be positive, got ${t}`),e):"string"==typeof e?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>"string"==typeof e?this._truncateToLimitUtil(e,t):e):e}}(t_=t0||(t0={}))[t_.NOT_RECORD=0]="NOT_RECORD",t_[t_.RECORD=1]="RECORD",t_[t_.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED";class iA{shouldSample(){return{decision:t0.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class iL{shouldSample(){return{decision:t0.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class iC{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(R(Error("ParentBasedSampler must have a root sampler configured")),this._root=new iL),this._remoteParentSampled=e.remoteParentSampled??new iL,this._remoteParentNotSampled=e.remoteParentNotSampled??new iA,this._localParentSampled=e.localParentSampled??new iL,this._localParentNotSampled=e.localParentNotSampled??new iA}shouldSample(e,t,r,i,n,s){let o=rG.getSpanContext(e);return o&&rI(o)?o.isRemote?o.traceFlags&tz.SAMPLED?this._remoteParentSampled.shouldSample(e,t,r,i,n,s):this._remoteParentNotSampled.shouldSample(e,t,r,i,n,s):o.traceFlags&tz.SAMPLED?this._localParentSampled.shouldSample(e,t,r,i,n,s):this._localParentNotSampled.shouldSample(e,t,r,i,n,s):this._root.shouldSample(e,t,r,i,n,s)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class iO{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(0xffffffff*this._ratio)}shouldSample(e,t){return{decision:rM(t)&&this._accumulate(t)<this._upperBound?t0.RECORD_AND_SAMPLED:t0.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return"number"!=typeof e||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let r=0;r<32;r+=8){let i=0;for(let t=0;t<8;t++){let n=e.charCodeAt(r+t);i=i<<4|(n<58?n-48:n<71?n-55:n-87)}t=(t^i)>>>0}return t}}function iR(){return{sampler:ik(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:O("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:O("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:O("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:O("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:O("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:O("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:O("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:O("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}function ik(){let e=C("OTEL_TRACES_SAMPLER")??t1.ParentBasedAlwaysOn;switch(e){case t1.AlwaysOn:return new iL;case t1.AlwaysOff:return new iA;case t1.ParentBasedAlwaysOn:return new iC({root:new iL});case t1.ParentBasedAlwaysOff:return new iC({root:new iA});case t1.TraceIdRatio:return new iO(ix());case t1.ParentBasedTraceIdRatio:return new iC({root:new iO(ix())});default:return w.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${t1.ParentBasedAlwaysOn}".`),new iC({root:new iL})}}function ix(){let e=O("OTEL_TRACES_SAMPLER_ARG");return null==e?(w.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1):e<0||e>1?(w.error(`OTEL_TRACES_SAMPLER_ARG=${e} was given, but it is out of range ([0..1]), defaulting to 1.`),1):e}(tg=t1||(t1={})).AlwaysOff="always_off",tg.AlwaysOn="always_on",tg.ParentBasedAlwaysOff="parentbased_always_off",tg.ParentBasedAlwaysOn="parentbased_always_on",tg.ParentBasedTraceIdRatio="parentbased_traceidratio",tg.TraceIdRatio="traceidratio";let iN=1/0,iP=new Uint8Array(16),iD=new Uint8Array(8),iM=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function iI(e){for(let t=0;t<e.length;t++)e[t]=256*Math.random()>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function iU(e){let t="";for(let r=0;r<e.length;r++)t+=iM[e[r]];return t}class iB{generateTraceId(){return iI(iP),iU(iP)}generateSpanId(){return iI(iD),iU(iD)}}let iF="otel.span.sampling_result";class iz{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter("otel.sdk.span.started",{unit:"{span}",description:"The number of created spans."}),this.liveSpans=e.createUpDownCounter("otel.sdk.span.live",{unit:"{span}",description:"The number of currently live spans."})}startSpan(e,t){var r;let i=function(e){switch(e){case t0.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case t0.RECORD:return"RECORD_ONLY";case t0.NOT_RECORD:return"DROP"}}(t);if(this.startedSpans.add(1,{"otel.span.parent.origin":(r=e)?r.isRemote?"remote":"local":"none",[iF]:i}),t===t0.NOT_RECORD)return()=>{};let n={[iF]:i};return this.liveSpans.add(1,n),()=>{this.liveSpans.add(-1,n)}}}class iV{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;
2constructor(e,t,r,i){const n=function(e){let t={sampler:ik()},r=iR(),i=Object.assign({},r,t,e);return i.generalLimits=Object.assign({},r.generalLimits,e.generalLimits||{}),i.spanLimits=Object.assign({},r.spanLimits,e.spanLimits||{}),i}(t);this._sampler=n.sampler,this._generalLimits=n.generalLimits,this._spanLimits=n.spanLimits,this._idGenerator=t.idGenerator||new iB,this._resource=r,this._spanProcessor=i,this.instrumentationScope=e;const s=n.meterProvider?n.meterProvider.getMeter("@opentelemetry/sdk-trace","2.7.1"):rY;this._tracerMetrics=new iz(s)}startSpan(e,t={},r=S.active()){let i,n,s;t.root&&(r=rG.deleteSpan(r));let o=rG.getSpan(r);if(N(r))return w.debug("Instrumentation suppressed, returning Noop Span"),rG.wrapSpanContext(rw);let a=o?.spanContext(),l=this._idGenerator.generateSpanId();a&&rG.isSpanContextValid(a)?(n=a.traceId,s=a.traceState,i=a):n=this._idGenerator.generateTraceId();let c=t.kind??tQ.INTERNAL,u=(t.links??[]).map(e=>({context:e.context,attributes:iy(e.attributes)})),h=iy(t.attributes),d=this._sampler.shouldSample(r,n,e,c,h,u),p=this._tracerMetrics.startSpan(a,d.decision);s=d.traceState??s;let _={traceId:n,spanId:l,traceFlags:d.decision===tK.RECORD_AND_SAMPLED?tz.SAMPLED:tz.NONE,traceState:s};if(d.decision===tK.NOT_RECORD)return w.debug("Recording is off, propagating context in a non-recording span"),rG.wrapSpanContext(_);let g=iy(Object.assign(h,d.attributes));return new iw({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:_,name:e,kind:c,links:u,parentSpanContext:i,attributes:g,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:p})}startActiveSpan(e,t,r,i){let n,s,o;if(arguments.length<2)return;2==arguments.length?o=t:3==arguments.length?(n=t,o=r):(n=t,s=r,o=i);let a=s??S.active(),l=this.startSpan(e,n,a),c=rG.setSpan(a,l);return S.with(c,o,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class ij{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{R(e||Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(let r of this._spanProcessors)r.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,r)=>{Promise.all(e).then(()=>{t()},r)})}}(tm=t2||(t2={}))[tm.resolved=0]="resolved",tm[tm.timeout=1]="timeout",tm[tm.error=2]="error",tm[tm.unresolved=3]="unresolved";class i${_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const t=function(...e){let t=e.shift(),r=new WeakMap;for(;e.length>0;)t=function e(t,r,i=0,n){let s;if(!(i>20)){if(i++,ib(t)||ib(r)||iT(r))s=i_(r);else if(im(t)){if(s=t.slice(),im(r))for(let e=0,t=r.length;e<t;e++)s.push(i_(r[e]));else if(iE(r)){let e=Object.keys(r);for(let t=0,i=e.length;t<i;t++){let i=e[t];"__proto__"!==i&&"constructor"!==i&&"prototype"!==i&&(s[i]=i_(r[i]))}}}else if(iE(t))if(iE(r)){var o,a;if(o=t,a=r,!(ip(o)&&ip(a)))return r;s=Object.assign({},t);let l=Object.keys(r);for(let o=0,a=l.length;o<a;o++){let a=l[o];if("__proto__"===a||"constructor"===a||"prototype"===a)continue;let c=r[a];if(ib(c))void 0===c?delete s[a]:s[a]=c;else{let o=s[a];if(ig(t,a,n)||ig(r,a,n))delete s[a];else{if(iE(o)&&iE(c)){let e=n.get(o)||[],i=n.get(c)||[];e.push({obj:t,key:a}),i.push({obj:r,key:a}),n.set(o,e),n.set(c,i)}s[a]=e(s[a],c,i,n)}}}}else s=r;return s}}(t,e.shift(),0,r);return t}({},iR(),function(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??O("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??O("OTEL_ATTRIBUTE_COUNT_LIMIT")??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??O("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??O("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??iN,Object.assign({},e,{spanLimits:t})}(e));this._resource=t.resource??K(),this._config=Object.assign({},t,{resource:this._resource});const r=[];e.spanProcessors?.length&&r.push(...e.spanProcessors),this._activeSpanProcessor=new ij(r)}getTracer(e,t,r){let i=`${e}@${t||""}:${r?.schemaUrl||""}`;return this._tracers.has(i)||this._tracers.set(i,new iV({name:e,version:t,schemaUrl:r?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(i)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(r=>{let i,n=setTimeout(()=>
2{r(Error(`Span processor did not completed within timeout period of ${e} ms`)),i=t2.timeout},e);t.forceFlush().then(()=>{clearTimeout(n),i!==t2.timeout&&r(i=t2.resolved)}).catch(e=>{clearTimeout(n),i=t2.error,r(e)})}));return new Promise((e,r)=>{Promise.all(t).then(t=>{let i=t.filter(e=>e!==t2.resolved);i.length>0?r(i):e()}).catch(e=>r([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class iH{_enabled=!1;_currentContext=a;_bindFunction(e=a,t){let r=this,i=function(...i){return r.with(e,()=>t.apply(this,i))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),i}active(){return this._currentContext}bind(e,t){return(void 0===e&&(e=this.active()),"function"==typeof t)?this._bindFunction(e,t):t}disable(){return this._currentContext=a,this._enabled=!1,this}enable(){return this._enabled||(this._enabled=!0,this._currentContext=a),this}with(e,t,r,...i){let n=this._currentContext;this._currentContext=e||a;try{return t.call(r,...i)}finally{this._currentContext=n}}}let iG={get(e,t){if(null!=e)return e[t]},keys:e=>null==e?[]:Object.keys(e)},iZ={set(e,t,r){null!=e&&(e[t]=r)}},iW=o("OpenTelemetry Baggage Key");function iq(e){return e.getValue(iW)||void 0}function iX(){return iq(v.getInstance().active())}function iY(e,t){return e.setValue(iW,t)}function iQ(e){return e.deleteValue(iW)}class iK{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(e,t){let r=new iK(this._entries);return r._entries.set(e,t),r}removeEntry(e){let t=new iK(this._entries);return t._entries.delete(e),t}removeEntries(...e){let t=new iK(this._entries);for(let r of e)t._entries.delete(r);return t}clear(){return new iK}}let iJ=Symbol("BaggageEntryMetadata"),i0=E.instance();function i1(e={}){return new iK(new Map(Object.entries(e)))}let i2="propagation",i5=new class{inject(e,t){}extract(e,t){return e}fields(){return[]}},i3=(class e{constructor(){this.createBaggage=i1,this.getBaggage=iq,this.getActiveBaggage=iX,this.setBaggage=iY,this.deleteBaggage=iQ}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(e){return _(i2,e,E.instance())}inject(e,t,r=iZ){return this._getGlobalPropagator().inject(e,t,r)}extract(e,t,r=iG){return this._getGlobalPropagator().extract(e,t,r)}fields(){return this._getGlobalPropagator().fields()}disable(){m(i2,E.instance())}_getGlobalPropagator(){return g(i2)||i5}}).getInstance();class i4{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];const t=new Set;for(const e of this._propagators)for(const r of"function"==typeof e.fields?e.fields():[])t.add(r);this._fields=Array.from(t)}inject(e,t,r){for(let i of this._propagators)try{i.inject(e,t,r)}catch(e){w.warn(`Failed to inject with ${i.constructor.name}. Err: ${e.message}`)}}extract(e,t,r){return this._propagators.reduce((e,i)=>{try{return i.extract(e,t,r)}catch(e){w.warn(`Failed to extract with ${i.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}let i8="baggage";class i6{inject(e,t,r){let i=i3.getBaggage(e);if(!i||N(e))return;let n=i.getAllEntries().map(([e,t])=>{let r=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return void 0!==t.metadata&&(r+=";"+t.metadata.toString()),r}).filter(e=>e.length<=4096).slice(0,180).reduce((e,t)=>{let r=`${e}${""!==e?",":""}${t}`;return r.length>8192?e:r},"");n.length>0&&r.set(t,i8,n)}extract(e,t,r){let i=r.get(t,i8),n=Array.isArray(i)?i.join(","):i;if(!n)return e;let s={};return 0===n.length||(n.split(",").forEach(e=>{let t=function(e){let t,r,i;if(!e)return;let n=e.indexOf(";"),s=-1===n?e:e.substring(0,n),o=s.indexOf("=");if(o<=0)return;let a=s.substring(0,o).trim(),l=s.substring(o+1).trim();if(a&&l){try{t=decodeURIComponent(a),r=decodeURIComponent(l)}catch{return}if(-1!==n&&n<e.length-1){var c;"string"!=typeof(c=e.substring(n+1))&&(i0.error(`Cannot create baggage metadata from unknown type: ${typeof c}`),c=""),i={__TYPE__:iJ,toString:()=>c}}return{key:t,value:r,metadata:i}}}(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),s[t.key]=e}}),0===Object.entries(s).length)?e:i3.setBaggage(e,i3.createBaggage(s))}fields(){return[i8]}}let i7="[_0-9a-z-*/]",i9=`[a-z]${i7}{0,255}`,ne=`[a-z0-9]${i7}{0,240}@[a-z]${i7}{0,13}`,nt=RegExp(`^(?:${i9}|${ne})$`),nr=/^[ -~]{0,255}[!-~]$/,ni=/,|=/;function nn(e){return nr.test(e)&&!ni.test(e)}class ns{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState="string"==typeof e?e:"",this._length=this._rawTraceState.length}set(e,t){if(!nt.test(e)||!nn(t))return this;let r=this._getState(),i=r.get(e),n=this._length;if("string"==typeof i?n+=t.length-i.length:n+=e.length+t.length+(r.size>0?2:1),n>512)return this;let s=new Map(r);return s.delete(e),s.set(e,t),this._fromState(s,n)}unset(e){let t=this._getState(),r=t.get(e);if("string"!=typeof r)return this;let i=this._length-(e.length+r.length+1);t.size>1&&(i-=1);let n=new Map(t);return n.delete(e),this._fromState(n,i)}get(e){return this._getState().get(e)}serialize(){let e="",t=0;for(let r of this._getState())t>0&&(e=","+e),e=`${r[0]}=${r[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(","),t=new Map,r=0;for(let i of e){let e=i.trim(),n=e.indexOf("=");if(-1===n)continue;let s=e.slice(0,n),o=e.slice(n+1);if(!nt.test(s)||!nn(o))continue;let a=r+e.length+ +(t.size>0);if(!(a>512)&&(t.set(s,o),r=a,t.size>=32))break}return this._length=r,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(e,t){let r=Object.create(ns.prototype);return r._internalState=e,r._length=t,r}}let no="traceparent",na="tracestate",nl=RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");class nc{inject(e,t,r){let i=rG.getSpanContext(e);if(!i||N(e)||!rI(i))return;let n=`00-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||tz.NONE).toString(16)}`;r.set(t,no,n),i.traceState&&r.set(t,na,i.traceState.serialize())}extract(e,t,r){let i,n=r.get(t,no);if(!n)return e;let s=Array.isArray(n)?n[0]:n;if("string"!=typeof s)return e;let o=(i=nl.exec(s))&&("00"!==i[1]||!i[5])?{traceId:i[2],spanId:i[3],traceFlags:parseInt(i[4],16)}:null;if(!o)return e;o.isRemote=!0;let a=r.get(t,na);if(a){let e=Array.isArray(a)?a.join(","):a;o.traceState=new ns("string"==typeof e?e:void 0)}return rG.setSpanContext(e,o)}fields(){return[no,na]}}class nu extends i${constructor(e={}){super(e)}register(e={}){rG.setGlobalTracerProvider(this),function(e){if(null!==e){if(void 0===e)return i3.setGlobalPropagator(new i4({propagators:[new nc,new i6]}));i3.setGlobalPropagator(e)}}(e.propagator),function(e){if(null!==e){if(void 0===e){let e=new iH;e.enable(),S.setGlobalContextManager(e);return}e.enable(),S.setGlobalContextManager(e)}}(e.contextManager)}}(tf=t5||(t5={})).CONNECT_END="connectEnd",tf.CONNECT_START="connectStart",tf.DECODED_BODY_SIZE="decodedBodySize",tf.DOM_COMPLETE="domComplete",tf.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",tf.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",tf.DOM_INTERACTIVE="domInteractive",tf.DOMAIN_LOOKUP_END="domainLookupEnd",tf.DOMAIN_LOOKUP_START="domainLookupStart",tf.ENCODED_BODY_SIZE="encodedBodySize",tf.FETCH_START="fetchStart",tf.LOAD_EVENT_END="loadEventEnd",tf.LOAD_EVENT_START="loadEventStart",tf.NAVIGATION_START="navigationStart",tf.REDIRECT_END="redirectEnd",tf.REDIRECT_START="redirectStart",tf.REQUEST_START="requestStart",tf.RESPONSE_END="responseEnd",tf.RESPONSE_START="responseStart",tf.SECURE_CONNECTION_START="secureConnectionStart",tf.START_TIME="startTime",tf.UNLOAD_EVENT_END="unloadEventEnd",tf.UNLOAD_EVENT_START="unloadEventStart";function nh(e,t,r,i=!0){if(t in r&&"number"==typeof r[t]&&!(i&&0===r[t]))return e.addEvent(t,r[t])}
2function nd(e,t,r=!1,i,n){if(void 0===i&&(i=0!==t[t5.START_TIME]),r||(nh(e,t5.FETCH_START,t,i),nh(e,t5.DOMAIN_LOOKUP_START,t,i),nh(e,t5.DOMAIN_LOOKUP_END,t,i),nh(e,t5.CONNECT_START,t,i),nh(e,t5.SECURE_CONNECTION_START,t,i),nh(e,t5.CONNECT_END,t,i),nh(e,t5.REQUEST_START,t,i),nh(e,t5.RESPONSE_START,t,i),nh(e,t5.RESPONSE_END,t,i)),!n){let r=t[t5.ENCODED_BODY_SIZE];void 0!==r&&e.setAttribute("http.response_content_length",r);let i=t[t5.DECODED_BODY_SIZE];void 0!==i&&r!==i&&e.setAttribute("http.response_content_length_uncompressed",i)}}(tT=t3||(t3={}))[tT.STABLE=1]="STABLE",tT[tT.OLD=2]="OLD",tT[tT.DUPLICATE=3]="DUPLICATE";let np=new class{getMeter(e,t,r){return rY}},n_="metrics",ng=(class e{static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(e){return _(n_,e,E.instance())}getMeterProvider(){return g(n_)||np}getMeter(e,t,r){return this.getMeterProvider().getMeter(e,t,r)}disable(){m(n_,E.instance())}}).getInstance(),nm=Symbol.for("io.opentelemetry.js.api.logs"),nf=globalThis;class nT{emit(e){}}let nE=new nT,nb=new class{getLogger(e,t,r){return new nT}};
2class ny{constructor(e,t,r,i){this._provider=e,this.name=t,this.version=r,this.options=i}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):nE}}class nv{getLogger(e,t,r){var i;return null!=(i=this._getDelegateLogger(e,t,r))?i:new ny(this,e,t,r)}_getDelegate(){var e;return null!=(e=this._delegate)?e:nb}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,r){var i;return null==(i=this._delegate)?void 0:i.getLogger(e,t,r)}}let nS=(class e{constructor(){this._proxyLoggerProvider=new nv}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return nf[nm]?this.getLoggerProvider():(nf[nm]=t=>1===t?e:nb,this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return null!=(t=null==(e=nf[nm])?void 0:e.call(nf,1))?t:this._proxyLoggerProvider}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete nf[nm],this._proxyLoggerProvider=new nv}}).getInstance(),nw=console.error.bind(console);function nA(e,t,r){let i=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:i,writable:!0,value:r})}let nL=(e,t,r)=>{if(!e||!e[t])return void nw("no original function "+String(t)+" to wrap");if(!r){nw("no wrapper function"),nw(Error().stack);return}let i=e[t];if("function"!=typeof i||"function"!=typeof r)return void nw("original object and wrapper must be functions");let n=r(i,t);return nA(n,"__original",i),nA(n,"__unwrap",()=>{e[t]===n&&nA(e,t,i)}),nA(n,"__wrapped",!0),nA(e,t,n),n},nC=(e,t,r)=>{if(e)Array.isArray(e)||(e=[e]);else{nw("must provide one or more modules to patch"),nw(Error().stack);return}t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{nL(e,t,r)})}):nw("must provide one or more functions to wrap on modules")},nO=(e,t)=>{if(!e||!e[t]){nw("no function to unwrap."),nw(Error().stack);return}let r=e[t];r.__unwrap?r.__unwrap():nw("no original to unwrap to -- has "+String(t)+" already been unwrapped?")},nR=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{nw("must provide one or more modules to patch"),nw(Error().stack);return}t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{nO(e,t)})}):nw("must provide one or more functions to unwrap on modules")};function nk(e){e&&e.logger&&("function"!=typeof e.logger?nw("new logger isn't a function, not replacing"):nw=e.logger)}nk.wrap=nL,nk.massWrap=nC,nk.unwrap=nO,nk.massUnwrap=nR;class nx{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(e,t,r){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(r),this._diag=w.createComponentLogger({namespace:e}),this._tracer=rG.getTracer(e,t),this._meter=ng.getMeter(e,t),this._logger=nS.getLogger(e,t),this._updateMetricInstruments()}_wrap=nL;_unwrap=nO;_massWrap=nC;_massUnwrap=nR;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,r,i){if(e)try{e(r,i)}catch(e){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},e)}}}class nN extends nx{constructor(e,t,r){super(e,t,r),this._config.enabled&&this.enable()}}function nP(e,t,r){let i,n;try{n=e()}catch(e){i=e}finally{if(t(i,n),i&&!r)throw i;return n}}(tE=t4||(t4={})).DOCUMENT_LOAD="documentLoad",tE.DOCUMENT_FETCH="documentFetch",tE.RESOURCE_FETCH="resourceFetch";let nD="http.url";(tb=t8||(t8={})).FIRST_PAINT="firstPaint",tb.FIRST_CONTENTFUL_PAINT="firstContentfulPaint";let nM={"first-paint":t8.FIRST_PAINT,"first-contentful-paint":t8.FIRST_CONTENTFUL_PAINT};class nI extends nN{component="document-load";version="1";moduleName=this.component;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-document-load","0.58.0",e),this._semconvStability=function(e,t){let r=t3.OLD;for(let i of t?.split(",").map(e=>e.trim()).filter(e=>""!==e)??[])if(i.toLowerCase()===e+"/dup"){r=t3.DUPLICATE;break}else i.toLowerCase()===e&&(r=t3.STABLE);return r}("http",e?.semconvStabilityOptIn)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){let t=eC.getEntriesByType?.("resource");t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){let e=Array.from(document.getElementsByTagName("meta")).find(e=>e.getAttribute("name")===no),t=(()=>{let e={},t=eC.getEntriesByType?.("navigation")[0];
2if(t)Object.values(t5).forEach(r=>{if(r in t){let i=t[r];"number"==typeof i&&(e[r]=i)}});else{let t=eC.timing;t&&Object.values(t5).forEach(r=>{if(r in t){let i=t[r];"number"==typeof i&&(e[r]=i)}})}return e})(),r=e&&e.content||"";S.with(i3.extract(a,{traceparent:r}),()=>{let e=this._startSpan(t4.DOCUMENT_LOAD,t5.FETCH_START,t);if(e){let r;S.with(rG.setSpan(S.active(),e),()=>{let e=this._startSpan(t4.DOCUMENT_FETCH,t5.FETCH_START,t);e&&(this._semconvStability&t3.OLD&&e.setAttribute(nD,location.href),this._semconvStability&t3.STABLE&&e.setAttribute(W,location.href),S.with(rG.setSpan(S.active(),e),()=>{let r=!(this._semconvStability&t3.OLD);nd(e,t,this.getConfig().ignoreNetworkEvents,void 0,r),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,t5.RESPONSE_END,t)}))}),this._semconvStability&t3.OLD&&(e.setAttribute(nD,location.href),e.setAttribute("http.user_agent",navigator.userAgent)),this._semconvStability&t3.STABLE&&(e.setAttribute(W,location.href),e.setAttribute("user_agent.original",navigator.userAgent)),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(nh(e,t5.FETCH_START,t),nh(e,t5.UNLOAD_EVENT_START,t),nh(e,t5.UNLOAD_EVENT_END,t),nh(e,t5.DOM_INTERACTIVE,t),nh(e,t5.DOM_CONTENT_LOADED_EVENT_START,t),nh(e,t5.DOM_CONTENT_LOADED_EVENT_END,t),nh(e,t5.DOM_COMPLETE,t),nh(e,t5.LOAD_EVENT_START,t),nh(e,t5.LOAD_EVENT_END,t)),!this.getConfig().ignorePerformancePaintEvents&&(r=eC.getEntriesByType?.("paint"))&&r.forEach(({name:t,startTime:r})=>{t in nM&&e.addEvent(nM[t],r)}),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,t5.LOAD_EVENT_END,t)}})}_endSpan(e,t,r){e&&(t in r?e.end(r[t]):e.end())}_initResourceSpan(e,t){let r=this._startSpan(t4.RESOURCE_FETCH,t5.FETCH_START,e,t);if(r){this._semconvStability&t3.OLD&&r.setAttribute(nD,e.name),this._semconvStability&t3.STABLE&&r.setAttribute(W,e.name);let t=!(this._semconvStability&t3.OLD);nd(r,e,this.getConfig().ignoreNetworkEvents,void 0,t),this._addCustomAttributesOnResourceSpan(r,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(r,t5.RESPONSE_END,e)}}_startSpan(e,t,r,i){if(t in r&&"number"==typeof r[t])return this.tracer.startSpan(e,{startTime:r[t]},i?rG.setSpan(S.active(),i):void 0)}_waitForPageLoad(){"complete"===window.document.readyState?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&nP(()=>t(e),e=>{e&&this._diag.error("addCustomAttributesOnSpan",e)},!0)}_addCustomAttributesOnResourceSpan(e,t,r){r&&nP(()=>r(e,t),e=>{e&&this._diag.error("addCustomAttributesOnResourceSpan",e)},!0)}enable(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener("load",this._onDocumentLoaded)}}function nU(e,t,r){let i,n;try{n=e()}catch(e){i=e}finally{if(t(i,n),i&&!r)throw i;return n}}(ty=t6||(t6={}))[ty.STABLE=1]="STABLE",ty[ty.OLD=2]="OLD",ty[ty.DUPLICATE=3]="DUPLICATE";let nB=Symbol.for("io.opentelemetry.js.api.logs"),nF=globalThis;class nz{emit(e){}}let nV=new nz,nj=new class{getLogger(e,t,r){return new nz}};
2class n${constructor(e,t,r,i){this._provider=e,this.name=t,this.version=r,this.options=i}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):nV}}class nH{getLogger(e,t,r){var i;return null!=(i=this._getDelegateLogger(e,t,r))?i:new n$(this,e,t,r)}_getDelegate(){var e;return null!=(e=this._delegate)?e:nj}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,r){var i;return null==(i=this._delegate)?void 0:i.getLogger(e,t,r)}}let nG=(class e{constructor(){this._proxyLoggerProvider=new nH}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return nF[nB]?this.getLoggerProvider():(nF[nB]=t=>1===t?e:nj,this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return null!=(t=null==(e=nF[nB])?void 0:e.call(nF,1))?t:this._proxyLoggerProvider}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete nF[nB],this._proxyLoggerProvider=new nH}}).getInstance(),nZ=console.error.bind(console);function nW(e,t,r){let i=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:i,writable:!0,value:r})}let nq=(e,t,r)=>{if(!e||!e[t])return void nZ("no original function "+String(t)+" to wrap");if(!r){nZ("no wrapper function"),nZ(Error().stack);return}let i=e[t];if("function"!=typeof i||"function"!=typeof r)return void nZ("original object and wrapper must be functions");let n=r(i,t);return nW(n,"__original",i),nW(n,"__unwrap",()=>{e[t]===n&&nW(e,t,i)}),nW(n,"__wrapped",!0),nW(e,t,n),n},nX=(e,t,r)=>{if(e)Array.isArray(e)||(e=[e]);else{nZ("must provide one or more modules to patch"),nZ(Error().stack);return}t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{nq(e,t,r)})}):nZ("must provide one or more functions to wrap on modules")},nY=(e,t)=>{if(!e||!e[t]){nZ("no function to unwrap."),nZ(Error().stack);return}let r=e[t];r.__unwrap?r.__unwrap():nZ("no original to unwrap to -- has "+String(t)+" already been unwrapped?")},nQ=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{nZ("must provide one or more modules to patch"),nZ(Error().stack);return}t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{nY(e,t)})}):nZ("must provide one or more functions to unwrap on modules")};function nK(e){e&&e.logger&&("function"!=typeof e.logger?nZ("new logger isn't a function, not replacing"):nZ=e.logger)}nK.wrap=nq,nK.massWrap=nX,nK.unwrap=nY,nK.massUnwrap=nQ;
2class nJ{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(e,t,r){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(r),this._diag=w.createComponentLogger({namespace:e}),this._tracer=rG.getTracer(e,t),this._meter=ng.getMeter(e,t),this._logger=nG.getLogger(e,t),this._updateMetricInstruments()}_wrap=nq;_unwrap=nY;_massWrap=nX;_massUnwrap=nQ;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,r,i){if(e)try{e(r,i)}catch(e){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},e)}}}class n0 extends nJ{constructor(e,t,r){super(e,t,r),this._config.enabled&&this.enable()}}function n1(e,t){return"string"==typeof t?e===t:!!e.match(t)}let n2=performance;function n5(e){return[Math.trunc(e/1e3),Math.round(e%1e3*1e6)]}function n3(e){var t,r;let i;return t=n5(n2.timeOrigin),r=n5("number"==typeof e?e:n2.now()),(i=[t[0]+r[0],t[1]+r[1]])[1]>=1e9&&(i[1]-=1e9,i[0]+=1),i}function n4(e){var t;if(Array.isArray(t=e)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1])return e;if("number"==typeof e)if(e<n2.timeOrigin)return n3(e);else return n5(e);if(e instanceof Date)return n5(e.getTime());throw TypeError("Invalid input type")}function n8(e){return 1e9*e[0]+e[1]}function n6(e,t,r,i=!0){if(t in r&&"number"==typeof r[t]&&!(i&&0===r[t]))return e.addEvent(t,r[t])}function n7(e,t,r=!1,i,n){if(void 0===i&&(i=0!==t[t7.START_TIME]),r||(n6(e,t7.FETCH_START,t,i),n6(e,t7.DOMAIN_LOOKUP_START,t,i),n6(e,t7.DOMAIN_LOOKUP_END,t,i),n6(e,t7.CONNECT_START,t,i),n6(e,t7.SECURE_CONNECTION_START,t,i),n6(e,t7.CONNECT_END,t,i),n6(e,t7.REQUEST_START,t,i),n6(e,t7.RESPONSE_START,t,i),n6(e,t7.RESPONSE_END,t,i)),!n){let r=t[t7.ENCODED_BODY_SIZE];void 0!==r&&e.setAttribute("http.response_content_length",r);let i=t[t7.DECODED_BODY_SIZE];void 0!==i&&r!==i&&e.setAttribute("http.response_content_length_uncompressed",i)}}function n9(){return"u">typeof location?location.origin:void 0}function se(e){if("function"==typeof URL)return new URL(e,"u">typeof document?document.baseURI:"u">typeof location?location.href:void 0);let t=(r||(r=document.createElement("a")),r);return t.href=e,t}(tv=t7||(t7={})).CONNECT_END="connectEnd",tv.CONNECT_START="connectStart",tv.DECODED_BODY_SIZE="decodedBodySize",tv.DOM_COMPLETE="domComplete",tv.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",tv.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",tv.DOM_INTERACTIVE="domInteractive",tv.DOMAIN_LOOKUP_END="domainLookupEnd",tv.DOMAIN_LOOKUP_START="domainLookupStart",tv.ENCODED_BODY_SIZE="encodedBodySize",tv.FETCH_START="fetchStart",tv.LOAD_EVENT_END="loadEventEnd",tv.LOAD_EVENT_START="loadEventStart",tv.NAVIGATION_START="navigationStart",tv.REDIRECT_END="redirectEnd",tv.REDIRECT_START="redirectStart",tv.REQUEST_START="requestStart",tv.RESPONSE_END="responseEnd",tv.RESPONSE_START="responseStart",tv.SECURE_CONNECTION_START="secureConnectionStart",tv.START_TIME="startTime",tv.UNLOAD_EVENT_END="unloadEventEnd",tv.UNLOAD_EVENT_START="unloadEventStart",(tS=t9||(t9={})).COMPONENT="component",tS.HTTP_STATUS_TEXT="http.status_text";let st=w.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"}),sr=new TextEncoder;function si(e){return sr.encode(e).byteLength}let sn={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},ss={"https:":"443","http:":"80"},so="0.213.0",sa="u">typeof PerformanceObserver;class sl extends n0{component="fetch";version=so;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-fetch",so,e),this._semconvStability=function(e,t){let r=t6.OLD;for(let i of t?.split(",").map(e=>e.trim()).filter(e=>""!==e)??[])if(i.toLowerCase()===e+"/dup"){r=t6.DUPLICATE;break}else i.toLowerCase()===e&&(r=t6.STABLE);return r}("http",e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let r=this.tracer.startSpan("CORS Preflight",{startTime:t[t7.FETCH_START]},rG.setSpan(S.active(),e)),i=!(this._semconvStability&t6.OLD);n7(r,t,this.getConfig().ignoreNetworkEvents,void 0,i),r.end(t[t7.RESPONSE_END])}_addFinalSpanAttributes(e,t){let r=se(t.url);if(this._semconvStability&t6.OLD&&(e.setAttribute("http.status_code",t.status),null!=t.statusText&&e.setAttribute(t9.HTTP_STATUS_TEXT,t.statusText),e.setAttribute("http.host",r.host),e.setAttribute("http.scheme",r.protocol.replace(":","")),"u">typeof navigator&&e.setAttribute("http.user_agent",navigator.userAgent)),this._semconvStability&t6.STABLE){let i;e.setAttribute(V,t.status),e.setAttribute(j,r.hostname);let n=(i=Number(r.port||ss[r.protocol]))&&!isNaN(i)?i:void 0;n&&e.setAttribute($,n)}}_addHeaders(e,t){let r;if(("string"==typeof(r=this.getConfig().propagateTraceHeaderCorsUrls||[])||r instanceof RegExp)&&(r=[r]),!(se(t).origin===n9()||r.some(e=>n1(t,e)))){let e={};i3.inject(S.active(),e),Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy");return}if(e instanceof Request)i3.inject(S.active(),e.headers,{set:(e,t,r)=>e.set(t,"string"==typeof r?r:String(r))});else{let t=new Headers(e.headers);i3.inject(S.active(),t,{set:(e,t,r)=>e.set(t,"string"==typeof r?r:String(r))}),e.headers=t}}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(function(e,t){if(!t)return!1;for(let r of t)if(n1(e,r))return!0;return!1}(e,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let r="",n={};if(this._semconvStability&t6.OLD){let i=(t.method||"GET").toUpperCase();r=`HTTP ${i}`,n[t9.COMPONENT]=this.moduleName,n["http.method"]=i,n["http.url"]=e}if(this._semconvStability&t6.STABLE){var s;let o,a,l=t.method,c=(s=t.method||"GET",o=function(){if(void 0===i){let e;e&&e.length>0?(i={}
2,e.forEach(e=>{i[e]=!0})):i=sn}return i}(),(a=s.toUpperCase())in o?a:"_OTHER");r||(r=c),n[F]=c,c!==l&&(n[z]=l),n[W]=e}return this.tracer.startSpan(r,{kind:tQ.CLIENT,attributes:n})}_findResourceAndAddNetworkEvents(e,t,r){let i=t.entries;if(!i.length){if(!performance.getEntriesByType)return;i=performance.getEntriesByType("resource")}let n=function(e,t,r,i,n=new WeakSet,s){var o,a,l,c,u,h;let d,p,_,g=se(e),m=(o=e=g.toString(),a=t,l=r,c=i,u=n,h=s,d=n8(a),p=n8(l),(_=c.filter(e=>{let t=n8(n4(e[t7.FETCH_START])),r=n8(n4(e[t7.RESPONSE_END]));return e.initiatorType.toLowerCase()===(h||"xmlhttprequest")&&e.name===o&&t>=d&&r<=p})).length>0&&(_=_.filter(e=>!u.has(e))),_);if(0===m.length)return{mainRequest:void 0};if(1===m.length)return{mainRequest:m[0]};let f=m.slice().sort((e,t)=>{let r=e[t7.FETCH_START],i=t[t7.FETCH_START];return r>i?1:r<i?-1:0});if(g.origin===n9()||!(f.length>1))return{mainRequest:m[0]};{let e=f[0],t=function(e,t,r){let i,n=n8(r),s=n8(n4(t)),o=e[1],a=e.length;for(let t=1;t<a;t++){let r=e[t],a=n8(n4(r[t7.FETCH_START])),l=n-n8(n4(r[t7.RESPONSE_END]));a>=s&&(!i||l<i)&&(i=l,o=r)}return o}(f,e[t7.RESPONSE_END],r),i=e[t7.RESPONSE_END];return t[t7.FETCH_START]<i&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}}(t.spanUrl,t.startTime,r,i,this._usedResources,"fetch");if(n.mainRequest){let t=n.mainRequest;this._markResourceAsUsed(t);let r=n.corsPreFlightRequest;r&&(this._addChildSpan(e,r),this._markResourceAsUsed(r));let i=!(this._semconvStability&t6.OLD);n7(e,t,this.getConfig().ignoreNetworkEvents,void 0,i)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,r){let i=n5(Date.now()),n=n3();this._addFinalSpanAttributes(e,r),this._semconvStability&t6.STABLE&&r.status>=400&&(e.setStatus({code:tJ.ERROR}),e.setAttribute(M,String(r.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,n
2),this._tasksCount--,this._clearResources(),e.end(i)},300)}_patchConstructor(){return e=>{let t=this,r=new Set(["url","type","redirected"]);return function(...i){let n=this,s=se(i[0]instanceof Request?i[0].url:String(i[0])).href,o=i[0]instanceof Request?i[0]:i[1]||{},a=t._createSpan(s,o);if(!a)return e.apply(this,i);let l=t._prepareSpanData(s);function c(e,r){t._applyAttributesAfterFetch(e,o,r),t._endSpan(e,l,{status:r.status||0,statusText:r.message,url:s})}function u(e,r){t._applyAttributesAfterFetch(e,o,r),r.status>=200&&r.status<400?t._endSpan(e,l,r):t._endSpan(e,l,{status:r.status,statusText:r.statusText,url:s})}function h(e,t,i){let n=null;try{let t=i.clone().body;if(t){let s=t.getReader(),o=204===i.status||205===i.status||304===i.status?null:function(e,t){if(!e)return null;let r=e.getReader();return new ReadableStream({async pull(e){try{let{value:t,done:i}=await r.read();i?(r.releaseLock(),e.close()):e.enqueue(t)}catch(t){e.error(t),r.cancel(t).catch(e=>{});try{r.releaseLock()}catch{}}},cancel:e=>(t.cancel(e).catch(e=>{}),r.cancel(e))})}(i.body,s),a=new Response(o,{status:i.status,statusText:i.statusText,headers:i.headers});n=function e(t,i){return new Proxy(t,{get(t,n,s){if("string"==typeof n&&r.has(n))return Reflect.get(i,n);if("clone"===n)return function(){return e(t.clone(),i)};let o=Reflect.get(t,n,t);return"function"==typeof o?o.bind(t):o}})}(a,i);let l=()=>{s.read().then(({done:t})=>{t?u(e,i):l()},t=>{c(e,t)})};l()}else u(e,i)}finally{t(n??i)}}function d(e,t,r){try{c(e,r)}finally{t(r)}}return t.getConfig().measureRequestSize&&(function(...e){if(e[0]instanceof URL||"string"==typeof e[0]){let t=e[1];if(!t?.body)return Promise.resolve();if(!(t.body instanceof ReadableStream))return Promise.resolve(function(e){return"u">typeof Document&&e instanceof Document?new XMLSerializer().serializeToString(document).length:"string"==typeof e?si(e):e instanceof Blob?e.size:e instanceof FormData?function(e){let t=0;for(let[r,i]of e.entries())t+=r.length,i instanceof Blob?t+=i.size:t+=i.length;return t}(e):e instanceof URLSearchParams?si(e.toString()):void 0!==e.byteLength?e.byteLength:void st.warn("unknown body type")}(t.body));{let{body:e,length:r}=function(e){let t;if(!e.pipeThrough)return st.warn("Platform has ReadableStream but not pipeThrough!"),{body:e,length:Promise.resolve(void 0)};let r=0,i=new Promise(e=>{t=e}),n=new TransformStream({start(){},async transform(e,t){let i=await e;r+=i.byteLength,t.enqueue(e)},flush(){t(r)}});return{body:e.pipeThrough(n),length:i}}(t.body);return t.body=e,r}}{let t=e[0];return t?.body?t.clone().text().then(e=>si(e)):Promise.resolve()}})(...i).then(e=>{e&&(t._semconvStability&t6.OLD&&a.setAttribute("http.request_content_length_uncompressed",e),t._semconvStability&t6.STABLE&&a.setAttribute("http.request.body.size",e))}).catch(e=>{t._diag.warn("getFetchBodyLength",e)}),new Promise((r,i)=>S.with(rG.setSpan(S.active(),a),()=>(t._callRequestHook(a,o),t._addHeaders(o,s),t._tasksCount++,e.apply(n,o instanceof Request?[o]:[s,o]).then(h.bind(n,a,r),d.bind(n,a,i)))))}}}_applyAttributesAfterFetch(e,t,r){let i=this.getConfig().applyCustomAttributesOnSpan;i&&nU(()=>i(e,t,r),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)},!0)}_callRequestHook(e,t){let r=this.getConfig().requestHook;r&&nU(()=>r(e,t),e=>{e&&this._diag.error("requestHook",e)},!0)}_prepareSpanData(e){let t=n3(),r=[];if("function"!=typeof PerformanceObserver)return{entries:r,startTime:t,spanUrl:e};let i=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{"fetch"===t.initiatorType&&t.name===e&&r.push(t)})});return i.observe({entryTypes:["resource"]}),{entries:r,observer:i,startTime:t,spanUrl:e}}enable(){var e;sa?("function"==typeof(e=fetch)&&"function"==typeof e.__original&&"function"==typeof e.__unwrap&&!0===e.__wrapped&&(this._unwrap(globalThis,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(globalThis,"fetch",this._patchConstructor())):this._diag.warn("this instrumentation is intended for web usage only, it does not instrument server-side fetch()")}disable(){sa&&(this._unwrap(globalThis,"fetch"),this._usedResources=new WeakSet)}}function sc(e){return"function"==typeof e&&"function"==typeof e.__original&&"function"==typeof e.__unwrap&&!0===e.__wrapped}let su=Symbol.for("io.opentelemetry.js.api.logs"),sh=globalThis;class sd{emit(e){}}let sp=new sd,s_=new class{getLogger(e,t,r){return new sd}};
2class sg{constructor(e,t,r,i){this._provider=e,this.name=t,this.version=r,this.options=i}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):sp}}class sm{getLogger(e,t,r){var i;return null!=(i=this._getDelegateLogger(e,t,r))?i:new sg(this,e,t,r)}_getDelegate(){var e;return null!=(e=this._delegate)?e:s_}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,r){var i;return null==(i=this._delegate)?void 0:i.getLogger(e,t,r)}}let sf=(class e{constructor(){this._proxyLoggerProvider=new sm}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return sh[su]?this.getLoggerProvider():(sh[su]=t=>1===t?e:s_,this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return null!=(t=null==(e=sh[su])?void 0:e.call(sh,1))?t:this._proxyLoggerProvider}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete sh[su],this._proxyLoggerProvider=new sm}}).getInstance(),sT=console.error.bind(console);function sE(e,t,r){let i=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:i,writable:!0,value:r})}let sb=(e,t,r)=>{if(!e||!e[t])return void sT("no original function "+String(t)+" to wrap");if(!r){sT("no wrapper function"),sT(Error().stack);return}let i=e[t];if("function"!=typeof i||"function"!=typeof r)return void sT("original object and wrapper must be functions");let n=r(i,t);return sE(n,"__original",i),sE(n,"__unwrap",()=>{e[t]===n&&sE(e,t,i)}),sE(n,"__wrapped",!0),sE(e,t,n),n},sy=(e,t,r)=>{if(e)Array.isArray(e)||(e=[e]);else{sT("must provide one or more modules to patch"),sT(Error().stack);return}t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{sb(e,t,r)})}):sT("must provide one or more functions to wrap on modules")},sv=(e,t)=>{if(!e||!e[t]){sT("no function to unwrap."),sT(Error().stack);return}let r=e[t];r.__unwrap?r.__unwrap():sT("no original to unwrap to -- has "+String(t)+" already been unwrapped?")},sS=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{sT("must provide one or more modules to patch"),sT(Error().stack);return}t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{sv(e,t)})}):sT("must provide one or more functions to unwrap on modules")};function sw(e){e&&e.logger&&("function"!=typeof e.logger?sT("new logger isn't a function, not replacing"):sT=e.logger)}sw.wrap=sb,sw.massWrap=sy,sw.unwrap=sv,sw.massUnwrap=sS;class sA{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(e,t,r){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(r),this._diag=w.createComponentLogger({namespace:e}),this._tracer=rG.getTracer(e,t),this._meter=ng.getMeter(e,t),this._logger=sf.getLogger(e,t),this._updateMetricInstruments()}_wrap=sb;_unwrap=sv;_massWrap=sy;_massUnwrap=sS;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,r,i){if(e)try{e(r,i)}catch(e){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},e)}}}class sL extends sA{constructor(e,t,r){super(e,t,r),this._config.enabled&&this.enable()}}(tw=re||(re={})).EVENT_TYPE="event_type",tw.TARGET_ELEMENT="target_element",tw.TARGET_XPATH="target_xpath",tw.HTTP_URL="http.url";let sC="0.57.0",sO=["click"];function sR(){return!1}class sk extends sL{version=sC;moduleName="user-interaction";_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(e={}){super("@opentelemetry/instrumentation-user-interaction",sC,e),this._eventNames=new Set(e?.eventNames??sO),this._shouldPreventSpanCreation="function"==typeof e?.shouldPreventSpanCreation?e.shouldPreventSpanCreation:sR}init(){}_checkForTimeout(e,t){let r=this._spansData.get(t);r&&("setTimeout"===e.source?r.hrTimeLastTimeout=eR():"Promise.then"!==e.source&&"setTimeout"!==e.source&&(r.hrTimeLastTimeout=void 0))}_allowEventName(e){return this._eventNames.has(e)}_createSpan(e,t,r){if(!(e instanceof HTMLElement)||!e.getAttribute||e.hasAttribute("disabled")||!this._allowEventName(t))return;
2let i=function e(t,r){if(t.nodeType===Node.DOCUMENT_NODE)return"/";let i=function(e,t){let r=e.nodeType,i=function(e){if(!e.parentNode)return 0;let t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);let r=Array.from(e.parentNode.childNodes);return(r=r.filter(r=>{let i=r.localName;return t.indexOf(r.nodeType)>=0&&i===e.localName})).length>=1?r.indexOf(e)+1:0}(e),n="";if(r===Node.ELEMENT_NODE){let r=e.getAttribute("id");if(t&&r)return`//*[@id="${r}"]`;n=e.localName}else if(r===Node.TEXT_NODE||r===Node.CDATA_SECTION_NODE)n="text()";else{if(r!==Node.COMMENT_NODE)return"";n="comment()"}return n&&i>1?`/${n}[${i}]`:`/${n}`}(t,r);if(r&&i.indexOf("@id")>0)return i;let n="";return t.parentNode&&(n+=e(t.parentNode,r)),n+=i}(e,!0);try{let n=this.tracer.startSpan(t,{attributes:{[re.EVENT_TYPE]:t,[re.TARGET_ELEMENT]:e.tagName,[re.TARGET_XPATH]:i,[re.HTTP_URL]:window.location.href}},r?rG.setSpan(S.active(),r):void 0);if(!0===this._shouldPreventSpanCreation(t,e,n))return;return this._spansData.set(n,{taskCount:0}),n}catch(e){this._diag.error("failed to start create new user interaction span",e)}}_decrementTask(e){let t=this._spansData.get(e);t&&(t.taskCount--,0===t.taskCount&&this._tryToEndSpan(e,t.hrTimeLastTimeout))}_getCurrentSpan(e){let t=e.get("OT_ZONE_CONTEXT");return t?rG.getSpan(t):t}_incrementTask(e){let t=this._spansData.get(e);t&&t.taskCount++}addPatchedListener(e,t,r,i){let n=this._wrappedListeners.get(r);n||(n=new Map,this._wrappedListeners.set(r,n));let s=n.get(t);return s||(s=new Map,n.set(t,s)),!s.has(e)&&(s.set(e,i),!0)}removePatchedListener(e,t,r){let i=this._wrappedListeners.get(r);if(!i)return;let n=i.get(t);if(!n)return;let s=n.get(e);return s&&(n.delete(e),0===n.size&&(i.delete(t),0===i.size&&this._wrappedListeners.delete(r))),s}_invokeListener(e,t,r){return"function"==typeof e?e.apply(t,r):e.handleEvent(r[0])}_patchAddEventListener(){let e=this;return t=>function(r,i,n){if(!i)return t.call(this,r,i,n);let s=n&&"object"==typeof n&&n.once,o=function(...t){let n,o=t[0],a=o?.target;o&&(n=e._eventsSpanMap.get(o)),s&&e.removePatchedListener(this,r,i);let l=e._createSpan(a,r,n);return l?(o&&e._eventsSpanMap.set(o,l),S.with(rG.setSpan(S.active(),l),()=>{let r=e._invokeListener(i,this,t);return l.end(),r})):e._invokeListener(i,this,t)};if(e.addPatchedListener(this,r,i,o))return t.call(this,r,o,n)}}_patchRemoveEventListener(){let e=this;return t=>function(r,i,n){let s=e.removePatchedListener(this,r,i);return s?t.call(this,r,s,n):t.call(this,r,i,n)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._unpatchHistoryApi(),this._wrap(history,"replaceState",this._patchHistoryMethod()),this._wrap(history,"pushState",this._patchHistoryMethod()),this._wrap(history,"back",this._patchHistoryMethod()),this._wrap(history,"forward",this._patchHistoryMethod()),this._wrap(history,"go",this._patchHistoryMethod())}_patchHistoryMethod(){let e=this;return t=>function(...r){let i=`${location.pathname}${location.hash}${location.search}`,n=t.apply(this,r),s=`${location.pathname}${location.hash}${location.search}`;return i!==s&&e._updateInteractionName(s),n}}_unpatchHistoryApi(){sc(history.replaceState)&&this._unwrap(history,"replaceState"),sc(history.pushState)&&this._unwrap(history,"pushState"),sc(history.back)&&this._unwrap(history,"back"),sc(history.forward)&&this._unwrap(history,"forward"),sc(history.go)&&this._unwrap(history,"go")}_updateInteractionName(e){let t=rG.getSpan(S.active());t&&"function"==typeof t.updateName&&t.updateName(`Navigation: ${e}`)}_patchZoneCancelTask(){let e=this;return t=>function(r){let i=Zone.current,n=e._getCurrentSpan(i);return n&&e._shouldCountTask(r,i)&&e._decrementTask(n),t.call(this,r)}}_patchZoneScheduleTask(){let e=this;return t=>function(r){let i=Zone.current,n=e._getCurrentSpan(i);return n&&e._shouldCountTask(r,i)&&(e._incrementTask(n),e._checkForTimeout(r,n)),t.call(this,r)}}_patchZoneRunTask(){let e=this;return t=>function(r,i,n){let s,o=Array.isArray(n)&&n[0]instanceof Event?n[0]:void 0,a=o?.target;if(a){if(s=e._createSpan(a,r.eventName))return e._incrementTask(s),this.run(()=>{try{return S.with(rG.setSpan(S.active(),s),()=>{let e=Zone.current;return r._zone=e,t.call(e,r,i,n)})}finally{e._decrementTask(s)}})}else s=e._getCurrentSpan(this);try{return t.call(this,r,i,n)}finally{s&&e._shouldCountTask(r,this)&&e._decrementTask(s)}}}_shouldCountTask(e,t){if(e._zone&&(t=e._zone),!t||!e.data||e.data.isPeriodic)return!1;let r=this._getCurrentSpan(t);return!!r&&!!this._spansData.get(r)&&("macroTask"===e.type||"microTask"===e.type)}_tryToEndSpan(e,t){e&&this._spansData.get(e)&&(e.end(t),this._spansData.delete(e))}enable(){let e=this._getZoneWithPrototype();this._diag.debug("applying patch to",this.moduleName,this.version,"zone:",!!e),e?(sc(e.prototype.runTask)&&(this._unwrap(e.prototype,"runTask"),this._diag.debug("removing previous patch from method runTask")),sc(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,"scheduleTask"),this._diag.debug("removing previous patch from method scheduleTask")),sc(e.prototype.cancelTask)&&(this._unwrap(e.prototype,"cancelTask"),this._diag.debug("removing previous patch from method cancelTask")),this._zonePatched=!0,this._wrap(e.prototype,"runTask",this._patchZoneRunTask()),this._wrap(e.prototype,"scheduleTask",this._patchZoneSc
2heduleTask()),this._wrap(e.prototype,"cancelTask",this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach(e=>{sc(e.addEventListener)&&(this._unwrap(e,"addEventListener"),this._diag.debug("removing previous patch from method addEventListener")),sc(e.removeEventListener)&&(this._unwrap(e,"removeEventListener"),this._diag.debug("removing previous patch from method removeEventListener")),this._wrap(e,"addEventListener",this._patchAddEventListener()),this._wrap(e,"removeEventListener",this._patchRemoveEventListener())})),this._patchHistoryApi()}disable(){let e=this._getZoneWithPrototype();this._diag.debug("removing patch from",this.moduleName,this.version,"zone:",!!e),e&&this._zonePatched?(sc(e.prototype.runTask)&&this._unwrap(e.prototype,"runTask"),sc(e.prototype.scheduleTask)&&this._unwrap(e.prototype,"scheduleTask"),sc(e.prototype.cancelTask)&&this._unwrap(e.prototype,"cancelTask")):this._getPatchableEventTargets().forEach(e=>{sc(e.addEventListener)&&this._unwrap(e,"addEventListener"),sc(e.removeEventListener)&&this._unwrap(e,"removeEventListener")}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}}function sx(e){return"function"==typeof e&&"function"==typeof e.__original&&"function"==typeof e.__unwrap&&!0===e.__wrapped}(tA=rt||(rt={}))[tA.STABLE=1]="STABLE",tA[tA.OLD=2]="OLD",tA[tA.DUPLICATE=3]="DUPLICATE";let sN=Symbol.for("io.opentelemetry.js.api.logs"),sP=globalThis;class sD{emit(e){}}let sM=new sD,sI=new class{getLogger(e,t,r){return new sD}};
2class sU{constructor(e,t,r,i){this._provider=e,this.name=t,this.version=r,this.options=i}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):sM}}class sB{getLogger(e,t,r){var i;return null!=(i=this._getDelegateLogger(e,t,r))?i:new sU(this,e,t,r)}_getDelegate(){var e;return null!=(e=this._delegate)?e:sI}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,r){var i;return null==(i=this._delegate)?void 0:i.getLogger(e,t,r)}}let sF=(class e{constructor(){this._proxyLoggerProvider=new sB}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return sP[sN]?this.getLoggerProvider():(sP[sN]=t=>1===t?e:sI,this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,t;return null!=(t=null==(e=sP[sN])?void 0:e.call(sP,1))?t:this._proxyLoggerProvider}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete sP[sN],this._proxyLoggerProvider=new sB}}).getInstance(),sz=console.error.bind(console);function sV(e,t,r){let i=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:i,writable:!0,value:r})}let sj=(e,t,r)=>{if(!e||!e[t])return void sz("no original function "+String(t)+" to wrap");if(!r){sz("no wrapper function"),sz(Error().stack);return}let i=e[t];if("function"!=typeof i||"function"!=typeof r)return void sz("original object and wrapper must be functions");let n=r(i,t);return sV(n,"__original",i),sV(n,"__unwrap",()=>{e[t]===n&&sV(e,t,i)}),sV(n,"__wrapped",!0),sV(e,t,n),n},s$=(e,t,r)=>{if(e)Array.isArray(e)||(e=[e]);else{sz("must provide one or more modules to patch"),sz(Error().stack);return}t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{sj(e,t,r)})}):sz("must provide one or more functions to wrap on modules")},sH=(e,t)=>{if(!e||!e[t]){sz("no function to unwrap."),sz(Error().stack);return}let r=e[t];r.__unwrap?r.__unwrap():sz("no original to unwrap to -- has "+String(t)+" already been unwrapped?")},sG=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{sz("must provide one or more modules to patch"),sz(Error().stack);return}t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{sH(e,t)})}):sz("must provide one or more functions to unwrap on modules")};function sZ(e){e&&e.logger&&("function"!=typeof e.logger?sz("new logger isn't a function, not replacing"):sz=e.logger)}sZ.wrap=sj,sZ.massWrap=s$,sZ.unwrap=sH,sZ.massUnwrap=sG;class sW{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(e,t,r){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(r),this._diag=w.createComponentLogger({namespace:e}),this._tracer=rG.getTracer(e,t),this._meter=ng.getMeter(e,t),this._logger=sF.getLogger(e,t),this._updateMetricInstruments()}_wrap=sj;_unwrap=sH;_massWrap=s$;_massUnwrap=sG;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,r,i){if(e)try{e(r,i)}catch(e){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},e)}}}class sq extends sW{constructor(e,t,r){super(e,t,r),this._config.enabled&&this.enable()}}let sX=performance;function sY(e){return[Math.trunc(e/1e3),Math.round(e%1e3*1e6)]}function sQ(e){var t,r;let i;return t=sY(sX.timeOrigin),r=sY("number"==typeof e?e:sX.now()),(i=[t[0]+r[0],t[1]+r[1]])[1]>=1e9&&(i[1]-=1e9,i[0]+=1),i}function sK(e){var t;if(Array.isArray(t=e)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1])return e;if("number"==typeof e)if(e<sX.timeOrigin)return sQ(e);else return sY(e);if(e instanceof Date)return sY(e.getTime());throw TypeError("Invalid input type")}function sJ(e){return 1e9*e[0]+e[1]}function s0(e,t){return"string"==typeof t?e===t:!!e.match(t)}function s1(e,t,r,i=!0){if(t in r&&"number"==typeof r[t]&&!(i&&0===r[t]))return e.addEvent(t,r[t])}function s2(e,t,r=!1,i,n){if(void 0===i&&(i=0!==t[rr.START_TIME]),r||(s1(e,rr.FETCH_START,t,i),s1(e,rr.DOMAIN_LOOKUP_START,t,i),s1(e,rr.DOMAIN_LOOKUP_END,t,i),s1(e,rr.CONNECT_START,t,i),s1(e,rr.SECURE_CONNECTION_START,t,i),s1(e,rr.CONNECT_END,t,i),s1(e,rr.REQUEST_START,t,i),s1(e,rr.RESPONSE_START,t,i),s1(e,rr.RESPONSE_END,t,i)),!n){let r=t[rr.ENCODED_BODY_SIZE];void 0!==r&&e.setAttribute("http.response_content_length",r);let i=t[rr.DECODED_BODY_SIZE];void 0!==i&&r!==i&&e.setAttribute("http.response_content_length_uncompressed",i)}}function s5(){return"u">typeof location?location.origin:void 0}function s3(e){if("function"==typeof URL)return new URL(e,"u">typeof document?document.baseURI:"u">typeof location?location.href:void 0);let t=(n||(n=document.createElement("a")),n);return t.href=e,t}(tL=rr||(rr={})).CONNECT_END="connectEnd",tL.CONNECT_START="connectStart",tL.DECODED_BODY_SIZE="decodedBodySize",tL.DOM_COMPLETE="domComplete",tL.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",tL.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",tL.DOM_INTERACTIVE="domInteractive",tL.DOMAIN_LOOKUP_END="domainLookupEnd",tL.DOMAIN_LOOKUP_START="domainLookupStart",tL.ENCODED_BODY_SIZE="encodedBodySize",tL.FETCH_START="fetchStart",tL.LOAD_
2EVENT_END="loadEventEnd",tL.LOAD_EVENT_START="loadEventStart",tL.NAVIGATION_START="navigationStart",tL.REDIRECT_END="redirectEnd",tL.REDIRECT_START="redirectStart",tL.REQUEST_START="requestStart",tL.RESPONSE_END="responseEnd",tL.RESPONSE_START="responseStart",tL.SECURE_CONNECTION_START="secureConnectionStart",tL.START_TIME="startTime",tL.UNLOAD_EVENT_END="unloadEventEnd",tL.UNLOAD_EVENT_START="unloadEventStart",(tC=ri||(ri={})).METHOD_OPEN="open",tC.METHOD_SEND="send",tC.EVENT_ABORT="abort",tC.EVENT_ERROR="error",tC.EVENT_LOAD="loaded",tC.EVENT_TIMEOUT="timeout";let s4=w.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"}),s8=new TextEncoder;function s6(e){return s8.encode(e).byteLength}let s7={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0},s9={"https:":"443","http:":"80"},oe="0.213.0";(rn||(rn={})).HTTP_STATUS_TEXT="http.status_text";class ot extends sq{component="xml-http-request";version=oe;moduleName=this.component;_tasksCount=0;_xhrMem=new WeakMap;_usedResources=new WeakSet;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-xml-http-request",oe,e),this._semconvStability=function(e,t){let r=rt.OLD;for(let i of t?.split(",").map(e=>e.trim()).filter(e=>""!==e)??[])if(i.toLowerCase()===e+"/dup"){r=rt.DUPLICATE;break}else i.toLowerCase()===e&&(r=rt.STABLE);return r}("http",e?.semconvStabilityOptIn)}init(){}_addHeaders(e,t){var r;let i;if(r=s3(t).href,("string"==typeof(i=this.getConfig().propagateTraceHeaderCorsUrls||[])||i instanceof RegExp)&&(i=[i]),!(s3(r).origin===s5()||i.some(e=>s0(r,e)))){let e={};i3.inject(S.active(),e),Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy");return}let n={};i3.inject(S.active(),n),Object.keys(n).forEach(t=>{e.setRequestHeader(t,String(n[t]))})}_addChildSpan(e,t){S.with(rG.setSpan(S.active(),e),()=>{let e=this.tracer.startSpan("CORS Preflight",{startTime:t[rr.FETCH_START]}),r=!(this._semconvStability&rt.OLD);s2(e,t,this.getConfig().ignoreNetworkEvents,void 0,r),e.end(t[rr.RESPONSE_END])})}_addFinalSpanAttributes(e,t,r){if(this._semconvStability&rt.OLD){if(void 0!==t.status&&e.setAttribute("http.status_code",t.status),void 0!==t.statusText&&e.setAttribute(rn.HTTP_STATUS_TEXT,t.statusText),"string"==typeof r){let t=s3(r);e.setAttribute("http.host",t.host),e.setAttribute("http.scheme",t.protocol.replace(":",""))}e.setAttribute("http.user_agent",navigator.userAgent)}this._semconvStability&rt.STABLE&&t.status&&e.setAttribute(V,t.status)}_applyAttributesAfterXHR(e,t){let r=this.getConfig().applyCustomAttributesOnSpan;"function"==typeof r&&function(e,t,r){let i,n;try{n=e()}catch(e){i=e}finally{if(t(i,n),i&&!r)throw i}}(()=>r(e,t),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)},!0)}_addResourceObserver(e,t){let r=this._xhrMem.get(e);r&&"function"==typeof PerformanceObserver&&"function"==typeof PerformanceResourceTiming&&(r.createdResources={observer:new PerformanceObserver(e=>{let i=e.getEntries(),n=s3(t);i.forEach(e=>{"xmlhttprequest"===e.initiatorType&&e.name===n.href&&r.createdResources&&r.createdResources.entries.push(e)})}),entries:[]},r.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(sX.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,r,i,n){if(!r||!i||!n||!e.createdResources)return;let s=e.createdResources.entries;s&&s.length||(s=sX.getEntriesByType("resource"));let o=function(e,t,r,i,n=new WeakSet){var s,o,a,l,c,u;let h,d,p,_=s3(e),g=(s=e=_.toString(),o=t,a=r,l=i,c=n,u=void 0,h=sJ(o),d=sJ(a),(p=l.filter(e=>{let t=sJ(sK(e[rr.FETCH_START])),r=sJ(sK(e[rr.RESPONSE_END]));return e.initiatorType.toLowerCase()===(u||"xmlhttprequest")&&e.name===s&&t>=h&&r<=d})).length>0&&(p=p.filter(e=>!c.has(e))),p);if(0===g.length)return{mainRequest:void 0};if(1===g.length)return{mainRequest:g[0]};let m=g.slice().sort((e,t)=>{let r=e[rr.FETCH_START],i=t[rr.FETCH_START];return r>i?1:r<i?-1:0});if(_.origin===s5()||!(m.length>1))return{mainRequest:g[0]};{let e=m[0],t=function(e,t,r){let i,n=sJ(r),s=sJ(sK(t)),o=e[1],a=e.length;for(let t=1;t<a;t++){let r=e[t],a=sJ(sK(r[rr.FETCH_START])),l=n-sJ(sK(r[rr.RESPONSE_END]));a>=s&&(!i||l<i)&&(i=l,o=r)}return o}(m,e[rr.RESPONSE_END],r),i=e[rr.RESPONSE_END];return t[rr.FETCH_START]<i&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}}(s3(r).href,i,n,s,this._usedResources);if(o.mainRequest){let e=o.mainRequest;this._markResourceAsUsed(e);let r=o.corsPreFlightRequest;r&&(this._addChildSpan(t,r),this._markResourceAsUsed(r));let i=!(this._semconvStability&rt.OLD);s2(t,e,this.getConfig().ignoreNetworkEvents,void 0,i)}}_cleanPreviousSpanInformation(e){let t=this._xhrMem.get(e);if(t){let r=t.callbackToRemoveEvents;r&&r(),this._xhrMem.delete(e)}}_createSpan(e,t,r){if(function(e,t){if(!t)return!1;for(let r of t)if(s0(e,r))return!0;return!1}(t,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let i="",n=s3(t),o={};if(this._semconvStability&rt.OLD&&(i=r.toUpperCase(),o["http.method"]=r,o["http.url"]=n.toString()),this._semconvStability&rt.STABLE){let e,t,a,l=(e=function(){if(void 0===s){let e;e&&e.length>0?(s={}
2,e.forEach(e=>{s[e]=!0})):s=s7}return s}(),(t=r.toUpperCase())in e?t:"_OTHER");i||(i=l),o[F]=l,l!==r&&(o[z]=r),o[W]=n.toString(),o[j]=n.hostname;let c=(a=Number(n.port||s9[n.protocol]))&&!isNaN(a)?a:void 0;c&&(o[$]=c)}let a=this.tracer.startSpan(i,{kind:tQ.CLIENT,attributes:o});return a.addEvent(ri.METHOD_OPEN),this._cleanPreviousSpanInformation(e),this._xhrMem.set(e,{span:a,spanUrl:t}),a}_markResourceAsUsed(e){this._usedResources.add(e)}_patchOpen(){return e=>{let t=this;return function(...r){let i=r[0],n=r[1];return t._createSpan(this,n,i),e.apply(this,r)}}}_patchSend(){let e=this;function t(t,r,i,n){let s=e._xhrMem.get(r);if(!s)return;if(s.status=r.status,s.statusText=r.statusText,e._xhrMem.delete(r),s.span){let t=s.span;e._applyAttributesAfterXHR(t,r),e._semconvStability&rt.STABLE&&(i?n&&(t.setStatus({code:tJ.ERROR,message:n}),t.setAttribute(M,n)):s.status&&s.status>=400&&(t.setStatus({code:tJ.ERROR}),t.setAttribute(M,String(s.status))))}let o=sQ(),a=Date.now();setTimeout(()=>{!function(t,r,i,n){let s=r.callbackToRemoveEvents;"function"==typeof s&&s();let{span:o,spanUrl:a,sendStartTime:l}=r;o&&(e._findResourceAndAddNetworkEvents(r,o,a,l,i),o.addEvent(t,n),e._addFinalSpanAttributes(o,r,a),o.end(n),e._tasksCount--),e._clearResources()}(t,s,o,a)},300)}function r(){t(ri.EVENT_ERROR,this,!0,"error")}function i(){t(ri.EVENT_ABORT,this,!1)}function n(){t(ri.EVENT_TIMEOUT,this,!0,"timeout")}function s(){this.status<299?t(ri.EVENT_LOAD,this,!1):t(ri.EVENT_ERROR,this,!1)}return t=>function(...o){let a=e._xhrMem.get(this);if(!a)return t.apply(this,o);let l=a.span,c=a.spanUrl;if(l&&c){if(e.getConfig().measureRequestSize&&o?.[0]){var u,h;let t=(h=u=o[0],"u">typeof Document&&h instanceof Document)?new XMLSerializer().serializeToString(document).length:"string"==typeof u?s6(u):u instanceof Blob?u.size:u instanceof FormData?function(e){let t=0;for(let[r,i]of e.entries())t+=r.length,i instanceof Blob?t+=i.size:t+=i.length;return t}(u):u instanceof URLSearchParams?s6(u.toString()):void 0!==u.byteLength?u.byteLength:void s4.warn("unknown body type");void 0!==t&&(e._semconvStability&rt.OLD&&l.setAttribute("http.request_content_length_uncompressed",t),e._semconvStability&rt.STABLE&&l.setAttribute("http.request.body.size",t))}S.with(rG.setSpan(S.active(),l),()=>{e._tasksCount++,a.sendStartTime=sQ(),l.addEvent(ri.METHOD_SEND),this.addEventListener("abort",i),this.addEventListener("error",r),this.addEventListener("load",s),this.addEventListener("timeout",n),a.callbackToRemoveEvents=()=>{let t;this.removeEventListener("abort",i),this.removeEventListener("error",r),this.removeEventListener("load",s),this.removeEventListener("timeout",n),(t=e._xhrMem.get(this))&&(t.callbackToRemoveEvents=void 0),a.createdResources&&a.createdResources.observer.disconnect()},e._addHeaders(this,c),e._addResourceObserver(this,c)})}return t.apply(this,o)}}enable(){this._diag.debug("applying patch to",this.moduleName,this.version),sx(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),sx(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}}let or={"@opentelemetry/instrumentation-document-load":nI,"@opentelemetry/instrumentation-fetch":sl,"@opentelemetry/instrumentation-user-interaction":sk,"@opentelemetry/instrumentation-xml-http-request":ot};e.i(56749);let oi="OT_ZONE_CONTEXT";class on{_enabled=!1;_bindFunction(e,t){let r=this,i=function(...i){return r.with(e,()=>t.apply(this,i))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),i}_bindListener(e,t){return void 0!==t.__ot_listeners||(t.__ot_listeners={},"function"==typeof t.addEventListener&&(t.addEventListener=this._patchAddEventListener(t,t.addEventListener,e)),"function"==typeof t.removeEventListener&&(t.removeEventListener=this._patchRemoveEventListener(t,t.removeEventListener))),t}_createZone(e,t){return Zone.current.fork({name:e,properties:{[oi]:t},onCancelTask:(e,t,r,i)=>"notScheduled"===i.state||"running"===i.state?i:e.cancelTask(r,i)})}_patchAddEventListener(e,t,r){let i=this;return function(n,s,o){void 0===e.__ot_listeners&&(e.__ot_listeners={});let a=e.__ot_listeners[n];void 0===a&&(a=new WeakMap,e.__ot_listeners[n]=a);let l=i.bind(r,s);return a.set(s,l),t.call(this,n,l,o)}}_patchRemoveEventListener(e,t){return function(r,i){if(void 0===e.__ot_listeners||void 0===e.__ot_listeners[r])return t.call(this,r,i);let n=e.__ot_listeners[r],s=n.get(i);return n.delete(i),t.call(this,r,s||i)}}active(){return this._enabled&&Zone.current&&Zone.current.get(oi)||a}bind(e,t){return"function"==typeof t?this._bindFunction(e,t):("object"==typeof t&&null!==t&&"addEventListener"in t&&"function"==typeof t.addEventListener&&"removeEventListener"in t&&"function"==typeof t.removeEventListener&&this._bindListener(e,t),t)}disable(){return this._enabled=!1,this}enable(){return this._enabled=!0,this}with(e,t,r,...i){let n="otel:with";return t.name&&(n+=`:${t.name}`),this._createZone(n,e).run(t,r,i)}}class os{_registeredViews=[];addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(r=>this._matchInstrument(r.instrumentSelector,e)&&this._matchMeter(r.meterSelector,t))}_matchInstrument(e,t){return(void 0===e.getType()||t.type===e.getType())&&e.getNameFilter().match(t.name)&&e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&&(void 0===t.version||e.getVersionFilter().match(t.version))&&(void 0===t.schemaUrl||e.getSchemaUrlFilter().match(t.schemaUrl))}}function oo(e,t,r){return oa.test(e)||w.warn(`Invalid metric name: "${e}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:e,type:t,description:r?.description??"",unit:r?.unit??"",valueType:r?.valueType??tq.DOUBLE,advice:r?.advice??{}}}let oa=/^[a-z][a-z0-9_.\-/]{0,254}$/i;class ol{_writableMetricStorage;_descriptor;constructor(e,t){this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},r=S.active()){"number"!=typeof e?w.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`):(this._descriptor.valueType!==tq.INT||Number.isInteger(e)||(w.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),Number.isInteger(e=Math.trunc(e))))&&this._writableMetricStorage.record(e,t,r,eO(Date.now()))}}class oc extends ol{add(e,t,r){this._record(e,t,r)}}class ou extends ol{add(e,t,r){e<0?w.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`):this._record(e,t,r)}}class oh extends ol{record(e,t,r){this._record(e,t,r)}}class od extends ol{record(e,t,r){e<0?w.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`):this._record(e,t,r)}}class op{_metricStorages;_descriptor;_observableRegistry;constructor(e,t,r){this._descriptor=e,this._metricStorages=t,this._observableRegistry=r}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}}class o_ extends op{}class og extends op{}class om extends op{}function of(e){return e instanceof op}class oT{_meterSharedState;constructor(e){this._meterSharedState=e}createGauge(e,t){let r=oo(e,t$.GAUGE,t);return new oh(this._meterSharedState.registerMetricStorage(r),r)}createHistogram(e,t){let r=oo(e,t$.HISTOGRAM,t);return new od(this._meterSharedState.registerMetricStorage(r),r)}createCounter(e,t){let r=oo(e,t$.COUNTER,t);return new ou(this._meterSharedState.registerMetricStorage(r),r)}createUpDownCounter(e,t){let r=oo(e,t$.UP_DOWN_COUNTER,t);return new oc(this._meterSharedState.registerMetricStorage(r),r)}createObservableGauge(e,t){let r=oo(e,t$.OBSERVABLE_GAUGE,t),i=this._meterSharedState.registerAsyncMetricStorage(r);return new og(r,i,this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let r=oo(e,t$.OBSERVABLE_COUNTER,t),i=this._meterSharedState.registerAsyncMetricStorage(r);return new o_(r,i,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let r=oo(e,t$.OBSERVABLE_UP_DOWN_COUNTER,t),i=this._meterSharedState.registerAsyncMetricStorage(r);return new om(r,i,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}}class oE{_instrumentDescriptor;constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=oo(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}class ob{_valueMap=new Map;_keyMap=new Map;_hash;constructor(e){this._hash=e}get(e,t){return t??=this._hash(e),this._valueMap.get(t)}getOrDefault(e,t){let r=this._hash(e);if(this._valueMap.has(r))return this._valueMap.get(r);let i=t();return this._keyMap.has(r)||this._keyMap.set(r,e),this._valueMap.set(r,i),i}set(e,t,r){r??=this._hash(e),this._keyMap.has(r)||this._keyMap.set(r,e),this._valueMap.set(r,t)}has(e,t){return t??=this._hash(e),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;!0!==t.done;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;!0!==t.done;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}}class oy extends ob{constructor(){super(eU)}}class ov{_activeCollectionStorage=new oy;_cumulativeMemoStorage=new oy;_cardinalityLimit;_overflowAttributes={"otel.metric.overflow":!0};_overflowHashCode;_aggregator;constructor(e,t){this._aggregator=e,this._cardinalityLimit=(t??2e3)-1,this._overflowHashCode=eU(this._overflowAttributes)}record(e,t,r,i){let n=this._activeCollectionStorage.get(t);
2if(!n){if(this._activeCollectionStorage.size>=this._cardinalityLimit){let t=this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(i));t?.record(e);return}n=this._aggregator.createAccumulation(i),this._activeCollectionStorage.set(t,n)}n?.record(e)}batchCumulate(e,t){for(let[r,i,n]of e.entries()){let e=r,s=n,o=this._aggregator.createAccumulation(t);o?.record(i);let a=o;if(this._cumulativeMemoStorage.has(e,s)){let t=this._cumulativeMemoStorage.get(e,s);a=this._aggregator.diff(t,o)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(e=this._overflowAttributes,s=this._overflowHashCode,this._cumulativeMemoStorage.has(e,s))){let t=this._cumulativeMemoStorage.get(e,s);a=this._aggregator.diff(t,o)}if(this._activeCollectionStorage.has(e,s)){let t=this._activeCollectionStorage.get(e,s);a=this._aggregator.merge(t,a)}this._cumulativeMemoStorage.set(e,o,s),this._activeCollectionStorage.set(e,a,s)}}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new oy,e}}class oS{_aggregator;_unreportedAccumulations=new Map;_reportHistory=new Map;constructor(e,t){this._aggregator=e,t.forEach(e=>{this._unreportedAccumulations.set(e,[])})}buildMetrics(e,t,r,i){let n;this._stashAccumulations(r);let s=this._getMergedUnreportedAccumulations(e),o=s;if(this._reportHistory.has(e)){let t=this._reportHistory.get(e),r=t.collectionTime;o=(n=t.aggregationTemporality)===tj.CUMULATIVE?oS.merge(t.accumulations,s,this._aggregator):oS.calibrateStartTime(t.accumulations,s,r)}else n=e.selectAggregationTemporality(t.type);this._reportHistory.set(e,{accumulations:o,collectionTime:i,aggregationTemporality:n});let a=Array.from(o.entries());if(0!==a.length)return this._aggregator.toMetricData(t,n,a,i)}_stashAccumulations(e){for(let t of this._unreportedAccumulations.keys()){let r=this._unreportedAccumulations.get(t);void 0===r&&(r=[],this._unreportedAccumulations.set(t,r)),r.push(e)}}_getMergedUnreportedAccumulations(e){let t=new oy,r=this._unreportedAccumulations.get(e);if(this._unreportedAccumulations.set(e,[]),void 0===r)return t;for(let e of r)t=oS.merge(t,e,this._aggregator);return t}static merge(e,t,r){let i=t.entries(),n=i.next();for(;!0!==n.done;){let[t,s,o]=n.value;if(e.has(t,o)){let i=e.get(t,o),n=r.merge(i,s);e.set(t,n,o)}else e.set(t,s,o);n=i.next()}return e}static calibrateStartTime(e,t,r){for(let[i,n]of e.keys()){let e=t.get(i,n);e?.setStartTime(r)}return t}}class ow extends oE{_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(e,t,r,i,n){super(e),this._aggregationCardinalityLimit=n,this._deltaMetricStorage=new ov(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new oS(t,i),this._attributesProcessor=r}record(e,t){let r=new oy;for(let[t,i]of e.entries())r.set(this._attributesProcessor.process(t),i);this._deltaMetricStorage.batchCumulate(r,t)}collect(e,t){let r=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,r,t)}}function oA(e,t){let r="";return e.unit!==t.unit&&(r+=`	- Unit '${e.unit}' does not match '${t.unit}'
3`),e.type!==t.type&&(r+=`	- Type '${e.type}' does not match '${t.type}'
4`),e.valueType!==t.valueType&&(r+=`	- Value Type '${e.valueType}' does not match '${t.valueType}'
5`),e.description!==t.description&&(r+=`	- Description '${e.description}' does not match '${t.description}'
6`),r}function oL(e,t){if(e.valueType!==t.valueType)return`	- use valueType '${e.valueType}' on instrument creation or use an instrument name other than '${t.name}'`;if(e.unit!==t.unit)return`	- use unit '${e.unit}' on instrument creation or use an instrument name other than '${t.name}'`;if(e.type!==t.type){let r;return r=JSON.stringify({name:t.name,type:t.type,unit:t.unit}),`	- create a new view with a name other than '${e.name}' and InstrumentSelector '${r}'`}if(e.description!==t.description){let r;return r=JSON.stringify({name:t.name,type:t.type,unit:t.unit}),`	- create a new view with a name other than '${e.name}' and InstrumentSelector '${r}'
7    	- OR - create a new view with the name ${e.name} and description '${e.description}' and InstrumentSelector ${r}
8    	- OR - create a new view with the name ${t.name} and description '${e.description}' and InstrumentSelector ${r}`}return""}class oC{_sharedRegistry=new Map;_perCollectorRegistry=new Map;static create(){return new oC}getStorages(e){let t=[];for(let e of this._sharedRegistry.values())t=t.concat(e);let r=this._perCollectorRegistry.get(e);if(null!=r)for(let e of r.values())t=t.concat(e);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let r=this._perCollectorRegistry.get(e);null==r&&(r=new Map,this._perCollectorRegistry.set(e,r)),this._registerStorage(t,r)}findOrUpdateCompatibleStorage(e){let t=this._sharedRegistry.get(e.name);return void 0===t?null:this._findOrUpdateCompatibleStorage(e,t)}findOrUpdateCompatibleCollectorStorage(e,t){let r=this._perCollectorRegistry.get(e);if(void 0===r)return null;let i=r.get(t.name);return void 0===i?null:this._findOrUpdateCompatibleStorage(t,i)}_registerStorage(e,t){let r=e.getInstrumentDescriptor(),i=t.get(r.name);void 0===i?t.set(r.name,[e]):i.push(e)}_findOrUpdateCompatibleStorage(e,t){let r=null;for(let i of t){let t=i.getInstrumentDescriptor();!function(e,t){var r,i;return r=e.name,i=t.name,r.toLowerCase()===i.toLowerCase()&&e.unit===t.unit&&e.type===t.type&&e.valueType===t.valueType}(t,e)?w.warn("A view or instrument with the name ",e.name," has already been registered and is incompatible with another registered view.\n","Details:\n",oA(t,e),"To resolve the conflict:\n",oL(t,e)):(t.description!==e.description&&(e.description.length>t.description.length&&i.updateDescription(e.description),w.warn("A view or instrument with the name ",e.name," has already been registered, but has a different description and is incompatible with another registered view.\n","Details:\n",oA(t,e),"The longer description will be used.\nTo resolve the conflict:",oL(t,e))),r
8=i)}return r}}class oO{_backingStorages;constructor(e){this._backingStorages=e}record(e,t,r,i){let n=this._backingStorages;for(let s=0;s<n.length;s++)n[s].record(e,t,r,i)}}class oR{_buffer=new oy;_instrumentName;_valueType;constructor(e,t){this._instrumentName=e,this._valueType=t}observe(e,t={}){"number"!=typeof e?w.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`):(this._valueType!==tq.INT||Number.isInteger(e)||(w.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),Number.isInteger(e=Math.trunc(e))))&&this._buffer.set(t,e)}}class ok{_buffer=new Map;observe(e,t,r={}){if(!of(e))return;let i=this._buffer.get(e);(null==i&&(i=new oy,this._buffer.set(e,i)),"number"!=typeof t)?w.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`):(e._descriptor.valueType!==tq.INT||Number.isInteger(t)||(w.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),Number.isInteger(t=Math.trunc(t))))&&i.set(r,t)}}class ox{_callbacks=[];_batchCallbacks=[];addCallback(e,t){this._findCallback(e,t)>=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let r=this._findCallback(e,t);r<0||this._callbacks.splice(r,1)}addBatchCallback(e,t){let r=new Set(t.filter(of));0===r.size?w.error("BatchObservableCallback is not associated with valid instruments",t):this._findBatchCallback(e,r)>=0||this._batchCallbacks.push({callback:e,instruments:r})}removeBatchCallback(e,t){let r=new Set(t.filter(of)),i=this._findBatchCallback(e,r);i<0||this._batchCallbacks.splice(i,1)}async observe(e,t){let r=this._observeCallbacks(e,t),i=this._observeBatchCallbacks(e,t);return(await Promise.allSettled([...r,...i])).filter(e=>"rejected"===e.status).map(e=>e.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:r,instrument:i})=>{let n=new oR(i._descriptor.name,i._descriptor.valueType),s=Promise.resolve(r(n));
8null!=t&&(s=eF(s,t)),await s,i._metricStorages.forEach(t=>{t.record(n._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:r,instruments:i})=>{let n=new ok,s=Promise.resolve(r(n));null!=t&&(s=eF(s,t)),await s,i.forEach(t=>{let r=n._buffer.get(t);null!=r&&t._metricStorages.forEach(t=>{t.record(r,e)})})})}_findCallback(e,t){return this._callbacks.findIndex(r=>r.callback===e&&r.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(r=>r.callback===e&&function(e,t){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}(r.instruments,t))}}class oN extends oE{_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(e,t,r,i,n){super(e),this._aggregationCardinalityLimit=n,this._deltaMetricStorage=new ov(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new oS(t,i),this._attributesProcessor=r}record(e,t,r,i){t=this._attributesProcessor.process(t,r),this._deltaMetricStorage.record(e,t,r,i)}collect(e,t){let r=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,r,t)}}class oP{_processors;constructor(e){this._processors=e}process(e,t){let r=e;for(let e of this._processors)r=e.process(r,t);return r}}let oD=new class{process(e,t){return e}};class oM{metricStorageRegistry=new oC;observableRegistry=new ox;meter;_meterProviderSharedState;_instrumentationScope;constructor(e,t){this.meter=new oT(this),this._meterProviderSharedState=e,this._instrumentationScope=t}registerMetricStorage(e){let t=this._registerMetricStorage(e,oN);return 1===t.length?t[0]:new oO(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,ow)}async collect(e,t,r){let i=await this.observableRegistry.observe(t,r?.timeoutMillis),n=this.metricStorageRegistry.getStorages(e);if(0===n.length)return null;let s=[];return(n.forEach(r=>{let i=r.collect(e,t);null!=i&&s.push(i)}),0===s.length)?{errors:i}:{scopeMetrics:{scope:this._instrumentationScope,metrics:s},errors:i}}_registerMetricStorage(e,t){let r=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(r=>{let i={name:r.name??e.name,description:r.description??e.description,type:e.type,unit:e.unit,valueType:e.valueType,advice:e.advice},n=this.metricStorageRegistry.findOrUpdateCompatibleStorage(i);if(null!=n)return n;let s=r.aggregation.createAggregator(i),o=new t(i,s,r.attributesProcessor,this._meterProviderSharedState.metricCollectors,r.aggregationCardinalityLimit);return this.metricStorageRegistry.register(o),o});if(0===r.length){let i=this._meterProviderSharedState.selectAggregations(e.type).map(([r,i])=>{let n=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(r,e);if(null!=n)return n;let s=i.createAggregator(e),o=r.selectCardinalityLimit(e.type),a=new t(e,s,oD,[r],o);return this.metricStorageRegistry.registerForCollector(r,a),a});r=r.concat(i)}return r}}class oI{viewRegistry=new os;metricCollectors=[];meterSharedStates=new Map;resource;constructor(e){this.resource=e}getMeterSharedState(e){let t=`${e.name}:${e.version??""}:${e.schemaUrl??""}`,r=this.meterSharedStates.get(t);return null==r&&(r=new oM(this,e),this.meterSharedStates.set(t,r)),r}selectAggregations(e){let t=[];for(let r of this.metricCollectors)t.push([r,tr(r.selectAggregation(e))]);return t}}class oU{_sharedState;_metricReader;constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let t=eO(Date.now()),r=[],i=[],n=Array.from(this._sharedState.meterSharedStates.values()).map(async n=>{let s=await n.collect(this,t,e);s?.scopeMetrics!=null&&r.push(s.scopeMetrics),s?.errors!=null&&i.push(...s.errors)});return await Promise.all(n),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:r},errors:i}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}selectCardinalityLimit(e){return this._metricReader.selectCardinalityLimit?.(e)??2e3}}let oB=/[\^$\\.+?()[\]{}|]/g;class oF{_matchAll;_regexp;constructor(e){"*"===e?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(oF.escapePattern(e)))}match(e){return!!this._matchAll||this._regexp.test(e)}static escapePattern(e){return`^${e.replace(oB,"\\$&").replace("*",".*")}$`}static hasWildcard(e){return e.includes("*")}}class oz{_matchAll;_pattern;constructor(e){this._matchAll=void 0===e,this._pattern=e}match(e){return!!this._matchAll||e===this._pattern}}class oV{_nameFilter;_type;_unitFilter;constructor(e){this._nameFilter=new oF(e?.name??"*"),this._type=e?.type,this._unitFilter=new oz(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}
8getUnitFilter(){return this._unitFilter}}class oj{_nameFilter;_versionFilter;_schemaUrlFilter;constructor(e){this._nameFilter=new oz(e?.name),this._versionFilter=new oz(e?.version),this._schemaUrlFilter=new oz(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}}class o${name;description;aggregation;attributesProcessor;instrumentSelector;meterSelector;aggregationCardinalityLimit;constructor(e){!function(e){if(null==e.instrumentName&&null==e.instrumentType&&null==e.instrumentUnit&&null==e.meterName&&null==e.meterVersion&&null==e.meterSchemaUrl)throw Error("Cannot create view with no selector arguments supplied");if(null!=e.name&&(e?.instrumentName==null||oF.hasWildcard(e.instrumentName)))throw Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.")}(e),null!=e.attributesProcessors?this.attributesProcessor=function(e){return new oP(e)}(e.attributesProcessors):this.attributesProcessor=oD,this.name=e.name,this.description=e.description,this.aggregation=tr(e.aggregation??{type:tZ.DEFAULT}),this.instrumentSelector=new oV({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new oj({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl}),this.aggregationCardinalityLimit=e.aggregationCardinalityLimit}}class oH{_sharedState;_shutdown=!1;constructor(e){if(this._sharedState=new oI(e?.resource??K()),e?.views!=null&&e.views.length>0)for(const t of e.views)this._sharedState.viewRegistry.addView(new o$(t));if(e?.readers!=null&&e.readers.length>0)for(const t of e.readers){const e=new oU(this._sharedState,t);t.setMetricProducer(e),this._sharedState.metricCollectors.push(e)}}getMeter(e,t="",r={}){return this._shutdown?(w.warn("A shutdown MeterProvider cannot provide a Meter"),rY):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:r.schemaUrl}).meter}async shutdown(e){this._shutdown?w.warn("shutdown may only be called once per MeterProvider"):(this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=>t.shutdown(e))))}async forceFlush(e){this._shutdown?w.warn("invalid attempt to force flush after MeterProvider shutdown"):await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}}let oG=e=>({type:tZ.DEFAULT}),oZ=e=>tj.CUMULATIVE;class oW{_shutdown=!1;_metricProducers;_sdkMetricProducer;_aggregationTemporalitySelector;_aggregationSelector;_cardinalitySelector;constructor(e){this._aggregationSelector=e?.aggregationSelector??oG,this._aggregationTemporalitySelector=e?.aggregationTemporalitySelector??oZ,this._metricProducers=e?.metricProducers??[],this._cardinalitySelector=e?.cardinalitySelector}setMetricProducer(e){if(this._sdkMetricProducer)throw Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}selectCardinalityLimit(e){return this._cardinalitySelector?this._cardinalitySelector(e):2e3}onInitialized(){}async collect(e){if(void 0===this._sdkMetricProducer)throw Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw Error("MetricReader is shutdown");let[t,...r]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e?.timeoutMillis}),...this._metricProducers.map(t=>t.collect({timeoutMillis:e?.timeoutMillis}))]),i=t.errors.concat(r.flatMap(e=>e.errors));return{resourceMetrics:{resource:t.resourceMetrics.resource,scopeMetrics:t.resourceMetrics.scopeMetrics.concat(r.flatMap(e=>e.resourceMetrics.scopeMetrics))},errors:i}}async shutdown(e){this._shutdown?w.error("Cannot call shutdown twice."):(e?.timeoutMillis==null?await this.onShutdown():await eF(this.onShutdown(),e.timeoutMillis),this._shutdown=!0)}async forceFlush(e){this._shutdown?w.warn("Cannot forceFlush on already shutdown MetricReader."):e?.timeoutMillis==null?await this.onForceFlush():await eF(this.onForceFlush(),e.timeoutMillis)}}class oq extends oW{_interval;_exporter;_exportInterval;_exportTimeout;constructor(e){const{exporter:t,exportIntervalMillis:r=6e4,metricProducers:i,cardinalityLimits:n}=e;let{exportTimeoutMillis:s=3e4}=e;if(super({aggregationSelector:t.selectAggregation?.bind(t),aggregationTemporalitySelector:t.selectAggregationTemporality?.bind(t),metricProducers:i,cardinalitySelector:e=>{let t={default:2e3,...n};switch(e){case t$.COUNTER:return t.counter??t.default;case t$.GAUGE:return t.gauge??t.default;case t$.HISTOGRAM:return t.histogram??t.default;case t$.OBSERVABLE_COUNTER:return t.observableCounter??t.default;case t$.OBSERVABLE_UP_DOWN_COUNTER:return t.observableUpDownCounter??t.default;case t$.OBSERVABLE_GAUGE:return t.observableGauge??t.default;case t$.UP_DOWN_COUNTER:return t.upDownCounter??t.default;default:return t.default}}}),r<=0)throw Error("exportIntervalMillis must be greater than 0");if(s<=0)throw Error("exportTimeoutMillis must be greater than 0");if(r<s)if("exportIntervalMillis"in e&&"exportTimeoutMillis"in e)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");else w.info(`Timeout of ${s} exceeds the interval of ${r}. Clamping timeout to interval duration.`),s=r;this._exportInterval=r,this._exportTimeout=s,this._exporter=t}async _runOnce(){try{await eF(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof eB)return void w.error("Export took longer than %s milliseconds and timed out.",this._exportTimeout);R(e)}}async _doRun(){var e,t;let{resourceMetrics:r,errors:i}=await this.collect({timeoutMillis:this._exportTimeout});if(i.length>0&&w.error("PeriodicExportingMetricReader: metrics collection errors",...i),r.resource.asyncAttributesPending)try{await r.resource.waitForAsyncAttributes?.()}catch(e){w.debug("Error while resolving async portion of resource: ",e),R(e)}
8if(0===r.scopeMetrics.length)return;let n=await (e=this._exporter,t=r,new Promise(r=>{S.with(x(S.active()),()=>{e.export(t,r)})}));if(n.code!==tV.SUCCESS)throw Error(`PeriodicExportingMetricReader: metrics export failed (error ${n.error})`)}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),"number"!=typeof this._interval&&this._interval.unref()}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this.onForceFlush(),await this._exporter.shutdown()}}let oX="[REDACTED]";function oY(e,t,r){if(e.attributes[t])if(r){let r=new URL(e.attributes[t]);r.hash&&(r.hash=`#${oX}`),e.attributes[t]=r.toString()}else e.attributes[t]=oX}class oQ{forceFlush(){return Promise.resolve(void 0)}onEnd(e){oY(e,"http.url",!0),oY(e,"url.full",!0),oY(e,"http.target",!0),oY(e,"url.fragment",!1),oY(e,"http.url_details.hash",!1)}onStart(e,t){}shutdown(){return Promise.resolve(void 0)}}let oK={maxQueueSize:16384,maxExportBatchSize:128,scheduledDelayMillis:2e3},oJ="khealth_otel_v1";{let e,t=(e=window[oJ])||(console.error(`Can not find Otel config in window[${oJ}]`),null);t?function(e){let{collectorUrl:t,name:r,version:i,env:n,clientToken:s,resourceExtraAttributes:o,redactUrlFragments:a,userInteractionEvents:l}=e;if(!t)return console.warn(`collectorUrl is not provided: ${String(t)}. Otel will not be initialized.`);let c=`${t}/v1/metrics`,u=`${t}/v1/traces`,h=`${t}/v1/logs`,d=((e={})=>(e.detectors||[]).map(t=>{try{var r;let i=(r=t.detect(e),new Y(r,void 0));return w.debug(`${t.constructor.name} found resource.`,i),i}catch(e){return w.debug(`${t.constructor.name} failed: ${e.message}`),Q({})}}).reduce((e,t)=>e.merge(t),Q({})))().merge(Q({"service.name":r,"service.version":i,env:n,...o})),p=[];!0===a&&p.push(new oQ);let _=new eS({url:u,headers:{"otel-client-token":s??""}});p.push(new D(_,oK)),new nu({resource:d,spanProcessors:p}).register({contextManager:new on});let g=e.contextPropagationDomainRegexes?.map(e=>new RegExp(e)),m=[u,c,h];!function(e){let t=e.tracerProvider||rG.getTracerProvider(),r=e.meterProvider||ng.getMeterProvider(),i=e.loggerProvider||rf.getLoggerProvider(),n=e.instrumentations?.flat()??[];for(let e=0,s=n.length;e<s;e++){let s=n[e];t&&s.setTracerProvider(t),r&&s.setMeterProvider(r),i&&s.setLoggerProvider&&s.setLoggerProvider(i),s.getConfig().enabled||s.enable()}}({instrumentations:[function(e={}){for(let t of Object.keys(e))if(!Object.prototype.hasOwnProperty.call(or,t)){w.error(`Provided instrumentation name "${t}" not found`);continue}let t=[];for(let r of Object.keys(or)){let i=or[r],n=e[r]??{};if(!1===n.enabled){w.debug(`Disabling instrumentation for ${r}`);continue}try{w.debug(`Loading instrumentation for ${r}`),t.push(new i(n))}catch(e){w.error(e)}}return t}({"@opentelemetry/instrumentation-user-interaction":{eventNames:l??["submit","click"]},"@opentelemetry/instrumentation-fetch":{propagateTraceHeaderCorsUrls:g,ignoreUrls:m},"@opentelemetry/instrumentation-xml-http-request":{propagateTraceHeaderCorsUrls:g,ignoreUrls:m}})]});let f=new oH({resource:d,readers:[new oq({exporter:new rc({url:c,headers:{"otel-client-token":s??""}}),exportIntervalMillis:5e3})]});ng.setGlobalMeterProvider(f);let T=new it({resource:d,processors:[new ry(new is({url:h,headers:{"otel-client-token":s??""}}),oK)]});rf.setGlobalLoggerProvider(T)}(t):console.error("Can not initialize Otel client: no config found")}e.s(["OtelClient",0,function(){return null}],17804)},77629,e=>{"use strict";var t=e.i(71645),r=e.i(18566),i=e.i(54215);e.s(["PageTracker",0,function(){let e=(0,i.useAnalytics)(),n=(0,r.usePathname)(),s=(0,r.useSearchParams)();return(0,t.useEffect)(()=>{if(!e)return;let t=setTimeout(()=>{let t=window.location.href,r=window.location.search,i=s.get("utm_source"),o=s.get("utm_medium"),a=s.get("utm_content"),l=s.get("utm_campaign"),c=s.get("gclid"),u=s.get("gbraid"),h=s.get("wbraid"),d=s.get("fbclid"),p=n.split("/").filter(Boolean),_=p.length>0?p[p.length-1]:"home";e.page(void 0,_,{url:t,search:r,...i&&{utm_source:i},...o&&{utm_medium:o},...a&&{utm_content:a},...l&&{utm_campaign:l},...c&&{gclid:c},...u&&{gbraid:u},...h&&{wbraid:h},...d&&{fbclid:d}})},1e3);return()=>clearTimeout(t)},[e,n,s]),null}])}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.