@grafana/faro-web-tracing 1.0.0-beta5 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
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.3.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: All API registration versions must match");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 y=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))},T=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([],y(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}(),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},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.")},S=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=g(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}(),b=Symbol("BaggageEntryMetadata"),O=T.instance();function w(t){return void 0===t&&(t={}),new S(new Map(Object.entries(t)))}function R(t){return Symbol.for(t)}var P,L,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)}),N=function(){function t(){}return t.prototype.createHistogram=function(t,e){return z},t.prototype.createCounter=function(t,e){return B},t.prototype.createUpDownCounter=function(t,e){return V},t.prototype.createObservableGauge=function(t,e){return X},t.prototype.createObservableCounter=function(t,e){return G},t.prototype.createObservableUpDownCounter=function(t,e){return q},t.prototype.addBatchObservableCallback=function(t,e){},t.prototype.removeBatchObservableCallback=function(t){},t}(),I=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}(I),M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e.prototype.add=function(t,e){},e}(I),x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e.prototype.record=function(t,e){},e}(I),j=function(){function t(){}return t.prototype.addCallback=function(t){},t.prototype.removeCallback=function(t){},t}(),U=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e}(j),Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e}(j),H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e}(j),F=new N,B=new D,z=new x,V=new M,G=new U,X=new Z,q=new H,W={get:function(t,e){if(null!=t)return t[e]},keys:function(t){return null==t?[]:Object.keys(t)}},Y={set:function(t,e,n){null!=t&&(t[e]=n)}},K=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(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))},Q=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,$([n],K(r),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),J=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},tt=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))},et="context",nt=new Q,rt=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return c(et,t,T.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,tt([t,e,n],J(o),!1))},t.prototype.bind=function(t,e){return this._getContextManager().bind(t,e)},t.prototype._getContextManager=function(){return l(et)||nt},t.prototype.disable=function(){this._getContextManager().disable(),p(et,T.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(L||(L={}));var ot="0000000000000000",it="00000000000000000000000000000000",at={traceId:it,spanId:ot,traceFlags:L.NONE},st=function(){function t(t){void 0===t&&(t=at),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.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}(),ut=R("OpenTelemetry Context Key SPAN");function ct(t){return t.getValue(ut)||void 0}function lt(){return ct(rt.getInstance().active())}function pt(t,e){return t.setValue(ut,e)}function ft(t){return t.deleteValue(ut)}function ht(t,e){return pt(t,new st(e))}function dt(t){var e;return null===(e=ct(t))||void 0===e?void 0:e.spanContext()}var _t=/^([0-9a-f]{32})$/i,vt=/^[0-9a-f]{16}$/i;function yt(t){return _t.test(t)&&t!==it}function Et(t){return yt(t.traceId)&&(e=t.spanId,vt.test(e)&&e!==ot);var e}function Tt(t){return new st(t)}var gt=rt.getInstance(),mt=function(){function t(){}return t.prototype.startSpan=function(t,e,n){if(Boolean(null==e?void 0:e.root))return new st;var r,o=n&&dt(n);return"object"==typeof(r=o)&&"string"==typeof r.spanId&&"string"==typeof r.traceId&&"number"==typeof r.traceFlags&&Et(o)?new st(o):new st},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:gt.active(),u=this.startSpan(t,o,s),c=pt(s,u);return gt.with(c,a,void 0,u)}},t}();var St,bt,Ot,wt=new mt,Rt=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):wt},t}(),Pt=new(function(){function t(){}return t.prototype.getTracer=function(t,e,n){return new mt},t}()),Lt=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 Rt(this,t,e,n)},t.prototype.getDelegate=function(){var t;return null!==(t=this._delegate)&&void 0!==t?t:Pt},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"}(St||(St={})),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"}(bt||(bt={})),function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"}(Ot||(Ot={}));var At=rt.getInstance(),Ct=T.instance(),kt=new(function(){function t(){}return t.prototype.getMeter=function(t,e,n){return F},t}()),Nt="metrics",It=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(t){return c(Nt,t,T.instance())},t.prototype.getMeterProvider=function(){return l(Nt)||kt},t.prototype.getMeter=function(t,e,n){return this.getMeterProvider().getMeter(t,e,n)},t.prototype.disable=function(){p(Nt,T.instance())},t}().getInstance(),Dt=function(){function t(){}return t.prototype.inject=function(t,e){},t.prototype.extract=function(t,e){return t},t.prototype.fields=function(){return[]},t}(),Mt=R("OpenTelemetry Baggage Key");function xt(t){return t.getValue(Mt)||void 0}function jt(t,e){return t.setValue(Mt,e)}function Ut(t){return t.deleteValue(Mt)}var Zt="propagation",Ht=new Dt,Ft=function(){function t(){this.createBaggage=w,this.getBaggage=xt,this.setBaggage=jt,this.deleteBaggage=Ut}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(t){return c(Zt,t,T.instance())},t.prototype.inject=function(t,e,n){return void 0===n&&(n=Y),this._getGlobalPropagator().inject(t,e,n)},t.prototype.extract=function(t,e,n){return void 0===n&&(n=W),this._getGlobalPropagator().extract(t,e,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){p(Zt,T.instance())},t.prototype._getGlobalPropagator=function(){return l(Zt)||Ht},t}(),Bt=Ft.getInstance(),zt="trace",Vt=function(){function t(){this._proxyTracerProvider=new Lt,this.wrapSpanContext=Tt,this.isSpanContextValid=Et,this.deleteSpan=ft,this.getSpan=ct,this.getActiveSpan=lt,this.getSpanContext=dt,this.setSpan=pt,this.setSpanContext=ht}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=c(zt,this._proxyTracerProvider,T.instance());return e&&this._proxyTracerProvider.setDelegate(t),e},t.prototype.getTracerProvider=function(){return l(zt)||this._proxyTracerProvider},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){p(zt,T.instance()),this._proxyTracerProvider=new Lt},t}().getInstance(),Gt=R("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Xt(t){return!0===t.getValue(Gt)}var qt="baggage",Wt=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 Yt(t){var e=t.split(";");if(!(e.length<=0)){var n=e.shift();if(n){var r=n.split("=");if(2===r.length){var o,i,a=decodeURIComponent(r[0].trim()),s=decodeURIComponent(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__:b,toString:function(){return i}}),{key:a,value:s,metadata:o}}}}}var Kt=function(){function t(){}return t.prototype.inject=function(t,e,n){var r=Bt.getBaggage(t);if(r&&!Xt(t)){var o=function(t){return t.getAllEntries().map((function(t){var e=Wt(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,qt,i)}},t.prototype.extract=function(t,e,n){var r=n.get(e,qt),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=Yt(t);if(e){var n={value:e.value};e.metadata&&(n.metadata=e.metadata),i[e.key]=n}})),0===Object.entries(i).length?t:Bt.setBaggage(t,Bt.createBaggage(i)))},t.prototype.fields=function(){return[qt]},t}(),$t=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.")},Qt=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 Jt(t){var e,n,r={};if("object"!=typeof t||null==t)return r;try{for(var o=$t(Object.entries(t)),i=o.next();!i.done;i=o.next()){var a=Qt(i.value,2),s=a[0],u=a[1];te(s)?ee(u)?Array.isArray(u)?r[s]=u.slice():r[s]=u:Ct.warn("Invalid attribute value set for key: "+s):Ct.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 te(t){return"string"==typeof t&&t.length>0}function ee(t){return null==t||(Array.isArray(t)?function(t){var e,n,r;try{for(var o=$t(t),i=o.next();!i.done;i=o.next()){var a=i.value;if(null!=a){if(!r){if(ne(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):ne(t))}function ne(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var re,oe=function(t){Ct.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 ie(t){try{oe(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"}(re||(re={}));var ae="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},se=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];function ue(t){return se.indexOf(t)>-1}var ce=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS"];function le(t){return ce.indexOf(t)>-1}var pe=1/0,fe={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_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_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_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:pe,OTEL_ATTRIBUTE_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:pe,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:128,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_TRACES_EXPORTER:"otlp",OTEL_TRACES_SAMPLER:re.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_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_METRICS_TEMPORALITY_PREFERENCE:"cumulative"};function he(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 de(t,e,n,r){void 0===r&&(r=",");var o=n[t];"string"==typeof o&&(e[t]=o.split(r).map((function(t){return t.trim()})))}var _e={ALL:f.ALL,VERBOSE:f.VERBOSE,DEBUG:f.DEBUG,INFO:f.INFO,WARN:f.WARN,ERROR:f.ERROR,NONE:f.NONE};function ve(t,e,n){var r=n[t];if("string"==typeof r){var o=_e[r.toUpperCase()];null!=o&&(e[t]=o)}}function ye(t){var e={};for(var n in fe){var r=n;if("OTEL_LOG_LEVEL"===r)ve(r,e,t);else if(ue(r))he(r,e,t);else if(le(r))de(r,e,t);else{var o=t[r];null!=o&&(e[r]=String(o))}}return e}function Ee(){var t=ye(ae);return Object.assign({},fe,t)}function Te(t){for(var e=t.length,n="",r=0;r<e;r+=2){var o=t.substring(r,r+2),i=parseInt(o,16);n+=String.fromCharCode(i)}return btoa(n)}var ge,me=performance,Se="exception.type",be="exception.message",Oe="exception.stacktrace",we="http.method",Re="http.url",Pe="http.host",Le="http.scheme",Ae="http.status_code",Ce="http.user_agent",ke="http.response_content_length",Ne="http.response_content_length_uncompressed",Ie="process.runtime.name",De="service.name",Me="service.version",xe="telemetry.sdk.name",je="telemetry.sdk.language",Ue="telemetry.sdk.version",Ze=((ge={})[xe]="opentelemetry",ge[Ie]="browser",ge[je]="webjs",ge[Ue]="1.8.0",ge);var He,Fe=Math.pow(10,9);function Be(t){var e=t/1e3,n=Math.trunc(e);return[n,Number((e-n).toFixed(9))*Fe]}function ze(){var t=me.timeOrigin;if("number"!=typeof t){var e=me;t=e.timing&&e.timing.fetchStart}return t}function Ve(t){var e=Be(ze()),n=Be("number"==typeof t?t:me.now()),r=e[0]+n[0],o=e[1]+n[1];return o>Fe&&(o-=Fe,r+=1),[r,o]}function Ge(t){if(qe(t))return t;if("number"==typeof t)return t<ze()?Ve(t):Be(t);if(t instanceof Date)return Be(t.getTime());throw TypeError("Invalid input type")}function Xe(t){return t[0]*Fe+t[1]}function qe(t){return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(He||(He={}));var We=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.")},Ye=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=We(this._propagators),a=i.next();!a.done;a=i.next()){var s=a.value;try{s.inject(t,e,n)}catch(t){Ct.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){Ct.warn("Failed to inject with "+r.constructor.name+". Err: "+t.message)}return t}),t)},t.prototype.fields=function(){return this._fields.slice()},t}(),Ke="[_0-9a-z-*/]",$e=new RegExp("^(?:"+("[a-z]"+Ke+"{0,255}")+"|"+("[a-z0-9]"+Ke+"{0,240}@[a-z]"+Ke+"{0,13}")+")$"),Qe=/^[ -~]{0,255}[!-~]$/,Je=/,|=/;var tn=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 $e.test(t)})(o)&&function(t){return Qe.test(t)&&!Je.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}(),en="traceparent",nn="tracestate",rn=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");var on,an,sn=function(){function t(){}return t.prototype.inject=function(t,e,n){var r=Vt.getSpanContext(t);if(r&&!Xt(t)&&Et(r)){var o="00-"+r.traceId+"-"+r.spanId+"-0"+Number(r.traceFlags||L.NONE).toString(16);n.set(e,en,o),r.traceState&&n.set(e,nn,r.traceState.serialize())}},t.prototype.extract=function(t,e,n){var r=n.get(e,en);if(!r)return t;var o=Array.isArray(r)?r[0]:r;if("string"!=typeof o)return t;var i=function(t){var e=rn.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,nn);if(a){var s=Array.isArray(a)?a.join(","):a;i.traceState=new tn("string"==typeof s?s:void 0)}return Vt.setSpanContext(t,i)},t.prototype.fields=function(){return[en,nn]},t}(),un="[object Null]",cn="[object Undefined]",ln=Function.prototype.toString,pn=ln.call(Object),fn=(on=Object.getPrototypeOf,an=Object,function(t){return on(an(t))}),hn=Object.prototype,dn=hn.hasOwnProperty,_n=Symbol?Symbol.toStringTag:void 0,vn=hn.toString;function yn(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||"[object Object]"!==function(t){if(null==t)return void 0===t?cn:un;return _n&&_n in Object(t)?function(t){var e=dn.call(t,_n),n=t[_n],r=!1;try{t[_n]=void 0,r=!0}catch(t){}var o=vn.call(t);r&&(e?t[_n]=n:delete t[_n]);return o}(t):function(t){return vn.call(t)}(t)}(t))return!1;var e=fn(t);if(null===e)return!0;var n=dn.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ln.call(n)===pn}function En(t){return mn(t)?t.slice():t}function Tn(t,e,n,r){var o;if(void 0===n&&(n=0),!(n>20)){if(n++,On(t)||On(e)||Sn(e))o=En(e);else if(mn(t)){if(o=t.slice(),mn(e))for(var i=0,a=e.length;i<a;i++)o.push(En(e[i]));else if(bn(e))for(i=0,a=(s=Object.keys(e)).length;i<a;i++){o[u=s[i]]=En(e[u])}}else if(bn(t))if(bn(e)){if(!function(t,e){if(!yn(t)||!yn(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(On(c))void 0===c?delete o[u]:o[u]=c;else{var l=o[u],p=c;if(gn(t,u,r)||gn(e,u,r))delete o[u];else{if(bn(l)&&bn(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]=Tn(o[u],c,n,r)}}}}else o=e;return o}}function gn(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 mn(t){return Array.isArray(t)}function Sn(t){return"function"==typeof t}function bn(t){return!On(t)&&!mn(t)&&!Sn(t)&&"object"==typeof t}function On(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}var wn=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 Rn(t,e){return"string"==typeof e?t===e:!!t.match(e)}function Pn(t,e){var n,r;if(!e)return!1;try{for(var o=wn(e),i=o.next();!i.done;i=o.next()){if(Rn(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 Ln=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}(),An=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},Cn=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))},kn=function(){function t(t,e){this._callback=t,this._that=e,this._isCalled=!1,this._deferred=new Ln}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,Cn([this._that],An(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}(),Nn=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 In(t){return Object.keys(t).map((function(e){return Dn(e,t[e])}))}function Dn(t,e){return{key:t,value:Mn(e)}}function Mn(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(Mn)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((function(t){var e=Nn(t,2);return Dn(e[0],e[1])}))}}:{}}function xn(t,e){var n=t.spanContext(),r=t.status,o=e?t.parentSpanId:null!=t.parentSpanId?Te(t.parentSpanId):void 0;return{traceId:e?n.traceId:Te(n.traceId),spanId:e?n.spanId:Te(n.spanId),parentSpanId:o,name:t.name,kind:null==t.kind?0:t.kind+1,startTimeUnixNano:Xe(t.startTime),endTimeUnixNano:Xe(t.endTime),attributes:In(t.attributes),droppedAttributesCount:0,events:t.events.map(jn),droppedEventsCount:0,status:{code:r.code,message:r.message},links:t.links.map((function(t){return function(t,e){return{attributes:t.attributes?In(t.attributes):[],spanId:e?t.context.spanId:Te(t.context.spanId),traceId:e?t.context.traceId:Te(t.context.traceId),droppedAttributesCount:0}}(t,e)})),droppedLinksCount:0}}function jn(t){return{attributes:t.attributes?In(t.attributes):[],name:t.name,timeUnixNano:Xe(t.time),droppedAttributesCount:0}}var Un=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.")},Zn=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 Hn(t,e){for(var n=function(t){var e,n,r=new Map;try{for(var o=Un(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),r=[],o=n.entries(),i=o.next();!i.done;){for(var a=Zn(i.value,2),s=a[0],u=[],c=a[1].values(),l=c.next();!l.done;){var p=l.value;if(p.length>0){var f=p[0].instrumentationLibrary,h=f.name,d=f.version,_=f.schemaUrl,v=p.map((function(t){return xn(t,e)}));u.push({scope:{name:h,version:d},spans:v,schemaUrl:_})}l=c.next()}var y={resource:{attributes:In(s.attributes),droppedAttributesCount:0},scopeSpans:u,schemaUrl:void 0};r.push(y),i=o.next()}return r}var Fn=function(){function t(t){this.attributes=t}return t.empty=function(){return t.EMPTY},t.default=function(){var e;return new t(((e={})[De]="unknown_service",e[je]=Ze[je],e[xe]=Ze[xe],e[Ue]=Ze[Ue],e))},t.prototype.merge=function(e){return e&&Object.keys(e.attributes).length?new t(Object.assign({},this.attributes,e.attributes)):this},t.EMPTY=new t({}),t}();class Bn{constructor(t){this.config=t}export(t,e){const n=function(t,e){return{resourceSpans:Hn(t,e)}}(t,!0);this.config.faro.api.pushTraces(n),e({code:He.SUCCESS})}shutdown(){return Promise.resolve(void 0)}}class zn{constructor(t){this.processor=t}forceFlush(){return this.processor.forceFlush()}onStart(t,n){const r=e.faro.metas.value.session;(null==r?void 0:r.id)&&(t.attributes.session_id=r.id),this.processor.onStart(t,n)}onEnd(t){this.processor.onEnd(t)}shutdown(){return this.processor.shutdown()}}var Vn,Gn=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.")},Xn=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},qn=function(){function t(t,e,n,r,o,i,a,s,u){void 0===a&&(a=[]),void 0===u&&(u=me),this.attributes={},this.links=[],this.events=[],this.status={code:Ot.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this._clock=u,this.name=n,this._spanContext=r,this.parentSpanId=i,this.kind=o,this.links=a,this.startTime=Ge(null!=s?s:u.now()),this.resource=t.resource,this.instrumentationLibrary=t.instrumentationLibrary,this._spanLimits=t.getSpanLimits(),this._spanProcessor=t.getActiveSpanProcessor(),this._spanProcessor.onStart(this,e),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(t,e){return null==e||this._isSpanEnded()?this:0===t.length?(Ct.warn("Invalid attribute key: "+t),this):ee(e)?(Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,t)||(this.attributes[t]=this._truncateToSize(e)),this):(Ct.warn("Invalid attribute value set for key: "+t),this)},t.prototype.setAttributes=function(t){var e,n;try{for(var r=Gn(Object.entries(t)),o=r.next();!o.done;o=r.next()){var i=Xn(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 Ct.warn("No events allowed."),this;var r;this.events.length>=this._spanLimits.eventCountLimit&&(Ct.warn("Dropping extra events."),this.events.shift()),(qe(r=e)||"number"==typeof r||r instanceof Date)&&(void 0===n&&(n=e),e=void 0),void 0===n&&(n=this._clock.now());var o=Jt(e);return this.events.push({name:t,attributes:o,time:Ge(n)}),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()?Ct.error("You can only call end() on a span once."):(this._ended=!0,this.endTime=Ge(null!=t?t:this._clock.now()),this._duration=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return r<0&&(n-=1,r+=Fe),[n,r]}(this.startTime,this.endTime),this._duration[0]<0&&(Ct.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._spanProcessor.onEnd(this))},t.prototype.isRecording=function(){return!1===this._ended},t.prototype.recordException=function(t,e){void 0===e&&(e=this._clock.now());var n={};"string"==typeof t?n[be]=t:t&&(t.code?n[Se]=t.code.toString():t.name&&(n[Se]=t.name),t.message&&(n[be]=t.message),t.stack&&(n[Oe]=t.stack)),n[Se]||n[be]?this.addEvent("exception",n,e):Ct.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}),t.prototype._isSpanEnded=function(){return this._ended&&Ct.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?(Ct.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"}(Vn||(Vn={}));var Wn=function(){function t(){}return t.prototype.shouldSample=function(){return{decision:Vn.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t}(),Yn=function(){function t(){}return t.prototype.shouldSample=function(){return{decision:Vn.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t}(),Kn=function(){function t(t){var e,n,r,o;this._root=t.root,this._root||(ie(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Yn),this._remoteParentSampled=null!==(e=t.remoteParentSampled)&&void 0!==e?e:new Yn,this._remoteParentNotSampled=null!==(n=t.remoteParentNotSampled)&&void 0!==n?n:new Wn,this._localParentSampled=null!==(r=t.localParentSampled)&&void 0!==r?r:new Yn,this._localParentNotSampled=null!==(o=t.localParentNotSampled)&&void 0!==o?o:new Wn}return t.prototype.shouldSample=function(t,e,n,r,o,i){var a=Vt.getSpanContext(t);return a&&Et(a)?a.isRemote?a.traceFlags&L.SAMPLED?this._remoteParentSampled.shouldSample(t,e,n,r,o,i):this._remoteParentNotSampled.shouldSample(t,e,n,r,o,i):a.traceFlags&L.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}(),$n=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?Vn.RECORD_AND_SAMPLED:Vn.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}(),Qn=Ee(),Jn=re.AlwaysOn;function tr(){return{sampler:er(Qn),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:Ee().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:Ee().OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:Ee().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:Ee().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:Ee().OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:Ee().OTEL_SPAN_EVENT_COUNT_LIMIT}}}function er(t){switch(void 0===t&&(t=Ee()),t.OTEL_TRACES_SAMPLER){case re.AlwaysOn:return new Yn;case re.AlwaysOff:return new Wn;case re.ParentBasedAlwaysOn:return new Kn({root:new Yn});case re.ParentBasedAlwaysOff:return new Kn({root:new Wn});case re.TraceIdRatio:return new $n(nr(t));case re.ParentBasedTraceIdRatio:return new Kn({root:new $n(nr(t))});default:return Ct.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+Jn+'".'),new Yn}}function nr(t){if(void 0===t.OTEL_TRACES_SAMPLER_ARG||""===t.OTEL_TRACES_SAMPLER_ARG)return Ct.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Ct.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to 1."),1):e<0||e>1?(Ct.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to 1."),1):e}function rr(t){var e,n,r,o,i,a,s,u,c,l,p,f,h=Object.assign({},t.spanLimits),d="undefined"!=typeof process?ye(process.env):ye(ae);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:128,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:pe,Object.assign({},t,{spanLimits:h})}var or=function(){function t(t,e){this._exporter=t,this._finishedSpans=[];var n=Ee();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 kn(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Ct.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||0!=(t.spanContext().traceFlags&L.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){this._finishedSpans.length>=this._maxQueueSize||(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);At.with(function(t){return t.setValue(Gt,!0)}(At.active()),(function(){t._exporter.export(t._finishedSpans.splice(0,t._maxExportBatchSize),(function(t){var o;clearTimeout(r),t.code===He.SUCCESS?e():n(null!==(o=t.error)&&void 0!==o?o:new Error("BatchSpanProcessor: span export failed"))}))}))}))},t.prototype._maybeStartTimer=function(){var t=this;void 0===this._timer&&(this._timer=setTimeout((function(){t._flushOneBatch().then((function(){t._finishedSpans.length>0&&(t._clearTimer(),t._maybeStartTimer())})).catch((function(t){ie(t)}))}),this._scheduledDelayMillis),this._timer)},t.prototype._clearTimer=function(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)},t}(),ir=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)}}(),ar=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.onInit(n),r}return ir(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}(or),sr=function(){this.generateTraceId=cr(16),this.generateSpanId=cr(8)},ur=Array(32);function cr(t){return function(){for(var e=0;e<2*t;e++)ur[e]=Math.floor(16*Math.random())+48,ur[e]>=58&&(ur[e]+=39);return String.fromCharCode.apply(null,ur.slice(0,2*t))}}var lr,pr=function(){function t(t,e,n){this._tracerProvider=n;var r,o,i,a,s=(r=e,o={sampler:er()},i=tr(),(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 sr,this.resource=n.resource,this.instrumentationLibrary=t}return t.prototype.startSpan=function(t,e,n){var r,o;void 0===e&&(e={}),void 0===n&&(n=At.active()),e.root&&(n=Vt.deleteSpan(n));var i=Vt.getSpan(n);if(Xt(n))return Ct.debug("Instrumentation suppressed, returning Noop Span"),Vt.wrapSpanContext(at);var a,s,u,c=null==i?void 0:i.spanContext(),l=this._idGenerator.generateSpanId();c&&Vt.isSpanContextValid(c)?(a=c.traceId,s=c.traceState,u=c.spanId):a=this._idGenerator.generateTraceId();var p=null!==(r=e.kind)&&void 0!==r?r:bt.INTERNAL,f=(null!==(o=e.links)&&void 0!==o?o:[]).map((function(t){return{context:t.context,attributes:Jt(t.attributes)}})),h=Jt(e.attributes),d=this._sampler.shouldSample(n,a,t,p,h,f),_={traceId:a,spanId:l,traceFlags:d.decision===St.RECORD_AND_SAMPLED?L.SAMPLED:L.NONE,traceState:s};if(d.decision===St.NOT_RECORD)return Ct.debug("Recording is off, propagating context in a non-recording span"),Vt.wrapSpanContext(_);var v=new qn(this,n,t,_,p,u,f,e.startTime),y=Jt(Object.assign(h,d.attributes));return v.setAttributes(y),v},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:At.active(),u=this.startSpan(t,o,s),c=Vt.setSpan(s,u);return At.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}(),fr=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.")},hr=function(){function t(t){this._spanProcessors=t}return t.prototype.forceFlush=function(){var t,e,n=[];try{for(var r=fr(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){ie(e||new Error("MultiSpanProcessor: forceFlush failed")),t()}))}))},t.prototype.onStart=function(t,e){var n,r;try{for(var o=fr(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=fr(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=fr(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}(),dr=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"}(lr||(lr={}));var _r,vr,yr=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=Tn(n,t.shift(),0,r);return n}({},tr(),rr(t));this.resource=null!==(e=n.resource)&&void 0!==e?e:Fn.empty(),this.resource=Fn.default().merge(this.resource),this._config=Object.assign({},n,{resource:this.resource});var r=this._buildExporterFromEnv();if(void 0!==r){var o=new ar(r);this.activeSpanProcessor=o}else this.activeSpanProcessor=new dr}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 pr({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 Ct.error("Error while trying to shutdown current span processor",t)})),this._registeredSpanProcessors.push(t),this.activeSpanProcessor=new hr(this._registeredSpanProcessors)},t.prototype.getActiveSpanProcessor=function(){return this.activeSpanProcessor},t.prototype.register=function(t){void 0===t&&(t={}),Vt.setGlobalTracerProvider(this),void 0===t.propagator&&(t.propagator=this._buildPropagatorFromEnv()),t.contextManager&&At.setGlobalContextManager(t.contextManager),t.propagator&&Bt.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=lr.timeout}),t);e.forceFlush().then((function(){clearTimeout(o),r!==lr.timeout&&(r=lr.resolved,n(r))})).catch((function(t){clearTimeout(o),r=lr.error,n(t)}))}))}));return new Promise((function(t,n){Promise.all(e).then((function(e){var r=e.filter((function(t){return t!==lr.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(Ee().OTEL_PROPAGATORS)),n=e.map((function(e){var n=t._getPropagator(e);return n||Ct.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 Ye({propagators:n})},t.prototype._buildExporterFromEnv=function(){var t=Ee().OTEL_TRACES_EXPORTER;if("none"!==t){var e=this._getSpanExporter(t);return e||Ct.error('Exporter "'+t+'" requested through environment variable is unavailable.'),e}},t._registeredPropagators=new Map([["tracecontext",function(){return new sn}],["baggage",function(){return new Kt}]]),t._registeredExporters=new Map,t}(),Er=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},Tr=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))},gr=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,Tr([n],Er(r),!1))}finally{this._currentContext=i}},t}(),mr=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)}}(),Sr=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 mr(e,t),e.prototype.register=function(e){void 0===e&&(e={}),void 0===e.contextManager&&(e.contextManager=new gr),e.contextManager&&e.contextManager.enable(),t.prototype.register.call(this,e)},e}(yr);function br(t,e){return e in t}function Or(t,e,n){if(br(n,e)&&"number"==typeof n[e])return t.addEvent(e,n[e]),t}function wr(t,e){Or(t,_r.FETCH_START,e),Or(t,_r.DOMAIN_LOOKUP_START,e),Or(t,_r.DOMAIN_LOOKUP_END,e),Or(t,_r.CONNECT_START,e),Or(t,_r.SECURE_CONNECTION_START,e),Or(t,_r.CONNECT_END,e),Or(t,_r.REQUEST_START,e),Or(t,_r.RESPONSE_START,e),Or(t,_r.RESPONSE_END,e);var n=e[_r.ENCODED_BODY_SIZE];void 0!==n&&t.setAttribute(ke,n);var r=e[_r.DECODED_BODY_SIZE];void 0!==r&&n!==r&&t.setAttribute(Ne,r)}function Rr(t,e,n,r,o,i){void 0===o&&(o=new WeakSet);var a=Pr(t),s=function(t,e,n,r,o,i){var a=Xe(e),s=Xe(n),u=r.filter((function(e){var n=Xe(Ge(e[_r.FETCH_START])),r=Xe(Ge(e[_r.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[_r.FETCH_START],r=e[_r.FETCH_START];return n>r?1:n<r?-1:0}))}(s);if(a.origin!==location.origin&&u.length>1){var c=u[0],l=function(t,e,n){for(var r,o=Xe(n),i=Xe(Ge(e)),a=t[1],s=t.length,u=1;u<s;u++){var c=t[u],l=Xe(Ge(c[_r.FETCH_START])),p=o-Xe(Ge(c[_r.RESPONSE_END]));l>=i&&(!r||p<r)&&(r=p,a=c)}return a}(u,c[_r.RESPONSE_END],n),p=c[_r.RESPONSE_END];return l[_r.FETCH_START]<p&&(l=c,c=void 0),{corsPreFlightRequest:c,mainRequest:l}}return{mainRequest:s[0]}}function Pr(t){if("function"==typeof URL)return new URL(t,location.href);var e=(vr||(vr=document.createElement("a")),vr);return e.href=t,e}function Lr(t,e){if(t.nodeType===Node.DOCUMENT_NODE)return"/";var n=function(t,e){var n=t.nodeType,r=function(t){if(!t.parentNode)return 0;var e=[t.nodeType];t.nodeType===Node.CDATA_SECTION_NODE&&e.push(Node.TEXT_NODE);var n=Array.from(t.parentNode.childNodes);if(n=n.filter((function(n){var r=n.localName;return e.indexOf(n.nodeType)>=0&&r===t.localName})),n.length>=1)return n.indexOf(t)+1;return 0}(t),o="";if(n===Node.ELEMENT_NODE){var i=t.getAttribute("id");if(e&&i)return'//*[@id="'+i+'"]';o=t.localName}else if(n===Node.TEXT_NODE||n===Node.CDATA_SECTION_NODE)o="text()";else{if(n!==Node.COMMENT_NODE)return"";o="comment()"}if(o&&r>1)return"/"+o+"["+r+"]";return"/"+o}(t,e);if(e&&n.indexOf("@id")>0)return n;var r="";return t.parentNode&&(r+=Lr(t.parentNode,!1)),r+=n}function Ar(t,e){var n=e||[];return("string"==typeof n||n instanceof RegExp)&&(n=[n]),Pr(t).origin===location.origin||n.some((function(e){return Rn(t,e)}))}function Cr(t){void 0===t&&(t=[]);for(var e=[],n=0,r=t.length;n<r;n++){var o=t[n];if(Array.isArray(o)){var i=Cr(o);e=e.concat(i.instrumentations)}else"function"==typeof o?e.push(new o):o.instrumentationName&&e.push(o)}return{instrumentations:e}}function kr(t){var e=Cr(t.instrumentations).instrumentations,n=t.tracerProvider||Vt.getTracerProvider(),r=t.meterProvider||It.getMeterProvider();return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),i.getConfig().enabled||i.enable()}}(e,n,r),function(){!function(t){t.forEach((function(t){return t.disable()}))}(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"}(_r||(_r={}));var Nr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ir(t){return"function"==typeof t}var Dr=console.error.bind(console);function Mr(t,e,n){var r=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}function xr(t){t&&t.logger&&(Ir(t.logger)?Dr=t.logger:Dr("new logger isn't a function, not replacing"))}function jr(t,e,n){if(t&&t[e]){if(!n)return Dr("no wrapper function"),void Dr((new Error).stack);if(Ir(t[e])&&Ir(n)){var r=t[e],o=n(r,e);return Mr(o,"__original",r),Mr(o,"__unwrap",(function(){t[e]===o&&Mr(t,e,r)})),Mr(o,"__wrapped",!0),Mr(t,e,o),o}Dr("original object and wrapper must be functions")}else Dr("no original function "+e+" to wrap")}function Ur(t,e){return t&&t[e]?t[e].__unwrap?t[e].__unwrap():void Dr("no original to unwrap to -- has "+e+" already been unwrapped?"):(Dr("no function to unwrap."),void Dr((new Error).stack))}xr.wrap=jr,xr.massWrap=function(t,e,n){if(!t)return Dr("must provide one or more modules to patch"),void Dr((new Error).stack);Array.isArray(t)||(t=[t]),e&&Array.isArray(e)?t.forEach((function(t){e.forEach((function(e){jr(t,e,n)}))})):Dr("must provide one or more functions to wrap on modules")},xr.unwrap=Ur,xr.massUnwrap=function(t,e){if(!t)return Dr("must provide one or more modules to patch"),void Dr((new Error).stack);Array.isArray(t)||(t=[t]),e&&Array.isArray(e)?t.forEach((function(t){e.forEach((function(e){Ur(t,e)}))})):Dr("must provide one or more functions to unwrap on modules")};var Zr,Hr=xr,Fr=function(){return Fr=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},Fr.apply(this,arguments)},Br=function(){function t(t,e,n){void 0===n&&(n={}),this.instrumentationName=t,this.instrumentationVersion=e,this._wrap=Hr.wrap,this._unwrap=Hr.unwrap,this._massWrap=Hr.massWrap,this._massUnwrap=Hr.massUnwrap,this._config=Fr({enabled:!0},n),this._diag=Ct.createComponentLogger({namespace:t}),this._tracer=Vt.getTracer(t,e),this._meter=It.getMeter(t,e)}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)},t.prototype.getConfig=function(){return this._config},t.prototype.setConfig=function(t){void 0===t&&(t={}),this._config=Object.assign({},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}(),zr=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)}}(),Vr=function(t){function e(e,n,r){void 0===r&&(r={});var o=t.call(this,e,n,r)||this;return o._config.enabled&&o.enable(),o}return zr(e,t),e}(Br);function Gr(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 Xr(t){return"function"==typeof t&&"function"==typeof t.__original&&"function"==typeof t.__unwrap&&!0===t.__wrapped}!function(t){t.COMPONENT="component",t.DOCUMENT_LOAD="documentLoad",t.DOCUMENT_FETCH="documentFetch",t.RESOURCE_FETCH="resourceFetch"}(Zr||(Zr={}));var qr;!function(t){t.FIRST_PAINT="firstPaint",t.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"}(qr||(qr={}));var Wr,Yr={"first-paint":qr.FIRST_PAINT,"first-contentful-paint":qr.FIRST_CONTENTFUL_PAINT},Kr=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)}}(),$r=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,"@opentelemetry/instrumentation-document-load","0.31.0",e)||this;return n.component="document-load",n.version="1",n.moduleName=n.component,n}return Kr(e,t),e.prototype.init=function(){},e.prototype._onDocumentLoaded=function(){var t=this;window.setTimeout((function(){t._collectPerformance()}))},e.prototype._addResourcesSpans=function(t){var e,n,r=this,o=null===(n=(e=me).getEntriesByType)||void 0===n?void 0:n.call(e,"resource");o&&o.forEach((function(e){r._initResourceSpan(e,t)}))},e.prototype._collectPerformance=function(){var t=this,e=Array.from(document.getElementsByTagName("meta")).find((function(t){return t.getAttribute("name")===en})),n=function(){var t,e,n={},r=null===(e=(t=me).getEntriesByType)||void 0===e?void 0:e.call(t,"navigation")[0];if(r)Object.values(_r).forEach((function(t){if(br(r,t)){var e=r[t];"number"==typeof e&&(n[t]=e)}}));else{var o=me.timing;o&&Object.values(_r).forEach((function(t){if(br(o,t)){var e=o[t];"number"==typeof e&&(n[t]=e)}}))}return n}(),r=e&&e.content||"";At.with(Bt.extract(C,{traceparent:r}),(function(){var e=t._startSpan(Zr.DOCUMENT_LOAD,_r.FETCH_START,n);e&&(At.with(Vt.setSpan(At.active(),e),(function(){var e=t._startSpan(Zr.DOCUMENT_FETCH,_r.FETCH_START,n);e&&(e.setAttribute(Re,location.href),At.with(Vt.setSpan(At.active(),e),(function(){wr(e,n),t._endSpan(e,_r.RESPONSE_END,n)})))})),e.setAttribute(Re,location.href),e.setAttribute(Ce,navigator.userAgent),t._addResourcesSpans(e),Or(e,_r.FETCH_START,n),Or(e,_r.UNLOAD_EVENT_START,n),Or(e,_r.UNLOAD_EVENT_END,n),Or(e,_r.DOM_INTERACTIVE,n),Or(e,_r.DOM_CONTENT_LOADED_EVENT_START,n),Or(e,_r.DOM_CONTENT_LOADED_EVENT_END,n),Or(e,_r.DOM_COMPLETE,n),Or(e,_r.LOAD_EVENT_START,n),Or(e,_r.LOAD_EVENT_END,n),function(t){var e,n,r=null===(n=(e=me).getEntriesByType)||void 0===n?void 0:n.call(e,"paint");r&&r.forEach((function(e){var n=e.name,r=e.startTime;br(Yr,n)&&t.addEvent(Yr[n],r)}))}(e),t._endSpan(e,_r.LOAD_EVENT_END,n))}))},e.prototype._endSpan=function(t,e,n){t&&(br(n,e)?t.end(n[e]):t.end())},e.prototype._initResourceSpan=function(t,e){var n=this._startSpan(Zr.RESOURCE_FETCH,_r.FETCH_START,t,e);n&&(n.setAttribute(Re,t.name),wr(n,t),this._endSpan(n,_r.RESPONSE_END,t))},e.prototype._startSpan=function(t,e,n,r){if(br(n,e)&&"number"==typeof n[e]){var o=this.tracer.startSpan(t,{startTime:n[e]},r?Vt.setSpan(At.active(),r):void 0);return o.setAttribute(Zr.COMPONENT,this.component),o}},e.prototype._waitForPageLoad=function(){"complete"===window.document.readyState?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))},e.prototype.enable=function(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()},e.prototype.disable=function(){window.removeEventListener("load",this._onDocumentLoaded)},e}(Vr);!function(t){t.COMPONENT="component",t.HTTP_ERROR_NAME="http.error_name",t.HTTP_STATUS_TEXT="http.status_text"}(Wr||(Wr={}));var Qr,Jr="0.34.0",to=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)}}(),eo=function(t){function e(e){var n=t.call(this,"@opentelemetry/instrumentation-fetch",Jr,e)||this;return n.component="fetch",n.version=Jr,n.moduleName=n.component,n._usedResources=new WeakSet,n._tasksCount=0,n}return to(e,t),e.prototype.init=function(){},e.prototype._getConfig=function(){return this._config},e.prototype._addChildSpan=function(t,e){var n=this.tracer.startSpan("CORS Preflight",{startTime:e[_r.FETCH_START]},Vt.setSpan(At.active(),t));this._getConfig().ignoreNetworkEvents||wr(n,e),n.end(e[_r.RESPONSE_END])},e.prototype._addFinalSpanAttributes=function(t,e){var n=Pr(e.url);t.setAttribute(Ae,e.status),null!=e.statusText&&t.setAttribute(Wr.HTTP_STATUS_TEXT,e.statusText),t.setAttribute(Pe,n.host),t.setAttribute(Le,n.protocol.replace(":","")),t.setAttribute(Ce,navigator.userAgent)},e.prototype._addHeaders=function(t,e){if(!Ar(e,this._getConfig().propagateTraceHeaderCorsUrls)){var n={};return Bt.inject(At.active(),n),void(Object.keys(n).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(t instanceof Request)Bt.inject(At.active(),t.headers,{set:function(t,e,n){return t.set(e,"string"==typeof n?n:String(n))}});else if(t.headers instanceof Headers)Bt.inject(At.active(),t.headers,{set:function(t,e,n){return t.set(e,"string"==typeof n?n:String(n))}});else{n={};Bt.inject(At.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={}),!Pn(t,this._getConfig().ignoreUrls)){var r=(e.method||"GET").toUpperCase(),o="HTTP "+r;return this.tracer.startSpan(o,{kind:bt.CLIENT,attributes:(n={},n[Wr.COMPONENT]=this.moduleName,n[we]=r,n[Re]=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=Rr(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||wr(t,i)}},e.prototype._markResourceAsUsed=function(t){this._usedResources.add(t)},e.prototype._endSpan=function(t,e,n){var r=this,o=Ve();this._addFinalSpanAttributes(t,n),setTimeout((function(){var n;null===(n=e.observer)||void 0===n||n.disconnect(),r._findResourceAndAddNetworkEvents(t,e,o),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=Pr(t[0]instanceof Request?t[0].url: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 At.with(Vt.setSpan(At.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&&Gr((function(){return o(t,e,n)}),(function(t){t&&r._diag.error("applyCustomAttributesOnSpan",t)}),!0)},e.prototype._prepareSpanData=function(t){var e=Ve(),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(){Xr(fetch)&&(this._unwrap(ae,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(ae,"fetch",this._patchConstructor())},e.prototype.disable=function(){this._unwrap(ae,"fetch"),this._usedResources=new WeakSet},e}(Vr);!function(t){t.COMPONENT="component",t.EVENT_TYPE="event_type",t.TARGET_ELEMENT="target_element",t.TARGET_XPATH="target_xpath",t.HTTP_URL="http.url",t.HTTP_USER_AGENT="http.user_agent"}(Qr||(Qr={}));var no="0.32.0",ro=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)}}(),oo=["click"];function io(){return!1}var ao,so=function(t){function e(e){var n,r=t.call(this,"@opentelemetry/instrumentation-user-interaction",no,e)||this;return r.component="user-interaction",r.version=no,r.moduleName=r.component,r._spansData=new WeakMap,r._wrappedListeners=new WeakMap,r._eventsSpanMap=new WeakMap,r._eventNames=new Set(null!==(n=null==e?void 0:e.eventNames)&&void 0!==n?n:oo),r._shouldPreventSpanCreation="function"==typeof(null==e?void 0:e.shouldPreventSpanCreation)?e.shouldPreventSpanCreation:io,r}return ro(e,t),e.prototype.init=function(){},e.prototype._checkForTimeout=function(t,e){var n=this._spansData.get(e);n&&("setTimeout"===t.source?n.hrTimeLastTimeout=Ve():"Promise.then"!==t.source&&"setTimeout"!==t.source&&(n.hrTimeLastTimeout=void 0))},e.prototype._allowEventName=function(t){return this._eventNames.has(t)},e.prototype._createSpan=function(t,e,n){var r;if(t instanceof HTMLElement&&t.getAttribute&&!t.hasAttribute("disabled")&&this._allowEventName(e)){var o=Lr(t,!0);try{var i=this.tracer.startSpan(e,{attributes:(r={},r[Qr.COMPONENT]=this.component,r[Qr.EVENT_TYPE]=e,r[Qr.TARGET_ELEMENT]=t.tagName,r[Qr.TARGET_XPATH]=o,r[Qr.HTTP_URL]=window.location.href,r[Qr.HTTP_USER_AGENT]=navigator.userAgent,r)},n?Vt.setSpan(At.active(),n):void 0);if(!0===this._shouldPreventSpanCreation(e,t,i))return;return this._spansData.set(i,{taskCount:0}),i}catch(t){Ct.error(this.component,t)}}},e.prototype._decrementTask=function(t){var e=this._spansData.get(t);e&&(e.taskCount--,0===e.taskCount&&this._tryToEndSpan(t,e.hrTimeLastTimeout))},e.prototype._getCurrentSpan=function(t){var e=t.get("OT_ZONE_CONTEXT");return e?Vt.getSpan(e):e},e.prototype._incrementTask=function(t){var e=this._spansData.get(t);e&&e.taskCount++},e.prototype.addPatchedListener=function(t,e,n,r){var o=this._wrappedListeners.get(n);o||(o=new Map,this._wrappedListeners.set(n,o));var i=o.get(e);return i||(i=new Map,o.set(e,i)),!i.has(t)&&(i.set(t,r),!0)},e.prototype.removePatchedListener=function(t,e,n){var r=this._wrappedListeners.get(n);if(r){var o=r.get(e);if(o){var i=o.get(t);return i&&(o.delete(t),0===o.size&&(r.delete(e),0===r.size&&this._wrappedListeners.delete(n))),i}}},e.prototype._invokeListener=function(t,e,n){return"function"==typeof t?t.apply(e,n):t.handleEvent(n[0])},e.prototype._patchAddEventListener=function(){var t=this;return function(e){return function(n,r,o){if(!r)return e.call(this,n,r,o);var i=o&&"object"==typeof o&&o.once,a=function(){for(var e,o=this,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];var u=a[0],c=null==u?void 0:u.target;u&&(e=t._eventsSpanMap.get(u)),i&&t.removePatchedListener(this,n,r);var l=t._createSpan(c,n,e);return l?(u&&t._eventsSpanMap.set(u,l),At.with(Vt.setSpan(At.active(),l),(function(){var e=t._invokeListener(r,o,a);return l.end(),e}))):t._invokeListener(r,this,a)};return t.addPatchedListener(this,n,r,a)?e.call(this,n,a,o):void 0}}},e.prototype._patchRemoveEventListener=function(){var t=this;return function(e){return function(n,r,o){var i=t.removePatchedListener(this,n,r);return i?e.call(this,n,i,o):e.call(this,n,r,o)}}},e.prototype._getPatchableEventTargets=function(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]},e.prototype._patchHistoryApi=function(){this._unpatchHistoryApi(),this._wrap(history,"replaceState",this._patchHistoryMethod()),this._wrap(history,"pushState",this._patchHistoryMethod()),this._wrap(history,"back",this._patchHistoryMethod()),this._wrap(history,"forward",this._patchHistoryMethod()),this._wrap(history,"go",this._patchHistoryMethod())},e.prototype._patchHistoryMethod=function(){var t=this;return function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=""+location.pathname+location.hash+location.search,i=e.apply(this,n),a=""+location.pathname+location.hash+location.search;return o!==a&&t._updateInteractionName(a),i}}},e.prototype._unpatchHistoryApi=function(){Xr(history.replaceState)&&this._unwrap(history,"replaceState"),Xr(history.pushState)&&this._unwrap(history,"pushState"),Xr(history.back)&&this._unwrap(history,"back"),Xr(history.forward)&&this._unwrap(history,"forward"),Xr(history.go)&&this._unwrap(history,"go")},e.prototype._updateInteractionName=function(t){var e=Vt.getSpan(At.active());e&&"function"==typeof e.updateName&&e.updateName("Navigation: "+t)},e.prototype._patchZoneCancelTask=function(){var t=this;return function(e){return function(n){var r=Zone.current,o=t._getCurrentSpan(r);return o&&t._shouldCountTask(n,r)&&t._decrementTask(o),e.call(this,n)}}},e.prototype._patchZoneScheduleTask=function(){var t=this;return function(e){return function(n){var r=Zone.current,o=t._getCurrentSpan(r);return o&&t._shouldCountTask(n,r)&&(t._incrementTask(o),t._checkForTimeout(n,o)),e.call(this,n)}}},e.prototype._patchZoneRunTask=function(){var t=this;return function(e){return function(n,r,o){var i,a=Array.isArray(o)&&o[0]instanceof Event?o[0]:void 0,s=null==a?void 0:a.target,u=this;if(s){if(i=t._createSpan(s,n.eventName))return t._incrementTask(i),u.run((function(){try{return At.with(Vt.setSpan(At.active(),i),(function(){var t=Zone.current;return n._zone=t,e.call(t,n,r,o)}))}finally{t._decrementTask(i)}}))}else i=t._getCurrentSpan(u);try{return e.call(u,n,r,o)}finally{i&&t._shouldCountTask(n,u)&&t._decrementTask(i)}}}},e.prototype._shouldCountTask=function(t,e){if(t._zone&&(e=t._zone),!e||!t.data||t.data.isPeriodic)return!1;var n=this._getCurrentSpan(e);return!!n&&(!!this._spansData.get(n)&&("macroTask"===t.type||"microTask"===t.type))},e.prototype._tryToEndSpan=function(t,e){t&&(this._spansData.get(t)&&(t.end(e),this._spansData.delete(t)))},e.prototype.enable=function(){var t=this,e=this.getZoneWithPrototype();(Ct.debug("applying patch to",this.moduleName,this.version,"zone:",!!e),e)?(Xr(e.prototype.runTask)&&(this._unwrap(e.prototype,"runTask"),Ct.debug("removing previous patch from method runTask")),Xr(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,"scheduleTask"),Ct.debug("removing previous patch from method scheduleTask")),Xr(e.prototype.cancelTask)&&(this._unwrap(e.prototype,"cancelTask"),Ct.debug("removing previous patch from method cancelTask")),this._zonePatched=!0,this._wrap(e.prototype,"runTask",this._patchZoneRunTask()),this._wrap(e.prototype,"scheduleTask",this._patchZoneScheduleTask()),this._wrap(e.prototype,"cancelTask",this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach((function(e){Xr(e.addEventListener)&&(t._unwrap(e,"addEventListener"),Ct.debug("removing previous patch from method addEventListener")),Xr(e.removeEventListener)&&(t._unwrap(e,"removeEventListener"),Ct.debug("removing previous patch from method removeEventListener")),t._wrap(e,"addEventListener",t._patchAddEventListener()),t._wrap(e,"removeEventListener",t._patchRemoveEventListener())})));this._patchHistoryApi()},e.prototype.disable=function(){var t=this,e=this.getZoneWithPrototype();(Ct.debug("removing patch from",this.moduleName,this.version,"zone:",!!e),e&&this._zonePatched)?(Xr(e.prototype.runTask)&&this._unwrap(e.prototype,"runTask"),Xr(e.prototype.scheduleTask)&&this._unwrap(e.prototype,"scheduleTask"),Xr(e.prototype.cancelTask)&&this._unwrap(e.prototype,"cancelTask")):this._getPatchableEventTargets().forEach((function(e){Xr(e.addEventListener)&&t._unwrap(e,"addEventListener"),Xr(e.removeEventListener)&&t._unwrap(e,"removeEventListener")}));this._unpatchHistoryApi()},e.prototype.getZoneWithPrototype=function(){return window.Zone},e}(Vr);!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"}(ao||(ao={}));var uo,co="0.34.0";!function(t){t.HTTP_STATUS_TEXT="http.status_text"}(uo||(uo={}));var lo=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)}}(),po=function(t){function e(e){var n=t.call(this,"@opentelemetry/instrumentation-xml-http-request",co,e)||this;return n.component="xml-http-request",n.version=co,n.moduleName=n.component,n._tasksCount=0,n._xhrMem=new WeakMap,n._usedResources=new WeakSet,n}return lo(e,t),e.prototype.init=function(){},e.prototype._getConfig=function(){return this._config},e.prototype._addHeaders=function(t,e){if(!Ar(Pr(e).href,this._getConfig().propagateTraceHeaderCorsUrls)){var n={};return Bt.inject(At.active(),n),void(Object.keys(n).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}var r={};Bt.inject(At.active(),r),Object.keys(r).forEach((function(e){t.setRequestHeader(e,String(r[e]))}))},e.prototype._addChildSpan=function(t,e){var n=this;At.with(Vt.setSpan(At.active(),t),(function(){var t=n.tracer.startSpan("CORS Preflight",{startTime:e[_r.FETCH_START]});wr(t,e),t.end(e[_r.RESPONSE_END])}))},e.prototype._addFinalSpanAttributes=function(t,e,n){if("string"==typeof n){var r=Pr(n);void 0!==e.status&&t.setAttribute(Ae,e.status),void 0!==e.statusText&&t.setAttribute(uo.HTTP_STATUS_TEXT,e.statusText),t.setAttribute(Pe,r.host),t.setAttribute(Le,r.protocol.replace(":","")),t.setAttribute(Ce,navigator.userAgent)}},e.prototype._applyAttributesAfterXHR=function(t,e){var n=this,r=this._getConfig().applyCustomAttributesOnSpan;"function"==typeof r&&Gr((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=Pr(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&&(me.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=me.getEntriesByType("resource"));var a=Rr(Pr(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)),wr(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(!Pn(e,this._getConfig().ignoreUrls)){var o="HTTP "+n.toUpperCase(),i=this.tracer.startSpan(o,{kind:bt.CLIENT,attributes:(r={},r[we]=n,r[Re]=e,r)});return i.addEvent(ao.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=Ve();setTimeout((function(){!function(e,n,r){var o=n.callbackToRemoveEvents;"function"==typeof o&&o();var i=n.span,a=n.spanUrl,s=n.sendStartTime;i&&(t._findResourceAndAddNetworkEvents(n,i,a,s,r),i.addEvent(e,r),t._addFinalSpanAttributes(i,n,a),i.end(r),t._tasksCount--),t._clearResources()}(e,r,o)}),300)}}function n(){e(ao.EVENT_ERROR,this)}function r(){e(ao.EVENT_ABORT,this)}function o(){e(ao.EVENT_TIMEOUT,this)}function i(){this.status<299?e(ao.EVENT_LOAD,this):e(ao.EVENT_ERROR,this)}function a(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)}return function(e){return function(){for(var s=this,u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];var l=t._xhrMem.get(this);if(!l)return e.apply(this,u);var p=l.span,f=l.spanUrl;return p&&f&&At.with(Vt.setSpan(At.active(),p),(function(){t._tasksCount++,l.sendStartTime=Ve(),p.addEvent(ao.METHOD_SEND),s.addEventListener("abort",r),s.addEventListener("error",n),s.addEventListener("load",i),s.addEventListener("timeout",o),l.callbackToRemoveEvents=function(){a(s),l.createdResources&&l.createdResources.observer.disconnect()},t._addHeaders(s,f),t._addResourceObserver(s,f)})),e.apply(this,u)}}},e.prototype.enable=function(){this._diag.debug("applying patch to",this.moduleName,this.version),Xr(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),Xr(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}(Vr);function fo(t=[]){return[new $r,new eo({ignoreUrls:t}),new po({ignoreUrls:t}),new so]}var ho="OT_ZONE_CONTEXT",_o=function(){function t(){this._enabled=!1,this._zoneCounter=0}return t.prototype._activeContextFromZone=function(t){return t&&t.get(ho)||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[ho]=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(),a=this._createZone(i,t);return a.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.4.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: All API registration versions must match");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},_=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))},d=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,_([],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 y=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},g=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))},E=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,g([],y(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 d(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.")},S=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}(),b=Symbol("BaggageEntryMetadata"),O=E.instance();function w(t){return void 0===t&&(t={}),new S(new Map(Object.entries(t)))}function R(t){return Symbol.for(t)}var P,L,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)}),N=function(){function t(){}return t.prototype.createHistogram=function(t,e){return z},t.prototype.createCounter=function(t,e){return B},t.prototype.createUpDownCounter=function(t,e){return V},t.prototype.createObservableGauge=function(t,e){return X},t.prototype.createObservableCounter=function(t,e){return G},t.prototype.createObservableUpDownCounter=function(t,e){return q},t.prototype.addBatchObservableCallback=function(t,e){},t.prototype.removeBatchObservableCallback=function(t){},t}(),I=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}(I),M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e.prototype.add=function(t,e){},e}(I),x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e.prototype.record=function(t,e){},e}(I),j=function(){function t(){}return t.prototype.addCallback=function(t){},t.prototype.removeCallback=function(t){},t}(),U=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e}(j),Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e}(j),H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e}(j),F=new N,B=new D,z=new x,V=new M,G=new U,X=new Z,q=new H,W={get:function(t,e){if(null!=t)return t[e]},keys:function(t){return null==t?[]:Object.keys(t)}},Y={set:function(t,e,n){null!=t&&(t[e]=n)}},K=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(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))},Q=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,$([n],K(r),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),J=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},tt=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))},et="context",nt=new Q,rt=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return c(et,t,E.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,tt([t,e,n],J(o),!1))},t.prototype.bind=function(t,e){return this._getContextManager().bind(t,e)},t.prototype._getContextManager=function(){return l(et)||nt},t.prototype.disable=function(){this._getContextManager().disable(),p(et,E.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(L||(L={}));var ot="0000000000000000",it="00000000000000000000000000000000",at={traceId:it,spanId:ot,traceFlags:L.NONE},st=function(){function t(t){void 0===t&&(t=at),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.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}(),ut=R("OpenTelemetry Context Key SPAN");function ct(t){return t.getValue(ut)||void 0}function lt(){return ct(rt.getInstance().active())}function pt(t,e){return t.setValue(ut,e)}function ft(t){return t.deleteValue(ut)}function ht(t,e){return pt(t,new st(e))}function _t(t){var e;return null===(e=ct(t))||void 0===e?void 0:e.spanContext()}var dt=/^([0-9a-f]{32})$/i,vt=/^[0-9a-f]{16}$/i;function yt(t){return dt.test(t)&&t!==it}function gt(t){return yt(t.traceId)&&(e=t.spanId,vt.test(e)&&e!==ot);var e}function Et(t){return new st(t)}var Tt=rt.getInstance(),mt=function(){function t(){}return t.prototype.startSpan=function(t,e,n){if(void 0===n&&(n=Tt.active()),Boolean(null==e?void 0:e.root))return new st;var r,o=n&&_t(n);return"object"==typeof(r=o)&&"string"==typeof r.spanId&&"string"==typeof r.traceId&&"number"==typeof r.traceFlags&&gt(o)?new st(o):new st},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:Tt.active(),u=this.startSpan(t,o,s),c=pt(s,u);return Tt.with(c,a,void 0,u)}},t}();var St,bt,Ot,wt=new mt,Rt=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):wt},t}(),Pt=new(function(){function t(){}return t.prototype.getTracer=function(t,e,n){return new mt},t}()),Lt=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 Rt(this,t,e,n)},t.prototype.getDelegate=function(){var t;return null!==(t=this._delegate)&&void 0!==t?t:Pt},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"}(St||(St={})),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"}(bt||(bt={})),function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"}(Ot||(Ot={}));var At=rt.getInstance(),Ct=E.instance(),kt=new(function(){function t(){}return t.prototype.getMeter=function(t,e,n){return F},t}()),Nt="metrics",It=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(t){return c(Nt,t,E.instance())},t.prototype.getMeterProvider=function(){return l(Nt)||kt},t.prototype.getMeter=function(t,e,n){return this.getMeterProvider().getMeter(t,e,n)},t.prototype.disable=function(){p(Nt,E.instance())},t}().getInstance(),Dt=function(){function t(){}return t.prototype.inject=function(t,e){},t.prototype.extract=function(t,e){return t},t.prototype.fields=function(){return[]},t}(),Mt=R("OpenTelemetry Baggage Key");function xt(t){return t.getValue(Mt)||void 0}function jt(){return xt(rt.getInstance().active())}function Ut(t,e){return t.setValue(Mt,e)}function Zt(t){return t.deleteValue(Mt)}var Ht="propagation",Ft=new Dt,Bt=function(){function t(){this.createBaggage=w,this.getBaggage=xt,this.getActiveBaggage=jt,this.setBaggage=Ut,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,E.instance())},t.prototype.inject=function(t,e,n){return void 0===n&&(n=Y),this._getGlobalPropagator().inject(t,e,n)},t.prototype.extract=function(t,e,n){return void 0===n&&(n=W),this._getGlobalPropagator().extract(t,e,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){p(Ht,E.instance())},t.prototype._getGlobalPropagator=function(){return l(Ht)||Ft},t}(),zt=Bt.getInstance(),Vt="trace",Gt=function(){function t(){this._proxyTracerProvider=new Lt,this.wrapSpanContext=Et,this.isSpanContextValid=gt,this.deleteSpan=ft,this.getSpan=ct,this.getActiveSpan=lt,this.getSpanContext=_t,this.setSpan=pt,this.setSpanContext=ht}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=c(Vt,this._proxyTracerProvider,E.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,E.instance()),this._proxyTracerProvider=new Lt},t}().getInstance(),Xt=R("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function qt(t){return!0===t.getValue(Xt)}var Wt="baggage",Yt=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 Kt(t){var e=t.split(";");if(!(e.length<=0)){var n=e.shift();if(n){var r=n.split("=");if(2===r.length){var o,i,a=decodeURIComponent(r[0].trim()),s=decodeURIComponent(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__:b,toString:function(){return i}}),{key:a,value:s,metadata:o}}}}}var $t=function(){function t(){}return t.prototype.inject=function(t,e,n){var r=zt.getBaggage(t);if(r&&!qt(t)){var o=function(t){return t.getAllEntries().map((function(t){var e=Yt(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,Wt,i)}},t.prototype.extract=function(t,e,n){var r=n.get(e,Wt),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=Kt(t);if(e){var n={value:e.value};e.metadata&&(n.metadata=e.metadata),i[e.key]=n}})),0===Object.entries(i).length?t:zt.setBaggage(t,zt.createBaggage(i)))},t.prototype.fields=function(){return[Wt]},t}(),Qt=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.")},Jt=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 te(t){var e,n,r={};if("object"!=typeof t||null==t)return r;try{for(var o=Qt(Object.entries(t)),i=o.next();!i.done;i=o.next()){var a=Jt(i.value,2),s=a[0],u=a[1];ee(s)?ne(u)?Array.isArray(u)?r[s]=u.slice():r[s]=u:Ct.warn("Invalid attribute value set for key: "+s):Ct.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 ee(t){return"string"==typeof t&&t.length>0}function ne(t){return null==t||(Array.isArray(t)?function(t){var e,n,r;try{for(var o=Qt(t),i=o.next();!i.done;i=o.next()){var a=i.value;if(null!=a){if(!r){if(re(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):re(t))}function re(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var oe,ie=function(t){Ct.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 ae(t){try{ie(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"}(oe||(oe={}));var se="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},ue=["OTEL_SDK_DISABLED"];function ce(t){return ue.indexOf(t)>-1}var le=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];function pe(t){return le.indexOf(t)>-1}var fe=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS"];function he(t){return fe.indexOf(t)>-1}var _e=1/0,de={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_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_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_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:_e,OTEL_ATTRIBUTE_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:_e,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:128,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:oe.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_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_METRICS_TEMPORALITY_PREFERENCE:"cumulative"};function ve(t,e,n){if(void 0!==n[t]){var r=String(n[t]);e[t]="true"===r.toLowerCase()}}function ye(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 ge(t,e,n,r){void 0===r&&(r=",");var o=n[t];"string"==typeof o&&(e[t]=o.split(r).map((function(t){return t.trim()})))}var Ee={ALL:f.ALL,VERBOSE:f.VERBOSE,DEBUG:f.DEBUG,INFO:f.INFO,WARN:f.WARN,ERROR:f.ERROR,NONE:f.NONE};function Te(t,e,n){var r=n[t];if("string"==typeof r){var o=Ee[r.toUpperCase()];null!=o&&(e[t]=o)}}function me(t){var e={};for(var n in de){var r=n;if("OTEL_LOG_LEVEL"===r)Te(r,e,t);else if(ce(r))ve(r,e,t);else if(pe(r))ye(r,e,t);else if(he(r))ge(r,e,t);else{var o=t[r];null!=o&&(e[r]=String(o))}}return e}function Se(){var t=me(se);return Object.assign({},de,t)}function be(t){for(var e=t.length,n="",r=0;r<e;r+=2){var o=t.substring(r,r+2),i=parseInt(o,16);n+=String.fromCharCode(i)}return btoa(n)}var Oe,we=performance,Re="exception.type",Pe="exception.message",Le="exception.stacktrace",Ae="http.method",Ce="http.url",ke="http.host",Ne="http.scheme",Ie="http.status_code",De="http.user_agent",Me="http.response_content_length",xe="http.response_content_length_uncompressed",je="process.runtime.name",Ue="service.name",Ze="service.version",He="telemetry.sdk.name",Fe="telemetry.sdk.language",Be="telemetry.sdk.version",ze=((Oe={})[He]="opentelemetry",Oe[je]="browser",Oe[Fe]="webjs",Oe[Be]="1.9.0",Oe);var Ve,Ge=Math.pow(10,6),Xe=Math.pow(10,9);function qe(t){var e=t/1e3;return[Math.trunc(e),Math.round(t%1e3*Ge)]}function We(){var t=we.timeOrigin;if("number"!=typeof t){var e=we;t=e.timing&&e.timing.fetchStart}return t}function Ye(t){return tn(qe(We()),qe("number"==typeof t?t:we.now()))}function Ke(t){if(Qe(t))return t;if("number"==typeof t)return t<We()?Ye(t):qe(t);if(t instanceof Date)return qe(t.getTime());throw TypeError("Invalid input type")}function $e(t){return t[0]*Xe+t[1]}function Qe(t){return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}function Je(t){return Qe(t)||"number"==typeof t||t instanceof Date}function tn(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"}(Ve||(Ve={}));var en=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.")},nn=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=en(this._propagators),a=i.next();!a.done;a=i.next()){var s=a.value;try{s.inject(t,e,n)}catch(t){Ct.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){Ct.warn("Failed to inject with "+r.constructor.name+". Err: "+t.message)}return t}),t)},t.prototype.fields=function(){return this._fields.slice()},t}(),rn="[_0-9a-z-*/]",on=new RegExp("^(?:"+("[a-z]"+rn+"{0,255}")+"|"+("[a-z0-9]"+rn+"{0,240}@[a-z]"+rn+"{0,13}")+")$"),an=/^[ -~]{0,255}[!-~]$/,sn=/,|=/;var un=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 on.test(t)})(o)&&function(t){return an.test(t)&&!sn.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}(),cn="traceparent",ln="tracestate",pn=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");var fn,hn,_n=function(){function t(){}return t.prototype.inject=function(t,e,n){var r=Gt.getSpanContext(t);if(r&&!qt(t)&&gt(r)){var o="00-"+r.traceId+"-"+r.spanId+"-0"+Number(r.traceFlags||L.NONE).toString(16);n.set(e,cn,o),r.traceState&&n.set(e,ln,r.traceState.serialize())}},t.prototype.extract=function(t,e,n){var r=n.get(e,cn);if(!r)return t;var o=Array.isArray(r)?r[0]:r;if("string"!=typeof o)return t;var i=function(t){var e=pn.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,ln);if(a){var s=Array.isArray(a)?a.join(","):a;i.traceState=new un("string"==typeof s?s:void 0)}return Gt.setSpanContext(t,i)},t.prototype.fields=function(){return[cn,ln]},t}(),dn="[object Null]",vn="[object Undefined]",yn=Function.prototype.toString,gn=yn.call(Object),En=(fn=Object.getPrototypeOf,hn=Object,function(t){return fn(hn(t))}),Tn=Object.prototype,mn=Tn.hasOwnProperty,Sn=Symbol?Symbol.toStringTag:void 0,bn=Tn.toString;function On(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||"[object Object]"!==function(t){if(null==t)return void 0===t?vn:dn;return Sn&&Sn in Object(t)?function(t){var e=mn.call(t,Sn),n=t[Sn],r=!1;try{t[Sn]=void 0,r=!0}catch(t){}var o=bn.call(t);r&&(e?t[Sn]=n:delete t[Sn]);return o}(t):function(t){return bn.call(t)}(t)}(t))return!1;var e=En(t);if(null===e)return!0;var n=mn.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&yn.call(n)===gn}function wn(t){return Ln(t)?t.slice():t}function Rn(t,e,n,r){var o;if(void 0===n&&(n=0),!(n>20)){if(n++,kn(t)||kn(e)||An(e))o=wn(e);else if(Ln(t)){if(o=t.slice(),Ln(e))for(var i=0,a=e.length;i<a;i++)o.push(wn(e[i]));else if(Cn(e))for(i=0,a=(s=Object.keys(e)).length;i<a;i++){o[u=s[i]]=wn(e[u])}}else if(Cn(t))if(Cn(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(kn(c))void 0===c?delete o[u]:o[u]=c;else{var l=o[u],p=c;if(Pn(t,u,r)||Pn(e,u,r))delete o[u];else{if(Cn(l)&&Cn(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]=Rn(o[u],c,n,r)}}}}else o=e;return o}}function Pn(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 Ln(t){return Array.isArray(t)}function An(t){return"function"==typeof t}function Cn(t){return!kn(t)&&!Ln(t)&&!An(t)&&"object"==typeof t}function kn(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 In(t,e){return"string"==typeof e?t===e:!!t.match(e)}function Dn(t,e){var n,r;if(!e)return!1;try{for(var o=Nn(e),i=o.next();!i.done;i=o.next()){if(In(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}(),xn=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},jn=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))},Un=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,jn([this._that],xn(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}(),Zn=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 Hn(t){return Object.keys(t).map((function(e){return Fn(e,t[e])}))}function Fn(t,e){return{key:t,value:Bn(e)}}function Bn(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(Bn)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((function(t){var e=Zn(t,2);return Fn(e[0],e[1])}))}}:{}}function zn(t,e){var n=t.spanContext(),r=t.status,o=e?t.parentSpanId:null!=t.parentSpanId?be(t.parentSpanId):void 0;return{traceId:e?n.traceId:be(n.traceId),spanId:e?n.spanId:be(n.spanId),parentSpanId:o,name:t.name,kind:null==t.kind?0:t.kind+1,startTimeUnixNano:$e(t.startTime),endTimeUnixNano:$e(t.endTime),attributes:Hn(t.attributes),droppedAttributesCount:0,events:t.events.map(Vn),droppedEventsCount:0,status:{code:r.code,message:r.message},links:t.links.map((function(t){return function(t,e){return{attributes:t.attributes?Hn(t.attributes):[],spanId:e?t.context.spanId:be(t.context.spanId),traceId:e?t.context.traceId:be(t.context.traceId),droppedAttributesCount:0}}(t,e)})),droppedLinksCount:0}}function Vn(t){return{attributes:t.attributes?Hn(t.attributes):[],name:t.name,timeUnixNano:$e(t.time),droppedAttributesCount:0}}var Gn=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.")},Xn=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 qn(t,e){for(var n=function(t){var e,n,r=new Map;try{for(var o=Gn(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),r=[],o=n.entries(),i=o.next();!i.done;){for(var a=Xn(i.value,2),s=a[0],u=[],c=a[1].values(),l=c.next();!l.done;){var p=l.value;if(p.length>0){var f=p[0].instrumentationLibrary,h=f.name,_=f.version,d=f.schemaUrl,v=p.map((function(t){return zn(t,e)}));u.push({scope:{name:h,version:_},spans:v,schemaUrl:d})}l=c.next()}var y={resource:{attributes:Hn(s.attributes),droppedAttributesCount:0},scopeSpans:u,schemaUrl:void 0};r.push(y),i=o.next()}return r}var Wn=function(){function t(t){this.attributes=t}return t.empty=function(){return t.EMPTY},t.default=function(){var e;return new t(((e={})[Ue]="unknown_service",e[Fe]=ze[Fe],e[He]=ze[He],e[Be]=ze[Be],e))},t.prototype.merge=function(e){return e&&Object.keys(e.attributes).length?new t(Object.assign({},this.attributes,e.attributes)):this},t.EMPTY=new t({}),t}();class Yn{constructor(t){this.config=t}export(t,e){const n=function(t,e){return{resourceSpans:qn(t,e)}}(t,!0);this.config.api.pushTraces(n),e({code:Ve.SUCCESS})}shutdown(){return Promise.resolve(void 0)}}class Kn{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),this.processor.onStart(t,e)}onEnd(t){this.processor.onEnd(t)}shutdown(){return this.processor.shutdown()}}var $n,Qn=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.")},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},tr=function(){function t(t,e,n,r,o,i,a,s,u){void 0===a&&(a=[]),this.attributes={},this.links=[],this.events=[],this.status={code:Ot.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 c=Date.now();this._performanceStartTime=we.now(),this._performanceOffset=c-(this._performanceStartTime+We()),this._startTimeProvided=null!=s,this.startTime=this._getTime(null!=s?s:c),this.resource=t.resource,this.instrumentationLibrary=t.instrumentationLibrary,this._spanLimits=t.getSpanLimits(),this._spanProcessor=t.getActiveSpanProcessor(),this._spanProcessor.onStart(this,e),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(t,e){return null==e||this._isSpanEnded()?this:0===t.length?(Ct.warn("Invalid attribute key: "+t),this):ne(e)?(Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,t)||(this.attributes[t]=this._truncateToSize(e)),this):(Ct.warn("Invalid attribute value set for key: "+t),this)},t.prototype.setAttributes=function(t){var e,n;try{for(var r=Qn(Object.entries(t)),o=r.next();!o.done;o=r.next()){var i=Jn(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 Ct.warn("No events allowed."),this;this.events.length>=this._spanLimits.eventCountLimit&&(Ct.warn("Dropping extra events."),this.events.shift()),Je(e)&&(Je(n)||(n=e),e=void 0);var r=te(e);return this.events.push({name:t,attributes:r,time:this._getTime(n)}),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()?Ct.error("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&&(Ct.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._spanProcessor.onEnd(this))},t.prototype._getTime=function(t){if("number"==typeof t&&t<we.now())return Ye(t+this._performanceOffset);if("number"==typeof t)return qe(t);if(t instanceof Date)return qe(t.getTime());if(Qe(t))return t;if(this._startTimeProvided)return qe(Date.now());var e=we.now()-this._performanceStartTime;return tn(this.startTime,qe(e))},t.prototype.isRecording=function(){return!1===this._ended},t.prototype.recordException=function(t,e){var n={};"string"==typeof t?n[Pe]=t:t&&(t.code?n[Re]=t.code.toString():t.name&&(n[Re]=t.name),t.message&&(n[Pe]=t.message),t.stack&&(n[Le]=t.stack)),n[Re]||n[Pe]?this.addEvent("exception",n,e):Ct.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}),t.prototype._isSpanEnded=function(){return this._ended&&Ct.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?(Ct.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"}($n||($n={}));var er=function(){function t(){}return t.prototype.shouldSample=function(){return{decision:$n.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t}(),nr=function(){function t(){}return t.prototype.shouldSample=function(){return{decision:$n.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t}(),rr=function(){function t(t){var e,n,r,o;this._root=t.root,this._root||(ae(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new nr),this._remoteParentSampled=null!==(e=t.remoteParentSampled)&&void 0!==e?e:new nr,this._remoteParentNotSampled=null!==(n=t.remoteParentNotSampled)&&void 0!==n?n:new er,this._localParentSampled=null!==(r=t.localParentSampled)&&void 0!==r?r:new nr,this._localParentNotSampled=null!==(o=t.localParentNotSampled)&&void 0!==o?o:new er}return t.prototype.shouldSample=function(t,e,n,r,o,i){var a=Gt.getSpanContext(t);return a&&gt(a)?a.isRemote?a.traceFlags&L.SAMPLED?this._remoteParentSampled.shouldSample(t,e,n,r,o,i):this._remoteParentNotSampled.shouldSample(t,e,n,r,o,i):a.traceFlags&L.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}(),or=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?$n.RECORD_AND_SAMPLED:$n.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}(),ir=Se(),ar=oe.AlwaysOn;function sr(){return{sampler:ur(ir),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:Se().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:Se().OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:Se().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:Se().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:Se().OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:Se().OTEL_SPAN_EVENT_COUNT_LIMIT}}}function ur(t){switch(void 0===t&&(t=Se()),t.OTEL_TRACES_SAMPLER){case oe.AlwaysOn:return new nr;case oe.AlwaysOff:return new er;case oe.ParentBasedAlwaysOn:return new rr({root:new nr});case oe.ParentBasedAlwaysOff:return new rr({root:new er});case oe.TraceIdRatio:return new or(cr(t));case oe.ParentBasedTraceIdRatio:return new rr({root:new or(cr(t))});default:return Ct.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+ar+'".'),new nr}}function cr(t){if(void 0===t.OTEL_TRACES_SAMPLER_ARG||""===t.OTEL_TRACES_SAMPLER_ARG)return Ct.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Ct.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to 1."),1):e<0||e>1?(Ct.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to 1."),1):e}function lr(t){var e,n,r,o,i,a,s,u,c,l,p,f,h=Object.assign({},t.spanLimits),_="undefined"!=typeof process?me(process.env):me(se);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:_.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)&&void 0!==i?i:_.OTEL_ATTRIBUTE_COUNT_LIMIT)&&void 0!==a?a:128,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:_.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)&&void 0!==p?p:_.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)&&void 0!==f?f:_e,Object.assign({},t,{spanLimits:h})}var pr=function(){function t(t,e){this._exporter=t,this._finishedSpans=[];var n=Se();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 Un(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Ct.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||0!=(t.spanContext().traceFlags&L.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){this._finishedSpans.length>=this._maxQueueSize||(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);At.with(function(t){return t.setValue(Xt,!0)}(At.active()),(function(){t._exporter.export(t._finishedSpans.splice(0,t._maxExportBatchSize),(function(t){var o;clearTimeout(r),t.code===Ve.SUCCESS?e():n(null!==(o=t.error)&&void 0!==o?o:new Error("BatchSpanProcessor: span export failed"))}))}))}))},t.prototype._maybeStartTimer=function(){var t=this;void 0===this._timer&&(this._timer=setTimeout((function(){t._flushOneBatch().then((function(){t._finishedSpans.length>0&&(t._clearTimer(),t._maybeStartTimer())})).catch((function(t){ae(t)}))}),this._scheduledDelayMillis),this._timer)},t.prototype._clearTimer=function(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)},t}(),fr=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)}}(),hr=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.onInit(n),r}return fr(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}(pr),_r=function(){this.generateTraceId=vr(16),this.generateSpanId=vr(8)},dr=Array(32);function vr(t){return function(){for(var e=0;e<2*t;e++)dr[e]=Math.floor(16*Math.random())+48,dr[e]>=58&&(dr[e]+=39);return String.fromCharCode.apply(null,dr.slice(0,2*t))}}var yr,gr=function(){function t(t,e,n){this._tracerProvider=n;var r,o,i,a,s=(r=e,o={sampler:ur()},i=sr(),(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 _r,this.resource=n.resource,this.instrumentationLibrary=t}return t.prototype.startSpan=function(t,e,n){var r,o;void 0===e&&(e={}),void 0===n&&(n=At.active()),e.root&&(n=Gt.deleteSpan(n));var i=Gt.getSpan(n);if(qt(n))return Ct.debug("Instrumentation suppressed, returning Noop Span"),Gt.wrapSpanContext(at);var a,s,u,c=null==i?void 0:i.spanContext(),l=this._idGenerator.generateSpanId();c&&Gt.isSpanContextValid(c)?(a=c.traceId,s=c.traceState,u=c.spanId):a=this._idGenerator.generateTraceId();var p=null!==(r=e.kind)&&void 0!==r?r:bt.INTERNAL,f=(null!==(o=e.links)&&void 0!==o?o:[]).map((function(t){return{context:t.context,attributes:te(t.attributes)}})),h=te(e.attributes),_=this._sampler.shouldSample(n,a,t,p,h,f),d={traceId:a,spanId:l,traceFlags:_.decision===St.RECORD_AND_SAMPLED?L.SAMPLED:L.NONE,traceState:s};if(_.decision===St.NOT_RECORD)return Ct.debug("Recording is off, propagating context in a non-recording span"),Gt.wrapSpanContext(d);var v=new tr(this,n,t,d,p,u,f,e.startTime),y=te(Object.assign(h,_.attributes));return v.setAttributes(y),v},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:At.active(),u=this.startSpan(t,o,s),c=Gt.setSpan(s,u);return At.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}(),Er=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(){function t(t){this._spanProcessors=t}return t.prototype.forceFlush=function(){var t,e,n=[];try{for(var r=Er(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){ae(e||new Error("MultiSpanProcessor: forceFlush failed")),t()}))}))},t.prototype.onStart=function(t,e){var n,r;try{for(var o=Er(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=Er(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=Er(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}(),mr=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"}(yr||(yr={}));var Sr,br,Or=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=Rn(n,t.shift(),0,r);return n}({},sr(),lr(t));this.resource=null!==(e=n.resource)&&void 0!==e?e:Wn.empty(),this.resource=Wn.default().merge(this.resource),this._config=Object.assign({},n,{resource:this.resource});var r=this._buildExporterFromEnv();if(void 0!==r){var o=new hr(r);this.activeSpanProcessor=o}else this.activeSpanProcessor=new mr}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 gr({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 Ct.error("Error while trying to shutdown current span processor",t)})),this._registeredSpanProcessors.push(t),this.activeSpanProcessor=new Tr(this._registeredSpanProcessors)},t.prototype.getActiveSpanProcessor=function(){return this.activeSpanProcessor},t.prototype.register=function(t){void 0===t&&(t={}),Gt.setGlobalTracerProvider(this),void 0===t.propagator&&(t.propagator=this._buildPropagatorFromEnv()),t.contextManager&&At.setGlobalContextManager(t.contextManager),t.propagator&&zt.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=yr.timeout}),t);e.forceFlush().then((function(){clearTimeout(o),r!==yr.timeout&&(r=yr.resolved,n(r))})).catch((function(t){clearTimeout(o),r=yr.error,n(t)}))}))}));return new Promise((function(t,n){Promise.all(e).then((function(e){var r=e.filter((function(t){return t!==yr.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(Se().OTEL_PROPAGATORS)),n=e.map((function(e){var n=t._getPropagator(e);return n||Ct.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 nn({propagators:n})},t.prototype._buildExporterFromEnv=function(){var t=Se().OTEL_TRACES_EXPORTER;if("none"!==t&&""!==t){var e=this._getSpanExporter(t);return e||Ct.error('Exporter "'+t+'" requested through environment variable is unavailable.'),e}},t._registeredPropagators=new Map([["tracecontext",function(){return new _n}],["baggage",function(){return new $t}]]),t._registeredExporters=new Map,t}(),wr=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},Rr=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))},Pr=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,Rr([n],wr(r),!1))}finally{this._currentContext=i}},t}(),Lr=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)}}(),Ar=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 Lr(e,t),e.prototype.register=function(e){void 0===e&&(e={}),void 0===e.contextManager&&(e.contextManager=new Pr),e.contextManager&&e.contextManager.enable(),t.prototype.register.call(this,e)},e}(Or);function Cr(t,e){return e in t}function kr(t,e,n){if(Cr(n,e)&&"number"==typeof n[e])return t.addEvent(e,n[e]),t}function Nr(t,e){kr(t,Sr.FETCH_START,e),kr(t,Sr.DOMAIN_LOOKUP_START,e),kr(t,Sr.DOMAIN_LOOKUP_END,e),kr(t,Sr.CONNECT_START,e),kr(t,Sr.SECURE_CONNECTION_START,e),kr(t,Sr.CONNECT_END,e),kr(t,Sr.REQUEST_START,e),kr(t,Sr.RESPONSE_START,e),kr(t,Sr.RESPONSE_END,e);var n=e[Sr.ENCODED_BODY_SIZE];void 0!==n&&t.setAttribute(Me,n);var r=e[Sr.DECODED_BODY_SIZE];void 0!==r&&n!==r&&t.setAttribute(xe,r)}function Ir(t,e,n,r,o,i){void 0===o&&(o=new WeakSet);var a=Dr(t),s=function(t,e,n,r,o,i){var a=$e(e),s=$e(n),u=r.filter((function(e){var n=$e(Ke(e[Sr.FETCH_START])),r=$e(Ke(e[Sr.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[Sr.FETCH_START],r=e[Sr.FETCH_START];return n>r?1:n<r?-1:0}))}(s);if(a.origin!==location.origin&&u.length>1){var c=u[0],l=function(t,e,n){for(var r,o=$e(n),i=$e(Ke(e)),a=t[1],s=t.length,u=1;u<s;u++){var c=t[u],l=$e(Ke(c[Sr.FETCH_START])),p=o-$e(Ke(c[Sr.RESPONSE_END]));l>=i&&(!r||p<r)&&(r=p,a=c)}return a}(u,c[Sr.RESPONSE_END],n),p=c[Sr.RESPONSE_END];return l[Sr.FETCH_START]<p&&(l=c,c=void 0),{corsPreFlightRequest:c,mainRequest:l}}return{mainRequest:s[0]}}function Dr(t){if("function"==typeof URL)return new URL(t,location.href);var e=(br||(br=document.createElement("a")),br);return e.href=t,e}function Mr(t,e){if(t.nodeType===Node.DOCUMENT_NODE)return"/";var n=function(t,e){var n=t.nodeType,r=function(t){if(!t.parentNode)return 0;var e=[t.nodeType];t.nodeType===Node.CDATA_SECTION_NODE&&e.push(Node.TEXT_NODE);var n=Array.from(t.parentNode.childNodes);if(n=n.filter((function(n){var r=n.localName;return e.indexOf(n.nodeType)>=0&&r===t.localName})),n.length>=1)return n.indexOf(t)+1;return 0}(t),o="";if(n===Node.ELEMENT_NODE){var i=t.getAttribute("id");if(e&&i)return'//*[@id="'+i+'"]';o=t.localName}else if(n===Node.TEXT_NODE||n===Node.CDATA_SECTION_NODE)o="text()";else{if(n!==Node.COMMENT_NODE)return"";o="comment()"}if(o&&r>1)return"/"+o+"["+r+"]";return"/"+o}(t,e);if(e&&n.indexOf("@id")>0)return n;var r="";return t.parentNode&&(r+=Mr(t.parentNode,!1)),r+=n}function xr(t,e){var n=e||[];return("string"==typeof n||n instanceof RegExp)&&(n=[n]),Dr(t).origin===location.origin||n.some((function(e){return In(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"}(Sr||(Sr={}));var jr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ur(t){return"function"==typeof t}var Zr=console.error.bind(console);function Hr(t,e,n){var r=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}function Fr(t){t&&t.logger&&(Ur(t.logger)?Zr=t.logger:Zr("new logger isn't a function, not replacing"))}function Br(t,e,n){if(t&&t[e]){if(!n)return Zr("no wrapper function"),void Zr((new Error).stack);if(Ur(t[e])&&Ur(n)){var r=t[e],o=n(r,e);return Hr(o,"__original",r),Hr(o,"__unwrap",(function(){t[e]===o&&Hr(t,e,r)})),Hr(o,"__wrapped",!0),Hr(t,e,o),o}Zr("original object and wrapper must be functions")}else Zr("no original function "+e+" to wrap")}function zr(t,e){return t&&t[e]?t[e].__unwrap?t[e].__unwrap():void Zr("no original to unwrap to -- has "+e+" already been unwrapped?"):(Zr("no function to unwrap."),void Zr((new Error).stack))}Fr.wrap=Br,Fr.massWrap=function(t,e,n){if(!t)return Zr("must provide one or more modules to patch"),void Zr((new Error).stack);Array.isArray(t)||(t=[t]),e&&Array.isArray(e)?t.forEach((function(t){e.forEach((function(e){Br(t,e,n)}))})):Zr("must provide one or more functions to wrap on modules")},Fr.unwrap=zr,Fr.massUnwrap=function(t,e){if(!t)return Zr("must provide one or more modules to patch"),void Zr((new Error).stack);Array.isArray(t)||(t=[t]),e&&Array.isArray(e)?t.forEach((function(t){e.forEach((function(e){zr(t,e)}))})):Zr("must provide one or more functions to unwrap on modules")};var Vr,Gr=Fr,Xr=function(){return Xr=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},Xr.apply(this,arguments)},qr=function(){function t(t,e,n){void 0===n&&(n={}),this.instrumentationName=t,this.instrumentationVersion=e,this._wrap=Gr.wrap,this._unwrap=Gr.unwrap,this._massWrap=Gr.massWrap,this._massUnwrap=Gr.massUnwrap,this._config=Xr({enabled:!0},n),this._diag=Ct.createComponentLogger({namespace:t}),this._tracer=Gt.getTracer(t,e),this._meter=It.getMeter(t,e)}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)},t.prototype.getConfig=function(){return this._config},t.prototype.setConfig=function(t){void 0===t&&(t={}),this._config=Object.assign({},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}(),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)}}(),Yr=function(t){function e(e,n,r){void 0===r&&(r={});var o=t.call(this,e,n,r)||this;return o._config.enabled&&o.enable(),o}return Wr(e,t),e}(qr);!function(t){t.COMPONENT="component",t.DOCUMENT_LOAD="documentLoad",t.DOCUMENT_FETCH="documentFetch",t.RESOURCE_FETCH="resourceFetch"}(Vr||(Vr={}));var Kr;!function(t){t.FIRST_PAINT="firstPaint",t.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"}(Kr||(Kr={}));var $r={"first-paint":Kr.FIRST_PAINT,"first-contentful-paint":Kr.FIRST_CONTENTFUL_PAINT},Qr=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)}}(),Jr=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,"@opentelemetry/instrumentation-document-load","0.31.0",e)||this;return n.component="document-load",n.version="1",n.moduleName=n.component,n}return Qr(e,t),e.prototype.init=function(){},e.prototype._onDocumentLoaded=function(){var t=this;window.setTimeout((function(){t._collectPerformance()}))},e.prototype._addResourcesSpans=function(t){var e,n,r=this,o=null===(n=(e=we).getEntriesByType)||void 0===n?void 0:n.call(e,"resource");o&&o.forEach((function(e){r._initResourceSpan(e,t)}))},e.prototype._collectPerformance=function(){var t=this,e=Array.from(document.getElementsByTagName("meta")).find((function(t){return t.getAttribute("name")===cn})),n=function(){var t,e,n={},r=null===(e=(t=we).getEntriesByType)||void 0===e?void 0:e.call(t,"navigation")[0];if(r)Object.values(Sr).forEach((function(t){if(Cr(r,t)){var e=r[t];"number"==typeof e&&(n[t]=e)}}));else{var o=we.timing;o&&Object.values(Sr).forEach((function(t){if(Cr(o,t)){var e=o[t];"number"==typeof e&&(n[t]=e)}}))}return n}(),r=e&&e.content||"";At.with(zt.extract(C,{traceparent:r}),(function(){var e=t._startSpan(Vr.DOCUMENT_LOAD,Sr.FETCH_START,n);e&&(At.with(Gt.setSpan(At.active(),e),(function(){var e=t._startSpan(Vr.DOCUMENT_FETCH,Sr.FETCH_START,n);e&&(e.setAttribute(Ce,location.href),At.with(Gt.setSpan(At.active(),e),(function(){Nr(e,n),t._endSpan(e,Sr.RESPONSE_END,n)})))})),e.setAttribute(Ce,location.href),e.setAttribute(De,navigator.userAgent),t._addResourcesSpans(e),kr(e,Sr.FETCH_START,n),kr(e,Sr.UNLOAD_EVENT_START,n),kr(e,Sr.UNLOAD_EVENT_END,n),kr(e,Sr.DOM_INTERACTIVE,n),kr(e,Sr.DOM_CONTENT_LOADED_EVENT_START,n),kr(e,Sr.DOM_CONTENT_LOADED_EVENT_END,n),kr(e,Sr.DOM_COMPLETE,n),kr(e,Sr.LOAD_EVENT_START,n),kr(e,Sr.LOAD_EVENT_END,n),function(t){var e,n,r=null===(n=(e=we).getEntriesByType)||void 0===n?void 0:n.call(e,"paint");r&&r.forEach((function(e){var n=e.name,r=e.startTime;Cr($r,n)&&t.addEvent($r[n],r)}))}(e),t._endSpan(e,Sr.LOAD_EVENT_END,n))}))},e.prototype._endSpan=function(t,e,n){t&&(Cr(n,e)?t.end(n[e]):t.end())},e.prototype._initResourceSpan=function(t,e){var n=this._startSpan(Vr.RESOURCE_FETCH,Sr.FETCH_START,t,e);n&&(n.setAttribute(Ce,t.name),Nr(n,t),this._endSpan(n,Sr.RESPONSE_END,t))},e.prototype._startSpan=function(t,e,n,r){if(Cr(n,e)&&"number"==typeof n[e]){var o=this.tracer.startSpan(t,{startTime:n[e]},r?Gt.setSpan(At.active(),r):void 0);return o.setAttribute(Vr.COMPONENT,this.component),o}},e.prototype._waitForPageLoad=function(){"complete"===window.document.readyState?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))},e.prototype.enable=function(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()},e.prototype.disable=function(){window.removeEventListener("load",this._onDocumentLoaded)},e}(Yr);function to(t){void 0===t&&(t=[]);for(var e=[],n=0,r=t.length;n<r;n++){var o=t[n];if(Array.isArray(o)){var i=to(o);e=e.concat(i.instrumentations)}else"function"==typeof o?e.push(new o):o.instrumentationName&&e.push(o)}return{instrumentations:e}}function eo(t){var e=to(t.instrumentations).instrumentations,n=t.tracerProvider||Gt.getTracerProvider(),r=t.meterProvider||It.getMeterProvider();return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),i.getConfig().enabled||i.enable()}}(e,n,r),function(){!function(t){t.forEach((function(t){return t.disable()}))}(e)}}var no,ro=function(){return ro=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},ro.apply(this,arguments)},oo=function(){function t(t,e,n){void 0===n&&(n={}),this.instrumentationName=t,this.instrumentationVersion=e,this._wrap=Gr.wrap,this._unwrap=Gr.unwrap,this._massWrap=Gr.massWrap,this._massUnwrap=Gr.massUnwrap,this._config=ro({enabled:!0},n),this._diag=Ct.createComponentLogger({namespace:t}),this._tracer=Gt.getTracer(t,e),this._meter=It.getMeter(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()},t.prototype._updateMetricInstruments=function(){},t.prototype.getConfig=function(){return this._config},t.prototype.setConfig=function(t){void 0===t&&(t={}),this._config=Object.assign({},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}(),io=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)}}(),ao=function(t){function e(e,n,r){void 0===r&&(r={});var o=t.call(this,e,n,r)||this;return o._config.enabled&&o.enable(),o}return io(e,t),e}(oo);function so(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 uo(t){return"function"==typeof t&&"function"==typeof t.__original&&"function"==typeof t.__unwrap&&!0===t.__wrapped}!function(t){t.COMPONENT="component",t.HTTP_ERROR_NAME="http.error_name",t.HTTP_STATUS_TEXT="http.status_text"}(no||(no={}));var co,lo="0.35.0",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){var n=t.call(this,"@opentelemetry/instrumentation-fetch",lo,e)||this;return n.component="fetch",n.version=lo,n.moduleName=n.component,n._usedResources=new WeakSet,n._tasksCount=0,n}return po(e,t),e.prototype.init=function(){},e.prototype._getConfig=function(){return this._config},e.prototype._addChildSpan=function(t,e){var n=this.tracer.startSpan("CORS Preflight",{startTime:e[Sr.FETCH_START]},Gt.setSpan(At.active(),t));this._getConfig().ignoreNetworkEvents||Nr(n,e),n.end(e[Sr.RESPONSE_END])},e.prototype._addFinalSpanAttributes=function(t,e){var n=Dr(e.url);t.setAttribute(Ie,e.status),null!=e.statusText&&t.setAttribute(no.HTTP_STATUS_TEXT,e.statusText),t.setAttribute(ke,n.host),t.setAttribute(Ne,n.protocol.replace(":","")),t.setAttribute(De,navigator.userAgent)},e.prototype._addHeaders=function(t,e){if(!xr(e,this._getConfig().propagateTraceHeaderCorsUrls)){var n={};return zt.inject(At.active(),n),void(Object.keys(n).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(t instanceof Request)zt.inject(At.active(),t.headers,{set:function(t,e,n){return t.set(e,"string"==typeof n?n:String(n))}});else if(t.headers instanceof Headers)zt.inject(At.active(),t.headers,{set:function(t,e,n){return t.set(e,"string"==typeof n?n:String(n))}});else{n={};zt.inject(At.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={}),!Dn(t,this._getConfig().ignoreUrls)){var r=(e.method||"GET").toUpperCase(),o="HTTP "+r;return this.tracer.startSpan(o,{kind:bt.CLIENT,attributes:(n={},n[no.COMPONENT]=this.moduleName,n[Ae]=r,n[Ce]=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=Ir(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||Nr(t,i)}},e.prototype._markResourceAsUsed=function(t){this._usedResources.add(t)},e.prototype._endSpan=function(t,e,n){var r=this,o=qe(Date.now()),i=Ye();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=Dr(t[0]instanceof Request?t[0].url: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 At.with(Gt.setSpan(At.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&&so((function(){return o(t,e,n)}),(function(t){t&&r._diag.error("applyCustomAttributesOnSpan",t)}),!0)},e.prototype._prepareSpanData=function(t){var e=Ye(),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(){uo(fetch)&&(this._unwrap(se,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(se,"fetch",this._patchConstructor())},e.prototype.disable=function(){this._unwrap(se,"fetch"),this._usedResources=new WeakSet},e}(ao),ho=function(){return ho=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},ho.apply(this,arguments)},_o=function(){function t(t,e,n){void 0===n&&(n={}),this.instrumentationName=t,this.instrumentationVersion=e,this._wrap=Gr.wrap,this._unwrap=Gr.unwrap,this._massWrap=Gr.massWrap,this._massUnwrap=Gr.massUnwrap,this._config=ho({enabled:!0},n),this._diag=Ct.createComponentLogger({namespace:t}),this._tracer=Gt.getTracer(t,e),this._meter=It.getMeter(t,e)}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)},t.prototype.getConfig=function(){return this._config},t.prototype.setConfig=function(t){void 0===t&&(t={}),this._config=Object.assign({},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}(),vo=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)}}(),yo=function(t){function e(e,n,r){void 0===r&&(r={});var o=t.call(this,e,n,r)||this;return o._config.enabled&&o.enable(),o}return vo(e,t),e}(_o);function go(t){return"function"==typeof t&&"function"==typeof t.__original&&"function"==typeof t.__unwrap&&!0===t.__wrapped}!function(t){t.COMPONENT="component",t.EVENT_TYPE="event_type",t.TARGET_ELEMENT="target_element",t.TARGET_XPATH="target_xpath",t.HTTP_URL="http.url",t.HTTP_USER_AGENT="http.user_agent"}(co||(co={}));var Eo="0.32.0",To=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)}}(),mo=["click"];function So(){return!1}var bo,Oo=function(t){function e(e){var n,r=t.call(this,"@opentelemetry/instrumentation-user-interaction",Eo,e)||this;return r.component="user-interaction",r.version=Eo,r.moduleName=r.component,r._spansData=new WeakMap,r._wrappedListeners=new WeakMap,r._eventsSpanMap=new WeakMap,r._eventNames=new Set(null!==(n=null==e?void 0:e.eventNames)&&void 0!==n?n:mo),r._shouldPreventSpanCreation="function"==typeof(null==e?void 0:e.shouldPreventSpanCreation)?e.shouldPreventSpanCreation:So,r}return To(e,t),e.prototype.init=function(){},e.prototype._checkForTimeout=function(t,e){var n=this._spansData.get(e);n&&("setTimeout"===t.source?n.hrTimeLastTimeout=Ye():"Promise.then"!==t.source&&"setTimeout"!==t.source&&(n.hrTimeLastTimeout=void 0))},e.prototype._allowEventName=function(t){return this._eventNames.has(t)},e.prototype._createSpan=function(t,e,n){var r;if(t instanceof HTMLElement&&t.getAttribute&&!t.hasAttribute("disabled")&&this._allowEventName(e)){var o=Mr(t,!0);try{var i=this.tracer.startSpan(e,{attributes:(r={},r[co.COMPONENT]=this.component,r[co.EVENT_TYPE]=e,r[co.TARGET_ELEMENT]=t.tagName,r[co.TARGET_XPATH]=o,r[co.HTTP_URL]=window.location.href,r[co.HTTP_USER_AGENT]=navigator.userAgent,r)},n?Gt.setSpan(At.active(),n):void 0);if(!0===this._shouldPreventSpanCreation(e,t,i))return;return this._spansData.set(i,{taskCount:0}),i}catch(t){Ct.error(this.component,t)}}},e.prototype._decrementTask=function(t){var e=this._spansData.get(t);e&&(e.taskCount--,0===e.taskCount&&this._tryToEndSpan(t,e.hrTimeLastTimeout))},e.prototype._getCurrentSpan=function(t){var e=t.get("OT_ZONE_CONTEXT");return e?Gt.getSpan(e):e},e.prototype._incrementTask=function(t){var e=this._spansData.get(t);e&&e.taskCount++},e.prototype.addPatchedListener=function(t,e,n,r){var o=this._wrappedListeners.get(n);o||(o=new Map,this._wrappedListeners.set(n,o));var i=o.get(e);return i||(i=new Map,o.set(e,i)),!i.has(t)&&(i.set(t,r),!0)},e.prototype.removePatchedListener=function(t,e,n){var r=this._wrappedListeners.get(n);if(r){var o=r.get(e);if(o){var i=o.get(t);return i&&(o.delete(t),0===o.size&&(r.delete(e),0===r.size&&this._wrappedListeners.delete(n))),i}}},e.prototype._invokeListener=function(t,e,n){return"function"==typeof t?t.apply(e,n):t.handleEvent(n[0])},e.prototype._patchAddEventListener=function(){var t=this;return function(e){return function(n,r,o){if(!r)return e.call(this,n,r,o);var i=o&&"object"==typeof o&&o.once,a=function(){for(var e,o=this,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];var u=a[0],c=null==u?void 0:u.target;u&&(e=t._eventsSpanMap.get(u)),i&&t.removePatchedListener(this,n,r);var l=t._createSpan(c,n,e);return l?(u&&t._eventsSpanMap.set(u,l),At.with(Gt.setSpan(At.active(),l),(function(){var e=t._invokeListener(r,o,a);return l.end(),e}))):t._invokeListener(r,this,a)};return t.addPatchedListener(this,n,r,a)?e.call(this,n,a,o):void 0}}},e.prototype._patchRemoveEventListener=function(){var t=this;return function(e){return function(n,r,o){var i=t.removePatchedListener(this,n,r);return i?e.call(this,n,i,o):e.call(this,n,r,o)}}},e.prototype._getPatchableEventTargets=function(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]},e.prototype._patchHistoryApi=function(){this._unpatchHistoryApi(),this._wrap(history,"replaceState",this._patchHistoryMethod()),this._wrap(history,"pushState",this._patchHistoryMethod()),this._wrap(history,"back",this._patchHistoryMethod()),this._wrap(history,"forward",this._patchHistoryMethod()),this._wrap(history,"go",this._patchHistoryMethod())},e.prototype._patchHistoryMethod=function(){var t=this;return function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=""+location.pathname+location.hash+location.search,i=e.apply(this,n),a=""+location.pathname+location.hash+location.search;return o!==a&&t._updateInteractionName(a),i}}},e.prototype._unpatchHistoryApi=function(){go(history.replaceState)&&this._unwrap(history,"replaceState"),go(history.pushState)&&this._unwrap(history,"pushState"),go(history.back)&&this._unwrap(history,"back"),go(history.forward)&&this._unwrap(history,"forward"),go(history.go)&&this._unwrap(history,"go")},e.prototype._updateInteractionName=function(t){var e=Gt.getSpan(At.active());e&&"function"==typeof e.updateName&&e.updateName("Navigation: "+t)},e.prototype._patchZoneCancelTask=function(){var t=this;return function(e){return function(n){var r=Zone.current,o=t._getCurrentSpan(r);return o&&t._shouldCountTask(n,r)&&t._decrementTask(o),e.call(this,n)}}},e.prototype._patchZoneScheduleTask=function(){var t=this;return function(e){return function(n){var r=Zone.current,o=t._getCurrentSpan(r);return o&&t._shouldCountTask(n,r)&&(t._incrementTask(o),t._checkForTimeout(n,o)),e.call(this,n)}}},e.prototype._patchZoneRunTask=function(){var t=this;return function(e){return function(n,r,o){var i,a=Array.isArray(o)&&o[0]instanceof Event?o[0]:void 0,s=null==a?void 0:a.target,u=this;if(s){if(i=t._createSpan(s,n.eventName))return t._incrementTask(i),u.run((function(){try{return At.with(Gt.setSpan(At.active(),i),(function(){var t=Zone.current;return n._zone=t,e.call(t,n,r,o)}))}finally{t._decrementTask(i)}}))}else i=t._getCurrentSpan(u);try{return e.call(u,n,r,o)}finally{i&&t._shouldCountTask(n,u)&&t._decrementTask(i)}}}},e.prototype._shouldCountTask=function(t,e){if(t._zone&&(e=t._zone),!e||!t.data||t.data.isPeriodic)return!1;var n=this._getCurrentSpan(e);return!!n&&(!!this._spansData.get(n)&&("macroTask"===t.type||"microTask"===t.type))},e.prototype._tryToEndSpan=function(t,e){t&&(this._spansData.get(t)&&(t.end(e),this._spansData.delete(t)))},e.prototype.enable=function(){var t=this,e=this.getZoneWithPrototype();(Ct.debug("applying patch to",this.moduleName,this.version,"zone:",!!e),e)?(go(e.prototype.runTask)&&(this._unwrap(e.prototype,"runTask"),Ct.debug("removing previous patch from method runTask")),go(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,"scheduleTask"),Ct.debug("removing previous patch from method scheduleTask")),go(e.prototype.cancelTask)&&(this._unwrap(e.prototype,"cancelTask"),Ct.debug("removing previous patch from method cancelTask")),this._zonePatched=!0,this._wrap(e.prototype,"runTask",this._patchZoneRunTask()),this._wrap(e.prototype,"scheduleTask",this._patchZoneScheduleTask()),this._wrap(e.prototype,"cancelTask",this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach((function(e){go(e.addEventListener)&&(t._unwrap(e,"addEventListener"),Ct.debug("removing previous patch from method addEventListener")),go(e.removeEventListener)&&(t._unwrap(e,"removeEventListener"),Ct.debug("removing previous patch from method removeEventListener")),t._wrap(e,"addEventListener",t._patchAddEventListener()),t._wrap(e,"removeEventListener",t._patchRemoveEventListener())})));this._patchHistoryApi()},e.prototype.disable=function(){var t=this,e=this.getZoneWithPrototype();(Ct.debug("removing patch from",this.moduleName,this.version,"zone:",!!e),e&&this._zonePatched)?(go(e.prototype.runTask)&&this._unwrap(e.prototype,"runTask"),go(e.prototype.scheduleTask)&&this._unwrap(e.prototype,"scheduleTask"),go(e.prototype.cancelTask)&&this._unwrap(e.prototype,"cancelTask")):this._getPatchableEventTargets().forEach((function(e){go(e.addEventListener)&&t._unwrap(e,"addEventListener"),go(e.removeEventListener)&&t._unwrap(e,"removeEventListener")}));this._unpatchHistoryApi()},e.prototype.getZoneWithPrototype=function(){return window.Zone},e}(yo);!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 wo,Ro="0.35.0";!function(t){t.HTTP_STATUS_TEXT="http.status_text"}(wo||(wo={}));var 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)}}(),Lo=function(t){function e(e){var n=t.call(this,"@opentelemetry/instrumentation-xml-http-request",Ro,e)||this;return n.component="xml-http-request",n.version=Ro,n.moduleName=n.component,n._tasksCount=0,n._xhrMem=new WeakMap,n._usedResources=new WeakSet,n}return Po(e,t),e.prototype.init=function(){},e.prototype._getConfig=function(){return this._config},e.prototype._addHeaders=function(t,e){if(!xr(Dr(e).href,this._getConfig().propagateTraceHeaderCorsUrls)){var n={};return zt.inject(At.active(),n),void(Object.keys(n).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}var r={};zt.inject(At.active(),r),Object.keys(r).forEach((function(e){t.setRequestHeader(e,String(r[e]))}))},e.prototype._addChildSpan=function(t,e){var n=this;At.with(Gt.setSpan(At.active(),t),(function(){var t=n.tracer.startSpan("CORS Preflight",{startTime:e[Sr.FETCH_START]});Nr(t,e),t.end(e[Sr.RESPONSE_END])}))},e.prototype._addFinalSpanAttributes=function(t,e,n){if("string"==typeof n){var r=Dr(n);void 0!==e.status&&t.setAttribute(Ie,e.status),void 0!==e.statusText&&t.setAttribute(wo.HTTP_STATUS_TEXT,e.statusText),t.setAttribute(ke,r.host),t.setAttribute(Ne,r.protocol.replace(":","")),t.setAttribute(De,navigator.userAgent)}},e.prototype._applyAttributesAfterXHR=function(t,e){var n=this,r=this._getConfig().applyCustomAttributesOnSpan;"function"==typeof r&&so((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=Dr(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&&(we.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=we.getEntriesByType("resource"));var a=Ir(Dr(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)),Nr(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(!Dn(e,this._getConfig().ignoreUrls)){var o="HTTP "+n.toUpperCase(),i=this.tracer.startSpan(o,{kind:bt.CLIENT,attributes:(r={},r[Ae]=n,r[Ce]=Dr(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=Ye(),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)}function a(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)}return function(e){return function(){for(var s=this,u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];var l=t._xhrMem.get(this);if(!l)return e.apply(this,u);var p=l.span,f=l.spanUrl;return p&&f&&At.with(Gt.setSpan(At.active(),p),(function(){t._tasksCount++,l.sendStartTime=Ye(),p.addEvent(bo.METHOD_SEND),s.addEventListener("abort",r),s.addEventListener("error",n),s.addEventListener("load",i),s.addEventListener("timeout",o),l.callbackToRemoveEvents=function(){a(s),l.createdResources&&l.createdResources.observer.disconnect()},t._addHeaders(s,f),t._addResourceObserver(s,f)})),e.apply(this,u)}}},e.prototype.enable=function(){this._diag.debug("applying patch to",this.moduleName,this.version),uo(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),uo(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}(ao);function Ao(t=[]){return[new Jr,new fo({ignoreUrls:t}),new Lo({ignoreUrls:t}),new Oo]}var Co="OT_ZONE_CONTEXT",ko=function(){function t(){this._enabled=!1,this._zoneCounter=0}return t.prototype._activeContextFromZone=function(t){return t&&t.get(Co)||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[Co]=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(),a=this._createZone(i,t);return a.run(e,n,r)},t}();
2
2
  /**
3
3
  * @license Angular v14.2.0-next.0
4
4
  * (c) 2010-2022 Google LLC. https://angular.io/
@@ -11,7 +11,7 @@ var GrafanaFaroWebTracing=function(t,e){"use strict";var n="object"==typeof glob
11
11
  * Use of this source code is governed by an MIT-style license that can be
12
12
  * found in the LICENSE file at https://angular.io/license
13
13
  */
14
- !function(t){const e=t.performance;function n(t){e&&e.mark&&e.mark(t)}function r(t,n){e&&e.measure&&e.measure(t,n)}n("Zone");const o=t.__Zone_symbol_prefix||"__zone_symbol__";function i(t){return o+t}const a=!0===t[i("forceDuplicateZoneCheck")];if(t.Zone){if(a||"function"!=typeof t.Zone.__symbol__)throw new Error("Zone already loaded.");return t.Zone}class s{constructor(t,e){this._parent=t,this._name=e?e.name||"unnamed":"<root>",this._properties=e&&e.properties||{},this._zoneDelegate=new c(this,this._parent&&this._parent._zoneDelegate,e)}static assertZonePatched(){if(t.Promise!==C.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=s.current;for(;t.parent;)t=t.parent;return t}static get current(){return N.zone}static get currentTask(){return I}static __load_patch(e,o,i=!1){if(C.hasOwnProperty(e)){if(!i&&a)throw Error("Already loaded patch: "+e)}else if(!t["__Zone_disable_"+e]){const i="Zone:"+e;n(i),C[e]=o(t,s,k),r(i,i)}}get parent(){return this._parent}get name(){return this._name}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){N={parent:N,zone:this};try{return this._zoneDelegate.invoke(this,t,e,n,r)}finally{N=N.parent}}runGuarded(t,e=null,n,r){N={parent:N,zone:this};try{try{return this._zoneDelegate.invoke(this,t,e,n,r)}catch(t){if(this._zoneDelegate.handleError(this,t))throw t}}finally{N=N.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||g).name+"; Execution: "+this.name+")");if(t.state===m&&(t.type===A||t.type===L))return;const r=t.state!=O;r&&t._transitionTo(O,b),t.runCount++;const o=I;I=t,N={parent:N,zone:this};try{t.type==L&&t.data&&!t.data.isPeriodic&&(t.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,t,e,n)}catch(t){if(this._zoneDelegate.handleError(this,t))throw t}}finally{t.state!==m&&t.state!==R&&(t.type==A||t.data&&t.data.isPeriodic?r&&t._transitionTo(b,O):(t.runCount=0,this._updateTaskCount(t,-1),r&&t._transitionTo(m,O,m))),N=N.parent,I=o}}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(S,m);const e=[];t._zoneDelegates=e,t._zone=this;try{t=this._zoneDelegate.scheduleTask(this,t)}catch(e){throw t._transitionTo(R,S,m),this._zoneDelegate.handleError(this,e),e}return t._zoneDelegates===e&&this._updateTaskCount(t,1),t.state==S&&t._transitionTo(b,S),t}scheduleMicroTask(t,e,n,r){return this.scheduleTask(new l(P,t,e,n,r,void 0))}scheduleMacroTask(t,e,n,r,o){return this.scheduleTask(new l(L,t,e,n,r,o))}scheduleEventTask(t,e,n,r,o){return this.scheduleTask(new l(A,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||g).name+"; Execution: "+this.name+")");t._transitionTo(w,b,O);try{this._zoneDelegate.cancelTask(this,t)}catch(e){throw t._transitionTo(R,w),this._zoneDelegate.handleError(this,e),e}return this._updateTaskCount(t,-1),t._transitionTo(m,w),t.runCount=0,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)}}s.__symbol__=i;const u={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 c{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,o=e&&e._hasTaskZS;(r||o)&&(this._hasTaskZS=r?n:u,this._hasTaskDlgt=e,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=t,n.onScheduleTask||(this._scheduleTaskZS=u,this._scheduleTaskDlgt=e,this._scheduleTaskCurrZone=this.zone),n.onInvokeTask||(this._invokeTaskZS=u,this._invokeTaskDlgt=e,this._invokeTaskCurrZone=this.zone),n.onCancelTask||(this._cancelTaskZS=u,this._cancelTaskDlgt=e,this._cancelTaskCurrZone=this.zone))}fork(t,e){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,t,e):new s(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!=P)throw new Error("Task is missing scheduleFn.");E(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 l{constructor(e,n,r,o,i,a){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=e,this.source=n,this.data=o,this.scheduleFn=i,this.cancelFn=a,!r)throw new Error("callback is not defined");this.callback=r;const s=this;e===A&&o&&o.useG?this.invoke=l.invokeTask:this.invoke=function(){return l.invokeTask.call(t,s,this,arguments)}}static invokeTask(t,e,n){t||(t=this),D++;try{return t.runCount++,t.zone.runTask(t,e,n)}finally{1==D&&T(),D--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(m,S)}_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==m&&(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 p=i("setTimeout"),f=i("Promise"),h=i("then");let d,_=[],v=!1;function y(e){if(d||t[f]&&(d=t[f].resolve(0)),d){let t=d[h];t||(t=d.then),t.call(d,e)}else t[p](e,0)}function E(t){0===D&&0===_.length&&y(T),t&&_.push(t)}function T(){if(!v){for(v=!0;_.length;){const t=_;_=[];for(let e=0;e<t.length;e++){const n=t[e];try{n.zone.runTask(n,null,null)}catch(t){k.onUnhandledError(t)}}}k.microtaskDrainDone(),v=!1}}const g={name:"NO ZONE"},m="notScheduled",S="scheduling",b="scheduled",O="running",w="canceling",R="unknown",P="microTask",L="macroTask",A="eventTask",C={},k={symbol:i,currentZoneFrame:()=>N,onUnhandledError:M,microtaskDrainDone:M,scheduleMicroTask:E,showUncaughtError:()=>!s[i("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:M,patchMethod:()=>M,bindArguments:()=>[],patchThen:()=>M,patchMacroTask:()=>M,patchEventPrototype:()=>M,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>M,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>M,wrapWithCurrentZone:()=>M,filterProperties:()=>[],attachOriginToPatched:()=>M,_redefineProperty:()=>M,patchCallbacks:()=>M,nativeScheduleMicroTask:y};let N={parent:null,zone:new s(null,null)},I=null,D=0;function M(){}r("Zone","Zone"),t.Zone=s}("undefined"!=typeof window&&window||"undefined"!=typeof self&&self||Nr);
14
+ !function(t){const e=t.performance;function n(t){e&&e.mark&&e.mark(t)}function r(t,n){e&&e.measure&&e.measure(t,n)}n("Zone");const o=t.__Zone_symbol_prefix||"__zone_symbol__";function i(t){return o+t}const a=!0===t[i("forceDuplicateZoneCheck")];if(t.Zone){if(a||"function"!=typeof t.Zone.__symbol__)throw new Error("Zone already loaded.");return t.Zone}class s{constructor(t,e){this._parent=t,this._name=e?e.name||"unnamed":"<root>",this._properties=e&&e.properties||{},this._zoneDelegate=new c(this,this._parent&&this._parent._zoneDelegate,e)}static assertZonePatched(){if(t.Promise!==C.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=s.current;for(;t.parent;)t=t.parent;return t}static get current(){return N.zone}static get currentTask(){return I}static __load_patch(e,o,i=!1){if(C.hasOwnProperty(e)){if(!i&&a)throw Error("Already loaded patch: "+e)}else if(!t["__Zone_disable_"+e]){const i="Zone:"+e;n(i),C[e]=o(t,s,k),r(i,i)}}get parent(){return this._parent}get name(){return this._name}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){N={parent:N,zone:this};try{return this._zoneDelegate.invoke(this,t,e,n,r)}finally{N=N.parent}}runGuarded(t,e=null,n,r){N={parent:N,zone:this};try{try{return this._zoneDelegate.invoke(this,t,e,n,r)}catch(t){if(this._zoneDelegate.handleError(this,t))throw t}}finally{N=N.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||T).name+"; Execution: "+this.name+")");if(t.state===m&&(t.type===A||t.type===L))return;const r=t.state!=O;r&&t._transitionTo(O,b),t.runCount++;const o=I;I=t,N={parent:N,zone:this};try{t.type==L&&t.data&&!t.data.isPeriodic&&(t.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,t,e,n)}catch(t){if(this._zoneDelegate.handleError(this,t))throw t}}finally{t.state!==m&&t.state!==R&&(t.type==A||t.data&&t.data.isPeriodic?r&&t._transitionTo(b,O):(t.runCount=0,this._updateTaskCount(t,-1),r&&t._transitionTo(m,O,m))),N=N.parent,I=o}}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(S,m);const e=[];t._zoneDelegates=e,t._zone=this;try{t=this._zoneDelegate.scheduleTask(this,t)}catch(e){throw t._transitionTo(R,S,m),this._zoneDelegate.handleError(this,e),e}return t._zoneDelegates===e&&this._updateTaskCount(t,1),t.state==S&&t._transitionTo(b,S),t}scheduleMicroTask(t,e,n,r){return this.scheduleTask(new l(P,t,e,n,r,void 0))}scheduleMacroTask(t,e,n,r,o){return this.scheduleTask(new l(L,t,e,n,r,o))}scheduleEventTask(t,e,n,r,o){return this.scheduleTask(new l(A,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||T).name+"; Execution: "+this.name+")");t._transitionTo(w,b,O);try{this._zoneDelegate.cancelTask(this,t)}catch(e){throw t._transitionTo(R,w),this._zoneDelegate.handleError(this,e),e}return this._updateTaskCount(t,-1),t._transitionTo(m,w),t.runCount=0,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)}}s.__symbol__=i;const u={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 c{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,o=e&&e._hasTaskZS;(r||o)&&(this._hasTaskZS=r?n:u,this._hasTaskDlgt=e,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=t,n.onScheduleTask||(this._scheduleTaskZS=u,this._scheduleTaskDlgt=e,this._scheduleTaskCurrZone=this.zone),n.onInvokeTask||(this._invokeTaskZS=u,this._invokeTaskDlgt=e,this._invokeTaskCurrZone=this.zone),n.onCancelTask||(this._cancelTaskZS=u,this._cancelTaskDlgt=e,this._cancelTaskCurrZone=this.zone))}fork(t,e){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,t,e):new s(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!=P)throw new Error("Task is missing scheduleFn.");g(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 l{constructor(e,n,r,o,i,a){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=e,this.source=n,this.data=o,this.scheduleFn=i,this.cancelFn=a,!r)throw new Error("callback is not defined");this.callback=r;const s=this;e===A&&o&&o.useG?this.invoke=l.invokeTask:this.invoke=function(){return l.invokeTask.call(t,s,this,arguments)}}static invokeTask(t,e,n){t||(t=this),D++;try{return t.runCount++,t.zone.runTask(t,e,n)}finally{1==D&&E(),D--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(m,S)}_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==m&&(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 p=i("setTimeout"),f=i("Promise"),h=i("then");let _,d=[],v=!1;function y(e){if(_||t[f]&&(_=t[f].resolve(0)),_){let t=_[h];t||(t=_.then),t.call(_,e)}else t[p](e,0)}function g(t){0===D&&0===d.length&&y(E),t&&d.push(t)}function E(){if(!v){for(v=!0;d.length;){const t=d;d=[];for(let e=0;e<t.length;e++){const n=t[e];try{n.zone.runTask(n,null,null)}catch(t){k.onUnhandledError(t)}}}k.microtaskDrainDone(),v=!1}}const T={name:"NO ZONE"},m="notScheduled",S="scheduling",b="scheduled",O="running",w="canceling",R="unknown",P="microTask",L="macroTask",A="eventTask",C={},k={symbol:i,currentZoneFrame:()=>N,onUnhandledError:M,microtaskDrainDone:M,scheduleMicroTask:g,showUncaughtError:()=>!s[i("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:M,patchMethod:()=>M,bindArguments:()=>[],patchThen:()=>M,patchMacroTask:()=>M,patchEventPrototype:()=>M,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>M,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>M,wrapWithCurrentZone:()=>M,filterProperties:()=>[],attachOriginToPatched:()=>M,_redefineProperty:()=>M,patchCallbacks:()=>M,nativeScheduleMicroTask:y};let N={parent:null,zone:new s(null,null)},I=null,D=0;function M(){}r("Zone","Zone"),t.Zone=s}("undefined"!=typeof window&&window||"undefined"!=typeof self&&self||jr);
15
15
  /**
16
16
  * @license
17
17
  * Copyright Google LLC All Rights Reserved.
@@ -19,14 +19,14 @@ var GrafanaFaroWebTracing=function(t,e){"use strict";var n="object"==typeof glob
19
19
  * Use of this source code is governed by an MIT-style license that can be
20
20
  * found in the LICENSE file at https://angular.io/license
21
21
  */
22
- const vo=Object.getOwnPropertyDescriptor,yo=Object.defineProperty,Eo=Object.getPrototypeOf,To=Object.create,go=Array.prototype.slice,mo="addEventListener",So="removeEventListener",bo=Zone.__symbol__(mo),Oo=Zone.__symbol__(So),wo="true",Ro="false",Po=Zone.__symbol__("");function Lo(t,e){return Zone.current.wrap(t,e)}function Ao(t,e,n,r,o){return Zone.current.scheduleMacroTask(t,e,n,r,o)}const Co=Zone.__symbol__,ko="undefined"!=typeof window,No=ko?window:void 0,Io=ko&&No||"object"==typeof self&&self||Nr;function Do(t,e){for(let n=t.length-1;n>=0;n--)"function"==typeof t[n]&&(t[n]=Lo(t[n],e+"_"+n));return t}function Mo(t){return!t||!1!==t.writable&&!("function"==typeof t.get&&void 0===t.set)}const xo="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,jo=!("nw"in Io)&&void 0!==Io.process&&"[object process]"==={}.toString.call(Io.process),Uo=!jo&&!xo&&!(!ko||!No.HTMLElement),Zo=void 0!==Io.process&&"[object process]"==={}.toString.call(Io.process)&&!xo&&!(!ko||!No.HTMLElement),Ho={},Fo=function(t){if(!(t=t||Io.event))return;let e=Ho[t.type];e||(e=Ho[t.type]=Co("ON_PROPERTY"+t.type));const n=this||t.target||Io,r=n[e];let o;if(Uo&&n===No&&"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),null==o||o||t.preventDefault();return o};function Bo(t,e,n){let r=vo(t,e);if(!r&&n){vo(n,e)&&(r={enumerable:!0,configurable:!0})}if(!r||!r.configurable)return;const o=Co("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=Ho[s];u||(u=Ho[s]=Co("ON_PROPERTY"+s)),r.set=function(e){let n=this;if(n||t!==Io||(n=Io),!n)return;"function"==typeof n[u]&&n.removeEventListener(s,Fo),a&&a.call(n,null),n[u]=e,"function"==typeof e&&n.addEventListener(s,Fo,!1)},r.get=function(){let n=this;if(n||t!==Io||(n=Io),!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.removeAttribute&&n.removeAttribute(e),t}return null},yo(t,e,r),t[o]=!0}function zo(t,e,n){if(e)for(let r=0;r<e.length;r++)Bo(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++)Bo(t,e[r],n)}}const Vo=Co("originalInstance");function Go(t){const e=Io[t];if(!e)return;Io[Co(t)]=e,Io[t]=function(){const n=Do(arguments,t);switch(n.length){case 0:this[Vo]=new e;break;case 1:this[Vo]=new e(n[0]);break;case 2:this[Vo]=new e(n[0],n[1]);break;case 3:this[Vo]=new e(n[0],n[1],n[2]);break;case 4:this[Vo]=new e(n[0],n[1],n[2],n[3]);break;default:throw new Error("Arg list too long.")}},Wo(Io[t],e);const n=new e((function(){}));let r;for(r in n)"XMLHttpRequest"===t&&"responseBlob"===r||function(e){"function"==typeof n[e]?Io[t].prototype[e]=function(){return this[Vo][e].apply(this[Vo],arguments)}:yo(Io[t].prototype,e,{set:function(n){"function"==typeof n?(this[Vo][e]=Lo(n,t+"."+e),Wo(this[Vo][e],n)):this[Vo][e]=n},get:function(){return this[Vo][e]}})}(r);for(r in e)"prototype"!==r&&e.hasOwnProperty(r)&&(Io[t][r]=e[r])}function Xo(t,e,n){let r=t;for(;r&&!r.hasOwnProperty(e);)r=Eo(r);!r&&t[e]&&(r=t);const o=Co(e);let i=null;if(r&&(!(i=r[o])||!r.hasOwnProperty(o))){i=r[o]=r[e];if(Mo(r&&vo(r,e))){const t=n(i,o,e);r[e]=function(){return t(this,arguments)},Wo(r[e],i)}}return i}function qo(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=Xo(t,e,(t=>function(e,r){const i=n(e,r);return i.cbIdx>=0&&"function"==typeof r[i.cbIdx]?Ao(i.name,r[i.cbIdx],i,o):t.apply(e,r)}))}function Wo(t,e){t[Co("OriginalDelegate")]=e}let Yo=!1,Ko=!1;function $o(){try{const t=No.navigator.userAgent;if(-1!==t.indexOf("MSIE ")||-1!==t.indexOf("Trident/"))return!0}catch(t){}return!1}function Qo(){if(Yo)return Ko;Yo=!0;try{const t=No.navigator.userAgent;-1===t.indexOf("MSIE ")&&-1===t.indexOf("Trident/")&&-1===t.indexOf("Edge/")||(Ko=!0)}catch(t){}return Ko}
22
+ const No=Object.getOwnPropertyDescriptor,Io=Object.defineProperty,Do=Object.getPrototypeOf,Mo=Object.create,xo=Array.prototype.slice,jo="addEventListener",Uo="removeEventListener",Zo=Zone.__symbol__(jo),Ho=Zone.__symbol__(Uo),Fo="true",Bo="false",zo=Zone.__symbol__("");function Vo(t,e){return Zone.current.wrap(t,e)}function Go(t,e,n,r,o){return Zone.current.scheduleMacroTask(t,e,n,r,o)}const Xo=Zone.__symbol__,qo="undefined"!=typeof window,Wo=qo?window:void 0,Yo=qo&&Wo||"object"==typeof self&&self||jr;function Ko(t,e){for(let n=t.length-1;n>=0;n--)"function"==typeof t[n]&&(t[n]=Vo(t[n],e+"_"+n));return t}function $o(t){return!t||!1!==t.writable&&!("function"==typeof t.get&&void 0===t.set)}const Qo="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,Jo=!("nw"in Yo)&&void 0!==Yo.process&&"[object process]"==={}.toString.call(Yo.process),ti=!Jo&&!Qo&&!(!qo||!Wo.HTMLElement),ei=void 0!==Yo.process&&"[object process]"==={}.toString.call(Yo.process)&&!Qo&&!(!qo||!Wo.HTMLElement),ni={},ri=function(t){if(!(t=t||Yo.event))return;let e=ni[t.type];e||(e=ni[t.type]=Xo("ON_PROPERTY"+t.type));const n=this||t.target||Yo,r=n[e];let o;if(ti&&n===Wo&&"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),null==o||o||t.preventDefault();return o};function oi(t,e,n){let r=No(t,e);if(!r&&n){No(n,e)&&(r={enumerable:!0,configurable:!0})}if(!r||!r.configurable)return;const o=Xo("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=ni[s];u||(u=ni[s]=Xo("ON_PROPERTY"+s)),r.set=function(e){let n=this;if(n||t!==Yo||(n=Yo),!n)return;"function"==typeof n[u]&&n.removeEventListener(s,ri),a&&a.call(n,null),n[u]=e,"function"==typeof e&&n.addEventListener(s,ri,!1)},r.get=function(){let n=this;if(n||t!==Yo||(n=Yo),!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.removeAttribute&&n.removeAttribute(e),t}return null},Io(t,e,r),t[o]=!0}function ii(t,e,n){if(e)for(let r=0;r<e.length;r++)oi(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++)oi(t,e[r],n)}}const ai=Xo("originalInstance");function si(t){const e=Yo[t];if(!e)return;Yo[Xo(t)]=e,Yo[t]=function(){const n=Ko(arguments,t);switch(n.length){case 0:this[ai]=new e;break;case 1:this[ai]=new e(n[0]);break;case 2:this[ai]=new e(n[0],n[1]);break;case 3:this[ai]=new e(n[0],n[1],n[2]);break;case 4:this[ai]=new e(n[0],n[1],n[2],n[3]);break;default:throw new Error("Arg list too long.")}},li(Yo[t],e);const n=new e((function(){}));let r;for(r in n)"XMLHttpRequest"===t&&"responseBlob"===r||function(e){"function"==typeof n[e]?Yo[t].prototype[e]=function(){return this[ai][e].apply(this[ai],arguments)}:Io(Yo[t].prototype,e,{set:function(n){"function"==typeof n?(this[ai][e]=Vo(n,t+"."+e),li(this[ai][e],n)):this[ai][e]=n},get:function(){return this[ai][e]}})}(r);for(r in e)"prototype"!==r&&e.hasOwnProperty(r)&&(Yo[t][r]=e[r])}function ui(t,e,n){let r=t;for(;r&&!r.hasOwnProperty(e);)r=Do(r);!r&&t[e]&&(r=t);const o=Xo(e);let i=null;if(r&&(!(i=r[o])||!r.hasOwnProperty(o))){i=r[o]=r[e];if($o(r&&No(r,e))){const t=n(i,o,e);r[e]=function(){return t(this,arguments)},li(r[e],i)}}return i}function ci(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=ui(t,e,(t=>function(e,r){const i=n(e,r);return i.cbIdx>=0&&"function"==typeof r[i.cbIdx]?Go(i.name,r[i.cbIdx],i,o):t.apply(e,r)}))}function li(t,e){t[Xo("OriginalDelegate")]=e}let pi=!1,fi=!1;function hi(){try{const t=Wo.navigator.userAgent;if(-1!==t.indexOf("MSIE ")||-1!==t.indexOf("Trident/"))return!0}catch(t){}return!1}function _i(){if(pi)return fi;pi=!0;try{const t=Wo.navigator.userAgent;-1===t.indexOf("MSIE ")&&-1===t.indexOf("Trident/")&&-1===t.indexOf("Edge/")||(fi=!0)}catch(t){}return fi}
23
23
  /**
24
24
  * @license
25
25
  * Copyright Google LLC All Rights Reserved.
26
26
  *
27
27
  * Use of this source code is governed by an MIT-style license that can be
28
28
  * found in the LICENSE file at https://angular.io/license
29
- */Zone.__load_patch("ZoneAwarePromise",((t,e,n)=>{const r=Object.getOwnPropertyDescriptor,o=Object.defineProperty;const i=n.symbol,a=[],s=!0===t[i("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],u=i("Promise"),c=i("then");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){p(t)}}};const l=i("unhandledPromiseRejectionHandler");function p(t){n.onUnhandledError(t);try{const n=e[l];"function"==typeof n&&n.call(this,t)}catch(t){}}function f(t){return t&&t.then}function h(t){return t}function d(t){return N.reject(t)}const _=i("state"),v=i("value"),y=i("finally"),E=i("parentPromiseValue"),T=i("parentPromiseState"),g=null,m=!0,S=!1;function b(t,e){return n=>{try{R(t,e,n)}catch(e){R(t,!1,e)}}}const O=function(){let t=!1;return function(e){return function(){t||(t=!0,e.apply(null,arguments))}}},w=i("currentTaskTrace");function R(t,r,i){const u=O();if(t===i)throw new TypeError("Promise resolved with itself");if(t[_]===g){let c=null;try{"object"!=typeof i&&"function"!=typeof i||(c=i&&i.then)}catch(e){return u((()=>{R(t,!1,e)}))(),t}if(r!==S&&i instanceof N&&i.hasOwnProperty(_)&&i.hasOwnProperty(v)&&i[_]!==g)L(i),R(t,i[_],i[v]);else if(r!==S&&"function"==typeof c)try{c.call(i,u(b(t,r)),u(b(t,!1)))}catch(e){u((()=>{R(t,!1,e)}))()}else{t[_]=r;const u=t[v];if(t[v]=i,t[y]===y&&r===m&&(t[_]=t[T],t[v]=t[E]),r===S&&i instanceof Error){const t=e.currentTask&&e.currentTask.data&&e.currentTask.data.__creationTrace__;t&&o(i,w,{configurable:!0,enumerable:!1,writable:!0,value:t})}for(let e=0;e<u.length;)A(t,u[e++],u[e++],u[e++],u[e++]);if(0==u.length&&r==S){t[_]=0;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 P=i("rejectionHandledHandler");function L(t){if(0===t[_]){try{const n=e[P];n&&"function"==typeof n&&n.call(this,{rejection:t[v],promise:t})}catch(t){}t[_]=S;for(let e=0;e<a.length;e++)t===a[e].promise&&a.splice(e,1)}}function A(t,e,n,r,o){L(t);const i=t[_],a=i?"function"==typeof r?r:h:"function"==typeof o?o:d;e.scheduleMicroTask("Promise.then",(()=>{try{const r=t[v],o=!!n&&y===n[y];o&&(n[E]=r,n[T]=i);const s=e.run(a,void 0,o&&a!==d&&a!==h?[]:[r]);R(n,!0,s)}catch(t){R(n,!1,t)}}),n)}const C=function(){},k=t.AggregateError;class N{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(t){return R(new this(null),m,t)}static reject(t){return R(new this(null),S,t)}static any(t){if(!t||"function"!=typeof t[Symbol.iterator])return Promise.reject(new k([],"All promises were rejected"));const e=[];let n=0;try{for(let r of t)n++,e.push(N.resolve(r))}catch(t){return Promise.reject(new k([],"All promises were rejected"))}if(0===n)return Promise.reject(new k([],"All promises were rejected"));let r=!1;const o=[];return new N(((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 k(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)f(e)||(e=this.resolve(e)),e.then(o,i);return r}static all(t){return N.allWithCallback(t)}static allSettled(t){return(this&&this.prototype instanceof N?this:N).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){f(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 N))throw new Error("Must be an instanceof Promise.");e[_]=g,e[v]=[];try{const n=O();t&&t(n(b(e,m)),n(b(e,S)))}catch(t){R(e,!1,t)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return N}then(t,n){var r;let o=null===(r=this.constructor)||void 0===r?void 0:r[Symbol.species];o&&"function"==typeof o||(o=this.constructor||N);const i=new o(C),a=e.current;return this[_]==g?this[v].push(a,i,t,n):A(this,a,i,t,n),i}catch(t){return this.then(null,t)}finally(t){var n;let r=null===(n=this.constructor)||void 0===n?void 0:n[Symbol.species];r&&"function"==typeof r||(r=N);const o=new r(C);o[y]=y;const i=e.current;return this[_]==g?this[v].push(i,o,t,t):A(this,i,o,t,t),o}}N.resolve=N.resolve,N.reject=N.reject,N.race=N.race,N.all=N.all;const I=t[u]=t.Promise;t.Promise=N;const D=i("thenPatched");function M(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 N(((t,e)=>{o.call(this,t,e)})).then(t,e)},t[D]=!0}return n.patchThen=M,I&&(M(I),Xo(t,"fetch",(t=>{return e=t,function(t,n){let r=e.apply(t,n);if(r instanceof N)return r;let o=r.constructor;return o[D]||M(o),r};var e}))),Promise[e.__symbol__("uncaughtPromiseErrors")]=a,N})),
29
+ */Zone.__load_patch("ZoneAwarePromise",((t,e,n)=>{const r=Object.getOwnPropertyDescriptor,o=Object.defineProperty;const i=n.symbol,a=[],s=!0===t[i("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],u=i("Promise"),c=i("then");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){p(t)}}};const l=i("unhandledPromiseRejectionHandler");function p(t){n.onUnhandledError(t);try{const n=e[l];"function"==typeof n&&n.call(this,t)}catch(t){}}function f(t){return t&&t.then}function h(t){return t}function _(t){return N.reject(t)}const d=i("state"),v=i("value"),y=i("finally"),g=i("parentPromiseValue"),E=i("parentPromiseState"),T=null,m=!0,S=!1;function b(t,e){return n=>{try{R(t,e,n)}catch(e){R(t,!1,e)}}}const O=function(){let t=!1;return function(e){return function(){t||(t=!0,e.apply(null,arguments))}}},w=i("currentTaskTrace");function R(t,r,i){const u=O();if(t===i)throw new TypeError("Promise resolved with itself");if(t[d]===T){let c=null;try{"object"!=typeof i&&"function"!=typeof i||(c=i&&i.then)}catch(e){return u((()=>{R(t,!1,e)}))(),t}if(r!==S&&i instanceof N&&i.hasOwnProperty(d)&&i.hasOwnProperty(v)&&i[d]!==T)L(i),R(t,i[d],i[v]);else if(r!==S&&"function"==typeof c)try{c.call(i,u(b(t,r)),u(b(t,!1)))}catch(e){u((()=>{R(t,!1,e)}))()}else{t[d]=r;const u=t[v];if(t[v]=i,t[y]===y&&r===m&&(t[d]=t[E],t[v]=t[g]),r===S&&i instanceof Error){const t=e.currentTask&&e.currentTask.data&&e.currentTask.data.__creationTrace__;t&&o(i,w,{configurable:!0,enumerable:!1,writable:!0,value:t})}for(let e=0;e<u.length;)A(t,u[e++],u[e++],u[e++],u[e++]);if(0==u.length&&r==S){t[d]=0;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 P=i("rejectionHandledHandler");function L(t){if(0===t[d]){try{const n=e[P];n&&"function"==typeof n&&n.call(this,{rejection:t[v],promise:t})}catch(t){}t[d]=S;for(let e=0;e<a.length;e++)t===a[e].promise&&a.splice(e,1)}}function A(t,e,n,r,o){L(t);const i=t[d],a=i?"function"==typeof r?r:h:"function"==typeof o?o:_;e.scheduleMicroTask("Promise.then",(()=>{try{const r=t[v],o=!!n&&y===n[y];o&&(n[g]=r,n[E]=i);const s=e.run(a,void 0,o&&a!==_&&a!==h?[]:[r]);R(n,!0,s)}catch(t){R(n,!1,t)}}),n)}const C=function(){},k=t.AggregateError;class N{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(t){return R(new this(null),m,t)}static reject(t){return R(new this(null),S,t)}static any(t){if(!t||"function"!=typeof t[Symbol.iterator])return Promise.reject(new k([],"All promises were rejected"));const e=[];let n=0;try{for(let r of t)n++,e.push(N.resolve(r))}catch(t){return Promise.reject(new k([],"All promises were rejected"))}if(0===n)return Promise.reject(new k([],"All promises were rejected"));let r=!1;const o=[];return new N(((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 k(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)f(e)||(e=this.resolve(e)),e.then(o,i);return r}static all(t){return N.allWithCallback(t)}static allSettled(t){return(this&&this.prototype instanceof N?this:N).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){f(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 N))throw new Error("Must be an instanceof Promise.");e[d]=T,e[v]=[];try{const n=O();t&&t(n(b(e,m)),n(b(e,S)))}catch(t){R(e,!1,t)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return N}then(t,n){var r;let o=null===(r=this.constructor)||void 0===r?void 0:r[Symbol.species];o&&"function"==typeof o||(o=this.constructor||N);const i=new o(C),a=e.current;return this[d]==T?this[v].push(a,i,t,n):A(this,a,i,t,n),i}catch(t){return this.then(null,t)}finally(t){var n;let r=null===(n=this.constructor)||void 0===n?void 0:n[Symbol.species];r&&"function"==typeof r||(r=N);const o=new r(C);o[y]=y;const i=e.current;return this[d]==T?this[v].push(i,o,t,t):A(this,i,o,t,t),o}}N.resolve=N.resolve,N.reject=N.reject,N.race=N.race,N.all=N.all;const I=t[u]=t.Promise;t.Promise=N;const D=i("thenPatched");function M(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 N(((t,e)=>{o.call(this,t,e)})).then(t,e)},t[D]=!0}return n.patchThen=M,I&&(M(I),ui(t,"fetch",(t=>{return e=t,function(t,n){let r=e.apply(t,n);if(r instanceof N)return r;let o=r.constructor;return o[D]||M(o),r};var e}))),Promise[e.__symbol__("uncaughtPromiseErrors")]=a,N})),
30
30
  /**
31
31
  * @license
32
32
  * Copyright Google LLC All Rights Reserved.
@@ -34,7 +34,7 @@ const vo=Object.getOwnPropertyDescriptor,yo=Object.defineProperty,Eo=Object.getP
34
34
  * Use of this source code is governed by an MIT-style license that can be
35
35
  * found in the LICENSE file at https://angular.io/license
36
36
  */
37
- Zone.__load_patch("toString",(t=>{const e=Function.prototype.toString,n=Co("OriginalDelegate"),r=Co("Promise"),o=Co("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)}}));
37
+ Zone.__load_patch("toString",(t=>{const e=Function.prototype.toString,n=Xo("OriginalDelegate"),r=Xo("Promise"),o=Xo("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)}}));
38
38
  /**
39
39
  * @license
40
40
  * Copyright Google LLC All Rights Reserved.
@@ -42,28 +42,28 @@ Zone.__load_patch("toString",(t=>{const e=Function.prototype.toString,n=Co("Orig
42
42
  * Use of this source code is governed by an MIT-style license that can be
43
43
  * found in the LICENSE file at https://angular.io/license
44
44
  */
45
- let Jo=!1;if("undefined"!=typeof window)try{const t=Object.defineProperty({},"passive",{get:function(){Jo=!0}});window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){Jo=!1}const ti={useG:!0},ei={},ni={},ri=new RegExp("^"+Po+"(\\w+)(true|false)$"),oi=Co("propagationStopped");function ii(t,e){const n=(e?e(t):t)+Ro,r=(e?e(t):t)+wo,o=Po+n,i=Po+r;ei[t]={},ei[t][Ro]=o,ei[t][wo]=i}function ai(t,e,n,r){const o=r&&r.add||mo,i=r&&r.rm||So,a=r&&r.listeners||"eventListeners",s=r&&r.rmAll||"removeAllListeners",u=Co(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[ei[r.type][o?wo:Ro]];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[oi]);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 y=e;for(;y&&!y.hasOwnProperty(o);)y=Eo(y);if(!y&&e[o]&&(y=e),!y)return!1;if(y[u])return!1;const E=n&&n.eventNameToString,T={},g=y[u]=y[o],m=y[Co(i)]=y[i],S=y[Co(a)]=y[a],b=y[Co(s)]=y[s];let O;function w(t,e){return!Jo&&"object"==typeof t&&t?!!t.capture:Jo&&e?"boolean"==typeof t?{capture:t,passive:!0}:t?"object"==typeof t&&!1!==t.passive?Object.assign(Object.assign({},t),{passive:!0}):t:{passive:!0}:t}n&&n.prepend&&(O=y[Co(n.prepend)]=y[n.prepend]);const R=function(t){return O.call(T.target,T.eventName,t.invoke,T.options)},P=r?function(t){if(!T.isExisting)return g.call(T.target,T.eventName,T.capture?_:d,T.options)}:function(t){return g.call(T.target,T.eventName,t.invoke,T.options)},L=r?function(t){if(!t.isRemoved){const e=ei[t.eventName];let n;e&&(n=e[t.capture?wo:Ro]);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,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)},A=n&&n.diff?n.diff:function(t,e){const n=typeof e;return"function"===n&&t.callback===e||"object"===n&&t.originalDelegate===e},C=Zone[Co("UNPATCHED_EVENTS")],k=t[Co("PASSIVE_EVENTS")],N=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(jo&&"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 _=Jo&&!!k&&-1!==k.indexOf(l),v=w(arguments[2],_);if(C)for(let t=0;t<C.length;t++)if(l===C[t])return _?e.call(c,l,p,v):e.apply(this,arguments);const y=!!v&&("boolean"==typeof v||v.capture),g=!(!v||"object"!=typeof v)&&v.once,m=Zone.current;let S=ei[l];S||(ii(l,E),S=ei[l]);const b=S[y?wo:Ro];let O,R=c[b],P=!1;if(R){if(P=!0,h)for(let t=0;t<R.length;t++)if(A(R[t],p))return}else R=c[b]=[];const L=c.constructor.name,N=ni[L];N&&(O=N[l]),O||(O=L+o+(E?E(l):l)),T.options=v,g&&(T.options.once=!1),T.target=c,T.capture=y,T.eventName=l,T.isExisting=P;const I=r?ti:void 0;I&&(I.taskData=T);const D=m.scheduleEventTask(O,p,I,i,a);return T.target=null,I&&(I.taskData=null),g&&(v.once=!0),(Jo||"boolean"!=typeof D.options)&&(D.options=v),D.target=c,D.capture=y,D.eventName=l,d&&(D.originalDelegate=p),u?R.unshift(D):R.push(D),s?c:void 0}};return y[o]=N(g,c,P,L,v),O&&(y[l]=N(O,p,R,L,v,!0)),y[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=ei[r];let u;s&&(u=s[i?wo:Ro]);const c=u&&e[u];if(c)for(let t=0;t<c.length;t++){const n=c[t];if(A(n,a)){if(c.splice(t,1),n.isRemoved=!0,0===c.length&&(n.allRemoved=!0,e[u]=null,"string"==typeof r)){e[Po+"ON_PROPERTY"+r]=null}return n.zone.cancelTask(n),v?e:void 0}}return m.apply(this,arguments)},y[a]=function(){const e=this||t;let r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));const o=[],i=si(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},y[s]=function(){const e=this||t;let r=arguments[0];if(r){n&&n.transferEventName&&(r=n.transferEventName(r));const t=ei[r];if(t){const n=t[Ro],o=t[wo],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=ri.exec(n);let o=r&&r[1];o&&"removeListener"!==o&&this[s].call(this,o)}this[s].call(this,"removeListener")}if(v)return this},Wo(y[o],g),Wo(y[i],m),b&&Wo(y[s],b),S&&Wo(y[a],S),!0}let y=[];for(let t=0;t<n.length;t++)y[t]=v(n[t],r);return y}function si(t,e){if(!e){const n=[];for(let r in t){const o=ri.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=ei[e];n||(ii(e),n=ei[e]);const r=t[n[Ro]],o=t[n[wo]];return r?o?r.concat(o):r.slice():o?o.slice():[]}function ui(t,e){const n=t.Event;n&&n.prototype&&e.patchMethod(n.prototype,"stopImmediatePropagation",(t=>function(e,n){e[oi]=!0,t&&t.apply(e,n)}))}
45
+ let di=!1;if("undefined"!=typeof window)try{const t=Object.defineProperty({},"passive",{get:function(){di=!0}});window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){di=!1}const vi={useG:!0},yi={},gi={},Ei=new RegExp("^"+zo+"(\\w+)(true|false)$"),Ti=Xo("propagationStopped");function mi(t,e){const n=(e?e(t):t)+Bo,r=(e?e(t):t)+Fo,o=zo+n,i=zo+r;yi[t]={},yi[t][Bo]=o,yi[t][Fo]=i}function Si(t,e,n,r){const o=r&&r.add||jo,i=r&&r.rm||Uo,a=r&&r.listeners||"eventListeners",s=r&&r.rmAll||"removeAllListeners",u=Xo(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[yi[r.type][o?Fo:Bo]];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[Ti]);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 _=function(t){return h(this,t,!1)},d=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 y=e;for(;y&&!y.hasOwnProperty(o);)y=Do(y);if(!y&&e[o]&&(y=e),!y)return!1;if(y[u])return!1;const g=n&&n.eventNameToString,E={},T=y[u]=y[o],m=y[Xo(i)]=y[i],S=y[Xo(a)]=y[a],b=y[Xo(s)]=y[s];let O;function w(t,e){return!di&&"object"==typeof t&&t?!!t.capture:di&&e?"boolean"==typeof t?{capture:t,passive:!0}:t?"object"==typeof t&&!1!==t.passive?Object.assign(Object.assign({},t),{passive:!0}):t:{passive:!0}:t}n&&n.prepend&&(O=y[Xo(n.prepend)]=y[n.prepend]);const R=function(t){return O.call(E.target,E.eventName,t.invoke,E.options)},P=r?function(t){if(!E.isExisting)return T.call(E.target,E.eventName,E.capture?d:_,E.options)}:function(t){return T.call(E.target,E.eventName,t.invoke,E.options)},L=r?function(t){if(!t.isRemoved){const e=yi[t.eventName];let n;e&&(n=e[t.capture?Fo:Bo]);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,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)},A=n&&n.diff?n.diff:function(t,e){const n=typeof e;return"function"===n&&t.callback===e||"object"===n&&t.originalDelegate===e},C=Zone[Xo("UNPATCHED_EVENTS")],k=t[Xo("PASSIVE_EVENTS")],N=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(Jo&&"uncaughtException"===l)return e.apply(this,arguments);let _=!1;if("function"!=typeof p){if(!p.handleEvent)return e.apply(this,arguments);_=!0}if(f&&!f(e,p,c,arguments))return;const d=di&&!!k&&-1!==k.indexOf(l),v=w(arguments[2],d);if(C)for(let t=0;t<C.length;t++)if(l===C[t])return d?e.call(c,l,p,v):e.apply(this,arguments);const y=!!v&&("boolean"==typeof v||v.capture),T=!(!v||"object"!=typeof v)&&v.once,m=Zone.current;let S=yi[l];S||(mi(l,g),S=yi[l]);const b=S[y?Fo:Bo];let O,R=c[b],P=!1;if(R){if(P=!0,h)for(let t=0;t<R.length;t++)if(A(R[t],p))return}else R=c[b]=[];const L=c.constructor.name,N=gi[L];N&&(O=N[l]),O||(O=L+o+(g?g(l):l)),E.options=v,T&&(E.options.once=!1),E.target=c,E.capture=y,E.eventName=l,E.isExisting=P;const I=r?vi:void 0;I&&(I.taskData=E);const D=m.scheduleEventTask(O,p,I,i,a);return E.target=null,I&&(I.taskData=null),T&&(v.once=!0),(di||"boolean"!=typeof D.options)&&(D.options=v),D.target=c,D.capture=y,D.eventName=l,_&&(D.originalDelegate=p),u?R.unshift(D):R.push(D),s?c:void 0}};return y[o]=N(T,c,P,L,v),O&&(y[l]=N(O,p,R,L,v,!0)),y[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=yi[r];let u;s&&(u=s[i?Fo:Bo]);const c=u&&e[u];if(c)for(let t=0;t<c.length;t++){const n=c[t];if(A(n,a)){if(c.splice(t,1),n.isRemoved=!0,0===c.length&&(n.allRemoved=!0,e[u]=null,"string"==typeof r)){e[zo+"ON_PROPERTY"+r]=null}return n.zone.cancelTask(n),v?e:void 0}}return m.apply(this,arguments)},y[a]=function(){const e=this||t;let r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));const o=[],i=bi(e,g?g(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},y[s]=function(){const e=this||t;let r=arguments[0];if(r){n&&n.transferEventName&&(r=n.transferEventName(r));const t=yi[r];if(t){const n=t[Bo],o=t[Fo],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=Ei.exec(n);let o=r&&r[1];o&&"removeListener"!==o&&this[s].call(this,o)}this[s].call(this,"removeListener")}if(v)return this},li(y[o],T),li(y[i],m),b&&li(y[s],b),S&&li(y[a],S),!0}let y=[];for(let t=0;t<n.length;t++)y[t]=v(n[t],r);return y}function bi(t,e){if(!e){const n=[];for(let r in t){const o=Ei.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=yi[e];n||(mi(e),n=yi[e]);const r=t[n[Bo]],o=t[n[Fo]];return r?o?r.concat(o):r.slice():o?o.slice():[]}function Oi(t,e){const n=t.Event;n&&n.prototype&&e.patchMethod(n.prototype,"stopImmediatePropagation",(t=>function(e,n){e[Ti]=!0,t&&t.apply(e,n)}))}
46
46
  /**
47
47
  * @license
48
48
  * Copyright Google LLC All Rights Reserved.
49
49
  *
50
50
  * Use of this source code is governed by an MIT-style license that can be
51
51
  * found in the LICENSE file at https://angular.io/license
52
- */function ci(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(t){}})),a.call(e,i,s,u)},t.attachOriginToPatched(e[r],a)}
52
+ */function wi(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(t){}})),a.call(e,i,s,u)},t.attachOriginToPatched(e[r],a)}
53
53
  /**
54
54
  * @license
55
55
  * Copyright Google LLC All Rights Reserved.
56
56
  *
57
57
  * Use of this source code is governed by an MIT-style license that can be
58
58
  * found in the LICENSE file at https://angular.io/license
59
- */function li(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 pi(t,e,n,r){if(!t)return;zo(t,li(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 hi(t,e){if(jo&&!Zo)return;if(Zone[t.symbol("patchEvents")])return;const n=e.__Zone_ignore_on_properties;let r=[];if(Uo){const t=window;r=r.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);const e=$o()?[{target:t,ignoreProperties:["error"]}]:[];pi(t,fi(t),n?n.concat(e):n,Eo(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&&pi(o.prototype,fi(o.prototype),n)}}
59
+ */function Ri(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 Pi(t,e,n,r){if(!t)return;ii(t,Ri(t,e,n),r)}function Li(t){return Object.getOwnPropertyNames(t).filter((t=>t.startsWith("on")&&t.length>2)).map((t=>t.substring(2)))}function Ai(t,e){if(Jo&&!ei)return;if(Zone[t.symbol("patchEvents")])return;const n=e.__Zone_ignore_on_properties;let r=[];if(ti){const t=window;r=r.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);const e=hi()?[{target:t,ignoreProperties:["error"]}]:[];Pi(t,Li(t),n?n.concat(e):n,Do(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&&Pi(o.prototype,Li(o.prototype),n)}}
60
60
  /**
61
61
  * @license
62
62
  * Copyright Google LLC All Rights Reserved.
63
63
  *
64
64
  * Use of this source code is governed by an MIT-style license that can be
65
65
  * found in the LICENSE file at https://angular.io/license
66
- */Zone.__load_patch("util",((t,e,n)=>{const r=fi(t);n.patchOnProperties=zo,n.patchMethod=Xo,n.bindArguments=Do,n.patchMacroTask=qo;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=ui,n.patchEventTarget=ai,n.isIEOrEdge=Qo,n.ObjectDefineProperty=yo,n.ObjectGetOwnPropertyDescriptor=vo,n.ObjectCreate=To,n.ArraySlice=go,n.patchClass=Go,n.wrapWithCurrentZone=Lo,n.filterProperties=li,n.attachOriginToPatched=Wo,n._redefineProperty=Object.defineProperty,n.patchCallbacks=ci,n.getGlobalObjects=()=>({globalSources:ni,zoneSymbolEventNames:ei,eventNames:r,isBrowser:Uo,isMix:Zo,isNode:jo,TRUE_STR:wo,FALSE_STR:Ro,ZONE_SYMBOL_PREFIX:Po,ADD_EVENT_LISTENER_STR:mo,REMOVE_EVENT_LISTENER_STR:So})}));
66
+ */Zone.__load_patch("util",((t,e,n)=>{const r=Li(t);n.patchOnProperties=ii,n.patchMethod=ui,n.bindArguments=Ko,n.patchMacroTask=ci;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=Oi,n.patchEventTarget=Si,n.isIEOrEdge=_i,n.ObjectDefineProperty=Io,n.ObjectGetOwnPropertyDescriptor=No,n.ObjectCreate=Mo,n.ArraySlice=xo,n.patchClass=si,n.wrapWithCurrentZone=Vo,n.filterProperties=Ri,n.attachOriginToPatched=li,n._redefineProperty=Object.defineProperty,n.patchCallbacks=wi,n.getGlobalObjects=()=>({globalSources:gi,zoneSymbolEventNames:yi,eventNames:r,isBrowser:ti,isMix:ei,isNode:Jo,TRUE_STR:Fo,FALSE_STR:Bo,ZONE_SYMBOL_PREFIX:zo,ADD_EVENT_LISTENER_STR:jo,REMOVE_EVENT_LISTENER_STR:Uo})}));
67
67
  /**
68
68
  * @license
69
69
  * Copyright Google LLC All Rights Reserved.
@@ -71,7 +71,7 @@ let Jo=!1;if("undefined"!=typeof window)try{const t=Object.defineProperty({},"pa
71
71
  * Use of this source code is governed by an MIT-style license that can be
72
72
  * found in the LICENSE file at https://angular.io/license
73
73
  */
74
- const di=Co("zoneTask");function _i(t,e,n,r){let o=null,i=null;n+=r;const a={};function s(e){const n=e.data;return n.args[0]=function(){return e.invoke.apply(this,arguments)},n.handleId=o.apply(t,n.args),e}function u(e){return i.call(t,e.data.handleId)}o=Xo(t,e+=r,(n=>function(o,i){if("function"==typeof i[0]){const t={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{t.isPeriodic||("number"==typeof t.handleId?delete a[t.handleId]:t.handleId&&(t.handleId[di]=null))}};const o=Ao(e,i[0],t,s,u);if(!o)return o;const c=o.data.handleId;return"number"==typeof c?a[c]=o:c&&(c[di]=o),c&&c.ref&&c.unref&&"function"==typeof c.ref&&"function"==typeof c.unref&&(o.ref=c.ref.bind(c),o.unref=c.unref.bind(c)),"number"==typeof c||c?c:o}return n.apply(t,i)})),i=Xo(t,n,(e=>function(n,r){const o=r[0];let i;"number"==typeof o?i=a[o]:(i=o&&o[di],i||(i=o)),i&&"string"==typeof i.type?"notScheduled"!==i.state&&(i.cancelFn&&i.data.isPeriodic||0===i.runCount)&&("number"==typeof o?delete a[o]:o&&(o[di]=null),i.zone.cancelTask(i)):e.apply(t,r)}))}
74
+ const Ci=Xo("zoneTask");function ki(t,e,n,r){let o=null,i=null;n+=r;const a={};function s(e){const n=e.data;return n.args[0]=function(){return e.invoke.apply(this,arguments)},n.handleId=o.apply(t,n.args),e}function u(e){return i.call(t,e.data.handleId)}o=ui(t,e+=r,(n=>function(o,i){if("function"==typeof i[0]){const t={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{t.isPeriodic||("number"==typeof t.handleId?delete a[t.handleId]:t.handleId&&(t.handleId[Ci]=null))}};const o=Go(e,i[0],t,s,u);if(!o)return o;const c=o.data.handleId;return"number"==typeof c?a[c]=o:c&&(c[Ci]=o),c&&c.ref&&c.unref&&"function"==typeof c.ref&&"function"==typeof c.unref&&(o.ref=c.ref.bind(c),o.unref=c.unref.bind(c)),"number"==typeof c||c?c:o}return n.apply(t,i)})),i=ui(t,n,(e=>function(n,r){const o=r[0];let i;"number"==typeof o?i=a[o]:(i=o&&o[Ci],i||(i=o)),i&&"string"==typeof i.type?"notScheduled"!==i.state&&(i.cancelFn&&i.data.isPeriodic||0===i.runCount)&&("number"==typeof o?delete a[o]:o&&(o[Ci]=null),i.zone.cancelTask(i)):e.apply(t,r)}))}
75
75
  /**
76
76
  * @license
77
77
  * Copyright Google LLC All Rights Reserved.
@@ -86,7 +86,7 @@ const di=Co("zoneTask");function _i(t,e,n,r){let o=null,i=null;n+=r;const a={};f
86
86
  * Use of this source code is governed by an MIT-style license that can be
87
87
  * found in the LICENSE file at https://angular.io/license
88
88
  */
89
- function vi(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}
89
+ function Ni(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}
90
90
  /**
91
91
  * @license
92
92
  * Copyright Google LLC All Rights Reserved.
@@ -94,4 +94,4 @@ function vi(t,e){if(Zone[e.symbol("patchEventTarget")])return;const{eventNames:n
94
94
  * Use of this source code is governed by an MIT-style license that can be
95
95
  * found in the LICENSE file at https://angular.io/license
96
96
  */
97
- Zone.__load_patch("legacy",(t=>{const e=t[Zone.__symbol__("legacyPatch")];e&&e()})),Zone.__load_patch("queueMicrotask",((t,e,n)=>{n.patchMethod(t,"queueMicrotask",(t=>function(t,n){e.current.scheduleMicroTask("queueMicrotask",n[0])}))})),Zone.__load_patch("timers",(t=>{const e="set",n="clear";_i(t,e,n,"Timeout"),_i(t,e,n,"Interval"),_i(t,e,n,"Immediate")})),Zone.__load_patch("requestAnimationFrame",(t=>{_i(t,"request","cancel","AnimationFrame"),_i(t,"mozRequest","mozCancel","AnimationFrame"),_i(t,"webkitRequest","webkitCancel","AnimationFrame")})),Zone.__load_patch("blocking",((t,e)=>{const n=["alert","prompt","confirm"];for(let r=0;r<n.length;r++){Xo(t,n[r],((n,r,o)=>function(r,i){return e.current.run(n,t,i,o)}))}})),Zone.__load_patch("EventTarget",((t,e,n)=>{!function(t,e){e.patchEventPrototype(t,e)}(t,n),vi(t,n);const r=t.XMLHttpRequestEventTarget;r&&r.prototype&&n.patchEventTarget(t,n,[r.prototype])})),Zone.__load_patch("MutationObserver",((t,e,n)=>{Go("MutationObserver"),Go("WebKitMutationObserver")})),Zone.__load_patch("IntersectionObserver",((t,e,n)=>{Go("IntersectionObserver")})),Zone.__load_patch("FileReader",((t,e,n)=>{Go("FileReader")})),Zone.__load_patch("on_property",((t,e,n)=>{hi(n,t)})),Zone.__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"])}(t,n)})),Zone.__load_patch("XHR",((t,e)=>{!function(t){const u=t.XMLHttpRequest;if(!u)return;const c=u.prototype;let l=c[bo],p=c[Oo];if(!l){const e=t.XMLHttpRequestEventTarget;if(e){const t=e.prototype;l=t[bo],p=t[Oo]}}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[bo],p=a[Oo]),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),g.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 y=Xo(c,"open",(()=>function(t,e){return t[r]=0==e[2],t[a]=e[1],y.apply(t,e)})),E=Co("fetchTaskAborting"),T=Co("fetchTaskScheduling"),g=Xo(c,"send",(()=>function(t,n){if(!0===e.current[T])return g.apply(t,n);if(t[r])return g.apply(t,n);{const e={target:t,url:t[a],isPeriodic:!1,args:n,aborted:!1},r=Ao("XMLHttpRequest.send",_,e,d,v);t&&!0===t[s]&&!e.aborted&&r.state===h&&r.invoke()}})),m=Xo(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=Co("xhrTask"),r=Co("xhrSync"),o=Co("xhrListener"),i=Co("xhrScheduled"),a=Co("xhrURL"),s=Co("xhrErrorBeforeScheduled")})),Zone.__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(!Mo(vo(t,o)))continue;t[o]=(t=>{const e=function(){return t.apply(this,Do(arguments,n+"."+o))};return Wo(e,t),e})(i)}}}(t.navigator.geolocation,["getCurrentPosition","watchPosition"])})),Zone.__load_patch("PromiseRejectionEvent",((t,e)=>{function n(e){return function(n){si(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[Co("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),e[Co("rejectionHandledHandler")]=n("rejectionhandled"))}));class yi extends e.BaseInstrumentation{constructor(t={}){super(),this.options=t,this.name="@grafana/faro-web-tracing",this.version=e.VERSION}initialize(){var t,n,r,o;const i=e.faro.config,a=this.options,s={};i.app.name&&(s[De]=i.app.name),i.app.version&&(s[Me]=i.app.version),Object.assign(s,a.resourceAttributes);const u=Fn.default().merge(new Fn(s)),c=new Sr({resource:u});c.addSpanProcessor(null!==(t=a.spanProcessor)&&void 0!==t?t:new zn(new ar(new Bn({faro:e.faro}),{scheduledDelayMillis:yi.SCHEDULED_BATCH_DELAY_MS,maxExportBatchSize:30}))),c.register({propagator:null!==(n=a.propagator)&&void 0!==n?n:new sn,contextManager:null!==(r=a.contextManager)&&void 0!==r?r:new _o}),kr({instrumentations:null!==(o=a.instrumentations)&&void 0!==o?o:fo(this.getIgnoreUrls())}),e.faro.api.initOTEL(Vt,At)}getIgnoreUrls(){return e.faro.transports.transports.flatMap((t=>t.getIgnoreUrls()))}}return yi.SCHEDULED_BATCH_DELAY_MS=1e3,t.FaroSessionSpanProcessor=zn,t.FaroTraceExporter=Bn,t.TracingInstrumentation=yi,t.getDefaultOTELInstrumentations=fo,t}({},GrafanaFaroWebSdk);
97
+ Zone.__load_patch("legacy",(t=>{const e=t[Zone.__symbol__("legacyPatch")];e&&e()})),Zone.__load_patch("queueMicrotask",((t,e,n)=>{n.patchMethod(t,"queueMicrotask",(t=>function(t,n){e.current.scheduleMicroTask("queueMicrotask",n[0])}))})),Zone.__load_patch("timers",(t=>{const e="set",n="clear";ki(t,e,n,"Timeout"),ki(t,e,n,"Interval"),ki(t,e,n,"Immediate")})),Zone.__load_patch("requestAnimationFrame",(t=>{ki(t,"request","cancel","AnimationFrame"),ki(t,"mozRequest","mozCancel","AnimationFrame"),ki(t,"webkitRequest","webkitCancel","AnimationFrame")})),Zone.__load_patch("blocking",((t,e)=>{const n=["alert","prompt","confirm"];for(let r=0;r<n.length;r++){ui(t,n[r],((n,r,o)=>function(r,i){return e.current.run(n,t,i,o)}))}})),Zone.__load_patch("EventTarget",((t,e,n)=>{!function(t,e){e.patchEventPrototype(t,e)}(t,n),Ni(t,n);const r=t.XMLHttpRequestEventTarget;r&&r.prototype&&n.patchEventTarget(t,n,[r.prototype])})),Zone.__load_patch("MutationObserver",((t,e,n)=>{si("MutationObserver"),si("WebKitMutationObserver")})),Zone.__load_patch("IntersectionObserver",((t,e,n)=>{si("IntersectionObserver")})),Zone.__load_patch("FileReader",((t,e,n)=>{si("FileReader")})),Zone.__load_patch("on_property",((t,e,n)=>{Ai(n,t)})),Zone.__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"])}(t,n)})),Zone.__load_patch("XHR",((t,e)=>{!function(t){const u=t.XMLHttpRequest;if(!u)return;const c=u.prototype;let l=c[Zo],p=c[Ho];if(!l){const e=t.XMLHttpRequestEventTarget;if(e){const t=e.prototype;l=t[Zo],p=t[Ho]}}const f="readystatechange",h="scheduled";function _(t){const r=t.data,a=r.target;a[i]=!1,a[s]=!1;const u=a[o];l||(l=a[Zo],p=a[Ho]),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 d(){}function v(t){const e=t.data;return e.aborted=!0,m.apply(e.target,e.args)}const y=ui(c,"open",(()=>function(t,e){return t[r]=0==e[2],t[a]=e[1],y.apply(t,e)})),g=Xo("fetchTaskAborting"),E=Xo("fetchTaskScheduling"),T=ui(c,"send",(()=>function(t,n){if(!0===e.current[E])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=Go("XMLHttpRequest.send",d,e,_,v);t&&!0===t[s]&&!e.aborted&&r.state===h&&r.invoke()}})),m=ui(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[g])return m.apply(t,r)}))}(t);const n=Xo("xhrTask"),r=Xo("xhrSync"),o=Xo("xhrListener"),i=Xo("xhrScheduled"),a=Xo("xhrURL"),s=Xo("xhrErrorBeforeScheduled")})),Zone.__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(!$o(No(t,o)))continue;t[o]=(t=>{const e=function(){return t.apply(this,Ko(arguments,n+"."+o))};return li(e,t),e})(i)}}}(t.navigator.geolocation,["getCurrentPosition","watchPosition"])})),Zone.__load_patch("PromiseRejectionEvent",((t,e)=>{function n(e){return function(n){bi(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[Xo("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),e[Xo("rejectionHandledHandler")]=n("rejectionhandled"))}));class Ii 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;const o=this.options,i={};this.config.app.name&&(i[Ue]=this.config.app.name),this.config.app.version&&(i[Ze]=this.config.app.version),Object.assign(i,o.resourceAttributes);const a=Wn.default().merge(new Wn(i)),s=new Ar({resource:a});s.addSpanProcessor(null!==(t=o.spanProcessor)&&void 0!==t?t:new Kn(new hr(new Yn({api:this.api}),{scheduledDelayMillis:Ii.SCHEDULED_BATCH_DELAY_MS,maxExportBatchSize:30}),this.metas)),s.register({propagator:null!==(e=o.propagator)&&void 0!==e?e:new _n,contextManager:null!==(n=o.contextManager)&&void 0!==n?n:new ko}),eo({instrumentations:null!==(r=o.instrumentations)&&void 0!==r?r:Ao(this.getIgnoreUrls())}),this.api.initOTEL(Gt,At)}getIgnoreUrls(){return this.transports.transports.flatMap((t=>t.getIgnoreUrls()))}}return Ii.SCHEDULED_BATCH_DELAY_MS=1e3,t.FaroSessionSpanProcessor=Kn,t.FaroTraceExporter=Yn,t.TracingInstrumentation=Ii,t.getDefaultOTELInstrumentations=Ao,t}({},GrafanaFaroWebSdk);
@@ -9,7 +9,7 @@ var FaroTraceExporter = /** @class */ (function () {
9
9
  }
10
10
  FaroTraceExporter.prototype.export = function (spans, resultCallback) {
11
11
  var traceEvent = (0, otlp_transformer_1.createExportTraceServiceRequest)(spans, true);
12
- this.config.faro.api.pushTraces(traceEvent);
12
+ this.config.api.pushTraces(traceEvent);
13
13
  resultCallback({ code: core_1.ExportResultCode.SUCCESS });
14
14
  };
15
15
  FaroTraceExporter.prototype.shutdown = function () {
@@ -1 +1 @@
1
- {"version":3,"file":"faroTraceExporter.js","sourceRoot":"","sources":["../../src/faroTraceExporter.ts"],"names":[],"mappings":";;;AAAA,4CAAuD;AAEvD,oEAAkF;AAKlF;IACE,2BAAoB,MAA+B;QAA/B,WAAM,GAAN,MAAM,CAAyB;IAAG,CAAC;IAEvD,kCAAM,GAAN,UAAO,KAAqB,EAAE,cAA8C;QAC1E,IAAM,UAAU,GAAG,IAAA,kDAA+B,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAEhE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAE5C,cAAc,CAAC,EAAE,IAAI,EAAE,uBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,oCAAQ,GAAR;QACE,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IACH,wBAAC;AAAD,CAAC,AAdD,IAcC;AAdY,8CAAiB","sourcesContent":["import { ExportResultCode } from '@opentelemetry/core';\nimport type { ExportResult } from '@opentelemetry/core';\nimport { createExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';\nimport type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';\n\nimport type { FaroTraceExporterConfig } from './types';\n\nexport class FaroTraceExporter implements SpanExporter {\n constructor(private config: FaroTraceExporterConfig) {}\n\n export(spans: ReadableSpan[], resultCallback: (result: ExportResult) => void): void {\n const traceEvent = createExportTraceServiceRequest(spans, true);\n\n this.config.faro.api.pushTraces(traceEvent);\n\n resultCallback({ code: ExportResultCode.SUCCESS });\n }\n\n shutdown(): Promise<void> {\n return Promise.resolve(undefined);\n }\n}\n"]}
1
+ {"version":3,"file":"faroTraceExporter.js","sourceRoot":"","sources":["../../src/faroTraceExporter.ts"],"names":[],"mappings":";;;AAAA,4CAAuD;AAEvD,oEAAkF;AAKlF;IACE,2BAAoB,MAA+B;QAA/B,WAAM,GAAN,MAAM,CAAyB;IAAG,CAAC;IAEvD,kCAAM,GAAN,UAAO,KAAqB,EAAE,cAA8C;QAC1E,IAAM,UAAU,GAAG,IAAA,kDAA+B,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAEhE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAEvC,cAAc,CAAC,EAAE,IAAI,EAAE,uBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,oCAAQ,GAAR;QACE,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IACH,wBAAC;AAAD,CAAC,AAdD,IAcC;AAdY,8CAAiB","sourcesContent":["import { ExportResultCode } from '@opentelemetry/core';\nimport type { ExportResult } from '@opentelemetry/core';\nimport { createExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';\nimport type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';\n\nimport type { FaroTraceExporterConfig } from './types';\n\nexport class FaroTraceExporter implements SpanExporter {\n constructor(private config: FaroTraceExporterConfig) {}\n\n export(spans: ReadableSpan[], resultCallback: (result: ExportResult) => void): void {\n const traceEvent = createExportTraceServiceRequest(spans, true);\n\n this.config.api.pushTraces(traceEvent);\n\n resultCallback({ code: ExportResultCode.SUCCESS });\n }\n\n shutdown(): Promise<void> {\n return Promise.resolve(undefined);\n }\n}\n"]}
@@ -43,22 +43,21 @@ var TracingInstrumentation = /** @class */ (function (_super) {
43
43
  }
44
44
  TracingInstrumentation.prototype.initialize = function () {
45
45
  var _a, _b, _c, _d;
46
- var config = faro_web_sdk_1.faro.config;
47
46
  var options = this.options;
48
47
  var attributes = {};
49
- if (config.app.name) {
50
- attributes[semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME] = config.app.name;
48
+ if (this.config.app.name) {
49
+ attributes[semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME] = this.config.app.name;
51
50
  }
52
- if (config.app.version) {
53
- attributes[semantic_conventions_1.SemanticResourceAttributes.SERVICE_VERSION] = config.app.version;
51
+ if (this.config.app.version) {
52
+ attributes[semantic_conventions_1.SemanticResourceAttributes.SERVICE_VERSION] = this.config.app.version;
54
53
  }
55
54
  Object.assign(attributes, options.resourceAttributes);
56
55
  var resource = resources_1.Resource.default().merge(new resources_1.Resource(attributes));
57
56
  var provider = new sdk_trace_web_1.WebTracerProvider({ resource: resource });
58
- provider.addSpanProcessor((_a = options.spanProcessor) !== null && _a !== void 0 ? _a : new sessionSpanProcessor_1.FaroSessionSpanProcessor(new sdk_trace_base_1.BatchSpanProcessor(new faroTraceExporter_1.FaroTraceExporter({ faro: faro_web_sdk_1.faro }), {
57
+ provider.addSpanProcessor((_a = options.spanProcessor) !== null && _a !== void 0 ? _a : new sessionSpanProcessor_1.FaroSessionSpanProcessor(new sdk_trace_base_1.BatchSpanProcessor(new faroTraceExporter_1.FaroTraceExporter({ api: this.api }), {
59
58
  scheduledDelayMillis: TracingInstrumentation.SCHEDULED_BATCH_DELAY_MS,
60
59
  maxExportBatchSize: 30,
61
- })));
60
+ }), this.metas));
62
61
  provider.register({
63
62
  propagator: (_b = options.propagator) !== null && _b !== void 0 ? _b : new core_1.W3CTraceContextPropagator(),
64
63
  contextManager: (_c = options.contextManager) !== null && _c !== void 0 ? _c : new context_zone_1.ZoneContextManager(),
@@ -66,10 +65,10 @@ var TracingInstrumentation = /** @class */ (function (_super) {
66
65
  (0, instrumentation_1.registerInstrumentations)({
67
66
  instrumentations: (_d = options.instrumentations) !== null && _d !== void 0 ? _d : (0, getDefaultOTELInstrumentations_1.getDefaultOTELInstrumentations)(this.getIgnoreUrls()),
68
67
  });
69
- faro_web_sdk_1.faro.api.initOTEL(api_1.trace, api_1.context);
68
+ this.api.initOTEL(api_1.trace, api_1.context);
70
69
  };
71
70
  TracingInstrumentation.prototype.getIgnoreUrls = function () {
72
- return faro_web_sdk_1.faro.transports.transports.flatMap(function (transport) { return transport.getIgnoreUrls(); });
71
+ return this.transports.transports.flatMap(function (transport) { return transport.getIgnoreUrls(); });
73
72
  };
74
73
  TracingInstrumentation.SCHEDULED_BATCH_DELAY_MS = 1000;
75
74
  return TracingInstrumentation;
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../src/instrumentation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,0CAAoD;AACpD,4DAAiE;AACjE,4CAAgE;AAChE,kEAA0E;AAC1E,sDAAwE;AACxE,gEAAmE;AACnE,8DAAiE;AACjE,4EAAiF;AAEjF,sDAA2E;AAE3E,yDAAwD;AACxD,mFAAkF;AAClF,+DAAkE;AAGlE,8CAA8C;AAC9C,gEAAgE;AAChE,0BAA0B;AAE1B;IAA4C,0CAAmB;IAM7D,gCAAoB,OAA2C;QAA3C,wBAAA,EAAA,YAA2C;QAA/D,YACE,iBAAO,SACR;QAFmB,aAAO,GAAP,OAAO,CAAoC;QAL/D,UAAI,GAAG,2BAA2B,CAAC;QACnC,aAAO,GAAG,sBAAO,CAAC;;IAMlB,CAAC;IAED,2CAAU,GAAV;;QACE,IAAM,MAAM,GAAG,mBAAI,CAAC,MAAM,CAAC;QAC3B,IAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAM,UAAU,GAAuB,EAAE,CAAC;QAE1C,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE;YACnB,UAAU,CAAC,iDAA0B,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;SACvE;QAED,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE;YACtB,UAAU,CAAC,iDAA0B,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;SAC7E;QAED,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAEtD,IAAM,QAAQ,GAAG,oBAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,oBAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;QAEpE,IAAM,QAAQ,GAAG,IAAI,iCAAiB,CAAC,EAAE,QAAQ,UAAA,EAAE,CAAC,CAAC;QAErD,QAAQ,CAAC,gBAAgB,CACvB,MAAA,OAAO,CAAC,aAAa,mCACnB,IAAI,+CAAwB,CAC1B,IAAI,mCAAkB,CAAC,IAAI,qCAAiB,CAAC,EAAE,IAAI,qBAAA,EAAE,CAAC,EAAE;YACtD,oBAAoB,EAAE,sBAAsB,CAAC,wBAAwB;YACrE,kBAAkB,EAAE,EAAE;SACvB,CAAC,CACH,CACJ,CAAC;QAEF,QAAQ,CAAC,QAAQ,CAAC;YAChB,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,gCAAyB,EAAE;YACjE,cAAc,EAAE,MAAA,OAAO,CAAC,cAAc,mCAAI,IAAI,iCAAkB,EAAE;SACnE,CAAC,CAAC;QAEH,IAAA,0CAAwB,EAAC;YACvB,gBAAgB,EAAE,MAAA,OAAO,CAAC,gBAAgB,mCAAI,IAAA,+DAA8B,EAAC,IAAI,CAAC,aAAa,EAAE,CAAC;SACnG,CAAC,CAAC;QAEH,mBAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,WAAK,EAAE,aAAO,CAAC,CAAC;IACpC,CAAC;IAEO,8CAAa,GAArB;QACE,OAAO,mBAAI,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,SAAS,IAAK,OAAA,SAAS,CAAC,aAAa,EAAE,EAAzB,CAAyB,CAAC,CAAC;IACtF,CAAC;IAjDM,+CAAwB,GAAG,IAAI,CAAC;IAkDzC,6BAAC;CAAA,AAtDD,CAA4C,kCAAmB,GAsD9D;AAtDY,wDAAsB","sourcesContent":["import { context, trace } from '@opentelemetry/api';\nimport { ZoneContextManager } from '@opentelemetry/context-zone';\nimport { W3CTraceContextPropagator } from '@opentelemetry/core';\nimport { registerInstrumentations } from '@opentelemetry/instrumentation';\nimport { Resource, ResourceAttributes } from '@opentelemetry/resources';\nimport { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport { WebTracerProvider } from '@opentelemetry/sdk-trace-web';\nimport { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';\n\nimport { BaseInstrumentation, faro, VERSION } from '@grafana/faro-web-sdk';\n\nimport { FaroTraceExporter } from './faroTraceExporter';\nimport { getDefaultOTELInstrumentations } from './getDefaultOTELInstrumentations';\nimport { FaroSessionSpanProcessor } from './sessionSpanProcessor';\nimport type { TracingInstrumentationOptions } from './types';\n\n// the providing of app name here is not great\n// should delay initialization and provide the full Faro config,\n// taking app name from it\n\nexport class TracingInstrumentation extends BaseInstrumentation {\n name = '@grafana/faro-web-tracing';\n version = VERSION;\n\n static SCHEDULED_BATCH_DELAY_MS = 1000;\n\n constructor(private options: TracingInstrumentationOptions = {}) {\n super();\n }\n\n initialize(): void {\n const config = faro.config;\n const options = this.options;\n const attributes: ResourceAttributes = {};\n\n if (config.app.name) {\n attributes[SemanticResourceAttributes.SERVICE_NAME] = config.app.name;\n }\n\n if (config.app.version) {\n attributes[SemanticResourceAttributes.SERVICE_VERSION] = config.app.version;\n }\n\n Object.assign(attributes, options.resourceAttributes);\n\n const resource = Resource.default().merge(new Resource(attributes));\n\n const provider = new WebTracerProvider({ resource });\n\n provider.addSpanProcessor(\n options.spanProcessor ??\n new FaroSessionSpanProcessor(\n new BatchSpanProcessor(new FaroTraceExporter({ faro }), {\n scheduledDelayMillis: TracingInstrumentation.SCHEDULED_BATCH_DELAY_MS,\n maxExportBatchSize: 30,\n })\n )\n );\n\n provider.register({\n propagator: options.propagator ?? new W3CTraceContextPropagator(),\n contextManager: options.contextManager ?? new ZoneContextManager(),\n });\n\n registerInstrumentations({\n instrumentations: options.instrumentations ?? getDefaultOTELInstrumentations(this.getIgnoreUrls()),\n });\n\n faro.api.initOTEL(trace, context);\n }\n\n private getIgnoreUrls(): Array<string | RegExp> {\n return faro.transports.transports.flatMap((transport) => transport.getIgnoreUrls());\n }\n}\n"]}
1
+ {"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../src/instrumentation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,0CAAoD;AACpD,4DAAiE;AACjE,4CAAgE;AAChE,kEAA0E;AAC1E,sDAAwE;AACxE,gEAAmE;AACnE,8DAAiE;AACjE,4EAAiF;AAEjF,sDAAqE;AAErE,yDAAwD;AACxD,mFAAkF;AAClF,+DAAkE;AAGlE,8CAA8C;AAC9C,gEAAgE;AAChE,0BAA0B;AAE1B;IAA4C,0CAAmB;IAM7D,gCAAoB,OAA2C;QAA3C,wBAAA,EAAA,YAA2C;QAA/D,YACE,iBAAO,SACR;QAFmB,aAAO,GAAP,OAAO,CAAoC;QAL/D,UAAI,GAAG,2BAA2B,CAAC;QACnC,aAAO,GAAG,sBAAO,CAAC;;IAMlB,CAAC;IAED,2CAAU,GAAV;;QACE,IAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAM,UAAU,GAAuB,EAAE,CAAC;QAE1C,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE;YACxB,UAAU,CAAC,iDAA0B,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;SAC5E;QAED,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE;YAC3B,UAAU,CAAC,iDAA0B,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;SAClF;QAED,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAEtD,IAAM,QAAQ,GAAG,oBAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,oBAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;QAEpE,IAAM,QAAQ,GAAG,IAAI,iCAAiB,CAAC,EAAE,QAAQ,UAAA,EAAE,CAAC,CAAC;QAErD,QAAQ,CAAC,gBAAgB,CACvB,MAAA,OAAO,CAAC,aAAa,mCACnB,IAAI,+CAAwB,CAC1B,IAAI,mCAAkB,CAAC,IAAI,qCAAiB,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE;YAC/D,oBAAoB,EAAE,sBAAsB,CAAC,wBAAwB;YACrE,kBAAkB,EAAE,EAAE;SACvB,CAAC,EACF,IAAI,CAAC,KAAK,CACX,CACJ,CAAC;QAEF,QAAQ,CAAC,QAAQ,CAAC;YAChB,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,gCAAyB,EAAE;YACjE,cAAc,EAAE,MAAA,OAAO,CAAC,cAAc,mCAAI,IAAI,iCAAkB,EAAE;SACnE,CAAC,CAAC;QAEH,IAAA,0CAAwB,EAAC;YACvB,gBAAgB,EAAE,MAAA,OAAO,CAAC,gBAAgB,mCAAI,IAAA,+DAA8B,EAAC,IAAI,CAAC,aAAa,EAAE,CAAC;SACnG,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,WAAK,EAAE,aAAO,CAAC,CAAC;IACpC,CAAC;IAEO,8CAAa,GAArB;QACE,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,SAAS,IAAK,OAAA,SAAS,CAAC,aAAa,EAAE,EAAzB,CAAyB,CAAC,CAAC;IACtF,CAAC;IAjDM,+CAAwB,GAAG,IAAI,CAAC;IAkDzC,6BAAC;CAAA,AAtDD,CAA4C,kCAAmB,GAsD9D;AAtDY,wDAAsB","sourcesContent":["import { context, trace } from '@opentelemetry/api';\nimport { ZoneContextManager } from '@opentelemetry/context-zone';\nimport { W3CTraceContextPropagator } from '@opentelemetry/core';\nimport { registerInstrumentations } from '@opentelemetry/instrumentation';\nimport { Resource, ResourceAttributes } from '@opentelemetry/resources';\nimport { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport { WebTracerProvider } from '@opentelemetry/sdk-trace-web';\nimport { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';\n\nimport { BaseInstrumentation, VERSION } from '@grafana/faro-web-sdk';\n\nimport { FaroTraceExporter } from './faroTraceExporter';\nimport { getDefaultOTELInstrumentations } from './getDefaultOTELInstrumentations';\nimport { FaroSessionSpanProcessor } from './sessionSpanProcessor';\nimport type { TracingInstrumentationOptions } from './types';\n\n// the providing of app name here is not great\n// should delay initialization and provide the full Faro config,\n// taking app name from it\n\nexport class TracingInstrumentation extends BaseInstrumentation {\n name = '@grafana/faro-web-tracing';\n version = VERSION;\n\n static SCHEDULED_BATCH_DELAY_MS = 1000;\n\n constructor(private options: TracingInstrumentationOptions = {}) {\n super();\n }\n\n initialize(): void {\n const options = this.options;\n const attributes: ResourceAttributes = {};\n\n if (this.config.app.name) {\n attributes[SemanticResourceAttributes.SERVICE_NAME] = this.config.app.name;\n }\n\n if (this.config.app.version) {\n attributes[SemanticResourceAttributes.SERVICE_VERSION] = this.config.app.version;\n }\n\n Object.assign(attributes, options.resourceAttributes);\n\n const resource = Resource.default().merge(new Resource(attributes));\n\n const provider = new WebTracerProvider({ resource });\n\n provider.addSpanProcessor(\n options.spanProcessor ??\n new FaroSessionSpanProcessor(\n new BatchSpanProcessor(new FaroTraceExporter({ api: this.api }), {\n scheduledDelayMillis: TracingInstrumentation.SCHEDULED_BATCH_DELAY_MS,\n maxExportBatchSize: 30,\n }),\n this.metas\n )\n );\n\n provider.register({\n propagator: options.propagator ?? new W3CTraceContextPropagator(),\n contextManager: options.contextManager ?? new ZoneContextManager(),\n });\n\n registerInstrumentations({\n instrumentations: options.instrumentations ?? getDefaultOTELInstrumentations(this.getIgnoreUrls()),\n });\n\n this.api.initOTEL(trace, context);\n }\n\n private getIgnoreUrls(): Array<string | RegExp> {\n return this.transports.transports.flatMap((transport) => transport.getIgnoreUrls());\n }\n}\n"]}
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FaroSessionSpanProcessor = void 0;
4
- var faro_web_sdk_1 = require("@grafana/faro-web-sdk");
5
4
  // adds Faro session id to every span
6
5
  var FaroSessionSpanProcessor = /** @class */ (function () {
7
- function FaroSessionSpanProcessor(processor) {
6
+ function FaroSessionSpanProcessor(processor, metas) {
8
7
  this.processor = processor;
8
+ this.metas = metas;
9
9
  }
10
10
  FaroSessionSpanProcessor.prototype.forceFlush = function () {
11
11
  return this.processor.forceFlush();
12
12
  };
13
13
  FaroSessionSpanProcessor.prototype.onStart = function (span, parentContext) {
14
- var session = faro_web_sdk_1.faro.metas.value.session;
14
+ var session = this.metas.value.session;
15
15
  if (session === null || session === void 0 ? void 0 : session.id) {
16
16
  span.attributes['session_id'] = session.id;
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sessionSpanProcessor.js","sourceRoot":"","sources":["../../src/sessionSpanProcessor.ts"],"names":[],"mappings":";;;AAGA,sDAA6C;AAE7C,qCAAqC;AACrC;IAGE,kCAAY,SAAwB;QAClC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,6CAAU,GAAV;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;IACrC,CAAC;IAED,0CAAO,GAAP,UAAQ,IAAU,EAAE,aAAsB;QACxC,IAAM,OAAO,GAAG,mBAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;QAEzC,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,EAAE,EAAE;YACf,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC;SAC5C;QAED,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAC9C,CAAC;IAED,wCAAK,GAAL,UAAM,IAAkB;QACtB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,2CAAQ,GAAR;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;IACnC,CAAC;IACH,+BAAC;AAAD,CAAC,AA5BD,IA4BC;AA5BY,4DAAwB","sourcesContent":["import type { Context } from '@opentelemetry/api';\nimport type { ReadableSpan, Span, SpanProcessor } from '@opentelemetry/sdk-trace-base';\n\nimport { faro } from '@grafana/faro-web-sdk';\n\n// adds Faro session id to every span\nexport class FaroSessionSpanProcessor implements SpanProcessor {\n private processor: SpanProcessor;\n\n constructor(processor: SpanProcessor) {\n this.processor = processor;\n }\n\n forceFlush(): Promise<void> {\n return this.processor.forceFlush();\n }\n\n onStart(span: Span, parentContext: Context): void {\n const session = faro.metas.value.session;\n\n if (session?.id) {\n span.attributes['session_id'] = session.id;\n }\n\n this.processor.onStart(span, parentContext);\n }\n\n onEnd(span: ReadableSpan): void {\n this.processor.onEnd(span);\n }\n\n shutdown(): Promise<void> {\n return this.processor.shutdown();\n }\n}\n"]}
1
+ {"version":3,"file":"sessionSpanProcessor.js","sourceRoot":"","sources":["../../src/sessionSpanProcessor.ts"],"names":[],"mappings":";;;AAKA,qCAAqC;AACrC;IACE,kCAAoB,SAAwB,EAAU,KAAY;QAA9C,cAAS,GAAT,SAAS,CAAe;QAAU,UAAK,GAAL,KAAK,CAAO;IAAG,CAAC;IAEtE,6CAAU,GAAV;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;IACrC,CAAC;IAED,0CAAO,GAAP,UAAQ,IAAU,EAAE,aAAsB;QACxC,IAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;QAEzC,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,EAAE,EAAE;YACf,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC;SAC5C;QAED,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAC9C,CAAC;IAED,wCAAK,GAAL,UAAM,IAAkB;QACtB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,2CAAQ,GAAR;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;IACnC,CAAC;IACH,+BAAC;AAAD,CAAC,AAxBD,IAwBC;AAxBY,4DAAwB","sourcesContent":["import type { Context } from '@opentelemetry/api';\nimport type { ReadableSpan, Span, SpanProcessor } from '@opentelemetry/sdk-trace-base';\n\nimport type { Metas } from '@grafana/faro-web-sdk';\n\n// adds Faro session id to every span\nexport class FaroSessionSpanProcessor implements SpanProcessor {\n constructor(private processor: SpanProcessor, private metas: Metas) {}\n\n forceFlush(): Promise<void> {\n return this.processor.forceFlush();\n }\n\n onStart(span: Span, parentContext: Context): void {\n const session = this.metas.value.session;\n\n if (session?.id) {\n span.attributes['session_id'] = session.id;\n }\n\n this.processor.onStart(span, parentContext);\n }\n\n onEnd(span: ReadableSpan): void {\n this.processor.onEnd(span);\n }\n\n shutdown(): Promise<void> {\n return this.processor.shutdown();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContextManager, TextMapPropagator } from '@opentelemetry/api';\nimport type { InstrumentationOption } from '@opentelemetry/instrumentation';\nimport type { ResourceAttributes } from '@opentelemetry/resources';\nimport type { SpanProcessor } from '@opentelemetry/sdk-trace-base';\n\nimport type { Faro } from '@grafana/faro-web-sdk';\n\nexport interface FaroTraceExporterConfig {\n faro: Faro;\n}\n\nexport interface TracingInstrumentationOptions {\n resourceAttributes?: ResourceAttributes;\n propagator?: TextMapPropagator;\n contextManager?: ContextManager;\n instrumentations?: InstrumentationOption[];\n spanProcessor?: SpanProcessor;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContextManager, TextMapPropagator } from '@opentelemetry/api';\nimport type { InstrumentationOption } from '@opentelemetry/instrumentation';\nimport type { ResourceAttributes } from '@opentelemetry/resources';\nimport type { SpanProcessor } from '@opentelemetry/sdk-trace-base';\n\nimport type { API } from '@grafana/faro-web-sdk';\n\nexport interface FaroTraceExporterConfig {\n api: API;\n}\n\nexport interface TracingInstrumentationOptions {\n resourceAttributes?: ResourceAttributes;\n propagator?: TextMapPropagator;\n contextManager?: ContextManager;\n instrumentations?: InstrumentationOption[];\n spanProcessor?: SpanProcessor;\n}\n"]}
@@ -6,7 +6,7 @@ export class FaroTraceExporter {
6
6
  }
7
7
  export(spans, resultCallback) {
8
8
  const traceEvent = createExportTraceServiceRequest(spans, true);
9
- this.config.faro.api.pushTraces(traceEvent);
9
+ this.config.api.pushTraces(traceEvent);
10
10
  resultCallback({ code: ExportResultCode.SUCCESS });
11
11
  }
12
12
  shutdown() {
@@ -1 +1 @@
1
- {"version":3,"file":"faroTraceExporter.js","sourceRoot":"","sources":["../../src/faroTraceExporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC;AAKlF,MAAM,OAAO,iBAAiB;IAC5B,YAAoB,MAA+B;QAA/B,WAAM,GAAN,MAAM,CAAyB;IAAG,CAAC;IAEvD,MAAM,CAAC,KAAqB,EAAE,cAA8C;QAC1E,MAAM,UAAU,GAAG,+BAA+B,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAEhE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAE5C,cAAc,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,QAAQ;QACN,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;CACF","sourcesContent":["import { ExportResultCode } from '@opentelemetry/core';\nimport type { ExportResult } from '@opentelemetry/core';\nimport { createExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';\nimport type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';\n\nimport type { FaroTraceExporterConfig } from './types';\n\nexport class FaroTraceExporter implements SpanExporter {\n constructor(private config: FaroTraceExporterConfig) {}\n\n export(spans: ReadableSpan[], resultCallback: (result: ExportResult) => void): void {\n const traceEvent = createExportTraceServiceRequest(spans, true);\n\n this.config.faro.api.pushTraces(traceEvent);\n\n resultCallback({ code: ExportResultCode.SUCCESS });\n }\n\n shutdown(): Promise<void> {\n return Promise.resolve(undefined);\n }\n}\n"]}
1
+ {"version":3,"file":"faroTraceExporter.js","sourceRoot":"","sources":["../../src/faroTraceExporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC;AAKlF,MAAM,OAAO,iBAAiB;IAC5B,YAAoB,MAA+B;QAA/B,WAAM,GAAN,MAAM,CAAyB;IAAG,CAAC;IAEvD,MAAM,CAAC,KAAqB,EAAE,cAA8C;QAC1E,MAAM,UAAU,GAAG,+BAA+B,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAEhE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAEvC,cAAc,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,QAAQ;QACN,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;CACF","sourcesContent":["import { ExportResultCode } from '@opentelemetry/core';\nimport type { ExportResult } from '@opentelemetry/core';\nimport { createExportTraceServiceRequest } from '@opentelemetry/otlp-transformer';\nimport type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';\n\nimport type { FaroTraceExporterConfig } from './types';\n\nexport class FaroTraceExporter implements SpanExporter {\n constructor(private config: FaroTraceExporterConfig) {}\n\n export(spans: ReadableSpan[], resultCallback: (result: ExportResult) => void): void {\n const traceEvent = createExportTraceServiceRequest(spans, true);\n\n this.config.api.pushTraces(traceEvent);\n\n resultCallback({ code: ExportResultCode.SUCCESS });\n }\n\n shutdown(): Promise<void> {\n return Promise.resolve(undefined);\n }\n}\n"]}
@@ -6,7 +6,7 @@ import { Resource } from '@opentelemetry/resources';
6
6
  import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
7
7
  import { WebTracerProvider } from '@opentelemetry/sdk-trace-web';
8
8
  import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
9
- import { BaseInstrumentation, faro, VERSION } from '@grafana/faro-web-sdk';
9
+ import { BaseInstrumentation, VERSION } from '@grafana/faro-web-sdk';
10
10
  import { FaroTraceExporter } from './faroTraceExporter';
11
11
  import { getDefaultOTELInstrumentations } from './getDefaultOTELInstrumentations';
12
12
  import { FaroSessionSpanProcessor } from './sessionSpanProcessor';
@@ -22,22 +22,21 @@ export class TracingInstrumentation extends BaseInstrumentation {
22
22
  }
23
23
  initialize() {
24
24
  var _a, _b, _c, _d;
25
- const config = faro.config;
26
25
  const options = this.options;
27
26
  const attributes = {};
28
- if (config.app.name) {
29
- attributes[SemanticResourceAttributes.SERVICE_NAME] = config.app.name;
27
+ if (this.config.app.name) {
28
+ attributes[SemanticResourceAttributes.SERVICE_NAME] = this.config.app.name;
30
29
  }
31
- if (config.app.version) {
32
- attributes[SemanticResourceAttributes.SERVICE_VERSION] = config.app.version;
30
+ if (this.config.app.version) {
31
+ attributes[SemanticResourceAttributes.SERVICE_VERSION] = this.config.app.version;
33
32
  }
34
33
  Object.assign(attributes, options.resourceAttributes);
35
34
  const resource = Resource.default().merge(new Resource(attributes));
36
35
  const provider = new WebTracerProvider({ resource });
37
- provider.addSpanProcessor((_a = options.spanProcessor) !== null && _a !== void 0 ? _a : new FaroSessionSpanProcessor(new BatchSpanProcessor(new FaroTraceExporter({ faro }), {
36
+ provider.addSpanProcessor((_a = options.spanProcessor) !== null && _a !== void 0 ? _a : new FaroSessionSpanProcessor(new BatchSpanProcessor(new FaroTraceExporter({ api: this.api }), {
38
37
  scheduledDelayMillis: TracingInstrumentation.SCHEDULED_BATCH_DELAY_MS,
39
38
  maxExportBatchSize: 30,
40
- })));
39
+ }), this.metas));
41
40
  provider.register({
42
41
  propagator: (_b = options.propagator) !== null && _b !== void 0 ? _b : new W3CTraceContextPropagator(),
43
42
  contextManager: (_c = options.contextManager) !== null && _c !== void 0 ? _c : new ZoneContextManager(),
@@ -45,10 +44,10 @@ export class TracingInstrumentation extends BaseInstrumentation {
45
44
  registerInstrumentations({
46
45
  instrumentations: (_d = options.instrumentations) !== null && _d !== void 0 ? _d : getDefaultOTELInstrumentations(this.getIgnoreUrls()),
47
46
  });
48
- faro.api.initOTEL(trace, context);
47
+ this.api.initOTEL(trace, context);
49
48
  }
50
49
  getIgnoreUrls() {
51
- return faro.transports.transports.flatMap((transport) => transport.getIgnoreUrls());
50
+ return this.transports.transports.flatMap((transport) => transport.getIgnoreUrls());
52
51
  }
53
52
  }
54
53
  TracingInstrumentation.SCHEDULED_BATCH_DELAY_MS = 1000;
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../src/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAsB,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAEjF,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAE3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGlE,8CAA8C;AAC9C,gEAAgE;AAChE,0BAA0B;AAE1B,MAAM,OAAO,sBAAuB,SAAQ,mBAAmB;IAM7D,YAAoB,UAAyC,EAAE;QAC7D,KAAK,EAAE,CAAC;QADU,YAAO,GAAP,OAAO,CAAoC;QAL/D,SAAI,GAAG,2BAA2B,CAAC;QACnC,YAAO,GAAG,OAAO,CAAC;IAMlB,CAAC;IAED,UAAU;;QACR,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,MAAM,UAAU,GAAuB,EAAE,CAAC;QAE1C,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE;YACnB,UAAU,CAAC,0BAA0B,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;SACvE;QAED,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE;YACtB,UAAU,CAAC,0BAA0B,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;SAC7E;QAED,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAEtD,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;QAEpE,MAAM,QAAQ,GAAG,IAAI,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;QAErD,QAAQ,CAAC,gBAAgB,CACvB,MAAA,OAAO,CAAC,aAAa,mCACnB,IAAI,wBAAwB,CAC1B,IAAI,kBAAkB,CAAC,IAAI,iBAAiB,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;YACtD,oBAAoB,EAAE,sBAAsB,CAAC,wBAAwB;YACrE,kBAAkB,EAAE,EAAE;SACvB,CAAC,CACH,CACJ,CAAC;QAEF,QAAQ,CAAC,QAAQ,CAAC;YAChB,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,yBAAyB,EAAE;YACjE,cAAc,EAAE,MAAA,OAAO,CAAC,cAAc,mCAAI,IAAI,kBAAkB,EAAE;SACnE,CAAC,CAAC;QAEH,wBAAwB,CAAC;YACvB,gBAAgB,EAAE,MAAA,OAAO,CAAC,gBAAgB,mCAAI,8BAA8B,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;SACnG,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;IAEO,aAAa;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC,CAAC;IACtF,CAAC;;AAjDM,+CAAwB,GAAG,IAAI,CAAC","sourcesContent":["import { context, trace } from '@opentelemetry/api';\nimport { ZoneContextManager } from '@opentelemetry/context-zone';\nimport { W3CTraceContextPropagator } from '@opentelemetry/core';\nimport { registerInstrumentations } from '@opentelemetry/instrumentation';\nimport { Resource, ResourceAttributes } from '@opentelemetry/resources';\nimport { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport { WebTracerProvider } from '@opentelemetry/sdk-trace-web';\nimport { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';\n\nimport { BaseInstrumentation, faro, VERSION } from '@grafana/faro-web-sdk';\n\nimport { FaroTraceExporter } from './faroTraceExporter';\nimport { getDefaultOTELInstrumentations } from './getDefaultOTELInstrumentations';\nimport { FaroSessionSpanProcessor } from './sessionSpanProcessor';\nimport type { TracingInstrumentationOptions } from './types';\n\n// the providing of app name here is not great\n// should delay initialization and provide the full Faro config,\n// taking app name from it\n\nexport class TracingInstrumentation extends BaseInstrumentation {\n name = '@grafana/faro-web-tracing';\n version = VERSION;\n\n static SCHEDULED_BATCH_DELAY_MS = 1000;\n\n constructor(private options: TracingInstrumentationOptions = {}) {\n super();\n }\n\n initialize(): void {\n const config = faro.config;\n const options = this.options;\n const attributes: ResourceAttributes = {};\n\n if (config.app.name) {\n attributes[SemanticResourceAttributes.SERVICE_NAME] = config.app.name;\n }\n\n if (config.app.version) {\n attributes[SemanticResourceAttributes.SERVICE_VERSION] = config.app.version;\n }\n\n Object.assign(attributes, options.resourceAttributes);\n\n const resource = Resource.default().merge(new Resource(attributes));\n\n const provider = new WebTracerProvider({ resource });\n\n provider.addSpanProcessor(\n options.spanProcessor ??\n new FaroSessionSpanProcessor(\n new BatchSpanProcessor(new FaroTraceExporter({ faro }), {\n scheduledDelayMillis: TracingInstrumentation.SCHEDULED_BATCH_DELAY_MS,\n maxExportBatchSize: 30,\n })\n )\n );\n\n provider.register({\n propagator: options.propagator ?? new W3CTraceContextPropagator(),\n contextManager: options.contextManager ?? new ZoneContextManager(),\n });\n\n registerInstrumentations({\n instrumentations: options.instrumentations ?? getDefaultOTELInstrumentations(this.getIgnoreUrls()),\n });\n\n faro.api.initOTEL(trace, context);\n }\n\n private getIgnoreUrls(): Array<string | RegExp> {\n return faro.transports.transports.flatMap((transport) => transport.getIgnoreUrls());\n }\n}\n"]}
1
+ {"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../src/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAsB,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAEjF,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGlE,8CAA8C;AAC9C,gEAAgE;AAChE,0BAA0B;AAE1B,MAAM,OAAO,sBAAuB,SAAQ,mBAAmB;IAM7D,YAAoB,UAAyC,EAAE;QAC7D,KAAK,EAAE,CAAC;QADU,YAAO,GAAP,OAAO,CAAoC;QAL/D,SAAI,GAAG,2BAA2B,CAAC;QACnC,YAAO,GAAG,OAAO,CAAC;IAMlB,CAAC;IAED,UAAU;;QACR,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,MAAM,UAAU,GAAuB,EAAE,CAAC;QAE1C,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE;YACxB,UAAU,CAAC,0BAA0B,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;SAC5E;QAED,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE;YAC3B,UAAU,CAAC,0BAA0B,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;SAClF;QAED,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAEtD,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;QAEpE,MAAM,QAAQ,GAAG,IAAI,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;QAErD,QAAQ,CAAC,gBAAgB,CACvB,MAAA,OAAO,CAAC,aAAa,mCACnB,IAAI,wBAAwB,CAC1B,IAAI,kBAAkB,CAAC,IAAI,iBAAiB,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE;YAC/D,oBAAoB,EAAE,sBAAsB,CAAC,wBAAwB;YACrE,kBAAkB,EAAE,EAAE;SACvB,CAAC,EACF,IAAI,CAAC,KAAK,CACX,CACJ,CAAC;QAEF,QAAQ,CAAC,QAAQ,CAAC;YAChB,UAAU,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI,yBAAyB,EAAE;YACjE,cAAc,EAAE,MAAA,OAAO,CAAC,cAAc,mCAAI,IAAI,kBAAkB,EAAE;SACnE,CAAC,CAAC;QAEH,wBAAwB,CAAC;YACvB,gBAAgB,EAAE,MAAA,OAAO,CAAC,gBAAgB,mCAAI,8BAA8B,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;SACnG,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;IAEO,aAAa;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC,CAAC;IACtF,CAAC;;AAjDM,+CAAwB,GAAG,IAAI,CAAC","sourcesContent":["import { context, trace } from '@opentelemetry/api';\nimport { ZoneContextManager } from '@opentelemetry/context-zone';\nimport { W3CTraceContextPropagator } from '@opentelemetry/core';\nimport { registerInstrumentations } from '@opentelemetry/instrumentation';\nimport { Resource, ResourceAttributes } from '@opentelemetry/resources';\nimport { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport { WebTracerProvider } from '@opentelemetry/sdk-trace-web';\nimport { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';\n\nimport { BaseInstrumentation, VERSION } from '@grafana/faro-web-sdk';\n\nimport { FaroTraceExporter } from './faroTraceExporter';\nimport { getDefaultOTELInstrumentations } from './getDefaultOTELInstrumentations';\nimport { FaroSessionSpanProcessor } from './sessionSpanProcessor';\nimport type { TracingInstrumentationOptions } from './types';\n\n// the providing of app name here is not great\n// should delay initialization and provide the full Faro config,\n// taking app name from it\n\nexport class TracingInstrumentation extends BaseInstrumentation {\n name = '@grafana/faro-web-tracing';\n version = VERSION;\n\n static SCHEDULED_BATCH_DELAY_MS = 1000;\n\n constructor(private options: TracingInstrumentationOptions = {}) {\n super();\n }\n\n initialize(): void {\n const options = this.options;\n const attributes: ResourceAttributes = {};\n\n if (this.config.app.name) {\n attributes[SemanticResourceAttributes.SERVICE_NAME] = this.config.app.name;\n }\n\n if (this.config.app.version) {\n attributes[SemanticResourceAttributes.SERVICE_VERSION] = this.config.app.version;\n }\n\n Object.assign(attributes, options.resourceAttributes);\n\n const resource = Resource.default().merge(new Resource(attributes));\n\n const provider = new WebTracerProvider({ resource });\n\n provider.addSpanProcessor(\n options.spanProcessor ??\n new FaroSessionSpanProcessor(\n new BatchSpanProcessor(new FaroTraceExporter({ api: this.api }), {\n scheduledDelayMillis: TracingInstrumentation.SCHEDULED_BATCH_DELAY_MS,\n maxExportBatchSize: 30,\n }),\n this.metas\n )\n );\n\n provider.register({\n propagator: options.propagator ?? new W3CTraceContextPropagator(),\n contextManager: options.contextManager ?? new ZoneContextManager(),\n });\n\n registerInstrumentations({\n instrumentations: options.instrumentations ?? getDefaultOTELInstrumentations(this.getIgnoreUrls()),\n });\n\n this.api.initOTEL(trace, context);\n }\n\n private getIgnoreUrls(): Array<string | RegExp> {\n return this.transports.transports.flatMap((transport) => transport.getIgnoreUrls());\n }\n}\n"]}
@@ -1,14 +1,14 @@
1
- import { faro } from '@grafana/faro-web-sdk';
2
1
  // adds Faro session id to every span
3
2
  export class FaroSessionSpanProcessor {
4
- constructor(processor) {
3
+ constructor(processor, metas) {
5
4
  this.processor = processor;
5
+ this.metas = metas;
6
6
  }
7
7
  forceFlush() {
8
8
  return this.processor.forceFlush();
9
9
  }
10
10
  onStart(span, parentContext) {
11
- const session = faro.metas.value.session;
11
+ const session = this.metas.value.session;
12
12
  if (session === null || session === void 0 ? void 0 : session.id) {
13
13
  span.attributes['session_id'] = session.id;
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sessionSpanProcessor.js","sourceRoot":"","sources":["../../src/sessionSpanProcessor.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,qCAAqC;AACrC,MAAM,OAAO,wBAAwB;IAGnC,YAAY,SAAwB;QAClC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;IACrC,CAAC;IAED,OAAO,CAAC,IAAU,EAAE,aAAsB;QACxC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;QAEzC,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,EAAE,EAAE;YACf,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC;SAC5C;QAED,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,IAAkB;QACtB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;IACnC,CAAC;CACF","sourcesContent":["import type { Context } from '@opentelemetry/api';\nimport type { ReadableSpan, Span, SpanProcessor } from '@opentelemetry/sdk-trace-base';\n\nimport { faro } from '@grafana/faro-web-sdk';\n\n// adds Faro session id to every span\nexport class FaroSessionSpanProcessor implements SpanProcessor {\n private processor: SpanProcessor;\n\n constructor(processor: SpanProcessor) {\n this.processor = processor;\n }\n\n forceFlush(): Promise<void> {\n return this.processor.forceFlush();\n }\n\n onStart(span: Span, parentContext: Context): void {\n const session = faro.metas.value.session;\n\n if (session?.id) {\n span.attributes['session_id'] = session.id;\n }\n\n this.processor.onStart(span, parentContext);\n }\n\n onEnd(span: ReadableSpan): void {\n this.processor.onEnd(span);\n }\n\n shutdown(): Promise<void> {\n return this.processor.shutdown();\n }\n}\n"]}
1
+ {"version":3,"file":"sessionSpanProcessor.js","sourceRoot":"","sources":["../../src/sessionSpanProcessor.ts"],"names":[],"mappings":"AAKA,qCAAqC;AACrC,MAAM,OAAO,wBAAwB;IACnC,YAAoB,SAAwB,EAAU,KAAY;QAA9C,cAAS,GAAT,SAAS,CAAe;QAAU,UAAK,GAAL,KAAK,CAAO;IAAG,CAAC;IAEtE,UAAU;QACR,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;IACrC,CAAC;IAED,OAAO,CAAC,IAAU,EAAE,aAAsB;QACxC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;QAEzC,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,EAAE,EAAE;YACf,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC;SAC5C;QAED,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,IAAkB;QACtB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;IACnC,CAAC;CACF","sourcesContent":["import type { Context } from '@opentelemetry/api';\nimport type { ReadableSpan, Span, SpanProcessor } from '@opentelemetry/sdk-trace-base';\n\nimport type { Metas } from '@grafana/faro-web-sdk';\n\n// adds Faro session id to every span\nexport class FaroSessionSpanProcessor implements SpanProcessor {\n constructor(private processor: SpanProcessor, private metas: Metas) {}\n\n forceFlush(): Promise<void> {\n return this.processor.forceFlush();\n }\n\n onStart(span: Span, parentContext: Context): void {\n const session = this.metas.value.session;\n\n if (session?.id) {\n span.attributes['session_id'] = session.id;\n }\n\n this.processor.onStart(span, parentContext);\n }\n\n onEnd(span: ReadableSpan): void {\n this.processor.onEnd(span);\n }\n\n shutdown(): Promise<void> {\n return this.processor.shutdown();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContextManager, TextMapPropagator } from '@opentelemetry/api';\nimport type { InstrumentationOption } from '@opentelemetry/instrumentation';\nimport type { ResourceAttributes } from '@opentelemetry/resources';\nimport type { SpanProcessor } from '@opentelemetry/sdk-trace-base';\n\nimport type { Faro } from '@grafana/faro-web-sdk';\n\nexport interface FaroTraceExporterConfig {\n faro: Faro;\n}\n\nexport interface TracingInstrumentationOptions {\n resourceAttributes?: ResourceAttributes;\n propagator?: TextMapPropagator;\n contextManager?: ContextManager;\n instrumentations?: InstrumentationOption[];\n spanProcessor?: SpanProcessor;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContextManager, TextMapPropagator } from '@opentelemetry/api';\nimport type { InstrumentationOption } from '@opentelemetry/instrumentation';\nimport type { ResourceAttributes } from '@opentelemetry/resources';\nimport type { SpanProcessor } from '@opentelemetry/sdk-trace-base';\n\nimport type { API } from '@grafana/faro-web-sdk';\n\nexport interface FaroTraceExporterConfig {\n api: API;\n}\n\nexport interface TracingInstrumentationOptions {\n resourceAttributes?: ResourceAttributes;\n propagator?: TextMapPropagator;\n contextManager?: ContextManager;\n instrumentations?: InstrumentationOption[];\n spanProcessor?: SpanProcessor;\n}\n"]}
@@ -1,8 +1,10 @@
1
1
  import type { Context } from '@opentelemetry/api';
2
2
  import type { ReadableSpan, Span, SpanProcessor } from '@opentelemetry/sdk-trace-base';
3
+ import type { Metas } from '@grafana/faro-web-sdk';
3
4
  export declare class FaroSessionSpanProcessor implements SpanProcessor {
4
5
  private processor;
5
- constructor(processor: SpanProcessor);
6
+ private metas;
7
+ constructor(processor: SpanProcessor, metas: Metas);
6
8
  forceFlush(): Promise<void>;
7
9
  onStart(span: Span, parentContext: Context): void;
8
10
  onEnd(span: ReadableSpan): void;
@@ -2,9 +2,9 @@ import type { ContextManager, TextMapPropagator } from '@opentelemetry/api';
2
2
  import type { InstrumentationOption } from '@opentelemetry/instrumentation';
3
3
  import type { ResourceAttributes } from '@opentelemetry/resources';
4
4
  import type { SpanProcessor } from '@opentelemetry/sdk-trace-base';
5
- import type { Faro } from '@grafana/faro-web-sdk';
5
+ import type { API } from '@grafana/faro-web-sdk';
6
6
  export interface FaroTraceExporterConfig {
7
- faro: Faro;
7
+ api: API;
8
8
  }
9
9
  export interface TracingInstrumentationOptions {
10
10
  resourceAttributes?: ResourceAttributes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/faro-web-tracing",
3
- "version": "1.0.0-beta5",
3
+ "version": "1.0.0",
4
4
  "description": "Faro web tracing implementation.",
5
5
  "keywords": [
6
6
  "observability",
@@ -51,21 +51,21 @@
51
51
  "quality:circular-deps": "madge --circular ."
52
52
  },
53
53
  "dependencies": {
54
- "@grafana/faro-web-sdk": "^1.0.0-beta4",
55
- "@opentelemetry/api": "^1.3.0",
56
- "@opentelemetry/context-zone": "^1.8.0",
57
- "@opentelemetry/core": "^1.8.0",
58
- "@opentelemetry/exporter-trace-otlp-http": "^0.34.0",
59
- "@opentelemetry/instrumentation": "^0.34.0",
54
+ "@grafana/faro-web-sdk": "^1.0.0",
55
+ "@opentelemetry/api": "^1.4.0",
56
+ "@opentelemetry/context-zone": "^1.9.0",
57
+ "@opentelemetry/core": "^1.9.0",
58
+ "@opentelemetry/exporter-trace-otlp-http": "^0.35.0",
59
+ "@opentelemetry/instrumentation": "^0.35.0",
60
60
  "@opentelemetry/instrumentation-document-load": "^0.31.0",
61
- "@opentelemetry/instrumentation-fetch": "^0.34.0",
61
+ "@opentelemetry/instrumentation-fetch": "^0.35.0",
62
62
  "@opentelemetry/instrumentation-user-interaction": "^0.32.0",
63
- "@opentelemetry/instrumentation-xml-http-request": "^0.34.0",
64
- "@opentelemetry/otlp-transformer": "^0.34.0",
65
- "@opentelemetry/resources": "^1.8.0",
66
- "@opentelemetry/sdk-trace-base": "^1.8.0",
67
- "@opentelemetry/sdk-trace-web": "^1.8.0",
68
- "@opentelemetry/semantic-conventions": "^1.8.0"
63
+ "@opentelemetry/instrumentation-xml-http-request": "^0.35.0",
64
+ "@opentelemetry/otlp-transformer": "^0.35.0",
65
+ "@opentelemetry/resources": "^1.9.0",
66
+ "@opentelemetry/sdk-trace-base": "^1.9.0",
67
+ "@opentelemetry/sdk-trace-web": "^1.9.0",
68
+ "@opentelemetry/semantic-conventions": "^1.9.0"
69
69
  },
70
70
  "resolutions": {
71
71
  "@opentelemetry/api-metrics": "^0.29.1"
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "9589b021e63a7344c549bfc91a40b0f71141da03"
76
+ "gitHead": "afd9cbdff2b0665006e081bb72360301916e5e56"
77
77
  }