Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 832
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
(()=>{var Ml=Object.create;var sa=Object.defineProperty;var xl=Object.getOwnPropertyDescriptor;var Cl=Object.getOwnPropertyNames;var vl=Object.getPrototypeOf,Ll=Object.prototype.hasOwnProperty;var an=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Il=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Cl(t))!Ll.call(e,o)&&o!==r&&sa(e,o,{get:()=>t[o],enumerable:!(n=xl(t,o))||n.enumerable});return e};var cn=(e,t,r)=>(r=e!=null?Ml(vl(e)):{},Il(t||!e||!e.__esModule?sa(r,"default",{value:e,enumerable:!0}):r,e));var xc=an((fg,Mc)=>{"use strict";function hi(e){return typeof e=="function"}var dt=console.error.bind(console);function yr(e,t,r){var n=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:n,writable:!0,value:r})}function Dr(e){e&&e.logger&&(hi(e.logger)?dt=e.logger:dt("new logger isn't a function, not replacing"))}function bc(e,t,r){if(!e||!e[t]){dt("no original function "+t+" to wrap");return}if(!r){dt("no wrapper function"),dt(new Error().stack);return}if(!hi(e[t])||!hi(r)){dt("original object and wrapper must be functions");return}var n=e[t],o=r(n,t);return yr(o,"__original",n),yr(o,"__unwrap",function(){e[t]===o&&yr(e,t,n)}),yr(o,"__wrapped",!0),yr(e,t,o),o}function Ep(e,t,r){if(e)Array.isArray(e)||(e=[e]);else{dt("must provide one or more modules to patch"),dt(new Error().stack);return}if(!(t&&Array.isArray(t))){dt("must provide one or more functions to wrap on modules");return}e.forEach(function(n){t.forEach(function(o){bc(n,o,r)})})}function Pc(e,t){if(!e||!e[t]){dt("no function to unwrap."),dt(new Error().stack);return}if(!e[t].__unwrap)dt("no original to unwrap to -- has "+t+" already been unwrapped?");else return e[t].__unwrap()}function mp(e,t){if(e)Array.isArray(e)||(e=[e]);else{dt("must provide one or more modules to patch"),dt(new Error().stack);return}if(!(t&&Array.isArray(t))){dt("must provide one or more functions to unwrap on modules");return}e.forEach(function(r){t.forEach(function(n){Pc(r,n)})})}Dr.wrap=bc;Dr.massWrap=Ep;Dr.unwrap=Pc;Dr.massUnwrap=mp;Mc.exports=Dr});var Cc=an((Sg,Ur)=>{(function(e,t){if(!e)return;var r={},n=e.TraceKit,o=[].slice,i="?",s=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function a(l,c){return Object.prototype.hasOwnProperty.call(l,c)}function u(l){return typeof l>"u"}r.noConflict=function(){return e.TraceKit=n,r},r.wrap=function(c){function T(){try{return c.apply(this,arguments)}catch(p){throw r.report(p),p}}return T},r.report=function(){var c=[],T=null,p=null;function _(m){q(),V(),c.push(m)}function d(m){for(var g=c.length-1;g>=0;--g)c[g]===m&&c.splice(g,1);c.length===0&&(H(),nt())}function h(m,g,O){var P=null;if(!(g&&!r.collectWindowErrors)){for(var N in c)if(a(c,N))try{c[N](m,g,O)}catch(B){P=B}if(P)throw P}}var R,f,S,M;function j(m,g,O,P,N){var B=null;if(p)r.computeStackTrace.augmentStackTraceWithInitialElement(p,g,O,m),z();else if(N)B=r.computeStackTrace(N),h(B,!0,N);else{var I={url:g,line:O,column:P},C,A=m;if({}.toString.call(m)==="[object String]"){var y=m.match(s);y&&(C=y[1],A=y[2])}I.func=r.computeStackTrace.guessFunctionName(I.url,I.line),I.context=r.computeStackTrace.gatherContext(I.url,I.line),B={name:C,message:A,mode:"onerror",stack:[I]},h(B,!0,null)}return R?R.apply(this,arguments):!1}function Y(m){var g=r.computeStackTrace(m.reason);h(g,!0,m.reason)}function q(){f!==!0&&(R=e.onerror,e.onerror=j,f=!0)}function H(){f&&(e.onerror=R,f=!1)}function V(){M!==!0&&(S=e.onunhandledrejection,e.onunhandledrejection=Y,M=!0)}function nt(){M&&(e.onunhandledrejection=S,M=!1)}function z(){var m=p,g=T;p=null,T=null,h(m,!1,g)}function it(m){if(p){if(T===m)return;z()}var g=r.computeStackTrace(m);throw p=g,T=m,setTimeout(function(){T===m&&z()},g.incomplete?2e3:0),m}return it.subscribe=_,it.unsubscribe=d,it}(),r.computeStackTrace=function(){var c=!1,T={};function p(m){if(!r.remoteFetching)return"";try{var g=function(){try{return new e.XMLHttpRequest}catch{return new e.ActiveXObject("Microsoft.XMLHTTP")}},O=g();return O.open("GET",m,!1),O.send(""),O.responseText}catch{return""}}function _(m){if(typeof m!="string")return[];if(!a(T,m)){var g="",O="";try{O=e.document.domain}catch{}var P=/(.*)\:\/\/([^:\/]+)([:\d]*)\/{0,1}([\s\S]*)/.exec(m);P&&P[2]===O&&(g=p(m)),T[m]=g?g.split(`
`):[]}return T[m]}function d(m,g){var O=/function ([^(]*)\(([^)]*)\)/,P=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,N="",B=10,I=_(m),C;if(!I.length)return i;for(var A=0;A0?P:null}function R(m){return m.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function f(m){return R(m).replace("<","(?:<|<)").replace(">","(?:>|>)").replace("&","(?:&|&)").replace('"','(?:"|")').replace(/\s+/g,"\\s+")}function S(m,g){for(var O,P,N=0,B=g.length;NO&&(B=N.exec(P[O]))?B.index:null}function j(m){if(!u(e&&e.document)){for(var g=[e.location.href],O=e.document.getElementsByTagName("script"),P,N=""+m,B=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,I=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,C,A,y,b=0;b|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,O=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,P=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,N,B=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,I=/\((\S*)(?::(\d+))(?::(\d+))\)/,C=m.stack.split(`
`),A=[],y,b,D,Pt=/^(.*) is undefined$/.exec(m.message),_t=0,At=C.length;_t eval")>-1,N&&(y=B.exec(b[3]))?(b[3]=y[1],b[4]=y[2],b[5]=null):_t===0&&!b[5]&&!u(m.columnNumber)&&(A[0].column=m.columnNumber+1),D={url:b[3],func:b[1]||i,args:b[2]?b[2].split(","):[],line:b[4]?+b[4]:null,column:b[5]?+b[5]:null};else continue;!D.func&&D.line&&(D.func=d(D.url,D.line)),D.context=D.line?h(D.url,D.line):null,A.push(D)}return A.length?(A[0]&&A[0].line&&!A[0].column&&Pt&&(A[0].column=M(Pt[1],A[0].url,A[0].line)),{mode:"stack",name:m.name,message:m.message,stack:A}):null}function q(m){var g=m.stacktrace;if(g){for(var O=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,P=/ line (\d+), column (\d+)\s*(?:in (?:]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,N=g.split(`
`),B=[],I,C=0;C=0&&(D.line=Pt+At.substring(0,Zt).split(`
`).length)}}}else if(A=N.exec(g[b])){var nr=e.location.href.replace(/#.*$/,""),en=new RegExp(f(g[b+1])),rn=S(en,[nr]);D={url:nr,func:"",args:[],line:rn?rn.line:A[1],column:null}}if(D){D.func||(D.func=d(D.url,D.line));var Lt=h(D.url,D.line),nn=Lt?Lt[Math.floor(Lt.length/2)]:null;Lt&&nn.replace(/^\s*/,"")===g[b+1].replace(/^\s*/,"")?D.context=Lt:D.context=[g[b+1]],B.push(D)}}return B.length?{mode:"multiline",name:m.name,message:g[0],stack:B}:null}function V(m,g,O,P){var N={url:g,line:O};if(N.url&&N.line){m.incomplete=!1,N.func||(N.func=d(N.url,N.line)),N.context||(N.context=h(N.url,N.line));var B=/ '([^']+)' /.exec(P);if(B&&(N.column=M(B[1],N.url,N.line)),m.stack.length>0&&m.stack[0].url===N.url){if(m.stack[0].line===N.line)return!1;if(!m.stack[0].line&&m.stack[0].func===N.func)return m.stack[0].line=N.line,m.stack[0].context=N.context,!1}return m.stack.unshift(N),m.partial=!0,!0}else m.incomplete=!0;return!1}function nt(m,g){for(var O=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,P=[],N={},B=!1,I,C,A,y=nt.caller;y&&!B;y=y.caller)if(!(y===z||y===r.report)){if(C={url:null,func:i,args:[],line:null,column:null},y.name?C.func=y.name:(I=O.exec(y.toString()))&&(C.func=I[1]),typeof C.func>"u")try{C.func=I.input.substring(0,I.input.indexOf("{"))}catch{}if(A=j(y)){C.url=A.url,C.line=A.line,C.func===i&&(C.func=d(C.url,C.line));var b=/ '([^']+)' /.exec(m.message||m.description);b&&(C.column=M(b[1],A.url,A.line))}N[""+y]?B=!0:N[""+y]=!0,P.push(C)}g&&P.splice(0,g);var D={mode:"callers",name:m.name,message:m.message,stack:P};return V(D,m.sourceURL||m.fileName,m.line||m.lineNumber,m.message||m.description),D}function z(m,g){var O=null;g=g==null?0:+g;try{if(O=q(m),O)return O}catch(P){if(c)throw P}try{if(O=Y(m),O)return O}catch(P){if(c)throw P}try{if(O=H(m),O)return O}catch(P){if(c)throw P}try{if(O=nt(m,g+1),O)return O}catch(P){if(c)throw P}return{name:m.name,message:m.message,mode:"failed"}}function it(m){m=(m==null?0:+m)+1;try{throw new Error}catch(g){return z(g,m+1)}}return z.augmentStackTraceWithInitialElement=V,z.computeStackTraceFromStackProp=Y,z.guessFunctionName=d,z.gatherContext=h,z.ofCaller=it,z.getSource=_,z}(),r.extendToAsynchronousCallbacks=function(){var l=function(T){var p=e[T];e[T]=function(){var d=o.call(arguments),h=d[0];return typeof h=="function"&&(d[0]=r.wrap(h)),p.apply?p.apply(this,d):p(d[0],d[1])}};l("setTimeout"),l("setInterval")},r.remoteFetching||(r.remoteFetching=!0),r.collectWindowErrors||(r.collectWindowErrors=!0),(!r.linesOfContext||r.linesOfContext<1)&&(r.linesOfContext=11),typeof define=="function"&&define.amd?define("TraceKit",[],r):typeof Ur<"u"&&Ur.exports&&e.module!==Ur?Ur.exports=r:e.TraceKit=r})(typeof window<"u"?window:global)});var ou=an((kr,ao)=>{(function(e,t){"use strict";var r="1.0.39",n="",o="?",i="function",s="undefined",a="object",u="string",l="major",c="model",T="name",p="type",_="vendor",d="version",h="architecture",R="console",f="mobile",S="tablet",M="smarttv",j="wearable",Y="embedded",q=500,H="Amazon",V="Apple",nt="ASUS",z="BlackBerry",it="Browser",m="Chrome",g="Edge",O="Firefox",P="Google",N="Huawei",B="LG",I="Microsoft",C="Motorola",A="Opera",y="Samsung",b="Sharp",D="Sony",Pt="Xiaomi",_t="Zebra",At="Facebook",Zt="Chromium OS",nr="Mac OS",en=" Browser",rn=function(G,k){var U={};for(var W in G)k[W]&&k[W].length%2===0?U[W]=k[W].concat(G[W]):U[W]=G[W];return U},Lt=function(G){for(var k={},U=0;U0?$.length===2?typeof $[1]==i?this[$[0]]=$[1].call(this,wt):this[$[0]]=$[1]:$.length===3?typeof $[1]===i&&!($[1].exec&&$[1].test)?this[$[0]]=wt?$[1].call(this,wt,$[2]):t:this[$[0]]=wt?wt.replace($[1],$[2]):t:$.length===4&&(this[$[0]]=wt?$[3].call(this,wt.replace($[1],$[2])):t):this[$]=wt||t;U+=2}},on=function(G,k){for(var U in k)if(typeof k[U]===a&&k[U].length>0){for(var W=0;W2&&(w[c]="iPad",w[p]=S),w},this.getEngine=function(){var w={};return w[T]=t,w[d]=t,or.call(w,W,It.engine),w},this.getOS=function(){var w={};return w[T]=t,w[d]=t,or.call(w,W,It.os),$&&!w[T]&&Yt&&Yt.platform&&Yt.platform!="Unknown"&&(w[T]=Yt.platform.replace(/chrome os/i,Zt).replace(/macos/i,nr)),w},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return W},this.setUA=function(w){return W=typeof w===u&&w.length>q?Uo(w,q):w,this},this.setUA(W),this};mt.VERSION=r,mt.BROWSER=Lt([T,d,l]),mt.CPU=Lt([h]),mt.DEVICE=Lt([c,_,p,R,f,M,S,j,Y]),mt.ENGINE=mt.OS=Lt([T,d]),typeof kr!==s?(typeof ao!==s&&ao.exports&&(kr=ao.exports=mt),kr.UAParser=mt):typeof define===i&&define.amd?define(function(){return mt}):typeof e!==s&&(e.UAParser=mt);var Ce=typeof e!==s&&(e.jQuery||e.Zepto);if(Ce&&!Ce.ua){var sn=new mt;Ce.ua=sn.getResult(),Ce.ua.get=function(){return sn.getUA()},Ce.ua.set=function(G){sn.setUA(G);var k=sn.getResult();for(var U in k)Ce.ua[U]=k[U]}}})(typeof window=="object"?window:kr)});var ol=an(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.ATTR_HTTP_USER_AGENT=et.ATTR_HTTP_URL=et.ATTR_HTTP_STATUS_CODE=et.ATTR_HTTP_SCHEME=et.ATTR_HTTP_RESPONSE_CONTENT_LENGTH=et.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=et.ATTR_HTTP_REQUEST_BODY_SIZE=et.ATTR_HTTP_METHOD=et.ATTR_HTTP_HOST=void 0;et.ATTR_HTTP_HOST="http.host";et.ATTR_HTTP_METHOD="http.method";et.ATTR_HTTP_REQUEST_BODY_SIZE="http.request.body.size";et.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED="http.request_content_length_uncompressed";et.ATTR_HTTP_RESPONSE_CONTENT_LENGTH="http.response_content_length";et.ATTR_HTTP_SCHEME="http.scheme";et.ATTR_HTTP_STATUS_CODE="http.status_code";et.ATTR_HTTP_URL="http.url";et.ATTR_HTTP_USER_AGENT="http.user_agent"});var aa=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{};var $t="1.9.0";var ca=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function wl(e){var t=new Set([e]),r=new Set,n=e.match(ca);if(!n)return function(){return!1};var o={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(o.prerelease!=null)return function(u){return u===e};function i(a){return r.add(a),!1}function s(a){return t.add(a),!0}return function(u){if(t.has(u))return!0;if(r.has(u))return!1;var l=u.match(ca);if(!l)return i(u);var c={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return c.prerelease!=null||o.major!==c.major?i(u):o.major===0?o.minor===c.minor&&o.patch<=c.patch?s(u):i(u):o.minor<=c.minor?s(u):i(u)}}var ua=wl($t);var yl=$t.split(".")[0],ir=Symbol.for("opentelemetry.js.api."+yl),sr=aa;function yt(e,t,r,n){var o;n===void 0&&(n=!1);var i=sr[ir]=(o=sr[ir])!==null&&o!==void 0?o:{version:$t};if(!n&&i[e]){var s=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(s.stack||s.message),!1}if(i.version!==$t){var s=new Error("@opentelemetry/api: Registration of version v"+i.version+" for "+e+" does not match previously registered API v"+$t);return r.error(s.stack||s.message),!1}return i[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+$t+"."),!0}function ht(e){var t,r,n=(t=sr[ir])===null||t===void 0?void 0:t.version;if(!(!n||!ua(n)))return(r=sr[ir])===null||r===void 0?void 0:r[e]}function Dt(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+$t+".");var r=sr[ir];r&&delete r[e]}var Dl=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i},Ul=function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;nF.ALL&&(e=F.ALL),t=t||{};function r(n,o){var i=t[n];return typeof i=="function"&&e>=o?i.bind(t):function(){}}return{error:r("error",F.ERROR),warn:r("warn",F.WARN),info:r("info",F.INFO),debug:r("debug",F.DEBUG),verbose:r("verbose",F.VERBOSE)}}var Bl=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i},Vl=function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n";c.warn("Current logger will be overwritten from "+p),T.warn("Current logger will overwrite one already registered from "+p)}return yt("diag",T,r,!0)};r.setLogger=n,r.disable=function(){Dt(Gl,r)},r.createComponentLogger=function(o){return new la(o)},r.verbose=t("verbose"),r.debug=t("debug"),r.info=t("info"),r.warn=t("warn"),r.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}();var Hl=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i},kl=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},pa=function(){function e(t){this._entries=t?new Map(t):new Map}return e.prototype.getEntry=function(t){var r=this._entries.get(t);if(r)return Object.assign({},r)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(t){var r=Hl(t,2),n=r[0],o=r[1];return[n,o]})},e.prototype.setEntry=function(t,r){var n=new e(this._entries);return n._entries.set(t,r),n},e.prototype.removeEntry=function(t){var r=new e(this._entries);return r._entries.delete(t),r},e.prototype.removeEntries=function(){for(var t,r,n=[],o=0;o0)&&!(o=n.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i},s_=function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n0)&&!(o=n.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i},c_=function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;nn===e?t:r}var ei=1;var fn=class e{constructor(){this._proxyLoggerProvider=new _r}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Le[pr]?this.getLoggerProvider():(Le[pr]=ya(ei,t,mn),this._proxyLoggerProvider.setDelegate(t),t)}getLoggerProvider(){var t,r;return(r=(t=Le[pr])===null||t===void 0?void 0:t.call(Le,ei))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(t,r,n){return this.getLoggerProvider().getLogger(t,r,n)}disable(){delete Le[pr],this._proxyLoggerProvider=new _r}};var Sn=fn.getInstance();function Da(e,t,r,n){for(let o=0,i=e.length;ot.disable())}function ri(e){let t=e.tracerProvider||L.getTracerProvider(),r=e.meterProvider||re.getMeterProvider(),n=e.loggerProvider||Sn.getLoggerProvider(),o=e.instrumentations?.flat()??[];return Da(o,t,r,n),()=>{Ua(o)}}var Tt=console.error.bind(console);function Tr(e,t,r){let n=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:n,writable:!0,value:r})}var An=(e,t,r)=>{if(!e||!e[t]){Tt("no original function "+String(t)+" to wrap");return}if(!r){Tt("no wrapper function"),Tt(new Error().stack);return}let n=e[t];if(typeof n!="function"||typeof r!="function"){Tt("original object and wrapper must be functions");return}let o=r(n,t);return Tr(o,"__original",n),Tr(o,"__unwrap",()=>{e[t]===o&&Tr(e,t,n)}),Tr(o,"__wrapped",!0),Tr(e,t,o),o},ni=(e,t,r)=>{if(e)Array.isArray(e)||(e=[e]);else{Tt("must provide one or more modules to patch"),Tt(new Error().stack);return}if(!(t&&Array.isArray(t))){Tt("must provide one or more functions to wrap on modules");return}e.forEach(n=>{t.forEach(o=>{An(n,o,r)})})},gn=(e,t)=>{if(!e||!e[t]){Tt("no function to unwrap."),Tt(new Error().stack);return}let r=e[t];if(!r.__unwrap)Tt("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{r.__unwrap();return}},oi=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Tt("must provide one or more modules to patch"),Tt(new Error().stack);return}if(!(t&&Array.isArray(t))){Tt("must provide one or more functions to unwrap on modules");return}e.forEach(r=>{t.forEach(n=>{gn(r,n)})})};function dr(e){e&&e.logger&&(typeof e.logger!="function"?Tt("new logger isn't a function, not replacing"):Tt=e.logger)}dr.wrap=An;dr.massWrap=ni;dr.unwrap=gn;dr.massUnwrap=oi;var Rn=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,r,n){this.instrumentationName=t,this.instrumentationVersion=r,this.setConfig(n),this._diag=E.createComponentLogger({namespace:t}),this._tracer=L.getTracer(t,r),this._meter=re.getMeter(t,r),this._logger=Sn.getLogger(t,r),this._updateMetricInstruments()}_wrap=An;_unwrap=gn;_massWrap=ni;_massUnwrap=oi;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,r,n,o){if(t)try{t(n,o)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},i)}}};var Et=class extends Rn{constructor(t,r,n){super(t,r,n),this._config.enabled&&this.enable()}};function Kt(e,t,r){let n,o;try{o=e()}catch(i){n=i}finally{if(t(n,o),n&&!r)throw n;return o}}function Q(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}var X;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(X||(X={}));function Er(e,t){let r=X.OLD,n=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of n??[])if(o.toLowerCase()===e+"/dup"){r=X.DUPLICATE;break}else o.toLowerCase()===e&&(r=X.STABLE);return r}var Ba=le("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function mr(e){return e.setValue(Ba,!0)}function Te(e){return e.getValue(Ba)===!0}var Va="=",Nn=";",hr=",",On="baggage";function Ga(e){return e.reduce((t,r)=>{let n=`${t}${t!==""?hr:""}${r}`;return n.length>8192?t:n},"")}function Ha(e){return e.getAllEntries().map(([t,r])=>{let n=`${encodeURIComponent(t)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=Nn+r.metadata.toString()),n})}function ka(e){let t=e.split(Nn);if(t.length<=0)return;let r=t.shift();if(!r)return;let n=r.indexOf(Va);if(n<=0)return;let o=decodeURIComponent(r.substring(0,n).trim()),i=decodeURIComponent(r.substring(n+1).trim()),s;return t.length>0&&(s=Vo(t.join(Nn))),{key:o,value:i,metadata:s}}var fr=class{inject(t,r,n){let o=J.getBaggage(t);if(!o||Te(t))return;let i=Ha(o).filter(a=>a.length<=4096).slice(0,180),s=Ga(i);s.length>0&&n.set(r,On,s)}extract(t,r,n){let o=n.get(r,On),i=Array.isArray(o)?o.join(hr):o;if(!i)return t;let s={};return i.length===0||(i.split(hr).forEach(u=>{let l=ka(u);if(l){let c={value:l.value};l.metadata&&(c.metadata=l.metadata),s[l.key]=c}}),Object.entries(s).length===0)?t:J.setBaggage(t,J.createBaggage(s))}fields(){return[On]}};function de(e){let t={};if(typeof e!="object"||e==null)return t;for(let[r,n]of Object.entries(e)){if(!g_(r)){E.warn(`Invalid attribute key: ${r}`);continue}if(!Ee(n)){E.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?t[r]=n.slice():t[r]=n}return t}function g_(e){return typeof e=="string"&&e.length>0}function Ee(e){return e==null?!0:Array.isArray(e)?R_(e):Fa(e)}function R_(e){let t;for(let r of e)if(r!=null){if(!t){if(Fa(r)){t=typeof r;continue}return!1}if(typeof r!==t)return!1}return!0}function Fa(e){switch(typeof e){case"number":case"boolean":case"string":return!0}return!1}function Ya(){return e=>{E.error(N_(e))}}function N_(e){return typeof e=="string"?e:JSON.stringify(O_(e))}function O_(e){let t={},r=e;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(t[n])return;let o=r[n];o&&(t[n]=String(o))}),r=Object.getPrototypeOf(r);return t}var b_=Ya();function st(e){try{b_(e)}catch{}}var Ie=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{};var rt=performance;var $a="2.0.1";var P_="http.url";var M_="http.user_agent";var bn=P_;var ja=M_;var Sr="error.type";var Ut="exception.message",we="exception.stacktrace",zt="exception.type";var Pn="http.request.method";var Mn="http.request.method_original";var xn="http.response.status_code";var Cn="server.address",vn="server.port",Ln="service.name",Ka="service.version";var Ar="telemetry.sdk.language";var za="webjs",gr="telemetry.sdk.name",Rr="telemetry.sdk.version";var In="url.full";var Wa="process.runtime.name";var ye={[gr]:"opentelemetry",[Wa]:"browser",[Ar]:za,[Rr]:$a};var x_=9,C_=6,v_=Math.pow(10,C_),wn=Math.pow(10,x_);function ut(e){let t=e/1e3,r=Math.trunc(t),n=Math.round(e%1e3*v_);return[r,n]}function Nr(){let e=rt.timeOrigin;if(typeof e!="number"){let t=rt;e=t.timing&&t.timing.fetchStart}return e}function Rt(e){let t=ut(Nr()),r=ut(typeof e=="number"?e:rt.now());return Dn(t,r)}function Bt(e){if(Or(e))return e;if(typeof e=="number")return e=wn&&(r[1]-=wn,r[0]+=1),r}var Z;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(Z||(Z={}));var br=class{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[],this._fields=Array.from(new Set(this._propagators.map(r=>typeof r.fields=="function"?r.fields():[]).reduce((r,n)=>r.concat(n),[])))}inject(t,r,n){for(let o of this._propagators)try{o.inject(t,r,n)}catch(i){E.warn(`Failed to inject with ${o.constructor.name}. Err: ${i.message}`)}}extract(t,r,n){return this._propagators.reduce((o,i)=>{try{return i.extract(o,r,n)}catch(s){E.warn(`Failed to extract with ${i.constructor.name}. Err: ${s.message}`)}return o},t)}fields(){return this._fields.slice()}};var si="[_0-9a-z-*/]",L_=`[a-z]${si}{0,255}`,I_=`[a-z0-9]${si}{0,240}@[a-z]${si}{0,13}`,w_=new RegExp(`^(?:${L_}|${I_})$`),y_=/^[ -~]{0,255}[!-~]$/,D_=/,|=/;function Xa(e){return w_.test(e)}function qa(e){return y_.test(e)&&!D_.test(e)}var Qa=32,U_=512,Ja=",",Za="=",Un=class e{_internalState=new Map;constructor(t){t&&this._parse(t)}set(t,r){let n=this._clone();return n._internalState.has(t)&&n._internalState.delete(t),n._internalState.set(t,r),n}unset(t){let r=this._clone();return r._internalState.delete(t),r}get(t){return this._internalState.get(t)}serialize(){return this._keys().reduce((t,r)=>(t.push(r+Za+this.get(r)),t),[]).join(Ja)}_parse(t){t.length>U_||(this._internalState=t.split(Ja).reverse().reduce((r,n)=>{let o=n.trim(),i=o.indexOf(Za);if(i!==-1){let s=o.slice(0,i),a=o.slice(i+1,n.length);Xa(s)&&qa(a)&&r.set(s,a)}return r},new Map),this._internalState.size>Qa&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Qa))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}};var De="traceparent",Bn="tracestate",B_="00",V_="(?!ff)[\\da-f]{2}",G_="(?![0]{32})[\\da-f]{32}",H_="(?![0]{16})[\\da-f]{16}",k_="[\\da-f]{2}",F_=new RegExp(`^\\s?(${V_})-(${G_})-(${H_})-(${k_})(-.*)?\\s?$`);function tc(e){let t=F_.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Pr=class{inject(t,r,n){let o=L.getSpanContext(t);if(!o||Te(t)||!Ct(o))return;let i=`${B_}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||pt.NONE).toString(16)}`;n.set(r,De,i),o.traceState&&n.set(r,Bn,o.traceState.serialize())}extract(t,r,n){let o=n.get(r,De);if(!o)return t;let i=Array.isArray(o)?o[0]:o;if(typeof i!="string")return t;let s=tc(i);if(!s)return t;s.isRemote=!0;let a=n.get(r,Bn);if(a){let u=Array.isArray(a)?a.join(","):a;s.traceState=new Un(typeof u=="string"?u:void 0)}return L.setSpanContext(t,s)}fields(){return[De,Bn]}};var Y_="[object Object]",$_="[object Null]",j_="[object Undefined]",K_=Function.prototype,ec=K_.toString,z_=ec.call(Object),W_=Object.getPrototypeOf,rc=Object.prototype,nc=rc.hasOwnProperty,he=Symbol?Symbol.toStringTag:void 0,oc=rc.toString;function ai(e){if(!X_(e)||q_(e)!==Y_)return!1;let t=W_(e);if(t===null)return!0;let r=nc.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&ec.call(r)===z_}function X_(e){return e!=null&&typeof e=="object"}function q_(e){return e==null?e===void 0?j_:$_:he&&he in Object(e)?Q_(e):J_(e)}function Q_(e){let t=nc.call(e,he),r=e[he],n=!1;try{e[he]=void 0,n=!0}catch{}let o=oc.call(e);return n&&(t?e[he]=r:delete e[he]),o}function J_(e){return oc.call(e)}var Z_=20;function xr(...e){let t=e.shift(),r=new WeakMap;for(;e.length>0;)t=sc(t,e.shift(),0,r);return t}function ci(e){return Gn(e)?e.slice():e}function sc(e,t,r=0,n){let o;if(!(r>Z_)){if(r++,Vn(e)||Vn(t)||ac(t))o=ci(t);else if(Gn(e)){if(o=e.slice(),Gn(t))for(let i=0,s=t.length;i"u"?delete o[u]:o[u]=l;else{let c=o[u],T=l;if(ic(e,u,n)||ic(t,u,n))delete o[u];else{if(Mr(c)&&Mr(T)){let p=n.get(c)||[],_=n.get(T)||[];p.push({obj:e,key:u}),_.push({obj:t,key:u}),n.set(c,p),n.set(T,_)}o[u]=sc(o[u],l,r,n)}}}}else o=t;return o}}function ic(e,t,r){let n=r.get(e[t])||[];for(let o=0,i=n.length;o"u"||e instanceof Date||e instanceof RegExp||e===null}function tp(e,t){return!(!ai(e)||!ai(t))}var Hn=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};function ui(e,t){let r,n=new Promise(function(i,s){r=setTimeout(function(){s(new Hn("Operation timed out."))},t)});return Promise.race([e,n]).then(o=>(clearTimeout(r),o),o=>{throw clearTimeout(r),o})}function kn(e,t){return typeof t=="string"?e===t:!!e.match(t)}function Cr(e,t){if(!t)return!1;for(let r of t)if(kn(e,r))return!0;return!1}var Fn=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,r)=>{this._resolve=t,this._reject=r})}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}};var ne=class{_callback;_that;_isCalled=!1;_deferred=new Fn;constructor(t,r){this._callback=t,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}};function cc(e,t){return new Promise(r=>{x.with(mr(x.active()),()=>{e.export(t,n=>{r(n)})})})}var li={_export:cc};function _i(){return"unknown_service"}var Ue=e=>e!==null&&typeof e=="object"&&typeof e.then=="function";var Yn=class e{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(t){let r=new e({});return r._rawAttributes=_c(t),r._asyncAttributesPending=t.filter(([n,o])=>Ue(o)).length>0,r}constructor(t){let r=t.attributes??{};this._rawAttributes=Object.entries(r).map(([n,o])=>(Ue(o)&&(this._asyncAttributesPending=!0),[n,o])),this._rawAttributes=_c(this._rawAttributes)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let t=0;tUe(r)?[t,r.catch(n=>{E.debug("promise rejection for resource attribute: %s - %s",t,n)})]:[t,r])}var pi=(e={})=>(e.detectors||[]).map(r=>{try{let n=pc(r.detect(e));return E.debug(`${r.constructor.name} found resource.`,n),n}catch(n){return E.debug(`${r.constructor.name} failed: ${n.message}`),fe()}}).reduce((r,n)=>r.merge(n),fe());var Tc="exception";var $n=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:gt.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(t){let r=Date.now();this._spanContext=t.spanContext,this._performanceStartTime=rt.now(),this._performanceOffset=r-(this._performanceStartTime+Nr()),this._startTimeProvided=t.startTime!=null,this._spanLimits=t.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=t.spanProcessor,this.name=t.name,this.parentSpanContext=t.parentSpanContext,this.kind=t.kind,this.links=t.links||[],this.startTime=this._getTime(t.startTime??r),this.resource=t.resource,this.instrumentationScope=t.scope,t.attributes!=null&&this.setAttributes(t.attributes),this._spanProcessor.onStart(this,t.context)}spanContext(){return this._spanContext}setAttribute(t,r){if(r==null||this._isSpanEnded())return this;if(t.length===0)return E.warn(`Invalid attribute key: ${t}`),this;if(!Ee(r))return E.warn(`Invalid attribute value set for key: ${t}`),this;let{attributeCountLimit:n}=this._spanLimits;return n!==void 0&&Object.keys(this.attributes).length>=n&&!Object.prototype.hasOwnProperty.call(this.attributes,t)?(this._droppedAttributesCount++,this):(this.attributes[t]=this._truncateToSize(r),this)}setAttributes(t){for(let[r,n]of Object.entries(t))this.setAttribute(r,n);return this}addEvent(t,r,n){if(this._isSpanEnded())return this;let{eventCountLimit:o}=this._spanLimits;if(o===0)return E.warn("No events allowed."),this._droppedEventsCount++,this;o!==void 0&&this.events.length>=o&&(this._droppedEventsCount===0&&E.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),yn(r)&&(yn(n)||(n=r),r=void 0);let i=de(r);return this.events.push({name:t,attributes:i,time:this._getTime(n),droppedAttributesCount:0}),this}addLink(t){return this.links.push(t),this}addLinks(t){return this.links.push(...t),this}setStatus(t){return this._isSpanEnded()?this:(this.status={...t},this.status.message!=null&&typeof t.message!="string"&&(E.warn(`Dropping invalid status.message of type '${typeof t.message}', expected 'string'`),delete this.status.message),this)}updateName(t){return this._isSpanEnded()?this:(this.name=t,this)}end(t){if(this._isSpanEnded()){E.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(t),this._duration=ii(this.startTime,this.endTime),this._duration[0]<0&&(E.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&E.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(t){if(typeof t=="number"&&t<=rt.now())return Rt(t+this._performanceOffset);if(typeof t=="number")return ut(t);if(t instanceof Date)return ut(t.getTime());if(Or(t))return t;if(this._startTimeProvided)return ut(Date.now());let r=rt.now()-this._performanceStartTime;return Dn(this.startTime,ut(r))}isRecording(){return this._ended===!1}recordException(t,r){let n={};typeof t=="string"?n[Ut]=t:t&&(t.code?n[zt]=t.code.toString():t.name&&(n[zt]=t.name),t.message&&(n[Ut]=t.message),t.stack&&(n[we]=t.stack)),n[zt]||n[Ut]?this.addEvent(Tc,n,r):E.warn(`Failed to record an exception ${t}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let t=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);E.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,t)}return this._ended}_truncateToLimitUtil(t,r){return t.length<=r?t:t.substring(0,r)}_truncateToSize(t){let r=this._attributeValueLengthLimit;return r<=0?(E.warn(`Attribute value limit must be positive, got ${r}`),t):typeof t=="string"?this._truncateToLimitUtil(t,r):Array.isArray(t)?t.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,r):n):t}};var Wt;(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Wt||(Wt={}));var vt=class{shouldSample(){return{decision:Wt.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};var St=class{shouldSample(){return{decision:Wt.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};var Ae=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(t){this._root=t.root,this._root||(st(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new St),this._remoteParentSampled=t.remoteParentSampled??new St,this._remoteParentNotSampled=t.remoteParentNotSampled??new vt,this._localParentSampled=t.localParentSampled??new St,this._localParentNotSampled=t.localParentNotSampled??new vt}shouldSample(t,r,n,o,i,s){let a=L.getSpanContext(t);return!a||!Ct(a)?this._root.shouldSample(t,r,n,o,i,s):a.isRemote?a.traceFlags&pt.SAMPLED?this._remoteParentSampled.shouldSample(t,r,n,o,i,s):this._remoteParentNotSampled.shouldSample(t,r,n,o,i,s):a.traceFlags&pt.SAMPLED?this._localParentSampled.shouldSample(t,r,n,o,i,s):this._localParentNotSampled.shouldSample(t,r,n,o,i,s)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};var oe=class{_ratio;_upperBound;constructor(t=0){this._ratio=t,this._ratio=this._normalize(t),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(t,r){return{decision:dn(r)&&this._accumulate(r)=1?1:t<=0?0:t}_accumulate(t){let r=0;for(let n=0;n>>0}return r}};var jn=1;function Kn(){return{sampler:Ti(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:void 0??1/0,attributeCountLimit:void 0??128},spanLimits:{attributeValueLengthLimit:void 0??1/0,attributeCountLimit:void 0??128,linkCountLimit:void 0??128,eventCountLimit:void 0??128,attributePerEventCountLimit:void 0??128,attributePerLinkCountLimit:void 0??128}}}function Ti(){let e=void 0??"parentbased_always_on";switch(e){case"always_on":return new St;case"always_off":return new vt;case"parentbased_always_on":return new Ae({root:new St});case"parentbased_always_off":return new Ae({root:new vt});case"traceidratio":return new oe(dc());case"parentbased_traceidratio":return new Ae({root:new oe(dc())});default:return E.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "parentbased_always_on".`),new Ae({root:new St})}}function dc(){let e=void 0;return e==null?(E.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${jn}.`),jn):e<0||e>1?(E.error(`OTEL_TRACES_SAMPLER_ARG=${e} was given, but it is out of range ([0..1]), defaulting to ${jn}.`),jn):e}var rp=128,np=1/0;function Ec(e){let t={sampler:Ti()},r=Kn(),n=Object.assign({},r,t,e);return n.generalLimits=Object.assign({},r.generalLimits,e.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,e.spanLimits||{}),n}function mc(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??rp,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??np,Object.assign({},e,{spanLimits:t})}var zn=class{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(t,r){this._exporter=t,this._maxExportBatchSize=typeof r?.maxExportBatchSize=="number"?r.maxExportBatchSize:void 0??512,this._maxQueueSize=typeof r?.maxQueueSize=="number"?r.maxQueueSize:void 0??2048,this._scheduledDelayMillis=typeof r?.scheduledDelayMillis=="number"?r.scheduledDelayMillis:void 0??5e3,this._exportTimeoutMillis=typeof r?.exportTimeoutMillis=="number"?r.exportTimeoutMillis:void 0??3e4,this._shutdownOnce=new ne(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(E.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(t,r){}onEnd(t){this._shutdownOnce.isCalled||(t.spanContext().traceFlags&pt.SAMPLED)!==0&&this._addToBuffer(t)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(t){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&E.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(E.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(t),this._maybeStartTimer()}_flushAll(){return new Promise((t,r)=>{let n=[],o=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let i=0,s=o;i{t()}).catch(r)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((t,r)=>{let n=setTimeout(()=>{r(new Error("Timeout"))},this._exportTimeoutMillis);x.with(mr(x.active()),()=>{let o;this._finishedSpans.length<=this._maxExportBatchSize?(o=this._finishedSpans,this._finishedSpans=[]):o=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(o,a=>{clearTimeout(n),a.code===Z.SUCCESS?t():r(a.error??new Error("BatchSpanProcessor: span export failed"))}),s=null;for(let a=0,u=o.length;a{st(a),r(a)})})})}_maybeStartTimer(){if(this._isExporting)return;let t=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(r=>{this._isExporting=!1,st(r)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return t();this._timer===void 0&&(this._timer=setTimeout(()=>t(),this._scheduledDelayMillis),this._timer,void 0)}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};var Be=class extends zn{_visibilityChangeListener;_pageHideListener;constructor(t,r){super(t,r),this.onInit(r)}onInit(t){t?.disableAutoFlushOnDocumentHide!==!0&&typeof document<"u"&&(this._visibilityChangeListener=()=>{document.visibilityState==="hidden"&&this.forceFlush().catch(r=>{st(r)})},this._pageHideListener=()=>{this.forceFlush().catch(r=>{st(r)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}onShutdown(){typeof document<"u"&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}};var ie=class{generateTraceId=hc(16);generateSpanId=hc(8)},Wn=Array(32);function hc(e){return function(){for(let r=0;r=58&&(Wn[r]+=39);return String.fromCharCode.apply(null,Wn.slice(0,e*2))}}var Xn=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(t,r,n,o){let i=Ec(r);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=r.idGenerator||new ie,this._resource=n,this._spanProcessor=o,this.instrumentationScope=t}startSpan(t,r={},n=x.active()){r.root&&(n=L.deleteSpan(n));let o=L.getSpan(n);if(Te(n))return E.debug("Instrumentation suppressed, returning Noop Span"),L.wrapSpanContext(cr);let i=o?.spanContext(),s=this._idGenerator.generateSpanId(),a,u,l;!i||!L.isSpanContextValid(i)?u=this._idGenerator.generateTraceId():(u=i.traceId,l=i.traceState,a=i);let c=r.kind??jt.INTERNAL,T=(r.links??[]).map(S=>({context:S.context,attributes:de(S.attributes)})),p=de(r.attributes),_=this._sampler.shouldSample(n,u,t,c,p,T);l=_.traceState??l;let d=_.decision===ve.RECORD_AND_SAMPLED?pt.SAMPLED:pt.NONE,h={traceId:u,spanId:s,traceFlags:d,traceState:l};if(_.decision===ve.NOT_RECORD)return E.debug("Recording is off, propagating context in a non-recording span"),L.wrapSpanContext(h);let R=de(Object.assign(p,_.attributes));return new $n({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:h,name:t,kind:c,links:T,parentSpanContext:a,attributes:R,startTime:r.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(t,r,n,o){let i,s,a;if(arguments.length<2)return;arguments.length===2?a=r:arguments.length===3?(i=r,a=n):(i=r,s=n,a=o);let u=s??x.active(),l=this.startSpan(t,i,u),c=L.setSpan(u,l);return x.with(c,a,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}};var qn=class{_spanProcessors;constructor(t){this._spanProcessors=t}forceFlush(){let t=[];for(let r of this._spanProcessors)t.push(r.forceFlush());return new Promise(r=>{Promise.all(t).then(()=>{r()}).catch(n=>{st(n||new Error("MultiSpanProcessor: forceFlush failed")),r()})})}onStart(t,r){for(let n of this._spanProcessors)n.onStart(t,r)}onEnd(t){for(let r of this._spanProcessors)r.onEnd(t)}shutdown(){let t=[];for(let r of this._spanProcessors)t.push(r.shutdown());return new Promise((r,n)=>{Promise.all(t).then(()=>{r()},n)})}};var ge;(function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"})(ge||(ge={}));var vr=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(t={}){let r=xr({},Kn(),mc(t));this._resource=r.resource??Se(),this._config=Object.assign({},r,{resource:this._resource});let n=[];t.spanProcessors?.length&&n.push(...t.spanProcessors),this._activeSpanProcessor=new qn(n)}getTracer(t,r,n){let o=`${t}@${r||""}:${n?.schemaUrl||""}`;return this._tracers.has(o)||this._tracers.set(o,new Xn({name:t,version:r,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(o)}forceFlush(){let t=this._config.forceFlushTimeoutMillis,r=this._activeSpanProcessor._spanProcessors.map(n=>new Promise(o=>{let i,s=setTimeout(()=>{o(new Error(`Span processor did not completed within timeout period of ${t} ms`)),i=ge.timeout},t);n.forceFlush().then(()=>{clearTimeout(s),i!==ge.timeout&&(i=ge.resolved,o(i))}).catch(a=>{clearTimeout(s),i=ge.error,o(a)})}));return new Promise((n,o)=>{Promise.all(r).then(i=>{let s=i.filter(a=>a!==ge.resolved);s.length>0?o(s):n()}).catch(i=>o([i]))})}shutdown(){return this._activeSpanProcessor.shutdown()}};var Qn=class{_enabled=!1;_currentContext=Mt;_bindFunction(t=Mt,r){let n=this,o=function(...i){return n.with(t,()=>r.apply(this,i))};return Object.defineProperty(o,"length",{enumerable:!1,configurable:!0,writable:!1,value:r.length}),o}active(){return this._currentContext}bind(t,r){return t===void 0&&(t=this.active()),typeof r=="function"?this._bindFunction(t,r):r}disable(){return this._currentContext=Mt,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=Mt,this)}with(t,r,n,...o){let i=this._currentContext;this._currentContext=t||Mt;try{return r.call(n,...o)}finally{this._currentContext=i}}};function op(e){if(e!==null){if(e===void 0){let t=new Qn;t.enable(),x.setGlobalContextManager(t);return}e.enable(),x.setGlobalContextManager(e)}}function ip(e){if(e!==null){if(e===void 0){J.setGlobalPropagator(new br({propagators:[new Pr,new fr]}));return}J.setGlobalPropagator(e)}}var Lr=class extends vr{constructor(t={}){super(t)}register(t={}){L.setGlobalTracerProvider(this),ip(t.propagator),op(t.contextManager)}};var v;(function(e){e.CONNECT_END="connectEnd",e.CONNECT_START="connectStart",e.DECODED_BODY_SIZE="decodedBodySize",e.DOM_COMPLETE="domComplete",e.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",e.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",e.DOM_INTERACTIVE="domInteractive",e.DOMAIN_LOOKUP_END="domainLookupEnd",e.DOMAIN_LOOKUP_START="domainLookupStart",e.ENCODED_BODY_SIZE="encodedBodySize",e.FETCH_START="fetchStart",e.LOAD_EVENT_END="loadEventEnd",e.LOAD_EVENT_START="loadEventStart",e.NAVIGATION_START="navigationStart",e.REDIRECT_END="redirectEnd",e.REDIRECT_START="redirectStart",e.REQUEST_START="requestStart",e.RESPONSE_END="responseEnd",e.RESPONSE_START="responseStart",e.SECURE_CONNECTION_START="secureConnectionStart",e.START_TIME="startTime",e.UNLOAD_EVENT_END="unloadEventEnd",e.UNLOAD_EVENT_START="unloadEventStart"})(v||(v={}));var fc="http.response_content_length",Sc="http.response_content_length_uncompressed";var di;function sp(){return di||(di=document.createElement("a")),di}function Xt(e,t){return t in e}function tt(e,t,r,n=!0){if(Xt(r,t)&&typeof r[t]=="number"&&!(n&&r[t]===0))return e.addEvent(t,r[t])}function Vt(e,t,r=!1,n,o){if(n===void 0&&(n=t[v.START_TIME]!==0),r||(tt(e,v.FETCH_START,t,n),tt(e,v.DOMAIN_LOOKUP_START,t,n),tt(e,v.DOMAIN_LOOKUP_END,t,n),tt(e,v.CONNECT_START,t,n),tt(e,v.SECURE_CONNECTION_START,t,n),tt(e,v.CONNECT_END,t,n),tt(e,v.REQUEST_START,t,n),tt(e,v.RESPONSE_START,t,n),tt(e,v.RESPONSE_END,t,n)),!o){let i=t[v.ENCODED_BODY_SIZE];i!==void 0&&e.setAttribute(fc,i);let s=t[v.DECODED_BODY_SIZE];s!==void 0&&i!==s&&e.setAttribute(Sc,s)}}function Ac(e){return e.slice().sort((t,r)=>{let n=t[v.FETCH_START],o=r[v.FETCH_START];return n>o?1:n1){let l=u[0],c=ap(u,l[v.RESPONSE_END],r),T=l[v.RESPONSE_END];return c[v.FETCH_START]=o&&(!s||p{let c=Nt(Bt(l[v.FETCH_START])),T=Nt(Bt(l[v.RESPONSE_END]));return l.initiatorType.toLowerCase()===(i||"xmlhttprequest")&&l.name===e&&c>=s&&T<=a});return u.length>0&&(u=u.filter(l=>!o.has(l))),u}function Ot(e){if(typeof URL=="function")return new URL(e,typeof document<"u"?document.baseURI:typeof location<"u"?location.href:void 0);let t=sp();return t.href=e,t}function Ve(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return"/";let r=lp(e,t);if(t&&r.indexOf("@id")>0)return r;let n="";return e.parentNode&&(n+=Ve(e.parentNode,!1)),n+=r,n}function up(e){if(!e.parentNode)return 0;let t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);let r=Array.from(e.parentNode.childNodes);return r=r.filter(n=>{let o=n.localName;return t.indexOf(n.nodeType)>=0&&o===e.localName}),r.length>=1?r.indexOf(e)+1:0}function lp(e,t){let r=e.nodeType,n=up(e),o="";if(r===Node.ELEMENT_NODE){let i=e.getAttribute("id");if(t&&i)return`//*[@id="${i}"]`;o=e.localName}else if(r===Node.TEXT_NODE||r===Node.CDATA_SECTION_NODE)o="text()";else if(r===Node.COMMENT_NODE)o="comment()";else return"";return o&&n>1?`/${o}[${n}]`:`/${o}`}function wr(e,t){let r=t||[];return(typeof r=="string"||r instanceof RegExp)&&(r=[r]),Ot(e).origin===gc()?!0:r.some(o=>kn(e,o))}var se={PLATFORM:"browser.platform",BRANDS:"browser.brands",MOBILE:"browser.mobile",LANGUAGE:"browser.language",USER_AGENT:"browser.user_agent"};var Ei=class{detect(t){if(!(typeof navigator<"u"))return fe();let n=pp();return this._getResourceAttributes(n,t)}_getResourceAttributes(t,r){return!t[se.USER_AGENT]&&!t[se.PLATFORM]?(E.debug("BrowserDetector failed: Unable to find required browser resources. "),fe()):{attributes:t}}};function pp(){let e={},t=navigator.userAgentData;return t?(e[se.PLATFORM]=t.platform,e[se.BRANDS]=t.brands.map(r=>`${r.brand} ${r.version}`),e[se.MOBILE]=t.mobile):e[se.USER_AGENT]=navigator.userAgent,e[se.LANGUAGE]=navigator.language,e}var mi=new Ei;var Ge="0.20.0",Rc="@honeycombio/user-instrumentation",Tp=["click"],Jn=class e extends Et{constructor(t={}){var r,n;super(Rc,Ge,t),this._config=t,this._isEnabled=(r=this._config.enabled)!==null&&r!==void 0?r:!1,this._listeners=(n=this._listeners)!==null&&n!==void 0?n:[]}init(){}static handleEndSpan(t){var r;(r=e._eventMap.get(t))===null||r===void 0||r.end()}static createGlobalEventListener(t,r,n){return o=>{let i=o.target;if(n()===!1||e._eventMap.has(o)||!dp(o,i,t,r))return;let s=Ve(i),a=L.getTracer(Rc);x.with(x.active(),()=>{a.startActiveSpan(t,{attributes:{event_type:t,target_element:i.tagName,target_xpath:s,"http.url":window.location.href}},u=>{Nc(o,"stopPropagation",u),Nc(o,"stopImmediatePropagation",u),e._eventMap.set(o,u)})})}}enable(){var t;if(this._isEnabled)return;let r=this.getRootNode();this._listeners=[],((t=this._config.eventNames)!==null&&t!==void 0?t:Tp).forEach(o=>{let i=e.createGlobalEventListener(o,this._config.rootNodeId,()=>this._isEnabled);this._listeners.push({eventName:o,handler:i}),r.addEventListener(o,i,{capture:!0}),r.addEventListener(o,e.handleEndSpan)}),this._isEnabled=!0}getRootNode(){if(this._config.rootNodeId){let t=document.getElementById(this._config.rootNodeId);return t===null?(this._diag.warn(`Root Node id: ${this._config.rootNodeId} not found!`),document):t}return document}disable(){this._isEnabled=!1,this._listeners.forEach(({eventName:t,handler:r})=>{document.removeEventListener(t,r,{capture:!0}),document.removeEventListener(t,e.handleEndSpan)}),this._listeners=[]}};Jn._eventMap=new WeakMap;var dp=(e,t,r,n)=>{if(!(t instanceof HTMLElement))return!1;let o=`on${r}`;return!(!Oc(t,o,n)||!t.getAttribute||t.hasAttribute("disabled"))},Oc=(e,t,r)=>!e||r&&e.id===r?!1:e[t]?!0:Oc(e.parentElement,t,r),Nc=(e,t,r)=>{let n=e[t].bind(e);e[t]=()=>{r.end(),n()}};var ue=cn(xc()),bu=cn(Cc());var qt=class{_delegate;constructor(t){this._delegate=t}export(t,r){this._delegate.export(t,r)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}};var Br=class extends Error{code;name="OTLPExporterError";data;constructor(t,r,n){super(t),this.data=n,this.code=r}};function hp(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function vc(e){if(e!=null)return()=>e}function Lc(e,t,r){return{timeoutMillis:hp(e.timeoutMillis??t.timeoutMillis??r.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??r.concurrencyLimit,compression:e.compression??t.compression??r.compression}}function Ic(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}var fi=class{_concurrencyLimit;_sendingPromises=[];constructor(t){this._concurrencyLimit=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(t);let r=()=>{let n=this._sendingPromises.indexOf(t);this._sendingPromises.splice(n,1)};t.then(r,r)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}};function wc(e){return new fi(e.concurrencyLimit)}function fp(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}function yc(){return{handleResponse(e){e==null||!fp(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||E.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}var Si=class{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(t,r,n,o,i){this._transport=t,this._serializer=r,this._responseHandler=n,this._promiseQueue=o,this._timeout=i,this._diagLogger=E.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,r){if(this._diagLogger.debug("items to be sent",t),this._promiseQueue.hasReachedLimit()){r({code:Z.FAILED,error:new Error("Concurrent export limit reached")});return}let n=this._serializer.serializeRequest(t);if(n==null){r({code:Z.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(o=>{if(o.status==="success"){if(o.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(o.data))}catch(i){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",i,o.data)}r({code:Z.SUCCESS});return}else if(o.status==="failure"&&o.error){r({code:Z.FAILED,error:o.error});return}else o.status==="retryable"?r({code:Z.FAILED,error:new Br("Export failed with retryable status")}):r({code:Z.FAILED,error:new Br("Export failed with unknown error")})},o=>r({code:Z.FAILED,error:o})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}};function Dc(e,t){return new Si(e.transport,e.serializer,yc(),e.promiseHandler,t.timeout)}function Ai(e,t,r){return Dc({transport:r,serializer:t,promiseHandler:wc(e)},{timeout:e.timeoutMillis})}function Uc(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Zn(e){let t=new Uint8Array(e.length/2),r=0;for(let n=0;n>BigInt(32)));return{low:t,high:r}}function Gc(e){let t=Vc(e);return Sp(t)}function Ap(e){return Vc(e).toString()}var gp=typeof BigInt<"u"?Ap:Nt;function Bc(e){return e}function Hc(e){if(e!==void 0)return Zn(e)}var Rp={encodeHrTime:Gc,encodeSpanContext:Zn,encodeOptionalSpanContext:Hc};function He(e){if(e===void 0)return Rp;let t=e.useLongBits??!0,r=e.useHex??!1;return{encodeHrTime:t?Gc:gp,encodeSpanContext:r?Bc:Zn,encodeOptionalSpanContext:r?Bc:Hc}}function ke(e){return{attributes:Qt(e.attributes),droppedAttributesCount:0}}function Fe(e){return{name:e.name,version:e.version}}function Qt(e){return Object.keys(e).map(t=>to(t,e[t]))}function to(e,t){return{key:e,value:eo(t)}}function eo(e){let t=typeof e;return t==="string"?{stringValue:e}:t==="number"?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:t==="boolean"?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(eo)}}:t==="object"&&e!=null?{kvlistValue:{values:Object.entries(e).map(([r,n])=>to(r,n))}}:{}}function kc(e,t){let r=He(t);return{resourceLogs:Op(e,r)}}function Np(e){let t=new Map;for(let r of e){let{resource:n,instrumentationScope:{name:o,version:i="",schemaUrl:s=""}}=r,a=t.get(n);a||(a=new Map,t.set(n,a));let u=`${o}@${i}:${s}`,l=a.get(u);l||(l=[],a.set(u,l)),l.push(r)}return t}function Op(e,t){let r=Np(e);return Array.from(r,([n,o])=>({resource:ke(n),scopeLogs:Array.from(o,([,i])=>({scope:Fe(i[0].instrumentationScope),logRecords:i.map(s=>bp(s,t)),schemaUrl:i[0].instrumentationScope.schemaUrl})),schemaUrl:void 0}))}function bp(e,t){return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:e.severityNumber,severityText:e.severityText,body:eo(e.body),attributes:Pp(e.attributes),droppedAttributesCount:e.droppedAttributesCount,flags:e.spanContext?.traceFlags,traceId:t.encodeOptionalSpanContext(e.spanContext?.traceId),spanId:t.encodeOptionalSpanContext(e.spanContext?.spanId)}}function Pp(e){return Object.keys(e).map(t=>to(t,e[t]))}var bt;(function(e){e[e.DELTA=0]="DELTA",e[e.CUMULATIVE=1]="CUMULATIVE"})(bt||(bt={}));var ot;(function(e){e.COUNTER="COUNTER",e.GAUGE="GAUGE",e.HISTOGRAM="HISTOGRAM",e.UP_DOWN_COUNTER="UP_DOWN_COUNTER",e.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",e.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",e.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(ot||(ot={}));var ae;(function(e){e[e.HISTOGRAM=0]="HISTOGRAM",e[e.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",e[e.GAUGE=2]="GAUGE",e[e.SUM=3]="SUM"})(ae||(ae={}));var Vr;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.DROP=1]="DROP",e[e.SUM=2]="SUM",e[e.LAST_VALUE=3]="LAST_VALUE",e[e.EXPLICIT_BUCKET_HISTOGRAM=4]="EXPLICIT_BUCKET_HISTOGRAM",e[e.EXPONENTIAL_HISTOGRAM=5]="EXPONENTIAL_HISTOGRAM"})(Vr||(Vr={}));var Gr;(function(e){e[e.AGGREGATION_TEMPORALITY_UNSPECIFIED=0]="AGGREGATION_TEMPORALITY_UNSPECIFIED",e[e.AGGREGATION_TEMPORALITY_DELTA=1]="AGGREGATION_TEMPORALITY_DELTA",e[e.AGGREGATION_TEMPORALITY_CUMULATIVE=2]="AGGREGATION_TEMPORALITY_CUMULATIVE"})(Gr||(Gr={}));function Mp(e,t){let r=He(t);return{resource:ke(e.resource),schemaUrl:void 0,scopeMetrics:xp(e.scopeMetrics,r)}}function xp(e,t){return Array.from(e.map(r=>({scope:Fe(r.scope),metrics:r.metrics.map(n=>Cp(n,t)),schemaUrl:r.scope.schemaUrl})))}function Cp(e,t){let r={name:e.descriptor.name,description:e.descriptor.description,unit:e.descriptor.unit},n=wp(e.aggregationTemporality);switch(e.dataPointType){case ae.SUM:r.sum={aggregationTemporality:n,isMonotonic:e.isMonotonic,dataPoints:Fc(e,t)};break;case ae.GAUGE:r.gauge={dataPoints:Fc(e,t)};break;case ae.HISTOGRAM:r.histogram={aggregationTemporality:n,dataPoints:Lp(e,t)};break;case ae.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:n,dataPoints:Ip(e,t)};break}return r}function vp(e,t,r){let n={attributes:Qt(e.attributes),startTimeUnixNano:r.encodeHrTime(e.startTime),timeUnixNano:r.encodeHrTime(e.endTime)};switch(t){case xt.INT:n.asInt=e.value;break;case xt.DOUBLE:n.asDouble=e.value;break}return n}function Fc(e,t){return e.dataPoints.map(r=>vp(r,e.descriptor.valueType,t))}function Lp(e,t){return e.dataPoints.map(r=>{let n=r.value;return{attributes:Qt(r.attributes),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)}})}function Ip(e,t){return e.dataPoints.map(r=>{let n=r.value;return{attributes:Qt(r.attributes),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)}})}function wp(e){switch(e){case bt.DELTA:return Gr.AGGREGATION_TEMPORALITY_DELTA;case bt.CUMULATIVE:return Gr.AGGREGATION_TEMPORALITY_CUMULATIVE}}function Yc(e,t){return{resourceMetrics:e.map(r=>Mp(r,t))}}function yp(e,t){let r=e.spanContext(),n=e.status,o=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(r.traceId),spanId:t.encodeSpanContext(r.spanId),parentSpanId:o,traceState:r.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:Qt(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(i=>Up(i,t)),droppedEventsCount:e.droppedEventsCount,status:{code:n.code,message:n.message},links:e.links.map(i=>Dp(i,t)),droppedLinksCount:e.droppedLinksCount}}function Dp(e,t){return{attributes:e.attributes?Qt(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function Up(e,t){return{attributes:e.attributes?Qt(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function $c(e,t){let r=He(t);return{resourceSpans:Vp(e,r)}}function Bp(e){let t=new Map;for(let r of e){let n=t.get(r.resource);n||(n=new Map,t.set(r.resource,n));let o=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`,i=n.get(o);i||(i=[],n.set(o,i)),i.push(r)}return t}function Vp(e,t){let r=Bp(e),n=[],o=r.entries(),i=o.next();for(;!i.done;){let[s,a]=i.value,u=[],l=a.values(),c=l.next();for(;!c.done;){let p=c.value;if(p.length>0){let _=p.map(d=>yp(d,t));u.push({scope:Fe(p[0].instrumentationScope),spans:_,schemaUrl:p[0].instrumentationScope.schemaUrl})}c=l.next()}let T={resource:ke(s),scopeSpans:u,schemaUrl:void 0};n.push(T),i=o.next()}return n}var ro={serializeRequest:e=>{let t=kc(e,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))}};var no={serializeRequest:e=>{let t=Yc([e],{useLongBits:!1});return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))}};var oo={serializeRequest:e=>{let t=$c(e,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))}};function Gp(){return Math.random()*(2*.2)-.2}var gi=class{_transport;constructor(t){this._transport=t}retry(t,r,n){return new Promise((o,i)=>{setTimeout(()=>{this._transport.send(t,r).then(o,i)},n)})}async send(t,r){let n=Date.now()+r,o=await this._transport.send(t,r),i=5,s=1e3;for(;o.status==="retryable"&&i>0;){i--;let a=Math.max(Math.min(s,5e3)+Gp(),0);s=s*1.5;let u=o.retryInMillis??a,l=n-Date.now();if(u>l)return o;o=await this.retry(t,l,u)}return o}shutdown(){return this._transport.shutdown()}};function Ri(e){return new gi(e.transport)}function jc(e){return[429,502,503,504].includes(e)}function Kc(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let r=new Date(e).getTime()-Date.now();return r>=0?r:0}var Ni=class{_parameters;constructor(t){this._parameters=t}send(t,r){return new Promise(n=>{let o=new XMLHttpRequest;o.timeout=r,o.open("POST",this._parameters.url);let i=this._parameters.headers();Object.entries(i).forEach(([s,a])=>{o.setRequestHeader(s,a)}),o.ontimeout=s=>{n({status:"failure",error:new Error("XHR request timed out")})},o.onreadystatechange=()=>{o.status>=200&&o.status<=299?(E.debug("XHR success"),n({status:"success"})):o.status&&jc(o.status)?n({status:"retryable",retryInMillis:Kc(o.getResponseHeader("Retry-After"))}):o.status!==0&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")})},o.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},o.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},o.send(t)})}shutdown(){}};function zc(e){return new Ni(e)}var Oi=class{_params;constructor(t){this._params=t}send(t){return new Promise(r=>{navigator.sendBeacon(this._params.url,new Blob([t],{type:this._params.blobType}))?(E.debug("SendBeacon success"),r({status:"success"})):r({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}};function Wc(e){return new Oi(e)}function Xc(e,t){return Ai(e,t,Ri({transport:zc(e)}))}function qc(e,t){return Ai(e,t,Ri({transport:Wc({url:e.url,blobType:e.headers()["Content-Type"]})}))}function Qc(e){return()=>{let t={};return Object.entries(e?.()??{}).forEach(([r,n])=>{typeof n<"u"?t[r]=String(n):E.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),t}}function Hp(e,t,r){let n={...r()},o={};return()=>(t!=null&&Object.assign(o,t()),e!=null&&Object.assign(o,e()),Object.assign(o,n))}function kp(e){if(e!=null)try{return new URL(e),e}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function Jc(e,t,r){return{...Lc(e,t,r),headers:Hp(Qc(e.headers),t.headers,r.headers),url:kp(e.url)??t.url??r.url,agentOptions:e.agentOptions??t.agentOptions??r.agentOptions}}function Zc(e,t){return{...Ic(),headers:()=>e,url:"http://localhost:4318/"+t,agentOptions:{keepAlive:!0}}}function tu(e,t,r){return Jc({url:e.url,timeoutMillis:e.timeoutMillis,headers:vc(e.headers),concurrencyLimit:e.concurrencyLimit},{},Zc(r,t))}function Re(e,t,r,n){let o=!!e.headers||typeof navigator.sendBeacon!="function",i=tu(e,r,n);return o?Xc(i,t):qc(i,t)}var Ye=class extends qt{constructor(t={}){super(Re(t,oo,"v1/traces",{"Content-Type":"application/json"}))}};var Hr;(function(e){e[e.DELTA=0]="DELTA",e[e.CUMULATIVE=1]="CUMULATIVE",e[e.LOWMEMORY=2]="LOWMEMORY"})(Hr||(Hr={}));var bi=()=>bt.CUMULATIVE,eu=e=>{switch(e){case ot.COUNTER:case ot.OBSERVABLE_COUNTER:case ot.GAUGE:case ot.HISTOGRAM:case ot.OBSERVABLE_GAUGE:return bt.DELTA;case ot.UP_DOWN_COUNTER:case ot.OBSERVABLE_UP_DOWN_COUNTER:return bt.CUMULATIVE}},ru=e=>{switch(e){case ot.COUNTER:case ot.HISTOGRAM:return bt.DELTA;case ot.GAUGE:case ot.UP_DOWN_COUNTER:case ot.OBSERVABLE_UP_DOWN_COUNTER:case ot.OBSERVABLE_COUNTER:case ot.OBSERVABLE_GAUGE:return bt.CUMULATIVE}};function Fp(){let e=(void 0??"cumulative").toLowerCase();return e==="cumulative"?bi:e==="delta"?eu:e==="lowmemory"?ru:(E.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${e}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`),bi)}function Yp(e){return e!=null?e===Hr.DELTA?eu:e===Hr.LOWMEMORY?ru:bi:Fp()}var $p=Object.freeze({type:Vr.DEFAULT});function jp(e){return e?.aggregationPreference??(()=>$p)}var io=class extends qt{_aggregationTemporalitySelector;_aggregationSelector;constructor(t,r){super(t),this._aggregationSelector=jp(r),this._aggregationTemporalitySelector=Yp(r?.temporalityPreference)}selectAggregation(t){return this._aggregationSelector(t)}selectAggregationTemporality(t){return this._aggregationTemporalitySelector(t)}};var $e=class extends io{constructor(t){super(Re(t??{},no,"v1/metrics",{"Content-Type":"application/json"}),t)}};var je=class extends qt{constructor(t={}){super(Re(t,ro,"v1/logs",{"Content-Type":"application/json"}))}};var nu="session.id";var so=class{_sessionIdProvider;constructor(t){this._sessionIdProvider=t}async forceFlush(){}onStart(t,r){let n=this._sessionIdProvider?.getSessionId();n&&t.setAttribute(nu,n)}onEnd(t){}async shutdown(){}};function Pi(e){return new so(e)}var Pu=cn(ou()),lo;(function(e){e[e.DELTA=0]="DELTA",e[e.CUMULATIVE=1]="CUMULATIVE"})(lo||(lo={}));var K;(function(e){e.COUNTER="COUNTER",e.GAUGE="GAUGE",e.HISTOGRAM="HISTOGRAM",e.UP_DOWN_COUNTER="UP_DOWN_COUNTER",e.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",e.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",e.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(K||(K={}));var qe;(function(e){e[e.HISTOGRAM=0]="HISTOGRAM",e[e.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",e[e.GAUGE=2]="GAUGE",e[e.SUM=3]="SUM"})(qe||(qe={}));function Kp(e){return e!=null}function Mu(e){let t=Object.keys(e);return t.length===0?"":(t=t.sort(),JSON.stringify(t.map(r=>[r,e[r]])))}function zp(e){return`${e.name}:${e.version??""}:${e.schemaUrl??""}`}var _o=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};function jr(e,t){let r,n=new Promise(function(i,s){r=setTimeout(function(){s(new _o("Operation timed out."))},t)});return Promise.race([e,n]).then(o=>(clearTimeout(r),o),o=>{throw clearTimeout(r),o})}async function Wp(e){return Promise.all(e.map(async t=>{try{return{status:"fulfilled",value:await t}}catch(r){return{status:"rejected",reason:r}}}))}function Xp(e){return e.status==="rejected"}function iu(e,t){let r=[];return e.forEach(n=>{r.push(...t(n))}),r}function qp(e,t){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}function Qp(e,t){let r=0,n=e.length-1,o=e.length;for(;n>=r;){let i=r+Math.trunc((n-r)/2);e[i]0);return t.push(0),{buckets:{boundaries:e,counts:t},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var Yr=class{startTime;_boundaries;_recordMinMax;_current;constructor(t,r,n=!0,o=Zp(r)){this.startTime=t,this._boundaries=r,this._recordMinMax=n,this._current=o}record(t){if(Number.isNaN(t))return;this._current.count+=1,this._current.sum+=t,this._recordMinMax&&(this._current.min=Math.min(t,this._current.min),this._current.max=Math.max(t,this._current.max),this._current.hasMinMax=!0);let r=Qp(this._boundaries,t);this._current.buckets.counts[r]+=1}setStartTime(t){this.startTime=t}toPointValue(){return this._current}},po=class{_boundaries;_recordMinMax;kind=Oe.HISTOGRAM;constructor(t,r){this._boundaries=t,this._recordMinMax=r}createAccumulation(t){return new Yr(t,this._boundaries,this._recordMinMax)}merge(t,r){let n=t.toPointValue(),o=r.toPointValue(),i=n.buckets.counts,s=o.buckets.counts,a=new Array(i.length);for(let c=0;c{let a=s.toPointValue(),u=t.type===K.GAUGE||t.type===K.UP_DOWN_COUNTER||t.type===K.OBSERVABLE_GAUGE||t.type===K.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:i,startTime:s.startTime,endTime:o,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:u?void 0:a.sum,buckets:a.buckets,count:a.count}}})}}},To=class e{backing;indexBase;indexStart;indexEnd;constructor(t=new Li,r=0,n=0,o=0){this.backing=t,this.indexBase=r,this.indexStart=n,this.indexEnd=o}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(t,r)=>this.at(r))}at(t){let r=this.indexBase-this.indexStart;return t=0;t--)if(this.at(t)!==0){this.indexEnd-=this.length-t-1;break}this._rotate()}downscale(t){this._rotate();let r=1+this.indexEnd-this.indexStart,n=1<>=t,this.indexEnd>>=t,this.indexBase=this.indexStart}clone(){return new e(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let t=this.indexBase-this.indexStart;t!==0&&(t>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,t),this.backing.reverse(t,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+t)),this.indexBase=this.indexStart)}_relocateBucket(t,r){t!==r&&this.incrementBucket(t,this.backing.emptyBucket(r))}},Li=class e{_counts;constructor(t=[0]){this._counts=t}get length(){return this._counts.length}countAt(t){return this._counts[t]}growTo(t,r,n){let o=new Array(t).fill(0);o.splice(n,this._counts.length-r,...this._counts.slice(r)),o.splice(0,r,...this._counts.slice(0,r)),this._counts=o}reverse(t,r){let n=Math.floor((t+r)/2)-t;for(let o=0;o=r?this._counts[t]-=r:this._counts[t]=0}clone(){return new e([...this._counts])}},tT=52,eT=2146435072,rT=1048575,Ys=1023,xu=-Ys+1,Cu=Ys,Ii=Math.pow(2,-1022);function vu(e){let t=new DataView(new ArrayBuffer(8));return t.setFloat64(0,e),((t.getUint32(0)&eT)>>20)-Ys}function Lu(e){let t=new DataView(new ArrayBuffer(8));t.setFloat64(0,e);let r=t.getUint32(0),n=t.getUint32(4);return(r&rT)*Math.pow(2,32)+n}function wi(e,t){return e===0||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY||Number.isNaN(e)?e:e*Math.pow(2,t)}function nT(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}var be=class extends Error{},yi=class{_shift;constructor(t){this._shift=-t}mapToIndex(t){if(t>this._shift}lowerBoundary(t){let r=this._minNormalLowerBoundaryIndex();if(tn)throw new be(`overflow: ${t} is > maximum lower boundary: ${n}`);return wi(1,t<>this._shift;return this._shift<2&&t--,t}_maxNormalLowerBoundaryIndex(){return Cu>>this._shift}_rightShift(t,r){return Math.floor(t*Math.pow(2,-r))}},Di=class{_scale;_scaleFactor;_inverseFactor;constructor(t){this._scale=t,this._scaleFactor=wi(Math.LOG2E,t),this._inverseFactor=wi(Math.LN2,-t)}mapToIndex(t){if(t<=Ii)return this._minNormalLowerBoundaryIndex()-1;if(Lu(t)===0)return(vu(t)<=n?n:r}lowerBoundary(t){let r=this._maxNormalLowerBoundaryIndex();if(t>=r){if(t===r)return 2*Math.exp((t-(1< maximum lower boundary: ${r}`)}let n=this._minNormalLowerBoundaryIndex();if(t<=n){if(t===n)return Ii;if(t===n-1)return Math.exp((t+(1<t>10?new Di(t-10):new yi(t-10));function cu(e){if(e>au||e= ${su} && <= ${au}, got: ${e}`);return oT[e+10]}var ze=class e{low;high;static combine(t,r){return new e(Math.min(t.low,r.low),Math.max(t.high,r.high))}constructor(t,r){this.low=t,this.high=r}},iT=20,sT=160,Mi=2,Ui=class e{startTime;_maxSize;_recordMinMax;_sum;_count;_zeroCount;_min;_max;_positive;_negative;_mapping;constructor(t=t,r=sT,n=!0,o=0,i=0,s=0,a=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,l=new To,c=new To,T=cu(iT)){this.startTime=t,this._maxSize=r,this._recordMinMax=n,this._sum=o,this._count=i,this._zeroCount=s,this._min=a,this._max=u,this._positive=l,this._negative=c,this._mapping=T,this._maxSizethis._max&&(this._max=t),t0?this._updateBuckets(this._positive,t,r):this._updateBuckets(this._negative,-t,r)}}merge(t){this._count===0?(this._min=t.min,this._max=t.max):t.count!==0&&(t.minthis.max&&(this._max=t.max)),this.startTime=t.startTime,this._sum+=t.sum,this._count+=t.count,this._zeroCount+=t.zeroCount;let r=this._minScale(t);this._downscale(this.scale-r),this._mergeBuckets(this.positive,t,t.positive,r),this._mergeBuckets(this.negative,t,t.negative,r)}diff(t){this._min=1/0,this._max=-1/0,this._sum-=t.sum,this._count-=t.count,this._zeroCount-=t.zeroCount;let r=this._minScale(t);this._downscale(this.scale-r),this._diffBuckets(this.positive,t,t.positive,r),this._diffBuckets(this.negative,t,t.negative,r)}clone(){return new e(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(t,r,n){let o=this._mapping.mapToIndex(r),i=!1,s=0,a=0;if(t.length===0?(t.indexStart=o,t.indexEnd=t.indexStart,t.indexBase=t.indexStart):o=this._maxSize?(i=!0,a=o,s=t.indexEnd):o>t.indexEnd&&o-t.indexStart>=this._maxSize&&(i=!0,a=t.indexStart,s=o),i){let u=this._changeScale(s,a);this._downscale(u),o=this._mapping.mapToIndex(r)}this._incrementIndexBy(t,o,n)}_incrementIndexBy(t,r,n){if(n===0)return;if(t.length===0&&(t.indexStart=t.indexEnd=t.indexBase=r),r=t.backing.length&&this._grow(t,i+1),t.indexStart=r}else if(r>t.indexEnd){let i=r-t.indexStart;i>=t.backing.length&&this._grow(t,i+1),t.indexEnd=r}let o=r-t.indexBase;o<0&&(o+=t.backing.length),t.incrementBucket(o,n)}_grow(t,r){let n=t.backing.length,o=t.indexBase-t.indexStart,i=n-o,s=nT(r);s>this._maxSize&&(s=this._maxSize);let a=s-o;t.backing.growTo(s,i,a)}_changeScale(t,r){let n=0;for(;t-r>=this._maxSize;)t>>=1,r>>=1,n++;return n}_downscale(t){if(t===0)return;if(t<0)throw new Error(`impossible change of scale: ${this.scale}`);let r=this._mapping.scale-t;this._positive.downscale(t),this._negative.downscale(t),this._mapping=cu(r)}_minScale(t){let r=Math.min(this.scale,t.scale),n=ze.combine(this._highLowAtScale(this.positive,this.scale,r),this._highLowAtScale(t.positive,t.scale,r)),o=ze.combine(this._highLowAtScale(this.negative,this.scale,r),this._highLowAtScale(t.negative,t.scale,r));return Math.min(r-this._changeScale(n.high,n.low),r-this._changeScale(o.high,o.low))}_highLowAtScale(t,r,n){if(t.length===0)return new ze(0,-1);let o=r-n;return new ze(t.indexStart>>o,t.indexEnd>>o)}_mergeBuckets(t,r,n,o){let i=n.offset,s=r.scale-o;for(let a=0;a>s,n.at(a))}_diffBuckets(t,r,n,o){let i=n.offset,s=r.scale-o;for(let a=0;a>s)-t.indexBase;l<0&&(l+=t.backing.length),t.decrementBucket(l,n.at(a))}t.trim()}},Bi=class{_maxSize;_recordMinMax;kind=Oe.EXPONENTIAL_HISTOGRAM;constructor(t,r){this._maxSize=t,this._recordMinMax=r}createAccumulation(t){return new Ui(t,this._maxSize,this._recordMinMax)}merge(t,r){let n=r.clone();return n.merge(t),n}diff(t,r){let n=r.clone();return n.diff(t),n}toMetricData(t,r,n,o){return{descriptor:t,aggregationTemporality:r,dataPointType:qe.EXPONENTIAL_HISTOGRAM,dataPoints:n.map(([i,s])=>{let a=s.toPointValue(),u=t.type===K.GAUGE||t.type===K.UP_DOWN_COUNTER||t.type===K.OBSERVABLE_GAUGE||t.type===K.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:i,startTime:s.startTime,endTime:o,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:u?void 0:a.sum,positive:{offset:a.positive.offset,bucketCounts:a.positive.bucketCounts},negative:{offset:a.negative.offset,bucketCounts:a.negative.bucketCounts},count:a.count,scale:a.scale,zeroCount:a.zeroCount}}})}}},$r=class{startTime;_current;sampleTime;constructor(t,r=0,n=[0,0]){this.startTime=t,this._current=r,this.sampleTime=n}record(t){this._current=t,this.sampleTime=ut(Date.now())}setStartTime(t){this.startTime=t}toPointValue(){return this._current}},Vi=class{kind=Oe.LAST_VALUE;createAccumulation(t){return new $r(t)}merge(t,r){let n=me(r.sampleTime)>=me(t.sampleTime)?r:t;return new $r(t.startTime,n.toPointValue(),n.sampleTime)}diff(t,r){let n=me(r.sampleTime)>=me(t.sampleTime)?r:t;return new $r(r.startTime,n.toPointValue(),n.sampleTime)}toMetricData(t,r,n,o){return{descriptor:t,aggregationTemporality:r,dataPointType:qe.GAUGE,dataPoints:n.map(([i,s])=>({attributes:i,startTime:s.startTime,endTime:o,value:s.toPointValue()}))}}},Ne=class{startTime;monotonic;_current;reset;constructor(t,r,n=0,o=!1){this.startTime=t,this.monotonic=r,this._current=n,this.reset=o}record(t){this.monotonic&&t<0||(this._current+=t)}setStartTime(t){this.startTime=t}toPointValue(){return this._current}},Eo=class{monotonic;kind=Oe.SUM;constructor(t){this.monotonic=t}createAccumulation(t){return new Ne(t,this.monotonic)}merge(t,r){let n=t.toPointValue(),o=r.toPointValue();return r.reset?new Ne(r.startTime,this.monotonic,o,r.reset):new Ne(t.startTime,this.monotonic,n+o)}diff(t,r){let n=t.toPointValue(),o=r.toPointValue();return this.monotonic&&n>o?new Ne(r.startTime,this.monotonic,o,!0):new Ne(r.startTime,this.monotonic,o-n)}toMetricData(t,r,n,o){return{descriptor:t,aggregationTemporality:r,dataPointType:qe.SUM,dataPoints:n.map(([i,s])=>({attributes:i,startTime:s.startTime,endTime:o,value:s.toPointValue()})),isMonotonic:this.monotonic}}},Gi=class e{static DEFAULT_INSTANCE=new vi;createAggregator(t){return e.DEFAULT_INSTANCE}},Hi=class e{static MONOTONIC_INSTANCE=new Eo(!0);static NON_MONOTONIC_INSTANCE=new Eo(!1);createAggregator(t){switch(t.type){case K.COUNTER:case K.OBSERVABLE_COUNTER:case K.HISTOGRAM:return e.MONOTONIC_INSTANCE;default:return e.NON_MONOTONIC_INSTANCE}}},ki=class e{static DEFAULT_INSTANCE=new Vi;createAggregator(t){return e.DEFAULT_INSTANCE}},Fi=class e{static DEFAULT_INSTANCE=new po([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);createAggregator(t){return e.DEFAULT_INSTANCE}},mo=class{_recordMinMax;_boundaries;constructor(t,r=!0){if(this._recordMinMax=r,t==null)throw new Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array");t=t.concat(),t=t.sort((i,s)=>i-s);let n=t.lastIndexOf(-1/0),o=t.indexOf(1/0);o===-1&&(o=void 0),this._boundaries=t.slice(n+1,o)}createAggregator(t){return new po(this._boundaries,this._recordMinMax)}},Yi=class{_maxSize;_recordMinMax;constructor(t=160,r=!0){this._maxSize=t,this._recordMinMax=r}createAggregator(t){return new Bi(this._maxSize,this._recordMinMax)}},$i=class{_resolve(t){switch(t.type){case K.COUNTER:case K.UP_DOWN_COUNTER:case K.OBSERVABLE_COUNTER:case K.OBSERVABLE_UP_DOWN_COUNTER:return wu;case K.GAUGE:case K.OBSERVABLE_GAUGE:return yu;case K.HISTOGRAM:return t.advice.explicitBucketBoundaries?new mo(t.advice.explicitBucketBoundaries):Du}return E.warn(`Unable to recognize instrument type: ${t.type}`),Iu}createAggregator(t){return this._resolve(t).createAggregator(t)}},Iu=new Gi,wu=new Hi,yu=new ki,Du=new Fi,aT=new $i,Gt;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.DROP=1]="DROP",e[e.SUM=2]="SUM",e[e.LAST_VALUE=3]="LAST_VALUE",e[e.EXPLICIT_BUCKET_HISTOGRAM=4]="EXPLICIT_BUCKET_HISTOGRAM",e[e.EXPONENTIAL_HISTOGRAM=5]="EXPONENTIAL_HISTOGRAM"})(Gt||(Gt={}));function Uu(e){switch(e.type){case Gt.DEFAULT:return aT;case Gt.DROP:return Iu;case Gt.SUM:return wu;case Gt.LAST_VALUE:return yu;case Gt.EXPONENTIAL_HISTOGRAM:{let t=e;return new Yi(t.options?.maxSize,t.options?.recordMinMax)}case Gt.EXPLICIT_BUCKET_HISTOGRAM:{let t=e;return t.options==null?Du:new mo(t.options?.boundaries,t.options?.recordMinMax)}default:throw new Error("Unsupported Aggregation")}}var cT=e=>({type:Gt.DEFAULT}),Bu=e=>lo.CUMULATIVE,ji=class{_shutdown=!1;_metricProducers;_sdkMetricProducer;_aggregationTemporalitySelector;_aggregationSelector;_cardinalitySelector;constructor(t){this._aggregationSelector=t?.aggregationSelector??cT,this._aggregationTemporalitySelector=t?.aggregationTemporalitySelector??Bu,this._metricProducers=t?.metricProducers??[],this._cardinalitySelector=t?.cardinalitySelector}setMetricProducer(t){if(this._sdkMetricProducer)throw new Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=t,this.onInitialized()}selectAggregation(t){return this._aggregationSelector(t)}selectAggregationTemporality(t){return this._aggregationTemporalitySelector(t)}selectCardinalityLimit(t){return this._cardinalitySelector?this._cardinalitySelector(t):2e3}onInitialized(){}async collect(t){if(this._sdkMetricProducer===void 0)throw new Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw new Error("MetricReader is shutdown");let[r,...n]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:t?.timeoutMillis}),...this._metricProducers.map(a=>a.collect({timeoutMillis:t?.timeoutMillis}))]),o=r.errors.concat(iu(n,a=>a.errors)),i=r.resourceMetrics.resource,s=r.resourceMetrics.scopeMetrics.concat(iu(n,a=>a.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:i,scopeMetrics:s},errors:o}}async shutdown(t){if(this._shutdown){E.error("Cannot call shutdown twice.");return}t?.timeoutMillis==null?await this.onShutdown():await jr(this.onShutdown(),t.timeoutMillis),this._shutdown=!0}async forceFlush(t){if(this._shutdown){E.warn("Cannot forceFlush on already shutdown MetricReader.");return}if(t?.timeoutMillis==null){await this.onForceFlush();return}await jr(this.onForceFlush(),t.timeoutMillis)}},Ki=class extends ji{_interval;_exporter;_exportInterval;_exportTimeout;constructor(t){if(super({aggregationSelector:t.exporter.selectAggregation?.bind(t.exporter),aggregationTemporalitySelector:t.exporter.selectAggregationTemporality?.bind(t.exporter),metricProducers:t.metricProducers}),t.exportIntervalMillis!==void 0&&t.exportIntervalMillis<=0)throw Error("exportIntervalMillis must be greater than 0");if(t.exportTimeoutMillis!==void 0&&t.exportTimeoutMillis<=0)throw Error("exportTimeoutMillis must be greater than 0");if(t.exportTimeoutMillis!==void 0&&t.exportIntervalMillis!==void 0&&t.exportIntervalMillis0&&E.error("PeriodicExportingMetricReader: metrics collection errors",...r),t.resource.asyncAttributesPending)try{await t.resource.waitForAsyncAttributes?.()}catch(o){E.debug("Error while resolving async portion of resource: ",o),st(o)}if(t.scopeMetrics.length===0)return;let n=await li._export(this._exporter,t);if(n.code!==Z.SUCCESS)throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${n.error})`)}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),this._interval}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this.onForceFlush(),await this._exporter.shutdown()}},zi=class e{_shutdown=!1;_temporalitySelector;constructor(t){this._temporalitySelector=t?.temporalitySelector??Bu}export(t,r){if(this._shutdown){setImmediate(r,{code:Z.FAILED});return}return e._sendMetrics(t,r)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(t){return this._temporalitySelector(t)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(t,r){for(let n of t.scopeMetrics)for(let o of n.metrics)console.dir({descriptor:o.descriptor,dataPointType:o.dataPointType,dataPoints:o.dataPoints},{depth:null});r({code:Z.SUCCESS})}},Wi=class{_registeredViews=[];addView(t){this._registeredViews.push(t)}findViews(t,r){return this._registeredViews.filter(o=>this._matchInstrument(o.instrumentSelector,t)&&this._matchMeter(o.meterSelector,r))}_matchInstrument(t,r){return(t.getType()===void 0||r.type===t.getType())&&t.getNameFilter().match(r.name)&&t.getUnitFilter().match(r.unit)}_matchMeter(t,r){return t.getNameFilter().match(r.name)&&(r.version===void 0||t.getVersionFilter().match(r.version))&&(r.schemaUrl===void 0||t.getSchemaUrlFilter().match(r.schemaUrl))}};function ce(e,t,r){return pT(e)||E.warn(`Invalid metric name: "${e}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:e,type:t,description:r?.description??"",unit:r?.unit??"",valueType:r?.valueType??xt.DOUBLE,advice:r?.advice??{}}}function uT(e,t){return{name:e.name??t.name,description:e.description??t.description,type:t.type,unit:t.unit,valueType:t.valueType,advice:t.advice}}function lT(e,t){return Jp(e.name,t.name)&&e.unit===t.unit&&e.type===t.type&&e.valueType===t.valueType}var _T=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function pT(e){return e.match(_T)!=null}var Qe=class{_writableMetricStorage;_descriptor;constructor(t,r){this._writableMetricStorage=t,this._descriptor=r}_record(t,r={},n=x.active()){if(typeof t!="number"){E.warn(`non-number value provided to metric ${this._descriptor.name}: ${t}`);return}this._descriptor.valueType===xt.INT&&!Number.isInteger(t)&&(E.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||this._writableMetricStorage.record(t,r,n,ut(Date.now()))}},Xi=class extends Qe{add(t,r,n){this._record(t,r,n)}},qi=class extends Qe{add(t,r,n){if(t<0){E.warn(`negative value provided to counter ${this._descriptor.name}: ${t}`);return}this._record(t,r,n)}},Qi=class extends Qe{record(t,r,n){this._record(t,r,n)}},Ji=class extends Qe{record(t,r,n){if(t<0){E.warn(`negative value provided to histogram ${this._descriptor.name}: ${t}`);return}this._record(t,r,n)}},Je=class{_observableRegistry;_metricStorages;_descriptor;constructor(t,r,n){this._observableRegistry=n,this._descriptor=t,this._metricStorages=r}addCallback(t){this._observableRegistry.addCallback(t,this)}removeCallback(t){this._observableRegistry.removeCallback(t,this)}},Zi=class extends Je{},ts=class extends Je{},es=class extends Je{};function rs(e){return e instanceof Je}var ns=class{_meterSharedState;constructor(t){this._meterSharedState=t}createGauge(t,r){let n=ce(t,K.GAUGE,r),o=this._meterSharedState.registerMetricStorage(n);return new Qi(o,n)}createHistogram(t,r){let n=ce(t,K.HISTOGRAM,r),o=this._meterSharedState.registerMetricStorage(n);return new Ji(o,n)}createCounter(t,r){let n=ce(t,K.COUNTER,r),o=this._meterSharedState.registerMetricStorage(n);return new qi(o,n)}createUpDownCounter(t,r){let n=ce(t,K.UP_DOWN_COUNTER,r),o=this._meterSharedState.registerMetricStorage(n);return new Xi(o,n)}createObservableGauge(t,r){let n=ce(t,K.OBSERVABLE_GAUGE,r),o=this._meterSharedState.registerAsyncMetricStorage(n);return new ts(n,o,this._meterSharedState.observableRegistry)}createObservableCounter(t,r){let n=ce(t,K.OBSERVABLE_COUNTER,r),o=this._meterSharedState.registerAsyncMetricStorage(n);return new Zi(n,o,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(t,r){let n=ce(t,K.OBSERVABLE_UP_DOWN_COUNTER,r),o=this._meterSharedState.registerAsyncMetricStorage(n);return new es(n,o,this._meterSharedState.observableRegistry)}addBatchObservableCallback(t,r){this._meterSharedState.observableRegistry.addBatchCallback(t,r)}removeBatchObservableCallback(t,r){this._meterSharedState.observableRegistry.removeBatchCallback(t,r)}},ho=class{_instrumentDescriptor;constructor(t){this._instrumentDescriptor=t}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(t){this._instrumentDescriptor=ce(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:t,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}},os=class{_hash;_valueMap=new Map;_keyMap=new Map;constructor(t){this._hash=t}get(t,r){return r??=this._hash(t),this._valueMap.get(r)}getOrDefault(t,r){let n=this._hash(t);if(this._valueMap.has(n))return this._valueMap.get(n);let o=r();return this._keyMap.has(n)||this._keyMap.set(n,t),this._valueMap.set(n,o),o}set(t,r,n){n??=this._hash(t),this._keyMap.has(n)||this._keyMap.set(n,t),this._valueMap.set(n,r)}has(t,r){return r??=this._hash(t),this._valueMap.has(r)}*keys(){let t=this._keyMap.entries(),r=t.next();for(;r.done!==!0;)yield[r.value[1],r.value[0]],r=t.next()}*entries(){let t=this._valueMap.entries(),r=t.next();for(;r.done!==!0;)yield[this._keyMap.get(r.value[0]),r.value[1],r.value[0]],r=t.next()}get size(){return this._valueMap.size}},Jt=class extends os{constructor(){super(Mu)}},fo=class{_aggregator;_activeCollectionStorage=new Jt;_cumulativeMemoStorage=new Jt;_cardinalityLimit;_overflowAttributes={"otel.metric.overflow":!0};_overflowHashCode;constructor(t,r){this._aggregator=t,this._cardinalityLimit=(r??2e3)-1,this._overflowHashCode=Mu(this._overflowAttributes)}record(t,r,n,o){let i=this._activeCollectionStorage.get(r);if(!i){if(this._activeCollectionStorage.size>=this._cardinalityLimit){this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(o))?.record(t);return}i=this._aggregator.createAccumulation(o),this._activeCollectionStorage.set(r,i)}i?.record(t)}batchCumulate(t,r){Array.from(t.entries()).forEach(([n,o,i])=>{let s=this._aggregator.createAccumulation(r);s?.record(o);let a=s;if(this._cumulativeMemoStorage.has(n,i)){let u=this._cumulativeMemoStorage.get(n,i);a=this._aggregator.diff(u,s)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(n=this._overflowAttributes,i=this._overflowHashCode,this._cumulativeMemoStorage.has(n,i))){let u=this._cumulativeMemoStorage.get(n,i);a=this._aggregator.diff(u,s)}if(this._activeCollectionStorage.has(n,i)){let u=this._activeCollectionStorage.get(n,i);a=this._aggregator.merge(u,a)}this._cumulativeMemoStorage.set(n,s,i),this._activeCollectionStorage.set(n,a,i)})}collect(){let t=this._activeCollectionStorage;return this._activeCollectionStorage=new Jt,t}},So=class e{_aggregator;_unreportedAccumulations=new Map;_reportHistory=new Map;constructor(t,r){this._aggregator=t,r.forEach(n=>{this._unreportedAccumulations.set(n,[])})}buildMetrics(t,r,n,o){this._stashAccumulations(n);let i=this._getMergedUnreportedAccumulations(t),s=i,a;if(this._reportHistory.has(t)){let l=this._reportHistory.get(t),c=l.collectionTime;a=l.aggregationTemporality,a===lo.CUMULATIVE?s=e.merge(l.accumulations,i,this._aggregator):s=e.calibrateStartTime(l.accumulations,i,c)}else a=t.selectAggregationTemporality(r.type);this._reportHistory.set(t,{accumulations:s,collectionTime:o,aggregationTemporality:a});let u=TT(s);if(u.length!==0)return this._aggregator.toMetricData(r,a,u,o)}_stashAccumulations(t){let r=this._unreportedAccumulations.keys();for(let n of r){let o=this._unreportedAccumulations.get(n);o===void 0&&(o=[],this._unreportedAccumulations.set(n,o)),o.push(t)}}_getMergedUnreportedAccumulations(t){let r=new Jt,n=this._unreportedAccumulations.get(t);if(this._unreportedAccumulations.set(t,[]),n===void 0)return r;for(let o of n)r=e.merge(r,o,this._aggregator);return r}static merge(t,r,n){let o=t,i=r.entries(),s=i.next();for(;s.done!==!0;){let[a,u,l]=s.value;if(t.has(a,l)){let c=t.get(a,l),T=n.merge(c,u);o.set(a,T,l)}else o.set(a,u,l);s=i.next()}return o}static calibrateStartTime(t,r,n){for(let[o,i]of t.keys())r.get(o,i)?.setStartTime(n);return r}};function TT(e){return Array.from(e.entries())}var is=class extends ho{_attributesProcessor;_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;constructor(t,r,n,o,i){super(t),this._attributesProcessor=n,this._aggregationCardinalityLimit=i,this._deltaMetricStorage=new fo(r,this._aggregationCardinalityLimit),this._temporalMetricStorage=new So(r,o)}record(t,r){let n=new Jt;Array.from(t.entries()).forEach(([o,i])=>{n.set(this._attributesProcessor.process(o),i)}),this._deltaMetricStorage.batchCumulate(n,r)}collect(t,r){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(t,this._instrumentDescriptor,n,r)}};function uu(e,t){let r="";return e.unit!==t.unit&&(r+=` - Unit '${e.unit}' does not match '${t.unit}'
`),e.type!==t.type&&(r+=` - Type '${e.type}' does not match '${t.type}'
`),e.valueType!==t.valueType&&(r+=` - Value Type '${e.valueType}' does not match '${t.valueType}'
`),e.description!==t.description&&(r+=` - Description '${e.description}' does not match '${t.description}'
`),r}function dT(e,t){return` - use valueType '${e.valueType}' on instrument creation or use an instrument name other than '${t.name}'`}function ET(e,t){return` - use unit '${e.unit}' on instrument creation or use an instrument name other than '${t.name}'`}function mT(e,t){let r={name:t.name,type:t.type,unit:t.unit},n=JSON.stringify(r);return` - create a new view with a name other than '${e.name}' and InstrumentSelector '${n}'`}function hT(e,t){let r={name:t.name,type:t.type,unit:t.unit},n=JSON.stringify(r);return` - create a new view with a name other than '${e.name}' and InstrumentSelector '${n}'
- OR - create a new view with the name ${e.name} and description '${e.description}' and InstrumentSelector ${n}
- OR - create a new view with the name ${t.name} and description '${e.description}' and InstrumentSelector ${n}`}function lu(e,t){return e.valueType!==t.valueType?dT(e,t):e.unit!==t.unit?ET(e,t):e.type!==t.type?mT(e,t):e.description!==t.description?hT(e,t):""}var ss=class e{_sharedRegistry=new Map;_perCollectorRegistry=new Map;static create(){return new e}getStorages(t){let r=[];for(let o of this._sharedRegistry.values())r=r.concat(o);let n=this._perCollectorRegistry.get(t);if(n!=null)for(let o of n.values())r=r.concat(o);return r}register(t){this._registerStorage(t,this._sharedRegistry)}registerForCollector(t,r){let n=this._perCollectorRegistry.get(t);n==null&&(n=new Map,this._perCollectorRegistry.set(t,n)),this._registerStorage(r,n)}findOrUpdateCompatibleStorage(t){let r=this._sharedRegistry.get(t.name);return r===void 0?null:this._findOrUpdateCompatibleStorage(t,r)}findOrUpdateCompatibleCollectorStorage(t,r){let n=this._perCollectorRegistry.get(t);if(n===void 0)return null;let o=n.get(r.name);return o===void 0?null:this._findOrUpdateCompatibleStorage(r,o)}_registerStorage(t,r){let n=t.getInstrumentDescriptor(),o=r.get(n.name);if(o===void 0){r.set(n.name,[t]);return}o.push(t)}_findOrUpdateCompatibleStorage(t,r){let n=null;for(let o of r){let i=o.getInstrumentDescriptor();lT(i,t)?(i.description!==t.description&&(t.description.length>i.description.length&&o.updateDescription(t.description),E.warn("A view or instrument with the name ",t.name,` has already been registered, but has a different description and is incompatible with another registered view.
`,`Details:
`,uu(i,t),`The longer description will be used.
To resolve the conflict:`,lu(i,t))),n=o):E.warn("A view or instrument with the name ",t.name,` has already been registered and is incompatible with another registered view.
`,`Details:
`,uu(i,t),`To resolve the conflict:
`,lu(i,t))}return n}},as=class{_backingStorages;constructor(t){this._backingStorages=t}record(t,r,n,o){this._backingStorages.forEach(i=>{i.record(t,r,n,o)})}},cs=class{_instrumentName;_valueType;_buffer=new Jt;constructor(t,r){this._instrumentName=t,this._valueType=r}observe(t,r={}){if(typeof t!="number"){E.warn(`non-number value provided to metric ${this._instrumentName}: ${t}`);return}this._valueType===xt.INT&&!Number.isInteger(t)&&(E.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||this._buffer.set(r,t)}},us=class{_buffer=new Map;observe(t,r,n={}){if(!rs(t))return;let o=this._buffer.get(t);if(o==null&&(o=new Jt,this._buffer.set(t,o)),typeof r!="number"){E.warn(`non-number value provided to metric ${t._descriptor.name}: ${r}`);return}t._descriptor.valueType===xt.INT&&!Number.isInteger(r)&&(E.warn(`INT value type cannot accept a floating-point value for ${t._descriptor.name}, ignoring the fractional digits.`),r=Math.trunc(r),!Number.isInteger(r))||o.set(n,r)}},ls=class{_callbacks=[];_batchCallbacks=[];addCallback(t,r){this._findCallback(t,r)>=0||this._callbacks.push({callback:t,instrument:r})}removeCallback(t,r){let n=this._findCallback(t,r);n<0||this._callbacks.splice(n,1)}addBatchCallback(t,r){let n=new Set(r.filter(rs));if(n.size===0){E.error("BatchObservableCallback is not associated with valid instruments",r);return}this._findBatchCallback(t,n)>=0||this._batchCallbacks.push({callback:t,instruments:n})}removeBatchCallback(t,r){let n=new Set(r.filter(rs)),o=this._findBatchCallback(t,n);o<0||this._batchCallbacks.splice(o,1)}async observe(t,r){let n=this._observeCallbacks(t,r),o=this._observeBatchCallbacks(t,r);return(await Wp([...n,...o])).filter(Xp).map(a=>a.reason)}_observeCallbacks(t,r){return this._callbacks.map(async({callback:n,instrument:o})=>{let i=new cs(o._descriptor.name,o._descriptor.valueType),s=Promise.resolve(n(i));r!=null&&(s=jr(s,r)),await s,o._metricStorages.forEach(a=>{a.record(i._buffer,t)})})}_observeBatchCallbacks(t,r){return this._batchCallbacks.map(async({callback:n,instruments:o})=>{let i=new us,s=Promise.resolve(n(i));r!=null&&(s=jr(s,r)),await s,o.forEach(a=>{let u=i._buffer.get(a);u!=null&&a._metricStorages.forEach(l=>{l.record(u,t)})})})}_findCallback(t,r){return this._callbacks.findIndex(n=>n.callback===t&&n.instrument===r)}_findBatchCallback(t,r){return this._batchCallbacks.findIndex(n=>n.callback===t&&qp(n.instruments,r))}},_s=class extends ho{_attributesProcessor;_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;constructor(t,r,n,o,i){super(t),this._attributesProcessor=n,this._aggregationCardinalityLimit=i,this._deltaMetricStorage=new fo(r,this._aggregationCardinalityLimit),this._temporalMetricStorage=new So(r,o)}record(t,r,n,o){r=this._attributesProcessor.process(r,n),this._deltaMetricStorage.record(t,r,n,o)}collect(t,r){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(t,this._instrumentDescriptor,n,r)}},ps=class{process(t,r){return t}},Ts=class{_processors;constructor(t){this._processors=t}process(t,r){let n=t;for(let o of this._processors)n=o.process(n,r);return n}};function Vu(){return ST}function fT(e){return new Ts(e)}var ST=new ps,ds=class{_meterProviderSharedState;_instrumentationScope;metricStorageRegistry=new ss;observableRegistry=new ls;meter;constructor(t,r){this._meterProviderSharedState=t,this._instrumentationScope=r,this.meter=new ns(this)}registerMetricStorage(t){let r=this._registerMetricStorage(t,_s);return r.length===1?r[0]:new as(r)}registerAsyncMetricStorage(t){return this._registerMetricStorage(t,is)}async collect(t,r,n){let o=await this.observableRegistry.observe(r,n?.timeoutMillis),i=this.metricStorageRegistry.getStorages(t);if(i.length===0)return null;let s=i.map(a=>a.collect(t,r)).filter(Kp);return s.length===0?{errors:o}:{scopeMetrics:{scope:this._instrumentationScope,metrics:s},errors:o}}_registerMetricStorage(t,r){let o=this._meterProviderSharedState.viewRegistry.findViews(t,this._instrumentationScope).map(i=>{let s=uT(i,t),a=this.metricStorageRegistry.findOrUpdateCompatibleStorage(s);if(a!=null)return a;let u=i.aggregation.createAggregator(s),l=new r(s,u,i.attributesProcessor,this._meterProviderSharedState.metricCollectors,i.aggregationCardinalityLimit);return this.metricStorageRegistry.register(l),l});if(o.length===0){let s=this._meterProviderSharedState.selectAggregations(t.type).map(([a,u])=>{let l=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(a,t);if(l!=null)return l;let c=u.createAggregator(t),T=a.selectCardinalityLimit(t.type),p=new r(t,c,Vu(),[a],T);return this.metricStorageRegistry.registerForCollector(a,p),p});o=o.concat(s)}return o}},Es=class{resource;viewRegistry=new Wi;metricCollectors=[];meterSharedStates=new Map;constructor(t){this.resource=t}getMeterSharedState(t){let r=zp(t),n=this.meterSharedStates.get(r);return n==null&&(n=new ds(this,t),this.meterSharedStates.set(r,n)),n}selectAggregations(t){let r=[];for(let n of this.metricCollectors)r.push([n,Uu(n.selectAggregation(t))]);return r}},ms=class{_sharedState;_metricReader;constructor(t,r){this._sharedState=t,this._metricReader=r}async collect(t){let r=ut(Date.now()),n=[],o=[],i=Array.from(this._sharedState.meterSharedStates.values()).map(async s=>{let a=await s.collect(this,r,t);a?.scopeMetrics!=null&&n.push(a.scopeMetrics),a?.errors!=null&&o.push(...a.errors)});return await Promise.all(i),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:n},errors:o}}async forceFlush(t){await this._metricReader.forceFlush(t)}async shutdown(t){await this._metricReader.shutdown(t)}selectAggregationTemporality(t){return this._metricReader.selectAggregationTemporality(t)}selectAggregation(t){return this._metricReader.selectAggregation(t)}selectCardinalityLimit(t){return this._metricReader.selectCardinalityLimit?.(t)??2e3}},AT=/[\^$\\.+?()[\]{}|]/g,Ao=class e{_matchAll;_regexp;constructor(t){t==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(e.escapePattern(t)))}match(t){return this._matchAll?!0:this._regexp.test(t)}static escapePattern(t){return`^${t.replace(AT,"\\$&").replace("*",".*")}$`}static hasWildcard(t){return t.includes("*")}},Xe=class{_matchAll;_pattern;constructor(t){this._matchAll=t===void 0,this._pattern=t}match(t){return!!(this._matchAll||t===this._pattern)}},hs=class{_nameFilter;_type;_unitFilter;constructor(t){this._nameFilter=new Ao(t?.name??"*"),this._type=t?.type,this._unitFilter=new Xe(t?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}},fs=class{_nameFilter;_versionFilter;_schemaUrlFilter;constructor(t){this._nameFilter=new Xe(t?.name),this._versionFilter=new Xe(t?.version),this._schemaUrlFilter=new Xe(t?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};function gT(e){return e.instrumentName==null&&e.instrumentType==null&&e.instrumentUnit==null&&e.meterName==null&&e.meterVersion==null&&e.meterSchemaUrl==null}function RT(e){if(gT(e))throw new Error("Cannot create view with no selector arguments supplied");if(e.name!=null&&(e?.instrumentName==null||Ao.hasWildcard(e.instrumentName)))throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.")}var Ss=class{name;description;aggregation;attributesProcessor;instrumentSelector;meterSelector;aggregationCardinalityLimit;constructor(t){RT(t),t.attributesProcessors!=null?this.attributesProcessor=fT(t.attributesProcessors):this.attributesProcessor=Vu(),this.name=t.name,this.description=t.description,this.aggregation=Uu(t.aggregation??{type:Gt.DEFAULT}),this.instrumentSelector=new hs({name:t.instrumentName,type:t.instrumentType,unit:t.instrumentUnit}),this.meterSelector=new fs({name:t.meterName,version:t.meterVersion,schemaUrl:t.meterSchemaUrl}),this.aggregationCardinalityLimit=t.aggregationCardinalityLimit}},As=class{_sharedState;_shutdown=!1;constructor(t){if(this._sharedState=new Es(t?.resource??Se()),t?.views!=null&&t.views.length>0)for(let r of t.views)this._sharedState.viewRegistry.addView(new Ss(r));if(t?.readers!=null&&t.readers.length>0)for(let r of t.readers){let n=new ms(this._sharedState,r);r.setMetricProducer(n),this._sharedState.metricCollectors.push(n)}}getMeter(t,r="",n={}){return this._shutdown?(E.warn("A shutdown MeterProvider cannot provide a Meter"),Yo()):this._sharedState.getMeterSharedState({name:t,version:r,schemaUrl:n.schemaUrl}).meter}async shutdown(t){if(this._shutdown){E.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(r=>r.shutdown(t)))}async forceFlush(t){if(this._shutdown){E.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(r=>r.forceFlush(t)))}},go=class{emit(t){}},Gu=new go,gs=class{getLogger(t,r,n){return new go}},Hu=new gs,Rs=class{constructor(t,r,n,o){this._provider=t,this.name=r,this.version=n,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider.getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Gu}},Ro=class{getLogger(t,r,n){var o;return(o=this.getDelegateLogger(t,r,n))!==null&&o!==void 0?o:new Rs(this,t,r,n)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Hu}setDelegate(t){this._delegate=t}getDelegateLogger(t,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,r,n)}},NT=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},co=Symbol.for("io.opentelemetry.js.api.logs"),Fr=NT;function OT(e,t,r){return n=>n===e?t:r}var _u=1,Ns=class e{constructor(){this._proxyLoggerProvider=new Ro}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Fr[co]?this.getLoggerProvider():(Fr[co]=OT(_u,t,Hu),this._proxyLoggerProvider.setDelegate(t),t)}getLoggerProvider(){var t,r;return(r=(t=Fr[co])===null||t===void 0?void 0:t.call(Fr,_u))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(t,r,n){return this.getLoggerProvider().getLogger(t,r,n)}disable(){delete Fr[co],this._proxyLoggerProvider=new Ro}},bT=Ns.getInstance(),Os=class{hrTime;hrTimeObserved;spanContext;resource;instrumentationScope;attributes={};_severityText;_severityNumber;_body;totalAttributesCount=0;_isReadonly=!1;_logRecordLimits;set severityText(t){this._isLogRecordReadonly()||(this._severityText=t)}get severityText(){return this._severityText}set severityNumber(t){this._isLogRecordReadonly()||(this._severityNumber=t)}get severityNumber(){return this._severityNumber}set body(t){this._isLogRecordReadonly()||(this._body=t)}get body(){return this._body}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(t,r,n){let{timestamp:o,observedTimestamp:i,severityNumber:s,severityText:a,body:u,attributes:l={},context:c}=n,T=Date.now();if(this.hrTime=Bt(o??T),this.hrTimeObserved=Bt(i??T),c){let p=L.getSpanContext(c);p&&Ct(p)&&(this.spanContext=p)}this.severityNumber=s,this.severityText=a,this.body=u,this.resource=t.resource,this.instrumentationScope=r,this._logRecordLimits=t.logRecordLimits,this.setAttributes(l)}setAttribute(t,r){return this._isLogRecordReadonly()?this:r===null?this:t.length===0?(E.warn(`Invalid attribute key: ${t}`),this):!Ee(r)&&!(typeof r=="object"&&!Array.isArray(r)&&Object.keys(r).length>0)?(E.warn(`Invalid attribute value set for key: ${t}`),this):(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,t)?(this.droppedAttributesCount===1&&E.warn("Dropping extra attributes."),this):(Ee(r)?this.attributes[t]=this._truncateToSize(r):this.attributes[t]=r,this))}setAttributes(t){for(let[r,n]of Object.entries(t))this.setAttribute(r,n);return this}setBody(t){return this.body=t,this}setSeverityNumber(t){return this.severityNumber=t,this}setSeverityText(t){return this.severityText=t,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(t){let r=this._logRecordLimits.attributeValueLengthLimit;return r<=0?(E.warn(`Attribute value limit must be positive, got ${r}`),t):typeof t=="string"?this._truncateToLimitUtil(t,r):Array.isArray(t)?t.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,r):n):t}_truncateToLimitUtil(t,r){return t.length<=r?t:t.substring(0,r)}_isLogRecordReadonly(){return this._isReadonly&&E.warn("Can not execute the operation on emitted log record"),this._isReadonly}},bs=class{instrumentationScope;_sharedState;constructor(t,r){this.instrumentationScope=t,this._sharedState=r}emit(t){let r=t.context||x.active(),n=new Os(this._sharedState,this.instrumentationScope,{context:r,...t});this._sharedState.activeProcessor.onEmit(n,r),n._makeReadonly()}};function PT(){return{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:void 0??1/0,attributeCountLimit:void 0??128},includeTraceContext:!0}}function MT(e){return{attributeCountLimit:e.attributeCountLimit??void 0??void 0??128,attributeValueLengthLimit:e.attributeValueLengthLimit??void 0??void 0??1/0}}var Ps=class{forceFlush(){return Promise.resolve()}onEmit(t,r){}shutdown(){return Promise.resolve()}},No=class{processors;forceFlushTimeoutMillis;constructor(t,r){this.processors=t,this.forceFlushTimeoutMillis=r}async forceFlush(){let t=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(r=>ui(r.forceFlush(),t)))}onEmit(t,r){this.processors.forEach(n=>n.onEmit(t,r))}async shutdown(){await Promise.all(this.processors.map(t=>t.shutdown()))}},Ms=class{resource;forceFlushTimeoutMillis;logRecordLimits;processors;loggers=new Map;activeProcessor;registeredLogRecordProcessors=[];constructor(t,r,n,o){this.resource=t,this.forceFlushTimeoutMillis=r,this.logRecordLimits=n,this.processors=o,o.length>0?(this.registeredLogRecordProcessors=o,this.activeProcessor=new No(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new Ps}},xT="unknown",xs=class{_shutdownOnce;_sharedState;constructor(t={}){let r=xr({},PT(),t),n=t.resource??Se();this._sharedState=new Ms(n,r.forceFlushTimeoutMillis,MT(r.logRecordLimits),t?.processors??[]),this._shutdownOnce=new ne(this._shutdown,this)}getLogger(t,r,n){if(this._shutdownOnce.isCalled)return E.warn("A shutdown LoggerProvider cannot provide a Logger"),Gu;t||E.warn("Logger requested without instrumentation scope name.");let o=t||xT,i=`${o}@${r||""}:${n?.schemaUrl||""}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new bs({name:o,version:r,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}addLogRecordProcessor(t){this._sharedState.registeredLogRecordProcessors.length===0&&this._sharedState.activeProcessor.shutdown().catch(r=>E.error("Error while trying to shutdown current log record processor",r)),this._sharedState.registeredLogRecordProcessors.push(t),this._sharedState.activeProcessor=new No(this._sharedState.registeredLogRecordProcessors,this._sharedState.forceFlushTimeoutMillis)}forceFlush(){return this._shutdownOnce.isCalled?(E.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(E.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}},Cs=class{export(t,r){this._sendLogRecords(t,r)}shutdown(){return Promise.resolve()}_exportInfo(t){return{resource:{attributes:t.resource.attributes},instrumentationScope:t.instrumentationScope,timestamp:me(t.hrTime),traceId:t.spanContext?.traceId,spanId:t.spanContext?.spanId,traceFlags:t.spanContext?.traceFlags,severityText:t.severityText,severityNumber:t.severityNumber,body:t.body,attributes:t.attributes}}_sendLogRecords(t,r){for(let n of t)console.dir(this._exportInfo(n),{depth:3});r?.({code:Z.SUCCESS})}},vs=class{_exporter;_shutdownOnce;_unresolvedExports;constructor(t){this._exporter=t,this._shutdownOnce=new ne(this._shutdown,this),this._unresolvedExports=new Set}onEmit(t){if(this._shutdownOnce.isCalled)return;let r=()=>li._export(this._exporter,[t]).then(n=>{n.code!==Z.SUCCESS&&st(n.error??new Error(`SimpleLogRecordProcessor: log record export failed (status ${n})`))}).catch(st);if(t.resource.asyncAttributesPending){let n=t.resource.waitForAsyncAttributes?.().then(()=>(this._unresolvedExports.delete(n),r()),st);n!=null&&this._unresolvedExports.add(n)}else r()}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports))}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}},Ls=class{constructor(t={}){var r,n,o;if(this._resource=Se().merge((r=t.resource)!==null&&r!==void 0?r:ft({})),this._resourceDetectors=(n=t.resourceDetectors)!==null&&n!==void 0?n:[mi],this._serviceName=t.serviceName,this._serviceVersion=t.serviceVersion,this._autoDetectResources=(o=t.autoDetectResources)!==null&&o!==void 0?o:!0,t.spanProcessor||t.traceExporter||t.spanProcessors){let s={};t.sampler&&(s.sampler=t.sampler),t.spanLimits&&(s.spanLimits=t.spanLimits),t.idGenerator&&(s.idGenerator=t.idGenerator);let a=t.spanProcessors||[];t.traceExporter&&a.push(new Be(t.traceExporter)),this._tracerProviderConfig={tracerConfig:s,spanProcessor:t.spanProcessor,spanProcessors:a,contextManager:t.contextManager,textMapPropagator:t.textMapPropagator}}t.metricExporters&&(this._meterProviderConfig={metricExporters:t.metricExporters}),t.logExporters&&(this._loggerProviderConfig={logExporters:t.logExporters});let i=[];t.instrumentations&&(i=t.instrumentations),this._instrumentations=i}start(){var t,r,n,o,i;if(this._disabled)return;if(ri({instrumentations:this._instrumentations}),this._autoDetectResources){let u={detectors:this._resourceDetectors};this._resource=this._resource.merge(pi(u))}this._resource=this._serviceName===void 0?this._resource:this._resource.merge(ft({[Ln]:this._serviceName})),this._serviceVersion!==void 0&&(this._resource=this._resource.merge(ft({[Ka]:this._serviceVersion})));let s=[];!((t=this._tracerProviderConfig)===null||t===void 0)&&t.spanProcessor&&s.push(this._tracerProviderConfig.spanProcessor),!((r=this._tracerProviderConfig)===null||r===void 0)&&r.spanProcessors&&s.push(...this._tracerProviderConfig.spanProcessors);let a=new Lr(Object.assign(Object.assign({},(n=this._tracerProviderConfig)===null||n===void 0?void 0:n.tracerConfig),{resource:this._resource,spanProcessors:s}));if(this._tracerProvider=a,a.register({contextManager:(o=this._tracerProviderConfig)===null||o===void 0?void 0:o.contextManager,propagator:(i=this._tracerProviderConfig)===null||i===void 0?void 0:i.textMapPropagator}),this._meterProviderConfig){let u=this._meterProviderConfig.metricExporters.map(l=>new Ki({exporter:l}));this._meterProvider=new As({resource:this._resource,readers:u}),re.setGlobalMeterProvider(this._meterProvider)}if(this._loggerProviderConfig){let u=this._loggerProviderConfig.logExporters.map(l=>new vs(l));this._loggerProvider=new xs({resource:this._resource,processors:u}),bT.setGlobalLoggerProvider(this._loggerProvider)}}getResourceAttributes(){return this._resource.attributes}forceFlush(){let t=[];return this._tracerProvider&&t.push(this._tracerProvider.forceFlush()),this._meterProvider&&t.push(this._meterProvider.forceFlush()),this._loggerProvider&&t.push(this._loggerProvider.forceFlush()),Promise.all(t).then(()=>{})}shutdown(){let t=[];return this._tracerProvider&&t.push(this._tracerProvider.shutdown()),this._meterProvider&&t.push(this._meterProvider.shutdown()),this._loggerProvider&&t.push(this._loggerProvider.shutdown()),Promise.all(t).then(()=>{})}},$s="https://api.honeycomb.io",ku="v1/traces",Is=`${$s}/${ku}`,Fu="v1/metrics",CT=`${$s}/${Fu}`,Yu="v1/logs",vT=`${$s}/${Yu}`,LT="unknown_service",IT=1,Oo={apiKey:"",tracesApiKey:"",endpoint:Is,tracesEndpoint:Is,serviceName:LT,debug:!1,sampleRate:1,skipOptionsValidation:!1,localVisualizations:!1,webVitalsInstrumentationConfig:{enabled:!0}},at=e=>`@honeycombio/opentelemetry-web: ${e}`,wT=/^[a-f0-9]*$/,yT=/^hc[a-z]ic_[a-z0-9]*$/;function bo(e){return e==null||e.length===0?!1:e.length===32?wT.test(e):e.length===64?yT.test(e):!1}function js(e,t){return e.endsWith(t)||e.endsWith(`${t}/`)?e:e.endsWith("/")?e+t:e+"/"+t}var wo=e=>e?.tracesEndpoint?e.tracesEndpoint:e?.endpoint?js(e.endpoint,ku):Is,DT=e=>e?.metricsEndpoint?e.metricsEndpoint:e?.endpoint?js(e.endpoint,Fu):CT,UT=e=>e?.logsEndpoint?e.logsEndpoint:e?.endpoint?js(e.endpoint,Yu):vT,Ks=e=>e?.tracesApiKey||e?.apiKey,BT=e=>e?.metricsApiKey||e?.apiKey,VT=e=>e?.logsApiKey||e?.apiKey,$u=e=>typeof e?.sampleRate=="number"&&Number.isSafeInteger(e?.sampleRate)&&e?.sampleRate>=0?e?.sampleRate:IT,ju=at("\u274C Missing API Key. Set `apiKey` in HoneycombOptions. Telemetry will not be exported."),Ku=at(`\u274C Missing Service Name. Set \`serviceName\` in HoneycombOptions. Defaulting to '${Oo.serviceName}'`),GT=at("\u{1F515} Dataset is ignored in favor of service name."),HT=at("\u274C Missing dataset. Specify either HONEYCOMB_DATASET environment variable or dataset in the options parameter."),kT=at("\u23ED\uFE0F Skipping options validation. To re-enable, set skipOptionsValidation option or HONEYCOMB_SKIP_OPTIONS_VALIDATION to false."),FT=at("\u23ED\uFE0F Skipping options validation, because a custom collector is being used."),YT=at("\u{1F528} Default deterministic sampler has been overridden. Honeycomb requires a resource attribute called SampleRate to properly show weighted values. Non-deterministic sampleRate could lead to missing spans in Honeycomb. See our docs for more details. https://docs.honeycomb.io/getting-data-in/opentelemetry/node-distro/#sampling-without-the-honeycomb-sdk"),$T=at("\u{1F515} Disabling local visualizations - must have both service name and API key configured."),jT=at("\u{1F515} Disabling local visualizations - cannot infer auth and ui url roots from endpoint url."),KT=at("\u{1F515} Failed to get proper auth response from Honeycomb. No local visualization available."),zT=at("\u{1F515} Default honeycomb exporter disabled but no exporters provided"),WT=e=>{try{return!new URL(e).hostname.endsWith(".honeycomb.io")}catch{return!1}},XT=e=>{var t,r;let n=e?.logLevel?e.logLevel:F.DEBUG;if(e?.skipOptionsValidation){n>=F.DEBUG&&console.debug(kT);return}let o=(t=e?.tracesEndpoint)!==null&&t!==void 0?t:e?.endpoint;if(o&&WT(o)){n>=F.DEBUG&&console.debug(FT);return}return!e?.apiKey&&n>=F.WARN&&console.warn(ju),!e?.serviceName&&n>=F.WARN&&console.warn(Ku),e?.apiKey&&!bo(e?.apiKey)&&e?.dataset&&n>=F.WARN&&console.warn(GT),e?.apiKey&&bo(e?.apiKey)&&!e?.dataset&&n>=F.WARN&&console.warn(HT),e?.sampler&&n>=F.DEBUG&&console.debug(YT),e?.disableDefaultTraceExporter===!0&&!e?.traceExporter&&!(!((r=e?.traceExporters)===null||r===void 0)&&r.length)&&console.warn(zT),e};function qT(e){if(!e?.debug)return;E.setLogger(new Ho,F.DEBUG),E.debug(at("\u{1F41D} Honeycomb Web SDK Debug Mode Enabled \u{1F41D}"));let t=wo(e),r=Object.assign(Object.assign(Object.assign({},Oo),e),{tracesEndpoint:t});QT(r),JT(r),ZT(r),td(r)}function QT(e){let t=Ks(e)||"";if(!t){E.debug(ju);return}E.debug(at(`API Key configured for traces: '${t}'`))}function JT(e){let t=e.serviceName||Oo.serviceName;if(t===Oo.serviceName){E.debug(Ku);return}E.debug(`@honeycombio/opentelemetry-web: Service Name configured for traces: '${t}'`)}function ZT(e){let t=wo(e);if(!t){E.debug(at("No endpoint configured for traces"));return}E.debug(at(`Endpoint configured for traces: '${t}'`))}function td(e){let t=$u(e);if(!t){E.debug("No sampler configured for traces");return}E.debug(at(`Sample Rate configured for traces: '${t}'`))}var ed=e=>{if(e?.sampler)return e.sampler;let t=$u(e);return new ws(t)},ws=class{constructor(t){switch(this._sampleRate=t,t){case 0:this._sampler=new vt;break;case 1:this._sampler=new St;break;default:{let r=1/t;this._sampler=new oe(r);break}}}shouldSample(t,r,n,o,i,s){let a=this._sampler.shouldSample(t,r,n,o,i,s);return Object.assign(Object.assign({},a),{attributes:Object.assign(Object.assign({},a.attributes),{SampleRate:this._sampleRate})})}toString(){return`DeterministicSampler(${this._sampler.toString()})`}},Po=class{t;o=0;i=[];u(t){if(t.hadRecentInput)return;let r=this.i[0],n=this.i.at(-1);this.o&&r&&n&&t.startTime-n.startTime<1e3&&t.startTime-r.startTime<5e3?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),this.t?.(t)}},er=()=>{let e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart{if(document.readyState==="loading")return"loading";{let t=er();if(t){if(e{let t=e.nodeName;return e.nodeType===1?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},zs=e=>{let t="";try{for(;e?.nodeType!==9;){let r=e,n=r.id?"#"+r.id:[rd(r),...Array.from(r.classList).sort()].join(".");if(t.length+n.length>99)return t||n;if(t=t?n+">"+t:n,r.id)break;e=r.parentNode}}catch{}return t},xi=new WeakMap;function Ze(e,t){return xi.get(e)||xi.set(e,new t),xi.get(e)}var zu=-1,Wu=()=>zu,rr=e=>{addEventListener("pageshow",t=>{t.persisted&&(zu=t.timeStamp,e(t))},!0)},Ht=(e,t,r,n)=>{let o,i;return s=>{t.value>=0&&(s||n)&&(i=t.value-(o??0),(i||o===void 0)&&(o=t.value,t.delta=i,t.rating=((a,u)=>a>u[1]?"poor":a>u[0]?"needs-improvement":"good")(t.value,r),e(t)))}},Ws=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},Kr=()=>er()?.activationStart??0,kt=(e,t=-1)=>{let r=er(),n="navigate";return Wu()>=0?n="back-forward-cache":r&&(document.prerendering||Kr()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},tr=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let n=new PerformanceObserver(o=>{Promise.resolve().then(()=>{t(o.getEntries())})});return n.observe({type:e,buffered:!0,...r}),n}}catch{}},Xs=e=>{let t=!1;return()=>{t||(e(),t=!0)}},We=-1,pu=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,xo=e=>{document.visibilityState==="hidden"&&We>-1&&(We=e.type==="visibilitychange"?e.timeStamp:0,nd())},Tu=()=>{addEventListener("visibilitychange",xo,!0),addEventListener("prerenderingchange",xo,!0)},nd=()=>{removeEventListener("visibilitychange",xo,!0),removeEventListener("prerenderingchange",xo,!0)},Xu=()=>{if(We<0){let e=Kr();We=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>e)[0]?.startTime)??pu(),Tu(),rr(()=>{setTimeout(()=>{We=pu(),Tu()})})}return{get firstHiddenTime(){return We}}},yo=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},du=[1800,3e3],qu=(e,t={})=>{yo(()=>{let r=Xu(),n,o=kt("FCP"),i=tr("paint",s=>{for(let a of s)a.name==="first-contentful-paint"&&(i.disconnect(),a.startTime{o=kt("FCP"),n=Ht(e,o,du,t.reportAllChanges),Ws(()=>{o.value=performance.now()-s.timeStamp,n(!0)})}))})},Eu=[.1,.25],mu=e=>e.find(t=>t.node?.nodeType===1)||e[0],od=(e,t={})=>{let r=Ze(t=Object.assign({},t),Po),n=new WeakMap;r.t=o=>{if(o?.sources?.length){let i=mu(o.sources);if(i){let s=(t.generateTarget??zs)(i.node);n.set(i,s)}}},((o,i={})=>{qu(Xs(()=>{let s,a=kt("CLS",0),u=Ze(i,Po),l=T=>{for(let p of T)u.u(p);u.o>a.value&&(a.value=u.o,a.entries=u.i,s())},c=tr("layout-shift",l);c&&(s=Ht(o,a,Eu,i.reportAllChanges),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&(l(c.takeRecords()),s(!0))}),rr(()=>{u.o=0,a=kt("CLS",0),s=Ht(o,a,Eu,i.reportAllChanges),Ws(()=>s())}),setTimeout(s))}))})(o=>{let i=(s=>{let a={};if(s.entries.length){let u=s.entries.reduce((l,c)=>l.value>c.value?l:c);if(u?.sources?.length){let l=mu(u.sources);l&&(a={largestShiftTarget:n.get(l),largestShiftTime:u.startTime,largestShiftValue:u.value,largestShiftSource:l,largestShiftEntry:u,loadState:Mo(u.startTime)})}}return Object.assign(s,{attribution:a})})(o);e(i)},t)},id=(e,t={})=>{qu(r=>{let n=(o=>{let i={timeToFirstByte:0,firstByteToFCP:o.value,loadState:Mo(Wu())};if(o.entries.length){let s=er(),a=o.entries.at(-1);if(s){let u=s.activationStart||0,l=Math.max(0,s.responseStart-u);i={timeToFirstByte:l,firstByteToFCP:o.value-l,loadState:Mo(o.entries[0].startTime),navigationEntry:s,fcpEntry:a}}}return Object.assign(o,{attribution:i})})(r);e(n)},t)},Qu=0,Ci=1/0,uo=0,sd=e=>{for(let t of e)t.interactionId&&(Ci=Math.min(Ci,t.interactionId),uo=Math.max(uo,t.interactionId),Qu=uo?(uo-Ci)/7+1:0)},ys,hu=()=>ys?Qu:performance.interactionCount??0,ad=()=>{"interactionCount"in performance||ys||(ys=tr("event",sd,{type:"event",buffered:!0,durationThreshold:0}))},fu=0,Co=class{l=[];h=new Map;m;p;v(){fu=hu(),this.l.length=0,this.h.clear()}M(){let t=Math.min(this.l.length-1,Math.floor((hu()-fu)/50));return this.l[t]}u(t){if(this.m?.(t),!t.interactionId&&t.entryType!=="first-input")return;let r=this.l.at(-1),n=this.h.get(t.interactionId);if(n||this.l.length<10||t.duration>r.T){if(n?t.duration>n.T?(n.entries=[t],n.T=t.duration):t.duration===n.T&&t.startTime===n.entries[0].startTime&&n.entries.push(t):(n={id:t.interactionId,entries:[t],T:t.duration},this.h.set(n.id,n),this.l.push(n)),this.l.sort((o,i)=>i.T-o.T),this.l.length>10){let o=this.l.splice(10);for(let i of o)this.h.delete(i.id)}this.p?.(n)}}},Ds=e=>{let t=globalThis.requestIdleCallback||setTimeout;document.visibilityState==="hidden"?e():(e=Xs(e),document.addEventListener("visibilitychange",e,{once:!0}),t(()=>{e(),document.removeEventListener("visibilitychange",e)}))},Su=[200,500],cd=(e,t={})=>{let r=Ze(t=Object.assign({},t),Co),n=[],o=[],i=0,s=new WeakMap,a=new WeakMap,u=!1,l=()=>{u||(Ds(c),u=!0)},c=()=>{let _=r.l.map(f=>s.get(f.entries[0])),d=o.length-50;o=o.filter((f,S)=>S>=d||_.includes(f));let h=new Set;for(let f of o){let S=T(f.startTime,f.processingEnd);for(let M of S)h.add(M)}let R=n.length-1-50;n=n.filter((f,S)=>f.startTime>i&&S>R||h.has(f)),u=!1};r.m=_=>{let d=_.startTime+_.duration,h;i=Math.max(i,_.processingEnd);for(let R=o.length-1;R>=0;R--){let f=o[R];if(Math.abs(d-f.renderTime)<=8){h=f,h.startTime=Math.min(_.startTime,h.startTime),h.processingStart=Math.min(_.processingStart,h.processingStart),h.processingEnd=Math.max(_.processingEnd,h.processingEnd),h.entries.push(_);break}}h||(h={startTime:_.startTime,processingStart:_.processingStart,processingEnd:_.processingEnd,renderTime:d,entries:[_]},o.push(h)),(_.interactionId||_.entryType==="first-input")&&s.set(_,h),l()},r.p=_=>{if(!a.get(_)){let d=(t.generateTarget??zs)(_.entries[0].target);a.set(_,d)}};let T=(_,d)=>{let h=[];for(let R of n)if(!(R.startTime+R.duration<_)){if(R.startTime>d)break;h.push(R)}return h},p=_=>{let d=_.entries[0],h=s.get(d),R=d.processingStart,f=Math.max(d.startTime+d.duration,R),S=Math.min(h.processingEnd,f),M=h.entries.sort((H,V)=>H.processingStart-V.processingStart),j=T(d.startTime,S),Y=r.h.get(d.interactionId),q={interactionTarget:a.get(Y),interactionType:d.name.startsWith("key")?"keyboard":"pointer",interactionTime:d.startTime,nextPaintTime:f,processedEventEntries:M,longAnimationFrameEntries:j,inputDelay:R-d.startTime,processingDuration:S-R,presentationDelay:f-S,loadState:Mo(d.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(H=>{if(!H.longAnimationFrameEntries?.length)return;let V=H.interactionTime,nt=H.inputDelay,z=H.processingDuration,it,m,g=0,O=0,P=0,N=0;for(let C of H.longAnimationFrameEntries){O=O+C.startTime+C.duration-C.styleAndLayoutStart;for(let A of C.scripts){let y=A.startTime+A.duration;if(yN&&(m=A.startTime=V+nt+z?"presentation-delay":"processing-duration",it=A,N=b)}}let B=H.longAnimationFrameEntries.at(-1),I=B?B.startTime+B.duration:0;I>=V+nt+z&&(P=H.nextPaintTime-I),it&&m&&(H.longestScript={entry:it,subpart:m,intersectingDuration:N}),H.totalScriptDuration=g,H.totalStyleAndLayoutDuration=O,H.totalPaintDuration=P,H.totalUnattributedDuration=H.nextPaintTime-V-g-O-P})(q),Object.assign(_,{attribution:q})};tr("long-animation-frame",_=>{n=n.concat(_),l()}),((_,d={})=>{globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype&&yo(()=>{ad();let h,R=kt("INP"),f=Ze(d,Co),S=j=>{Ds(()=>{for(let q of j)f.u(q);let Y=f.M();Y&&Y.T!==R.value&&(R.value=Y.T,R.entries=Y.entries,h())})},M=tr("event",S,{durationThreshold:d.durationThreshold??40});h=Ht(_,R,Su,d.reportAllChanges),M&&(M.observe({type:"first-input",buffered:!0}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&(S(M.takeRecords()),h(!0))}),rr(()=>{f.v(),R=kt("INP"),h=Ht(_,R,Su,d.reportAllChanges)}))})})(_=>{let d=p(_);e(d)},t)},vo=class{m;u(t){this.m?.(t)}},Au=[2500,4e3],ud=(e,t={})=>{let r=Ze(t=Object.assign({},t),vo),n=new WeakMap;r.m=o=>{if(o.element){let i=(t.generateTarget??zs)(o.element);n.set(o,i)}},((o,i={})=>{yo(()=>{let s=Xu(),a,u=kt("LCP"),l=Ze(i,vo),c=p=>{i.reportAllChanges||(p=p.slice(-1));for(let _ of p)l.u(_),_.startTime{c(T.takeRecords()),T.disconnect(),a(!0)});for(let _ of["keydown","click","visibilitychange"])addEventListener(_,()=>Ds(p),{capture:!0,once:!0});rr(_=>{u=kt("LCP"),a=Ht(o,u,Au,i.reportAllChanges),Ws(()=>{u.value=performance.now()-_.timeStamp,a(!0)})})}})})(o=>{let i=(s=>{let a={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:s.value};if(s.entries.length){let u=er();if(u){let l=u.activationStart||0,c=s.entries.at(-1),T=c.url&&performance.getEntriesByType("resource").filter(h=>h.name===c.url)[0],p=Math.max(0,u.responseStart-l),_=Math.max(p,T?(T.requestStart||T.startTime)-l:0),d=Math.min(s.value,Math.max(_,T?T.responseEnd-l:0));a={target:n.get(c),timeToFirstByte:p,resourceLoadDelay:_-p,resourceLoadDuration:d-_,elementRenderDelay:s.value-d,navigationEntry:u,lcpEntry:c},c.url&&(a.url=c.url),T&&(a.lcpResourceEntry=T)}}return Object.assign(s,{attribution:a})})(o);e(i)},t)},gu=[800,1800],Us=e=>{document.prerendering?yo(()=>Us(e)):document.readyState!=="complete"?addEventListener("load",()=>Us(e),!0):setTimeout(e)},ld=(e,t={})=>{((r,n={})=>{let o=kt("TTFB"),i=Ht(r,o,gu,n.reportAllChanges);Us(()=>{let s=er();s&&(o.value=Math.max(s.responseStart-Kr(),0),o.entries=[s],i(!0),rr(()=>{o=kt("TTFB",0),i=Ht(r,o,gu,n.reportAllChanges),i(!0)}))})})(r=>{let n=(o=>{let i={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(o.entries.length){let s=o.entries[0],a=s.activationStart||0,u=Math.max((s.workerStart||s.fetchStart)-a,0),l=Math.max(s.domainLookupStart-a,0),c=Math.max(s.connectStart-a,0),T=Math.max(s.connectEnd-a,0);i={waitingDuration:u,cacheDuration:l-u,dnsDuration:c-l,connectionDuration:T-c,requestDuration:o.value-T,navigationEntry:s}}return Object.assign(o,{attribution:i})})(r);e(n)},t)},Lo=class{constructor(t,r,n={}){this.instrumentationName=t,this.instrumentationVersion=r,this._wrap=ue.wrap,this._unwrap=ue.unwrap,this._massWrap=ue.massWrap,this._massUnwrap=ue.massUnwrap,this._config=Object.assign({enabled:!0},n),this._diag=E.createComponentLogger({namespace:t}),this._tracer=L.getTracer(t,r),this._meter=re.getMeter(t,r),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t={}){this._config=Object.assign({},t)}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}},Bs=class extends Lo{constructor({enabled:t=!0,vitalsToTrack:r=["CLS","LCP","INP","TTFB","FCP"],lcp:n,cls:o,inp:i,fcp:s,ttfb:a}={}){let u={enabled:t,vitalsToTrack:r,lcp:n,cls:o,inp:i,fcp:s,ttfb:a};super("@honeycombio/instrumentation-web-vitals",Ge,u),this.onReportCLS=(l,c={})=>{let{applyCustomAttributes:T}=c;if(!this.isEnabled())return;let{name:p,attribution:_}=l,{largestShiftTarget:d,largestShiftTime:h,largestShiftValue:R,loadState:f,largestShiftEntry:S}=_,M=this.getAttrPrefix(p),j=this.tracer.startSpan(p);j.setAttributes(Object.assign(Object.assign({},this.getSharedAttributes(l)),{[`${M}.largest_shift_target`]:d,[`${M}.element`]:d,[`${M}.largest_shift_time`]:h,[`${M}.largest_shift_value`]:R,[`${M}.load_state`]:f,[`${M}.had_recent_input`]:S?.hadRecentInput})),T&&T(l,j),j.end()},this.onReportLCP=(l,c={})=>{let{applyCustomAttributes:T,dataAttributes:p}=c;if(!this.isEnabled())return;let{name:_,attribution:d}=l,{target:h,url:R,timeToFirstByte:f,resourceLoadDelay:S,resourceLoadDuration:M,elementRenderDelay:j,lcpEntry:Y}=d,q=this.getAttrPrefix(_),H=this.tracer.startSpan(_);H.setAttributes(Object.assign(Object.assign({},this.getSharedAttributes(l)),{[`${q}.element`]:h,[`${q}.url`]:R,[`${q}.time_to_first_byte`]:f,[`${q}.resource_load_delay`]:S,[`${q}.resource_load_duration`]:M,[`${q}.element_render_delay`]:j,[`${q}.resource_load_time`]:M}));let V=Y?.element;if(V?.dataset)for(let nt in V.dataset){let z=V.dataset[nt];z!==void 0&&(p===void 0||p.includes(nt))&&H.setAttribute(`${q}.element.data.${nt}`,z)}T&&T(l,H),H.end()},this.onReportINP=(l,c={includeTimingsAsSpans:!1})=>{let{applyCustomAttributes:T,includeTimingsAsSpans:p}=c;if(!this.isEnabled())return;let{name:_,attribution:d}=l,{inputDelay:h,interactionTarget:R,interactionTime:f,interactionType:S,loadState:M,nextPaintTime:j,presentationDelay:Y,processingDuration:q,longAnimationFrameEntries:H}=d,V=this.getAttrPrefix(_),nt=h+q+Y;this.tracer.startActiveSpan(_,{startTime:f},z=>{let it=Object.assign(Object.assign({},this.getSharedAttributes(l)),{[`${V}.input_delay`]:h,[`${V}.interaction_target`]:R,[`${V}.interaction_time`]:f,[`${V}.interaction_type`]:S,[`${V}.load_state`]:M,[`${V}.next_paint_time`]:j,[`${V}.presentation_delay`]:Y,[`${V}.processing_duration`]:q,[`${V}.duration`]:nt,[`${V}.element`]:R,[`${V}.event_type`]:S});z.setAttributes(it),T&&T(l,z),p&&H.forEach(m=>{this.processPerformanceLongAnimationFrameTimingSpans(V,m)}),z.end(f+nt)})},this.onReportFCP=(l,c={})=>{let{applyCustomAttributes:T}=c;if(!this.isEnabled())return;let{name:p,attribution:_}=l,{timeToFirstByte:d,firstByteToFCP:h,loadState:R}=_,f=this.getAttrPrefix(p),S=this.tracer.startSpan(p);S.setAttributes(Object.assign(Object.assign({},this.getSharedAttributes(l)),{[`${f}.time_to_first_byte`]:d,[`${f}.time_since_first_byte`]:h,[`${f}.load_state`]:R})),T&&T(l,S),S.end()},this.onReportTTFB=(l,c={})=>{let{applyCustomAttributes:T}=c;if(!this.isEnabled())return;let{name:p,attribution:_}=l,{cacheDuration:d,connectionDuration:h,dnsDuration:R,requestDuration:f,waitingDuration:S}=_,M=this.getAttrPrefix(p),j=Object.assign(Object.assign({},this.getSharedAttributes(l)),{[`${M}.waiting_duration`]:S,[`${M}.dns_duration`]:R,[`${M}.connection_duration`]:h,[`${M}.request_duration`]:f,[`${M}.cache_duration`]:d,[`${M}.waiting_time`]:S,[`${M}.dns_time`]:R,[`${M}.connection_time`]:h,[`${M}.request_time`]:f}),Y=this.tracer.startSpan(p);Y.setAttributes(j),T&&T(l,Y),Y.end()},this.vitalsToTrack=[...r],this.lcpOpts=n,this.clsOpts=o,this.inpOpts=i,this.fcpOpts=s,this.ttfbOpts=a,this._isEnabled=t,this._setupWebVitalsCallbacks()}init(){}_setupWebVitalsCallbacks(){this.vitalsToTrack.includes("CLS")&&od(t=>{this.onReportCLS(t,this.clsOpts)},this.clsOpts),this.vitalsToTrack.includes("LCP")&&ud(t=>{this.onReportLCP(t,this.lcpOpts)},this.lcpOpts),this.vitalsToTrack.includes("INP")&&cd(t=>{this.onReportINP(t,this.inpOpts)},this.inpOpts),this.vitalsToTrack.includes("TTFB")&&ld(t=>{this.onReportTTFB(t,this.ttfbOpts)},this.ttfbOpts),this.vitalsToTrack.includes("FCP")&&id(t=>{this.onReportFCP(t,this.fcpOpts)},this.fcpOpts)}getAttrPrefix(t){return t.toLowerCase()}getSharedAttributes(t){let{name:r,id:n,delta:o,rating:i,value:s,navigationType:a}=t,u=this.getAttrPrefix(r);return{[`${u}.id`]:n,[`${u}.delta`]:o,[`${u}.value`]:s,[`${u}.rating`]:i,[`${u}.navigation_type`]:a}}getAttributesForPerformanceLongAnimationFrameTiming(t,r){return{[`${t}.duration`]:r.duration,[`${t}.entryType`]:r.entryType,[`${t}.name`]:r.name,[`${t}.renderStart`]:r.renderStart,[`${t}.startTime`]:r.startTime}}getAttributesForPerformanceScriptTiming(t,r){return{[`${t}.entry_type`]:r.entryType,[`${t}.start_time`]:r.startTime,[`${t}.execution_start`]:r.executionStart,[`${t}.duration`]:r.duration,[`${t}.forced_style_and_layout_duration`]:r.forcedStyleAndLayoutDuration,[`${t}.invoker`]:r.invoker,[`${t}.pause_duration`]:r.pauseDuration,[`${t}.source_url`]:r.sourceURL,[`${t}.source_function_name`]:r.sourceFunctionName,[`${t}.source_char_position`]:r.sourceCharPosition,[`${t}.window_attribution`]:r.windowAttribution}}processPerformanceLongAnimationFrameTimingSpans(t,r){if(!r)return;let n=`${t}.timing`,o=this.getAttributesForPerformanceLongAnimationFrameTiming(n,r);this.tracer.startActiveSpan(r.name,{startTime:r.startTime},i=>{i.setAttributes(o),this.processPerformanceScriptTimingSpans(n,r.scripts),i.end(r.startTime+r.duration)})}processPerformanceScriptTimingSpans(t,r){if(!r||!r?.length)return;let n=`${t}.script`;r.map(o=>{this.tracer.startActiveSpan(o.name,{startTime:o.startTime},i=>{let s=this.getAttributesForPerformanceScriptTiming(n,o);i.setAttributes(s),i.end(o.startTime+o.duration)})})}disable(){if(!this.isEnabled()){this._diag.debug("Instrumentation already disabled");return}this._isEnabled=!1,this._diag.debug("Instrumentation disabled")}enable(){if(this.isEnabled()){this._diag.debug("Instrumentation already enabled");return}this._isEnabled=!0,this._diag.debug("Instrumentation enabled"),this._diag.debug(`Sending spans for ${this.vitalsToTrack.join(",")}`)}isEnabled(){return this._isEnabled}},Ju="@honeycombio/instrumentation-global-errors";function _d(e){if(!e)return{};let t=(0,bu.computeStackTrace)(e).stack,r=[],n=[],o=[],i=[];return Array.isArray(t)?(t.forEach(s=>{r.push(s.line),n.push(s.column),o.push(s.func),i.push(s.url)}),{"exception.structured_stacktrace.columns":n,"exception.structured_stacktrace.lines":r,"exception.structured_stacktrace.functions":o,"exception.structured_stacktrace.urls":i}):{}}function pd(e,t={},r=L.getTracer(Ju),n){let o=e.message,i=e.name,s=Object.assign(Object.assign({[zt]:i,[Ut]:o,[we]:e.stack},_d(e)),t),a=r.startSpan("exception",{attributes:s},x.active());n&&n(a,e),a.setStatus({code:gt.ERROR,message:o}),a.end()}var Vs=class extends Lo{constructor({enabled:t=!0,applyCustomAttributesOnSpan:r}={}){let n={enabled:t,applyCustomAttributesOnSpan:r};super(Ju,Ge,n),this.onError=o=>{let i="reason"in o?o.reason:o.error;console.log(this.applyCustomAttributesOnSpan),i&&pd(i,{},this.tracer,this.applyCustomAttributesOnSpan)},t&&this.enable(),this._isEnabled=t,this.applyCustomAttributesOnSpan=r}init(){}disable(){if(!this.isEnabled()){this._diag.debug("Instrumentation already disabled");return}this._isEnabled=!1,window.removeEventListener("error",this.onError),window.removeEventListener("unhandledrejection",this.onError),this._diag.debug("Instrumentation disabled")}enable(){if(this.isEnabled()){this._diag.debug("Instrumentation already enabled");return}this._isEnabled=!0,window.addEventListener("error",this.onError),window.addEventListener("unhandledrejection",this.onError),this._diag.debug("Instrumentation enabled")}isEnabled(){return this._isEnabled}},Ru="x-honeycomb-team",Nu="x-honeycomb-dataset";function Td(e){let t=Ks(e);return new Ye({url:wo(e),headers:qs(e,t,e?.tracesHeaders)})}function dd(e){let t=BT(e);return new $e({url:DT(e),headers:qs(e,t,e?.metricsHeaders,!0)})}function Ed(e){let t=VT(e);return new je({url:UT(e),headers:qs(e,t,e?.logsHeaders)})}function qs(e,t,r,n=!1){let o=Object.assign(Object.assign({},e?.headers),r);return t&&!o[Ru]&&(o[Ru]=t),bo(t)&&(n&&e?.metricsDataset?o[Nu]=e?.metricsDataset:e?.dataset&&(o[Nu]=e?.dataset)),o}function md(e){let t=Ks(e),{authRoot:r,uiRoot:n}=hd(e?.tracesEndpoint||wo(e));return new Gs(e?.serviceName,t,e?.logLevel,r,n)}var hd=(e="")=>{let t=new URL(e),n=/(api)([.|-])?(.*?)(\.?)(honeycomb\.io)(.*)/.exec(t.host);if(n===null)return{authRoot:void 0,uiRoot:void 0};let o=n[2]==="-",i,s;o?(i=`api-${n[3]}`,s=`ui-${n[3]}`):(i=n[3]?`api.${n[3]}`:"api",s=n[3]?`ui.${n[3]}`:"ui");let a=`${t.protocol}//${i}.honeycomb.io/1/auth`,u=`${t.protocol}//${s}.honeycomb.io`;return{authRoot:a,uiRoot:u}},Gs=class{constructor(t,r,n,o,i){if(this._traceUrl="",this._logLevel=F.DEBUG,n&&(this._logLevel=n),!t||!r){this._logLevel>=F.DEBUG&&console.debug($T);return}if(!o||!i){this._logLevel>=F.DEBUG&&console.debug(jT);return}fetch(o,{headers:{"x-honeycomb-team":r}}).then(a=>{if(a.ok)return a.json();throw new Error}).then(a=>{var u,l,c;let T=a;if(!((u=T.team)===null||u===void 0)&&u.slug)this._traceUrl=fd(r,t,(l=T.team)===null||l===void 0?void 0:l.slug,(c=T.environment)===null||c===void 0?void 0:c.slug,i);else throw new Error}).catch(()=>{this._logLevel>=F.INFO&&console.log(KT)})}export(t,r){this._traceUrl&&t.forEach(n=>{var o;!(!((o=n.parentSpanContext)===null||o===void 0)&&o.spanId)&&this._logLevel>=F.INFO&&console.log(at(`Honeycomb link: ${this._traceUrl}=${n.spanContext().traceId}`))}),r({code:Z.SUCCESS})}shutdown(){return Promise.resolve()}};function fd(e,t,r,n,o){let i=`${o}/${r}`;return!bo(e)&&n&&(i+=`/environments/${n}`),i+=`/datasets/${t}/trace?trace_id`,i}function Sd(e){let t=[];return e?.localVisualizations&&t.push(md(e)),e?.traceExporter&&t.push(e?.traceExporter),e?.traceExporters&&t.push(...e.traceExporters),e?.disableDefaultTraceExporter!==!0&&t.unshift(Td(e)),Rd([...t])}function Ad(e){let t=[];return t.push(dd(e)),e?.localVisualizations&&t.push(new zi),t}function gd(e){let t=[];return t.push(Ed(e)),e?.localVisualizations&&t.push(new Cs),t}function Rd(e){return new Hs(e)}var Hs=class{constructor(t){this._exporters=t}export(t,r){this._exporters.forEach(n=>n.export(t,r)),r({code:Z.SUCCESS})}async shutdown(){let t=[];this._exporters.forEach(r=>t.push(r.shutdown())),await Promise.all(t)}},ks=class{constructor(){}onStart(t,r){var n,o;((o=(n=J.getBaggage(r))===null||n===void 0?void 0:n.getAllEntries())!==null&&o!==void 0?o:[]).forEach(i=>{t.setAttribute(i[0],i[1].value),E.debug(`@honeycombio/opentelemetry-web: \u{1F6A8} Baggage in all outgoing headers: ${i[0]}=${i[1].value} `)})}onEnd(){}forceFlush(){return Promise.resolve()}shutdown(){return Promise.resolve()}},Fs=class{constructor(){}onStart(t){let{href:r,pathname:n,search:o,hash:i,hostname:s}=window.location;t.setAttributes({"browser.width":window.innerWidth,"browser.height":window.innerHeight,"page.hash":i,"page.url":r,"page.route":n,"page.hostname":s,"page.search":o,"url.path":n})}onEnd(){}forceFlush(){return Promise.resolve()}shutdown(){return Promise.resolve()}},Nd=new ie,Od=Nd.generateTraceId(),bd={getSessionId:()=>Od},Pd=e=>{let t=[];return e?.disableBrowserAttributes||t.push(new Fs),t.push(new ks,Pi(e?.sessionProvider||bd),...e?.spanProcessors||[]),t},Md="telemetry.distro.name",xd="telemetry.distro.version";function Cd(){return ft({"honeycomb.distro.version":Ge,"honeycomb.distro.runtime_version":"browser",[Md]:"@honeycombio/opentelemetry-web",[xd]:Ge})}var Ou={path:!0,hash:!0,hostname:!0,referrer:!0,url:!1,search:!1};function vd(e){if(e===!1||!window?.location)return ft({});let t=Ld(e),{href:r,pathname:n,search:o,hash:i,hostname:s}=window.location,a={"entry_page.url":Ke(t.url,r),"entry_page.path":Ke(t.path,n),"entry_page.search":Ke(t.search,o),"entry_page.hash":Ke(t.hash,i),"entry_page.hostname":Ke(t.hostname,s),"entry_page.referrer":Ke(t.referrer,document.referrer)};return ft(a)}function Ld(e){return e?Object.assign(Object.assign({},Ou),e):Ou}function Ke(e,t){if(e)return t}var Id=e=>e<=768?"small":e>768&&e<=1024?"medium":e>1024?"large":"unknown",wd=e=>{var t;return(t=e?.effectiveType)!==null&&t!==void 0?t:"unknown"},yd=(e,t)=>!e&&!t?"unknown":e||"desktop",Dd=e=>{let t=new Pu.default(e),{name:r,version:n}=t.getBrowser();return{browserName:r??"unknown",browserVersion:n??"unknown",deviceType:yd(t.getDevice().type,r)}};function Ud(){let{browserName:e,browserVersion:t,deviceType:r}=Dd(navigator.userAgent),n={"user_agent.original":navigator.userAgent,"browser.mobile":navigator.userAgent.includes("Mobi"),"browser.touch_screen_enabled":navigator.maxTouchPoints>0,"browser.language":navigator.language,"browser.name":e,"browser.version":t,"device.type":r,"network.effectiveType":wd(navigator.connection),"screen.width":window.screen.width,"screen.height":window.screen.height,"screen.size":Id(window.screen.width)};return ft(n)}var Bd=e=>{let t=ft({});return e?.disableBrowserAttributes||(t=t.merge(vd(e?.entryPageAttributes)).merge(Ud())),t=t.merge(Cd()),e?.resource&&(t=t.merge(e.resource)),e?.resourceAttributes&&(t=t.merge(ft(e.resourceAttributes))),t},Io=class extends Ls{constructor(t){var r,n;let o=[...t?.instrumentations||[]];((r=t?.webVitalsInstrumentationConfig)===null||r===void 0?void 0:r.enabled)!==!1&&o.push(new Bs(t?.webVitalsInstrumentationConfig)),((n=t?.globalErrorsInstrumentationConfig)===null||n===void 0?void 0:n.enabled)!==!1&&o.push(new Vs(t?.globalErrorsInstrumentationConfig)),super(Object.assign(Object.assign({},t),{instrumentations:o,resource:Bd(t),sampler:ed(t),spanProcessors:Pd(t),traceExporter:Sd(t),metricExporters:Ad(t),logExporters:gd(t)})),XT(t),t?.debug&&qT(t)}};var Pe;(function(e){e.DOCUMENT_LOAD="documentLoad",e.DOCUMENT_FETCH="documentFetch",e.RESOURCE_FETCH="resourceFetch"})(Pe||(Pe={}));var Zu="0.47.0",tl="@opentelemetry/instrumentation-document-load";var zr;(function(e){e.FIRST_PAINT="firstPaint",e.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"})(zr||(zr={}));var rl=()=>{let e={},t=rt.getEntriesByType?.("navigation")[0];if(t)Object.values(v).forEach(n=>{if(Xt(t,n)){let o=t[n];typeof o=="number"&&(e[n]=o)}});else{let n=rt.timing;n&&Object.values(v).forEach(i=>{if(Xt(n,i)){let s=n[i];typeof s=="number"&&(e[i]=s)}})}return e},el={"first-paint":zr.FIRST_PAINT,"first-contentful-paint":zr.FIRST_CONTENTFUL_PAINT},nl=e=>{let t=rt.getEntriesByType?.("paint");t&&t.forEach(({name:r,startTime:n})=>{Xt(el,r)&&e.addEvent(el[r],n)})};var Wr=class extends Et{component="document-load";version="1";moduleName=this.component;constructor(t={}){super(tl,Zu,t)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(t){let r=rt.getEntriesByType?.("resource");r&&r.forEach(n=>{this._initResourceSpan(n,t)})}_collectPerformance(){let t=Array.from(document.getElementsByTagName("meta")).find(o=>o.getAttribute("name")===De),r=rl(),n=t&&t.content||"";x.with(J.extract(Mt,{traceparent:n}),()=>{let o=this._startSpan(Pe.DOCUMENT_LOAD,v.FETCH_START,r);o&&(x.with(L.setSpan(x.active(),o),()=>{let i=this._startSpan(Pe.DOCUMENT_FETCH,v.FETCH_START,r);i&&(i.setAttribute(bn,location.href),x.with(L.setSpan(x.active(),i),()=>{this.getConfig().ignoreNetworkEvents||Vt(i,r),this._addCustomAttributesOnSpan(i,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(i,v.RESPONSE_END,r)}))}),o.setAttribute(bn,location.href),o.setAttribute(ja,navigator.userAgent),this._addResourcesSpans(o),this.getConfig().ignoreNetworkEvents||(tt(o,v.FETCH_START,r),tt(o,v.UNLOAD_EVENT_START,r),tt(o,v.UNLOAD_EVENT_END,r),tt(o,v.DOM_INTERACTIVE,r),tt(o,v.DOM_CONTENT_LOADED_EVENT_START,r),tt(o,v.DOM_CONTENT_LOADED_EVENT_END,r),tt(o,v.DOM_COMPLETE,r),tt(o,v.LOAD_EVENT_START,r),tt(o,v.LOAD_EVENT_END,r)),this.getConfig().ignorePerformancePaintEvents||nl(o),this._addCustomAttributesOnSpan(o,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(o,v.LOAD_EVENT_END,r))})}_endSpan(t,r,n){t&&(Xt(n,r)?t.end(n[r]):t.end())}_initResourceSpan(t,r){let n=this._startSpan(Pe.RESOURCE_FETCH,v.FETCH_START,t,r);n&&(n.setAttribute(bn,t.name),this.getConfig().ignoreNetworkEvents||Vt(n,t),this._addCustomAttributesOnResourceSpan(n,t,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,v.RESPONSE_END,t))}_startSpan(t,r,n,o){if(Xt(n,r)&&typeof n[r]=="number")return this.tracer.startSpan(t,{startTime:n[r]},o?L.setSpan(x.active(),o):void 0)}_waitForPageLoad(){window.document.readyState==="complete"?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))}_addCustomAttributesOnSpan(t,r){r&&Kt(()=>r(t),n=>{n&&this._diag.error("addCustomAttributesOnSpan",n)},!0)}_addCustomAttributesOnResourceSpan(t,r,n){n&&Kt(()=>n(t,r),o=>{o&&this._diag.error("addCustomAttributesOnResourceSpan",o)},!0)}enable(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener("load",this._onDocumentLoaded)}};var Xr;(function(e){e.COMPONENT="component",e.HTTP_STATUS_TEXT="http.status_text"})(Xr||(Xr={}));var lt=cn(ol());var il=E.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function sl(...e){if(e[0]instanceof URL||typeof e[0]=="string"){let t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){let{body:r,length:n}=Vd(t.body);return t.body=r,n}else return Promise.resolve(Hd(t.body))}else{let t=e[0];return t?.body?t.clone().text().then(r=>Qs(r)):Promise.resolve()}}function Vd(e){if(!e.pipeThrough)return il.warn("Platform has ReadableStream but not pipeThrough!"),{body:e,length:Promise.resolve(void 0)};let t=0,r,n=new Promise(i=>{r=i}),o=new TransformStream({start(){},async transform(i,s){let a=await i;t+=a.byteLength,s.enqueue(i)},flush(){r(t)}});return{body:e.pipeThrough(o),length:n}}function Gd(e){return typeof Document<"u"&&e instanceof Document}function Hd(e){if(Gd(e))return new XMLSerializer().serializeToString(document).length;if(typeof e=="string")return Qs(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return Fd(e);if(e instanceof URLSearchParams)return Qs(e.toString());if(e.byteLength!==void 0)return e.byteLength;il.warn("unknown body type")}var kd=new TextEncoder;function Qs(e){return kd.encode(e).byteLength}function Fd(e){let t=0;for(let[r,n]of e.entries())t+=r.length,n instanceof Blob?t+=n.size:t+=n.length;return t}function al(e){let t=$d(),r=e.toUpperCase();return r in t?r:"_OTHER"}var Yd={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},qr;function $d(){if(qr===void 0){let e=void 0;e&&e.length>0?(qr={},e.forEach(t=>{qr[t]=!0})):qr=Yd}return qr}var jd={"https:":"443","http:":"80"};function cl(e){let t=Number(e.port||jd[e.protocol]);if(t&&!isNaN(t))return t}var Js="0.202.0";var Kd=300,ul=typeof process=="object"&&process.release?.name==="node",Qr=class extends Et{component="fetch";version=Js;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(t={}){super("@opentelemetry/instrumentation-fetch",Js,t),this._semconvStability=Er("http",t?.semconvStabilityOptIn)}init(){}_addChildSpan(t,r){let n=this.tracer.startSpan("CORS Preflight",{startTime:r[v.FETCH_START]},L.setSpan(x.active(),t)),o=!(this._semconvStability&X.OLD);Vt(n,r,this.getConfig().ignoreNetworkEvents,void 0,o),n.end(r[v.RESPONSE_END])}_addFinalSpanAttributes(t,r){let n=Ot(r.url);if(this._semconvStability&X.OLD&&(t.setAttribute(lt.ATTR_HTTP_STATUS_CODE,r.status),r.statusText!=null&&t.setAttribute(Xr.HTTP_STATUS_TEXT,r.statusText),t.setAttribute(lt.ATTR_HTTP_HOST,n.host),t.setAttribute(lt.ATTR_HTTP_SCHEME,n.protocol.replace(":","")),typeof navigator<"u"&&t.setAttribute(lt.ATTR_HTTP_USER_AGENT,navigator.userAgent)),this._semconvStability&X.STABLE){t.setAttribute(xn,r.status),t.setAttribute(Cn,n.hostname);let o=cl(n);o&&t.setAttribute(vn,o)}}_addHeaders(t,r){if(!wr(r,this.getConfig().propagateTraceHeaderCorsUrls)){let n={};J.inject(x.active(),n),Object.keys(n).length>0&&this._diag.debug("headers inject skipped due to CORS policy");return}if(t instanceof Request)J.inject(x.active(),t.headers,{set:(n,o,i)=>n.set(o,typeof i=="string"?i:String(i))});else if(t.headers instanceof Headers)J.inject(x.active(),t.headers,{set:(n,o,i)=>n.set(o,typeof i=="string"?i:String(i))});else if(t.headers instanceof Map)J.inject(x.active(),t.headers,{set:(n,o,i)=>n.set(o,typeof i=="string"?i:String(i))});else{let n={};J.inject(x.active(),n),t.headers=Object.assign({},n,t.headers||{})}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(t,r={}){if(Cr(t,this.getConfig().ignoreUrls)){this._diag.debug("ignoring span as url matches ignored url");return}let n="",o={};if(this._semconvStability&X.OLD){let i=(r.method||"GET").toUpperCase();n=`HTTP ${i}`,o[Xr.COMPONENT]=this.moduleName,o[lt.ATTR_HTTP_METHOD]=i,o[lt.ATTR_HTTP_URL]=t}if(this._semconvStability&X.STABLE){let i=r.method,s=al(r.method||"GET");n||(n=s),o[Pn]=s,s!==i&&(o[Mn]=i),o[In]=t}return this.tracer.startSpan(n,{kind:jt.CLIENT,attributes:o})}_findResourceAndAddNetworkEvents(t,r,n){let o=r.entries;if(!o.length){if(!performance.getEntriesByType)return;o=performance.getEntriesByType("resource")}let i=Ir(r.spanUrl,r.startTime,n,o,this._usedResources,"fetch");if(i.mainRequest){let s=i.mainRequest;this._markResourceAsUsed(s);let a=i.corsPreFlightRequest;a&&(this._addChildSpan(t,a),this._markResourceAsUsed(a));let u=!(this._semconvStability&X.OLD);Vt(t,s,this.getConfig().ignoreNetworkEvents,void 0,u)}}_markResourceAsUsed(t){this._usedResources.add(t)}_endSpan(t,r,n){let o=ut(Date.now()),i=Rt();this._addFinalSpanAttributes(t,n),this._semconvStability&X.STABLE&&n.status>=400&&(t.setStatus({code:gt.ERROR}),t.setAttribute(Sr,String(n.status))),setTimeout(()=>{r.observer?.disconnect(),this._findResourceAndAddNetworkEvents(t,r,i),this._tasksCount--,this._clearResources(),t.end(o)},Kd)}_patchConstructor(){return t=>{let r=this;return function(...o){let i=this,s=Ot(o[0]instanceof Request?o[0].url:String(o[0])).href,a=o[0]instanceof Request?o[0]:o[1]||{},u=r._createSpan(s,a);if(!u)return t.apply(this,o);let l=r._prepareSpanData(s);r.getConfig().measureRequestSize&&sl(...o).then(d=>{d&&(r._semconvStability&X.OLD&&u.setAttribute(lt.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED,d),r._semconvStability&X.STABLE&&u.setAttribute(lt.ATTR_HTTP_REQUEST_BODY_SIZE,d))}).catch(d=>{r._diag.warn("getFetchBodyLength",d)});function c(d,h){r._applyAttributesAfterFetch(d,a,h),r._endSpan(d,l,{status:h.status||0,statusText:h.message,url:s})}function T(d,h){r._applyAttributesAfterFetch(d,a,h),h.status>=200&&h.status<400?r._endSpan(d,l,h):r._endSpan(d,l,{status:h.status,statusText:h.statusText,url:s})}function p(d,h,R){try{let S=R.clone().body;if(S){let M=S.getReader(),j=()=>{M.read().then(({done:Y})=>{Y?T(d,R):j()},Y=>{c(d,Y)})};j()}else T(d,R)}finally{h(R)}}function _(d,h,R){try{c(d,R)}finally{h(R)}}return new Promise((d,h)=>x.with(L.setSpan(x.active(),u),()=>(r._addHeaders(a,s),r._callRequestHook(u,a),r._tasksCount++,t.apply(i,a instanceof Request?[a]:[s,a]).then(p.bind(i,u,d),_.bind(i,u,h)))))}}}_applyAttributesAfterFetch(t,r,n){let o=this.getConfig().applyCustomAttributesOnSpan;o&&Kt(()=>o(t,r,n),i=>{i&&this._diag.error("applyCustomAttributesOnSpan",i)},!0)}_callRequestHook(t,r){let n=this.getConfig().requestHook;n&&Kt(()=>n(t,r),o=>{o&&this._diag.error("requestHook",o)},!0)}_prepareSpanData(t){let r=Rt(),n=[];if(typeof PerformanceObserver!="function")return{entries:n,startTime:r,spanUrl:t};let o=new PerformanceObserver(i=>{i.getEntries().forEach(a=>{a.initiatorType==="fetch"&&a.name===t&&n.push(a)})});return o.observe({entryTypes:["resource"]}),{entries:n,observer:o,startTime:r,spanUrl:t}}enable(){if(ul){this._diag.warn("this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()");return}Q(fetch)&&(this._unwrap(Ie,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(Ie,"fetch",this._patchConstructor())}disable(){ul||(this._unwrap(Ie,"fetch"),this._usedResources=new WeakSet)}};var Me;(function(e){e.EVENT_TYPE="event_type",e.TARGET_ELEMENT="target_element",e.TARGET_XPATH="target_xpath",e.HTTP_URL="http.url"})(Me||(Me={}));var Zs="0.47.0",ll="@opentelemetry/instrumentation-user-interaction";var zd="OT_ZONE_CONTEXT",Wd="Navigation:",Xd=["click"];function qd(){return!1}var Jr=class extends Et{version=Zs;moduleName="user-interaction";_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(t={}){super(ll,Zs,t),this._eventNames=new Set(t?.eventNames??Xd),this._shouldPreventSpanCreation=typeof t?.shouldPreventSpanCreation=="function"?t.shouldPreventSpanCreation:qd}init(){}_checkForTimeout(t,r){let n=this._spansData.get(r);n&&(t.source==="setTimeout"?n.hrTimeLastTimeout=Rt():t.source!=="Promise.then"&&t.source!=="setTimeout"&&(n.hrTimeLastTimeout=void 0))}_allowEventName(t){return this._eventNames.has(t)}_createSpan(t,r,n){if(!(t instanceof HTMLElement)||!t.getAttribute||t.hasAttribute("disabled")||!this._allowEventName(r))return;let o=Ve(t,!0);try{let i=this.tracer.startSpan(r,{attributes:{[Me.EVENT_TYPE]:r,[Me.TARGET_ELEMENT]:t.tagName,[Me.TARGET_XPATH]:o,[Me.HTTP_URL]:window.location.href}},n?L.setSpan(x.active(),n):void 0);return this._shouldPreventSpanCreation(r,t,i)===!0?void 0:(this._spansData.set(i,{taskCount:0}),i)}catch(i){this._diag.error("failed to start create new user interaction span",i)}}_decrementTask(t){let r=this._spansData.get(t);r&&(r.taskCount--,r.taskCount===0&&this._tryToEndSpan(t,r.hrTimeLastTimeout))}_getCurrentSpan(t){let r=t.get(zd);return r&&L.getSpan(r)}_incrementTask(t){let r=this._spansData.get(t);r&&r.taskCount++}addPatchedListener(t,r,n,o){let i=this._wrappedListeners.get(n);i||(i=new Map,this._wrappedListeners.set(n,i));let s=i.get(r);return s||(s=new Map,i.set(r,s)),s.has(t)?!1:(s.set(t,o),!0)}removePatchedListener(t,r,n){let o=this._wrappedListeners.get(n);if(!o)return;let i=o.get(r);if(!i)return;let s=i.get(t);return s&&(i.delete(t),i.size===0&&(o.delete(r),o.size===0&&this._wrappedListeners.delete(n))),s}_invokeListener(t,r,n){return typeof t=="function"?t.apply(r,n):t.handleEvent(n[0])}_patchAddEventListener(){let t=this;return r=>function(o,i,s){if(!i)return r.call(this,o,i,s);let a=s&&typeof s=="object"&&s.once,u=function(...l){let c,T=l[0],p=T?.target;T&&(c=t._eventsSpanMap.get(T)),a&&t.removePatchedListener(this,o,i);let _=t._createSpan(p,o,c);return _?(T&&t._eventsSpanMap.set(T,_),x.with(L.setSpan(x.active(),_),()=>{let d=t._invokeListener(i,this,l);return _.end(),d})):t._invokeListener(i,this,l)};if(t.addPatchedListener(this,o,i,u))return r.call(this,o,u,s)}}_patchRemoveEventListener(){let t=this;return r=>function(o,i,s){let a=t.removePatchedListener(this,o,i);return a?r.call(this,o,a,s):r.call(this,o,i,s)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._unpatchHistoryApi(),this._wrap(history,"replaceState",this._patchHistoryMethod()),this._wrap(history,"pushState",this._patchHistoryMethod()),this._wrap(history,"back",this._patchHistoryMethod()),this._wrap(history,"forward",this._patchHistoryMethod()),this._wrap(history,"go",this._patchHistoryMethod())}_patchHistoryMethod(){let t=this;return r=>function(...o){let i=`${location.pathname}${location.hash}${location.search}`,s=r.apply(this,o),a=`${location.pathname}${location.hash}${location.search}`;return i!==a&&t._updateInteractionName(a),s}}_unpatchHistoryApi(){Q(history.replaceState)&&this._unwrap(history,"replaceState"),Q(history.pushState)&&this._unwrap(history,"pushState"),Q(history.back)&&this._unwrap(history,"back"),Q(history.forward)&&this._unwrap(history,"forward"),Q(history.go)&&this._unwrap(history,"go")}_updateInteractionName(t){let r=L.getSpan(x.active());r&&typeof r.updateName=="function"&&r.updateName(`${Wd} ${t}`)}_patchZoneCancelTask(){let t=this;return r=>function(o){let i=Zone.current,s=t._getCurrentSpan(i);return s&&t._shouldCountTask(o,i)&&t._decrementTask(s),r.call(this,o)}}_patchZoneScheduleTask(){let t=this;return r=>function(o){let i=Zone.current,s=t._getCurrentSpan(i);return s&&t._shouldCountTask(o,i)&&(t._incrementTask(s),t._checkForTimeout(o,s)),r.call(this,o)}}_patchZoneRunTask(){let t=this;return r=>function(o,i,s){let u=(Array.isArray(s)&&s[0]instanceof Event?s[0]:void 0)?.target,l,c=this;if(u){if(l=t._createSpan(u,o.eventName),l)return t._incrementTask(l),c.run(()=>{try{return x.with(L.setSpan(x.active(),l),()=>{let T=Zone.current;return o._zone=T,r.call(T,o,i,s)})}finally{t._decrementTask(l)}})}else l=t._getCurrentSpan(c);try{return r.call(c,o,i,s)}finally{l&&t._shouldCountTask(o,c)&&t._decrementTask(l)}}}_shouldCountTask(t,r){if(t._zone&&(r=t._zone),!r||!t.data||t.data.isPeriodic)return!1;let n=this._getCurrentSpan(r);return!n||!this._spansData.get(n)?!1:t.type==="macroTask"||t.type==="microTask"}_tryToEndSpan(t,r){t&&this._spansData.get(t)&&(t.end(r),this._spansData.delete(t))}enable(){let t=this._getZoneWithPrototype();this._diag.debug("applying patch to",this.moduleName,this.version,"zone:",!!t),t?(Q(t.prototype.runTask)&&(this._unwrap(t.prototype,"runTask"),this._diag.debug("removing previous patch from method runTask")),Q(t.prototype.scheduleTask)&&(this._unwrap(t.prototype,"scheduleTask"),this._diag.debug("removing previous patch from method scheduleTask")),Q(t.prototype.cancelTask)&&(this._unwrap(t.prototype,"cancelTask"),this._diag.debug("removing previous patch from method cancelTask")),this._zonePatched=!0,this._wrap(t.prototype,"runTask",this._patchZoneRunTask()),this._wrap(t.prototype,"scheduleTask",this._patchZoneScheduleTask()),this._wrap(t.prototype,"cancelTask",this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach(n=>{Q(n.addEventListener)&&(this._unwrap(n,"addEventListener"),this._diag.debug("removing previous patch from method addEventListener")),Q(n.removeEventListener)&&(this._unwrap(n,"removeEventListener"),this._diag.debug("removing previous patch from method removeEventListener")),this._wrap(n,"addEventListener",this._patchAddEventListener()),this._wrap(n,"removeEventListener",this._patchRemoveEventListener())})),this._patchHistoryApi()}disable(){let t=this._getZoneWithPrototype();this._diag.debug("removing patch from",this.moduleName,this.version,"zone:",!!t),t&&this._zonePatched?(Q(t.prototype.runTask)&&this._unwrap(t.prototype,"runTask"),Q(t.prototype.scheduleTask)&&this._unwrap(t.prototype,"scheduleTask"),Q(t.prototype.cancelTask)&&this._unwrap(t.prototype,"cancelTask")):this._getPatchableEventTargets().forEach(n=>{Q(n.addEventListener)&&this._unwrap(n,"addEventListener"),Q(n.removeEventListener)&&this._unwrap(n,"removeEventListener")}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}};var _l="http.host",pl="http.method",Tl="http.request.body.size",dl="http.request_content_length_uncompressed";var El="http.scheme",ml="http.status_code",hl="http.url",fl="http.user_agent";var Ft;(function(e){e.METHOD_OPEN="open",e.METHOD_SEND="send",e.EVENT_ABORT="abort",e.EVENT_ERROR="error",e.EVENT_LOAD="loaded",e.EVENT_TIMEOUT="timeout"})(Ft||(Ft={}));var Qd=E.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function Jd(e){return typeof Document<"u"&&e instanceof Document}function Al(e){if(Jd(e))return new XMLSerializer().serializeToString(document).length;if(typeof e=="string")return Sl(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return tE(e);if(e instanceof URLSearchParams)return Sl(e.toString());if(e.byteLength!==void 0)return e.byteLength;Qd.warn("unknown body type")}var Zd=new TextEncoder;function Sl(e){return Zd.encode(e).byteLength}function tE(e){let t=0;for(let[r,n]of e.entries())t+=r.length,n instanceof Blob?t+=n.size:t+=n.length;return t}function gl(e){let t=rE(),r=e.toUpperCase();return r in t?r:"_OTHER"}var eE={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},Zr;function rE(){if(Zr===void 0){let e=void 0;e&&e.length>0?(Zr={},e.forEach(t=>{Zr[t]=!0})):Zr=eE}return Zr}var nE={"https:":"443","http:":"80"};function Rl(e){let t=Number(e.port||nE[e.protocol]);if(t&&!isNaN(t))return t}var ta="0.202.0";var Do;(function(e){e.HTTP_STATUS_TEXT="http.status_text"})(Do||(Do={}));var oE=300,tn=class extends Et{component="xml-http-request";version=ta;moduleName=this.component;_tasksCount=0;_xhrMem=new WeakMap;_usedResources=new WeakSet;_semconvStability;constructor(t={}){super("@opentelemetry/instrumentation-xml-http-request",ta,t),this._semconvStability=Er("http",t?.semconvStabilityOptIn)}init(){}_addHeaders(t,r){let n=Ot(r).href;if(!wr(n,this.getConfig().propagateTraceHeaderCorsUrls)){let i={};J.inject(x.active(),i),Object.keys(i).length>0&&this._diag.debug("headers inject skipped due to CORS policy");return}let o={};J.inject(x.active(),o),Object.keys(o).forEach(i=>{t.setRequestHeader(i,String(o[i]))})}_addChildSpan(t,r){x.with(L.setSpan(x.active(),t),()=>{let n=this.tracer.startSpan("CORS Preflight",{startTime:r[v.FETCH_START]}),o=!(this._semconvStability&X.OLD);Vt(n,r,this.getConfig().ignoreNetworkEvents,void 0,o),n.end(r[v.RESPONSE_END])})}_addFinalSpanAttributes(t,r,n){if(this._semconvStability&X.OLD){if(r.status!==void 0&&t.setAttribute(ml,r.status),r.statusText!==void 0&&t.setAttribute(Do.HTTP_STATUS_TEXT,r.statusText),typeof n=="string"){let o=Ot(n);t.setAttribute(_l,o.host),t.setAttribute(El,o.protocol.replace(":",""))}t.setAttribute(fl,navigator.userAgent)}this._semconvStability&X.STABLE&&r.status&&t.setAttribute(xn,r.status)}_applyAttributesAfterXHR(t,r){let n=this.getConfig().applyCustomAttributesOnSpan;typeof n=="function"&&Kt(()=>n(t,r),o=>{o&&this._diag.error("applyCustomAttributesOnSpan",o)},!0)}_addResourceObserver(t,r){let n=this._xhrMem.get(t);!n||typeof PerformanceObserver!="function"||typeof PerformanceResourceTiming!="function"||(n.createdResources={observer:new PerformanceObserver(o=>{let i=o.getEntries(),s=Ot(r);i.forEach(a=>{a.initiatorType==="xmlhttprequest"&&a.name===s.href&&n.createdResources&&n.createdResources.entries.push(a)})}),entries:[]},n.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(rt.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(t,r,n,o,i){if(!n||!o||!i||!t.createdResources)return;let s=t.createdResources.entries;(!s||!s.length)&&(s=rt.getEntriesByType("resource"));let a=Ir(Ot(n).href,o,i,s,this._usedResources);if(a.mainRequest){let u=a.mainRequest;this._markResourceAsUsed(u);let l=a.corsPreFlightRequest;l&&(this._addChildSpan(r,l),this._markResourceAsUsed(l));let c=!(this._semconvStability&X.OLD);Vt(r,u,this.getConfig().ignoreNetworkEvents,void 0,c)}}_cleanPreviousSpanInformation(t){let r=this._xhrMem.get(t);if(r){let n=r.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(t)}}_createSpan(t,r,n){if(Cr(r,this.getConfig().ignoreUrls)){this._diag.debug("ignoring span as url matches ignored url");return}let o="",i=Ot(r),s={};if(this._semconvStability&X.OLD&&(o=n.toUpperCase(),s[pl]=n,s[hl]=i.toString()),this._semconvStability&X.STABLE){let u=n,l=gl(n);o||(o=l),s[Pn]=l,l!==u&&(s[Mn]=u),s[In]=i.toString(),s[Cn]=i.hostname;let c=Rl(i);c&&(s[vn]=c)}let a=this.tracer.startSpan(o,{kind:jt.CLIENT,attributes:s});return a.addEvent(Ft.METHOD_OPEN),this._cleanPreviousSpanInformation(t),this._xhrMem.set(t,{span:a,spanUrl:r}),a}_markResourceAsUsed(t){this._usedResources.add(t)}_patchOpen(){return t=>{let r=this;return function(...o){let i=o[0],s=o[1];return r._createSpan(this,s,i),t.apply(this,o)}}}_patchSend(){let t=this;function r(l,c,T,p){let _=c.callbackToRemoveEvents;typeof _=="function"&&_();let{span:d,spanUrl:h,sendStartTime:R}=c;d&&(t._findResourceAndAddNetworkEvents(c,d,h,R,T),d.addEvent(l,p),t._addFinalSpanAttributes(d,c,h),d.end(p),t._tasksCount--),t._clearResources()}function n(l,c,T,p){let _=t._xhrMem.get(c);if(!_)return;if(_.status=c.status,_.statusText=c.statusText,t._xhrMem.delete(c),_.span){let R=_.span;t._applyAttributesAfterXHR(R,c),t._semconvStability&X.STABLE&&(T?p&&(R.setStatus({code:gt.ERROR,message:p}),R.setAttribute(Sr,p)):_.status&&_.status>=400&&(R.setStatus({code:gt.ERROR}),R.setAttribute(Sr,String(_.status))))}let d=Rt(),h=Date.now();setTimeout(()=>{r(l,_,d,h)},oE)}function o(){n(Ft.EVENT_ERROR,this,!0,"error")}function i(){n(Ft.EVENT_ABORT,this,!1)}function s(){n(Ft.EVENT_TIMEOUT,this,!0,"timeout")}function a(){this.status<299?n(Ft.EVENT_LOAD,this,!1):n(Ft.EVENT_ERROR,this,!1)}function u(l){l.removeEventListener("abort",i),l.removeEventListener("error",o),l.removeEventListener("load",a),l.removeEventListener("timeout",s);let c=t._xhrMem.get(l);c&&(c.callbackToRemoveEvents=void 0)}return l=>function(...T){let p=t._xhrMem.get(this);if(!p)return l.apply(this,T);let _=p.span,d=p.spanUrl;if(_&&d){if(t.getConfig().measureRequestSize&&T?.[0]){let h=T[0],R=Al(h);R!==void 0&&(t._semconvStability&X.OLD&&_.setAttribute(dl,R),t._semconvStability&X.STABLE&&_.setAttribute(Tl,R))}x.with(L.setSpan(x.active(),_),()=>{t._tasksCount++,p.sendStartTime=Rt(),_.addEvent(Ft.METHOD_SEND),this.addEventListener("abort",i),this.addEventListener("error",o),this.addEventListener("load",a),this.addEventListener("timeout",s),p.callbackToRemoveEvents=()=>{u(this),p.createdResources&&p.createdResources.observer.disconnect()},t._addHeaders(this,d),t._addResourceObserver(this,d)})}return l.apply(this,T)}}enable(){this._diag.debug("applying patch to",this.moduleName,this.version),Q(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),Q(XMLHttpRequest.prototype.send)&&(this._unwrap(XMLHttpRequest.prototype,"send"),this._diag.debug("removing previous patch from method send")),this._wrap(XMLHttpRequest.prototype,"open",this._patchOpen()),this._wrap(XMLHttpRequest.prototype,"send",this._patchSend())}disable(){this._diag.debug("removing patch from",this.moduleName,this.version),this._unwrap(XMLHttpRequest.prototype,"open"),this._unwrap(XMLHttpRequest.prototype,"send"),this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet}};var ea={"@opentelemetry/instrumentation-document-load":Wr,"@opentelemetry/instrumentation-fetch":Qr,"@opentelemetry/instrumentation-user-interaction":Jr,"@opentelemetry/instrumentation-xml-http-request":tn};function ra(e={}){for(let r of Object.keys(e))if(!Object.prototype.hasOwnProperty.call(ea,r)){E.error(`Provided instrumentation name "${r}" not found`);continue}let t=[];for(let r of Object.keys(ea)){let n=ea[r],o=e[r]??{};if(o.enabled===!1){E.debug(`Disabling instrumentation for ${r}`);continue}try{E.debug(`Loading instrumentation for ${r}`),t.push(new n(o))}catch(i){E.error(i)}}return t}function iE(e){if(e||(e={}),!e.apiKey)throw new Error("Usage: initializeTracing({ apiKey: 'honeycomb api key', serviceName: 'name of this service' })");e.serviceName||(console.log("No service name provided to initializeTracing. Defaulting to unknown_service"),e.serviceName="unknown_service"),e.configDefaults||(e.configDefaults={ignoreNetworkEvents:!0,propagateTraceHeaderCorsUrls:[/.+/g]}),new Io({localVisualizations:e.debug,instrumentations:[ra({"@opentelemetry/instrumentation-xml-http-request":e.configDefaults,"@opentelemetry/instrumentation-fetch":e.configDefaults,"@opentelemetry/instrumentation-document-load":{...e.configDefaults},"@opentelemetry/instrumentation-user-interaction":{enabled:!0,eventNames:["click","submit"]}})],...e}).start()}function sE(){return L.getActiveSpan()?.spanContext()}function aE(e){let t=L.getActiveSpan();t&&t.setAttributes(e)}function Nl(e){let t,r;return typeof e=="string"?t=e:(t=e.name||"missing tracer name",r=e.version),L.getTracer(t,r)}function Ol(e,t,r,n){if(r===void 0||typeof r!="function")throw new Error("USAGE: inSpan(tracerName, spanName, () => { ... })");return Nl(e).startActiveSpan(t,{},n||null,o=>{try{return r(o)}catch(i){throw o.setStatus({code:2,message:i.message}),o.recordException(i),i}finally{o.end()}})}async function cE(e,t,r,n){return r===void 0&&console.log("USAGE: inSpanAsync(tracerName, spanName, async () => { ... })"),Nl(e).startActiveSpan(t,{},n,async o=>{try{return await r(o)}catch(i){throw o.setStatus({code:2,message:i.message}),o.recordException(i),i}finally{o.end()}})}function uE(e,t){let r=L.getActiveSpan();if(!r)return;let n={};typeof e=="string"?n[Ut]=e:e&&(e.code?n[zt]=e.code.toString():e.name&&(n[zt]=e.name),e.message&&(n[Ut]=e.message),e.stack&&(n[we]=e.stack));let o={...n,...t};r.addEvent("exception",o),r.setStatus({code:2,message:n[Ut]})}function lE(e,t){L.getActiveSpan()?.addEvent(e,t)}function _E(e,t,r,n){(r||!r.spanId||!r.traceId)&&console.log("inChildSpan: the third argument should be a spanContext (or undefined to use the active context)");let o=r?L.setSpanContext(x.active(),r):x.active();return Ol(e,t,n,o)}var pE={initializeTracing:iE,setAttributes:aE,inSpan:Ol,inSpanAsync:cE,recordException:uE,addSpanEvent:lE,activeSpanContext:sE,inChildSpan:_E};window.Hny=pE;})();
/*! Bundled license information:
tracekit/tracekit.js:
(**
* https://github.com/csnover/TraceKit
* @license MIT
* @namespace TraceKit
*)
*/