@monoscopetech/browser 0.5.3 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function tc(e,t,r,n){return new(r||(r=Promise))(function(t,o){function s(e){try{a(n.next(e))}catch(e){o(e)}}function i(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r(function(e){e(n)})).then(s,i)}a((n=n.apply(e,[])).next())})}for(var rc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),oc=0;oc<64;oc++)nc[rc.charCodeAt(oc)]=oc;const sc=new Map;const ic=(e,t,r)=>{if(!e||!cc(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=sc.get(e);return r||(r=new Map,sc.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let o=n.indexOf(e);return-1===o&&(o=n.length,n.push(e)),o};function ac(e,t,r){if(e instanceof Array)return e.map(e=>ac(e,t,r));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,r=function(e){var t,r=new Uint8Array(e),n=r.length,o="";for(t=0;t<n;t+=3)o+=rc[r[t]>>2],o+=rc[(3&r[t])<<4|r[t+1]>>4],o+=rc[(15&r[t+1])<<2|r[t+2]>>6],o+=rc[63&r[t+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:r}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[ac(e.buffer,t,r),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[ac(e.data,t,r),e.width,e.height]}}if(cc(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:ic(e,t,r)}}return e}const lc=(e,t,r)=>[...e].map(e=>ac(e,t,r)),cc=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(r.find(r=>e instanceof t[r]))};function uc(e,t,r){const n=[];try{const o=pl(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(n,...o){return ml(this,t,r,!0)||"__context"in this||(this.__context=n),e.apply(this,[n,...o])}});n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(e=>e())}}function hc(e,t,r,n,o,s,i){const a=[],l=Object.getOwnPropertyNames(e);for(const s of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))try{if("function"!=typeof e[s])continue;const l=pl(e,s,function(e){return function(...a){const l=e.apply(this,a);if(ic(l,i,this),!ml(this.canvas,n,o,!0)){const e=lc([...a],i,this),n={type:t,property:s,args:e};r(this.canvas,n)}return l}});a.push(l)}catch(n){const o=hl(e,s,{set(e){r(this.canvas,{type:t,property:s,args:[e],setter:!0})}});a.push(o)}return a}var pc=null;try{var dc="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");pc=dc.Worker}catch(e){}function fc(e,t,r){var n=function(e){return Buffer.from(e,"base64").toString("utf8")}(e),o=n.indexOf("\n",10)+1,s=n.substring(o)+"";return function(e){return new pc(s,Object.assign({},e,{eval:!0}))}}function mc(e,t,r){var n=function(e){return atob(e)}(e),o=n.indexOf("\n",10)+1,s=n.substring(o)+"",i=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(i)}var gc="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var yc=function(e){return gc?fc(e):function(e){var t;return function(r){return t=t||mc(e),new Worker(t,r)}}(e)}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=");class bc{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:r,blockClass:n,blockSelector:o,recordCanvas:s,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(r,n,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,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,r,n,o){const s=uc(t,r,n),i=new Map,a=new yc;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:o,height:s}=e.data;this.mutationCb({id:t,type:El["2D"],commands:[{property:"clearRect",args:[0,0,o,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};const l=1e3/e;let c,u=0;const h=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{ml(t,r,n,!0)||e.push(t)}),e})().forEach(e=>tc(this,0,void 0,function*(){var t;const r=this.mirror.getId(e);if(i.get(r))return;if(i.set(r,!0),["webgl","webgl2"].includes(e.__context)){const r=e.getContext(e.__context);!1===(null===(t=null==r?void 0:r.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==r||r.clear(r.COLOR_BUFFER_BIT))}const n=yield createImageBitmap(e);a.postMessage({id:r,bitmap:n,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[n])}))),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=uc(e,t,r),o=function(e,t,r,n){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const s=pl(t.CanvasRenderingContext2D.prototype,i,function(o){return function(...s){return ml(this.canvas,r,n,!0)||setTimeout(()=>{const r=lc([...s],t,this);e(this.canvas,{type:El["2D"],property:i,args:r})},0),o.apply(this,s)}});o.push(s)}catch(r){const n=hl(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:El["2D"],property:i,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),s=function(e,t,r,n){const o=[];return o.push(...hc(t.WebGLRenderingContext.prototype,El.WebGL,e,r,n,0,t)),void 0!==t.WebGL2RenderingContext&&o.push(...hc(t.WebGL2RenderingContext.prototype,El.WebGL2,e,r,n,0,t)),()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r,this.mirror);this.resetObservers=()=>{n(),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 r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;const n=r.map(e=>{const t=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["type"]);return t}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}class vc{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Sl,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 r={id:t,styleIds:[]},n=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const r=Array.from(t.rules||CSSRule);n.push({styleId:e,rules:r.map((e,t)=>({rule:Fa(e),index:t}))})}r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function wc(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let Cc,Sc,_c,Ic=!1;const Ac=new Ba;function Ec(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:i="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:c=!0,maskAllInputs:u,maskInputOptions:h,slimDOMOptions:p,maskInputFn:d,maskTextFn:f,hooks:m,packFn:g,sampling:y={},dataURLOptions:b={},mousemoveWait:v,recordCanvas:w=!1,recordCrossOriginIframes:C=!1,userTriggeredOnInput:S=!1,collectFonts:_=!1,inlineImages:I=!1,plugins:A,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:T=new Set([])}=e,k=!C||window.parent===window;let O=!1;if(!k)try{window.parent.document,O=!1}catch(e){O=!0}if(k&&!t)throw new Error("emit function is required");void 0!==v&&void 0===y.mousemove&&(y.mousemove=v),Ac.reset();const R=!0===u?{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!==h?h:{password:!0},x=!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 N;!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 M=0;const L=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return g&&(e=g(e)),e};Cc=(e,o)=>{var s;if(!(null===(s=Pl[0])||void 0===s?void 0:s.isFrozen())||e.type===_l.FullSnapshot||e.type===_l.IncrementalSnapshot&&e.data.source===Il.Mutation||Pl.forEach(e=>e.unfreeze()),k)null==t||t(L(e),o);else if(O){const t={type:"rrweb",event:L(e),isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===_l.FullSnapshot)N=e,M=0;else if(e.type===_l.IncrementalSnapshot){if(e.data.source===Il.Mutation&&e.data.isAttachIframe)return;M++;const t=n&&M>=n,o=r&&e.timestamp-N.timestamp>r;(t||o)&&Sc(!0)}};const D=e=>{Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Mutation},e)}))},P=e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Scroll},e)})),F=e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.CanvasMutation},e)})),B=new vc({mutationCb:D,adoptedStyleSheetCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.AdoptedStyleSheet},e)}))}),U=new $l({mirror:Ac,mutationCb:D,stylesheetManager:B,recordCrossOriginIframes:C,wrappedEmit:Cc});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:Ac,crossOriginIframeMirror:U.crossOriginIframeMirror,crossOriginIframeStyleMirror:U.crossOriginIframeStyleMirror});_c=new bc({recordCanvas:w,mutationCb:F,win:window,blockClass:o,blockSelector:s,mirror:Ac,sampling:y.canvas,dataURLOptions:b});const Z=new ec({mutationCb:D,scrollCb:P,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskInputOptions:R,dataURLOptions:b,maskTextFn:f,maskInputFn:d,recordCanvas:w,inlineImages:I,sampling:y,slimDOMOptions:x,iframeManager:U,stylesheetManager:B,canvasManager:_c,keepIframeSrcFn:E},mirror:Ac});Sc=(e=!1)=>{var t,r,n,i,u,h;Cc(wc({type:_l.Meta,data:{href:window.location.href,width:fl(),height:dl()}}),e),B.reset(),Pl.forEach(e=>e.lock());const p=function(e,t){var r=t||{},n=r.mirror,o=void 0===n?new Ba:n,s=r.blockClass,i=void 0===s?"rr-block":s,a=r.blockSelector,l=void 0===a?null:a,c=r.maskTextClass,u=void 0===c?"rr-mask":c,h=r.maskTextSelector,p=void 0===h?null:h,d=r.inlineStylesheet,f=void 0===d||d,m=r.inlineImages,g=void 0!==m&&m,y=r.recordCanvas,b=void 0!==y&&y,v=r.maskAllInputs,w=void 0!==v&&v,C=r.maskTextFn,S=r.maskInputFn,_=r.slimDOM,I=void 0!==_&&_,A=r.dataURLOptions,E=r.preserveWhiteSpace,T=r.onSerialize,k=r.onIframeLoad,O=r.iframeLoadTimeout,R=r.onStylesheetLoad,x=r.stylesheetLoadTimeout,N=r.keepIframeSrcFn;return il(e,{doc:e,mirror:o,blockClass:i,blockSelector:l,maskTextClass:u,maskTextSelector:p,skipChild:!1,inlineStylesheet:f,maskInputOptions:!0===w?{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===w?{password:!0}:w,maskTextFn:C,maskInputFn:S,slimDOMOptions:!0===I||"all"===I?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===I,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===I?{}:I,dataURLOptions:A,inlineImages:g,recordCanvas:b,preserveWhiteSpace:E,onSerialize:T,onIframeLoad:k,iframeLoadTimeout:O,onStylesheetLoad:R,stylesheetLoadTimeout:x,keepIframeSrcFn:void 0===N?function(){return!1}:N,newlyAddedElement:!1})}(document,{mirror:Ac,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskAllInputs:R,maskTextFn:f,slimDOM:x,dataURLOptions:b,recordCanvas:w,inlineImages:I,onSerialize:e=>{vl(e,Ac)&&U.addIframe(e),wl(e,Ac)&&B.trackLinkElement(e),Cl(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{U.attachIframe(e,t),Z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{B.attachLinkElement(e,t)},keepIframeSrcFn:E});if(!p)return console.warn("Failed to snapshot the document");Cc(wc({type:_l.FullSnapshot,data:{node:p,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(r=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===r?void 0:r.scrollLeft)||(null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(u=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===u?void 0:u.scrollTop)||(null===(h=null===document||void 0===document?void 0:document.body)||void 0===h?void 0:h.scrollTop)||0}}})),Pl.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&B.adoptStyleSheets(document.adoptedStyleSheets,Ac.getId(document))};try{const e=[];e.push(al("DOMContentLoaded",()=>{Cc(wc({type:_l.DomContentLoaded,data:{}}))}));const t=e=>{var t;return ql({mutationCb:D,mousemoveCb:(e,t)=>Cc(wc({type:_l.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.MouseInteraction},e)})),scrollCb:P,viewportResizeCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.ViewportResize},e)})),inputCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Input},e)})),mediaInteractionCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.MediaInteraction},e)})),styleSheetRuleCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.StyleSheetRule},e)})),styleDeclarationCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.StyleDeclaration},e)})),canvasMutationCb:F,fontCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Font},e)})),selectionCb:e=>{Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Selection},e)}))},blockClass:o,ignoreClass:i,maskTextClass:a,maskTextSelector:l,maskInputOptions:R,inlineStylesheet:c,sampling:y,recordCanvas:w,inlineImages:I,userTriggeredOnInput:S,collectFonts:_,doc:e,maskInputFn:d,maskTextFn:f,keepIframeSrcFn:E,blockSelector:s,slimDOMOptions:x,dataURLOptions:b,mirror:Ac,iframeManager:U,stylesheetManager:B,shadowDomManager:Z,canvasManager:_c,ignoreCSSAttributes:T,plugins:(null===(t=null==A?void 0:A.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Cc(wc({type:_l.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},m)};U.addLoadListener(r=>{e.push(t(r.contentDocument))});const r=()=>{Sc(),e.push(t(document)),Ic=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():e.push(al("load",()=>{Cc(wc({type:_l.Load,data:{}})),r()},window)),()=>{e.forEach(e=>e()),Ic=!1}}catch(e){console.warn(e)}}Ec.addCustomEvent=(e,t)=>{if(!Ic)throw new Error("please add custom event after start recording");Cc(wc({type:_l.Custom,data:{tag:e,payload:t}}))},Ec.freezePage=()=>{Pl.forEach(e=>e.freeze())},Ec.takeFullSnapshot=e=>{if(!Ic)throw new Error("please take full snapshot after start recording");Sc(e)},Ec.mirror=Ac;class Tc{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(){var e;Ec({emit:e=>{this.events.push(e)},plugins:[(e={level:["info","log","warn","error"],lengthThreshold:1e4,stringifyOptions:{stringLengthLimit:1e3,numOfKeysLimit:100,depthOfLimit:1}},{name:"rrweb/console@1",observer:Na,options: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 r=this.events;this.events=[];const n=JSON.stringify({events:r,sessionId:this.sessionId,timestamp:(new Date).toISOString()});fetch(e,{mode:"no-cors",method:"POST",headers:{"Content-Type":"application/json"},body:n}).catch(e=>{console.error("Failed to save replay events:",e),this.events=[...r,...this.events]})}}var kc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Oc="1.9.0",Rc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var xc=function(e){var t=new Set([e]),r=new Set,n=e.match(Rc);if(!n)return function(){return!1};var o=+n[1],s=+n[2],i=+n[3];if(null!=n[4])return function(t){return t===e};function a(e){return r.add(e),!1}function l(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;var n=e.match(Rc);if(!n)return a(e);var c=+n[1],u=+n[2],h=+n[3];return null!=n[4]||o!==c?a(e):0===o?s===u&&i<=h?l(e):a(e):s<=u?l(e):a(e)}}(Oc),Nc=Oc.split(".")[0],Mc=Symbol.for("opentelemetry.js.api."+Nc),Lc=kc;function Dc(e,t,r,n){var o;void 0===n&&(n=!1);var s=Lc[Mc]=null!==(o=Lc[Mc])&&void 0!==o?o:{version:Oc};if(!n&&s[e]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(i.stack||i.message),!1}if(s.version!==Oc){i=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+e+" does not match previously registered API v"+Oc);return r.error(i.stack||i.message),!1}return s[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+Oc+"."),!0}function Pc(e){var t,r,n=null===(t=Lc[Mc])||void 0===t?void 0:t.version;if(n&&xc(n))return null===(r=Lc[Mc])||void 0===r?void 0:r[e]}function Fc(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Oc+".");var r=Lc[Mc];r&&delete r[e]}var Bc,Uc=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i},Zc=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,s=t.length;o<s;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},jc=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 zc("debug",this._namespace,e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zc("error",this._namespace,e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zc("info",this._namespace,e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zc("warn",this._namespace,e)},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zc("verbose",this._namespace,e)},e}();function zc(e,t,r){var n=Pc("diag");if(n)return r.unshift(t),n[e].apply(n,Zc([],Uc(r),!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"}(Bc||(Bc={}));var Vc=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i},Gc=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,s=t.length;o<s;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},Wc=function(){function e(){function e(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=Pc("diag");if(n)return n[e].apply(n,Gc([],Vc(t),!1))}}var t=this;t.setLogger=function(e,r){var n,o,s;if(void 0===r&&(r={logLevel:Bc.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!==(n=i.stack)&&void 0!==n?n:i.message),!1}"number"==typeof r&&(r={logLevel:r});var a=Pc("diag"),l=function(e,t){function r(r,n){var o=t[r];return"function"==typeof o&&e>=n?o.bind(t):function(){}}return e<Bc.NONE?e=Bc.NONE:e>Bc.ALL&&(e=Bc.ALL),t=t||{},{error:r("error",Bc.ERROR),warn:r("warn",Bc.WARN),info:r("info",Bc.INFO),debug:r("debug",Bc.DEBUG),verbose:r("verbose",Bc.VERBOSE)}}(null!==(o=r.logLevel)&&void 0!==o?o:Bc.INFO,e);if(a&&!r.suppressOverrideMessage){var c=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+c),l.warn("Current logger will overwrite one already registered from "+c)}return Dc("diag",l,t,!0)},t.disable=function(){Fc("diag",t)},t.createComponentLogger=function(e){return new jc(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}(),Hc=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i},Yc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Kc=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=Hc(e,2);return[t[0],t[1]]})},e.prototype.setEntry=function(t,r){var n=new e(this._entries);return n._entries.set(t,r),n},e.prototype.removeEntry=function(t){var r=new e(this._entries);return r._entries.delete(t),r},e.prototype.removeEntries=function(){for(var t,r,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var s=new e(this._entries);try{for(var i=Yc(n),a=i.next();!a.done;a=i.next()){var l=a.value;s._entries.delete(l)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return s},e.prototype.clear=function(){return new e},e}(),Jc=Symbol("BaggageEntryMetadata"),Xc=Wc.instance();function qc(e){return void 0===e&&(e={}),new Kc(new Map(Object.entries(e)))}function Qc(e){return Symbol.for(e)}var $c,eu,tu=function e(t){var r=this;r._currentContext=t?new Map(t):new Map,r.getValue=function(e){return r._currentContext.get(e)},r.setValue=function(t,n){var o=new e(r._currentContext);return o._currentContext.set(t,n),o},r.deleteValue=function(t){var n=new e(r._currentContext);return n._currentContext.delete(t),n}},ru=new tu,nu=($c=function(e,t){return $c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},$c(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 r(){this.constructor=e}$c(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),ou=function(){function e(){}return e.prototype.createGauge=function(e,t){return gu},e.prototype.createHistogram=function(e,t){return yu},e.prototype.createCounter=function(e,t){return mu},e.prototype.createUpDownCounter=function(e,t){return bu},e.prototype.createObservableGauge=function(e,t){return wu},e.prototype.createObservableCounter=function(e,t){return vu},e.prototype.createObservableUpDownCounter=function(e,t){return Cu},e.prototype.addBatchObservableCallback=function(e,t){},e.prototype.removeBatchObservableCallback=function(e){},e}(),su=function(){},iu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t.prototype.add=function(e,t){},t}(su),au=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t.prototype.add=function(e,t){},t}(su),lu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t.prototype.record=function(e,t){},t}(su),cu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t.prototype.record=function(e,t){},t}(su),uu=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e}(),hu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t}(uu),pu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t}(uu),du=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t}(uu),fu=new ou,mu=new iu,gu=new lu,yu=new cu,bu=new au,vu=new hu,wu=new pu,Cu=new du,Su={get:function(e,t){if(null!=e)return e[t]},keys:function(e){return null==e?[]:Object.keys(e)}},_u={set:function(e,t,r){null!=e&&(e[t]=r)}},Iu=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i},Au=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,s=t.length;o<s;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},Eu=function(){function e(){}return e.prototype.active=function(){return ru},e.prototype.with=function(e,t,r){for(var n=[],o=3;o<arguments.length;o++)n[o-3]=arguments[o];return t.call.apply(t,Au([r],Iu(n),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),Tu=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i},ku=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,s=t.length;o<s;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},Ou="context",Ru=new Eu,xu=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return Dc(Ou,e,Wc.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,r){for(var n,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];return(n=this._getContextManager()).with.apply(n,ku([e,t,r],Tu(o),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return Pc(Ou)||Ru},e.prototype.disable=function(){this._getContextManager().disable(),Fc(Ou,Wc.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(eu||(eu={}));var Nu="0000000000000000",Mu="00000000000000000000000000000000",Lu={traceId:Mu,spanId:Nu,traceFlags:eu.NONE},Du=function(){function e(e){void 0===e&&(e=Lu),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}(),Pu=Qc("OpenTelemetry Context Key SPAN");function Fu(e){return e.getValue(Pu)||void 0}function Bu(){return Fu(xu.getInstance().active())}function Uu(e,t){return e.setValue(Pu,t)}function Zu(e){return e.deleteValue(Pu)}function ju(e,t){return Uu(e,new Du(t))}function zu(e){var t;return null===(t=Fu(e))||void 0===t?void 0:t.spanContext()}var Vu=/^([0-9a-f]{32})$/i,Gu=/^[0-9a-f]{16}$/i;function Wu(e){return Vu.test(e)&&e!==Mu}function Hu(e){return Wu(e.traceId)&&(t=e.spanId,Gu.test(t)&&t!==Nu);var t}function Yu(e){return new Du(e)}var Ku=xu.getInstance(),Ju=function(){function e(){}return e.prototype.startSpan=function(e,t,r){if(void 0===r&&(r=Ku.active()),Boolean(null==t?void 0:t.root))return new Du;var n,o=r&&zu(r);return"object"==typeof(n=o)&&"string"==typeof n.spanId&&"string"==typeof n.traceId&&"number"==typeof n.traceFlags&&Hu(o)?new Du(o):new Du},e.prototype.startActiveSpan=function(e,t,r,n){var o,s,i;if(!(arguments.length<2)){2===arguments.length?i=t:3===arguments.length?(o=t,i=r):(o=t,s=r,i=n);var a=null!=s?s:Ku.active(),l=this.startSpan(e,o,a),c=Uu(a,l);return Ku.with(c,i,void 0,l)}},e}();var Xu,qu,Qu,$u=new Ju,eh=function(){function e(e,t,r,n){this._provider=e,this.name=t,this.version=r,this.options=n}return e.prototype.startSpan=function(e,t,r){return this._getTracer().startSpan(e,t,r)},e.prototype.startActiveSpan=function(e,t,r,n){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):$u},e}(),th=new(function(){function e(){}return e.prototype.getTracer=function(e,t,r){return new Ju},e}()),rh=function(){function e(){}return e.prototype.getTracer=function(e,t,r){var n;return null!==(n=this.getDelegateTracer(e,t,r))&&void 0!==n?n:new eh(this,e,t,r)},e.prototype.getDelegate=function(){var e;return null!==(e=this._delegate)&&void 0!==e?e:th},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,r){var n;return null===(n=this._delegate)||void 0===n?void 0:n.getTracer(e,t,r)},e}();!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(Xu||(Xu={})),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"}(qu||(qu={})),function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}(Qu||(Qu={}));var nh=xu.getInstance(),oh=Wc.instance(),sh=new(function(){function e(){}return e.prototype.getMeter=function(e,t,r){return fu},e}()),ih="metrics",ah=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalMeterProvider=function(e){return Dc(ih,e,Wc.instance())},e.prototype.getMeterProvider=function(){return Pc(ih)||sh},e.prototype.getMeter=function(e,t,r){return this.getMeterProvider().getMeter(e,t,r)},e.prototype.disable=function(){Fc(ih,Wc.instance())},e}().getInstance(),lh=function(){function e(){}return e.prototype.inject=function(e,t){},e.prototype.extract=function(e,t){return e},e.prototype.fields=function(){return[]},e}(),ch=Qc("OpenTelemetry Baggage Key");function uh(e){return e.getValue(ch)||void 0}function hh(){return uh(xu.getInstance().active())}function ph(e,t){return e.setValue(ch,t)}function dh(e){return e.deleteValue(ch)}var fh="propagation",mh=new lh,gh=function(){function e(){this.createBaggage=qc,this.getBaggage=uh,this.getActiveBaggage=hh,this.setBaggage=ph,this.deleteBaggage=dh}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(e){return Dc(fh,e,Wc.instance())},e.prototype.inject=function(e,t,r){return void 0===r&&(r=_u),this._getGlobalPropagator().inject(e,t,r)},e.prototype.extract=function(e,t,r){return void 0===r&&(r=Su),this._getGlobalPropagator().extract(e,t,r)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){Fc(fh,Wc.instance())},e.prototype._getGlobalPropagator=function(){return Pc(fh)||mh},e}(),yh=gh.getInstance(),bh="trace",vh=function(){function e(){this._proxyTracerProvider=new rh,this.wrapSpanContext=Yu,this.isSpanContextValid=Hu,this.deleteSpan=Zu,this.getSpan=Fu,this.getActiveSpan=Bu,this.getSpanContext=zu,this.setSpan=Uu,this.setSpanContext=ju}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=Dc(bh,this._proxyTracerProvider,Wc.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return Pc(bh)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){Fc(bh,Wc.instance()),this._proxyTracerProvider=new rh},e}().getInstance();const wh=Qc("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Ch(e){return!0===e.getValue(wh)}const Sh="baggage";function _h(e){const t=e.split(";");if(t.length<=0)return;const r=t.shift();if(!r)return;const n=r.indexOf("=");if(n<=0)return;const o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim());let i;var a;return t.length>0&&("string"!=typeof(a=t.join(";"))&&(Xc.error("Cannot create baggage metadata from unknown type: "+typeof a),a=""),i={__TYPE__:Jc,toString:function(){return a}}),{key:o,value:s,metadata:i}}class Ih{inject(e,t,r){const n=yh.getBaggage(e);if(!n||Ch(e))return;const o=function(e){return e.getAllEntries().map(([e,t])=>{let r=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return void 0!==t.metadata&&(r+=";"+t.metadata.toString()),r})}(n).filter(e=>e.length<=4096).slice(0,180),s=function(e){return e.reduce((e,t)=>{const r=`${e}${""!==e?",":""}${t}`;return r.length>8192?e:r},"")}(o);s.length>0&&r.set(t,Sh,s)}extract(e,t,r){const n=r.get(t,Sh),o=Array.isArray(n)?n.join(","):n;if(!o)return e;const s={};if(0===o.length)return e;return o.split(",").forEach(e=>{const t=_h(e);if(t){const e={value:t.value};t.metadata&&(e.metadata=t.metadata),s[t.key]=e}}),0===Object.entries(s).length?e:yh.setBaggage(e,yh.createBaggage(s))}fields(){return[Sh]}}function Ah(e){const t={};if("object"!=typeof e||null==e)return t;for(const[r,n]of Object.entries(e))Eh(r)?Th(n)?Array.isArray(n)?t[r]=n.slice():t[r]=n:oh.warn(`Invalid attribute value set for key: ${r}`):oh.warn(`Invalid attribute key: ${r}`);return t}function Eh(e){return"string"==typeof e&&e.length>0}function Th(e){return null==e||(Array.isArray(e)?function(e){let t;for(const r of e)if(null!=r){if(!t){if(kh(r)){t=typeof r;continue}return!1}if(typeof r!==t)return!1}return!0}(e):kh(e))}function kh(e){switch(typeof e){case"number":case"boolean":case"string":return!0}return!1}let Oh=e=>{oh.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){const t={};let r=e;for(;null!==r;)Object.getOwnPropertyNames(r).forEach(e=>{if(t[e])return;const n=r[e];n&&(t[e]=String(n))}),r=Object.getPrototypeOf(r);return t}(e))}(e))};function Rh(e){try{Oh(e)}catch{}}const xh="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Nh=performance,Mh="http.url",Lh="error.type",Dh="exception.message",Ph="exception.type",Fh="http.request.method",Bh="http.request.method_original",Uh="http.response.status_code",Zh="server.address",jh="server.port",zh="service.name",Vh="telemetry.sdk.language",Gh="telemetry.sdk.name",Wh="telemetry.sdk.version",Hh="url.full",Yh="process.runtime.name",Kh={[Gh]:"opentelemetry",[Yh]:"browser",[Vh]:"webjs",[Wh]:"2.0.1"};const Jh=Math.pow(10,6),Xh=Math.pow(10,9);function qh(e){const t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Jh)]}function Qh(){let e=Nh.timeOrigin;if("number"!=typeof e){const t=Nh;e=t.timing&&t.timing.fetchStart}return e}function $h(e){return op(qh(Qh()),qh("number"==typeof e?e:Nh.now()))}function ep(e){if(rp(e))return e;if("number"==typeof e)return e<Qh()?$h(e):qh(e);if(e instanceof Date)return qh(e.getTime());throw TypeError("Invalid input type")}function tp(e){return e[0]*Xh+e[1]}function rp(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function np(e){return rp(e)||"number"==typeof e||e instanceof Date}function op(e,t){const r=[e[0]+t[0],e[1]+t[1]];return r[1]>=Xh&&(r[1]-=Xh,r[0]+=1),r}var sp;!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(sp||(sp={}));class ip{_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,r){for(const n of this._propagators)try{n.inject(e,t,r)}catch(e){oh.warn(`Failed to inject with ${n.constructor.name}. Err: ${e.message}`)}}extract(e,t,r){return this._propagators.reduce((e,n)=>{try{return n.extract(e,t,r)}catch(e){oh.warn(`Failed to extract with ${n.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}const ap="[_0-9a-z-*/]",lp=new RegExp(`^(?:${`[a-z]${ap}{0,255}`}|${`[a-z0-9]${ap}{0,240}@[a-z]${ap}{0,13}`})$`),cp=/^[ -~]{0,255}[!-~]$/,up=/,|=/;class hp{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,t){const r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,t),r}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 r=t.trim(),n=r.indexOf("=");if(-1!==n){const o=r.slice(0,n),s=r.slice(n+1,t.length);(function(e){return lp.test(e)})(o)&&function(e){return cp.test(e)&&!up.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 hp;return e._internalState=new Map(this._internalState),e}}const pp="traceparent",dp="tracestate",fp=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");class mp{inject(e,t,r){const n=vh.getSpanContext(e);if(!n||Ch(e)||!Hu(n))return;const o=`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||eu.NONE).toString(16)}`;r.set(t,pp,o),n.traceState&&r.set(t,dp,n.traceState.serialize())}extract(e,t,r){const n=r.get(t,pp);if(!n)return e;const o=Array.isArray(n)?n[0]:n;if("string"!=typeof o)return e;const s=function(e){const t=fp.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=r.get(t,dp);if(i){const e=Array.isArray(i)?i.join(","):i;s.traceState=new hp("string"==typeof e?e:void 0)}return vh.setSpanContext(e,s)}fields(){return[pp,dp]}}const gp="[object Null]",yp="[object Undefined]",bp=Function.prototype.toString,vp=bp.call(Object),wp=Object.getPrototypeOf,Cp=Object.prototype,Sp=Cp.hasOwnProperty,_p=Symbol?Symbol.toStringTag:void 0,Ip=Cp.toString;function Ap(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!==function(e){if(null==e)return void 0===e?yp:gp;return _p&&_p in Object(e)?function(e){const t=Sp.call(e,_p),r=e[_p];let n=!1;try{e[_p]=void 0,n=!0}catch(e){}const o=Ip.call(e);n&&(t?e[_p]=r:delete e[_p]);return o}(e):function(e){return Ip.call(e)}(e)}(e))return!1;const t=wp(e);if(null===t)return!0;const r=Sp.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&bp.call(r)===vp}function Ep(e){return Op(e)?e.slice():e}function Tp(e,t,r=0,n){let o;if(!(r>20)){if(r++,Np(e)||Np(t)||Rp(t))o=Ep(t);else if(Op(e)){if(o=e.slice(),Op(t))for(let e=0,r=t.length;e<r;e++)o.push(Ep(t[e]));else if(xp(t)){const e=Object.keys(t);for(let r=0,n=e.length;r<n;r++){const n=e[r];o[n]=Ep(t[n])}}}else if(xp(e))if(xp(t)){if(!function(e,t){if(!Ap(e)||!Ap(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],l=t[a];if(Np(l))void 0===l?delete o[a]:o[a]=l;else{const s=o[a],i=l;if(kp(e,a,n)||kp(t,a,n))delete o[a];else{if(xp(s)&&xp(i)){const r=n.get(s)||[],o=n.get(i)||[];r.push({obj:e,key:a}),o.push({obj:t,key:a}),n.set(s,r),n.set(i,o)}o[a]=Tp(o[a],l,r,n)}}}}else o=t;return o}}function kp(e,t,r){const n=r.get(e[t])||[];for(let r=0,o=n.length;r<o;r++){const o=n[r];if(o.key===t&&o.obj===e)return!0}return!1}function Op(e){return Array.isArray(e)}function Rp(e){return"function"==typeof e}function xp(e){return!Np(e)&&!Op(e)&&!Rp(e)&&"object"==typeof e}function Np(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}function Mp(e,t){return"string"==typeof t?e===t:!!e.match(t)}function Lp(e,t){if(!t)return!1;for(const r of t)if(Mp(e,r))return!0;return!1}class Dp{_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 Pp{_callback;_that;_isCalled=!1;_deferred=new Dp;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 Fp=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class Bp{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const t=new Bp({});return t._rawAttributes=Zp(e),t._asyncAttributesPending=e.filter(([e,t])=>Fp(t)).length>0,t}constructor(e){const t=e.attributes??{};this._rawAttributes=Object.entries(t).map(([e,t])=>(Fp(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Zp(this._rawAttributes)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){const[t,r]=this._rawAttributes[e];this._rawAttributes[e]=[t,Fp(r)?await r:r]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&oh.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[t,r]of this._rawAttributes)Fp(r)?oh.debug(`Unsettled resource attribute ${t} skipped`):null!=r&&(e[t]??=r);return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}merge(e){return null==e?this:Bp.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function Up(e){return Bp.FromAttributeList(Object.entries(e))}function Zp(e){return e.map(([e,t])=>Fp(t)?[e,t.catch(t=>{oh.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,t])}class jp{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:Qu.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=Nh.now(),this._performanceOffset=t-(this._performanceStartTime+Qh()),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 oh.warn(`Invalid attribute key: ${e}`),this;if(!Th(t))return oh.warn(`Invalid attribute value set for key: ${e}`),this;const{attributeCountLimit:r}=this._spanLimits;return void 0!==r&&Object.keys(this.attributes).length>=r&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this)}setAttributes(e){for(const[t,r]of Object.entries(e))this.setAttribute(t,r);return this}addEvent(e,t,r){if(this._isSpanEnded())return this;const{eventCountLimit:n}=this._spanLimits;if(0===n)return oh.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==n&&this.events.length>=n&&(0===this._droppedEventsCount&&oh.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),np(t)&&(np(r)||(r=t),t=void 0);const o=Ah(t);return this.events.push({name:e,attributes:o,time:this._getTime(r),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&&(oh.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()?oh.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 r=t[0]-e[0],n=t[1]-e[1];return n<0&&(r-=1,n+=Xh),[r,n]}(this.startTime,this.endTime),this._duration[0]<0&&(oh.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&&oh.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this))}_getTime(e){if("number"==typeof e&&e<=Nh.now())return $h(e+this._performanceOffset);if("number"==typeof e)return qh(e);if(e instanceof Date)return qh(e.getTime());if(rp(e))return e;if(this._startTimeProvided)return qh(Date.now());const t=Nh.now()-this._performanceStartTime;return op(this.startTime,qh(t))}isRecording(){return!1===this._ended}recordException(e,t){const r={};"string"==typeof e?r[Dh]=e:e&&(e.code?r[Ph]=e.code.toString():e.name&&(r[Ph]=e.name),e.message&&(r[Dh]=e.message),e.stack&&(r["exception.stacktrace"]=e.stack)),r[Ph]||r[Dh]?this.addEvent("exception",r,t):oh.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}}`);oh.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?(oh.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 zp;!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(zp||(zp={}));class Vp{shouldSample(){return{decision:zp.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class Gp{shouldSample(){return{decision:zp.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class Wp{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(Rh(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Gp),this._remoteParentSampled=e.remoteParentSampled??new Gp,this._remoteParentNotSampled=e.remoteParentNotSampled??new Vp,this._localParentSampled=e.localParentSampled??new Gp,this._localParentNotSampled=e.localParentNotSampled??new Vp}shouldSample(e,t,r,n,o,s){const i=vh.getSpanContext(e);return i&&Hu(i)?i.isRemote?i.traceFlags&eu.SAMPLED?this._remoteParentSampled.shouldSample(e,t,r,n,o,s):this._remoteParentNotSampled.shouldSample(e,t,r,n,o,s):i.traceFlags&eu.SAMPLED?this._localParentSampled.shouldSample(e,t,r,n,o,s):this._localParentNotSampled.shouldSample(e,t,r,n,o,s):this._root.shouldSample(e,t,r,n,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 Hp{_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:Wu(t)&&this._accumulate(t)<this._upperBound?zp.RECORD_AND_SAMPLED:zp.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 r=0;r<e.length/8;r++){const n=8*r;t=(t^parseInt(e.slice(n,n+8),16))>>>0}return t}}function Yp(){return{sampler:Kp(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function Kp(){const e="parentbased_always_on";switch(e){case"always_on":return new Gp;case"always_off":return new Vp;case"parentbased_always_on":return new Wp({root:new Gp});case"parentbased_always_off":return new Wp({root:new Vp});case"traceidratio":return new Hp(Jp());case"parentbased_traceidratio":return new Wp({root:new Hp(Jp())});default:return oh.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "parentbased_always_on".`),new Wp({root:new Gp})}}function Jp(){return oh.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1}const Xp=1/0;class qp{_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:512,this._maxQueueSize="number"==typeof t?.maxQueueSize?t.maxQueueSize:2048,this._scheduledDelayMillis="number"==typeof t?.scheduledDelayMillis?t.scheduledDelayMillis:5e3,this._exportTimeoutMillis="number"==typeof t?.exportTimeoutMillis?t.exportTimeoutMillis:3e4,this._shutdownOnce=new Pp(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(oh.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&eu.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&&oh.debug("maxQueueSize reached, dropping spans"),void this._droppedSpansCount++;this._droppedSpansCount>0&&(oh.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{const r=[];for(let e=0,t=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);e<t;e++)r.push(this._flushOneBatch());Promise.all(r).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),0===this._finishedSpans.length?Promise.resolve():new Promise((e,t)=>{const r=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);nh.with(function(e){return e.setValue(wh,!0)}(nh.active()),()=>{let n;this._finishedSpans.length<=this._maxExportBatchSize?(n=this._finishedSpans,this._finishedSpans=[]):n=this._finishedSpans.splice(0,this._maxExportBatchSize);const o=()=>this._exporter.export(n,n=>{clearTimeout(r),n.code===sp.SUCCESS?e():t(n.error??new Error("BatchSpanProcessor: span export failed"))});let s=null;for(let e=0,t=n.length;e<t;e++){const t=n[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(s??=[],s.push(t.resource.waitForAsyncAttributes()))}null===s?o():Promise.all(s).then(o,e=>{Rh(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,Rh(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),this._timer)}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}class Qp extends qp{_visibilityChangeListener;_pageHideListener;constructor(e,t){super(e,t),this.onInit(t)}onInit(e){!0!==e?.disableAutoFlushOnDocumentHide&&"undefined"!=typeof document&&(this._visibilityChangeListener=()=>{"hidden"===document.visibilityState&&this.forceFlush().catch(e=>{Rh(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{Rh(e)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}onShutdown(){"undefined"!=typeof document&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}}class $p{generateTraceId=td(16);generateSpanId=td(8)}const ed=Array(32);function td(e){return function(){for(let t=0;t<2*e;t++)ed[t]=Math.floor(16*Math.random())+48,ed[t]>=58&&(ed[t]+=39);return String.fromCharCode.apply(null,ed.slice(0,2*e))}}class rd{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,t,r,n){const o=function(e){const t={sampler:Kp()},r=Yp(),n=Object.assign({},r,t,e);return n.generalLimits=Object.assign({},r.generalLimits,e.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,e.spanLimits||{}),n}(t);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=t.idGenerator||new $p,this._resource=r,this._spanProcessor=n,this.instrumentationScope=e}startSpan(e,t={},r=nh.active()){t.root&&(r=vh.deleteSpan(r));const n=vh.getSpan(r);if(Ch(r)){oh.debug("Instrumentation suppressed, returning Noop Span");return vh.wrapSpanContext(Lu)}const o=n?.spanContext(),s=this._idGenerator.generateSpanId();let i,a,l;o&&vh.isSpanContextValid(o)?(a=o.traceId,l=o.traceState,i=o):a=this._idGenerator.generateTraceId();const c=t.kind??qu.INTERNAL,u=(t.links??[]).map(e=>({context:e.context,attributes:Ah(e.attributes)})),h=Ah(t.attributes),p=this._sampler.shouldSample(r,a,e,c,h,u);l=p.traceState??l;const d={traceId:a,spanId:s,traceFlags:p.decision===Xu.RECORD_AND_SAMPLED?eu.SAMPLED:eu.NONE,traceState:l};if(p.decision===Xu.NOT_RECORD){oh.debug("Recording is off, propagating context in a non-recording span");return vh.wrapSpanContext(d)}const f=Ah(Object.assign(h,p.attributes));return new jp({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:d,name:e,kind:c,links:u,parentSpanContext:i,attributes:f,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(e,t,r,n){let o,s,i;if(arguments.length<2)return;2===arguments.length?i=t:3===arguments.length?(o=t,i=r):(o=t,s=r,i=n);const a=s??nh.active(),l=this.startSpan(e,o,a),c=vh.setSpan(a,l);return nh.with(c,i,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class nd{_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=>{Rh(e||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(const r of this._spanProcessors)r.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,r)=>{Promise.all(e).then(()=>{t()},r)})}}var od,sd;!function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"}(od||(od={}));class id{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const t=function(...e){let t=e.shift();const r=new WeakMap;for(;e.length>0;)t=Tp(t,e.shift(),0,r);return t}({},Yp(),function(e){const t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??Xp,Object.assign({},e,{spanLimits:t})}(e));this._resource=t.resource??Up({[zh]:"unknown_service",[Vh]:Kh[Vh],[Gh]:Kh[Gh],[Wh]:Kh[Wh]}),this._config=Object.assign({},t,{resource:this._resource});const r=[];e.spanProcessors?.length&&r.push(...e.spanProcessors),this._activeSpanProcessor=new nd(r)}getTracer(e,t,r){const n=`${e}@${t||""}:${r?.schemaUrl||""}`;return this._tracers.has(n)||this._tracers.set(n,new rd({name:e,version:t,schemaUrl:r?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(n)}forceFlush(){const e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(r=>{let n;const o=setTimeout(()=>{r(new Error(`Span processor did not completed within timeout period of ${e} ms`)),n=od.timeout},e);t.forceFlush().then(()=>{clearTimeout(o),n!==od.timeout&&(n=od.resolved,r(n))}).catch(e=>{clearTimeout(o),n=od.error,r(e)})}));return new Promise((e,r)=>{Promise.all(t).then(t=>{const n=t.filter(e=>e!==od.resolved);n.length>0?r(n):e()}).catch(e=>r([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class ad{_enabled=!1;_currentContext=ru;_bindFunction(e=ru,t){const r=this,n=function(...n){return r.with(e,()=>t.apply(this,n))};return Object.defineProperty(n,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),n}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=ru,this._enabled=!1,this}enable(){return this._enabled||(this._enabled=!0,this._currentContext=ru),this}with(e,t,r,...n){const o=this._currentContext;this._currentContext=e||ru;try{return t.call(r,...n)}finally{this._currentContext=o}}}class ld extends id{constructor(e={}){super(e)}register(e={}){var t;vh.setGlobalTracerProvider(this),null!==(t=e.propagator)&&(void 0!==t?yh.setGlobalPropagator(t):yh.setGlobalPropagator(new ip({propagators:[new mp,new Ih]}))),function(e){if(null!==e){if(void 0===e){const e=new ad;return e.enable(),void nh.setGlobalContextManager(e)}e.enable(),nh.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"}(sd||(sd={}));let cd;function ud(e,t){return t in e}function hd(e,t,r,n=!0){if(ud(r,t)&&"number"==typeof r[t]&&(!n||0!==r[t]))return e.addEvent(t,r[t])}function pd(e,t,r=!1,n,o){if(void 0===n&&(n=0!==t[sd.START_TIME]),r||(hd(e,sd.FETCH_START,t,n),hd(e,sd.DOMAIN_LOOKUP_START,t,n),hd(e,sd.DOMAIN_LOOKUP_END,t,n),hd(e,sd.CONNECT_START,t,n),hd(e,sd.SECURE_CONNECTION_START,t,n),hd(e,sd.CONNECT_END,t,n),hd(e,sd.REQUEST_START,t,n),hd(e,sd.RESPONSE_START,t,n),hd(e,sd.RESPONSE_END,t,n)),!o){const r=t[sd.ENCODED_BODY_SIZE];void 0!==r&&e.setAttribute("http.response_content_length",r);const n=t[sd.DECODED_BODY_SIZE];void 0!==n&&r!==n&&e.setAttribute("http.response_content_length_uncompressed",n)}}function dd(){return"undefined"!=typeof location?location.origin:void 0}function fd(e,t,r,n,o=new WeakSet,s){const i=md(e),a=function(e,t,r,n,o,s){const i=tp(t),a=tp(r);let l=n.filter(t=>{const r=tp(ep(t[sd.FETCH_START])),n=tp(ep(t[sd.RESPONSE_END]));return t.initiatorType.toLowerCase()===(s||"xmlhttprequest")&&t.name===e&&r>=i&&n<=a});l.length>0&&(l=l.filter(e=>!o.has(e)));return l}(e=i.toString(),t,r,n,o,s);if(0===a.length)return{mainRequest:void 0};if(1===a.length)return{mainRequest:a[0]};const l=function(e){return e.slice().sort((e,t)=>{const r=e[sd.FETCH_START],n=t[sd.FETCH_START];return r>n?1:r<n?-1:0})}(a);if(i.origin!==dd()&&l.length>1){let e=l[0],t=function(e,t,r){const n=tp(r),o=tp(ep(t));let s,i=e[1];const a=e.length;for(let t=1;t<a;t++){const r=e[t],a=tp(ep(r[sd.FETCH_START])),l=n-tp(ep(r[sd.RESPONSE_END]));a>=o&&(!s||l<s)&&(s=l,i=r)}return i}(l,e[sd.RESPONSE_END],r);const n=e[sd.RESPONSE_END];return t[sd.FETCH_START]<n&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}return{mainRequest:a[0]}}function md(e){if("function"==typeof URL)return new URL(e,"undefined"!=typeof document?document.baseURI:"undefined"!=typeof location?location.href:void 0);const t=(cd||(cd=document.createElement("a")),cd);return t.href=e,t}function gd(e,t){let r=t||[];("string"==typeof r||r instanceof RegExp)&&(r=[r]);return md(e).origin===dd()||r.some(t=>Mp(e,t))}class yd{emit(e){}}const bd=new yd;const vd=new class{getLogger(e,t,r){return new yd}};class wd{constructor(e,t,r,n){this._provider=e,this.name=t,this.version=r,this.options=n}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):bd}}class Cd{getLogger(e,t,r){var n;return null!==(n=this.getDelegateLogger(e,t,r))&&void 0!==n?n:new wd(this,e,t,r)}getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:vd}setDelegate(e){this._delegate=e}getDelegateLogger(e,t,r){var n;return null===(n=this._delegate)||void 0===n?void 0:n.getLogger(e,t,r)}}const Sd="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},_d=Symbol.for("io.opentelemetry.js.api.logs"),Id=Sd;class Ad{constructor(){this._proxyLoggerProvider=new Cd}static getInstance(){return this._instance||(this._instance=new Ad),this._instance}setGlobalLoggerProvider(e){return Id[_d]?this.getLoggerProvider():(Id[_d]=(t=1,r=e,n=vd,e=>e===t?r:n),this._proxyLoggerProvider.setDelegate(e),e);var t,r,n}getLoggerProvider(){var e,t;return null!==(t=null===(e=Id[_d])||void 0===e?void 0:e.call(Id,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete Id[_d],this._proxyLoggerProvider=new Cd}}const Ed=Ad.getInstance();let Td=console.error.bind(console);function kd(e,t,r){const n=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:n,writable:!0,value:r})}const Od=(e,t,r)=>{if(!e||!e[t])return void Td("no original function "+String(t)+" to wrap");if(!r)return Td("no wrapper function"),void Td((new Error).stack);const n=e[t];if("function"!=typeof n||"function"!=typeof r)return void Td("original object and wrapper must be functions");const o=r(n,t);return kd(o,"__original",n),kd(o,"__unwrap",()=>{e[t]===o&&kd(e,t,n)}),kd(o,"__wrapped",!0),kd(e,t,o),o},Rd=(e,t,r)=>{if(!e)return Td("must provide one or more modules to patch"),void Td((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{Od(e,t,r)})}):Td("must provide one or more functions to wrap on modules")},xd=(e,t)=>{if(!e||!e[t])return Td("no function to unwrap."),void Td((new Error).stack);const r=e[t];r.__unwrap?r.__unwrap():Td("no original to unwrap to -- has "+String(t)+" already been unwrapped?")},Nd=(e,t)=>{if(!e)return Td("must provide one or more modules to patch"),void Td((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{xd(e,t)})}):Td("must provide one or more functions to unwrap on modules")};class Md{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,r){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(r),this._diag=oh.createComponentLogger({namespace:e}),this._tracer=vh.getTracer(e,t),this._meter=ah.getMeter(e,t),this._logger=Ed.getLogger(e,t),this._updateMetricInstruments()}_wrap=Od;_unwrap=xd;_massWrap=Rd;_massUnwrap=Nd;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,r,n){if(e)try{e(r,n)}catch(e){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},e)}}}class Ld extends Md{constructor(e,t,r){super(e,t,r),this._config.enabled&&this.enable()}}function Dd(e,t,r){let n,o;try{o=e()}catch(e){n=e}finally{return t(n,o),o}}function Pd(e){return"function"==typeof e&&"function"==typeof e.__original&&"function"==typeof e.__unwrap&&!0===e.__wrapped}var Fd,Bd;function Ud(e,t){let r=Fd.OLD;const n=t?.split(",").map(e=>e.trim()).filter(e=>""!==e);for(const t of n??[]){if(t.toLowerCase()===e+"/dup"){r=Fd.DUPLICATE;break}t.toLowerCase()===e&&(r=Fd.STABLE)}return r}!function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"}(Fd||(Fd={})),function(e){e.DOCUMENT_LOAD="documentLoad",e.DOCUMENT_FETCH="documentFetch",e.RESOURCE_FETCH="resourceFetch"}(Bd||(Bd={}));var Zd;!function(e){e.FIRST_PAINT="firstPaint",e.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"}(Zd||(Zd={}));const jd={"first-paint":Zd.FIRST_PAINT,"first-contentful-paint":Zd.FIRST_CONTENTFUL_PAINT};class zd extends Ld{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=Nh.getEntriesByType?.("resource");t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){const e=Array.from(document.getElementsByTagName("meta")).find(e=>e.getAttribute("name")===pp),t=(()=>{const e={},t=Nh.getEntriesByType?.("navigation")[0];if(t)Object.values(sd).forEach(r=>{if(ud(t,r)){const n=t[r];"number"==typeof n&&(e[r]=n)}});else{const t=Nh.timing;t&&Object.values(sd).forEach(r=>{if(ud(t,r)){const n=t[r];"number"==typeof n&&(e[r]=n)}})}return e})(),r=e&&e.content||"";nh.with(yh.extract(ru,{traceparent:r}),()=>{const e=this._startSpan(Bd.DOCUMENT_LOAD,sd.FETCH_START,t);e&&(nh.with(vh.setSpan(nh.active(),e),()=>{const e=this._startSpan(Bd.DOCUMENT_FETCH,sd.FETCH_START,t);e&&(e.setAttribute(Mh,location.href),nh.with(vh.setSpan(nh.active(),e),()=>{pd(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,sd.RESPONSE_END,t)}))}),e.setAttribute(Mh,location.href),e.setAttribute("http.user_agent",navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(hd(e,sd.FETCH_START,t),hd(e,sd.UNLOAD_EVENT_START,t),hd(e,sd.UNLOAD_EVENT_END,t),hd(e,sd.DOM_INTERACTIVE,t),hd(e,sd.DOM_CONTENT_LOADED_EVENT_START,t),hd(e,sd.DOM_CONTENT_LOADED_EVENT_END,t),hd(e,sd.DOM_COMPLETE,t),hd(e,sd.LOAD_EVENT_START,t),hd(e,sd.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||(e=>{const t=Nh.getEntriesByType?.("paint");t&&t.forEach(({name:t,startTime:r})=>{ud(jd,t)&&e.addEvent(jd[t],r)})})(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,sd.LOAD_EVENT_END,t))})}_endSpan(e,t,r){e&&(ud(r,t)?e.end(r[t]):e.end())}_initResourceSpan(e,t){const r=this._startSpan(Bd.RESOURCE_FETCH,sd.FETCH_START,e,t);r&&(r.setAttribute(Mh,e.name),pd(r,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(r,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(r,sd.RESPONSE_END,e))}_startSpan(e,t,r,n){if(ud(r,t)&&"number"==typeof r[t]){return this.tracer.startSpan(e,{startTime:r[t]},n?vh.setSpan(nh.active(),n):void 0)}}_waitForPageLoad(){"complete"===window.document.readyState?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&Dd(()=>t(e),e=>{e&&this._diag.error("addCustomAttributesOnSpan",e)})}_addCustomAttributesOnResourceSpan(e,t,r){r&&Dd(()=>r(e,t),e=>{e&&this._diag.error("addCustomAttributesOnResourceSpan",e)})}enable(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener("load",this._onDocumentLoaded)}}const Vd="OT_ZONE_CONTEXT";class Gd{_enabled=!1;_zoneCounter=0;_activeContextFromZone(e){return e&&e.get(Vd)||ru}_bindFunction(e,t){const r=this,n=function(...n){return r.with(e,()=>t.apply(this,n))};return Object.defineProperty(n,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),n}_bindListener(e,t){const r=t;return void 0!==r.__ot_listeners||(r.__ot_listeners={},"function"==typeof r.addEventListener&&(r.addEventListener=this._patchAddEventListener(r,r.addEventListener,e)),"function"==typeof r.removeEventListener&&(r.removeEventListener=this._patchRemoveEventListener(r,r.removeEventListener))),t}_createZoneName(){this._zoneCounter++;const e=Math.random();return`${this._zoneCounter}-${e}`}_createZone(e,t){return Zone.current.fork({name:e,properties:{[Vd]:t}})}_getActiveZone(){return Zone.current}_patchAddEventListener(e,t,r){const n=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 l=n.bind(r,s);return a.set(s,l),t.call(this,o,l,i)}}_patchRemoveEventListener(e,t){return function(r,n){if(void 0===e.__ot_listeners||void 0===e.__ot_listeners[r])return t.call(this,r,n);const o=e.__ot_listeners[r],s=o.get(n);return o.delete(n),t.call(this,r,s||n)}}active(){if(!this._enabled)return ru;const e=this._getActiveZone(),t=this._activeContextFromZone(e);return t||ru}bind(e,t){return void 0===e&&(e=this.active()),"function"==typeof t?this._bindFunction(e,t):("object"==typeof(r=t)&&null!==r&&"addEventListener"in r&&"function"==typeof r.addEventListener&&"removeEventListener"in r&&"function"==typeof r.removeEventListener&&this._bindListener(e,t),t);var r}disable(){return this._enabled=!1,this}enable(){return this._enabled=!0,this}with(e,t,r,...n){const o=this._createZoneName();return this._createZone(o,e).run(t,r,n)}}
15
+ ***************************************************************************** */function tc(e,t,r,n){return new(r||(r=Promise))(function(t,o){function s(e){try{a(n.next(e))}catch(e){o(e)}}function i(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r(function(e){e(n)})).then(s,i)}a((n=n.apply(e,[])).next())})}for(var rc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),oc=0;oc<64;oc++)nc[rc.charCodeAt(oc)]=oc;const sc=new Map;const ic=(e,t,r)=>{if(!e||!cc(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=sc.get(e);return r||(r=new Map,sc.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let o=n.indexOf(e);return-1===o&&(o=n.length,n.push(e)),o};function ac(e,t,r){if(e instanceof Array)return e.map(e=>ac(e,t,r));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,r=function(e){var t,r=new Uint8Array(e),n=r.length,o="";for(t=0;t<n;t+=3)o+=rc[r[t]>>2],o+=rc[(3&r[t])<<4|r[t+1]>>4],o+=rc[(15&r[t+1])<<2|r[t+2]>>6],o+=rc[63&r[t+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:r}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[ac(e.buffer,t,r),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[ac(e.data,t,r),e.width,e.height]}}if(cc(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:ic(e,t,r)}}return e}const lc=(e,t,r)=>[...e].map(e=>ac(e,t,r)),cc=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(r.find(r=>e instanceof t[r]))};function uc(e,t,r){const n=[];try{const o=pl(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(n,...o){return ml(this,t,r,!0)||"__context"in this||(this.__context=n),e.apply(this,[n,...o])}});n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(e=>e())}}function hc(e,t,r,n,o,s,i){const a=[],l=Object.getOwnPropertyNames(e);for(const s of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))try{if("function"!=typeof e[s])continue;const l=pl(e,s,function(e){return function(...a){const l=e.apply(this,a);if(ic(l,i,this),!ml(this.canvas,n,o,!0)){const e=lc([...a],i,this),n={type:t,property:s,args:e};r(this.canvas,n)}return l}});a.push(l)}catch(n){const o=hl(e,s,{set(e){r(this.canvas,{type:t,property:s,args:[e],setter:!0})}});a.push(o)}return a}var pc=null;try{var dc="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");pc=dc.Worker}catch(e){}function fc(e,t,r){var n=function(e){return Buffer.from(e,"base64").toString("utf8")}(e),o=n.indexOf("\n",10)+1,s=n.substring(o)+"";return function(e){return new pc(s,Object.assign({},e,{eval:!0}))}}function mc(e,t,r){var n=function(e){return atob(e)}(e),o=n.indexOf("\n",10)+1,s=n.substring(o)+"",i=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(i)}var gc="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var yc=function(e){return gc?fc(e):function(e){var t;return function(r){return t=t||mc(e),new Worker(t,r)}}(e)}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=");class bc{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:r,blockClass:n,blockSelector:o,recordCanvas:s,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(r,n,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,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,r,n,o){const s=uc(t,r,n),i=new Map,a=new yc;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:r,type:n,width:o,height:s}=e.data;this.mutationCb({id:t,type:El["2D"],commands:[{property:"clearRect",args:[0,0,o,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})};const l=1e3/e;let c,u=0;const h=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{ml(t,r,n,!0)||e.push(t)}),e})().forEach(e=>tc(this,0,void 0,function*(){var t;const r=this.mirror.getId(e);if(i.get(r))return;if(i.set(r,!0),["webgl","webgl2"].includes(e.__context)){const r=e.getContext(e.__context);!1===(null===(t=null==r?void 0:r.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==r||r.clear(r.COLOR_BUFFER_BIT))}const n=yield createImageBitmap(e);a.postMessage({id:r,bitmap:n,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[n])}))),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=uc(e,t,r),o=function(e,t,r,n){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const s=pl(t.CanvasRenderingContext2D.prototype,i,function(o){return function(...s){return ml(this.canvas,r,n,!0)||setTimeout(()=>{const r=lc([...s],t,this);e(this.canvas,{type:El["2D"],property:i,args:r})},0),o.apply(this,s)}});o.push(s)}catch(r){const n=hl(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:El["2D"],property:i,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),s=function(e,t,r,n){const o=[];return o.push(...hc(t.WebGLRenderingContext.prototype,El.WebGL,e,r,n,0,t)),void 0!==t.WebGL2RenderingContext&&o.push(...hc(t.WebGL2RenderingContext.prototype,El.WebGL2,e,r,n,0,t)),()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r,this.mirror);this.resetObservers=()=>{n(),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 r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;const n=r.map(e=>{const t=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["type"]);return t}),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}class vc{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Sl,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 r={id:t,styleIds:[]},n=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const r=Array.from(t.rules||CSSRule);n.push({styleId:e,rules:r.map((e,t)=>({rule:Fa(e),index:t}))})}r.styleIds.push(e)}n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function wc(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let Cc,Sc,_c,Ic=!1;const Ac=new Ba;function Ec(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:i="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:c=!0,maskAllInputs:u,maskInputOptions:h,slimDOMOptions:p,maskInputFn:d,maskTextFn:f,hooks:m,packFn:g,sampling:y={},dataURLOptions:b={},mousemoveWait:v,recordCanvas:w=!1,recordCrossOriginIframes:C=!1,userTriggeredOnInput:S=!1,collectFonts:_=!1,inlineImages:I=!1,plugins:A,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:T=new Set([])}=e,k=!C||window.parent===window;let O=!1;if(!k)try{window.parent.document,O=!1}catch(e){O=!0}if(k&&!t)throw new Error("emit function is required");void 0!==v&&void 0===y.mousemove&&(y.mousemove=v),Ac.reset();const R=!0===u?{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!==h?h:{password:!0},x=!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 N;!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 M=0;const L=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return g&&(e=g(e)),e};Cc=(e,o)=>{var s;if(!(null===(s=Pl[0])||void 0===s?void 0:s.isFrozen())||e.type===_l.FullSnapshot||e.type===_l.IncrementalSnapshot&&e.data.source===Il.Mutation||Pl.forEach(e=>e.unfreeze()),k)null==t||t(L(e),o);else if(O){const t={type:"rrweb",event:L(e),isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===_l.FullSnapshot)N=e,M=0;else if(e.type===_l.IncrementalSnapshot){if(e.data.source===Il.Mutation&&e.data.isAttachIframe)return;M++;const t=n&&M>=n,o=r&&e.timestamp-N.timestamp>r;(t||o)&&Sc(!0)}};const D=e=>{Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Mutation},e)}))},P=e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Scroll},e)})),F=e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.CanvasMutation},e)})),B=new vc({mutationCb:D,adoptedStyleSheetCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.AdoptedStyleSheet},e)}))}),U=new $l({mirror:Ac,mutationCb:D,stylesheetManager:B,recordCrossOriginIframes:C,wrappedEmit:Cc});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:Ac,crossOriginIframeMirror:U.crossOriginIframeMirror,crossOriginIframeStyleMirror:U.crossOriginIframeStyleMirror});_c=new bc({recordCanvas:w,mutationCb:F,win:window,blockClass:o,blockSelector:s,mirror:Ac,sampling:y.canvas,dataURLOptions:b});const Z=new ec({mutationCb:D,scrollCb:P,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskInputOptions:R,dataURLOptions:b,maskTextFn:f,maskInputFn:d,recordCanvas:w,inlineImages:I,sampling:y,slimDOMOptions:x,iframeManager:U,stylesheetManager:B,canvasManager:_c,keepIframeSrcFn:E},mirror:Ac});Sc=(e=!1)=>{var t,r,n,i,u,h;Cc(wc({type:_l.Meta,data:{href:window.location.href,width:fl(),height:dl()}}),e),B.reset(),Pl.forEach(e=>e.lock());const p=function(e,t){var r=t||{},n=r.mirror,o=void 0===n?new Ba:n,s=r.blockClass,i=void 0===s?"rr-block":s,a=r.blockSelector,l=void 0===a?null:a,c=r.maskTextClass,u=void 0===c?"rr-mask":c,h=r.maskTextSelector,p=void 0===h?null:h,d=r.inlineStylesheet,f=void 0===d||d,m=r.inlineImages,g=void 0!==m&&m,y=r.recordCanvas,b=void 0!==y&&y,v=r.maskAllInputs,w=void 0!==v&&v,C=r.maskTextFn,S=r.maskInputFn,_=r.slimDOM,I=void 0!==_&&_,A=r.dataURLOptions,E=r.preserveWhiteSpace,T=r.onSerialize,k=r.onIframeLoad,O=r.iframeLoadTimeout,R=r.onStylesheetLoad,x=r.stylesheetLoadTimeout,N=r.keepIframeSrcFn;return il(e,{doc:e,mirror:o,blockClass:i,blockSelector:l,maskTextClass:u,maskTextSelector:p,skipChild:!1,inlineStylesheet:f,maskInputOptions:!0===w?{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===w?{password:!0}:w,maskTextFn:C,maskInputFn:S,slimDOMOptions:!0===I||"all"===I?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===I,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===I?{}:I,dataURLOptions:A,inlineImages:g,recordCanvas:b,preserveWhiteSpace:E,onSerialize:T,onIframeLoad:k,iframeLoadTimeout:O,onStylesheetLoad:R,stylesheetLoadTimeout:x,keepIframeSrcFn:void 0===N?function(){return!1}:N,newlyAddedElement:!1})}(document,{mirror:Ac,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskAllInputs:R,maskTextFn:f,slimDOM:x,dataURLOptions:b,recordCanvas:w,inlineImages:I,onSerialize:e=>{vl(e,Ac)&&U.addIframe(e),wl(e,Ac)&&B.trackLinkElement(e),Cl(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{U.attachIframe(e,t),Z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{B.attachLinkElement(e,t)},keepIframeSrcFn:E});if(!p)return console.warn("Failed to snapshot the document");Cc(wc({type:_l.FullSnapshot,data:{node:p,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(r=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===r?void 0:r.scrollLeft)||(null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(u=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===u?void 0:u.scrollTop)||(null===(h=null===document||void 0===document?void 0:document.body)||void 0===h?void 0:h.scrollTop)||0}}})),Pl.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&B.adoptStyleSheets(document.adoptedStyleSheets,Ac.getId(document))};try{const e=[];e.push(al("DOMContentLoaded",()=>{Cc(wc({type:_l.DomContentLoaded,data:{}}))}));const t=e=>{var t;return ql({mutationCb:D,mousemoveCb:(e,t)=>Cc(wc({type:_l.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.MouseInteraction},e)})),scrollCb:P,viewportResizeCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.ViewportResize},e)})),inputCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Input},e)})),mediaInteractionCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.MediaInteraction},e)})),styleSheetRuleCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.StyleSheetRule},e)})),styleDeclarationCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.StyleDeclaration},e)})),canvasMutationCb:F,fontCb:e=>Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Font},e)})),selectionCb:e=>{Cc(wc({type:_l.IncrementalSnapshot,data:Object.assign({source:Il.Selection},e)}))},blockClass:o,ignoreClass:i,maskTextClass:a,maskTextSelector:l,maskInputOptions:R,inlineStylesheet:c,sampling:y,recordCanvas:w,inlineImages:I,userTriggeredOnInput:S,collectFonts:_,doc:e,maskInputFn:d,maskTextFn:f,keepIframeSrcFn:E,blockSelector:s,slimDOMOptions:x,dataURLOptions:b,mirror:Ac,iframeManager:U,stylesheetManager:B,shadowDomManager:Z,canvasManager:_c,ignoreCSSAttributes:T,plugins:(null===(t=null==A?void 0:A.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Cc(wc({type:_l.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},m)};U.addLoadListener(r=>{e.push(t(r.contentDocument))});const r=()=>{Sc(),e.push(t(document)),Ic=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():e.push(al("load",()=>{Cc(wc({type:_l.Load,data:{}})),r()},window)),()=>{e.forEach(e=>e()),Ic=!1}}catch(e){console.warn(e)}}Ec.addCustomEvent=(e,t)=>{if(!Ic)throw new Error("please add custom event after start recording");Cc(wc({type:_l.Custom,data:{tag:e,payload:t}}))},Ec.freezePage=()=>{Pl.forEach(e=>e.freeze())},Ec.takeFullSnapshot=e=>{if(!Ic)throw new Error("please take full snapshot after start recording");Sc(e)},Ec.mirror=Ac;class Tc{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(){var e;Ec({emit:e=>{this.events.push(e)},plugins:[(e={level:["info","log","warn","error"],lengthThreshold:1e4,stringifyOptions:{stringLengthLimit:1e3,numOfKeysLimit:100,depthOfLimit:1}},{name:"rrweb/console@1",observer:Na,options:e})]}),setInterval(this.save,5e3)}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 r=this.events;this.events=[];const n=JSON.stringify({events:r,sessionId:this.sessionId,timestamp:(new Date).toISOString()});fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:n}).catch(e=>{console.error("Failed to save replay events:",e),this.events=[...r,...this.events]})}}var kc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Oc="1.9.0",Rc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var xc=function(e){var t=new Set([e]),r=new Set,n=e.match(Rc);if(!n)return function(){return!1};var o=+n[1],s=+n[2],i=+n[3];if(null!=n[4])return function(t){return t===e};function a(e){return r.add(e),!1}function l(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;var n=e.match(Rc);if(!n)return a(e);var c=+n[1],u=+n[2],h=+n[3];return null!=n[4]||o!==c?a(e):0===o?s===u&&i<=h?l(e):a(e):s<=u?l(e):a(e)}}(Oc),Nc=Oc.split(".")[0],Mc=Symbol.for("opentelemetry.js.api."+Nc),Lc=kc;function Dc(e,t,r,n){var o;void 0===n&&(n=!1);var s=Lc[Mc]=null!==(o=Lc[Mc])&&void 0!==o?o:{version:Oc};if(!n&&s[e]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(i.stack||i.message),!1}if(s.version!==Oc){i=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+e+" does not match previously registered API v"+Oc);return r.error(i.stack||i.message),!1}return s[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+Oc+"."),!0}function Pc(e){var t,r,n=null===(t=Lc[Mc])||void 0===t?void 0:t.version;if(n&&xc(n))return null===(r=Lc[Mc])||void 0===r?void 0:r[e]}function Fc(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Oc+".");var r=Lc[Mc];r&&delete r[e]}var Bc,Uc=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i},Zc=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,s=t.length;o<s;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},jc=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 zc("debug",this._namespace,e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zc("error",this._namespace,e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zc("info",this._namespace,e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zc("warn",this._namespace,e)},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zc("verbose",this._namespace,e)},e}();function zc(e,t,r){var n=Pc("diag");if(n)return r.unshift(t),n[e].apply(n,Zc([],Uc(r),!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"}(Bc||(Bc={}));var Vc=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i},Gc=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,s=t.length;o<s;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},Wc=function(){function e(){function e(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=Pc("diag");if(n)return n[e].apply(n,Gc([],Vc(t),!1))}}var t=this;t.setLogger=function(e,r){var n,o,s;if(void 0===r&&(r={logLevel:Bc.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!==(n=i.stack)&&void 0!==n?n:i.message),!1}"number"==typeof r&&(r={logLevel:r});var a=Pc("diag"),l=function(e,t){function r(r,n){var o=t[r];return"function"==typeof o&&e>=n?o.bind(t):function(){}}return e<Bc.NONE?e=Bc.NONE:e>Bc.ALL&&(e=Bc.ALL),t=t||{},{error:r("error",Bc.ERROR),warn:r("warn",Bc.WARN),info:r("info",Bc.INFO),debug:r("debug",Bc.DEBUG),verbose:r("verbose",Bc.VERBOSE)}}(null!==(o=r.logLevel)&&void 0!==o?o:Bc.INFO,e);if(a&&!r.suppressOverrideMessage){var c=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+c),l.warn("Current logger will overwrite one already registered from "+c)}return Dc("diag",l,t,!0)},t.disable=function(){Fc("diag",t)},t.createComponentLogger=function(e){return new jc(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}(),Hc=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i},Yc=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Kc=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=Hc(e,2);return[t[0],t[1]]})},e.prototype.setEntry=function(t,r){var n=new e(this._entries);return n._entries.set(t,r),n},e.prototype.removeEntry=function(t){var r=new e(this._entries);return r._entries.delete(t),r},e.prototype.removeEntries=function(){for(var t,r,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var s=new e(this._entries);try{for(var i=Yc(n),a=i.next();!a.done;a=i.next()){var l=a.value;s._entries.delete(l)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return s},e.prototype.clear=function(){return new e},e}(),Jc=Symbol("BaggageEntryMetadata"),Xc=Wc.instance();function qc(e){return void 0===e&&(e={}),new Kc(new Map(Object.entries(e)))}function Qc(e){return Symbol.for(e)}var $c,eu,tu=function e(t){var r=this;r._currentContext=t?new Map(t):new Map,r.getValue=function(e){return r._currentContext.get(e)},r.setValue=function(t,n){var o=new e(r._currentContext);return o._currentContext.set(t,n),o},r.deleteValue=function(t){var n=new e(r._currentContext);return n._currentContext.delete(t),n}},ru=new tu,nu=($c=function(e,t){return $c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},$c(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 r(){this.constructor=e}$c(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),ou=function(){function e(){}return e.prototype.createGauge=function(e,t){return gu},e.prototype.createHistogram=function(e,t){return yu},e.prototype.createCounter=function(e,t){return mu},e.prototype.createUpDownCounter=function(e,t){return bu},e.prototype.createObservableGauge=function(e,t){return wu},e.prototype.createObservableCounter=function(e,t){return vu},e.prototype.createObservableUpDownCounter=function(e,t){return Cu},e.prototype.addBatchObservableCallback=function(e,t){},e.prototype.removeBatchObservableCallback=function(e){},e}(),su=function(){},iu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t.prototype.add=function(e,t){},t}(su),au=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t.prototype.add=function(e,t){},t}(su),lu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t.prototype.record=function(e,t){},t}(su),cu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t.prototype.record=function(e,t){},t}(su),uu=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e}(),hu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t}(uu),pu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t}(uu),du=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t}(uu),fu=new ou,mu=new iu,gu=new lu,yu=new cu,bu=new au,vu=new hu,wu=new pu,Cu=new du,Su={get:function(e,t){if(null!=e)return e[t]},keys:function(e){return null==e?[]:Object.keys(e)}},_u={set:function(e,t,r){null!=e&&(e[t]=r)}},Iu=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i},Au=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,s=t.length;o<s;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},Eu=function(){function e(){}return e.prototype.active=function(){return ru},e.prototype.with=function(e,t,r){for(var n=[],o=3;o<arguments.length;o++)n[o-3]=arguments[o];return t.call.apply(t,Au([r],Iu(n),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),Tu=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i},ku=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,s=t.length;o<s;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},Ou="context",Ru=new Eu,xu=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return Dc(Ou,e,Wc.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,r){for(var n,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];return(n=this._getContextManager()).with.apply(n,ku([e,t,r],Tu(o),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return Pc(Ou)||Ru},e.prototype.disable=function(){this._getContextManager().disable(),Fc(Ou,Wc.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(eu||(eu={}));var Nu="0000000000000000",Mu="00000000000000000000000000000000",Lu={traceId:Mu,spanId:Nu,traceFlags:eu.NONE},Du=function(){function e(e){void 0===e&&(e=Lu),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}(),Pu=Qc("OpenTelemetry Context Key SPAN");function Fu(e){return e.getValue(Pu)||void 0}function Bu(){return Fu(xu.getInstance().active())}function Uu(e,t){return e.setValue(Pu,t)}function Zu(e){return e.deleteValue(Pu)}function ju(e,t){return Uu(e,new Du(t))}function zu(e){var t;return null===(t=Fu(e))||void 0===t?void 0:t.spanContext()}var Vu=/^([0-9a-f]{32})$/i,Gu=/^[0-9a-f]{16}$/i;function Wu(e){return Vu.test(e)&&e!==Mu}function Hu(e){return Wu(e.traceId)&&(t=e.spanId,Gu.test(t)&&t!==Nu);var t}function Yu(e){return new Du(e)}var Ku=xu.getInstance(),Ju=function(){function e(){}return e.prototype.startSpan=function(e,t,r){if(void 0===r&&(r=Ku.active()),Boolean(null==t?void 0:t.root))return new Du;var n,o=r&&zu(r);return"object"==typeof(n=o)&&"string"==typeof n.spanId&&"string"==typeof n.traceId&&"number"==typeof n.traceFlags&&Hu(o)?new Du(o):new Du},e.prototype.startActiveSpan=function(e,t,r,n){var o,s,i;if(!(arguments.length<2)){2===arguments.length?i=t:3===arguments.length?(o=t,i=r):(o=t,s=r,i=n);var a=null!=s?s:Ku.active(),l=this.startSpan(e,o,a),c=Uu(a,l);return Ku.with(c,i,void 0,l)}},e}();var Xu,qu,Qu,$u=new Ju,eh=function(){function e(e,t,r,n){this._provider=e,this.name=t,this.version=r,this.options=n}return e.prototype.startSpan=function(e,t,r){return this._getTracer().startSpan(e,t,r)},e.prototype.startActiveSpan=function(e,t,r,n){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):$u},e}(),th=new(function(){function e(){}return e.prototype.getTracer=function(e,t,r){return new Ju},e}()),rh=function(){function e(){}return e.prototype.getTracer=function(e,t,r){var n;return null!==(n=this.getDelegateTracer(e,t,r))&&void 0!==n?n:new eh(this,e,t,r)},e.prototype.getDelegate=function(){var e;return null!==(e=this._delegate)&&void 0!==e?e:th},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,r){var n;return null===(n=this._delegate)||void 0===n?void 0:n.getTracer(e,t,r)},e}();!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(Xu||(Xu={})),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"}(qu||(qu={})),function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}(Qu||(Qu={}));var nh=xu.getInstance(),oh=Wc.instance(),sh=new(function(){function e(){}return e.prototype.getMeter=function(e,t,r){return fu},e}()),ih="metrics",ah=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalMeterProvider=function(e){return Dc(ih,e,Wc.instance())},e.prototype.getMeterProvider=function(){return Pc(ih)||sh},e.prototype.getMeter=function(e,t,r){return this.getMeterProvider().getMeter(e,t,r)},e.prototype.disable=function(){Fc(ih,Wc.instance())},e}().getInstance(),lh=function(){function e(){}return e.prototype.inject=function(e,t){},e.prototype.extract=function(e,t){return e},e.prototype.fields=function(){return[]},e}(),ch=Qc("OpenTelemetry Baggage Key");function uh(e){return e.getValue(ch)||void 0}function hh(){return uh(xu.getInstance().active())}function ph(e,t){return e.setValue(ch,t)}function dh(e){return e.deleteValue(ch)}var fh="propagation",mh=new lh,gh=function(){function e(){this.createBaggage=qc,this.getBaggage=uh,this.getActiveBaggage=hh,this.setBaggage=ph,this.deleteBaggage=dh}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(e){return Dc(fh,e,Wc.instance())},e.prototype.inject=function(e,t,r){return void 0===r&&(r=_u),this._getGlobalPropagator().inject(e,t,r)},e.prototype.extract=function(e,t,r){return void 0===r&&(r=Su),this._getGlobalPropagator().extract(e,t,r)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){Fc(fh,Wc.instance())},e.prototype._getGlobalPropagator=function(){return Pc(fh)||mh},e}(),yh=gh.getInstance(),bh="trace",vh=function(){function e(){this._proxyTracerProvider=new rh,this.wrapSpanContext=Yu,this.isSpanContextValid=Hu,this.deleteSpan=Zu,this.getSpan=Fu,this.getActiveSpan=Bu,this.getSpanContext=zu,this.setSpan=Uu,this.setSpanContext=ju}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=Dc(bh,this._proxyTracerProvider,Wc.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return Pc(bh)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){Fc(bh,Wc.instance()),this._proxyTracerProvider=new rh},e}().getInstance();const wh=Qc("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Ch(e){return!0===e.getValue(wh)}const Sh="baggage";function _h(e){const t=e.split(";");if(t.length<=0)return;const r=t.shift();if(!r)return;const n=r.indexOf("=");if(n<=0)return;const o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim());let i;var a;return t.length>0&&("string"!=typeof(a=t.join(";"))&&(Xc.error("Cannot create baggage metadata from unknown type: "+typeof a),a=""),i={__TYPE__:Jc,toString:function(){return a}}),{key:o,value:s,metadata:i}}class Ih{inject(e,t,r){const n=yh.getBaggage(e);if(!n||Ch(e))return;const o=function(e){return e.getAllEntries().map(([e,t])=>{let r=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return void 0!==t.metadata&&(r+=";"+t.metadata.toString()),r})}(n).filter(e=>e.length<=4096).slice(0,180),s=function(e){return e.reduce((e,t)=>{const r=`${e}${""!==e?",":""}${t}`;return r.length>8192?e:r},"")}(o);s.length>0&&r.set(t,Sh,s)}extract(e,t,r){const n=r.get(t,Sh),o=Array.isArray(n)?n.join(","):n;if(!o)return e;const s={};if(0===o.length)return e;return o.split(",").forEach(e=>{const t=_h(e);if(t){const e={value:t.value};t.metadata&&(e.metadata=t.metadata),s[t.key]=e}}),0===Object.entries(s).length?e:yh.setBaggage(e,yh.createBaggage(s))}fields(){return[Sh]}}function Ah(e){const t={};if("object"!=typeof e||null==e)return t;for(const[r,n]of Object.entries(e))Eh(r)?Th(n)?Array.isArray(n)?t[r]=n.slice():t[r]=n:oh.warn(`Invalid attribute value set for key: ${r}`):oh.warn(`Invalid attribute key: ${r}`);return t}function Eh(e){return"string"==typeof e&&e.length>0}function Th(e){return null==e||(Array.isArray(e)?function(e){let t;for(const r of e)if(null!=r){if(!t){if(kh(r)){t=typeof r;continue}return!1}if(typeof r!==t)return!1}return!0}(e):kh(e))}function kh(e){switch(typeof e){case"number":case"boolean":case"string":return!0}return!1}let Oh=e=>{oh.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){const t={};let r=e;for(;null!==r;)Object.getOwnPropertyNames(r).forEach(e=>{if(t[e])return;const n=r[e];n&&(t[e]=String(n))}),r=Object.getPrototypeOf(r);return t}(e))}(e))};function Rh(e){try{Oh(e)}catch{}}const xh="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Nh=performance,Mh="http.url",Lh="error.type",Dh="exception.message",Ph="exception.type",Fh="http.request.method",Bh="http.request.method_original",Uh="http.response.status_code",Zh="server.address",jh="server.port",zh="service.name",Vh="telemetry.sdk.language",Gh="telemetry.sdk.name",Wh="telemetry.sdk.version",Hh="url.full",Yh="process.runtime.name",Kh={[Gh]:"opentelemetry",[Yh]:"browser",[Vh]:"webjs",[Wh]:"2.0.1"};const Jh=Math.pow(10,6),Xh=Math.pow(10,9);function qh(e){const t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Jh)]}function Qh(){let e=Nh.timeOrigin;if("number"!=typeof e){const t=Nh;e=t.timing&&t.timing.fetchStart}return e}function $h(e){return op(qh(Qh()),qh("number"==typeof e?e:Nh.now()))}function ep(e){if(rp(e))return e;if("number"==typeof e)return e<Qh()?$h(e):qh(e);if(e instanceof Date)return qh(e.getTime());throw TypeError("Invalid input type")}function tp(e){return e[0]*Xh+e[1]}function rp(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function np(e){return rp(e)||"number"==typeof e||e instanceof Date}function op(e,t){const r=[e[0]+t[0],e[1]+t[1]];return r[1]>=Xh&&(r[1]-=Xh,r[0]+=1),r}var sp;!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(sp||(sp={}));class ip{_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,r){for(const n of this._propagators)try{n.inject(e,t,r)}catch(e){oh.warn(`Failed to inject with ${n.constructor.name}. Err: ${e.message}`)}}extract(e,t,r){return this._propagators.reduce((e,n)=>{try{return n.extract(e,t,r)}catch(e){oh.warn(`Failed to extract with ${n.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}const ap="[_0-9a-z-*/]",lp=new RegExp(`^(?:${`[a-z]${ap}{0,255}`}|${`[a-z0-9]${ap}{0,240}@[a-z]${ap}{0,13}`})$`),cp=/^[ -~]{0,255}[!-~]$/,up=/,|=/;class hp{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,t){const r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,t),r}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 r=t.trim(),n=r.indexOf("=");if(-1!==n){const o=r.slice(0,n),s=r.slice(n+1,t.length);(function(e){return lp.test(e)})(o)&&function(e){return cp.test(e)&&!up.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 hp;return e._internalState=new Map(this._internalState),e}}const pp="traceparent",dp="tracestate",fp=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");class mp{inject(e,t,r){const n=vh.getSpanContext(e);if(!n||Ch(e)||!Hu(n))return;const o=`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||eu.NONE).toString(16)}`;r.set(t,pp,o),n.traceState&&r.set(t,dp,n.traceState.serialize())}extract(e,t,r){const n=r.get(t,pp);if(!n)return e;const o=Array.isArray(n)?n[0]:n;if("string"!=typeof o)return e;const s=function(e){const t=fp.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=r.get(t,dp);if(i){const e=Array.isArray(i)?i.join(","):i;s.traceState=new hp("string"==typeof e?e:void 0)}return vh.setSpanContext(e,s)}fields(){return[pp,dp]}}const gp="[object Null]",yp="[object Undefined]",bp=Function.prototype.toString,vp=bp.call(Object),wp=Object.getPrototypeOf,Cp=Object.prototype,Sp=Cp.hasOwnProperty,_p=Symbol?Symbol.toStringTag:void 0,Ip=Cp.toString;function Ap(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!==function(e){if(null==e)return void 0===e?yp:gp;return _p&&_p in Object(e)?function(e){const t=Sp.call(e,_p),r=e[_p];let n=!1;try{e[_p]=void 0,n=!0}catch(e){}const o=Ip.call(e);n&&(t?e[_p]=r:delete e[_p]);return o}(e):function(e){return Ip.call(e)}(e)}(e))return!1;const t=wp(e);if(null===t)return!0;const r=Sp.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&bp.call(r)===vp}function Ep(e){return Op(e)?e.slice():e}function Tp(e,t,r=0,n){let o;if(!(r>20)){if(r++,Np(e)||Np(t)||Rp(t))o=Ep(t);else if(Op(e)){if(o=e.slice(),Op(t))for(let e=0,r=t.length;e<r;e++)o.push(Ep(t[e]));else if(xp(t)){const e=Object.keys(t);for(let r=0,n=e.length;r<n;r++){const n=e[r];o[n]=Ep(t[n])}}}else if(xp(e))if(xp(t)){if(!function(e,t){if(!Ap(e)||!Ap(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],l=t[a];if(Np(l))void 0===l?delete o[a]:o[a]=l;else{const s=o[a],i=l;if(kp(e,a,n)||kp(t,a,n))delete o[a];else{if(xp(s)&&xp(i)){const r=n.get(s)||[],o=n.get(i)||[];r.push({obj:e,key:a}),o.push({obj:t,key:a}),n.set(s,r),n.set(i,o)}o[a]=Tp(o[a],l,r,n)}}}}else o=t;return o}}function kp(e,t,r){const n=r.get(e[t])||[];for(let r=0,o=n.length;r<o;r++){const o=n[r];if(o.key===t&&o.obj===e)return!0}return!1}function Op(e){return Array.isArray(e)}function Rp(e){return"function"==typeof e}function xp(e){return!Np(e)&&!Op(e)&&!Rp(e)&&"object"==typeof e}function Np(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}function Mp(e,t){return"string"==typeof t?e===t:!!e.match(t)}function Lp(e,t){if(!t)return!1;for(const r of t)if(Mp(e,r))return!0;return!1}class Dp{_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 Pp{_callback;_that;_isCalled=!1;_deferred=new Dp;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 Fp=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class Bp{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const t=new Bp({});return t._rawAttributes=Zp(e),t._asyncAttributesPending=e.filter(([e,t])=>Fp(t)).length>0,t}constructor(e){const t=e.attributes??{};this._rawAttributes=Object.entries(t).map(([e,t])=>(Fp(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=Zp(this._rawAttributes)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){const[t,r]=this._rawAttributes[e];this._rawAttributes[e]=[t,Fp(r)?await r:r]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&oh.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[t,r]of this._rawAttributes)Fp(r)?oh.debug(`Unsettled resource attribute ${t} skipped`):null!=r&&(e[t]??=r);return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}merge(e){return null==e?this:Bp.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function Up(e){return Bp.FromAttributeList(Object.entries(e))}function Zp(e){return e.map(([e,t])=>Fp(t)?[e,t.catch(t=>{oh.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,t])}class jp{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:Qu.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=Nh.now(),this._performanceOffset=t-(this._performanceStartTime+Qh()),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 oh.warn(`Invalid attribute key: ${e}`),this;if(!Th(t))return oh.warn(`Invalid attribute value set for key: ${e}`),this;const{attributeCountLimit:r}=this._spanLimits;return void 0!==r&&Object.keys(this.attributes).length>=r&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this)}setAttributes(e){for(const[t,r]of Object.entries(e))this.setAttribute(t,r);return this}addEvent(e,t,r){if(this._isSpanEnded())return this;const{eventCountLimit:n}=this._spanLimits;if(0===n)return oh.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==n&&this.events.length>=n&&(0===this._droppedEventsCount&&oh.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),np(t)&&(np(r)||(r=t),t=void 0);const o=Ah(t);return this.events.push({name:e,attributes:o,time:this._getTime(r),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&&(oh.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()?oh.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 r=t[0]-e[0],n=t[1]-e[1];return n<0&&(r-=1,n+=Xh),[r,n]}(this.startTime,this.endTime),this._duration[0]<0&&(oh.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&&oh.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this))}_getTime(e){if("number"==typeof e&&e<=Nh.now())return $h(e+this._performanceOffset);if("number"==typeof e)return qh(e);if(e instanceof Date)return qh(e.getTime());if(rp(e))return e;if(this._startTimeProvided)return qh(Date.now());const t=Nh.now()-this._performanceStartTime;return op(this.startTime,qh(t))}isRecording(){return!1===this._ended}recordException(e,t){const r={};"string"==typeof e?r[Dh]=e:e&&(e.code?r[Ph]=e.code.toString():e.name&&(r[Ph]=e.name),e.message&&(r[Dh]=e.message),e.stack&&(r["exception.stacktrace"]=e.stack)),r[Ph]||r[Dh]?this.addEvent("exception",r,t):oh.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}}`);oh.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?(oh.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 zp;!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(zp||(zp={}));class Vp{shouldSample(){return{decision:zp.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class Gp{shouldSample(){return{decision:zp.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class Wp{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(Rh(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Gp),this._remoteParentSampled=e.remoteParentSampled??new Gp,this._remoteParentNotSampled=e.remoteParentNotSampled??new Vp,this._localParentSampled=e.localParentSampled??new Gp,this._localParentNotSampled=e.localParentNotSampled??new Vp}shouldSample(e,t,r,n,o,s){const i=vh.getSpanContext(e);return i&&Hu(i)?i.isRemote?i.traceFlags&eu.SAMPLED?this._remoteParentSampled.shouldSample(e,t,r,n,o,s):this._remoteParentNotSampled.shouldSample(e,t,r,n,o,s):i.traceFlags&eu.SAMPLED?this._localParentSampled.shouldSample(e,t,r,n,o,s):this._localParentNotSampled.shouldSample(e,t,r,n,o,s):this._root.shouldSample(e,t,r,n,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 Hp{_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:Wu(t)&&this._accumulate(t)<this._upperBound?zp.RECORD_AND_SAMPLED:zp.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 r=0;r<e.length/8;r++){const n=8*r;t=(t^parseInt(e.slice(n,n+8),16))>>>0}return t}}function Yp(){return{sampler:Kp(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function Kp(){const e="parentbased_always_on";switch(e){case"always_on":return new Gp;case"always_off":return new Vp;case"parentbased_always_on":return new Wp({root:new Gp});case"parentbased_always_off":return new Wp({root:new Vp});case"traceidratio":return new Hp(Jp());case"parentbased_traceidratio":return new Wp({root:new Hp(Jp())});default:return oh.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "parentbased_always_on".`),new Wp({root:new Gp})}}function Jp(){return oh.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1}const Xp=1/0;class qp{_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:512,this._maxQueueSize="number"==typeof t?.maxQueueSize?t.maxQueueSize:2048,this._scheduledDelayMillis="number"==typeof t?.scheduledDelayMillis?t.scheduledDelayMillis:5e3,this._exportTimeoutMillis="number"==typeof t?.exportTimeoutMillis?t.exportTimeoutMillis:3e4,this._shutdownOnce=new Pp(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(oh.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&eu.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&&oh.debug("maxQueueSize reached, dropping spans"),void this._droppedSpansCount++;this._droppedSpansCount>0&&(oh.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{const r=[];for(let e=0,t=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);e<t;e++)r.push(this._flushOneBatch());Promise.all(r).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),0===this._finishedSpans.length?Promise.resolve():new Promise((e,t)=>{const r=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);nh.with(function(e){return e.setValue(wh,!0)}(nh.active()),()=>{let n;this._finishedSpans.length<=this._maxExportBatchSize?(n=this._finishedSpans,this._finishedSpans=[]):n=this._finishedSpans.splice(0,this._maxExportBatchSize);const o=()=>this._exporter.export(n,n=>{clearTimeout(r),n.code===sp.SUCCESS?e():t(n.error??new Error("BatchSpanProcessor: span export failed"))});let s=null;for(let e=0,t=n.length;e<t;e++){const t=n[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(s??=[],s.push(t.resource.waitForAsyncAttributes()))}null===s?o():Promise.all(s).then(o,e=>{Rh(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,Rh(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),this._timer)}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}class Qp extends qp{_visibilityChangeListener;_pageHideListener;constructor(e,t){super(e,t),this.onInit(t)}onInit(e){!0!==e?.disableAutoFlushOnDocumentHide&&"undefined"!=typeof document&&(this._visibilityChangeListener=()=>{"hidden"===document.visibilityState&&this.forceFlush().catch(e=>{Rh(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{Rh(e)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}onShutdown(){"undefined"!=typeof document&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}}class $p{generateTraceId=td(16);generateSpanId=td(8)}const ed=Array(32);function td(e){return function(){for(let t=0;t<2*e;t++)ed[t]=Math.floor(16*Math.random())+48,ed[t]>=58&&(ed[t]+=39);return String.fromCharCode.apply(null,ed.slice(0,2*e))}}class rd{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,t,r,n){const o=function(e){const t={sampler:Kp()},r=Yp(),n=Object.assign({},r,t,e);return n.generalLimits=Object.assign({},r.generalLimits,e.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,e.spanLimits||{}),n}(t);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=t.idGenerator||new $p,this._resource=r,this._spanProcessor=n,this.instrumentationScope=e}startSpan(e,t={},r=nh.active()){t.root&&(r=vh.deleteSpan(r));const n=vh.getSpan(r);if(Ch(r)){oh.debug("Instrumentation suppressed, returning Noop Span");return vh.wrapSpanContext(Lu)}const o=n?.spanContext(),s=this._idGenerator.generateSpanId();let i,a,l;o&&vh.isSpanContextValid(o)?(a=o.traceId,l=o.traceState,i=o):a=this._idGenerator.generateTraceId();const c=t.kind??qu.INTERNAL,u=(t.links??[]).map(e=>({context:e.context,attributes:Ah(e.attributes)})),h=Ah(t.attributes),p=this._sampler.shouldSample(r,a,e,c,h,u);l=p.traceState??l;const d={traceId:a,spanId:s,traceFlags:p.decision===Xu.RECORD_AND_SAMPLED?eu.SAMPLED:eu.NONE,traceState:l};if(p.decision===Xu.NOT_RECORD){oh.debug("Recording is off, propagating context in a non-recording span");return vh.wrapSpanContext(d)}const f=Ah(Object.assign(h,p.attributes));return new jp({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:d,name:e,kind:c,links:u,parentSpanContext:i,attributes:f,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(e,t,r,n){let o,s,i;if(arguments.length<2)return;2===arguments.length?i=t:3===arguments.length?(o=t,i=r):(o=t,s=r,i=n);const a=s??nh.active(),l=this.startSpan(e,o,a),c=vh.setSpan(a,l);return nh.with(c,i,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class nd{_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=>{Rh(e||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(const r of this._spanProcessors)r.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,r)=>{Promise.all(e).then(()=>{t()},r)})}}var od,sd;!function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"}(od||(od={}));class id{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const t=function(...e){let t=e.shift();const r=new WeakMap;for(;e.length>0;)t=Tp(t,e.shift(),0,r);return t}({},Yp(),function(e){const t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??Xp,Object.assign({},e,{spanLimits:t})}(e));this._resource=t.resource??Up({[zh]:"unknown_service",[Vh]:Kh[Vh],[Gh]:Kh[Gh],[Wh]:Kh[Wh]}),this._config=Object.assign({},t,{resource:this._resource});const r=[];e.spanProcessors?.length&&r.push(...e.spanProcessors),this._activeSpanProcessor=new nd(r)}getTracer(e,t,r){const n=`${e}@${t||""}:${r?.schemaUrl||""}`;return this._tracers.has(n)||this._tracers.set(n,new rd({name:e,version:t,schemaUrl:r?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(n)}forceFlush(){const e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(r=>{let n;const o=setTimeout(()=>{r(new Error(`Span processor did not completed within timeout period of ${e} ms`)),n=od.timeout},e);t.forceFlush().then(()=>{clearTimeout(o),n!==od.timeout&&(n=od.resolved,r(n))}).catch(e=>{clearTimeout(o),n=od.error,r(e)})}));return new Promise((e,r)=>{Promise.all(t).then(t=>{const n=t.filter(e=>e!==od.resolved);n.length>0?r(n):e()}).catch(e=>r([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class ad{_enabled=!1;_currentContext=ru;_bindFunction(e=ru,t){const r=this,n=function(...n){return r.with(e,()=>t.apply(this,n))};return Object.defineProperty(n,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),n}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=ru,this._enabled=!1,this}enable(){return this._enabled||(this._enabled=!0,this._currentContext=ru),this}with(e,t,r,...n){const o=this._currentContext;this._currentContext=e||ru;try{return t.call(r,...n)}finally{this._currentContext=o}}}class ld extends id{constructor(e={}){super(e)}register(e={}){var t;vh.setGlobalTracerProvider(this),null!==(t=e.propagator)&&(void 0!==t?yh.setGlobalPropagator(t):yh.setGlobalPropagator(new ip({propagators:[new mp,new Ih]}))),function(e){if(null!==e){if(void 0===e){const e=new ad;return e.enable(),void nh.setGlobalContextManager(e)}e.enable(),nh.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"}(sd||(sd={}));let cd;function ud(e,t){return t in e}function hd(e,t,r,n=!0){if(ud(r,t)&&"number"==typeof r[t]&&(!n||0!==r[t]))return e.addEvent(t,r[t])}function pd(e,t,r=!1,n,o){if(void 0===n&&(n=0!==t[sd.START_TIME]),r||(hd(e,sd.FETCH_START,t,n),hd(e,sd.DOMAIN_LOOKUP_START,t,n),hd(e,sd.DOMAIN_LOOKUP_END,t,n),hd(e,sd.CONNECT_START,t,n),hd(e,sd.SECURE_CONNECTION_START,t,n),hd(e,sd.CONNECT_END,t,n),hd(e,sd.REQUEST_START,t,n),hd(e,sd.RESPONSE_START,t,n),hd(e,sd.RESPONSE_END,t,n)),!o){const r=t[sd.ENCODED_BODY_SIZE];void 0!==r&&e.setAttribute("http.response_content_length",r);const n=t[sd.DECODED_BODY_SIZE];void 0!==n&&r!==n&&e.setAttribute("http.response_content_length_uncompressed",n)}}function dd(){return"undefined"!=typeof location?location.origin:void 0}function fd(e,t,r,n,o=new WeakSet,s){const i=md(e),a=function(e,t,r,n,o,s){const i=tp(t),a=tp(r);let l=n.filter(t=>{const r=tp(ep(t[sd.FETCH_START])),n=tp(ep(t[sd.RESPONSE_END]));return t.initiatorType.toLowerCase()===(s||"xmlhttprequest")&&t.name===e&&r>=i&&n<=a});l.length>0&&(l=l.filter(e=>!o.has(e)));return l}(e=i.toString(),t,r,n,o,s);if(0===a.length)return{mainRequest:void 0};if(1===a.length)return{mainRequest:a[0]};const l=function(e){return e.slice().sort((e,t)=>{const r=e[sd.FETCH_START],n=t[sd.FETCH_START];return r>n?1:r<n?-1:0})}(a);if(i.origin!==dd()&&l.length>1){let e=l[0],t=function(e,t,r){const n=tp(r),o=tp(ep(t));let s,i=e[1];const a=e.length;for(let t=1;t<a;t++){const r=e[t],a=tp(ep(r[sd.FETCH_START])),l=n-tp(ep(r[sd.RESPONSE_END]));a>=o&&(!s||l<s)&&(s=l,i=r)}return i}(l,e[sd.RESPONSE_END],r);const n=e[sd.RESPONSE_END];return t[sd.FETCH_START]<n&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}return{mainRequest:a[0]}}function md(e){if("function"==typeof URL)return new URL(e,"undefined"!=typeof document?document.baseURI:"undefined"!=typeof location?location.href:void 0);const t=(cd||(cd=document.createElement("a")),cd);return t.href=e,t}function gd(e,t){let r=t||[];("string"==typeof r||r instanceof RegExp)&&(r=[r]);return md(e).origin===dd()||r.some(t=>Mp(e,t))}class yd{emit(e){}}const bd=new yd;const vd=new class{getLogger(e,t,r){return new yd}};class wd{constructor(e,t,r,n){this._provider=e,this.name=t,this.version=r,this.options=n}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):bd}}class Cd{getLogger(e,t,r){var n;return null!==(n=this.getDelegateLogger(e,t,r))&&void 0!==n?n:new wd(this,e,t,r)}getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:vd}setDelegate(e){this._delegate=e}getDelegateLogger(e,t,r){var n;return null===(n=this._delegate)||void 0===n?void 0:n.getLogger(e,t,r)}}const Sd="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},_d=Symbol.for("io.opentelemetry.js.api.logs"),Id=Sd;class Ad{constructor(){this._proxyLoggerProvider=new Cd}static getInstance(){return this._instance||(this._instance=new Ad),this._instance}setGlobalLoggerProvider(e){return Id[_d]?this.getLoggerProvider():(Id[_d]=(t=1,r=e,n=vd,e=>e===t?r:n),this._proxyLoggerProvider.setDelegate(e),e);var t,r,n}getLoggerProvider(){var e,t;return null!==(t=null===(e=Id[_d])||void 0===e?void 0:e.call(Id,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete Id[_d],this._proxyLoggerProvider=new Cd}}const Ed=Ad.getInstance();let Td=console.error.bind(console);function kd(e,t,r){const n=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:n,writable:!0,value:r})}const Od=(e,t,r)=>{if(!e||!e[t])return void Td("no original function "+String(t)+" to wrap");if(!r)return Td("no wrapper function"),void Td((new Error).stack);const n=e[t];if("function"!=typeof n||"function"!=typeof r)return void Td("original object and wrapper must be functions");const o=r(n,t);return kd(o,"__original",n),kd(o,"__unwrap",()=>{e[t]===o&&kd(e,t,n)}),kd(o,"__wrapped",!0),kd(e,t,o),o},Rd=(e,t,r)=>{if(!e)return Td("must provide one or more modules to patch"),void Td((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{Od(e,t,r)})}):Td("must provide one or more functions to wrap on modules")},xd=(e,t)=>{if(!e||!e[t])return Td("no function to unwrap."),void Td((new Error).stack);const r=e[t];r.__unwrap?r.__unwrap():Td("no original to unwrap to -- has "+String(t)+" already been unwrapped?")},Nd=(e,t)=>{if(!e)return Td("must provide one or more modules to patch"),void Td((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{xd(e,t)})}):Td("must provide one or more functions to unwrap on modules")};class Md{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,r){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(r),this._diag=oh.createComponentLogger({namespace:e}),this._tracer=vh.getTracer(e,t),this._meter=ah.getMeter(e,t),this._logger=Ed.getLogger(e,t),this._updateMetricInstruments()}_wrap=Od;_unwrap=xd;_massWrap=Rd;_massUnwrap=Nd;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,r,n){if(e)try{e(r,n)}catch(e){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},e)}}}class Ld extends Md{constructor(e,t,r){super(e,t,r),this._config.enabled&&this.enable()}}function Dd(e,t,r){let n,o;try{o=e()}catch(e){n=e}finally{return t(n,o),o}}function Pd(e){return"function"==typeof e&&"function"==typeof e.__original&&"function"==typeof e.__unwrap&&!0===e.__wrapped}var Fd,Bd;function Ud(e,t){let r=Fd.OLD;const n=t?.split(",").map(e=>e.trim()).filter(e=>""!==e);for(const t of n??[]){if(t.toLowerCase()===e+"/dup"){r=Fd.DUPLICATE;break}t.toLowerCase()===e&&(r=Fd.STABLE)}return r}!function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"}(Fd||(Fd={})),function(e){e.DOCUMENT_LOAD="documentLoad",e.DOCUMENT_FETCH="documentFetch",e.RESOURCE_FETCH="resourceFetch"}(Bd||(Bd={}));var Zd;!function(e){e.FIRST_PAINT="firstPaint",e.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"}(Zd||(Zd={}));const jd={"first-paint":Zd.FIRST_PAINT,"first-contentful-paint":Zd.FIRST_CONTENTFUL_PAINT};class zd extends Ld{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=Nh.getEntriesByType?.("resource");t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){const e=Array.from(document.getElementsByTagName("meta")).find(e=>e.getAttribute("name")===pp),t=(()=>{const e={},t=Nh.getEntriesByType?.("navigation")[0];if(t)Object.values(sd).forEach(r=>{if(ud(t,r)){const n=t[r];"number"==typeof n&&(e[r]=n)}});else{const t=Nh.timing;t&&Object.values(sd).forEach(r=>{if(ud(t,r)){const n=t[r];"number"==typeof n&&(e[r]=n)}})}return e})(),r=e&&e.content||"";nh.with(yh.extract(ru,{traceparent:r}),()=>{const e=this._startSpan(Bd.DOCUMENT_LOAD,sd.FETCH_START,t);e&&(nh.with(vh.setSpan(nh.active(),e),()=>{const e=this._startSpan(Bd.DOCUMENT_FETCH,sd.FETCH_START,t);e&&(e.setAttribute(Mh,location.href),nh.with(vh.setSpan(nh.active(),e),()=>{pd(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,sd.RESPONSE_END,t)}))}),e.setAttribute(Mh,location.href),e.setAttribute("http.user_agent",navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(hd(e,sd.FETCH_START,t),hd(e,sd.UNLOAD_EVENT_START,t),hd(e,sd.UNLOAD_EVENT_END,t),hd(e,sd.DOM_INTERACTIVE,t),hd(e,sd.DOM_CONTENT_LOADED_EVENT_START,t),hd(e,sd.DOM_CONTENT_LOADED_EVENT_END,t),hd(e,sd.DOM_COMPLETE,t),hd(e,sd.LOAD_EVENT_START,t),hd(e,sd.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||(e=>{const t=Nh.getEntriesByType?.("paint");t&&t.forEach(({name:t,startTime:r})=>{ud(jd,t)&&e.addEvent(jd[t],r)})})(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,sd.LOAD_EVENT_END,t))})}_endSpan(e,t,r){e&&(ud(r,t)?e.end(r[t]):e.end())}_initResourceSpan(e,t){const r=this._startSpan(Bd.RESOURCE_FETCH,sd.FETCH_START,e,t);r&&(r.setAttribute(Mh,e.name),pd(r,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(r,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(r,sd.RESPONSE_END,e))}_startSpan(e,t,r,n){if(ud(r,t)&&"number"==typeof r[t]){return this.tracer.startSpan(e,{startTime:r[t]},n?vh.setSpan(nh.active(),n):void 0)}}_waitForPageLoad(){"complete"===window.document.readyState?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&Dd(()=>t(e),e=>{e&&this._diag.error("addCustomAttributesOnSpan",e)})}_addCustomAttributesOnResourceSpan(e,t,r){r&&Dd(()=>r(e,t),e=>{e&&this._diag.error("addCustomAttributesOnResourceSpan",e)})}enable(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener("load",this._onDocumentLoaded)}}const Vd="OT_ZONE_CONTEXT";class Gd{_enabled=!1;_zoneCounter=0;_activeContextFromZone(e){return e&&e.get(Vd)||ru}_bindFunction(e,t){const r=this,n=function(...n){return r.with(e,()=>t.apply(this,n))};return Object.defineProperty(n,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),n}_bindListener(e,t){const r=t;return void 0!==r.__ot_listeners||(r.__ot_listeners={},"function"==typeof r.addEventListener&&(r.addEventListener=this._patchAddEventListener(r,r.addEventListener,e)),"function"==typeof r.removeEventListener&&(r.removeEventListener=this._patchRemoveEventListener(r,r.removeEventListener))),t}_createZoneName(){this._zoneCounter++;const e=Math.random();return`${this._zoneCounter}-${e}`}_createZone(e,t){return Zone.current.fork({name:e,properties:{[Vd]:t}})}_getActiveZone(){return Zone.current}_patchAddEventListener(e,t,r){const n=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 l=n.bind(r,s);return a.set(s,l),t.call(this,o,l,i)}}_patchRemoveEventListener(e,t){return function(r,n){if(void 0===e.__ot_listeners||void 0===e.__ot_listeners[r])return t.call(this,r,n);const o=e.__ot_listeners[r],s=o.get(n);return o.delete(n),t.call(this,r,s||n)}}active(){if(!this._enabled)return ru;const e=this._getActiveZone(),t=this._activeContextFromZone(e);return t||ru}bind(e,t){return void 0===e&&(e=this.active()),"function"==typeof t?this._bindFunction(e,t):("object"==typeof(r=t)&&null!==r&&"addEventListener"in r&&"function"==typeof r.addEventListener&&"removeEventListener"in r&&"function"==typeof r.removeEventListener&&this._bindListener(e,t),t);var r}disable(){return this._enabled=!1,this}enable(){return this._enabled=!0,this}with(e,t,r,...n){const o=this._createZoneName();return this._createZone(o,e).run(t,r,n)}}
16
16
  /**
17
17
  * @license Angular v<unknown>
18
18
  * (c) 2010-2025 Google LLC. https://angular.io/