@monoscopetech/browser 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("perf_hooks"),require("path"),require("util"),require("module"),require("tty"),require("fs"),require("os"),require("url"),require("worker_threads")):"function"==typeof define&&define.amd?define(["perf_hooks","path","util","module","tty","fs","os","url","worker_threads"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["@monoscopetech/browser"]=t(e.perf_hooks$2,e.path$4,e.require$$1$2,e.require$$1$3,e.require$$0,e.require$$0$1,e.os$2,e.require$$2,e.require$$3)}(this,function(e,t,n,r,o,s,i,a,c){"use strict";function u(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var l,d=u(t);function p(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function h(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function f(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(g).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function g(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=f(e.styleSheet)||t}catch(e){}return t}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(l||(l={}));var m=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function _(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,s=e.maskInputFn,i=o||"";return(t[n.toLowerCase()]||t[r])&&(i=s?s(i):"*".repeat(i.length)),i}var y="__rrweb_original__";var v,b,C=1,S=new RegExp("[^a-z0-9-_:]");function T(){return C++}var I=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,E=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,w=/^(data:)([^,]*),(.*)/i;function A(e,t){return(e||"").replace(I,function(e,n,r,o,s,i){var a=r||s||i,c=n||o||"";if(!a)return e;if(!E.test(a))return"url(".concat(c).concat(a).concat(c,")");if(w.test(a))return"url(".concat(c).concat(a).concat(c,")");if("/"===a[0])return"url(".concat(c).concat(function(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}(t)+a).concat(c,")");var u=t.split("/"),l=a.split("/");u.pop();for(var d=0,p=l;d<p.length;d++){var h=p[d];"."!==h&&(".."===h?u.pop():u.push(h))}return"url(".concat(c).concat(u.join("/")).concat(c,")")})}var k=/^[^ \t\n\r\u000c]+/,O=/^[, \t\n\r\u000c]+/;function R(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function N(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function L(){var e=document.createElement("a");return e.href="",e.href}function M(e,t,n,r){return"src"===n||"href"===n&&r&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&r&&"#"!==r[0]?R(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(O),!(n>=t.length);){var s=r(k);if(","===s.slice(-1))s=R(e,s.substring(0,s.length-1)),o.push(s);else{var i="";s=R(e,s);for(var a=!1;;){var c=t.charAt(n);if(""===c){o.push((s+i).trim());break}if(a)")"===c&&(a=!1);else{if(","===c){n+=1,o.push((s+i).trim());break}"("===c&&(a=!0)}i+=c,n+=1}}}return o.join(", ")}(e,r):"style"===n&&r?A(r,L()):"object"===t&&"data"===n&&r?R(e,r):r:R(e,r)}function x(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&x(e.parentNode,t,n);for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&x(e.parentNode,t,n)}function D(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(r.closest(".".concat(t)))return!0}else if(x(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}return!1}function P(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,s=t.blockSelector,i=t.maskTextClass,a=t.maskTextSelector,c=t.inlineStylesheet,u=t.maskInputOptions,d=void 0===u?{}:u,p=t.maskTextFn,h=t.maskInputFn,g=t.dataURLOptions,m=void 0===g?{}:g,C=t.inlineImages,T=t.recordCanvas,I=t.keepIframeSrcFn,E=t.newlyAddedElement,w=void 0!==E&&E,k=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:l.Document,childNodes:[],compatMode:e.compatMode}:{type:l.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:l.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:k};case e.ELEMENT_NODE:return function(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,s=t.inlineStylesheet,i=t.maskInputOptions,a=void 0===i?{}:i,c=t.maskInputFn,u=t.dataURLOptions,d=void 0===u?{}:u,p=t.inlineImages,h=t.recordCanvas,g=t.keepIframeSrcFn,m=t.newlyAddedElement,C=void 0!==m&&m,T=t.rootId,I=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&e.matches(n)}(e,r,o),E=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return S.test(t)?"div":t}(e),w={},k=e.attributes.length,O=0;O<k;O++){var R=e.attributes[O];w[R.name]=M(n,E,R.name,R.value)}if("link"===E&&s){var x=Array.from(n.styleSheets).find(function(t){return t.href===e.href}),D=null;x&&(D=f(x)),D&&(delete w.rel,delete w.href,w._cssText=A(D,x.href))}if("style"===E&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(D=f(e.sheet))&&(w._cssText=A(D,L()))}if("input"===E||"textarea"===E||"select"===E){var P=e.value,F=e.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&P?w.value=_({type:w.type,tagName:E,value:P,maskInputOptions:a,maskInputFn:c}):F&&(w.checked=F)}"option"===E&&(e.selected&&!a.select?w.selected=!0:delete w.selected);if("canvas"===E&&h)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var o=t.getImageData,s=y in o?o[y]:o;if(new Uint32Array(s.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(function(e){return 0!==e}))return!1}return!0})(e)||(w.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var U=e.toDataURL(d.type,d.quality),Z=document.createElement("canvas");Z.width=e.width,Z.height=e.height,U!==Z.toDataURL(d.type,d.quality)&&(w.rr_dataURL=U)}if("img"===E&&p){v||(v=n.createElement("canvas"),b=v.getContext("2d"));var j=e,B=j.crossOrigin;j.crossOrigin="anonymous";var z=function(){try{v.width=j.naturalWidth,v.height=j.naturalHeight,b.drawImage(j,0,0),w.rr_dataURL=v.toDataURL(d.type,d.quality)}catch(e){console.warn("Cannot inline img src=".concat(j.currentSrc,"! Error: ").concat(e))}B?w.crossOrigin=B:j.removeAttribute("crossorigin")};j.complete&&0!==j.naturalWidth?z():j.onload=z}"audio"!==E&&"video"!==E||(w.rr_mediaState=e.paused?"paused":"played",w.rr_mediaCurrentTime=e.currentTime);C||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop));if(I){var V=e.getBoundingClientRect(),H=V.width,$=V.height;w={class:w.class,rr_width:"".concat(H,"px"),rr_height:"".concat($,"px")}}"iframe"!==E||g(w.src)||(e.contentDocument||(w.rr_src=w.src),delete w.src);return{type:l.Element,tagName:E,attributes:w,childNodes:[],isSVG:N(e)||void 0,needBlock:I,rootId:T}}(e,{doc:n,blockClass:o,blockSelector:s,inlineStylesheet:c,maskInputOptions:d,maskInputFn:h,dataURLOptions:m,inlineImages:C,recordCanvas:T,keepIframeSrcFn:I,newlyAddedElement:w,rootId:k});case e.TEXT_NODE:return function(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,s=t.maskTextFn,i=t.rootId,a=e.parentNode&&e.parentNode.tagName,c=e.textContent,u="STYLE"===a||void 0,d="SCRIPT"===a||void 0;if(u&&c){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(c=(p=e.parentNode.sheet).cssRules?Array.from(p.cssRules).map(function(e){return e.cssText||""}).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}c=A(c,L())}var p;d&&(c="SCRIPT_PLACEHOLDER");!u&&!d&&c&&D(e,r,o)&&(c=s?s(c):c.replace(/[\S]/g,"*"));return{type:l.Text,textContent:c||"",isStyle:u,rootId:i}}(e,{maskTextClass:i,maskTextSelector:a,maskTextFn:p,rootId:k});case e.CDATA_SECTION_NODE:return{type:l.CDATA,textContent:"",rootId:k};case e.COMMENT_NODE:return{type:l.Comment,textContent:e.textContent||"",rootId:k};default:return!1}}function F(e){return void 0===e?"":e.toLowerCase()}function U(e,t){var n,r=t.doc,o=t.mirror,s=t.blockClass,i=t.blockSelector,a=t.maskTextClass,c=t.maskTextSelector,u=t.skipChild,d=void 0!==u&&u,f=t.inlineStylesheet,g=void 0===f||f,m=t.maskInputOptions,_=void 0===m?{}:m,y=t.maskTextFn,v=t.maskInputFn,b=t.slimDOMOptions,C=t.dataURLOptions,S=void 0===C?{}:C,I=t.inlineImages,E=void 0!==I&&I,w=t.recordCanvas,A=void 0!==w&&w,k=t.onSerialize,O=t.onIframeLoad,R=t.iframeLoadTimeout,N=void 0===R?5e3:R,L=t.onStylesheetLoad,M=t.stylesheetLoadTimeout,x=void 0===M?5e3:M,D=t.keepIframeSrcFn,Z=void 0===D?function(){return!1}:D,j=t.newlyAddedElement,B=void 0!==j&&j,z=t.preserveWhiteSpace,V=void 0===z||z,H=P(e,{doc:r,mirror:o,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:c,inlineStylesheet:g,maskInputOptions:_,maskTextFn:y,maskInputFn:v,dataURLOptions:S,inlineImages:E,recordCanvas:A,keepIframeSrcFn:Z,newlyAddedElement:B});if(!H)return console.warn(e,"not serialized"),null;n=o.hasNode(e)?o.getId(e):!function(e,t){if(t.comment&&e.type===l.Comment)return!0;if(e.type===l.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(F(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===F(e.attributes.name)||"icon"===F(e.attributes.rel)||"apple-touch-icon"===F(e.attributes.rel)||"shortcut icon"===F(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&F(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(F(e.attributes.property).match(/^(og|twitter|fb):/)||F(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===F(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===F(e.attributes.name)||"googlebot"===F(e.attributes.name)||"bingbot"===F(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===F(e.attributes.name)||"generator"===F(e.attributes.name)||"framework"===F(e.attributes.name)||"publisher"===F(e.attributes.name)||"progid"===F(e.attributes.name)||F(e.attributes.property).match(/^article:/)||F(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===F(e.attributes.name)||"yandex-verification"===F(e.attributes.name)||"csrf-token"===F(e.attributes.name)||"p:domain_verify"===F(e.attributes.name)||"verify-v1"===F(e.attributes.name)||"verification"===F(e.attributes.name)||"shopify-checkout-api-token"===F(e.attributes.name)))return!0}}return!1}(H,b)&&(V||H.type!==l.Text||H.isStyle||H.textContent.replace(/^\s+|\s+$/gm,"").length)?T():-2;var $=Object.assign(H,{id:n});if(o.add(e,$),-2===n)return null;k&&k(e);var G=!d;if($.type===l.Element){G=G&&!$.needBlock,delete $.needBlock;var W=e.shadowRoot;W&&h(W)&&($.isShadowHost=!0)}if(($.type===l.Document||$.type===l.Element)&&G){b.headWhitespace&&$.type===l.Element&&"head"===$.tagName&&(V=!1);for(var q={doc:r,mirror:o,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:c,skipChild:d,inlineStylesheet:g,maskInputOptions:_,maskTextFn:y,maskInputFn:v,slimDOMOptions:b,dataURLOptions:S,inlineImages:E,recordCanvas:A,preserveWhiteSpace:V,onSerialize:k,onIframeLoad:O,iframeLoadTimeout:N,onStylesheetLoad:L,stylesheetLoadTimeout:x,keepIframeSrcFn:Z},K=0,Y=Array.from(e.childNodes);K<Y.length;K++){(J=U(Y[K],q))&&$.childNodes.push(J)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var X=0,Q=Array.from(e.shadowRoot.childNodes);X<Q.length;X++){var J;(J=U(Q[X],q))&&(h(e.shadowRoot)&&(J.isShadow=!0),$.childNodes.push(J))}}return e.parentNode&&p(e.parentNode)&&h(e.parentNode)&&($.isShadow=!0),$.type===l.Element&&"iframe"===$.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,s=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){var i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout(function(){s||(t(),s=!0)},n);e.addEventListener("load",function(){clearTimeout(a),s=!0,t()})}}}(e,function(){var t=e.contentDocument;if(t&&O){var n=U(t,{doc:t,mirror:o,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:g,maskInputOptions:_,maskTextFn:y,maskInputFn:v,slimDOMOptions:b,dataURLOptions:S,inlineImages:E,recordCanvas:A,preserveWhiteSpace:V,onSerialize:k,onIframeLoad:O,iframeLoadTimeout:N,onStylesheetLoad:L,stylesheetLoadTimeout:x,keepIframeSrcFn:Z});n&&O(e,n)}},N),$.type===l.Element&&"link"===$.tagName&&"stylesheet"===$.attributes.rel&&function(e,t,n){var r,o=!1;try{r=e.sheet}catch(e){return}if(!r){var s=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(s),o=!0,t()})}}(e,function(){if(L){var t=U(e,{doc:r,mirror:o,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:g,maskInputOptions:_,maskTextFn:y,maskInputFn:v,slimDOMOptions:b,dataURLOptions:S,inlineImages:E,recordCanvas:A,preserveWhiteSpace:V,onSerialize:k,onIframeLoad:O,iframeLoadTimeout:N,onStylesheetLoad:L,stylesheetLoadTimeout:x,keepIframeSrcFn:Z});t&&L(e,t)}},x),$}function Z(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const j="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let B={map:{},getId:()=>(console.error(j),-1),getNode:()=>(console.error(j),null),removeNodeFromMap(){console.error(j)},has:()=>(console.error(j),!1),reset(){console.error(j)}};function z(e,t,n={}){let r=null,o=0;return function(...s){const i=Date.now();o||!1!==n.leading||(o=i);const a=t-(i-o),c=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),o=i,e.apply(c,s)):r||!1===n.trailing||(r=setTimeout(()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(c,s)},a))}}function V(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),s&&s.set&&s.set.call(this,e)}}),()=>V(e,t,s||{},!0)}function H(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch(e){return()=>{}}}function $(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function G(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function W(e,t,n,r){if(!e)return!1;const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(x(o,t,r))return!0;if(n){if(e.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function q(e,t){return-2===t.getId(e)}function K(e,t){if(p(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||K(e.parentNode,t))}function Y(e){return Boolean(e.changedTouches)}function X(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Q(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function J(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(B=new Proxy(B,{get:(e,t,n)=>("map"===t&&console.error(j),Reflect.get(e,t,n))}));class ee{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var te=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(te||{}),ne=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(ne||{}),re=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(re||{}),oe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(oe||{});function se(e){return"__ln"in e}class ie{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&se(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&se(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const ae=(e,t)=>`${e}@${t}`;class ce{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new ie,n=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},r=r=>{var o,s,i,a;let c=null;(null===(s=null===(o=r.getRootNode)||void 0===o?void 0:o.call(r))||void 0===s?void 0:s.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&r.getRootNode().host&&(c=r.getRootNode().host);let u=c;for(;(null===(a=null===(i=null==u?void 0:u.getRootNode)||void 0===i?void 0:i.call(u))||void 0===a?void 0:a.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&u.getRootNode().host;)u=u.getRootNode().host;const l=!(this.doc.contains(r)||u&&this.doc.contains(u));if(!r.parentNode||l)return;const d=p(r.parentNode)?this.mirror.getId(c):this.mirror.getId(r.parentNode),h=n(r);if(-1===d||-1===h)return t.addNode(r);const f=U(r,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{X(e,this.mirror)&&this.iframeManager.addIframe(e),Q(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),J(r)&&this.shadowDomManager.addShadowRoot(r.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});f&&e.push({parentId:d,nextId:h,node:f})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))le(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||r(e);for(const e of Array.from(this.addedSet.values()))pe(this.droppedSet,e)||le(this.removes,e,this.mirror)?pe(this.movedSet,e)?r(e):this.droppedSet.add(e):r(e);let o=null;for(;t.length;){let e=null;if(o){const t=this.mirror.getId(o.value.parentNode),r=n(o.value);-1!==t&&-1!==r&&(e=o)}if(!e)for(let r=t.length-1;r>=0;r--){const o=t.get(r);if(o){const t=this.mirror.getId(o.value.parentNode);if(-1===n(o.value))continue;if(-1!==t){e=o;break}{const t=o.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const n=t.parentNode.host;if(-1!==this.mirror.getId(n)){e=o;break}}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}o=e.previous,t.removeNode(e.value),r(e.value)}const s={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>({id:this.mirror.getId(e.node),attributes:e.attributes})).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))},this.processMutation=e=>{if(!q(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;W(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:D(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(n=_({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),W(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let r=this.attributes.find(t=>t.node===e.target);if("IFRAME"===t.tagName&&"src"===e.attributeName&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;e.attributeName="rr_src"}if(r||(r={node:e.target,attributes:{}},this.attributes.push(r)),"style"===e.attributeName){const n=this.doc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue),void 0!==r.attributes.style&&null!==r.attributes.style||(r.attributes.style={});const o=r.attributes.style;for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),s=t.style.getPropertyPriority(e);r===n.style.getPropertyValue(e)&&s===n.style.getPropertyPriority(e)||(o[e]=""===s?r:[r,s])}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(o[e]=!1)}else r.attributes[e.attributeName]=M(this.doc,t.tagName,e.attributeName,n);break}case"childList":if(W(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=p(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);W(e.target,this.blockClass,this.blockSelector,!1)||q(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(ue(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||K(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ae(n,r)]?ue(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!p(e.target)||!h(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if(q(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[ae(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);W(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach(e=>this.genAdds(e))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ue(e,t){e.delete(t),t.childNodes.forEach(t=>ue(e,t))}function le(e,t,n){return 0!==e.length&&de(e,t,n)}function de(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return!!e.some(e=>e.id===o)||de(e,r,n)}function pe(e,t){return 0!==e.size&&he(e,t)}function he(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||he(e,n))}const fe=[],ge="undefined"!=typeof CSSGroupingRule,me="undefined"!=typeof CSSMediaRule,_e="undefined"!=typeof CSSSupportsRule,ye="undefined"!=typeof CSSConditionRule;function ve(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function be(e,t){var n,r;const o=new ce;fe.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const i=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");i&&window[i]&&(s=window[i]);const a=new s(o.processMutations.bind(o));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Ce({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:s}){if(!1===s.mouseInteraction)return()=>{};const i=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,a=[];return Object.keys(re).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(s=>{const i=s.toLowerCase(),c=(t=>s=>{const i=ve(s);if(W(i,r,o,!0))return;const a=Y(s)?s.changedTouches[0]:s;if(!a)return;const c=n.getId(i),{clientX:u,clientY:l}=a;e({type:re[t],id:c,x:u,y:l})})(s);a.push(Z(i,c,t))}),()=>{a.forEach(e=>e())}}function Se({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:s}){return Z("scroll",z(s=>{const i=ve(s);if(!i||W(i,r,o,!0))return;const a=n.getId(i);if(i===t){const n=t.scrollingElement||t.documentElement;e({id:a,x:n.scrollLeft,y:n.scrollTop})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})},s.scroll||100),t)}function Te(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const Ie=["INPUT","TEXTAREA","SELECT"],Ee=new WeakMap;function we(e){return function(e,t){if(ge&&e.parentRule instanceof CSSGroupingRule||me&&e.parentRule instanceof CSSMediaRule||_e&&e.parentRule instanceof CSSSupportsRule||ye&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ae(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function ke({mirror:e,stylesheetManager:t},n){var r,o,s;let i=null;i="#document"===n.nodeName?e.getId(n):e.getId(n.host);const a="#document"===n.nodeName?null===(r=n.defaultView)||void 0===r?void 0:r.Document:null===(s=null===(o=n.ownerDocument)||void 0===o?void 0:o.defaultView)||void 0===s?void 0:s.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets");return null!==i&&-1!==i&&a&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var n;const r=null===(n=c.set)||void 0===n?void 0:n.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(e){}return r}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}):()=>{}}function Oe(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:i,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:u,styleDeclarationCb:l,canvasMutationCb:d,fontCb:p,selectionCb:h}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),s(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),u(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),l(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),h(...e)}}(e,t);const r=be(e,e.doc),o=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,s="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const c=z(t=>{const n=Date.now()-i;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],i=null},s),u=z(e=>{const t=ve(e),{clientX:n,clientY:o}=Y(e)?e.changedTouches[0]:e;i||(i=Date.now()),a.push({x:n,y:o,id:r.getId(t),timeOffset:Date.now()-i}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?ne.Drag:e instanceof MouseEvent?ne.MouseMove:ne.TouchMove)},o,{trailing:!1}),l=[Z("mousemove",u,n),Z("touchmove",u,n),Z("drag",u,n)];return()=>{l.forEach(e=>e())}}(e),s=Ce(e),i=Se(e),a=function({viewportResizeCb:e}){let t=-1,n=-1;return Z("resize",z(()=>{const r=$(),o=G();t===r&&n===o||(e({width:Number(o),height:Number(r)}),t=r,n=o)},200),window)}(e),c=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:s,maskInputOptions:i,maskInputFn:a,sampling:c,userTriggeredOnInput:u}){function l(e){let n=ve(e);const c=e.isTrusted;if(n&&"OPTION"===n.tagName&&(n=n.parentElement),!n||!n.tagName||Ie.indexOf(n.tagName)<0||W(n,r,o,!0))return;const l=n.type;if(n.classList.contains(s))return;let p=n.value,h=!1;"radio"===l||"checkbox"===l?h=n.checked:(i[n.tagName.toLowerCase()]||i[l])&&(p=_({maskInputOptions:i,tagName:n.tagName,type:l,value:p,maskInputFn:a})),d(n,Te({text:p,isChecked:h,userTriggered:c},u));const f=n.name;"radio"===l&&f&&h&&t.querySelectorAll(`input[type="radio"][name="${f}"]`).forEach(e=>{e!==n&&d(e,Te({text:e.value,isChecked:!h,userTriggered:!1},u))})}function d(t,r){const o=Ee.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Ee.set(t,r);const o=n.getId(t);e(Object.assign(Object.assign({},r),{id:o}))}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>Z(e,l,t)),h=t.defaultView;if(!h)return()=>{p.forEach(e=>e())};const f=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),g=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&p.push(...g.map(e=>V(e[0],e[1],{set(){l({target:this})}},!1,h))),()=>{p.forEach(e=>e())}}(e),u=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o}){const s=s=>z(o=>{const i=ve(o);if(!i||W(i,t,n,!0))return;const{currentTime:a,volume:c,muted:u,playbackRate:l}=i;e({type:s,id:r.getId(i),currentTime:a,volume:c,muted:u,playbackRate:l})},o.media||500),i=[Z("play",s(0)),Z("pause",s(1)),Z("seeked",s(2)),Z("volumechange",s(3)),Z("ratechange",s(4))];return()=>{i.forEach(e=>e())}}(e),l=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(r,s){const{id:i,styleId:a}=Ae(this,t,n.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:r,index:s}]}),o.apply(this,[r,s])};const s=r.CSSStyleSheet.prototype.deleteRule;let i,a;r.CSSStyleSheet.prototype.deleteRule=function(r){const{id:o,styleId:i}=Ae(this,t,n.styleMirror);return(o&&-1!==o||i&&-1!==i)&&e({id:o,styleId:i,removes:[{index:r}]}),s.apply(this,[r])},r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=function(r){const{id:o,styleId:s}=Ae(this,t,n.styleMirror);return(o&&-1!==o||s&&-1!==s)&&e({id:o,styleId:s,replace:r}),i.apply(this,[r])}),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=function(r){const{id:o,styleId:s}=Ae(this,t,n.styleMirror);return(o&&-1!==o||s&&-1!==s)&&e({id:o,styleId:s,replaceSync:r}),a.apply(this,[r])});const c={};ge?c.CSSGroupingRule=r.CSSGroupingRule:(me&&(c.CSSMediaRule=r.CSSMediaRule),ye&&(c.CSSConditionRule=r.CSSConditionRule),_e&&(c.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(c).forEach(([r,o])=>{u[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=function(o,s){const{id:i,styleId:a}=Ae(this.parentStyleSheet,t,n.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:o,index:[...we(this),s||0]}]}),u[r].insertRule.apply(this,[o,s])},o.prototype.deleteRule=function(o){const{id:s,styleId:i}=Ae(this.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||i&&-1!==i)&&e({id:s,styleId:i,removes:[{index:[...we(this),o]}]}),u[r].deleteRule.apply(this,[o])}}),()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=s,i&&(r.CSSStyleSheet.prototype.replace=i),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=u[e].insertRule,t.prototype.deleteRule=u[e].deleteRule})}}(e,{win:n}),d=ke(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(o,i,a){var c;if(n.has(o))return s.apply(this,[o,i,a]);const{id:u,styleId:l}=Ae(null===(c=this.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,r.styleMirror);return(u&&-1!==u||l&&-1!==l)&&e({id:u,styleId:l,set:{property:o,value:i,priority:a},index:we(this.parentRule)}),s.apply(this,[o,i,a])};const i=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(o){var s;if(n.has(o))return i.apply(this,[o]);const{id:a,styleId:c}=Ae(null===(s=this.parentRule)||void 0===s?void 0:s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,remove:{property:o},index:we(this.parentRule)}),i.apply(this,[o])},()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=i}}(e,{win:n}),h=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(e,t,n){const r=new s(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const i=H(t.fonts,"add",function(t){return function(n){return setTimeout(()=>{const t=o.get(n);t&&(e(t),o.delete(n))},0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=s}),r.push(i),()=>{r.forEach(e=>e())}}(e):()=>{},f=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:s}=e;let i=!0;const a=()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const s=e.getRangeAt(t),{startContainer:i,startOffset:c,endContainer:u,endOffset:l}=s;W(i,r,o,!0)||W(u,r,o,!0)||a.push({start:n.getId(i),startOffset:c,end:n.getId(u),endOffset:l})}s({ranges:a})};return a(),Z("selectionchange",a)}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,n,t.options));return()=>{fe.forEach(e=>e.reset()),r.disconnect(),o(),s(),i(),a(),c(),u(),l(),d(),p(),h(),f(),g.forEach(e=>e())}}class Re{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),s=r||this.getRemoteIdToIdMap(e);let i=o.get(t);return i||(i=this.generateIdFn(),o.set(t,i),s.set(i,t)),i}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Ne{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Re(T),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Re(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){if("rrweb"===e.data.type){if(!e.source)return;const t=this.crossOriginIframeMap.get(e.source);if(!t)return;const n=this.transformCrossOriginEvent(t,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}transformCrossOriginEvent(e,t){var n;switch(t.type){case te.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:te.IncrementalSnapshot,data:{source:ne.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case te.Meta:case te.Load:case te.DomContentLoaded:return!1;case te.Plugin:return t;case te.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case te.IncrementalSnapshot:switch(t.data.source){case ne.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case ne.Drag:case ne.TouchMove:case ne.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case ne.ViewportResize:return!1;case ne.MediaInteraction:case ne.MouseInteraction:case ne.Scroll:case ne.CanvasMutation:case ne.Input:return this.replaceIds(t.data,e,["id"]),t;case ne.StyleSheetRule:case ne.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case ne.Font:return t;case ne.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case ne.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}}class Le{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(H(Element.prototype,"attachShadow",function(e){return function(n){const r=e.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),r}}))}addShadowRoot(e,t){h(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),be(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Se(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),ke({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)},0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(H(e.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(r){const o=n.call(this,r);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),o}}))}}reset(){this.restorePatches.forEach(e=>e()),this.shadowDoms=new WeakSet}}
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
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&<(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} [0m`;n[0]=s+n[0].split("\n").join("\n"+s),n.push(o+"m+"+e.exports.humanize(this.diff)+"[0m")}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
|
+
/**
|
|
17
|
+
* @license Angular v<unknown>
|
|
18
|
+
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
19
|
+
* License: MIT
|
|
20
|
+
*/const Ba=globalThis;function za(e){return(Ba.__Zone_symbol_prefix||"__zone_symbol__")+e}const Va=Object.getOwnPropertyDescriptor,Ha=Object.defineProperty,$a=Object.getPrototypeOf,Ga=Object.create,Wa=Array.prototype.slice,qa="addEventListener",Ka="removeEventListener",Ya=za(qa),Xa=za(Ka),Qa="true",Ja="false",ec=za("");function tc(e,t){return Zone.current.wrap(e,t)}function nc(e,t,n,r,o){return Zone.current.scheduleMacroTask(e,t,n,r,o)}const rc=za,oc="undefined"!=typeof window,sc=oc?window:void 0,ic=oc&&sc||globalThis;function ac(e,t){for(let n=e.length-1;n>=0;n--)"function"==typeof e[n]&&(e[n]=tc(e[n],t+"_"+n));return e}function cc(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&void 0===e.set)}const uc="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,lc=!("nw"in ic)&&void 0!==ic.process&&"[object process]"===ic.process.toString(),dc=!lc&&!uc&&!(!oc||!sc.HTMLElement),pc=void 0!==ic.process&&"[object process]"===ic.process.toString()&&!uc&&!(!oc||!sc.HTMLElement),hc={},fc=rc("enable_beforeunload"),gc=function(e){if(!(e=e||ic.event))return;let t=hc[e.type];t||(t=hc[e.type]=rc("ON_PROPERTY"+e.type));const n=this||e.target||ic,r=n[t];let o;if(dc&&n===sc&&"error"===e.type){const t=e;o=r&&r.call(this,t.message,t.filename,t.lineno,t.colno,t.error),!0===o&&e.preventDefault()}else o=r&&r.apply(this,arguments),"beforeunload"===e.type&&ic[fc]&&"string"==typeof o?e.returnValue=o:null==o||o||e.preventDefault();return o};function mc(e,t,n){let r=Va(e,t);if(!r&&n){Va(n,t)&&(r={enumerable:!0,configurable:!0})}if(!r||!r.configurable)return;const o=rc("on"+t+"patched");if(e.hasOwnProperty(o)&&e[o])return;delete r.writable,delete r.value;const s=r.get,i=r.set,a=t.slice(2);let c=hc[a];c||(c=hc[a]=rc("ON_PROPERTY"+a)),r.set=function(t){let n=this;if(n||e!==ic||(n=ic),!n)return;"function"==typeof n[c]&&n.removeEventListener(a,gc),i?.call(n,null),n[c]=t,"function"==typeof t&&n.addEventListener(a,gc,!1)},r.get=function(){let n=this;if(n||e!==ic||(n=ic),!n)return null;const o=n[c];if(o)return o;if(s){let e=s.call(this);if(e)return r.set.call(this,e),"function"==typeof n.removeAttribute&&n.removeAttribute(t),e}return null},Ha(e,t,r),e[o]=!0}function _c(e,t,n){if(t)for(let r=0;r<t.length;r++)mc(e,"on"+t[r],n);else{const t=[];for(const n in e)"on"==n.slice(0,2)&&t.push(n);for(let r=0;r<t.length;r++)mc(e,t[r],n)}}const yc=rc("originalInstance");function vc(e){const t=ic[e];if(!t)return;ic[rc(e)]=t,ic[e]=function(){const n=ac(arguments,e);switch(n.length){case 0:this[yc]=new t;break;case 1:this[yc]=new t(n[0]);break;case 2:this[yc]=new t(n[0],n[1]);break;case 3:this[yc]=new t(n[0],n[1],n[2]);break;case 4:this[yc]=new t(n[0],n[1],n[2],n[3]);break;default:throw new Error("Arg list too long.")}},Sc(ic[e],t);const n=new t(function(){});let r;for(r in n)"XMLHttpRequest"===e&&"responseBlob"===r||function(t){"function"==typeof n[t]?ic[e].prototype[t]=function(){return this[yc][t].apply(this[yc],arguments)}:Ha(ic[e].prototype,t,{set:function(n){"function"==typeof n?(this[yc][t]=tc(n,e+"."+t),Sc(this[yc][t],n)):this[yc][t]=n},get:function(){return this[yc][t]}})}(r);for(r in t)"prototype"!==r&&t.hasOwnProperty(r)&&(ic[e][r]=t[r])}function bc(e,t,n){let r=e;for(;r&&!r.hasOwnProperty(t);)r=$a(r);!r&&e[t]&&(r=e);const o=rc(t);let s=null;if(r&&(!(s=r[o])||!r.hasOwnProperty(o))){s=r[o]=r[t];if(cc(r&&Va(r,t))){const e=n(s,o,t);r[t]=function(){return e(this,arguments)},Sc(r[t],s)}}return s}function Cc(e,t,n){let r=null;function o(e){const t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},r.apply(t.target,t.args),e}r=bc(e,t,e=>function(t,r){const s=n(t,r);return s.cbIdx>=0&&"function"==typeof r[s.cbIdx]?nc(s.name,r[s.cbIdx],s,o):e.apply(t,r)})}function Sc(e,t){e[rc("OriginalDelegate")]=t}let Tc=!1,Ic=!1;function Ec(){if(Tc)return Ic;Tc=!0;try{const e=sc.navigator.userAgent;-1===e.indexOf("MSIE ")&&-1===e.indexOf("Trident/")&&-1===e.indexOf("Edge/")||(Ic=!0)}catch(e){}return Ic}function wc(e){return"function"==typeof e}function Ac(e){return"number"==typeof e}const kc={useG:!0},Oc={},Rc={},Nc=new RegExp("^"+ec+"(\\w+)(true|false)$"),Lc=rc("propagationStopped");function Mc(e,t){const n=(t?t(e):e)+Ja,r=(t?t(e):e)+Qa,o=ec+n,s=ec+r;Oc[e]={},Oc[e][Ja]=o,Oc[e][Qa]=s}function xc(e,t,n,r){const o=r&&r.add||qa,s=r&&r.rm||Ka,i=r&&r.listeners||"eventListeners",a=r&&r.rmAll||"removeAllListeners",c=rc(o),u="."+o+":",l="prependListener",d="."+l+":",p=function(e,t,n){if(e.isRemoved)return;const r=e.callback;let o;"object"==typeof r&&r.handleEvent&&(e.callback=e=>r.handleEvent(e),e.originalDelegate=r);try{e.invoke(e,t,[n])}catch(e){o=e}const i=e.options;if(i&&"object"==typeof i&&i.once){const r=e.originalDelegate?e.originalDelegate:e.callback;t[s].call(t,n.type,r,i)}return o};function h(n,r,o){if(!(r=r||e.event))return;const s=n||r.target||e,i=s[Oc[r.type][o?Qa:Ja]];if(i){const e=[];if(1===i.length){const t=p(i[0],s,r);t&&e.push(t)}else{const t=i.slice();for(let n=0;n<t.length&&(!r||!0!==r[Lc]);n++){const o=p(t[n],s,r);o&&e.push(o)}}if(1===e.length)throw e[0];for(let n=0;n<e.length;n++){const r=e[n];t.nativeScheduleMicroTask(()=>{throw r})}}}const f=function(e){return h(this,e,!1)},g=function(e){return h(this,e,!0)};function m(t,n){if(!t)return!1;let r=!0;n&&void 0!==n.useG&&(r=n.useG);const p=n&&n.vh;let h=!0;n&&void 0!==n.chkDup&&(h=n.chkDup);let m=!1;n&&void 0!==n.rt&&(m=n.rt);let _=t;for(;_&&!_.hasOwnProperty(o);)_=$a(_);if(!_&&t[o]&&(_=t),!_)return!1;if(_[c])return!1;const y=n&&n.eventNameToString,v={},b=_[c]=_[o],C=_[rc(s)]=_[s],S=_[rc(i)]=_[i],T=_[rc(a)]=_[a];let I;n&&n.prepend&&(I=_[rc(n.prepend)]=_[n.prepend]);const E=function(e){return I.call(v.target,v.eventName,e.invoke,v.options)},w=r?function(e){if(!v.isExisting)return b.call(v.target,v.eventName,v.capture?g:f,v.options)}:function(e){return b.call(v.target,v.eventName,e.invoke,v.options)},A=r?function(e){if(!e.isRemoved){const t=Oc[e.eventName];let n;t&&(n=t[e.capture?Qa:Ja]);const r=n&&e.target[n];if(r)for(let t=0;t<r.length;t++){if(r[t]===e){r.splice(t,1),e.isRemoved=!0,e.removeAbortListener&&(e.removeAbortListener(),e.removeAbortListener=null),0===r.length&&(e.allRemoved=!0,e.target[n]=null);break}}}if(e.allRemoved)return C.call(e.target,e.eventName,e.capture?g:f,e.options)}:function(e){return C.call(e.target,e.eventName,e.invoke,e.options)},k=n?.diff||function(e,t){const n=typeof t;return"function"===n&&e.callback===t||"object"===n&&e.originalDelegate===t},O=Zone[rc("UNPATCHED_EVENTS")],R=e[rc("PASSIVE_EVENTS")];const N=function(t,o,s,i,a=!1,c=!1){return function(){const u=this||e;let l=arguments[0];n&&n.transferEventName&&(l=n.transferEventName(l));let d=arguments[1];if(!d)return t.apply(this,arguments);if(lc&&"uncaughtException"===l)return t.apply(this,arguments);let f=!1;if("function"!=typeof d){if(!d.handleEvent)return t.apply(this,arguments);f=!0}if(p&&!p(t,d,u,arguments))return;const g=!!R&&-1!==R.indexOf(l),m=function(e){if("object"==typeof e&&null!==e){const t={...e};return e.signal&&(t.signal=e.signal),t}return e}(function(e,t){return t?"boolean"==typeof e?{capture:e,passive:!0}:e?"object"==typeof e&&!1!==e.passive?{...e,passive:!0}:e:{passive:!0}:e}(arguments[2],g)),_=m?.signal;if(_?.aborted)return;if(O)for(let e=0;e<O.length;e++)if(l===O[e])return g?t.call(u,l,d,m):t.apply(this,arguments);const b=!!m&&("boolean"==typeof m||m.capture),C=!(!m||"object"!=typeof m)&&m.once,S=Zone.current;let T=Oc[l];T||(Mc(l,y),T=Oc[l]);const I=T[b?Qa:Ja];let E,w=u[I],A=!1;if(w){if(A=!0,h)for(let e=0;e<w.length;e++)if(k(w[e],d))return}else w=u[I]=[];const N=u.constructor.name,L=Rc[N];L&&(E=L[l]),E||(E=N+o+(y?y(l):l)),v.options=m,C&&(v.options.once=!1),v.target=u,v.capture=b,v.eventName=l,v.isExisting=A;const M=r?kc:void 0;M&&(M.taskData=v),_&&(v.options.signal=void 0);const x=S.scheduleEventTask(E,d,M,s,i);if(_){v.options.signal=_;const e=()=>x.zone.cancelTask(x);t.call(_,"abort",e,{once:!0}),x.removeAbortListener=()=>_.removeEventListener("abort",e)}return v.target=null,M&&(M.taskData=null),C&&(v.options.once=!0),"boolean"!=typeof x.options&&(x.options=m),x.target=u,x.capture=b,x.eventName=l,f&&(x.originalDelegate=d),c?w.unshift(x):w.push(x),a?u:void 0}};return _[o]=N(b,u,w,A,m),I&&(_[l]=N(I,d,E,A,m,!0)),_[s]=function(){const t=this||e;let r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));const o=arguments[2],s=!!o&&("boolean"==typeof o||o.capture),i=arguments[1];if(!i)return C.apply(this,arguments);if(p&&!p(C,i,t,arguments))return;const a=Oc[r];let c;a&&(c=a[s?Qa:Ja]);const u=c&&t[c];if(u)for(let e=0;e<u.length;e++){const n=u[e];if(k(n,i)){if(u.splice(e,1),n.isRemoved=!0,0===u.length&&(n.allRemoved=!0,t[c]=null,!s&&"string"==typeof r)){t[ec+"ON_PROPERTY"+r]=null}return n.zone.cancelTask(n),m?t:void 0}}return C.apply(this,arguments)},_[i]=function(){const t=this||e;let r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));const o=[],s=Dc(t,y?y(r):r);for(let e=0;e<s.length;e++){const t=s[e];let n=t.originalDelegate?t.originalDelegate:t.callback;o.push(n)}return o},_[a]=function(){const t=this||e;let r=arguments[0];if(r){n&&n.transferEventName&&(r=n.transferEventName(r));const e=Oc[r];if(e){const n=e[Ja],o=e[Qa],i=t[n],a=t[o];if(i){const e=i.slice();for(let t=0;t<e.length;t++){const n=e[t];let o=n.originalDelegate?n.originalDelegate:n.callback;this[s].call(this,r,o,n.options)}}if(a){const e=a.slice();for(let t=0;t<e.length;t++){const n=e[t];let o=n.originalDelegate?n.originalDelegate:n.callback;this[s].call(this,r,o,n.options)}}}}else{const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t],r=Nc.exec(n);let o=r&&r[1];o&&"removeListener"!==o&&this[a].call(this,o)}this[a].call(this,"removeListener")}if(m)return this},Sc(_[o],b),Sc(_[s],C),T&&Sc(_[a],T),S&&Sc(_[i],S),!0}let _=[];for(let e=0;e<n.length;e++)_[e]=m(n[e],r);return _}function Dc(e,t){if(!t){const n=[];for(let r in e){const o=Nc.exec(r);let s=o&&o[1];if(s&&(!t||s===t)){const t=e[r];if(t)for(let e=0;e<t.length;e++)n.push(t[e])}}return n}let n=Oc[t];n||(Mc(t),n=Oc[t]);const r=e[n[Ja]],o=e[n[Qa]];return r?o?r.concat(o):r.slice():o?o.slice():[]}function Pc(e,t){const n=e.Event;n&&n.prototype&&t.patchMethod(n.prototype,"stopImmediatePropagation",e=>function(t,n){t[Lc]=!0,e&&e.apply(t,n)})}function Fc(e,t){t.patchMethod(e,"queueMicrotask",e=>function(e,t){Zone.current.scheduleMicroTask("queueMicrotask",t[0])})}const Uc=rc("zoneTask");function Zc(e,t,n,r){let o=null,s=null;n+=r;const i={};function a(t){const n=t.data;n.args[0]=function(){return t.invoke.apply(this,arguments)};const r=o.apply(e,n.args);return Ac(r)?n.handleId=r:(n.handle=r,n.isRefreshable=wc(r.refresh)),t}function c(t){const{handle:n,handleId:r}=t.data;return s.call(e,n??r)}o=bc(e,t+=r,n=>function(o,s){if(wc(s[0])){const e={isRefreshable:!1,isPeriodic:"Interval"===r,delay:"Timeout"===r||"Interval"===r?s[1]||0:void 0,args:s},n=s[0];s[0]=function(){try{return n.apply(this,arguments)}finally{const{handle:t,handleId:n,isPeriodic:r,isRefreshable:o}=e;r||o||(n?delete i[n]:t&&(t[Uc]=null))}};const o=nc(t,s[0],e,a,c);if(!o)return o;const{handleId:u,handle:l,isRefreshable:d,isPeriodic:p}=o.data;if(u)i[u]=o;else if(l&&(l[Uc]=o,d&&!p)){const e=l.refresh;l.refresh=function(){const{zone:t,state:n}=o;return"notScheduled"===n?(o._state="scheduled",t._updateTaskCount(o,1)):"running"===n&&(o._state="scheduling"),e.call(this)}}return l??u??o}return n.apply(e,s)}),s=bc(e,n,t=>function(n,r){const o=r[0];let s;Ac(o)?(s=i[o],delete i[o]):(s=o?.[Uc],s?o[Uc]=null:s=o),s?.type?s.cancelFn&&s.zone.cancelTask(s):t.apply(e,r)})}function jc(e,t){if(Zone[t.symbol("patchEventTarget")])return;const{eventNames:n,zoneSymbolEventNames:r,TRUE_STR:o,FALSE_STR:s,ZONE_SYMBOL_PREFIX:i}=t.getGlobalObjects();for(let e=0;e<n.length;e++){const t=n[e],a=i+(t+s),c=i+(t+o);r[t]={},r[t][s]=a,r[t][o]=c}const a=e.EventTarget;return a&&a.prototype?(t.patchEventTarget(e,t,[a&&a.prototype]),!0):void 0}function Bc(e,t,n){if(!n||0===n.length)return t;const r=n.filter(t=>t.target===e);if(0===r.length)return t;const o=r[0].ignoreProperties;return t.filter(e=>-1===o.indexOf(e))}function zc(e,t,n,r){if(!e)return;_c(e,Bc(e,t,n),r)}function Vc(e){return Object.getOwnPropertyNames(e).filter(e=>e.startsWith("on")&&e.length>2).map(e=>e.substring(2))}function Hc(e,t){if(lc&&!pc)return;if(Zone[e.symbol("patchEvents")])return;const n=t.__Zone_ignore_on_properties;let r=[];if(dc){const e=window;r=r.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);const t=[];zc(e,Vc(e),n?n.concat(t):n,$a(e))}r=r.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let e=0;e<r.length;e++){const o=t[r[e]];o?.prototype&&zc(o.prototype,Vc(o.prototype),n)}}function $c(e){e.__load_patch("ZoneAwarePromise",(e,t,n)=>{const r=Object.getOwnPropertyDescriptor,o=Object.defineProperty;const s=n.symbol,i=[],a=!1!==e[s("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],c=s("Promise"),u=s("then");n.onUnhandledError=e=>{if(n.showUncaughtError()){const t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=()=>{for(;i.length;){const e=i.shift();try{e.zone.runGuarded(()=>{if(e.throwOriginal)throw e.rejection;throw e})}catch(e){d(e)}}};const l=s("unhandledPromiseRejectionHandler");function d(e){n.onUnhandledError(e);try{const n=t[l];"function"==typeof n&&n.call(this,e)}catch(e){}}function p(e){return e&&"function"==typeof e.then}function h(e){return e}function f(e){return M.reject(e)}const g=s("state"),m=s("value"),_=s("finally"),y=s("parentPromiseValue"),v=s("parentPromiseState"),b=null,C=!0,S=!1;function T(e,t){return n=>{try{A(e,t,n)}catch(t){A(e,!1,t)}}}const I=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},E="Promise resolved with itself",w=s("currentTaskTrace");function A(e,r,s){const c=I();if(e===s)throw new TypeError(E);if(e[g]===b){let u=null;try{"object"!=typeof s&&"function"!=typeof s||(u=s&&s.then)}catch(t){return c(()=>{A(e,!1,t)})(),e}if(r!==S&&s instanceof M&&s.hasOwnProperty(g)&&s.hasOwnProperty(m)&&s[g]!==b)O(s),A(e,s[g],s[m]);else if(r!==S&&"function"==typeof u)try{u.call(s,c(T(e,r)),c(T(e,!1)))}catch(t){c(()=>{A(e,!1,t)})()}else{e[g]=r;const c=e[m];if(e[m]=s,e[_]===_&&r===C&&(e[g]=e[v],e[m]=e[y]),r===S&&s instanceof Error){const e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&o(s,w,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t<c.length;)R(e,c[t++],c[t++],c[t++],c[t++]);if(0==c.length&&r==S){e[g]=0;let r=s;try{throw new Error("Uncaught (in promise): "+function(e){if(e&&e.toString===Object.prototype.toString){return(e.constructor&&e.constructor.name||"")+": "+JSON.stringify(e)}return e?e.toString():Object.prototype.toString.call(e)}(s)+(s&&s.stack?"\n"+s.stack:""))}catch(e){r=e}a&&(r.throwOriginal=!0),r.rejection=s,r.promise=e,r.zone=t.current,r.task=t.currentTask,i.push(r),n.scheduleMicroTask()}}}return e}const k=s("rejectionHandledHandler");function O(e){if(0===e[g]){try{const n=t[k];n&&"function"==typeof n&&n.call(this,{rejection:e[m],promise:e})}catch(e){}e[g]=S;for(let t=0;t<i.length;t++)e===i[t].promise&&i.splice(t,1)}}function R(e,t,n,r,o){O(e);const s=e[g],i=s?"function"==typeof r?r:h:"function"==typeof o?o:f;t.scheduleMicroTask("Promise.then",()=>{try{const r=e[m],o=!!n&&_===n[_];o&&(n[y]=r,n[v]=s);const a=t.run(i,void 0,o&&i!==f&&i!==h?[]:[r]);A(n,!0,a)}catch(e){A(n,!1,e)}},n)}const N=function(){},L=e.AggregateError;class M{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(e){return e instanceof M?e:A(new this(null),C,e)}static reject(e){return A(new this(null),S,e)}static withResolvers(){const e={};return e.promise=new M((t,n)=>{e.resolve=t,e.reject=n}),e}static any(e){if(!e||"function"!=typeof e[Symbol.iterator])return Promise.reject(new L([],"All promises were rejected"));const t=[];let n=0;try{for(let r of e)n++,t.push(M.resolve(r))}catch(e){return Promise.reject(new L([],"All promises were rejected"))}if(0===n)return Promise.reject(new L([],"All promises were rejected"));let r=!1;const o=[];return new M((e,s)=>{for(let i=0;i<t.length;i++)t[i].then(t=>{r||(r=!0,e(t))},e=>{o.push(e),n--,0===n&&(r=!0,s(new L(o,"All promises were rejected")))})})}static race(e){let t,n,r=new this((e,r)=>{t=e,n=r});function o(e){t(e)}function s(e){n(e)}for(let t of e)p(t)||(t=this.resolve(t)),t.then(o,s);return r}static all(e){return M.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof M?this:M).allWithCallback(e,{thenCallback:e=>({status:"fulfilled",value:e}),errorCallback:e=>({status:"rejected",reason:e})})}static allWithCallback(e,t){let n,r,o=new this((e,t)=>{n=e,r=t}),s=2,i=0;const a=[];for(let o of e){p(o)||(o=this.resolve(o));const e=i;try{o.then(r=>{a[e]=t?t.thenCallback(r):r,s--,0===s&&n(a)},o=>{t?(a[e]=t.errorCallback(o),s--,0===s&&n(a)):r(o)})}catch(e){r(e)}s++,i++}return s-=2,0===s&&n(a),o}constructor(e){const t=this;if(!(t instanceof M))throw new Error("Must be an instanceof Promise.");t[g]=b,t[m]=[];try{const n=I();e&&e(n(T(t,C)),n(T(t,S)))}catch(e){A(t,!1,e)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return M}then(e,n){let r=this.constructor?.[Symbol.species];r&&"function"==typeof r||(r=this.constructor||M);const o=new r(N),s=t.current;return this[g]==b?this[m].push(s,o,e,n):R(this,s,o,e,n),o}catch(e){return this.then(null,e)}finally(e){let n=this.constructor?.[Symbol.species];n&&"function"==typeof n||(n=M);const r=new n(N);r[_]=_;const o=t.current;return this[g]==b?this[m].push(o,r,e,e):R(this,o,r,e,e),r}}M.resolve=M.resolve,M.reject=M.reject,M.race=M.race,M.all=M.all;const x=e[c]=e.Promise;e.Promise=M;const D=s("thenPatched");function P(e){const t=e.prototype,n=r(t,"then");if(n&&(!1===n.writable||!n.configurable))return;const o=t.then;t[u]=o,e.prototype.then=function(e,t){const n=new M((e,t)=>{o.call(this,e,t)});return n.then(e,t)},e[D]=!0}return n.patchThen=P,x&&(P(x),bc(e,"fetch",e=>{return t=e,function(e,n){let r=t.apply(e,n);if(r instanceof M)return r;let o=r.constructor;return o[D]||P(o),r};var t})),Promise[t.__symbol__("uncaughtPromiseErrors")]=i,M})}function Gc(e,t,n,r,o){const s=Zone.__symbol__(r);if(t[s])return;const i=t[s]=t[r];t[r]=function(s,a,c){return a&&a.prototype&&o.forEach(function(t){const o=`${n}.${r}::`+t,s=a.prototype;try{if(s.hasOwnProperty(t)){const n=e.ObjectGetOwnPropertyDescriptor(s,t);n&&n.value?(n.value=e.wrapWithCurrentZone(n.value,o),e._redefineProperty(a.prototype,t,n)):s[t]&&(s[t]=e.wrapWithCurrentZone(s[t],o))}else s[t]&&(s[t]=e.wrapWithCurrentZone(s[t],o))}catch{}}),i.call(t,s,a,c)},e.attachOriginToPatched(t[r],i)}const Wc=function(){const e=globalThis,t=!0===e[za("forceDuplicateZoneCheck")];if(e.Zone&&(t||"function"!=typeof e.Zone.__symbol__))throw new Error("Zone already loaded.");return e.Zone??=function(){const e=Ba.performance;function t(t){e&&e.mark&&e.mark(t)}function n(t,n){e&&e.measure&&e.measure(t,n)}t("Zone");class r{static __symbol__=za;static assertZonePatched(){if(Ba.Promise!==w.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let e=r.current;for(;e.parent;)e=e.parent;return e}static get current(){return k.zone}static get currentTask(){return O}static __load_patch(e,o,s=!1){if(w.hasOwnProperty(e)){const t=!0===Ba[za("forceDuplicateZoneCheck")];if(!s&&t)throw Error("Already loaded patch: "+e)}else if(!Ba["__Zone_disable_"+e]){const s="Zone:"+e;t(s),w[e]=o(Ba,r,A),n(s,s)}}get parent(){return this._parent}get name(){return this._name}_parent;_name;_properties;_zoneDelegate;constructor(e,t){this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new s(this,this._parent&&this._parent._zoneDelegate,t)}get(e){const t=this.getZoneWith(e);if(t)return t._properties[e]}getZoneWith(e){let t=this;for(;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}fork(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}wrap(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);const n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}}run(e,t,n,r){k={parent:k,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{k=k.parent}}runGuarded(e,t=null,n,r){k={parent:k,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{k=k.parent}}runTask(e,t,n){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||m).name+"; Execution: "+this.name+")");const r=e,{type:o,data:{isPeriodic:s=!1,isRefreshable:i=!1}={}}=e;if(e.state===_&&(o===E||o===I))return;const a=e.state!=b;a&&r._transitionTo(b,v);const c=O;O=r,k={parent:k,zone:this};try{o!=I||!e.data||s||i||(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,r,t,n)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{const t=e.state;if(t!==_&&t!==S)if(o==E||s||i&&t===y)a&&r._transitionTo(v,b,y);else{const e=r._zoneDelegates;this._updateTaskCount(r,-1),a&&r._transitionTo(_,b,_),i&&(r._zoneDelegates=e)}k=k.parent,O=c}}scheduleTask(e){if(e.zone&&e.zone!==this){let t=this;for(;t;){if(t===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);t=t.parent}}e._transitionTo(y,_);const t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(t){throw e._transitionTo(S,y,_),this._zoneDelegate.handleError(this,t),t}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==y&&e._transitionTo(v,y),e}scheduleMicroTask(e,t,n,r){return this.scheduleTask(new i(T,e,t,n,r,void 0))}scheduleMacroTask(e,t,n,r,o){return this.scheduleTask(new i(I,e,t,n,r,o))}scheduleEventTask(e,t,n,r,o){return this.scheduleTask(new i(E,e,t,n,r,o))}cancelTask(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||m).name+"; Execution: "+this.name+")");if(e.state===v||e.state===b){e._transitionTo(C,v,b);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(S,C),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(_,C),e.runCount=-1,e}}_updateTaskCount(e,t){const n=e._zoneDelegates;-1==t&&(e._zoneDelegates=null);for(let r=0;r<n.length;r++)n[r]._updateTaskCount(e.type,t)}}const o={name:"",onHasTask:(e,t,n,r)=>e.hasTask(n,r),onScheduleTask:(e,t,n,r)=>e.scheduleTask(n,r),onInvokeTask:(e,t,n,r,o,s)=>e.invokeTask(n,r,o,s),onCancelTask:(e,t,n,r)=>e.cancelTask(n,r)};class s{get zone(){return this._zone}_zone;_taskCounts={microTask:0,macroTask:0,eventTask:0};_parentDelegate;_forkDlgt;_forkZS;_forkCurrZone;_interceptDlgt;_interceptZS;_interceptCurrZone;_invokeDlgt;_invokeZS;_invokeCurrZone;_handleErrorDlgt;_handleErrorZS;_handleErrorCurrZone;_scheduleTaskDlgt;_scheduleTaskZS;_scheduleTaskCurrZone;_invokeTaskDlgt;_invokeTaskZS;_invokeTaskCurrZone;_cancelTaskDlgt;_cancelTaskZS;_cancelTaskCurrZone;_hasTaskDlgt;_hasTaskDlgtOwner;_hasTaskZS;_hasTaskCurrZone;constructor(e,t,n){this._zone=e,this._parentDelegate=t,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this._zone:t._forkCurrZone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this._zone:t._interceptCurrZone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this._zone:t._invokeCurrZone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this._zone:t._handleErrorCurrZone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this._zone:t._scheduleTaskCurrZone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this._zone:t._invokeTaskCurrZone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this._zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const r=n&&n.onHasTask,s=t&&t._hasTaskZS;(r||s)&&(this._hasTaskZS=r?n:o,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,n.onScheduleTask||(this._scheduleTaskZS=o,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this._zone),n.onInvokeTask||(this._invokeTaskZS=o,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this._zone),n.onCancelTask||(this._cancelTaskZS=o,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this._zone))}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new r(e,t)}intercept(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t}invoke(e,t,n,r,o){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,r,o):t.apply(n,r)}handleError(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)}scheduleTask(e,t){let n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),n||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=T)throw new Error("Task is missing scheduleFn.");f(t)}return n}invokeTask(e,t,n,r){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,r):t.callback.apply(n,r)}cancelTask(e,t){let n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");n=t.cancelFn(t)}return n}hasTask(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(t){this.handleError(e,t)}}_updateTaskCount(e,t){const n=this._taskCounts,r=n[e],o=n[e]=r+t;if(o<0)throw new Error("More tasks executed then were scheduled.");if(0==r||0==o){const t={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e};this.hasTask(this._zone,t)}}}class i{type;source;invoke;callback;data;scheduleFn;cancelFn;_zone=null;runCount=0;_zoneDelegates=null;_state="notScheduled";constructor(e,t,n,r,o,s){if(this.type=e,this.source=t,this.data=r,this.scheduleFn=o,this.cancelFn=s,!n)throw new Error("callback is not defined");this.callback=n;const a=this;e===E&&r&&r.useG?this.invoke=i.invokeTask:this.invoke=function(){return i.invokeTask.call(Ba,a,this,arguments)}}static invokeTask(e,t,n){e||(e=this),R++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==R&&g(),R--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(_,y)}_transitionTo(e,t,n){if(this._state!==t&&this._state!==n)throw new Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${n?" or '"+n+"'":""}, was '${this._state}'.`);this._state=e,e==_&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const a=za("setTimeout"),c=za("Promise"),u=za("then");let l,d=[],p=!1;function h(e){if(l||Ba[c]&&(l=Ba[c].resolve(0)),l){let t=l[u];t||(t=l.then),t.call(l,e)}else Ba[a](e,0)}function f(e){0===R&&0===d.length&&h(g),e&&d.push(e)}function g(){if(!p){for(p=!0;d.length;){const e=d;d=[];for(let t=0;t<e.length;t++){const n=e[t];try{n.zone.runTask(n,null,null)}catch(e){A.onUnhandledError(e)}}}A.microtaskDrainDone(),p=!1}}const m={name:"NO ZONE"},_="notScheduled",y="scheduling",v="scheduled",b="running",C="canceling",S="unknown",T="microTask",I="macroTask",E="eventTask",w={},A={symbol:za,currentZoneFrame:()=>k,onUnhandledError:N,microtaskDrainDone:N,scheduleMicroTask:f,showUncaughtError:()=>!r[za("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:N,patchMethod:()=>N,bindArguments:()=>[],patchThen:()=>N,patchMacroTask:()=>N,patchEventPrototype:()=>N,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>N,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>N,wrapWithCurrentZone:()=>N,filterProperties:()=>[],attachOriginToPatched:()=>N,_redefineProperty:()=>N,patchCallbacks:()=>N,nativeScheduleMicroTask:h};let k={parent:null,zone:new r(null,null)},O=null,R=0;function N(){}return n("Zone","Zone"),r}(),e.Zone}();!function(e){$c(e),function(e){e.__load_patch("toString",e=>{const t=Function.prototype.toString,n=rc("OriginalDelegate"),r=rc("Promise"),o=rc("Error"),s=function(){if("function"==typeof this){const s=this[n];if(s)return"function"==typeof s?t.call(s):Object.prototype.toString.call(s);if(this===Promise){const n=e[r];if(n)return t.call(n)}if(this===Error){const n=e[o];if(n)return t.call(n)}}return t.call(this)};s[n]=t,Function.prototype.toString=s;const i=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":i.call(this)}})}(e),function(e){e.__load_patch("util",(e,t,n)=>{const r=Vc(e);n.patchOnProperties=_c,n.patchMethod=bc,n.bindArguments=ac,n.patchMacroTask=Cc;const o=t.__symbol__("BLACK_LISTED_EVENTS"),s=t.__symbol__("UNPATCHED_EVENTS");e[s]&&(e[o]=e[s]),e[o]&&(t[o]=t[s]=e[o]),n.patchEventPrototype=Pc,n.patchEventTarget=xc,n.isIEOrEdge=Ec,n.ObjectDefineProperty=Ha,n.ObjectGetOwnPropertyDescriptor=Va,n.ObjectCreate=Ga,n.ArraySlice=Wa,n.patchClass=vc,n.wrapWithCurrentZone=tc,n.filterProperties=Bc,n.attachOriginToPatched=Sc,n._redefineProperty=Object.defineProperty,n.patchCallbacks=Gc,n.getGlobalObjects=()=>({globalSources:Rc,zoneSymbolEventNames:Oc,eventNames:r,isBrowser:dc,isMix:pc,isNode:lc,TRUE_STR:Qa,FALSE_STR:Ja,ZONE_SYMBOL_PREFIX:ec,ADD_EVENT_LISTENER_STR:qa,REMOVE_EVENT_LISTENER_STR:Ka})})}(e)}(Wc),function(e){e.__load_patch("legacy",t=>{const n=t[e.__symbol__("legacyPatch")];n&&n()}),e.__load_patch("timers",e=>{const t="set",n="clear";Zc(e,t,n,"Timeout"),Zc(e,t,n,"Interval"),Zc(e,t,n,"Immediate")}),e.__load_patch("requestAnimationFrame",e=>{Zc(e,"request","cancel","AnimationFrame"),Zc(e,"mozRequest","mozCancel","AnimationFrame"),Zc(e,"webkitRequest","webkitCancel","AnimationFrame")}),e.__load_patch("blocking",(e,t)=>{const n=["alert","prompt","confirm"];for(let r=0;r<n.length;r++){bc(e,n[r],(n,r,o)=>function(r,s){return t.current.run(n,e,s,o)})}}),e.__load_patch("EventTarget",(e,t,n)=>{!function(e,t){t.patchEventPrototype(e,t)}(e,n),jc(e,n);const r=e.XMLHttpRequestEventTarget;r&&r.prototype&&n.patchEventTarget(e,n,[r.prototype])}),e.__load_patch("MutationObserver",(e,t,n)=>{vc("MutationObserver"),vc("WebKitMutationObserver")}),e.__load_patch("IntersectionObserver",(e,t,n)=>{vc("IntersectionObserver")}),e.__load_patch("FileReader",(e,t,n)=>{vc("FileReader")}),e.__load_patch("on_property",(e,t,n)=>{Hc(n,e)}),e.__load_patch("customElements",(e,t,n)=>{!function(e,t){const{isBrowser:n,isMix:r}=t.getGlobalObjects();if(!n&&!r||!e.customElements||!("customElements"in e))return;t.patchCallbacks(t,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"])}(e,n)}),e.__load_patch("XHR",(e,t)=>{!function(e){const c=e.XMLHttpRequest;if(!c)return;const u=c.prototype;let l=u[Ya],d=u[Xa];if(!l){const t=e.XMLHttpRequestEventTarget;if(t){const e=t.prototype;l=e[Ya],d=e[Xa]}}const p="readystatechange",h="scheduled";function f(e){const r=e.data,i=r.target;i[s]=!1,i[a]=!1;const c=i[o];l||(l=i[Ya],d=i[Xa]),c&&d.call(i,p,c);const u=i[o]=()=>{if(i.readyState===i.DONE)if(!r.aborted&&i[s]&&e.state===h){const n=i[t.__symbol__("loadfalse")];if(0!==i.status&&n&&n.length>0){const o=e.invoke;e.invoke=function(){const n=i[t.__symbol__("loadfalse")];for(let t=0;t<n.length;t++)n[t]===e&&n.splice(t,1);r.aborted||e.state!==h||o.call(e)},n.push(e)}else e.invoke()}else r.aborted||!1!==i[s]||(i[a]=!0)};l.call(i,p,u);return i[n]||(i[n]=e),b.apply(i,r.args),i[s]=!0,e}function g(){}function m(e){const t=e.data;return t.aborted=!0,C.apply(t.target,t.args)}const _=bc(u,"open",()=>function(e,t){return e[r]=0==t[2],e[i]=t[1],_.apply(e,t)}),y=rc("fetchTaskAborting"),v=rc("fetchTaskScheduling"),b=bc(u,"send",()=>function(e,n){if(!0===t.current[v])return b.apply(e,n);if(e[r])return b.apply(e,n);{const t={target:e,url:e[i],isPeriodic:!1,args:n,aborted:!1},r=nc("XMLHttpRequest.send",g,t,f,m);e&&!0===e[a]&&!t.aborted&&r.state===h&&r.invoke()}}),C=bc(u,"abort",()=>function(e,r){const o=e[n];if(o&&"string"==typeof o.type){if(null==o.cancelFn||o.data&&o.data.aborted)return;o.zone.cancelTask(o)}else if(!0===t.current[y])return C.apply(e,r)})}(e);const n=rc("xhrTask"),r=rc("xhrSync"),o=rc("xhrListener"),s=rc("xhrScheduled"),i=rc("xhrURL"),a=rc("xhrErrorBeforeScheduled")}),e.__load_patch("geolocation",e=>{e.navigator&&e.navigator.geolocation&&function(e,t){const n=e.constructor.name;for(let r=0;r<t.length;r++){const o=t[r],s=e[o];if(s){if(!cc(Va(e,o)))continue;e[o]=(e=>{const t=function(){return e.apply(this,ac(arguments,n+"."+o))};return Sc(t,e),t})(s)}}}(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),e.__load_patch("PromiseRejectionEvent",(e,t)=>{function n(t){return function(n){Dc(e,t).forEach(r=>{const o=e.PromiseRejectionEvent;if(o){const e=new o(t,{promise:n.promise,reason:n.rejection});r.invoke(e)}})}}e.PromiseRejectionEvent&&(t[rc("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),t[rc("rejectionHandledHandler")]=n("rejectionhandled"))}),e.__load_patch("queueMicrotask",(e,t,n)=>{Fc(e,n)})}(Wc);var qc;!function(e){e.METHOD_OPEN="open",e.METHOD_SEND="send",e.EVENT_ABORT="abort",e.EVENT_ERROR="error",e.EVENT_LOAD="loaded",e.EVENT_TIMEOUT="timeout"}(qc||(qc={}));const Kc=Un.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function Yc(e){return t=e,"undefined"!=typeof Document&&t instanceof Document?(new XMLSerializer).serializeToString(document).length:"string"==typeof e?Qc(e):e instanceof Blob?e.size:e instanceof FormData?function(e){let t=0;for(const[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}(e):e instanceof URLSearchParams?Qc(e.toString()):void 0!==e.byteLength?e.byteLength:void Kc.warn("unknown body type");var t}const Xc=new TextEncoder;function Qc(e){return Xc.encode(e).byteLength}function Jc(e){const t=function(){if(void 0===tu){const e=gr("OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS");e&&e.length>0?(tu={},e.forEach(e=>{tu[e]=!0})):tu=eu}return tu}(),n=e.toUpperCase();return n in t?n:"_OTHER"}const eu={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let tu;const nu={"https:":"443","http:":"80"};const ru="0.203.0";var ou;!function(e){e.HTTP_STATUS_TEXT="http.status_text"}(ou||(ou={}));class su extends Ma{component="xml-http-request";version=ru;moduleName=this.component;_tasksCount=0;_xhrMem=new WeakMap;_usedResources=new WeakSet;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-xml-http-request",ru,e),this._semconvStability=Da("http",e?.semconvStabilityOptIn)}init(){}_addHeaders(e,t){if(!ns(ts(t).href,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return Xn.inject(Fn.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}const n={};Xn.inject(Fn.active(),n),Object.keys(n).forEach(t=>{e.setRequestHeader(t,String(n[t]))})}_addChildSpan(e,t){Fn.with(Jn.setSpan(Fn.active(),e),()=>{const e=this.tracer.startSpan("CORS Preflight",{startTime:t[$o.FETCH_START]}),n=!(this._semconvStability&ka.OLD);Qo(e,t,this.getConfig().ignoreNetworkEvents,void 0,n),e.end(t[$o.RESPONSE_END])})}_addFinalSpanAttributes(e,t,n){if(this._semconvStability&ka.OLD){if(void 0!==t.status&&e.setAttribute("http.status_code",t.status),void 0!==t.statusText&&e.setAttribute(ou.HTTP_STATUS_TEXT,t.statusText),"string"==typeof n){const t=ts(n);e.setAttribute("http.host",t.host),e.setAttribute("http.scheme",t.protocol.replace(":",""))}e.setAttribute("http.user_agent",navigator.userAgent)}this._semconvStability&ka.STABLE&&t.status&&e.setAttribute(Ir,t.status)}_applyAttributesAfterXHR(e,t){const n=this.getConfig().applyCustomAttributesOnSpan;"function"==typeof n&&Na(()=>n(e,t),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_addResourceObserver(e,t){const n=this._xhrMem.get(e);n&&"function"==typeof PerformanceObserver&&"function"==typeof PerformanceResourceTiming&&(n.createdResources={observer:new PerformanceObserver(e=>{const r=e.getEntries(),o=ts(t);r.forEach(e=>{"xmlhttprequest"===e.initiatorType&&e.name===o.href&&n.createdResources&&n.createdResources.entries.push(e)})}),entries:[]},n.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(_r.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,n,r,o){if(!(n&&r&&o&&e.createdResources))return;let s=e.createdResources.entries;s&&s.length||(s=_r.getEntriesByType("resource"));const i=es(ts(n).href,r,o,s,this._usedResources);if(i.mainRequest){const e=i.mainRequest;this._markResourceAsUsed(e);const n=i.corsPreFlightRequest;n&&(this._addChildSpan(t,n),this._markResourceAsUsed(n));const r=!(this._semconvStability&ka.OLD);Qo(t,e,this.getConfig().ignoreNetworkEvents,void 0,r)}}_cleanPreviousSpanInformation(e){const t=this._xhrMem.get(e);if(t){const n=t.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(e)}}_createSpan(e,t,n){if(bo(t,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let r="";const o=ts(t),s={};if(this._semconvStability&ka.OLD&&(r=n.toUpperCase(),s["http.method"]=n,s["http.url"]=o.toString()),this._semconvStability&ka.STABLE){const e=n,t=Jc(n);r||(r=t),s[Sr]=t,t!==e&&(s[Tr]=e),s[Nr]=o.toString(),s[Er]=o.hostname;const i=function(e){const t=Number(e.port||nu[e.protocol]);return t&&!isNaN(t)?t:void 0}(o);i&&(s[wr]=i)}const i=this.tracer.startSpan(r,{kind:Nn.CLIENT,attributes:s});return i.addEvent(qc.METHOD_OPEN),this._cleanPreviousSpanInformation(e),this._xhrMem.set(e,{span:i,spanUrl:t}),i}_markResourceAsUsed(e){this._usedResources.add(e)}_patchOpen(){return e=>{const t=this;return function(...n){const r=n[0],o=n[1];return t._createSpan(this,o,r),e.apply(this,n)}}}_patchSend(){const e=this;function t(t,n,r,o){const s=e._xhrMem.get(n);if(!s)return;if(s.status=n.status,s.statusText=n.statusText,e._xhrMem.delete(n),s.span){const t=s.span;e._applyAttributesAfterXHR(t,n),e._semconvStability&ka.STABLE&&(r?o&&(t.setStatus({code:Ln.ERROR,message:o}),t.setAttribute(vr,o)):s.status&&s.status>=400&&(t.setStatus({code:Ln.ERROR}),t.setAttribute(vr,String(s.status))))}const i=Ur(),a=Date.now();setTimeout(()=>{!function(t,n,r,o){const s=n.callbackToRemoveEvents;"function"==typeof s&&s();const{span:i,spanUrl:a,sendStartTime:c}=n;i&&(e._findResourceAndAddNetworkEvents(n,i,a,c,r),i.addEvent(t,o),e._addFinalSpanAttributes(i,n,a),i.end(o),e._tasksCount--),e._clearResources()}(t,s,i,a)},300)}function n(){t(qc.EVENT_ERROR,this,!0,"error")}function r(){t(qc.EVENT_ABORT,this,!1)}function o(){t(qc.EVENT_TIMEOUT,this,!0,"timeout")}function s(){this.status<299?t(qc.EVENT_LOAD,this,!1):t(qc.EVENT_ERROR,this,!1)}return t=>function(...i){const a=e._xhrMem.get(this);if(!a)return t.apply(this,i);const c=a.span,u=a.spanUrl;if(c&&u){if(e.getConfig().measureRequestSize&&i?.[0]){const t=Yc(i[0]);void 0!==t&&(e._semconvStability&ka.OLD&&c.setAttribute("http.request_content_length_uncompressed",t),e._semconvStability&ka.STABLE&&c.setAttribute("http.request.body.size",t))}Fn.with(Jn.setSpan(Fn.active(),c),()=>{e._tasksCount++,a.sendStartTime=Ur(),c.addEvent(qc.METHOD_SEND),this.addEventListener("abort",r),this.addEventListener("error",n),this.addEventListener("load",s),this.addEventListener("timeout",o),a.callbackToRemoveEvents=()=>{!function(t){t.removeEventListener("abort",r),t.removeEventListener("error",n),t.removeEventListener("load",s),t.removeEventListener("timeout",o);const i=e._xhrMem.get(t);i&&(i.callbackToRemoveEvents=void 0)}(this),a.createdResources&&a.createdResources.observer.disconnect()},e._addHeaders(this,u),e._addResourceObserver(this,u)})}return t.apply(this,i)}}enable(){this._diag.debug("applying patch to",this.moduleName,this.version),La(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),La(XMLHttpRequest.prototype.send)&&(this._unwrap(XMLHttpRequest.prototype,"send"),this._diag.debug("removing previous patch from method send")),this._wrap(XMLHttpRequest.prototype,"open",this._patchOpen()),this._wrap(XMLHttpRequest.prototype,"send",this._patchSend())}disable(){this._diag.debug("removing patch from",this.moduleName,this.version),this._unwrap(XMLHttpRequest.prototype,"open"),this._unwrap(XMLHttpRequest.prototype,"send"),this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet}}var iu;!function(e){e.COMPONENT="component",e.HTTP_STATUS_TEXT="http.status_text"}(iu||(iu={}));var au={};Object.defineProperty(au,"__esModule",{value:!0});var cu=au.ATTR_HTTP_USER_AGENT=au.ATTR_HTTP_URL=au.ATTR_HTTP_STATUS_CODE=au.ATTR_HTTP_SCHEME=au.ATTR_HTTP_RESPONSE_CONTENT_LENGTH=au.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=au.ATTR_HTTP_REQUEST_BODY_SIZE=au.ATTR_HTTP_METHOD=au.ATTR_HTTP_HOST=void 0,uu=au.ATTR_HTTP_HOST="http.host",lu=au.ATTR_HTTP_METHOD="http.method",du=au.ATTR_HTTP_REQUEST_BODY_SIZE="http.request.body.size",pu=au.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED="http.request_content_length_uncompressed";au.ATTR_HTTP_RESPONSE_CONTENT_LENGTH="http.response_content_length";var hu=au.ATTR_HTTP_SCHEME="http.scheme",fu=au.ATTR_HTTP_STATUS_CODE="http.status_code",gu=au.ATTR_HTTP_URL="http.url";cu=au.ATTR_HTTP_USER_AGENT="http.user_agent";const mu=Un.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function _u(...e){if(e[0]instanceof URL||"string"==typeof e[0]){const t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){const{body:e,length:n}=function(e){if(!e.pipeThrough)return mu.warn("Platform has ReadableStream but not pipeThrough!"),{body:e,length:Promise.resolve(void 0)};let t,n=0;const r=new Promise(e=>{t=e}),o=new TransformStream({start(){},async transform(e,t){const r=await e;n+=r.byteLength,t.enqueue(e)},flush(){t(n)}});return{body:e.pipeThrough(o),length:r}}(t.body);return t.body=e,n}return Promise.resolve(function(e){if(t=e,"undefined"!=typeof Document&&t instanceof Document)return(new XMLSerializer).serializeToString(document).length;var t;if("string"==typeof e)return vu(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return function(e){let t=0;for(const[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}(e);if(e instanceof URLSearchParams)return vu(e.toString());if(void 0!==e.byteLength)return e.byteLength;return void mu.warn("unknown body type")}(t.body))}{const t=e[0];return t?.body?t.clone().text().then(e=>vu(e)):Promise.resolve()}}const yu=new TextEncoder;function vu(e){return yu.encode(e).byteLength}const bu={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let Cu;function Su(){if(void 0===Cu){const e=gr("OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS");e&&e.length>0?(Cu={},e.forEach(e=>{Cu[e]=!0})):Cu=bu}return Cu}const Tu={"https:":"443","http:":"80"};const Iu="0.203.0",Eu="object"==typeof process&&"node"===process.release?.name;class wu extends Ma{component="fetch";version=Iu;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-fetch",Iu,e),this._semconvStability=Da("http",e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){const n=this.tracer.startSpan("CORS Preflight",{startTime:t[$o.FETCH_START]},Jn.setSpan(Fn.active(),e)),r=!(this._semconvStability&ka.OLD);Qo(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[$o.RESPONSE_END])}_addFinalSpanAttributes(e,t){const n=ts(t.url);if(this._semconvStability&ka.OLD&&(e.setAttribute(fu,t.status),null!=t.statusText&&e.setAttribute(iu.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(uu,n.host),e.setAttribute(hu,n.protocol.replace(":","")),"undefined"!=typeof navigator&&e.setAttribute(cu,navigator.userAgent)),this._semconvStability&ka.STABLE){e.setAttribute(Ir,t.status),e.setAttribute(Er,n.hostname);const r=function(e){const t=Number(e.port||Tu[e.protocol]);return t&&!isNaN(t)?t:void 0}(n);r&&e.setAttribute(wr,r)}}_addHeaders(e,t){if(!ns(t,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return Xn.inject(Fn.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(e instanceof Request)Xn.inject(Fn.active(),e.headers,{set:(e,t,n)=>e.set(t,"string"==typeof n?n:String(n))});else if(e.headers instanceof Headers)Xn.inject(Fn.active(),e.headers,{set:(e,t,n)=>e.set(t,"string"==typeof n?n:String(n))});else if(e.headers instanceof Map)Xn.inject(Fn.active(),e.headers,{set:(e,t,n)=>e.set(t,"string"==typeof n?n:String(n))});else{const t={};Xn.inject(Fn.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(bo(e,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let n="";const r={};if(this._semconvStability&ka.OLD){const o=(t.method||"GET").toUpperCase();n=`HTTP ${o}`,r[iu.COMPONENT]=this.moduleName,r[lu]=o,r[gu]=e}if(this._semconvStability&ka.STABLE){const o=t.method,s=function(e){const t=Su(),n=e.toUpperCase();return n in t?n:"_OTHER"}(t.method||"GET");n||(n=s),r[Sr]=s,s!==o&&(r[Tr]=o),r[Nr]=e}return this.tracer.startSpan(n,{kind:Nn.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType("resource")}const o=es(t.spanUrl,t.startTime,n,r,this._usedResources,"fetch");if(o.mainRequest){const t=o.mainRequest;this._markResourceAsUsed(t);const n=o.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));const r=!(this._semconvStability&ka.OLD);Qo(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){const r=Pr(Date.now()),o=Ur();this._addFinalSpanAttributes(e,n),this._semconvStability&ka.STABLE&&n.status>=400&&(e.setStatus({code:Ln.ERROR}),e.setAttribute(vr,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,o),this._tasksCount--,this._clearResources(),e.end(r)},300)}_patchConstructor(){return e=>{const t=this;return function(...n){const r=this,o=ts(n[0]instanceof Request?n[0].url:String(n[0])).href,s=n[0]instanceof Request?n[0]:n[1]||{},i=t._createSpan(o,s);if(!i)return e.apply(this,n);const a=t._prepareSpanData(o);function c(e,n){t._applyAttributesAfterFetch(e,s,n),t._endSpan(e,a,{status:n.status||0,statusText:n.message,url:o})}function u(e,n){t._applyAttributesAfterFetch(e,s,n),n.status>=200&&n.status<400?t._endSpan(e,a,n):t._endSpan(e,a,{status:n.status,statusText:n.statusText,url:o})}function l(e,t,n){try{const t=n.clone().body;if(t){const r=t.getReader(),o=()=>{r.read().then(({done:t})=>{t?u(e,n):o()},t=>{c(e,t)})};o()}else u(e,n)}finally{t(n)}}function d(e,t,n){try{c(e,n)}finally{t(n)}}return t.getConfig().measureRequestSize&&_u(...n).then(e=>{e&&(t._semconvStability&ka.OLD&&i.setAttribute(pu,e),t._semconvStability&ka.STABLE&&i.setAttribute(du,e))}).catch(e=>{t._diag.warn("getFetchBodyLength",e)}),new Promise((n,a)=>Fn.with(Jn.setSpan(Fn.active(),i),()=>(t._addHeaders(s,o),t._callRequestHook(i,s),t._tasksCount++,e.apply(r,s instanceof Request?[s]:[o,s]).then(l.bind(r,i,n),d.bind(r,i,a)))))}}}_applyAttributesAfterFetch(e,t,n){const r=this.getConfig().applyCustomAttributesOnSpan;r&&Na(()=>r(e,t,n),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_callRequestHook(e,t){const n=this.getConfig().requestHook;n&&Na(()=>n(e,t),e=>{e&&this._diag.error("requestHook",e)})}_prepareSpanData(e){const t=Ur(),n=[];if("function"!=typeof PerformanceObserver)return{entries:n,startTime:t,spanUrl:e};const r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{"fetch"===t.initiatorType&&t.name===e&&n.push(t)})});return r.observe({entryTypes:["resource"]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){Eu?this._diag.warn("this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()"):(La(fetch)&&(this._unwrap(mr,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(mr,"fetch",this._patchConstructor()))}disable(){Eu||(this._unwrap(mr,"fetch"),this._usedResources=new WeakSet)}}class Au{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class ku extends Error{code;name="OTLPExporterError";data;constructor(e,t,n){super(e),this.data=n,this.code=t}}function Ou(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function Ru(e){if(null!=e)return()=>e}function Nu(e,t,n){return{timeoutMillis:Ou(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}class Lu{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);const t=()=>{const t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function Mu(e){return new Lu(e.concurrencyLimit)}function xu(){return{handleResponse(e){null!=e&&function(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}(e)&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&Un.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}class Du{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,n,r,o){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=o,this._diagLogger=Un.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit())return void t({code:Hr.FAILED,error:new Error("Concurrent export limit reached")});const n=this._serializer.serializeRequest(e);null!=n?this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if("success"!==e.status)"failure"===e.status&&e.error?t({code:Hr.FAILED,error:e.error}):"retryable"===e.status?t({code:Hr.FAILED,error:new ku("Export failed with retryable status")}):t({code:Hr.FAILED,error:new ku("Export failed with unknown error")});else{if(null!=e.data)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",t,e.data)}t({code:Hr.SUCCESS})}},e=>t({code:Hr.FAILED,error:e}))):t({code:Hr.FAILED,error:new Error("Nothing to send")})}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function Pu(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Fu(e){const t=new Uint8Array(e.length/2);let n=0;for(let r=0;r<e.length;r+=2){const o=Pu(e.charCodeAt(r)),s=Pu(e.charCodeAt(r+1));t[n++]=o<<4|s}return t}function Uu(e){const t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}const Zu="undefined"!=typeof BigInt?function(e){return Uu(e).toString()}:jr;function ju(e){return e}const Bu={encodeHrTime:function(e){const t=Uu(e);return n=t,{low:Number(BigInt.asUintN(32,n)),high:Number(BigInt.asUintN(32,n>>BigInt(32)))};var n},encodeSpanContext:Fu,encodeOptionalSpanContext:function(e){if(void 0!==e)return Fu(e)}};function zu(e){return{attributes:Hu(e.attributes),droppedAttributesCount:0}}function Vu(e){return{name:e.name,version:e.version}}function Hu(e){return Object.keys(e).map(t=>$u(t,e[t]))}function $u(e,t){return{key:e,value:Gu(t)}}function Gu(e){const t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(Gu)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map(([e,t])=>$u(e,t))}}:{}}function Wu(e,t){const n=e.spanContext(),r=e.status,o=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:o,traceState:n.traceState?.serialize(),name:e.name,kind:null==e.kind?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:Hu(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>function(e,t){return{attributes:e.attributes?Hu(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>function(e,t){return{attributes:e.attributes?Hu(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}(e,t)),droppedLinksCount:e.droppedLinksCount}}function qu(e,t){const n=function(e){return void 0===e?Bu:{encodeHrTime:Zu,encodeSpanContext:ju,encodeOptionalSpanContext:ju}}(t);return{resourceSpans:Ku(e,n)}}function Ku(e,t){const n=function(e){const t=new Map;for(const n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));const r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||""}:${n.instrumentationScope.schemaUrl||""}`;let o=e.get(r);o||(o=[],e.set(r,o)),o.push(n)}return t}(e),r=[],o=n.entries();let s=o.next();for(;!s.done;){const[e,n]=s.value,i=[],a=n.values();let c=a.next();for(;!c.done;){const e=c.value;if(e.length>0){const n=e.map(e=>Wu(e,t));i.push({scope:Vu(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=a.next()}const u={resource:zu(e),scopeSpans:i,schemaUrl:void 0};r.push(u),s=o.next()}return r}const Yu={serializeRequest:e=>{const t=qu(e,{});return(new TextEncoder).encode(JSON.stringify(t))},deserializeResponse:e=>{if(0===e.length)return{};const t=new TextDecoder;return JSON.parse(t.decode(e))}};class Xu{_parameters;_utils=null;constructor(e){this._parameters=e}async send(e,t){const{agent:n,send:r}=this._loadUtils();return new Promise(o=>{r(this._parameters,n,e,e=>{o(e)},t)})}shutdown(){}_loadUtils(){let e=this._utils;if(null===e){const{sendWithHttp:t,createHttpAgent:n}=require("./http-transport-utils");e=this._utils={agent:n(this._parameters.url,this._parameters.agentOptions),send:t}}return e}}function Qu(){return.4*Math.random()-.2}class Ju{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,o)=>{setTimeout(()=>{this._transport.send(e,t).then(r,o)},n)})}async send(e,t){const n=Date.now()+t;let r=await this._transport.send(e,t),o=5,s=1e3;for(;"retryable"===r.status&&o>0;){o--;const t=Math.max(Math.min(s,5e3)+Qu(),0);s*=1.5;const i=r.retryInMillis??t,a=n-Date.now();if(i>a)return r;r=await this.retry(e,a,i)}return r}shutdown(){return this._transport.shutdown()}}function el(e){return new Ju(e.transport)}function tl(e,t){return n={transport:el({transport:(o=e,new Xu(o))}),serializer:t,promiseHandler:Mu(e)},r={timeout:e.timeoutMillis},new Du(n.transport,n.serializer,xu(),n.promiseHandler,r.timeout);var n,r,o}function nl(e){const t=process.env[e]?.trim();if(null!=t&&""!==t){const n=Number(t);if(Number.isFinite(n)&&n>0)return n;Un.warn(`Configuration: ${e} is invalid, expected number greater than 0 (actual: ${t})`)}}function rl(e){const t=nl(`OTEL_EXPORTER_OTLP_${e}_TIMEOUT`),n=nl("OTEL_EXPORTER_OTLP_TIMEOUT");return t??n}function ol(e){const t=process.env[e]?.trim();if(""!==t)return null==t||"none"===t||"gzip"===t?t:void Un.warn(`Configuration: ${e} is invalid, expected 'none' or 'gzip' (actual: '${t}')`)}function sl(e){const t=ol(`OTEL_EXPORTER_OTLP_${e}_COMPRESSION`),n=ol("OTEL_EXPORTER_OTLP_COMPRESSION");return t??n}function il(e){return{timeoutMillis:rl(e),compression:sl(e)}}function al(e,t,n){const r={...n()},o={};return()=>(null!=t&&Object.assign(o,t()),null!=e&&Object.assign(o,e()),Object.assign(o,r))}function cl(e){if(null!=e)try{return new URL(e),e}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function ul(e){const t=process.env[`OTEL_EXPORTER_OTLP_${e}_HEADERS`]?.trim(),n=process.env.OTEL_EXPORTER_OTLP_HEADERS?.trim(),r=sr(t),o=sr(n);if(0!==Object.keys(r).length||0!==Object.keys(o).length)return Object.assign({},sr(n),sr(t))}function ll(e){const t=process.env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();if(null!=t&&""!==t)return function(e,t){try{new URL(e)}catch{return void Un.warn(`Configuration: Could not parse environment-provided export URL: '${e}', falling back to undefined`)}e.endsWith("/")||(e+="/"),e+=t;try{new URL(e)}catch{return void Un.warn(`Configuration: Provided URL appended with '${t}' is not a valid URL, using 'undefined' instead of '${e}'`)}return e}(t,e)}function dl(e){const t=process.env[`OTEL_EXPORTER_OTLP_${e}_ENDPOINT`]?.trim();if(null!=t&&""!==t)return function(e){try{return new URL(e).toString()}catch{return void Un.warn(`Configuration: Could not parse environment-provided export URL: '${e}', falling back to undefined`)}}(t)}function pl(e){return null!=e?.keepAlive&&(null!=e.httpAgentOptions?null==e.httpAgentOptions.keepAlive&&(e.httpAgentOptions.keepAlive=e.keepAlive):e.httpAgentOptions={keepAlive:e.keepAlive}),e.httpAgentOptions}function hl(e,t,n,r){return e.metadata&&Un.warn("Metadata cannot be set when using http"),o={url:e.url,headers:Ru(e.headers),concurrencyLimit:e.concurrencyLimit,timeoutMillis:e.timeoutMillis,compression:e.compression,agentOptions:pl(e)},s=function(e,t){return{...il(e),url:dl(e)??ll(t),headers:Ru(ul(e))}}(t,n),i=function(e,t){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none",headers:()=>e,url:"http://localhost:4318/"+t,agentOptions:{keepAlive:!0}}}(r,n),{...Nu(o,s,i),headers:al((a=o.headers,()=>{const e={};return Object.entries(a?.()??{}).forEach(([t,n])=>{void 0!==n?e[t]=String(n):Un.warn(`Header "${t}" has invalid value (${n}) and will be ignored`)}),e}),s.headers,i.headers),url:cl(o.url)??s.url??i.url,agentOptions:o.agentOptions??s.agentOptions??i.agentOptions};var o,s,i,a}class fl extends Au{constructor(e={}){super(tl(hl(e,"TRACES","v1/traces",{"User-Agent":"OTel-OTLP-Exporter-JavaScript/0.203.0","Content-Type":"application/json"}),Yu))}}const gl=(e,t)=>{const{serviceName:n,resourceAttributes:r,instrumentations:o=[],propagateTraceHeaderCorsUrls:s}=e,i=t,a=Eo({[Ar]:n,"at-project-id":e.projectId,...r||{}}),c=new fl({url:e.exporterEndpoint||"http://otelcol.apitoolkit.io:4318/v1/traces",headers:{}}),u=new qo({resource:a,spanProcessors:[new Uo(c)]});u.register({contextManager:new ja,propagator:new eo});const l=s||[/^https?:\/\/.*/],d=[/^https?:\/\/(?:[^\/]+\.)?apitoolkit\.io\//,/^https?:\/\/(?:[^\/]+\.)?monoscope\.tech\//];!function(e){const t=e.tracerProvider||Jn.getTracerProvider(),n=e.meterProvider||Bn.getMeterProvider(),r=e.loggerProvider||ps.getLoggerProvider(),o=e.instrumentations?.flat()??[];(function(e,t,n,r){for(let o=0,s=e.length;o<s;o++){const s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}})(o,t,n,r)}({tracerProvider:u,instrumentations:[...o,new Ua({applyCustomAttributesOnSpan:{documentLoad:e=>{e.setAttribute("session.id",i)},documentFetch:e=>{e.setAttribute("session.id",i)},resourceFetch:e=>{e.setAttribute("session.id",i)}}}),new su({propagateTraceHeaderCorsUrls:l,ignoreUrls:d,applyCustomAttributesOnSpan:(e,t)=>{e.setAttribute("session.id",i)}}),new wu({propagateTraceHeaderCorsUrls:l,ignoreUrls:d,applyCustomAttributesOnSpan:(e,t)=>{e.setAttribute("session.id",i)}})]})},ml=[];for(let e=0;e<256;++e)ml.push((e+256).toString(16).slice(1));let _l;const yl=new Uint8Array(16);var vl={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function bl(e,t,n){if(vl.randomUUID&&!e)return vl.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!_l){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");_l=crypto.getRandomValues.bind(crypto)}return _l(yl)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(ml[e[t+0]]+ml[e[t+1]]+ml[e[t+2]]+ml[e[t+3]]+"-"+ml[e[t+4]]+ml[e[t+5]]+"-"+ml[e[t+6]]+ml[e[t+7]]+"-"+ml[e[t+8]]+ml[e[t+9]]+"-"+ml[e[t+10]]+ml[e[t+11]]+ml[e[t+12]]+ml[e[t+13]]+ml[e[t+14]]+ml[e[t+15]]).toLowerCase()}(r)}return class{constructor(e){if(!e.projectId)throw new Error("MonoscopeConfig must include projectId");const t=sessionStorage.getItem("monoscope-session-id");t?this.sessionId=t:(this.sessionId=bl(),sessionStorage.setItem("monoscope-session-id",this.sessionId)),gl(e,this.sessionId),this.config=e,this.replay=new it(e,this.sessionId),this.replay.configure()}getSessionId(){return this.sessionId}}});
|
|
21
|
+
//# sourceMappingURL=monoscopetech-browser.umd.js.map
|