@monoscopetech/browser 0.5.2 → 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.
@@ -1,4 +1,4 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Monoscope=t()}(this,function(){"use strict";var e,t=Object.defineProperty,r=(e,r,n)=>((e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n)(e,"symbol"!=typeof r?r+"":r,n),n=Object.defineProperty,s=(e,t,r)=>((e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),o=Object.defineProperty,i=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const a={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},l={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},c={};function u(e){if(c[e])return c[e];const t=globalThis[e],r=t.prototype,n=e in a?a[e]:void 0,s=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),o=e in l?l[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&i&&!globalThis.Zone)return c[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const o=s[e].prototype;return document.body.removeChild(n),o?c[e]=o:r}catch{return r}}const h={};function p(e,t,r){var n;const s=`${e}.${String(r)}`;if(h[s])return h[s].call(t);const o=u(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(h[s]=i,i.call(t)):t[r]}const d={};function f(e,t,r){const n=`${e}.${String(r)}`;if(d[n])return d[n].bind(t);const s=u(e)[r];return"function"!=typeof s?t[r]:(d[n]=s,s.bind(t))}const m={childNodes:function(e){return p("Node",e,"childNodes")},parentNode:function(e){return p("Node",e,"parentNode")},parentElement:function(e){return p("Node",e,"parentElement")},textContent:function(e){return p("Node",e,"textContent")},contains:function(e,t){return f("Node",e,"contains")(t)},getRootNode:function(e){return f("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?p("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?p("Element",e,"shadowRoot"):null},querySelector:function(e,t){return p("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return p("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return u("MutationObserver").constructor}};let g=class{constructor(){i(this,"idNodeMap",new Map),i(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function y(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&y(m.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&y(m.parentNode(e),t,r)}function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function v(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var w={exports:{}},C=String,S=function(){return{isColorSupported:!1,reset:C,bold:C,dim:C,italic:C,underline:C,inverse:C,hidden:C,strikethrough:C,black:C,red:C,green:C,yellow:C,blue:C,magenta:C,cyan:C,white:C,gray:C,bgBlack:C,bgRed:C,bgGreen:C,bgYellow:C,bgBlue:C,bgMagenta:C,bgCyan:C,bgWhite:C}};w.exports=S(),w.exports.createColors=S;var _=w.exports;const I=v(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let A=_,E=I,T=class e extends Error{constructor(t,r,n,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=A.isColorSupported),E&&e&&(t=E(t));let r,n,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=A.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var k=T;T.default=T;var O={};O.isClean=Symbol("isClean"),O.my=Symbol("my");const R={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let x=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return R[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[s]?n=this[s](o,e):o.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var i;return void 0===n&&(n=R[r]),o.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var N=x;x.default=x;let M=N;function L(e,t){new M(t).stringify(e)}var D=L;L.default=L;let{isClean:P,my:F}=O,B=k,U=N,Z=D;function j(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>j(e,r)):("object"===o&&null!==s&&(s=j(s)),r[n]=s)}return r}let z=class{constructor(e={}){this.raws={},this[P]=!1,this[F]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=j(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new B(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[P]){this[P]=!1;let e=this;for(;e=e.parent;)e[P]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new U).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Z){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var V=z;z.default=z;let G=V,W=class extends G{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var H=W;W.default=W;var Y={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:K,SourceMapGenerator:J}=I,{existsSync:X,readFileSync:q}=I,{dirname:Q,join:$}=I;let ee=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Q(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new K(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=Q(e),X(e))return this.mapFile=e,q(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof K)return J.fromSourceMap(t).toString();if(t instanceof J)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=$(Q(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var te=ee;ee.default=ee;let{SourceMapConsumer:re,SourceMapGenerator:ne}=I,{fileURLToPath:se,pathToFileURL:oe}=I,{isAbsolute:ie,resolve:ae}=I,{nanoid:le}=Y,ce=I,ue=k,he=te,pe=Symbol("fromOffsetCache"),de=Boolean(re&&ne),fe=Boolean(ae&&ie),me=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!fe||/^\w+:\/\//.test(t.from)||ie(t.from)?this.file=t.from:this.file=ae(t.from)),fe&&de){let e=new he(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+le(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,i=e.col}else o=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return s=a?new ue(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new ue(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,n.plugin),s.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(oe&&(s.input.url=oe(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[pe])r=this[pe];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[pe]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ae(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=i.originalPositionFor({column:n,line:r})),o=ie(a.source)?oe(a.source):new URL(a.source,this.map.consumer().sourceRoot||oe(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!se)throw new Error("file: protocol is not available in this PostCSS build");l.file=se(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var ge=me;me.default=me,ce&&ce.registerInput&&ce.registerInput(me);let{SourceMapConsumer:ye,SourceMapGenerator:be}=I,{dirname:ve,relative:we,resolve:Ce,sep:Se}=I,{pathToFileURL:_e}=I,Ie=ge,Ae=Boolean(ye&&be),Ee=Boolean(ve&&Ce&&we&&Se);var Te=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||ve(e.file);!1===this.mapOpts.sourcesContent?(t=new ye(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Ee&&Ae&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=be.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new be({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new be({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),n=i.length-t):n+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?ve(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=ve(Ce(r,this.mapOpts.annotation)));let n=we(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Ie(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(_e){let t=_e(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Se&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let ke=V,Oe=class extends ke{constructor(e){super(e),this.type="comment"}};var Re=Oe;Oe.default=Oe;let xe,Ne,Me,Le,{isClean:De,my:Pe}=O,Fe=H,Be=Re,Ue=V;function Ze(e){return e.map(e=>(e.nodes&&(e.nodes=Ze(e.nodes)),delete e.source,e))}function je(e){if(e[De]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)je(t)}let ze=class e extends Ue{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Ze(xe(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Fe(t)]}else if(t.selector)t=[new Ne(t)];else if(t.name)t=[new Me(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Be(t)]}return t.map(t=>(t[Pe]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[De]&&je(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};ze.registerParse=e=>{xe=e},ze.registerRule=e=>{Ne=e},ze.registerAtRule=e=>{Me=e},ze.registerRoot=e=>{Le=e};var Ve=ze;ze.default=ze,ze.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Me.prototype):"rule"===e.type?Object.setPrototypeOf(e,Ne.prototype):"decl"===e.type?Object.setPrototypeOf(e,Fe.prototype):"comment"===e.type?Object.setPrototypeOf(e,Be.prototype):"root"===e.type&&Object.setPrototypeOf(e,Le.prototype),e[Pe]=!0,e.nodes&&e.nodes.forEach(e=>{ze.rebuild(e)})};let Ge,We,He=Ve,Ye=class extends He{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ge(new We,this,e).stringify()}};Ye.registerLazyResult=e=>{Ge=e},Ye.registerProcessor=e=>{We=e};var Ke=Ye;Ye.default=Ye;let Je={};var Xe=function(e){Je[e]||(Je[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let qe=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Qe=qe;qe.default=qe;let $e=Qe,et=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new $e(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var tt=et;et.default=et;const rt="'".charCodeAt(0),nt='"'.charCodeAt(0),st="\\".charCodeAt(0),ot="/".charCodeAt(0),it="\n".charCodeAt(0),at=" ".charCodeAt(0),lt="\f".charCodeAt(0),ct="\t".charCodeAt(0),ut="\r".charCodeAt(0),ht="[".charCodeAt(0),pt="]".charCodeAt(0),dt="(".charCodeAt(0),ft=")".charCodeAt(0),mt="{".charCodeAt(0),gt="}".charCodeAt(0),yt=";".charCodeAt(0),bt="*".charCodeAt(0),vt=":".charCodeAt(0),wt="@".charCodeAt(0),Ct=/[\t\n\f\r "#'()/;[\\\]{}]/g,St=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,_t=/.[\r\n"'(/\\]/,It=/[\da-f]/i;let At=Ve,Et=class extends At{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var Tt=Et;Et.default=Et,At.registerAtRule(Et);let kt,Ot,Rt=Ve,xt=class extends Rt{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new kt(new Ot,this,e).stringify()}};xt.registerLazyResult=e=>{kt=e},xt.registerProcessor=e=>{Ot=e};var Nt=xt;xt.default=xt,Rt.registerRoot(xt);let Mt={comma:e=>Mt.split(e,[","],!0),space:e=>Mt.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],s="",o=!1,i=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?i+=1:")"===r?i>0&&(i-=1):0===i&&t.includes(r)&&(o=!0),o?(""!==s&&n.push(s.trim()),s="",o=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};var Lt=Mt;Mt.default=Mt;let Dt=Ve,Pt=Lt,Ft=class extends Dt{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Pt.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Bt=Ft;Ft.default=Ft,Dt.registerRule(Ft);let Ut=H,Zt=function(e,t={}){let r,n,s,o,i,a,l,c,u,h,p=e.css.valueOf(),d=t.ignoreErrors,f=p.length,m=0,g=[],y=[];function b(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=p.charCodeAt(m),r){case it:case at:case ct:case ut:case lt:n=m;do{n+=1,r=p.charCodeAt(n)}while(r===at||r===it||r===ct||r===ut||r===lt);h=["space",p.slice(m,n)],m=n-1;break;case ht:case pt:case mt:case gt:case vt:case yt:case ft:{let e=String.fromCharCode(r);h=[e,e,m];break}case dt:if(c=g.length?g.pop()[1]:"",u=p.charCodeAt(m+1),"url"===c&&u!==rt&&u!==nt&&u!==at&&u!==it&&u!==ct&&u!==lt&&u!==ut){n=m;do{if(a=!1,n=p.indexOf(")",n+1),-1===n){if(d||t){n=m;break}b("bracket")}for(l=n;p.charCodeAt(l-1)===st;)l-=1,a=!a}while(a);h=["brackets",p.slice(m,n+1),m,n],m=n}else n=p.indexOf(")",m+1),o=p.slice(m,n+1),-1===n||_t.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case rt:case nt:s=r===rt?"'":'"',n=m;do{if(a=!1,n=p.indexOf(s,n+1),-1===n){if(d||t){n=m+1;break}b("string")}for(l=n;p.charCodeAt(l-1)===st;)l-=1,a=!a}while(a);h=["string",p.slice(m,n+1),m,n],m=n;break;case wt:Ct.lastIndex=m+1,Ct.test(p),n=0===Ct.lastIndex?p.length-1:Ct.lastIndex-2,h=["at-word",p.slice(m,n+1),m,n],m=n;break;case st:for(n=m,i=!0;p.charCodeAt(n+1)===st;)n+=1,i=!i;if(r=p.charCodeAt(n+1),i&&r!==ot&&r!==at&&r!==it&&r!==ct&&r!==ut&&r!==lt&&(n+=1,It.test(p.charAt(n)))){for(;It.test(p.charAt(n+1));)n+=1;p.charCodeAt(n+1)===at&&(n+=1)}h=["word",p.slice(m,n+1),m,n],m=n;break;default:r===ot&&p.charCodeAt(m+1)===bt?(n=p.indexOf("*/",m+2)+1,0===n&&(d||t?n=p.length:b("comment")),h=["comment",p.slice(m,n+1),m,n],m=n):(St.lastIndex=m+1,St.test(p),n=0===St.lastIndex?p.length-1:St.lastIndex-2,h=["word",p.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},jt=Re,zt=Tt,Vt=Nt,Gt=Bt;const Wt={empty:!0,space:!0};let Ht=Ve,Yt=class{constructor(e){this.input=e,this.root=new Vt,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new zt;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[o,i]of e.entries()){if(t=i,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new jt;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Zt(this.input)}decl(e,t){let r=new Ut;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Gt;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,s=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),o.push("("===r?")":"]");else if(i&&n&&"{"===r)s||(s=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,i);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(s),t&&n){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let s,o,i,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],o=s[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",Wt[a]||Wt[i]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new Gt;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Kt=ge;function Jt(e,t){let r=new Kt(e,t),n=new Yt(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var Xt=Jt;Jt.default=Jt,Ht.registerParse(Jt);let{isClean:qt,my:Qt}=O,$t=Te,er=D,tr=Ve,rr=Ke,nr=Xe,sr=tt,or=Xt,ir=Nt;const ar={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},lr={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},cr={Once:!0,postcssPlugin:!0,prepare:!0};function ur(e){return"object"==typeof e&&"function"==typeof e.then}function hr(e){let t=!1,r=ar[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function pr(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:hr(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function dr(e){return e[qt]=!1,e.nodes&&e.nodes.forEach(e=>dr(e)),e}let fr={},mr=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof sr)s=dr(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=or;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[Qt]&&tr.rebuild(s)}else s=dr(r);this.result=new sr(t,s,n),this.helpers={...fr,postcss:fr,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,s=t.split("."),o=n.split(".");(s[0]!==o[0]||parseInt(s[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!lr[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!cr[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(ur(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qt];){e[qt]=!0;let t=[pr(e)];for(;t.length>0;){let e=this.visitTick(t);if(ur(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return ur(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=er;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new $t(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(ur(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qt];)e[qt]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||nr("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(ur(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[qt])return n[qt]=!0,void e.push(pr(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[qt]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[qt]=!0;let t=hr(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[qt]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};mr.registerPostcss=e=>{fr=e};var gr=mr;mr.default=mr,ir.registerLazyResult(mr),rr.registerLazyResult(mr);let yr=Te,br=D,vr=Xe,wr=Xt;const Cr=tt;let Sr=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=br;this.result=new Cr(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new yr(s,n,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||vr("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=wr;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var _r=Sr;Sr.default=Sr;let Ir=_r,Ar=gr,Er=Ke,Tr=Nt,kr=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Ar(this,e,t):new Ir(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Or=kr;kr.default=kr,Tr.registerProcessor(kr),Er.registerProcessor(kr);let Rr=H,xr=te,Nr=Re,Mr=Tt,Lr=ge,Dr=Nt,Pr=Bt;function Fr(e,t){if(Array.isArray(e))return e.map(e=>Fr(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Lr.prototype};r.map&&(r.map={...r.map,__proto__:xr.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Fr(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Dr(n);if("decl"===n.type)return new Rr(n);if("rule"===n.type)return new Pr(n);if("comment"===n.type)return new Nr(n);if("atrule"===n.type)return new Mr(n);throw new Error("Unknown node type: "+e.type)}var Br=Fr;Fr.default=Fr;let Ur=k,Zr=H,jr=gr,zr=Ve,Vr=Or,Gr=D,Wr=Br,Hr=Ke,Yr=Qe,Kr=Re,Jr=Tt,Xr=tt,qr=ge,Qr=Xt,$r=Lt,en=Bt,tn=Nt,rn=V;function nn(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Vr(e)}nn.plugin=function(e,t){let r,n=!1;function s(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new Vr).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return nn([s(r)]).process(e,t)},s},nn.stringify=Gr,nn.parse=Qr,nn.fromJSON=Wr,nn.list=$r,nn.comment=e=>new Kr(e),nn.atRule=e=>new Jr(e),nn.decl=e=>new Zr(e),nn.rule=e=>new en(e),nn.root=e=>new tn(e),nn.document=e=>new Hr(e),nn.CssSyntaxError=Ur,nn.Declaration=Zr,nn.Container=zr,nn.Processor=Vr,nn.Document=Hr,nn.Comment=Kr,nn.Warning=Yr,nn.AtRule=Jr,nn.Result=Xr,nn.Input=qr,nn.Rule=en,nn.Root=tn,nn.Node=rn,jr.registerPostcss(nn);var sn=nn;nn.default=nn;const on=b(sn);on.stringify,on.fromJSON,on.plugin,on.parse,on.list,on.document,on.comment,on.atRule,on.rule,on.decl,on.root,on.CssSyntaxError,on.Declaration,on.Container,on.Processor,on.Document,on.Comment,on.Warning,on.AtRule,on.Result,on.Input,on.Rule,on.Root,on.Node;var an=Object.defineProperty,ln=(e,t,r)=>((e,t,r)=>t in e?an(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function cn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function un(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var hn={exports:{}},pn=String,dn=function(){return{isColorSupported:!1,reset:pn,bold:pn,dim:pn,italic:pn,underline:pn,inverse:pn,hidden:pn,strikethrough:pn,black:pn,red:pn,green:pn,yellow:pn,blue:pn,magenta:pn,cyan:pn,white:pn,gray:pn,bgBlack:pn,bgRed:pn,bgGreen:pn,bgYellow:pn,bgBlue:pn,bgMagenta:pn,bgCyan:pn,bgWhite:pn}};hn.exports=dn(),hn.exports.createColors=dn;var fn=hn.exports;const mn=un(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let gn=fn,yn=mn,bn=class e extends Error{constructor(t,r,n,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=gn.isColorSupported),yn&&e&&(t=yn(t));let r,n,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=gn.createColors(!0);r=t=>e(s(t)),n=e=>t(e)}else r=n=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var vn=bn;bn.default=bn;var wn={};wn.isClean=Symbol("isClean"),wn.my=Symbol("my");const Cn={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Sn=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(r+n+s,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&"root"!==n.type;)s+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let s=e.nodes[n],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let s=e.parent;if("before"===r){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return Cn[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let s="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[s]?n=this[s](o,e):o.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var i;return void 0===n&&(n=Cn[r]),o.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var _n=Sn;Sn.default=Sn;let In=_n;function An(e,t){new In(t).stringify(e)}var En=An;An.default=An;let{isClean:Tn,my:kn}=wn,On=vn,Rn=_n,xn=En;function Nn(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let s=e[n],o=typeof s;"parent"===n&&"object"===o?t&&(r[n]=t):"source"===n?r[n]=s:Array.isArray(s)?r[n]=s.map(e=>Nn(e,r)):("object"===o&&null!==s&&(s=Nn(s)),r[n]=s)}return r}let Mn=class{constructor(e={}){this.raws={},this[Tn]=!1,this[kn]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Nn(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new On(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[Tn]){this[Tn]=!1;let e=this;for(;e=e.parent;)e[Tn]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,s+=1):n+=1;return{column:n,line:s}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),s=n.indexOf(e.word);-1!==s&&(t=this.positionInside(s,n),r=this.positionInside(s+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Rn).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let o=t.get(n.input);null==o&&(o=s,t.set(n.input,s),s++),r[e]={end:n.end,inputId:o,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=xn){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var Ln=Mn;Mn.default=Mn;let Dn=Ln,Pn=class extends Dn{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Fn=Pn;Pn.default=Pn;var Bn={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Un,SourceMapGenerator:Zn}=mn,{existsSync:jn,readFileSync:zn}=mn,{dirname:Vn,join:Gn}=mn;let Wn=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Vn(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Un(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=Vn(e),jn(e))return this.mapFile=e,zn(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Un)return Zn.fromSourceMap(t).toString();if(t instanceof Zn)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Gn(Vn(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Hn=Wn;Wn.default=Wn;let{SourceMapConsumer:Yn,SourceMapGenerator:Kn}=mn,{fileURLToPath:Jn,pathToFileURL:Xn}=mn,{isAbsolute:qn,resolve:Qn}=mn,{nanoid:$n}=Bn,es=mn,ts=vn,rs=Hn,ns=Symbol("fromOffsetCache"),ss=Boolean(Yn&&Kn),os=Boolean(Qn&&qn),is=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!os||/^\w+:\/\//.test(t.from)||qn(t.from)?this.file=t.from:this.file=Qn(t.from)),os&&ss){let e=new rs(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+$n(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let s,o,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);o=e.line,i=e.col}else o=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return s=a?new ts(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new ts(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,n.plugin),s.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(Xn&&(s.input.url=Xn(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,r;if(this[ns])r=this[ns];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,s=e.length;n<s;n++)r[n]=t,t+=e[n].length+1;this[ns]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,s=r.length-2;for(;n<s;)if(t=n+(s-n>>1),e<r[t])s=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Qn(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(s=i.originalPositionFor({column:n,line:r})),o=qn(a.source)?Xn(a.source):new URL(a.source,this.map.consumer().sourceRoot||Xn(this.map.mapFile));let l={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Jn)throw new Error("file: protocol is not available in this PostCSS build");l.file=Jn(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var as=is;is.default=is,es&&es.registerInput&&es.registerInput(is);let{SourceMapConsumer:ls,SourceMapGenerator:cs}=mn,{dirname:us,relative:hs,resolve:ps,sep:ds}=mn,{pathToFileURL:fs}=mn,ms=as,gs=Boolean(ls&&cs),ys=Boolean(us&&ps&&hs&&ds);var bs=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||us(e.file);!1===this.mapOpts.sourcesContent?(t=new ls(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),ys&&gs&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=cs.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new cs({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new cs({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=n-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),n=i.length-t):n+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=n-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=n-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?us(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=us(ps(r,this.mapOpts.annotation)));let n=hs(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new ms(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(fs){let t=fs(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===ds&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let vs=Ln,ws=class extends vs{constructor(e){super(e),this.type="comment"}};var Cs=ws;ws.default=ws;let Ss,_s,Is,As,{isClean:Es,my:Ts}=wn,ks=Fn,Os=Cs,Rs=Ln;function xs(e){return e.map(e=>(e.nodes&&(e.nodes=xs(e.nodes)),delete e.source,e))}function Ns(e){if(e[Es]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ns(t)}let Ms=class e extends Rs{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),s=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),s=0===n&&"prepend",o=this.normalize(t,this.proxyOf.nodes[n],s).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=xs(Ss(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new ks(t)]}else if(t.selector)t=[new _s(t)];else if(t.name)t=[new Is(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Os(t)]}return t.map(t=>(t[Ts]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Es]&&Ns(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Ms.registerParse=e=>{Ss=e},Ms.registerRule=e=>{_s=e},Ms.registerAtRule=e=>{Is=e},Ms.registerRoot=e=>{As=e};var Ls=Ms;Ms.default=Ms,Ms.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Is.prototype):"rule"===e.type?Object.setPrototypeOf(e,_s.prototype):"decl"===e.type?Object.setPrototypeOf(e,ks.prototype):"comment"===e.type?Object.setPrototypeOf(e,Os.prototype):"root"===e.type&&Object.setPrototypeOf(e,As.prototype),e[Ts]=!0,e.nodes&&e.nodes.forEach(e=>{Ms.rebuild(e)})};let Ds,Ps,Fs=Ls,Bs=class extends Fs{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ds(new Ps,this,e).stringify()}};Bs.registerLazyResult=e=>{Ds=e},Bs.registerProcessor=e=>{Ps=e};var Us=Bs;Bs.default=Bs;let Zs={};var js=function(e){Zs[e]||(Zs[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let zs=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Vs=zs;zs.default=zs;let Gs=Vs,Ws=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Gs(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Hs=Ws;Ws.default=Ws;const Ys="'".charCodeAt(0),Ks='"'.charCodeAt(0),Js="\\".charCodeAt(0),Xs="/".charCodeAt(0),qs="\n".charCodeAt(0),Qs=" ".charCodeAt(0),$s="\f".charCodeAt(0),eo="\t".charCodeAt(0),to="\r".charCodeAt(0),ro="[".charCodeAt(0),no="]".charCodeAt(0),so="(".charCodeAt(0),oo=")".charCodeAt(0),io="{".charCodeAt(0),ao="}".charCodeAt(0),lo=";".charCodeAt(0),co="*".charCodeAt(0),uo=":".charCodeAt(0),ho="@".charCodeAt(0),po=/[\t\n\f\r "#'()/;[\\\]{}]/g,fo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,mo=/.[\r\n"'(/\\]/,go=/[\da-f]/i;let yo=Ls,bo=class extends yo{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var vo=bo;bo.default=bo,yo.registerAtRule(bo);let wo,Co,So=Ls,_o=class extends So{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new wo(new Co,this,e).stringify()}};_o.registerLazyResult=e=>{wo=e},_o.registerProcessor=e=>{Co=e};var Io=_o;_o.default=_o,So.registerRoot(_o);let Ao={comma:e=>Ao.split(e,[","],!0),space:e=>Ao.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],s="",o=!1,i=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?i+=1:")"===r?i>0&&(i-=1):0===i&&t.includes(r)&&(o=!0),o?(""!==s&&n.push(s.trim()),s="",o=!1):s+=r;return(r||""!==s)&&n.push(s.trim()),n}};var Eo=Ao;Ao.default=Ao;let To=Ls,ko=Eo,Oo=class extends To{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return ko.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Ro=Oo;Oo.default=Oo,To.registerRule(Oo);let xo=Fn,No=function(e,t={}){let r,n,s,o,i,a,l,c,u,h,p=e.css.valueOf(),d=t.ignoreErrors,f=p.length,m=0,g=[],y=[];function b(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=p.charCodeAt(m),r){case qs:case Qs:case eo:case to:case $s:n=m;do{n+=1,r=p.charCodeAt(n)}while(r===Qs||r===qs||r===eo||r===to||r===$s);h=["space",p.slice(m,n)],m=n-1;break;case ro:case no:case io:case ao:case uo:case lo:case oo:{let e=String.fromCharCode(r);h=[e,e,m];break}case so:if(c=g.length?g.pop()[1]:"",u=p.charCodeAt(m+1),"url"===c&&u!==Ys&&u!==Ks&&u!==Qs&&u!==qs&&u!==eo&&u!==$s&&u!==to){n=m;do{if(a=!1,n=p.indexOf(")",n+1),-1===n){if(d||t){n=m;break}b("bracket")}for(l=n;p.charCodeAt(l-1)===Js;)l-=1,a=!a}while(a);h=["brackets",p.slice(m,n+1),m,n],m=n}else n=p.indexOf(")",m+1),o=p.slice(m,n+1),-1===n||mo.test(o)?h=["(","(",m]:(h=["brackets",o,m,n],m=n);break;case Ys:case Ks:s=r===Ys?"'":'"',n=m;do{if(a=!1,n=p.indexOf(s,n+1),-1===n){if(d||t){n=m+1;break}b("string")}for(l=n;p.charCodeAt(l-1)===Js;)l-=1,a=!a}while(a);h=["string",p.slice(m,n+1),m,n],m=n;break;case ho:po.lastIndex=m+1,po.test(p),n=0===po.lastIndex?p.length-1:po.lastIndex-2,h=["at-word",p.slice(m,n+1),m,n],m=n;break;case Js:for(n=m,i=!0;p.charCodeAt(n+1)===Js;)n+=1,i=!i;if(r=p.charCodeAt(n+1),i&&r!==Xs&&r!==Qs&&r!==qs&&r!==eo&&r!==to&&r!==$s&&(n+=1,go.test(p.charAt(n)))){for(;go.test(p.charAt(n+1));)n+=1;p.charCodeAt(n+1)===Qs&&(n+=1)}h=["word",p.slice(m,n+1),m,n],m=n;break;default:r===Xs&&p.charCodeAt(m+1)===co?(n=p.indexOf("*/",m+2)+1,0===n&&(d||t?n=p.length:b("comment")),h=["comment",p.slice(m,n+1),m,n],m=n):(fo.lastIndex=m+1,fo.test(p),n=0===fo.lastIndex?p.length-1:fo.lastIndex-2,h=["word",p.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},Mo=Cs,Lo=vo,Do=Io,Po=Ro;const Fo={empty:!0,space:!0};let Bo=Ls,Uo=class{constructor(e){this.input=e,this.root=new Do,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,s=new Lo;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(s.source.end=this.getPosition(r[3]||r[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let s=t-1;s>=0&&(r=e[s],"space"===r[0]||(n+=1,2!==n));s--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,s=0;for(let[o,i]of e.entries()){if(t=i,r=t[0],"("===r&&(s+=1),")"===r&&(s-=1),0===s&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return o}this.doubleColon(t)}n=t}return!1}comment(e){let t=new Mo;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=No(this.input)}decl(e,t){let r=new xo;this.init(r,e[0][2]);let n,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),s="";for(let e=t;e>0;e--){let t=n[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=n.pop()[1]+s}0===s.trim().indexOf("!")&&(r.important=!0,r.raws.important=s,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Po;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,s=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)s||(s=l),o.push("("===r?")":"]");else if(i&&n&&"{"===r)s||(s=l),o.push("}");else if(0===o.length){if(";"===r){if(n)return void this.decl(a,i);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(s=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(s),t&&n){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let s,o,i,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)s=r[e],o=s[0],"space"!==o||e!==l-1||n?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",Fo[a]||Fo[i]||","===c.slice(-1)?u=!1:c+=s[1]):c+=s[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new Po;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Zo=as;function jo(e,t){let r=new Zo(e,t),n=new Uo(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var zo=jo;jo.default=jo,Bo.registerParse(jo);let{isClean:Vo,my:Go}=wn,Wo=bs,Ho=En,Yo=Ls,Ko=Us,Jo=js,Xo=Hs,qo=zo,Qo=Io;const $o={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ei={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},ti={Once:!0,postcssPlugin:!0,prepare:!0};function ri(e){return"object"==typeof e&&"function"==typeof e.then}function ni(e){let t=!1,r=$o[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function si(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:ni(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function oi(e){return e[Vo]=!1,e.nodes&&e.nodes.forEach(e=>oi(e)),e}let ii={},ai=class e{constructor(t,r,n){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof Xo)s=oi(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=qo;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{s=e(r,n)}catch(e){this.processed=!0,this.error=e}s&&!s[Go]&&Yo.rebuild(s)}else s=oi(r);this.result=new Xo(t,s,n),this.helpers={...ii,postcss:ii,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,s=t.split("."),o=n.split(".");(s[0]!==o[0]||parseInt(s[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!ei[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ti[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(ri(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Vo];){e[Vo]=!0;let t=[si(e)];for(;t.length>0;){let e=this.visitTick(t);if(ri(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return ri(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Ho;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Wo(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(ri(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Vo];)e[Vo]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Jo("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(ri(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,s]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,s=t.iterator;for(;n=r.nodes[r.indexes[s]];)if(r.indexes[s]+=1,!n[Vo])return n[Vo]=!0,void e.push(si(n));t.iterator=0,delete r.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[Vo]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Vo]=!0;let t=ni(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[Vo]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};ai.registerPostcss=e=>{ii=e};var li=ai;ai.default=ai,Qo.registerLazyResult(ai),Ko.registerLazyResult(ai);let ci=bs,ui=En,hi=js,pi=zo;const di=Hs;let fi=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let s=ui;this.result=new di(this._processor,n,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new ci(s,n,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||hi("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=pi;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var mi=fi;fi.default=fi;let gi=mi,yi=li,bi=Us,vi=Io,wi=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new yi(this,e,t):new gi(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Ci=wi;wi.default=wi,vi.registerProcessor(wi),bi.registerProcessor(wi);let Si=Fn,_i=Hn,Ii=Cs,Ai=vo,Ei=as,Ti=Io,ki=Ro;function Oi(e,t){if(Array.isArray(e))return e.map(e=>Oi(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Ei.prototype};r.map&&(r.map={...r.map,__proto__:_i.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Oi(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Ti(n);if("decl"===n.type)return new Si(n);if("rule"===n.type)return new ki(n);if("comment"===n.type)return new Ii(n);if("atrule"===n.type)return new Ai(n);throw new Error("Unknown node type: "+e.type)}var Ri=Oi;Oi.default=Oi;let xi=vn,Ni=Fn,Mi=li,Li=Ls,Di=Ci,Pi=En,Fi=Ri,Bi=Us,Ui=Vs,Zi=Cs,ji=vo,zi=Hs,Vi=as,Gi=zo,Wi=Eo,Hi=Ro,Yi=Io,Ki=Ln;function Ji(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Di(e)}Ji.plugin=function(e,t){let r,n=!1;function s(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...r);return s.postcssPlugin=e,s.postcssVersion=(new Di).version,s}return Object.defineProperty(s,"postcss",{get:()=>(r||(r=s()),r)}),s.process=function(e,t,r){return Ji([s(r)]).process(e,t)},s},Ji.stringify=Pi,Ji.parse=Gi,Ji.fromJSON=Fi,Ji.list=Wi,Ji.comment=e=>new Zi(e),Ji.atRule=e=>new ji(e),Ji.decl=e=>new Ni(e),Ji.rule=e=>new Hi(e),Ji.root=e=>new Yi(e),Ji.document=e=>new Bi(e),Ji.CssSyntaxError=xi,Ji.Declaration=Ni,Ji.Container=Li,Ji.Processor=Di,Ji.Document=Bi,Ji.Comment=Zi,Ji.Warning=Ui,Ji.AtRule=ji,Ji.Result=zi,Ji.Input=Vi,Ji.Rule=Hi,Ji.Root=Yi,Ji.Node=Ki,Mi.registerPostcss(Ji);var Xi=Ji;Ji.default=Ji;const qi=cn(Xi);qi.stringify,qi.fromJSON,qi.plugin,qi.parse,qi.list,qi.document,qi.comment,qi.atRule,qi.rule,qi.decl,qi.root,qi.CssSyntaxError,qi.Declaration,qi.Container,qi.Processor,qi.Document,qi.Comment,qi.Warning,qi.AtRule,qi.Result,qi.Input,qi.Rule,qi.Root,qi.Node;class Qi{constructor(...e){ln(this,"parentElement",null),ln(this,"parentNode",null),ln(this,"ownerDocument"),ln(this,"firstChild",null),ln(this,"lastChild",null),ln(this,"previousSibling",null),ln(this,"nextSibling",null),ln(this,"ELEMENT_NODE",1),ln(this,"TEXT_NODE",3),ln(this,"nodeType"),ln(this,"nodeName"),ln(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Qi))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const $i={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ea={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ta={};function ra(e){if(ta[e])return ta[e];const t=globalThis[e],r=t.prototype,n=e in $i?$i[e]:void 0,s=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),o=e in ea?ea[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(s&&i&&!globalThis.Zone)return ta[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const s=n.contentWindow;if(!s)return t.prototype;const o=s[e].prototype;return document.body.removeChild(n),o?ta[e]=o:r}catch{return r}}const na={};function sa(e,t,r){var n;const s=`${e}.${String(r)}`;if(na[s])return na[s].call(t);const o=ra(e),i=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return i?(na[s]=i,i.call(t)):t[r]}const oa={};function ia(e,t,r){const n=`${e}.${String(r)}`;if(oa[n])return oa[n].bind(t);const s=ra(e)[r];return"function"!=typeof s?t[r]:(oa[n]=s,s.bind(t))}const aa={childNodes:function(e){return sa("Node",e,"childNodes")},parentNode:function(e){return sa("Node",e,"parentNode")},parentElement:function(e){return sa("Node",e,"parentElement")},textContent:function(e){return sa("Node",e,"textContent")},contains:function(e,t){return ia("Node",e,"contains")(t)},getRootNode:function(e){return ia("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?sa("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?sa("Element",e,"shadowRoot"):null},querySelector:function(e,t){return sa("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return sa("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return ra("MutationObserver").constructor}};const la="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let ca={map:{},getId:()=>(console.error(la),-1),getNode:()=>(console.error(la),null),removeNodeFromMap(){console.error(la)},has:()=>(console.error(la),!1),reset(){console.error(la)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ca=new Proxy(ca,{get:(e,t,r)=>("map"===t&&console.error(la),Reflect.get(e,t,r))}));let ua=Date.now;function ha(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:aa.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(ua=()=>(new Date).getTime());function pa(e){var t;let r=null;return"getRootNode"in e&&(null==(t=aa.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&aa.host(aa.getRootNode(e))&&(r=aa.host(aa.getRootNode(e))),r}function da(e){let t,r=e;for(;t=pa(r);)r=t;return r}function fa(e){const t=e.ownerDocument;if(!t)return!1;const r=da(e);return aa.contains(t,r)}const ma=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){s(this,"id",1),s(this,"styleIDMap",new WeakMap),s(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return ca},closestElementOfNode:ha,getBaseDimension:function e(t,r){var n,s;const o=null==(s=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:s.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),a=e(o,r),l=i.height/o.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,r){const n=t[r[0]];return 1===r.length?n:e(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){const t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:da,getShadowHost:pa,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,n,s;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=aa.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=aa.parentElement(o.body))?void 0:n.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof Qi&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(aa.shadowRoot(e)))},hookSetter:function e(t,r,n,s,o=window){const i=o.Object.getOwnPropertyDescriptor(t,r);return o.Object.defineProperty(t,r,s?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>e(t,r,i||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(aa.contains(t,e)||fa(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&m.host(e)||null;return Boolean(t&&"shadowRoot"in t&&m.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const s=aa.parentNode(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,r))},isBlocked:function(e,t,r,n){if(!e)return!1;const s=ha(e);if(!s)return!1;try{if("string"==typeof t){if(s.classList.contains(t))return!0;if(n&&null!==s.closest("."+t))return!0}else if(y(s,t,n))return!0}catch(e){}if(r){if(s.matches(r))return!0;if(n&&null!==s.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(let n=t.children.length-1;n>=0;n--)e(t.children[n],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return ua},on:function(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)},patch:function(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],s=r(n);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}},polyfill: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)},queueToResolveTrees:function(e){const t={},r=(e,r)=>{const n={value:e,parent:r,children:[]};return t[e.node.id]=n,n},n=[];for(const s of e){const{nextId:e,parentId:o}=s;if(e&&e in t){const o=t[e];if(o.parent){const e=o.parent.children.indexOf(o);o.parent.children.splice(e,0,r(s,o.parent))}else{const e=n.indexOf(o);n.splice(e,0,r(s,null))}continue}if(o in t){const e=t[o];e.children.push(r(s,e));continue}n.push(r(s,null))}return n},shadowHostInDom:fa,throttle:function(e,t,r={}){let n=null,s=0;return function(...o){const i=Date.now();s||!1!==r.leading||(s=i);const a=t-(i-s),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),s=i,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout(()=>{s=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)},a))}},uniqueTextMutations:function(e){const t=new Set,r=[];for(let n=e.length;n--;){const s=e[n];t.has(s.id)||(r.push(s),t.add(s.id))}return r}},Symbol.toStringTag,{value:"Module"}));for(var ga="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ya="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ba=0;ba<64;ba++)ya[ga.charCodeAt(ba)]=ba;var va,wa,Ca;"undefined"!=typeof window&&window.Blob&&new Blob([(va="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Uint8Array.from(atob(va),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],e=>2*e)[0]){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null==(e=t.contentWindow)?void 0:e.Array.from)||Array.from,document.body.removeChild(t)}}catch(e){console.debug("Unable to override Array.from",e)}new g,(Ca=wa||(wa={}))[Ca.NotStarted=0]="NotStarted",Ca[Ca.Running=1]="Running",Ca[Ca.Stopped=2]="Stopped";class Sa{constructor(e){r(this,"fileName"),r(this,"functionName"),r(this,"lineNumber"),r(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const _a=/(^|@)\S+:\d+/,Ia=/^\s*at .*(\S+:\d+|\(native\))/m,Aa=/^(eval@)?(\[native code])?$/,Ea={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Ia)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Ia)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const r=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=r?t.replace(r[0],""):t;const n=t.split(/\s+/).slice(1),s=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(s[0])>-1?void 0:s[0];return new Sa({functionName:o,fileName:i,lineNumber:s[1],columnNumber:s[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(Aa)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Sa({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,s=this.extractLocation(e.replace(t,""));return new Sa({functionName:n,fileName:s[0],lineNumber:s[1],columnNumber:s[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[];for(let e=2,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new Sa({fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[];for(let e=0,s=r.length;e<s;e+=2){const s=t.exec(r[e]);s&&n.push(new Sa({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(_a)&&!e.match(/^Error created at/)},this).map(function(e){const t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Sa({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Ta(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,s=[];if(n.children&&n.children.length>0)for(let e=0;e<n.children.length;e++){const t=n.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===r&&s.push(t)}s.length>1&&(r+=`:eq(${s.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function ka(e){return"[object Object]"===Object.prototype.toString.call(e)}function Oa(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(ka(e[n])&&Oa(e[n],t-1))return!0;return!1}function Ra(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],s=[];return JSON.stringify(e,function(e,t){if(n.length>0){const r=n.indexOf(this);~r?n.splice(r+1):n.push(this),~r?s.splice(r,1/0,e):s.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+s.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(ka(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(ka(e)&&Oa(e,r.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=`${t.slice(0,r.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const r in t){const n=t[r];Array.isArray(n)?e[r]=Ta(n.length?n[0]:null):e[r]=n}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t})}const xa={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Na(e,t,r){const n=r?Object.assign({},xa,r):xa,s=n.logger;if(!s)return()=>{};let o;o="string"==typeof s?t[s]:s;let i=0,a=!1;const l=[];if(n.level.includes("error")){const r=t=>{const r=t.message,s=t.error,o=Ea.parse(s).map(e=>e.toString()),i=[Ra(r,n.stringifyOptions)];e({level:"error",trace:o,payload:i})};t.addEventListener("error",r),l.push(()=>{t.removeEventListener("error",r)});const s=t=>{let r,s;t.reason instanceof Error?(r=t.reason,s=[Ra(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,s=[Ra("Uncaught (in promise)",n.stringifyOptions),Ra(t.reason,n.stringifyOptions)]);const o=Ea.parse(r).map(e=>e.toString());e({level:"error",trace:o,payload:s})};t.addEventListener("unhandledrejection",s),l.push(()=>{t.removeEventListener("unhandledrejection",s)})}for(const e of n.level)l.push(c(o,e));return()=>{l.forEach(e=>e())};function c(t,r){return t[r]?ma.patch(t,r,t=>(...s)=>{if(t.apply(this,s),!("assert"===r&&s[0]||a)){a=!0;try{const t=Ea.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===r?s.slice(1):s).map(e=>Ra(e,n.stringifyOptions));i++,i<n.lengthThreshold?e({level:r,trace:t,payload:o}):i===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Ra("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}var Ma;function La(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function Da(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Pa(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t).map(Fa).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function Fa(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=Pa(e.styleSheet)||t}catch(e){}return t}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(Ma||(Ma={}));var Ba=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,r=this.getId(e);this.idNodeMap.delete(r),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Ua(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,s=e.value,o=e.maskInputFn,i=s||"";return(t[r.toLowerCase()]||t[n])&&(i=o?o(i):"*".repeat(i.length)),i}var Za="__rrweb_original__";var ja,za,Va=1,Ga=new RegExp("[^a-z0-9-_:]");function Wa(){return Va++}var Ha=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ya=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Ka=/^(data:)([^,]*),(.*)/i;function Ja(e,t){return(e||"").replace(Ha,function(e,r,n,s,o,i){var a,l=n||o||i,c=r||s||"";if(!l)return e;if(!Ya.test(l))return"url(".concat(c).concat(l).concat(c,")");if(Ka.test(l))return"url(".concat(c).concat(l).concat(c,")");if("/"===l[0])return"url(".concat(c).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)).concat(c,")");var u=t.split("/"),h=l.split("/");u.pop();for(var p=0,d=h;p<d.length;p++){var f=d[p];"."!==f&&(".."===f?u.pop():u.push(f))}return"url(".concat(c).concat(u.join("/")).concat(c,")")})}var Xa=/^[^ \t\n\r\u000c]+/,qa=/^[, \t\n\r\u000c]+/;function Qa(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function $a(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function el(){var e=document.createElement("a");return e.href="",e.href}function tl(e,t,r,n){return"src"===r||"href"===r&&n&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&n&&"#"!==n[0]?Qa(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,s=e.exec(t.substring(r));return s?(n=s[0],r+=n.length,n):""}for(var s=[];n(qa),!(r>=t.length);){var o=n(Xa);if(","===o.slice(-1))o=Qa(e,o.substring(0,o.length-1)),s.push(o);else{var i="";o=Qa(e,o);for(var a=!1;;){var l=t.charAt(r);if(""===l){s.push((o+i).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,s.push((o+i).trim());break}"("===l&&(a=!0)}i+=l,r+=1}}}return s.join(", ")}(e,n):"style"===r&&n?Ja(n,el()):"object"===t&&"data"===r&&n?Qa(e,n):n:Qa(e,n)}function rl(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&rl(e.parentNode,t,r);for(var n=e.classList.length;n--;){var s=e.classList[n];if(t.test(s))return!0}return!!r&&rl(e.parentNode,t,r)}function nl(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===n)return!1;if("string"==typeof t){if(n.classList.contains(t))return!0;if(n.closest(".".concat(t)))return!0}else if(rl(n,t,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}return!1}function sl(e,t){var r=t.doc,n=t.mirror,s=t.blockClass,o=t.blockSelector,i=t.maskTextClass,a=t.maskTextSelector,l=t.inlineStylesheet,c=t.maskInputOptions,u=void 0===c?{}:c,h=t.maskTextFn,p=t.maskInputFn,d=t.dataURLOptions,f=void 0===d?{}:d,m=t.inlineImages,g=t.recordCanvas,y=t.keepIframeSrcFn,b=t.newlyAddedElement,v=void 0!==b&&b,w=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Ma.Document,childNodes:[],compatMode:e.compatMode}:{type:Ma.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ma.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return function(e,t){for(var r=t.doc,n=t.blockClass,s=t.blockSelector,o=t.inlineStylesheet,i=t.maskInputOptions,a=void 0===i?{}:i,l=t.maskInputFn,c=t.dataURLOptions,u=void 0===c?{}:c,h=t.inlineImages,p=t.recordCanvas,d=t.keepIframeSrcFn,f=t.newlyAddedElement,m=void 0!==f&&f,g=t.rootId,y=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var s=e.classList[n];if(t.test(s))return!0}return!!r&&e.matches(r)}(e,n,s),b=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Ga.test(t)?"div":t}(e),v={},w=e.attributes.length,C=0;C<w;C++){var S=e.attributes[C];v[S.name]=tl(r,b,S.name,S.value)}if("link"===b&&o){var _=Array.from(r.styleSheets).find(function(t){return t.href===e.href}),I=null;_&&(I=Pa(_)),I&&(delete v.rel,delete v.href,v._cssText=Ja(I,_.href))}if("style"===b&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(I=Pa(e.sheet))&&(v._cssText=Ja(I,el()))}if("input"===b||"textarea"===b||"select"===b){var A=e.value,E=e.checked;"radio"!==v.type&&"checkbox"!==v.type&&"submit"!==v.type&&"button"!==v.type&&A?v.value=Ua({type:v.type,tagName:b,value:A,maskInputOptions:a,maskInputFn:l}):E&&(v.checked=E)}"option"===b&&(e.selected&&!a.select?v.selected=!0:delete v.selected);if("canvas"===b&&p)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var s=t.getImageData,o=Za in s?s[Za]:s;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some(function(e){return 0!==e}))return!1}return!0})(e)||(v.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var T=e.toDataURL(u.type,u.quality),k=document.createElement("canvas");k.width=e.width,k.height=e.height,T!==k.toDataURL(u.type,u.quality)&&(v.rr_dataURL=T)}if("img"===b&&h){ja||(ja=r.createElement("canvas"),za=ja.getContext("2d"));var O=e,R=O.crossOrigin;O.crossOrigin="anonymous";var x=function(){try{ja.width=O.naturalWidth,ja.height=O.naturalHeight,za.drawImage(O,0,0),v.rr_dataURL=ja.toDataURL(u.type,u.quality)}catch(e){console.warn("Cannot inline img src=".concat(O.currentSrc,"! Error: ").concat(e))}R?v.crossOrigin=R:O.removeAttribute("crossorigin")};O.complete&&0!==O.naturalWidth?x():O.onload=x}"audio"!==b&&"video"!==b||(v.rr_mediaState=e.paused?"paused":"played",v.rr_mediaCurrentTime=e.currentTime);m||(e.scrollLeft&&(v.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(v.rr_scrollTop=e.scrollTop));if(y){var N=e.getBoundingClientRect(),M=N.width,L=N.height;v={class:v.class,rr_width:"".concat(M,"px"),rr_height:"".concat(L,"px")}}"iframe"!==b||d(v.src)||(e.contentDocument||(v.rr_src=v.src),delete v.src);return{type:Ma.Element,tagName:b,attributes:v,childNodes:[],isSVG:$a(e)||void 0,needBlock:y,rootId:g}}(e,{doc:r,blockClass:s,blockSelector:o,inlineStylesheet:l,maskInputOptions:u,maskInputFn:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:y,newlyAddedElement:v,rootId:w});case e.TEXT_NODE:return function(e,t){var r,n=t.maskTextClass,s=t.maskTextSelector,o=t.maskTextFn,i=t.rootId,a=e.parentNode&&e.parentNode.tagName,l=e.textContent,c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;if(c&&l){try{e.nextSibling||e.previousSibling||(null===(r=e.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(l=(h=e.parentNode.sheet).cssRules?Array.from(h.cssRules).map(function(e){return e.cssText||""}).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}l=Ja(l,el())}var h;u&&(l="SCRIPT_PLACEHOLDER");!c&&!u&&l&&nl(e,n,s)&&(l=o?o(l):l.replace(/[\S]/g,"*"));return{type:Ma.Text,textContent:l||"",isStyle:c,rootId:i}}(e,{maskTextClass:i,maskTextSelector:a,maskTextFn:h,rootId:w});case e.CDATA_SECTION_NODE:return{type:Ma.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:Ma.Comment,textContent:e.textContent||"",rootId:w};default:return!1}}function ol(e){return void 0===e?"":e.toLowerCase()}function il(e,t){var r,n=t.doc,s=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,u=void 0!==c&&c,h=t.inlineStylesheet,p=void 0===h||h,d=t.maskInputOptions,f=void 0===d?{}:d,m=t.maskTextFn,g=t.maskInputFn,y=t.slimDOMOptions,b=t.dataURLOptions,v=void 0===b?{}:b,w=t.inlineImages,C=void 0!==w&&w,S=t.recordCanvas,_=void 0!==S&&S,I=t.onSerialize,A=t.onIframeLoad,E=t.iframeLoadTimeout,T=void 0===E?5e3:E,k=t.onStylesheetLoad,O=t.stylesheetLoadTimeout,R=void 0===O?5e3:O,x=t.keepIframeSrcFn,N=void 0===x?function(){return!1}:x,M=t.newlyAddedElement,L=void 0!==M&&M,D=t.preserveWhiteSpace,P=void 0===D||D,F=sl(e,{doc:n,mirror:s,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,inlineStylesheet:p,maskInputOptions:f,maskTextFn:m,maskInputFn:g,dataURLOptions:v,inlineImages:C,recordCanvas:_,keepIframeSrcFn:N,newlyAddedElement:L});if(!F)return console.warn(e,"not serialized"),null;r=s.hasNode(e)?s.getId(e):!function(e,t){if(t.comment&&e.type===Ma.Comment)return!0;if(e.type===Ma.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(ol(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ol(e.attributes.name)||"icon"===ol(e.attributes.rel)||"apple-touch-icon"===ol(e.attributes.rel)||"shortcut icon"===ol(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&ol(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ol(e.attributes.property).match(/^(og|twitter|fb):/)||ol(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===ol(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===ol(e.attributes.name)||"googlebot"===ol(e.attributes.name)||"bingbot"===ol(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===ol(e.attributes.name)||"generator"===ol(e.attributes.name)||"framework"===ol(e.attributes.name)||"publisher"===ol(e.attributes.name)||"progid"===ol(e.attributes.name)||ol(e.attributes.property).match(/^article:/)||ol(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===ol(e.attributes.name)||"yandex-verification"===ol(e.attributes.name)||"csrf-token"===ol(e.attributes.name)||"p:domain_verify"===ol(e.attributes.name)||"verify-v1"===ol(e.attributes.name)||"verification"===ol(e.attributes.name)||"shopify-checkout-api-token"===ol(e.attributes.name)))return!0}}return!1}(F,y)&&(P||F.type!==Ma.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?Wa():-2;var B=Object.assign(F,{id:r});if(s.add(e,B),-2===r)return null;I&&I(e);var U=!u;if(B.type===Ma.Element){U=U&&!B.needBlock,delete B.needBlock;var Z=e.shadowRoot;Z&&Da(Z)&&(B.isShadowHost=!0)}if((B.type===Ma.Document||B.type===Ma.Element)&&U){y.headWhitespace&&B.type===Ma.Element&&"head"===B.tagName&&(P=!1);for(var j={doc:n,mirror:s,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:u,inlineStylesheet:p,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:v,inlineImages:C,recordCanvas:_,preserveWhiteSpace:P,onSerialize:I,onIframeLoad:A,iframeLoadTimeout:T,onStylesheetLoad:k,stylesheetLoadTimeout:R,keepIframeSrcFn:N},z=0,V=Array.from(e.childNodes);z<V.length;z++){(H=il(V[z],j))&&B.childNodes.push(H)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var G=0,W=Array.from(e.shadowRoot.childNodes);G<W.length;G++){var H;(H=il(W[G],j))&&(Da(e.shadowRoot)&&(H.isShadow=!0),B.childNodes.push(H))}}return e.parentNode&&La(e.parentNode)&&Da(e.parentNode)&&(B.isShadow=!0),B.type===Ma.Element&&"iframe"===B.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var s,o=!1;try{s=n.document.readyState}catch(e){return}if("complete"===s){var i="about:blank";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()})}}}(e,function(){var t=e.contentDocument;if(t&&A){var r=il(t,{doc:t,mirror:s,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:v,inlineImages:C,recordCanvas:_,preserveWhiteSpace:P,onSerialize:I,onIframeLoad:A,iframeLoadTimeout:T,onStylesheetLoad:k,stylesheetLoadTimeout:R,keepIframeSrcFn:N});r&&A(e,r)}},T),B.type===Ma.Element&&"link"===B.tagName&&"stylesheet"===B.attributes.rel&&function(e,t,r){var n,s=!1;try{n=e.sheet}catch(e){return}if(!n){var o=setTimeout(function(){s||(t(),s=!0)},r);e.addEventListener("load",function(){clearTimeout(o),s=!0,t()})}}(e,function(){if(k){var t=il(e,{doc:n,mirror:s,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:v,inlineImages:C,recordCanvas:_,preserveWhiteSpace:P,onSerialize:I,onIframeLoad:A,iframeLoadTimeout:T,onStylesheetLoad:k,stylesheetLoadTimeout:R,keepIframeSrcFn:N});t&&k(e,t)}},R),B}function al(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const ll="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let cl={map:{},getId:()=>(console.error(ll),-1),getNode:()=>(console.error(ll),null),removeNodeFromMap(){console.error(ll)},has:()=>(console.error(ll),!1),reset(){console.error(ll)}};function ul(e,t,r={}){let n=null,s=0;return function(...o){const i=Date.now();s||!1!==r.leading||(s=i);const a=t-(i-s),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),s=i,e.apply(l,o)):n||!1===r.trailing||(n=setTimeout(()=>{s=!1===r.leading?0:Date.now(),n=null,e.apply(l,o)},a))}}function hl(e,t,r,n,s=window){const o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,n?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>hl(e,t,o||{},!0)}function pl(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],s=r(n);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch(e){return()=>{}}}function dl(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function fl(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ml(e,t,r,n){if(!e)return!1;const s=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!s)return!1;if("string"==typeof t){if(s.classList.contains(t))return!0;if(n&&null!==s.closest("."+t))return!0}else if(rl(s,t,n))return!0;if(r){if(e.matches(r))return!0;if(n&&null!==s.closest(r))return!0}return!1}function gl(e,t){return-2===t.getId(e)}function yl(e,t){if(La(e))return!1;const r=t.getId(e);return!t.has(r)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||yl(e.parentNode,t))}function bl(e){return Boolean(e.changedTouches)}function vl(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function wl(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Cl(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(cl=new Proxy(cl,{get:(e,t,r)=>("map"===t&&console.error(ll),Reflect.get(e,t,r))}));class Sl{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var _l=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(_l||{}),Il=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(Il||{}),Al=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Al||{}),El=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(El||{});function Tl(e){return"__ln"in e}class kl{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Tl(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Tl(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const Ol=(e,t)=>`${e}@${t}`;class Rl{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new kl,r=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},n=n=>{var s,o,i,a;let l=null;(null===(o=null===(s=n.getRootNode)||void 0===s?void 0:s.call(n))||void 0===o?void 0:o.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&n.getRootNode().host&&(l=n.getRootNode().host);let c=l;for(;(null===(a=null===(i=null==c?void 0:c.getRootNode)||void 0===i?void 0:i.call(c))||void 0===a?void 0:a.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&c.getRootNode().host;)c=c.getRootNode().host;const u=!(this.doc.contains(n)||c&&this.doc.contains(c));if(!n.parentNode||u)return;const h=La(n.parentNode)?this.mirror.getId(l):this.mirror.getId(n.parentNode),p=r(n);if(-1===h||-1===p)return t.addNode(n);const d=il(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{vl(e,this.mirror)&&this.iframeManager.addIframe(e),wl(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Cl(n)&&this.shadowDomManager.addShadowRoot(n.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});d&&e.push({parentId:h,nextId:p,node:d})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))Nl(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||n(e);for(const e of Array.from(this.addedSet.values()))Ll(this.droppedSet,e)||Nl(this.removes,e,this.mirror)?Ll(this.movedSet,e)?n(e):this.droppedSet.add(e):n(e);let s=null;for(;t.length;){let e=null;if(s){const t=this.mirror.getId(s.value.parentNode),n=r(s.value);-1!==t&&-1!==n&&(e=s)}if(!e)for(let n=t.length-1;n>=0;n--){const s=t.get(n);if(s){const t=this.mirror.getId(s.value.parentNode);if(-1===r(s.value))continue;if(-1!==t){e=s;break}{const t=s.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=s;break}}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}s=e.previous,t.removeNode(e.value),n(e.value)}const o={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>({id:this.mirror.getId(e.node),attributes:e.attributes})).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(o.texts.length||o.attributes.length||o.removes.length||o.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))},this.processMutation=e=>{if(!gl(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;ml(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:nl(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(r=Ua({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),ml(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let n=this.attributes.find(t=>t.node===e.target);if("IFRAME"===t.tagName&&"src"===e.attributeName&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;e.attributeName="rr_src"}if(n||(n={node:e.target,attributes:{}},this.attributes.push(n)),"style"===e.attributeName){const r=this.doc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue),void 0!==n.attributes.style&&null!==n.attributes.style||(n.attributes.style={});const s=n.attributes.style;for(const e of Array.from(t.style)){const n=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);n===r.style.getPropertyValue(e)&&o===r.style.getPropertyPriority(e)||(s[e]=""===o?n:[n,o])}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(s[e]=!1)}else n.attributes[e.attributeName]=tl(this.doc,t.tagName,e.attributeName,r);break}case"childList":if(ml(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),n=La(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);ml(e.target,this.blockClass,this.blockSelector,!1)||gl(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(xl(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||yl(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ol(r,n)]?xl(this.movedSet,t):this.removes.push({parentId:n,id:r,isShadow:!(!La(e.target)||!Da(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if(gl(e,this.mirror))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Ol(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ml(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach(e=>this.genAdds(e))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function xl(e,t){e.delete(t),t.childNodes.forEach(t=>xl(e,t))}function Nl(e,t,r){return 0!==e.length&&Ml(e,t,r)}function Ml(e,t,r){const{parentNode:n}=t;if(!n)return!1;const s=r.getId(n);return!!e.some(e=>e.id===s)||Ml(e,n,r)}function Ll(e,t){return 0!==e.size&&Dl(e,t)}function Dl(e,t){const{parentNode:r}=t;return!!r&&(!!e.has(r)||Dl(e,r))}const Pl=[],Fl="undefined"!=typeof CSSGroupingRule,Bl="undefined"!=typeof CSSMediaRule,Ul="undefined"!=typeof CSSSupportsRule,Zl="undefined"!=typeof CSSConditionRule;function jl(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function zl(e,t){var r,n;const s=new Rl;Pl.push(s),s.init(e);let o=window.MutationObserver||window.__rrMutationObserver;const i=null===(n=null===(r=null===window||void 0===window?void 0:window.Zone)||void 0===r?void 0:r.__symbol__)||void 0===n?void 0:n.call(r,"MutationObserver");i&&window[i]&&(o=window[i]);const a=new o(s.processMutations.bind(s));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Vl({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const i=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];return Object.keys(Al).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{const i=o.toLowerCase(),l=(t=>o=>{const i=jl(o);if(ml(i,n,s,!0))return;const a=bl(o)?o.changedTouches[0]:o;if(!a)return;const l=r.getId(i),{clientX:c,clientY:u}=a;e({type:Al[t],id:l,x:c,y:u})})(o);a.push(al(i,l,t))}),()=>{a.forEach(e=>e())}}function Gl({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,sampling:o}){return al("scroll",ul(o=>{const i=jl(o);if(!i||ml(i,n,s,!0))return;const a=r.getId(i);if(i===t){const r=t.scrollingElement||t.documentElement;e({id:a,x:r.scrollLeft,y:r.scrollTop})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})},o.scroll||100),t)}function Wl(e,t){const r=Object.assign({},e);return t||delete r.userTriggered,r}const Hl=["INPUT","TEXTAREA","SELECT"],Yl=new WeakMap;function Kl(e){return function(e,t){if(Fl&&e.parentRule instanceof CSSGroupingRule||Bl&&e.parentRule instanceof CSSMediaRule||Ul&&e.parentRule instanceof CSSSupportsRule||Zl&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function Jl(e,t,r){let n,s;return e?(e.ownerNode?n=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:n}):{}}function Xl({mirror:e,stylesheetManager:t},r){var n,s,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(r.host);const a="#document"===r.nodeName?null===(n=r.defaultView)||void 0===n?void 0:n.Document:null===(o=null===(s=r.ownerDocument)||void 0===s?void 0:s.defaultView)||void 0===o?void 0:o.ShadowRoot,l=Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets");return null!==i&&-1!==i&&a&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null===(e=l.get)||void 0===e?void 0:e.call(this)},set(e){var r;const n=null===(r=l.set)||void 0===r?void 0:r.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(e){}return n}}),()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}):()=>{}}function ql(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:h,fontCb:p,selectionCb:d}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),n(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),s(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),h(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),d(...e)}}(e,t);const n=zl(e,e.doc),s=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const s="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=ul(t=>{const r=Date.now()-i;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],i=null},o),c=ul(e=>{const t=jl(e),{clientX:r,clientY:s}=bl(e)?e.changedTouches[0]:e;i||(i=Date.now()),a.push({x:r,y:s,id:n.getId(t),timeOffset:Date.now()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Il.Drag:e instanceof MouseEvent?Il.MouseMove:Il.TouchMove)},s,{trailing:!1}),u=[al("mousemove",c,r),al("touchmove",c,r),al("drag",c,r)];return()=>{u.forEach(e=>e())}}(e),o=Vl(e),i=Gl(e),a=function({viewportResizeCb:e}){let t=-1,r=-1;return al("resize",ul(()=>{const n=dl(),s=fl();t===n&&r===s||(e({width:Number(s),height:Number(n)}),t=n,r=s)},200),window)}(e),l=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:s,ignoreClass:o,maskInputOptions:i,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function u(e){let r=jl(e);const l=e.isTrusted;if(r&&"OPTION"===r.tagName&&(r=r.parentElement),!r||!r.tagName||Hl.indexOf(r.tagName)<0||ml(r,n,s,!0))return;const u=r.type;if(r.classList.contains(o))return;let p=r.value,d=!1;"radio"===u||"checkbox"===u?d=r.checked:(i[r.tagName.toLowerCase()]||i[u])&&(p=Ua({maskInputOptions:i,tagName:r.tagName,type:u,value:p,maskInputFn:a})),h(r,Wl({text:p,isChecked:d,userTriggered:l},c));const f=r.name;"radio"===u&&f&&d&&t.querySelectorAll(`input[type="radio"][name="${f}"]`).forEach(e=>{e!==r&&h(e,Wl({text:e.value,isChecked:!d,userTriggered:!1},c))})}function h(t,n){const s=Yl.get(t);if(!s||s.text!==n.text||s.isChecked!==n.isChecked){Yl.set(t,n);const s=r.getId(t);e(Object.assign(Object.assign({},n),{id:s}))}}const p=("last"===l.input?["change"]:["input","change"]).map(e=>al(e,u,t)),d=t.defaultView;if(!d)return()=>{p.forEach(e=>e())};const f=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),m=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&p.push(...m.map(e=>hl(e[0],e[1],{set(){u({target:this})}},!1,d))),()=>{p.forEach(e=>e())}}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:s}){const o=o=>ul(s=>{const i=jl(s);if(!i||ml(i,t,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u}=i;e({type:o,id:n.getId(i),currentTime:a,volume:l,muted:c,playbackRate:u})},s.media||500),i=[al("play",o(0)),al("pause",o(1)),al("seeked",o(2)),al("volumechange",o(3)),al("ratechange",o(4))];return()=>{i.forEach(e=>e())}}(e),u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){const s=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(n,o){const{id:i,styleId:a}=Jl(this,t,r.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:n,index:o}]}),s.apply(this,[n,o])};const o=n.CSSStyleSheet.prototype.deleteRule;let i,a;n.CSSStyleSheet.prototype.deleteRule=function(n){const{id:s,styleId:i}=Jl(this,t,r.styleMirror);return(s&&-1!==s||i&&-1!==i)&&e({id:s,styleId:i,removes:[{index:n}]}),o.apply(this,[n])},n.CSSStyleSheet.prototype.replace&&(i=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=function(n){const{id:s,styleId:o}=Jl(this,t,r.styleMirror);return(s&&-1!==s||o&&-1!==o)&&e({id:s,styleId:o,replace:n}),i.apply(this,[n])}),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=function(n){const{id:s,styleId:o}=Jl(this,t,r.styleMirror);return(s&&-1!==s||o&&-1!==o)&&e({id:s,styleId:o,replaceSync:n}),a.apply(this,[n])});const l={};Fl?l.CSSGroupingRule=n.CSSGroupingRule:(Bl&&(l.CSSMediaRule=n.CSSMediaRule),Zl&&(l.CSSConditionRule=n.CSSConditionRule),Ul&&(l.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(l).forEach(([n,s])=>{c[n]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=function(s,o){const{id:i,styleId:a}=Jl(this.parentStyleSheet,t,r.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:s,index:[...Kl(this),o||0]}]}),c[n].insertRule.apply(this,[s,o])},s.prototype.deleteRule=function(s){const{id:o,styleId:i}=Jl(this.parentStyleSheet,t,r.styleMirror);return(o&&-1!==o||i&&-1!==i)&&e({id:o,styleId:i,removes:[{index:[...Kl(this),s]}]}),c[n].deleteRule.apply(this,[s])}}),()=>{n.CSSStyleSheet.prototype.insertRule=s,n.CSSStyleSheet.prototype.deleteRule=o,i&&(n.CSSStyleSheet.prototype.replace=i),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})}}(e,{win:r}),h=Xl(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:s}){const o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=function(s,i,a){var l;if(r.has(s))return o.apply(this,[s,i,a]);const{id:c,styleId:u}=Jl(null===(l=this.parentRule)||void 0===l?void 0:l.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||u&&-1!==u)&&e({id:c,styleId:u,set:{property:s,value:i,priority:a},index:Kl(this.parentRule)}),o.apply(this,[s,i,a])};const i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=function(s){var o;if(r.has(s))return i.apply(this,[s]);const{id:a,styleId:l}=Jl(null===(o=this.parentRule)||void 0===o?void 0:o.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,remove:{property:s},index:Kl(this.parentRule)}),i.apply(this,[s])},()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=i}}(e,{win:r}),d=e.collectFonts?function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,r){const n=new o(e,t,r);return s.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const i=pl(t.fonts,"add",function(t){return function(r){return setTimeout(()=>{const t=s.get(r);t&&(e(t),s.delete(r))},0),t.apply(this,[r])}});return n.push(()=>{r.FontFace=o}),n.push(i),()=>{n.forEach(e=>e())}}(e):()=>{},f=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:s,selectionCb:o}=e;let i=!0;const a=()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:i,startOffset:l,endContainer:c,endOffset:u}=o;ml(i,n,s,!0)||ml(c,n,s,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:u})}o({ranges:a})};return a(),al("selectionchange",a)}(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,r,t.options));return()=>{Pl.forEach(e=>e.reset()),n.disconnect(),s(),o(),i(),a(),l(),c(),u(),h(),p(),d(),f(),m.forEach(e=>e())}}class Ql{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,r,n){const s=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e);let i=s.get(t);return i||(i=this.generateIdFn(),s.set(t,i),o.set(i,t)),i}getIds(e,t){const r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,r,n))}getRemoteId(e,t,r){const n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const s=n.get(t);return s||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,r))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class $l{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ql(Wa),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ql(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(r=this.loadListener)||void 0===r||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){if("rrweb"===e.data.type){if(!e.source)return;const t=this.crossOriginIframeMap.get(e.source);if(!t)return;const r=this.transformCrossOriginEvent(t,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}transformCrossOriginEvent(e,t){var r;switch(t.type){case _l.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:_l.IncrementalSnapshot,data:{source:Il.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case _l.Meta:case _l.Load:case _l.DomContentLoaded:return!1;case _l.Plugin:return t;case _l.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case _l.IncrementalSnapshot:switch(t.data.source){case Il.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Il.Drag:case Il.TouchMove:case Il.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Il.ViewportResize:return!1;case Il.MediaInteraction:case Il.MouseInteraction:case Il.Scroll:case Il.CanvasMutation:case Il.Input:return this.replaceIds(t.data,e,["id"]),t;case Il.StyleSheetRule:case Il.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Il.Font:return t;case Il.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Il.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(r=t.data.styles)||void 0===r||r.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}}replace(e,t,r,n){for(const s of n)(Array.isArray(t[s])||"number"==typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(r,t[s]):t[s]=e.getId(r,t[s]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}}class ec{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(pl(Element.prototype,"attachShadow",function(e){return function(r){const n=e.call(this,r);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}}))}addShadowRoot(e,t){Da(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),zl(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Gl(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),Xl({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)},0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(pl(e.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(n){const s=r.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),s}}))}}reset(){this.restorePatches.forEach(e=>e()),this.shadowDoms=new WeakSet}}
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Monoscope=t()}(this,function(){"use strict";var e,t=Object.defineProperty,r=(e,r,n)=>((e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n)(e,"symbol"!=typeof r?r+"":r,n),n=Object.defineProperty,o=(e,t,r)=>((e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),s=Object.defineProperty,i=(e,t,r)=>((e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const a={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},l={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},c={};function u(e){if(c[e])return c[e];const t=globalThis[e],r=t.prototype,n=e in a?a[e]:void 0,o=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),s=e in l?l[e]:void 0,i=Boolean(s&&s.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(o&&i&&!globalThis.Zone)return c[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const o=n.contentWindow;if(!o)return t.prototype;const s=o[e].prototype;return document.body.removeChild(n),s?c[e]=s:r}catch{return r}}const h={};function p(e,t,r){var n;const o=`${e}.${String(r)}`;if(h[o])return h[o].call(t);const s=u(e),i=null==(n=Object.getOwnPropertyDescriptor(s,r))?void 0:n.get;return i?(h[o]=i,i.call(t)):t[r]}const d={};function f(e,t,r){const n=`${e}.${String(r)}`;if(d[n])return d[n].bind(t);const o=u(e)[r];return"function"!=typeof o?t[r]:(d[n]=o,o.bind(t))}const m={childNodes:function(e){return p("Node",e,"childNodes")},parentNode:function(e){return p("Node",e,"parentNode")},parentElement:function(e){return p("Node",e,"parentElement")},textContent:function(e){return p("Node",e,"textContent")},contains:function(e,t){return f("Node",e,"contains")(t)},getRootNode:function(e){return f("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?p("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?p("Element",e,"shadowRoot"):null},querySelector:function(e,t){return p("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return p("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return u("MutationObserver").constructor}};let g=class{constructor(){i(this,"idNodeMap",new Map),i(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function y(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&y(m.parentNode(e),t,r);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!r&&y(m.parentNode(e),t,r)}function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function v(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var w={exports:{}},C=String,S=function(){return{isColorSupported:!1,reset:C,bold:C,dim:C,italic:C,underline:C,inverse:C,hidden:C,strikethrough:C,black:C,red:C,green:C,yellow:C,blue:C,magenta:C,cyan:C,white:C,gray:C,bgBlack:C,bgRed:C,bgGreen:C,bgYellow:C,bgBlue:C,bgMagenta:C,bgCyan:C,bgWhite:C}};w.exports=S(),w.exports.createColors=S;var _=w.exports;const I=v(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let A=_,E=I,T=class e extends Error{constructor(t,r,n,o,s,i){super(t),this.name="CssSyntaxError",this.reason=t,s&&(this.file=s),o&&(this.source=o),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=A.isColorSupported),E&&e&&(t=E(t));let r,n,o=t.split(/\r?\n/),s=Math.max(this.line-3,0),i=Math.min(this.line+2,o.length),a=String(i).length;if(e){let{bold:e,gray:t,red:o}=A.createColors(!0);r=t=>e(o(t)),n=e=>t(e)}else r=n=e=>e;return o.slice(s,i).map((e,t)=>{let o=s+1+t,i=" "+(" "+o).slice(-a)+" | ";if(o===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var k=T;T.default=T;var O={};O.isClean=Symbol("isClean"),O.my=Symbol("my");const R={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let x=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let o=(e.raws.between||"")+(t?";":"");this.builder(r+n+o,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,o=0;for(;n&&"root"!==n.type;)o+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<o;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let o=e.nodes[n],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let o=e.parent;if("before"===r){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return R[r];let s=e.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[r])return s.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let o="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[o]?n=this[o](s,e):s.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var i;return void 0===n&&(n=R[r]),s.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var N=x;x.default=x;let M=N;function L(e,t){new M(t).stringify(e)}var D=L;L.default=L;let{isClean:P,my:F}=O,B=k,U=N,Z=D;function j(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let o=e[n],s=typeof o;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=o:Array.isArray(o)?r[n]=o.map(e=>j(e,r)):("object"===s&&null!==o&&(o=j(o)),r[n]=o)}return r}let z=class{constructor(e={}){this.raws={},this[P]=!1,this[F]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=j(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new B(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[P]){this[P]=!1;let e=this;for(;e=e.parent;)e[P]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,o=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,o+=1):n+=1;return{column:n,line:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),o=n.indexOf(e.word);-1!==o&&(t=this.positionInside(o,n),r=this.positionInside(o+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new U).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let o=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let s=t.get(n.input);null==s&&(s=o,t.set(n.input,o),o++),r[e]={end:n.end,inputId:s,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Z){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var V=z;z.default=z;let G=V,W=class extends G{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var H=W;W.default=W;var Y={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:K,SourceMapGenerator:J}=I,{existsSync:X,readFileSync:q}=I,{dirname:Q,join:$}=I;let ee=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Q(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new K(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=Q(e),X(e))return this.mapFile=e,q(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof K)return J.fromSourceMap(t).toString();if(t instanceof J)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=$(Q(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var te=ee;ee.default=ee;let{SourceMapConsumer:re,SourceMapGenerator:ne}=I,{fileURLToPath:oe,pathToFileURL:se}=I,{isAbsolute:ie,resolve:ae}=I,{nanoid:le}=Y,ce=I,ue=k,he=te,pe=Symbol("fromOffsetCache"),de=Boolean(re&&ne),fe=Boolean(ae&&ie),me=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!fe||/^\w+:\/\//.test(t.from)||ie(t.from)?this.file=t.from:this.file=ae(t.from)),fe&&de){let e=new he(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+le(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let o,s,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);s=e.line,i=e.col}else s=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,s,i);return o=a?new ue(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new ue(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:i,line:s},this.css,this.file,n.plugin),o.input={column:r,endColumn:i,endLine:s,line:t,source:this.css},this.file&&(se&&(o.input.url=se(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[pe])r=this[pe];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,o=e.length;n<o;n++)r[n]=t,t+=e[n].length+1;this[pe]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,o=r.length-2;for(;n<o;)if(t=n+(o-n>>1),e<r[t])o=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ae(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let o,s,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(o=i.originalPositionFor({column:n,line:r})),s=ie(a.source)?se(a.source):new URL(a.source,this.map.consumer().sourceRoot||se(this.map.mapFile));let l={column:a.column,endColumn:o&&o.column,endLine:o&&o.line,line:a.line,url:s.toString()};if("file:"===s.protocol){if(!oe)throw new Error("file: protocol is not available in this PostCSS build");l.file=oe(s)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var ge=me;me.default=me,ce&&ce.registerInput&&ce.registerInput(me);let{SourceMapConsumer:ye,SourceMapGenerator:be}=I,{dirname:ve,relative:we,resolve:Ce,sep:Se}=I,{pathToFileURL:_e}=I,Ie=ge,Ae=Boolean(ye&&be),Ee=Boolean(ve&&Ce&&we&&Se);var Te=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||ve(e.file);!1===this.mapOpts.sourcesContent?(t=new ye(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Ee&&Ae&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=be.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new be({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new be({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(s.generated.line=r,s.generated.column=n-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),n=i.length-t):n+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=r,s.generated.column=n-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=r,s.generated.column=n-1,this.map.addMapping(s)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?ve(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=ve(Ce(r,this.mapOpts.annotation)));let n=we(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Ie(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(_e){let t=_e(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Se&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let ke=V,Oe=class extends ke{constructor(e){super(e),this.type="comment"}};var Re=Oe;Oe.default=Oe;let xe,Ne,Me,Le,{isClean:De,my:Pe}=O,Fe=H,Be=Re,Ue=V;function Ze(e){return e.map(e=>(e.nodes&&(e.nodes=Ze(e.nodes)),delete e.source,e))}function je(e){if(e[De]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)je(t)}let ze=class e extends Ue{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),o=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),o=0===n&&"prepend",s=this.normalize(t,this.proxyOf.nodes[n],o).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Ze(xe(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Fe(t)]}else if(t.selector)t=[new Ne(t)];else if(t.name)t=[new Me(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Be(t)]}return t.map(t=>(t[Pe]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[De]&&je(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};ze.registerParse=e=>{xe=e},ze.registerRule=e=>{Ne=e},ze.registerAtRule=e=>{Me=e},ze.registerRoot=e=>{Le=e};var Ve=ze;ze.default=ze,ze.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Me.prototype):"rule"===e.type?Object.setPrototypeOf(e,Ne.prototype):"decl"===e.type?Object.setPrototypeOf(e,Fe.prototype):"comment"===e.type?Object.setPrototypeOf(e,Be.prototype):"root"===e.type&&Object.setPrototypeOf(e,Le.prototype),e[Pe]=!0,e.nodes&&e.nodes.forEach(e=>{ze.rebuild(e)})};let Ge,We,He=Ve,Ye=class extends He{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ge(new We,this,e).stringify()}};Ye.registerLazyResult=e=>{Ge=e},Ye.registerProcessor=e=>{We=e};var Ke=Ye;Ye.default=Ye;let Je={};var Xe=function(e){Je[e]||(Je[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let qe=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Qe=qe;qe.default=qe;let $e=Qe,et=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new $e(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var tt=et;et.default=et;const rt="'".charCodeAt(0),nt='"'.charCodeAt(0),ot="\\".charCodeAt(0),st="/".charCodeAt(0),it="\n".charCodeAt(0),at=" ".charCodeAt(0),lt="\f".charCodeAt(0),ct="\t".charCodeAt(0),ut="\r".charCodeAt(0),ht="[".charCodeAt(0),pt="]".charCodeAt(0),dt="(".charCodeAt(0),ft=")".charCodeAt(0),mt="{".charCodeAt(0),gt="}".charCodeAt(0),yt=";".charCodeAt(0),bt="*".charCodeAt(0),vt=":".charCodeAt(0),wt="@".charCodeAt(0),Ct=/[\t\n\f\r "#'()/;[\\\]{}]/g,St=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,_t=/.[\r\n"'(/\\]/,It=/[\da-f]/i;let At=Ve,Et=class extends At{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var Tt=Et;Et.default=Et,At.registerAtRule(Et);let kt,Ot,Rt=Ve,xt=class extends Rt{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new kt(new Ot,this,e).stringify()}};xt.registerLazyResult=e=>{kt=e},xt.registerProcessor=e=>{Ot=e};var Nt=xt;xt.default=xt,Rt.registerRoot(xt);let Mt={comma:e=>Mt.split(e,[","],!0),space:e=>Mt.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],o="",s=!1,i=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?i+=1:")"===r?i>0&&(i-=1):0===i&&t.includes(r)&&(s=!0),s?(""!==o&&n.push(o.trim()),o="",s=!1):o+=r;return(r||""!==o)&&n.push(o.trim()),n}};var Lt=Mt;Mt.default=Mt;let Dt=Ve,Pt=Lt,Ft=class extends Dt{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Pt.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Bt=Ft;Ft.default=Ft,Dt.registerRule(Ft);let Ut=H,Zt=function(e,t={}){let r,n,o,s,i,a,l,c,u,h,p=e.css.valueOf(),d=t.ignoreErrors,f=p.length,m=0,g=[],y=[];function b(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=p.charCodeAt(m),r){case it:case at:case ct:case ut:case lt:n=m;do{n+=1,r=p.charCodeAt(n)}while(r===at||r===it||r===ct||r===ut||r===lt);h=["space",p.slice(m,n)],m=n-1;break;case ht:case pt:case mt:case gt:case vt:case yt:case ft:{let e=String.fromCharCode(r);h=[e,e,m];break}case dt:if(c=g.length?g.pop()[1]:"",u=p.charCodeAt(m+1),"url"===c&&u!==rt&&u!==nt&&u!==at&&u!==it&&u!==ct&&u!==lt&&u!==ut){n=m;do{if(a=!1,n=p.indexOf(")",n+1),-1===n){if(d||t){n=m;break}b("bracket")}for(l=n;p.charCodeAt(l-1)===ot;)l-=1,a=!a}while(a);h=["brackets",p.slice(m,n+1),m,n],m=n}else n=p.indexOf(")",m+1),s=p.slice(m,n+1),-1===n||_t.test(s)?h=["(","(",m]:(h=["brackets",s,m,n],m=n);break;case rt:case nt:o=r===rt?"'":'"',n=m;do{if(a=!1,n=p.indexOf(o,n+1),-1===n){if(d||t){n=m+1;break}b("string")}for(l=n;p.charCodeAt(l-1)===ot;)l-=1,a=!a}while(a);h=["string",p.slice(m,n+1),m,n],m=n;break;case wt:Ct.lastIndex=m+1,Ct.test(p),n=0===Ct.lastIndex?p.length-1:Ct.lastIndex-2,h=["at-word",p.slice(m,n+1),m,n],m=n;break;case ot:for(n=m,i=!0;p.charCodeAt(n+1)===ot;)n+=1,i=!i;if(r=p.charCodeAt(n+1),i&&r!==st&&r!==at&&r!==it&&r!==ct&&r!==ut&&r!==lt&&(n+=1,It.test(p.charAt(n)))){for(;It.test(p.charAt(n+1));)n+=1;p.charCodeAt(n+1)===at&&(n+=1)}h=["word",p.slice(m,n+1),m,n],m=n;break;default:r===st&&p.charCodeAt(m+1)===bt?(n=p.indexOf("*/",m+2)+1,0===n&&(d||t?n=p.length:b("comment")),h=["comment",p.slice(m,n+1),m,n],m=n):(St.lastIndex=m+1,St.test(p),n=0===St.lastIndex?p.length-1:St.lastIndex-2,h=["word",p.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},jt=Re,zt=Tt,Vt=Nt,Gt=Bt;const Wt={empty:!0,space:!0};let Ht=Ve,Yt=class{constructor(e){this.input=e,this.root=new Vt,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,o=new zt;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(o.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(o,"params",a),s&&(e=a[a.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),i&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let o=t-1;o>=0&&(r=e[o],"space"===r[0]||(n+=1,2!==n));o--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,o=0;for(let[s,i]of e.entries()){if(t=i,r=t[0],"("===r&&(o+=1),")"===r&&(o-=1),0===o&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return s}this.doubleColon(t)}n=t}return!1}comment(e){let t=new jt;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Zt(this.input)}decl(e,t){let r=new Ut;this.init(r,e[0][2]);let n,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let s,i=[];for(;e.length&&(s=e[0][0],"space"===s||"comment"===s);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),o="";for(let e=t;e>0;e--){let t=n[e][0];if(0===o.trim().indexOf("!")&&"space"!==t)break;o=n.pop()[1]+o}0===o.trim().indexOf("!")&&(r.important=!0,r.raws.important=o,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Gt;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,o=null,s=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)o||(o=l),s.push("("===r?")":"]");else if(i&&n&&"{"===r)o||(o=l),s.push("}");else if(0===s.length){if(";"===r){if(n)return void this.decl(a,i);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===s[s.length-1]&&(s.pop(),0===s.length&&(o=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),s.length>0&&this.unclosedBracket(o),t&&n){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let o,s,i,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)o=r[e],s=o[0],"space"!==s||e!==l-1||n?"comment"===s?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",Wt[a]||Wt[i]||","===c.slice(-1)?u=!1:c+=o[1]):c+=o[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new Gt;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Kt=ge;function Jt(e,t){let r=new Kt(e,t),n=new Yt(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var Xt=Jt;Jt.default=Jt,Ht.registerParse(Jt);let{isClean:qt,my:Qt}=O,$t=Te,er=D,tr=Ve,rr=Ke,nr=Xe,or=tt,sr=Xt,ir=Nt;const ar={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},lr={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},cr={Once:!0,postcssPlugin:!0,prepare:!0};function ur(e){return"object"==typeof e&&"function"==typeof e.then}function hr(e){let t=!1,r=ar[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function pr(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:hr(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function dr(e){return e[qt]=!1,e.nodes&&e.nodes.forEach(e=>dr(e)),e}let fr={},mr=class e{constructor(t,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof or)o=dr(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=sr;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[Qt]&&tr.rebuild(o)}else o=dr(r);this.result=new or(t,o,n),this.helpers={...fr,postcss:fr,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,o=t.split("."),s=n.split(".");(o[0]!==s[0]||parseInt(o[1])>parseInt(s[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!lr[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!cr[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(ur(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qt];){e[qt]=!0;let t=[pr(e)];for(;t.length>0;){let e=this.visitTick(t);if(ur(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return ur(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=er;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new $t(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(ur(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qt];)e[qt]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||nr("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(ur(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,o]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return o(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,o=t.iterator;for(;n=r.nodes[r.indexes[o]];)if(r.indexes[o]+=1,!n[qt])return n[qt]=!0,void e.push(pr(n));t.iterator=0,delete r.indexes[o]}let o=t.events;for(;t.eventIndex<o.length;){let e=o[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[qt]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[qt]=!0;let t=hr(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[qt]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};mr.registerPostcss=e=>{fr=e};var gr=mr;mr.default=mr,ir.registerLazyResult(mr),rr.registerLazyResult(mr);let yr=Te,br=D,vr=Xe,wr=Xt;const Cr=tt;let Sr=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let o=br;this.result=new Cr(this._processor,n,this._opts),this.result.css=t;let s=this;Object.defineProperty(this.result,"root",{get:()=>s.root});let i=new yr(o,n,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||vr("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=wr;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var _r=Sr;Sr.default=Sr;let Ir=_r,Ar=gr,Er=Ke,Tr=Nt,kr=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Ar(this,e,t):new Ir(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Or=kr;kr.default=kr,Tr.registerProcessor(kr),Er.registerProcessor(kr);let Rr=H,xr=te,Nr=Re,Mr=Tt,Lr=ge,Dr=Nt,Pr=Bt;function Fr(e,t){if(Array.isArray(e))return e.map(e=>Fr(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Lr.prototype};r.map&&(r.map={...r.map,__proto__:xr.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Fr(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Dr(n);if("decl"===n.type)return new Rr(n);if("rule"===n.type)return new Pr(n);if("comment"===n.type)return new Nr(n);if("atrule"===n.type)return new Mr(n);throw new Error("Unknown node type: "+e.type)}var Br=Fr;Fr.default=Fr;let Ur=k,Zr=H,jr=gr,zr=Ve,Vr=Or,Gr=D,Wr=Br,Hr=Ke,Yr=Qe,Kr=Re,Jr=Tt,Xr=tt,qr=ge,Qr=Xt,$r=Lt,en=Bt,tn=Nt,rn=V;function nn(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Vr(e)}nn.plugin=function(e,t){let r,n=!1;function o(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new Vr).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return nn([o(r)]).process(e,t)},o},nn.stringify=Gr,nn.parse=Qr,nn.fromJSON=Wr,nn.list=$r,nn.comment=e=>new Kr(e),nn.atRule=e=>new Jr(e),nn.decl=e=>new Zr(e),nn.rule=e=>new en(e),nn.root=e=>new tn(e),nn.document=e=>new Hr(e),nn.CssSyntaxError=Ur,nn.Declaration=Zr,nn.Container=zr,nn.Processor=Vr,nn.Document=Hr,nn.Comment=Kr,nn.Warning=Yr,nn.AtRule=Jr,nn.Result=Xr,nn.Input=qr,nn.Rule=en,nn.Root=tn,nn.Node=rn,jr.registerPostcss(nn);var on=nn;nn.default=nn;const sn=b(on);sn.stringify,sn.fromJSON,sn.plugin,sn.parse,sn.list,sn.document,sn.comment,sn.atRule,sn.rule,sn.decl,sn.root,sn.CssSyntaxError,sn.Declaration,sn.Container,sn.Processor,sn.Document,sn.Comment,sn.Warning,sn.AtRule,sn.Result,sn.Input,sn.Rule,sn.Root,sn.Node;var an=Object.defineProperty,ln=(e,t,r)=>((e,t,r)=>t in e?an(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function cn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function un(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var hn={exports:{}},pn=String,dn=function(){return{isColorSupported:!1,reset:pn,bold:pn,dim:pn,italic:pn,underline:pn,inverse:pn,hidden:pn,strikethrough:pn,black:pn,red:pn,green:pn,yellow:pn,blue:pn,magenta:pn,cyan:pn,white:pn,gray:pn,bgBlack:pn,bgRed:pn,bgGreen:pn,bgYellow:pn,bgBlue:pn,bgMagenta:pn,bgCyan:pn,bgWhite:pn}};hn.exports=dn(),hn.exports.createColors=dn;var fn=hn.exports;const mn=un(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let gn=fn,yn=mn,bn=class e extends Error{constructor(t,r,n,o,s,i){super(t),this.name="CssSyntaxError",this.reason=t,s&&(this.file=s),o&&(this.source=o),i&&(this.plugin=i),void 0!==r&&void 0!==n&&("number"==typeof r?(this.line=r,this.column=n):(this.line=r.line,this.column=r.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=gn.isColorSupported),yn&&e&&(t=yn(t));let r,n,o=t.split(/\r?\n/),s=Math.max(this.line-3,0),i=Math.min(this.line+2,o.length),a=String(i).length;if(e){let{bold:e,gray:t,red:o}=gn.createColors(!0);r=t=>e(o(t)),n=e=>t(e)}else r=n=e=>e;return o.slice(s,i).map((e,t)=>{let o=s+1+t,i=" "+(" "+o).slice(-a)+" | ";if(o===this.line){let t=n(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(i)+e+"\n "+t+r("^")}return" "+n(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var vn=bn;bn.default=bn;var wn={};wn.isClean=Symbol("isClean"),wn.my=Symbol("my");const Cn={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Sn=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:n&&(r+=" "),e.nodes)this.block(e,r+n);else{let o=(e.raws.between||"")+(t?";":"");this.builder(r+n+o,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let n=e.parent,o=0;for(;n&&"root"!==n.type;)o+=1,n=n.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<o;e++)r+=t}return r}block(e,t){let r,n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let n=0;n<e.nodes.length;n++){let o=e.nodes[n],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,t!==n||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),n=e.prop+r+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}document(e){this.body(e)}raw(e,t,r){let n;if(r||(r=t),t&&(n=e.raws[t],void 0!==n))return n;let o=e.parent;if("before"===r){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return Cn[r];let s=e.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[r])return s.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let o="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[o]?n=this[o](s,e):s.walk(e=>{if(n=e.raws[t],void 0!==n)return!1})}var i;return void 0===n&&(n=Cn[r]),s.rawCache[r]=n,n}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let n=r.parent;if(n&&n!==e&&n.parent&&n.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],n=e.raws[t];return n&&n.value===r?n.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var _n=Sn;Sn.default=Sn;let In=_n;function An(e,t){new In(t).stringify(e)}var En=An;An.default=An;let{isClean:Tn,my:kn}=wn,On=vn,Rn=_n,xn=En;function Nn(e,t){let r=new e.constructor;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if("proxyCache"===n)continue;let o=e[n],s=typeof o;"parent"===n&&"object"===s?t&&(r[n]=t):"source"===n?r[n]=o:Array.isArray(o)?r[n]=o.map(e=>Nn(e,r)):("object"===s&&null!==o&&(o=Nn(o)),r[n]=o)}return r}let Mn=class{constructor(e={}){this.raws={},this[Tn]=!1,this[kn]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Nn(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:n}=this.rangeBy(t);return this.source.input.error(e,{column:n.column,line:n.line},{column:r.column,line:r.line},t)}return new On(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[Tn]){this[Tn]=!1;let e=this;for(;e=e.parent;)e[Tn]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let n=(t=this.toString()).indexOf(e.word);-1!==n&&(r=this.positionInside(n,t))}return r}positionInside(e,t){let r=t||this.toString(),n=this.source.start.column,o=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(n=1,o+=1):n+=1;return{column:n,line:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let n=this.toString(),o=n.indexOf(e.word);-1!==o&&(t=this.positionInside(o,n),r=this.positionInside(o+e.word.length,n))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Rn).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let n of e)n===this?r=!0:r?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},n=null==t;t=t||new Map;let o=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let n=this[e];if(Array.isArray(n))r[e]=n.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof n&&n.toJSON)r[e]=n.toJSON(null,t);else if("source"===e){let s=t.get(n.input);null==s&&(s=o,t.set(n.input,o),o++),r[e]={end:n.end,inputId:s,start:n.start}}else r[e]=n}return n&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=xn){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let n={node:this};for(let e in r)n[e]=r[e];return e.warn(t,n)}get proxyOf(){return this}};var Ln=Mn;Mn.default=Mn;let Dn=Ln,Pn=class extends Dn{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Fn=Pn;Pn.default=Pn;var Bn={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Un,SourceMapGenerator:Zn}=mn,{existsSync:jn,readFileSync:zn}=mn,{dirname:Vn,join:Gn}=mn;let Wn=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,n=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Vn(this.mapFile)),n&&(this.text=n)}consumer(){return this.consumerCache||(this.consumerCache=new Un(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),n=e.indexOf("*/",r);r>-1&&n>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,n)))}loadFile(e){if(this.root=Vn(e),jn(e))return this.mapFile=e,zn(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Un)return Zn.fromSourceMap(t).toString();if(t instanceof Zn)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Gn(Vn(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Hn=Wn;Wn.default=Wn;let{SourceMapConsumer:Yn,SourceMapGenerator:Kn}=mn,{fileURLToPath:Jn,pathToFileURL:Xn}=mn,{isAbsolute:qn,resolve:Qn}=mn,{nanoid:$n}=Bn,eo=mn,to=vn,ro=Hn,no=Symbol("fromOffsetCache"),oo=Boolean(Yn&&Kn),so=Boolean(Qn&&qn),io=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!so||/^\w+:\/\//.test(t.from)||qn(t.from)?this.file=t.from:this.file=Qn(t.from)),so&&oo){let e=new ro(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+$n(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,n={}){let o,s,i;if(t&&"object"==typeof t){let e=t,n=r;if("number"==typeof e.offset){let n=this.fromOffset(e.offset);t=n.line,r=n.col}else t=e.line,r=e.column;if("number"==typeof n.offset){let e=this.fromOffset(n.offset);s=e.line,i=e.col}else s=n.line,i=n.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,s,i);return o=a?new to(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,n.plugin):new to(e,void 0===s?t:{column:r,line:t},void 0===s?r:{column:i,line:s},this.css,this.file,n.plugin),o.input={column:r,endColumn:i,endLine:s,line:t,source:this.css},this.file&&(Xn&&(o.input.url=Xn(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[no])r=this[no];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let n=0,o=e.length;n<o;n++)r[n]=t,t+=e[n].length+1;this[no]=r}t=r[r.length-1];let n=0;if(e>=t)n=r.length-1;else{let t,o=r.length-2;for(;n<o;)if(t=n+(o-n>>1),e<r[t])o=t-1;else{if(!(e>=r[t+1])){n=t;break}n=t+1}}return{col:e-r[n]+1,line:n+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Qn(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,n){if(!this.map)return!1;let o,s,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(o=i.originalPositionFor({column:n,line:r})),s=qn(a.source)?Xn(a.source):new URL(a.source,this.map.consumer().sourceRoot||Xn(this.map.mapFile));let l={column:a.column,endColumn:o&&o.column,endLine:o&&o.line,line:a.line,url:s.toString()};if("file:"===s.protocol){if(!Jn)throw new Error("file: protocol is not available in this PostCSS build");l.file=Jn(s)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var ao=io;io.default=io,eo&&eo.registerInput&&eo.registerInput(io);let{SourceMapConsumer:lo,SourceMapGenerator:co}=mn,{dirname:uo,relative:ho,resolve:po,sep:fo}=mn,{pathToFileURL:mo}=mn,go=ao,yo=Boolean(lo&&co),bo=Boolean(uo&&po&&ho&&fo);var vo=class{constructor(e,t,r,n){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=n,this.originalCSS=n,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),n=e.root||uo(e.file);!1===this.mapOpts.sourcesContent?(t=new lo(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(n)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),bo&&yo&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=co.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new co({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new co({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,n=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(s.generated.line=r,s.generated.column=n-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),n=i.length-t):n+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=r,s.generated.column=n-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=r,s.generated.column=n-1,this.map.addMapping(s)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?uo(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=uo(po(r,this.mapOpts.annotation)));let n=ho(r,e);return this.memoizedPaths.set(e,n),n}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new go(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let n=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(n,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(mo){let t=mo(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===fo&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let wo=Ln,Co=class extends wo{constructor(e){super(e),this.type="comment"}};var So=Co;Co.default=Co;let _o,Io,Ao,Eo,{isClean:To,my:ko}=wn,Oo=Fn,Ro=So,xo=Ln;function No(e){return e.map(e=>(e.nodes&&(e.nodes=No(e.nodes)),delete e.source,e))}function Mo(e){if(e[To]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Mo(t)}let Lo=class e extends xo{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,n=this.getIterator();for(;this.indexes[n]<this.proxyOf.nodes.length&&(t=this.indexes[n],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[n]+=1;return delete this.indexes[n],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,n=this.index(e),o=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of o)this.proxyOf.nodes.splice(n+1,0,e);for(let e in this.indexes)r=this.indexes[e],n<r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}insertBefore(e,t){let r,n=this.index(e),o=0===n&&"prepend",s=this.normalize(t,this.proxyOf.nodes[n],o).reverse();n=this.index(e);for(let e of s)this.proxyOf.nodes.splice(n,0,e);for(let e in this.indexes)r=this.indexes[e],n<=r&&(this.indexes[e]=r+s.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=No(_o(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Oo(t)]}else if(t.selector)t=[new Io(t)];else if(t.name)t=[new Ao(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Ro(t)]}return t.map(t=>(t[ko]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[To]&&Mo(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let n;try{n=e(t,r)}catch(e){throw t.addToError(e)}return!1!==n&&t.walk&&(n=t.walk(e)),n})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("atrule"===r.type&&e.test(r.name))return t(r,n)}):this.walk((r,n)=>{if("atrule"===r.type&&r.name===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("decl"===r.type&&e.test(r.prop))return t(r,n)}):this.walk((r,n)=>{if("decl"===r.type&&r.prop===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,n)=>{if("rule"===r.type&&e.test(r.selector))return t(r,n)}):this.walk((r,n)=>{if("rule"===r.type&&r.selector===e)return t(r,n)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};Lo.registerParse=e=>{_o=e},Lo.registerRule=e=>{Io=e},Lo.registerAtRule=e=>{Ao=e},Lo.registerRoot=e=>{Eo=e};var Do=Lo;Lo.default=Lo,Lo.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Ao.prototype):"rule"===e.type?Object.setPrototypeOf(e,Io.prototype):"decl"===e.type?Object.setPrototypeOf(e,Oo.prototype):"comment"===e.type?Object.setPrototypeOf(e,Ro.prototype):"root"===e.type&&Object.setPrototypeOf(e,Eo.prototype),e[ko]=!0,e.nodes&&e.nodes.forEach(e=>{Lo.rebuild(e)})};let Po,Fo,Bo=Do,Uo=class extends Bo{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Po(new Fo,this,e).stringify()}};Uo.registerLazyResult=e=>{Po=e},Uo.registerProcessor=e=>{Fo=e};var Zo=Uo;Uo.default=Uo;let jo={};var zo=function(e){jo[e]||(jo[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Vo=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Go=Vo;Vo.default=Vo;let Wo=Go,Ho=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Wo(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Yo=Ho;Ho.default=Ho;const Ko="'".charCodeAt(0),Jo='"'.charCodeAt(0),Xo="\\".charCodeAt(0),qo="/".charCodeAt(0),Qo="\n".charCodeAt(0),$o=" ".charCodeAt(0),es="\f".charCodeAt(0),ts="\t".charCodeAt(0),rs="\r".charCodeAt(0),ns="[".charCodeAt(0),os="]".charCodeAt(0),ss="(".charCodeAt(0),is=")".charCodeAt(0),as="{".charCodeAt(0),ls="}".charCodeAt(0),cs=";".charCodeAt(0),us="*".charCodeAt(0),hs=":".charCodeAt(0),ps="@".charCodeAt(0),ds=/[\t\n\f\r "#'()/;[\\\]{}]/g,fs=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,ms=/.[\r\n"'(/\\]/,gs=/[\da-f]/i;let ys=Do,bs=class extends ys{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var vs=bs;bs.default=bs,ys.registerAtRule(bs);let ws,Cs,Ss=Do,_s=class extends Ss{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let n=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of n)e.raws.before=t.raws.before;return n}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new ws(new Cs,this,e).stringify()}};_s.registerLazyResult=e=>{ws=e},_s.registerProcessor=e=>{Cs=e};var Is=_s;_s.default=_s,Ss.registerRoot(_s);let As={comma:e=>As.split(e,[","],!0),space:e=>As.split(e,[" ","\n","\t"]),split(e,t,r){let n=[],o="",s=!1,i=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?i+=1:")"===r?i>0&&(i-=1):0===i&&t.includes(r)&&(s=!0),s?(""!==o&&n.push(o.trim()),o="",s=!1):o+=r;return(r||""!==o)&&n.push(o.trim()),n}};var Es=As;As.default=As;let Ts=Do,ks=Es,Os=class extends Ts{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return ks.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Rs=Os;Os.default=Os,Ts.registerRule(Os);let xs=Fn,Ns=function(e,t={}){let r,n,o,s,i,a,l,c,u,h,p=e.css.valueOf(),d=t.ignoreErrors,f=p.length,m=0,g=[],y=[];function b(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=p.charCodeAt(m),r){case Qo:case $o:case ts:case rs:case es:n=m;do{n+=1,r=p.charCodeAt(n)}while(r===$o||r===Qo||r===ts||r===rs||r===es);h=["space",p.slice(m,n)],m=n-1;break;case ns:case os:case as:case ls:case hs:case cs:case is:{let e=String.fromCharCode(r);h=[e,e,m];break}case ss:if(c=g.length?g.pop()[1]:"",u=p.charCodeAt(m+1),"url"===c&&u!==Ko&&u!==Jo&&u!==$o&&u!==Qo&&u!==ts&&u!==es&&u!==rs){n=m;do{if(a=!1,n=p.indexOf(")",n+1),-1===n){if(d||t){n=m;break}b("bracket")}for(l=n;p.charCodeAt(l-1)===Xo;)l-=1,a=!a}while(a);h=["brackets",p.slice(m,n+1),m,n],m=n}else n=p.indexOf(")",m+1),s=p.slice(m,n+1),-1===n||ms.test(s)?h=["(","(",m]:(h=["brackets",s,m,n],m=n);break;case Ko:case Jo:o=r===Ko?"'":'"',n=m;do{if(a=!1,n=p.indexOf(o,n+1),-1===n){if(d||t){n=m+1;break}b("string")}for(l=n;p.charCodeAt(l-1)===Xo;)l-=1,a=!a}while(a);h=["string",p.slice(m,n+1),m,n],m=n;break;case ps:ds.lastIndex=m+1,ds.test(p),n=0===ds.lastIndex?p.length-1:ds.lastIndex-2,h=["at-word",p.slice(m,n+1),m,n],m=n;break;case Xo:for(n=m,i=!0;p.charCodeAt(n+1)===Xo;)n+=1,i=!i;if(r=p.charCodeAt(n+1),i&&r!==qo&&r!==$o&&r!==Qo&&r!==ts&&r!==rs&&r!==es&&(n+=1,gs.test(p.charAt(n)))){for(;gs.test(p.charAt(n+1));)n+=1;p.charCodeAt(n+1)===$o&&(n+=1)}h=["word",p.slice(m,n+1),m,n],m=n;break;default:r===qo&&p.charCodeAt(m+1)===us?(n=p.indexOf("*/",m+2)+1,0===n&&(d||t?n=p.length:b("comment")),h=["comment",p.slice(m,n+1),m,n],m=n):(fs.lastIndex=m+1,fs.test(p),n=0===fs.lastIndex?p.length-1:fs.lastIndex-2,h=["word",p.slice(m,n+1),m,n],g.push(h),m=n)}return m++,h},position:function(){return m}}},Ms=So,Ls=vs,Ds=Is,Ps=Rs;const Fs={empty:!0,space:!0};let Bs=Do,Us=class{constructor(e){this.input=e,this.root=new Ds,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,n,o=new Ls;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(n=a.length-1,r=a[n];r&&"space"===r[0];)r=a[--n];r&&(o.source.end=this.getPosition(r[3]||r[2]),o.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(o.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(o,"params",a),s&&(e=a[a.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),i&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,n=0;for(let o=t-1;o>=0&&(r=e[o],"space"===r[0]||(n+=1,2!==n));o--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,n,o=0;for(let[s,i]of e.entries()){if(t=i,r=t[0],"("===r&&(o+=1),")"===r&&(o-=1),0===o&&":"===r){if(n){if("word"===n[0]&&"progid"===n[1])continue;return s}this.doubleColon(t)}n=t}return!1}comment(e){let t=new Ms;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Ns(this.input)}decl(e,t){let r=new xs;this.init(r,e[0][2]);let n,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],n=r[3]||r[2];if(n)return n}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(n=e.shift(),":"===n[0]){r.raws.between+=n[1];break}"word"===n[0]&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let s,i=[];for(;e.length&&(s=e[0][0],"space"===s||"comment"===s);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(n=e[t],"!important"===n[1].toLowerCase()){r.important=!0;let n=this.stringFrom(e,t);n=this.spacesFromEnd(e)+n," !important"!==n&&(r.raws.important=n);break}if("important"===n[1].toLowerCase()){let n=e.slice(0),o="";for(let e=t;e>0;e--){let t=n[e][0];if(0===o.trim().indexOf("!")&&"space"!==t)break;o=n.pop()[1]+o}0===o.trim().indexOf("!")&&(r.important=!0,r.raws.important=o,e=n)}if("space"!==n[0]&&"comment"!==n[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Ps;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,n=!1,o=null,s=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)o||(o=l),s.push("("===r?")":"]");else if(i&&n&&"{"===r)o||(o=l),s.push("}");else if(0===s.length){if(";"===r){if(n)return void this.decl(a,i);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(n=!0)}else r===s[s.length-1]&&(s.pop(),0===s.length&&(o=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),s.length>0&&this.unclosedBracket(o),t&&n){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,n){let o,s,i,a,l=r.length,c="",u=!0;for(let e=0;e<l;e+=1)o=r[e],s=o[0],"space"!==s||e!==l-1||n?"comment"===s?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",Fs[a]||Fs[i]||","===c.slice(-1)?u=!1:c+=o[1]):c+=o[1]:u=!1;if(!u){let n=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:n,value:c}}e[t]=c}rule(e){e.pop();let t=new Ps;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let n=t;n<e.length;n++)r+=e[n][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Zs=ao;function js(e,t){let r=new Zs(e,t),n=new Us(r);try{n.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return n.root}var zs=js;js.default=js,Bs.registerParse(js);let{isClean:Vs,my:Gs}=wn,Ws=vo,Hs=En,Ys=Do,Ks=Zo,Js=zo,Xs=Yo,qs=zs,Qs=Is;const $s={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ei={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},ti={Once:!0,postcssPlugin:!0,prepare:!0};function ri(e){return"object"==typeof e&&"function"==typeof e.then}function ni(e){let t=!1,r=$s[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function oi(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:ni(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function si(e){return e[Vs]=!1,e.nodes&&e.nodes.forEach(e=>si(e)),e}let ii={},ai=class e{constructor(t,r,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof Xs)o=si(r.root),r.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=r.map);else{let e=qs;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(r,n)}catch(e){this.processed=!0,this.error=e}o&&!o[Gs]&&Ys.rebuild(o)}else o=si(r);this.result=new Xs(t,o,n),this.helpers={...ii,postcss:ii,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,n=this.result.processor.version,o=t.split("."),s=n.split(".");(o[0]!==s[0]||parseInt(o[1])>parseInt(s[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+n+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!ei[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ti[r])if("object"==typeof t[r])for(let n in t[r])e(t,"*"===n?r:r+"-"+n.toLowerCase(),t[r][n]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(ri(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Vs];){e[Vs]=!0;let t=[oi(e)];for(;t.length>0;){let e=this.visitTick(t);if(ri(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return ri(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Hs;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Ws(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(ri(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Vs];)e[Vs]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Js("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,n]of e){let e;this.result.lastPlugin=r;try{e=n(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(ri(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:n}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(n.length>0&&t.visitorIndex<n.length){let[e,o]=n[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===n.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return o(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let n,o=t.iterator;for(;n=r.nodes[r.indexes[o]];)if(r.indexes[o]+=1,!n[Vs])return n[Vs]=!0,void e.push(oi(n));t.iterator=0,delete r.indexes[o]}let o=t.events;for(;t.eventIndex<o.length;){let e=o[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[Vs]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Vs]=!0;let t=ni(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[Vs]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};ai.registerPostcss=e=>{ii=e};var li=ai;ai.default=ai,Qs.registerLazyResult(ai),Ks.registerLazyResult(ai);let ci=vo,ui=En,hi=zo,pi=zs;const di=Yo;let fi=class{constructor(e,t,r){let n;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let o=ui;this.result=new di(this._processor,n,this._opts),this.result.css=t;let s=this;Object.defineProperty(this.result,"root",{get:()=>s.root});let i=new ci(o,n,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||hi("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=pi;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var mi=fi;fi.default=fi;let gi=mi,yi=li,bi=Zo,vi=Is,wi=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new yi(this,e,t):new gi(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Ci=wi;wi.default=wi,vi.registerProcessor(wi),bi.registerProcessor(wi);let Si=Fn,_i=Hn,Ii=So,Ai=vs,Ei=ao,Ti=Is,ki=Rs;function Oi(e,t){if(Array.isArray(e))return e.map(e=>Oi(e));let{inputs:r,...n}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Ei.prototype};r.map&&(r.map={...r.map,__proto__:_i.prototype}),t.push(r)}}if(n.nodes&&(n.nodes=e.nodes.map(e=>Oi(e,t))),n.source){let{inputId:e,...r}=n.source;n.source=r,null!=e&&(n.source.input=t[e])}if("root"===n.type)return new Ti(n);if("decl"===n.type)return new Si(n);if("rule"===n.type)return new ki(n);if("comment"===n.type)return new Ii(n);if("atrule"===n.type)return new Ai(n);throw new Error("Unknown node type: "+e.type)}var Ri=Oi;Oi.default=Oi;let xi=vn,Ni=Fn,Mi=li,Li=Do,Di=Ci,Pi=En,Fi=Ri,Bi=Zo,Ui=Go,Zi=So,ji=vs,zi=Yo,Vi=ao,Gi=zs,Wi=Es,Hi=Rs,Yi=Is,Ki=Ln;function Ji(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Di(e)}Ji.plugin=function(e,t){let r,n=!1;function o(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let o=t(...r);return o.postcssPlugin=e,o.postcssVersion=(new Di).version,o}return Object.defineProperty(o,"postcss",{get:()=>(r||(r=o()),r)}),o.process=function(e,t,r){return Ji([o(r)]).process(e,t)},o},Ji.stringify=Pi,Ji.parse=Gi,Ji.fromJSON=Fi,Ji.list=Wi,Ji.comment=e=>new Zi(e),Ji.atRule=e=>new ji(e),Ji.decl=e=>new Ni(e),Ji.rule=e=>new Hi(e),Ji.root=e=>new Yi(e),Ji.document=e=>new Bi(e),Ji.CssSyntaxError=xi,Ji.Declaration=Ni,Ji.Container=Li,Ji.Processor=Di,Ji.Document=Bi,Ji.Comment=Zi,Ji.Warning=Ui,Ji.AtRule=ji,Ji.Result=zi,Ji.Input=Vi,Ji.Rule=Hi,Ji.Root=Yi,Ji.Node=Ki,Mi.registerPostcss(Ji);var Xi=Ji;Ji.default=Ji;const qi=cn(Xi);qi.stringify,qi.fromJSON,qi.plugin,qi.parse,qi.list,qi.document,qi.comment,qi.atRule,qi.rule,qi.decl,qi.root,qi.CssSyntaxError,qi.Declaration,qi.Container,qi.Processor,qi.Document,qi.Comment,qi.Warning,qi.AtRule,qi.Result,qi.Input,qi.Rule,qi.Root,qi.Node;class Qi{constructor(...e){ln(this,"parentElement",null),ln(this,"parentNode",null),ln(this,"ownerDocument"),ln(this,"firstChild",null),ln(this,"lastChild",null),ln(this,"previousSibling",null),ln(this,"nextSibling",null),ln(this,"ELEMENT_NODE",1),ln(this,"TEXT_NODE",3),ln(this,"nodeType"),ln(this,"nodeName"),ln(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Qi))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const $i={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ea={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ta={};function ra(e){if(ta[e])return ta[e];const t=globalThis[e],r=t.prototype,n=e in $i?$i[e]:void 0,o=Boolean(n&&n.every(e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))})),s=e in ea?ea[e]:void 0,i=Boolean(s&&s.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(o&&i&&!globalThis.Zone)return ta[e]=t.prototype,t.prototype;try{const n=document.createElement("iframe");document.body.appendChild(n);const o=n.contentWindow;if(!o)return t.prototype;const s=o[e].prototype;return document.body.removeChild(n),s?ta[e]=s:r}catch{return r}}const na={};function oa(e,t,r){var n;const o=`${e}.${String(r)}`;if(na[o])return na[o].call(t);const s=ra(e),i=null==(n=Object.getOwnPropertyDescriptor(s,r))?void 0:n.get;return i?(na[o]=i,i.call(t)):t[r]}const sa={};function ia(e,t,r){const n=`${e}.${String(r)}`;if(sa[n])return sa[n].bind(t);const o=ra(e)[r];return"function"!=typeof o?t[r]:(sa[n]=o,o.bind(t))}const aa={childNodes:function(e){return oa("Node",e,"childNodes")},parentNode:function(e){return oa("Node",e,"parentNode")},parentElement:function(e){return oa("Node",e,"parentElement")},textContent:function(e){return oa("Node",e,"textContent")},contains:function(e,t){return ia("Node",e,"contains")(t)},getRootNode:function(e){return ia("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?oa("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?oa("Element",e,"shadowRoot"):null},querySelector:function(e,t){return oa("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return oa("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return ra("MutationObserver").constructor}};const la="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let ca={map:{},getId:()=>(console.error(la),-1),getNode:()=>(console.error(la),null),removeNodeFromMap(){console.error(la)},has:()=>(console.error(la),!1),reset(){console.error(la)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ca=new Proxy(ca,{get:(e,t,r)=>("map"===t&&console.error(la),Reflect.get(e,t,r))}));let ua=Date.now;function ha(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:aa.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(ua=()=>(new Date).getTime());function pa(e){var t;let r=null;return"getRootNode"in e&&(null==(t=aa.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&aa.host(aa.getRootNode(e))&&(r=aa.host(aa.getRootNode(e))),r}function da(e){let t,r=e;for(;t=pa(r);)r=t;return r}function fa(e){const t=e.ownerDocument;if(!t)return!1;const r=da(e);return aa.contains(t,r)}const ma=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){o(this,"id",1),o(this,"styleIDMap",new WeakMap),o(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return ca},closestElementOfNode:ha,getBaseDimension:function e(t,r){var n,o;const s=null==(o=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:o.frameElement;if(!s||s===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=s.getBoundingClientRect(),a=e(s,r),l=i.height/s.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,r){const n=t[r[0]];return 1===r.length?n:e(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){const t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:da,getShadowHost:pa,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,n,o;const s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(t=aa.parentElement(s.body))?void 0:t.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(n=aa.parentElement(s.body))?void 0:n.scrollTop)||(null==(o=null==s?void 0:s.body)?void 0:o.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof Qi&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(aa.shadowRoot(e)))},hookSetter:function e(t,r,n,o,s=window){const i=s.Object.getOwnPropertyDescriptor(t,r);return s.Object.defineProperty(t,r,o?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>e(t,r,i||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(aa.contains(t,e)||fa(e))},isAncestorRemoved:function e(t,r){if(function(e){const t=e&&"host"in e&&"mode"in e&&m.host(e)||null;return Boolean(t&&"shadowRoot"in t&&m.shadowRoot(t)===e)}(t))return!1;const n=r.getId(t);if(!r.has(n))return!0;const o=aa.parentNode(t);return(!o||o.nodeType!==t.DOCUMENT_NODE)&&(!o||e(o,r))},isBlocked:function(e,t,r,n){if(!e)return!1;const o=ha(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(n&&null!==o.closest("."+t))return!0}else if(y(o,t,n))return!0}catch(e){}if(r){if(o.matches(r))return!0;if(n&&null!==o.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(let n=t.children.length-1;n>=0;n--)e(t.children[n],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return ua},on:function(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)},patch:function(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}},polyfill: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)},queueToResolveTrees:function(e){const t={},r=(e,r)=>{const n={value:e,parent:r,children:[]};return t[e.node.id]=n,n},n=[];for(const o of e){const{nextId:e,parentId:s}=o;if(e&&e in t){const s=t[e];if(s.parent){const e=s.parent.children.indexOf(s);s.parent.children.splice(e,0,r(o,s.parent))}else{const e=n.indexOf(s);n.splice(e,0,r(o,null))}continue}if(s in t){const e=t[s];e.children.push(r(o,e));continue}n.push(r(o,null))}return n},shadowHostInDom:fa,throttle:function(e,t,r={}){let n=null,o=0;return function(...s){const i=Date.now();o||!1!==r.leading||(o=i);const a=t-(i-o),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),o=i,e.apply(l,s)):n||!1===r.trailing||(n=setTimeout(()=>{o=!1===r.leading?0:Date.now(),n=null,e.apply(l,s)},a))}},uniqueTextMutations:function(e){const t=new Set,r=[];for(let n=e.length;n--;){const o=e[n];t.has(o.id)||(r.push(o),t.add(o.id))}return r}},Symbol.toStringTag,{value:"Module"}));for(var ga="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ya="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ba=0;ba<64;ba++)ya[ga.charCodeAt(ba)]=ba;var va,wa,Ca;"undefined"!=typeof window&&window.Blob&&new Blob([(va="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Uint8Array.from(atob(va),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],e=>2*e)[0]){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null==(e=t.contentWindow)?void 0:e.Array.from)||Array.from,document.body.removeChild(t)}}catch(e){console.debug("Unable to override Array.from",e)}new g,(Ca=wa||(wa={}))[Ca.NotStarted=0]="NotStarted",Ca[Ca.Running=1]="Running",Ca[Ca.Stopped=2]="Stopped";class Sa{constructor(e){r(this,"fileName"),r(this,"functionName"),r(this,"lineNumber"),r(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const _a=/(^|@)\S+:\d+/,Ia=/^\s*at .*(\S+:\d+|\(native\))/m,Aa=/^(eval@)?(\[native code])?$/,Ea={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Ia)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Ia)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const r=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=r?t.replace(r[0],""):t;const n=t.split(/\s+/).slice(1),o=this.extractLocation(r?r[1]:n.pop()),s=n.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new Sa({functionName:s,fileName:i,lineNumber:o[1],columnNumber:o[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(Aa)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Sa({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,o=this.extractLocation(e.replace(t,""));return new Sa({functionName:n,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[];for(let e=2,o=r.length;e<o;e+=2){const o=t.exec(r[e]);o&&n.push(new Sa({fileName:o[2],lineNumber:parseFloat(o[1])}))}return n},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[];for(let e=0,o=r.length;e<o;e+=2){const o=t.exec(r[e]);o&&n.push(new Sa({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(_a)&&!e.match(/^Error created at/)},this).map(function(e){const t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Sa({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Ta(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();const n=e.parentElement,o=[];if(n.children&&n.children.length>0)for(let e=0;e<n.children.length;e++){const t=n.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===r&&o.push(t)}o.length>1&&(r+=`:eq(${o.indexOf(e)})`),t=r+(t?">"+t:""),e=n}return t}function ka(e){return"[object Object]"===Object.prototype.toString.call(e)}function Oa(e,t){if(0===t)return!0;const r=Object.keys(e);for(const n of r)if(ka(e[n])&&Oa(e[n],t-1))return!0;return!1}function Ra(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],o=[];return JSON.stringify(e,function(e,t){if(n.length>0){const r=n.indexOf(this);~r?n.splice(r+1):n.push(this),~r?o.splice(r,1/0,e):o.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(ka(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(ka(e)&&Oa(e,r.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=`${t.slice(0,r.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const r in t){const n=t[r];Array.isArray(n)?e[r]=Ta(n.length?n[0]:null):e[r]=n}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t})}const xa={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Na(e,t,r){const n=r?Object.assign({},xa,r):xa,o=n.logger;if(!o)return()=>{};let s;s="string"==typeof o?t[o]:o;let i=0,a=!1;const l=[];if(n.level.includes("error")){const r=t=>{const r=t.message,o=t.error,s=Ea.parse(o).map(e=>e.toString()),i=[Ra(r,n.stringifyOptions)];e({level:"error",trace:s,payload:i})};t.addEventListener("error",r),l.push(()=>{t.removeEventListener("error",r)});const o=t=>{let r,o;t.reason instanceof Error?(r=t.reason,o=[Ra(`Uncaught (in promise) ${r.name}: ${r.message}`,n.stringifyOptions)]):(r=new Error,o=[Ra("Uncaught (in promise)",n.stringifyOptions),Ra(t.reason,n.stringifyOptions)]);const s=Ea.parse(r).map(e=>e.toString());e({level:"error",trace:s,payload:o})};t.addEventListener("unhandledrejection",o),l.push(()=>{t.removeEventListener("unhandledrejection",o)})}for(const e of n.level)l.push(c(s,e));return()=>{l.forEach(e=>e())};function c(t,r){return t[r]?ma.patch(t,r,t=>(...o)=>{if(t.apply(this,o),!("assert"===r&&o[0]||a)){a=!0;try{const t=Ea.parse(new Error).map(e=>e.toString()).splice(1),s=("assert"===r?o.slice(1):o).map(e=>Ra(e,n.stringifyOptions));i++,i<n.lengthThreshold?e({level:r,trace:t,payload:s}):i===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Ra("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...o)}finally{a=!1}}}):()=>{}}}var Ma;function La(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function Da(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Pa(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t).map(Fa).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function Fa(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=Pa(e.styleSheet)||t}catch(e){}return t}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(Ma||(Ma={}));var Ba=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,r=this.getId(e);this.idNodeMap.delete(r),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Ua(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,s=e.maskInputFn,i=o||"";return(t[r.toLowerCase()]||t[n])&&(i=s?s(i):"*".repeat(i.length)),i}var Za="__rrweb_original__";var ja,za,Va=1,Ga=new RegExp("[^a-z0-9-_:]");function Wa(){return Va++}var Ha=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ya=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Ka=/^(data:)([^,]*),(.*)/i;function Ja(e,t){return(e||"").replace(Ha,function(e,r,n,o,s,i){var a,l=n||s||i,c=r||o||"";if(!l)return e;if(!Ya.test(l))return"url(".concat(c).concat(l).concat(c,")");if(Ka.test(l))return"url(".concat(c).concat(l).concat(c,")");if("/"===l[0])return"url(".concat(c).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)).concat(c,")");var u=t.split("/"),h=l.split("/");u.pop();for(var p=0,d=h;p<d.length;p++){var f=d[p];"."!==f&&(".."===f?u.pop():u.push(f))}return"url(".concat(c).concat(u.join("/")).concat(c,")")})}var Xa=/^[^ \t\n\r\u000c]+/,qa=/^[, \t\n\r\u000c]+/;function Qa(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function $a(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function el(){var e=document.createElement("a");return e.href="",e.href}function tl(e,t,r,n){return"src"===r||"href"===r&&n&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&n&&"#"!==n[0]?Qa(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,o=e.exec(t.substring(r));return o?(n=o[0],r+=n.length,n):""}for(var o=[];n(qa),!(r>=t.length);){var s=n(Xa);if(","===s.slice(-1))s=Qa(e,s.substring(0,s.length-1)),o.push(s);else{var i="";s=Qa(e,s);for(var a=!1;;){var l=t.charAt(r);if(""===l){o.push((s+i).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,o.push((s+i).trim());break}"("===l&&(a=!0)}i+=l,r+=1}}}return o.join(", ")}(e,n):"style"===r&&n?Ja(n,el()):"object"===t&&"data"===r&&n?Qa(e,n):n:Qa(e,n)}function rl(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&rl(e.parentNode,t,r);for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return!!r&&rl(e.parentNode,t,r)}function nl(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===n)return!1;if("string"==typeof t){if(n.classList.contains(t))return!0;if(n.closest(".".concat(t)))return!0}else if(rl(n,t,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}return!1}function ol(e,t){var r=t.doc,n=t.mirror,o=t.blockClass,s=t.blockSelector,i=t.maskTextClass,a=t.maskTextSelector,l=t.inlineStylesheet,c=t.maskInputOptions,u=void 0===c?{}:c,h=t.maskTextFn,p=t.maskInputFn,d=t.dataURLOptions,f=void 0===d?{}:d,m=t.inlineImages,g=t.recordCanvas,y=t.keepIframeSrcFn,b=t.newlyAddedElement,v=void 0!==b&&b,w=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Ma.Document,childNodes:[],compatMode:e.compatMode}:{type:Ma.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ma.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return function(e,t){for(var r=t.doc,n=t.blockClass,o=t.blockSelector,s=t.inlineStylesheet,i=t.maskInputOptions,a=void 0===i?{}:i,l=t.maskInputFn,c=t.dataURLOptions,u=void 0===c?{}:c,h=t.inlineImages,p=t.recordCanvas,d=t.keepIframeSrcFn,f=t.newlyAddedElement,m=void 0!==f&&f,g=t.rootId,y=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return!!r&&e.matches(r)}(e,n,o),b=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Ga.test(t)?"div":t}(e),v={},w=e.attributes.length,C=0;C<w;C++){var S=e.attributes[C];v[S.name]=tl(r,b,S.name,S.value)}if("link"===b&&s){var _=Array.from(r.styleSheets).find(function(t){return t.href===e.href}),I=null;_&&(I=Pa(_)),I&&(delete v.rel,delete v.href,v._cssText=Ja(I,_.href))}if("style"===b&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(I=Pa(e.sheet))&&(v._cssText=Ja(I,el()))}if("input"===b||"textarea"===b||"select"===b){var A=e.value,E=e.checked;"radio"!==v.type&&"checkbox"!==v.type&&"submit"!==v.type&&"button"!==v.type&&A?v.value=Ua({type:v.type,tagName:b,value:A,maskInputOptions:a,maskInputFn:l}):E&&(v.checked=E)}"option"===b&&(e.selected&&!a.select?v.selected=!0:delete v.selected);if("canvas"===b&&p)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var o=t.getImageData,s=Za in o?o[Za]:o;if(new Uint32Array(s.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some(function(e){return 0!==e}))return!1}return!0})(e)||(v.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var T=e.toDataURL(u.type,u.quality),k=document.createElement("canvas");k.width=e.width,k.height=e.height,T!==k.toDataURL(u.type,u.quality)&&(v.rr_dataURL=T)}if("img"===b&&h){ja||(ja=r.createElement("canvas"),za=ja.getContext("2d"));var O=e,R=O.crossOrigin;O.crossOrigin="anonymous";var x=function(){try{ja.width=O.naturalWidth,ja.height=O.naturalHeight,za.drawImage(O,0,0),v.rr_dataURL=ja.toDataURL(u.type,u.quality)}catch(e){console.warn("Cannot inline img src=".concat(O.currentSrc,"! Error: ").concat(e))}R?v.crossOrigin=R:O.removeAttribute("crossorigin")};O.complete&&0!==O.naturalWidth?x():O.onload=x}"audio"!==b&&"video"!==b||(v.rr_mediaState=e.paused?"paused":"played",v.rr_mediaCurrentTime=e.currentTime);m||(e.scrollLeft&&(v.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(v.rr_scrollTop=e.scrollTop));if(y){var N=e.getBoundingClientRect(),M=N.width,L=N.height;v={class:v.class,rr_width:"".concat(M,"px"),rr_height:"".concat(L,"px")}}"iframe"!==b||d(v.src)||(e.contentDocument||(v.rr_src=v.src),delete v.src);return{type:Ma.Element,tagName:b,attributes:v,childNodes:[],isSVG:$a(e)||void 0,needBlock:y,rootId:g}}(e,{doc:r,blockClass:o,blockSelector:s,inlineStylesheet:l,maskInputOptions:u,maskInputFn:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:y,newlyAddedElement:v,rootId:w});case e.TEXT_NODE:return function(e,t){var r,n=t.maskTextClass,o=t.maskTextSelector,s=t.maskTextFn,i=t.rootId,a=e.parentNode&&e.parentNode.tagName,l=e.textContent,c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;if(c&&l){try{e.nextSibling||e.previousSibling||(null===(r=e.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(l=(h=e.parentNode.sheet).cssRules?Array.from(h.cssRules).map(function(e){return e.cssText||""}).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}l=Ja(l,el())}var h;u&&(l="SCRIPT_PLACEHOLDER");!c&&!u&&l&&nl(e,n,o)&&(l=s?s(l):l.replace(/[\S]/g,"*"));return{type:Ma.Text,textContent:l||"",isStyle:c,rootId:i}}(e,{maskTextClass:i,maskTextSelector:a,maskTextFn:h,rootId:w});case e.CDATA_SECTION_NODE:return{type:Ma.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:Ma.Comment,textContent:e.textContent||"",rootId:w};default:return!1}}function sl(e){return void 0===e?"":e.toLowerCase()}function il(e,t){var r,n=t.doc,o=t.mirror,s=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,u=void 0!==c&&c,h=t.inlineStylesheet,p=void 0===h||h,d=t.maskInputOptions,f=void 0===d?{}:d,m=t.maskTextFn,g=t.maskInputFn,y=t.slimDOMOptions,b=t.dataURLOptions,v=void 0===b?{}:b,w=t.inlineImages,C=void 0!==w&&w,S=t.recordCanvas,_=void 0!==S&&S,I=t.onSerialize,A=t.onIframeLoad,E=t.iframeLoadTimeout,T=void 0===E?5e3:E,k=t.onStylesheetLoad,O=t.stylesheetLoadTimeout,R=void 0===O?5e3:O,x=t.keepIframeSrcFn,N=void 0===x?function(){return!1}:x,M=t.newlyAddedElement,L=void 0!==M&&M,D=t.preserveWhiteSpace,P=void 0===D||D,F=ol(e,{doc:n,mirror:o,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:l,inlineStylesheet:p,maskInputOptions:f,maskTextFn:m,maskInputFn:g,dataURLOptions:v,inlineImages:C,recordCanvas:_,keepIframeSrcFn:N,newlyAddedElement:L});if(!F)return console.warn(e,"not serialized"),null;r=o.hasNode(e)?o.getId(e):!function(e,t){if(t.comment&&e.type===Ma.Comment)return!0;if(e.type===Ma.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(sl(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===sl(e.attributes.name)||"icon"===sl(e.attributes.rel)||"apple-touch-icon"===sl(e.attributes.rel)||"shortcut icon"===sl(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&sl(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(sl(e.attributes.property).match(/^(og|twitter|fb):/)||sl(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===sl(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===sl(e.attributes.name)||"googlebot"===sl(e.attributes.name)||"bingbot"===sl(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===sl(e.attributes.name)||"generator"===sl(e.attributes.name)||"framework"===sl(e.attributes.name)||"publisher"===sl(e.attributes.name)||"progid"===sl(e.attributes.name)||sl(e.attributes.property).match(/^article:/)||sl(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===sl(e.attributes.name)||"yandex-verification"===sl(e.attributes.name)||"csrf-token"===sl(e.attributes.name)||"p:domain_verify"===sl(e.attributes.name)||"verify-v1"===sl(e.attributes.name)||"verification"===sl(e.attributes.name)||"shopify-checkout-api-token"===sl(e.attributes.name)))return!0}}return!1}(F,y)&&(P||F.type!==Ma.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?Wa():-2;var B=Object.assign(F,{id:r});if(o.add(e,B),-2===r)return null;I&&I(e);var U=!u;if(B.type===Ma.Element){U=U&&!B.needBlock,delete B.needBlock;var Z=e.shadowRoot;Z&&Da(Z)&&(B.isShadowHost=!0)}if((B.type===Ma.Document||B.type===Ma.Element)&&U){y.headWhitespace&&B.type===Ma.Element&&"head"===B.tagName&&(P=!1);for(var j={doc:n,mirror:o,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:u,inlineStylesheet:p,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:v,inlineImages:C,recordCanvas:_,preserveWhiteSpace:P,onSerialize:I,onIframeLoad:A,iframeLoadTimeout:T,onStylesheetLoad:k,stylesheetLoadTimeout:R,keepIframeSrcFn:N},z=0,V=Array.from(e.childNodes);z<V.length;z++){(H=il(V[z],j))&&B.childNodes.push(H)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var G=0,W=Array.from(e.shadowRoot.childNodes);G<W.length;G++){var H;(H=il(W[G],j))&&(Da(e.shadowRoot)&&(H.isShadow=!0),B.childNodes.push(H))}}return e.parentNode&&La(e.parentNode)&&Da(e.parentNode)&&(B.isShadow=!0),B.type===Ma.Element&&"iframe"===B.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var o,s=!1;try{o=n.document.readyState}catch(e){return}if("complete"===o){var i="about:blank";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout(function(){s||(t(),s=!0)},r);e.addEventListener("load",function(){clearTimeout(a),s=!0,t()})}}}(e,function(){var t=e.contentDocument;if(t&&A){var r=il(t,{doc:t,mirror:o,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:v,inlineImages:C,recordCanvas:_,preserveWhiteSpace:P,onSerialize:I,onIframeLoad:A,iframeLoadTimeout:T,onStylesheetLoad:k,stylesheetLoadTimeout:R,keepIframeSrcFn:N});r&&A(e,r)}},T),B.type===Ma.Element&&"link"===B.tagName&&"stylesheet"===B.attributes.rel&&function(e,t,r){var n,o=!1;try{n=e.sheet}catch(e){return}if(!n){var s=setTimeout(function(){o||(t(),o=!0)},r);e.addEventListener("load",function(){clearTimeout(s),o=!0,t()})}}(e,function(){if(k){var t=il(e,{doc:n,mirror:o,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:v,inlineImages:C,recordCanvas:_,preserveWhiteSpace:P,onSerialize:I,onIframeLoad:A,iframeLoadTimeout:T,onStylesheetLoad:k,stylesheetLoadTimeout:R,keepIframeSrcFn:N});t&&k(e,t)}},R),B}function al(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const ll="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let cl={map:{},getId:()=>(console.error(ll),-1),getNode:()=>(console.error(ll),null),removeNodeFromMap(){console.error(ll)},has:()=>(console.error(ll),!1),reset(){console.error(ll)}};function ul(e,t,r={}){let n=null,o=0;return function(...s){const i=Date.now();o||!1!==r.leading||(o=i);const a=t-(i-o),l=this;a<=0||a>t?(n&&(clearTimeout(n),n=null),o=i,e.apply(l,s)):n||!1===r.trailing||(n=setTimeout(()=>{o=!1===r.leading?0:Date.now(),n=null,e.apply(l,s)},a))}}function hl(e,t,r,n,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),s&&s.set&&s.set.call(this,e)}}),()=>hl(e,t,s||{},!0)}function pl(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch(e){return()=>{}}}function dl(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function fl(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ml(e,t,r,n){if(!e)return!1;const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(n&&null!==o.closest("."+t))return!0}else if(rl(o,t,n))return!0;if(r){if(e.matches(r))return!0;if(n&&null!==o.closest(r))return!0}return!1}function gl(e,t){return-2===t.getId(e)}function yl(e,t){if(La(e))return!1;const r=t.getId(e);return!t.has(r)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||yl(e.parentNode,t))}function bl(e){return Boolean(e.changedTouches)}function vl(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function wl(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Cl(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(cl=new Proxy(cl,{get:(e,t,r)=>("map"===t&&console.error(ll),Reflect.get(e,t,r))}));class Sl{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var _l=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(_l||{}),Il=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(Il||{}),Al=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Al||{}),El=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(El||{});function Tl(e){return"__ln"in e}class kl{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Tl(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Tl(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const Ol=(e,t)=>`${e}@${t}`;class Rl{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new kl,r=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},n=n=>{var o,s,i,a;let l=null;(null===(s=null===(o=n.getRootNode)||void 0===o?void 0:o.call(n))||void 0===s?void 0:s.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&n.getRootNode().host&&(l=n.getRootNode().host);let c=l;for(;(null===(a=null===(i=null==c?void 0:c.getRootNode)||void 0===i?void 0:i.call(c))||void 0===a?void 0:a.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&c.getRootNode().host;)c=c.getRootNode().host;const u=!(this.doc.contains(n)||c&&this.doc.contains(c));if(!n.parentNode||u)return;const h=La(n.parentNode)?this.mirror.getId(l):this.mirror.getId(n.parentNode),p=r(n);if(-1===h||-1===p)return t.addNode(n);const d=il(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{vl(e,this.mirror)&&this.iframeManager.addIframe(e),wl(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Cl(n)&&this.shadowDomManager.addShadowRoot(n.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});d&&e.push({parentId:h,nextId:p,node:d})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))Nl(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||n(e);for(const e of Array.from(this.addedSet.values()))Ll(this.droppedSet,e)||Nl(this.removes,e,this.mirror)?Ll(this.movedSet,e)?n(e):this.droppedSet.add(e):n(e);let o=null;for(;t.length;){let e=null;if(o){const t=this.mirror.getId(o.value.parentNode),n=r(o.value);-1!==t&&-1!==n&&(e=o)}if(!e)for(let n=t.length-1;n>=0;n--){const o=t.get(n);if(o){const t=this.mirror.getId(o.value.parentNode);if(-1===r(o.value))continue;if(-1!==t){e=o;break}{const t=o.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=o;break}}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}o=e.previous,t.removeNode(e.value),n(e.value)}const s={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>({id:this.mirror.getId(e.node),attributes:e.attributes})).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))},this.processMutation=e=>{if(!gl(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;ml(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:nl(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(r=Ua({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:r,maskInputFn:this.maskInputFn})),ml(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let n=this.attributes.find(t=>t.node===e.target);if("IFRAME"===t.tagName&&"src"===e.attributeName&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;e.attributeName="rr_src"}if(n||(n={node:e.target,attributes:{}},this.attributes.push(n)),"style"===e.attributeName){const r=this.doc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue),void 0!==n.attributes.style&&null!==n.attributes.style||(n.attributes.style={});const o=n.attributes.style;for(const e of Array.from(t.style)){const n=t.style.getPropertyValue(e),s=t.style.getPropertyPriority(e);n===r.style.getPropertyValue(e)&&s===r.style.getPropertyPriority(e)||(o[e]=""===s?n:[n,s])}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(o[e]=!1)}else n.attributes[e.attributeName]=tl(this.doc,t.tagName,e.attributeName,r);break}case"childList":if(ml(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),n=La(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);ml(e.target,this.blockClass,this.blockSelector,!1)||gl(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(xl(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||yl(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ol(r,n)]?xl(this.movedSet,t):this.removes.push({parentId:n,id:r,isShadow:!(!La(e.target)||!Da(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if(gl(e,this.mirror))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Ol(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ml(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach(e=>this.genAdds(e))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function xl(e,t){e.delete(t),t.childNodes.forEach(t=>xl(e,t))}function Nl(e,t,r){return 0!==e.length&&Ml(e,t,r)}function Ml(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return!!e.some(e=>e.id===o)||Ml(e,n,r)}function Ll(e,t){return 0!==e.size&&Dl(e,t)}function Dl(e,t){const{parentNode:r}=t;return!!r&&(!!e.has(r)||Dl(e,r))}const Pl=[],Fl="undefined"!=typeof CSSGroupingRule,Bl="undefined"!=typeof CSSMediaRule,Ul="undefined"!=typeof CSSSupportsRule,Zl="undefined"!=typeof CSSConditionRule;function jl(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function zl(e,t){var r,n;const o=new Rl;Pl.push(o),o.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const i=null===(n=null===(r=null===window||void 0===window?void 0:window.Zone)||void 0===r?void 0:r.__symbol__)||void 0===n?void 0:n.call(r,"MutationObserver");i&&window[i]&&(s=window[i]);const a=new s(o.processMutations.bind(o));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Vl({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:s}){if(!1===s.mouseInteraction)return()=>{};const i=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,a=[];return Object.keys(Al).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(s=>{const i=s.toLowerCase(),l=(t=>s=>{const i=jl(s);if(ml(i,n,o,!0))return;const a=bl(s)?s.changedTouches[0]:s;if(!a)return;const l=r.getId(i),{clientX:c,clientY:u}=a;e({type:Al[t],id:l,x:c,y:u})})(s);a.push(al(i,l,t))}),()=>{a.forEach(e=>e())}}function Gl({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:s}){return al("scroll",ul(s=>{const i=jl(s);if(!i||ml(i,n,o,!0))return;const a=r.getId(i);if(i===t){const r=t.scrollingElement||t.documentElement;e({id:a,x:r.scrollLeft,y:r.scrollTop})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})},s.scroll||100),t)}function Wl(e,t){const r=Object.assign({},e);return t||delete r.userTriggered,r}const Hl=["INPUT","TEXTAREA","SELECT"],Yl=new WeakMap;function Kl(e){return function(e,t){if(Fl&&e.parentRule instanceof CSSGroupingRule||Bl&&e.parentRule instanceof CSSMediaRule||Ul&&e.parentRule instanceof CSSSupportsRule||Zl&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function Jl(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function Xl({mirror:e,stylesheetManager:t},r){var n,o,s;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(r.host);const a="#document"===r.nodeName?null===(n=r.defaultView)||void 0===n?void 0:n.Document:null===(s=null===(o=r.ownerDocument)||void 0===o?void 0:o.defaultView)||void 0===s?void 0:s.ShadowRoot,l=Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets");return null!==i&&-1!==i&&a&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null===(e=l.get)||void 0===e?void 0:e.call(this)},set(e){var r;const n=null===(r=l.set)||void 0===r?void 0:r.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(e){}return n}}),()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}):()=>{}}function ql(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};!function(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:h,fontCb:p,selectionCb:d}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),n(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),s(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),h(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),d(...e)}}(e,t);const n=zl(e,e.doc),o=function({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,s="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=ul(t=>{const r=Date.now()-i;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],i=null},s),c=ul(e=>{const t=jl(e),{clientX:r,clientY:o}=bl(e)?e.changedTouches[0]:e;i||(i=Date.now()),a.push({x:r,y:o,id:n.getId(t),timeOffset:Date.now()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Il.Drag:e instanceof MouseEvent?Il.MouseMove:Il.TouchMove)},o,{trailing:!1}),u=[al("mousemove",c,r),al("touchmove",c,r),al("drag",c,r)];return()=>{u.forEach(e=>e())}}(e),s=Vl(e),i=Gl(e),a=function({viewportResizeCb:e}){let t=-1,r=-1;return al("resize",ul(()=>{const n=dl(),o=fl();t===n&&r===o||(e({width:Number(o),height:Number(n)}),t=n,r=o)},200),window)}(e),l=function({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:s,maskInputOptions:i,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function u(e){let r=jl(e);const l=e.isTrusted;if(r&&"OPTION"===r.tagName&&(r=r.parentElement),!r||!r.tagName||Hl.indexOf(r.tagName)<0||ml(r,n,o,!0))return;const u=r.type;if(r.classList.contains(s))return;let p=r.value,d=!1;"radio"===u||"checkbox"===u?d=r.checked:(i[r.tagName.toLowerCase()]||i[u])&&(p=Ua({maskInputOptions:i,tagName:r.tagName,type:u,value:p,maskInputFn:a})),h(r,Wl({text:p,isChecked:d,userTriggered:l},c));const f=r.name;"radio"===u&&f&&d&&t.querySelectorAll(`input[type="radio"][name="${f}"]`).forEach(e=>{e!==r&&h(e,Wl({text:e.value,isChecked:!d,userTriggered:!1},c))})}function h(t,n){const o=Yl.get(t);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){Yl.set(t,n);const o=r.getId(t);e(Object.assign(Object.assign({},n),{id:o}))}}const p=("last"===l.input?["change"]:["input","change"]).map(e=>al(e,u,t)),d=t.defaultView;if(!d)return()=>{p.forEach(e=>e())};const f=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),m=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&p.push(...m.map(e=>hl(e[0],e[1],{set(){u({target:this})}},!1,d))),()=>{p.forEach(e=>e())}}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o}){const s=s=>ul(o=>{const i=jl(o);if(!i||ml(i,t,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u}=i;e({type:s,id:n.getId(i),currentTime:a,volume:l,muted:c,playbackRate:u})},o.media||500),i=[al("play",s(0)),al("pause",s(1)),al("seeked",s(2)),al("volumechange",s(3)),al("ratechange",s(4))];return()=>{i.forEach(e=>e())}}(e),u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){const o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=function(n,s){const{id:i,styleId:a}=Jl(this,t,r.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:n,index:s}]}),o.apply(this,[n,s])};const s=n.CSSStyleSheet.prototype.deleteRule;let i,a;n.CSSStyleSheet.prototype.deleteRule=function(n){const{id:o,styleId:i}=Jl(this,t,r.styleMirror);return(o&&-1!==o||i&&-1!==i)&&e({id:o,styleId:i,removes:[{index:n}]}),s.apply(this,[n])},n.CSSStyleSheet.prototype.replace&&(i=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=function(n){const{id:o,styleId:s}=Jl(this,t,r.styleMirror);return(o&&-1!==o||s&&-1!==s)&&e({id:o,styleId:s,replace:n}),i.apply(this,[n])}),n.CSSStyleSheet.prototype.replaceSync&&(a=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=function(n){const{id:o,styleId:s}=Jl(this,t,r.styleMirror);return(o&&-1!==o||s&&-1!==s)&&e({id:o,styleId:s,replaceSync:n}),a.apply(this,[n])});const l={};Fl?l.CSSGroupingRule=n.CSSGroupingRule:(Bl&&(l.CSSMediaRule=n.CSSMediaRule),Zl&&(l.CSSConditionRule=n.CSSConditionRule),Ul&&(l.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(l).forEach(([n,o])=>{c[n]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=function(o,s){const{id:i,styleId:a}=Jl(this.parentStyleSheet,t,r.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:o,index:[...Kl(this),s||0]}]}),c[n].insertRule.apply(this,[o,s])},o.prototype.deleteRule=function(o){const{id:s,styleId:i}=Jl(this.parentStyleSheet,t,r.styleMirror);return(s&&-1!==s||i&&-1!==i)&&e({id:s,styleId:i,removes:[{index:[...Kl(this),o]}]}),c[n].deleteRule.apply(this,[o])}}),()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=s,i&&(n.CSSStyleSheet.prototype.replace=i),a&&(n.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})}}(e,{win:r}),h=Xl(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){const s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(o,i,a){var l;if(r.has(o))return s.apply(this,[o,i,a]);const{id:c,styleId:u}=Jl(null===(l=this.parentRule)||void 0===l?void 0:l.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||u&&-1!==u)&&e({id:c,styleId:u,set:{property:o,value:i,priority:a},index:Kl(this.parentRule)}),s.apply(this,[o,i,a])};const i=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(o){var s;if(r.has(o))return i.apply(this,[o]);const{id:a,styleId:l}=Jl(null===(s=this.parentRule)||void 0===s?void 0:s.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,remove:{property:o},index:Kl(this.parentRule)}),i.apply(this,[o])},()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=i}}(e,{win:r}),d=e.collectFonts?function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,s=r.FontFace;r.FontFace=function(e,t,r){const n=new s(e,t,r);return o.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};const i=pl(t.fonts,"add",function(t){return function(r){return setTimeout(()=>{const t=o.get(r);t&&(e(t),o.delete(r))},0),t.apply(this,[r])}});return n.push(()=>{r.FontFace=s}),n.push(i),()=>{n.forEach(e=>e())}}(e):()=>{},f=function(e){const{doc:t,mirror:r,blockClass:n,blockSelector:o,selectionCb:s}=e;let i=!0;const a=()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const s=e.getRangeAt(t),{startContainer:i,startOffset:l,endContainer:c,endOffset:u}=s;ml(i,n,o,!0)||ml(c,n,o,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:u})}s({ranges:a})};return a(),al("selectionchange",a)}(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,r,t.options));return()=>{Pl.forEach(e=>e.reset()),n.disconnect(),o(),s(),i(),a(),l(),c(),u(),h(),p(),d(),f(),m.forEach(e=>e())}}class Ql{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,r,n){const o=r||this.getIdToRemoteIdMap(e),s=n||this.getRemoteIdToIdMap(e);let i=o.get(t);return i||(i=this.generateIdFn(),o.set(t,i),s.set(i,t)),i}getIds(e,t){const r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,r,n))}getRemoteId(e,t,r){const n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=n.get(t);return o||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,r))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class $l{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ql(Wa),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ql(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(r=this.loadListener)||void 0===r||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){if("rrweb"===e.data.type){if(!e.source)return;const t=this.crossOriginIframeMap.get(e.source);if(!t)return;const r=this.transformCrossOriginEvent(t,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}transformCrossOriginEvent(e,t){var r;switch(t.type){case _l.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:_l.IncrementalSnapshot,data:{source:Il.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case _l.Meta:case _l.Load:case _l.DomContentLoaded:return!1;case _l.Plugin:return t;case _l.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case _l.IncrementalSnapshot:switch(t.data.source){case Il.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Il.Drag:case Il.TouchMove:case Il.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Il.ViewportResize:return!1;case Il.MediaInteraction:case Il.MouseInteraction:case Il.Scroll:case Il.CanvasMutation:case Il.Input:return this.replaceIds(t.data,e,["id"]),t;case Il.StyleSheetRule:case Il.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Il.Font:return t;case Il.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Il.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(r=t.data.styles)||void 0===r||r.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}}replace(e,t,r,n){for(const o of n)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(r,t[o]):t[o]=e.getId(r,t[o]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}}class ec{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(pl(Element.prototype,"attachShadow",function(e){return function(r){const n=e.call(this,r);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}}))}addShadowRoot(e,t){Da(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),zl(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Gl(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),Xl({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)},0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(pl(e.contentWindow.HTMLElement.prototype,"attachShadow",function(r){return function(n){const o=r.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),o}}))}}reset(){this.restorePatches.forEach(e=>e()),this.shadowDoms=new WeakSet}}
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,10 +12,10 @@
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,s){function o(e){try{a(n.next(e))}catch(e){s(e)}}function i(e){try{a(n.throw(e))}catch(e){s(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(o,i)}a((n=n.apply(e,[])).next())})}for(var rc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),sc=0;sc<64;sc++)nc[rc.charCodeAt(sc)]=sc;const oc=new Map;const ic=(e,t,r)=>{if(!e||!cc(e,t)&&"object"!=typeof e)return;const n=function(e,t){let r=oc.get(e);return r||(r=new Map,oc.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let s=n.indexOf(e);return-1===s&&(s=n.length,n.push(e)),s};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,s="";for(t=0;t<n;t+=3)s+=rc[r[t]>>2],s+=rc[(3&r[t])<<4|r[t+1]>>4],s+=rc[(15&r[t+1])<<2|r[t+2]>>6],s+=rc[63&r[t+2]];return n%3==2?s=s.substring(0,s.length-1)+"=":n%3==1&&(s=s.substring(0,s.length-2)+"=="),s}(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 s=pl(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(n,...s){return ml(this,t,r,!0)||"__context"in this||(this.__context=n),e.apply(this,[n,...s])}});n.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(e=>e())}}function hc(e,t,r,n,s,o,i){const a=[],l=Object.getOwnPropertyNames(e);for(const o of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(o))try{if("function"!=typeof e[o])continue;const l=pl(e,o,function(e){return function(...a){const l=e.apply(this,a);if(ic(l,i,this),!ml(this.canvas,n,s,!0)){const e=lc([...a],i,this),n={type:t,property:o,args:e};r(this.canvas,n)}return l}});a.push(l)}catch(n){const s=hl(e,o,{set(e){r(this.canvas,{type:t,property:o,args:[e],setter:!0})}});a.push(s)}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),s=n.indexOf("\n",10)+1,o=n.substring(s)+"";return function(e){return new pc(o,Object.assign({},e,{eval:!0}))}}function mc(e,t,r){var n=function(e){return atob(e)}(e),s=n.indexOf("\n",10)+1,o=n.substring(s)+"",i=new Blob([o],{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:s,recordCanvas:o,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,s),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,s,{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,s){const o=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:s,height:o}=e.data;this.mutationCb({id:t,type:El["2D"],commands:[{property:"clearRect",args:[0,0,s,o]},{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:s.dataURLOptions},[n])}))),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const n=uc(e,t,r),s=function(e,t,r,n){const s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const o=pl(t.CanvasRenderingContext2D.prototype,i,function(s){return function(...o){return ml(this.canvas,r,n,!0)||setTimeout(()=>{const r=lc([...o],t,this);e(this.canvas,{type:El["2D"],property:i,args:r})},0),s.apply(this,o)}});s.push(o)}catch(r){const n=hl(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:El["2D"],property:i,args:[t],setter:!0})}});s.push(n)}return()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,n){const s=[];return s.push(...hc(t.WebGLRenderingContext.prototype,El.WebGL,e,r,n,0,t)),void 0!==t.WebGL2RenderingContext&&s.push(...hc(t.WebGL2RenderingContext.prototype,El.WebGL2,e,r,n,0,t)),()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r,this.mirror);this.resetObservers=()=>{n(),s(),o()}}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 s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]])}return r}(e,["type"]);return t}),{type:s}=r[0];this.mutationCb({id:t,type:s,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:s="rr-block",blockSelector:o=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,s)=>{var o;if(!(null===(o=Pl[0])||void 0===o?void 0:o.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),s);else if(O){const t={type:"rrweb",event:L(e),isCheckout:s};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,s=r&&e.timestamp-N.timestamp>r;(t||s)&&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:s,blockSelector:o,mirror:Ac,sampling:y.canvas,dataURLOptions:b});const Z=new ec({mutationCb:D,scrollCb:P,bypassOptions:{blockClass:s,blockSelector:o,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,s=void 0===n?new Ba:n,o=r.blockClass,i=void 0===o?"rr-block":o,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:s,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:s,blockSelector:o,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:s,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:o,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 s=+n[1],o=+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]||s!==c?a(e):0===s?o===u&&i<=h?l(e):a(e):o<=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 s;void 0===n&&(n=!1);var o=Lc[Mc]=null!==(s=Lc[Mc])&&void 0!==s?s:{version:Oc};if(!n&&o[e]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(i.stack||i.message),!1}if(o.version!==Oc){i=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+e+" does not match previously registered API v"+Oc);return r.error(i.stack||i.message),!1}return o[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,s,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}return i},Zc=function(e,t,r){if(r||2===arguments.length)for(var n,s=0,o=t.length;s<o;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);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,s,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}return i},Gc=function(e,t,r){if(r||2===arguments.length)for(var n,s=0,o=t.length;s<o;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);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,s,o;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 s=t[r];return"function"==typeof s&&e>=n?s.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!==(s=r.logLevel)&&void 0!==s?s:Bc.INFO,e);if(a&&!r.suppressOverrideMessage){var c=null!==(o=(new Error).stack)&&void 0!==o?o:"<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,s,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.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=[],s=0;s<arguments.length;s++)n[s]=arguments[s];var o=new e(this._entries);try{for(var i=Yc(n),a=i.next();!a.done;a=i.next()){var l=a.value;o._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 o},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 s=new e(r._currentContext);return s._currentContext.set(t,n),s},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)}),su=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}(),ou=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}(ou),au=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t.prototype.add=function(e,t){},t}(ou),lu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t.prototype.record=function(e,t){},t}(ou),cu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return nu(t,e),t.prototype.record=function(e,t){},t}(ou),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 su,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,s,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}return i},Au=function(e,t,r){if(r||2===arguments.length)for(var n,s=0,o=t.length;s<o;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);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=[],s=3;s<arguments.length;s++)n[s-3]=arguments[s];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,s,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}return i},ku=function(e,t,r){if(r||2===arguments.length)for(var n,s=0,o=t.length;s<o;s++)!n&&s in t||(n||(n=Array.prototype.slice.call(t,0,s)),n[s]=t[s]);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,s=[],o=3;o<arguments.length;o++)s[o-3]=arguments[o];return(n=this._getContextManager()).with.apply(n,ku([e,t,r],Tu(s),!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,s=r&&zu(r);return"object"==typeof(n=s)&&"string"==typeof n.spanId&&"string"==typeof n.traceId&&"number"==typeof n.traceFlags&&Hu(s)?new Du(s):new Du},e.prototype.startActiveSpan=function(e,t,r,n){var s,o,i;if(!(arguments.length<2)){2===arguments.length?i=t:3===arguments.length?(s=t,i=r):(s=t,o=r,i=n);var a=null!=o?o:Ku.active(),l=this.startSpan(e,s,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 s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,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(),sh=Wc.instance(),oh=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)||oh},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 s=decodeURIComponent(r.substring(0,n).trim()),o=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:s,value:o,metadata:i}}class Ih{inject(e,t,r){const n=yh.getBaggage(e);if(!n||Ch(e))return;const s=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),o=function(e){return e.reduce((e,t)=>{const r=`${e}${""!==e?",":""}${t}`;return r.length>8192?e:r},"")}(s);o.length>0&&r.set(t,Sh,o)}extract(e,t,r){const n=r.get(t,Sh),s=Array.isArray(n)?n.join(","):n;if(!s)return e;const o={};if(0===s.length)return e;return s.split(",").forEach(e=>{const t=_h(e);if(t){const e={value:t.value};t.metadata&&(e.metadata=t.metadata),o[t.key]=e}}),0===Object.entries(o).length?e:yh.setBaggage(e,yh.createBaggage(o))}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:sh.warn(`Invalid attribute value set for key: ${r}`):sh.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=>{sh.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 sp(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 sp(e,t){const r=[e[0]+t[0],e[1]+t[1]];return r[1]>=Xh&&(r[1]-=Xh,r[0]+=1),r}var op;!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(op||(op={}));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){sh.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){sh.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 s=r.slice(0,n),o=r.slice(n+1,t.length);(function(e){return lp.test(e)})(s)&&function(e){return cp.test(e)&&!up.test(e)}(o)&&e.set(s,o)}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 s=`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||eu.NONE).toString(16)}`;r.set(t,pp,s),n.traceState&&r.set(t,dp,n.traceState.serialize())}extract(e,t,r){const n=r.get(t,pp);if(!n)return e;const s=Array.isArray(n)?n[0]:n;if("string"!=typeof s)return e;const o=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}(s);if(!o)return e;o.isRemote=!0;const i=r.get(t,dp);if(i){const e=Array.isArray(i)?i.join(","):i;o.traceState=new hp("string"==typeof e?e:void 0)}return vh.setSpanContext(e,o)}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 s=Ip.call(e);n&&(t?e[_p]=r:delete e[_p]);return s}(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 s;if(!(r>20)){if(r++,Np(e)||Np(t)||Rp(t))s=Ep(t);else if(Op(e)){if(s=e.slice(),Op(t))for(let e=0,r=t.length;e<r;e++)s.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];s[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;s=Object.assign({},e);const o=Object.keys(t);for(let i=0,a=o.length;i<a;i++){const a=o[i],l=t[a];if(Np(l))void 0===l?delete s[a]:s[a]=l;else{const o=s[a],i=l;if(kp(e,a,n)||kp(t,a,n))delete s[a];else{if(xp(o)&&xp(i)){const r=n.get(o)||[],s=n.get(i)||[];r.push({obj:e,key:a}),s.push({obj:t,key:a}),n.set(o,r),n.set(i,s)}s[a]=Tp(s[a],l,r,n)}}}}else s=t;return s}}function kp(e,t,r){const n=r.get(e[t])||[];for(let r=0,s=n.length;r<s;r++){const s=n[r];if(s.key===t&&s.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&&sh.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[t,r]of this._rawAttributes)Fp(r)?sh.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=>{sh.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 sh.warn(`Invalid attribute key: ${e}`),this;if(!Th(t))return sh.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 sh.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==n&&this.events.length>=n&&(0===this._droppedEventsCount&&sh.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),np(t)&&(np(r)||(r=t),t=void 0);const s=Ah(t);return this.events.push({name:e,attributes:s,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&&(sh.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()?sh.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&&(sh.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&&sh.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 sp(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):sh.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}}`);sh.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?(sh.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,s,o){const i=vh.getSpanContext(e);return i&&Hu(i)?i.isRemote?i.traceFlags&eu.SAMPLED?this._remoteParentSampled.shouldSample(e,t,r,n,s,o):this._remoteParentNotSampled.shouldSample(e,t,r,n,s,o):i.traceFlags&eu.SAMPLED?this._localParentSampled.shouldSample(e,t,r,n,s,o):this._localParentNotSampled.shouldSample(e,t,r,n,s,o):this._root.shouldSample(e,t,r,n,s,o)}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 sh.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "parentbased_always_on".`),new Wp({root:new Gp})}}function Jp(){return sh.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&&(sh.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&&sh.debug("maxQueueSize reached, dropping spans"),void this._droppedSpansCount++;this._droppedSpansCount>0&&(sh.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 s=()=>this._exporter.export(n,n=>{clearTimeout(r),n.code===op.SUCCESS?e():t(n.error??new Error("BatchSpanProcessor: span export failed"))});let o=null;for(let e=0,t=n.length;e<t;e++){const t=n[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(o??=[],o.push(t.resource.waitForAsyncAttributes()))}null===o?s():Promise.all(o).then(s,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 s=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=s.sampler,this._generalLimits=s.generalLimits,this._spanLimits=s.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)){sh.debug("Instrumentation suppressed, returning Noop Span");return vh.wrapSpanContext(Lu)}const s=n?.spanContext(),o=this._idGenerator.generateSpanId();let i,a,l;s&&vh.isSpanContextValid(s)?(a=s.traceId,l=s.traceState,i=s):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:o,traceFlags:p.decision===Xu.RECORD_AND_SAMPLED?eu.SAMPLED:eu.NONE,traceState:l};if(p.decision===Xu.NOT_RECORD){sh.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 s,o,i;if(arguments.length<2)return;2===arguments.length?i=t:3===arguments.length?(s=t,i=r):(s=t,o=r,i=n);const a=o??nh.active(),l=this.startSpan(e,s,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 sd,od;!function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"}(sd||(sd={}));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 s=setTimeout(()=>{r(new Error(`Span processor did not completed within timeout period of ${e} ms`)),n=sd.timeout},e);t.forceFlush().then(()=>{clearTimeout(s),n!==sd.timeout&&(n=sd.resolved,r(n))}).catch(e=>{clearTimeout(s),n=sd.error,r(e)})}));return new Promise((e,r)=>{Promise.all(t).then(t=>{const n=t.filter(e=>e!==sd.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 s=this._currentContext;this._currentContext=e||ru;try{return t.call(r,...n)}finally{this._currentContext=s}}}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"}(od||(od={}));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,s){if(void 0===n&&(n=0!==t[od.START_TIME]),r||(hd(e,od.FETCH_START,t,n),hd(e,od.DOMAIN_LOOKUP_START,t,n),hd(e,od.DOMAIN_LOOKUP_END,t,n),hd(e,od.CONNECT_START,t,n),hd(e,od.SECURE_CONNECTION_START,t,n),hd(e,od.CONNECT_END,t,n),hd(e,od.REQUEST_START,t,n),hd(e,od.RESPONSE_START,t,n),hd(e,od.RESPONSE_END,t,n)),!s){const r=t[od.ENCODED_BODY_SIZE];void 0!==r&&e.setAttribute("http.response_content_length",r);const n=t[od.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,s=new WeakSet,o){const i=md(e),a=function(e,t,r,n,s,o){const i=tp(t),a=tp(r);let l=n.filter(t=>{const r=tp(ep(t[od.FETCH_START])),n=tp(ep(t[od.RESPONSE_END]));return t.initiatorType.toLowerCase()===(o||"xmlhttprequest")&&t.name===e&&r>=i&&n<=a});l.length>0&&(l=l.filter(e=>!s.has(e)));return l}(e=i.toString(),t,r,n,s,o);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[od.FETCH_START],n=t[od.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),s=tp(ep(t));let o,i=e[1];const a=e.length;for(let t=1;t<a;t++){const r=e[t],a=tp(ep(r[od.FETCH_START])),l=n-tp(ep(r[od.RESPONSE_END]));a>=s&&(!o||l<o)&&(o=l,i=r)}return i}(l,e[od.RESPONSE_END],r);const n=e[od.RESPONSE_END];return t[od.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 s=r(n,t);return kd(s,"__original",n),kd(s,"__unwrap",()=>{e[t]===s&&kd(e,t,n)}),kd(s,"__wrapped",!0),kd(e,t,s),s},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=sh.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,s;try{s=e()}catch(e){n=e}finally{return t(n,s),s}}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(od).forEach(r=>{if(ud(t,r)){const n=t[r];"number"==typeof n&&(e[r]=n)}});else{const t=Nh.timing;t&&Object.values(od).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,od.FETCH_START,t);e&&(nh.with(vh.setSpan(nh.active(),e),()=>{const e=this._startSpan(Bd.DOCUMENT_FETCH,od.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,od.RESPONSE_END,t)}))}),e.setAttribute(Mh,location.href),e.setAttribute("http.user_agent",navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(hd(e,od.FETCH_START,t),hd(e,od.UNLOAD_EVENT_START,t),hd(e,od.UNLOAD_EVENT_END,t),hd(e,od.DOM_INTERACTIVE,t),hd(e,od.DOM_CONTENT_LOADED_EVENT_START,t),hd(e,od.DOM_CONTENT_LOADED_EVENT_END,t),hd(e,od.DOM_COMPLETE,t),hd(e,od.LOAD_EVENT_START,t),hd(e,od.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,od.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,od.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,od.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(s,o,i){void 0===e.__ot_listeners&&(e.__ot_listeners={});let a=e.__ot_listeners[s];void 0===a&&(a=new WeakMap,e.__ot_listeners[s]=a);const l=n.bind(r,o);return a.set(o,l),t.call(this,s,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 s=e.__ot_listeners[r],o=s.get(n);return s.delete(n),t.call(this,r,o||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 s=this._createZoneName();return this._createZone(s,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/
19
19
  * License: MIT
20
- */const Wd=globalThis;function Hd(e){return(Wd.__Zone_symbol_prefix||"__zone_symbol__")+e}const Yd=Object.getOwnPropertyDescriptor,Kd=Object.defineProperty,Jd=Object.getPrototypeOf,Xd=Object.create,qd=Array.prototype.slice,Qd="addEventListener",$d="removeEventListener",ef=Hd(Qd),tf=Hd($d),rf="true",nf="false",sf=Hd("");function of(e,t){return Zone.current.wrap(e,t)}function af(e,t,r,n,s){return Zone.current.scheduleMacroTask(e,t,r,n,s)}const lf=Hd,cf="undefined"!=typeof window,uf=cf?window:void 0,hf=cf&&uf||globalThis;function pf(e,t){for(let r=e.length-1;r>=0;r--)"function"==typeof e[r]&&(e[r]=of(e[r],t+"_"+r));return e}function df(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&void 0===e.set)}const ff="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,mf=!("nw"in hf)&&void 0!==hf.process&&"[object process]"===hf.process.toString(),gf=!mf&&!ff&&!(!cf||!uf.HTMLElement),yf=void 0!==hf.process&&"[object process]"===hf.process.toString()&&!ff&&!(!cf||!uf.HTMLElement),bf={},vf=lf("enable_beforeunload"),wf=function(e){if(!(e=e||hf.event))return;let t=bf[e.type];t||(t=bf[e.type]=lf("ON_PROPERTY"+e.type));const r=this||e.target||hf,n=r[t];let s;if(gf&&r===uf&&"error"===e.type){const t=e;s=n&&n.call(this,t.message,t.filename,t.lineno,t.colno,t.error),!0===s&&e.preventDefault()}else s=n&&n.apply(this,arguments),"beforeunload"===e.type&&hf[vf]&&"string"==typeof s?e.returnValue=s:null==s||s||e.preventDefault();return s};function Cf(e,t,r){let n=Yd(e,t);if(!n&&r){Yd(r,t)&&(n={enumerable:!0,configurable:!0})}if(!n||!n.configurable)return;const s=lf("on"+t+"patched");if(e.hasOwnProperty(s)&&e[s])return;delete n.writable,delete n.value;const o=n.get,i=n.set,a=t.slice(2);let l=bf[a];l||(l=bf[a]=lf("ON_PROPERTY"+a)),n.set=function(t){let r=this;if(r||e!==hf||(r=hf),!r)return;"function"==typeof r[l]&&r.removeEventListener(a,wf),i?.call(r,null),r[l]=t,"function"==typeof t&&r.addEventListener(a,wf,!1)},n.get=function(){let r=this;if(r||e!==hf||(r=hf),!r)return null;const s=r[l];if(s)return s;if(o){let e=o.call(this);if(e)return n.set.call(this,e),"function"==typeof r.removeAttribute&&r.removeAttribute(t),e}return null},Kd(e,t,n),e[s]=!0}function Sf(e,t,r){if(t)for(let n=0;n<t.length;n++)Cf(e,"on"+t[n],r);else{const t=[];for(const r in e)"on"==r.slice(0,2)&&t.push(r);for(let n=0;n<t.length;n++)Cf(e,t[n],r)}}const _f=lf("originalInstance");function If(e){const t=hf[e];if(!t)return;hf[lf(e)]=t,hf[e]=function(){const r=pf(arguments,e);switch(r.length){case 0:this[_f]=new t;break;case 1:this[_f]=new t(r[0]);break;case 2:this[_f]=new t(r[0],r[1]);break;case 3:this[_f]=new t(r[0],r[1],r[2]);break;case 4:this[_f]=new t(r[0],r[1],r[2],r[3]);break;default:throw new Error("Arg list too long.")}},Tf(hf[e],t);const r=new t(function(){});let n;for(n in r)"XMLHttpRequest"===e&&"responseBlob"===n||function(t){"function"==typeof r[t]?hf[e].prototype[t]=function(){return this[_f][t].apply(this[_f],arguments)}:Kd(hf[e].prototype,t,{set:function(r){"function"==typeof r?(this[_f][t]=of(r,e+"."+t),Tf(this[_f][t],r)):this[_f][t]=r},get:function(){return this[_f][t]}})}(n);for(n in t)"prototype"!==n&&t.hasOwnProperty(n)&&(hf[e][n]=t[n])}function Af(e,t,r){let n=e;for(;n&&!n.hasOwnProperty(t);)n=Jd(n);!n&&e[t]&&(n=e);const s=lf(t);let o=null;if(n&&(!(o=n[s])||!n.hasOwnProperty(s))){o=n[s]=n[t];if(df(n&&Yd(n,t))){const e=r(o,s,t);n[t]=function(){return e(this,arguments)},Tf(n[t],o)}}return o}function Ef(e,t,r){let n=null;function s(e){const t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},n.apply(t.target,t.args),e}n=Af(e,t,e=>function(t,n){const o=r(t,n);return o.cbIdx>=0&&"function"==typeof n[o.cbIdx]?af(o.name,n[o.cbIdx],o,s):e.apply(t,n)})}function Tf(e,t){e[lf("OriginalDelegate")]=t}let kf=!1,Of=!1;function Rf(){if(kf)return Of;kf=!0;try{const e=uf.navigator.userAgent;-1===e.indexOf("MSIE ")&&-1===e.indexOf("Trident/")&&-1===e.indexOf("Edge/")||(Of=!0)}catch(e){}return Of}function xf(e){return"function"==typeof e}function Nf(e){return"number"==typeof e}const Mf={useG:!0},Lf={},Df={},Pf=new RegExp("^"+sf+"(\\w+)(true|false)$"),Ff=lf("propagationStopped");function Bf(e,t){const r=(t?t(e):e)+nf,n=(t?t(e):e)+rf,s=sf+r,o=sf+n;Lf[e]={},Lf[e][nf]=s,Lf[e][rf]=o}function Uf(e,t,r,n){const s=n&&n.add||Qd,o=n&&n.rm||$d,i=n&&n.listeners||"eventListeners",a=n&&n.rmAll||"removeAllListeners",l=lf(s),c="."+s+":",u="prependListener",h="."+u+":",p=function(e,t,r){if(e.isRemoved)return;const n=e.callback;let s;"object"==typeof n&&n.handleEvent&&(e.callback=e=>n.handleEvent(e),e.originalDelegate=n);try{e.invoke(e,t,[r])}catch(e){s=e}const i=e.options;if(i&&"object"==typeof i&&i.once){const n=e.originalDelegate?e.originalDelegate:e.callback;t[o].call(t,r.type,n,i)}return s};function d(r,n,s){if(!(n=n||e.event))return;const o=r||n.target||e,i=o[Lf[n.type][s?rf:nf]];if(i){const e=[];if(1===i.length){const t=p(i[0],o,n);t&&e.push(t)}else{const t=i.slice();for(let r=0;r<t.length&&(!n||!0!==n[Ff]);r++){const s=p(t[r],o,n);s&&e.push(s)}}if(1===e.length)throw e[0];for(let r=0;r<e.length;r++){const n=e[r];t.nativeScheduleMicroTask(()=>{throw n})}}}const f=function(e){return d(this,e,!1)},m=function(e){return d(this,e,!0)};function g(t,r){if(!t)return!1;let n=!0;r&&void 0!==r.useG&&(n=r.useG);const p=r&&r.vh;let d=!0;r&&void 0!==r.chkDup&&(d=r.chkDup);let g=!1;r&&void 0!==r.rt&&(g=r.rt);let y=t;for(;y&&!y.hasOwnProperty(s);)y=Jd(y);if(!y&&t[s]&&(y=t),!y)return!1;if(y[l])return!1;const b=r&&r.eventNameToString,v={},w=y[l]=y[s],C=y[lf(o)]=y[o],S=y[lf(i)]=y[i],_=y[lf(a)]=y[a];let I;r&&r.prepend&&(I=y[lf(r.prepend)]=y[r.prepend]);const A=function(e){return I.call(v.target,v.eventName,e.invoke,v.options)},E=n?function(e){if(!v.isExisting)return w.call(v.target,v.eventName,v.capture?m:f,v.options)}:function(e){return w.call(v.target,v.eventName,e.invoke,v.options)},T=n?function(e){if(!e.isRemoved){const t=Lf[e.eventName];let r;t&&(r=t[e.capture?rf:nf]);const n=r&&e.target[r];if(n)for(let t=0;t<n.length;t++){if(n[t]===e){n.splice(t,1),e.isRemoved=!0,e.removeAbortListener&&(e.removeAbortListener(),e.removeAbortListener=null),0===n.length&&(e.allRemoved=!0,e.target[r]=null);break}}}if(e.allRemoved)return C.call(e.target,e.eventName,e.capture?m:f,e.options)}:function(e){return C.call(e.target,e.eventName,e.invoke,e.options)},k=r?.diff||function(e,t){const r=typeof t;return"function"===r&&e.callback===t||"object"===r&&e.originalDelegate===t},O=Zone[lf("UNPATCHED_EVENTS")],R=e[lf("PASSIVE_EVENTS")];const x=function(t,s,o,i,a=!1,l=!1){return function(){const c=this||e;let u=arguments[0];r&&r.transferEventName&&(u=r.transferEventName(u));let h=arguments[1];if(!h)return t.apply(this,arguments);if(mf&&"uncaughtException"===u)return t.apply(this,arguments);let f=!1;if("function"!=typeof h){if(!h.handleEvent)return t.apply(this,arguments);f=!0}if(p&&!p(t,h,c,arguments))return;const m=!!R&&-1!==R.indexOf(u),g=function(e){if("object"==typeof e&&null!==e){const t={...e};return e.signal&&(t.signal=e.signal),t}return e}(function(e,t){return t?"boolean"==typeof e?{capture:e,passive:!0}:e?"object"==typeof e&&!1!==e.passive?{...e,passive:!0}:e:{passive:!0}:e}(arguments[2],m)),y=g?.signal;if(y?.aborted)return;if(O)for(let e=0;e<O.length;e++)if(u===O[e])return m?t.call(c,u,h,g):t.apply(this,arguments);const w=!!g&&("boolean"==typeof g||g.capture),C=!(!g||"object"!=typeof g)&&g.once,S=Zone.current;let _=Lf[u];_||(Bf(u,b),_=Lf[u]);const I=_[w?rf:nf];let A,E=c[I],T=!1;if(E){if(T=!0,d)for(let e=0;e<E.length;e++)if(k(E[e],h))return}else E=c[I]=[];const x=c.constructor.name,N=Df[x];N&&(A=N[u]),A||(A=x+s+(b?b(u):u)),v.options=g,C&&(v.options.once=!1),v.target=c,v.capture=w,v.eventName=u,v.isExisting=T;const M=n?Mf:void 0;M&&(M.taskData=v),y&&(v.options.signal=void 0);const L=S.scheduleEventTask(A,h,M,o,i);if(y){v.options.signal=y;const e=()=>L.zone.cancelTask(L);t.call(y,"abort",e,{once:!0}),L.removeAbortListener=()=>y.removeEventListener("abort",e)}return v.target=null,M&&(M.taskData=null),C&&(v.options.once=!0),"boolean"!=typeof L.options&&(L.options=g),L.target=c,L.capture=w,L.eventName=u,f&&(L.originalDelegate=h),l?E.unshift(L):E.push(L),a?c:void 0}};return y[s]=x(w,c,E,T,g),I&&(y[u]=x(I,h,A,T,g,!0)),y[o]=function(){const t=this||e;let n=arguments[0];r&&r.transferEventName&&(n=r.transferEventName(n));const s=arguments[2],o=!!s&&("boolean"==typeof s||s.capture),i=arguments[1];if(!i)return C.apply(this,arguments);if(p&&!p(C,i,t,arguments))return;const a=Lf[n];let l;a&&(l=a[o?rf:nf]);const c=l&&t[l];if(c)for(let e=0;e<c.length;e++){const r=c[e];if(k(r,i)){if(c.splice(e,1),r.isRemoved=!0,0===c.length&&(r.allRemoved=!0,t[l]=null,!o&&"string"==typeof n)){t[sf+"ON_PROPERTY"+n]=null}return r.zone.cancelTask(r),g?t:void 0}}return C.apply(this,arguments)},y[i]=function(){const t=this||e;let n=arguments[0];r&&r.transferEventName&&(n=r.transferEventName(n));const s=[],o=Zf(t,b?b(n):n);for(let e=0;e<o.length;e++){const t=o[e];let r=t.originalDelegate?t.originalDelegate:t.callback;s.push(r)}return s},y[a]=function(){const t=this||e;let n=arguments[0];if(n){r&&r.transferEventName&&(n=r.transferEventName(n));const e=Lf[n];if(e){const r=e[nf],s=e[rf],i=t[r],a=t[s];if(i){const e=i.slice();for(let t=0;t<e.length;t++){const r=e[t];let s=r.originalDelegate?r.originalDelegate:r.callback;this[o].call(this,n,s,r.options)}}if(a){const e=a.slice();for(let t=0;t<e.length;t++){const r=e[t];let s=r.originalDelegate?r.originalDelegate:r.callback;this[o].call(this,n,s,r.options)}}}}else{const e=Object.keys(t);for(let t=0;t<e.length;t++){const r=e[t],n=Pf.exec(r);let s=n&&n[1];s&&"removeListener"!==s&&this[a].call(this,s)}this[a].call(this,"removeListener")}if(g)return this},Tf(y[s],w),Tf(y[o],C),_&&Tf(y[a],_),S&&Tf(y[i],S),!0}let y=[];for(let e=0;e<r.length;e++)y[e]=g(r[e],n);return y}function Zf(e,t){if(!t){const r=[];for(let n in e){const s=Pf.exec(n);let o=s&&s[1];if(o&&(!t||o===t)){const t=e[n];if(t)for(let e=0;e<t.length;e++)r.push(t[e])}}return r}let r=Lf[t];r||(Bf(t),r=Lf[t]);const n=e[r[nf]],s=e[r[rf]];return n?s?n.concat(s):n.slice():s?s.slice():[]}function jf(e,t){const r=e.Event;r&&r.prototype&&t.patchMethod(r.prototype,"stopImmediatePropagation",e=>function(t,r){t[Ff]=!0,e&&e.apply(t,r)})}function zf(e,t){t.patchMethod(e,"queueMicrotask",e=>function(e,t){Zone.current.scheduleMicroTask("queueMicrotask",t[0])})}const Vf=lf("zoneTask");function Gf(e,t,r,n){let s=null,o=null;r+=n;const i={};function a(t){const r=t.data;r.args[0]=function(){return t.invoke.apply(this,arguments)};const n=s.apply(e,r.args);return Nf(n)?r.handleId=n:(r.handle=n,r.isRefreshable=xf(n.refresh)),t}function l(t){const{handle:r,handleId:n}=t.data;return o.call(e,r??n)}s=Af(e,t+=n,r=>function(s,o){if(xf(o[0])){const e={isRefreshable:!1,isPeriodic:"Interval"===n,delay:"Timeout"===n||"Interval"===n?o[1]||0:void 0,args:o},r=o[0];o[0]=function(){try{return r.apply(this,arguments)}finally{const{handle:t,handleId:r,isPeriodic:n,isRefreshable:s}=e;n||s||(r?delete i[r]:t&&(t[Vf]=null))}};const s=af(t,o[0],e,a,l);if(!s)return s;const{handleId:c,handle:u,isRefreshable:h,isPeriodic:p}=s.data;if(c)i[c]=s;else if(u&&(u[Vf]=s,h&&!p)){const e=u.refresh;u.refresh=function(){const{zone:t,state:r}=s;return"notScheduled"===r?(s._state="scheduled",t._updateTaskCount(s,1)):"running"===r&&(s._state="scheduling"),e.call(this)}}return u??c??s}return r.apply(e,o)}),o=Af(e,r,t=>function(r,n){const s=n[0];let o;Nf(s)?(o=i[s],delete i[s]):(o=s?.[Vf],o?s[Vf]=null:o=s),o?.type?o.cancelFn&&o.zone.cancelTask(o):t.apply(e,n)})}function Wf(e,t){if(Zone[t.symbol("patchEventTarget")])return;const{eventNames:r,zoneSymbolEventNames:n,TRUE_STR:s,FALSE_STR:o,ZONE_SYMBOL_PREFIX:i}=t.getGlobalObjects();for(let e=0;e<r.length;e++){const t=r[e],a=i+(t+o),l=i+(t+s);n[t]={},n[t][o]=a,n[t][s]=l}const a=e.EventTarget;return a&&a.prototype?(t.patchEventTarget(e,t,[a&&a.prototype]),!0):void 0}function Hf(e,t,r){if(!r||0===r.length)return t;const n=r.filter(t=>t.target===e);if(0===n.length)return t;const s=n[0].ignoreProperties;return t.filter(e=>-1===s.indexOf(e))}function Yf(e,t,r,n){if(!e)return;Sf(e,Hf(e,t,r),n)}function Kf(e){return Object.getOwnPropertyNames(e).filter(e=>e.startsWith("on")&&e.length>2).map(e=>e.substring(2))}function Jf(e,t){if(mf&&!yf)return;if(Zone[e.symbol("patchEvents")])return;const r=t.__Zone_ignore_on_properties;let n=[];if(gf){const e=window;n=n.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);const t=[];Yf(e,Kf(e),r?r.concat(t):r,Jd(e))}n=n.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let e=0;e<n.length;e++){const s=t[n[e]];s?.prototype&&Yf(s.prototype,Kf(s.prototype),r)}}function Xf(e){e.__load_patch("ZoneAwarePromise",(e,t,r)=>{const n=Object.getOwnPropertyDescriptor,s=Object.defineProperty;const o=r.symbol,i=[],a=!1!==e[o("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],l=o("Promise"),c=o("then");r.onUnhandledError=e=>{if(r.showUncaughtError()){const t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},r.microtaskDrainDone=()=>{for(;i.length;){const e=i.shift();try{e.zone.runGuarded(()=>{if(e.throwOriginal)throw e.rejection;throw e})}catch(e){h(e)}}};const u=o("unhandledPromiseRejectionHandler");function h(e){r.onUnhandledError(e);try{const r=t[u];"function"==typeof r&&r.call(this,e)}catch(e){}}function p(e){return e&&"function"==typeof e.then}function d(e){return e}function f(e){return M.reject(e)}const m=o("state"),g=o("value"),y=o("finally"),b=o("parentPromiseValue"),v=o("parentPromiseState"),w=null,C=!0,S=!1;function _(e,t){return r=>{try{T(e,t,r)}catch(t){T(e,!1,t)}}}const I=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},A="Promise resolved with itself",E=o("currentTaskTrace");function T(e,n,o){const l=I();if(e===o)throw new TypeError(A);if(e[m]===w){let c=null;try{"object"!=typeof o&&"function"!=typeof o||(c=o&&o.then)}catch(t){return l(()=>{T(e,!1,t)})(),e}if(n!==S&&o instanceof M&&o.hasOwnProperty(m)&&o.hasOwnProperty(g)&&o[m]!==w)O(o),T(e,o[m],o[g]);else if(n!==S&&"function"==typeof c)try{c.call(o,l(_(e,n)),l(_(e,!1)))}catch(t){l(()=>{T(e,!1,t)})()}else{e[m]=n;const l=e[g];if(e[g]=o,e[y]===y&&n===C&&(e[m]=e[v],e[g]=e[b]),n===S&&o instanceof Error){const e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&s(o,E,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t<l.length;)R(e,l[t++],l[t++],l[t++],l[t++]);if(0==l.length&&n==S){e[m]=0;let n=o;try{throw new Error("Uncaught (in promise): "+function(e){if(e&&e.toString===Object.prototype.toString){return(e.constructor&&e.constructor.name||"")+": "+JSON.stringify(e)}return e?e.toString():Object.prototype.toString.call(e)}(o)+(o&&o.stack?"\n"+o.stack:""))}catch(e){n=e}a&&(n.throwOriginal=!0),n.rejection=o,n.promise=e,n.zone=t.current,n.task=t.currentTask,i.push(n),r.scheduleMicroTask()}}}return e}const k=o("rejectionHandledHandler");function O(e){if(0===e[m]){try{const r=t[k];r&&"function"==typeof r&&r.call(this,{rejection:e[g],promise:e})}catch(e){}e[m]=S;for(let t=0;t<i.length;t++)e===i[t].promise&&i.splice(t,1)}}function R(e,t,r,n,s){O(e);const o=e[m],i=o?"function"==typeof n?n:d:"function"==typeof s?s:f;t.scheduleMicroTask("Promise.then",()=>{try{const n=e[g],s=!!r&&y===r[y];s&&(r[b]=n,r[v]=o);const a=t.run(i,void 0,s&&i!==f&&i!==d?[]:[n]);T(r,!0,a)}catch(e){T(r,!1,e)}},r)}const x=function(){},N=e.AggregateError;class M{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(e){return e instanceof M?e:T(new this(null),C,e)}static reject(e){return T(new this(null),S,e)}static withResolvers(){const e={};return e.promise=new M((t,r)=>{e.resolve=t,e.reject=r}),e}static any(e){if(!e||"function"!=typeof e[Symbol.iterator])return Promise.reject(new N([],"All promises were rejected"));const t=[];let r=0;try{for(let n of e)r++,t.push(M.resolve(n))}catch(e){return Promise.reject(new N([],"All promises were rejected"))}if(0===r)return Promise.reject(new N([],"All promises were rejected"));let n=!1;const s=[];return new M((e,o)=>{for(let i=0;i<t.length;i++)t[i].then(t=>{n||(n=!0,e(t))},e=>{s.push(e),r--,0===r&&(n=!0,o(new N(s,"All promises were rejected")))})})}static race(e){let t,r,n=new this((e,n)=>{t=e,r=n});function s(e){t(e)}function o(e){r(e)}for(let t of e)p(t)||(t=this.resolve(t)),t.then(s,o);return n}static all(e){return M.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof M?this:M).allWithCallback(e,{thenCallback:e=>({status:"fulfilled",value:e}),errorCallback:e=>({status:"rejected",reason:e})})}static allWithCallback(e,t){let r,n,s=new this((e,t)=>{r=e,n=t}),o=2,i=0;const a=[];for(let s of e){p(s)||(s=this.resolve(s));const e=i;try{s.then(n=>{a[e]=t?t.thenCallback(n):n,o--,0===o&&r(a)},s=>{t?(a[e]=t.errorCallback(s),o--,0===o&&r(a)):n(s)})}catch(e){n(e)}o++,i++}return o-=2,0===o&&r(a),s}constructor(e){const t=this;if(!(t instanceof M))throw new Error("Must be an instanceof Promise.");t[m]=w,t[g]=[];try{const r=I();e&&e(r(_(t,C)),r(_(t,S)))}catch(e){T(t,!1,e)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return M}then(e,r){let n=this.constructor?.[Symbol.species];n&&"function"==typeof n||(n=this.constructor||M);const s=new n(x),o=t.current;return this[m]==w?this[g].push(o,s,e,r):R(this,o,s,e,r),s}catch(e){return this.then(null,e)}finally(e){let r=this.constructor?.[Symbol.species];r&&"function"==typeof r||(r=M);const n=new r(x);n[y]=y;const s=t.current;return this[m]==w?this[g].push(s,n,e,e):R(this,s,n,e,e),n}}M.resolve=M.resolve,M.reject=M.reject,M.race=M.race,M.all=M.all;const L=e[l]=e.Promise;e.Promise=M;const D=o("thenPatched");function P(e){const t=e.prototype,r=n(t,"then");if(r&&(!1===r.writable||!r.configurable))return;const s=t.then;t[c]=s,e.prototype.then=function(e,t){const r=new M((e,t)=>{s.call(this,e,t)});return r.then(e,t)},e[D]=!0}return r.patchThen=P,L&&(P(L),Af(e,"fetch",e=>{return t=e,function(e,r){let n=t.apply(e,r);if(n instanceof M)return n;let s=n.constructor;return s[D]||P(s),n};var t})),Promise[t.__symbol__("uncaughtPromiseErrors")]=i,M})}function qf(e,t,r,n,s){const o=Zone.__symbol__(n);if(t[o])return;const i=t[o]=t[n];t[n]=function(o,a,l){return a&&a.prototype&&s.forEach(function(t){const s=`${r}.${n}::`+t,o=a.prototype;try{if(o.hasOwnProperty(t)){const r=e.ObjectGetOwnPropertyDescriptor(o,t);r&&r.value?(r.value=e.wrapWithCurrentZone(r.value,s),e._redefineProperty(a.prototype,t,r)):o[t]&&(o[t]=e.wrapWithCurrentZone(o[t],s))}else o[t]&&(o[t]=e.wrapWithCurrentZone(o[t],s))}catch{}}),i.call(t,o,a,l)},e.attachOriginToPatched(t[n],i)}const Qf=function(){const e=globalThis,t=!0===e[Hd("forceDuplicateZoneCheck")];if(e.Zone&&(t||"function"!=typeof e.Zone.__symbol__))throw new Error("Zone already loaded.");return e.Zone??=function(){const e=Wd.performance;function t(t){e&&e.mark&&e.mark(t)}function r(t,r){e&&e.measure&&e.measure(t,r)}t("Zone");class n{static __symbol__=Hd;static assertZonePatched(){if(Wd.Promise!==E.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let e=n.current;for(;e.parent;)e=e.parent;return e}static get current(){return k.zone}static get currentTask(){return O}static __load_patch(e,s,o=!1){if(E.hasOwnProperty(e)){const t=!0===Wd[Hd("forceDuplicateZoneCheck")];if(!o&&t)throw Error("Already loaded patch: "+e)}else if(!Wd["__Zone_disable_"+e]){const o="Zone:"+e;t(o),E[e]=s(Wd,n,T),r(o,o)}}get parent(){return this._parent}get name(){return this._name}_parent;_name;_properties;_zoneDelegate;constructor(e,t){this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new o(this,this._parent&&this._parent._zoneDelegate,t)}get(e){const t=this.getZoneWith(e);if(t)return t._properties[e]}getZoneWith(e){let t=this;for(;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}fork(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}wrap(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);const r=this._zoneDelegate.intercept(this,e,t),n=this;return function(){return n.runGuarded(r,this,arguments,t)}}run(e,t,r,n){k={parent:k,zone:this};try{return this._zoneDelegate.invoke(this,e,t,r,n)}finally{k=k.parent}}runGuarded(e,t=null,r,n){k={parent:k,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,r,n)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{k=k.parent}}runTask(e,t,r){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||g).name+"; Execution: "+this.name+")");const n=e,{type:s,data:{isPeriodic:o=!1,isRefreshable:i=!1}={}}=e;if(e.state===y&&(s===A||s===I))return;const a=e.state!=w;a&&n._transitionTo(w,v);const l=O;O=n,k={parent:k,zone:this};try{s!=I||!e.data||o||i||(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,n,t,r)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{const t=e.state;if(t!==y&&t!==S)if(s==A||o||i&&t===b)a&&n._transitionTo(v,w,b);else{const e=n._zoneDelegates;this._updateTaskCount(n,-1),a&&n._transitionTo(y,w,y),i&&(n._zoneDelegates=e)}k=k.parent,O=l}}scheduleTask(e){if(e.zone&&e.zone!==this){let t=this;for(;t;){if(t===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);t=t.parent}}e._transitionTo(b,y);const t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(t){throw e._transitionTo(S,b,y),this._zoneDelegate.handleError(this,t),t}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==b&&e._transitionTo(v,b),e}scheduleMicroTask(e,t,r,n){return this.scheduleTask(new i(_,e,t,r,n,void 0))}scheduleMacroTask(e,t,r,n,s){return this.scheduleTask(new i(I,e,t,r,n,s))}scheduleEventTask(e,t,r,n,s){return this.scheduleTask(new i(A,e,t,r,n,s))}cancelTask(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||g).name+"; Execution: "+this.name+")");if(e.state===v||e.state===w){e._transitionTo(C,v,w);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(S,C),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(y,C),e.runCount=-1,e}}_updateTaskCount(e,t){const r=e._zoneDelegates;-1==t&&(e._zoneDelegates=null);for(let n=0;n<r.length;n++)r[n]._updateTaskCount(e.type,t)}}const s={name:"",onHasTask:(e,t,r,n)=>e.hasTask(r,n),onScheduleTask:(e,t,r,n)=>e.scheduleTask(r,n),onInvokeTask:(e,t,r,n,s,o)=>e.invokeTask(r,n,s,o),onCancelTask:(e,t,r,n)=>e.cancelTask(r,n)};class o{get zone(){return this._zone}_zone;_taskCounts={microTask:0,macroTask:0,eventTask:0};_parentDelegate;_forkDlgt;_forkZS;_forkCurrZone;_interceptDlgt;_interceptZS;_interceptCurrZone;_invokeDlgt;_invokeZS;_invokeCurrZone;_handleErrorDlgt;_handleErrorZS;_handleErrorCurrZone;_scheduleTaskDlgt;_scheduleTaskZS;_scheduleTaskCurrZone;_invokeTaskDlgt;_invokeTaskZS;_invokeTaskCurrZone;_cancelTaskDlgt;_cancelTaskZS;_cancelTaskCurrZone;_hasTaskDlgt;_hasTaskDlgtOwner;_hasTaskZS;_hasTaskCurrZone;constructor(e,t,r){this._zone=e,this._parentDelegate=t,this._forkZS=r&&(r&&r.onFork?r:t._forkZS),this._forkDlgt=r&&(r.onFork?t:t._forkDlgt),this._forkCurrZone=r&&(r.onFork?this._zone:t._forkCurrZone),this._interceptZS=r&&(r.onIntercept?r:t._interceptZS),this._interceptDlgt=r&&(r.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=r&&(r.onIntercept?this._zone:t._interceptCurrZone),this._invokeZS=r&&(r.onInvoke?r:t._invokeZS),this._invokeDlgt=r&&(r.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=r&&(r.onInvoke?this._zone:t._invokeCurrZone),this._handleErrorZS=r&&(r.onHandleError?r:t._handleErrorZS),this._handleErrorDlgt=r&&(r.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=r&&(r.onHandleError?this._zone:t._handleErrorCurrZone),this._scheduleTaskZS=r&&(r.onScheduleTask?r:t._scheduleTaskZS),this._scheduleTaskDlgt=r&&(r.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=r&&(r.onScheduleTask?this._zone:t._scheduleTaskCurrZone),this._invokeTaskZS=r&&(r.onInvokeTask?r:t._invokeTaskZS),this._invokeTaskDlgt=r&&(r.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=r&&(r.onInvokeTask?this._zone:t._invokeTaskCurrZone),this._cancelTaskZS=r&&(r.onCancelTask?r:t._cancelTaskZS),this._cancelTaskDlgt=r&&(r.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=r&&(r.onCancelTask?this._zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const n=r&&r.onHasTask,o=t&&t._hasTaskZS;(n||o)&&(this._hasTaskZS=n?r:s,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,r.onScheduleTask||(this._scheduleTaskZS=s,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this._zone),r.onInvokeTask||(this._invokeTaskZS=s,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this._zone),r.onCancelTask||(this._cancelTaskZS=s,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this._zone))}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new n(e,t)}intercept(e,t,r){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,r):t}invoke(e,t,r,n,s){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,r,n,s):t.apply(r,n)}handleError(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)}scheduleTask(e,t){let r=t;if(this._scheduleTaskZS)this._hasTaskZS&&r._zoneDelegates.push(this._hasTaskDlgtOwner),r=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),r||(r=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=_)throw new Error("Task is missing scheduleFn.");f(t)}return r}invokeTask(e,t,r,n){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,r,n):t.callback.apply(r,n)}cancelTask(e,t){let r;if(this._cancelTaskZS)r=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");r=t.cancelFn(t)}return r}hasTask(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(t){this.handleError(e,t)}}_updateTaskCount(e,t){const r=this._taskCounts,n=r[e],s=r[e]=n+t;if(s<0)throw new Error("More tasks executed then were scheduled.");if(0==n||0==s){const t={microTask:r.microTask>0,macroTask:r.macroTask>0,eventTask:r.eventTask>0,change:e};this.hasTask(this._zone,t)}}}class i{type;source;invoke;callback;data;scheduleFn;cancelFn;_zone=null;runCount=0;_zoneDelegates=null;_state="notScheduled";constructor(e,t,r,n,s,o){if(this.type=e,this.source=t,this.data=n,this.scheduleFn=s,this.cancelFn=o,!r)throw new Error("callback is not defined");this.callback=r;const a=this;e===A&&n&&n.useG?this.invoke=i.invokeTask:this.invoke=function(){return i.invokeTask.call(Wd,a,this,arguments)}}static invokeTask(e,t,r){e||(e=this),R++;try{return e.runCount++,e.zone.runTask(e,t,r)}finally{1==R&&m(),R--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(y,b)}_transitionTo(e,t,r){if(this._state!==t&&this._state!==r)throw new Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${r?" or '"+r+"'":""}, was '${this._state}'.`);this._state=e,e==y&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const a=Hd("setTimeout"),l=Hd("Promise"),c=Hd("then");let u,h=[],p=!1;function d(e){if(u||Wd[l]&&(u=Wd[l].resolve(0)),u){let t=u[c];t||(t=u.then),t.call(u,e)}else Wd[a](e,0)}function f(e){0===R&&0===h.length&&d(m),e&&h.push(e)}function m(){if(!p){for(p=!0;h.length;){const e=h;h=[];for(let t=0;t<e.length;t++){const r=e[t];try{r.zone.runTask(r,null,null)}catch(e){T.onUnhandledError(e)}}}T.microtaskDrainDone(),p=!1}}const g={name:"NO ZONE"},y="notScheduled",b="scheduling",v="scheduled",w="running",C="canceling",S="unknown",_="microTask",I="macroTask",A="eventTask",E={},T={symbol:Hd,currentZoneFrame:()=>k,onUnhandledError:x,microtaskDrainDone:x,scheduleMicroTask:f,showUncaughtError:()=>!n[Hd("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:x,patchMethod:()=>x,bindArguments:()=>[],patchThen:()=>x,patchMacroTask:()=>x,patchEventPrototype:()=>x,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>x,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>x,wrapWithCurrentZone:()=>x,filterProperties:()=>[],attachOriginToPatched:()=>x,_redefineProperty:()=>x,patchCallbacks:()=>x,nativeScheduleMicroTask:d};let k={parent:null,zone:new n(null,null)},O=null,R=0;function x(){}return r("Zone","Zone"),n}(),e.Zone}();!function(e){Xf(e),function(e){e.__load_patch("toString",e=>{const t=Function.prototype.toString,r=lf("OriginalDelegate"),n=lf("Promise"),s=lf("Error"),o=function(){if("function"==typeof this){const o=this[r];if(o)return"function"==typeof o?t.call(o):Object.prototype.toString.call(o);if(this===Promise){const r=e[n];if(r)return t.call(r)}if(this===Error){const r=e[s];if(r)return t.call(r)}}return t.call(this)};o[r]=t,Function.prototype.toString=o;const i=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":i.call(this)}})}(e),function(e){e.__load_patch("util",(e,t,r)=>{const n=Kf(e);r.patchOnProperties=Sf,r.patchMethod=Af,r.bindArguments=pf,r.patchMacroTask=Ef;const s=t.__symbol__("BLACK_LISTED_EVENTS"),o=t.__symbol__("UNPATCHED_EVENTS");e[o]&&(e[s]=e[o]),e[s]&&(t[s]=t[o]=e[s]),r.patchEventPrototype=jf,r.patchEventTarget=Uf,r.isIEOrEdge=Rf,r.ObjectDefineProperty=Kd,r.ObjectGetOwnPropertyDescriptor=Yd,r.ObjectCreate=Xd,r.ArraySlice=qd,r.patchClass=If,r.wrapWithCurrentZone=of,r.filterProperties=Hf,r.attachOriginToPatched=Tf,r._redefineProperty=Object.defineProperty,r.patchCallbacks=qf,r.getGlobalObjects=()=>({globalSources:Df,zoneSymbolEventNames:Lf,eventNames:n,isBrowser:gf,isMix:yf,isNode:mf,TRUE_STR:rf,FALSE_STR:nf,ZONE_SYMBOL_PREFIX:sf,ADD_EVENT_LISTENER_STR:Qd,REMOVE_EVENT_LISTENER_STR:$d})})}(e)}(Qf),function(e){e.__load_patch("legacy",t=>{const r=t[e.__symbol__("legacyPatch")];r&&r()}),e.__load_patch("timers",e=>{const t="set",r="clear";Gf(e,t,r,"Timeout"),Gf(e,t,r,"Interval"),Gf(e,t,r,"Immediate")}),e.__load_patch("requestAnimationFrame",e=>{Gf(e,"request","cancel","AnimationFrame"),Gf(e,"mozRequest","mozCancel","AnimationFrame"),Gf(e,"webkitRequest","webkitCancel","AnimationFrame")}),e.__load_patch("blocking",(e,t)=>{const r=["alert","prompt","confirm"];for(let n=0;n<r.length;n++){Af(e,r[n],(r,n,s)=>function(n,o){return t.current.run(r,e,o,s)})}}),e.__load_patch("EventTarget",(e,t,r)=>{!function(e,t){t.patchEventPrototype(e,t)}(e,r),Wf(e,r);const n=e.XMLHttpRequestEventTarget;n&&n.prototype&&r.patchEventTarget(e,r,[n.prototype])}),e.__load_patch("MutationObserver",(e,t,r)=>{If("MutationObserver"),If("WebKitMutationObserver")}),e.__load_patch("IntersectionObserver",(e,t,r)=>{If("IntersectionObserver")}),e.__load_patch("FileReader",(e,t,r)=>{If("FileReader")}),e.__load_patch("on_property",(e,t,r)=>{Jf(r,e)}),e.__load_patch("customElements",(e,t,r)=>{!function(e,t){const{isBrowser:r,isMix:n}=t.getGlobalObjects();if(!r&&!n||!e.customElements||!("customElements"in e))return;t.patchCallbacks(t,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"])}(e,r)}),e.__load_patch("XHR",(e,t)=>{!function(e){const l=e.XMLHttpRequest;if(!l)return;const c=l.prototype;let u=c[ef],h=c[tf];if(!u){const t=e.XMLHttpRequestEventTarget;if(t){const e=t.prototype;u=e[ef],h=e[tf]}}const p="readystatechange",d="scheduled";function f(e){const n=e.data,i=n.target;i[o]=!1,i[a]=!1;const l=i[s];u||(u=i[ef],h=i[tf]),l&&h.call(i,p,l);const c=i[s]=()=>{if(i.readyState===i.DONE)if(!n.aborted&&i[o]&&e.state===d){const r=i[t.__symbol__("loadfalse")];if(0!==i.status&&r&&r.length>0){const s=e.invoke;e.invoke=function(){const r=i[t.__symbol__("loadfalse")];for(let t=0;t<r.length;t++)r[t]===e&&r.splice(t,1);n.aborted||e.state!==d||s.call(e)},r.push(e)}else e.invoke()}else n.aborted||!1!==i[o]||(i[a]=!0)};u.call(i,p,c);return i[r]||(i[r]=e),w.apply(i,n.args),i[o]=!0,e}function m(){}function g(e){const t=e.data;return t.aborted=!0,C.apply(t.target,t.args)}const y=Af(c,"open",()=>function(e,t){return e[n]=0==t[2],e[i]=t[1],y.apply(e,t)}),b=lf("fetchTaskAborting"),v=lf("fetchTaskScheduling"),w=Af(c,"send",()=>function(e,r){if(!0===t.current[v])return w.apply(e,r);if(e[n])return w.apply(e,r);{const t={target:e,url:e[i],isPeriodic:!1,args:r,aborted:!1},n=af("XMLHttpRequest.send",m,t,f,g);e&&!0===e[a]&&!t.aborted&&n.state===d&&n.invoke()}}),C=Af(c,"abort",()=>function(e,n){const s=e[r];if(s&&"string"==typeof s.type){if(null==s.cancelFn||s.data&&s.data.aborted)return;s.zone.cancelTask(s)}else if(!0===t.current[b])return C.apply(e,n)})}(e);const r=lf("xhrTask"),n=lf("xhrSync"),s=lf("xhrListener"),o=lf("xhrScheduled"),i=lf("xhrURL"),a=lf("xhrErrorBeforeScheduled")}),e.__load_patch("geolocation",e=>{e.navigator&&e.navigator.geolocation&&function(e,t){const r=e.constructor.name;for(let n=0;n<t.length;n++){const s=t[n],o=e[s];if(o){if(!df(Yd(e,s)))continue;e[s]=(e=>{const t=function(){return e.apply(this,pf(arguments,r+"."+s))};return Tf(t,e),t})(o)}}}(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),e.__load_patch("PromiseRejectionEvent",(e,t)=>{function r(t){return function(r){Zf(e,t).forEach(n=>{const s=e.PromiseRejectionEvent;if(s){const e=new s(t,{promise:r.promise,reason:r.rejection});n.invoke(e)}})}}e.PromiseRejectionEvent&&(t[lf("unhandledPromiseRejectionHandler")]=r("unhandledrejection"),t[lf("rejectionHandledHandler")]=r("rejectionhandled"))}),e.__load_patch("queueMicrotask",(e,t,r)=>{zf(e,r)})}(Qf);var $f;!function(e){e.METHOD_OPEN="open",e.METHOD_SEND="send",e.EVENT_ABORT="abort",e.EVENT_ERROR="error",e.EVENT_LOAD="loaded",e.EVENT_TIMEOUT="timeout"}($f||($f={}));const em=sh.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function tm(e){return t=e,"undefined"!=typeof Document&&t instanceof Document?(new XMLSerializer).serializeToString(document).length:"string"==typeof e?nm(e):e instanceof Blob?e.size:e instanceof FormData?function(e){let t=0;for(const[r,n]of e.entries())t+=r.length,n instanceof Blob?t+=n.size:t+=n.length;return t}(e):e instanceof URLSearchParams?nm(e.toString()):void 0!==e.byteLength?e.byteLength:void em.warn("unknown body type");var t}const rm=new TextEncoder;function nm(e){return rm.encode(e).byteLength}function sm(e){const t=function(){void 0===im&&(im=om);return im}(),r=e.toUpperCase();return r in t?r:"_OTHER"}const om={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let im;const am={"https:":"443","http:":"80"};const lm="0.203.0";var cm;!function(e){e.HTTP_STATUS_TEXT="http.status_text"}(cm||(cm={}));class um extends Ld{component="xml-http-request";version=lm;moduleName=this.component;_tasksCount=0;_xhrMem=new WeakMap;_usedResources=new WeakSet;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-xml-http-request",lm,e),this._semconvStability=Ud("http",e?.semconvStabilityOptIn)}init(){}_addHeaders(e,t){if(!gd(md(t).href,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return yh.inject(nh.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}const r={};yh.inject(nh.active(),r),Object.keys(r).forEach(t=>{e.setRequestHeader(t,String(r[t]))})}_addChildSpan(e,t){nh.with(vh.setSpan(nh.active(),e),()=>{const e=this.tracer.startSpan("CORS Preflight",{startTime:t[od.FETCH_START]}),r=!(this._semconvStability&Fd.OLD);pd(e,t,this.getConfig().ignoreNetworkEvents,void 0,r),e.end(t[od.RESPONSE_END])})}_addFinalSpanAttributes(e,t,r){if(this._semconvStability&Fd.OLD){if(void 0!==t.status&&e.setAttribute("http.status_code",t.status),void 0!==t.statusText&&e.setAttribute(cm.HTTP_STATUS_TEXT,t.statusText),"string"==typeof r){const t=md(r);e.setAttribute("http.host",t.host),e.setAttribute("http.scheme",t.protocol.replace(":",""))}e.setAttribute("http.user_agent",navigator.userAgent)}this._semconvStability&Fd.STABLE&&t.status&&e.setAttribute(Uh,t.status)}_applyAttributesAfterXHR(e,t){const r=this.getConfig().applyCustomAttributesOnSpan;"function"==typeof r&&Dd(()=>r(e,t),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_addResourceObserver(e,t){const r=this._xhrMem.get(e);r&&"function"==typeof PerformanceObserver&&"function"==typeof PerformanceResourceTiming&&(r.createdResources={observer:new PerformanceObserver(e=>{const n=e.getEntries(),s=md(t);n.forEach(e=>{"xmlhttprequest"===e.initiatorType&&e.name===s.href&&r.createdResources&&r.createdResources.entries.push(e)})}),entries:[]},r.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(Nh.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,r,n,s){if(!(r&&n&&s&&e.createdResources))return;let o=e.createdResources.entries;o&&o.length||(o=Nh.getEntriesByType("resource"));const i=fd(md(r).href,n,s,o,this._usedResources);if(i.mainRequest){const e=i.mainRequest;this._markResourceAsUsed(e);const r=i.corsPreFlightRequest;r&&(this._addChildSpan(t,r),this._markResourceAsUsed(r));const n=!(this._semconvStability&Fd.OLD);pd(t,e,this.getConfig().ignoreNetworkEvents,void 0,n)}}_cleanPreviousSpanInformation(e){const t=this._xhrMem.get(e);if(t){const r=t.callbackToRemoveEvents;r&&r(),this._xhrMem.delete(e)}}_createSpan(e,t,r){if(Lp(t,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let n="";const s=md(t),o={};if(this._semconvStability&Fd.OLD&&(n=r.toUpperCase(),o["http.method"]=r,o["http.url"]=s.toString()),this._semconvStability&Fd.STABLE){const e=r,t=sm(r);n||(n=t),o[Fh]=t,t!==e&&(o[Bh]=e),o[Hh]=s.toString(),o[Zh]=s.hostname;const i=function(e){const t=Number(e.port||am[e.protocol]);return t&&!isNaN(t)?t:void 0}(s);i&&(o[jh]=i)}const i=this.tracer.startSpan(n,{kind:qu.CLIENT,attributes:o});return i.addEvent($f.METHOD_OPEN),this._cleanPreviousSpanInformation(e),this._xhrMem.set(e,{span:i,spanUrl:t}),i}_markResourceAsUsed(e){this._usedResources.add(e)}_patchOpen(){return e=>{const t=this;return function(...r){const n=r[0],s=r[1];return t._createSpan(this,s,n),e.apply(this,r)}}}_patchSend(){const e=this;function t(t,r,n,s){const o=e._xhrMem.get(r);if(!o)return;if(o.status=r.status,o.statusText=r.statusText,e._xhrMem.delete(r),o.span){const t=o.span;e._applyAttributesAfterXHR(t,r),e._semconvStability&Fd.STABLE&&(n?s&&(t.setStatus({code:Qu.ERROR,message:s}),t.setAttribute(Lh,s)):o.status&&o.status>=400&&(t.setStatus({code:Qu.ERROR}),t.setAttribute(Lh,String(o.status))))}const i=$h(),a=Date.now();setTimeout(()=>{!function(t,r,n,s){const o=r.callbackToRemoveEvents;"function"==typeof o&&o();const{span:i,spanUrl:a,sendStartTime:l}=r;i&&(e._findResourceAndAddNetworkEvents(r,i,a,l,n),i.addEvent(t,s),e._addFinalSpanAttributes(i,r,a),i.end(s),e._tasksCount--),e._clearResources()}(t,o,i,a)},300)}function r(){t($f.EVENT_ERROR,this,!0,"error")}function n(){t($f.EVENT_ABORT,this,!1)}function s(){t($f.EVENT_TIMEOUT,this,!0,"timeout")}function o(){this.status<299?t($f.EVENT_LOAD,this,!1):t($f.EVENT_ERROR,this,!1)}return t=>function(...i){const a=e._xhrMem.get(this);if(!a)return t.apply(this,i);const l=a.span,c=a.spanUrl;if(l&&c){if(e.getConfig().measureRequestSize&&i?.[0]){const t=tm(i[0]);void 0!==t&&(e._semconvStability&Fd.OLD&&l.setAttribute("http.request_content_length_uncompressed",t),e._semconvStability&Fd.STABLE&&l.setAttribute("http.request.body.size",t))}nh.with(vh.setSpan(nh.active(),l),()=>{e._tasksCount++,a.sendStartTime=$h(),l.addEvent($f.METHOD_SEND),this.addEventListener("abort",n),this.addEventListener("error",r),this.addEventListener("load",o),this.addEventListener("timeout",s),a.callbackToRemoveEvents=()=>{!function(t){t.removeEventListener("abort",n),t.removeEventListener("error",r),t.removeEventListener("load",o),t.removeEventListener("timeout",s);const i=e._xhrMem.get(t);i&&(i.callbackToRemoveEvents=void 0)}(this),a.createdResources&&a.createdResources.observer.disconnect()},e._addHeaders(this,c),e._addResourceObserver(this,c)})}return t.apply(this,i)}}enable(){this._diag.debug("applying patch to",this.moduleName,this.version),Pd(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),Pd(XMLHttpRequest.prototype.send)&&(this._unwrap(XMLHttpRequest.prototype,"send"),this._diag.debug("removing previous patch from method send")),this._wrap(XMLHttpRequest.prototype,"open",this._patchOpen()),this._wrap(XMLHttpRequest.prototype,"send",this._patchSend())}disable(){this._diag.debug("removing patch from",this.moduleName,this.version),this._unwrap(XMLHttpRequest.prototype,"open"),this._unwrap(XMLHttpRequest.prototype,"send"),this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet}}var hm;!function(e){e.COMPONENT="component",e.HTTP_STATUS_TEXT="http.status_text"}(hm||(hm={}));var pm={};Object.defineProperty(pm,"__esModule",{value:!0});var dm=pm.ATTR_HTTP_USER_AGENT=pm.ATTR_HTTP_URL=pm.ATTR_HTTP_STATUS_CODE=pm.ATTR_HTTP_SCHEME=pm.ATTR_HTTP_RESPONSE_CONTENT_LENGTH=pm.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=pm.ATTR_HTTP_REQUEST_BODY_SIZE=pm.ATTR_HTTP_METHOD=pm.ATTR_HTTP_HOST=void 0,fm=pm.ATTR_HTTP_HOST="http.host",mm=pm.ATTR_HTTP_METHOD="http.method",gm=pm.ATTR_HTTP_REQUEST_BODY_SIZE="http.request.body.size",ym=pm.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED="http.request_content_length_uncompressed";pm.ATTR_HTTP_RESPONSE_CONTENT_LENGTH="http.response_content_length";var bm=pm.ATTR_HTTP_SCHEME="http.scheme",vm=pm.ATTR_HTTP_STATUS_CODE="http.status_code",wm=pm.ATTR_HTTP_URL="http.url";dm=pm.ATTR_HTTP_USER_AGENT="http.user_agent";const Cm=sh.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function Sm(...e){if(e[0]instanceof URL||"string"==typeof e[0]){const t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){const{body:e,length:r}=function(e){if(!e.pipeThrough)return Cm.warn("Platform has ReadableStream but not pipeThrough!"),{body:e,length:Promise.resolve(void 0)};let t,r=0;const n=new Promise(e=>{t=e}),s=new TransformStream({start(){},async transform(e,t){const n=await e;r+=n.byteLength,t.enqueue(e)},flush(){t(r)}});return{body:e.pipeThrough(s),length:n}}(t.body);return t.body=e,r}return Promise.resolve(function(e){if(t=e,"undefined"!=typeof Document&&t instanceof Document)return(new XMLSerializer).serializeToString(document).length;var t;if("string"==typeof e)return Im(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return function(e){let t=0;for(const[r,n]of e.entries())t+=r.length,n instanceof Blob?t+=n.size:t+=n.length;return t}(e);if(e instanceof URLSearchParams)return Im(e.toString());if(void 0!==e.byteLength)return e.byteLength;return void Cm.warn("unknown body type")}(t.body))}{const t=e[0];return t?.body?t.clone().text().then(e=>Im(e)):Promise.resolve()}}const _m=new TextEncoder;function Im(e){return _m.encode(e).byteLength}const Am={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let Em;function Tm(){return void 0===Em&&(Em=Am),Em}const km={"https:":"443","http:":"80"};const Om="0.203.0",Rm="object"==typeof process&&"node"===process.release?.name;class xm extends Ld{component="fetch";version=Om;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-fetch",Om,e),this._semconvStability=Ud("http",e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){const r=this.tracer.startSpan("CORS Preflight",{startTime:t[od.FETCH_START]},vh.setSpan(nh.active(),e)),n=!(this._semconvStability&Fd.OLD);pd(r,t,this.getConfig().ignoreNetworkEvents,void 0,n),r.end(t[od.RESPONSE_END])}_addFinalSpanAttributes(e,t){const r=md(t.url);if(this._semconvStability&Fd.OLD&&(e.setAttribute(vm,t.status),null!=t.statusText&&e.setAttribute(hm.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(fm,r.host),e.setAttribute(bm,r.protocol.replace(":","")),"undefined"!=typeof navigator&&e.setAttribute(dm,navigator.userAgent)),this._semconvStability&Fd.STABLE){e.setAttribute(Uh,t.status),e.setAttribute(Zh,r.hostname);const n=function(e){const t=Number(e.port||km[e.protocol]);return t&&!isNaN(t)?t:void 0}(r);n&&e.setAttribute(jh,n)}}_addHeaders(e,t){if(!gd(t,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return yh.inject(nh.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(e instanceof Request)yh.inject(nh.active(),e.headers,{set:(e,t,r)=>e.set(t,"string"==typeof r?r:String(r))});else if(e.headers instanceof Headers)yh.inject(nh.active(),e.headers,{set:(e,t,r)=>e.set(t,"string"==typeof r?r:String(r))});else if(e.headers instanceof Map)yh.inject(nh.active(),e.headers,{set:(e,t,r)=>e.set(t,"string"==typeof r?r:String(r))});else{const t={};yh.inject(nh.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(Lp(e,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let r="";const n={};if(this._semconvStability&Fd.OLD){const s=(t.method||"GET").toUpperCase();r=`HTTP ${s}`,n[hm.COMPONENT]=this.moduleName,n[mm]=s,n[wm]=e}if(this._semconvStability&Fd.STABLE){const s=t.method,o=function(e){const t=Tm(),r=e.toUpperCase();return r in t?r:"_OTHER"}(t.method||"GET");r||(r=o),n[Fh]=o,o!==s&&(n[Bh]=s),n[Hh]=e}return this.tracer.startSpan(r,{kind:qu.CLIENT,attributes:n})}_findResourceAndAddNetworkEvents(e,t,r){let n=t.entries;if(!n.length){if(!performance.getEntriesByType)return;n=performance.getEntriesByType("resource")}const s=fd(t.spanUrl,t.startTime,r,n,this._usedResources,"fetch");if(s.mainRequest){const t=s.mainRequest;this._markResourceAsUsed(t);const r=s.corsPreFlightRequest;r&&(this._addChildSpan(e,r),this._markResourceAsUsed(r));const n=!(this._semconvStability&Fd.OLD);pd(e,t,this.getConfig().ignoreNetworkEvents,void 0,n)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,r){const n=qh(Date.now()),s=$h();this._addFinalSpanAttributes(e,r),this._semconvStability&Fd.STABLE&&r.status>=400&&(e.setStatus({code:Qu.ERROR}),e.setAttribute(Lh,String(r.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,s),this._tasksCount--,this._clearResources(),e.end(n)},300)}_patchConstructor(){return e=>{const t=this;return function(...r){const n=this,s=md(r[0]instanceof Request?r[0].url:String(r[0])).href,o=r[0]instanceof Request?r[0]:r[1]||{},i=t._createSpan(s,o);if(!i)return e.apply(this,r);const a=t._prepareSpanData(s);function l(e,r){t._applyAttributesAfterFetch(e,o,r),t._endSpan(e,a,{status:r.status||0,statusText:r.message,url:s})}function c(e,r){t._applyAttributesAfterFetch(e,o,r),r.status>=200&&r.status<400?t._endSpan(e,a,r):t._endSpan(e,a,{status:r.status,statusText:r.statusText,url:s})}function u(e,t,r){try{const t=r.clone().body;if(t){const n=t.getReader(),s=()=>{n.read().then(({done:t})=>{t?c(e,r):s()},t=>{l(e,t)})};s()}else c(e,r)}finally{t(r)}}function h(e,t,r){try{l(e,r)}finally{t(r)}}return t.getConfig().measureRequestSize&&Sm(...r).then(e=>{e&&(t._semconvStability&Fd.OLD&&i.setAttribute(ym,e),t._semconvStability&Fd.STABLE&&i.setAttribute(gm,e))}).catch(e=>{t._diag.warn("getFetchBodyLength",e)}),new Promise((r,a)=>nh.with(vh.setSpan(nh.active(),i),()=>(t._addHeaders(o,s),t._callRequestHook(i,o),t._tasksCount++,e.apply(n,o instanceof Request?[o]:[s,o]).then(u.bind(n,i,r),h.bind(n,i,a)))))}}}_applyAttributesAfterFetch(e,t,r){const n=this.getConfig().applyCustomAttributesOnSpan;n&&Dd(()=>n(e,t,r),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_callRequestHook(e,t){const r=this.getConfig().requestHook;r&&Dd(()=>r(e,t),e=>{e&&this._diag.error("requestHook",e)})}_prepareSpanData(e){const t=$h(),r=[];if("function"!=typeof PerformanceObserver)return{entries:r,startTime:t,spanUrl:e};const n=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{"fetch"===t.initiatorType&&t.name===e&&r.push(t)})});return n.observe({entryTypes:["resource"]}),{entries:r,observer:n,startTime:t,spanUrl:e}}enable(){Rm?this._diag.warn("this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()"):(Pd(fetch)&&(this._unwrap(xh,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(xh,"fetch",this._patchConstructor()))}disable(){Rm||(this._unwrap(xh,"fetch"),this._usedResources=new WeakSet)}}class Nm{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class Mm extends Error{code;name="OTLPExporterError";data;constructor(e,t,r){super(e),this.data=r,this.code=t}}function Lm(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function Dm(e){if(null!=e)return()=>e}function Pm(e,t,r){return{timeoutMillis:Lm(e.timeoutMillis??t.timeoutMillis??r.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??r.concurrencyLimit,compression:e.compression??t.compression??r.compression}}class Fm{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);const t=()=>{const t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function Bm(e){return new Fm(e.concurrencyLimit)}function Um(){return{handleResponse(e){null!=e&&function(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}(e)&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&sh.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}class Zm{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,r,n,s){this._transport=e,this._serializer=t,this._responseHandler=r,this._promiseQueue=n,this._timeout=s,this._diagLogger=sh.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit())return void t({code:op.FAILED,error:new Error("Concurrent export limit reached")});const r=this._serializer.serializeRequest(e);null!=r?this._promiseQueue.pushPromise(this._transport.send(r,this._timeout).then(e=>{if("success"!==e.status)"failure"===e.status&&e.error?t({code:op.FAILED,error:e.error}):"retryable"===e.status?t({code:op.FAILED,error:new Mm("Export failed with retryable status")}):t({code:op.FAILED,error:new Mm("Export failed with unknown error")});else{if(null!=e.data)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",t,e.data)}t({code:op.SUCCESS})}},e=>t({code:op.FAILED,error:e}))):t({code:op.FAILED,error:new Error("Nothing to send")})}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function jm(e,t,r){return n={transport:r,serializer:t,promiseHandler:Bm(e)},s={timeout:e.timeoutMillis},new Zm(n.transport,n.serializer,Um(),n.promiseHandler,s.timeout);var n,s}function zm(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Vm(e){const t=new Uint8Array(e.length/2);let r=0;for(let n=0;n<e.length;n+=2){const s=zm(e.charCodeAt(n)),o=zm(e.charCodeAt(n+1));t[r++]=s<<4|o}return t}function Gm(e){const t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}const Wm="undefined"!=typeof BigInt?function(e){return Gm(e).toString()}:tp;function Hm(e){return e}const Ym={encodeHrTime:function(e){const t=Gm(e);return r=t,{low:Number(BigInt.asUintN(32,r)),high:Number(BigInt.asUintN(32,r>>BigInt(32)))};var r},encodeSpanContext:Vm,encodeOptionalSpanContext:function(e){if(void 0!==e)return Vm(e)}};function Km(e){return{attributes:Xm(e.attributes),droppedAttributesCount:0}}function Jm(e){return{name:e.name,version:e.version}}function Xm(e){return Object.keys(e).map(t=>qm(t,e[t]))}function qm(e,t){return{key:e,value:Qm(t)}}function Qm(e){const t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(Qm)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map(([e,t])=>qm(e,t))}}:{}}function $m(e,t){const r=e.spanContext(),n=e.status,s=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(r.traceId),spanId:t.encodeSpanContext(r.spanId),parentSpanId:s,traceState:r.traceState?.serialize(),name:e.name,kind:null==e.kind?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:Xm(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>function(e,t){return{attributes:e.attributes?Xm(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:n.code,message:n.message},links:e.links.map(e=>function(e,t){return{attributes:e.attributes?Xm(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}(e,t)),droppedLinksCount:e.droppedLinksCount}}function eg(e,t){const r=function(e){return void 0===e?Ym:{encodeHrTime:Wm,encodeSpanContext:Hm,encodeOptionalSpanContext:Hm}}(t);return{resourceSpans:tg(e,r)}}function tg(e,t){const r=function(e){const t=new Map;for(const r of e){let e=t.get(r.resource);e||(e=new Map,t.set(r.resource,e));const n=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`;let s=e.get(n);s||(s=[],e.set(n,s)),s.push(r)}return t}(e),n=[],s=r.entries();let o=s.next();for(;!o.done;){const[e,r]=o.value,i=[],a=r.values();let l=a.next();for(;!l.done;){const e=l.value;if(e.length>0){const r=e.map(e=>$m(e,t));i.push({scope:Jm(e[0].instrumentationScope),spans:r,schemaUrl:e[0].instrumentationScope.schemaUrl})}l=a.next()}const c={resource:Km(e),scopeSpans:i,schemaUrl:void 0};n.push(c),o=s.next()}return n}const rg={serializeRequest:e=>{const t=eg(e,{});return(new TextEncoder).encode(JSON.stringify(t))},deserializeResponse:e=>{if(0===e.length)return{};const t=new TextDecoder;return JSON.parse(t.decode(e))}};function ng(){return.4*Math.random()-.2}class sg{_transport;constructor(e){this._transport=e}retry(e,t,r){return new Promise((n,s)=>{setTimeout(()=>{this._transport.send(e,t).then(n,s)},r)})}async send(e,t){const r=Date.now()+t;let n=await this._transport.send(e,t),s=5,o=1e3;for(;"retryable"===n.status&&s>0;){s--;const t=Math.max(Math.min(o,5e3)+ng(),0);o*=1.5;const i=n.retryInMillis??t,a=r-Date.now();if(i>a)return n;n=await this.retry(e,a,i)}return n}shutdown(){return this._transport.shutdown()}}function og(e){return new sg(e.transport)}function ig(e){if(null==e)return;const t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?1e3*t:-1;const r=new Date(e).getTime()-Date.now();return r>=0?r:0}class ag{_parameters;constructor(e){this._parameters=e}send(e,t){return new Promise(r=>{const n=new XMLHttpRequest;n.timeout=t,n.open("POST",this._parameters.url);const s=this._parameters.headers();Object.entries(s).forEach(([e,t])=>{n.setRequestHeader(e,t)}),n.ontimeout=e=>{r({status:"failure",error:new Error("XHR request timed out")})},n.onreadystatechange=()=>{var e;n.status>=200&&n.status<=299?(sh.debug("XHR success"),r({status:"success"})):n.status&&(e=n.status,[429,502,503,504].includes(e))?r({status:"retryable",retryInMillis:ig(n.getResponseHeader("Retry-After"))}):0!==n.status&&r({status:"failure",error:new Error("XHR request failed with non-retryable status")})},n.onabort=()=>{r({status:"failure",error:new Error("XHR request aborted")})},n.onerror=()=>{r({status:"failure",error:new Error("XHR request errored")})},n.send(e)})}shutdown(){}}class lg{_params;constructor(e){this._params=e}send(e){return new Promise(t=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(sh.debug("SendBeacon success"),t({status:"success"})):t({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function cg(e,t,r){const n={...r()},s={};return()=>(null!=t&&Object.assign(s,t()),null!=e&&Object.assign(s,e()),Object.assign(s,n))}function ug(e){if(null!=e)try{return new URL(e),e}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function hg(e,t,r){return n={url:e.url,timeoutMillis:e.timeoutMillis,headers:Dm(e.headers),concurrencyLimit:e.concurrencyLimit},s={},o=function(e,t){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none",headers:()=>e,url:"http://localhost:4318/"+t,agentOptions:{keepAlive:!0}}}(r,t),{...Pm(n,s,o),headers:cg((i=n.headers,()=>{const e={};return Object.entries(i?.()??{}).forEach(([t,r])=>{void 0!==r?e[t]=String(r):sh.warn(`Header "${t}" has invalid value (${r}) and will be ignored`)}),e}),s.headers,o.headers),url:ug(n.url)??s.url??o.url,agentOptions:n.agentOptions??s.agentOptions??o.agentOptions};var n,s,o,i}function pg(e,t,r,n){const s=!!e.headers||"function"!=typeof navigator.sendBeacon,o=hg(e,r,n);return s?function(e,t){return jm(e,t,og({transport:(r=e,new ag(r))}));var r}(o,t):function(e,t){return jm(e,t,og({transport:(r={url:e.url,blobType:e.headers()["Content-Type"]},new lg(r))}));var r}(o,t)}class dg extends Nm{constructor(e={}){super(pg(e,rg,"v1/traces",{"Content-Type":"application/json"}))}}class fg{constructor(e,t){this.config=e,this.sessionId=t,this.provider=this.createProvider()}createProvider(){const{serviceName:e,resourceAttributes:t,exporterEndpoint:r,projectId:n}=this.config,s=Up({[zh]:e,"at-project-id":n,...t||{}}),o=new dg({url:r||"https://otelcol.apitoolkit.io/v1/traces",headers:{}});return new ld({resource:s,spanProcessors:[new Qp(o)]})}configure(){this.provider.register({contextManager:new Gd,propagator:new mp});const e=this.config.propagateTraceHeaderCorsUrls||[/^https?:\/\/.*/],t=[/^https?:\/\/(?:[^\/]+\.)?apitoolkit\.io\//,/^https?:\/\/(?:[^\/]+\.)?monoscope\.tech\//];!function(e){const t=e.tracerProvider||vh.getTracerProvider(),r=e.meterProvider||ah.getMeterProvider(),n=e.loggerProvider||Ed.getLoggerProvider(),s=e.instrumentations?.flat()??[];(function(e,t,r,n){for(let s=0,o=e.length;s<o;s++){const o=e[s];t&&o.setTracerProvider(t),r&&o.setMeterProvider(r),n&&o.setLoggerProvider&&o.setLoggerProvider(n),o.getConfig().enabled||o.enable()}})(s,t,r,n)}({tracerProvider:this.provider,instrumentations:[...this.config.instrumentations||[],new zd({applyCustomAttributesOnSpan:{documentLoad:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)},documentFetch:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)},resourceFetch:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)}}}),new um({propagateTraceHeaderCorsUrls:e,ignoreUrls:t,applyCustomAttributesOnSpan:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)}}),new xm({propagateTraceHeaderCorsUrls:e,ignoreUrls:t,applyCustomAttributesOnSpan:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)}})]})}setUserAttributes(e){if(this.config.user)for(let t in this.config.user)e.setAttribute(`user.${t}`,this.config.user[t])}async shutdown(){await this.provider.shutdown()}setUser(e){this.config={...this.config,user:{...this.config.user,...e}}}}const mg=[];for(let e=0;e<256;++e)mg.push((e+256).toString(16).slice(1));let gg;const yg=new Uint8Array(16);var bg={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function vg(e,t,r){if(bg.randomUUID&&!e)return bg.randomUUID();const n=(e=e||{}).random??e.rng?.()??function(){if(!gg){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");gg=crypto.getRandomValues.bind(crypto)}return gg(yg)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e,t=0){return(mg[e[t+0]]+mg[e[t+1]]+mg[e[t+2]]+mg[e[t+3]]+"-"+mg[e[t+4]]+mg[e[t+5]]+"-"+mg[e[t+6]]+mg[e[t+7]]+"-"+mg[e[t+8]]+mg[e[t+9]]+"-"+mg[e[t+10]]+mg[e[t+11]]+mg[e[t+12]]+mg[e[t+13]]+mg[e[t+14]]+mg[e[t+15]]).toLowerCase()}(n)}return class{constructor(e){if(!e.projectId)throw new Error("MonoscopeConfig must include projectId");const t=sessionStorage.getItem("monoscope-session-id");t?this.sessionId=t:(this.sessionId=vg(),sessionStorage.setItem("monoscope-session-id",this.sessionId)),this.config=e,this.replay=new Tc(e,this.sessionId),this.otel=new fg(e,this.sessionId),this.otel.configure(),this.replay.configure()}getSessionId(){return this.sessionId}setUser(e){this.otel.setUser(e)}}});
20
+ */const Wd=globalThis;function Hd(e){return(Wd.__Zone_symbol_prefix||"__zone_symbol__")+e}const Yd=Object.getOwnPropertyDescriptor,Kd=Object.defineProperty,Jd=Object.getPrototypeOf,Xd=Object.create,qd=Array.prototype.slice,Qd="addEventListener",$d="removeEventListener",ef=Hd(Qd),tf=Hd($d),rf="true",nf="false",of=Hd("");function sf(e,t){return Zone.current.wrap(e,t)}function af(e,t,r,n,o){return Zone.current.scheduleMacroTask(e,t,r,n,o)}const lf=Hd,cf="undefined"!=typeof window,uf=cf?window:void 0,hf=cf&&uf||globalThis;function pf(e,t){for(let r=e.length-1;r>=0;r--)"function"==typeof e[r]&&(e[r]=sf(e[r],t+"_"+r));return e}function df(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&void 0===e.set)}const ff="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,mf=!("nw"in hf)&&void 0!==hf.process&&"[object process]"===hf.process.toString(),gf=!mf&&!ff&&!(!cf||!uf.HTMLElement),yf=void 0!==hf.process&&"[object process]"===hf.process.toString()&&!ff&&!(!cf||!uf.HTMLElement),bf={},vf=lf("enable_beforeunload"),wf=function(e){if(!(e=e||hf.event))return;let t=bf[e.type];t||(t=bf[e.type]=lf("ON_PROPERTY"+e.type));const r=this||e.target||hf,n=r[t];let o;if(gf&&r===uf&&"error"===e.type){const t=e;o=n&&n.call(this,t.message,t.filename,t.lineno,t.colno,t.error),!0===o&&e.preventDefault()}else o=n&&n.apply(this,arguments),"beforeunload"===e.type&&hf[vf]&&"string"==typeof o?e.returnValue=o:null==o||o||e.preventDefault();return o};function Cf(e,t,r){let n=Yd(e,t);if(!n&&r){Yd(r,t)&&(n={enumerable:!0,configurable:!0})}if(!n||!n.configurable)return;const o=lf("on"+t+"patched");if(e.hasOwnProperty(o)&&e[o])return;delete n.writable,delete n.value;const s=n.get,i=n.set,a=t.slice(2);let l=bf[a];l||(l=bf[a]=lf("ON_PROPERTY"+a)),n.set=function(t){let r=this;if(r||e!==hf||(r=hf),!r)return;"function"==typeof r[l]&&r.removeEventListener(a,wf),i?.call(r,null),r[l]=t,"function"==typeof t&&r.addEventListener(a,wf,!1)},n.get=function(){let r=this;if(r||e!==hf||(r=hf),!r)return null;const o=r[l];if(o)return o;if(s){let e=s.call(this);if(e)return n.set.call(this,e),"function"==typeof r.removeAttribute&&r.removeAttribute(t),e}return null},Kd(e,t,n),e[o]=!0}function Sf(e,t,r){if(t)for(let n=0;n<t.length;n++)Cf(e,"on"+t[n],r);else{const t=[];for(const r in e)"on"==r.slice(0,2)&&t.push(r);for(let n=0;n<t.length;n++)Cf(e,t[n],r)}}const _f=lf("originalInstance");function If(e){const t=hf[e];if(!t)return;hf[lf(e)]=t,hf[e]=function(){const r=pf(arguments,e);switch(r.length){case 0:this[_f]=new t;break;case 1:this[_f]=new t(r[0]);break;case 2:this[_f]=new t(r[0],r[1]);break;case 3:this[_f]=new t(r[0],r[1],r[2]);break;case 4:this[_f]=new t(r[0],r[1],r[2],r[3]);break;default:throw new Error("Arg list too long.")}},Tf(hf[e],t);const r=new t(function(){});let n;for(n in r)"XMLHttpRequest"===e&&"responseBlob"===n||function(t){"function"==typeof r[t]?hf[e].prototype[t]=function(){return this[_f][t].apply(this[_f],arguments)}:Kd(hf[e].prototype,t,{set:function(r){"function"==typeof r?(this[_f][t]=sf(r,e+"."+t),Tf(this[_f][t],r)):this[_f][t]=r},get:function(){return this[_f][t]}})}(n);for(n in t)"prototype"!==n&&t.hasOwnProperty(n)&&(hf[e][n]=t[n])}function Af(e,t,r){let n=e;for(;n&&!n.hasOwnProperty(t);)n=Jd(n);!n&&e[t]&&(n=e);const o=lf(t);let s=null;if(n&&(!(s=n[o])||!n.hasOwnProperty(o))){s=n[o]=n[t];if(df(n&&Yd(n,t))){const e=r(s,o,t);n[t]=function(){return e(this,arguments)},Tf(n[t],s)}}return s}function Ef(e,t,r){let n=null;function o(e){const t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},n.apply(t.target,t.args),e}n=Af(e,t,e=>function(t,n){const s=r(t,n);return s.cbIdx>=0&&"function"==typeof n[s.cbIdx]?af(s.name,n[s.cbIdx],s,o):e.apply(t,n)})}function Tf(e,t){e[lf("OriginalDelegate")]=t}let kf=!1,Of=!1;function Rf(){if(kf)return Of;kf=!0;try{const e=uf.navigator.userAgent;-1===e.indexOf("MSIE ")&&-1===e.indexOf("Trident/")&&-1===e.indexOf("Edge/")||(Of=!0)}catch(e){}return Of}function xf(e){return"function"==typeof e}function Nf(e){return"number"==typeof e}const Mf={useG:!0},Lf={},Df={},Pf=new RegExp("^"+of+"(\\w+)(true|false)$"),Ff=lf("propagationStopped");function Bf(e,t){const r=(t?t(e):e)+nf,n=(t?t(e):e)+rf,o=of+r,s=of+n;Lf[e]={},Lf[e][nf]=o,Lf[e][rf]=s}function Uf(e,t,r,n){const o=n&&n.add||Qd,s=n&&n.rm||$d,i=n&&n.listeners||"eventListeners",a=n&&n.rmAll||"removeAllListeners",l=lf(o),c="."+o+":",u="prependListener",h="."+u+":",p=function(e,t,r){if(e.isRemoved)return;const n=e.callback;let o;"object"==typeof n&&n.handleEvent&&(e.callback=e=>n.handleEvent(e),e.originalDelegate=n);try{e.invoke(e,t,[r])}catch(e){o=e}const i=e.options;if(i&&"object"==typeof i&&i.once){const n=e.originalDelegate?e.originalDelegate:e.callback;t[s].call(t,r.type,n,i)}return o};function d(r,n,o){if(!(n=n||e.event))return;const s=r||n.target||e,i=s[Lf[n.type][o?rf:nf]];if(i){const e=[];if(1===i.length){const t=p(i[0],s,n);t&&e.push(t)}else{const t=i.slice();for(let r=0;r<t.length&&(!n||!0!==n[Ff]);r++){const o=p(t[r],s,n);o&&e.push(o)}}if(1===e.length)throw e[0];for(let r=0;r<e.length;r++){const n=e[r];t.nativeScheduleMicroTask(()=>{throw n})}}}const f=function(e){return d(this,e,!1)},m=function(e){return d(this,e,!0)};function g(t,r){if(!t)return!1;let n=!0;r&&void 0!==r.useG&&(n=r.useG);const p=r&&r.vh;let d=!0;r&&void 0!==r.chkDup&&(d=r.chkDup);let g=!1;r&&void 0!==r.rt&&(g=r.rt);let y=t;for(;y&&!y.hasOwnProperty(o);)y=Jd(y);if(!y&&t[o]&&(y=t),!y)return!1;if(y[l])return!1;const b=r&&r.eventNameToString,v={},w=y[l]=y[o],C=y[lf(s)]=y[s],S=y[lf(i)]=y[i],_=y[lf(a)]=y[a];let I;r&&r.prepend&&(I=y[lf(r.prepend)]=y[r.prepend]);const A=function(e){return I.call(v.target,v.eventName,e.invoke,v.options)},E=n?function(e){if(!v.isExisting)return w.call(v.target,v.eventName,v.capture?m:f,v.options)}:function(e){return w.call(v.target,v.eventName,e.invoke,v.options)},T=n?function(e){if(!e.isRemoved){const t=Lf[e.eventName];let r;t&&(r=t[e.capture?rf:nf]);const n=r&&e.target[r];if(n)for(let t=0;t<n.length;t++){if(n[t]===e){n.splice(t,1),e.isRemoved=!0,e.removeAbortListener&&(e.removeAbortListener(),e.removeAbortListener=null),0===n.length&&(e.allRemoved=!0,e.target[r]=null);break}}}if(e.allRemoved)return C.call(e.target,e.eventName,e.capture?m:f,e.options)}:function(e){return C.call(e.target,e.eventName,e.invoke,e.options)},k=r?.diff||function(e,t){const r=typeof t;return"function"===r&&e.callback===t||"object"===r&&e.originalDelegate===t},O=Zone[lf("UNPATCHED_EVENTS")],R=e[lf("PASSIVE_EVENTS")];const x=function(t,o,s,i,a=!1,l=!1){return function(){const c=this||e;let u=arguments[0];r&&r.transferEventName&&(u=r.transferEventName(u));let h=arguments[1];if(!h)return t.apply(this,arguments);if(mf&&"uncaughtException"===u)return t.apply(this,arguments);let f=!1;if("function"!=typeof h){if(!h.handleEvent)return t.apply(this,arguments);f=!0}if(p&&!p(t,h,c,arguments))return;const m=!!R&&-1!==R.indexOf(u),g=function(e){if("object"==typeof e&&null!==e){const t={...e};return e.signal&&(t.signal=e.signal),t}return e}(function(e,t){return t?"boolean"==typeof e?{capture:e,passive:!0}:e?"object"==typeof e&&!1!==e.passive?{...e,passive:!0}:e:{passive:!0}:e}(arguments[2],m)),y=g?.signal;if(y?.aborted)return;if(O)for(let e=0;e<O.length;e++)if(u===O[e])return m?t.call(c,u,h,g):t.apply(this,arguments);const w=!!g&&("boolean"==typeof g||g.capture),C=!(!g||"object"!=typeof g)&&g.once,S=Zone.current;let _=Lf[u];_||(Bf(u,b),_=Lf[u]);const I=_[w?rf:nf];let A,E=c[I],T=!1;if(E){if(T=!0,d)for(let e=0;e<E.length;e++)if(k(E[e],h))return}else E=c[I]=[];const x=c.constructor.name,N=Df[x];N&&(A=N[u]),A||(A=x+o+(b?b(u):u)),v.options=g,C&&(v.options.once=!1),v.target=c,v.capture=w,v.eventName=u,v.isExisting=T;const M=n?Mf:void 0;M&&(M.taskData=v),y&&(v.options.signal=void 0);const L=S.scheduleEventTask(A,h,M,s,i);if(y){v.options.signal=y;const e=()=>L.zone.cancelTask(L);t.call(y,"abort",e,{once:!0}),L.removeAbortListener=()=>y.removeEventListener("abort",e)}return v.target=null,M&&(M.taskData=null),C&&(v.options.once=!0),"boolean"!=typeof L.options&&(L.options=g),L.target=c,L.capture=w,L.eventName=u,f&&(L.originalDelegate=h),l?E.unshift(L):E.push(L),a?c:void 0}};return y[o]=x(w,c,E,T,g),I&&(y[u]=x(I,h,A,T,g,!0)),y[s]=function(){const t=this||e;let n=arguments[0];r&&r.transferEventName&&(n=r.transferEventName(n));const o=arguments[2],s=!!o&&("boolean"==typeof o||o.capture),i=arguments[1];if(!i)return C.apply(this,arguments);if(p&&!p(C,i,t,arguments))return;const a=Lf[n];let l;a&&(l=a[s?rf:nf]);const c=l&&t[l];if(c)for(let e=0;e<c.length;e++){const r=c[e];if(k(r,i)){if(c.splice(e,1),r.isRemoved=!0,0===c.length&&(r.allRemoved=!0,t[l]=null,!s&&"string"==typeof n)){t[of+"ON_PROPERTY"+n]=null}return r.zone.cancelTask(r),g?t:void 0}}return C.apply(this,arguments)},y[i]=function(){const t=this||e;let n=arguments[0];r&&r.transferEventName&&(n=r.transferEventName(n));const o=[],s=Zf(t,b?b(n):n);for(let e=0;e<s.length;e++){const t=s[e];let r=t.originalDelegate?t.originalDelegate:t.callback;o.push(r)}return o},y[a]=function(){const t=this||e;let n=arguments[0];if(n){r&&r.transferEventName&&(n=r.transferEventName(n));const e=Lf[n];if(e){const r=e[nf],o=e[rf],i=t[r],a=t[o];if(i){const e=i.slice();for(let t=0;t<e.length;t++){const r=e[t];let o=r.originalDelegate?r.originalDelegate:r.callback;this[s].call(this,n,o,r.options)}}if(a){const e=a.slice();for(let t=0;t<e.length;t++){const r=e[t];let o=r.originalDelegate?r.originalDelegate:r.callback;this[s].call(this,n,o,r.options)}}}}else{const e=Object.keys(t);for(let t=0;t<e.length;t++){const r=e[t],n=Pf.exec(r);let o=n&&n[1];o&&"removeListener"!==o&&this[a].call(this,o)}this[a].call(this,"removeListener")}if(g)return this},Tf(y[o],w),Tf(y[s],C),_&&Tf(y[a],_),S&&Tf(y[i],S),!0}let y=[];for(let e=0;e<r.length;e++)y[e]=g(r[e],n);return y}function Zf(e,t){if(!t){const r=[];for(let n in e){const o=Pf.exec(n);let s=o&&o[1];if(s&&(!t||s===t)){const t=e[n];if(t)for(let e=0;e<t.length;e++)r.push(t[e])}}return r}let r=Lf[t];r||(Bf(t),r=Lf[t]);const n=e[r[nf]],o=e[r[rf]];return n?o?n.concat(o):n.slice():o?o.slice():[]}function jf(e,t){const r=e.Event;r&&r.prototype&&t.patchMethod(r.prototype,"stopImmediatePropagation",e=>function(t,r){t[Ff]=!0,e&&e.apply(t,r)})}function zf(e,t){t.patchMethod(e,"queueMicrotask",e=>function(e,t){Zone.current.scheduleMicroTask("queueMicrotask",t[0])})}const Vf=lf("zoneTask");function Gf(e,t,r,n){let o=null,s=null;r+=n;const i={};function a(t){const r=t.data;r.args[0]=function(){return t.invoke.apply(this,arguments)};const n=o.apply(e,r.args);return Nf(n)?r.handleId=n:(r.handle=n,r.isRefreshable=xf(n.refresh)),t}function l(t){const{handle:r,handleId:n}=t.data;return s.call(e,r??n)}o=Af(e,t+=n,r=>function(o,s){if(xf(s[0])){const e={isRefreshable:!1,isPeriodic:"Interval"===n,delay:"Timeout"===n||"Interval"===n?s[1]||0:void 0,args:s},r=s[0];s[0]=function(){try{return r.apply(this,arguments)}finally{const{handle:t,handleId:r,isPeriodic:n,isRefreshable:o}=e;n||o||(r?delete i[r]:t&&(t[Vf]=null))}};const o=af(t,s[0],e,a,l);if(!o)return o;const{handleId:c,handle:u,isRefreshable:h,isPeriodic:p}=o.data;if(c)i[c]=o;else if(u&&(u[Vf]=o,h&&!p)){const e=u.refresh;u.refresh=function(){const{zone:t,state:r}=o;return"notScheduled"===r?(o._state="scheduled",t._updateTaskCount(o,1)):"running"===r&&(o._state="scheduling"),e.call(this)}}return u??c??o}return r.apply(e,s)}),s=Af(e,r,t=>function(r,n){const o=n[0];let s;Nf(o)?(s=i[o],delete i[o]):(s=o?.[Vf],s?o[Vf]=null:s=o),s?.type?s.cancelFn&&s.zone.cancelTask(s):t.apply(e,n)})}function Wf(e,t){if(Zone[t.symbol("patchEventTarget")])return;const{eventNames:r,zoneSymbolEventNames:n,TRUE_STR:o,FALSE_STR:s,ZONE_SYMBOL_PREFIX:i}=t.getGlobalObjects();for(let e=0;e<r.length;e++){const t=r[e],a=i+(t+s),l=i+(t+o);n[t]={},n[t][s]=a,n[t][o]=l}const a=e.EventTarget;return a&&a.prototype?(t.patchEventTarget(e,t,[a&&a.prototype]),!0):void 0}function Hf(e,t,r){if(!r||0===r.length)return t;const n=r.filter(t=>t.target===e);if(0===n.length)return t;const o=n[0].ignoreProperties;return t.filter(e=>-1===o.indexOf(e))}function Yf(e,t,r,n){if(!e)return;Sf(e,Hf(e,t,r),n)}function Kf(e){return Object.getOwnPropertyNames(e).filter(e=>e.startsWith("on")&&e.length>2).map(e=>e.substring(2))}function Jf(e,t){if(mf&&!yf)return;if(Zone[e.symbol("patchEvents")])return;const r=t.__Zone_ignore_on_properties;let n=[];if(gf){const e=window;n=n.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);const t=[];Yf(e,Kf(e),r?r.concat(t):r,Jd(e))}n=n.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let e=0;e<n.length;e++){const o=t[n[e]];o?.prototype&&Yf(o.prototype,Kf(o.prototype),r)}}function Xf(e){e.__load_patch("ZoneAwarePromise",(e,t,r)=>{const n=Object.getOwnPropertyDescriptor,o=Object.defineProperty;const s=r.symbol,i=[],a=!1!==e[s("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],l=s("Promise"),c=s("then");r.onUnhandledError=e=>{if(r.showUncaughtError()){const t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},r.microtaskDrainDone=()=>{for(;i.length;){const e=i.shift();try{e.zone.runGuarded(()=>{if(e.throwOriginal)throw e.rejection;throw e})}catch(e){h(e)}}};const u=s("unhandledPromiseRejectionHandler");function h(e){r.onUnhandledError(e);try{const r=t[u];"function"==typeof r&&r.call(this,e)}catch(e){}}function p(e){return e&&"function"==typeof e.then}function d(e){return e}function f(e){return M.reject(e)}const m=s("state"),g=s("value"),y=s("finally"),b=s("parentPromiseValue"),v=s("parentPromiseState"),w=null,C=!0,S=!1;function _(e,t){return r=>{try{T(e,t,r)}catch(t){T(e,!1,t)}}}const I=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},A="Promise resolved with itself",E=s("currentTaskTrace");function T(e,n,s){const l=I();if(e===s)throw new TypeError(A);if(e[m]===w){let c=null;try{"object"!=typeof s&&"function"!=typeof s||(c=s&&s.then)}catch(t){return l(()=>{T(e,!1,t)})(),e}if(n!==S&&s instanceof M&&s.hasOwnProperty(m)&&s.hasOwnProperty(g)&&s[m]!==w)O(s),T(e,s[m],s[g]);else if(n!==S&&"function"==typeof c)try{c.call(s,l(_(e,n)),l(_(e,!1)))}catch(t){l(()=>{T(e,!1,t)})()}else{e[m]=n;const l=e[g];if(e[g]=s,e[y]===y&&n===C&&(e[m]=e[v],e[g]=e[b]),n===S&&s instanceof Error){const e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&o(s,E,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t<l.length;)R(e,l[t++],l[t++],l[t++],l[t++]);if(0==l.length&&n==S){e[m]=0;let n=s;try{throw new Error("Uncaught (in promise): "+function(e){if(e&&e.toString===Object.prototype.toString){return(e.constructor&&e.constructor.name||"")+": "+JSON.stringify(e)}return e?e.toString():Object.prototype.toString.call(e)}(s)+(s&&s.stack?"\n"+s.stack:""))}catch(e){n=e}a&&(n.throwOriginal=!0),n.rejection=s,n.promise=e,n.zone=t.current,n.task=t.currentTask,i.push(n),r.scheduleMicroTask()}}}return e}const k=s("rejectionHandledHandler");function O(e){if(0===e[m]){try{const r=t[k];r&&"function"==typeof r&&r.call(this,{rejection:e[g],promise:e})}catch(e){}e[m]=S;for(let t=0;t<i.length;t++)e===i[t].promise&&i.splice(t,1)}}function R(e,t,r,n,o){O(e);const s=e[m],i=s?"function"==typeof n?n:d:"function"==typeof o?o:f;t.scheduleMicroTask("Promise.then",()=>{try{const n=e[g],o=!!r&&y===r[y];o&&(r[b]=n,r[v]=s);const a=t.run(i,void 0,o&&i!==f&&i!==d?[]:[n]);T(r,!0,a)}catch(e){T(r,!1,e)}},r)}const x=function(){},N=e.AggregateError;class M{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(e){return e instanceof M?e:T(new this(null),C,e)}static reject(e){return T(new this(null),S,e)}static withResolvers(){const e={};return e.promise=new M((t,r)=>{e.resolve=t,e.reject=r}),e}static any(e){if(!e||"function"!=typeof e[Symbol.iterator])return Promise.reject(new N([],"All promises were rejected"));const t=[];let r=0;try{for(let n of e)r++,t.push(M.resolve(n))}catch(e){return Promise.reject(new N([],"All promises were rejected"))}if(0===r)return Promise.reject(new N([],"All promises were rejected"));let n=!1;const o=[];return new M((e,s)=>{for(let i=0;i<t.length;i++)t[i].then(t=>{n||(n=!0,e(t))},e=>{o.push(e),r--,0===r&&(n=!0,s(new N(o,"All promises were rejected")))})})}static race(e){let t,r,n=new this((e,n)=>{t=e,r=n});function o(e){t(e)}function s(e){r(e)}for(let t of e)p(t)||(t=this.resolve(t)),t.then(o,s);return n}static all(e){return M.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof M?this:M).allWithCallback(e,{thenCallback:e=>({status:"fulfilled",value:e}),errorCallback:e=>({status:"rejected",reason:e})})}static allWithCallback(e,t){let r,n,o=new this((e,t)=>{r=e,n=t}),s=2,i=0;const a=[];for(let o of e){p(o)||(o=this.resolve(o));const e=i;try{o.then(n=>{a[e]=t?t.thenCallback(n):n,s--,0===s&&r(a)},o=>{t?(a[e]=t.errorCallback(o),s--,0===s&&r(a)):n(o)})}catch(e){n(e)}s++,i++}return s-=2,0===s&&r(a),o}constructor(e){const t=this;if(!(t instanceof M))throw new Error("Must be an instanceof Promise.");t[m]=w,t[g]=[];try{const r=I();e&&e(r(_(t,C)),r(_(t,S)))}catch(e){T(t,!1,e)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return M}then(e,r){let n=this.constructor?.[Symbol.species];n&&"function"==typeof n||(n=this.constructor||M);const o=new n(x),s=t.current;return this[m]==w?this[g].push(s,o,e,r):R(this,s,o,e,r),o}catch(e){return this.then(null,e)}finally(e){let r=this.constructor?.[Symbol.species];r&&"function"==typeof r||(r=M);const n=new r(x);n[y]=y;const o=t.current;return this[m]==w?this[g].push(o,n,e,e):R(this,o,n,e,e),n}}M.resolve=M.resolve,M.reject=M.reject,M.race=M.race,M.all=M.all;const L=e[l]=e.Promise;e.Promise=M;const D=s("thenPatched");function P(e){const t=e.prototype,r=n(t,"then");if(r&&(!1===r.writable||!r.configurable))return;const o=t.then;t[c]=o,e.prototype.then=function(e,t){const r=new M((e,t)=>{o.call(this,e,t)});return r.then(e,t)},e[D]=!0}return r.patchThen=P,L&&(P(L),Af(e,"fetch",e=>{return t=e,function(e,r){let n=t.apply(e,r);if(n instanceof M)return n;let o=n.constructor;return o[D]||P(o),n};var t})),Promise[t.__symbol__("uncaughtPromiseErrors")]=i,M})}function qf(e,t,r,n,o){const s=Zone.__symbol__(n);if(t[s])return;const i=t[s]=t[n];t[n]=function(s,a,l){return a&&a.prototype&&o.forEach(function(t){const o=`${r}.${n}::`+t,s=a.prototype;try{if(s.hasOwnProperty(t)){const r=e.ObjectGetOwnPropertyDescriptor(s,t);r&&r.value?(r.value=e.wrapWithCurrentZone(r.value,o),e._redefineProperty(a.prototype,t,r)):s[t]&&(s[t]=e.wrapWithCurrentZone(s[t],o))}else s[t]&&(s[t]=e.wrapWithCurrentZone(s[t],o))}catch{}}),i.call(t,s,a,l)},e.attachOriginToPatched(t[n],i)}const Qf=function(){const e=globalThis,t=!0===e[Hd("forceDuplicateZoneCheck")];if(e.Zone&&(t||"function"!=typeof e.Zone.__symbol__))throw new Error("Zone already loaded.");return e.Zone??=function(){const e=Wd.performance;function t(t){e&&e.mark&&e.mark(t)}function r(t,r){e&&e.measure&&e.measure(t,r)}t("Zone");class n{static __symbol__=Hd;static assertZonePatched(){if(Wd.Promise!==E.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let e=n.current;for(;e.parent;)e=e.parent;return e}static get current(){return k.zone}static get currentTask(){return O}static __load_patch(e,o,s=!1){if(E.hasOwnProperty(e)){const t=!0===Wd[Hd("forceDuplicateZoneCheck")];if(!s&&t)throw Error("Already loaded patch: "+e)}else if(!Wd["__Zone_disable_"+e]){const s="Zone:"+e;t(s),E[e]=o(Wd,n,T),r(s,s)}}get parent(){return this._parent}get name(){return this._name}_parent;_name;_properties;_zoneDelegate;constructor(e,t){this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new s(this,this._parent&&this._parent._zoneDelegate,t)}get(e){const t=this.getZoneWith(e);if(t)return t._properties[e]}getZoneWith(e){let t=this;for(;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}fork(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}wrap(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);const r=this._zoneDelegate.intercept(this,e,t),n=this;return function(){return n.runGuarded(r,this,arguments,t)}}run(e,t,r,n){k={parent:k,zone:this};try{return this._zoneDelegate.invoke(this,e,t,r,n)}finally{k=k.parent}}runGuarded(e,t=null,r,n){k={parent:k,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,r,n)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{k=k.parent}}runTask(e,t,r){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||g).name+"; Execution: "+this.name+")");const n=e,{type:o,data:{isPeriodic:s=!1,isRefreshable:i=!1}={}}=e;if(e.state===y&&(o===A||o===I))return;const a=e.state!=w;a&&n._transitionTo(w,v);const l=O;O=n,k={parent:k,zone:this};try{o!=I||!e.data||s||i||(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,n,t,r)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{const t=e.state;if(t!==y&&t!==S)if(o==A||s||i&&t===b)a&&n._transitionTo(v,w,b);else{const e=n._zoneDelegates;this._updateTaskCount(n,-1),a&&n._transitionTo(y,w,y),i&&(n._zoneDelegates=e)}k=k.parent,O=l}}scheduleTask(e){if(e.zone&&e.zone!==this){let t=this;for(;t;){if(t===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);t=t.parent}}e._transitionTo(b,y);const t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(t){throw e._transitionTo(S,b,y),this._zoneDelegate.handleError(this,t),t}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==b&&e._transitionTo(v,b),e}scheduleMicroTask(e,t,r,n){return this.scheduleTask(new i(_,e,t,r,n,void 0))}scheduleMacroTask(e,t,r,n,o){return this.scheduleTask(new i(I,e,t,r,n,o))}scheduleEventTask(e,t,r,n,o){return this.scheduleTask(new i(A,e,t,r,n,o))}cancelTask(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||g).name+"; Execution: "+this.name+")");if(e.state===v||e.state===w){e._transitionTo(C,v,w);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(S,C),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(y,C),e.runCount=-1,e}}_updateTaskCount(e,t){const r=e._zoneDelegates;-1==t&&(e._zoneDelegates=null);for(let n=0;n<r.length;n++)r[n]._updateTaskCount(e.type,t)}}const o={name:"",onHasTask:(e,t,r,n)=>e.hasTask(r,n),onScheduleTask:(e,t,r,n)=>e.scheduleTask(r,n),onInvokeTask:(e,t,r,n,o,s)=>e.invokeTask(r,n,o,s),onCancelTask:(e,t,r,n)=>e.cancelTask(r,n)};class s{get zone(){return this._zone}_zone;_taskCounts={microTask:0,macroTask:0,eventTask:0};_parentDelegate;_forkDlgt;_forkZS;_forkCurrZone;_interceptDlgt;_interceptZS;_interceptCurrZone;_invokeDlgt;_invokeZS;_invokeCurrZone;_handleErrorDlgt;_handleErrorZS;_handleErrorCurrZone;_scheduleTaskDlgt;_scheduleTaskZS;_scheduleTaskCurrZone;_invokeTaskDlgt;_invokeTaskZS;_invokeTaskCurrZone;_cancelTaskDlgt;_cancelTaskZS;_cancelTaskCurrZone;_hasTaskDlgt;_hasTaskDlgtOwner;_hasTaskZS;_hasTaskCurrZone;constructor(e,t,r){this._zone=e,this._parentDelegate=t,this._forkZS=r&&(r&&r.onFork?r:t._forkZS),this._forkDlgt=r&&(r.onFork?t:t._forkDlgt),this._forkCurrZone=r&&(r.onFork?this._zone:t._forkCurrZone),this._interceptZS=r&&(r.onIntercept?r:t._interceptZS),this._interceptDlgt=r&&(r.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=r&&(r.onIntercept?this._zone:t._interceptCurrZone),this._invokeZS=r&&(r.onInvoke?r:t._invokeZS),this._invokeDlgt=r&&(r.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=r&&(r.onInvoke?this._zone:t._invokeCurrZone),this._handleErrorZS=r&&(r.onHandleError?r:t._handleErrorZS),this._handleErrorDlgt=r&&(r.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=r&&(r.onHandleError?this._zone:t._handleErrorCurrZone),this._scheduleTaskZS=r&&(r.onScheduleTask?r:t._scheduleTaskZS),this._scheduleTaskDlgt=r&&(r.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=r&&(r.onScheduleTask?this._zone:t._scheduleTaskCurrZone),this._invokeTaskZS=r&&(r.onInvokeTask?r:t._invokeTaskZS),this._invokeTaskDlgt=r&&(r.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=r&&(r.onInvokeTask?this._zone:t._invokeTaskCurrZone),this._cancelTaskZS=r&&(r.onCancelTask?r:t._cancelTaskZS),this._cancelTaskDlgt=r&&(r.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=r&&(r.onCancelTask?this._zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const n=r&&r.onHasTask,s=t&&t._hasTaskZS;(n||s)&&(this._hasTaskZS=n?r:o,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,r.onScheduleTask||(this._scheduleTaskZS=o,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this._zone),r.onInvokeTask||(this._invokeTaskZS=o,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this._zone),r.onCancelTask||(this._cancelTaskZS=o,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this._zone))}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new n(e,t)}intercept(e,t,r){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,r):t}invoke(e,t,r,n,o){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,r,n,o):t.apply(r,n)}handleError(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)}scheduleTask(e,t){let r=t;if(this._scheduleTaskZS)this._hasTaskZS&&r._zoneDelegates.push(this._hasTaskDlgtOwner),r=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),r||(r=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=_)throw new Error("Task is missing scheduleFn.");f(t)}return r}invokeTask(e,t,r,n){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,r,n):t.callback.apply(r,n)}cancelTask(e,t){let r;if(this._cancelTaskZS)r=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");r=t.cancelFn(t)}return r}hasTask(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(t){this.handleError(e,t)}}_updateTaskCount(e,t){const r=this._taskCounts,n=r[e],o=r[e]=n+t;if(o<0)throw new Error("More tasks executed then were scheduled.");if(0==n||0==o){const t={microTask:r.microTask>0,macroTask:r.macroTask>0,eventTask:r.eventTask>0,change:e};this.hasTask(this._zone,t)}}}class i{type;source;invoke;callback;data;scheduleFn;cancelFn;_zone=null;runCount=0;_zoneDelegates=null;_state="notScheduled";constructor(e,t,r,n,o,s){if(this.type=e,this.source=t,this.data=n,this.scheduleFn=o,this.cancelFn=s,!r)throw new Error("callback is not defined");this.callback=r;const a=this;e===A&&n&&n.useG?this.invoke=i.invokeTask:this.invoke=function(){return i.invokeTask.call(Wd,a,this,arguments)}}static invokeTask(e,t,r){e||(e=this),R++;try{return e.runCount++,e.zone.runTask(e,t,r)}finally{1==R&&m(),R--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(y,b)}_transitionTo(e,t,r){if(this._state!==t&&this._state!==r)throw new Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${r?" or '"+r+"'":""}, was '${this._state}'.`);this._state=e,e==y&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const a=Hd("setTimeout"),l=Hd("Promise"),c=Hd("then");let u,h=[],p=!1;function d(e){if(u||Wd[l]&&(u=Wd[l].resolve(0)),u){let t=u[c];t||(t=u.then),t.call(u,e)}else Wd[a](e,0)}function f(e){0===R&&0===h.length&&d(m),e&&h.push(e)}function m(){if(!p){for(p=!0;h.length;){const e=h;h=[];for(let t=0;t<e.length;t++){const r=e[t];try{r.zone.runTask(r,null,null)}catch(e){T.onUnhandledError(e)}}}T.microtaskDrainDone(),p=!1}}const g={name:"NO ZONE"},y="notScheduled",b="scheduling",v="scheduled",w="running",C="canceling",S="unknown",_="microTask",I="macroTask",A="eventTask",E={},T={symbol:Hd,currentZoneFrame:()=>k,onUnhandledError:x,microtaskDrainDone:x,scheduleMicroTask:f,showUncaughtError:()=>!n[Hd("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:x,patchMethod:()=>x,bindArguments:()=>[],patchThen:()=>x,patchMacroTask:()=>x,patchEventPrototype:()=>x,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>x,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>x,wrapWithCurrentZone:()=>x,filterProperties:()=>[],attachOriginToPatched:()=>x,_redefineProperty:()=>x,patchCallbacks:()=>x,nativeScheduleMicroTask:d};let k={parent:null,zone:new n(null,null)},O=null,R=0;function x(){}return r("Zone","Zone"),n}(),e.Zone}();!function(e){Xf(e),function(e){e.__load_patch("toString",e=>{const t=Function.prototype.toString,r=lf("OriginalDelegate"),n=lf("Promise"),o=lf("Error"),s=function(){if("function"==typeof this){const s=this[r];if(s)return"function"==typeof s?t.call(s):Object.prototype.toString.call(s);if(this===Promise){const r=e[n];if(r)return t.call(r)}if(this===Error){const r=e[o];if(r)return t.call(r)}}return t.call(this)};s[r]=t,Function.prototype.toString=s;const i=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":i.call(this)}})}(e),function(e){e.__load_patch("util",(e,t,r)=>{const n=Kf(e);r.patchOnProperties=Sf,r.patchMethod=Af,r.bindArguments=pf,r.patchMacroTask=Ef;const o=t.__symbol__("BLACK_LISTED_EVENTS"),s=t.__symbol__("UNPATCHED_EVENTS");e[s]&&(e[o]=e[s]),e[o]&&(t[o]=t[s]=e[o]),r.patchEventPrototype=jf,r.patchEventTarget=Uf,r.isIEOrEdge=Rf,r.ObjectDefineProperty=Kd,r.ObjectGetOwnPropertyDescriptor=Yd,r.ObjectCreate=Xd,r.ArraySlice=qd,r.patchClass=If,r.wrapWithCurrentZone=sf,r.filterProperties=Hf,r.attachOriginToPatched=Tf,r._redefineProperty=Object.defineProperty,r.patchCallbacks=qf,r.getGlobalObjects=()=>({globalSources:Df,zoneSymbolEventNames:Lf,eventNames:n,isBrowser:gf,isMix:yf,isNode:mf,TRUE_STR:rf,FALSE_STR:nf,ZONE_SYMBOL_PREFIX:of,ADD_EVENT_LISTENER_STR:Qd,REMOVE_EVENT_LISTENER_STR:$d})})}(e)}(Qf),function(e){e.__load_patch("legacy",t=>{const r=t[e.__symbol__("legacyPatch")];r&&r()}),e.__load_patch("timers",e=>{const t="set",r="clear";Gf(e,t,r,"Timeout"),Gf(e,t,r,"Interval"),Gf(e,t,r,"Immediate")}),e.__load_patch("requestAnimationFrame",e=>{Gf(e,"request","cancel","AnimationFrame"),Gf(e,"mozRequest","mozCancel","AnimationFrame"),Gf(e,"webkitRequest","webkitCancel","AnimationFrame")}),e.__load_patch("blocking",(e,t)=>{const r=["alert","prompt","confirm"];for(let n=0;n<r.length;n++){Af(e,r[n],(r,n,o)=>function(n,s){return t.current.run(r,e,s,o)})}}),e.__load_patch("EventTarget",(e,t,r)=>{!function(e,t){t.patchEventPrototype(e,t)}(e,r),Wf(e,r);const n=e.XMLHttpRequestEventTarget;n&&n.prototype&&r.patchEventTarget(e,r,[n.prototype])}),e.__load_patch("MutationObserver",(e,t,r)=>{If("MutationObserver"),If("WebKitMutationObserver")}),e.__load_patch("IntersectionObserver",(e,t,r)=>{If("IntersectionObserver")}),e.__load_patch("FileReader",(e,t,r)=>{If("FileReader")}),e.__load_patch("on_property",(e,t,r)=>{Jf(r,e)}),e.__load_patch("customElements",(e,t,r)=>{!function(e,t){const{isBrowser:r,isMix:n}=t.getGlobalObjects();if(!r&&!n||!e.customElements||!("customElements"in e))return;t.patchCallbacks(t,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"])}(e,r)}),e.__load_patch("XHR",(e,t)=>{!function(e){const l=e.XMLHttpRequest;if(!l)return;const c=l.prototype;let u=c[ef],h=c[tf];if(!u){const t=e.XMLHttpRequestEventTarget;if(t){const e=t.prototype;u=e[ef],h=e[tf]}}const p="readystatechange",d="scheduled";function f(e){const n=e.data,i=n.target;i[s]=!1,i[a]=!1;const l=i[o];u||(u=i[ef],h=i[tf]),l&&h.call(i,p,l);const c=i[o]=()=>{if(i.readyState===i.DONE)if(!n.aborted&&i[s]&&e.state===d){const r=i[t.__symbol__("loadfalse")];if(0!==i.status&&r&&r.length>0){const o=e.invoke;e.invoke=function(){const r=i[t.__symbol__("loadfalse")];for(let t=0;t<r.length;t++)r[t]===e&&r.splice(t,1);n.aborted||e.state!==d||o.call(e)},r.push(e)}else e.invoke()}else n.aborted||!1!==i[s]||(i[a]=!0)};u.call(i,p,c);return i[r]||(i[r]=e),w.apply(i,n.args),i[s]=!0,e}function m(){}function g(e){const t=e.data;return t.aborted=!0,C.apply(t.target,t.args)}const y=Af(c,"open",()=>function(e,t){return e[n]=0==t[2],e[i]=t[1],y.apply(e,t)}),b=lf("fetchTaskAborting"),v=lf("fetchTaskScheduling"),w=Af(c,"send",()=>function(e,r){if(!0===t.current[v])return w.apply(e,r);if(e[n])return w.apply(e,r);{const t={target:e,url:e[i],isPeriodic:!1,args:r,aborted:!1},n=af("XMLHttpRequest.send",m,t,f,g);e&&!0===e[a]&&!t.aborted&&n.state===d&&n.invoke()}}),C=Af(c,"abort",()=>function(e,n){const o=e[r];if(o&&"string"==typeof o.type){if(null==o.cancelFn||o.data&&o.data.aborted)return;o.zone.cancelTask(o)}else if(!0===t.current[b])return C.apply(e,n)})}(e);const r=lf("xhrTask"),n=lf("xhrSync"),o=lf("xhrListener"),s=lf("xhrScheduled"),i=lf("xhrURL"),a=lf("xhrErrorBeforeScheduled")}),e.__load_patch("geolocation",e=>{e.navigator&&e.navigator.geolocation&&function(e,t){const r=e.constructor.name;for(let n=0;n<t.length;n++){const o=t[n],s=e[o];if(s){if(!df(Yd(e,o)))continue;e[o]=(e=>{const t=function(){return e.apply(this,pf(arguments,r+"."+o))};return Tf(t,e),t})(s)}}}(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),e.__load_patch("PromiseRejectionEvent",(e,t)=>{function r(t){return function(r){Zf(e,t).forEach(n=>{const o=e.PromiseRejectionEvent;if(o){const e=new o(t,{promise:r.promise,reason:r.rejection});n.invoke(e)}})}}e.PromiseRejectionEvent&&(t[lf("unhandledPromiseRejectionHandler")]=r("unhandledrejection"),t[lf("rejectionHandledHandler")]=r("rejectionhandled"))}),e.__load_patch("queueMicrotask",(e,t,r)=>{zf(e,r)})}(Qf);var $f;!function(e){e.METHOD_OPEN="open",e.METHOD_SEND="send",e.EVENT_ABORT="abort",e.EVENT_ERROR="error",e.EVENT_LOAD="loaded",e.EVENT_TIMEOUT="timeout"}($f||($f={}));const em=oh.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function tm(e){return t=e,"undefined"!=typeof Document&&t instanceof Document?(new XMLSerializer).serializeToString(document).length:"string"==typeof e?nm(e):e instanceof Blob?e.size:e instanceof FormData?function(e){let t=0;for(const[r,n]of e.entries())t+=r.length,n instanceof Blob?t+=n.size:t+=n.length;return t}(e):e instanceof URLSearchParams?nm(e.toString()):void 0!==e.byteLength?e.byteLength:void em.warn("unknown body type");var t}const rm=new TextEncoder;function nm(e){return rm.encode(e).byteLength}function om(e){const t=function(){void 0===im&&(im=sm);return im}(),r=e.toUpperCase();return r in t?r:"_OTHER"}const sm={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let im;const am={"https:":"443","http:":"80"};const lm="0.203.0";var cm;!function(e){e.HTTP_STATUS_TEXT="http.status_text"}(cm||(cm={}));class um extends Ld{component="xml-http-request";version=lm;moduleName=this.component;_tasksCount=0;_xhrMem=new WeakMap;_usedResources=new WeakSet;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-xml-http-request",lm,e),this._semconvStability=Ud("http",e?.semconvStabilityOptIn)}init(){}_addHeaders(e,t){if(!gd(md(t).href,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return yh.inject(nh.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}const r={};yh.inject(nh.active(),r),Object.keys(r).forEach(t=>{e.setRequestHeader(t,String(r[t]))})}_addChildSpan(e,t){nh.with(vh.setSpan(nh.active(),e),()=>{const e=this.tracer.startSpan("CORS Preflight",{startTime:t[sd.FETCH_START]}),r=!(this._semconvStability&Fd.OLD);pd(e,t,this.getConfig().ignoreNetworkEvents,void 0,r),e.end(t[sd.RESPONSE_END])})}_addFinalSpanAttributes(e,t,r){if(this._semconvStability&Fd.OLD){if(void 0!==t.status&&e.setAttribute("http.status_code",t.status),void 0!==t.statusText&&e.setAttribute(cm.HTTP_STATUS_TEXT,t.statusText),"string"==typeof r){const t=md(r);e.setAttribute("http.host",t.host),e.setAttribute("http.scheme",t.protocol.replace(":",""))}e.setAttribute("http.user_agent",navigator.userAgent)}this._semconvStability&Fd.STABLE&&t.status&&e.setAttribute(Uh,t.status)}_applyAttributesAfterXHR(e,t){const r=this.getConfig().applyCustomAttributesOnSpan;"function"==typeof r&&Dd(()=>r(e,t),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_addResourceObserver(e,t){const r=this._xhrMem.get(e);r&&"function"==typeof PerformanceObserver&&"function"==typeof PerformanceResourceTiming&&(r.createdResources={observer:new PerformanceObserver(e=>{const n=e.getEntries(),o=md(t);n.forEach(e=>{"xmlhttprequest"===e.initiatorType&&e.name===o.href&&r.createdResources&&r.createdResources.entries.push(e)})}),entries:[]},r.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(Nh.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,r,n,o){if(!(r&&n&&o&&e.createdResources))return;let s=e.createdResources.entries;s&&s.length||(s=Nh.getEntriesByType("resource"));const i=fd(md(r).href,n,o,s,this._usedResources);if(i.mainRequest){const e=i.mainRequest;this._markResourceAsUsed(e);const r=i.corsPreFlightRequest;r&&(this._addChildSpan(t,r),this._markResourceAsUsed(r));const n=!(this._semconvStability&Fd.OLD);pd(t,e,this.getConfig().ignoreNetworkEvents,void 0,n)}}_cleanPreviousSpanInformation(e){const t=this._xhrMem.get(e);if(t){const r=t.callbackToRemoveEvents;r&&r(),this._xhrMem.delete(e)}}_createSpan(e,t,r){if(Lp(t,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let n="";const o=md(t),s={};if(this._semconvStability&Fd.OLD&&(n=r.toUpperCase(),s["http.method"]=r,s["http.url"]=o.toString()),this._semconvStability&Fd.STABLE){const e=r,t=om(r);n||(n=t),s[Fh]=t,t!==e&&(s[Bh]=e),s[Hh]=o.toString(),s[Zh]=o.hostname;const i=function(e){const t=Number(e.port||am[e.protocol]);return t&&!isNaN(t)?t:void 0}(o);i&&(s[jh]=i)}const i=this.tracer.startSpan(n,{kind:qu.CLIENT,attributes:s});return i.addEvent($f.METHOD_OPEN),this._cleanPreviousSpanInformation(e),this._xhrMem.set(e,{span:i,spanUrl:t}),i}_markResourceAsUsed(e){this._usedResources.add(e)}_patchOpen(){return e=>{const t=this;return function(...r){const n=r[0],o=r[1];return t._createSpan(this,o,n),e.apply(this,r)}}}_patchSend(){const e=this;function t(t,r,n,o){const s=e._xhrMem.get(r);if(!s)return;if(s.status=r.status,s.statusText=r.statusText,e._xhrMem.delete(r),s.span){const t=s.span;e._applyAttributesAfterXHR(t,r),e._semconvStability&Fd.STABLE&&(n?o&&(t.setStatus({code:Qu.ERROR,message:o}),t.setAttribute(Lh,o)):s.status&&s.status>=400&&(t.setStatus({code:Qu.ERROR}),t.setAttribute(Lh,String(s.status))))}const i=$h(),a=Date.now();setTimeout(()=>{!function(t,r,n,o){const s=r.callbackToRemoveEvents;"function"==typeof s&&s();const{span:i,spanUrl:a,sendStartTime:l}=r;i&&(e._findResourceAndAddNetworkEvents(r,i,a,l,n),i.addEvent(t,o),e._addFinalSpanAttributes(i,r,a),i.end(o),e._tasksCount--),e._clearResources()}(t,s,i,a)},300)}function r(){t($f.EVENT_ERROR,this,!0,"error")}function n(){t($f.EVENT_ABORT,this,!1)}function o(){t($f.EVENT_TIMEOUT,this,!0,"timeout")}function s(){this.status<299?t($f.EVENT_LOAD,this,!1):t($f.EVENT_ERROR,this,!1)}return t=>function(...i){const a=e._xhrMem.get(this);if(!a)return t.apply(this,i);const l=a.span,c=a.spanUrl;if(l&&c){if(e.getConfig().measureRequestSize&&i?.[0]){const t=tm(i[0]);void 0!==t&&(e._semconvStability&Fd.OLD&&l.setAttribute("http.request_content_length_uncompressed",t),e._semconvStability&Fd.STABLE&&l.setAttribute("http.request.body.size",t))}nh.with(vh.setSpan(nh.active(),l),()=>{e._tasksCount++,a.sendStartTime=$h(),l.addEvent($f.METHOD_SEND),this.addEventListener("abort",n),this.addEventListener("error",r),this.addEventListener("load",s),this.addEventListener("timeout",o),a.callbackToRemoveEvents=()=>{!function(t){t.removeEventListener("abort",n),t.removeEventListener("error",r),t.removeEventListener("load",s),t.removeEventListener("timeout",o);const i=e._xhrMem.get(t);i&&(i.callbackToRemoveEvents=void 0)}(this),a.createdResources&&a.createdResources.observer.disconnect()},e._addHeaders(this,c),e._addResourceObserver(this,c)})}return t.apply(this,i)}}enable(){this._diag.debug("applying patch to",this.moduleName,this.version),Pd(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),Pd(XMLHttpRequest.prototype.send)&&(this._unwrap(XMLHttpRequest.prototype,"send"),this._diag.debug("removing previous patch from method send")),this._wrap(XMLHttpRequest.prototype,"open",this._patchOpen()),this._wrap(XMLHttpRequest.prototype,"send",this._patchSend())}disable(){this._diag.debug("removing patch from",this.moduleName,this.version),this._unwrap(XMLHttpRequest.prototype,"open"),this._unwrap(XMLHttpRequest.prototype,"send"),this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet}}var hm;!function(e){e.COMPONENT="component",e.HTTP_STATUS_TEXT="http.status_text"}(hm||(hm={}));var pm={};Object.defineProperty(pm,"__esModule",{value:!0});var dm=pm.ATTR_HTTP_USER_AGENT=pm.ATTR_HTTP_URL=pm.ATTR_HTTP_STATUS_CODE=pm.ATTR_HTTP_SCHEME=pm.ATTR_HTTP_RESPONSE_CONTENT_LENGTH=pm.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=pm.ATTR_HTTP_REQUEST_BODY_SIZE=pm.ATTR_HTTP_METHOD=pm.ATTR_HTTP_HOST=void 0,fm=pm.ATTR_HTTP_HOST="http.host",mm=pm.ATTR_HTTP_METHOD="http.method",gm=pm.ATTR_HTTP_REQUEST_BODY_SIZE="http.request.body.size",ym=pm.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED="http.request_content_length_uncompressed";pm.ATTR_HTTP_RESPONSE_CONTENT_LENGTH="http.response_content_length";var bm=pm.ATTR_HTTP_SCHEME="http.scheme",vm=pm.ATTR_HTTP_STATUS_CODE="http.status_code",wm=pm.ATTR_HTTP_URL="http.url";dm=pm.ATTR_HTTP_USER_AGENT="http.user_agent";const Cm=oh.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function Sm(...e){if(e[0]instanceof URL||"string"==typeof e[0]){const t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){const{body:e,length:r}=function(e){if(!e.pipeThrough)return Cm.warn("Platform has ReadableStream but not pipeThrough!"),{body:e,length:Promise.resolve(void 0)};let t,r=0;const n=new Promise(e=>{t=e}),o=new TransformStream({start(){},async transform(e,t){const n=await e;r+=n.byteLength,t.enqueue(e)},flush(){t(r)}});return{body:e.pipeThrough(o),length:n}}(t.body);return t.body=e,r}return Promise.resolve(function(e){if(t=e,"undefined"!=typeof Document&&t instanceof Document)return(new XMLSerializer).serializeToString(document).length;var t;if("string"==typeof e)return Im(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return function(e){let t=0;for(const[r,n]of e.entries())t+=r.length,n instanceof Blob?t+=n.size:t+=n.length;return t}(e);if(e instanceof URLSearchParams)return Im(e.toString());if(void 0!==e.byteLength)return e.byteLength;return void Cm.warn("unknown body type")}(t.body))}{const t=e[0];return t?.body?t.clone().text().then(e=>Im(e)):Promise.resolve()}}const _m=new TextEncoder;function Im(e){return _m.encode(e).byteLength}const Am={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let Em;function Tm(){return void 0===Em&&(Em=Am),Em}const km={"https:":"443","http:":"80"};const Om="0.203.0",Rm="object"==typeof process&&"node"===process.release?.name;class xm extends Ld{component="fetch";version=Om;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-fetch",Om,e),this._semconvStability=Ud("http",e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){const r=this.tracer.startSpan("CORS Preflight",{startTime:t[sd.FETCH_START]},vh.setSpan(nh.active(),e)),n=!(this._semconvStability&Fd.OLD);pd(r,t,this.getConfig().ignoreNetworkEvents,void 0,n),r.end(t[sd.RESPONSE_END])}_addFinalSpanAttributes(e,t){const r=md(t.url);if(this._semconvStability&Fd.OLD&&(e.setAttribute(vm,t.status),null!=t.statusText&&e.setAttribute(hm.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(fm,r.host),e.setAttribute(bm,r.protocol.replace(":","")),"undefined"!=typeof navigator&&e.setAttribute(dm,navigator.userAgent)),this._semconvStability&Fd.STABLE){e.setAttribute(Uh,t.status),e.setAttribute(Zh,r.hostname);const n=function(e){const t=Number(e.port||km[e.protocol]);return t&&!isNaN(t)?t:void 0}(r);n&&e.setAttribute(jh,n)}}_addHeaders(e,t){if(!gd(t,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return yh.inject(nh.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(e instanceof Request)yh.inject(nh.active(),e.headers,{set:(e,t,r)=>e.set(t,"string"==typeof r?r:String(r))});else if(e.headers instanceof Headers)yh.inject(nh.active(),e.headers,{set:(e,t,r)=>e.set(t,"string"==typeof r?r:String(r))});else if(e.headers instanceof Map)yh.inject(nh.active(),e.headers,{set:(e,t,r)=>e.set(t,"string"==typeof r?r:String(r))});else{const t={};yh.inject(nh.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(Lp(e,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let r="";const n={};if(this._semconvStability&Fd.OLD){const o=(t.method||"GET").toUpperCase();r=`HTTP ${o}`,n[hm.COMPONENT]=this.moduleName,n[mm]=o,n[wm]=e}if(this._semconvStability&Fd.STABLE){const o=t.method,s=function(e){const t=Tm(),r=e.toUpperCase();return r in t?r:"_OTHER"}(t.method||"GET");r||(r=s),n[Fh]=s,s!==o&&(n[Bh]=o),n[Hh]=e}return this.tracer.startSpan(r,{kind:qu.CLIENT,attributes:n})}_findResourceAndAddNetworkEvents(e,t,r){let n=t.entries;if(!n.length){if(!performance.getEntriesByType)return;n=performance.getEntriesByType("resource")}const o=fd(t.spanUrl,t.startTime,r,n,this._usedResources,"fetch");if(o.mainRequest){const t=o.mainRequest;this._markResourceAsUsed(t);const r=o.corsPreFlightRequest;r&&(this._addChildSpan(e,r),this._markResourceAsUsed(r));const n=!(this._semconvStability&Fd.OLD);pd(e,t,this.getConfig().ignoreNetworkEvents,void 0,n)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,r){const n=qh(Date.now()),o=$h();this._addFinalSpanAttributes(e,r),this._semconvStability&Fd.STABLE&&r.status>=400&&(e.setStatus({code:Qu.ERROR}),e.setAttribute(Lh,String(r.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,o),this._tasksCount--,this._clearResources(),e.end(n)},300)}_patchConstructor(){return e=>{const t=this;return function(...r){const n=this,o=md(r[0]instanceof Request?r[0].url:String(r[0])).href,s=r[0]instanceof Request?r[0]:r[1]||{},i=t._createSpan(o,s);if(!i)return e.apply(this,r);const a=t._prepareSpanData(o);function l(e,r){t._applyAttributesAfterFetch(e,s,r),t._endSpan(e,a,{status:r.status||0,statusText:r.message,url:o})}function c(e,r){t._applyAttributesAfterFetch(e,s,r),r.status>=200&&r.status<400?t._endSpan(e,a,r):t._endSpan(e,a,{status:r.status,statusText:r.statusText,url:o})}function u(e,t,r){try{const t=r.clone().body;if(t){const n=t.getReader(),o=()=>{n.read().then(({done:t})=>{t?c(e,r):o()},t=>{l(e,t)})};o()}else c(e,r)}finally{t(r)}}function h(e,t,r){try{l(e,r)}finally{t(r)}}return t.getConfig().measureRequestSize&&Sm(...r).then(e=>{e&&(t._semconvStability&Fd.OLD&&i.setAttribute(ym,e),t._semconvStability&Fd.STABLE&&i.setAttribute(gm,e))}).catch(e=>{t._diag.warn("getFetchBodyLength",e)}),new Promise((r,a)=>nh.with(vh.setSpan(nh.active(),i),()=>(t._addHeaders(s,o),t._callRequestHook(i,s),t._tasksCount++,e.apply(n,s instanceof Request?[s]:[o,s]).then(u.bind(n,i,r),h.bind(n,i,a)))))}}}_applyAttributesAfterFetch(e,t,r){const n=this.getConfig().applyCustomAttributesOnSpan;n&&Dd(()=>n(e,t,r),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_callRequestHook(e,t){const r=this.getConfig().requestHook;r&&Dd(()=>r(e,t),e=>{e&&this._diag.error("requestHook",e)})}_prepareSpanData(e){const t=$h(),r=[];if("function"!=typeof PerformanceObserver)return{entries:r,startTime:t,spanUrl:e};const n=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{"fetch"===t.initiatorType&&t.name===e&&r.push(t)})});return n.observe({entryTypes:["resource"]}),{entries:r,observer:n,startTime:t,spanUrl:e}}enable(){Rm?this._diag.warn("this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()"):(Pd(fetch)&&(this._unwrap(xh,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(xh,"fetch",this._patchConstructor()))}disable(){Rm||(this._unwrap(xh,"fetch"),this._usedResources=new WeakSet)}}class Nm{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class Mm extends Error{code;name="OTLPExporterError";data;constructor(e,t,r){super(e),this.data=r,this.code=t}}function Lm(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function Dm(e){if(null!=e)return()=>e}function Pm(e,t,r){return{timeoutMillis:Lm(e.timeoutMillis??t.timeoutMillis??r.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??r.concurrencyLimit,compression:e.compression??t.compression??r.compression}}class Fm{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);const t=()=>{const t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function Bm(e){return new Fm(e.concurrencyLimit)}function Um(){return{handleResponse(e){null!=e&&function(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}(e)&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&oh.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}class Zm{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,r,n,o){this._transport=e,this._serializer=t,this._responseHandler=r,this._promiseQueue=n,this._timeout=o,this._diagLogger=oh.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit())return void t({code:sp.FAILED,error:new Error("Concurrent export limit reached")});const r=this._serializer.serializeRequest(e);null!=r?this._promiseQueue.pushPromise(this._transport.send(r,this._timeout).then(e=>{if("success"!==e.status)"failure"===e.status&&e.error?t({code:sp.FAILED,error:e.error}):"retryable"===e.status?t({code:sp.FAILED,error:new Mm("Export failed with retryable status")}):t({code:sp.FAILED,error:new Mm("Export failed with unknown error")});else{if(null!=e.data)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",t,e.data)}t({code:sp.SUCCESS})}},e=>t({code:sp.FAILED,error:e}))):t({code:sp.FAILED,error:new Error("Nothing to send")})}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function jm(e,t,r){return n={transport:r,serializer:t,promiseHandler:Bm(e)},o={timeout:e.timeoutMillis},new Zm(n.transport,n.serializer,Um(),n.promiseHandler,o.timeout);var n,o}function zm(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Vm(e){const t=new Uint8Array(e.length/2);let r=0;for(let n=0;n<e.length;n+=2){const o=zm(e.charCodeAt(n)),s=zm(e.charCodeAt(n+1));t[r++]=o<<4|s}return t}function Gm(e){const t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}const Wm="undefined"!=typeof BigInt?function(e){return Gm(e).toString()}:tp;function Hm(e){return e}const Ym={encodeHrTime:function(e){const t=Gm(e);return r=t,{low:Number(BigInt.asUintN(32,r)),high:Number(BigInt.asUintN(32,r>>BigInt(32)))};var r},encodeSpanContext:Vm,encodeOptionalSpanContext:function(e){if(void 0!==e)return Vm(e)}};function Km(e){return{attributes:Xm(e.attributes),droppedAttributesCount:0}}function Jm(e){return{name:e.name,version:e.version}}function Xm(e){return Object.keys(e).map(t=>qm(t,e[t]))}function qm(e,t){return{key:e,value:Qm(t)}}function Qm(e){const t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(Qm)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map(([e,t])=>qm(e,t))}}:{}}function $m(e,t){const r=e.spanContext(),n=e.status,o=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(r.traceId),spanId:t.encodeSpanContext(r.spanId),parentSpanId:o,traceState:r.traceState?.serialize(),name:e.name,kind:null==e.kind?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:Xm(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>function(e,t){return{attributes:e.attributes?Xm(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:n.code,message:n.message},links:e.links.map(e=>function(e,t){return{attributes:e.attributes?Xm(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}(e,t)),droppedLinksCount:e.droppedLinksCount}}function eg(e,t){const r=function(e){return void 0===e?Ym:{encodeHrTime:Wm,encodeSpanContext:Hm,encodeOptionalSpanContext:Hm}}(t);return{resourceSpans:tg(e,r)}}function tg(e,t){const r=function(e){const t=new Map;for(const r of e){let e=t.get(r.resource);e||(e=new Map,t.set(r.resource,e));const n=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`;let o=e.get(n);o||(o=[],e.set(n,o)),o.push(r)}return t}(e),n=[],o=r.entries();let s=o.next();for(;!s.done;){const[e,r]=s.value,i=[],a=r.values();let l=a.next();for(;!l.done;){const e=l.value;if(e.length>0){const r=e.map(e=>$m(e,t));i.push({scope:Jm(e[0].instrumentationScope),spans:r,schemaUrl:e[0].instrumentationScope.schemaUrl})}l=a.next()}const c={resource:Km(e),scopeSpans:i,schemaUrl:void 0};n.push(c),s=o.next()}return n}const rg={serializeRequest:e=>{const t=eg(e,{});return(new TextEncoder).encode(JSON.stringify(t))},deserializeResponse:e=>{if(0===e.length)return{};const t=new TextDecoder;return JSON.parse(t.decode(e))}};function ng(){return.4*Math.random()-.2}class og{_transport;constructor(e){this._transport=e}retry(e,t,r){return new Promise((n,o)=>{setTimeout(()=>{this._transport.send(e,t).then(n,o)},r)})}async send(e,t){const r=Date.now()+t;let n=await this._transport.send(e,t),o=5,s=1e3;for(;"retryable"===n.status&&o>0;){o--;const t=Math.max(Math.min(s,5e3)+ng(),0);s*=1.5;const i=n.retryInMillis??t,a=r-Date.now();if(i>a)return n;n=await this.retry(e,a,i)}return n}shutdown(){return this._transport.shutdown()}}function sg(e){return new og(e.transport)}function ig(e){if(null==e)return;const t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?1e3*t:-1;const r=new Date(e).getTime()-Date.now();return r>=0?r:0}class ag{_parameters;constructor(e){this._parameters=e}send(e,t){return new Promise(r=>{const n=new XMLHttpRequest;n.timeout=t,n.open("POST",this._parameters.url);const o=this._parameters.headers();Object.entries(o).forEach(([e,t])=>{n.setRequestHeader(e,t)}),n.ontimeout=e=>{r({status:"failure",error:new Error("XHR request timed out")})},n.onreadystatechange=()=>{var e;n.status>=200&&n.status<=299?(oh.debug("XHR success"),r({status:"success"})):n.status&&(e=n.status,[429,502,503,504].includes(e))?r({status:"retryable",retryInMillis:ig(n.getResponseHeader("Retry-After"))}):0!==n.status&&r({status:"failure",error:new Error("XHR request failed with non-retryable status")})},n.onabort=()=>{r({status:"failure",error:new Error("XHR request aborted")})},n.onerror=()=>{r({status:"failure",error:new Error("XHR request errored")})},n.send(e)})}shutdown(){}}class lg{_params;constructor(e){this._params=e}send(e){return new Promise(t=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(oh.debug("SendBeacon success"),t({status:"success"})):t({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function cg(e,t,r){const n={...r()},o={};return()=>(null!=t&&Object.assign(o,t()),null!=e&&Object.assign(o,e()),Object.assign(o,n))}function ug(e){if(null!=e)try{return new URL(e),e}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function hg(e,t,r){return n={url:e.url,timeoutMillis:e.timeoutMillis,headers:Dm(e.headers),concurrencyLimit:e.concurrencyLimit},o={},s=function(e,t){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none",headers:()=>e,url:"http://localhost:4318/"+t,agentOptions:{keepAlive:!0}}}(r,t),{...Pm(n,o,s),headers:cg((i=n.headers,()=>{const e={};return Object.entries(i?.()??{}).forEach(([t,r])=>{void 0!==r?e[t]=String(r):oh.warn(`Header "${t}" has invalid value (${r}) and will be ignored`)}),e}),o.headers,s.headers),url:ug(n.url)??o.url??s.url,agentOptions:n.agentOptions??o.agentOptions??s.agentOptions};var n,o,s,i}function pg(e,t,r,n){const o=!!e.headers||"function"!=typeof navigator.sendBeacon,s=hg(e,r,n);return o?function(e,t){return jm(e,t,sg({transport:(r=e,new ag(r))}));var r}(s,t):function(e,t){return jm(e,t,sg({transport:(r={url:e.url,blobType:e.headers()["Content-Type"]},new lg(r))}));var r}(s,t)}class dg extends Nm{constructor(e={}){super(pg(e,rg,"v1/traces",{"Content-Type":"application/json"}))}}class fg{constructor(e,t){this.config=e,this.sessionId=t,this.provider=this.createProvider()}createProvider(){const{serviceName:e,resourceAttributes:t,exporterEndpoint:r,projectId:n}=this.config,o=Up({[zh]:e,"at-project-id":n,...t||{}}),s=new dg({url:r||"https://otelcol.apitoolkit.io/v1/traces",headers:{}});return new ld({resource:o,spanProcessors:[new Qp(s)]})}configure(){this.provider.register({contextManager:new Gd,propagator:new mp});const e=this.config.propagateTraceHeaderCorsUrls||[/^https?:\/\/.*/],t=[/^https?:\/\/(?:[^\/]+\.)?apitoolkit\.io\//,/^https?:\/\/(?:[^\/]+\.)?monoscope\.tech\//];!function(e){const t=e.tracerProvider||vh.getTracerProvider(),r=e.meterProvider||ah.getMeterProvider(),n=e.loggerProvider||Ed.getLoggerProvider(),o=e.instrumentations?.flat()??[];(function(e,t,r,n){for(let o=0,s=e.length;o<s;o++){const s=e[o];t&&s.setTracerProvider(t),r&&s.setMeterProvider(r),n&&s.setLoggerProvider&&s.setLoggerProvider(n),s.getConfig().enabled||s.enable()}})(o,t,r,n)}({tracerProvider:this.provider,instrumentations:[...this.config.instrumentations||[],new zd({ignoreNetworkEvents:!this.config.enableNetworkEvents,applyCustomAttributesOnSpan:{documentLoad:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)}}}),new um({propagateTraceHeaderCorsUrls:e,ignoreUrls:t,applyCustomAttributesOnSpan:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)}}),new xm({propagateTraceHeaderCorsUrls:e,ignoreUrls:t,applyCustomAttributesOnSpan:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)}})]})}setUserAttributes(e){if(this.config.user)for(let t in this.config.user)e.setAttribute(`user.${t}`,this.config.user[t])}async shutdown(){await this.provider.shutdown()}setUser(e){this.config={...this.config,user:{...this.config.user,...e}}}}const mg=[];for(let e=0;e<256;++e)mg.push((e+256).toString(16).slice(1));let gg;const yg=new Uint8Array(16);var bg={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function vg(e,t,r){if(bg.randomUUID&&!e)return bg.randomUUID();const n=(e=e||{}).random??e.rng?.()??function(){if(!gg){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");gg=crypto.getRandomValues.bind(crypto)}return gg(yg)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e,t=0){return(mg[e[t+0]]+mg[e[t+1]]+mg[e[t+2]]+mg[e[t+3]]+"-"+mg[e[t+4]]+mg[e[t+5]]+"-"+mg[e[t+6]]+mg[e[t+7]]+"-"+mg[e[t+8]]+mg[e[t+9]]+"-"+mg[e[t+10]]+mg[e[t+11]]+mg[e[t+12]]+mg[e[t+13]]+mg[e[t+14]]+mg[e[t+15]]).toLowerCase()}(n)}return class{constructor(e){if(!e.projectId)throw new Error("MonoscopeConfig must include projectId");const t=sessionStorage.getItem("monoscope-session-id");t?this.sessionId=t:(this.sessionId=vg(),sessionStorage.setItem("monoscope-session-id",this.sessionId)),this.config=e,this.replay=new Tc(e,this.sessionId),this.otel=new fg(e,this.sessionId),this.otel.configure(),this.replay.configure()}getSessionId(){return this.sessionId}setUser(e){this.otel.setUser(e)}}});
21
21
  //# sourceMappingURL=monoscope.umd.js.map