@grafana/faro-web-tracing 1.10.1 → 1.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- var GrafanaFaroWebTracing=function(t,e){"use strict";var n="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},r="1.9.0",o=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var i=function(t){var e=new Set([t]),n=new Set,r=t.match(o);if(!r)return function(){return!1};var i=+r[1],a=+r[2],s=+r[3];if(null!=r[4])return function(e){return e===t};function u(t){return n.add(t),!1}function c(t){return e.add(t),!0}return function(t){if(e.has(t))return!0;if(n.has(t))return!1;var r=t.match(o);if(!r)return u(t);var l=+r[1],p=+r[2],f=+r[3];return null!=r[4]||i!==l?u(t):0===i?a===p&&s<=f?c(t):u(t):a<=p?c(t):u(t)}}(r),a=r.split(".")[0],s=Symbol.for("opentelemetry.js.api."+a),u=n;function c(t,e,n,o){var i;void 0===o&&(o=!1);var a=u[s]=null!==(i=u[s])&&void 0!==i?i:{version:r};if(!o&&a[t]){var c=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return n.error(c.stack||c.message),!1}if(a.version!==r){c=new Error("@opentelemetry/api: Registration of version v"+a.version+" for "+t+" does not match previously registered API v"+r);return n.error(c.stack||c.message),!1}return a[t]=e,n.debug("@opentelemetry/api: Registered a global for "+t+" v"+r+"."),!0}function l(t){var e,n,r=null===(e=u[s])||void 0===e?void 0:e.version;if(r&&i(r))return null===(n=u[s])||void 0===n?void 0:n[t]}function p(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+r+".");var n=u[s];n&&delete n[t]}var f,h=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},d=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},_=function(){function t(t){this._namespace=t.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return v("debug",this._namespace,t)},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return v("error",this._namespace,t)},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return v("info",this._namespace,t)},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return v("warn",this._namespace,t)},t.prototype.verbose=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return v("verbose",this._namespace,t)},t}();function v(t,e,n){var r=l("diag");if(r)return n.unshift(e),r[t].apply(r,d([],h(n),!1))}!function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"}(f||(f={}));var g=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},E=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},y=function(){function t(){function t(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=l("diag");if(r)return r[t].apply(r,E([],g(e),!1))}}var e=this;e.setLogger=function(t,n){var r,o,i;if(void 0===n&&(n={logLevel:f.INFO}),t===e){var a=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return e.error(null!==(r=a.stack)&&void 0!==r?r:a.message),!1}"number"==typeof n&&(n={logLevel:n});var s=l("diag"),u=function(t,e){function n(n,r){var o=e[n];return"function"==typeof o&&t>=r?o.bind(e):function(){}}return t<f.NONE?t=f.NONE:t>f.ALL&&(t=f.ALL),e=e||{},{error:n("error",f.ERROR),warn:n("warn",f.WARN),info:n("info",f.INFO),debug:n("debug",f.DEBUG),verbose:n("verbose",f.VERBOSE)}}(null!==(o=n.logLevel)&&void 0!==o?o:f.INFO,t);if(s&&!n.suppressOverrideMessage){var p=null!==(i=(new Error).stack)&&void 0!==i?i:"<failed to generate stacktrace>";s.warn("Current logger will be overwritten from "+p),u.warn("Current logger will overwrite one already registered from "+p)}return c("diag",u,e,!0)},e.disable=function(){p("diag",e)},e.createComponentLogger=function(t){return new _(t)},e.verbose=t("verbose"),e.debug=t("debug"),e.info=t("info"),e.warn=t("warn"),e.error=t("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t}(),T=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},m=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},b=function(){function t(t){this._entries=t?new Map(t):new Map}return t.prototype.getEntry=function(t){var e=this._entries.get(t);if(e)return Object.assign({},e)},t.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map((function(t){var e=T(t,2);return[e[0],e[1]]}))},t.prototype.setEntry=function(e,n){var r=new t(this._entries);return r._entries.set(e,n),r},t.prototype.removeEntry=function(e){var n=new t(this._entries);return n._entries.delete(e),n},t.prototype.removeEntries=function(){for(var e,n,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=new t(this._entries);try{for(var a=m(r),s=a.next();!s.done;s=a.next()){var u=s.value;i._entries.delete(u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return i},t.prototype.clear=function(){return new t},t}(),S=Symbol("BaggageEntryMetadata"),O=y.instance();function R(t){return void 0===t&&(t={}),new b(new Map(Object.entries(t)))}function L(t){return Symbol.for(t)}var P,w,A=function t(e){var n=this;n._currentContext=e?new Map(e):new Map,n.getValue=function(t){return n._currentContext.get(t)},n.setValue=function(e,r){var o=new t(n._currentContext);return o._currentContext.set(e,r),o},n.deleteValue=function(e){var r=new t(n._currentContext);return r._currentContext.delete(e),r}},C=new A,k=(P=function(t,e){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},P(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}P(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),I=function(){function t(){}return t.prototype.createGauge=function(t,e){return G},t.prototype.createHistogram=function(t,e){return X},t.prototype.createCounter=function(t,e){return F},t.prototype.createUpDownCounter=function(t,e){return V},t.prototype.createObservableGauge=function(t,e){return W},t.prototype.createObservableCounter=function(t,e){return q},t.prototype.createObservableUpDownCounter=function(t,e){return K},t.prototype.addBatchObservableCallback=function(t,e){},t.prototype.removeBatchObservableCallback=function(t){},t}(),N=function(){},D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e.prototype.add=function(t,e){},e}(N),x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e.prototype.add=function(t,e){},e}(N),M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e.prototype.record=function(t,e){},e}(N),j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e.prototype.record=function(t,e){},e}(N),U=function(){function t(){}return t.prototype.addCallback=function(t){},t.prototype.removeCallback=function(t){},t}(),B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e}(U),Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e}(U),z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e}(U),H=new I,F=new D,G=new M,X=new j,V=new x,q=new B,W=new Z,K=new z,Y={get:function(t,e){if(null!=t)return t[e]},keys:function(t){return null==t?[]:Object.keys(t)}},$={set:function(t,e,n){null!=t&&(t[e]=n)}},Q=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},J=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},tt=function(){function t(){}return t.prototype.active=function(){return C},t.prototype.with=function(t,e,n){for(var r=[],o=3;o<arguments.length;o++)r[o-3]=arguments[o];return e.call.apply(e,J([n],Q(r),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),et=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},nt=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},rt="context",ot=new tt,it=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return c(rt,t,y.instance())},t.prototype.active=function(){return this._getContextManager().active()},t.prototype.with=function(t,e,n){for(var r,o=[],i=3;i<arguments.length;i++)o[i-3]=arguments[i];return(r=this._getContextManager()).with.apply(r,nt([t,e,n],et(o),!1))},t.prototype.bind=function(t,e){return this._getContextManager().bind(t,e)},t.prototype._getContextManager=function(){return l(rt)||ot},t.prototype.disable=function(){this._getContextManager().disable(),p(rt,y.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(w||(w={}));var at="0000000000000000",st="00000000000000000000000000000000",ut={traceId:st,spanId:at,traceFlags:w.NONE},ct=function(){function t(t){void 0===t&&(t=ut),this._spanContext=t}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(t,e){return this},t.prototype.setAttributes=function(t){return this},t.prototype.addEvent=function(t,e){return this},t.prototype.addLink=function(t){return this},t.prototype.addLinks=function(t){return this},t.prototype.setStatus=function(t){return this},t.prototype.updateName=function(t){return this},t.prototype.end=function(t){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(t,e){},t}(),lt=L("OpenTelemetry Context Key SPAN");function pt(t){return t.getValue(lt)||void 0}function ft(){return pt(it.getInstance().active())}function ht(t,e){return t.setValue(lt,e)}function dt(t){return t.deleteValue(lt)}function _t(t,e){return ht(t,new ct(e))}function vt(t){var e;return null===(e=pt(t))||void 0===e?void 0:e.spanContext()}var gt=/^([0-9a-f]{32})$/i,Et=/^[0-9a-f]{16}$/i;function yt(t){return gt.test(t)&&t!==st}function Tt(t){return yt(t.traceId)&&(e=t.spanId,Et.test(e)&&e!==at);var e}function mt(t){return new ct(t)}var bt=it.getInstance(),St=function(){function t(){}return t.prototype.startSpan=function(t,e,n){if(void 0===n&&(n=bt.active()),Boolean(null==e?void 0:e.root))return new ct;var r,o=n&&vt(n);return"object"==typeof(r=o)&&"string"==typeof r.spanId&&"string"==typeof r.traceId&&"number"==typeof r.traceFlags&&Tt(o)?new ct(o):new ct},t.prototype.startActiveSpan=function(t,e,n,r){var o,i,a;if(!(arguments.length<2)){2===arguments.length?a=e:3===arguments.length?(o=e,a=n):(o=e,i=n,a=r);var s=null!=i?i:bt.active(),u=this.startSpan(t,o,s),c=ht(s,u);return bt.with(c,a,void 0,u)}},t}();var Ot,Rt,Lt,Pt=new St,wt=function(){function t(t,e,n,r){this._provider=t,this.name=e,this.version=n,this.options=r}return t.prototype.startSpan=function(t,e,n){return this._getTracer().startSpan(t,e,n)},t.prototype.startActiveSpan=function(t,e,n,r){var o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Pt},t}(),At=new(function(){function t(){}return t.prototype.getTracer=function(t,e,n){return new St},t}()),Ct=function(){function t(){}return t.prototype.getTracer=function(t,e,n){var r;return null!==(r=this.getDelegateTracer(t,e,n))&&void 0!==r?r:new wt(this,t,e,n)},t.prototype.getDelegate=function(){var t;return null!==(t=this._delegate)&&void 0!==t?t:At},t.prototype.setDelegate=function(t){this._delegate=t},t.prototype.getDelegateTracer=function(t,e,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getTracer(t,e,n)},t}();!function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(Ot||(Ot={})),function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"}(Rt||(Rt={})),function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"}(Lt||(Lt={}));var kt=it.getInstance(),It=y.instance(),Nt=new(function(){function t(){}return t.prototype.getMeter=function(t,e,n){return H},t}()),Dt="metrics",xt=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(t){return c(Dt,t,y.instance())},t.prototype.getMeterProvider=function(){return l(Dt)||Nt},t.prototype.getMeter=function(t,e,n){return this.getMeterProvider().getMeter(t,e,n)},t.prototype.disable=function(){p(Dt,y.instance())},t}().getInstance(),Mt=function(){function t(){}return t.prototype.inject=function(t,e){},t.prototype.extract=function(t,e){return t},t.prototype.fields=function(){return[]},t}(),jt=L("OpenTelemetry Baggage Key");function Ut(t){return t.getValue(jt)||void 0}function Bt(){return Ut(it.getInstance().active())}function Zt(t,e){return t.setValue(jt,e)}function zt(t){return t.deleteValue(jt)}var Ht="propagation",Ft=new Mt,Gt=function(){function t(){this.createBaggage=R,this.getBaggage=Ut,this.getActiveBaggage=Bt,this.setBaggage=Zt,this.deleteBaggage=zt}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(t){return c(Ht,t,y.instance())},t.prototype.inject=function(t,e,n){return void 0===n&&(n=$),this._getGlobalPropagator().inject(t,e,n)},t.prototype.extract=function(t,e,n){return void 0===n&&(n=Y),this._getGlobalPropagator().extract(t,e,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){p(Ht,y.instance())},t.prototype._getGlobalPropagator=function(){return l(Ht)||Ft},t}(),Xt=Gt.getInstance(),Vt="trace",qt=function(){function t(){this._proxyTracerProvider=new Ct,this.wrapSpanContext=mt,this.isSpanContextValid=Tt,this.deleteSpan=dt,this.getSpan=pt,this.getActiveSpan=ft,this.getSpanContext=vt,this.setSpan=ht,this.setSpanContext=_t}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=c(Vt,this._proxyTracerProvider,y.instance());return e&&this._proxyTracerProvider.setDelegate(t),e},t.prototype.getTracerProvider=function(){return l(Vt)||this._proxyTracerProvider},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){p(Vt,y.instance()),this._proxyTracerProvider=new Ct},t}().getInstance(),Wt=L("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Kt(t){return!0===t.getValue(Wt)}var Yt="baggage",$t=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function Qt(t){var e=t.split(";");if(!(e.length<=0)){var n=e.shift();if(n){var r=n.indexOf("=");if(!(r<=0)){var o,i,a=decodeURIComponent(n.substring(0,r).trim()),s=decodeURIComponent(n.substring(r+1).trim());return e.length>0&&("string"!=typeof(i=e.join(";"))&&(O.error("Cannot create baggage metadata from unknown type: "+typeof i),i=""),o={__TYPE__:S,toString:function(){return i}}),{key:a,value:s,metadata:o}}}}}var Jt=function(){function t(){}return t.prototype.inject=function(t,e,n){var r=Xt.getBaggage(t);if(r&&!Kt(t)){var o=function(t){return t.getAllEntries().map((function(t){var e=$t(t,2),n=e[0],r=e[1],o=encodeURIComponent(n)+"="+encodeURIComponent(r.value);return void 0!==r.metadata&&(o+=";"+r.metadata.toString()),o}))}(r).filter((function(t){return t.length<=4096})).slice(0,180),i=function(t){return t.reduce((function(t,e){var n=t+(""!==t?",":"")+e;return n.length>8192?t:n}),"")}(o);i.length>0&&n.set(e,Yt,i)}},t.prototype.extract=function(t,e,n){var r=n.get(e,Yt),o=Array.isArray(r)?r.join(","):r;if(!o)return t;var i={};return 0===o.length?t:(o.split(",").forEach((function(t){var e=Qt(t);if(e){var n={value:e.value};e.metadata&&(n.metadata=e.metadata),i[e.key]=n}})),0===Object.entries(i).length?t:Xt.setBaggage(t,Xt.createBaggage(i)))},t.prototype.fields=function(){return[Yt]},t}(),te=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ee=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function ne(t){var e,n,r={};if("object"!=typeof t||null==t)return r;try{for(var o=te(Object.entries(t)),i=o.next();!i.done;i=o.next()){var a=ee(i.value,2),s=a[0],u=a[1];re(s)?oe(u)?Array.isArray(u)?r[s]=u.slice():r[s]=u:It.warn("Invalid attribute value set for key: "+s):It.warn("Invalid attribute key: "+s)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r}function re(t){return"string"==typeof t&&t.length>0}function oe(t){return null==t||(Array.isArray(t)?function(t){var e,n,r;try{for(var o=te(t),i=o.next();!i.done;i=o.next()){var a=i.value;if(null!=a){if(!r){if(ie(a)){r=typeof a;continue}return!1}if(typeof a!==r)return!1}}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return!0}(t):ie(t))}function ie(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var ae,se=function(t){It.error(function(t){return"string"==typeof t?t:JSON.stringify(function(t){for(var e={},n=t;null!==n;)Object.getOwnPropertyNames(n).forEach((function(t){if(!e[t]){var r=n[t];r&&(e[t]=String(r))}})),n=Object.getPrototypeOf(n);return e}(t))}(t))};function ue(t){try{se(t)}catch(t){}}!function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"}(ae||(ae={}));var ce=",",le=["OTEL_SDK_DISABLED"];function pe(t){return le.indexOf(t)>-1}var fe=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];function he(t){return fe.indexOf(t)>-1}var de=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS"];function _e(t){return de.indexOf(t)>-1}var ve=1/0,ge=128,Ee={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:f.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:ve,OTEL_ATTRIBUTE_COUNT_LIMIT:ge,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:ve,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:ge,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:ve,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:ge,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:128,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:ae.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative"};function ye(t,e,n){if(void 0!==n[t]){var r=String(n[t]);e[t]="true"===r.toLowerCase()}}function Te(t,e,n,r,o){if(void 0===r&&(r=-1/0),void 0===o&&(o=1/0),void 0!==n[t]){var i=Number(n[t]);isNaN(i)||(e[t]=i<r?r:i>o?o:i)}}function me(t,e,n,r){void 0===r&&(r=ce);var o=n[t];"string"==typeof o&&(e[t]=o.split(r).map((function(t){return t.trim()})))}var be={ALL:f.ALL,VERBOSE:f.VERBOSE,DEBUG:f.DEBUG,INFO:f.INFO,WARN:f.WARN,ERROR:f.ERROR,NONE:f.NONE};function Se(t,e,n){var r=n[t];if("string"==typeof r){var o=be[r.toUpperCase()];null!=o&&(e[t]=o)}}function Oe(t){var e={};for(var n in Ee){var r=n;if("OTEL_LOG_LEVEL"===r)Se(r,e,t);else if(pe(r))ye(r,e,t);else if(he(r))Te(r,e,t);else if(_e(r))me(r,e,t);else{var o=t[r];null!=o&&(e[r]=String(o))}}return e}var Re="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{};function Le(){var t=Oe(Re);return Object.assign({},Ee,t)}function Pe(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function we(t){for(var e=new Uint8Array(t.length/2),n=0,r=0;r<t.length;r+=2){var o=Pe(t.charCodeAt(r)),i=Pe(t.charCodeAt(r+1));e[n++]=o<<4|i}return e}var Ae,Ce=performance,ke="exception.type",Ie="exception.message",Ne="http.method",De="http.url",xe="http.host",Me="http.scheme",je="http.status_code",Ue="http.user_agent",Be="telemetry.sdk.name",Ze="telemetry.sdk.language",ze="telemetry.sdk.version",He=((Ae={})[Be]="opentelemetry",Ae["process.runtime.name"]="browser",Ae[Ze]="webjs",Ae[ze]="1.26.0",Ae);var Fe,Ge=Math.pow(10,6),Xe=Math.pow(10,9);function Ve(t){var e=t/1e3;return[Math.trunc(e),Math.round(t%1e3*Ge)]}function qe(){var t=Ce.timeOrigin;if("number"!=typeof t){var e=Ce;t=e.timing&&e.timing.fetchStart}return t}function We(t){return Je(Ve(qe()),Ve("number"==typeof t?t:Ce.now()))}function Ke(t){if($e(t))return t;if("number"==typeof t)return t<qe()?We(t):Ve(t);if(t instanceof Date)return Ve(t.getTime());throw TypeError("Invalid input type")}function Ye(t){return t[0]*Xe+t[1]}function $e(t){return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}function Qe(t){return $e(t)||"number"==typeof t||t instanceof Date}function Je(t,e){var n=[t[0]+e[0],t[1]+e[1]];return n[1]>=Xe&&(n[1]-=Xe,n[0]+=1),n}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(Fe||(Fe={}));var tn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},en=function(){function t(t){var e;void 0===t&&(t={}),this._propagators=null!==(e=t.propagators)&&void 0!==e?e:[],this._fields=Array.from(new Set(this._propagators.map((function(t){return"function"==typeof t.fields?t.fields():[]})).reduce((function(t,e){return t.concat(e)}),[])))}return t.prototype.inject=function(t,e,n){var r,o;try{for(var i=tn(this._propagators),a=i.next();!a.done;a=i.next()){var s=a.value;try{s.inject(t,e,n)}catch(t){It.warn("Failed to inject with "+s.constructor.name+". Err: "+t.message)}}}catch(t){r={error:t}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}},t.prototype.extract=function(t,e,n){return this._propagators.reduce((function(t,r){try{return r.extract(t,e,n)}catch(t){It.warn("Failed to inject with "+r.constructor.name+". Err: "+t.message)}return t}),t)},t.prototype.fields=function(){return this._fields.slice()},t}(),nn="[_0-9a-z-*/]",rn=new RegExp("^(?:"+("[a-z]"+nn+"{0,255}")+"|"+("[a-z0-9]"+nn+"{0,240}@[a-z]"+nn+"{0,13}")+")$"),on=/^[ -~]{0,255}[!-~]$/,an=/,|=/;var sn=function(){function t(t){this._internalState=new Map,t&&this._parse(t)}return t.prototype.set=function(t,e){var n=this._clone();return n._internalState.has(t)&&n._internalState.delete(t),n._internalState.set(t,e),n},t.prototype.unset=function(t){var e=this._clone();return e._internalState.delete(t),e},t.prototype.get=function(t){return this._internalState.get(t)},t.prototype.serialize=function(){var t=this;return this._keys().reduce((function(e,n){return e.push(n+"="+t.get(n)),e}),[]).join(",")},t.prototype._parse=function(t){t.length>512||(this._internalState=t.split(",").reverse().reduce((function(t,e){var n=e.trim(),r=n.indexOf("=");if(-1!==r){var o=n.slice(0,r),i=n.slice(r+1,e.length);(function(t){return rn.test(t)})(o)&&function(t){return on.test(t)&&!an.test(t)}(i)&&t.set(o,i)}return t}),new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t}(),un="traceparent",cn="tracestate",ln=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");var pn,fn,hn=function(){function t(){}return t.prototype.inject=function(t,e,n){var r=qt.getSpanContext(t);if(r&&!Kt(t)&&Tt(r)){var o="00-"+r.traceId+"-"+r.spanId+"-0"+Number(r.traceFlags||w.NONE).toString(16);n.set(e,un,o),r.traceState&&n.set(e,cn,r.traceState.serialize())}},t.prototype.extract=function(t,e,n){var r=n.get(e,un);if(!r)return t;var o=Array.isArray(r)?r[0]:r;if("string"!=typeof o)return t;var i=function(t){var e=ln.exec(t);return e?"00"===e[1]&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}:null}(o);if(!i)return t;i.isRemote=!0;var a=n.get(e,cn);if(a){var s=Array.isArray(a)?a.join(","):a;i.traceState=new sn("string"==typeof s?s:void 0)}return qt.setSpanContext(t,i)},t.prototype.fields=function(){return[un,cn]},t}(),dn="[object Object]",_n="[object Null]",vn="[object Undefined]",gn=Function.prototype.toString,En=gn.call(Object),yn=(pn=Object.getPrototypeOf,fn=Object,function(t){return pn(fn(t))}),Tn=Object.prototype,mn=Tn.hasOwnProperty,bn=Symbol?Symbol.toStringTag:void 0,Sn=Tn.toString;function On(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||function(t){if(null==t)return void 0===t?vn:_n;return bn&&bn in Object(t)?function(t){var e=mn.call(t,bn),n=t[bn],r=!1;try{t[bn]=void 0,r=!0}catch(t){}var o=Sn.call(t);r&&(e?t[bn]=n:delete t[bn]);return o}(t):function(t){return Sn.call(t)}(t)}(t)!==dn)return!1;var e=yn(t);if(null===e)return!0;var n=mn.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&gn.call(n)===En}var Rn=20;function Ln(t){return An(t)?t.slice():t}function Pn(t,e,n,r){var o;if(void 0===n&&(n=0),!(n>Rn)){if(n++,In(t)||In(e)||Cn(e))o=Ln(e);else if(An(t)){if(o=t.slice(),An(e))for(var i=0,a=e.length;i<a;i++)o.push(Ln(e[i]));else if(kn(e))for(i=0,a=(s=Object.keys(e)).length;i<a;i++){o[u=s[i]]=Ln(e[u])}}else if(kn(t))if(kn(e)){if(!function(t,e){if(!On(t)||!On(e))return!1;return!0}(t,e))return e;o=Object.assign({},t);var s;for(i=0,a=(s=Object.keys(e)).length;i<a;i++){var u,c=e[u=s[i]];if(In(c))void 0===c?delete o[u]:o[u]=c;else{var l=o[u],p=c;if(wn(t,u,r)||wn(e,u,r))delete o[u];else{if(kn(l)&&kn(p)){var f=r.get(l)||[],h=r.get(p)||[];f.push({obj:t,key:u}),h.push({obj:e,key:u}),r.set(l,f),r.set(p,h)}o[u]=Pn(o[u],c,n,r)}}}}else o=e;return o}}function wn(t,e,n){for(var r=n.get(t[e])||[],o=0,i=r.length;o<i;o++){var a=r[o];if(a.key===e&&a.obj===t)return!0}return!1}function An(t){return Array.isArray(t)}function Cn(t){return"function"==typeof t}function kn(t){return!In(t)&&!An(t)&&!Cn(t)&&"object"==typeof t}function In(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}var Nn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function Dn(t,e){return"string"==typeof e?t===e:!!t.match(e)}function xn(t,e){var n,r;if(!e)return!1;try{for(var o=Nn(e),i=o.next();!i.done;i=o.next()){if(Dn(t,i.value))return!0}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}var Mn=function(){function t(){var t=this;this._promise=new Promise((function(e,n){t._resolve=e,t._reject=n}))}return Object.defineProperty(t.prototype,"promise",{get:function(){return this._promise},enumerable:!1,configurable:!0}),t.prototype.resolve=function(t){this._resolve(t)},t.prototype.reject=function(t){this._reject(t)},t}(),jn=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Un=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Bn=function(){function t(t,e){this._callback=t,this._that=e,this._isCalled=!1,this._deferred=new Mn}return Object.defineProperty(t.prototype,"isCalled",{get:function(){return this._isCalled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"promise",{get:function(){return this._deferred.promise},enumerable:!1,configurable:!0}),t.prototype.call=function(){for(var t,e=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(!this._isCalled){this._isCalled=!0;try{Promise.resolve((t=this._callback).call.apply(t,Un([this._that],jn(n),!1))).then((function(t){return e._deferred.resolve(t)}),(function(t){return e._deferred.reject(t)}))}catch(t){this._deferred.reject(t)}}return this._deferred.promise},t}();function Zn(t){var e=BigInt(1e9);return BigInt(t[0])*e+BigInt(t[1])}function zn(t){var e,n=Zn(t);return e=n,{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}var Hn="undefined"!=typeof BigInt?function(t){return Zn(t).toString()}:Ye;function Fn(t){return t}function Gn(t){if(void 0!==t)return we(t)}var Xn,Vn={encodeHrTime:zn,encodeSpanContext:we,encodeOptionalSpanContext:Gn};!function(t){t[t.SPAN_KIND_UNSPECIFIED=0]="SPAN_KIND_UNSPECIFIED",t[t.SPAN_KIND_INTERNAL=1]="SPAN_KIND_INTERNAL",t[t.SPAN_KIND_SERVER=2]="SPAN_KIND_SERVER",t[t.SPAN_KIND_CLIENT=3]="SPAN_KIND_CLIENT",t[t.SPAN_KIND_PRODUCER=4]="SPAN_KIND_PRODUCER",t[t.SPAN_KIND_CONSUMER=5]="SPAN_KIND_CONSUMER"}(Xn||(Xn={}));var qn=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function Wn(t){return Object.keys(t).map((function(e){return Kn(e,t[e])}))}function Kn(t,e){return{key:t,value:Yn(e)}}function Yn(t){var e=typeof t;return"string"===e?{stringValue:t}:"number"===e?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:"boolean"===e?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(Yn)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((function(t){var e=qn(t,2);return Kn(e[0],e[1])}))}}:{}}function $n(t,e){var n,r=t.spanContext(),o=t.status;return{traceId:e.encodeSpanContext(r.traceId),spanId:e.encodeSpanContext(r.spanId),parentSpanId:e.encodeOptionalSpanContext(t.parentSpanId),traceState:null===(n=r.traceState)||void 0===n?void 0:n.serialize(),name:t.name,kind:null==t.kind?0:t.kind+1,startTimeUnixNano:e.encodeHrTime(t.startTime),endTimeUnixNano:e.encodeHrTime(t.endTime),attributes:Wn(t.attributes),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map((function(t){return function(t,e){return{attributes:t.attributes?Wn(t.attributes):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}(t,e)})),droppedEventsCount:t.droppedEventsCount,status:{code:o.code,message:o.message},links:t.links.map((function(t){return function(t,e){var n;return{attributes:t.attributes?Wn(t.attributes):[],spanId:e.encodeSpanContext(t.context.spanId),traceId:e.encodeSpanContext(t.context.traceId),traceState:null===(n=t.context.traceState)||void 0===n?void 0:n.serialize(),droppedAttributesCount:t.droppedAttributesCount||0}}(t,e)})),droppedLinksCount:t.droppedLinksCount}}function Qn(t){return{attributes:Wn(t.attributes),droppedAttributesCount:0}}var Jn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},tr=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function er(t,e){var n=function(t){var e,n;if(void 0===t)return Vn;var r=null===(e=t.useLongBits)||void 0===e||e,o=null!==(n=t.useHex)&&void 0!==n&&n;return{encodeHrTime:r?zn:Hn,encodeSpanContext:o?Fn:we,encodeOptionalSpanContext:o?Fn:Gn}}(e);return{resourceSpans:nr(t,n)}}function nr(t,e){for(var n,r=function(t){var e,n,r=new Map;try{for(var o=Jn(t),i=o.next();!i.done;i=o.next()){var a=i.value,s=r.get(a.resource);s||(s=new Map,r.set(a.resource,s));var u=a.instrumentationLibrary.name+"@"+(a.instrumentationLibrary.version||"")+":"+(a.instrumentationLibrary.schemaUrl||""),c=s.get(u);c||(c=[],s.set(u,c)),c.push(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r}(t),o=[],i=r.entries(),a=i.next();!a.done;){for(var s=tr(a.value,2),u=s[0],c=[],l=s[1].values(),p=l.next();!p.done;){var f=p.value;if(f.length>0){var h=f.map((function(t){return $n(t,e)}));c.push({scope:(n=f[0].instrumentationLibrary,{name:n.name,version:n.version}),spans:h,schemaUrl:f[0].instrumentationLibrary.schemaUrl})}p=l.next()}var d={resource:Qn(u),scopeSpans:c,schemaUrl:void 0};o.push(d),a=i.next()}return o}var rr=function(){return rr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},rr.apply(this,arguments)},or=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},ir=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ar=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},sr=function(){function t(t,e){var n,r=this;this._attributes=t,this.asyncAttributesPending=null!=e,this._syncAttributes=null!==(n=this._attributes)&&void 0!==n?n:{},this._asyncAttributesPromise=null==e?void 0:e.then((function(t){return r._attributes=Object.assign({},r._attributes,t),r.asyncAttributesPending=!1,t}),(function(t){return It.debug("a resource's async attributes promise rejected: %s",t),r.asyncAttributesPending=!1,{}}))}return t.empty=function(){return t.EMPTY},t.default=function(){var e;return new t(((e={})["service.name"]="unknown_service",e[Ze]=He[Ze],e[Be]=He[Be],e[ze]=He[ze],e))},Object.defineProperty(t.prototype,"attributes",{get:function(){var t;return this.asyncAttributesPending&&It.error("Accessing resource attributes before async attributes settled"),null!==(t=this._attributes)&&void 0!==t?t:{}},enumerable:!1,configurable:!0}),t.prototype.waitForAsyncAttributes=function(){return or(this,void 0,void 0,(function(){return ir(this,(function(t){switch(t.label){case 0:return this.asyncAttributesPending?[4,this._asyncAttributesPromise]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.merge=function(e){var n,r=this;if(!e)return this;var o=rr(rr({},this._syncAttributes),null!==(n=e._syncAttributes)&&void 0!==n?n:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new t(o);var i=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then((function(t){var n,o=ar(t,2),i=o[0],a=o[1];return rr(rr(rr(rr({},r._syncAttributes),i),null!==(n=e._syncAttributes)&&void 0!==n?n:e.attributes),a)}));return new t(o,i)},t.EMPTY=new t({}),t}();let ur={};class cr{constructor(t){this.config=t}export(t,e){const n=er(t,{useHex:!0,useLongBits:!1});this.config.api.pushTraces(n),function(t=[]){var e,n;for(const r of t){const{scopeSpans:t}=r;for(const r of t){const{scope:t,spans:o=[]}=r;for(const r of o){if(r.kind!==Xn.SPAN_KIND_CLIENT)continue;const o={traceId:r.traceId.toString(),spanId:r.spanId.toString()},i={};for(const t of r.attributes)i[t.key]=String(Object.values(t.value)[0]);const a=(null!==(e=null==t?void 0:t.name)&&void 0!==e?e:"").indexOf("-");let s="unknown";(null==t?void 0:t.name)&&(-1===a&&(s=null!==(n=t.name.split("/")[1])&&void 0!==n?n:t.name),a>-1&&(s=null==t?void 0:t.name.substring(a+1))),ur.api.pushEvent(`faro.tracing.${s}`,i,void 0,{spanContext:o})}}}}(n.resourceSpans),e({code:Fe.SUCCESS})}shutdown(){return Promise.resolve(void 0)}}class lr{constructor(t,e){this.processor=t,this.metas=e}forceFlush(){return this.processor.forceFlush()}onStart(t,e){const n=this.metas.value.session;(null==n?void 0:n.id)&&(t.attributes["session.id"]=n.id,t.attributes.session_id=n.id),this.processor.onStart(t,e)}onEnd(t){this.processor.onEnd(t)}shutdown(){return this.processor.shutdown()}}"function"==typeof SuppressedError&&SuppressedError;var pr=function(){function t(){}return t.prototype.emit=function(t){},t}(),fr=new(function(){function t(){}return t.prototype.getLogger=function(t,e,n){return new pr},t}()),hr="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},dr=Symbol.for("io.opentelemetry.js.api.logs"),_r=hr;var vr=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalLoggerProvider=function(t){return _r[dr]?this.getLoggerProvider():(_r[dr]=(e=1,n=t,r=fr,function(t){return t===e?n:r}),t);var e,n,r},t.prototype.getLoggerProvider=function(){var t,e;return null!==(e=null===(t=_r[dr])||void 0===t?void 0:t.call(_r,1))&&void 0!==e?e:fr},t.prototype.getLogger=function(t,e,n){return this.getLoggerProvider().getLogger(t,e,n)},t.prototype.disable=function(){delete _r[dr]},t}(),gr=vr.getInstance();function Er(t){return"function"==typeof t}var yr=console.error.bind(console);function Tr(t,e,n){var r=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}function mr(t){t&&t.logger&&(Er(t.logger)?yr=t.logger:yr("new logger isn't a function, not replacing"))}function br(t,e,n){if(t&&t[e]){if(!n)return yr("no wrapper function"),void yr((new Error).stack);if(Er(t[e])&&Er(n)){var r=t[e],o=n(r,e);return Tr(o,"__original",r),Tr(o,"__unwrap",(function(){t[e]===o&&Tr(t,e,r)})),Tr(o,"__wrapped",!0),Tr(t,e,o),o}yr("original object and wrapper must be functions")}else yr("no original function "+e+" to wrap")}function Sr(t,e){return t&&t[e]?t[e].__unwrap?t[e].__unwrap():void yr("no original to unwrap to -- has "+e+" already been unwrapped?"):(yr("no function to unwrap."),void yr((new Error).stack))}mr.wrap=br,mr.massWrap=function(t,e,n){if(!t)return yr("must provide one or more modules to patch"),void yr((new Error).stack);Array.isArray(t)||(t=[t]),e&&Array.isArray(e)?t.forEach((function(t){e.forEach((function(e){br(t,e,n)}))})):yr("must provide one or more functions to wrap on modules")},mr.unwrap=Sr,mr.massUnwrap=function(t,e){if(!t)return yr("must provide one or more modules to patch"),void yr((new Error).stack);Array.isArray(t)||(t=[t]),e&&Array.isArray(e)?t.forEach((function(t){e.forEach((function(e){Sr(t,e)}))})):yr("must provide one or more functions to unwrap on modules")};var Or=mr,Rr=function(){return Rr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Rr.apply(this,arguments)},Lr=function(){function t(t,e,n){this.instrumentationName=t,this.instrumentationVersion=e,this._config={},this._wrap=Or.wrap,this._unwrap=Or.unwrap,this._massWrap=Or.massWrap,this._massUnwrap=Or.massUnwrap,this.setConfig(n),this._diag=It.createComponentLogger({namespace:t}),this._tracer=qt.getTracer(t,e),this._meter=xt.getMeter(t,e),this._logger=gr.getLogger(t,e),this._updateMetricInstruments()}return Object.defineProperty(t.prototype,"meter",{get:function(){return this._meter},enumerable:!1,configurable:!0}),t.prototype.setMeterProvider=function(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()},Object.defineProperty(t.prototype,"logger",{get:function(){return this._logger},enumerable:!1,configurable:!0}),t.prototype.setLoggerProvider=function(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)},t.prototype.getModuleDefinitions=function(){var t,e=null!==(t=this.init())&&void 0!==t?t:[];return Array.isArray(e)?e:[e]},t.prototype._updateMetricInstruments=function(){},t.prototype.getConfig=function(){return this._config},t.prototype.setConfig=function(t){this._config=Rr({enabled:!0},t)},t.prototype.setTracerProvider=function(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)},Object.defineProperty(t.prototype,"tracer",{get:function(){return this._tracer},enumerable:!1,configurable:!0}),t.prototype._runSpanCustomizationHook=function(t,e,n,r){if(t)try{t(n,r)}catch(t){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:e},t)}},t}(),Pr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wr=function(t){function e(e,n,r){var o=t.call(this,e,n,r)||this;return o._config.enabled&&o.enable(),o}return Pr(e,t),e}(Lr);function Ar(t,e,n){var r,o;try{o=t()}catch(t){r=t}finally{if(e(r,o),r&&!n)throw r;return o}}function Cr(t){return"function"==typeof t&&"function"==typeof t.__original&&"function"==typeof t.__unwrap&&!0===t.__wrapped}var kr,Ir=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Nr=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Dr=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},xr=function(){function t(t,e,n,r,o,i,a,s,u,c){void 0===a&&(a=[]),this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:Lt.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=n,this._spanContext=r,this.parentSpanId=i,this.kind=o,this.links=a;var l=Date.now();this._performanceStartTime=Ce.now(),this._performanceOffset=l-(this._performanceStartTime+qe()),this._startTimeProvided=null!=s,this.startTime=this._getTime(null!=s?s:l),this.resource=t.resource,this.instrumentationLibrary=t.instrumentationLibrary,this._spanLimits=t.getSpanLimits(),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,null!=c&&this.setAttributes(c),this._spanProcessor=t.getActiveSpanProcessor(),this._spanProcessor.onStart(this,e)}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(t,e){return null==e||this._isSpanEnded()?this:0===t.length?(It.warn("Invalid attribute key: "+t),this):oe(e)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,t)?(this._droppedAttributesCount++,this):(this.attributes[t]=this._truncateToSize(e),this):(It.warn("Invalid attribute value set for key: "+t),this)},t.prototype.setAttributes=function(t){var e,n;try{for(var r=Ir(Object.entries(t)),o=r.next();!o.done;o=r.next()){var i=Nr(o.value,2),a=i[0],s=i[1];this.setAttribute(a,s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return this},t.prototype.addEvent=function(t,e,n){if(this._isSpanEnded())return this;if(0===this._spanLimits.eventCountLimit)return It.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(0===this._droppedEventsCount&&It.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),Qe(e)&&(Qe(n)||(n=e),e=void 0);var r=ne(e);return this.events.push({name:t,attributes:r,time:this._getTime(n),droppedAttributesCount:0}),this},t.prototype.addLink=function(t){return this.links.push(t),this},t.prototype.addLinks=function(t){var e;return(e=this.links).push.apply(e,Dr([],Nr(t),!1)),this},t.prototype.setStatus=function(t){return this._isSpanEnded()||(this.status=t),this},t.prototype.updateName=function(t){return this._isSpanEnded()||(this.name=t),this},t.prototype.end=function(t){this._isSpanEnded()?It.error(this.name+" "+this._spanContext.traceId+"-"+this._spanContext.spanId+" - You can only call end() on a span once."):(this._ended=!0,this.endTime=this._getTime(t),this._duration=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return r<0&&(n-=1,r+=Xe),[n,r]}(this.startTime,this.endTime),this._duration[0]<0&&(It.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&&It.warn("Dropped "+this._droppedEventsCount+" events because eventCountLimit reached"),this._spanProcessor.onEnd(this))},t.prototype._getTime=function(t){if("number"==typeof t&&t<Ce.now())return We(t+this._performanceOffset);if("number"==typeof t)return Ve(t);if(t instanceof Date)return Ve(t.getTime());if($e(t))return t;if(this._startTimeProvided)return Ve(Date.now());var e=Ce.now()-this._performanceStartTime;return Je(this.startTime,Ve(e))},t.prototype.isRecording=function(){return!1===this._ended},t.prototype.recordException=function(t,e){var n={};"string"==typeof t?n[Ie]=t:t&&(t.code?n[ke]=t.code.toString():t.name&&(n[ke]=t.name),t.message&&(n[Ie]=t.message),t.stack&&(n["exception.stacktrace"]=t.stack)),n[ke]||n[Ie]?this.addEvent("exception",n,e):It.warn("Failed to record an exception "+t)},Object.defineProperty(t.prototype,"duration",{get:function(){return this._duration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ended",{get:function(){return this._ended},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedAttributesCount",{get:function(){return this._droppedAttributesCount},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedEventsCount",{get:function(){return this._droppedEventsCount},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedLinksCount",{get:function(){return this._droppedLinksCount},enumerable:!1,configurable:!0}),t.prototype._isSpanEnded=function(){return this._ended&&It.warn("Can not execute the operation on ended Span {traceId: "+this._spanContext.traceId+", spanId: "+this._spanContext.spanId+"}"),this._ended},t.prototype._truncateToLimitUtil=function(t,e){return t.length<=e?t:t.substr(0,e)},t.prototype._truncateToSize=function(t){var e=this,n=this._attributeValueLengthLimit;return n<=0?(It.warn("Attribute value limit must be positive, got "+n),t):"string"==typeof t?this._truncateToLimitUtil(t,n):Array.isArray(t)?t.map((function(t){return"string"==typeof t?e._truncateToLimitUtil(t,n):t})):t},t}();!function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(kr||(kr={}));var Mr=function(){function t(){}return t.prototype.shouldSample=function(){return{decision:kr.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t}(),jr=function(){function t(){}return t.prototype.shouldSample=function(){return{decision:kr.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t}(),Ur=function(){function t(t){var e,n,r,o;this._root=t.root,this._root||(ue(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new jr),this._remoteParentSampled=null!==(e=t.remoteParentSampled)&&void 0!==e?e:new jr,this._remoteParentNotSampled=null!==(n=t.remoteParentNotSampled)&&void 0!==n?n:new Mr,this._localParentSampled=null!==(r=t.localParentSampled)&&void 0!==r?r:new jr,this._localParentNotSampled=null!==(o=t.localParentNotSampled)&&void 0!==o?o:new Mr}return t.prototype.shouldSample=function(t,e,n,r,o,i){var a=qt.getSpanContext(t);return a&&Tt(a)?a.isRemote?a.traceFlags&w.SAMPLED?this._remoteParentSampled.shouldSample(t,e,n,r,o,i):this._remoteParentNotSampled.shouldSample(t,e,n,r,o,i):a.traceFlags&w.SAMPLED?this._localParentSampled.shouldSample(t,e,n,r,o,i):this._localParentNotSampled.shouldSample(t,e,n,r,o,i):this._root.shouldSample(t,e,n,r,o,i)},t.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},t}(),Br=function(){function t(t){void 0===t&&(t=0),this._ratio=t,this._ratio=this._normalize(t),this._upperBound=Math.floor(4294967295*this._ratio)}return t.prototype.shouldSample=function(t,e){return{decision:yt(e)&&this._accumulate(e)<this._upperBound?kr.RECORD_AND_SAMPLED:kr.NOT_RECORD}},t.prototype.toString=function(){return"TraceIdRatioBased{"+this._ratio+"}"},t.prototype._normalize=function(t){return"number"!=typeof t||isNaN(t)?0:t>=1?1:t<=0?0:t},t.prototype._accumulate=function(t){for(var e=0,n=0;n<t.length/8;n++){var r=8*n;e=(e^parseInt(t.slice(r,r+8),16))>>>0}return e},t}(),Zr=Le(),zr=ae.AlwaysOn,Hr=1;function Fr(){var t=Le();return{sampler:Gr(Zr),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:t.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:t.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:t.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:t.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT}}}function Gr(t){switch(void 0===t&&(t=Le()),t.OTEL_TRACES_SAMPLER){case ae.AlwaysOn:return new jr;case ae.AlwaysOff:return new Mr;case ae.ParentBasedAlwaysOn:return new Ur({root:new jr});case ae.ParentBasedAlwaysOff:return new Ur({root:new Mr});case ae.TraceIdRatio:return new Br(Xr(t));case ae.ParentBasedTraceIdRatio:return new Ur({root:new Br(Xr(t))});default:return It.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+zr+'".'),new jr}}function Xr(t){if(void 0===t.OTEL_TRACES_SAMPLER_ARG||""===t.OTEL_TRACES_SAMPLER_ARG)return It.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+Hr+"."),Hr;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(It.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+Hr+"."),Hr):e<0||e>1?(It.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+Hr+"."),Hr):e}function Vr(t){var e,n,r,o,i,a,s,u,c,l,p,f,h=Object.assign({},t.spanLimits),d=Oe(Re);return h.attributeCountLimit=null!==(a=null!==(i=null!==(o=null!==(n=null===(e=t.spanLimits)||void 0===e?void 0:e.attributeCountLimit)&&void 0!==n?n:null===(r=t.generalLimits)||void 0===r?void 0:r.attributeCountLimit)&&void 0!==o?o:d.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)&&void 0!==i?i:d.OTEL_ATTRIBUTE_COUNT_LIMIT)&&void 0!==a?a:ge,h.attributeValueLengthLimit=null!==(f=null!==(p=null!==(l=null!==(u=null===(s=t.spanLimits)||void 0===s?void 0:s.attributeValueLengthLimit)&&void 0!==u?u:null===(c=t.generalLimits)||void 0===c?void 0:c.attributeValueLengthLimit)&&void 0!==l?l:d.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)&&void 0!==p?p:d.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)&&void 0!==f?f:ve,Object.assign({},t,{spanLimits:h})}var qr=function(){function t(t,e){this._exporter=t,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=Le();this._maxExportBatchSize="number"==typeof(null==e?void 0:e.maxExportBatchSize)?e.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize="number"==typeof(null==e?void 0:e.maxQueueSize)?e.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis="number"==typeof(null==e?void 0:e.scheduledDelayMillis)?e.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis="number"==typeof(null==e?void 0:e.exportTimeoutMillis)?e.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new Bn(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(It.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}return t.prototype.forceFlush=function(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()},t.prototype.onStart=function(t,e){},t.prototype.onEnd=function(t){this._shutdownOnce.isCalled||t.spanContext().traceFlags&w.SAMPLED&&this._addToBuffer(t)},t.prototype.shutdown=function(){return this._shutdownOnce.call()},t.prototype._shutdown=function(){var t=this;return Promise.resolve().then((function(){return t.onShutdown()})).then((function(){return t._flushAll()})).then((function(){return t._exporter.shutdown()}))},t.prototype._addToBuffer=function(t){if(this._finishedSpans.length>=this._maxQueueSize)return 0===this._droppedSpansCount&&It.debug("maxQueueSize reached, dropping spans"),void this._droppedSpansCount++;this._droppedSpansCount>0&&(It.warn("Dropped "+this._droppedSpansCount+" spans because maxQueueSize reached"),this._droppedSpansCount=0),this._finishedSpans.push(t),this._maybeStartTimer()},t.prototype._flushAll=function(){var t=this;return new Promise((function(e,n){for(var r=[],o=0,i=Math.ceil(t._finishedSpans.length/t._maxExportBatchSize);o<i;o++)r.push(t._flushOneBatch());Promise.all(r).then((function(){e()})).catch(n)}))},t.prototype._flushOneBatch=function(){var t=this;return this._clearTimer(),0===this._finishedSpans.length?Promise.resolve():new Promise((function(e,n){var r=setTimeout((function(){n(new Error("Timeout"))}),t._exportTimeoutMillis);kt.with(function(t){return t.setValue(Wt,!0)}(kt.active()),(function(){var o;t._finishedSpans.length<=t._maxExportBatchSize?(o=t._finishedSpans,t._finishedSpans=[]):o=t._finishedSpans.splice(0,t._maxExportBatchSize);for(var i=function(){return t._exporter.export(o,(function(t){var o;clearTimeout(r),t.code===Fe.SUCCESS?e():n(null!==(o=t.error)&&void 0!==o?o:new Error("BatchSpanProcessor: span export failed"))}))},a=null,s=0,u=o.length;s<u;s++){var c=o[s];c.resource.asyncAttributesPending&&c.resource.waitForAsyncAttributes&&(null!=a||(a=[]),a.push(c.resource.waitForAsyncAttributes()))}null===a?i():Promise.all(a).then(i,(function(t){ue(t),n(t)}))}))}))},t.prototype._maybeStartTimer=function(){var t=this;if(!this._isExporting){var e=function(){t._isExporting=!0,t._flushOneBatch().finally((function(){t._isExporting=!1,t._finishedSpans.length>0&&(t._clearTimer(),t._maybeStartTimer())})).catch((function(e){t._isExporting=!1,ue(e)}))};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout((function(){return e()}),this._scheduledDelayMillis),this._timer)}},t.prototype._clearTimer=function(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)},t}(),Wr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kr=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.onInit(n),r}return Wr(e,t),e.prototype.onInit=function(t){var e=this;!0!==(null==t?void 0:t.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this._visibilityChangeListener=function(){"hidden"===document.visibilityState&&e.forceFlush()},this._pageHideListener=function(){e.forceFlush()},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))},e.prototype.onShutdown=function(){"undefined"!=typeof document&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))},e}(qr),Yr=function(){this.generateTraceId=Qr(16),this.generateSpanId=Qr(8)},$r=Array(32);function Qr(t){return function(){for(var e=0;e<2*t;e++)$r[e]=Math.floor(16*Math.random())+48,$r[e]>=58&&($r[e]+=39);return String.fromCharCode.apply(null,$r.slice(0,2*t))}}var Jr,to=function(){function t(t,e,n){this._tracerProvider=n;var r,o,i,a,s=(r=e,o={sampler:Gr()},i=Fr(),(a=Object.assign({},i,o,r)).generalLimits=Object.assign({},i.generalLimits,r.generalLimits||{}),a.spanLimits=Object.assign({},i.spanLimits,r.spanLimits||{}),a);this._sampler=s.sampler,this._generalLimits=s.generalLimits,this._spanLimits=s.spanLimits,this._idGenerator=e.idGenerator||new Yr,this.resource=n.resource,this.instrumentationLibrary=t}return t.prototype.startSpan=function(t,e,n){var r,o,i;void 0===e&&(e={}),void 0===n&&(n=kt.active()),e.root&&(n=qt.deleteSpan(n));var a=qt.getSpan(n);if(Kt(n))return It.debug("Instrumentation suppressed, returning Noop Span"),qt.wrapSpanContext(ut);var s,u,c,l=null==a?void 0:a.spanContext(),p=this._idGenerator.generateSpanId();l&&qt.isSpanContextValid(l)?(s=l.traceId,u=l.traceState,c=l.spanId):s=this._idGenerator.generateTraceId();var f=null!==(r=e.kind)&&void 0!==r?r:Rt.INTERNAL,h=(null!==(o=e.links)&&void 0!==o?o:[]).map((function(t){return{context:t.context,attributes:ne(t.attributes)}})),d=ne(e.attributes),_=this._sampler.shouldSample(n,s,t,f,d,h);u=null!==(i=_.traceState)&&void 0!==i?i:u;var v={traceId:s,spanId:p,traceFlags:_.decision===Ot.RECORD_AND_SAMPLED?w.SAMPLED:w.NONE,traceState:u};if(_.decision===Ot.NOT_RECORD)return It.debug("Recording is off, propagating context in a non-recording span"),qt.wrapSpanContext(v);var g=ne(Object.assign(d,_.attributes));return new xr(this,n,t,v,f,c,h,e.startTime,void 0,g)},t.prototype.startActiveSpan=function(t,e,n,r){var o,i,a;if(!(arguments.length<2)){2===arguments.length?a=e:3===arguments.length?(o=e,a=n):(o=e,i=n,a=r);var s=null!=i?i:kt.active(),u=this.startSpan(t,o,s),c=qt.setSpan(s,u);return kt.with(c,a,void 0,u)}},t.prototype.getGeneralLimits=function(){return this._generalLimits},t.prototype.getSpanLimits=function(){return this._spanLimits},t.prototype.getActiveSpanProcessor=function(){return this._tracerProvider.getActiveSpanProcessor()},t}(),eo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},no=function(){function t(t){this._spanProcessors=t}return t.prototype.forceFlush=function(){var t,e,n=[];try{for(var r=eo(this._spanProcessors),o=r.next();!o.done;o=r.next()){var i=o.value;n.push(i.forceFlush())}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return new Promise((function(t){Promise.all(n).then((function(){t()})).catch((function(e){ue(e||new Error("MultiSpanProcessor: forceFlush failed")),t()}))}))},t.prototype.onStart=function(t,e){var n,r;try{for(var o=eo(this._spanProcessors),i=o.next();!i.done;i=o.next()){i.value.onStart(t,e)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},t.prototype.onEnd=function(t){var e,n;try{for(var r=eo(this._spanProcessors),o=r.next();!o.done;o=r.next()){o.value.onEnd(t)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.shutdown=function(){var t,e,n=[];try{for(var r=eo(this._spanProcessors),o=r.next();!o.done;o=r.next()){var i=o.value;n.push(i.shutdown())}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return new Promise((function(t,e){Promise.all(n).then((function(){t()}),e)}))},t}(),ro=function(){function t(){}return t.prototype.onStart=function(t,e){},t.prototype.onEnd=function(t){},t.prototype.shutdown=function(){return Promise.resolve()},t.prototype.forceFlush=function(){return Promise.resolve()},t}();!function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"}(Jr||(Jr={}));var oo,io,ao,so=function(){function t(t){var e;void 0===t&&(t={}),this._registeredSpanProcessors=[],this._tracers=new Map;var n=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=t.shift(),r=new WeakMap;t.length>0;)n=Pn(n,t.shift(),0,r);return n}({},Fr(),Vr(t));this.resource=null!==(e=n.resource)&&void 0!==e?e:sr.empty(),this.resource=sr.default().merge(this.resource),this._config=Object.assign({},n,{resource:this.resource});var r=this._buildExporterFromEnv();if(void 0!==r){var o=new Kr(r);this.activeSpanProcessor=o}else this.activeSpanProcessor=new ro}return t.prototype.getTracer=function(t,e,n){var r=t+"@"+(e||"")+":"+((null==n?void 0:n.schemaUrl)||"");return this._tracers.has(r)||this._tracers.set(r,new to({name:t,version:e,schemaUrl:null==n?void 0:n.schemaUrl},this._config,this)),this._tracers.get(r)},t.prototype.addSpanProcessor=function(t){0===this._registeredSpanProcessors.length&&this.activeSpanProcessor.shutdown().catch((function(t){return It.error("Error while trying to shutdown current span processor",t)})),this._registeredSpanProcessors.push(t),this.activeSpanProcessor=new no(this._registeredSpanProcessors)},t.prototype.getActiveSpanProcessor=function(){return this.activeSpanProcessor},t.prototype.register=function(t){void 0===t&&(t={}),qt.setGlobalTracerProvider(this),void 0===t.propagator&&(t.propagator=this._buildPropagatorFromEnv()),t.contextManager&&kt.setGlobalContextManager(t.contextManager),t.propagator&&Xt.setGlobalPropagator(t.propagator)},t.prototype.forceFlush=function(){var t=this._config.forceFlushTimeoutMillis,e=this._registeredSpanProcessors.map((function(e){return new Promise((function(n){var r,o=setTimeout((function(){n(new Error("Span processor did not completed within timeout period of "+t+" ms")),r=Jr.timeout}),t);e.forceFlush().then((function(){clearTimeout(o),r!==Jr.timeout&&(r=Jr.resolved,n(r))})).catch((function(t){clearTimeout(o),r=Jr.error,n(t)}))}))}));return new Promise((function(t,n){Promise.all(e).then((function(e){var r=e.filter((function(t){return t!==Jr.resolved}));r.length>0?n(r):t()})).catch((function(t){return n([t])}))}))},t.prototype.shutdown=function(){return this.activeSpanProcessor.shutdown()},t.prototype._getPropagator=function(t){var e;return null===(e=this.constructor._registeredPropagators.get(t))||void 0===e?void 0:e()},t.prototype._getSpanExporter=function(t){var e;return null===(e=this.constructor._registeredExporters.get(t))||void 0===e?void 0:e()},t.prototype._buildPropagatorFromEnv=function(){var t=this,e=Array.from(new Set(Le().OTEL_PROPAGATORS)),n=e.map((function(e){var n=t._getPropagator(e);return n||It.warn('Propagator "'+e+'" requested through environment variable is unavailable.'),n})).reduce((function(t,e){return e&&t.push(e),t}),[]);return 0===n.length?void 0:1===e.length?n[0]:new en({propagators:n})},t.prototype._buildExporterFromEnv=function(){var t=Le().OTEL_TRACES_EXPORTER;if("none"!==t&&""!==t){var e=this._getSpanExporter(t);return e||It.error('Exporter "'+t+'" requested through environment variable is unavailable.'),e}},t._registeredPropagators=new Map([["tracecontext",function(){return new hn}],["baggage",function(){return new Jt}]]),t._registeredExporters=new Map,t}(),uo=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},co=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},lo=function(){function t(){this._enabled=!1,this._currentContext=C}return t.prototype._bindFunction=function(t,e){void 0===t&&(t=C);var n=this,r=function(){for(var r=this,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.with(t,(function(){return e.apply(r,o)}))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:e.length}),r},t.prototype.active=function(){return this._currentContext},t.prototype.bind=function(t,e){return void 0===t&&(t=this.active()),"function"==typeof e?this._bindFunction(t,e):e},t.prototype.disable=function(){return this._currentContext=C,this._enabled=!1,this},t.prototype.enable=function(){return this._enabled||(this._enabled=!0,this._currentContext=C),this},t.prototype.with=function(t,e,n){for(var r=[],o=3;o<arguments.length;o++)r[o-3]=arguments[o];var i=this._currentContext;this._currentContext=t||C;try{return e.call.apply(e,co([n],uo(r),!1))}finally{this._currentContext=i}},t}(),po=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fo=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;if(e.contextManager)throw"contextManager should be defined in register method not in constructor";if(e.propagator)throw"propagator should be defined in register method not in constructor";return n}return po(e,t),e.prototype.register=function(e){void 0===e&&(e={}),void 0===e.contextManager&&(e.contextManager=new lo),e.contextManager&&e.contextManager.enable(),t.prototype.register.call(this,e)},e}(so);function ho(t,e){return e in t}function _o(t,e,n,r){var o=void 0,i=void 0;ho(n,e)&&"number"==typeof n[e]&&(o=n[e]);var a=oo.FETCH_START;if(ho(n,a)&&"number"==typeof n[a]&&(i=n[a]),void 0!==o&&void 0!==i&&o>=i)return t.addEvent(e,o),t}function vo(t,e){_o(t,oo.FETCH_START,e),_o(t,oo.DOMAIN_LOOKUP_START,e),_o(t,oo.DOMAIN_LOOKUP_END,e),_o(t,oo.CONNECT_START,e),ho(e,"name")&&e.name.startsWith("https:")&&_o(t,oo.SECURE_CONNECTION_START,e),_o(t,oo.CONNECT_END,e),_o(t,oo.REQUEST_START,e),_o(t,oo.RESPONSE_START,e),_o(t,oo.RESPONSE_END,e);var n=e[oo.ENCODED_BODY_SIZE];void 0!==n&&t.setAttribute("http.response_content_length",n);var r=e[oo.DECODED_BODY_SIZE];void 0!==r&&n!==r&&t.setAttribute("http.response_content_length_uncompressed",r)}function go(){return"undefined"!=typeof location?location.origin:void 0}function Eo(t,e,n,r,o,i){void 0===o&&(o=new WeakSet);var a=yo(t),s=function(t,e,n,r,o,i){var a=Ye(e),s=Ye(n),u=r.filter((function(e){var n=Ye(Ke(e[oo.FETCH_START])),r=Ye(Ke(e[oo.RESPONSE_END]));return e.initiatorType.toLowerCase()===(i||"xmlhttprequest")&&e.name===t&&n>=a&&r<=s}));u.length>0&&(u=u.filter((function(t){return!o.has(t)})));return u}(t=a.toString(),e,n,r,o,i);if(0===s.length)return{mainRequest:void 0};if(1===s.length)return{mainRequest:s[0]};var u=function(t){return t.slice().sort((function(t,e){var n=t[oo.FETCH_START],r=e[oo.FETCH_START];return n>r?1:n<r?-1:0}))}(s);if(a.origin!==go()&&u.length>1){var c=u[0],l=function(t,e,n){for(var r,o=Ye(n),i=Ye(Ke(e)),a=t[1],s=t.length,u=1;u<s;u++){var c=t[u],l=Ye(Ke(c[oo.FETCH_START])),p=o-Ye(Ke(c[oo.RESPONSE_END]));l>=i&&(!r||p<r)&&(r=p,a=c)}return a}(u,c[oo.RESPONSE_END],n),p=c[oo.RESPONSE_END];return l[oo.FETCH_START]<p&&(l=c,c=void 0),{corsPreFlightRequest:c,mainRequest:l}}return{mainRequest:s[0]}}function yo(t){if("function"==typeof URL)return new URL(t,"undefined"!=typeof document?document.baseURI:"undefined"!=typeof location?location.href:void 0);var e=(io||(io=document.createElement("a")),io);return e.href=t,e}function To(t,e){var n=e||[];return("string"==typeof n||n instanceof RegExp)&&(n=[n]),yo(t).origin===go()||n.some((function(e){return Dn(t,e)}))}!function(t){t.CONNECT_END="connectEnd",t.CONNECT_START="connectStart",t.DECODED_BODY_SIZE="decodedBodySize",t.DOM_COMPLETE="domComplete",t.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",t.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",t.DOM_INTERACTIVE="domInteractive",t.DOMAIN_LOOKUP_END="domainLookupEnd",t.DOMAIN_LOOKUP_START="domainLookupStart",t.ENCODED_BODY_SIZE="encodedBodySize",t.FETCH_START="fetchStart",t.LOAD_EVENT_END="loadEventEnd",t.LOAD_EVENT_START="loadEventStart",t.NAVIGATION_START="navigationStart",t.REDIRECT_END="redirectEnd",t.REDIRECT_START="redirectStart",t.REQUEST_START="requestStart",t.RESPONSE_END="responseEnd",t.RESPONSE_START="responseStart",t.SECURE_CONNECTION_START="secureConnectionStart",t.UNLOAD_EVENT_END="unloadEventEnd",t.UNLOAD_EVENT_START="unloadEventStart"}(oo||(oo={})),function(t){t.COMPONENT="component",t.HTTP_ERROR_NAME="http.error_name",t.HTTP_STATUS_TEXT="http.status_text"}(ao||(ao={}));var mo,bo,So="0.53.0",Oo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ro="object"==typeof process&&"node"===(null===(mo=process.release)||void 0===mo?void 0:mo.name),Lo=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,"@opentelemetry/instrumentation-fetch",So,e)||this;return n.component="fetch",n.version=So,n.moduleName=n.component,n._usedResources=new WeakSet,n._tasksCount=0,n}return Oo(e,t),e.prototype.init=function(){},e.prototype._addChildSpan=function(t,e){var n=this.tracer.startSpan("CORS Preflight",{startTime:e[oo.FETCH_START]},qt.setSpan(kt.active(),t));this.getConfig().ignoreNetworkEvents||vo(n,e),n.end(e[oo.RESPONSE_END])},e.prototype._addFinalSpanAttributes=function(t,e){var n=yo(e.url);t.setAttribute(je,e.status),null!=e.statusText&&t.setAttribute(ao.HTTP_STATUS_TEXT,e.statusText),t.setAttribute(xe,n.host),t.setAttribute(Me,n.protocol.replace(":","")),"undefined"!=typeof navigator&&t.setAttribute(Ue,navigator.userAgent)},e.prototype._addHeaders=function(t,e){if(!To(e,this.getConfig().propagateTraceHeaderCorsUrls)){var n={};return Xt.inject(kt.active(),n),void(Object.keys(n).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(t instanceof Request)Xt.inject(kt.active(),t.headers,{set:function(t,e,n){return t.set(e,"string"==typeof n?n:String(n))}});else if(t.headers instanceof Headers)Xt.inject(kt.active(),t.headers,{set:function(t,e,n){return t.set(e,"string"==typeof n?n:String(n))}});else if(t.headers instanceof Map)Xt.inject(kt.active(),t.headers,{set:function(t,e,n){return t.set(e,"string"==typeof n?n:String(n))}});else{n={};Xt.inject(kt.active(),n),t.headers=Object.assign({},n,t.headers||{})}},e.prototype._clearResources=function(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)},e.prototype._createSpan=function(t,e){var n;if(void 0===e&&(e={}),!xn(t,this.getConfig().ignoreUrls)){var r=(e.method||"GET").toUpperCase(),o="HTTP "+r;return this.tracer.startSpan(o,{kind:Rt.CLIENT,attributes:(n={},n[ao.COMPONENT]=this.moduleName,n[Ne]=r,n[De]=t,n)})}this._diag.debug("ignoring span as url matches ignored url")},e.prototype._findResourceAndAddNetworkEvents=function(t,e,n){var r=e.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType("resource")}var o=Eo(e.spanUrl,e.startTime,n,r,this._usedResources,"fetch");if(o.mainRequest){var i=o.mainRequest;this._markResourceAsUsed(i);var a=o.corsPreFlightRequest;a&&(this._addChildSpan(t,a),this._markResourceAsUsed(a)),this.getConfig().ignoreNetworkEvents||vo(t,i)}},e.prototype._markResourceAsUsed=function(t){this._usedResources.add(t)},e.prototype._endSpan=function(t,e,n){var r=this,o=Ve(Date.now()),i=We();this._addFinalSpanAttributes(t,n),setTimeout((function(){var n;null===(n=e.observer)||void 0===n||n.disconnect(),r._findResourceAndAddNetworkEvents(t,e,i),r._tasksCount--,r._clearResources(),t.end(o)}),300)},e.prototype._patchConstructor=function(){var t=this;return function(e){var n=t;return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var o=this,i=yo(t[0]instanceof Request?t[0].url:String(t[0])).href,a=t[0]instanceof Request?t[0]:t[1]||{},s=n._createSpan(i,a);if(!s)return e.apply(this,t);var u=n._prepareSpanData(i);function c(t,e){n._applyAttributesAfterFetch(t,a,e),n._endSpan(t,u,{status:e.status||0,statusText:e.message,url:i})}function l(t,e){n._applyAttributesAfterFetch(t,a,e),e.status>=200&&e.status<400?n._endSpan(t,u,e):n._endSpan(t,u,{status:e.status,statusText:e.statusText,url:i})}function p(t,e,n){try{var r=n.clone(),o=n.clone(),i=r.body;if(i){var a=i.getReader(),s=function(){a.read().then((function(e){e.done?l(t,o):s()}),(function(e){c(t,e)}))};s()}else l(t,n)}finally{e(n)}}function f(t,e,n){try{c(t,n)}finally{e(n)}}return new Promise((function(t,r){return kt.with(qt.setSpan(kt.active(),s),(function(){return n._addHeaders(a,i),n._tasksCount++,e.apply(o,a instanceof Request?[a]:[i,a]).then(p.bind(o,s,t),f.bind(o,s,r))}))}))}}},e.prototype._applyAttributesAfterFetch=function(t,e,n){var r=this,o=this.getConfig().applyCustomAttributesOnSpan;o&&Ar((function(){return o(t,e,n)}),(function(t){t&&r._diag.error("applyCustomAttributesOnSpan",t)}),!0)},e.prototype._prepareSpanData=function(t){var e=We(),n=[];if("function"!=typeof PerformanceObserver)return{entries:n,startTime:e,spanUrl:t};var r=new PerformanceObserver((function(e){e.getEntries().forEach((function(e){"fetch"===e.initiatorType&&e.name===t&&n.push(e)}))}));return r.observe({entryTypes:["resource"]}),{entries:n,observer:r,startTime:e,spanUrl:t}},e.prototype.enable=function(){Ro?this._diag.warn("this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()"):(Cr(fetch)&&(this._unwrap(Re,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(Re,"fetch",this._patchConstructor()))},e.prototype.disable=function(){Ro||(this._unwrap(Re,"fetch"),this._usedResources=new WeakSet)},e}(wr);!function(t){t.METHOD_OPEN="open",t.METHOD_SEND="send",t.EVENT_ABORT="abort",t.EVENT_ERROR="error",t.EVENT_LOAD="loaded",t.EVENT_TIMEOUT="timeout"}(bo||(bo={}));var Po,wo="0.53.0";!function(t){t.HTTP_STATUS_TEXT="http.status_text"}(Po||(Po={}));var Ao=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Co=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,"@opentelemetry/instrumentation-xml-http-request",wo,e)||this;return n.component="xml-http-request",n.version=wo,n.moduleName=n.component,n._tasksCount=0,n._xhrMem=new WeakMap,n._usedResources=new WeakSet,n}return Ao(e,t),e.prototype.init=function(){},e.prototype._addHeaders=function(t,e){if(!To(yo(e).href,this.getConfig().propagateTraceHeaderCorsUrls)){var n={};return Xt.inject(kt.active(),n),void(Object.keys(n).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}var r={};Xt.inject(kt.active(),r),Object.keys(r).forEach((function(e){t.setRequestHeader(e,String(r[e]))}))},e.prototype._addChildSpan=function(t,e){var n=this;kt.with(qt.setSpan(kt.active(),t),(function(){var t=n.tracer.startSpan("CORS Preflight",{startTime:e[oo.FETCH_START]});n.getConfig().ignoreNetworkEvents||vo(t,e),t.end(e[oo.RESPONSE_END])}))},e.prototype._addFinalSpanAttributes=function(t,e,n){if("string"==typeof n){var r=yo(n);void 0!==e.status&&t.setAttribute(je,e.status),void 0!==e.statusText&&t.setAttribute(Po.HTTP_STATUS_TEXT,e.statusText),t.setAttribute(xe,r.host),t.setAttribute(Me,r.protocol.replace(":","")),t.setAttribute(Ue,navigator.userAgent)}},e.prototype._applyAttributesAfterXHR=function(t,e){var n=this,r=this.getConfig().applyCustomAttributesOnSpan;"function"==typeof r&&Ar((function(){return r(t,e)}),(function(t){t&&n._diag.error("applyCustomAttributesOnSpan",t)}),!0)},e.prototype._addResourceObserver=function(t,e){var n=this._xhrMem.get(t);n&&"function"==typeof PerformanceObserver&&"function"==typeof PerformanceResourceTiming&&(n.createdResources={observer:new PerformanceObserver((function(t){var r=t.getEntries(),o=yo(e);r.forEach((function(t){"xmlhttprequest"===t.initiatorType&&t.name===o.href&&n.createdResources&&n.createdResources.entries.push(t)}))})),entries:[]},n.createdResources.observer.observe({entryTypes:["resource"]}))},e.prototype._clearResources=function(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(Ce.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)},e.prototype._findResourceAndAddNetworkEvents=function(t,e,n,r,o){if(n&&r&&o&&t.createdResources){var i=t.createdResources.entries;i&&i.length||(i=Ce.getEntriesByType("resource"));var a=Eo(yo(n).href,r,o,i,this._usedResources);if(a.mainRequest){var s=a.mainRequest;this._markResourceAsUsed(s);var u=a.corsPreFlightRequest;u&&(this._addChildSpan(e,u),this._markResourceAsUsed(u)),this.getConfig().ignoreNetworkEvents||vo(e,s)}}},e.prototype._cleanPreviousSpanInformation=function(t){var e=this._xhrMem.get(t);if(e){var n=e.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(t)}},e.prototype._createSpan=function(t,e,n){var r;if(!xn(e,this.getConfig().ignoreUrls)){var o=n.toUpperCase(),i=this.tracer.startSpan(o,{kind:Rt.CLIENT,attributes:(r={},r[Ne]=n,r[De]=yo(e).toString(),r)});return i.addEvent(bo.METHOD_OPEN),this._cleanPreviousSpanInformation(t),this._xhrMem.set(t,{span:i,spanUrl:e}),i}this._diag.debug("ignoring span as url matches ignored url")},e.prototype._markResourceAsUsed=function(t){this._usedResources.add(t)},e.prototype._patchOpen=function(){var t=this;return function(e){var n=t;return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var o=t[0],i=t[1];return n._createSpan(this,i,o),e.apply(this,t)}}},e.prototype._patchSend=function(){var t=this;function e(e,n){var r=t._xhrMem.get(n);if(r){r.status=n.status,r.statusText=n.statusText,t._xhrMem.delete(n),r.span&&t._applyAttributesAfterXHR(r.span,n);var o=We(),i=Date.now();setTimeout((function(){!function(e,n,r,o){var i=n.callbackToRemoveEvents;"function"==typeof i&&i();var a=n.span,s=n.spanUrl,u=n.sendStartTime;a&&(t._findResourceAndAddNetworkEvents(n,a,s,u,r),a.addEvent(e,o),t._addFinalSpanAttributes(a,n,s),a.end(o),t._tasksCount--),t._clearResources()}(e,r,o,i)}),300)}}function n(){e(bo.EVENT_ERROR,this)}function r(){e(bo.EVENT_ABORT,this)}function o(){e(bo.EVENT_TIMEOUT,this)}function i(){this.status<299?e(bo.EVENT_LOAD,this):e(bo.EVENT_ERROR,this)}return function(e){return function(){for(var a=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];var c=t._xhrMem.get(this);if(!c)return e.apply(this,s);var l=c.span,p=c.spanUrl;return l&&p&&kt.with(qt.setSpan(kt.active(),l),(function(){t._tasksCount++,c.sendStartTime=We(),l.addEvent(bo.METHOD_SEND),a.addEventListener("abort",r),a.addEventListener("error",n),a.addEventListener("load",i),a.addEventListener("timeout",o),c.callbackToRemoveEvents=function(){!function(e){e.removeEventListener("abort",r),e.removeEventListener("error",n),e.removeEventListener("load",i),e.removeEventListener("timeout",o);var a=t._xhrMem.get(e);a&&(a.callbackToRemoveEvents=void 0)}(a),c.createdResources&&c.createdResources.observer.disconnect()},t._addHeaders(a,p),t._addResourceObserver(a,p)})),e.apply(this,s)}}},e.prototype.enable=function(){this._diag.debug("applying patch to",this.moduleName,this.version),Cr(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),Cr(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())},e.prototype.disable=function(){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},e}(wr);function ko(t,e,n){Io(t,n instanceof Error?0:n.status)}function Io(t,e){if(null==e)return;(0===e||e>=400&&e<600)&&t.setStatus({code:Lt.ERROR})}function No(t){return(e,n,r)=>{ko(e,0,r),null==t||t(e,n,r)}}function Do(t){return(e,n)=>{!function(t,e){Io(t,e.status)}(e,n),null==t||t(e,n)}}function xo(t={}){const{fetchInstrumentationOptions:e,xhrInstrumentationOptions:n}=t,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["fetchInstrumentationOptions","xhrInstrumentationOptions"]),o=function(t,e){return Object.assign(Object.assign(Object.assign(Object.assign({},e),{ignoreNetworkEvents:!0}),t),{applyCustomAttributesOnSpan:No(null==t?void 0:t.applyCustomAttributesOnSpan)})}(e,r),i=function(t,e){return Object.assign(Object.assign(Object.assign(Object.assign({},e),{ignoreNetworkEvents:!0}),t),{applyCustomAttributesOnSpan:Do(null==t?void 0:t.applyCustomAttributesOnSpan)})}(n,r);return[new Lo(o),new Co(i)]}var Mo="OT_ZONE_CONTEXT",jo=function(){function t(){this._enabled=!1,this._zoneCounter=0}return t.prototype._activeContextFromZone=function(t){return t&&t.get(Mo)||C},t.prototype._bindFunction=function(t,e){var n=this,r=function(){for(var r=this,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.with(t,(function(){return e.apply(r,o)}))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:e.length}),r},t.prototype._bindListener=function(t,e){var n=e;return void 0!==n.__ot_listeners||(n.__ot_listeners={},"function"==typeof n.addEventListener&&(n.addEventListener=this._patchAddEventListener(n,n.addEventListener,t)),"function"==typeof n.removeEventListener&&(n.removeEventListener=this._patchRemoveEventListener(n,n.removeEventListener))),e},t.prototype._createZoneName=function(){this._zoneCounter++;var t=Math.random();return this._zoneCounter+"-"+t},t.prototype._createZone=function(t,e){var n;return Zone.current.fork({name:t,properties:(n={},n[Mo]=e,n)})},t.prototype._getActiveZone=function(){return Zone.current},t.prototype._patchAddEventListener=function(t,e,n){var r=this;return function(o,i,a){void 0===t.__ot_listeners&&(t.__ot_listeners={});var s=t.__ot_listeners[o];void 0===s&&(s=new WeakMap,t.__ot_listeners[o]=s);var u=r.bind(n,i);return s.set(i,u),e.call(this,o,u,a)}},t.prototype._patchRemoveEventListener=function(t,e){return function(n,r){if(void 0===t.__ot_listeners||void 0===t.__ot_listeners[n])return e.call(this,n,r);var o=t.__ot_listeners[n],i=o.get(r);return o.delete(r),e.call(this,n,i||r)}},t.prototype.active=function(){if(!this._enabled)return C;var t=this._getActiveZone(),e=this._activeContextFromZone(t);return e||C},t.prototype.bind=function(t,e){return void 0===t&&(t=this.active()),"function"==typeof e?this._bindFunction(t,e):(void 0===(n=e)&&(n={}),"function"==typeof n.addEventListener&&"function"==typeof n.removeEventListener&&this._bindListener(t,e),e);var n},t.prototype.disable=function(){return this._enabled=!1,this},t.prototype.enable=function(){return this._enabled=!0,this},t.prototype.with=function(t,e,n){for(var r=[],o=3;o<arguments.length;o++)r[o-3]=arguments[o];var i=this._createZoneName();return this._createZone(i,t).run(e,n,r)},t}();
1
+ var GrafanaFaroWebTracing=function(t,e){"use strict";var n="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},r="1.9.0",o=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var i=function(t){var e=new Set([t]),n=new Set,r=t.match(o);if(!r)return function(){return!1};var i=+r[1],a=+r[2],s=+r[3];if(null!=r[4])return function(e){return e===t};function u(t){return n.add(t),!1}function c(t){return e.add(t),!0}return function(t){if(e.has(t))return!0;if(n.has(t))return!1;var r=t.match(o);if(!r)return u(t);var l=+r[1],p=+r[2],f=+r[3];return null!=r[4]||i!==l?u(t):0===i?a===p&&s<=f?c(t):u(t):a<=p?c(t):u(t)}}(r),a=r.split(".")[0],s=Symbol.for("opentelemetry.js.api."+a),u=n;function c(t,e,n,o){var i;void 0===o&&(o=!1);var a=u[s]=null!==(i=u[s])&&void 0!==i?i:{version:r};if(!o&&a[t]){var c=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return n.error(c.stack||c.message),!1}if(a.version!==r){c=new Error("@opentelemetry/api: Registration of version v"+a.version+" for "+t+" does not match previously registered API v"+r);return n.error(c.stack||c.message),!1}return a[t]=e,n.debug("@opentelemetry/api: Registered a global for "+t+" v"+r+"."),!0}function l(t){var e,n,r=null===(e=u[s])||void 0===e?void 0:e.version;if(r&&i(r))return null===(n=u[s])||void 0===n?void 0:n[t]}function p(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+r+".");var n=u[s];n&&delete n[t]}var f,h=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},d=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},_=function(){function t(t){this._namespace=t.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return v("debug",this._namespace,t)},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return v("error",this._namespace,t)},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return v("info",this._namespace,t)},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return v("warn",this._namespace,t)},t.prototype.verbose=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return v("verbose",this._namespace,t)},t}();function v(t,e,n){var r=l("diag");if(r)return n.unshift(e),r[t].apply(r,d([],h(n),!1))}!function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"}(f||(f={}));var g=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},E=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},y=function(){function t(){function t(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=l("diag");if(r)return r[t].apply(r,E([],g(e),!1))}}var e=this;e.setLogger=function(t,n){var r,o,i;if(void 0===n&&(n={logLevel:f.INFO}),t===e){var a=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return e.error(null!==(r=a.stack)&&void 0!==r?r:a.message),!1}"number"==typeof n&&(n={logLevel:n});var s=l("diag"),u=function(t,e){function n(n,r){var o=e[n];return"function"==typeof o&&t>=r?o.bind(e):function(){}}return t<f.NONE?t=f.NONE:t>f.ALL&&(t=f.ALL),e=e||{},{error:n("error",f.ERROR),warn:n("warn",f.WARN),info:n("info",f.INFO),debug:n("debug",f.DEBUG),verbose:n("verbose",f.VERBOSE)}}(null!==(o=n.logLevel)&&void 0!==o?o:f.INFO,t);if(s&&!n.suppressOverrideMessage){var p=null!==(i=(new Error).stack)&&void 0!==i?i:"<failed to generate stacktrace>";s.warn("Current logger will be overwritten from "+p),u.warn("Current logger will overwrite one already registered from "+p)}return c("diag",u,e,!0)},e.disable=function(){p("diag",e)},e.createComponentLogger=function(t){return new _(t)},e.verbose=t("verbose"),e.debug=t("debug"),e.info=t("info"),e.warn=t("warn"),e.error=t("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t}(),T=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},m=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},b=function(){function t(t){this._entries=t?new Map(t):new Map}return t.prototype.getEntry=function(t){var e=this._entries.get(t);if(e)return Object.assign({},e)},t.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map((function(t){var e=T(t,2);return[e[0],e[1]]}))},t.prototype.setEntry=function(e,n){var r=new t(this._entries);return r._entries.set(e,n),r},t.prototype.removeEntry=function(e){var n=new t(this._entries);return n._entries.delete(e),n},t.prototype.removeEntries=function(){for(var e,n,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=new t(this._entries);try{for(var a=m(r),s=a.next();!s.done;s=a.next()){var u=s.value;i._entries.delete(u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return i},t.prototype.clear=function(){return new t},t}(),S=Symbol("BaggageEntryMetadata"),O=y.instance();function R(t){return void 0===t&&(t={}),new b(new Map(Object.entries(t)))}function L(t){return Symbol.for(t)}var P,w,A=function t(e){var n=this;n._currentContext=e?new Map(e):new Map,n.getValue=function(t){return n._currentContext.get(t)},n.setValue=function(e,r){var o=new t(n._currentContext);return o._currentContext.set(e,r),o},n.deleteValue=function(e){var r=new t(n._currentContext);return r._currentContext.delete(e),r}},C=new A,k=(P=function(t,e){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},P(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}P(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),I=function(){function t(){}return t.prototype.createGauge=function(t,e){return G},t.prototype.createHistogram=function(t,e){return X},t.prototype.createCounter=function(t,e){return F},t.prototype.createUpDownCounter=function(t,e){return V},t.prototype.createObservableGauge=function(t,e){return W},t.prototype.createObservableCounter=function(t,e){return q},t.prototype.createObservableUpDownCounter=function(t,e){return K},t.prototype.addBatchObservableCallback=function(t,e){},t.prototype.removeBatchObservableCallback=function(t){},t}(),N=function(){},D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e.prototype.add=function(t,e){},e}(N),x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e.prototype.add=function(t,e){},e}(N),M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e.prototype.record=function(t,e){},e}(N),j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e.prototype.record=function(t,e){},e}(N),U=function(){function t(){}return t.prototype.addCallback=function(t){},t.prototype.removeCallback=function(t){},t}(),B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e}(U),Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e}(U),z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e}(U),H=new I,F=new D,G=new M,X=new j,V=new x,q=new B,W=new Z,K=new z,Y={get:function(t,e){if(null!=t)return t[e]},keys:function(t){return null==t?[]:Object.keys(t)}},$={set:function(t,e,n){null!=t&&(t[e]=n)}},Q=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},J=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},tt=function(){function t(){}return t.prototype.active=function(){return C},t.prototype.with=function(t,e,n){for(var r=[],o=3;o<arguments.length;o++)r[o-3]=arguments[o];return e.call.apply(e,J([n],Q(r),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),et=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},nt=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},rt="context",ot=new tt,it=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return c(rt,t,y.instance())},t.prototype.active=function(){return this._getContextManager().active()},t.prototype.with=function(t,e,n){for(var r,o=[],i=3;i<arguments.length;i++)o[i-3]=arguments[i];return(r=this._getContextManager()).with.apply(r,nt([t,e,n],et(o),!1))},t.prototype.bind=function(t,e){return this._getContextManager().bind(t,e)},t.prototype._getContextManager=function(){return l(rt)||ot},t.prototype.disable=function(){this._getContextManager().disable(),p(rt,y.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(w||(w={}));var at="0000000000000000",st="00000000000000000000000000000000",ut={traceId:st,spanId:at,traceFlags:w.NONE},ct=function(){function t(t){void 0===t&&(t=ut),this._spanContext=t}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(t,e){return this},t.prototype.setAttributes=function(t){return this},t.prototype.addEvent=function(t,e){return this},t.prototype.addLink=function(t){return this},t.prototype.addLinks=function(t){return this},t.prototype.setStatus=function(t){return this},t.prototype.updateName=function(t){return this},t.prototype.end=function(t){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(t,e){},t}(),lt=L("OpenTelemetry Context Key SPAN");function pt(t){return t.getValue(lt)||void 0}function ft(){return pt(it.getInstance().active())}function ht(t,e){return t.setValue(lt,e)}function dt(t){return t.deleteValue(lt)}function _t(t,e){return ht(t,new ct(e))}function vt(t){var e;return null===(e=pt(t))||void 0===e?void 0:e.spanContext()}var gt=/^([0-9a-f]{32})$/i,Et=/^[0-9a-f]{16}$/i;function yt(t){return gt.test(t)&&t!==st}function Tt(t){return yt(t.traceId)&&(e=t.spanId,Et.test(e)&&e!==at);var e}function mt(t){return new ct(t)}var bt=it.getInstance(),St=function(){function t(){}return t.prototype.startSpan=function(t,e,n){if(void 0===n&&(n=bt.active()),Boolean(null==e?void 0:e.root))return new ct;var r,o=n&&vt(n);return"object"==typeof(r=o)&&"string"==typeof r.spanId&&"string"==typeof r.traceId&&"number"==typeof r.traceFlags&&Tt(o)?new ct(o):new ct},t.prototype.startActiveSpan=function(t,e,n,r){var o,i,a;if(!(arguments.length<2)){2===arguments.length?a=e:3===arguments.length?(o=e,a=n):(o=e,i=n,a=r);var s=null!=i?i:bt.active(),u=this.startSpan(t,o,s),c=ht(s,u);return bt.with(c,a,void 0,u)}},t}();var Ot,Rt,Lt,Pt=new St,wt=function(){function t(t,e,n,r){this._provider=t,this.name=e,this.version=n,this.options=r}return t.prototype.startSpan=function(t,e,n){return this._getTracer().startSpan(t,e,n)},t.prototype.startActiveSpan=function(t,e,n,r){var o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Pt},t}(),At=new(function(){function t(){}return t.prototype.getTracer=function(t,e,n){return new St},t}()),Ct=function(){function t(){}return t.prototype.getTracer=function(t,e,n){var r;return null!==(r=this.getDelegateTracer(t,e,n))&&void 0!==r?r:new wt(this,t,e,n)},t.prototype.getDelegate=function(){var t;return null!==(t=this._delegate)&&void 0!==t?t:At},t.prototype.setDelegate=function(t){this._delegate=t},t.prototype.getDelegateTracer=function(t,e,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getTracer(t,e,n)},t}();!function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(Ot||(Ot={})),function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"}(Rt||(Rt={})),function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"}(Lt||(Lt={}));var kt=it.getInstance(),It=y.instance(),Nt=new(function(){function t(){}return t.prototype.getMeter=function(t,e,n){return H},t}()),Dt="metrics",xt=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(t){return c(Dt,t,y.instance())},t.prototype.getMeterProvider=function(){return l(Dt)||Nt},t.prototype.getMeter=function(t,e,n){return this.getMeterProvider().getMeter(t,e,n)},t.prototype.disable=function(){p(Dt,y.instance())},t}().getInstance(),Mt=function(){function t(){}return t.prototype.inject=function(t,e){},t.prototype.extract=function(t,e){return t},t.prototype.fields=function(){return[]},t}(),jt=L("OpenTelemetry Baggage Key");function Ut(t){return t.getValue(jt)||void 0}function Bt(){return Ut(it.getInstance().active())}function Zt(t,e){return t.setValue(jt,e)}function zt(t){return t.deleteValue(jt)}var Ht="propagation",Ft=new Mt,Gt=function(){function t(){this.createBaggage=R,this.getBaggage=Ut,this.getActiveBaggage=Bt,this.setBaggage=Zt,this.deleteBaggage=zt}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(t){return c(Ht,t,y.instance())},t.prototype.inject=function(t,e,n){return void 0===n&&(n=$),this._getGlobalPropagator().inject(t,e,n)},t.prototype.extract=function(t,e,n){return void 0===n&&(n=Y),this._getGlobalPropagator().extract(t,e,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){p(Ht,y.instance())},t.prototype._getGlobalPropagator=function(){return l(Ht)||Ft},t}(),Xt=Gt.getInstance(),Vt="trace",qt=function(){function t(){this._proxyTracerProvider=new Ct,this.wrapSpanContext=mt,this.isSpanContextValid=Tt,this.deleteSpan=dt,this.getSpan=pt,this.getActiveSpan=ft,this.getSpanContext=vt,this.setSpan=ht,this.setSpanContext=_t}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=c(Vt,this._proxyTracerProvider,y.instance());return e&&this._proxyTracerProvider.setDelegate(t),e},t.prototype.getTracerProvider=function(){return l(Vt)||this._proxyTracerProvider},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){p(Vt,y.instance()),this._proxyTracerProvider=new Ct},t}().getInstance(),Wt=L("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Kt(t){return!0===t.getValue(Wt)}var Yt="baggage",$t=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function Qt(t){var e=t.split(";");if(!(e.length<=0)){var n=e.shift();if(n){var r=n.indexOf("=");if(!(r<=0)){var o,i,a=decodeURIComponent(n.substring(0,r).trim()),s=decodeURIComponent(n.substring(r+1).trim());return e.length>0&&("string"!=typeof(i=e.join(";"))&&(O.error("Cannot create baggage metadata from unknown type: "+typeof i),i=""),o={__TYPE__:S,toString:function(){return i}}),{key:a,value:s,metadata:o}}}}}var Jt=function(){function t(){}return t.prototype.inject=function(t,e,n){var r=Xt.getBaggage(t);if(r&&!Kt(t)){var o=function(t){return t.getAllEntries().map((function(t){var e=$t(t,2),n=e[0],r=e[1],o=encodeURIComponent(n)+"="+encodeURIComponent(r.value);return void 0!==r.metadata&&(o+=";"+r.metadata.toString()),o}))}(r).filter((function(t){return t.length<=4096})).slice(0,180),i=function(t){return t.reduce((function(t,e){var n=t+(""!==t?",":"")+e;return n.length>8192?t:n}),"")}(o);i.length>0&&n.set(e,Yt,i)}},t.prototype.extract=function(t,e,n){var r=n.get(e,Yt),o=Array.isArray(r)?r.join(","):r;if(!o)return t;var i={};return 0===o.length?t:(o.split(",").forEach((function(t){var e=Qt(t);if(e){var n={value:e.value};e.metadata&&(n.metadata=e.metadata),i[e.key]=n}})),0===Object.entries(i).length?t:Xt.setBaggage(t,Xt.createBaggage(i)))},t.prototype.fields=function(){return[Yt]},t}(),te=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ee=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function ne(t){var e,n,r={};if("object"!=typeof t||null==t)return r;try{for(var o=te(Object.entries(t)),i=o.next();!i.done;i=o.next()){var a=ee(i.value,2),s=a[0],u=a[1];re(s)?oe(u)?Array.isArray(u)?r[s]=u.slice():r[s]=u:It.warn("Invalid attribute value set for key: "+s):It.warn("Invalid attribute key: "+s)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r}function re(t){return"string"==typeof t&&t.length>0}function oe(t){return null==t||(Array.isArray(t)?function(t){var e,n,r;try{for(var o=te(t),i=o.next();!i.done;i=o.next()){var a=i.value;if(null!=a){if(!r){if(ie(a)){r=typeof a;continue}return!1}if(typeof a!==r)return!1}}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return!0}(t):ie(t))}function ie(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var ae,se=function(t){It.error(function(t){return"string"==typeof t?t:JSON.stringify(function(t){for(var e={},n=t;null!==n;)Object.getOwnPropertyNames(n).forEach((function(t){if(!e[t]){var r=n[t];r&&(e[t]=String(r))}})),n=Object.getPrototypeOf(n);return e}(t))}(t))};function ue(t){try{se(t)}catch(t){}}!function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"}(ae||(ae={}));var ce=",",le=["OTEL_SDK_DISABLED"];function pe(t){return le.indexOf(t)>-1}var fe=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];function he(t){return fe.indexOf(t)>-1}var de=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS"];function _e(t){return de.indexOf(t)>-1}var ve=1/0,ge=128,Ee={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:f.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:ve,OTEL_ATTRIBUTE_COUNT_LIMIT:ge,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:ve,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:ge,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:ve,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:ge,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:128,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:ae.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative"};function ye(t,e,n){if(void 0!==n[t]){var r=String(n[t]);e[t]="true"===r.toLowerCase()}}function Te(t,e,n,r,o){if(void 0===r&&(r=-1/0),void 0===o&&(o=1/0),void 0!==n[t]){var i=Number(n[t]);isNaN(i)||(e[t]=i<r?r:i>o?o:i)}}function me(t,e,n,r){void 0===r&&(r=ce);var o=n[t];"string"==typeof o&&(e[t]=o.split(r).map((function(t){return t.trim()})))}var be={ALL:f.ALL,VERBOSE:f.VERBOSE,DEBUG:f.DEBUG,INFO:f.INFO,WARN:f.WARN,ERROR:f.ERROR,NONE:f.NONE};function Se(t,e,n){var r=n[t];if("string"==typeof r){var o=be[r.toUpperCase()];null!=o&&(e[t]=o)}}function Oe(t){var e={};for(var n in Ee){var r=n;if("OTEL_LOG_LEVEL"===r)Se(r,e,t);else if(pe(r))ye(r,e,t);else if(he(r))Te(r,e,t);else if(_e(r))me(r,e,t);else{var o=t[r];null!=o&&(e[r]=String(o))}}return e}var Re="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{};function Le(){var t=Oe(Re);return Object.assign({},Ee,t)}function Pe(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function we(t){for(var e=new Uint8Array(t.length/2),n=0,r=0;r<t.length;r+=2){var o=Pe(t.charCodeAt(r)),i=Pe(t.charCodeAt(r+1));e[n++]=o<<4|i}return e}var Ae,Ce=performance,ke="exception.type",Ie="exception.message",Ne="http.method",De="http.url",xe="http.host",Me="http.scheme",je="http.status_code",Ue="http.user_agent",Be="telemetry.sdk.name",Ze="telemetry.sdk.language",ze="telemetry.sdk.version",He=((Ae={})[Be]="opentelemetry",Ae["process.runtime.name"]="browser",Ae[Ze]="webjs",Ae[ze]="1.26.0",Ae);var Fe,Ge=Math.pow(10,6),Xe=Math.pow(10,9);function Ve(t){var e=t/1e3;return[Math.trunc(e),Math.round(t%1e3*Ge)]}function qe(){var t=Ce.timeOrigin;if("number"!=typeof t){var e=Ce;t=e.timing&&e.timing.fetchStart}return t}function We(t){return Je(Ve(qe()),Ve("number"==typeof t?t:Ce.now()))}function Ke(t){if($e(t))return t;if("number"==typeof t)return t<qe()?We(t):Ve(t);if(t instanceof Date)return Ve(t.getTime());throw TypeError("Invalid input type")}function Ye(t){return t[0]*Xe+t[1]}function $e(t){return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}function Qe(t){return $e(t)||"number"==typeof t||t instanceof Date}function Je(t,e){var n=[t[0]+e[0],t[1]+e[1]];return n[1]>=Xe&&(n[1]-=Xe,n[0]+=1),n}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(Fe||(Fe={}));var tn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},en=function(){function t(t){var e;void 0===t&&(t={}),this._propagators=null!==(e=t.propagators)&&void 0!==e?e:[],this._fields=Array.from(new Set(this._propagators.map((function(t){return"function"==typeof t.fields?t.fields():[]})).reduce((function(t,e){return t.concat(e)}),[])))}return t.prototype.inject=function(t,e,n){var r,o;try{for(var i=tn(this._propagators),a=i.next();!a.done;a=i.next()){var s=a.value;try{s.inject(t,e,n)}catch(t){It.warn("Failed to inject with "+s.constructor.name+". Err: "+t.message)}}}catch(t){r={error:t}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}},t.prototype.extract=function(t,e,n){return this._propagators.reduce((function(t,r){try{return r.extract(t,e,n)}catch(t){It.warn("Failed to inject with "+r.constructor.name+". Err: "+t.message)}return t}),t)},t.prototype.fields=function(){return this._fields.slice()},t}(),nn="[_0-9a-z-*/]",rn=new RegExp("^(?:"+("[a-z]"+nn+"{0,255}")+"|"+("[a-z0-9]"+nn+"{0,240}@[a-z]"+nn+"{0,13}")+")$"),on=/^[ -~]{0,255}[!-~]$/,an=/,|=/;var sn=function(){function t(t){this._internalState=new Map,t&&this._parse(t)}return t.prototype.set=function(t,e){var n=this._clone();return n._internalState.has(t)&&n._internalState.delete(t),n._internalState.set(t,e),n},t.prototype.unset=function(t){var e=this._clone();return e._internalState.delete(t),e},t.prototype.get=function(t){return this._internalState.get(t)},t.prototype.serialize=function(){var t=this;return this._keys().reduce((function(e,n){return e.push(n+"="+t.get(n)),e}),[]).join(",")},t.prototype._parse=function(t){t.length>512||(this._internalState=t.split(",").reverse().reduce((function(t,e){var n=e.trim(),r=n.indexOf("=");if(-1!==r){var o=n.slice(0,r),i=n.slice(r+1,e.length);(function(t){return rn.test(t)})(o)&&function(t){return on.test(t)&&!an.test(t)}(i)&&t.set(o,i)}return t}),new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t}(),un="traceparent",cn="tracestate",ln=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");var pn,fn,hn=function(){function t(){}return t.prototype.inject=function(t,e,n){var r=qt.getSpanContext(t);if(r&&!Kt(t)&&Tt(r)){var o="00-"+r.traceId+"-"+r.spanId+"-0"+Number(r.traceFlags||w.NONE).toString(16);n.set(e,un,o),r.traceState&&n.set(e,cn,r.traceState.serialize())}},t.prototype.extract=function(t,e,n){var r=n.get(e,un);if(!r)return t;var o=Array.isArray(r)?r[0]:r;if("string"!=typeof o)return t;var i=function(t){var e=ln.exec(t);return e?"00"===e[1]&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}:null}(o);if(!i)return t;i.isRemote=!0;var a=n.get(e,cn);if(a){var s=Array.isArray(a)?a.join(","):a;i.traceState=new sn("string"==typeof s?s:void 0)}return qt.setSpanContext(t,i)},t.prototype.fields=function(){return[un,cn]},t}(),dn="[object Object]",_n="[object Null]",vn="[object Undefined]",gn=Function.prototype.toString,En=gn.call(Object),yn=(pn=Object.getPrototypeOf,fn=Object,function(t){return pn(fn(t))}),Tn=Object.prototype,mn=Tn.hasOwnProperty,bn=Symbol?Symbol.toStringTag:void 0,Sn=Tn.toString;function On(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||function(t){if(null==t)return void 0===t?vn:_n;return bn&&bn in Object(t)?function(t){var e=mn.call(t,bn),n=t[bn],r=!1;try{t[bn]=void 0,r=!0}catch(t){}var o=Sn.call(t);r&&(e?t[bn]=n:delete t[bn]);return o}(t):function(t){return Sn.call(t)}(t)}(t)!==dn)return!1;var e=yn(t);if(null===e)return!0;var n=mn.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&gn.call(n)===En}var Rn=20;function Ln(t){return An(t)?t.slice():t}function Pn(t,e,n,r){var o;if(void 0===n&&(n=0),!(n>Rn)){if(n++,In(t)||In(e)||Cn(e))o=Ln(e);else if(An(t)){if(o=t.slice(),An(e))for(var i=0,a=e.length;i<a;i++)o.push(Ln(e[i]));else if(kn(e))for(i=0,a=(s=Object.keys(e)).length;i<a;i++){o[u=s[i]]=Ln(e[u])}}else if(kn(t))if(kn(e)){if(!function(t,e){if(!On(t)||!On(e))return!1;return!0}(t,e))return e;o=Object.assign({},t);var s;for(i=0,a=(s=Object.keys(e)).length;i<a;i++){var u,c=e[u=s[i]];if(In(c))void 0===c?delete o[u]:o[u]=c;else{var l=o[u],p=c;if(wn(t,u,r)||wn(e,u,r))delete o[u];else{if(kn(l)&&kn(p)){var f=r.get(l)||[],h=r.get(p)||[];f.push({obj:t,key:u}),h.push({obj:e,key:u}),r.set(l,f),r.set(p,h)}o[u]=Pn(o[u],c,n,r)}}}}else o=e;return o}}function wn(t,e,n){for(var r=n.get(t[e])||[],o=0,i=r.length;o<i;o++){var a=r[o];if(a.key===e&&a.obj===t)return!0}return!1}function An(t){return Array.isArray(t)}function Cn(t){return"function"==typeof t}function kn(t){return!In(t)&&!An(t)&&!Cn(t)&&"object"==typeof t}function In(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}var Nn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function Dn(t,e){return"string"==typeof e?t===e:!!t.match(e)}function xn(t,e){var n,r;if(!e)return!1;try{for(var o=Nn(e),i=o.next();!i.done;i=o.next()){if(Dn(t,i.value))return!0}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}var Mn=function(){function t(){var t=this;this._promise=new Promise((function(e,n){t._resolve=e,t._reject=n}))}return Object.defineProperty(t.prototype,"promise",{get:function(){return this._promise},enumerable:!1,configurable:!0}),t.prototype.resolve=function(t){this._resolve(t)},t.prototype.reject=function(t){this._reject(t)},t}(),jn=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Un=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Bn=function(){function t(t,e){this._callback=t,this._that=e,this._isCalled=!1,this._deferred=new Mn}return Object.defineProperty(t.prototype,"isCalled",{get:function(){return this._isCalled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"promise",{get:function(){return this._deferred.promise},enumerable:!1,configurable:!0}),t.prototype.call=function(){for(var t,e=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(!this._isCalled){this._isCalled=!0;try{Promise.resolve((t=this._callback).call.apply(t,Un([this._that],jn(n),!1))).then((function(t){return e._deferred.resolve(t)}),(function(t){return e._deferred.reject(t)}))}catch(t){this._deferred.reject(t)}}return this._deferred.promise},t}();function Zn(t){var e=BigInt(1e9);return BigInt(t[0])*e+BigInt(t[1])}function zn(t){var e,n=Zn(t);return e=n,{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}var Hn="undefined"!=typeof BigInt?function(t){return Zn(t).toString()}:Ye;function Fn(t){return t}function Gn(t){if(void 0!==t)return we(t)}var Xn,Vn={encodeHrTime:zn,encodeSpanContext:we,encodeOptionalSpanContext:Gn};!function(t){t[t.SPAN_KIND_UNSPECIFIED=0]="SPAN_KIND_UNSPECIFIED",t[t.SPAN_KIND_INTERNAL=1]="SPAN_KIND_INTERNAL",t[t.SPAN_KIND_SERVER=2]="SPAN_KIND_SERVER",t[t.SPAN_KIND_CLIENT=3]="SPAN_KIND_CLIENT",t[t.SPAN_KIND_PRODUCER=4]="SPAN_KIND_PRODUCER",t[t.SPAN_KIND_CONSUMER=5]="SPAN_KIND_CONSUMER"}(Xn||(Xn={}));var qn=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function Wn(t){return Object.keys(t).map((function(e){return Kn(e,t[e])}))}function Kn(t,e){return{key:t,value:Yn(e)}}function Yn(t){var e=typeof t;return"string"===e?{stringValue:t}:"number"===e?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:"boolean"===e?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(Yn)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((function(t){var e=qn(t,2);return Kn(e[0],e[1])}))}}:{}}function $n(t,e){var n,r=t.spanContext(),o=t.status;return{traceId:e.encodeSpanContext(r.traceId),spanId:e.encodeSpanContext(r.spanId),parentSpanId:e.encodeOptionalSpanContext(t.parentSpanId),traceState:null===(n=r.traceState)||void 0===n?void 0:n.serialize(),name:t.name,kind:null==t.kind?0:t.kind+1,startTimeUnixNano:e.encodeHrTime(t.startTime),endTimeUnixNano:e.encodeHrTime(t.endTime),attributes:Wn(t.attributes),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map((function(t){return function(t,e){return{attributes:t.attributes?Wn(t.attributes):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}(t,e)})),droppedEventsCount:t.droppedEventsCount,status:{code:o.code,message:o.message},links:t.links.map((function(t){return function(t,e){var n;return{attributes:t.attributes?Wn(t.attributes):[],spanId:e.encodeSpanContext(t.context.spanId),traceId:e.encodeSpanContext(t.context.traceId),traceState:null===(n=t.context.traceState)||void 0===n?void 0:n.serialize(),droppedAttributesCount:t.droppedAttributesCount||0}}(t,e)})),droppedLinksCount:t.droppedLinksCount}}function Qn(t){return{attributes:Wn(t.attributes),droppedAttributesCount:0}}var Jn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},tr=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function er(t,e){var n=function(t){var e,n;if(void 0===t)return Vn;var r=null===(e=t.useLongBits)||void 0===e||e,o=null!==(n=t.useHex)&&void 0!==n&&n;return{encodeHrTime:r?zn:Hn,encodeSpanContext:o?Fn:we,encodeOptionalSpanContext:o?Fn:Gn}}(e);return{resourceSpans:nr(t,n)}}function nr(t,e){for(var n,r=function(t){var e,n,r=new Map;try{for(var o=Jn(t),i=o.next();!i.done;i=o.next()){var a=i.value,s=r.get(a.resource);s||(s=new Map,r.set(a.resource,s));var u=a.instrumentationLibrary.name+"@"+(a.instrumentationLibrary.version||"")+":"+(a.instrumentationLibrary.schemaUrl||""),c=s.get(u);c||(c=[],s.set(u,c)),c.push(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r}(t),o=[],i=r.entries(),a=i.next();!a.done;){for(var s=tr(a.value,2),u=s[0],c=[],l=s[1].values(),p=l.next();!p.done;){var f=p.value;if(f.length>0){var h=f.map((function(t){return $n(t,e)}));c.push({scope:(n=f[0].instrumentationLibrary,{name:n.name,version:n.version}),spans:h,schemaUrl:f[0].instrumentationLibrary.schemaUrl})}p=l.next()}var d={resource:Qn(u),scopeSpans:c,schemaUrl:void 0};o.push(d),a=i.next()}return o}var rr=function(){return rr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},rr.apply(this,arguments)},or=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},ir=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ar=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},sr=function(){function t(t,e){var n,r=this;this._attributes=t,this.asyncAttributesPending=null!=e,this._syncAttributes=null!==(n=this._attributes)&&void 0!==n?n:{},this._asyncAttributesPromise=null==e?void 0:e.then((function(t){return r._attributes=Object.assign({},r._attributes,t),r.asyncAttributesPending=!1,t}),(function(t){return It.debug("a resource's async attributes promise rejected: %s",t),r.asyncAttributesPending=!1,{}}))}return t.empty=function(){return t.EMPTY},t.default=function(){var e;return new t(((e={})["service.name"]="unknown_service",e[Ze]=He[Ze],e[Be]=He[Be],e[ze]=He[ze],e))},Object.defineProperty(t.prototype,"attributes",{get:function(){var t;return this.asyncAttributesPending&&It.error("Accessing resource attributes before async attributes settled"),null!==(t=this._attributes)&&void 0!==t?t:{}},enumerable:!1,configurable:!0}),t.prototype.waitForAsyncAttributes=function(){return or(this,void 0,void 0,(function(){return ir(this,(function(t){switch(t.label){case 0:return this.asyncAttributesPending?[4,this._asyncAttributesPromise]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.merge=function(e){var n,r=this;if(!e)return this;var o=rr(rr({},this._syncAttributes),null!==(n=e._syncAttributes)&&void 0!==n?n:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new t(o);var i=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then((function(t){var n,o=ar(t,2),i=o[0],a=o[1];return rr(rr(rr(rr({},r._syncAttributes),i),null!==(n=e._syncAttributes)&&void 0!==n?n:e.attributes),a)}));return new t(o,i)},t.EMPTY=new t({}),t}();let ur={};class cr{constructor(t){this.config=t}export(t,e){const n=er(t,{useHex:!0,useLongBits:!1});this.config.api.pushTraces(n),function(t=[]){var e,n;for(const r of t){const{scopeSpans:t}=r;for(const r of t){const{scope:t,spans:o=[]}=r;for(const r of o){if(r.kind!==Xn.SPAN_KIND_CLIENT)continue;const o={traceId:r.traceId.toString(),spanId:r.spanId.toString()},i={};for(const t of r.attributes)i[t.key]=String(Object.values(t.value)[0]);const a=(null!==(e=null==t?void 0:t.name)&&void 0!==e?e:"").indexOf("-");let s="unknown";(null==t?void 0:t.name)&&(-1===a&&(s=null!==(n=t.name.split("/")[1])&&void 0!==n?n:t.name),a>-1&&(s=null==t?void 0:t.name.substring(a+1))),ur.api.pushEvent(`faro.tracing.${s}`,i,void 0,{spanContext:o})}}}}(n.resourceSpans),e({code:Fe.SUCCESS})}shutdown(){return Promise.resolve(void 0)}}class lr{constructor(t,e){this.processor=t,this.metas=e}forceFlush(){return this.processor.forceFlush()}onStart(t,e){const n=this.metas.value.session;(null==n?void 0:n.id)&&(t.attributes["session.id"]=n.id,t.attributes.session_id=n.id),this.processor.onStart(t,e)}onEnd(t){this.processor.onEnd(t)}shutdown(){return this.processor.shutdown()}}"function"==typeof SuppressedError&&SuppressedError;var pr=function(){function t(){}return t.prototype.emit=function(t){},t}(),fr=new(function(){function t(){}return t.prototype.getLogger=function(t,e,n){return new pr},t}()),hr="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},dr=Symbol.for("io.opentelemetry.js.api.logs"),_r=hr;var vr=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalLoggerProvider=function(t){return _r[dr]?this.getLoggerProvider():(_r[dr]=(e=1,n=t,r=fr,function(t){return t===e?n:r}),t);var e,n,r},t.prototype.getLoggerProvider=function(){var t,e;return null!==(e=null===(t=_r[dr])||void 0===t?void 0:t.call(_r,1))&&void 0!==e?e:fr},t.prototype.getLogger=function(t,e,n){return this.getLoggerProvider().getLogger(t,e,n)},t.prototype.disable=function(){delete _r[dr]},t}(),gr=vr.getInstance();function Er(t){return"function"==typeof t}var yr=console.error.bind(console);function Tr(t,e,n){var r=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}function mr(t){t&&t.logger&&(Er(t.logger)?yr=t.logger:yr("new logger isn't a function, not replacing"))}function br(t,e,n){if(t&&t[e]){if(!n)return yr("no wrapper function"),void yr((new Error).stack);if(Er(t[e])&&Er(n)){var r=t[e],o=n(r,e);return Tr(o,"__original",r),Tr(o,"__unwrap",(function(){t[e]===o&&Tr(t,e,r)})),Tr(o,"__wrapped",!0),Tr(t,e,o),o}yr("original object and wrapper must be functions")}else yr("no original function "+e+" to wrap")}function Sr(t,e){return t&&t[e]?t[e].__unwrap?t[e].__unwrap():void yr("no original to unwrap to -- has "+e+" already been unwrapped?"):(yr("no function to unwrap."),void yr((new Error).stack))}mr.wrap=br,mr.massWrap=function(t,e,n){if(!t)return yr("must provide one or more modules to patch"),void yr((new Error).stack);Array.isArray(t)||(t=[t]),e&&Array.isArray(e)?t.forEach((function(t){e.forEach((function(e){br(t,e,n)}))})):yr("must provide one or more functions to wrap on modules")},mr.unwrap=Sr,mr.massUnwrap=function(t,e){if(!t)return yr("must provide one or more modules to patch"),void yr((new Error).stack);Array.isArray(t)||(t=[t]),e&&Array.isArray(e)?t.forEach((function(t){e.forEach((function(e){Sr(t,e)}))})):yr("must provide one or more functions to unwrap on modules")};var Or=mr,Rr=function(){return Rr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Rr.apply(this,arguments)},Lr=function(){function t(t,e,n){this.instrumentationName=t,this.instrumentationVersion=e,this._config={},this._wrap=Or.wrap,this._unwrap=Or.unwrap,this._massWrap=Or.massWrap,this._massUnwrap=Or.massUnwrap,this.setConfig(n),this._diag=It.createComponentLogger({namespace:t}),this._tracer=qt.getTracer(t,e),this._meter=xt.getMeter(t,e),this._logger=gr.getLogger(t,e),this._updateMetricInstruments()}return Object.defineProperty(t.prototype,"meter",{get:function(){return this._meter},enumerable:!1,configurable:!0}),t.prototype.setMeterProvider=function(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()},Object.defineProperty(t.prototype,"logger",{get:function(){return this._logger},enumerable:!1,configurable:!0}),t.prototype.setLoggerProvider=function(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)},t.prototype.getModuleDefinitions=function(){var t,e=null!==(t=this.init())&&void 0!==t?t:[];return Array.isArray(e)?e:[e]},t.prototype._updateMetricInstruments=function(){},t.prototype.getConfig=function(){return this._config},t.prototype.setConfig=function(t){this._config=Rr({enabled:!0},t)},t.prototype.setTracerProvider=function(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)},Object.defineProperty(t.prototype,"tracer",{get:function(){return this._tracer},enumerable:!1,configurable:!0}),t.prototype._runSpanCustomizationHook=function(t,e,n,r){if(t)try{t(n,r)}catch(t){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:e},t)}},t}(),Pr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wr=function(t){function e(e,n,r){var o=t.call(this,e,n,r)||this;return o._config.enabled&&o.enable(),o}return Pr(e,t),e}(Lr);function Ar(t,e,n){var r,o;try{o=t()}catch(t){r=t}finally{if(e(r,o),r&&!n)throw r;return o}}function Cr(t){return"function"==typeof t&&"function"==typeof t.__original&&"function"==typeof t.__unwrap&&!0===t.__wrapped}var kr,Ir=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Nr=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Dr=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},xr=function(){function t(t,e,n,r,o,i,a,s,u,c){void 0===a&&(a=[]),this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:Lt.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=n,this._spanContext=r,this.parentSpanId=i,this.kind=o,this.links=a;var l=Date.now();this._performanceStartTime=Ce.now(),this._performanceOffset=l-(this._performanceStartTime+qe()),this._startTimeProvided=null!=s,this.startTime=this._getTime(null!=s?s:l),this.resource=t.resource,this.instrumentationLibrary=t.instrumentationLibrary,this._spanLimits=t.getSpanLimits(),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,null!=c&&this.setAttributes(c),this._spanProcessor=t.getActiveSpanProcessor(),this._spanProcessor.onStart(this,e)}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(t,e){return null==e||this._isSpanEnded()?this:0===t.length?(It.warn("Invalid attribute key: "+t),this):oe(e)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,t)?(this._droppedAttributesCount++,this):(this.attributes[t]=this._truncateToSize(e),this):(It.warn("Invalid attribute value set for key: "+t),this)},t.prototype.setAttributes=function(t){var e,n;try{for(var r=Ir(Object.entries(t)),o=r.next();!o.done;o=r.next()){var i=Nr(o.value,2),a=i[0],s=i[1];this.setAttribute(a,s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return this},t.prototype.addEvent=function(t,e,n){if(this._isSpanEnded())return this;if(0===this._spanLimits.eventCountLimit)return It.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(0===this._droppedEventsCount&&It.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),Qe(e)&&(Qe(n)||(n=e),e=void 0);var r=ne(e);return this.events.push({name:t,attributes:r,time:this._getTime(n),droppedAttributesCount:0}),this},t.prototype.addLink=function(t){return this.links.push(t),this},t.prototype.addLinks=function(t){var e;return(e=this.links).push.apply(e,Dr([],Nr(t),!1)),this},t.prototype.setStatus=function(t){return this._isSpanEnded()||(this.status=t),this},t.prototype.updateName=function(t){return this._isSpanEnded()||(this.name=t),this},t.prototype.end=function(t){this._isSpanEnded()?It.error(this.name+" "+this._spanContext.traceId+"-"+this._spanContext.spanId+" - You can only call end() on a span once."):(this._ended=!0,this.endTime=this._getTime(t),this._duration=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return r<0&&(n-=1,r+=Xe),[n,r]}(this.startTime,this.endTime),this._duration[0]<0&&(It.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&&It.warn("Dropped "+this._droppedEventsCount+" events because eventCountLimit reached"),this._spanProcessor.onEnd(this))},t.prototype._getTime=function(t){if("number"==typeof t&&t<Ce.now())return We(t+this._performanceOffset);if("number"==typeof t)return Ve(t);if(t instanceof Date)return Ve(t.getTime());if($e(t))return t;if(this._startTimeProvided)return Ve(Date.now());var e=Ce.now()-this._performanceStartTime;return Je(this.startTime,Ve(e))},t.prototype.isRecording=function(){return!1===this._ended},t.prototype.recordException=function(t,e){var n={};"string"==typeof t?n[Ie]=t:t&&(t.code?n[ke]=t.code.toString():t.name&&(n[ke]=t.name),t.message&&(n[Ie]=t.message),t.stack&&(n["exception.stacktrace"]=t.stack)),n[ke]||n[Ie]?this.addEvent("exception",n,e):It.warn("Failed to record an exception "+t)},Object.defineProperty(t.prototype,"duration",{get:function(){return this._duration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ended",{get:function(){return this._ended},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedAttributesCount",{get:function(){return this._droppedAttributesCount},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedEventsCount",{get:function(){return this._droppedEventsCount},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedLinksCount",{get:function(){return this._droppedLinksCount},enumerable:!1,configurable:!0}),t.prototype._isSpanEnded=function(){return this._ended&&It.warn("Can not execute the operation on ended Span {traceId: "+this._spanContext.traceId+", spanId: "+this._spanContext.spanId+"}"),this._ended},t.prototype._truncateToLimitUtil=function(t,e){return t.length<=e?t:t.substr(0,e)},t.prototype._truncateToSize=function(t){var e=this,n=this._attributeValueLengthLimit;return n<=0?(It.warn("Attribute value limit must be positive, got "+n),t):"string"==typeof t?this._truncateToLimitUtil(t,n):Array.isArray(t)?t.map((function(t){return"string"==typeof t?e._truncateToLimitUtil(t,n):t})):t},t}();!function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(kr||(kr={}));var Mr=function(){function t(){}return t.prototype.shouldSample=function(){return{decision:kr.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t}(),jr=function(){function t(){}return t.prototype.shouldSample=function(){return{decision:kr.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t}(),Ur=function(){function t(t){var e,n,r,o;this._root=t.root,this._root||(ue(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new jr),this._remoteParentSampled=null!==(e=t.remoteParentSampled)&&void 0!==e?e:new jr,this._remoteParentNotSampled=null!==(n=t.remoteParentNotSampled)&&void 0!==n?n:new Mr,this._localParentSampled=null!==(r=t.localParentSampled)&&void 0!==r?r:new jr,this._localParentNotSampled=null!==(o=t.localParentNotSampled)&&void 0!==o?o:new Mr}return t.prototype.shouldSample=function(t,e,n,r,o,i){var a=qt.getSpanContext(t);return a&&Tt(a)?a.isRemote?a.traceFlags&w.SAMPLED?this._remoteParentSampled.shouldSample(t,e,n,r,o,i):this._remoteParentNotSampled.shouldSample(t,e,n,r,o,i):a.traceFlags&w.SAMPLED?this._localParentSampled.shouldSample(t,e,n,r,o,i):this._localParentNotSampled.shouldSample(t,e,n,r,o,i):this._root.shouldSample(t,e,n,r,o,i)},t.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},t}(),Br=function(){function t(t){void 0===t&&(t=0),this._ratio=t,this._ratio=this._normalize(t),this._upperBound=Math.floor(4294967295*this._ratio)}return t.prototype.shouldSample=function(t,e){return{decision:yt(e)&&this._accumulate(e)<this._upperBound?kr.RECORD_AND_SAMPLED:kr.NOT_RECORD}},t.prototype.toString=function(){return"TraceIdRatioBased{"+this._ratio+"}"},t.prototype._normalize=function(t){return"number"!=typeof t||isNaN(t)?0:t>=1?1:t<=0?0:t},t.prototype._accumulate=function(t){for(var e=0,n=0;n<t.length/8;n++){var r=8*n;e=(e^parseInt(t.slice(r,r+8),16))>>>0}return e},t}(),Zr=Le(),zr=ae.AlwaysOn,Hr=1;function Fr(){var t=Le();return{sampler:Gr(Zr),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:t.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:t.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:t.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:t.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT}}}function Gr(t){switch(void 0===t&&(t=Le()),t.OTEL_TRACES_SAMPLER){case ae.AlwaysOn:return new jr;case ae.AlwaysOff:return new Mr;case ae.ParentBasedAlwaysOn:return new Ur({root:new jr});case ae.ParentBasedAlwaysOff:return new Ur({root:new Mr});case ae.TraceIdRatio:return new Br(Xr(t));case ae.ParentBasedTraceIdRatio:return new Ur({root:new Br(Xr(t))});default:return It.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+zr+'".'),new jr}}function Xr(t){if(void 0===t.OTEL_TRACES_SAMPLER_ARG||""===t.OTEL_TRACES_SAMPLER_ARG)return It.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+Hr+"."),Hr;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(It.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+Hr+"."),Hr):e<0||e>1?(It.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+Hr+"."),Hr):e}function Vr(t){var e,n,r,o,i,a,s,u,c,l,p,f,h=Object.assign({},t.spanLimits),d=Oe(Re);return h.attributeCountLimit=null!==(a=null!==(i=null!==(o=null!==(n=null===(e=t.spanLimits)||void 0===e?void 0:e.attributeCountLimit)&&void 0!==n?n:null===(r=t.generalLimits)||void 0===r?void 0:r.attributeCountLimit)&&void 0!==o?o:d.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)&&void 0!==i?i:d.OTEL_ATTRIBUTE_COUNT_LIMIT)&&void 0!==a?a:ge,h.attributeValueLengthLimit=null!==(f=null!==(p=null!==(l=null!==(u=null===(s=t.spanLimits)||void 0===s?void 0:s.attributeValueLengthLimit)&&void 0!==u?u:null===(c=t.generalLimits)||void 0===c?void 0:c.attributeValueLengthLimit)&&void 0!==l?l:d.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)&&void 0!==p?p:d.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)&&void 0!==f?f:ve,Object.assign({},t,{spanLimits:h})}var qr=function(){function t(t,e){this._exporter=t,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=Le();this._maxExportBatchSize="number"==typeof(null==e?void 0:e.maxExportBatchSize)?e.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize="number"==typeof(null==e?void 0:e.maxQueueSize)?e.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis="number"==typeof(null==e?void 0:e.scheduledDelayMillis)?e.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis="number"==typeof(null==e?void 0:e.exportTimeoutMillis)?e.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new Bn(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(It.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}return t.prototype.forceFlush=function(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()},t.prototype.onStart=function(t,e){},t.prototype.onEnd=function(t){this._shutdownOnce.isCalled||t.spanContext().traceFlags&w.SAMPLED&&this._addToBuffer(t)},t.prototype.shutdown=function(){return this._shutdownOnce.call()},t.prototype._shutdown=function(){var t=this;return Promise.resolve().then((function(){return t.onShutdown()})).then((function(){return t._flushAll()})).then((function(){return t._exporter.shutdown()}))},t.prototype._addToBuffer=function(t){if(this._finishedSpans.length>=this._maxQueueSize)return 0===this._droppedSpansCount&&It.debug("maxQueueSize reached, dropping spans"),void this._droppedSpansCount++;this._droppedSpansCount>0&&(It.warn("Dropped "+this._droppedSpansCount+" spans because maxQueueSize reached"),this._droppedSpansCount=0),this._finishedSpans.push(t),this._maybeStartTimer()},t.prototype._flushAll=function(){var t=this;return new Promise((function(e,n){for(var r=[],o=0,i=Math.ceil(t._finishedSpans.length/t._maxExportBatchSize);o<i;o++)r.push(t._flushOneBatch());Promise.all(r).then((function(){e()})).catch(n)}))},t.prototype._flushOneBatch=function(){var t=this;return this._clearTimer(),0===this._finishedSpans.length?Promise.resolve():new Promise((function(e,n){var r=setTimeout((function(){n(new Error("Timeout"))}),t._exportTimeoutMillis);kt.with(function(t){return t.setValue(Wt,!0)}(kt.active()),(function(){var o;t._finishedSpans.length<=t._maxExportBatchSize?(o=t._finishedSpans,t._finishedSpans=[]):o=t._finishedSpans.splice(0,t._maxExportBatchSize);for(var i=function(){return t._exporter.export(o,(function(t){var o;clearTimeout(r),t.code===Fe.SUCCESS?e():n(null!==(o=t.error)&&void 0!==o?o:new Error("BatchSpanProcessor: span export failed"))}))},a=null,s=0,u=o.length;s<u;s++){var c=o[s];c.resource.asyncAttributesPending&&c.resource.waitForAsyncAttributes&&(null!=a||(a=[]),a.push(c.resource.waitForAsyncAttributes()))}null===a?i():Promise.all(a).then(i,(function(t){ue(t),n(t)}))}))}))},t.prototype._maybeStartTimer=function(){var t=this;if(!this._isExporting){var e=function(){t._isExporting=!0,t._flushOneBatch().finally((function(){t._isExporting=!1,t._finishedSpans.length>0&&(t._clearTimer(),t._maybeStartTimer())})).catch((function(e){t._isExporting=!1,ue(e)}))};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout((function(){return e()}),this._scheduledDelayMillis),this._timer)}},t.prototype._clearTimer=function(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)},t}(),Wr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kr=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.onInit(n),r}return Wr(e,t),e.prototype.onInit=function(t){var e=this;!0!==(null==t?void 0:t.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this._visibilityChangeListener=function(){"hidden"===document.visibilityState&&e.forceFlush()},this._pageHideListener=function(){e.forceFlush()},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))},e.prototype.onShutdown=function(){"undefined"!=typeof document&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))},e}(qr),Yr=function(){this.generateTraceId=Qr(16),this.generateSpanId=Qr(8)},$r=Array(32);function Qr(t){return function(){for(var e=0;e<2*t;e++)$r[e]=Math.floor(16*Math.random())+48,$r[e]>=58&&($r[e]+=39);return String.fromCharCode.apply(null,$r.slice(0,2*t))}}var Jr,to=function(){function t(t,e,n){this._tracerProvider=n;var r,o,i,a,s=(r=e,o={sampler:Gr()},i=Fr(),(a=Object.assign({},i,o,r)).generalLimits=Object.assign({},i.generalLimits,r.generalLimits||{}),a.spanLimits=Object.assign({},i.spanLimits,r.spanLimits||{}),a);this._sampler=s.sampler,this._generalLimits=s.generalLimits,this._spanLimits=s.spanLimits,this._idGenerator=e.idGenerator||new Yr,this.resource=n.resource,this.instrumentationLibrary=t}return t.prototype.startSpan=function(t,e,n){var r,o,i;void 0===e&&(e={}),void 0===n&&(n=kt.active()),e.root&&(n=qt.deleteSpan(n));var a=qt.getSpan(n);if(Kt(n))return It.debug("Instrumentation suppressed, returning Noop Span"),qt.wrapSpanContext(ut);var s,u,c,l=null==a?void 0:a.spanContext(),p=this._idGenerator.generateSpanId();l&&qt.isSpanContextValid(l)?(s=l.traceId,u=l.traceState,c=l.spanId):s=this._idGenerator.generateTraceId();var f=null!==(r=e.kind)&&void 0!==r?r:Rt.INTERNAL,h=(null!==(o=e.links)&&void 0!==o?o:[]).map((function(t){return{context:t.context,attributes:ne(t.attributes)}})),d=ne(e.attributes),_=this._sampler.shouldSample(n,s,t,f,d,h);u=null!==(i=_.traceState)&&void 0!==i?i:u;var v={traceId:s,spanId:p,traceFlags:_.decision===Ot.RECORD_AND_SAMPLED?w.SAMPLED:w.NONE,traceState:u};if(_.decision===Ot.NOT_RECORD)return It.debug("Recording is off, propagating context in a non-recording span"),qt.wrapSpanContext(v);var g=ne(Object.assign(d,_.attributes));return new xr(this,n,t,v,f,c,h,e.startTime,void 0,g)},t.prototype.startActiveSpan=function(t,e,n,r){var o,i,a;if(!(arguments.length<2)){2===arguments.length?a=e:3===arguments.length?(o=e,a=n):(o=e,i=n,a=r);var s=null!=i?i:kt.active(),u=this.startSpan(t,o,s),c=qt.setSpan(s,u);return kt.with(c,a,void 0,u)}},t.prototype.getGeneralLimits=function(){return this._generalLimits},t.prototype.getSpanLimits=function(){return this._spanLimits},t.prototype.getActiveSpanProcessor=function(){return this._tracerProvider.getActiveSpanProcessor()},t}(),eo=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},no=function(){function t(t){this._spanProcessors=t}return t.prototype.forceFlush=function(){var t,e,n=[];try{for(var r=eo(this._spanProcessors),o=r.next();!o.done;o=r.next()){var i=o.value;n.push(i.forceFlush())}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return new Promise((function(t){Promise.all(n).then((function(){t()})).catch((function(e){ue(e||new Error("MultiSpanProcessor: forceFlush failed")),t()}))}))},t.prototype.onStart=function(t,e){var n,r;try{for(var o=eo(this._spanProcessors),i=o.next();!i.done;i=o.next()){i.value.onStart(t,e)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},t.prototype.onEnd=function(t){var e,n;try{for(var r=eo(this._spanProcessors),o=r.next();!o.done;o=r.next()){o.value.onEnd(t)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.shutdown=function(){var t,e,n=[];try{for(var r=eo(this._spanProcessors),o=r.next();!o.done;o=r.next()){var i=o.value;n.push(i.shutdown())}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return new Promise((function(t,e){Promise.all(n).then((function(){t()}),e)}))},t}(),ro=function(){function t(){}return t.prototype.onStart=function(t,e){},t.prototype.onEnd=function(t){},t.prototype.shutdown=function(){return Promise.resolve()},t.prototype.forceFlush=function(){return Promise.resolve()},t}();!function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"}(Jr||(Jr={}));var oo,io,ao,so=function(){function t(t){var e;void 0===t&&(t={}),this._registeredSpanProcessors=[],this._tracers=new Map;var n=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=t.shift(),r=new WeakMap;t.length>0;)n=Pn(n,t.shift(),0,r);return n}({},Fr(),Vr(t));this.resource=null!==(e=n.resource)&&void 0!==e?e:sr.empty(),this.resource=sr.default().merge(this.resource),this._config=Object.assign({},n,{resource:this.resource});var r=this._buildExporterFromEnv();if(void 0!==r){var o=new Kr(r);this.activeSpanProcessor=o}else this.activeSpanProcessor=new ro}return t.prototype.getTracer=function(t,e,n){var r=t+"@"+(e||"")+":"+((null==n?void 0:n.schemaUrl)||"");return this._tracers.has(r)||this._tracers.set(r,new to({name:t,version:e,schemaUrl:null==n?void 0:n.schemaUrl},this._config,this)),this._tracers.get(r)},t.prototype.addSpanProcessor=function(t){0===this._registeredSpanProcessors.length&&this.activeSpanProcessor.shutdown().catch((function(t){return It.error("Error while trying to shutdown current span processor",t)})),this._registeredSpanProcessors.push(t),this.activeSpanProcessor=new no(this._registeredSpanProcessors)},t.prototype.getActiveSpanProcessor=function(){return this.activeSpanProcessor},t.prototype.register=function(t){void 0===t&&(t={}),qt.setGlobalTracerProvider(this),void 0===t.propagator&&(t.propagator=this._buildPropagatorFromEnv()),t.contextManager&&kt.setGlobalContextManager(t.contextManager),t.propagator&&Xt.setGlobalPropagator(t.propagator)},t.prototype.forceFlush=function(){var t=this._config.forceFlushTimeoutMillis,e=this._registeredSpanProcessors.map((function(e){return new Promise((function(n){var r,o=setTimeout((function(){n(new Error("Span processor did not completed within timeout period of "+t+" ms")),r=Jr.timeout}),t);e.forceFlush().then((function(){clearTimeout(o),r!==Jr.timeout&&(r=Jr.resolved,n(r))})).catch((function(t){clearTimeout(o),r=Jr.error,n(t)}))}))}));return new Promise((function(t,n){Promise.all(e).then((function(e){var r=e.filter((function(t){return t!==Jr.resolved}));r.length>0?n(r):t()})).catch((function(t){return n([t])}))}))},t.prototype.shutdown=function(){return this.activeSpanProcessor.shutdown()},t.prototype._getPropagator=function(t){var e;return null===(e=this.constructor._registeredPropagators.get(t))||void 0===e?void 0:e()},t.prototype._getSpanExporter=function(t){var e;return null===(e=this.constructor._registeredExporters.get(t))||void 0===e?void 0:e()},t.prototype._buildPropagatorFromEnv=function(){var t=this,e=Array.from(new Set(Le().OTEL_PROPAGATORS)),n=e.map((function(e){var n=t._getPropagator(e);return n||It.warn('Propagator "'+e+'" requested through environment variable is unavailable.'),n})).reduce((function(t,e){return e&&t.push(e),t}),[]);return 0===n.length?void 0:1===e.length?n[0]:new en({propagators:n})},t.prototype._buildExporterFromEnv=function(){var t=Le().OTEL_TRACES_EXPORTER;if("none"!==t&&""!==t){var e=this._getSpanExporter(t);return e||It.error('Exporter "'+t+'" requested through environment variable is unavailable.'),e}},t._registeredPropagators=new Map([["tracecontext",function(){return new hn}],["baggage",function(){return new Jt}]]),t._registeredExporters=new Map,t}(),uo=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},co=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},lo=function(){function t(){this._enabled=!1,this._currentContext=C}return t.prototype._bindFunction=function(t,e){void 0===t&&(t=C);var n=this,r=function(){for(var r=this,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.with(t,(function(){return e.apply(r,o)}))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:e.length}),r},t.prototype.active=function(){return this._currentContext},t.prototype.bind=function(t,e){return void 0===t&&(t=this.active()),"function"==typeof e?this._bindFunction(t,e):e},t.prototype.disable=function(){return this._currentContext=C,this._enabled=!1,this},t.prototype.enable=function(){return this._enabled||(this._enabled=!0,this._currentContext=C),this},t.prototype.with=function(t,e,n){for(var r=[],o=3;o<arguments.length;o++)r[o-3]=arguments[o];var i=this._currentContext;this._currentContext=t||C;try{return e.call.apply(e,co([n],uo(r),!1))}finally{this._currentContext=i}},t}(),po=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fo=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;if(e.contextManager)throw"contextManager should be defined in register method not in constructor";if(e.propagator)throw"propagator should be defined in register method not in constructor";return n}return po(e,t),e.prototype.register=function(e){void 0===e&&(e={}),void 0===e.contextManager&&(e.contextManager=new lo),e.contextManager&&e.contextManager.enable(),t.prototype.register.call(this,e)},e}(so);function ho(t,e){return e in t}function _o(t,e,n,r){var o=void 0,i=void 0;ho(n,e)&&"number"==typeof n[e]&&(o=n[e]);var a=oo.FETCH_START;if(ho(n,a)&&"number"==typeof n[a]&&(i=n[a]),void 0!==o&&void 0!==i&&o>=i)return t.addEvent(e,o),t}function vo(t,e){_o(t,oo.FETCH_START,e),_o(t,oo.DOMAIN_LOOKUP_START,e),_o(t,oo.DOMAIN_LOOKUP_END,e),_o(t,oo.CONNECT_START,e),ho(e,"name")&&e.name.startsWith("https:")&&_o(t,oo.SECURE_CONNECTION_START,e),_o(t,oo.CONNECT_END,e),_o(t,oo.REQUEST_START,e),_o(t,oo.RESPONSE_START,e),_o(t,oo.RESPONSE_END,e);var n=e[oo.ENCODED_BODY_SIZE];void 0!==n&&t.setAttribute("http.response_content_length",n);var r=e[oo.DECODED_BODY_SIZE];void 0!==r&&n!==r&&t.setAttribute("http.response_content_length_uncompressed",r)}function go(){return"undefined"!=typeof location?location.origin:void 0}function Eo(t,e,n,r,o,i){void 0===o&&(o=new WeakSet);var a=yo(t),s=function(t,e,n,r,o,i){var a=Ye(e),s=Ye(n),u=r.filter((function(e){var n=Ye(Ke(e[oo.FETCH_START])),r=Ye(Ke(e[oo.RESPONSE_END]));return e.initiatorType.toLowerCase()===(i||"xmlhttprequest")&&e.name===t&&n>=a&&r<=s}));u.length>0&&(u=u.filter((function(t){return!o.has(t)})));return u}(t=a.toString(),e,n,r,o,i);if(0===s.length)return{mainRequest:void 0};if(1===s.length)return{mainRequest:s[0]};var u=function(t){return t.slice().sort((function(t,e){var n=t[oo.FETCH_START],r=e[oo.FETCH_START];return n>r?1:n<r?-1:0}))}(s);if(a.origin!==go()&&u.length>1){var c=u[0],l=function(t,e,n){for(var r,o=Ye(n),i=Ye(Ke(e)),a=t[1],s=t.length,u=1;u<s;u++){var c=t[u],l=Ye(Ke(c[oo.FETCH_START])),p=o-Ye(Ke(c[oo.RESPONSE_END]));l>=i&&(!r||p<r)&&(r=p,a=c)}return a}(u,c[oo.RESPONSE_END],n),p=c[oo.RESPONSE_END];return l[oo.FETCH_START]<p&&(l=c,c=void 0),{corsPreFlightRequest:c,mainRequest:l}}return{mainRequest:s[0]}}function yo(t){if("function"==typeof URL)return new URL(t,"undefined"!=typeof document?document.baseURI:"undefined"!=typeof location?location.href:void 0);var e=(io||(io=document.createElement("a")),io);return e.href=t,e}function To(t,e){var n=e||[];return("string"==typeof n||n instanceof RegExp)&&(n=[n]),yo(t).origin===go()||n.some((function(e){return Dn(t,e)}))}!function(t){t.CONNECT_END="connectEnd",t.CONNECT_START="connectStart",t.DECODED_BODY_SIZE="decodedBodySize",t.DOM_COMPLETE="domComplete",t.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",t.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",t.DOM_INTERACTIVE="domInteractive",t.DOMAIN_LOOKUP_END="domainLookupEnd",t.DOMAIN_LOOKUP_START="domainLookupStart",t.ENCODED_BODY_SIZE="encodedBodySize",t.FETCH_START="fetchStart",t.LOAD_EVENT_END="loadEventEnd",t.LOAD_EVENT_START="loadEventStart",t.NAVIGATION_START="navigationStart",t.REDIRECT_END="redirectEnd",t.REDIRECT_START="redirectStart",t.REQUEST_START="requestStart",t.RESPONSE_END="responseEnd",t.RESPONSE_START="responseStart",t.SECURE_CONNECTION_START="secureConnectionStart",t.UNLOAD_EVENT_END="unloadEventEnd",t.UNLOAD_EVENT_START="unloadEventStart"}(oo||(oo={})),function(t){t.COMPONENT="component",t.HTTP_ERROR_NAME="http.error_name",t.HTTP_STATUS_TEXT="http.status_text"}(ao||(ao={}));var mo,bo,So="0.53.0",Oo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ro="object"==typeof process&&"node"===(null===(mo=process.release)||void 0===mo?void 0:mo.name),Lo=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,"@opentelemetry/instrumentation-fetch",So,e)||this;return n.component="fetch",n.version=So,n.moduleName=n.component,n._usedResources=new WeakSet,n._tasksCount=0,n}return Oo(e,t),e.prototype.init=function(){},e.prototype._addChildSpan=function(t,e){var n=this.tracer.startSpan("CORS Preflight",{startTime:e[oo.FETCH_START]},qt.setSpan(kt.active(),t));this.getConfig().ignoreNetworkEvents||vo(n,e),n.end(e[oo.RESPONSE_END])},e.prototype._addFinalSpanAttributes=function(t,e){var n=yo(e.url);t.setAttribute(je,e.status),null!=e.statusText&&t.setAttribute(ao.HTTP_STATUS_TEXT,e.statusText),t.setAttribute(xe,n.host),t.setAttribute(Me,n.protocol.replace(":","")),"undefined"!=typeof navigator&&t.setAttribute(Ue,navigator.userAgent)},e.prototype._addHeaders=function(t,e){if(!To(e,this.getConfig().propagateTraceHeaderCorsUrls)){var n={};return Xt.inject(kt.active(),n),void(Object.keys(n).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(t instanceof Request)Xt.inject(kt.active(),t.headers,{set:function(t,e,n){return t.set(e,"string"==typeof n?n:String(n))}});else if(t.headers instanceof Headers)Xt.inject(kt.active(),t.headers,{set:function(t,e,n){return t.set(e,"string"==typeof n?n:String(n))}});else if(t.headers instanceof Map)Xt.inject(kt.active(),t.headers,{set:function(t,e,n){return t.set(e,"string"==typeof n?n:String(n))}});else{n={};Xt.inject(kt.active(),n),t.headers=Object.assign({},n,t.headers||{})}},e.prototype._clearResources=function(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)},e.prototype._createSpan=function(t,e){var n;if(void 0===e&&(e={}),!xn(t,this.getConfig().ignoreUrls)){var r=(e.method||"GET").toUpperCase(),o="HTTP "+r;return this.tracer.startSpan(o,{kind:Rt.CLIENT,attributes:(n={},n[ao.COMPONENT]=this.moduleName,n[Ne]=r,n[De]=t,n)})}this._diag.debug("ignoring span as url matches ignored url")},e.prototype._findResourceAndAddNetworkEvents=function(t,e,n){var r=e.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType("resource")}var o=Eo(e.spanUrl,e.startTime,n,r,this._usedResources,"fetch");if(o.mainRequest){var i=o.mainRequest;this._markResourceAsUsed(i);var a=o.corsPreFlightRequest;a&&(this._addChildSpan(t,a),this._markResourceAsUsed(a)),this.getConfig().ignoreNetworkEvents||vo(t,i)}},e.prototype._markResourceAsUsed=function(t){this._usedResources.add(t)},e.prototype._endSpan=function(t,e,n){var r=this,o=Ve(Date.now()),i=We();this._addFinalSpanAttributes(t,n),setTimeout((function(){var n;null===(n=e.observer)||void 0===n||n.disconnect(),r._findResourceAndAddNetworkEvents(t,e,i),r._tasksCount--,r._clearResources(),t.end(o)}),300)},e.prototype._patchConstructor=function(){var t=this;return function(e){var n=t;return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var o=this,i=yo(t[0]instanceof Request?t[0].url:String(t[0])).href,a=t[0]instanceof Request?t[0]:t[1]||{},s=n._createSpan(i,a);if(!s)return e.apply(this,t);var u=n._prepareSpanData(i);function c(t,e){n._applyAttributesAfterFetch(t,a,e),n._endSpan(t,u,{status:e.status||0,statusText:e.message,url:i})}function l(t,e){n._applyAttributesAfterFetch(t,a,e),e.status>=200&&e.status<400?n._endSpan(t,u,e):n._endSpan(t,u,{status:e.status,statusText:e.statusText,url:i})}function p(t,e,n){try{var r=n.clone(),o=n.clone(),i=r.body;if(i){var a=i.getReader(),s=function(){a.read().then((function(e){e.done?l(t,o):s()}),(function(e){c(t,e)}))};s()}else l(t,n)}finally{e(n)}}function f(t,e,n){try{c(t,n)}finally{e(n)}}return new Promise((function(t,r){return kt.with(qt.setSpan(kt.active(),s),(function(){return n._addHeaders(a,i),n._tasksCount++,e.apply(o,a instanceof Request?[a]:[i,a]).then(p.bind(o,s,t),f.bind(o,s,r))}))}))}}},e.prototype._applyAttributesAfterFetch=function(t,e,n){var r=this,o=this.getConfig().applyCustomAttributesOnSpan;o&&Ar((function(){return o(t,e,n)}),(function(t){t&&r._diag.error("applyCustomAttributesOnSpan",t)}),!0)},e.prototype._prepareSpanData=function(t){var e=We(),n=[];if("function"!=typeof PerformanceObserver)return{entries:n,startTime:e,spanUrl:t};var r=new PerformanceObserver((function(e){e.getEntries().forEach((function(e){"fetch"===e.initiatorType&&e.name===t&&n.push(e)}))}));return r.observe({entryTypes:["resource"]}),{entries:n,observer:r,startTime:e,spanUrl:t}},e.prototype.enable=function(){Ro?this._diag.warn("this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()"):(Cr(fetch)&&(this._unwrap(Re,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(Re,"fetch",this._patchConstructor()))},e.prototype.disable=function(){Ro||(this._unwrap(Re,"fetch"),this._usedResources=new WeakSet)},e}(wr);!function(t){t.METHOD_OPEN="open",t.METHOD_SEND="send",t.EVENT_ABORT="abort",t.EVENT_ERROR="error",t.EVENT_LOAD="loaded",t.EVENT_TIMEOUT="timeout"}(bo||(bo={}));var Po,wo="0.53.0";!function(t){t.HTTP_STATUS_TEXT="http.status_text"}(Po||(Po={}));var Ao=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Co=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,"@opentelemetry/instrumentation-xml-http-request",wo,e)||this;return n.component="xml-http-request",n.version=wo,n.moduleName=n.component,n._tasksCount=0,n._xhrMem=new WeakMap,n._usedResources=new WeakSet,n}return Ao(e,t),e.prototype.init=function(){},e.prototype._addHeaders=function(t,e){if(!To(yo(e).href,this.getConfig().propagateTraceHeaderCorsUrls)){var n={};return Xt.inject(kt.active(),n),void(Object.keys(n).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}var r={};Xt.inject(kt.active(),r),Object.keys(r).forEach((function(e){t.setRequestHeader(e,String(r[e]))}))},e.prototype._addChildSpan=function(t,e){var n=this;kt.with(qt.setSpan(kt.active(),t),(function(){var t=n.tracer.startSpan("CORS Preflight",{startTime:e[oo.FETCH_START]});n.getConfig().ignoreNetworkEvents||vo(t,e),t.end(e[oo.RESPONSE_END])}))},e.prototype._addFinalSpanAttributes=function(t,e,n){if("string"==typeof n){var r=yo(n);void 0!==e.status&&t.setAttribute(je,e.status),void 0!==e.statusText&&t.setAttribute(Po.HTTP_STATUS_TEXT,e.statusText),t.setAttribute(xe,r.host),t.setAttribute(Me,r.protocol.replace(":","")),t.setAttribute(Ue,navigator.userAgent)}},e.prototype._applyAttributesAfterXHR=function(t,e){var n=this,r=this.getConfig().applyCustomAttributesOnSpan;"function"==typeof r&&Ar((function(){return r(t,e)}),(function(t){t&&n._diag.error("applyCustomAttributesOnSpan",t)}),!0)},e.prototype._addResourceObserver=function(t,e){var n=this._xhrMem.get(t);n&&"function"==typeof PerformanceObserver&&"function"==typeof PerformanceResourceTiming&&(n.createdResources={observer:new PerformanceObserver((function(t){var r=t.getEntries(),o=yo(e);r.forEach((function(t){"xmlhttprequest"===t.initiatorType&&t.name===o.href&&n.createdResources&&n.createdResources.entries.push(t)}))})),entries:[]},n.createdResources.observer.observe({entryTypes:["resource"]}))},e.prototype._clearResources=function(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(Ce.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)},e.prototype._findResourceAndAddNetworkEvents=function(t,e,n,r,o){if(n&&r&&o&&t.createdResources){var i=t.createdResources.entries;i&&i.length||(i=Ce.getEntriesByType("resource"));var a=Eo(yo(n).href,r,o,i,this._usedResources);if(a.mainRequest){var s=a.mainRequest;this._markResourceAsUsed(s);var u=a.corsPreFlightRequest;u&&(this._addChildSpan(e,u),this._markResourceAsUsed(u)),this.getConfig().ignoreNetworkEvents||vo(e,s)}}},e.prototype._cleanPreviousSpanInformation=function(t){var e=this._xhrMem.get(t);if(e){var n=e.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(t)}},e.prototype._createSpan=function(t,e,n){var r;if(!xn(e,this.getConfig().ignoreUrls)){var o=n.toUpperCase(),i=this.tracer.startSpan(o,{kind:Rt.CLIENT,attributes:(r={},r[Ne]=n,r[De]=yo(e).toString(),r)});return i.addEvent(bo.METHOD_OPEN),this._cleanPreviousSpanInformation(t),this._xhrMem.set(t,{span:i,spanUrl:e}),i}this._diag.debug("ignoring span as url matches ignored url")},e.prototype._markResourceAsUsed=function(t){this._usedResources.add(t)},e.prototype._patchOpen=function(){var t=this;return function(e){var n=t;return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var o=t[0],i=t[1];return n._createSpan(this,i,o),e.apply(this,t)}}},e.prototype._patchSend=function(){var t=this;function e(e,n){var r=t._xhrMem.get(n);if(r){r.status=n.status,r.statusText=n.statusText,t._xhrMem.delete(n),r.span&&t._applyAttributesAfterXHR(r.span,n);var o=We(),i=Date.now();setTimeout((function(){!function(e,n,r,o){var i=n.callbackToRemoveEvents;"function"==typeof i&&i();var a=n.span,s=n.spanUrl,u=n.sendStartTime;a&&(t._findResourceAndAddNetworkEvents(n,a,s,u,r),a.addEvent(e,o),t._addFinalSpanAttributes(a,n,s),a.end(o),t._tasksCount--),t._clearResources()}(e,r,o,i)}),300)}}function n(){e(bo.EVENT_ERROR,this)}function r(){e(bo.EVENT_ABORT,this)}function o(){e(bo.EVENT_TIMEOUT,this)}function i(){this.status<299?e(bo.EVENT_LOAD,this):e(bo.EVENT_ERROR,this)}return function(e){return function(){for(var a=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];var c=t._xhrMem.get(this);if(!c)return e.apply(this,s);var l=c.span,p=c.spanUrl;return l&&p&&kt.with(qt.setSpan(kt.active(),l),(function(){t._tasksCount++,c.sendStartTime=We(),l.addEvent(bo.METHOD_SEND),a.addEventListener("abort",r),a.addEventListener("error",n),a.addEventListener("load",i),a.addEventListener("timeout",o),c.callbackToRemoveEvents=function(){!function(e){e.removeEventListener("abort",r),e.removeEventListener("error",n),e.removeEventListener("load",i),e.removeEventListener("timeout",o);var a=t._xhrMem.get(e);a&&(a.callbackToRemoveEvents=void 0)}(a),c.createdResources&&c.createdResources.observer.disconnect()},t._addHeaders(a,p),t._addResourceObserver(a,p)})),e.apply(this,s)}}},e.prototype.enable=function(){this._diag.debug("applying patch to",this.moduleName,this.version),Cr(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),Cr(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())},e.prototype.disable=function(){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},e}(wr);class ko extends Co{constructor(t={}){super(t);this.parentCreateSpan=this._createSpan.bind(this)}_patchOpen(){return t=>{const e=this;return function(...n){const r=n[0];let o=n[1];return o instanceof URL&&(o=o.href),e.parentCreateSpan(this,o,r),t.apply(this,n)}}}}function Io(t,e,n){No(t,n instanceof Error?0:n.status)}function No(t,e){if(null==e)return;(0===e||e>=400&&e<600)&&t.setStatus({code:Lt.ERROR})}function Do(t){return(e,n,r)=>{Io(e,0,r),null==t||t(e,n,r)}}function xo(t){return(e,n)=>{!function(t,e){No(t,e.status)}(e,n),null==t||t(e,n)}}function Mo(t={}){const{fetchInstrumentationOptions:e,xhrInstrumentationOptions:n}=t,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["fetchInstrumentationOptions","xhrInstrumentationOptions"]),o=function(t,e){return Object.assign(Object.assign(Object.assign(Object.assign({},e),{ignoreNetworkEvents:!0}),t),{applyCustomAttributesOnSpan:Do(null==t?void 0:t.applyCustomAttributesOnSpan)})}(e,r),i=function(t,e){return Object.assign(Object.assign(Object.assign(Object.assign({},e),{ignoreNetworkEvents:!0}),t),{applyCustomAttributesOnSpan:xo(null==t?void 0:t.applyCustomAttributesOnSpan)})}(n,r);return[new Lo(o),new ko(i)]}var jo="OT_ZONE_CONTEXT",Uo=function(){function t(){this._enabled=!1,this._zoneCounter=0}return t.prototype._activeContextFromZone=function(t){return t&&t.get(jo)||C},t.prototype._bindFunction=function(t,e){var n=this,r=function(){for(var r=this,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n.with(t,(function(){return e.apply(r,o)}))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:e.length}),r},t.prototype._bindListener=function(t,e){var n=e;return void 0!==n.__ot_listeners||(n.__ot_listeners={},"function"==typeof n.addEventListener&&(n.addEventListener=this._patchAddEventListener(n,n.addEventListener,t)),"function"==typeof n.removeEventListener&&(n.removeEventListener=this._patchRemoveEventListener(n,n.removeEventListener))),e},t.prototype._createZoneName=function(){this._zoneCounter++;var t=Math.random();return this._zoneCounter+"-"+t},t.prototype._createZone=function(t,e){var n;return Zone.current.fork({name:t,properties:(n={},n[jo]=e,n)})},t.prototype._getActiveZone=function(){return Zone.current},t.prototype._patchAddEventListener=function(t,e,n){var r=this;return function(o,i,a){void 0===t.__ot_listeners&&(t.__ot_listeners={});var s=t.__ot_listeners[o];void 0===s&&(s=new WeakMap,t.__ot_listeners[o]=s);var u=r.bind(n,i);return s.set(i,u),e.call(this,o,u,a)}},t.prototype._patchRemoveEventListener=function(t,e){return function(n,r){if(void 0===t.__ot_listeners||void 0===t.__ot_listeners[n])return e.call(this,n,r);var o=t.__ot_listeners[n],i=o.get(r);return o.delete(r),e.call(this,n,i||r)}},t.prototype.active=function(){if(!this._enabled)return C;var t=this._getActiveZone(),e=this._activeContextFromZone(t);return e||C},t.prototype.bind=function(t,e){return void 0===t&&(t=this.active()),"function"==typeof e?this._bindFunction(t,e):(void 0===(n=e)&&(n={}),"function"==typeof n.addEventListener&&"function"==typeof n.removeEventListener&&this._bindListener(t,e),e);var n},t.prototype.disable=function(){return this._enabled=!1,this},t.prototype.enable=function(){return this._enabled=!0,this},t.prototype.with=function(t,e,n){for(var r=[],o=3;o<arguments.length;o++)r[o-3]=arguments[o];var i=this._createZoneName();return this._createZone(i,t).run(e,n,r)},t}();
2
2
  /**
3
3
  * @license Angular v<unknown>
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
- const Uo=globalThis;function Bo(t){return(Uo.__Zone_symbol_prefix||"__zone_symbol__")+t}const Zo=Object.getOwnPropertyDescriptor,zo=Object.defineProperty,Ho=Object.getPrototypeOf,Fo=Object.create,Go=Array.prototype.slice,Xo="addEventListener",Vo="removeEventListener",qo=Bo(Xo),Wo=Bo(Vo),Ko="true",Yo="false",$o=Bo("");function Qo(t,e){return Zone.current.wrap(t,e)}function Jo(t,e,n,r,o){return Zone.current.scheduleMacroTask(t,e,n,r,o)}const ti=Bo,ei="undefined"!=typeof window,ni=ei?window:void 0,ri=ei&&ni||globalThis,oi="removeAttribute";function ii(t,e){for(let n=t.length-1;n>=0;n--)"function"==typeof t[n]&&(t[n]=Qo(t[n],e+"_"+n));return t}function ai(t){return!t||!1!==t.writable&&!("function"==typeof t.get&&void 0===t.set)}const si="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,ui=!("nw"in ri)&&void 0!==ri.process&&"[object process]"===ri.process.toString(),ci=!ui&&!si&&!(!ei||!ni.HTMLElement),li=void 0!==ri.process&&"[object process]"===ri.process.toString()&&!si&&!(!ei||!ni.HTMLElement),pi={},fi=ti("enable_beforeunload"),hi=function(t){if(!(t=t||ri.event))return;let e=pi[t.type];e||(e=pi[t.type]=ti("ON_PROPERTY"+t.type));const n=this||t.target||ri,r=n[e];let o;if(ci&&n===ni&&"error"===t.type){const e=t;o=r&&r.call(this,e.message,e.filename,e.lineno,e.colno,e.error),!0===o&&t.preventDefault()}else o=r&&r.apply(this,arguments),"beforeunload"===t.type&&ri[fi]&&"string"==typeof o?t.returnValue=o:null==o||o||t.preventDefault();return o};function di(t,e,n){let r=Zo(t,e);if(!r&&n){Zo(n,e)&&(r={enumerable:!0,configurable:!0})}if(!r||!r.configurable)return;const o=ti("on"+e+"patched");if(t.hasOwnProperty(o)&&t[o])return;delete r.writable,delete r.value;const i=r.get,a=r.set,s=e.slice(2);let u=pi[s];u||(u=pi[s]=ti("ON_PROPERTY"+s)),r.set=function(e){let n=this;if(n||t!==ri||(n=ri),!n)return;"function"==typeof n[u]&&n.removeEventListener(s,hi),a&&a.call(n,null),n[u]=e,"function"==typeof e&&n.addEventListener(s,hi,!1)},r.get=function(){let n=this;if(n||t!==ri||(n=ri),!n)return null;const o=n[u];if(o)return o;if(i){let t=i.call(this);if(t)return r.set.call(this,t),"function"==typeof n[oi]&&n.removeAttribute(e),t}return null},zo(t,e,r),t[o]=!0}function _i(t,e,n){if(e)for(let r=0;r<e.length;r++)di(t,"on"+e[r],n);else{const e=[];for(const n in t)"on"==n.slice(0,2)&&e.push(n);for(let r=0;r<e.length;r++)di(t,e[r],n)}}const vi=ti("originalInstance");function gi(t){const e=ri[t];if(!e)return;ri[ti(t)]=e,ri[t]=function(){const n=ii(arguments,t);switch(n.length){case 0:this[vi]=new e;break;case 1:this[vi]=new e(n[0]);break;case 2:this[vi]=new e(n[0],n[1]);break;case 3:this[vi]=new e(n[0],n[1],n[2]);break;case 4:this[vi]=new e(n[0],n[1],n[2],n[3]);break;default:throw new Error("Arg list too long.")}},Ti(ri[t],e);const n=new e((function(){}));let r;for(r in n)"XMLHttpRequest"===t&&"responseBlob"===r||function(e){"function"==typeof n[e]?ri[t].prototype[e]=function(){return this[vi][e].apply(this[vi],arguments)}:zo(ri[t].prototype,e,{set:function(n){"function"==typeof n?(this[vi][e]=Qo(n,t+"."+e),Ti(this[vi][e],n)):this[vi][e]=n},get:function(){return this[vi][e]}})}(r);for(r in e)"prototype"!==r&&e.hasOwnProperty(r)&&(ri[t][r]=e[r])}function Ei(t,e,n){let r=t;for(;r&&!r.hasOwnProperty(e);)r=Ho(r);!r&&t[e]&&(r=t);const o=ti(e);let i=null;if(r&&(!(i=r[o])||!r.hasOwnProperty(o))){i=r[o]=r[e];if(ai(r&&Zo(r,e))){const t=n(i,o,e);r[e]=function(){return t(this,arguments)},Ti(r[e],i)}}return i}function yi(t,e,n){let r=null;function o(t){const e=t.data;return e.args[e.cbIdx]=function(){t.invoke.apply(this,arguments)},r.apply(e.target,e.args),t}r=Ei(t,e,(t=>function(e,r){const i=n(e,r);return i.cbIdx>=0&&"function"==typeof r[i.cbIdx]?Jo(i.name,r[i.cbIdx],i,o):t.apply(e,r)}))}function Ti(t,e){t[ti("OriginalDelegate")]=e}let mi=!1,bi=!1;function Si(){try{const t=ni.navigator.userAgent;if(-1!==t.indexOf("MSIE ")||-1!==t.indexOf("Trident/"))return!0}catch(t){}return!1}function Oi(){if(mi)return bi;mi=!0;try{const t=ni.navigator.userAgent;-1===t.indexOf("MSIE ")&&-1===t.indexOf("Trident/")&&-1===t.indexOf("Edge/")||(bi=!0)}catch(t){}return bi}function Ri(t){return"function"==typeof t}function Li(t){return"number"==typeof t}let Pi=!1;if("undefined"!=typeof window)try{const t=Object.defineProperty({},"passive",{get:function(){Pi=!0}});window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){Pi=!1}const wi={useG:!0},Ai={},Ci={},ki=new RegExp("^"+$o+"(\\w+)(true|false)$"),Ii=ti("propagationStopped");function Ni(t,e){const n=(e?e(t):t)+Yo,r=(e?e(t):t)+Ko,o=$o+n,i=$o+r;Ai[t]={},Ai[t][Yo]=o,Ai[t][Ko]=i}function Di(t,e,n,r){const o=r&&r.add||Xo,i=r&&r.rm||Vo,a=r&&r.listeners||"eventListeners",s=r&&r.rmAll||"removeAllListeners",u=ti(o),c="."+o+":",l="prependListener",p="."+l+":",f=function(t,e,n){if(t.isRemoved)return;const r=t.callback;let o;"object"==typeof r&&r.handleEvent&&(t.callback=t=>r.handleEvent(t),t.originalDelegate=r);try{t.invoke(t,e,[n])}catch(t){o=t}const a=t.options;if(a&&"object"==typeof a&&a.once){const r=t.originalDelegate?t.originalDelegate:t.callback;e[i].call(e,n.type,r,a)}return o};function h(n,r,o){if(!(r=r||t.event))return;const i=n||r.target||t,a=i[Ai[r.type][o?Ko:Yo]];if(a){const t=[];if(1===a.length){const e=f(a[0],i,r);e&&t.push(e)}else{const e=a.slice();for(let n=0;n<e.length&&(!r||!0!==r[Ii]);n++){const o=f(e[n],i,r);o&&t.push(o)}}if(1===t.length)throw t[0];for(let n=0;n<t.length;n++){const r=t[n];e.nativeScheduleMicroTask((()=>{throw r}))}}}const d=function(t){return h(this,t,!1)},_=function(t){return h(this,t,!0)};function v(e,n){if(!e)return!1;let r=!0;n&&void 0!==n.useG&&(r=n.useG);const f=n&&n.vh;let h=!0;n&&void 0!==n.chkDup&&(h=n.chkDup);let v=!1;n&&void 0!==n.rt&&(v=n.rt);let g=e;for(;g&&!g.hasOwnProperty(o);)g=Ho(g);if(!g&&e[o]&&(g=e),!g)return!1;if(g[u])return!1;const E=n&&n.eventNameToString,y={},T=g[u]=g[o],m=g[ti(i)]=g[i],b=g[ti(a)]=g[a],S=g[ti(s)]=g[s];let O;n&&n.prepend&&(O=g[ti(n.prepend)]=g[n.prepend]);const R=function(t){return O.call(y.target,y.eventName,t.invoke,y.options)},L=r?function(t){if(!y.isExisting)return T.call(y.target,y.eventName,y.capture?_:d,y.options)}:function(t){return T.call(y.target,y.eventName,t.invoke,y.options)},P=r?function(t){if(!t.isRemoved){const e=Ai[t.eventName];let n;e&&(n=e[t.capture?Ko:Yo]);const r=n&&t.target[n];if(r)for(let e=0;e<r.length;e++){if(r[e]===t){r.splice(e,1),t.isRemoved=!0,t.removeAbortListener&&(t.removeAbortListener(),t.removeAbortListener=null),0===r.length&&(t.allRemoved=!0,t.target[n]=null);break}}}if(t.allRemoved)return m.call(t.target,t.eventName,t.capture?_:d,t.options)}:function(t){return m.call(t.target,t.eventName,t.invoke,t.options)},w=n&&n.diff?n.diff:function(t,e){const n=typeof e;return"function"===n&&t.callback===e||"object"===n&&t.originalDelegate===e},A=Zone[ti("UNPATCHED_EVENTS")],C=t[ti("PASSIVE_EVENTS")];const k=function(e,o,i,a,s=!1,u=!1){return function(){const c=this||t;let l=arguments[0];n&&n.transferEventName&&(l=n.transferEventName(l));let p=arguments[1];if(!p)return e.apply(this,arguments);if(ui&&"uncaughtException"===l)return e.apply(this,arguments);let d=!1;if("function"!=typeof p){if(!p.handleEvent)return e.apply(this,arguments);d=!0}if(f&&!f(e,p,c,arguments))return;const _=Pi&&!!C&&-1!==C.indexOf(l),v=function(t){if("object"==typeof t&&null!==t){const e={...t};return t.signal&&(e.signal=t.signal),e}return t}(function(t,e){return!Pi&&"object"==typeof t&&t?!!t.capture:Pi&&e?"boolean"==typeof t?{capture:t,passive:!0}:t?"object"==typeof t&&!1!==t.passive?{...t,passive:!0}:t:{passive:!0}:t}(arguments[2],_)),g=v?.signal;if(g?.aborted)return;if(A)for(let t=0;t<A.length;t++)if(l===A[t])return _?e.call(c,l,p,v):e.apply(this,arguments);const T=!!v&&("boolean"==typeof v||v.capture),m=!(!v||"object"!=typeof v)&&v.once,b=Zone.current;let S=Ai[l];S||(Ni(l,E),S=Ai[l]);const O=S[T?Ko:Yo];let R,L=c[O],P=!1;if(L){if(P=!0,h)for(let t=0;t<L.length;t++)if(w(L[t],p))return}else L=c[O]=[];const k=c.constructor.name,I=Ci[k];I&&(R=I[l]),R||(R=k+o+(E?E(l):l)),y.options=v,m&&(y.options.once=!1),y.target=c,y.capture=T,y.eventName=l,y.isExisting=P;const N=r?wi:void 0;N&&(N.taskData=y),g&&(y.options.signal=void 0);const D=b.scheduleEventTask(R,p,N,i,a);if(g){y.options.signal=g;const t=()=>D.zone.cancelTask(D);e.call(g,"abort",t,{once:!0}),D.removeAbortListener=()=>g.removeEventListener("abort",t)}return y.target=null,N&&(N.taskData=null),m&&(y.options.once=!0),(Pi||"boolean"!=typeof D.options)&&(D.options=v),D.target=c,D.capture=T,D.eventName=l,d&&(D.originalDelegate=p),u?L.unshift(D):L.push(D),s?c:void 0}};return g[o]=k(T,c,L,P,v),O&&(g[l]=k(O,p,R,P,v,!0)),g[i]=function(){const e=this||t;let r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));const o=arguments[2],i=!!o&&("boolean"==typeof o||o.capture),a=arguments[1];if(!a)return m.apply(this,arguments);if(f&&!f(m,a,e,arguments))return;const s=Ai[r];let u;s&&(u=s[i?Ko:Yo]);const c=u&&e[u];if(c)for(let t=0;t<c.length;t++){const n=c[t];if(w(n,a)){if(c.splice(t,1),n.isRemoved=!0,0===c.length&&(n.allRemoved=!0,e[u]=null,!i&&"string"==typeof r)){e[$o+"ON_PROPERTY"+r]=null}return n.zone.cancelTask(n),v?e:void 0}}return m.apply(this,arguments)},g[a]=function(){const e=this||t;let r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));const o=[],i=xi(e,E?E(r):r);for(let t=0;t<i.length;t++){const e=i[t];let n=e.originalDelegate?e.originalDelegate:e.callback;o.push(n)}return o},g[s]=function(){const e=this||t;let r=arguments[0];if(r){n&&n.transferEventName&&(r=n.transferEventName(r));const t=Ai[r];if(t){const n=t[Yo],o=t[Ko],a=e[n],s=e[o];if(a){const t=a.slice();for(let e=0;e<t.length;e++){const n=t[e];let o=n.originalDelegate?n.originalDelegate:n.callback;this[i].call(this,r,o,n.options)}}if(s){const t=s.slice();for(let e=0;e<t.length;e++){const n=t[e];let o=n.originalDelegate?n.originalDelegate:n.callback;this[i].call(this,r,o,n.options)}}}}else{const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e],r=ki.exec(n);let o=r&&r[1];o&&"removeListener"!==o&&this[s].call(this,o)}this[s].call(this,"removeListener")}if(v)return this},Ti(g[o],T),Ti(g[i],m),S&&Ti(g[s],S),b&&Ti(g[a],b),!0}let g=[];for(let t=0;t<n.length;t++)g[t]=v(n[t],r);return g}function xi(t,e){if(!e){const n=[];for(let r in t){const o=ki.exec(r);let i=o&&o[1];if(i&&(!e||i===e)){const e=t[r];if(e)for(let t=0;t<e.length;t++)n.push(e[t])}}return n}let n=Ai[e];n||(Ni(e),n=Ai[e]);const r=t[n[Yo]],o=t[n[Ko]];return r?o?r.concat(o):r.slice():o?o.slice():[]}function Mi(t,e){const n=t.Event;n&&n.prototype&&e.patchMethod(n.prototype,"stopImmediatePropagation",(t=>function(e,n){e[Ii]=!0,t&&t.apply(e,n)}))}function ji(t,e){e.patchMethod(t,"queueMicrotask",(t=>function(t,e){Zone.current.scheduleMicroTask("queueMicrotask",e[0])}))}const Ui=ti("zoneTask");function Bi(t,e,n,r){let o=null,i=null;n+=r;const a={};function s(e){const n=e.data;n.args[0]=function(){return e.invoke.apply(this,arguments)};const r=o.apply(t,n.args);return Li(r)?n.handleId=r:(n.handle=r,n.isRefreshable=Ri(r.refresh)),e}function u(e){const{handle:n,handleId:r}=e.data;return i.call(t,n??r)}o=Ei(t,e+=r,(n=>function(o,i){if(Ri(i[0])){const t={isRefreshable:!1,isPeriodic:"Interval"===r,delay:"Timeout"===r||"Interval"===r?i[1]||0:void 0,args:i},n=i[0];i[0]=function(){try{return n.apply(this,arguments)}finally{const{handle:e,handleId:n,isPeriodic:r,isRefreshable:o}=t;r||o||(n?delete a[n]:e&&(e[Ui]=null))}};const o=Jo(e,i[0],t,s,u);if(!o)return o;const{handleId:c,handle:l,isRefreshable:p,isPeriodic:f}=o.data;if(c)a[c]=o;else if(l&&(l[Ui]=o,p&&!f)){const t=l.refresh;l.refresh=function(){const{zone:e,state:n}=o;return"notScheduled"===n?(o._state="scheduled",e._updateTaskCount(o,1)):"running"===n&&(o._state="scheduling"),t.call(this)}}return l??c??o}return n.apply(t,i)})),i=Ei(t,n,(e=>function(n,r){const o=r[0];let i;Li(o)?(i=a[o],delete a[o]):(i=o?.[Ui],i?o[Ui]=null:i=o),i?.type?i.cancelFn&&i.zone.cancelTask(i):e.apply(t,r)}))}function Zi(t,e){if(Zone[e.symbol("patchEventTarget")])return;const{eventNames:n,zoneSymbolEventNames:r,TRUE_STR:o,FALSE_STR:i,ZONE_SYMBOL_PREFIX:a}=e.getGlobalObjects();for(let t=0;t<n.length;t++){const e=n[t],s=a+(e+i),u=a+(e+o);r[e]={},r[e][i]=s,r[e][o]=u}const s=t.EventTarget;return s&&s.prototype?(e.patchEventTarget(t,e,[s&&s.prototype]),!0):void 0}function zi(t,e,n){if(!n||0===n.length)return e;const r=n.filter((e=>e.target===t));if(!r||0===r.length)return e;const o=r[0].ignoreProperties;return e.filter((t=>-1===o.indexOf(t)))}function Hi(t,e,n,r){if(!t)return;_i(t,zi(t,e,n),r)}function Fi(t){return Object.getOwnPropertyNames(t).filter((t=>t.startsWith("on")&&t.length>2)).map((t=>t.substring(2)))}function Gi(t,e){if(ui&&!li)return;if(Zone[t.symbol("patchEvents")])return;const n=e.__Zone_ignore_on_properties;let r=[];if(ci){const t=window;r=r.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);const e=Si()?[{target:t,ignoreProperties:["error"]}]:[];Hi(t,Fi(t),n?n.concat(e):n,Ho(t))}r=r.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let t=0;t<r.length;t++){const o=e[r[t]];o&&o.prototype&&Hi(o.prototype,Fi(o.prototype),n)}}function Xi(t){t.__load_patch("ZoneAwarePromise",((t,e,n)=>{const r=Object.getOwnPropertyDescriptor,o=Object.defineProperty;const i=n.symbol,a=[],s=!1!==t[i("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],u=i("Promise"),c=i("then"),l="__creationTrace__";n.onUnhandledError=t=>{if(n.showUncaughtError()){const e=t&&t.rejection;e?console.error("Unhandled Promise rejection:",e instanceof Error?e.message:e,"; Zone:",t.zone.name,"; Task:",t.task&&t.task.source,"; Value:",e,e instanceof Error?e.stack:void 0):console.error(t)}},n.microtaskDrainDone=()=>{for(;a.length;){const t=a.shift();try{t.zone.runGuarded((()=>{if(t.throwOriginal)throw t.rejection;throw t}))}catch(t){f(t)}}};const p=i("unhandledPromiseRejectionHandler");function f(t){n.onUnhandledError(t);try{const n=e[p];"function"==typeof n&&n.call(this,t)}catch(t){}}function h(t){return t&&t.then}function d(t){return t}function _(t){return M.reject(t)}const v=i("state"),g=i("value"),E=i("finally"),y=i("parentPromiseValue"),T=i("parentPromiseState"),m="Promise.then",b=null,S=!0,O=!1,R=0;function L(t,e){return n=>{try{C(t,e,n)}catch(e){C(t,!1,e)}}}const P=function(){let t=!1;return function(e){return function(){t||(t=!0,e.apply(null,arguments))}}},w="Promise resolved with itself",A=i("currentTaskTrace");function C(t,r,i){const u=P();if(t===i)throw new TypeError(w);if(t[v]===b){let c=null;try{"object"!=typeof i&&"function"!=typeof i||(c=i&&i.then)}catch(e){return u((()=>{C(t,!1,e)}))(),t}if(r!==O&&i instanceof M&&i.hasOwnProperty(v)&&i.hasOwnProperty(g)&&i[v]!==b)I(i),C(t,i[v],i[g]);else if(r!==O&&"function"==typeof c)try{c.call(i,u(L(t,r)),u(L(t,!1)))}catch(e){u((()=>{C(t,!1,e)}))()}else{t[v]=r;const u=t[g];if(t[g]=i,t[E]===E&&r===S&&(t[v]=t[T],t[g]=t[y]),r===O&&i instanceof Error){const t=e.currentTask&&e.currentTask.data&&e.currentTask.data[l];t&&o(i,A,{configurable:!0,enumerable:!1,writable:!0,value:t})}for(let e=0;e<u.length;)N(t,u[e++],u[e++],u[e++],u[e++]);if(0==u.length&&r==O){t[v]=R;let r=i;try{throw new Error("Uncaught (in promise): "+function(t){if(t&&t.toString===Object.prototype.toString){return(t.constructor&&t.constructor.name||"")+": "+JSON.stringify(t)}return t?t.toString():Object.prototype.toString.call(t)}(i)+(i&&i.stack?"\n"+i.stack:""))}catch(t){r=t}s&&(r.throwOriginal=!0),r.rejection=i,r.promise=t,r.zone=e.current,r.task=e.currentTask,a.push(r),n.scheduleMicroTask()}}}return t}const k=i("rejectionHandledHandler");function I(t){if(t[v]===R){try{const n=e[k];n&&"function"==typeof n&&n.call(this,{rejection:t[g],promise:t})}catch(t){}t[v]=O;for(let e=0;e<a.length;e++)t===a[e].promise&&a.splice(e,1)}}function N(t,e,n,r,o){I(t);const i=t[v],a=i?"function"==typeof r?r:d:"function"==typeof o?o:_;e.scheduleMicroTask(m,(()=>{try{const r=t[g],o=!!n&&E===n[E];o&&(n[y]=r,n[T]=i);const s=e.run(a,void 0,o&&a!==_&&a!==d?[]:[r]);C(n,!0,s)}catch(t){C(n,!1,t)}}),n)}const D=function(){},x=t.AggregateError;class M{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(t){return t instanceof M?t:C(new this(null),S,t)}static reject(t){return C(new this(null),O,t)}static withResolvers(){const t={};return t.promise=new M(((e,n)=>{t.resolve=e,t.reject=n})),t}static any(t){if(!t||"function"!=typeof t[Symbol.iterator])return Promise.reject(new x([],"All promises were rejected"));const e=[];let n=0;try{for(let r of t)n++,e.push(M.resolve(r))}catch(t){return Promise.reject(new x([],"All promises were rejected"))}if(0===n)return Promise.reject(new x([],"All promises were rejected"));let r=!1;const o=[];return new M(((t,i)=>{for(let a=0;a<e.length;a++)e[a].then((e=>{r||(r=!0,t(e))}),(t=>{o.push(t),n--,0===n&&(r=!0,i(new x(o,"All promises were rejected")))}))}))}static race(t){let e,n,r=new this(((t,r)=>{e=t,n=r}));function o(t){e(t)}function i(t){n(t)}for(let e of t)h(e)||(e=this.resolve(e)),e.then(o,i);return r}static all(t){return M.allWithCallback(t)}static allSettled(t){return(this&&this.prototype instanceof M?this:M).allWithCallback(t,{thenCallback:t=>({status:"fulfilled",value:t}),errorCallback:t=>({status:"rejected",reason:t})})}static allWithCallback(t,e){let n,r,o=new this(((t,e)=>{n=t,r=e})),i=2,a=0;const s=[];for(let o of t){h(o)||(o=this.resolve(o));const t=a;try{o.then((r=>{s[t]=e?e.thenCallback(r):r,i--,0===i&&n(s)}),(o=>{e?(s[t]=e.errorCallback(o),i--,0===i&&n(s)):r(o)}))}catch(t){r(t)}i++,a++}return i-=2,0===i&&n(s),o}constructor(t){const e=this;if(!(e instanceof M))throw new Error("Must be an instanceof Promise.");e[v]=b,e[g]=[];try{const n=P();t&&t(n(L(e,S)),n(L(e,O)))}catch(t){C(e,!1,t)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return M}then(t,n){let r=this.constructor?.[Symbol.species];r&&"function"==typeof r||(r=this.constructor||M);const o=new r(D),i=e.current;return this[v]==b?this[g].push(i,o,t,n):N(this,i,o,t,n),o}catch(t){return this.then(null,t)}finally(t){let n=this.constructor?.[Symbol.species];n&&"function"==typeof n||(n=M);const r=new n(D);r[E]=E;const o=e.current;return this[v]==b?this[g].push(o,r,t,t):N(this,o,r,t,t),r}}M.resolve=M.resolve,M.reject=M.reject,M.race=M.race,M.all=M.all;const j=t[u]=t.Promise;t.Promise=M;const U=i("thenPatched");function B(t){const e=t.prototype,n=r(e,"then");if(n&&(!1===n.writable||!n.configurable))return;const o=e.then;e[c]=o,t.prototype.then=function(t,e){return new M(((t,e)=>{o.call(this,t,e)})).then(t,e)},t[U]=!0}return n.patchThen=B,j&&(B(j),Ei(t,"fetch",(t=>{return e=t,function(t,n){let r=e.apply(t,n);if(r instanceof M)return r;let o=r.constructor;return o[U]||B(o),r};var e}))),Promise[e.__symbol__("uncaughtPromiseErrors")]=a,M}))}function Vi(t,e,n,r,o){const i=Zone.__symbol__(r);if(e[i])return;const a=e[i]=e[r];e[r]=function(i,s,u){return s&&s.prototype&&o.forEach((function(e){const o=`${n}.${r}::`+e,i=s.prototype;try{if(i.hasOwnProperty(e)){const n=t.ObjectGetOwnPropertyDescriptor(i,e);n&&n.value?(n.value=t.wrapWithCurrentZone(n.value,o),t._redefineProperty(s.prototype,e,n)):i[e]&&(i[e]=t.wrapWithCurrentZone(i[e],o))}else i[e]&&(i[e]=t.wrapWithCurrentZone(i[e],o))}catch{}})),a.call(e,i,s,u)},t.attachOriginToPatched(e[r],a)}const qi=function(){const t=globalThis,e=!0===t[Bo("forceDuplicateZoneCheck")];if(t.Zone&&(e||"function"!=typeof t.Zone.__symbol__))throw new Error("Zone already loaded.");return t.Zone??=function(){const t=Uo.performance;function e(e){t&&t.mark&&t.mark(e)}function n(e,n){t&&t.measure&&t.measure(e,n)}e("Zone");class r{static{this.__symbol__=Bo}static assertZonePatched(){if(Uo.Promise!==L.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let t=r.current;for(;t.parent;)t=t.parent;return t}static get current(){return w.zone}static get currentTask(){return A}static __load_patch(t,o,i=!1){if(L.hasOwnProperty(t)){const e=!0===Uo[Bo("forceDuplicateZoneCheck")];if(!i&&e)throw Error("Already loaded patch: "+t)}else if(!Uo["__Zone_disable_"+t]){const i="Zone:"+t;e(i),L[t]=o(Uo,r,P),n(i,i)}}get parent(){return this._parent}get name(){return this._name}constructor(t,e){this._parent=t,this._name=e?e.name||"unnamed":"<root>",this._properties=e&&e.properties||{},this._zoneDelegate=new i(this,this._parent&&this._parent._zoneDelegate,e)}get(t){const e=this.getZoneWith(t);if(e)return e._properties[t]}getZoneWith(t){let e=this;for(;e;){if(e._properties.hasOwnProperty(t))return e;e=e._parent}return null}fork(t){if(!t)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,t)}wrap(t,e){if("function"!=typeof t)throw new Error("Expecting function got: "+t);const n=this._zoneDelegate.intercept(this,t,e),r=this;return function(){return r.runGuarded(n,this,arguments,e)}}run(t,e,n,r){w={parent:w,zone:this};try{return this._zoneDelegate.invoke(this,t,e,n,r)}finally{w=w.parent}}runGuarded(t,e=null,n,r){w={parent:w,zone:this};try{try{return this._zoneDelegate.invoke(this,t,e,n,r)}catch(t){if(this._zoneDelegate.handleError(this,t))throw t}}finally{w=w.parent}}runTask(t,e,n){if(t.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(t.zone||v).name+"; Execution: "+this.name+")");const r=t,{type:o,data:{isPeriodic:i=!1,isRefreshable:a=!1}={}}=t;if(t.state===g&&(o===R||o===O))return;const s=t.state!=T;s&&r._transitionTo(T,y);const u=A;A=r,w={parent:w,zone:this};try{o!=O||!t.data||i||a||(t.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,r,e,n)}catch(t){if(this._zoneDelegate.handleError(this,t))throw t}}finally{const e=t.state;if(e!==g&&e!==b)if(o==R||i||a&&e===E)s&&r._transitionTo(y,T,E);else{const t=r._zoneDelegates;this._updateTaskCount(r,-1),s&&r._transitionTo(g,T,g),a&&(r._zoneDelegates=t)}w=w.parent,A=u}}scheduleTask(t){if(t.zone&&t.zone!==this){let e=this;for(;e;){if(e===t.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${t.zone.name}`);e=e.parent}}t._transitionTo(E,g);const e=[];t._zoneDelegates=e,t._zone=this;try{t=this._zoneDelegate.scheduleTask(this,t)}catch(e){throw t._transitionTo(b,E,g),this._zoneDelegate.handleError(this,e),e}return t._zoneDelegates===e&&this._updateTaskCount(t,1),t.state==E&&t._transitionTo(y,E),t}scheduleMicroTask(t,e,n,r){return this.scheduleTask(new a(S,t,e,n,r,void 0))}scheduleMacroTask(t,e,n,r,o){return this.scheduleTask(new a(O,t,e,n,r,o))}scheduleEventTask(t,e,n,r,o){return this.scheduleTask(new a(R,t,e,n,r,o))}cancelTask(t){if(t.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(t.zone||v).name+"; Execution: "+this.name+")");if(t.state===y||t.state===T){t._transitionTo(m,y,T);try{this._zoneDelegate.cancelTask(this,t)}catch(e){throw t._transitionTo(b,m),this._zoneDelegate.handleError(this,e),e}return this._updateTaskCount(t,-1),t._transitionTo(g,m),t.runCount=-1,t}}_updateTaskCount(t,e){const n=t._zoneDelegates;-1==e&&(t._zoneDelegates=null);for(let r=0;r<n.length;r++)n[r]._updateTaskCount(t.type,e)}}const o={name:"",onHasTask:(t,e,n,r)=>t.hasTask(n,r),onScheduleTask:(t,e,n,r)=>t.scheduleTask(n,r),onInvokeTask:(t,e,n,r,o,i)=>t.invokeTask(n,r,o,i),onCancelTask:(t,e,n,r)=>t.cancelTask(n,r)};class i{get zone(){return this._zone}constructor(t,e,n){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this._zone=t,this._parentDelegate=e,this._forkZS=n&&(n&&n.onFork?n:e._forkZS),this._forkDlgt=n&&(n.onFork?e:e._forkDlgt),this._forkCurrZone=n&&(n.onFork?this._zone:e._forkCurrZone),this._interceptZS=n&&(n.onIntercept?n:e._interceptZS),this._interceptDlgt=n&&(n.onIntercept?e:e._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this._zone:e._interceptCurrZone),this._invokeZS=n&&(n.onInvoke?n:e._invokeZS),this._invokeDlgt=n&&(n.onInvoke?e:e._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this._zone:e._invokeCurrZone),this._handleErrorZS=n&&(n.onHandleError?n:e._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?e:e._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this._zone:e._handleErrorCurrZone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:e._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?e:e._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this._zone:e._scheduleTaskCurrZone),this._invokeTaskZS=n&&(n.onInvokeTask?n:e._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?e:e._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this._zone:e._invokeTaskCurrZone),this._cancelTaskZS=n&&(n.onCancelTask?n:e._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?e:e._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this._zone:e._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const r=n&&n.onHasTask,i=e&&e._hasTaskZS;(r||i)&&(this._hasTaskZS=r?n:o,this._hasTaskDlgt=e,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,n.onScheduleTask||(this._scheduleTaskZS=o,this._scheduleTaskDlgt=e,this._scheduleTaskCurrZone=this._zone),n.onInvokeTask||(this._invokeTaskZS=o,this._invokeTaskDlgt=e,this._invokeTaskCurrZone=this._zone),n.onCancelTask||(this._cancelTaskZS=o,this._cancelTaskDlgt=e,this._cancelTaskCurrZone=this._zone))}fork(t,e){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,t,e):new r(t,e)}intercept(t,e,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,t,e,n):e}invoke(t,e,n,r,o){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,t,e,n,r,o):e.apply(n,r)}handleError(t,e){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,t,e)}scheduleTask(t,e){let n=e;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,t,e),n||(n=e);else if(e.scheduleFn)e.scheduleFn(e);else{if(e.type!=S)throw new Error("Task is missing scheduleFn.");d(e)}return n}invokeTask(t,e,n,r){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,t,e,n,r):e.callback.apply(n,r)}cancelTask(t,e){let n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,t,e);else{if(!e.cancelFn)throw Error("Task is not cancelable");n=e.cancelFn(e)}return n}hasTask(t,e){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,t,e)}catch(e){this.handleError(t,e)}}_updateTaskCount(t,e){const n=this._taskCounts,r=n[t],o=n[t]=r+e;if(o<0)throw new Error("More tasks executed then were scheduled.");if(0==r||0==o){const e={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:t};this.hasTask(this._zone,e)}}}class a{constructor(t,e,n,r,o,i){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=t,this.source=e,this.data=r,this.scheduleFn=o,this.cancelFn=i,!n)throw new Error("callback is not defined");this.callback=n;const s=this;t===R&&r&&r.useG?this.invoke=a.invokeTask:this.invoke=function(){return a.invokeTask.call(Uo,s,this,arguments)}}static invokeTask(t,e,n){t||(t=this),C++;try{return t.runCount++,t.zone.runTask(t,e,n)}finally{1==C&&_(),C--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(g,E)}_transitionTo(t,e,n){if(this._state!==e&&this._state!==n)throw new Error(`${this.type} '${this.source}': can not transition to '${t}', expecting state '${e}'${n?" or '"+n+"'":""}, was '${this._state}'.`);this._state=t,t==g&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const s=Bo("setTimeout"),u=Bo("Promise"),c=Bo("then");let l,p=[],f=!1;function h(t){if(l||Uo[u]&&(l=Uo[u].resolve(0)),l){let e=l[c];e||(e=l.then),e.call(l,t)}else Uo[s](t,0)}function d(t){0===C&&0===p.length&&h(_),t&&p.push(t)}function _(){if(!f){for(f=!0;p.length;){const t=p;p=[];for(let e=0;e<t.length;e++){const n=t[e];try{n.zone.runTask(n,null,null)}catch(t){P.onUnhandledError(t)}}}P.microtaskDrainDone(),f=!1}}const v={name:"NO ZONE"},g="notScheduled",E="scheduling",y="scheduled",T="running",m="canceling",b="unknown",S="microTask",O="macroTask",R="eventTask",L={},P={symbol:Bo,currentZoneFrame:()=>w,onUnhandledError:k,microtaskDrainDone:k,scheduleMicroTask:d,showUncaughtError:()=>!r[Bo("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:k,patchMethod:()=>k,bindArguments:()=>[],patchThen:()=>k,patchMacroTask:()=>k,patchEventPrototype:()=>k,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>k,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>k,wrapWithCurrentZone:()=>k,filterProperties:()=>[],attachOriginToPatched:()=>k,_redefineProperty:()=>k,patchCallbacks:()=>k,nativeScheduleMicroTask:h};let w={parent:null,zone:new r(null,null)},A=null,C=0;function k(){}return n("Zone","Zone"),r}(),t.Zone}();function Wi(t={}){var e;return"true"===(null===(e=t.attributes)||void 0===e?void 0:e.isSampled)?kr.RECORD_AND_SAMPLED:kr.NOT_RECORD}!function(t){Xi(t),function(t){t.__load_patch("toString",(t=>{const e=Function.prototype.toString,n=ti("OriginalDelegate"),r=ti("Promise"),o=ti("Error"),i=function(){if("function"==typeof this){const i=this[n];if(i)return"function"==typeof i?e.call(i):Object.prototype.toString.call(i);if(this===Promise){const n=t[r];if(n)return e.call(n)}if(this===Error){const n=t[o];if(n)return e.call(n)}}return e.call(this)};i[n]=e,Function.prototype.toString=i;const a=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":a.call(this)}}))}(t),function(t){t.__load_patch("util",((t,e,n)=>{const r=Fi(t);n.patchOnProperties=_i,n.patchMethod=Ei,n.bindArguments=ii,n.patchMacroTask=yi;const o=e.__symbol__("BLACK_LISTED_EVENTS"),i=e.__symbol__("UNPATCHED_EVENTS");t[i]&&(t[o]=t[i]),t[o]&&(e[o]=e[i]=t[o]),n.patchEventPrototype=Mi,n.patchEventTarget=Di,n.isIEOrEdge=Oi,n.ObjectDefineProperty=zo,n.ObjectGetOwnPropertyDescriptor=Zo,n.ObjectCreate=Fo,n.ArraySlice=Go,n.patchClass=gi,n.wrapWithCurrentZone=Qo,n.filterProperties=zi,n.attachOriginToPatched=Ti,n._redefineProperty=Object.defineProperty,n.patchCallbacks=Vi,n.getGlobalObjects=()=>({globalSources:Ci,zoneSymbolEventNames:Ai,eventNames:r,isBrowser:ci,isMix:li,isNode:ui,TRUE_STR:Ko,FALSE_STR:Yo,ZONE_SYMBOL_PREFIX:$o,ADD_EVENT_LISTENER_STR:Xo,REMOVE_EVENT_LISTENER_STR:Vo})}))}(t)}(qi),function(t){t.__load_patch("legacy",(e=>{const n=e[t.__symbol__("legacyPatch")];n&&n()})),t.__load_patch("timers",(t=>{const e="set",n="clear";Bi(t,e,n,"Timeout"),Bi(t,e,n,"Interval"),Bi(t,e,n,"Immediate")})),t.__load_patch("requestAnimationFrame",(t=>{Bi(t,"request","cancel","AnimationFrame"),Bi(t,"mozRequest","mozCancel","AnimationFrame"),Bi(t,"webkitRequest","webkitCancel","AnimationFrame")})),t.__load_patch("blocking",((t,e)=>{const n=["alert","prompt","confirm"];for(let r=0;r<n.length;r++){Ei(t,n[r],((n,r,o)=>function(r,i){return e.current.run(n,t,i,o)}))}})),t.__load_patch("EventTarget",((t,e,n)=>{!function(t,e){e.patchEventPrototype(t,e)}(t,n),Zi(t,n);const r=t.XMLHttpRequestEventTarget;r&&r.prototype&&n.patchEventTarget(t,n,[r.prototype])})),t.__load_patch("MutationObserver",((t,e,n)=>{gi("MutationObserver"),gi("WebKitMutationObserver")})),t.__load_patch("IntersectionObserver",((t,e,n)=>{gi("IntersectionObserver")})),t.__load_patch("FileReader",((t,e,n)=>{gi("FileReader")})),t.__load_patch("on_property",((t,e,n)=>{Gi(n,t)})),t.__load_patch("customElements",((t,e,n)=>{!function(t,e){const{isBrowser:n,isMix:r}=e.getGlobalObjects();if(!n&&!r||!t.customElements||!("customElements"in t))return;e.patchCallbacks(e,t.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"])}(t,n)})),t.__load_patch("XHR",((t,e)=>{!function(t){const u=t.XMLHttpRequest;if(!u)return;const c=u.prototype;let l=c[qo],p=c[Wo];if(!l){const e=t.XMLHttpRequestEventTarget;if(e){const t=e.prototype;l=t[qo],p=t[Wo]}}const f="readystatechange",h="scheduled";function d(t){const r=t.data,a=r.target;a[i]=!1,a[s]=!1;const u=a[o];l||(l=a[qo],p=a[Wo]),u&&p.call(a,f,u);const c=a[o]=()=>{if(a.readyState===a.DONE)if(!r.aborted&&a[i]&&t.state===h){const n=a[e.__symbol__("loadfalse")];if(0!==a.status&&n&&n.length>0){const o=t.invoke;t.invoke=function(){const n=a[e.__symbol__("loadfalse")];for(let e=0;e<n.length;e++)n[e]===t&&n.splice(e,1);r.aborted||t.state!==h||o.call(t)},n.push(t)}else t.invoke()}else r.aborted||!1!==a[i]||(a[s]=!0)};l.call(a,f,c);return a[n]||(a[n]=t),T.apply(a,r.args),a[i]=!0,t}function _(){}function v(t){const e=t.data;return e.aborted=!0,m.apply(e.target,e.args)}const g=Ei(c,"open",(()=>function(t,e){return t[r]=0==e[2],t[a]=e[1],g.apply(t,e)})),E=ti("fetchTaskAborting"),y=ti("fetchTaskScheduling"),T=Ei(c,"send",(()=>function(t,n){if(!0===e.current[y])return T.apply(t,n);if(t[r])return T.apply(t,n);{const e={target:t,url:t[a],isPeriodic:!1,args:n,aborted:!1},r=Jo("XMLHttpRequest.send",_,e,d,v);t&&!0===t[s]&&!e.aborted&&r.state===h&&r.invoke()}})),m=Ei(c,"abort",(()=>function(t,r){const o=t[n];if(o&&"string"==typeof o.type){if(null==o.cancelFn||o.data&&o.data.aborted)return;o.zone.cancelTask(o)}else if(!0===e.current[E])return m.apply(t,r)}))}(t);const n=ti("xhrTask"),r=ti("xhrSync"),o=ti("xhrListener"),i=ti("xhrScheduled"),a=ti("xhrURL"),s=ti("xhrErrorBeforeScheduled")})),t.__load_patch("geolocation",(t=>{t.navigator&&t.navigator.geolocation&&function(t,e){const n=t.constructor.name;for(let r=0;r<e.length;r++){const o=e[r],i=t[o];if(i){if(!ai(Zo(t,o)))continue;t[o]=(t=>{const e=function(){return t.apply(this,ii(arguments,n+"."+o))};return Ti(e,t),e})(i)}}}(t.navigator.geolocation,["getCurrentPosition","watchPosition"])})),t.__load_patch("PromiseRejectionEvent",((t,e)=>{function n(e){return function(n){xi(t,e).forEach((r=>{const o=t.PromiseRejectionEvent;if(o){const t=new o(e,{promise:n.promise,reason:n.rejection});r.invoke(t)}}))}}t.PromiseRejectionEvent&&(e[ti("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),e[ti("rejectionHandledHandler")]=n("rejectionhandled"))})),t.__load_patch("queueMicrotask",((t,e,n)=>{ji(t,n)}))}(qi);class Ki extends e.BaseInstrumentation{constructor(t={}){super(),this.options=t,this.name="@grafana/faro-web-tracing",this.version=e.VERSION}initialize(){var t,e,n,r,o;const i=this.options,a={};this.config.app.name&&(a["service.name"]=this.config.app.name),this.config.app.namespace&&(a["service.namespace"]=this.config.app.namespace),this.config.app.version&&(a["service.version"]=this.config.app.version),this.config.app.environment&&(a["deployment.environment.name"]=this.config.app.environment,a["deployment.environment"]=this.config.app.environment),Object.assign(a,i.resourceAttributes);const s=sr.default().merge(new sr(a)),u=new fo({resource:s,sampler:{shouldSample:()=>({decision:Wi(this.api.getSession())})}});u.addSpanProcessor(null!==(t=i.spanProcessor)&&void 0!==t?t:new lr(new Kr(new cr({api:this.api}),{scheduledDelayMillis:Ki.SCHEDULED_BATCH_DELAY_MS,maxExportBatchSize:30}),this.metas)),u.register({propagator:null!==(e=i.propagator)&&void 0!==e?e:new hn,contextManager:null!==(n=i.contextManager)&&void 0!==n?n:new jo});const{propagateTraceHeaderCorsUrls:c,fetchInstrumentationOptions:l,xhrInstrumentationOptions:p}=null!==(r=this.options.instrumentationOptions)&&void 0!==r?r:{};!function(t){var e,n,r=t.tracerProvider||qt.getTracerProvider(),o=t.meterProvider||xt.getMeterProvider(),i=t.loggerProvider||gr.getLoggerProvider(),a=null!==(n=null===(e=t.instrumentations)||void 0===e?void 0:e.flat())&&void 0!==n?n:[];(function(t,e,n,r){for(var o=0,i=t.length;o<i;o++){var a=t[o];e&&a.setTracerProvider(e),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}})(a,r,o,i)}({instrumentations:null!==(o=i.instrumentations)&&void 0!==o?o:xo({ignoreUrls:this.getIgnoreUrls(),propagateTraceHeaderCorsUrls:c,fetchInstrumentationOptions:l,xhrInstrumentationOptions:p})}),this.api.initOTEL(qt,kt)}getIgnoreUrls(){return this.transports.transports.flatMap((t=>t.getIgnoreUrls()))}}return Ki.SCHEDULED_BATCH_DELAY_MS=1e3,t.FaroSessionSpanProcessor=lr,t.FaroTraceExporter=cr,t.TracingInstrumentation=Ki,t.fetchCustomAttributeFunctionWithDefaults=No,t.getDefaultOTELInstrumentations=xo,t.getSamplingDecision=Wi,t.setSpanStatusOnFetchError=ko,t}({},GrafanaFaroWebSdk);
7
+ const Bo=globalThis;function Zo(t){return(Bo.__Zone_symbol_prefix||"__zone_symbol__")+t}const zo=Object.getOwnPropertyDescriptor,Ho=Object.defineProperty,Fo=Object.getPrototypeOf,Go=Object.create,Xo=Array.prototype.slice,Vo="addEventListener",qo="removeEventListener",Wo=Zo(Vo),Ko=Zo(qo),Yo="true",$o="false",Qo=Zo("");function Jo(t,e){return Zone.current.wrap(t,e)}function ti(t,e,n,r,o){return Zone.current.scheduleMacroTask(t,e,n,r,o)}const ei=Zo,ni="undefined"!=typeof window,ri=ni?window:void 0,oi=ni&&ri||globalThis,ii="removeAttribute";function ai(t,e){for(let n=t.length-1;n>=0;n--)"function"==typeof t[n]&&(t[n]=Jo(t[n],e+"_"+n));return t}function si(t){return!t||!1!==t.writable&&!("function"==typeof t.get&&void 0===t.set)}const ui="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,ci=!("nw"in oi)&&void 0!==oi.process&&"[object process]"===oi.process.toString(),li=!ci&&!ui&&!(!ni||!ri.HTMLElement),pi=void 0!==oi.process&&"[object process]"===oi.process.toString()&&!ui&&!(!ni||!ri.HTMLElement),fi={},hi=ei("enable_beforeunload"),di=function(t){if(!(t=t||oi.event))return;let e=fi[t.type];e||(e=fi[t.type]=ei("ON_PROPERTY"+t.type));const n=this||t.target||oi,r=n[e];let o;if(li&&n===ri&&"error"===t.type){const e=t;o=r&&r.call(this,e.message,e.filename,e.lineno,e.colno,e.error),!0===o&&t.preventDefault()}else o=r&&r.apply(this,arguments),"beforeunload"===t.type&&oi[hi]&&"string"==typeof o?t.returnValue=o:null==o||o||t.preventDefault();return o};function _i(t,e,n){let r=zo(t,e);if(!r&&n){zo(n,e)&&(r={enumerable:!0,configurable:!0})}if(!r||!r.configurable)return;const o=ei("on"+e+"patched");if(t.hasOwnProperty(o)&&t[o])return;delete r.writable,delete r.value;const i=r.get,a=r.set,s=e.slice(2);let u=fi[s];u||(u=fi[s]=ei("ON_PROPERTY"+s)),r.set=function(e){let n=this;if(n||t!==oi||(n=oi),!n)return;"function"==typeof n[u]&&n.removeEventListener(s,di),a&&a.call(n,null),n[u]=e,"function"==typeof e&&n.addEventListener(s,di,!1)},r.get=function(){let n=this;if(n||t!==oi||(n=oi),!n)return null;const o=n[u];if(o)return o;if(i){let t=i.call(this);if(t)return r.set.call(this,t),"function"==typeof n[ii]&&n.removeAttribute(e),t}return null},Ho(t,e,r),t[o]=!0}function vi(t,e,n){if(e)for(let r=0;r<e.length;r++)_i(t,"on"+e[r],n);else{const e=[];for(const n in t)"on"==n.slice(0,2)&&e.push(n);for(let r=0;r<e.length;r++)_i(t,e[r],n)}}const gi=ei("originalInstance");function Ei(t){const e=oi[t];if(!e)return;oi[ei(t)]=e,oi[t]=function(){const n=ai(arguments,t);switch(n.length){case 0:this[gi]=new e;break;case 1:this[gi]=new e(n[0]);break;case 2:this[gi]=new e(n[0],n[1]);break;case 3:this[gi]=new e(n[0],n[1],n[2]);break;case 4:this[gi]=new e(n[0],n[1],n[2],n[3]);break;default:throw new Error("Arg list too long.")}},mi(oi[t],e);const n=new e((function(){}));let r;for(r in n)"XMLHttpRequest"===t&&"responseBlob"===r||function(e){"function"==typeof n[e]?oi[t].prototype[e]=function(){return this[gi][e].apply(this[gi],arguments)}:Ho(oi[t].prototype,e,{set:function(n){"function"==typeof n?(this[gi][e]=Jo(n,t+"."+e),mi(this[gi][e],n)):this[gi][e]=n},get:function(){return this[gi][e]}})}(r);for(r in e)"prototype"!==r&&e.hasOwnProperty(r)&&(oi[t][r]=e[r])}function yi(t,e,n){let r=t;for(;r&&!r.hasOwnProperty(e);)r=Fo(r);!r&&t[e]&&(r=t);const o=ei(e);let i=null;if(r&&(!(i=r[o])||!r.hasOwnProperty(o))){i=r[o]=r[e];if(si(r&&zo(r,e))){const t=n(i,o,e);r[e]=function(){return t(this,arguments)},mi(r[e],i)}}return i}function Ti(t,e,n){let r=null;function o(t){const e=t.data;return e.args[e.cbIdx]=function(){t.invoke.apply(this,arguments)},r.apply(e.target,e.args),t}r=yi(t,e,(t=>function(e,r){const i=n(e,r);return i.cbIdx>=0&&"function"==typeof r[i.cbIdx]?ti(i.name,r[i.cbIdx],i,o):t.apply(e,r)}))}function mi(t,e){t[ei("OriginalDelegate")]=e}let bi=!1,Si=!1;function Oi(){try{const t=ri.navigator.userAgent;if(-1!==t.indexOf("MSIE ")||-1!==t.indexOf("Trident/"))return!0}catch(t){}return!1}function Ri(){if(bi)return Si;bi=!0;try{const t=ri.navigator.userAgent;-1===t.indexOf("MSIE ")&&-1===t.indexOf("Trident/")&&-1===t.indexOf("Edge/")||(Si=!0)}catch(t){}return Si}function Li(t){return"function"==typeof t}function Pi(t){return"number"==typeof t}let wi=!1;if("undefined"!=typeof window)try{const t=Object.defineProperty({},"passive",{get:function(){wi=!0}});window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){wi=!1}const Ai={useG:!0},Ci={},ki={},Ii=new RegExp("^"+Qo+"(\\w+)(true|false)$"),Ni=ei("propagationStopped");function Di(t,e){const n=(e?e(t):t)+$o,r=(e?e(t):t)+Yo,o=Qo+n,i=Qo+r;Ci[t]={},Ci[t][$o]=o,Ci[t][Yo]=i}function xi(t,e,n,r){const o=r&&r.add||Vo,i=r&&r.rm||qo,a=r&&r.listeners||"eventListeners",s=r&&r.rmAll||"removeAllListeners",u=ei(o),c="."+o+":",l="prependListener",p="."+l+":",f=function(t,e,n){if(t.isRemoved)return;const r=t.callback;let o;"object"==typeof r&&r.handleEvent&&(t.callback=t=>r.handleEvent(t),t.originalDelegate=r);try{t.invoke(t,e,[n])}catch(t){o=t}const a=t.options;if(a&&"object"==typeof a&&a.once){const r=t.originalDelegate?t.originalDelegate:t.callback;e[i].call(e,n.type,r,a)}return o};function h(n,r,o){if(!(r=r||t.event))return;const i=n||r.target||t,a=i[Ci[r.type][o?Yo:$o]];if(a){const t=[];if(1===a.length){const e=f(a[0],i,r);e&&t.push(e)}else{const e=a.slice();for(let n=0;n<e.length&&(!r||!0!==r[Ni]);n++){const o=f(e[n],i,r);o&&t.push(o)}}if(1===t.length)throw t[0];for(let n=0;n<t.length;n++){const r=t[n];e.nativeScheduleMicroTask((()=>{throw r}))}}}const d=function(t){return h(this,t,!1)},_=function(t){return h(this,t,!0)};function v(e,n){if(!e)return!1;let r=!0;n&&void 0!==n.useG&&(r=n.useG);const f=n&&n.vh;let h=!0;n&&void 0!==n.chkDup&&(h=n.chkDup);let v=!1;n&&void 0!==n.rt&&(v=n.rt);let g=e;for(;g&&!g.hasOwnProperty(o);)g=Fo(g);if(!g&&e[o]&&(g=e),!g)return!1;if(g[u])return!1;const E=n&&n.eventNameToString,y={},T=g[u]=g[o],m=g[ei(i)]=g[i],b=g[ei(a)]=g[a],S=g[ei(s)]=g[s];let O;n&&n.prepend&&(O=g[ei(n.prepend)]=g[n.prepend]);const R=function(t){return O.call(y.target,y.eventName,t.invoke,y.options)},L=r?function(t){if(!y.isExisting)return T.call(y.target,y.eventName,y.capture?_:d,y.options)}:function(t){return T.call(y.target,y.eventName,t.invoke,y.options)},P=r?function(t){if(!t.isRemoved){const e=Ci[t.eventName];let n;e&&(n=e[t.capture?Yo:$o]);const r=n&&t.target[n];if(r)for(let e=0;e<r.length;e++){if(r[e]===t){r.splice(e,1),t.isRemoved=!0,t.removeAbortListener&&(t.removeAbortListener(),t.removeAbortListener=null),0===r.length&&(t.allRemoved=!0,t.target[n]=null);break}}}if(t.allRemoved)return m.call(t.target,t.eventName,t.capture?_:d,t.options)}:function(t){return m.call(t.target,t.eventName,t.invoke,t.options)},w=n&&n.diff?n.diff:function(t,e){const n=typeof e;return"function"===n&&t.callback===e||"object"===n&&t.originalDelegate===e},A=Zone[ei("UNPATCHED_EVENTS")],C=t[ei("PASSIVE_EVENTS")];const k=function(e,o,i,a,s=!1,u=!1){return function(){const c=this||t;let l=arguments[0];n&&n.transferEventName&&(l=n.transferEventName(l));let p=arguments[1];if(!p)return e.apply(this,arguments);if(ci&&"uncaughtException"===l)return e.apply(this,arguments);let d=!1;if("function"!=typeof p){if(!p.handleEvent)return e.apply(this,arguments);d=!0}if(f&&!f(e,p,c,arguments))return;const _=wi&&!!C&&-1!==C.indexOf(l),v=function(t){if("object"==typeof t&&null!==t){const e={...t};return t.signal&&(e.signal=t.signal),e}return t}(function(t,e){return!wi&&"object"==typeof t&&t?!!t.capture:wi&&e?"boolean"==typeof t?{capture:t,passive:!0}:t?"object"==typeof t&&!1!==t.passive?{...t,passive:!0}:t:{passive:!0}:t}(arguments[2],_)),g=v?.signal;if(g?.aborted)return;if(A)for(let t=0;t<A.length;t++)if(l===A[t])return _?e.call(c,l,p,v):e.apply(this,arguments);const T=!!v&&("boolean"==typeof v||v.capture),m=!(!v||"object"!=typeof v)&&v.once,b=Zone.current;let S=Ci[l];S||(Di(l,E),S=Ci[l]);const O=S[T?Yo:$o];let R,L=c[O],P=!1;if(L){if(P=!0,h)for(let t=0;t<L.length;t++)if(w(L[t],p))return}else L=c[O]=[];const k=c.constructor.name,I=ki[k];I&&(R=I[l]),R||(R=k+o+(E?E(l):l)),y.options=v,m&&(y.options.once=!1),y.target=c,y.capture=T,y.eventName=l,y.isExisting=P;const N=r?Ai:void 0;N&&(N.taskData=y),g&&(y.options.signal=void 0);const D=b.scheduleEventTask(R,p,N,i,a);if(g){y.options.signal=g;const t=()=>D.zone.cancelTask(D);e.call(g,"abort",t,{once:!0}),D.removeAbortListener=()=>g.removeEventListener("abort",t)}return y.target=null,N&&(N.taskData=null),m&&(y.options.once=!0),(wi||"boolean"!=typeof D.options)&&(D.options=v),D.target=c,D.capture=T,D.eventName=l,d&&(D.originalDelegate=p),u?L.unshift(D):L.push(D),s?c:void 0}};return g[o]=k(T,c,L,P,v),O&&(g[l]=k(O,p,R,P,v,!0)),g[i]=function(){const e=this||t;let r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));const o=arguments[2],i=!!o&&("boolean"==typeof o||o.capture),a=arguments[1];if(!a)return m.apply(this,arguments);if(f&&!f(m,a,e,arguments))return;const s=Ci[r];let u;s&&(u=s[i?Yo:$o]);const c=u&&e[u];if(c)for(let t=0;t<c.length;t++){const n=c[t];if(w(n,a)){if(c.splice(t,1),n.isRemoved=!0,0===c.length&&(n.allRemoved=!0,e[u]=null,!i&&"string"==typeof r)){e[Qo+"ON_PROPERTY"+r]=null}return n.zone.cancelTask(n),v?e:void 0}}return m.apply(this,arguments)},g[a]=function(){const e=this||t;let r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));const o=[],i=Mi(e,E?E(r):r);for(let t=0;t<i.length;t++){const e=i[t];let n=e.originalDelegate?e.originalDelegate:e.callback;o.push(n)}return o},g[s]=function(){const e=this||t;let r=arguments[0];if(r){n&&n.transferEventName&&(r=n.transferEventName(r));const t=Ci[r];if(t){const n=t[$o],o=t[Yo],a=e[n],s=e[o];if(a){const t=a.slice();for(let e=0;e<t.length;e++){const n=t[e];let o=n.originalDelegate?n.originalDelegate:n.callback;this[i].call(this,r,o,n.options)}}if(s){const t=s.slice();for(let e=0;e<t.length;e++){const n=t[e];let o=n.originalDelegate?n.originalDelegate:n.callback;this[i].call(this,r,o,n.options)}}}}else{const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e],r=Ii.exec(n);let o=r&&r[1];o&&"removeListener"!==o&&this[s].call(this,o)}this[s].call(this,"removeListener")}if(v)return this},mi(g[o],T),mi(g[i],m),S&&mi(g[s],S),b&&mi(g[a],b),!0}let g=[];for(let t=0;t<n.length;t++)g[t]=v(n[t],r);return g}function Mi(t,e){if(!e){const n=[];for(let r in t){const o=Ii.exec(r);let i=o&&o[1];if(i&&(!e||i===e)){const e=t[r];if(e)for(let t=0;t<e.length;t++)n.push(e[t])}}return n}let n=Ci[e];n||(Di(e),n=Ci[e]);const r=t[n[$o]],o=t[n[Yo]];return r?o?r.concat(o):r.slice():o?o.slice():[]}function ji(t,e){const n=t.Event;n&&n.prototype&&e.patchMethod(n.prototype,"stopImmediatePropagation",(t=>function(e,n){e[Ni]=!0,t&&t.apply(e,n)}))}function Ui(t,e){e.patchMethod(t,"queueMicrotask",(t=>function(t,e){Zone.current.scheduleMicroTask("queueMicrotask",e[0])}))}const Bi=ei("zoneTask");function Zi(t,e,n,r){let o=null,i=null;n+=r;const a={};function s(e){const n=e.data;n.args[0]=function(){return e.invoke.apply(this,arguments)};const r=o.apply(t,n.args);return Pi(r)?n.handleId=r:(n.handle=r,n.isRefreshable=Li(r.refresh)),e}function u(e){const{handle:n,handleId:r}=e.data;return i.call(t,n??r)}o=yi(t,e+=r,(n=>function(o,i){if(Li(i[0])){const t={isRefreshable:!1,isPeriodic:"Interval"===r,delay:"Timeout"===r||"Interval"===r?i[1]||0:void 0,args:i},n=i[0];i[0]=function(){try{return n.apply(this,arguments)}finally{const{handle:e,handleId:n,isPeriodic:r,isRefreshable:o}=t;r||o||(n?delete a[n]:e&&(e[Bi]=null))}};const o=ti(e,i[0],t,s,u);if(!o)return o;const{handleId:c,handle:l,isRefreshable:p,isPeriodic:f}=o.data;if(c)a[c]=o;else if(l&&(l[Bi]=o,p&&!f)){const t=l.refresh;l.refresh=function(){const{zone:e,state:n}=o;return"notScheduled"===n?(o._state="scheduled",e._updateTaskCount(o,1)):"running"===n&&(o._state="scheduling"),t.call(this)}}return l??c??o}return n.apply(t,i)})),i=yi(t,n,(e=>function(n,r){const o=r[0];let i;Pi(o)?(i=a[o],delete a[o]):(i=o?.[Bi],i?o[Bi]=null:i=o),i?.type?i.cancelFn&&i.zone.cancelTask(i):e.apply(t,r)}))}function zi(t,e){if(Zone[e.symbol("patchEventTarget")])return;const{eventNames:n,zoneSymbolEventNames:r,TRUE_STR:o,FALSE_STR:i,ZONE_SYMBOL_PREFIX:a}=e.getGlobalObjects();for(let t=0;t<n.length;t++){const e=n[t],s=a+(e+i),u=a+(e+o);r[e]={},r[e][i]=s,r[e][o]=u}const s=t.EventTarget;return s&&s.prototype?(e.patchEventTarget(t,e,[s&&s.prototype]),!0):void 0}function Hi(t,e,n){if(!n||0===n.length)return e;const r=n.filter((e=>e.target===t));if(!r||0===r.length)return e;const o=r[0].ignoreProperties;return e.filter((t=>-1===o.indexOf(t)))}function Fi(t,e,n,r){if(!t)return;vi(t,Hi(t,e,n),r)}function Gi(t){return Object.getOwnPropertyNames(t).filter((t=>t.startsWith("on")&&t.length>2)).map((t=>t.substring(2)))}function Xi(t,e){if(ci&&!pi)return;if(Zone[t.symbol("patchEvents")])return;const n=e.__Zone_ignore_on_properties;let r=[];if(li){const t=window;r=r.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);const e=Oi()?[{target:t,ignoreProperties:["error"]}]:[];Fi(t,Gi(t),n?n.concat(e):n,Fo(t))}r=r.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let t=0;t<r.length;t++){const o=e[r[t]];o&&o.prototype&&Fi(o.prototype,Gi(o.prototype),n)}}function Vi(t){t.__load_patch("ZoneAwarePromise",((t,e,n)=>{const r=Object.getOwnPropertyDescriptor,o=Object.defineProperty;const i=n.symbol,a=[],s=!1!==t[i("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],u=i("Promise"),c=i("then"),l="__creationTrace__";n.onUnhandledError=t=>{if(n.showUncaughtError()){const e=t&&t.rejection;e?console.error("Unhandled Promise rejection:",e instanceof Error?e.message:e,"; Zone:",t.zone.name,"; Task:",t.task&&t.task.source,"; Value:",e,e instanceof Error?e.stack:void 0):console.error(t)}},n.microtaskDrainDone=()=>{for(;a.length;){const t=a.shift();try{t.zone.runGuarded((()=>{if(t.throwOriginal)throw t.rejection;throw t}))}catch(t){f(t)}}};const p=i("unhandledPromiseRejectionHandler");function f(t){n.onUnhandledError(t);try{const n=e[p];"function"==typeof n&&n.call(this,t)}catch(t){}}function h(t){return t&&t.then}function d(t){return t}function _(t){return M.reject(t)}const v=i("state"),g=i("value"),E=i("finally"),y=i("parentPromiseValue"),T=i("parentPromiseState"),m="Promise.then",b=null,S=!0,O=!1,R=0;function L(t,e){return n=>{try{C(t,e,n)}catch(e){C(t,!1,e)}}}const P=function(){let t=!1;return function(e){return function(){t||(t=!0,e.apply(null,arguments))}}},w="Promise resolved with itself",A=i("currentTaskTrace");function C(t,r,i){const u=P();if(t===i)throw new TypeError(w);if(t[v]===b){let c=null;try{"object"!=typeof i&&"function"!=typeof i||(c=i&&i.then)}catch(e){return u((()=>{C(t,!1,e)}))(),t}if(r!==O&&i instanceof M&&i.hasOwnProperty(v)&&i.hasOwnProperty(g)&&i[v]!==b)I(i),C(t,i[v],i[g]);else if(r!==O&&"function"==typeof c)try{c.call(i,u(L(t,r)),u(L(t,!1)))}catch(e){u((()=>{C(t,!1,e)}))()}else{t[v]=r;const u=t[g];if(t[g]=i,t[E]===E&&r===S&&(t[v]=t[T],t[g]=t[y]),r===O&&i instanceof Error){const t=e.currentTask&&e.currentTask.data&&e.currentTask.data[l];t&&o(i,A,{configurable:!0,enumerable:!1,writable:!0,value:t})}for(let e=0;e<u.length;)N(t,u[e++],u[e++],u[e++],u[e++]);if(0==u.length&&r==O){t[v]=R;let r=i;try{throw new Error("Uncaught (in promise): "+function(t){if(t&&t.toString===Object.prototype.toString){return(t.constructor&&t.constructor.name||"")+": "+JSON.stringify(t)}return t?t.toString():Object.prototype.toString.call(t)}(i)+(i&&i.stack?"\n"+i.stack:""))}catch(t){r=t}s&&(r.throwOriginal=!0),r.rejection=i,r.promise=t,r.zone=e.current,r.task=e.currentTask,a.push(r),n.scheduleMicroTask()}}}return t}const k=i("rejectionHandledHandler");function I(t){if(t[v]===R){try{const n=e[k];n&&"function"==typeof n&&n.call(this,{rejection:t[g],promise:t})}catch(t){}t[v]=O;for(let e=0;e<a.length;e++)t===a[e].promise&&a.splice(e,1)}}function N(t,e,n,r,o){I(t);const i=t[v],a=i?"function"==typeof r?r:d:"function"==typeof o?o:_;e.scheduleMicroTask(m,(()=>{try{const r=t[g],o=!!n&&E===n[E];o&&(n[y]=r,n[T]=i);const s=e.run(a,void 0,o&&a!==_&&a!==d?[]:[r]);C(n,!0,s)}catch(t){C(n,!1,t)}}),n)}const D=function(){},x=t.AggregateError;class M{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(t){return t instanceof M?t:C(new this(null),S,t)}static reject(t){return C(new this(null),O,t)}static withResolvers(){const t={};return t.promise=new M(((e,n)=>{t.resolve=e,t.reject=n})),t}static any(t){if(!t||"function"!=typeof t[Symbol.iterator])return Promise.reject(new x([],"All promises were rejected"));const e=[];let n=0;try{for(let r of t)n++,e.push(M.resolve(r))}catch(t){return Promise.reject(new x([],"All promises were rejected"))}if(0===n)return Promise.reject(new x([],"All promises were rejected"));let r=!1;const o=[];return new M(((t,i)=>{for(let a=0;a<e.length;a++)e[a].then((e=>{r||(r=!0,t(e))}),(t=>{o.push(t),n--,0===n&&(r=!0,i(new x(o,"All promises were rejected")))}))}))}static race(t){let e,n,r=new this(((t,r)=>{e=t,n=r}));function o(t){e(t)}function i(t){n(t)}for(let e of t)h(e)||(e=this.resolve(e)),e.then(o,i);return r}static all(t){return M.allWithCallback(t)}static allSettled(t){return(this&&this.prototype instanceof M?this:M).allWithCallback(t,{thenCallback:t=>({status:"fulfilled",value:t}),errorCallback:t=>({status:"rejected",reason:t})})}static allWithCallback(t,e){let n,r,o=new this(((t,e)=>{n=t,r=e})),i=2,a=0;const s=[];for(let o of t){h(o)||(o=this.resolve(o));const t=a;try{o.then((r=>{s[t]=e?e.thenCallback(r):r,i--,0===i&&n(s)}),(o=>{e?(s[t]=e.errorCallback(o),i--,0===i&&n(s)):r(o)}))}catch(t){r(t)}i++,a++}return i-=2,0===i&&n(s),o}constructor(t){const e=this;if(!(e instanceof M))throw new Error("Must be an instanceof Promise.");e[v]=b,e[g]=[];try{const n=P();t&&t(n(L(e,S)),n(L(e,O)))}catch(t){C(e,!1,t)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return M}then(t,n){let r=this.constructor?.[Symbol.species];r&&"function"==typeof r||(r=this.constructor||M);const o=new r(D),i=e.current;return this[v]==b?this[g].push(i,o,t,n):N(this,i,o,t,n),o}catch(t){return this.then(null,t)}finally(t){let n=this.constructor?.[Symbol.species];n&&"function"==typeof n||(n=M);const r=new n(D);r[E]=E;const o=e.current;return this[v]==b?this[g].push(o,r,t,t):N(this,o,r,t,t),r}}M.resolve=M.resolve,M.reject=M.reject,M.race=M.race,M.all=M.all;const j=t[u]=t.Promise;t.Promise=M;const U=i("thenPatched");function B(t){const e=t.prototype,n=r(e,"then");if(n&&(!1===n.writable||!n.configurable))return;const o=e.then;e[c]=o,t.prototype.then=function(t,e){return new M(((t,e)=>{o.call(this,t,e)})).then(t,e)},t[U]=!0}return n.patchThen=B,j&&(B(j),yi(t,"fetch",(t=>{return e=t,function(t,n){let r=e.apply(t,n);if(r instanceof M)return r;let o=r.constructor;return o[U]||B(o),r};var e}))),Promise[e.__symbol__("uncaughtPromiseErrors")]=a,M}))}function qi(t,e,n,r,o){const i=Zone.__symbol__(r);if(e[i])return;const a=e[i]=e[r];e[r]=function(i,s,u){return s&&s.prototype&&o.forEach((function(e){const o=`${n}.${r}::`+e,i=s.prototype;try{if(i.hasOwnProperty(e)){const n=t.ObjectGetOwnPropertyDescriptor(i,e);n&&n.value?(n.value=t.wrapWithCurrentZone(n.value,o),t._redefineProperty(s.prototype,e,n)):i[e]&&(i[e]=t.wrapWithCurrentZone(i[e],o))}else i[e]&&(i[e]=t.wrapWithCurrentZone(i[e],o))}catch{}})),a.call(e,i,s,u)},t.attachOriginToPatched(e[r],a)}const Wi=function(){const t=globalThis,e=!0===t[Zo("forceDuplicateZoneCheck")];if(t.Zone&&(e||"function"!=typeof t.Zone.__symbol__))throw new Error("Zone already loaded.");return t.Zone??=function(){const t=Bo.performance;function e(e){t&&t.mark&&t.mark(e)}function n(e,n){t&&t.measure&&t.measure(e,n)}e("Zone");class r{static{this.__symbol__=Zo}static assertZonePatched(){if(Bo.Promise!==L.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let t=r.current;for(;t.parent;)t=t.parent;return t}static get current(){return w.zone}static get currentTask(){return A}static __load_patch(t,o,i=!1){if(L.hasOwnProperty(t)){const e=!0===Bo[Zo("forceDuplicateZoneCheck")];if(!i&&e)throw Error("Already loaded patch: "+t)}else if(!Bo["__Zone_disable_"+t]){const i="Zone:"+t;e(i),L[t]=o(Bo,r,P),n(i,i)}}get parent(){return this._parent}get name(){return this._name}constructor(t,e){this._parent=t,this._name=e?e.name||"unnamed":"<root>",this._properties=e&&e.properties||{},this._zoneDelegate=new i(this,this._parent&&this._parent._zoneDelegate,e)}get(t){const e=this.getZoneWith(t);if(e)return e._properties[t]}getZoneWith(t){let e=this;for(;e;){if(e._properties.hasOwnProperty(t))return e;e=e._parent}return null}fork(t){if(!t)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,t)}wrap(t,e){if("function"!=typeof t)throw new Error("Expecting function got: "+t);const n=this._zoneDelegate.intercept(this,t,e),r=this;return function(){return r.runGuarded(n,this,arguments,e)}}run(t,e,n,r){w={parent:w,zone:this};try{return this._zoneDelegate.invoke(this,t,e,n,r)}finally{w=w.parent}}runGuarded(t,e=null,n,r){w={parent:w,zone:this};try{try{return this._zoneDelegate.invoke(this,t,e,n,r)}catch(t){if(this._zoneDelegate.handleError(this,t))throw t}}finally{w=w.parent}}runTask(t,e,n){if(t.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(t.zone||v).name+"; Execution: "+this.name+")");const r=t,{type:o,data:{isPeriodic:i=!1,isRefreshable:a=!1}={}}=t;if(t.state===g&&(o===R||o===O))return;const s=t.state!=T;s&&r._transitionTo(T,y);const u=A;A=r,w={parent:w,zone:this};try{o!=O||!t.data||i||a||(t.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,r,e,n)}catch(t){if(this._zoneDelegate.handleError(this,t))throw t}}finally{const e=t.state;if(e!==g&&e!==b)if(o==R||i||a&&e===E)s&&r._transitionTo(y,T,E);else{const t=r._zoneDelegates;this._updateTaskCount(r,-1),s&&r._transitionTo(g,T,g),a&&(r._zoneDelegates=t)}w=w.parent,A=u}}scheduleTask(t){if(t.zone&&t.zone!==this){let e=this;for(;e;){if(e===t.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${t.zone.name}`);e=e.parent}}t._transitionTo(E,g);const e=[];t._zoneDelegates=e,t._zone=this;try{t=this._zoneDelegate.scheduleTask(this,t)}catch(e){throw t._transitionTo(b,E,g),this._zoneDelegate.handleError(this,e),e}return t._zoneDelegates===e&&this._updateTaskCount(t,1),t.state==E&&t._transitionTo(y,E),t}scheduleMicroTask(t,e,n,r){return this.scheduleTask(new a(S,t,e,n,r,void 0))}scheduleMacroTask(t,e,n,r,o){return this.scheduleTask(new a(O,t,e,n,r,o))}scheduleEventTask(t,e,n,r,o){return this.scheduleTask(new a(R,t,e,n,r,o))}cancelTask(t){if(t.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(t.zone||v).name+"; Execution: "+this.name+")");if(t.state===y||t.state===T){t._transitionTo(m,y,T);try{this._zoneDelegate.cancelTask(this,t)}catch(e){throw t._transitionTo(b,m),this._zoneDelegate.handleError(this,e),e}return this._updateTaskCount(t,-1),t._transitionTo(g,m),t.runCount=-1,t}}_updateTaskCount(t,e){const n=t._zoneDelegates;-1==e&&(t._zoneDelegates=null);for(let r=0;r<n.length;r++)n[r]._updateTaskCount(t.type,e)}}const o={name:"",onHasTask:(t,e,n,r)=>t.hasTask(n,r),onScheduleTask:(t,e,n,r)=>t.scheduleTask(n,r),onInvokeTask:(t,e,n,r,o,i)=>t.invokeTask(n,r,o,i),onCancelTask:(t,e,n,r)=>t.cancelTask(n,r)};class i{get zone(){return this._zone}constructor(t,e,n){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this._zone=t,this._parentDelegate=e,this._forkZS=n&&(n&&n.onFork?n:e._forkZS),this._forkDlgt=n&&(n.onFork?e:e._forkDlgt),this._forkCurrZone=n&&(n.onFork?this._zone:e._forkCurrZone),this._interceptZS=n&&(n.onIntercept?n:e._interceptZS),this._interceptDlgt=n&&(n.onIntercept?e:e._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this._zone:e._interceptCurrZone),this._invokeZS=n&&(n.onInvoke?n:e._invokeZS),this._invokeDlgt=n&&(n.onInvoke?e:e._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this._zone:e._invokeCurrZone),this._handleErrorZS=n&&(n.onHandleError?n:e._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?e:e._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this._zone:e._handleErrorCurrZone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:e._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?e:e._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this._zone:e._scheduleTaskCurrZone),this._invokeTaskZS=n&&(n.onInvokeTask?n:e._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?e:e._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this._zone:e._invokeTaskCurrZone),this._cancelTaskZS=n&&(n.onCancelTask?n:e._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?e:e._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this._zone:e._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const r=n&&n.onHasTask,i=e&&e._hasTaskZS;(r||i)&&(this._hasTaskZS=r?n:o,this._hasTaskDlgt=e,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,n.onScheduleTask||(this._scheduleTaskZS=o,this._scheduleTaskDlgt=e,this._scheduleTaskCurrZone=this._zone),n.onInvokeTask||(this._invokeTaskZS=o,this._invokeTaskDlgt=e,this._invokeTaskCurrZone=this._zone),n.onCancelTask||(this._cancelTaskZS=o,this._cancelTaskDlgt=e,this._cancelTaskCurrZone=this._zone))}fork(t,e){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,t,e):new r(t,e)}intercept(t,e,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,t,e,n):e}invoke(t,e,n,r,o){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,t,e,n,r,o):e.apply(n,r)}handleError(t,e){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,t,e)}scheduleTask(t,e){let n=e;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,t,e),n||(n=e);else if(e.scheduleFn)e.scheduleFn(e);else{if(e.type!=S)throw new Error("Task is missing scheduleFn.");d(e)}return n}invokeTask(t,e,n,r){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,t,e,n,r):e.callback.apply(n,r)}cancelTask(t,e){let n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,t,e);else{if(!e.cancelFn)throw Error("Task is not cancelable");n=e.cancelFn(e)}return n}hasTask(t,e){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,t,e)}catch(e){this.handleError(t,e)}}_updateTaskCount(t,e){const n=this._taskCounts,r=n[t],o=n[t]=r+e;if(o<0)throw new Error("More tasks executed then were scheduled.");if(0==r||0==o){const e={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:t};this.hasTask(this._zone,e)}}}class a{constructor(t,e,n,r,o,i){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=t,this.source=e,this.data=r,this.scheduleFn=o,this.cancelFn=i,!n)throw new Error("callback is not defined");this.callback=n;const s=this;t===R&&r&&r.useG?this.invoke=a.invokeTask:this.invoke=function(){return a.invokeTask.call(Bo,s,this,arguments)}}static invokeTask(t,e,n){t||(t=this),C++;try{return t.runCount++,t.zone.runTask(t,e,n)}finally{1==C&&_(),C--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(g,E)}_transitionTo(t,e,n){if(this._state!==e&&this._state!==n)throw new Error(`${this.type} '${this.source}': can not transition to '${t}', expecting state '${e}'${n?" or '"+n+"'":""}, was '${this._state}'.`);this._state=t,t==g&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const s=Zo("setTimeout"),u=Zo("Promise"),c=Zo("then");let l,p=[],f=!1;function h(t){if(l||Bo[u]&&(l=Bo[u].resolve(0)),l){let e=l[c];e||(e=l.then),e.call(l,t)}else Bo[s](t,0)}function d(t){0===C&&0===p.length&&h(_),t&&p.push(t)}function _(){if(!f){for(f=!0;p.length;){const t=p;p=[];for(let e=0;e<t.length;e++){const n=t[e];try{n.zone.runTask(n,null,null)}catch(t){P.onUnhandledError(t)}}}P.microtaskDrainDone(),f=!1}}const v={name:"NO ZONE"},g="notScheduled",E="scheduling",y="scheduled",T="running",m="canceling",b="unknown",S="microTask",O="macroTask",R="eventTask",L={},P={symbol:Zo,currentZoneFrame:()=>w,onUnhandledError:k,microtaskDrainDone:k,scheduleMicroTask:d,showUncaughtError:()=>!r[Zo("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:k,patchMethod:()=>k,bindArguments:()=>[],patchThen:()=>k,patchMacroTask:()=>k,patchEventPrototype:()=>k,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>k,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>k,wrapWithCurrentZone:()=>k,filterProperties:()=>[],attachOriginToPatched:()=>k,_redefineProperty:()=>k,patchCallbacks:()=>k,nativeScheduleMicroTask:h};let w={parent:null,zone:new r(null,null)},A=null,C=0;function k(){}return n("Zone","Zone"),r}(),t.Zone}();function Ki(t={}){var e;return"true"===(null===(e=t.attributes)||void 0===e?void 0:e.isSampled)?kr.RECORD_AND_SAMPLED:kr.NOT_RECORD}!function(t){Vi(t),function(t){t.__load_patch("toString",(t=>{const e=Function.prototype.toString,n=ei("OriginalDelegate"),r=ei("Promise"),o=ei("Error"),i=function(){if("function"==typeof this){const i=this[n];if(i)return"function"==typeof i?e.call(i):Object.prototype.toString.call(i);if(this===Promise){const n=t[r];if(n)return e.call(n)}if(this===Error){const n=t[o];if(n)return e.call(n)}}return e.call(this)};i[n]=e,Function.prototype.toString=i;const a=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":a.call(this)}}))}(t),function(t){t.__load_patch("util",((t,e,n)=>{const r=Gi(t);n.patchOnProperties=vi,n.patchMethod=yi,n.bindArguments=ai,n.patchMacroTask=Ti;const o=e.__symbol__("BLACK_LISTED_EVENTS"),i=e.__symbol__("UNPATCHED_EVENTS");t[i]&&(t[o]=t[i]),t[o]&&(e[o]=e[i]=t[o]),n.patchEventPrototype=ji,n.patchEventTarget=xi,n.isIEOrEdge=Ri,n.ObjectDefineProperty=Ho,n.ObjectGetOwnPropertyDescriptor=zo,n.ObjectCreate=Go,n.ArraySlice=Xo,n.patchClass=Ei,n.wrapWithCurrentZone=Jo,n.filterProperties=Hi,n.attachOriginToPatched=mi,n._redefineProperty=Object.defineProperty,n.patchCallbacks=qi,n.getGlobalObjects=()=>({globalSources:ki,zoneSymbolEventNames:Ci,eventNames:r,isBrowser:li,isMix:pi,isNode:ci,TRUE_STR:Yo,FALSE_STR:$o,ZONE_SYMBOL_PREFIX:Qo,ADD_EVENT_LISTENER_STR:Vo,REMOVE_EVENT_LISTENER_STR:qo})}))}(t)}(Wi),function(t){t.__load_patch("legacy",(e=>{const n=e[t.__symbol__("legacyPatch")];n&&n()})),t.__load_patch("timers",(t=>{const e="set",n="clear";Zi(t,e,n,"Timeout"),Zi(t,e,n,"Interval"),Zi(t,e,n,"Immediate")})),t.__load_patch("requestAnimationFrame",(t=>{Zi(t,"request","cancel","AnimationFrame"),Zi(t,"mozRequest","mozCancel","AnimationFrame"),Zi(t,"webkitRequest","webkitCancel","AnimationFrame")})),t.__load_patch("blocking",((t,e)=>{const n=["alert","prompt","confirm"];for(let r=0;r<n.length;r++){yi(t,n[r],((n,r,o)=>function(r,i){return e.current.run(n,t,i,o)}))}})),t.__load_patch("EventTarget",((t,e,n)=>{!function(t,e){e.patchEventPrototype(t,e)}(t,n),zi(t,n);const r=t.XMLHttpRequestEventTarget;r&&r.prototype&&n.patchEventTarget(t,n,[r.prototype])})),t.__load_patch("MutationObserver",((t,e,n)=>{Ei("MutationObserver"),Ei("WebKitMutationObserver")})),t.__load_patch("IntersectionObserver",((t,e,n)=>{Ei("IntersectionObserver")})),t.__load_patch("FileReader",((t,e,n)=>{Ei("FileReader")})),t.__load_patch("on_property",((t,e,n)=>{Xi(n,t)})),t.__load_patch("customElements",((t,e,n)=>{!function(t,e){const{isBrowser:n,isMix:r}=e.getGlobalObjects();if(!n&&!r||!t.customElements||!("customElements"in t))return;e.patchCallbacks(e,t.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"])}(t,n)})),t.__load_patch("XHR",((t,e)=>{!function(t){const u=t.XMLHttpRequest;if(!u)return;const c=u.prototype;let l=c[Wo],p=c[Ko];if(!l){const e=t.XMLHttpRequestEventTarget;if(e){const t=e.prototype;l=t[Wo],p=t[Ko]}}const f="readystatechange",h="scheduled";function d(t){const r=t.data,a=r.target;a[i]=!1,a[s]=!1;const u=a[o];l||(l=a[Wo],p=a[Ko]),u&&p.call(a,f,u);const c=a[o]=()=>{if(a.readyState===a.DONE)if(!r.aborted&&a[i]&&t.state===h){const n=a[e.__symbol__("loadfalse")];if(0!==a.status&&n&&n.length>0){const o=t.invoke;t.invoke=function(){const n=a[e.__symbol__("loadfalse")];for(let e=0;e<n.length;e++)n[e]===t&&n.splice(e,1);r.aborted||t.state!==h||o.call(t)},n.push(t)}else t.invoke()}else r.aborted||!1!==a[i]||(a[s]=!0)};l.call(a,f,c);return a[n]||(a[n]=t),T.apply(a,r.args),a[i]=!0,t}function _(){}function v(t){const e=t.data;return e.aborted=!0,m.apply(e.target,e.args)}const g=yi(c,"open",(()=>function(t,e){return t[r]=0==e[2],t[a]=e[1],g.apply(t,e)})),E=ei("fetchTaskAborting"),y=ei("fetchTaskScheduling"),T=yi(c,"send",(()=>function(t,n){if(!0===e.current[y])return T.apply(t,n);if(t[r])return T.apply(t,n);{const e={target:t,url:t[a],isPeriodic:!1,args:n,aborted:!1},r=ti("XMLHttpRequest.send",_,e,d,v);t&&!0===t[s]&&!e.aborted&&r.state===h&&r.invoke()}})),m=yi(c,"abort",(()=>function(t,r){const o=t[n];if(o&&"string"==typeof o.type){if(null==o.cancelFn||o.data&&o.data.aborted)return;o.zone.cancelTask(o)}else if(!0===e.current[E])return m.apply(t,r)}))}(t);const n=ei("xhrTask"),r=ei("xhrSync"),o=ei("xhrListener"),i=ei("xhrScheduled"),a=ei("xhrURL"),s=ei("xhrErrorBeforeScheduled")})),t.__load_patch("geolocation",(t=>{t.navigator&&t.navigator.geolocation&&function(t,e){const n=t.constructor.name;for(let r=0;r<e.length;r++){const o=e[r],i=t[o];if(i){if(!si(zo(t,o)))continue;t[o]=(t=>{const e=function(){return t.apply(this,ai(arguments,n+"."+o))};return mi(e,t),e})(i)}}}(t.navigator.geolocation,["getCurrentPosition","watchPosition"])})),t.__load_patch("PromiseRejectionEvent",((t,e)=>{function n(e){return function(n){Mi(t,e).forEach((r=>{const o=t.PromiseRejectionEvent;if(o){const t=new o(e,{promise:n.promise,reason:n.rejection});r.invoke(t)}}))}}t.PromiseRejectionEvent&&(e[ei("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),e[ei("rejectionHandledHandler")]=n("rejectionhandled"))})),t.__load_patch("queueMicrotask",((t,e,n)=>{Ui(t,n)}))}(Wi);class Yi extends e.BaseInstrumentation{constructor(t={}){super(),this.options=t,this.name="@grafana/faro-web-tracing",this.version=e.VERSION}initialize(){var t,e,n,r,o;const i=this.options,a={};this.config.app.name&&(a["service.name"]=this.config.app.name),this.config.app.namespace&&(a["service.namespace"]=this.config.app.namespace),this.config.app.version&&(a["service.version"]=this.config.app.version),this.config.app.environment&&(a["deployment.environment.name"]=this.config.app.environment,a["deployment.environment"]=this.config.app.environment),Object.assign(a,i.resourceAttributes);const s=sr.default().merge(new sr(a)),u=new fo({resource:s,sampler:{shouldSample:()=>({decision:Ki(this.api.getSession())})}});u.addSpanProcessor(null!==(t=i.spanProcessor)&&void 0!==t?t:new lr(new Kr(new cr({api:this.api}),{scheduledDelayMillis:Yi.SCHEDULED_BATCH_DELAY_MS,maxExportBatchSize:30}),this.metas)),u.register({propagator:null!==(e=i.propagator)&&void 0!==e?e:new hn,contextManager:null!==(n=i.contextManager)&&void 0!==n?n:new Uo});const{propagateTraceHeaderCorsUrls:c,fetchInstrumentationOptions:l,xhrInstrumentationOptions:p}=null!==(r=this.options.instrumentationOptions)&&void 0!==r?r:{};!function(t){var e,n,r=t.tracerProvider||qt.getTracerProvider(),o=t.meterProvider||xt.getMeterProvider(),i=t.loggerProvider||gr.getLoggerProvider(),a=null!==(n=null===(e=t.instrumentations)||void 0===e?void 0:e.flat())&&void 0!==n?n:[];(function(t,e,n,r){for(var o=0,i=t.length;o<i;o++){var a=t[o];e&&a.setTracerProvider(e),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}})(a,r,o,i)}({instrumentations:null!==(o=i.instrumentations)&&void 0!==o?o:Mo({ignoreUrls:this.getIgnoreUrls(),propagateTraceHeaderCorsUrls:c,fetchInstrumentationOptions:l,xhrInstrumentationOptions:p})}),this.api.initOTEL(qt,kt)}getIgnoreUrls(){return this.transports.transports.flatMap((t=>t.getIgnoreUrls()))}}return Yi.SCHEDULED_BATCH_DELAY_MS=1e3,t.FaroSessionSpanProcessor=lr,t.FaroTraceExporter=cr,t.TracingInstrumentation=Yi,t.fetchCustomAttributeFunctionWithDefaults=Do,t.getDefaultOTELInstrumentations=Mo,t.getSamplingDecision=Ki,t.setSpanStatusOnFetchError=Io,t}({},GrafanaFaroWebSdk);
@@ -0,0 +1,8 @@
1
+ import { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';
2
+ import type { XMLHttpRequestInstrumentationConfig } from '@opentelemetry/instrumentation-xml-http-request';
3
+ import type { OpenFunction } from '@opentelemetry/instrumentation-xml-http-request/build/src/types';
4
+ export declare class FaroXhrInstrumentation extends XMLHttpRequestInstrumentation {
5
+ private parentCreateSpan;
6
+ constructor(config?: XMLHttpRequestInstrumentationConfig);
7
+ protected _patchOpen(): (original: OpenFunction) => OpenFunction;
8
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.FaroXhrInstrumentation = void 0;
19
+ var instrumentation_xml_http_request_1 = require("@opentelemetry/instrumentation-xml-http-request");
20
+ var FaroXhrInstrumentation = /** @class */ (function (_super) {
21
+ __extends(FaroXhrInstrumentation, _super);
22
+ function FaroXhrInstrumentation(config) {
23
+ if (config === void 0) { config = {}; }
24
+ var _this = _super.call(this, config) || this;
25
+ var self = _this;
26
+ _this.parentCreateSpan = self._createSpan.bind(_this);
27
+ return _this;
28
+ }
29
+ // Patching the parent's private method to handle url type string or URL
30
+ FaroXhrInstrumentation.prototype._patchOpen = function () {
31
+ var _this = this;
32
+ return function (original) {
33
+ var plugin = _this;
34
+ return function patchOpen() {
35
+ var args = [];
36
+ for (var _i = 0; _i < arguments.length; _i++) {
37
+ args[_i] = arguments[_i];
38
+ }
39
+ var method = args[0];
40
+ var url = args[1];
41
+ if (isInstanceOfURL(url)) {
42
+ url = url.href;
43
+ }
44
+ plugin.parentCreateSpan(this, url, method);
45
+ return original.apply(this, args);
46
+ };
47
+ };
48
+ };
49
+ return FaroXhrInstrumentation;
50
+ }(instrumentation_xml_http_request_1.XMLHttpRequestInstrumentation));
51
+ exports.FaroXhrInstrumentation = FaroXhrInstrumentation;
52
+ function isInstanceOfURL(item) {
53
+ return item instanceof URL;
54
+ }
55
+ //# sourceMappingURL=faroXhrInstrumentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"faroXhrInstrumentation.js","sourceRoot":"","sources":["../../src/faroXhrInstrumentation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,oGAAgG;AAQhG;IAA4C,0CAA6B;IAGvE,gCAAY,MAAgD;QAAhD,uBAAA,EAAA,WAAgD;QAA5D,YACE,kBAAM,MAAM,CAAC,SAId;QAFC,IAAM,IAAI,GAAG,KAAqB,CAAC;QACnC,KAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;;IACtD,CAAC;IAED,wEAAwE;IACrD,2CAAU,GAA7B;QAAA,iBAgBC;QAfC,OAAO,UAAC,QAAsB;YAC5B,IAAM,MAAM,GAAG,KAAI,CAAC;YACpB,OAAO,SAAS,SAAS;gBAAuB,cAAO;qBAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;oBAAP,yBAAO;;gBACrD,IAAM,MAAM,GAAW,IAAI,CAAC,CAAC,CAAC,CAAC;gBAC/B,IAAI,GAAG,GAAiB,IAAI,CAAC,CAAC,CAAC,CAAC;gBAEhC,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE;oBACxB,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC;iBAChB;gBAED,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;gBAE3C,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACpC,CAAC,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;IACH,6BAAC;AAAD,CAAC,AA5BD,CAA4C,gEAA6B,GA4BxE;AA5BY,wDAAsB;AA8BnC,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,IAAI,YAAY,GAAG,CAAC;AAC7B,CAAC","sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';\nimport type { XMLHttpRequestInstrumentationConfig } from '@opentelemetry/instrumentation-xml-http-request';\nimport type { OpenFunction } from '@opentelemetry/instrumentation-xml-http-request/build/src/types';\n\ntype Parent = {\n _createSpan: (xhr: XMLHttpRequest, url: string, method: string) => Span | undefined;\n};\n\nexport class FaroXhrInstrumentation extends XMLHttpRequestInstrumentation {\n private parentCreateSpan: Parent['_createSpan'];\n\n constructor(config: XMLHttpRequestInstrumentationConfig = {}) {\n super(config);\n\n const self = this as any as Parent;\n this.parentCreateSpan = self._createSpan.bind(this);\n }\n\n // Patching the parent's private method to handle url type string or URL\n protected override _patchOpen() {\n return (original: OpenFunction): OpenFunction => {\n const plugin = this;\n return function patchOpen(this: XMLHttpRequest, ...args): void {\n const method: string = args[0];\n let url: string | URL = args[1];\n\n if (isInstanceOfURL(url)) {\n url = url.href;\n }\n\n plugin.parentCreateSpan(this, url, method);\n\n return original.apply(this, args);\n };\n };\n }\n}\n\nfunction isInstanceOfURL(item: any): item is URL {\n return item instanceof URL;\n}\n"]}
@@ -24,14 +24,14 @@ var __rest = (this && this.__rest) || function (s, e) {
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.getDefaultOTELInstrumentations = void 0;
26
26
  var instrumentation_fetch_1 = require("@opentelemetry/instrumentation-fetch");
27
- var instrumentation_xml_http_request_1 = require("@opentelemetry/instrumentation-xml-http-request");
27
+ var faroXhrInstrumentation_1 = require("./faroXhrInstrumentation");
28
28
  var instrumentationUtils_1 = require("./instrumentationUtils");
29
29
  function getDefaultOTELInstrumentations(options) {
30
30
  if (options === void 0) { options = {}; }
31
31
  var fetchInstrumentationOptions = options.fetchInstrumentationOptions, xhrInstrumentationOptions = options.xhrInstrumentationOptions, sharedOptions = __rest(options, ["fetchInstrumentationOptions", "xhrInstrumentationOptions"]);
32
32
  var fetchOpts = createFetchInstrumentationOptions(fetchInstrumentationOptions, sharedOptions);
33
33
  var xhrOpts = createXhrInstrumentationOptions(xhrInstrumentationOptions, sharedOptions);
34
- return [new instrumentation_fetch_1.FetchInstrumentation(fetchOpts), new instrumentation_xml_http_request_1.XMLHttpRequestInstrumentation(xhrOpts)];
34
+ return [new instrumentation_fetch_1.FetchInstrumentation(fetchOpts), new faroXhrInstrumentation_1.FaroXhrInstrumentation(xhrOpts)];
35
35
  }
36
36
  exports.getDefaultOTELInstrumentations = getDefaultOTELInstrumentations;
37
37
  function createFetchInstrumentationOptions(fetchInstrumentationOptions, sharedOptions) {
@@ -1 +1 @@
1
- {"version":3,"file":"getDefaultOTELInstrumentations.js","sourceRoot":"","sources":["../../src/getDefaultOTELInstrumentations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8EAA4E;AAC5E,oGAAgG;AAEhG,+DAGgC;AAGhC,SAAgB,8BAA8B,CAAC,OAA4C;IAA5C,wBAAA,EAAA,YAA4C;IACjF,IAAA,2BAA2B,GAAkD,OAAO,4BAAzD,EAAE,yBAAyB,GAAuB,OAAO,0BAA9B,EAAK,aAAa,UAAK,OAAO,EAAtF,4DAA4E,CAAF,CAAa;IAE7F,IAAM,SAAS,GAAG,iCAAiC,CAAC,2BAA2B,EAAE,aAAa,CAAC,CAAC;IAChG,IAAM,OAAO,GAAG,+BAA+B,CAAC,yBAAyB,EAAE,aAAa,CAAC,CAAC;IAE1F,OAAO,CAAC,IAAI,4CAAoB,CAAC,SAAS,CAAC,EAAE,IAAI,gEAA6B,CAAC,OAAO,CAAC,CAAC,CAAC;AAC3F,CAAC;AAPD,wEAOC;AACD,SAAS,iCAAiC,CACxC,2BAA0F,EAC1F,aAAsC;IAEtC,+CACK,aAAa,KAChB,mBAAmB,EAAE,IAAI,KAEtB,2BAA2B;QAC9B,4BAA4B;QAC5B,2BAA2B,EAAE,IAAA,+DAAwC,EACnE,2BAA2B,aAA3B,2BAA2B,uBAA3B,2BAA2B,CAAE,2BAA2B,CACzD,IACD;AACJ,CAAC;AAED,SAAS,+BAA+B,CACtC,yBAAsF,EACtF,aAAsC;IAEtC,+CACK,aAAa,KAChB,mBAAmB,EAAE,IAAI,KAEtB,yBAAyB;QAC5B,4BAA4B;QAC5B,2BAA2B,EAAE,IAAA,6DAAsC,EACjE,yBAAyB,aAAzB,yBAAyB,uBAAzB,yBAAyB,CAAE,2BAA2B,CACvD,IACD;AACJ,CAAC","sourcesContent":["import { FetchInstrumentation } from '@opentelemetry/instrumentation-fetch';\nimport { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';\n\nimport {\n fetchCustomAttributeFunctionWithDefaults,\n xhrCustomAttributeFunctionWithDefaults,\n} from './instrumentationUtils';\nimport type { DefaultInstrumentationsOptions, InstrumentationOption } from './types';\n\nexport function getDefaultOTELInstrumentations(options: DefaultInstrumentationsOptions = {}): InstrumentationOption[] {\n const { fetchInstrumentationOptions, xhrInstrumentationOptions, ...sharedOptions } = options;\n\n const fetchOpts = createFetchInstrumentationOptions(fetchInstrumentationOptions, sharedOptions);\n const xhrOpts = createXhrInstrumentationOptions(xhrInstrumentationOptions, sharedOptions);\n\n return [new FetchInstrumentation(fetchOpts), new XMLHttpRequestInstrumentation(xhrOpts)];\n}\nfunction createFetchInstrumentationOptions(\n fetchInstrumentationOptions: DefaultInstrumentationsOptions['fetchInstrumentationOptions'],\n sharedOptions: Record<string, unknown>\n) {\n return {\n ...sharedOptions,\n ignoreNetworkEvents: true,\n // keep this here to overwrite the defaults above if provided by the users\n ...fetchInstrumentationOptions,\n // always keep this function\n applyCustomAttributesOnSpan: fetchCustomAttributeFunctionWithDefaults(\n fetchInstrumentationOptions?.applyCustomAttributesOnSpan\n ),\n };\n}\n\nfunction createXhrInstrumentationOptions(\n xhrInstrumentationOptions: DefaultInstrumentationsOptions['xhrInstrumentationOptions'],\n sharedOptions: Record<string, unknown>\n) {\n return {\n ...sharedOptions,\n ignoreNetworkEvents: true,\n // keep this here to overwrite the defaults above if provided by the users\n ...xhrInstrumentationOptions,\n // always keep this function\n applyCustomAttributesOnSpan: xhrCustomAttributeFunctionWithDefaults(\n xhrInstrumentationOptions?.applyCustomAttributesOnSpan\n ),\n };\n}\n"]}
1
+ {"version":3,"file":"getDefaultOTELInstrumentations.js","sourceRoot":"","sources":["../../src/getDefaultOTELInstrumentations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8EAA4E;AAE5E,mEAAkE;AAClE,+DAGgC;AAGhC,SAAgB,8BAA8B,CAAC,OAA4C;IAA5C,wBAAA,EAAA,YAA4C;IACjF,IAAA,2BAA2B,GAAkD,OAAO,4BAAzD,EAAE,yBAAyB,GAAuB,OAAO,0BAA9B,EAAK,aAAa,UAAK,OAAO,EAAtF,4DAA4E,CAAF,CAAa;IAE7F,IAAM,SAAS,GAAG,iCAAiC,CAAC,2BAA2B,EAAE,aAAa,CAAC,CAAC;IAChG,IAAM,OAAO,GAAG,+BAA+B,CAAC,yBAAyB,EAAE,aAAa,CAAC,CAAC;IAE1F,OAAO,CAAC,IAAI,4CAAoB,CAAC,SAAS,CAAC,EAAE,IAAI,+CAAsB,CAAC,OAAO,CAAC,CAAC,CAAC;AACpF,CAAC;AAPD,wEAOC;AACD,SAAS,iCAAiC,CACxC,2BAA0F,EAC1F,aAAsC;IAEtC,+CACK,aAAa,KAChB,mBAAmB,EAAE,IAAI,KAEtB,2BAA2B;QAC9B,4BAA4B;QAC5B,2BAA2B,EAAE,IAAA,+DAAwC,EACnE,2BAA2B,aAA3B,2BAA2B,uBAA3B,2BAA2B,CAAE,2BAA2B,CACzD,IACD;AACJ,CAAC;AAED,SAAS,+BAA+B,CACtC,yBAAsF,EACtF,aAAsC;IAEtC,+CACK,aAAa,KAChB,mBAAmB,EAAE,IAAI,KAEtB,yBAAyB;QAC5B,4BAA4B;QAC5B,2BAA2B,EAAE,IAAA,6DAAsC,EACjE,yBAAyB,aAAzB,yBAAyB,uBAAzB,yBAAyB,CAAE,2BAA2B,CACvD,IACD;AACJ,CAAC","sourcesContent":["import { FetchInstrumentation } from '@opentelemetry/instrumentation-fetch';\n\nimport { FaroXhrInstrumentation } from './faroXhrInstrumentation';\nimport {\n fetchCustomAttributeFunctionWithDefaults,\n xhrCustomAttributeFunctionWithDefaults,\n} from './instrumentationUtils';\nimport type { DefaultInstrumentationsOptions, InstrumentationOption } from './types';\n\nexport function getDefaultOTELInstrumentations(options: DefaultInstrumentationsOptions = {}): InstrumentationOption[] {\n const { fetchInstrumentationOptions, xhrInstrumentationOptions, ...sharedOptions } = options;\n\n const fetchOpts = createFetchInstrumentationOptions(fetchInstrumentationOptions, sharedOptions);\n const xhrOpts = createXhrInstrumentationOptions(xhrInstrumentationOptions, sharedOptions);\n\n return [new FetchInstrumentation(fetchOpts), new FaroXhrInstrumentation(xhrOpts)];\n}\nfunction createFetchInstrumentationOptions(\n fetchInstrumentationOptions: DefaultInstrumentationsOptions['fetchInstrumentationOptions'],\n sharedOptions: Record<string, unknown>\n) {\n return {\n ...sharedOptions,\n ignoreNetworkEvents: true,\n // keep this here to overwrite the defaults above if provided by the users\n ...fetchInstrumentationOptions,\n // always keep this function\n applyCustomAttributesOnSpan: fetchCustomAttributeFunctionWithDefaults(\n fetchInstrumentationOptions?.applyCustomAttributesOnSpan\n ),\n };\n}\n\nfunction createXhrInstrumentationOptions(\n xhrInstrumentationOptions: DefaultInstrumentationsOptions['xhrInstrumentationOptions'],\n sharedOptions: Record<string, unknown>\n) {\n return {\n ...sharedOptions,\n ignoreNetworkEvents: true,\n // keep this here to overwrite the defaults above if provided by the users\n ...xhrInstrumentationOptions,\n // always keep this function\n applyCustomAttributesOnSpan: xhrCustomAttributeFunctionWithDefaults(\n xhrInstrumentationOptions?.applyCustomAttributesOnSpan\n ),\n };\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';
2
+ export class FaroXhrInstrumentation extends XMLHttpRequestInstrumentation {
3
+ constructor(config = {}) {
4
+ super(config);
5
+ const self = this;
6
+ this.parentCreateSpan = self._createSpan.bind(this);
7
+ }
8
+ // Patching the parent's private method to handle url type string or URL
9
+ _patchOpen() {
10
+ return (original) => {
11
+ const plugin = this;
12
+ return function patchOpen(...args) {
13
+ const method = args[0];
14
+ let url = args[1];
15
+ if (isInstanceOfURL(url)) {
16
+ url = url.href;
17
+ }
18
+ plugin.parentCreateSpan(this, url, method);
19
+ return original.apply(this, args);
20
+ };
21
+ };
22
+ }
23
+ }
24
+ function isInstanceOfURL(item) {
25
+ return item instanceof URL;
26
+ }
27
+ //# sourceMappingURL=faroXhrInstrumentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"faroXhrInstrumentation.js","sourceRoot":"","sources":["../../src/faroXhrInstrumentation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AAQhG,MAAM,OAAO,sBAAuB,SAAQ,6BAA6B;IAGvE,YAAY,SAA8C,EAAE;QAC1D,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,MAAM,IAAI,GAAG,IAAqB,CAAC;QACnC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,wEAAwE;IACrD,UAAU;QAC3B,OAAO,CAAC,QAAsB,EAAgB,EAAE;YAC9C,MAAM,MAAM,GAAG,IAAI,CAAC;YACpB,OAAO,SAAS,SAAS,CAAuB,GAAG,IAAI;gBACrD,MAAM,MAAM,GAAW,IAAI,CAAC,CAAC,CAAC,CAAC;gBAC/B,IAAI,GAAG,GAAiB,IAAI,CAAC,CAAC,CAAC,CAAC;gBAEhC,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE;oBACxB,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC;iBAChB;gBAED,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;gBAE3C,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACpC,CAAC,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CACF;AAED,SAAS,eAAe,CAAC,IAAS;IAChC,OAAO,IAAI,YAAY,GAAG,CAAC;AAC7B,CAAC","sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';\nimport type { XMLHttpRequestInstrumentationConfig } from '@opentelemetry/instrumentation-xml-http-request';\nimport type { OpenFunction } from '@opentelemetry/instrumentation-xml-http-request/build/src/types';\n\ntype Parent = {\n _createSpan: (xhr: XMLHttpRequest, url: string, method: string) => Span | undefined;\n};\n\nexport class FaroXhrInstrumentation extends XMLHttpRequestInstrumentation {\n private parentCreateSpan: Parent['_createSpan'];\n\n constructor(config: XMLHttpRequestInstrumentationConfig = {}) {\n super(config);\n\n const self = this as any as Parent;\n this.parentCreateSpan = self._createSpan.bind(this);\n }\n\n // Patching the parent's private method to handle url type string or URL\n protected override _patchOpen() {\n return (original: OpenFunction): OpenFunction => {\n const plugin = this;\n return function patchOpen(this: XMLHttpRequest, ...args): void {\n const method: string = args[0];\n let url: string | URL = args[1];\n\n if (isInstanceOfURL(url)) {\n url = url.href;\n }\n\n plugin.parentCreateSpan(this, url, method);\n\n return original.apply(this, args);\n };\n };\n }\n}\n\nfunction isInstanceOfURL(item: any): item is URL {\n return item instanceof URL;\n}\n"]}
@@ -10,13 +10,13 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { FetchInstrumentation } from '@opentelemetry/instrumentation-fetch';
13
- import { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';
13
+ import { FaroXhrInstrumentation } from './faroXhrInstrumentation';
14
14
  import { fetchCustomAttributeFunctionWithDefaults, xhrCustomAttributeFunctionWithDefaults, } from './instrumentationUtils';
15
15
  export function getDefaultOTELInstrumentations(options = {}) {
16
16
  const { fetchInstrumentationOptions, xhrInstrumentationOptions } = options, sharedOptions = __rest(options, ["fetchInstrumentationOptions", "xhrInstrumentationOptions"]);
17
17
  const fetchOpts = createFetchInstrumentationOptions(fetchInstrumentationOptions, sharedOptions);
18
18
  const xhrOpts = createXhrInstrumentationOptions(xhrInstrumentationOptions, sharedOptions);
19
- return [new FetchInstrumentation(fetchOpts), new XMLHttpRequestInstrumentation(xhrOpts)];
19
+ return [new FetchInstrumentation(fetchOpts), new FaroXhrInstrumentation(xhrOpts)];
20
20
  }
21
21
  function createFetchInstrumentationOptions(fetchInstrumentationOptions, sharedOptions) {
22
22
  return Object.assign(Object.assign(Object.assign(Object.assign({}, sharedOptions), { ignoreNetworkEvents: true }), fetchInstrumentationOptions), {
@@ -1 +1 @@
1
- {"version":3,"file":"getDefaultOTELInstrumentations.js","sourceRoot":"","sources":["../../src/getDefaultOTELInstrumentations.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AAEhG,OAAO,EACL,wCAAwC,EACxC,sCAAsC,GACvC,MAAM,wBAAwB,CAAC;AAGhC,MAAM,UAAU,8BAA8B,CAAC,UAA0C,EAAE;IACzF,MAAM,EAAE,2BAA2B,EAAE,yBAAyB,KAAuB,OAAO,EAAzB,aAAa,UAAK,OAAO,EAAtF,4DAA4E,CAAU,CAAC;IAE7F,MAAM,SAAS,GAAG,iCAAiC,CAAC,2BAA2B,EAAE,aAAa,CAAC,CAAC;IAChG,MAAM,OAAO,GAAG,+BAA+B,CAAC,yBAAyB,EAAE,aAAa,CAAC,CAAC;IAE1F,OAAO,CAAC,IAAI,oBAAoB,CAAC,SAAS,CAAC,EAAE,IAAI,6BAA6B,CAAC,OAAO,CAAC,CAAC,CAAC;AAC3F,CAAC;AACD,SAAS,iCAAiC,CACxC,2BAA0F,EAC1F,aAAsC;IAEtC,mEACK,aAAa,KAChB,mBAAmB,EAAE,IAAI,KAEtB,2BAA2B;QAC9B,4BAA4B;QAC5B,2BAA2B,EAAE,wCAAwC,CACnE,2BAA2B,aAA3B,2BAA2B,uBAA3B,2BAA2B,CAAE,2BAA2B,CACzD,IACD;AACJ,CAAC;AAED,SAAS,+BAA+B,CACtC,yBAAsF,EACtF,aAAsC;IAEtC,mEACK,aAAa,KAChB,mBAAmB,EAAE,IAAI,KAEtB,yBAAyB;QAC5B,4BAA4B;QAC5B,2BAA2B,EAAE,sCAAsC,CACjE,yBAAyB,aAAzB,yBAAyB,uBAAzB,yBAAyB,CAAE,2BAA2B,CACvD,IACD;AACJ,CAAC","sourcesContent":["import { FetchInstrumentation } from '@opentelemetry/instrumentation-fetch';\nimport { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';\n\nimport {\n fetchCustomAttributeFunctionWithDefaults,\n xhrCustomAttributeFunctionWithDefaults,\n} from './instrumentationUtils';\nimport type { DefaultInstrumentationsOptions, InstrumentationOption } from './types';\n\nexport function getDefaultOTELInstrumentations(options: DefaultInstrumentationsOptions = {}): InstrumentationOption[] {\n const { fetchInstrumentationOptions, xhrInstrumentationOptions, ...sharedOptions } = options;\n\n const fetchOpts = createFetchInstrumentationOptions(fetchInstrumentationOptions, sharedOptions);\n const xhrOpts = createXhrInstrumentationOptions(xhrInstrumentationOptions, sharedOptions);\n\n return [new FetchInstrumentation(fetchOpts), new XMLHttpRequestInstrumentation(xhrOpts)];\n}\nfunction createFetchInstrumentationOptions(\n fetchInstrumentationOptions: DefaultInstrumentationsOptions['fetchInstrumentationOptions'],\n sharedOptions: Record<string, unknown>\n) {\n return {\n ...sharedOptions,\n ignoreNetworkEvents: true,\n // keep this here to overwrite the defaults above if provided by the users\n ...fetchInstrumentationOptions,\n // always keep this function\n applyCustomAttributesOnSpan: fetchCustomAttributeFunctionWithDefaults(\n fetchInstrumentationOptions?.applyCustomAttributesOnSpan\n ),\n };\n}\n\nfunction createXhrInstrumentationOptions(\n xhrInstrumentationOptions: DefaultInstrumentationsOptions['xhrInstrumentationOptions'],\n sharedOptions: Record<string, unknown>\n) {\n return {\n ...sharedOptions,\n ignoreNetworkEvents: true,\n // keep this here to overwrite the defaults above if provided by the users\n ...xhrInstrumentationOptions,\n // always keep this function\n applyCustomAttributesOnSpan: xhrCustomAttributeFunctionWithDefaults(\n xhrInstrumentationOptions?.applyCustomAttributesOnSpan\n ),\n };\n}\n"]}
1
+ {"version":3,"file":"getDefaultOTELInstrumentations.js","sourceRoot":"","sources":["../../src/getDefaultOTELInstrumentations.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,wCAAwC,EACxC,sCAAsC,GACvC,MAAM,wBAAwB,CAAC;AAGhC,MAAM,UAAU,8BAA8B,CAAC,UAA0C,EAAE;IACzF,MAAM,EAAE,2BAA2B,EAAE,yBAAyB,KAAuB,OAAO,EAAzB,aAAa,UAAK,OAAO,EAAtF,4DAA4E,CAAU,CAAC;IAE7F,MAAM,SAAS,GAAG,iCAAiC,CAAC,2BAA2B,EAAE,aAAa,CAAC,CAAC;IAChG,MAAM,OAAO,GAAG,+BAA+B,CAAC,yBAAyB,EAAE,aAAa,CAAC,CAAC;IAE1F,OAAO,CAAC,IAAI,oBAAoB,CAAC,SAAS,CAAC,EAAE,IAAI,sBAAsB,CAAC,OAAO,CAAC,CAAC,CAAC;AACpF,CAAC;AACD,SAAS,iCAAiC,CACxC,2BAA0F,EAC1F,aAAsC;IAEtC,mEACK,aAAa,KAChB,mBAAmB,EAAE,IAAI,KAEtB,2BAA2B;QAC9B,4BAA4B;QAC5B,2BAA2B,EAAE,wCAAwC,CACnE,2BAA2B,aAA3B,2BAA2B,uBAA3B,2BAA2B,CAAE,2BAA2B,CACzD,IACD;AACJ,CAAC;AAED,SAAS,+BAA+B,CACtC,yBAAsF,EACtF,aAAsC;IAEtC,mEACK,aAAa,KAChB,mBAAmB,EAAE,IAAI,KAEtB,yBAAyB;QAC5B,4BAA4B;QAC5B,2BAA2B,EAAE,sCAAsC,CACjE,yBAAyB,aAAzB,yBAAyB,uBAAzB,yBAAyB,CAAE,2BAA2B,CACvD,IACD;AACJ,CAAC","sourcesContent":["import { FetchInstrumentation } from '@opentelemetry/instrumentation-fetch';\n\nimport { FaroXhrInstrumentation } from './faroXhrInstrumentation';\nimport {\n fetchCustomAttributeFunctionWithDefaults,\n xhrCustomAttributeFunctionWithDefaults,\n} from './instrumentationUtils';\nimport type { DefaultInstrumentationsOptions, InstrumentationOption } from './types';\n\nexport function getDefaultOTELInstrumentations(options: DefaultInstrumentationsOptions = {}): InstrumentationOption[] {\n const { fetchInstrumentationOptions, xhrInstrumentationOptions, ...sharedOptions } = options;\n\n const fetchOpts = createFetchInstrumentationOptions(fetchInstrumentationOptions, sharedOptions);\n const xhrOpts = createXhrInstrumentationOptions(xhrInstrumentationOptions, sharedOptions);\n\n return [new FetchInstrumentation(fetchOpts), new FaroXhrInstrumentation(xhrOpts)];\n}\nfunction createFetchInstrumentationOptions(\n fetchInstrumentationOptions: DefaultInstrumentationsOptions['fetchInstrumentationOptions'],\n sharedOptions: Record<string, unknown>\n) {\n return {\n ...sharedOptions,\n ignoreNetworkEvents: true,\n // keep this here to overwrite the defaults above if provided by the users\n ...fetchInstrumentationOptions,\n // always keep this function\n applyCustomAttributesOnSpan: fetchCustomAttributeFunctionWithDefaults(\n fetchInstrumentationOptions?.applyCustomAttributesOnSpan\n ),\n };\n}\n\nfunction createXhrInstrumentationOptions(\n xhrInstrumentationOptions: DefaultInstrumentationsOptions['xhrInstrumentationOptions'],\n sharedOptions: Record<string, unknown>\n) {\n return {\n ...sharedOptions,\n ignoreNetworkEvents: true,\n // keep this here to overwrite the defaults above if provided by the users\n ...xhrInstrumentationOptions,\n // always keep this function\n applyCustomAttributesOnSpan: xhrCustomAttributeFunctionWithDefaults(\n xhrInstrumentationOptions?.applyCustomAttributesOnSpan\n ),\n };\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';
2
+ import type { XMLHttpRequestInstrumentationConfig } from '@opentelemetry/instrumentation-xml-http-request';
3
+ import type { OpenFunction } from '@opentelemetry/instrumentation-xml-http-request/build/src/types';
4
+ export declare class FaroXhrInstrumentation extends XMLHttpRequestInstrumentation {
5
+ private parentCreateSpan;
6
+ constructor(config?: XMLHttpRequestInstrumentationConfig);
7
+ protected _patchOpen(): (original: OpenFunction) => OpenFunction;
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/faro-web-tracing",
3
- "version": "1.10.1",
3
+ "version": "1.10.2",
4
4
  "description": "Faro web tracing implementation.",
5
5
  "keywords": [
6
6
  "observability",
@@ -52,7 +52,7 @@
52
52
  "quality:circular-deps": "madge --circular ."
53
53
  },
54
54
  "dependencies": {
55
- "@grafana/faro-web-sdk": "^1.10.1",
55
+ "@grafana/faro-web-sdk": "^1.10.2",
56
56
  "@opentelemetry/api": "^1.9.0",
57
57
  "@opentelemetry/context-zone": "1.26.0",
58
58
  "@opentelemetry/core": "^1.26.0",
@@ -68,5 +68,5 @@
68
68
  "publishConfig": {
69
69
  "access": "public"
70
70
  },
71
- "gitHead": "b0f480e48d5dd405b4650c9d26e3648454806411"
71
+ "gitHead": "4e2f75f08c305da67e769879cea46b414809a32f"
72
72
  }