@monoscopetech/browser 0.2.2 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function Me(e,t,n,r){return new(n||(n=Promise))(function(t,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function i(e){try{a(r.throw(e))}catch(e){o(e)}}function a(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n(function(e){e(r)})).then(s,i)}a((r=r.apply(e,[])).next())})}for(var xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",De="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Pe=0;Pe<64;Pe++)De[xe.charCodeAt(Pe)]=Pe;const Fe=new Map;const Ue=(e,t,n)=>{if(!e||!Be(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=Fe.get(e);return n||(n=new Map,Fe.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function Ze(e,t,n){if(e instanceof Array)return e.map(e=>Ze(e,t,n));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=xe[n[t]>>2],o+=xe[(3&n[t])<<4|n[t+1]>>4],o+=xe[(15&n[t+1])<<2|n[t+2]>>6],o+=xe[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Ze(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Ze(e.data,t,n),e.width,e.height]}}if(Be(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Ue(e,t,n)}}return e}const je=(e,t,n)=>[...e].map(e=>Ze(e,t,n)),Be=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function ze(e,t,n){const r=[];try{const o=H(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(r,...o){return W(this,t,n,!0)||"__context"in this||(this.__context=r),e.apply(this,[r,...o])}});r.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(e=>e())}}function Ve(e,t,n,r,o,s,i){const a=[],c=Object.getOwnPropertyNames(e);for(const s of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))try{if("function"!=typeof e[s])continue;const c=H(e,s,function(e){return function(...a){const c=e.apply(this,a);if(Ue(c,i,this),!W(this.canvas,r,o,!0)){const e=je([...a],i,this),r={type:t,property:s,args:e};n(this.canvas,r)}return c}});a.push(c)}catch(r){const o=V(e,s,{set(e){n(this.canvas,{type:t,property:s,args:[e],setter:!0})}});a.push(o)}return a}var He=null;try{var $e="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");He=$e.Worker}catch(e){}function Ge(e,t,n){var r=function(e){return Buffer.from(e,"base64").toString("utf8")}(e),o=r.indexOf("\n",10)+1,s=r.substring(o)+"";return function(e){return new He(s,Object.assign({},e,{eval:!0}))}}function We(e,t,n){var r=function(e){return atob(e)}(e),o=r.indexOf("\n",10)+1,s=r.substring(o)+"",i=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(i)}var qe="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var Ke,Ye=(Ke="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",qe?Ge(Ke):function(e){var t;return function(n){return t=t||We(e),new Worker(t,n)}}(Ke));class Xe{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:r,blockSelector:o,recordCanvas:s,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(n,r,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,o){const s=ze(t,n,r),i=new Map,a=new Ye;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:s}=e.data;this.mutationCb({id:t,type:oe["2D"],commands:[{property:"clearRect",args:[0,0,o,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const c=1e3/e;let u,l=0;const d=e=>{l&&e-l<c||(l=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{W(t,n,r,!0)||e.push(t)}),e})().forEach(e=>Me(this,0,void 0,function*(){var t;const n=this.mirror.getId(e);if(i.get(n))return;if(i.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))}const r=yield createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[r])}))),u=requestAnimationFrame(d)};u=requestAnimationFrame(d),this.resetObservers=()=>{s(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=ze(e,t,n),o=function(e,t,n,r){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const s=H(t.CanvasRenderingContext2D.prototype,i,function(o){return function(...s){return W(this.canvas,n,r,!0)||setTimeout(()=>{const n=je([...s],t,this);e(this.canvas,{type:oe["2D"],property:i,args:n})},0),o.apply(this,s)}});o.push(s)}catch(n){const r=V(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:oe["2D"],property:i,args:[t],setter:!0})}});o.push(r)}return()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),s=function(e,t,n,r){const o=[];return o.push(...Ve(t.WebGLRenderingContext.prototype,oe.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&o.push(...Ve(t.WebGL2RenderingContext.prototype,oe.WebGL2,e,n,r,0,t)),()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{r(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["type"]);return t}),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class Qe{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new ee,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);r.push({styleId:e,rules:n.map((e,t)=>({rule:g(e),index:t}))})}n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function Je(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let et,tt,nt,rt=!1;const ot=new m;function st(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:i="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:l,maskInputOptions:d,slimDOMOptions:p,maskInputFn:h,maskTextFn:f,hooks:g,packFn:_,sampling:y={},dataURLOptions:v={},mousemoveWait:b,recordCanvas:C=!1,recordCrossOriginIframes:S=!1,userTriggeredOnInput:T=!1,collectFonts:I=!1,inlineImages:E=!1,plugins:w,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:k=new Set([])}=e,O=!S||window.parent===window;let R=!1;if(!O)try{window.parent.document,R=!1}catch(e){R=!0}if(O&&!t)throw new Error("emit function is required");void 0!==b&&void 0===y.mousemove&&(y.mousemove=b),ot.reset();const N=!0===l?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==d?d:{password:!0},L=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p}:p||{};let M;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let x=0;const D=e=>{for(const t of w||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&(e=_(e)),e};et=(e,o)=>{var s;if(!(null===(s=fe[0])||void 0===s?void 0:s.isFrozen())||e.type===te.FullSnapshot||e.type===te.IncrementalSnapshot&&e.data.source===ne.Mutation||fe.forEach(e=>e.unfreeze()),O)null==t||t(D(e),o);else if(R){const t={type:"rrweb",event:D(e),isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===te.FullSnapshot)M=e,x=0;else if(e.type===te.IncrementalSnapshot){if(e.data.source===ne.Mutation&&e.data.isAttachIframe)return;x++;const t=r&&x>=r,o=n&&e.timestamp-M.timestamp>n;(t||o)&&tt(!0)}};const P=e=>{et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.Mutation},e)}))},F=e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.Scroll},e)})),j=e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.CanvasMutation},e)})),B=new Qe({mutationCb:P,adoptedStyleSheetCb:e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.AdoptedStyleSheet},e)}))}),z=new Ne({mirror:ot,mutationCb:P,stylesheetManager:B,recordCrossOriginIframes:S,wrappedEmit:et});for(const e of w||[])e.getMirror&&e.getMirror({nodeMirror:ot,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});nt=new Xe({recordCanvas:C,mutationCb:j,win:window,blockClass:o,blockSelector:s,mirror:ot,sampling:y.canvas,dataURLOptions:v});const V=new Le({mutationCb:P,scrollCb:F,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:N,dataURLOptions:v,maskTextFn:f,maskInputFn:h,recordCanvas:C,inlineImages:E,sampling:y,slimDOMOptions:L,iframeManager:z,stylesheetManager:B,canvasManager:nt,keepIframeSrcFn:A},mirror:ot});tt=(e=!1)=>{var t,n,r,i,l,d;et(Je({type:te.Meta,data:{href:window.location.href,width:G(),height:$()}}),e),B.reset(),fe.forEach(e=>e.lock());const p=function(e,t){var n=t||{},r=n.mirror,o=void 0===r?new m:r,s=n.blockClass,i=void 0===s?"rr-block":s,a=n.blockSelector,c=void 0===a?null:a,u=n.maskTextClass,l=void 0===u?"rr-mask":u,d=n.maskTextSelector,p=void 0===d?null:d,h=n.inlineStylesheet,f=void 0===h||h,g=n.inlineImages,_=void 0!==g&&g,y=n.recordCanvas,v=void 0!==y&&y,b=n.maskAllInputs,C=void 0!==b&&b,S=n.maskTextFn,T=n.maskInputFn,I=n.slimDOM,E=void 0!==I&&I,w=n.dataURLOptions,A=n.preserveWhiteSpace,k=n.onSerialize,O=n.onIframeLoad,R=n.iframeLoadTimeout,N=n.onStylesheetLoad,L=n.stylesheetLoadTimeout,M=n.keepIframeSrcFn;return U(e,{doc:e,mirror:o,blockClass:i,blockSelector:c,maskTextClass:l,maskTextSelector:p,skipChild:!1,inlineStylesheet:f,maskInputOptions:!0===C?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===C?{password:!0}:C,maskTextFn:S,maskInputFn:T,slimDOMOptions:!0===E||"all"===E?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===E,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===E?{}:E,dataURLOptions:w,inlineImages:_,recordCanvas:v,preserveWhiteSpace:A,onSerialize:k,onIframeLoad:O,iframeLoadTimeout:R,onStylesheetLoad:N,stylesheetLoadTimeout:L,keepIframeSrcFn:void 0===M?function(){return!1}:M,newlyAddedElement:!1})}(document,{mirror:ot,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:N,maskTextFn:f,slimDOM:L,dataURLOptions:v,recordCanvas:C,inlineImages:E,onSerialize:e=>{X(e,ot)&&z.addIframe(e),Q(e,ot)&&B.trackLinkElement(e),J(e)&&V.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{z.attachIframe(e,t),V.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{B.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!p)return console.warn("Failed to snapshot the document");et(Je({type:te.FullSnapshot,data:{node:p,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(l=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===l?void 0:l.scrollTop)||(null===(d=null===document||void 0===document?void 0:document.body)||void 0===d?void 0:d.scrollTop)||0}}})),fe.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&B.adoptStyleSheets(document.adoptedStyleSheets,ot.getId(document))};try{const e=[];e.push(Z("DOMContentLoaded",()=>{et(Je({type:te.DomContentLoaded,data:{}}))}));const t=e=>{var t;return Oe({mutationCb:P,mousemoveCb:(e,t)=>et(Je({type:te.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.MouseInteraction},e)})),scrollCb:F,viewportResizeCb:e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.ViewportResize},e)})),inputCb:e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.Input},e)})),mediaInteractionCb:e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.MediaInteraction},e)})),styleSheetRuleCb:e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.StyleSheetRule},e)})),styleDeclarationCb:e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.StyleDeclaration},e)})),canvasMutationCb:j,fontCb:e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.Font},e)})),selectionCb:e=>{et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.Selection},e)}))},blockClass:o,ignoreClass:i,maskTextClass:a,maskTextSelector:c,maskInputOptions:N,inlineStylesheet:u,sampling:y,recordCanvas:C,inlineImages:E,userTriggeredOnInput:T,collectFonts:I,doc:e,maskInputFn:h,maskTextFn:f,keepIframeSrcFn:A,blockSelector:s,slimDOMOptions:L,dataURLOptions:v,mirror:ot,iframeManager:z,stylesheetManager:B,shadowDomManager:V,canvasManager:nt,ignoreCSSAttributes:k,plugins:(null===(t=null==w?void 0:w.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>et(Je({type:te.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},g)};z.addLoadListener(n=>{e.push(t(n.contentDocument))});const n=()=>{tt(),e.push(t(document)),rt=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(Z("load",()=>{et(Je({type:te.Load,data:{}})),n()},window)),()=>{e.forEach(e=>e()),rt=!1}}catch(e){console.warn(e)}}st.addCustomEvent=(e,t)=>{if(!rt)throw new Error("please add custom event after start recording");et(Je({type:te.Custom,data:{tag:e,payload:t}}))},st.freezePage=()=>{fe.forEach(e=>e.freeze())},st.takeFullSnapshot=e=>{if(!rt)throw new Error("please take full snapshot after start recording");tt(e)},st.mirror=ot;class it{constructor(e,t){this.events=[],this.sessionId=t,this.config=e,this.save=this.save.bind(this),this.events=[],this.configure=this.configure.bind(this),window.addEventListener("unload",()=>this.save())}configure(){st({emit:e=>{this.events.push(e)}}),setInterval(this.save,15e3)}save(){if(0===this.events.length)return;let{replayEventsBaseUrl:e,projectId:t}=this.config;e=e?`${e}/rrweb/${t}`:`https://app.apitoolkit.io/rrweb/${t}`;const n=this.events;this.events=[];const r=JSON.stringify({events:n,sessionId:this.sessionId});fetch(e,{mode:"no-cors",method:"POST",headers:{"Content-Type":"application/json"},body:r}).catch(e=>{console.error("Failed to save replay events:",e),this.events=[...n,...this.events]})}}var at="object"==typeof globalThis?globalThis:global,ct="1.9.0",ut=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var lt=function(e){var t=new Set([e]),n=new Set,r=e.match(ut);if(!r)return function(){return!1};var o=+r[1],s=+r[2],i=+r[3];if(null!=r[4])return function(t){return t===e};function a(e){return n.add(e),!1}function c(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;var r=e.match(ut);if(!r)return a(e);var u=+r[1],l=+r[2],d=+r[3];return null!=r[4]||o!==u?a(e):0===o?s===l&&i<=d?c(e):a(e):s<=l?c(e):a(e)}}(ct),dt=ct.split(".")[0],pt=Symbol.for("opentelemetry.js.api."+dt),ht=at;function ft(e,t,n,r){var o;void 0===r&&(r=!1);var s=ht[pt]=null!==(o=ht[pt])&&void 0!==o?o:{version:ct};if(!r&&s[e]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(i.stack||i.message),!1}if(s.version!==ct){i=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+e+" does not match previously registered API v"+ct);return n.error(i.stack||i.message),!1}return s[e]=t,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+ct+"."),!0}function gt(e){var t,n,r=null===(t=ht[pt])||void 0===t?void 0:t.version;if(r&&lt(r))return null===(n=ht[pt])||void 0===n?void 0:n[e]}function mt(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+ct+".");var n=ht[pt];n&&delete n[e]}var _t,yt=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},vt=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},bt=function(){function e(e){this._namespace=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ct("debug",this._namespace,e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ct("error",this._namespace,e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ct("info",this._namespace,e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ct("warn",this._namespace,e)},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ct("verbose",this._namespace,e)},e}();function Ct(e,t,n){var r=gt("diag");if(r)return n.unshift(t),r[e].apply(r,vt([],yt(n),!1))}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(_t||(_t={}));var St=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},Tt=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},It=function(){function e(){function e(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=gt("diag");if(r)return r[e].apply(r,Tt([],St(t),!1))}}var t=this;t.setLogger=function(e,n){var r,o,s;if(void 0===n&&(n={logLevel:_t.INFO}),e===t){var i=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(r=i.stack)&&void 0!==r?r:i.message),!1}"number"==typeof n&&(n={logLevel:n});var a=gt("diag"),c=function(e,t){function n(n,r){var o=t[n];return"function"==typeof o&&e>=r?o.bind(t):function(){}}return e<_t.NONE?e=_t.NONE:e>_t.ALL&&(e=_t.ALL),t=t||{},{error:n("error",_t.ERROR),warn:n("warn",_t.WARN),info:n("info",_t.INFO),debug:n("debug",_t.DEBUG),verbose:n("verbose",_t.VERBOSE)}}(null!==(o=n.logLevel)&&void 0!==o?o:_t.INFO,e);if(a&&!n.suppressOverrideMessage){var u=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+u),c.warn("Current logger will overwrite one already registered from "+u)}return ft("diag",c,t,!0)},t.disable=function(){mt("diag",t)},t.createComponentLogger=function(e){return new bt(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}(),Et=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},wt=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},At=function(){function e(e){this._entries=e?new Map(e):new Map}return e.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=Et(e,2);return[t[0],t[1]]})},e.prototype.setEntry=function(t,n){var r=new e(this._entries);return r._entries.set(t,n),r},e.prototype.removeEntry=function(t){var n=new e(this._entries);return n._entries.delete(t),n},e.prototype.removeEntries=function(){for(var t,n,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var s=new e(this._entries);try{for(var i=wt(r),a=i.next();!a.done;a=i.next()){var c=a.value;s._entries.delete(c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return s},e.prototype.clear=function(){return new e},e}(),kt=Symbol("BaggageEntryMetadata"),Ot=It.instance();function Rt(e){return void 0===e&&(e={}),new At(new Map(Object.entries(e)))}function Nt(e){return Symbol.for(e)}var Lt,Mt,xt=function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(e){return n._currentContext.get(e)},n.setValue=function(t,r){var o=new e(n._currentContext);return o._currentContext.set(t,r),o},n.deleteValue=function(t){var r=new e(n._currentContext);return r._currentContext.delete(t),r}},Dt=new xt,Pt=(Lt=function(e,t){return Lt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Lt(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Lt(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Ft=function(){function e(){}return e.prototype.createGauge=function(e,t){return Kt},e.prototype.createHistogram=function(e,t){return Yt},e.prototype.createCounter=function(e,t){return qt},e.prototype.createUpDownCounter=function(e,t){return Xt},e.prototype.createObservableGauge=function(e,t){return Jt},e.prototype.createObservableCounter=function(e,t){return Qt},e.prototype.createObservableUpDownCounter=function(e,t){return en},e.prototype.addBatchObservableCallback=function(e,t){},e.prototype.removeBatchObservableCallback=function(e){},e}(),Ut=function(){},Zt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Pt(t,e),t.prototype.add=function(e,t){},t}(Ut),jt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Pt(t,e),t.prototype.add=function(e,t){},t}(Ut),Bt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Pt(t,e),t.prototype.record=function(e,t){},t}(Ut),zt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Pt(t,e),t.prototype.record=function(e,t){},t}(Ut),Vt=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e}(),Ht=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Pt(t,e),t}(Vt),$t=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Pt(t,e),t}(Vt),Gt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Pt(t,e),t}(Vt),Wt=new Ft,qt=new Zt,Kt=new Bt,Yt=new zt,Xt=new jt,Qt=new Ht,Jt=new $t,en=new Gt,tn={get:function(e,t){if(null!=e)return e[t]},keys:function(e){return null==e?[]:Object.keys(e)}},nn={set:function(e,t,n){null!=e&&(e[t]=n)}},rn=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},on=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},sn=function(){function e(){}return e.prototype.active=function(){return Dt},e.prototype.with=function(e,t,n){for(var r=[],o=3;o<arguments.length;o++)r[o-3]=arguments[o];return t.call.apply(t,on([n],rn(r),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),an=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},cn=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},un="context",ln=new sn,dn=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return ft(un,e,It.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,n){for(var r,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];return(r=this._getContextManager()).with.apply(r,cn([e,t,n],an(o),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return gt(un)||ln},e.prototype.disable=function(){this._getContextManager().disable(),mt(un,It.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(Mt||(Mt={}));var pn="0000000000000000",hn="00000000000000000000000000000000",fn={traceId:hn,spanId:pn,traceFlags:Mt.NONE},gn=function(){function e(e){void 0===e&&(e=fn),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),mn=Nt("OpenTelemetry Context Key SPAN");function _n(e){return e.getValue(mn)||void 0}function yn(){return _n(dn.getInstance().active())}function vn(e,t){return e.setValue(mn,t)}function bn(e){return e.deleteValue(mn)}function Cn(e,t){return vn(e,new gn(t))}function Sn(e){var t;return null===(t=_n(e))||void 0===t?void 0:t.spanContext()}var Tn=/^([0-9a-f]{32})$/i,In=/^[0-9a-f]{16}$/i;function En(e){return Tn.test(e)&&e!==hn}function wn(e){return En(e.traceId)&&(t=e.spanId,In.test(t)&&t!==pn);var t}function An(e){return new gn(e)}var kn=dn.getInstance(),On=function(){function e(){}return e.prototype.startSpan=function(e,t,n){if(void 0===n&&(n=kn.active()),Boolean(null==t?void 0:t.root))return new gn;var r,o=n&&Sn(n);return"object"==typeof(r=o)&&"string"==typeof r.spanId&&"string"==typeof r.traceId&&"number"==typeof r.traceFlags&&wn(o)?new gn(o):new gn},e.prototype.startActiveSpan=function(e,t,n,r){var o,s,i;if(!(arguments.length<2)){2===arguments.length?i=t:3===arguments.length?(o=t,i=n):(o=t,s=n,i=r);var a=null!=s?s:kn.active(),c=this.startSpan(e,o,a),u=vn(a,c);return kn.with(u,i,void 0,c)}},e}();var Rn,Nn,Ln,Mn=new On,xn=function(){function e(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}return e.prototype.startSpan=function(e,t,n){return this._getTracer().startSpan(e,t,n)},e.prototype.startActiveSpan=function(e,t,n,r){var o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Mn},e}(),Dn=new(function(){function e(){}return e.prototype.getTracer=function(e,t,n){return new On},e}()),Pn=function(){function e(){}return e.prototype.getTracer=function(e,t,n){var r;return null!==(r=this.getDelegateTracer(e,t,n))&&void 0!==r?r:new xn(this,e,t,n)},e.prototype.getDelegate=function(){var e;return null!==(e=this._delegate)&&void 0!==e?e:Dn},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getTracer(e,t,n)},e}();!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(Rn||(Rn={})),function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"}(Nn||(Nn={})),function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}(Ln||(Ln={}));var Fn=dn.getInstance(),Un=It.instance(),Zn=new(function(){function e(){}return e.prototype.getMeter=function(e,t,n){return Wt},e}()),jn="metrics",Bn=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalMeterProvider=function(e){return ft(jn,e,It.instance())},e.prototype.getMeterProvider=function(){return gt(jn)||Zn},e.prototype.getMeter=function(e,t,n){return this.getMeterProvider().getMeter(e,t,n)},e.prototype.disable=function(){mt(jn,It.instance())},e}().getInstance(),zn=function(){function e(){}return e.prototype.inject=function(e,t){},e.prototype.extract=function(e,t){return e},e.prototype.fields=function(){return[]},e}(),Vn=Nt("OpenTelemetry Baggage Key");function Hn(e){return e.getValue(Vn)||void 0}function $n(){return Hn(dn.getInstance().active())}function Gn(e,t){return e.setValue(Vn,t)}function Wn(e){return e.deleteValue(Vn)}var qn="propagation",Kn=new zn,Yn=function(){function e(){this.createBaggage=Rt,this.getBaggage=Hn,this.getActiveBaggage=$n,this.setBaggage=Gn,this.deleteBaggage=Wn}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(e){return ft(qn,e,It.instance())},e.prototype.inject=function(e,t,n){return void 0===n&&(n=nn),this._getGlobalPropagator().inject(e,t,n)},e.prototype.extract=function(e,t,n){return void 0===n&&(n=tn),this._getGlobalPropagator().extract(e,t,n)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){mt(qn,It.instance())},e.prototype._getGlobalPropagator=function(){return gt(qn)||Kn},e}(),Xn=Yn.getInstance(),Qn="trace",Jn=function(){function e(){this._proxyTracerProvider=new Pn,this.wrapSpanContext=An,this.isSpanContextValid=wn,this.deleteSpan=bn,this.getSpan=_n,this.getActiveSpan=yn,this.getSpanContext=Sn,this.setSpan=vn,this.setSpanContext=Cn}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=ft(Qn,this._proxyTracerProvider,It.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return gt(Qn)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){mt(Qn,It.instance()),this._proxyTracerProvider=new Pn},e}().getInstance();const er=Nt("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function tr(e){return!0===e.getValue(er)}const nr=",",rr="baggage";function or(e){const t=e.split(";");if(t.length<=0)return;const n=t.shift();if(!n)return;const r=n.indexOf("=");if(r<=0)return;const o=decodeURIComponent(n.substring(0,r).trim()),s=decodeURIComponent(n.substring(r+1).trim());let i;var a;return t.length>0&&("string"!=typeof(a=t.join(";"))&&(Ot.error("Cannot create baggage metadata from unknown type: "+typeof a),a=""),i={__TYPE__:kt,toString:function(){return a}}),{key:o,value:s,metadata:i}}function sr(e){const t={};return"string"==typeof e&&e.length>0&&e.split(nr).forEach(e=>{const n=or(e);void 0!==n&&n.value.length>0&&(t[n.key]=n.value)}),t}class ir{inject(e,t,n){const r=Xn.getBaggage(e);if(!r||tr(e))return;const o=function(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return void 0!==t.metadata&&(n+=";"+t.metadata.toString()),n})}(r).filter(e=>e.length<=4096).slice(0,180),s=function(e){return e.reduce((e,t)=>{const n=`${e}${""!==e?nr:""}${t}`;return n.length>8192?e:n},"")}(o);s.length>0&&n.set(t,rr,s)}extract(e,t,n){const r=n.get(t,rr),o=Array.isArray(r)?r.join(nr):r;if(!o)return e;const s={};if(0===o.length)return e;return o.split(nr).forEach(e=>{const t=or(e);if(t){const e={value:t.value};t.metadata&&(e.metadata=t.metadata),s[t.key]=e}}),0===Object.entries(s).length?e:Xn.setBaggage(e,Xn.createBaggage(s))}fields(){return[rr]}}function ar(e){const t={};if("object"!=typeof e||null==e)return t;for(const[n,r]of Object.entries(e))cr(n)?ur(r)?Array.isArray(r)?t[n]=r.slice():t[n]=r:Un.warn(`Invalid attribute value set for key: ${n}`):Un.warn(`Invalid attribute key: ${n}`);return t}function cr(e){return"string"==typeof e&&e.length>0}function ur(e){return null==e||(Array.isArray(e)?function(e){let t;for(const n of e)if(null!=n){if(!t){if(lr(n)){t=typeof n;continue}return!1}if(typeof n!==t)return!1}return!0}(e):lr(e))}function lr(e){switch(typeof e){case"number":case"boolean":case"string":return!0}return!1}let dr=e=>{Un.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){const t={};let n=e;for(;null!==n;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;const r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}(e))}(e))};function pr(e){try{dr(e)}catch{}}function hr(e){const t=process.env[e];if(null==t||""===t.trim())return;const r=Number(t);if(!isNaN(r))return r;Un.warn(`Unknown value ${n.inspect(t)} for ${e}, expected a number, using defaults`)}function fr(e){const t=process.env[e];if(null!=t&&""!==t.trim())return t}function gr(e){return fr(e)?.split(",").map(e=>e.trim()).filter(e=>""!==e)}const mr="object"==typeof globalThis?globalThis:global,_r=e.performance,yr="http.url",vr="error.type",br="exception.message",Cr="exception.type",Sr="http.request.method",Tr="http.request.method_original",Ir="http.response.status_code",Er="server.address",wr="server.port",Ar="service.name",kr="telemetry.sdk.language",Or="telemetry.sdk.name",Rr="telemetry.sdk.version",Nr="url.full",Lr="process.runtime.name",Mr={[Or]:"opentelemetry",[Lr]:"node",[kr]:"nodejs",[Rr]:"2.0.1"};const xr=Math.pow(10,6),Dr=Math.pow(10,9);function Pr(e){const t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*xr)]}function Fr(){let e=_r.timeOrigin;if("number"!=typeof e){const t=_r;e=t.timing&&t.timing.fetchStart}return e}function Ur(e){return Vr(Pr(Fr()),Pr("number"==typeof e?e:_r.now()))}function Zr(e){if(Br(e))return e;if("number"==typeof e)return e<Fr()?Ur(e):Pr(e);if(e instanceof Date)return Pr(e.getTime());throw TypeError("Invalid input type")}function jr(e){return e[0]*Dr+e[1]}function Br(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function zr(e){return Br(e)||"number"==typeof e||e instanceof Date}function Vr(e,t){const n=[e[0]+t[0],e[1]+t[1]];return n[1]>=Dr&&(n[1]-=Dr,n[0]+=1),n}var Hr;!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(Hr||(Hr={}));class $r{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(e=>"function"==typeof e.fields?e.fields():[]).reduce((e,t)=>e.concat(t),[])))}inject(e,t,n){for(const r of this._propagators)try{r.inject(e,t,n)}catch(e){Un.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){Un.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}const Gr="[_0-9a-z-*/]",Wr=new RegExp(`^(?:${`[a-z]${Gr}{0,255}`}|${`[a-z0-9]${Gr}{0,240}@[a-z]${Gr}{0,13}`})$`),qr=/^[ -~]{0,255}[!-~]$/,Kr=/,|=/;class Yr{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,t){const n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){const t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+"="+this.get(t)),e),[]).join(",")}_parse(e){e.length>512||(this._internalState=e.split(",").reverse().reduce((e,t)=>{const n=t.trim(),r=n.indexOf("=");if(-1!==r){const o=n.slice(0,r),s=n.slice(r+1,t.length);(function(e){return Wr.test(e)})(o)&&function(e){return qr.test(e)&&!Kr.test(e)}(s)&&e.set(o,s)}return e},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new Yr;return e._internalState=new Map(this._internalState),e}}const Xr="traceparent",Qr="tracestate",Jr=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");class eo{inject(e,t,n){const r=Jn.getSpanContext(e);if(!r||tr(e)||!wn(r))return;const o=`00-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||Mt.NONE).toString(16)}`;n.set(t,Xr,o),r.traceState&&n.set(t,Qr,r.traceState.serialize())}extract(e,t,n){const r=n.get(t,Xr);if(!r)return e;const o=Array.isArray(r)?r[0]:r;if("string"!=typeof o)return e;const s=function(e){const t=Jr.exec(e);return t?"00"===t[1]&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}:null}(o);if(!s)return e;s.isRemote=!0;const i=n.get(t,Qr);if(i){const e=Array.isArray(i)?i.join(","):i;s.traceState=new Yr("string"==typeof e?e:void 0)}return Jn.setSpanContext(e,s)}fields(){return[Xr,Qr]}}const to="[object Null]",no="[object Undefined]",ro=Function.prototype.toString,oo=ro.call(Object),so=Object.getPrototypeOf,io=Object.prototype,ao=io.hasOwnProperty,co=Symbol?Symbol.toStringTag:void 0,uo=io.toString;function lo(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!==function(e){if(null==e)return void 0===e?no:to;return co&&co in Object(e)?function(e){const t=ao.call(e,co),n=e[co];let r=!1;try{e[co]=void 0,r=!0}catch(e){}const o=uo.call(e);r&&(t?e[co]=n:delete e[co]);return o}(e):function(e){return uo.call(e)}(e)}(e))return!1;const t=so(e);if(null===t)return!0;const n=ao.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ro.call(n)===oo}function po(e){return go(e)?e.slice():e}function ho(e,t,n=0,r){let o;if(!(n>20)){if(n++,yo(e)||yo(t)||mo(t))o=po(t);else if(go(e)){if(o=e.slice(),go(t))for(let e=0,n=t.length;e<n;e++)o.push(po(t[e]));else if(_o(t)){const e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){const r=e[n];o[r]=po(t[r])}}}else if(_o(e))if(_o(t)){if(!function(e,t){if(!lo(e)||!lo(t))return!1;return!0}(e,t))return t;o=Object.assign({},e);const s=Object.keys(t);for(let i=0,a=s.length;i<a;i++){const a=s[i],c=t[a];if(yo(c))void 0===c?delete o[a]:o[a]=c;else{const s=o[a],i=c;if(fo(e,a,r)||fo(t,a,r))delete o[a];else{if(_o(s)&&_o(i)){const n=r.get(s)||[],o=r.get(i)||[];n.push({obj:e,key:a}),o.push({obj:t,key:a}),r.set(s,n),r.set(i,o)}o[a]=ho(o[a],c,n,r)}}}}else o=t;return o}}function fo(e,t,n){const r=n.get(e[t])||[];for(let n=0,o=r.length;n<o;n++){const o=r[n];if(o.key===t&&o.obj===e)return!0}return!1}function go(e){return Array.isArray(e)}function mo(e){return"function"==typeof e}function _o(e){return!yo(e)&&!go(e)&&!mo(e)&&"object"==typeof e}function yo(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}function vo(e,t){return"string"==typeof t?e===t:!!e.match(t)}function bo(e,t){if(!t)return!1;for(const n of t)if(vo(e,n))return!0;return!1}class Co{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class So{_callback;_that;_isCalled=!1;_deferred=new Co;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}const To=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class Io{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const t=new Io({});return t._rawAttributes=wo(e),t._asyncAttributesPending=e.filter(([e,t])=>To(t)).length>0,t}constructor(e){const t=e.attributes??{};this._rawAttributes=Object.entries(t).map(([e,t])=>(To(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=wo(this._rawAttributes)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){const[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,To(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Un.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[t,n]of this._rawAttributes)To(n)?Un.debug(`Unsettled resource attribute ${t} skipped`):null!=n&&(e[t]??=n);return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}merge(e){return null==e?this:Io.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function Eo(e){return Io.FromAttributeList(Object.entries(e))}function wo(e){return e.map(([e,t])=>To(t)?[e,t.catch(t=>{Un.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,t])}class Ao{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:Ln.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){const t=Date.now();this._spanContext=e.spanContext,this._performanceStartTime=_r.now(),this._performanceOffset=t-(this._performanceStartTime+Fr()),this._startTimeProvided=null!=e.startTime,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,this.links=e.links||[],this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,null!=e.attributes&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(null==t||this._isSpanEnded())return this;if(0===e.length)return Un.warn(`Invalid attribute key: ${e}`),this;if(!ur(t))return Un.warn(`Invalid attribute value set for key: ${e}`),this;const{attributeCountLimit:n}=this._spanLimits;return void 0!==n&&Object.keys(this.attributes).length>=n&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this)}setAttributes(e){for(const[t,n]of Object.entries(e))this.setAttribute(t,n);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;const{eventCountLimit:r}=this._spanLimits;if(0===r)return Un.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==r&&this.events.length>=r&&(0===this._droppedEventsCount&&Un.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),zr(t)&&(zr(n)||(n=t),t=void 0);const o=ar(t);return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()||(this.status={...e},null!=this.status.message&&"string"!=typeof e.message&&(Un.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message)),this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){this._isSpanEnded()?Un.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`):(this._ended=!0,this.endTime=this._getTime(e),this._duration=function(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=Dr),[n,r]}(this.startTime,this.endTime),this._duration[0]<0&&(Un.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&&Un.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this))}_getTime(e){if("number"==typeof e&&e<=_r.now())return Ur(e+this._performanceOffset);if("number"==typeof e)return Pr(e);if(e instanceof Date)return Pr(e.getTime());if(Br(e))return e;if(this._startTimeProvided)return Pr(Date.now());const t=_r.now()-this._performanceStartTime;return Vr(this.startTime,Pr(t))}isRecording(){return!1===this._ended}recordException(e,t){const n={};"string"==typeof e?n[br]=e:e&&(e.code?n[Cr]=e.code.toString():e.name&&(n[Cr]=e.name),e.message&&(n[br]=e.message),e.stack&&(n["exception.stacktrace"]=e.stack)),n[Cr]||n[br]?this.addEvent("exception",n,t):Un.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){const e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);Un.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){const t=this._attributeValueLengthLimit;return t<=0?(Un.warn(`Attribute value limit must be positive, got ${t}`),e):"string"==typeof e?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>"string"==typeof e?this._truncateToLimitUtil(e,t):e):e}}var ko;!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(ko||(ko={}));class Oo{shouldSample(){return{decision:ko.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class Ro{shouldSample(){return{decision:ko.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class No{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(pr(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Ro),this._remoteParentSampled=e.remoteParentSampled??new Ro,this._remoteParentNotSampled=e.remoteParentNotSampled??new Oo,this._localParentSampled=e.localParentSampled??new Ro,this._localParentNotSampled=e.localParentNotSampled??new Oo}shouldSample(e,t,n,r,o,s){const i=Jn.getSpanContext(e);return i&&wn(i)?i.isRemote?i.traceFlags&Mt.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,o,s):this._remoteParentNotSampled.shouldSample(e,t,n,r,o,s):i.traceFlags&Mt.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,o,s):this._localParentNotSampled.shouldSample(e,t,n,r,o,s):this._root.shouldSample(e,t,n,r,o,s)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class Lo{_ratio;_upperBound;constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(4294967295*this._ratio)}shouldSample(e,t){return{decision:En(t)&&this._accumulate(t)<this._upperBound?ko.RECORD_AND_SAMPLED:ko.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return"number"!=typeof e||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){const r=8*n;t=(t^parseInt(e.slice(r,r+8),16))>>>0}return t}}function Mo(){return{sampler:xo(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:hr("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:hr("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:hr("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:hr("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:hr("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:hr("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:hr("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:hr("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}function xo(){const e=fr("OTEL_TRACES_SAMPLER")??"parentbased_always_on";switch(e){case"always_on":return new Ro;case"always_off":return new Oo;case"parentbased_always_on":return new No({root:new Ro});case"parentbased_always_off":return new No({root:new Oo});case"traceidratio":return new Lo(Do());case"parentbased_traceidratio":return new No({root:new Lo(Do())});default:return Un.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "parentbased_always_on".`),new No({root:new Ro})}}function Do(){const e=hr("OTEL_TRACES_SAMPLER_ARG");return null==e?(Un.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1):e<0||e>1?(Un.error(`OTEL_TRACES_SAMPLER_ARG=${e} was given, but it is out of range ([0..1]), defaulting to 1.`),1):e}const Po=1/0;class Fo{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,t){this._exporter=e,this._maxExportBatchSize="number"==typeof t?.maxExportBatchSize?t.maxExportBatchSize:hr("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize="number"==typeof t?.maxQueueSize?t.maxQueueSize:hr("OTEL_BSP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis="number"==typeof t?.scheduledDelayMillis?t.scheduledDelayMillis:hr("OTEL_BSP_SCHEDULE_DELAY")??5e3,this._exportTimeoutMillis="number"==typeof t?.exportTimeoutMillis?t.exportTimeoutMillis:hr("OTEL_BSP_EXPORT_TIMEOUT")??3e4,this._shutdownOnce=new So(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Un.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||0!==(e.spanContext().traceFlags&Mt.SAMPLED)&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize)return 0===this._droppedSpansCount&&Un.debug("maxQueueSize reached, dropping spans"),void this._droppedSpansCount++;this._droppedSpansCount>0&&(Un.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{const n=[];for(let e=0,t=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),0===this._finishedSpans.length?Promise.resolve():new Promise((e,t)=>{const n=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);Fn.with(function(e){return e.setValue(er,!0)}(Fn.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);const o=()=>this._exporter.export(r,r=>{clearTimeout(n),r.code===Hr.SUCCESS?e():t(r.error??new Error("BatchSpanProcessor: span export failed"))});let s=null;for(let e=0,t=r.length;e<t;e++){const t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(s??=[],s.push(t.resource.waitForAsyncAttributes()))}null===s?o():Promise.all(s).then(o,e=>{pr(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;const e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,pr(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),this._timer.unref())}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}class Uo extends Fo{onShutdown(){}}class Zo{generateTraceId=Bo(16);generateSpanId=Bo(8)}const jo=Buffer.allocUnsafe(16);function Bo(e){return function(){for(let t=0;t<e/4;t++)jo.writeUInt32BE(Math.random()*2**32>>>0,4*t);for(let t=0;t<e&&!(jo[t]>0);t++)t===e-1&&(jo[e-1]=1);return jo.toString("hex",0,e)}}class zo{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,t,n,r){const o=function(e){const t={sampler:xo()},n=Mo(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}(t);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=t.idGenerator||new Zo,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e}startSpan(e,t={},n=Fn.active()){t.root&&(n=Jn.deleteSpan(n));const r=Jn.getSpan(n);if(tr(n)){Un.debug("Instrumentation suppressed, returning Noop Span");return Jn.wrapSpanContext(fn)}const o=r?.spanContext(),s=this._idGenerator.generateSpanId();let i,a,c;o&&Jn.isSpanContextValid(o)?(a=o.traceId,c=o.traceState,i=o):a=this._idGenerator.generateTraceId();const u=t.kind??Nn.INTERNAL,l=(t.links??[]).map(e=>({context:e.context,attributes:ar(e.attributes)})),d=ar(t.attributes),p=this._sampler.shouldSample(n,a,e,u,d,l);c=p.traceState??c;const h={traceId:a,spanId:s,traceFlags:p.decision===Rn.RECORD_AND_SAMPLED?Mt.SAMPLED:Mt.NONE,traceState:c};if(p.decision===Rn.NOT_RECORD){Un.debug("Recording is off, propagating context in a non-recording span");return Jn.wrapSpanContext(h)}const f=ar(Object.assign(d,p.attributes));return new Ao({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:h,name:e,kind:u,links:l,parentSpanContext:i,attributes:f,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(e,t,n,r){let o,s,i;if(arguments.length<2)return;2===arguments.length?i=t:3===arguments.length?(o=t,i=n):(o=t,s=n,i=r);const a=s??Fn.active(),c=this.startSpan(e,o,a),u=Jn.setSpan(a,c);return Fn.with(u,i,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class Vo{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){const e=[];for(const t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{pr(e||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(const n of this._spanProcessors)n.onStart(e,t)}onEnd(e){for(const t of this._spanProcessors)t.onEnd(e)}shutdown(){const e=[];for(const t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}}var Ho,$o;!function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"}(Ho||(Ho={}));class Go{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const t=function(...e){let t=e.shift();const n=new WeakMap;for(;e.length>0;)t=ho(t,e.shift(),0,n);return t}({},Mo(),function(e){const t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??hr("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??hr("OTEL_ATTRIBUTE_COUNT_LIMIT")??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??hr("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??hr("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??Po,Object.assign({},e,{spanLimits:t})}(e));this._resource=t.resource??Eo({[Ar]:`unknown_service:${process.argv0}`,[kr]:Mr[kr],[Or]:Mr[Or],[Rr]:Mr[Rr]}),this._config=Object.assign({},t,{resource:this._resource});const n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new Vo(n)}getTracer(e,t,n){const r=`${e}@${t||""}:${n?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new zo({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){const e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r;const o=setTimeout(()=>{n(new Error(`Span processor did not completed within timeout period of ${e} ms`)),r=Ho.timeout},e);t.forceFlush().then(()=>{clearTimeout(o),r!==Ho.timeout&&(r=Ho.resolved,n(r))}).catch(e=>{clearTimeout(o),r=Ho.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{const r=t.filter(e=>e!==Ho.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class Wo{_enabled=!1;_currentContext=Dt;_bindFunction(e=Dt,t){const n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return void 0===e&&(e=this.active()),"function"==typeof t?this._bindFunction(e,t):t}disable(){return this._currentContext=Dt,this._enabled=!1,this}enable(){return this._enabled||(this._enabled=!0,this._currentContext=Dt),this}with(e,t,n,...r){const o=this._currentContext;this._currentContext=e||Dt;try{return t.call(n,...r)}finally{this._currentContext=o}}}class qo extends Go{constructor(e={}){super(e)}register(e={}){var t;Jn.setGlobalTracerProvider(this),null!==(t=e.propagator)&&(void 0!==t?Xn.setGlobalPropagator(t):Xn.setGlobalPropagator(new $r({propagators:[new eo,new ir]}))),function(e){if(null!==e){if(void 0===e){const e=new Wo;return e.enable(),void Fn.setGlobalContextManager(e)}e.enable(),Fn.setGlobalContextManager(e)}}(e.contextManager)}}!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"}($o||($o={}));let Ko;function Yo(e,t){return t in e}function Xo(e,t,n,r=!0){if(Yo(n,t)&&"number"==typeof n[t]&&(!r||0!==n[t]))return e.addEvent(t,n[t])}function Qo(e,t,n=!1,r,o){if(void 0===r&&(r=0!==t[$o.START_TIME]),n||(Xo(e,$o.FETCH_START,t,r),Xo(e,$o.DOMAIN_LOOKUP_START,t,r),Xo(e,$o.DOMAIN_LOOKUP_END,t,r),Xo(e,$o.CONNECT_START,t,r),Xo(e,$o.SECURE_CONNECTION_START,t,r),Xo(e,$o.CONNECT_END,t,r),Xo(e,$o.REQUEST_START,t,r),Xo(e,$o.RESPONSE_START,t,r),Xo(e,$o.RESPONSE_END,t,r)),!o){const n=t[$o.ENCODED_BODY_SIZE];void 0!==n&&e.setAttribute("http.response_content_length",n);const r=t[$o.DECODED_BODY_SIZE];void 0!==r&&n!==r&&e.setAttribute("http.response_content_length_uncompressed",r)}}function Jo(){return"undefined"!=typeof location?location.origin:void 0}function es(e,t,n,r,o=new WeakSet,s){const i=ts(e),a=function(e,t,n,r,o,s){const i=jr(t),a=jr(n);let c=r.filter(t=>{const n=jr(Zr(t[$o.FETCH_START])),r=jr(Zr(t[$o.RESPONSE_END]));return t.initiatorType.toLowerCase()===(s||"xmlhttprequest")&&t.name===e&&n>=i&&r<=a});c.length>0&&(c=c.filter(e=>!o.has(e)));return c}(e=i.toString(),t,n,r,o,s);if(0===a.length)return{mainRequest:void 0};if(1===a.length)return{mainRequest:a[0]};const c=function(e){return e.slice().sort((e,t)=>{const n=e[$o.FETCH_START],r=t[$o.FETCH_START];return n>r?1:n<r?-1:0})}(a);if(i.origin!==Jo()&&c.length>1){let e=c[0],t=function(e,t,n){const r=jr(n),o=jr(Zr(t));let s,i=e[1];const a=e.length;for(let t=1;t<a;t++){const n=e[t],a=jr(Zr(n[$o.FETCH_START])),c=r-jr(Zr(n[$o.RESPONSE_END]));a>=o&&(!s||c<s)&&(s=c,i=n)}return i}(c,e[$o.RESPONSE_END],n);const r=e[$o.RESPONSE_END];return t[$o.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}return{mainRequest:a[0]}}function ts(e){if("function"==typeof URL)return new URL(e,"undefined"!=typeof document?document.baseURI:"undefined"!=typeof location?location.href:void 0);const t=(Ko||(Ko=document.createElement("a")),Ko);return t.href=e,t}function ns(e,t){let n=t||[];("string"==typeof n||n instanceof RegExp)&&(n=[n]);return ts(e).origin===Jo()||n.some(t=>vo(e,t))}class rs{emit(e){}}const os=new rs;const ss=new class{getLogger(e,t,n){return new rs}};class is{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;const e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):os}}class as{getLogger(e,t,n){var r;return null!==(r=this.getDelegateLogger(e,t,n))&&void 0!==r?r:new is(this,e,t,n)}getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:ss}setDelegate(e){this._delegate=e}getDelegateLogger(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getLogger(e,t,n)}}const cs="object"==typeof globalThis?globalThis:global,us=Symbol.for("io.opentelemetry.js.api.logs"),ls=cs;class ds{constructor(){this._proxyLoggerProvider=new as}static getInstance(){return this._instance||(this._instance=new ds),this._instance}setGlobalLoggerProvider(e){return ls[us]?this.getLoggerProvider():(ls[us]=(t=1,n=e,r=ss,e=>e===t?n:r),this._proxyLoggerProvider.setDelegate(e),e);var t,n,r}getLoggerProvider(){var e,t;return null!==(t=null===(e=ls[us])||void 0===e?void 0:e.call(ls,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete ls[us],this._proxyLoggerProvider=new as}}const ps=ds.getInstance();const hs=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,fs=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,gs={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function ms(e,t,n){if(!function(e){return"string"==typeof e&&hs.test(e)}(e))return Un.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");const r=function(e){const t=e.match(hs);if(!t)return void Un.error(`Invalid version: ${e}`);const n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}(e);if(!r)return!1;const o=[],s=_s(r,t,o,n);return s&&!n?.includePrerelease?function(e,t){if(e.prerelease)return t.some(t=>t.prerelease&&t.version===e.version);return!0}(r,o):s}function _s(e,t,n,r){if(t.includes("||")){const o=t.trim().split("||");for(const t of o)if(ys(e,t,n,r))return!0;return!1}if(t.includes(" - "))t=function(e,t){const n=Ns;return e.replace(n,(e,n,r,o,s,i,a,c,u,l,d,p)=>`${n=vs(r)?"":vs(o)?`>=${r}.0.0${t?.includePrerelease?"-0":""}`:vs(s)?`>=${r}.${o}.0${t?.includePrerelease?"-0":""}`:i?`>=${n}`:`>=${n}${t?.includePrerelease?"-0":""}`} ${c=vs(u)?"":vs(l)?`<${+u+1}.0.0-0`:vs(d)?`<${u}.${+l+1}.0-0`:p?`<=${u}.${l}.${d}-${p}`:t?.includePrerelease?`<${u}.${l}.${+d+1}-0`:`<=${c}`}`.trim())}(t,r);else if(t.includes(" ")){const o=t.trim().replace(/\s{2,}/g," ").split(" ");for(const t of o)if(!ys(e,t,n,r))return!1;return!0}return ys(e,t,n,r)}function ys(e,t,n,r){if(t=function(e,t){return e=e.trim(),e=function(e,t){const n=Ms,r=t?.includePrerelease?"-0":"";return e.replace(n,(e,t,n,o,s)=>{let i;return i=vs(t)?"":vs(n)?`>=${t}.0.0${r} <${+t+1}.0.0-0`:vs(o)?"0"===t?`>=${t}.${n}.0${r} <${t}.${+n+1}.0-0`:`>=${t}.${n}.0${r} <${+t+1}.0.0-0`:s?"0"===t?"0"===n?`>=${t}.${n}.${o}-${s} <${t}.${n}.${+o+1}-0`:`>=${t}.${n}.${o}-${s} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${o}-${s} <${+t+1}.0.0-0`:"0"===t?"0"===n?`>=${t}.${n}.${o}${r} <${t}.${n}.${+o+1}-0`:`>=${t}.${n}.${o}${r} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${o} <${+t+1}.0.0-0`,i})}(e,t),e=function(e){const t=Ls;return e.replace(t,(e,t,n,r,o)=>{let s;return s=vs(t)?"":vs(n)?`>=${t}.0.0 <${+t+1}.0.0-0`:vs(r)?`>=${t}.${n}.0 <${t}.${+n+1}.0-0`:o?`>=${t}.${n}.${r}-${o} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${r} <${t}.${+n+1}.0-0`,s})}(e),e=function(e,t){const n=Rs;return e.replace(n,(e,n,r,o,s,i)=>{const a=vs(r),c=a||vs(o),u=c||vs(s),l=u;return"="===n&&l&&(n=""),i=t?.includePrerelease?"-0":"",a?e=">"===n||"<"===n?"<0.0.0-0":"*":n&&l?(c&&(o=0),s=0,">"===n?(n=">=",c?(r=+r+1,o=0,s=0):(o=+o+1,s=0)):"<="===n&&(n="<",c?r=+r+1:o=+o+1),"<"===n&&(i="-0"),e=`${n+r}.${o}.${s}${i}`):c?e=`>=${r}.0.0${i} <${+r+1}.0.0-0`:u&&(e=`>=${r}.${o}.0${i} <${r}.${+o+1}.0-0`),e})}(e,t),e=e.trim(),e}(t,r),t.includes(" "))return _s(e,t,n,r);{const r=function(e){if(!e)return{};const t=e.match(fs);if(!t)return Un.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op;const r=t.groups.version,o=t.groups.prerelease,s=t.groups.build,i=r.split("."),a=o?.split(".");"=="===n&&(n="=");return{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}(t);return n.push(r),function(e,t){if(t.invalid)return!1;if(!t.version||bs(t.version))return!0;let n=Ts(e.versionSegments||[],t.versionSegments||[]);if(0===n){const r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];n=r.length||o.length?!r.length&&o.length?1:r.length&&!o.length?-1:Ts(r,o):0}return gs[t.op]?.includes(n)}(e,r)}}function vs(e){return!e||"x"===e.toLowerCase()||"*"===e}function bs(e){return"*"===e||"x"===e||"X"===e}function Cs(e){const t=parseInt(e,10);return isNaN(t)?e:t}function Ss(e,t){if(bs(e)||bs(t))return 0;const[n,r]=function(e,t){if(typeof e==typeof t){if("number"==typeof e)return[e,t];if("string"==typeof e)return[e,t];throw new Error("Version segments can only be strings or numbers")}return[String(e),String(t)]}(Cs(e),Cs(t));return n>r?1:n<r?-1:0}function Ts(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){const r=Ss(e[n]||"0",t[n]||"0");if(0!==r)return r}return 0}const Is="[a-zA-Z0-9-]",Es="0|[1-9]\\d*",ws=`(?:${Es}|${`\\d*[a-zA-Z-]${Is}*`})`,As=`${Is}+`,ks=`${Es}|x|X|\\*`,Os=`[v=\\s]*(${ks})(?:\\.(${ks})(?:\\.(${ks})(?:${`(?:-(${ws}(?:\\.${ws})*))`})?${`(?:\\+(${As}(?:\\.${As})*))`}?)?)?`,Rs=new RegExp(`^((?:<|>)?=?)\\s*${Os}$`),Ns=new RegExp(`^\\s*(${Os})\\s+-\\s+(${Os})\\s*$`),Ls=new RegExp(`^(?:~>?)${Os}$`),Ms=new RegExp(`^(?:\\^)${Os}$`);let xs=console.error.bind(console);function Ds(e,t,n){const r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}const Ps=(e,t,n)=>{if(!e||!e[t])return void xs("no original function "+String(t)+" to wrap");if(!n)return xs("no wrapper function"),void xs((new Error).stack);const r=e[t];if("function"!=typeof r||"function"!=typeof n)return void xs("original object and wrapper must be functions");const o=n(r,t);return Ds(o,"__original",r),Ds(o,"__unwrap",()=>{e[t]===o&&Ds(e,t,r)}),Ds(o,"__wrapped",!0),Ds(e,t,o),o},Fs=(e,t,n)=>{if(!e)return xs("must provide one or more modules to patch"),void xs((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{Ps(e,t,n)})}):xs("must provide one or more functions to wrap on modules")},Us=(e,t)=>{if(!e||!e[t])return xs("no function to unwrap."),void xs((new Error).stack);const n=e[t];n.__unwrap?n.__unwrap():xs("no original to unwrap to -- has "+String(t)+" already been unwrapped?")},Zs=(e,t)=>{if(!e)return xs("must provide one or more modules to patch"),void xs((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{Us(e,t)})}):xs("must provide one or more functions to unwrap on modules")};class js{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=Un.createComponentLogger({namespace:e}),this._tracer=Jn.getTracer(e,t),this._meter=Bn.getMeter(e,t),this._logger=ps.getLogger(e,t),this._updateMetricInstruments()}_wrap=Ps;_unwrap=Us;_massWrap=Fs;_massUnwrap=Zs;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},e)}}}var Bs,zs,Vs,Hs,$s,Gs={exports:{}},Ws={exports:{}},qs={exports:{}};function Ks(){if(zs)return Bs;zs=1;var e=1e3,t=60*e,n=60*t,r=24*n,o=7*r,s=365.25*r;function i(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}return Bs=function(a,c){c=c||{};var u=typeof a;if("string"===u&&a.length>0)return function(i){if((i=String(i)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*s;case"weeks":case"week":case"w":return c*o;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(a);if("number"===u&&isFinite(a))return c.long?function(o){var s=Math.abs(o);if(s>=r)return i(o,s,r,"day");if(s>=n)return i(o,s,n,"hour");if(s>=t)return i(o,s,t,"minute");if(s>=e)return i(o,s,e,"second");return o+" ms"}(a):function(o){var s=Math.abs(o);if(s>=r)return Math.round(o/r)+"d";if(s>=n)return Math.round(o/n)+"h";if(s>=t)return Math.round(o/t)+"m";if(s>=e)return Math.round(o/e)+"s";return o+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))}}function Ys(){if(Hs)return Vs;return Hs=1,Vs=function(e){function t(e){let r,o,s,i=null;function a(...e){if(!a.enabled)return;const n=a,o=Number(new Date),s=o-(r||o);n.diff=s,n.prev=r,n.curr=o,r=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,o)=>{if("%%"===r)return"%";i++;const s=t.formatters[o];if("function"==typeof s){const t=e[i];r=s.call(n,t),e.splice(i,1),i--}return r}),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(o!==t.namespaces&&(o=t.namespaces,s=t.enabled(e)),s),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e,t){let n=0,r=0,o=-1,s=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||"*"===t[r]))"*"===t[r]?(o=r,s=n,r++):(n++,r++);else{if(-1===o)return!1;r=o+1,s++,n=s}for(;r<t.length&&"*"===t[r];)r++;return r===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(r(e,n))return!1;for(const n of t.names)if(r(e,n))return!0;return!1},t.humanize=Ks(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},Vs}var Xs,Qs={exports:{}};"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Ws.exports=($s||($s=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))}),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Ys()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(qs,qs.exports)),qs.exports):Ws.exports=(Xs||(Xs=1,function(e,t){const r=o,s=n;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(s.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:o}=this;if(o){const t=this.color,o="[3"+(t<8?t:"8;5;"+t),s=` ${o};1m${r} `;n[0]=s+n[0].split("\n").join("\n"+s),n.push(o+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):r.isatty(process.stderr.fd)},t.destroy=s.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=require("supports-color");e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e},{}),e.exports=Ys()(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts)}}(Qs,Qs.exports)),Qs.exports);var Js,ei,ti,ni,ri=Ws.exports,oi=t.sep,si=function(e){var t=e.split(oi),n=t.lastIndexOf("node_modules");if(-1!==n&&t[n+1]){for(var r="@"===t[n+1][0],o=r?t[n+1]+"/"+t[n+2]:t[n+1],s=r?3:2,i="",a=n+s-1,c=0;c<=a;c++)i+=c===a?t[c]:t[c]+oi;for(var u="",l=t.length-1,d=n+s;d<=l;d++)u+=d===l?t[d]:t[d]+oi;return{name:o,basedir:i,path:u}}};function ii(){return ei?Js:(ei=1,Js=i.homedir||function(){var e=process.env.HOME,t=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return"win32"===process.platform?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:"darwin"===process.platform?e||(t?"/Users/"+t:null):"linux"===process.platform?e||(0===process.getuid()?"/root":t?"/home/"+t:null):e||null})}function ai(){return ni?ti:(ni=1,ti=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t};var t=(new Error).stack;return Error.prepareStackTrace=e,t[2].getFileName()})}var ci,ui,li,di,pi,hi,fi,gi,mi,_i,yi,vi={exports:{}};function bi(){if(ci)return vi.exports;ci=1;var e="win32"===process.platform,t=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,n={};n.parse=function(e){if("string"!=typeof e)throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var n,r=(n=e,t.exec(n).slice(1));if(!r||5!==r.length)throw new TypeError("Invalid path '"+e+"'");return{root:r[1],dir:r[0]===r[1]?r[0]:r[0].slice(0,-1),base:r[2],ext:r[4],name:r[3]}};var r=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,o={};return o.parse=function(e){if("string"!=typeof e)throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var t,n=(t=e,r.exec(t).slice(1));if(!n||5!==n.length)throw new TypeError("Invalid path '"+e+"'");return{root:n[1],dir:n[0].slice(0,-1),base:n[2],ext:n[4],name:n[3]}},vi.exports=e?n.parse:o.parse,vi.exports.posix=o.parse,vi.exports.win32=n.parse,vi.exports}function Ci(){if(li)return ui;li=1;var e=t,n=e.parse||bi(),r=function(t,r){var o="/";/^([A-Za-z]:)/.test(t)?o="":/^\\\\/.test(t)&&(o="\\\\");for(var s=[t],i=n(t);i.dir!==s[s.length-1];)s.push(i.dir),i=n(i.dir);return s.reduce(function(t,n){return t.concat(r.map(function(t){return e.resolve(o,n,t)}))},[])};return ui=function(e,t,n){var o=t&&t.moduleDirectory?[].concat(t.moduleDirectory):["node_modules"];if(t&&"function"==typeof t.paths)return t.paths(n,e,function(){return r(e,o)},t);var s=r(e,o);return t&&t.paths?s.concat(t.paths):s}}function Si(){return pi?di:(pi=1,di=function(e,t){return t||{}})}function Ti(){if(fi)return hi;fi=1;var e=Object.prototype.toString,t=Math.max,n=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var o=0;o<t.length;o+=1)n[o+e.length]=t[o];return n};return hi=function(r){var o=this;if("function"!=typeof o||"[object Function]"!==e.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var s,i=function(e,t){for(var n=[],r=t,o=0;r<e.length;r+=1,o+=1)n[o]=e[r];return n}(arguments,1),a=t(0,o.length-i.length),c=[],u=0;u<a;u++)c[u]="$"+u;if(s=Function("binder","return function ("+function(e,t){for(var n="",r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n}(c,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof s){var e=o.apply(this,n(i,arguments));return Object(e)===e?e:this}return o.apply(r,n(i,arguments))}),o.prototype){var l=function(){};l.prototype=o.prototype,s.prototype=new l,l.prototype=null}return s},hi}function Ii(){if(yi)return _i;yi=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=function(){if(mi)return gi;mi=1;var e=Ti();return gi=Function.prototype.bind||e}();return _i=n.call(e,t)}var Ei,wi,Ai,ki,Oi={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]};function Ri(){if(wi)return Ei;wi=1;var e=Ii();function t(e,t){for(var n=e.split("."),r=t.split(" "),o=r.length>1?r[0]:"=",s=(r.length>1?r[1]:r[0]).split("."),i=0;i<3;++i){var a=parseInt(n[i]||0,10),c=parseInt(s[i]||0,10);if(a!==c)return"<"===o?a<c:">="===o&&a>=c}return">="===o}function n(e,n){var r=n.split(/ ?&& ?/);if(0===r.length)return!1;for(var o=0;o<r.length;++o)if(!t(e,r[o]))return!1;return!0}var r=Oi;return Ei=function(t,o){return e(r,t)&&function(e,t){if("boolean"==typeof t)return t;var r=void 0===e?process.versions&&process.versions.node:e;if("string"!=typeof r)throw new TypeError(void 0===e?"Unable to determine current node version":"If provided, a valid node version is required");if(t&&"object"==typeof t){for(var o=0;o<t.length;++o)if(n(r,t[o]))return!0;return!1}return n(r,t)}(o,r[t])},Ei}function Ni(){if(ki)return Ai;ki=1;var e=s,n=ii(),r=t,o=ai(),i=Ci(),a=Si(),c=Ri(),u="win32"!==process.platform&&e.realpath&&"function"==typeof e.realpath.native?e.realpath.native:e.realpath,l=n(),d=function(t,n){e.stat(t,function(e,t){return e?"ENOENT"===e.code||"ENOTDIR"===e.code?n(null,!1):n(e):n(null,t.isFile()||t.isFIFO())})},p=function(t,n){e.stat(t,function(e,t){return e?"ENOENT"===e.code||"ENOTDIR"===e.code?n(null,!1):n(e):n(null,t.isDirectory())})},h=function(e,t){u(e,function(n,r){n&&"ENOENT"!==n.code?t(n):t(null,n?e:r)})},f=function(e,t,n,r){n&&!1===n.preserveSymlinks?e(t,r):r(null,t)},g=function(e,t,n){e(t,function(e,t){if(e)n(e);else try{var r=JSON.parse(t);n(null,r)}catch(e){n(null)}})};return Ai=function(t,n,s){var u=s,m=n;if("function"==typeof n&&(u=m,m={}),"string"!=typeof t){var _=new TypeError("Path must be a string.");return process.nextTick(function(){u(_)})}var y=(m=a(t,m)).isFile||d,v=m.isDirectory||p,b=m.readFile||e.readFile,C=m.realpath||h,S=m.readPackage||g;if(m.readFile&&m.readPackage){var T=new TypeError("`readFile` and `readPackage` are mutually exclusive.");return process.nextTick(function(){u(T)})}var I=m.packageIterator,E=m.extensions||[".js"],w=!1!==m.includeCoreModules,A=m.basedir||r.dirname(o()),k=m.filename||A;m.paths=m.paths||[r.join(l,".node_modules"),r.join(l,".node_libraries")];var O,R=r.resolve(A);function N(e,n,r){e?u(e):n?u(null,n,r):x(O,function(e,n,r){if(e)u(e);else if(n)f(C,n,m,function(e,t){e?u(e):u(null,t,r)});else{var o=new Error("Cannot find module '"+t+"' from '"+k+"'");o.code="MODULE_NOT_FOUND",u(o)}})}function L(e,t,n){var o=t,s=n;"function"==typeof o&&(s=o,o=void 0),function e(t,n,o){if(0===t.length)return s(null,void 0,o);var i=n+t[0],a=o;a?c(null,a):M(r.dirname(i),c);function c(o,c,l){if(a=c,o)return s(o);if(l&&a&&m.pathFilter){var d=r.relative(l,i),p=d.slice(0,d.length-t[0].length),h=m.pathFilter(a,n,p);if(h)return e([""].concat(E.slice()),r.resolve(l,h),a)}y(i,u)}function u(r,o){return r?s(r):o?s(null,i,a):void e(t.slice(1),n,a)}}([""].concat(E),e,o)}function M(e,t){return""===e||"/"===e||"win32"===process.platform&&/^\w:[/\\]*$/.test(e)||/[/\\]node_modules[/\\]*$/.test(e)?t(null):void f(C,e,m,function(n,o){if(n)return M(r.dirname(e),t);var s=r.join(o,"package.json");y(s,function(n,o){if(!o)return M(r.dirname(e),t);S(b,s,function(n,r){n&&t(n);var o=r;o&&m.packageFilter&&(o=m.packageFilter(o,s)),t(null,o,e)})})})}function x(e,t,n){var o=n,s=t;"function"==typeof s&&(o=s,s=m.package),f(C,e,m,function(t,n){if(t)return o(t);var i=r.join(n,"package.json");y(i,function(t,n){return t?o(t):n?void S(b,i,function(t,n){if(t)return o(t);var s=n;if(s&&m.packageFilter&&(s=m.packageFilter(s,i)),s&&s.main){if("string"!=typeof s.main){var a=new TypeError("package “"+s.name+"” `main` must be a string");return a.code="INVALID_PACKAGE_MAIN",o(a)}return"."!==s.main&&"./"!==s.main||(s.main="index"),void L(r.resolve(e,s.main),s,function(t,n,s){return t?o(t):n?o(null,n,s):s?void x(r.resolve(e,s.main),s,function(t,n,s){return t?o(t):n?o(null,n,s):void L(r.join(e,"index"),s,o)}):L(r.join(e,"index"),s,o)})}L(r.join(e,"/index"),s,o)}):L(r.join(e,"index"),s,o)})})}function D(e,t){if(0===t.length)return e(null,void 0);var n=t[0];function o(t,r,o){return t?e(t):r?e(null,r,o):void x(n,m.package,s)}function s(n,r,o){return n?e(n):r?e(null,r,o):void D(e,t.slice(1))}v(r.dirname(n),function(r,s){if(r)return e(r);if(!s)return D(e,t.slice(1));L(n,m.package,o)})}f(C,R,m,function(e,n){e?u(e):function(e){if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t))O=r.resolve(e,t),"."!==t&&".."!==t&&"/"!==t.slice(-1)||(O+="/"),/\/$/.test(t)&&O===e?x(O,m.package,N):L(O,m.package,N);else{if(w&&c(t))return u(null,t);!function(e,t,n){var o=function(){return function(e,t,n){for(var o=i(t,n,e),s=0;s<o.length;s++)o[s]=r.join(o[s],e);return o}(e,t,m)};D(n,I?I(e,t,o,m):o())}(t,e,function(e,n,r){if(e)u(e);else{if(n)return f(C,n,m,function(e,t){e?u(e):u(null,t,r)});var o=new Error("Cannot find module '"+t+"' from '"+k+"'");o.code="MODULE_NOT_FOUND",u(o)}})}}(n)})},Ai}var Li,Mi,xi,Di,Pi,Fi,Ui,Zi,ji={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":">= 23.4",_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]};function Bi(){if(Fi)return Pi;Fi=1;var e=Ri(),n=s,r=t,o=ii(),i=ai(),a=Ci(),c=Si(),u="win32"!==process.platform&&n.realpathSync&&"function"==typeof n.realpathSync.native?n.realpathSync.native:n.realpathSync,l=o(),d=function(e){try{var t=n.statSync(e,{throwIfNoEntry:!1})}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return!1;throw e}return!!t&&(t.isFile()||t.isFIFO())},p=function(e){try{var t=n.statSync(e,{throwIfNoEntry:!1})}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return!1;throw e}return!!t&&t.isDirectory()},h=function(e){try{return u(e)}catch(e){if("ENOENT"!==e.code)throw e}return e},f=function(e,t,n){return n&&!1===n.preserveSymlinks?e(t):t},g=function(e,t){var n=e(t);try{return JSON.parse(n)}catch(e){}};return Pi=function(t,o){if("string"!=typeof t)throw new TypeError("Path must be a string.");var s=c(t,o),u=s.isFile||d,m=s.readFileSync||n.readFileSync,_=s.isDirectory||p,y=s.realpathSync||h,v=s.readPackageSync||g;if(s.readFileSync&&s.readPackageSync)throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");var b=s.packageIterator,C=s.extensions||[".js"],S=!1!==s.includeCoreModules,T=s.basedir||r.dirname(i()),I=s.filename||T;s.paths=s.paths||[r.join(l,".node_modules"),r.join(l,".node_libraries")];var E=f(y,r.resolve(T),s);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)){var w=r.resolve(E,t);"."!==t&&".."!==t&&"/"!==t.slice(-1)||(w+="/");var A=R(w)||L(w);if(A)return f(y,A,s)}else{if(S&&e(t))return t;var k=function(e,t){for(var n=function(){return function(e,t,n){for(var o=a(t,n,e),s=0;s<o.length;s++)o[s]=r.join(o[s],e);return o}(e,t,s)},o=b?b(e,t,n,s):n(),i=0;i<o.length;i++){var c=o[i];if(_(r.dirname(c))){var u=R(c);if(u)return u;var l=L(c);if(l)return l}}}(t,E);if(k)return f(y,k,s)}var O=new Error("Cannot find module '"+t+"' from '"+I+"'");throw O.code="MODULE_NOT_FOUND",O;function R(e){var t=N(r.dirname(e));if(t&&t.dir&&t.pkg&&s.pathFilter){var n=r.relative(t.dir,e),o=s.pathFilter(t.pkg,e,n);o&&(e=r.resolve(t.dir,o))}if(u(e))return e;for(var i=0;i<C.length;i++){var a=e+C[i];if(u(a))return a}}function N(e){if(""!==e&&"/"!==e&&!("win32"===process.platform&&/^\w:[/\\]*$/.test(e)||/[/\\]node_modules[/\\]*$/.test(e))){var t=r.join(f(y,e,s),"package.json");if(!u(t))return N(r.dirname(e));var n=v(m,t);return n&&s.packageFilter&&(n=s.packageFilter(n,e)),{pkg:n,dir:e}}}function L(e){var t=r.join(f(y,e,s),"/package.json");if(u(t)){try{var n=v(m,t)}catch(e){}if(n&&s.packageFilter&&(n=s.packageFilter(n,e)),n&&n.main){if("string"!=typeof n.main){var o=new TypeError("package “"+n.name+"” `main` must be a string");throw o.code="INVALID_PACKAGE_MAIN",o}"."!==n.main&&"./"!==n.main||(n.main="index");try{var i=R(r.resolve(e,n.main));if(i)return i;var a=L(r.resolve(e,n.main));if(a)return a}catch(e){}}}return R(r.join(e,"/index"))}},Pi}function zi(){if(Zi)return Ui;Zi=1;var e=Ni();return e.core=function(){if(Mi)return Li;Mi=1;var e=Ri(),t=ji,n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=e(r));return Li=n}(),e.isCore=function(){if(Di)return xi;Di=1;var e=Ri();return xi=function(t){return e(t)}}(),e.sync=Bi(),Ui=e}var Vi={url:"https://github.com/nodejs/require-in-the-middle/issues"};const Hi=t,$i=r,Gi=ri("require-in-the-middle"),Wi=si;Gs.exports=ea;var qi=Gs.exports.Hook=ea;let Ki,Yi,Xi;if($i.isBuiltin)Yi=$i.isBuiltin;else if($i.builtinModules)Yi=e=>!!e.startsWith("node:")||(void 0===Ki&&(Ki=new Set($i.builtinModules)),Ki.has(e));else{const e=zi(),[t,n]=process.versions.node.split(".").map(Number);Yi=8===t&&n<8?t=>"http2"===t||!!e.core[t]:t=>!!e.core[t]}const Qi=/([/\\]index)?(\.js)?$/;class Ji{constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,t){if(this._localCache.has(e))return!0;if(t)return!1;{const t=require.cache[e];return!(!t||!(this._kRitmExports in t))}}get(e,t){const n=this._localCache.get(e);if(void 0!==n)return n;if(!t){const t=require.cache[e];return t&&t[this._kRitmExports]}}set(e,t,n){n?this._localCache.set(e,t):e in require.cache?require.cache[e][this._kRitmExports]=t:(Gi('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,t))}}function ea(e,t,n){if(this instanceof ea==!1)return new ea(e,t,n);if("function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),"function"!=typeof $i._resolveFilename)return console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof $i._resolveFilename),void console.error("Please report this error as an issue related to Node.js %s at %s",process.version,Vi.url);this._cache=new Ji,this._unhooked=!1,this._origRequire=$i.prototype.require;const r=this,o=new Set,s=!!t&&!0===t.internals,i=Array.isArray(e);function a(t,a){const c=t[0],u=Yi(c);let l,d,p;if(u){if(l=c,c.startsWith("node:")){const e=c.slice(5);Yi(e)&&(l=e)}}else{if(a)return Gi("call to process.getBuiltinModule with unknown built-in id"),r._origGetBuiltinModule.apply(this,t);try{l=$i._resolveFilename(c,this)}catch(e){return Gi('Module._resolveFilename("%s") threw %j, calling original Module.require',c,e.message),r._origRequire.apply(this,t)}}if(Gi("processing %s module require('%s'): %s",!0===u?"core":"non-core",c,l),!0===r._cache.has(l,u))return Gi("returning already patched cached module: %s",l),r._cache.get(l,u);const h=o.has(l);!1===h&&o.add(l);const f=a?r._origGetBuiltinModule.apply(this,t):r._origRequire.apply(this,t);if(!0===h)return Gi("module is in the process of being patched already - ignoring: %s",l),f;if(o.delete(l),!0===u){if(!0===i&&!1===e.includes(l))return Gi("ignoring core module not on whitelist: %s",l),f;d=l}else if(!0===i&&e.includes(l)){const e=Hi.parse(l);d=e.name,p=e.dir}else{const t=Wi(l);if(void 0===t)return Gi("could not parse filename: %s",l),f;d=t.name,p=t.basedir;const n=function(e){const t="/"!==Hi.sep?e.path.split(Hi.sep).join("/"):e.path;return Hi.posix.join(e.name,t).replace(Qi,"")}(t);Gi("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",d,c,n,p);let o=!1;if(i){if(!c.startsWith(".")&&e.includes(c)&&(d=c,o=!0),!e.includes(d)&&!e.includes(n))return f;e.includes(n)&&n!==d&&(d=n,o=!0)}if(!o){let e;try{e=function(e,t){if(!Xi)if(require.resolve&&require.resolve.paths)Xi=function(e,t){return require.resolve(e,{paths:[t]})};else{const e=zi();Xi=function(t,n){return e.sync(t,{basedir:n})}}return Xi(e,t)}(d,p)}catch(e){return Gi("could not resolve module: %s",d),r._cache.set(l,f,u),f}if(e!==l){if(!0!==s)return Gi("ignoring require of non-main module file: %s",e),r._cache.set(l,f,u),f;d=d+Hi.sep+Hi.relative(p,l),Gi("preparing to process require of internal file: %s",d)}}}r._cache.set(l,f,u),Gi("calling require hook: %s",d);const g=n(f,d,p);return r._cache.set(l,g,u),Gi("returning module: %s",d),g}Gi("registering require hook"),this._require=$i.prototype.require=function(e){return!0===r._unhooked?(Gi("ignoring require call - module is soft-unhooked"),r._origRequire.apply(this,arguments)):a.call(this,arguments,!1)},"function"==typeof process.getBuiltinModule&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(e){return!0===r._unhooked?(Gi("ignoring process.getBuiltinModule call - module is soft-unhooked"),r._origGetBuiltinModule.apply(this,arguments)):a.call(this,arguments,!0)})}ea.prototype.unhook=function(){this._unhooked=!0,this._require===$i.prototype.require?($i.prototype.require=this._origRequire,Gi("require unhook successful")):Gi("require unhook unsuccessful"),void 0!==process.getBuiltinModule&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,Gi("process.getBuiltinModule unhook successful")):Gi("process.getBuiltinModule unhook unsuccessful"))};const ta="/";class na{hooks=[];children=new Map}class ra{_trie=new na;_counter=0;insert(e){let t=this._trie;for(const n of e.moduleName.split(ta)){let e=t.children.get(n);e||(e=new na,t.children.set(n,e)),t=e}t.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:t,fullOnly:n}={}){let r=this._trie;const o=[];let s=!0;for(const t of e.split(ta)){const e=r.children.get(t);if(!e){s=!1;break}n||o.push(...e.hooks),r=e}return n&&s&&o.push(...r.hooks),0===o.length?[]:1===o.length?[o[0].hook]:(t&&o.sort((e,t)=>e.insertedId-t.insertedId),o.map(({hook:e})=>e))}}const oa=["afterEach","after","beforeEach","before","describe","it"].every(e=>"function"==typeof global[e]);class sa{_moduleNameTrie=new ra;static _instance;constructor(){this._initialize()}_initialize(){new qi(null,{internals:!0},(e,t,n)=>{const r=(o=t,d.sep!==ta?o.split(d.sep).join(ta):o);var o;const s=this._moduleNameTrie.search(r,{maintainInsertionOrder:!0,fullOnly:void 0===n});for(const{onRequire:r}of s)e=r(e,t,n);return e})}register(e,t){const n={moduleName:e,onRequire:t};return this._moduleNameTrie.insert(n),n}static getInstance(){return oa?new sa:this._instance=this._instance??new sa}}var ia={exports:{}},aa={};const ca=[],ua=new WeakMap,la=new WeakMap,da=new Map,pa=[],ha={set:(e,t,n)=>ua.get(e)[t](n),get(e,t){if(t===Symbol.toStringTag)return"Module";const n=la.get(e)[t];return"function"==typeof n?n():void 0},defineProperty(e,t,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");return ua.get(e)[t](n.value)}};let fa=!1;aa.register=function(e,t,n,r,o){da.set(e,o),ua.set(t,n),la.set(t,r);const s=new Proxy(t,ha);ca.forEach(t=>t(e,s)),pa.push([e,s])},aa.importHooks=ca,aa.specifiers=da,aa.toHook=pa,aa.getExperimentalPatchInternals=function(){return fa},aa.setExperimentalPatchInternals=function(e){fa=e};const ga=t,ma=si,{fileURLToPath:_a}=a,{MessageChannel:ya}=c,{importHooks:va,specifiers:ba,toHook:Ca,getExperimentalPatchInternals:Sa}=aa;function Ta(e){va.push(e),Ca.forEach(([t,n])=>e(t,n))}function Ia(e){const t=va.indexOf(e);t>-1&&va.splice(t,1)}function Ea(e,t,n,r){const o=e(t,n,r);o&&o!==t&&(t.default=o)}let wa;function Aa(e,t,n){if(this instanceof Aa==!1)return new Aa(e,t,n);"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null);const r=!!t&&!0===t.internals;wa&&Array.isArray(e)&&wa(e),this._iitmHook=(t,o)=>{const s=t;let i;if(t.startsWith("node:"))t=t.replace(/^node:/,"");else{if(t.startsWith("file://"))try{t=_a(t)}catch(e){}const e=ma(t);e&&(t=e.name,i=e.basedir)}if(e){for(const a of e)if(a===t){if(i)if(r)t=t+ga.sep+ga.relative(i,_a(s));else if(!Sa()&&!i.endsWith(ba.get(s)))continue;Ea(n,o,t,i)}}else Ea(n,o,t,i)},Ta(this._iitmHook)}Aa.prototype.unhook=function(){Ia(this._iitmHook)},ia.exports=Aa;var ka,Oa,Ra=ia.exports.Hook=Aa;function Na(e,t,n){let r,o;try{o=e()}catch(e){r=e}finally{return t(r,o),o}}function La(e){return"function"==typeof e&&"function"==typeof e.__original&&"function"==typeof e.__unwrap&&!0===e.__wrapped}ia.exports.addHook=Ta,ia.exports.removeHook=Ia,ia.exports.createAddHookMessageChannel=function(){const{port1:e,port2:t}=new ya;let n,r=0;return wa=t=>{r++,e.postMessage(t)},e.on("message",()=>{r--,n&&r<=0&&n()}).unref(),{registerOptions:{data:{addHookMessagePort:t,include:[]},transferList:[t]},addHookMessagePort:t,waitForAllMessagesAcknowledged:function(){const e=setInterval(()=>{},1e3),t=new Promise(e=>{n=e}).then(()=>{clearInterval(e)});return 0===r&&n(),t}}};class Ma extends js{_modules;_hooks=[];_requireInTheMiddleSingleton=sa.getInstance();_enabled=!1;constructor(e,t,n){super(e,t,n);let r=this.init();r&&!Array.isArray(r)&&(r=[r]),this._modules=r||[],this._config.enabled&&this.enable()}_wrap=(e,t,r)=>{if(La(e[t])&&this._unwrap(e,t),n.types.isProxy(e)){const n=Ps(Object.assign({},e),t,r);return Object.defineProperty(e,t,{value:n}),n}return Ps(e,t,r)};_unwrap=(e,t)=>n.types.isProxy(e)?Object.defineProperty(e,t,{value:e[t]}):Us(e,t);_massWrap=(e,t,n)=>{e?(Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{this._wrap(e,t,n)})}):Un.error("must provide one or more functions to wrap on modules")):Un.error("must provide one or more modules to patch")};_massUnwrap=(e,t)=>{e?(Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{this._unwrap(e,t)})}):Un.error("must provide one or more functions to wrap on modules")):Un.error("must provide one or more modules to patch")};_warnOnPreloadedModules(){this._modules.forEach(e=>{const{name:t}=e;try{const e=require.resolve(t);require.cache[e]&&this._diag.warn(`Module ${t} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${t}`)}catch{}})}_extractPackageVersion(e){try{const t=s.readFileSync(d.join(e,"package.json"),{encoding:"utf8"}),n=JSON.parse(t).version;return"string"==typeof n?n:void 0}catch{Un.warn("Failed extracting version",e)}}_onRequire(e,t,n,r){if(!r)return"function"==typeof e.patch&&(e.moduleExports=t,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(t)):t;const o=this._extractPackageVersion(r);if(e.moduleVersion=o,e.name===n)return xa(e.supportedVersions,o,e.includePrerelease)&&"function"==typeof e.patch&&(e.moduleExports=t,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:r}),e.patch(t,e.moduleVersion)):t;const s=e.files??[],i=d.normalize(n);return s.filter(e=>e.name===i).filter(t=>xa(t.supportedVersions,o,e.includePrerelease)).reduce((t,n)=>(n.moduleExports=t,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:n.name,baseDir:r}),n.patch(t,e.moduleVersion)):t),t)}enable(){if(!this._enabled)if(this._enabled=!0,this._hooks.length>0)for(const e of this._modules){"function"==typeof e.patch&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(const t of e.files)t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:t.name}),t.patch(t.moduleExports,e.moduleVersion))}else{this._warnOnPreloadedModules();for(const e of this._modules){const t=(t,n,r)=>{if(!r&&d.isAbsolute(n)){const e=d.parse(n);n=e.name,r=e.dir}return this._onRequire(e,t,n,r)},n=(t,n,r)=>this._onRequire(e,t,n,r),r=d.isAbsolute(e.name)?new qi([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(r);const o=new Ra([e.name],{internals:!1},t);this._hooks.push(o)}}}disable(){if(this._enabled){this._enabled=!1;for(const e of this._modules){"function"==typeof e.unpatch&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(const t of e.files)t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:t.name}),t.unpatch(t.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}}function xa(e,t,n){return void 0===t?e.includes("*"):e.some(e=>ms(t,e,{includePrerelease:n}))}function Da(e,t){let n=ka.OLD;const r=t?.split(",").map(e=>e.trim()).filter(e=>""!==e);for(const t of r??[]){if(t.toLowerCase()===e+"/dup"){n=ka.DUPLICATE;break}t.toLowerCase()===e&&(n=ka.STABLE)}return n}!function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"}(ka||(ka={})),function(e){e.DOCUMENT_LOAD="documentLoad",e.DOCUMENT_FETCH="documentFetch",e.RESOURCE_FETCH="resourceFetch"}(Oa||(Oa={}));var Pa;!function(e){e.FIRST_PAINT="firstPaint",e.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"}(Pa||(Pa={}));const Fa={"first-paint":Pa.FIRST_PAINT,"first-contentful-paint":Pa.FIRST_CONTENTFUL_PAINT};class Ua extends Ma{component="document-load";version="1";moduleName=this.component;constructor(e={}){super("@opentelemetry/instrumentation-document-load","0.48.0",e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){const t=_r.getEntriesByType?.("resource");t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){const e=Array.from(document.getElementsByTagName("meta")).find(e=>e.getAttribute("name")===Xr),t=(()=>{const e={},t=_r.getEntriesByType?.("navigation")[0];if(t)Object.values($o).forEach(n=>{if(Yo(t,n)){const r=t[n];"number"==typeof r&&(e[n]=r)}});else{const t=_r.timing;t&&Object.values($o).forEach(n=>{if(Yo(t,n)){const r=t[n];"number"==typeof r&&(e[n]=r)}})}return e})(),n=e&&e.content||"";Fn.with(Xn.extract(Dt,{traceparent:n}),()=>{const e=this._startSpan(Oa.DOCUMENT_LOAD,$o.FETCH_START,t);e&&(Fn.with(Jn.setSpan(Fn.active(),e),()=>{const e=this._startSpan(Oa.DOCUMENT_FETCH,$o.FETCH_START,t);e&&(e.setAttribute(yr,location.href),Fn.with(Jn.setSpan(Fn.active(),e),()=>{Qo(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,$o.RESPONSE_END,t)}))}),e.setAttribute(yr,location.href),e.setAttribute("http.user_agent",navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(Xo(e,$o.FETCH_START,t),Xo(e,$o.UNLOAD_EVENT_START,t),Xo(e,$o.UNLOAD_EVENT_END,t),Xo(e,$o.DOM_INTERACTIVE,t),Xo(e,$o.DOM_CONTENT_LOADED_EVENT_START,t),Xo(e,$o.DOM_CONTENT_LOADED_EVENT_END,t),Xo(e,$o.DOM_COMPLETE,t),Xo(e,$o.LOAD_EVENT_START,t),Xo(e,$o.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||(e=>{const t=_r.getEntriesByType?.("paint");t&&t.forEach(({name:t,startTime:n})=>{Yo(Fa,t)&&e.addEvent(Fa[t],n)})})(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,$o.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(Yo(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){const n=this._startSpan(Oa.RESOURCE_FETCH,$o.FETCH_START,e,t);n&&(n.setAttribute(yr,e.name),Qo(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,$o.RESPONSE_END,e))}_startSpan(e,t,n,r){if(Yo(n,t)&&"number"==typeof n[t]){return this.tracer.startSpan(e,{startTime:n[t]},r?Jn.setSpan(Fn.active(),r):void 0)}}_waitForPageLoad(){"complete"===window.document.readyState?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&Na(()=>t(e),e=>{e&&this._diag.error("addCustomAttributesOnSpan",e)})}_addCustomAttributesOnResourceSpan(e,t,n){n&&Na(()=>n(e,t),e=>{e&&this._diag.error("addCustomAttributesOnResourceSpan",e)})}enable(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener("load",this._onDocumentLoaded)}}const Za="OT_ZONE_CONTEXT";class ja{_enabled=!1;_zoneCounter=0;_activeContextFromZone(e){return e&&e.get(Za)||Dt}_bindFunction(e,t){const n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}_bindListener(e,t){const n=t;return void 0!==n.__ot_listeners||(n.__ot_listeners={},"function"==typeof n.addEventListener&&(n.addEventListener=this._patchAddEventListener(n,n.addEventListener,e)),"function"==typeof n.removeEventListener&&(n.removeEventListener=this._patchRemoveEventListener(n,n.removeEventListener))),t}_createZoneName(){this._zoneCounter++;const e=Math.random();return`${this._zoneCounter}-${e}`}_createZone(e,t){return Zone.current.fork({name:e,properties:{[Za]:t}})}_getActiveZone(){return Zone.current}_patchAddEventListener(e,t,n){const r=this;return function(o,s,i){void 0===e.__ot_listeners&&(e.__ot_listeners={});let a=e.__ot_listeners[o];void 0===a&&(a=new WeakMap,e.__ot_listeners[o]=a);const c=r.bind(n,s);return a.set(s,c),t.call(this,o,c,i)}}_patchRemoveEventListener(e,t){return function(n,r){if(void 0===e.__ot_listeners||void 0===e.__ot_listeners[n])return t.call(this,n,r);const o=e.__ot_listeners[n],s=o.get(r);return o.delete(r),t.call(this,n,s||r)}}active(){if(!this._enabled)return Dt;const e=this._getActiveZone(),t=this._activeContextFromZone(e);return t||Dt}bind(e,t){return void 0===e&&(e=this.active()),"function"==typeof t?this._bindFunction(e,t):("object"==typeof(n=t)&&null!==n&&"addEventListener"in n&&"function"==typeof n.addEventListener&&"removeEventListener"in n&&"function"==typeof n.removeEventListener&&this._bindListener(e,t),t);var n}disable(){return this._enabled=!1,this}enable(){return this._enabled=!0,this}with(e,t,n,...r){const o=this._createZoneName();return this._createZone(o,e).run(t,n,r)}}
15
+ ***************************************************************************** */function Me(e,t,n,r){return new(n||(n=Promise))(function(t,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function i(e){try{a(r.throw(e))}catch(e){o(e)}}function a(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n(function(e){e(r)})).then(s,i)}a((r=r.apply(e,[])).next())})}for(var xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",De="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Pe=0;Pe<64;Pe++)De[xe.charCodeAt(Pe)]=Pe;const Fe=new Map;const Ue=(e,t,n)=>{if(!e||!Be(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=Fe.get(e);return n||(n=new Map,Fe.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function Ze(e,t,n){if(e instanceof Array)return e.map(e=>Ze(e,t,n));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=xe[n[t]>>2],o+=xe[(3&n[t])<<4|n[t+1]>>4],o+=xe[(15&n[t+1])<<2|n[t+2]>>6],o+=xe[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Ze(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Ze(e.data,t,n),e.width,e.height]}}if(Be(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Ue(e,t,n)}}return e}const je=(e,t,n)=>[...e].map(e=>Ze(e,t,n)),Be=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function ze(e,t,n){const r=[];try{const o=H(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(r,...o){return W(this,t,n,!0)||"__context"in this||(this.__context=r),e.apply(this,[r,...o])}});r.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(e=>e())}}function Ve(e,t,n,r,o,s,i){const a=[],c=Object.getOwnPropertyNames(e);for(const s of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))try{if("function"!=typeof e[s])continue;const c=H(e,s,function(e){return function(...a){const c=e.apply(this,a);if(Ue(c,i,this),!W(this.canvas,r,o,!0)){const e=je([...a],i,this),r={type:t,property:s,args:e};n(this.canvas,r)}return c}});a.push(c)}catch(r){const o=V(e,s,{set(e){n(this.canvas,{type:t,property:s,args:[e],setter:!0})}});a.push(o)}return a}var He=null;try{var $e="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");He=$e.Worker}catch(e){}function Ge(e,t,n){var r=function(e){return Buffer.from(e,"base64").toString("utf8")}(e),o=r.indexOf("\n",10)+1,s=r.substring(o)+"";return function(e){return new He(s,Object.assign({},e,{eval:!0}))}}function We(e,t,n){var r=function(e){return atob(e)}(e),o=r.indexOf("\n",10)+1,s=r.substring(o)+"",i=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(i)}var qe="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var Ke,Ye=(Ke="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",qe?Ge(Ke):function(e){var t;return function(n){return t=t||We(e),new Worker(t,n)}}(Ke));class Xe{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:r,blockSelector:o,recordCanvas:s,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(n,r,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,o){const s=ze(t,n,r),i=new Map,a=new Ye;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:s}=e.data;this.mutationCb({id:t,type:oe["2D"],commands:[{property:"clearRect",args:[0,0,o,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const c=1e3/e;let u,l=0;const d=e=>{l&&e-l<c||(l=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{W(t,n,r,!0)||e.push(t)}),e})().forEach(e=>Me(this,0,void 0,function*(){var t;const n=this.mirror.getId(e);if(i.get(n))return;if(i.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))}const r=yield createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[r])}))),u=requestAnimationFrame(d)};u=requestAnimationFrame(d),this.resetObservers=()=>{s(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=ze(e,t,n),o=function(e,t,n,r){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const s=H(t.CanvasRenderingContext2D.prototype,i,function(o){return function(...s){return W(this.canvas,n,r,!0)||setTimeout(()=>{const n=je([...s],t,this);e(this.canvas,{type:oe["2D"],property:i,args:n})},0),o.apply(this,s)}});o.push(s)}catch(n){const r=V(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:oe["2D"],property:i,args:[t],setter:!0})}});o.push(r)}return()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),s=function(e,t,n,r){const o=[];return o.push(...Ve(t.WebGLRenderingContext.prototype,oe.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&o.push(...Ve(t.WebGL2RenderingContext.prototype,oe.WebGL2,e,n,r,0,t)),()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{r(),o(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["type"]);return t}),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class Qe{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new ee,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);r.push({styleId:e,rules:n.map((e,t)=>({rule:g(e),index:t}))})}n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function Je(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let et,tt,nt,rt=!1;const ot=new m;function st(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:i="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:l,maskInputOptions:d,slimDOMOptions:p,maskInputFn:h,maskTextFn:f,hooks:g,packFn:_,sampling:y={},dataURLOptions:v={},mousemoveWait:b,recordCanvas:C=!1,recordCrossOriginIframes:S=!1,userTriggeredOnInput:T=!1,collectFonts:I=!1,inlineImages:E=!1,plugins:w,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:k=new Set([])}=e,O=!S||window.parent===window;let R=!1;if(!O)try{window.parent.document,R=!1}catch(e){R=!0}if(O&&!t)throw new Error("emit function is required");void 0!==b&&void 0===y.mousemove&&(y.mousemove=b),ot.reset();const N=!0===l?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==d?d:{password:!0},L=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p}:p||{};let M;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let x=0;const D=e=>{for(const t of w||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&(e=_(e)),e};et=(e,o)=>{var s;if(!(null===(s=fe[0])||void 0===s?void 0:s.isFrozen())||e.type===te.FullSnapshot||e.type===te.IncrementalSnapshot&&e.data.source===ne.Mutation||fe.forEach(e=>e.unfreeze()),O)null==t||t(D(e),o);else if(R){const t={type:"rrweb",event:D(e),isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===te.FullSnapshot)M=e,x=0;else if(e.type===te.IncrementalSnapshot){if(e.data.source===ne.Mutation&&e.data.isAttachIframe)return;x++;const t=r&&x>=r,o=n&&e.timestamp-M.timestamp>n;(t||o)&&tt(!0)}};const P=e=>{et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.Mutation},e)}))},F=e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.Scroll},e)})),j=e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.CanvasMutation},e)})),B=new Qe({mutationCb:P,adoptedStyleSheetCb:e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.AdoptedStyleSheet},e)}))}),z=new Ne({mirror:ot,mutationCb:P,stylesheetManager:B,recordCrossOriginIframes:S,wrappedEmit:et});for(const e of w||[])e.getMirror&&e.getMirror({nodeMirror:ot,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});nt=new Xe({recordCanvas:C,mutationCb:j,win:window,blockClass:o,blockSelector:s,mirror:ot,sampling:y.canvas,dataURLOptions:v});const V=new Le({mutationCb:P,scrollCb:F,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:N,dataURLOptions:v,maskTextFn:f,maskInputFn:h,recordCanvas:C,inlineImages:E,sampling:y,slimDOMOptions:L,iframeManager:z,stylesheetManager:B,canvasManager:nt,keepIframeSrcFn:A},mirror:ot});tt=(e=!1)=>{var t,n,r,i,l,d;et(Je({type:te.Meta,data:{href:window.location.href,width:G(),height:$()}}),e),B.reset(),fe.forEach(e=>e.lock());const p=function(e,t){var n=t||{},r=n.mirror,o=void 0===r?new m:r,s=n.blockClass,i=void 0===s?"rr-block":s,a=n.blockSelector,c=void 0===a?null:a,u=n.maskTextClass,l=void 0===u?"rr-mask":u,d=n.maskTextSelector,p=void 0===d?null:d,h=n.inlineStylesheet,f=void 0===h||h,g=n.inlineImages,_=void 0!==g&&g,y=n.recordCanvas,v=void 0!==y&&y,b=n.maskAllInputs,C=void 0!==b&&b,S=n.maskTextFn,T=n.maskInputFn,I=n.slimDOM,E=void 0!==I&&I,w=n.dataURLOptions,A=n.preserveWhiteSpace,k=n.onSerialize,O=n.onIframeLoad,R=n.iframeLoadTimeout,N=n.onStylesheetLoad,L=n.stylesheetLoadTimeout,M=n.keepIframeSrcFn;return U(e,{doc:e,mirror:o,blockClass:i,blockSelector:c,maskTextClass:l,maskTextSelector:p,skipChild:!1,inlineStylesheet:f,maskInputOptions:!0===C?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===C?{password:!0}:C,maskTextFn:S,maskInputFn:T,slimDOMOptions:!0===E||"all"===E?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===E,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===E?{}:E,dataURLOptions:w,inlineImages:_,recordCanvas:v,preserveWhiteSpace:A,onSerialize:k,onIframeLoad:O,iframeLoadTimeout:R,onStylesheetLoad:N,stylesheetLoadTimeout:L,keepIframeSrcFn:void 0===M?function(){return!1}:M,newlyAddedElement:!1})}(document,{mirror:ot,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:N,maskTextFn:f,slimDOM:L,dataURLOptions:v,recordCanvas:C,inlineImages:E,onSerialize:e=>{X(e,ot)&&z.addIframe(e),Q(e,ot)&&B.trackLinkElement(e),J(e)&&V.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{z.attachIframe(e,t),V.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{B.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!p)return console.warn("Failed to snapshot the document");et(Je({type:te.FullSnapshot,data:{node:p,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(l=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===l?void 0:l.scrollTop)||(null===(d=null===document||void 0===document?void 0:document.body)||void 0===d?void 0:d.scrollTop)||0}}})),fe.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&B.adoptStyleSheets(document.adoptedStyleSheets,ot.getId(document))};try{const e=[];e.push(Z("DOMContentLoaded",()=>{et(Je({type:te.DomContentLoaded,data:{}}))}));const t=e=>{var t;return Oe({mutationCb:P,mousemoveCb:(e,t)=>et(Je({type:te.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.MouseInteraction},e)})),scrollCb:F,viewportResizeCb:e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.ViewportResize},e)})),inputCb:e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.Input},e)})),mediaInteractionCb:e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.MediaInteraction},e)})),styleSheetRuleCb:e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.StyleSheetRule},e)})),styleDeclarationCb:e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.StyleDeclaration},e)})),canvasMutationCb:j,fontCb:e=>et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.Font},e)})),selectionCb:e=>{et(Je({type:te.IncrementalSnapshot,data:Object.assign({source:ne.Selection},e)}))},blockClass:o,ignoreClass:i,maskTextClass:a,maskTextSelector:c,maskInputOptions:N,inlineStylesheet:u,sampling:y,recordCanvas:C,inlineImages:E,userTriggeredOnInput:T,collectFonts:I,doc:e,maskInputFn:h,maskTextFn:f,keepIframeSrcFn:A,blockSelector:s,slimDOMOptions:L,dataURLOptions:v,mirror:ot,iframeManager:z,stylesheetManager:B,shadowDomManager:V,canvasManager:nt,ignoreCSSAttributes:k,plugins:(null===(t=null==w?void 0:w.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>et(Je({type:te.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},g)};z.addLoadListener(n=>{e.push(t(n.contentDocument))});const n=()=>{tt(),e.push(t(document)),rt=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(Z("load",()=>{et(Je({type:te.Load,data:{}})),n()},window)),()=>{e.forEach(e=>e()),rt=!1}}catch(e){console.warn(e)}}st.addCustomEvent=(e,t)=>{if(!rt)throw new Error("please add custom event after start recording");et(Je({type:te.Custom,data:{tag:e,payload:t}}))},st.freezePage=()=>{fe.forEach(e=>e.freeze())},st.takeFullSnapshot=e=>{if(!rt)throw new Error("please take full snapshot after start recording");tt(e)},st.mirror=ot;class it{constructor(e,t){this.events=[],this.sessionId=t,this.config=e,this.save=this.save.bind(this),this.events=[],this.configure=this.configure.bind(this),window.addEventListener("unload",()=>this.save())}configure(){st({emit:e=>{this.events.push(e)}}),setInterval(this.save,15e3)}save(){if(0===this.events.length)return;let{replayEventsBaseUrl:e,projectId:t}=this.config;e=e?`${e}/rrweb/${t}`:`https://app.apitoolkit.io/rrweb/${t}`;const n=this.events;this.events=[];const r=JSON.stringify({events:n,sessionId:this.sessionId,timestamp:(new Date).toISOString()});fetch(e,{mode:"no-cors",method:"POST",headers:{"Content-Type":"application/json"},body:r}).catch(e=>{console.error("Failed to save replay events:",e),this.events=[...n,...this.events]})}}var at="object"==typeof globalThis?globalThis:global,ct="1.9.0",ut=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var lt=function(e){var t=new Set([e]),n=new Set,r=e.match(ut);if(!r)return function(){return!1};var o=+r[1],s=+r[2],i=+r[3];if(null!=r[4])return function(t){return t===e};function a(e){return n.add(e),!1}function c(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;var r=e.match(ut);if(!r)return a(e);var u=+r[1],l=+r[2],d=+r[3];return null!=r[4]||o!==u?a(e):0===o?s===l&&i<=d?c(e):a(e):s<=l?c(e):a(e)}}(ct),dt=ct.split(".")[0],pt=Symbol.for("opentelemetry.js.api."+dt),ht=at;function ft(e,t,n,r){var o;void 0===r&&(r=!1);var s=ht[pt]=null!==(o=ht[pt])&&void 0!==o?o:{version:ct};if(!r&&s[e]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(i.stack||i.message),!1}if(s.version!==ct){i=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+e+" does not match previously registered API v"+ct);return n.error(i.stack||i.message),!1}return s[e]=t,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+ct+"."),!0}function gt(e){var t,n,r=null===(t=ht[pt])||void 0===t?void 0:t.version;if(r&&lt(r))return null===(n=ht[pt])||void 0===n?void 0:n[e]}function mt(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+ct+".");var n=ht[pt];n&&delete n[e]}var _t,yt=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},vt=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},bt=function(){function e(e){this._namespace=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ct("debug",this._namespace,e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ct("error",this._namespace,e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ct("info",this._namespace,e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ct("warn",this._namespace,e)},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ct("verbose",this._namespace,e)},e}();function Ct(e,t,n){var r=gt("diag");if(r)return n.unshift(t),r[e].apply(r,vt([],yt(n),!1))}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(_t||(_t={}));var St=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},Tt=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},It=function(){function e(){function e(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=gt("diag");if(r)return r[e].apply(r,Tt([],St(t),!1))}}var t=this;t.setLogger=function(e,n){var r,o,s;if(void 0===n&&(n={logLevel:_t.INFO}),e===t){var i=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(r=i.stack)&&void 0!==r?r:i.message),!1}"number"==typeof n&&(n={logLevel:n});var a=gt("diag"),c=function(e,t){function n(n,r){var o=t[n];return"function"==typeof o&&e>=r?o.bind(t):function(){}}return e<_t.NONE?e=_t.NONE:e>_t.ALL&&(e=_t.ALL),t=t||{},{error:n("error",_t.ERROR),warn:n("warn",_t.WARN),info:n("info",_t.INFO),debug:n("debug",_t.DEBUG),verbose:n("verbose",_t.VERBOSE)}}(null!==(o=n.logLevel)&&void 0!==o?o:_t.INFO,e);if(a&&!n.suppressOverrideMessage){var u=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+u),c.warn("Current logger will overwrite one already registered from "+u)}return ft("diag",c,t,!0)},t.disable=function(){mt("diag",t)},t.createComponentLogger=function(e){return new bt(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}(),Et=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},wt=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},At=function(){function e(e){this._entries=e?new Map(e):new Map}return e.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=Et(e,2);return[t[0],t[1]]})},e.prototype.setEntry=function(t,n){var r=new e(this._entries);return r._entries.set(t,n),r},e.prototype.removeEntry=function(t){var n=new e(this._entries);return n._entries.delete(t),n},e.prototype.removeEntries=function(){for(var t,n,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var s=new e(this._entries);try{for(var i=wt(r),a=i.next();!a.done;a=i.next()){var c=a.value;s._entries.delete(c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return s},e.prototype.clear=function(){return new e},e}(),kt=Symbol("BaggageEntryMetadata"),Ot=It.instance();function Rt(e){return void 0===e&&(e={}),new At(new Map(Object.entries(e)))}function Nt(e){return Symbol.for(e)}var Lt,Mt,xt=function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(e){return n._currentContext.get(e)},n.setValue=function(t,r){var o=new e(n._currentContext);return o._currentContext.set(t,r),o},n.deleteValue=function(t){var r=new e(n._currentContext);return r._currentContext.delete(t),r}},Dt=new xt,Pt=(Lt=function(e,t){return Lt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Lt(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Lt(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Ft=function(){function e(){}return e.prototype.createGauge=function(e,t){return Kt},e.prototype.createHistogram=function(e,t){return Yt},e.prototype.createCounter=function(e,t){return qt},e.prototype.createUpDownCounter=function(e,t){return Xt},e.prototype.createObservableGauge=function(e,t){return Jt},e.prototype.createObservableCounter=function(e,t){return Qt},e.prototype.createObservableUpDownCounter=function(e,t){return en},e.prototype.addBatchObservableCallback=function(e,t){},e.prototype.removeBatchObservableCallback=function(e){},e}(),Ut=function(){},Zt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Pt(t,e),t.prototype.add=function(e,t){},t}(Ut),jt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Pt(t,e),t.prototype.add=function(e,t){},t}(Ut),Bt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Pt(t,e),t.prototype.record=function(e,t){},t}(Ut),zt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Pt(t,e),t.prototype.record=function(e,t){},t}(Ut),Vt=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e}(),Ht=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Pt(t,e),t}(Vt),$t=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Pt(t,e),t}(Vt),Gt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Pt(t,e),t}(Vt),Wt=new Ft,qt=new Zt,Kt=new Bt,Yt=new zt,Xt=new jt,Qt=new Ht,Jt=new $t,en=new Gt,tn={get:function(e,t){if(null!=e)return e[t]},keys:function(e){return null==e?[]:Object.keys(e)}},nn={set:function(e,t,n){null!=e&&(e[t]=n)}},rn=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},on=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},sn=function(){function e(){}return e.prototype.active=function(){return Dt},e.prototype.with=function(e,t,n){for(var r=[],o=3;o<arguments.length;o++)r[o-3]=arguments[o];return t.call.apply(t,on([n],rn(r),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),an=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},cn=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},un="context",ln=new sn,dn=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return ft(un,e,It.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,n){for(var r,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];return(r=this._getContextManager()).with.apply(r,cn([e,t,n],an(o),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return gt(un)||ln},e.prototype.disable=function(){this._getContextManager().disable(),mt(un,It.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(Mt||(Mt={}));var pn="0000000000000000",hn="00000000000000000000000000000000",fn={traceId:hn,spanId:pn,traceFlags:Mt.NONE},gn=function(){function e(e){void 0===e&&(e=fn),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),mn=Nt("OpenTelemetry Context Key SPAN");function _n(e){return e.getValue(mn)||void 0}function yn(){return _n(dn.getInstance().active())}function vn(e,t){return e.setValue(mn,t)}function bn(e){return e.deleteValue(mn)}function Cn(e,t){return vn(e,new gn(t))}function Sn(e){var t;return null===(t=_n(e))||void 0===t?void 0:t.spanContext()}var Tn=/^([0-9a-f]{32})$/i,In=/^[0-9a-f]{16}$/i;function En(e){return Tn.test(e)&&e!==hn}function wn(e){return En(e.traceId)&&(t=e.spanId,In.test(t)&&t!==pn);var t}function An(e){return new gn(e)}var kn=dn.getInstance(),On=function(){function e(){}return e.prototype.startSpan=function(e,t,n){if(void 0===n&&(n=kn.active()),Boolean(null==t?void 0:t.root))return new gn;var r,o=n&&Sn(n);return"object"==typeof(r=o)&&"string"==typeof r.spanId&&"string"==typeof r.traceId&&"number"==typeof r.traceFlags&&wn(o)?new gn(o):new gn},e.prototype.startActiveSpan=function(e,t,n,r){var o,s,i;if(!(arguments.length<2)){2===arguments.length?i=t:3===arguments.length?(o=t,i=n):(o=t,s=n,i=r);var a=null!=s?s:kn.active(),c=this.startSpan(e,o,a),u=vn(a,c);return kn.with(u,i,void 0,c)}},e}();var Rn,Nn,Ln,Mn=new On,xn=function(){function e(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}return e.prototype.startSpan=function(e,t,n){return this._getTracer().startSpan(e,t,n)},e.prototype.startActiveSpan=function(e,t,n,r){var o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Mn},e}(),Dn=new(function(){function e(){}return e.prototype.getTracer=function(e,t,n){return new On},e}()),Pn=function(){function e(){}return e.prototype.getTracer=function(e,t,n){var r;return null!==(r=this.getDelegateTracer(e,t,n))&&void 0!==r?r:new xn(this,e,t,n)},e.prototype.getDelegate=function(){var e;return null!==(e=this._delegate)&&void 0!==e?e:Dn},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getTracer(e,t,n)},e}();!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(Rn||(Rn={})),function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"}(Nn||(Nn={})),function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}(Ln||(Ln={}));var Fn=dn.getInstance(),Un=It.instance(),Zn=new(function(){function e(){}return e.prototype.getMeter=function(e,t,n){return Wt},e}()),jn="metrics",Bn=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalMeterProvider=function(e){return ft(jn,e,It.instance())},e.prototype.getMeterProvider=function(){return gt(jn)||Zn},e.prototype.getMeter=function(e,t,n){return this.getMeterProvider().getMeter(e,t,n)},e.prototype.disable=function(){mt(jn,It.instance())},e}().getInstance(),zn=function(){function e(){}return e.prototype.inject=function(e,t){},e.prototype.extract=function(e,t){return e},e.prototype.fields=function(){return[]},e}(),Vn=Nt("OpenTelemetry Baggage Key");function Hn(e){return e.getValue(Vn)||void 0}function $n(){return Hn(dn.getInstance().active())}function Gn(e,t){return e.setValue(Vn,t)}function Wn(e){return e.deleteValue(Vn)}var qn="propagation",Kn=new zn,Yn=function(){function e(){this.createBaggage=Rt,this.getBaggage=Hn,this.getActiveBaggage=$n,this.setBaggage=Gn,this.deleteBaggage=Wn}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(e){return ft(qn,e,It.instance())},e.prototype.inject=function(e,t,n){return void 0===n&&(n=nn),this._getGlobalPropagator().inject(e,t,n)},e.prototype.extract=function(e,t,n){return void 0===n&&(n=tn),this._getGlobalPropagator().extract(e,t,n)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){mt(qn,It.instance())},e.prototype._getGlobalPropagator=function(){return gt(qn)||Kn},e}(),Xn=Yn.getInstance(),Qn="trace",Jn=function(){function e(){this._proxyTracerProvider=new Pn,this.wrapSpanContext=An,this.isSpanContextValid=wn,this.deleteSpan=bn,this.getSpan=_n,this.getActiveSpan=yn,this.getSpanContext=Sn,this.setSpan=vn,this.setSpanContext=Cn}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=ft(Qn,this._proxyTracerProvider,It.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return gt(Qn)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){mt(Qn,It.instance()),this._proxyTracerProvider=new Pn},e}().getInstance();const er=Nt("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function tr(e){return!0===e.getValue(er)}const nr=",",rr="baggage";function or(e){const t=e.split(";");if(t.length<=0)return;const n=t.shift();if(!n)return;const r=n.indexOf("=");if(r<=0)return;const o=decodeURIComponent(n.substring(0,r).trim()),s=decodeURIComponent(n.substring(r+1).trim());let i;var a;return t.length>0&&("string"!=typeof(a=t.join(";"))&&(Ot.error("Cannot create baggage metadata from unknown type: "+typeof a),a=""),i={__TYPE__:kt,toString:function(){return a}}),{key:o,value:s,metadata:i}}function sr(e){const t={};return"string"==typeof e&&e.length>0&&e.split(nr).forEach(e=>{const n=or(e);void 0!==n&&n.value.length>0&&(t[n.key]=n.value)}),t}class ir{inject(e,t,n){const r=Xn.getBaggage(e);if(!r||tr(e))return;const o=function(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return void 0!==t.metadata&&(n+=";"+t.metadata.toString()),n})}(r).filter(e=>e.length<=4096).slice(0,180),s=function(e){return e.reduce((e,t)=>{const n=`${e}${""!==e?nr:""}${t}`;return n.length>8192?e:n},"")}(o);s.length>0&&n.set(t,rr,s)}extract(e,t,n){const r=n.get(t,rr),o=Array.isArray(r)?r.join(nr):r;if(!o)return e;const s={};if(0===o.length)return e;return o.split(nr).forEach(e=>{const t=or(e);if(t){const e={value:t.value};t.metadata&&(e.metadata=t.metadata),s[t.key]=e}}),0===Object.entries(s).length?e:Xn.setBaggage(e,Xn.createBaggage(s))}fields(){return[rr]}}function ar(e){const t={};if("object"!=typeof e||null==e)return t;for(const[n,r]of Object.entries(e))cr(n)?ur(r)?Array.isArray(r)?t[n]=r.slice():t[n]=r:Un.warn(`Invalid attribute value set for key: ${n}`):Un.warn(`Invalid attribute key: ${n}`);return t}function cr(e){return"string"==typeof e&&e.length>0}function ur(e){return null==e||(Array.isArray(e)?function(e){let t;for(const n of e)if(null!=n){if(!t){if(lr(n)){t=typeof n;continue}return!1}if(typeof n!==t)return!1}return!0}(e):lr(e))}function lr(e){switch(typeof e){case"number":case"boolean":case"string":return!0}return!1}let dr=e=>{Un.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){const t={};let n=e;for(;null!==n;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;const r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}(e))}(e))};function pr(e){try{dr(e)}catch{}}function hr(e){const t=process.env[e];if(null==t||""===t.trim())return;const r=Number(t);if(!isNaN(r))return r;Un.warn(`Unknown value ${n.inspect(t)} for ${e}, expected a number, using defaults`)}function fr(e){const t=process.env[e];if(null!=t&&""!==t.trim())return t}function gr(e){return fr(e)?.split(",").map(e=>e.trim()).filter(e=>""!==e)}const mr="object"==typeof globalThis?globalThis:global,_r=e.performance,yr="http.url",vr="error.type",br="exception.message",Cr="exception.type",Sr="http.request.method",Tr="http.request.method_original",Ir="http.response.status_code",Er="server.address",wr="server.port",Ar="service.name",kr="telemetry.sdk.language",Or="telemetry.sdk.name",Rr="telemetry.sdk.version",Nr="url.full",Lr="process.runtime.name",Mr={[Or]:"opentelemetry",[Lr]:"node",[kr]:"nodejs",[Rr]:"2.0.1"};const xr=Math.pow(10,6),Dr=Math.pow(10,9);function Pr(e){const t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*xr)]}function Fr(){let e=_r.timeOrigin;if("number"!=typeof e){const t=_r;e=t.timing&&t.timing.fetchStart}return e}function Ur(e){return Vr(Pr(Fr()),Pr("number"==typeof e?e:_r.now()))}function Zr(e){if(Br(e))return e;if("number"==typeof e)return e<Fr()?Ur(e):Pr(e);if(e instanceof Date)return Pr(e.getTime());throw TypeError("Invalid input type")}function jr(e){return e[0]*Dr+e[1]}function Br(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function zr(e){return Br(e)||"number"==typeof e||e instanceof Date}function Vr(e,t){const n=[e[0]+t[0],e[1]+t[1]];return n[1]>=Dr&&(n[1]-=Dr,n[0]+=1),n}var Hr;!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(Hr||(Hr={}));class $r{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(e=>"function"==typeof e.fields?e.fields():[]).reduce((e,t)=>e.concat(t),[])))}inject(e,t,n){for(const r of this._propagators)try{r.inject(e,t,n)}catch(e){Un.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){Un.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}const Gr="[_0-9a-z-*/]",Wr=new RegExp(`^(?:${`[a-z]${Gr}{0,255}`}|${`[a-z0-9]${Gr}{0,240}@[a-z]${Gr}{0,13}`})$`),qr=/^[ -~]{0,255}[!-~]$/,Kr=/,|=/;class Yr{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,t){const n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){const t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+"="+this.get(t)),e),[]).join(",")}_parse(e){e.length>512||(this._internalState=e.split(",").reverse().reduce((e,t)=>{const n=t.trim(),r=n.indexOf("=");if(-1!==r){const o=n.slice(0,r),s=n.slice(r+1,t.length);(function(e){return Wr.test(e)})(o)&&function(e){return qr.test(e)&&!Kr.test(e)}(s)&&e.set(o,s)}return e},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new Yr;return e._internalState=new Map(this._internalState),e}}const Xr="traceparent",Qr="tracestate",Jr=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");class eo{inject(e,t,n){const r=Jn.getSpanContext(e);if(!r||tr(e)||!wn(r))return;const o=`00-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||Mt.NONE).toString(16)}`;n.set(t,Xr,o),r.traceState&&n.set(t,Qr,r.traceState.serialize())}extract(e,t,n){const r=n.get(t,Xr);if(!r)return e;const o=Array.isArray(r)?r[0]:r;if("string"!=typeof o)return e;const s=function(e){const t=Jr.exec(e);return t?"00"===t[1]&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}:null}(o);if(!s)return e;s.isRemote=!0;const i=n.get(t,Qr);if(i){const e=Array.isArray(i)?i.join(","):i;s.traceState=new Yr("string"==typeof e?e:void 0)}return Jn.setSpanContext(e,s)}fields(){return[Xr,Qr]}}const to="[object Null]",no="[object Undefined]",ro=Function.prototype.toString,oo=ro.call(Object),so=Object.getPrototypeOf,io=Object.prototype,ao=io.hasOwnProperty,co=Symbol?Symbol.toStringTag:void 0,uo=io.toString;function lo(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!==function(e){if(null==e)return void 0===e?no:to;return co&&co in Object(e)?function(e){const t=ao.call(e,co),n=e[co];let r=!1;try{e[co]=void 0,r=!0}catch(e){}const o=uo.call(e);r&&(t?e[co]=n:delete e[co]);return o}(e):function(e){return uo.call(e)}(e)}(e))return!1;const t=so(e);if(null===t)return!0;const n=ao.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ro.call(n)===oo}function po(e){return go(e)?e.slice():e}function ho(e,t,n=0,r){let o;if(!(n>20)){if(n++,yo(e)||yo(t)||mo(t))o=po(t);else if(go(e)){if(o=e.slice(),go(t))for(let e=0,n=t.length;e<n;e++)o.push(po(t[e]));else if(_o(t)){const e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){const r=e[n];o[r]=po(t[r])}}}else if(_o(e))if(_o(t)){if(!function(e,t){if(!lo(e)||!lo(t))return!1;return!0}(e,t))return t;o=Object.assign({},e);const s=Object.keys(t);for(let i=0,a=s.length;i<a;i++){const a=s[i],c=t[a];if(yo(c))void 0===c?delete o[a]:o[a]=c;else{const s=o[a],i=c;if(fo(e,a,r)||fo(t,a,r))delete o[a];else{if(_o(s)&&_o(i)){const n=r.get(s)||[],o=r.get(i)||[];n.push({obj:e,key:a}),o.push({obj:t,key:a}),r.set(s,n),r.set(i,o)}o[a]=ho(o[a],c,n,r)}}}}else o=t;return o}}function fo(e,t,n){const r=n.get(e[t])||[];for(let n=0,o=r.length;n<o;n++){const o=r[n];if(o.key===t&&o.obj===e)return!0}return!1}function go(e){return Array.isArray(e)}function mo(e){return"function"==typeof e}function _o(e){return!yo(e)&&!go(e)&&!mo(e)&&"object"==typeof e}function yo(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}function vo(e,t){return"string"==typeof t?e===t:!!e.match(t)}function bo(e,t){if(!t)return!1;for(const n of t)if(vo(e,n))return!0;return!1}class Co{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class So{_callback;_that;_isCalled=!1;_deferred=new Co;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}const To=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class Io{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const t=new Io({});return t._rawAttributes=wo(e),t._asyncAttributesPending=e.filter(([e,t])=>To(t)).length>0,t}constructor(e){const t=e.attributes??{};this._rawAttributes=Object.entries(t).map(([e,t])=>(To(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=wo(this._rawAttributes)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){const[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,To(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Un.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[t,n]of this._rawAttributes)To(n)?Un.debug(`Unsettled resource attribute ${t} skipped`):null!=n&&(e[t]??=n);return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}merge(e){return null==e?this:Io.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function Eo(e){return Io.FromAttributeList(Object.entries(e))}function wo(e){return e.map(([e,t])=>To(t)?[e,t.catch(t=>{Un.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,t])}class Ao{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:Ln.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){const t=Date.now();this._spanContext=e.spanContext,this._performanceStartTime=_r.now(),this._performanceOffset=t-(this._performanceStartTime+Fr()),this._startTimeProvided=null!=e.startTime,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,this.links=e.links||[],this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,null!=e.attributes&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(null==t||this._isSpanEnded())return this;if(0===e.length)return Un.warn(`Invalid attribute key: ${e}`),this;if(!ur(t))return Un.warn(`Invalid attribute value set for key: ${e}`),this;const{attributeCountLimit:n}=this._spanLimits;return void 0!==n&&Object.keys(this.attributes).length>=n&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this)}setAttributes(e){for(const[t,n]of Object.entries(e))this.setAttribute(t,n);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;const{eventCountLimit:r}=this._spanLimits;if(0===r)return Un.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==r&&this.events.length>=r&&(0===this._droppedEventsCount&&Un.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),zr(t)&&(zr(n)||(n=t),t=void 0);const o=ar(t);return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()||(this.status={...e},null!=this.status.message&&"string"!=typeof e.message&&(Un.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message)),this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){this._isSpanEnded()?Un.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`):(this._ended=!0,this.endTime=this._getTime(e),this._duration=function(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=Dr),[n,r]}(this.startTime,this.endTime),this._duration[0]<0&&(Un.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&&Un.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this))}_getTime(e){if("number"==typeof e&&e<=_r.now())return Ur(e+this._performanceOffset);if("number"==typeof e)return Pr(e);if(e instanceof Date)return Pr(e.getTime());if(Br(e))return e;if(this._startTimeProvided)return Pr(Date.now());const t=_r.now()-this._performanceStartTime;return Vr(this.startTime,Pr(t))}isRecording(){return!1===this._ended}recordException(e,t){const n={};"string"==typeof e?n[br]=e:e&&(e.code?n[Cr]=e.code.toString():e.name&&(n[Cr]=e.name),e.message&&(n[br]=e.message),e.stack&&(n["exception.stacktrace"]=e.stack)),n[Cr]||n[br]?this.addEvent("exception",n,t):Un.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){const e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);Un.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){const t=this._attributeValueLengthLimit;return t<=0?(Un.warn(`Attribute value limit must be positive, got ${t}`),e):"string"==typeof e?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>"string"==typeof e?this._truncateToLimitUtil(e,t):e):e}}var ko;!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(ko||(ko={}));class Oo{shouldSample(){return{decision:ko.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class Ro{shouldSample(){return{decision:ko.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class No{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(pr(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Ro),this._remoteParentSampled=e.remoteParentSampled??new Ro,this._remoteParentNotSampled=e.remoteParentNotSampled??new Oo,this._localParentSampled=e.localParentSampled??new Ro,this._localParentNotSampled=e.localParentNotSampled??new Oo}shouldSample(e,t,n,r,o,s){const i=Jn.getSpanContext(e);return i&&wn(i)?i.isRemote?i.traceFlags&Mt.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,o,s):this._remoteParentNotSampled.shouldSample(e,t,n,r,o,s):i.traceFlags&Mt.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,o,s):this._localParentNotSampled.shouldSample(e,t,n,r,o,s):this._root.shouldSample(e,t,n,r,o,s)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class Lo{_ratio;_upperBound;constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(4294967295*this._ratio)}shouldSample(e,t){return{decision:En(t)&&this._accumulate(t)<this._upperBound?ko.RECORD_AND_SAMPLED:ko.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return"number"!=typeof e||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){const r=8*n;t=(t^parseInt(e.slice(r,r+8),16))>>>0}return t}}function Mo(){return{sampler:xo(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:hr("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:hr("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:hr("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:hr("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:hr("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:hr("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:hr("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:hr("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}function xo(){const e=fr("OTEL_TRACES_SAMPLER")??"parentbased_always_on";switch(e){case"always_on":return new Ro;case"always_off":return new Oo;case"parentbased_always_on":return new No({root:new Ro});case"parentbased_always_off":return new No({root:new Oo});case"traceidratio":return new Lo(Do());case"parentbased_traceidratio":return new No({root:new Lo(Do())});default:return Un.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "parentbased_always_on".`),new No({root:new Ro})}}function Do(){const e=hr("OTEL_TRACES_SAMPLER_ARG");return null==e?(Un.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1):e<0||e>1?(Un.error(`OTEL_TRACES_SAMPLER_ARG=${e} was given, but it is out of range ([0..1]), defaulting to 1.`),1):e}const Po=1/0;class Fo{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,t){this._exporter=e,this._maxExportBatchSize="number"==typeof t?.maxExportBatchSize?t.maxExportBatchSize:hr("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize="number"==typeof t?.maxQueueSize?t.maxQueueSize:hr("OTEL_BSP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis="number"==typeof t?.scheduledDelayMillis?t.scheduledDelayMillis:hr("OTEL_BSP_SCHEDULE_DELAY")??5e3,this._exportTimeoutMillis="number"==typeof t?.exportTimeoutMillis?t.exportTimeoutMillis:hr("OTEL_BSP_EXPORT_TIMEOUT")??3e4,this._shutdownOnce=new So(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Un.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||0!==(e.spanContext().traceFlags&Mt.SAMPLED)&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize)return 0===this._droppedSpansCount&&Un.debug("maxQueueSize reached, dropping spans"),void this._droppedSpansCount++;this._droppedSpansCount>0&&(Un.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{const n=[];for(let e=0,t=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),0===this._finishedSpans.length?Promise.resolve():new Promise((e,t)=>{const n=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);Fn.with(function(e){return e.setValue(er,!0)}(Fn.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);const o=()=>this._exporter.export(r,r=>{clearTimeout(n),r.code===Hr.SUCCESS?e():t(r.error??new Error("BatchSpanProcessor: span export failed"))});let s=null;for(let e=0,t=r.length;e<t;e++){const t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(s??=[],s.push(t.resource.waitForAsyncAttributes()))}null===s?o():Promise.all(s).then(o,e=>{pr(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;const e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,pr(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),this._timer.unref())}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}class Uo extends Fo{onShutdown(){}}class Zo{generateTraceId=Bo(16);generateSpanId=Bo(8)}const jo=Buffer.allocUnsafe(16);function Bo(e){return function(){for(let t=0;t<e/4;t++)jo.writeUInt32BE(Math.random()*2**32>>>0,4*t);for(let t=0;t<e&&!(jo[t]>0);t++)t===e-1&&(jo[e-1]=1);return jo.toString("hex",0,e)}}class zo{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,t,n,r){const o=function(e){const t={sampler:xo()},n=Mo(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}(t);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=t.idGenerator||new Zo,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e}startSpan(e,t={},n=Fn.active()){t.root&&(n=Jn.deleteSpan(n));const r=Jn.getSpan(n);if(tr(n)){Un.debug("Instrumentation suppressed, returning Noop Span");return Jn.wrapSpanContext(fn)}const o=r?.spanContext(),s=this._idGenerator.generateSpanId();let i,a,c;o&&Jn.isSpanContextValid(o)?(a=o.traceId,c=o.traceState,i=o):a=this._idGenerator.generateTraceId();const u=t.kind??Nn.INTERNAL,l=(t.links??[]).map(e=>({context:e.context,attributes:ar(e.attributes)})),d=ar(t.attributes),p=this._sampler.shouldSample(n,a,e,u,d,l);c=p.traceState??c;const h={traceId:a,spanId:s,traceFlags:p.decision===Rn.RECORD_AND_SAMPLED?Mt.SAMPLED:Mt.NONE,traceState:c};if(p.decision===Rn.NOT_RECORD){Un.debug("Recording is off, propagating context in a non-recording span");return Jn.wrapSpanContext(h)}const f=ar(Object.assign(d,p.attributes));return new Ao({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:h,name:e,kind:u,links:l,parentSpanContext:i,attributes:f,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(e,t,n,r){let o,s,i;if(arguments.length<2)return;2===arguments.length?i=t:3===arguments.length?(o=t,i=n):(o=t,s=n,i=r);const a=s??Fn.active(),c=this.startSpan(e,o,a),u=Jn.setSpan(a,c);return Fn.with(u,i,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class Vo{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){const e=[];for(const t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{pr(e||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(const n of this._spanProcessors)n.onStart(e,t)}onEnd(e){for(const t of this._spanProcessors)t.onEnd(e)}shutdown(){const e=[];for(const t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}}var Ho,$o;!function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"}(Ho||(Ho={}));class Go{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const t=function(...e){let t=e.shift();const n=new WeakMap;for(;e.length>0;)t=ho(t,e.shift(),0,n);return t}({},Mo(),function(e){const t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??hr("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??hr("OTEL_ATTRIBUTE_COUNT_LIMIT")??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??hr("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??hr("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??Po,Object.assign({},e,{spanLimits:t})}(e));this._resource=t.resource??Eo({[Ar]:`unknown_service:${process.argv0}`,[kr]:Mr[kr],[Or]:Mr[Or],[Rr]:Mr[Rr]}),this._config=Object.assign({},t,{resource:this._resource});const n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new Vo(n)}getTracer(e,t,n){const r=`${e}@${t||""}:${n?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new zo({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){const e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r;const o=setTimeout(()=>{n(new Error(`Span processor did not completed within timeout period of ${e} ms`)),r=Ho.timeout},e);t.forceFlush().then(()=>{clearTimeout(o),r!==Ho.timeout&&(r=Ho.resolved,n(r))}).catch(e=>{clearTimeout(o),r=Ho.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{const r=t.filter(e=>e!==Ho.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class Wo{_enabled=!1;_currentContext=Dt;_bindFunction(e=Dt,t){const n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return void 0===e&&(e=this.active()),"function"==typeof t?this._bindFunction(e,t):t}disable(){return this._currentContext=Dt,this._enabled=!1,this}enable(){return this._enabled||(this._enabled=!0,this._currentContext=Dt),this}with(e,t,n,...r){const o=this._currentContext;this._currentContext=e||Dt;try{return t.call(n,...r)}finally{this._currentContext=o}}}class qo extends Go{constructor(e={}){super(e)}register(e={}){var t;Jn.setGlobalTracerProvider(this),null!==(t=e.propagator)&&(void 0!==t?Xn.setGlobalPropagator(t):Xn.setGlobalPropagator(new $r({propagators:[new eo,new ir]}))),function(e){if(null!==e){if(void 0===e){const e=new Wo;return e.enable(),void Fn.setGlobalContextManager(e)}e.enable(),Fn.setGlobalContextManager(e)}}(e.contextManager)}}!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"}($o||($o={}));let Ko;function Yo(e,t){return t in e}function Xo(e,t,n,r=!0){if(Yo(n,t)&&"number"==typeof n[t]&&(!r||0!==n[t]))return e.addEvent(t,n[t])}function Qo(e,t,n=!1,r,o){if(void 0===r&&(r=0!==t[$o.START_TIME]),n||(Xo(e,$o.FETCH_START,t,r),Xo(e,$o.DOMAIN_LOOKUP_START,t,r),Xo(e,$o.DOMAIN_LOOKUP_END,t,r),Xo(e,$o.CONNECT_START,t,r),Xo(e,$o.SECURE_CONNECTION_START,t,r),Xo(e,$o.CONNECT_END,t,r),Xo(e,$o.REQUEST_START,t,r),Xo(e,$o.RESPONSE_START,t,r),Xo(e,$o.RESPONSE_END,t,r)),!o){const n=t[$o.ENCODED_BODY_SIZE];void 0!==n&&e.setAttribute("http.response_content_length",n);const r=t[$o.DECODED_BODY_SIZE];void 0!==r&&n!==r&&e.setAttribute("http.response_content_length_uncompressed",r)}}function Jo(){return"undefined"!=typeof location?location.origin:void 0}function es(e,t,n,r,o=new WeakSet,s){const i=ts(e),a=function(e,t,n,r,o,s){const i=jr(t),a=jr(n);let c=r.filter(t=>{const n=jr(Zr(t[$o.FETCH_START])),r=jr(Zr(t[$o.RESPONSE_END]));return t.initiatorType.toLowerCase()===(s||"xmlhttprequest")&&t.name===e&&n>=i&&r<=a});c.length>0&&(c=c.filter(e=>!o.has(e)));return c}(e=i.toString(),t,n,r,o,s);if(0===a.length)return{mainRequest:void 0};if(1===a.length)return{mainRequest:a[0]};const c=function(e){return e.slice().sort((e,t)=>{const n=e[$o.FETCH_START],r=t[$o.FETCH_START];return n>r?1:n<r?-1:0})}(a);if(i.origin!==Jo()&&c.length>1){let e=c[0],t=function(e,t,n){const r=jr(n),o=jr(Zr(t));let s,i=e[1];const a=e.length;for(let t=1;t<a;t++){const n=e[t],a=jr(Zr(n[$o.FETCH_START])),c=r-jr(Zr(n[$o.RESPONSE_END]));a>=o&&(!s||c<s)&&(s=c,i=n)}return i}(c,e[$o.RESPONSE_END],n);const r=e[$o.RESPONSE_END];return t[$o.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}return{mainRequest:a[0]}}function ts(e){if("function"==typeof URL)return new URL(e,"undefined"!=typeof document?document.baseURI:"undefined"!=typeof location?location.href:void 0);const t=(Ko||(Ko=document.createElement("a")),Ko);return t.href=e,t}function ns(e,t){let n=t||[];("string"==typeof n||n instanceof RegExp)&&(n=[n]);return ts(e).origin===Jo()||n.some(t=>vo(e,t))}class rs{emit(e){}}const os=new rs;const ss=new class{getLogger(e,t,n){return new rs}};class is{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;const e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):os}}class as{getLogger(e,t,n){var r;return null!==(r=this.getDelegateLogger(e,t,n))&&void 0!==r?r:new is(this,e,t,n)}getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:ss}setDelegate(e){this._delegate=e}getDelegateLogger(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getLogger(e,t,n)}}const cs="object"==typeof globalThis?globalThis:global,us=Symbol.for("io.opentelemetry.js.api.logs"),ls=cs;class ds{constructor(){this._proxyLoggerProvider=new as}static getInstance(){return this._instance||(this._instance=new ds),this._instance}setGlobalLoggerProvider(e){return ls[us]?this.getLoggerProvider():(ls[us]=(t=1,n=e,r=ss,e=>e===t?n:r),this._proxyLoggerProvider.setDelegate(e),e);var t,n,r}getLoggerProvider(){var e,t;return null!==(t=null===(e=ls[us])||void 0===e?void 0:e.call(ls,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete ls[us],this._proxyLoggerProvider=new as}}const ps=ds.getInstance();const hs=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,fs=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,gs={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function ms(e,t,n){if(!function(e){return"string"==typeof e&&hs.test(e)}(e))return Un.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");const r=function(e){const t=e.match(hs);if(!t)return void Un.error(`Invalid version: ${e}`);const n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}(e);if(!r)return!1;const o=[],s=_s(r,t,o,n);return s&&!n?.includePrerelease?function(e,t){if(e.prerelease)return t.some(t=>t.prerelease&&t.version===e.version);return!0}(r,o):s}function _s(e,t,n,r){if(t.includes("||")){const o=t.trim().split("||");for(const t of o)if(ys(e,t,n,r))return!0;return!1}if(t.includes(" - "))t=function(e,t){const n=Ns;return e.replace(n,(e,n,r,o,s,i,a,c,u,l,d,p)=>`${n=vs(r)?"":vs(o)?`>=${r}.0.0${t?.includePrerelease?"-0":""}`:vs(s)?`>=${r}.${o}.0${t?.includePrerelease?"-0":""}`:i?`>=${n}`:`>=${n}${t?.includePrerelease?"-0":""}`} ${c=vs(u)?"":vs(l)?`<${+u+1}.0.0-0`:vs(d)?`<${u}.${+l+1}.0-0`:p?`<=${u}.${l}.${d}-${p}`:t?.includePrerelease?`<${u}.${l}.${+d+1}-0`:`<=${c}`}`.trim())}(t,r);else if(t.includes(" ")){const o=t.trim().replace(/\s{2,}/g," ").split(" ");for(const t of o)if(!ys(e,t,n,r))return!1;return!0}return ys(e,t,n,r)}function ys(e,t,n,r){if(t=function(e,t){return e=e.trim(),e=function(e,t){const n=Ms,r=t?.includePrerelease?"-0":"";return e.replace(n,(e,t,n,o,s)=>{let i;return i=vs(t)?"":vs(n)?`>=${t}.0.0${r} <${+t+1}.0.0-0`:vs(o)?"0"===t?`>=${t}.${n}.0${r} <${t}.${+n+1}.0-0`:`>=${t}.${n}.0${r} <${+t+1}.0.0-0`:s?"0"===t?"0"===n?`>=${t}.${n}.${o}-${s} <${t}.${n}.${+o+1}-0`:`>=${t}.${n}.${o}-${s} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${o}-${s} <${+t+1}.0.0-0`:"0"===t?"0"===n?`>=${t}.${n}.${o}${r} <${t}.${n}.${+o+1}-0`:`>=${t}.${n}.${o}${r} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${o} <${+t+1}.0.0-0`,i})}(e,t),e=function(e){const t=Ls;return e.replace(t,(e,t,n,r,o)=>{let s;return s=vs(t)?"":vs(n)?`>=${t}.0.0 <${+t+1}.0.0-0`:vs(r)?`>=${t}.${n}.0 <${t}.${+n+1}.0-0`:o?`>=${t}.${n}.${r}-${o} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${r} <${t}.${+n+1}.0-0`,s})}(e),e=function(e,t){const n=Rs;return e.replace(n,(e,n,r,o,s,i)=>{const a=vs(r),c=a||vs(o),u=c||vs(s),l=u;return"="===n&&l&&(n=""),i=t?.includePrerelease?"-0":"",a?e=">"===n||"<"===n?"<0.0.0-0":"*":n&&l?(c&&(o=0),s=0,">"===n?(n=">=",c?(r=+r+1,o=0,s=0):(o=+o+1,s=0)):"<="===n&&(n="<",c?r=+r+1:o=+o+1),"<"===n&&(i="-0"),e=`${n+r}.${o}.${s}${i}`):c?e=`>=${r}.0.0${i} <${+r+1}.0.0-0`:u&&(e=`>=${r}.${o}.0${i} <${r}.${+o+1}.0-0`),e})}(e,t),e=e.trim(),e}(t,r),t.includes(" "))return _s(e,t,n,r);{const r=function(e){if(!e)return{};const t=e.match(fs);if(!t)return Un.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op;const r=t.groups.version,o=t.groups.prerelease,s=t.groups.build,i=r.split("."),a=o?.split(".");"=="===n&&(n="=");return{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}(t);return n.push(r),function(e,t){if(t.invalid)return!1;if(!t.version||bs(t.version))return!0;let n=Ts(e.versionSegments||[],t.versionSegments||[]);if(0===n){const r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];n=r.length||o.length?!r.length&&o.length?1:r.length&&!o.length?-1:Ts(r,o):0}return gs[t.op]?.includes(n)}(e,r)}}function vs(e){return!e||"x"===e.toLowerCase()||"*"===e}function bs(e){return"*"===e||"x"===e||"X"===e}function Cs(e){const t=parseInt(e,10);return isNaN(t)?e:t}function Ss(e,t){if(bs(e)||bs(t))return 0;const[n,r]=function(e,t){if(typeof e==typeof t){if("number"==typeof e)return[e,t];if("string"==typeof e)return[e,t];throw new Error("Version segments can only be strings or numbers")}return[String(e),String(t)]}(Cs(e),Cs(t));return n>r?1:n<r?-1:0}function Ts(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){const r=Ss(e[n]||"0",t[n]||"0");if(0!==r)return r}return 0}const Is="[a-zA-Z0-9-]",Es="0|[1-9]\\d*",ws=`(?:${Es}|${`\\d*[a-zA-Z-]${Is}*`})`,As=`${Is}+`,ks=`${Es}|x|X|\\*`,Os=`[v=\\s]*(${ks})(?:\\.(${ks})(?:\\.(${ks})(?:${`(?:-(${ws}(?:\\.${ws})*))`})?${`(?:\\+(${As}(?:\\.${As})*))`}?)?)?`,Rs=new RegExp(`^((?:<|>)?=?)\\s*${Os}$`),Ns=new RegExp(`^\\s*(${Os})\\s+-\\s+(${Os})\\s*$`),Ls=new RegExp(`^(?:~>?)${Os}$`),Ms=new RegExp(`^(?:\\^)${Os}$`);let xs=console.error.bind(console);function Ds(e,t,n){const r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}const Ps=(e,t,n)=>{if(!e||!e[t])return void xs("no original function "+String(t)+" to wrap");if(!n)return xs("no wrapper function"),void xs((new Error).stack);const r=e[t];if("function"!=typeof r||"function"!=typeof n)return void xs("original object and wrapper must be functions");const o=n(r,t);return Ds(o,"__original",r),Ds(o,"__unwrap",()=>{e[t]===o&&Ds(e,t,r)}),Ds(o,"__wrapped",!0),Ds(e,t,o),o},Fs=(e,t,n)=>{if(!e)return xs("must provide one or more modules to patch"),void xs((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{Ps(e,t,n)})}):xs("must provide one or more functions to wrap on modules")},Us=(e,t)=>{if(!e||!e[t])return xs("no function to unwrap."),void xs((new Error).stack);const n=e[t];n.__unwrap?n.__unwrap():xs("no original to unwrap to -- has "+String(t)+" already been unwrapped?")},Zs=(e,t)=>{if(!e)return xs("must provide one or more modules to patch"),void xs((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{Us(e,t)})}):xs("must provide one or more functions to unwrap on modules")};class js{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=Un.createComponentLogger({namespace:e}),this._tracer=Jn.getTracer(e,t),this._meter=Bn.getMeter(e,t),this._logger=ps.getLogger(e,t),this._updateMetricInstruments()}_wrap=Ps;_unwrap=Us;_massWrap=Fs;_massUnwrap=Zs;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},e)}}}var Bs,zs,Vs,Hs,$s,Gs={exports:{}},Ws={exports:{}},qs={exports:{}};function Ks(){if(zs)return Bs;zs=1;var e=1e3,t=60*e,n=60*t,r=24*n,o=7*r,s=365.25*r;function i(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}return Bs=function(a,c){c=c||{};var u=typeof a;if("string"===u&&a.length>0)return function(i){if((i=String(i)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*s;case"weeks":case"week":case"w":return c*o;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(a);if("number"===u&&isFinite(a))return c.long?function(o){var s=Math.abs(o);if(s>=r)return i(o,s,r,"day");if(s>=n)return i(o,s,n,"hour");if(s>=t)return i(o,s,t,"minute");if(s>=e)return i(o,s,e,"second");return o+" ms"}(a):function(o){var s=Math.abs(o);if(s>=r)return Math.round(o/r)+"d";if(s>=n)return Math.round(o/n)+"h";if(s>=t)return Math.round(o/t)+"m";if(s>=e)return Math.round(o/e)+"s";return o+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))}}function Ys(){if(Hs)return Vs;return Hs=1,Vs=function(e){function t(e){let r,o,s,i=null;function a(...e){if(!a.enabled)return;const n=a,o=Number(new Date),s=o-(r||o);n.diff=s,n.prev=r,n.curr=o,r=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,o)=>{if("%%"===r)return"%";i++;const s=t.formatters[o];if("function"==typeof s){const t=e[i];r=s.call(n,t),e.splice(i,1),i--}return r}),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(o!==t.namespaces&&(o=t.namespaces,s=t.enabled(e)),s),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e,t){let n=0,r=0,o=-1,s=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||"*"===t[r]))"*"===t[r]?(o=r,s=n,r++):(n++,r++);else{if(-1===o)return!1;r=o+1,s++,n=s}for(;r<t.length&&"*"===t[r];)r++;return r===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(r(e,n))return!1;for(const n of t.names)if(r(e,n))return!0;return!1},t.humanize=Ks(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},Vs}var Xs,Qs={exports:{}};"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Ws.exports=($s||($s=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))}),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Ys()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(qs,qs.exports)),qs.exports):Ws.exports=(Xs||(Xs=1,function(e,t){const r=o,s=n;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(s.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:o}=this;if(o){const t=this.color,o="[3"+(t<8?t:"8;5;"+t),s=` ${o};1m${r} `;n[0]=s+n[0].split("\n").join("\n"+s),n.push(o+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):r.isatty(process.stderr.fd)},t.destroy=s.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=require("supports-color");e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e},{}),e.exports=Ys()(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts)}}(Qs,Qs.exports)),Qs.exports);var Js,ei,ti,ni,ri=Ws.exports,oi=t.sep,si=function(e){var t=e.split(oi),n=t.lastIndexOf("node_modules");if(-1!==n&&t[n+1]){for(var r="@"===t[n+1][0],o=r?t[n+1]+"/"+t[n+2]:t[n+1],s=r?3:2,i="",a=n+s-1,c=0;c<=a;c++)i+=c===a?t[c]:t[c]+oi;for(var u="",l=t.length-1,d=n+s;d<=l;d++)u+=d===l?t[d]:t[d]+oi;return{name:o,basedir:i,path:u}}};function ii(){return ei?Js:(ei=1,Js=i.homedir||function(){var e=process.env.HOME,t=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return"win32"===process.platform?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:"darwin"===process.platform?e||(t?"/Users/"+t:null):"linux"===process.platform?e||(0===process.getuid()?"/root":t?"/home/"+t:null):e||null})}function ai(){return ni?ti:(ni=1,ti=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t};var t=(new Error).stack;return Error.prepareStackTrace=e,t[2].getFileName()})}var ci,ui,li,di,pi,hi,fi,gi,mi,_i,yi,vi={exports:{}};function bi(){if(ci)return vi.exports;ci=1;var e="win32"===process.platform,t=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,n={};n.parse=function(e){if("string"!=typeof e)throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var n,r=(n=e,t.exec(n).slice(1));if(!r||5!==r.length)throw new TypeError("Invalid path '"+e+"'");return{root:r[1],dir:r[0]===r[1]?r[0]:r[0].slice(0,-1),base:r[2],ext:r[4],name:r[3]}};var r=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,o={};return o.parse=function(e){if("string"!=typeof e)throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var t,n=(t=e,r.exec(t).slice(1));if(!n||5!==n.length)throw new TypeError("Invalid path '"+e+"'");return{root:n[1],dir:n[0].slice(0,-1),base:n[2],ext:n[4],name:n[3]}},vi.exports=e?n.parse:o.parse,vi.exports.posix=o.parse,vi.exports.win32=n.parse,vi.exports}function Ci(){if(li)return ui;li=1;var e=t,n=e.parse||bi(),r=function(t,r){var o="/";/^([A-Za-z]:)/.test(t)?o="":/^\\\\/.test(t)&&(o="\\\\");for(var s=[t],i=n(t);i.dir!==s[s.length-1];)s.push(i.dir),i=n(i.dir);return s.reduce(function(t,n){return t.concat(r.map(function(t){return e.resolve(o,n,t)}))},[])};return ui=function(e,t,n){var o=t&&t.moduleDirectory?[].concat(t.moduleDirectory):["node_modules"];if(t&&"function"==typeof t.paths)return t.paths(n,e,function(){return r(e,o)},t);var s=r(e,o);return t&&t.paths?s.concat(t.paths):s}}function Si(){return pi?di:(pi=1,di=function(e,t){return t||{}})}function Ti(){if(fi)return hi;fi=1;var e=Object.prototype.toString,t=Math.max,n=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var o=0;o<t.length;o+=1)n[o+e.length]=t[o];return n};return hi=function(r){var o=this;if("function"!=typeof o||"[object Function]"!==e.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var s,i=function(e,t){for(var n=[],r=t,o=0;r<e.length;r+=1,o+=1)n[o]=e[r];return n}(arguments,1),a=t(0,o.length-i.length),c=[],u=0;u<a;u++)c[u]="$"+u;if(s=Function("binder","return function ("+function(e,t){for(var n="",r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n}(c,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof s){var e=o.apply(this,n(i,arguments));return Object(e)===e?e:this}return o.apply(r,n(i,arguments))}),o.prototype){var l=function(){};l.prototype=o.prototype,s.prototype=new l,l.prototype=null}return s},hi}function Ii(){if(yi)return _i;yi=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=function(){if(mi)return gi;mi=1;var e=Ti();return gi=Function.prototype.bind||e}();return _i=n.call(e,t)}var Ei,wi,Ai,ki,Oi={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]};function Ri(){if(wi)return Ei;wi=1;var e=Ii();function t(e,t){for(var n=e.split("."),r=t.split(" "),o=r.length>1?r[0]:"=",s=(r.length>1?r[1]:r[0]).split("."),i=0;i<3;++i){var a=parseInt(n[i]||0,10),c=parseInt(s[i]||0,10);if(a!==c)return"<"===o?a<c:">="===o&&a>=c}return">="===o}function n(e,n){var r=n.split(/ ?&& ?/);if(0===r.length)return!1;for(var o=0;o<r.length;++o)if(!t(e,r[o]))return!1;return!0}var r=Oi;return Ei=function(t,o){return e(r,t)&&function(e,t){if("boolean"==typeof t)return t;var r=void 0===e?process.versions&&process.versions.node:e;if("string"!=typeof r)throw new TypeError(void 0===e?"Unable to determine current node version":"If provided, a valid node version is required");if(t&&"object"==typeof t){for(var o=0;o<t.length;++o)if(n(r,t[o]))return!0;return!1}return n(r,t)}(o,r[t])},Ei}function Ni(){if(ki)return Ai;ki=1;var e=s,n=ii(),r=t,o=ai(),i=Ci(),a=Si(),c=Ri(),u="win32"!==process.platform&&e.realpath&&"function"==typeof e.realpath.native?e.realpath.native:e.realpath,l=n(),d=function(t,n){e.stat(t,function(e,t){return e?"ENOENT"===e.code||"ENOTDIR"===e.code?n(null,!1):n(e):n(null,t.isFile()||t.isFIFO())})},p=function(t,n){e.stat(t,function(e,t){return e?"ENOENT"===e.code||"ENOTDIR"===e.code?n(null,!1):n(e):n(null,t.isDirectory())})},h=function(e,t){u(e,function(n,r){n&&"ENOENT"!==n.code?t(n):t(null,n?e:r)})},f=function(e,t,n,r){n&&!1===n.preserveSymlinks?e(t,r):r(null,t)},g=function(e,t,n){e(t,function(e,t){if(e)n(e);else try{var r=JSON.parse(t);n(null,r)}catch(e){n(null)}})};return Ai=function(t,n,s){var u=s,m=n;if("function"==typeof n&&(u=m,m={}),"string"!=typeof t){var _=new TypeError("Path must be a string.");return process.nextTick(function(){u(_)})}var y=(m=a(t,m)).isFile||d,v=m.isDirectory||p,b=m.readFile||e.readFile,C=m.realpath||h,S=m.readPackage||g;if(m.readFile&&m.readPackage){var T=new TypeError("`readFile` and `readPackage` are mutually exclusive.");return process.nextTick(function(){u(T)})}var I=m.packageIterator,E=m.extensions||[".js"],w=!1!==m.includeCoreModules,A=m.basedir||r.dirname(o()),k=m.filename||A;m.paths=m.paths||[r.join(l,".node_modules"),r.join(l,".node_libraries")];var O,R=r.resolve(A);function N(e,n,r){e?u(e):n?u(null,n,r):x(O,function(e,n,r){if(e)u(e);else if(n)f(C,n,m,function(e,t){e?u(e):u(null,t,r)});else{var o=new Error("Cannot find module '"+t+"' from '"+k+"'");o.code="MODULE_NOT_FOUND",u(o)}})}function L(e,t,n){var o=t,s=n;"function"==typeof o&&(s=o,o=void 0),function e(t,n,o){if(0===t.length)return s(null,void 0,o);var i=n+t[0],a=o;a?c(null,a):M(r.dirname(i),c);function c(o,c,l){if(a=c,o)return s(o);if(l&&a&&m.pathFilter){var d=r.relative(l,i),p=d.slice(0,d.length-t[0].length),h=m.pathFilter(a,n,p);if(h)return e([""].concat(E.slice()),r.resolve(l,h),a)}y(i,u)}function u(r,o){return r?s(r):o?s(null,i,a):void e(t.slice(1),n,a)}}([""].concat(E),e,o)}function M(e,t){return""===e||"/"===e||"win32"===process.platform&&/^\w:[/\\]*$/.test(e)||/[/\\]node_modules[/\\]*$/.test(e)?t(null):void f(C,e,m,function(n,o){if(n)return M(r.dirname(e),t);var s=r.join(o,"package.json");y(s,function(n,o){if(!o)return M(r.dirname(e),t);S(b,s,function(n,r){n&&t(n);var o=r;o&&m.packageFilter&&(o=m.packageFilter(o,s)),t(null,o,e)})})})}function x(e,t,n){var o=n,s=t;"function"==typeof s&&(o=s,s=m.package),f(C,e,m,function(t,n){if(t)return o(t);var i=r.join(n,"package.json");y(i,function(t,n){return t?o(t):n?void S(b,i,function(t,n){if(t)return o(t);var s=n;if(s&&m.packageFilter&&(s=m.packageFilter(s,i)),s&&s.main){if("string"!=typeof s.main){var a=new TypeError("package “"+s.name+"” `main` must be a string");return a.code="INVALID_PACKAGE_MAIN",o(a)}return"."!==s.main&&"./"!==s.main||(s.main="index"),void L(r.resolve(e,s.main),s,function(t,n,s){return t?o(t):n?o(null,n,s):s?void x(r.resolve(e,s.main),s,function(t,n,s){return t?o(t):n?o(null,n,s):void L(r.join(e,"index"),s,o)}):L(r.join(e,"index"),s,o)})}L(r.join(e,"/index"),s,o)}):L(r.join(e,"index"),s,o)})})}function D(e,t){if(0===t.length)return e(null,void 0);var n=t[0];function o(t,r,o){return t?e(t):r?e(null,r,o):void x(n,m.package,s)}function s(n,r,o){return n?e(n):r?e(null,r,o):void D(e,t.slice(1))}v(r.dirname(n),function(r,s){if(r)return e(r);if(!s)return D(e,t.slice(1));L(n,m.package,o)})}f(C,R,m,function(e,n){e?u(e):function(e){if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t))O=r.resolve(e,t),"."!==t&&".."!==t&&"/"!==t.slice(-1)||(O+="/"),/\/$/.test(t)&&O===e?x(O,m.package,N):L(O,m.package,N);else{if(w&&c(t))return u(null,t);!function(e,t,n){var o=function(){return function(e,t,n){for(var o=i(t,n,e),s=0;s<o.length;s++)o[s]=r.join(o[s],e);return o}(e,t,m)};D(n,I?I(e,t,o,m):o())}(t,e,function(e,n,r){if(e)u(e);else{if(n)return f(C,n,m,function(e,t){e?u(e):u(null,t,r)});var o=new Error("Cannot find module '"+t+"' from '"+k+"'");o.code="MODULE_NOT_FOUND",u(o)}})}}(n)})},Ai}var Li,Mi,xi,Di,Pi,Fi,Ui,Zi,ji={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":">= 23.4",_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]};function Bi(){if(Fi)return Pi;Fi=1;var e=Ri(),n=s,r=t,o=ii(),i=ai(),a=Ci(),c=Si(),u="win32"!==process.platform&&n.realpathSync&&"function"==typeof n.realpathSync.native?n.realpathSync.native:n.realpathSync,l=o(),d=function(e){try{var t=n.statSync(e,{throwIfNoEntry:!1})}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return!1;throw e}return!!t&&(t.isFile()||t.isFIFO())},p=function(e){try{var t=n.statSync(e,{throwIfNoEntry:!1})}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return!1;throw e}return!!t&&t.isDirectory()},h=function(e){try{return u(e)}catch(e){if("ENOENT"!==e.code)throw e}return e},f=function(e,t,n){return n&&!1===n.preserveSymlinks?e(t):t},g=function(e,t){var n=e(t);try{return JSON.parse(n)}catch(e){}};return Pi=function(t,o){if("string"!=typeof t)throw new TypeError("Path must be a string.");var s=c(t,o),u=s.isFile||d,m=s.readFileSync||n.readFileSync,_=s.isDirectory||p,y=s.realpathSync||h,v=s.readPackageSync||g;if(s.readFileSync&&s.readPackageSync)throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");var b=s.packageIterator,C=s.extensions||[".js"],S=!1!==s.includeCoreModules,T=s.basedir||r.dirname(i()),I=s.filename||T;s.paths=s.paths||[r.join(l,".node_modules"),r.join(l,".node_libraries")];var E=f(y,r.resolve(T),s);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)){var w=r.resolve(E,t);"."!==t&&".."!==t&&"/"!==t.slice(-1)||(w+="/");var A=R(w)||L(w);if(A)return f(y,A,s)}else{if(S&&e(t))return t;var k=function(e,t){for(var n=function(){return function(e,t,n){for(var o=a(t,n,e),s=0;s<o.length;s++)o[s]=r.join(o[s],e);return o}(e,t,s)},o=b?b(e,t,n,s):n(),i=0;i<o.length;i++){var c=o[i];if(_(r.dirname(c))){var u=R(c);if(u)return u;var l=L(c);if(l)return l}}}(t,E);if(k)return f(y,k,s)}var O=new Error("Cannot find module '"+t+"' from '"+I+"'");throw O.code="MODULE_NOT_FOUND",O;function R(e){var t=N(r.dirname(e));if(t&&t.dir&&t.pkg&&s.pathFilter){var n=r.relative(t.dir,e),o=s.pathFilter(t.pkg,e,n);o&&(e=r.resolve(t.dir,o))}if(u(e))return e;for(var i=0;i<C.length;i++){var a=e+C[i];if(u(a))return a}}function N(e){if(""!==e&&"/"!==e&&!("win32"===process.platform&&/^\w:[/\\]*$/.test(e)||/[/\\]node_modules[/\\]*$/.test(e))){var t=r.join(f(y,e,s),"package.json");if(!u(t))return N(r.dirname(e));var n=v(m,t);return n&&s.packageFilter&&(n=s.packageFilter(n,e)),{pkg:n,dir:e}}}function L(e){var t=r.join(f(y,e,s),"/package.json");if(u(t)){try{var n=v(m,t)}catch(e){}if(n&&s.packageFilter&&(n=s.packageFilter(n,e)),n&&n.main){if("string"!=typeof n.main){var o=new TypeError("package “"+n.name+"” `main` must be a string");throw o.code="INVALID_PACKAGE_MAIN",o}"."!==n.main&&"./"!==n.main||(n.main="index");try{var i=R(r.resolve(e,n.main));if(i)return i;var a=L(r.resolve(e,n.main));if(a)return a}catch(e){}}}return R(r.join(e,"/index"))}},Pi}function zi(){if(Zi)return Ui;Zi=1;var e=Ni();return e.core=function(){if(Mi)return Li;Mi=1;var e=Ri(),t=ji,n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=e(r));return Li=n}(),e.isCore=function(){if(Di)return xi;Di=1;var e=Ri();return xi=function(t){return e(t)}}(),e.sync=Bi(),Ui=e}var Vi={url:"https://github.com/nodejs/require-in-the-middle/issues"};const Hi=t,$i=r,Gi=ri("require-in-the-middle"),Wi=si;Gs.exports=ea;var qi=Gs.exports.Hook=ea;let Ki,Yi,Xi;if($i.isBuiltin)Yi=$i.isBuiltin;else if($i.builtinModules)Yi=e=>!!e.startsWith("node:")||(void 0===Ki&&(Ki=new Set($i.builtinModules)),Ki.has(e));else{const e=zi(),[t,n]=process.versions.node.split(".").map(Number);Yi=8===t&&n<8?t=>"http2"===t||!!e.core[t]:t=>!!e.core[t]}const Qi=/([/\\]index)?(\.js)?$/;class Ji{constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,t){if(this._localCache.has(e))return!0;if(t)return!1;{const t=require.cache[e];return!(!t||!(this._kRitmExports in t))}}get(e,t){const n=this._localCache.get(e);if(void 0!==n)return n;if(!t){const t=require.cache[e];return t&&t[this._kRitmExports]}}set(e,t,n){n?this._localCache.set(e,t):e in require.cache?require.cache[e][this._kRitmExports]=t:(Gi('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,t))}}function ea(e,t,n){if(this instanceof ea==!1)return new ea(e,t,n);if("function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),"function"!=typeof $i._resolveFilename)return console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof $i._resolveFilename),void console.error("Please report this error as an issue related to Node.js %s at %s",process.version,Vi.url);this._cache=new Ji,this._unhooked=!1,this._origRequire=$i.prototype.require;const r=this,o=new Set,s=!!t&&!0===t.internals,i=Array.isArray(e);function a(t,a){const c=t[0],u=Yi(c);let l,d,p;if(u){if(l=c,c.startsWith("node:")){const e=c.slice(5);Yi(e)&&(l=e)}}else{if(a)return Gi("call to process.getBuiltinModule with unknown built-in id"),r._origGetBuiltinModule.apply(this,t);try{l=$i._resolveFilename(c,this)}catch(e){return Gi('Module._resolveFilename("%s") threw %j, calling original Module.require',c,e.message),r._origRequire.apply(this,t)}}if(Gi("processing %s module require('%s'): %s",!0===u?"core":"non-core",c,l),!0===r._cache.has(l,u))return Gi("returning already patched cached module: %s",l),r._cache.get(l,u);const h=o.has(l);!1===h&&o.add(l);const f=a?r._origGetBuiltinModule.apply(this,t):r._origRequire.apply(this,t);if(!0===h)return Gi("module is in the process of being patched already - ignoring: %s",l),f;if(o.delete(l),!0===u){if(!0===i&&!1===e.includes(l))return Gi("ignoring core module not on whitelist: %s",l),f;d=l}else if(!0===i&&e.includes(l)){const e=Hi.parse(l);d=e.name,p=e.dir}else{const t=Wi(l);if(void 0===t)return Gi("could not parse filename: %s",l),f;d=t.name,p=t.basedir;const n=function(e){const t="/"!==Hi.sep?e.path.split(Hi.sep).join("/"):e.path;return Hi.posix.join(e.name,t).replace(Qi,"")}(t);Gi("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",d,c,n,p);let o=!1;if(i){if(!c.startsWith(".")&&e.includes(c)&&(d=c,o=!0),!e.includes(d)&&!e.includes(n))return f;e.includes(n)&&n!==d&&(d=n,o=!0)}if(!o){let e;try{e=function(e,t){if(!Xi)if(require.resolve&&require.resolve.paths)Xi=function(e,t){return require.resolve(e,{paths:[t]})};else{const e=zi();Xi=function(t,n){return e.sync(t,{basedir:n})}}return Xi(e,t)}(d,p)}catch(e){return Gi("could not resolve module: %s",d),r._cache.set(l,f,u),f}if(e!==l){if(!0!==s)return Gi("ignoring require of non-main module file: %s",e),r._cache.set(l,f,u),f;d=d+Hi.sep+Hi.relative(p,l),Gi("preparing to process require of internal file: %s",d)}}}r._cache.set(l,f,u),Gi("calling require hook: %s",d);const g=n(f,d,p);return r._cache.set(l,g,u),Gi("returning module: %s",d),g}Gi("registering require hook"),this._require=$i.prototype.require=function(e){return!0===r._unhooked?(Gi("ignoring require call - module is soft-unhooked"),r._origRequire.apply(this,arguments)):a.call(this,arguments,!1)},"function"==typeof process.getBuiltinModule&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(e){return!0===r._unhooked?(Gi("ignoring process.getBuiltinModule call - module is soft-unhooked"),r._origGetBuiltinModule.apply(this,arguments)):a.call(this,arguments,!0)})}ea.prototype.unhook=function(){this._unhooked=!0,this._require===$i.prototype.require?($i.prototype.require=this._origRequire,Gi("require unhook successful")):Gi("require unhook unsuccessful"),void 0!==process.getBuiltinModule&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,Gi("process.getBuiltinModule unhook successful")):Gi("process.getBuiltinModule unhook unsuccessful"))};const ta="/";class na{hooks=[];children=new Map}class ra{_trie=new na;_counter=0;insert(e){let t=this._trie;for(const n of e.moduleName.split(ta)){let e=t.children.get(n);e||(e=new na,t.children.set(n,e)),t=e}t.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:t,fullOnly:n}={}){let r=this._trie;const o=[];let s=!0;for(const t of e.split(ta)){const e=r.children.get(t);if(!e){s=!1;break}n||o.push(...e.hooks),r=e}return n&&s&&o.push(...r.hooks),0===o.length?[]:1===o.length?[o[0].hook]:(t&&o.sort((e,t)=>e.insertedId-t.insertedId),o.map(({hook:e})=>e))}}const oa=["afterEach","after","beforeEach","before","describe","it"].every(e=>"function"==typeof global[e]);class sa{_moduleNameTrie=new ra;static _instance;constructor(){this._initialize()}_initialize(){new qi(null,{internals:!0},(e,t,n)=>{const r=(o=t,d.sep!==ta?o.split(d.sep).join(ta):o);var o;const s=this._moduleNameTrie.search(r,{maintainInsertionOrder:!0,fullOnly:void 0===n});for(const{onRequire:r}of s)e=r(e,t,n);return e})}register(e,t){const n={moduleName:e,onRequire:t};return this._moduleNameTrie.insert(n),n}static getInstance(){return oa?new sa:this._instance=this._instance??new sa}}var ia={exports:{}},aa={};const ca=[],ua=new WeakMap,la=new WeakMap,da=new Map,pa=[],ha={set:(e,t,n)=>ua.get(e)[t](n),get(e,t){if(t===Symbol.toStringTag)return"Module";const n=la.get(e)[t];return"function"==typeof n?n():void 0},defineProperty(e,t,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");return ua.get(e)[t](n.value)}};let fa=!1;aa.register=function(e,t,n,r,o){da.set(e,o),ua.set(t,n),la.set(t,r);const s=new Proxy(t,ha);ca.forEach(t=>t(e,s)),pa.push([e,s])},aa.importHooks=ca,aa.specifiers=da,aa.toHook=pa,aa.getExperimentalPatchInternals=function(){return fa},aa.setExperimentalPatchInternals=function(e){fa=e};const ga=t,ma=si,{fileURLToPath:_a}=a,{MessageChannel:ya}=c,{importHooks:va,specifiers:ba,toHook:Ca,getExperimentalPatchInternals:Sa}=aa;function Ta(e){va.push(e),Ca.forEach(([t,n])=>e(t,n))}function Ia(e){const t=va.indexOf(e);t>-1&&va.splice(t,1)}function Ea(e,t,n,r){const o=e(t,n,r);o&&o!==t&&(t.default=o)}let wa;function Aa(e,t,n){if(this instanceof Aa==!1)return new Aa(e,t,n);"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null);const r=!!t&&!0===t.internals;wa&&Array.isArray(e)&&wa(e),this._iitmHook=(t,o)=>{const s=t;let i;if(t.startsWith("node:"))t=t.replace(/^node:/,"");else{if(t.startsWith("file://"))try{t=_a(t)}catch(e){}const e=ma(t);e&&(t=e.name,i=e.basedir)}if(e){for(const a of e)if(a===t){if(i)if(r)t=t+ga.sep+ga.relative(i,_a(s));else if(!Sa()&&!i.endsWith(ba.get(s)))continue;Ea(n,o,t,i)}}else Ea(n,o,t,i)},Ta(this._iitmHook)}Aa.prototype.unhook=function(){Ia(this._iitmHook)},ia.exports=Aa;var ka,Oa,Ra=ia.exports.Hook=Aa;function Na(e,t,n){let r,o;try{o=e()}catch(e){r=e}finally{return t(r,o),o}}function La(e){return"function"==typeof e&&"function"==typeof e.__original&&"function"==typeof e.__unwrap&&!0===e.__wrapped}ia.exports.addHook=Ta,ia.exports.removeHook=Ia,ia.exports.createAddHookMessageChannel=function(){const{port1:e,port2:t}=new ya;let n,r=0;return wa=t=>{r++,e.postMessage(t)},e.on("message",()=>{r--,n&&r<=0&&n()}).unref(),{registerOptions:{data:{addHookMessagePort:t,include:[]},transferList:[t]},addHookMessagePort:t,waitForAllMessagesAcknowledged:function(){const e=setInterval(()=>{},1e3),t=new Promise(e=>{n=e}).then(()=>{clearInterval(e)});return 0===r&&n(),t}}};class Ma extends js{_modules;_hooks=[];_requireInTheMiddleSingleton=sa.getInstance();_enabled=!1;constructor(e,t,n){super(e,t,n);let r=this.init();r&&!Array.isArray(r)&&(r=[r]),this._modules=r||[],this._config.enabled&&this.enable()}_wrap=(e,t,r)=>{if(La(e[t])&&this._unwrap(e,t),n.types.isProxy(e)){const n=Ps(Object.assign({},e),t,r);return Object.defineProperty(e,t,{value:n}),n}return Ps(e,t,r)};_unwrap=(e,t)=>n.types.isProxy(e)?Object.defineProperty(e,t,{value:e[t]}):Us(e,t);_massWrap=(e,t,n)=>{e?(Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{this._wrap(e,t,n)})}):Un.error("must provide one or more functions to wrap on modules")):Un.error("must provide one or more modules to patch")};_massUnwrap=(e,t)=>{e?(Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{this._unwrap(e,t)})}):Un.error("must provide one or more functions to wrap on modules")):Un.error("must provide one or more modules to patch")};_warnOnPreloadedModules(){this._modules.forEach(e=>{const{name:t}=e;try{const e=require.resolve(t);require.cache[e]&&this._diag.warn(`Module ${t} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${t}`)}catch{}})}_extractPackageVersion(e){try{const t=s.readFileSync(d.join(e,"package.json"),{encoding:"utf8"}),n=JSON.parse(t).version;return"string"==typeof n?n:void 0}catch{Un.warn("Failed extracting version",e)}}_onRequire(e,t,n,r){if(!r)return"function"==typeof e.patch&&(e.moduleExports=t,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(t)):t;const o=this._extractPackageVersion(r);if(e.moduleVersion=o,e.name===n)return xa(e.supportedVersions,o,e.includePrerelease)&&"function"==typeof e.patch&&(e.moduleExports=t,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:r}),e.patch(t,e.moduleVersion)):t;const s=e.files??[],i=d.normalize(n);return s.filter(e=>e.name===i).filter(t=>xa(t.supportedVersions,o,e.includePrerelease)).reduce((t,n)=>(n.moduleExports=t,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:n.name,baseDir:r}),n.patch(t,e.moduleVersion)):t),t)}enable(){if(!this._enabled)if(this._enabled=!0,this._hooks.length>0)for(const e of this._modules){"function"==typeof e.patch&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(const t of e.files)t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:t.name}),t.patch(t.moduleExports,e.moduleVersion))}else{this._warnOnPreloadedModules();for(const e of this._modules){const t=(t,n,r)=>{if(!r&&d.isAbsolute(n)){const e=d.parse(n);n=e.name,r=e.dir}return this._onRequire(e,t,n,r)},n=(t,n,r)=>this._onRequire(e,t,n,r),r=d.isAbsolute(e.name)?new qi([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(r);const o=new Ra([e.name],{internals:!1},t);this._hooks.push(o)}}}disable(){if(this._enabled){this._enabled=!1;for(const e of this._modules){"function"==typeof e.unpatch&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(const t of e.files)t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:t.name}),t.unpatch(t.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}}function xa(e,t,n){return void 0===t?e.includes("*"):e.some(e=>ms(t,e,{includePrerelease:n}))}function Da(e,t){let n=ka.OLD;const r=t?.split(",").map(e=>e.trim()).filter(e=>""!==e);for(const t of r??[]){if(t.toLowerCase()===e+"/dup"){n=ka.DUPLICATE;break}t.toLowerCase()===e&&(n=ka.STABLE)}return n}!function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"}(ka||(ka={})),function(e){e.DOCUMENT_LOAD="documentLoad",e.DOCUMENT_FETCH="documentFetch",e.RESOURCE_FETCH="resourceFetch"}(Oa||(Oa={}));var Pa;!function(e){e.FIRST_PAINT="firstPaint",e.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"}(Pa||(Pa={}));const Fa={"first-paint":Pa.FIRST_PAINT,"first-contentful-paint":Pa.FIRST_CONTENTFUL_PAINT};class Ua extends Ma{component="document-load";version="1";moduleName=this.component;constructor(e={}){super("@opentelemetry/instrumentation-document-load","0.48.0",e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){const t=_r.getEntriesByType?.("resource");t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){const e=Array.from(document.getElementsByTagName("meta")).find(e=>e.getAttribute("name")===Xr),t=(()=>{const e={},t=_r.getEntriesByType?.("navigation")[0];if(t)Object.values($o).forEach(n=>{if(Yo(t,n)){const r=t[n];"number"==typeof r&&(e[n]=r)}});else{const t=_r.timing;t&&Object.values($o).forEach(n=>{if(Yo(t,n)){const r=t[n];"number"==typeof r&&(e[n]=r)}})}return e})(),n=e&&e.content||"";Fn.with(Xn.extract(Dt,{traceparent:n}),()=>{const e=this._startSpan(Oa.DOCUMENT_LOAD,$o.FETCH_START,t);e&&(Fn.with(Jn.setSpan(Fn.active(),e),()=>{const e=this._startSpan(Oa.DOCUMENT_FETCH,$o.FETCH_START,t);e&&(e.setAttribute(yr,location.href),Fn.with(Jn.setSpan(Fn.active(),e),()=>{Qo(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,$o.RESPONSE_END,t)}))}),e.setAttribute(yr,location.href),e.setAttribute("http.user_agent",navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(Xo(e,$o.FETCH_START,t),Xo(e,$o.UNLOAD_EVENT_START,t),Xo(e,$o.UNLOAD_EVENT_END,t),Xo(e,$o.DOM_INTERACTIVE,t),Xo(e,$o.DOM_CONTENT_LOADED_EVENT_START,t),Xo(e,$o.DOM_CONTENT_LOADED_EVENT_END,t),Xo(e,$o.DOM_COMPLETE,t),Xo(e,$o.LOAD_EVENT_START,t),Xo(e,$o.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||(e=>{const t=_r.getEntriesByType?.("paint");t&&t.forEach(({name:t,startTime:n})=>{Yo(Fa,t)&&e.addEvent(Fa[t],n)})})(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,$o.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(Yo(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){const n=this._startSpan(Oa.RESOURCE_FETCH,$o.FETCH_START,e,t);n&&(n.setAttribute(yr,e.name),Qo(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,$o.RESPONSE_END,e))}_startSpan(e,t,n,r){if(Yo(n,t)&&"number"==typeof n[t]){return this.tracer.startSpan(e,{startTime:n[t]},r?Jn.setSpan(Fn.active(),r):void 0)}}_waitForPageLoad(){"complete"===window.document.readyState?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&Na(()=>t(e),e=>{e&&this._diag.error("addCustomAttributesOnSpan",e)})}_addCustomAttributesOnResourceSpan(e,t,n){n&&Na(()=>n(e,t),e=>{e&&this._diag.error("addCustomAttributesOnResourceSpan",e)})}enable(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener("load",this._onDocumentLoaded)}}const Za="OT_ZONE_CONTEXT";class ja{_enabled=!1;_zoneCounter=0;_activeContextFromZone(e){return e&&e.get(Za)||Dt}_bindFunction(e,t){const n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}_bindListener(e,t){const n=t;return void 0!==n.__ot_listeners||(n.__ot_listeners={},"function"==typeof n.addEventListener&&(n.addEventListener=this._patchAddEventListener(n,n.addEventListener,e)),"function"==typeof n.removeEventListener&&(n.removeEventListener=this._patchRemoveEventListener(n,n.removeEventListener))),t}_createZoneName(){this._zoneCounter++;const e=Math.random();return`${this._zoneCounter}-${e}`}_createZone(e,t){return Zone.current.fork({name:e,properties:{[Za]:t}})}_getActiveZone(){return Zone.current}_patchAddEventListener(e,t,n){const r=this;return function(o,s,i){void 0===e.__ot_listeners&&(e.__ot_listeners={});let a=e.__ot_listeners[o];void 0===a&&(a=new WeakMap,e.__ot_listeners[o]=a);const c=r.bind(n,s);return a.set(s,c),t.call(this,o,c,i)}}_patchRemoveEventListener(e,t){return function(n,r){if(void 0===e.__ot_listeners||void 0===e.__ot_listeners[n])return t.call(this,n,r);const o=e.__ot_listeners[n],s=o.get(r);return o.delete(r),t.call(this,n,s||r)}}active(){if(!this._enabled)return Dt;const e=this._getActiveZone(),t=this._activeContextFromZone(e);return t||Dt}bind(e,t){return void 0===e&&(e=this.active()),"function"==typeof t?this._bindFunction(e,t):("object"==typeof(n=t)&&null!==n&&"addEventListener"in n&&"function"==typeof n.addEventListener&&"removeEventListener"in n&&"function"==typeof n.removeEventListener&&this._bindListener(e,t),t);var n}disable(){return this._enabled=!1,this}enable(){return this._enabled=!0,this}with(e,t,n,...r){const o=this._createZoneName();return this._createZone(o,e).run(t,n,r)}}
16
16
  /**
17
17
  * @license Angular v<unknown>
18
18
  * (c) 2010-2025 Google LLC. https://angular.io/