@launchdarkly/o11y 0.0.0-stage → 1.2.0
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.
- package/CHANGELOG.md +9 -0
- package/LICENSE +13 -0
- package/README.md +15 -2
- package/dist/LDObserve-CHIjcqIn.js +92 -0
- package/dist/LDObserve-CHIjcqIn.js.map +1 -0
- package/dist/LDObserve.d.ts +645 -0
- package/dist/LDObserve.js +6 -0
- package/dist/LDObserve.js.map +1 -0
- package/dist/LDRecord.d.ts +149 -0
- package/dist/LDRecord.js +48 -0
- package/dist/LDRecord.js.map +1 -0
- package/dist/assets/highlight-client-worker-DsbKMpxq.js.map +1 -0
- package/dist/buffer-DIFxvF2Q.js +102 -0
- package/dist/buffer-DIFxvF2Q.js.map +1 -0
- package/dist/common-DQ61tUu9.js +4587 -0
- package/dist/common-DQ61tUu9.js.map +1 -0
- package/dist/index.d.ts +2772 -0
- package/dist/index.js +1657 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +495 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/observe-CFB6c1lu.js +12196 -0
- package/dist/observe-CFB6c1lu.js.map +1 -0
- package/dist/observe.d.ts +1195 -0
- package/dist/observe.js +8 -0
- package/dist/observe.js.map +1 -0
- package/dist/record-C_yieA7u.js +11270 -0
- package/dist/record-C_yieA7u.js.map +1 -0
- package/dist/record.d.ts +1725 -0
- package/dist/record.js +8 -0
- package/dist/record.js.map +1 -0
- package/package.json +158 -3
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
(function(A,z){typeof exports=="object"&&typeof module!="undefined"?z(exports):typeof define=="function"&&define.amd?define(["exports"],z):(A=typeof globalThis!="undefined"?globalThis:A||self,z(A.LD={}))})(this,function(A){"use strict";var $N=Object.defineProperty,qN=Object.defineProperties;var eO=Object.getOwnPropertyDescriptors;var io=Object.getOwnPropertySymbols,tO=Object.getPrototypeOf,By=Object.prototype.hasOwnProperty,zy=Object.prototype.propertyIsEnumerable,rO=Reflect.get;var uc=(A,z)=>(z=Symbol[A])?z:Symbol.for("Symbol."+A),dc=A=>{throw TypeError(A)};var cc=(A,z,se)=>z in A?$N(A,z,{enumerable:!0,configurable:!0,writable:!0,value:se}):A[z]=se,x=(A,z)=>{for(var se in z||(z={}))By.call(z,se)&&cc(A,se,z[se]);if(io)for(var se of io(z))zy.call(z,se)&&cc(A,se,z[se]);return A},B=(A,z)=>qN(A,eO(z));var et=(A,z)=>{var se={};for(var Ee in A)By.call(A,Ee)&&z.indexOf(Ee)<0&&(se[Ee]=A[Ee]);if(A!=null&&io)for(var Ee of io(A))z.indexOf(Ee)<0&&zy.call(A,Ee)&&(se[Ee]=A[Ee]);return se};var L=(A,z,se)=>cc(A,typeof z!="symbol"?z+"":z,se),Ky=(A,z,se)=>z.has(A)||dc("Cannot "+se);var so=(A,z,se)=>(Ky(A,z,"read from private field"),se?se.call(A):z.get(A)),oo=(A,z,se)=>z.has(A)?dc("Cannot add the same private member more than once"):z instanceof WeakSet?z.add(A):z.set(A,se),ao=(A,z,se,Ee)=>(Ky(A,z,"write to private field"),Ee?Ee.call(A,se):z.set(A,se),se);var hc=(A,z,se)=>rO(tO(A),se,z);var $=(A,z,se)=>new Promise((Ee,Qe)=>{var it=$e=>{try{ar(se.next($e))}catch(ln){Qe(ln)}},Nt=$e=>{try{ar(se.throw($e))}catch(ln){Qe(ln)}},ar=$e=>$e.done?Ee($e.value):Promise.resolve($e.value).then(it,Nt);ar((se=se.apply(A,z)).next())}),nO=function(A,z){this[0]=A,this[1]=z};var fc=A=>{var z=A[uc("asyncIterator")],se=!1,Ee,Qe={};return z==null?(z=A[uc("iterator")](),Ee=it=>Qe[it]=Nt=>z[it](Nt)):(z=z.call(A),Ee=it=>Qe[it]=Nt=>{if(se){if(se=!1,it==="throw")throw Nt;return Nt}return se=!0,{done:!1,value:new nO(new Promise(ar=>{var $e=z[it](Nt);$e instanceof Object||dc("Object expected"),ar($e)}),1)}}),Qe[uc("iterator")]=()=>Qe,Ee("next"),"throw"in z?Ee("throw"):Qe.throw=it=>{throw it},"return"in z&&Ee("return"),Qe};var ni,ii,si;const z={key:"_sid"},se="rrweb/sequential-id@1",Ee=e=>{const t=z;let r=0;return{name:se,eventProcessor(n){return Object.assign(n,{[t.key]:++r}),n},options:t}};function Qe(e,t){if(!!!e)throw new Error(t)}function it(e){return typeof e=="object"&&e!==null}function Nt(e,t){if(!!!e)throw new Error("Unexpected invariant triggered.")}const ar=/\r\n|[\n\r]/g;function $e(e,t){let r=0,n=1;for(const i of e.body.matchAll(ar)){if(typeof i.index=="number"||Nt(!1),i.index>=t)break;r=i.index+i[0].length,n+=1}return{line:n,column:t+1-r}}function ln(e){return pc(e.source,$e(e.source,e.start))}function pc(e,t){const r=e.locationOffset.column-1,n="".padStart(r)+e.body,i=t.line-1,s=e.locationOffset.line-1,o=t.line+s,l=t.line===1?r:0,u=t.column+l,a=`${e.name}:${o}:${u}
|
|
2
|
+
`,h=n.split(/\r\n|[\n\r]/g),c=h[i];if(c.length>120){const f=Math.floor(u/80),d=u%80,p=[];for(let m=0;m<c.length;m+=80)p.push(c.slice(m,m+80));return a+mc([[`${o} |`,p[0]],...p.slice(1,f+1).map(m=>["|",m]),["|","^".padStart(d)],["|",p[f+1]]])}return a+mc([[`${o-1} |`,h[i-1]],[`${o} |`,c],["|","^".padStart(u)],[`${o+1} |`,h[i+1]]])}function mc(e){const t=e.filter(([n,i])=>i!==void 0),r=Math.max(...t.map(([n])=>n.length));return t.map(([n,i])=>n.padStart(r)+(i?" "+i:"")).join(`
|
|
3
|
+
`)}function jy(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class lo extends Error{constructor(t,...r){var n,i,s;const{nodes:o,source:l,positions:u,path:a,originalError:h,extensions:c}=jy(r);super(t),this.name="GraphQLError",this.path=a!=null?a:void 0,this.originalError=h!=null?h:void 0,this.nodes=gc(Array.isArray(o)?o:o?[o]:void 0);const f=gc((n=this.nodes)===null||n===void 0?void 0:n.map(p=>p.loc).filter(p=>p!=null));this.source=l!=null?l:f==null||(i=f[0])===null||i===void 0?void 0:i.source,this.positions=u!=null?u:f==null?void 0:f.map(p=>p.start),this.locations=u&&l?u.map(p=>$e(l,p)):f==null?void 0:f.map(p=>$e(p.source,p.start));const d=it(h==null?void 0:h.extensions)?h==null?void 0:h.extensions:void 0;this.extensions=(s=c!=null?c:d)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),h!=null&&h.stack?Object.defineProperty(this,"stack",{value:h.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,lo):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const r of this.nodes)r.loc&&(t+=`
|
|
4
|
+
|
|
5
|
+
`+ln(r.loc));else if(this.source&&this.locations)for(const r of this.locations)t+=`
|
|
6
|
+
|
|
7
|
+
`+pc(this.source,r);return t}toJSON(){const t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}function gc(e){return e===void 0||e.length===0?void 0:e}function ke(e,t,r){return new lo(`Syntax Error: ${r}`,{source:e,positions:[t]})}class Qy{constructor(t,r,n){this.start=t.start,this.end=r.end,this.startToken=t,this.endToken=r,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class yc{constructor(t,r,n,i,s,o){this.kind=t,this.start=r,this.end=n,this.line=i,this.column=s,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const bc={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},$y=new Set(Object.keys(bc));function vc(e){const t=e==null?void 0:e.kind;return typeof t=="string"&&$y.has(t)}var Or;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(Or||(Or={}));var uo;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(uo||(uo={}));var ee;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(ee||(ee={}));function co(e){return e===9||e===32}function un(e){return e>=48&&e<=57}function Sc(e){return e>=97&&e<=122||e>=65&&e<=90}function wc(e){return Sc(e)||e===95}function qy(e){return Sc(e)||un(e)||e===95}function eb(e){var t;let r=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let o=0;o<e.length;++o){var s;const l=e[o],u=tb(l);u!==l.length&&(n=(s=n)!==null&&s!==void 0?s:o,i=o,o!==0&&u<r&&(r=u))}return e.map((o,l)=>l===0?o:o.slice(r)).slice((t=n)!==null&&t!==void 0?t:0,i+1)}function tb(e){let t=0;for(;t<e.length&&co(e.charCodeAt(t));)++t;return t}function rb(e,t){const r=e.replace(/"""/g,'\\"""'),n=r.split(/\r\n|[\n\r]/g),i=n.length===1,s=n.length>1&&n.slice(1).every(d=>d.length===0||co(d.charCodeAt(0))),o=r.endsWith('\\"""'),l=e.endsWith('"')&&!o,u=e.endsWith("\\"),a=l||u,h=!i||e.length>70||a||s||o;let c="";const f=i&&co(e.charCodeAt(0));return(h&&!f||s)&&(c+=`
|
|
8
|
+
`),c+=r,(h||a)&&(c+=`
|
|
9
|
+
`),'"""'+c+'"""'}var V;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(V||(V={}));class nb{constructor(t){const r=new yc(V.SOF,0,0,0,0);this.source=t,this.lastToken=r,this.token=r,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==V.EOF)do if(t.next)t=t.next;else{const r=sb(this,t.end);t.next=r,r.prev=t,t=r}while(t.kind===V.COMMENT);return t}}function ib(e){return e===V.BANG||e===V.DOLLAR||e===V.AMP||e===V.PAREN_L||e===V.PAREN_R||e===V.SPREAD||e===V.COLON||e===V.EQUALS||e===V.AT||e===V.BRACKET_L||e===V.BRACKET_R||e===V.BRACE_L||e===V.PIPE||e===V.BRACE_R}function Gr(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function oi(e,t){return Rc(e.charCodeAt(t))&&_c(e.charCodeAt(t+1))}function Rc(e){return e>=55296&&e<=56319}function _c(e){return e>=56320&&e<=57343}function lr(e,t){const r=e.source.body.codePointAt(t);if(r===void 0)return V.EOF;if(r>=32&&r<=126){const n=String.fromCodePoint(r);return n==='"'?`'"'`:`"${n}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function Oe(e,t,r,n,i){const s=e.line,o=1+r-e.lineStart;return new yc(t,r,n,s,o,i)}function sb(e,t){const r=e.source.body,n=r.length;let i=t;for(;i<n;){const s=r.charCodeAt(i);switch(s){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:r.charCodeAt(i+1)===10?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return ob(e,i);case 33:return Oe(e,V.BANG,i,i+1);case 36:return Oe(e,V.DOLLAR,i,i+1);case 38:return Oe(e,V.AMP,i,i+1);case 40:return Oe(e,V.PAREN_L,i,i+1);case 41:return Oe(e,V.PAREN_R,i,i+1);case 46:if(r.charCodeAt(i+1)===46&&r.charCodeAt(i+2)===46)return Oe(e,V.SPREAD,i,i+3);break;case 58:return Oe(e,V.COLON,i,i+1);case 61:return Oe(e,V.EQUALS,i,i+1);case 64:return Oe(e,V.AT,i,i+1);case 91:return Oe(e,V.BRACKET_L,i,i+1);case 93:return Oe(e,V.BRACKET_R,i,i+1);case 123:return Oe(e,V.BRACE_L,i,i+1);case 124:return Oe(e,V.PIPE,i,i+1);case 125:return Oe(e,V.BRACE_R,i,i+1);case 34:return r.charCodeAt(i+1)===34&&r.charCodeAt(i+2)===34?hb(e,i):lb(e,i)}if(un(s)||s===45)return ab(e,i,s);if(wc(s))return fb(e,i);throw ke(e.source,i,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Gr(s)||oi(r,i)?`Unexpected character: ${lr(e,i)}.`:`Invalid character: ${lr(e,i)}.`)}return Oe(e,V.EOF,n,n)}function ob(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n;){const s=r.charCodeAt(i);if(s===10||s===13)break;if(Gr(s))++i;else if(oi(r,i))i+=2;else break}return Oe(e,V.COMMENT,t,i,r.slice(t+1,i))}function ab(e,t,r){const n=e.source.body;let i=t,s=r,o=!1;if(s===45&&(s=n.charCodeAt(++i)),s===48){if(s=n.charCodeAt(++i),un(s))throw ke(e.source,i,`Invalid number, unexpected digit after 0: ${lr(e,i)}.`)}else i=ho(e,i,s),s=n.charCodeAt(i);if(s===46&&(o=!0,s=n.charCodeAt(++i),i=ho(e,i,s),s=n.charCodeAt(i)),(s===69||s===101)&&(o=!0,s=n.charCodeAt(++i),(s===43||s===45)&&(s=n.charCodeAt(++i)),i=ho(e,i,s),s=n.charCodeAt(i)),s===46||wc(s))throw ke(e.source,i,`Invalid number, expected digit but got: ${lr(e,i)}.`);return Oe(e,o?V.FLOAT:V.INT,t,i,n.slice(t,i))}function ho(e,t,r){if(!un(r))throw ke(e.source,t,`Invalid number, expected digit but got: ${lr(e,t)}.`);const n=e.source.body;let i=t+1;for(;un(n.charCodeAt(i));)++i;return i}function lb(e,t){const r=e.source.body,n=r.length;let i=t+1,s=i,o="";for(;i<n;){const l=r.charCodeAt(i);if(l===34)return o+=r.slice(s,i),Oe(e,V.STRING,t,i+1,o);if(l===92){o+=r.slice(s,i);const u=r.charCodeAt(i+1)===117?r.charCodeAt(i+2)===123?ub(e,i):cb(e,i):db(e,i);o+=u.value,i+=u.size,s=i;continue}if(l===10||l===13)break;if(Gr(l))++i;else if(oi(r,i))i+=2;else throw ke(e.source,i,`Invalid character within String: ${lr(e,i)}.`)}throw ke(e.source,i,"Unterminated string.")}function ub(e,t){const r=e.source.body;let n=0,i=3;for(;i<12;){const s=r.charCodeAt(t+i++);if(s===125){if(i<5||!Gr(n))break;return{value:String.fromCodePoint(n),size:i}}if(n=n<<4|cn(s),n<0)break}throw ke(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+i)}".`)}function cb(e,t){const r=e.source.body,n=Tc(r,t+2);if(Gr(n))return{value:String.fromCodePoint(n),size:6};if(Rc(n)&&r.charCodeAt(t+6)===92&&r.charCodeAt(t+7)===117){const i=Tc(r,t+8);if(_c(i))return{value:String.fromCodePoint(n,i),size:12}}throw ke(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+6)}".`)}function Tc(e,t){return cn(e.charCodeAt(t))<<12|cn(e.charCodeAt(t+1))<<8|cn(e.charCodeAt(t+2))<<4|cn(e.charCodeAt(t+3))}function cn(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function db(e,t){const r=e.source.body;switch(r.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
|
|
10
|
+
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw ke(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}function hb(e,t){const r=e.source.body,n=r.length;let i=e.lineStart,s=t+3,o=s,l="";const u=[];for(;s<n;){const a=r.charCodeAt(s);if(a===34&&r.charCodeAt(s+1)===34&&r.charCodeAt(s+2)===34){l+=r.slice(o,s),u.push(l);const h=Oe(e,V.BLOCK_STRING,t,s+3,eb(u).join(`
|
|
11
|
+
`));return e.line+=u.length-1,e.lineStart=i,h}if(a===92&&r.charCodeAt(s+1)===34&&r.charCodeAt(s+2)===34&&r.charCodeAt(s+3)===34){l+=r.slice(o,s),o=s+1,s+=4;continue}if(a===10||a===13){l+=r.slice(o,s),u.push(l),a===13&&r.charCodeAt(s+1)===10?s+=2:++s,l="",o=s,i=s;continue}if(Gr(a))++s;else if(oi(r,s))s+=2;else throw ke(e.source,s,`Invalid character within String: ${lr(e,s)}.`)}throw ke(e.source,s,"Unterminated string.")}function fb(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n;){const s=r.charCodeAt(i);if(qy(s))++i;else break}return Oe(e,V.NAME,t,i,r.slice(t,i))}const pb=10,Ec=2;function fo(e){return ai(e,[])}function ai(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return mb(e,t);default:return String(e)}}function mb(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";const r=[...t,e];if(gb(e)){const n=e.toJSON();if(n!==e)return typeof n=="string"?n:ai(n,r)}else if(Array.isArray(e))return bb(e,r);return yb(e,r)}function gb(e){return typeof e.toJSON=="function"}function yb(e,t){const r=Object.entries(e);return r.length===0?"{}":t.length>Ec?"["+vb(e)+"]":"{ "+r.map(([i,s])=>i+": "+ai(s,t)).join(", ")+" }"}function bb(e,t){if(e.length===0)return"[]";if(t.length>Ec)return"[Array]";const r=Math.min(pb,e.length),n=e.length-r,i=[];for(let s=0;s<r;++s)i.push(ai(e[s],t));return n===1?i.push("... 1 more item"):n>1&&i.push(`... ${n} more items`),"["+i.join(", ")+"]"}function vb(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){const r=e.constructor.name;if(typeof r=="string"&&r!=="")return r}return t}const Sb=globalThis.process&&process.env.NODE_ENV==="production"?function(t,r){return t instanceof r}:function(t,r){if(t instanceof r)return!0;if(typeof t=="object"&&t!==null){var n;const i=r.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(n=t.constructor)===null||n===void 0?void 0:n.name;if(i===s){const o=fo(t);throw new Error(`Cannot use ${i} "${o}" from another module or realm.
|
|
12
|
+
|
|
13
|
+
Ensure that there is only one instance of "graphql" in the node_modules
|
|
14
|
+
directory. If different versions of "graphql" are the dependencies of other
|
|
15
|
+
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
16
|
+
|
|
17
|
+
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
18
|
+
|
|
19
|
+
Duplicate "graphql" modules cannot be used at the same time since different
|
|
20
|
+
versions may have different capabilities and behavior. The data from one
|
|
21
|
+
version used in the function from another could produce confusing and
|
|
22
|
+
spurious results.`)}}return!1};class Ic{constructor(t,r="GraphQL request",n={line:1,column:1}){typeof t=="string"||Qe(!1,`Body must be a string. Received: ${fo(t)}.`),this.body=t,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Qe(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Qe(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function wb(e){return Sb(e,Ic)}function Cc(e,t){const r=new Rb(e,t),n=r.parseDocument();return Object.defineProperty(n,"tokenCount",{enumerable:!1,value:r.tokenCount}),n}class Rb{constructor(t,r={}){const n=wb(t)?t:new Ic(t);this._lexer=new nb(n),this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const t=this.expectToken(V.NAME);return this.node(t,{kind:ee.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:ee.DOCUMENT,definitions:this.many(V.SOF,this.parseDefinition,V.EOF)})}parseDefinition(){if(this.peek(V.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),r=t?this._lexer.lookahead():this._lexer.token;if(r.kind===V.NAME){switch(r.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw ke(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(r.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(r)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(V.BRACE_L))return this.node(t,{kind:ee.OPERATION_DEFINITION,operation:Or.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const r=this.parseOperationType();let n;return this.peek(V.NAME)&&(n=this.parseName()),this.node(t,{kind:ee.OPERATION_DEFINITION,operation:r,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(V.NAME);switch(t.value){case"query":return Or.QUERY;case"mutation":return Or.MUTATION;case"subscription":return Or.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(V.PAREN_L,this.parseVariableDefinition,V.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:ee.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(V.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(V.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(V.DOLLAR),this.node(t,{kind:ee.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:ee.SELECTION_SET,selections:this.many(V.BRACE_L,this.parseSelection,V.BRACE_R)})}parseSelection(){return this.peek(V.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,r=this.parseName();let n,i;return this.expectOptionalToken(V.COLON)?(n=r,i=this.parseName()):i=r,this.node(t,{kind:ee.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(V.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const r=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(V.PAREN_L,r,V.PAREN_R)}parseArgument(t=!1){const r=this._lexer.token,n=this.parseName();return this.expectToken(V.COLON),this.node(r,{kind:ee.ARGUMENT,name:n,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(V.SPREAD);const r=this.expectOptionalKeyword("on");return!r&&this.peek(V.NAME)?this.node(t,{kind:ee.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:ee.INLINE_FRAGMENT,typeCondition:r?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:ee.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:ee.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){const r=this._lexer.token;switch(r.kind){case V.BRACKET_L:return this.parseList(t);case V.BRACE_L:return this.parseObject(t);case V.INT:return this.advanceLexer(),this.node(r,{kind:ee.INT,value:r.value});case V.FLOAT:return this.advanceLexer(),this.node(r,{kind:ee.FLOAT,value:r.value});case V.STRING:case V.BLOCK_STRING:return this.parseStringLiteral();case V.NAME:switch(this.advanceLexer(),r.value){case"true":return this.node(r,{kind:ee.BOOLEAN,value:!0});case"false":return this.node(r,{kind:ee.BOOLEAN,value:!1});case"null":return this.node(r,{kind:ee.NULL});default:return this.node(r,{kind:ee.ENUM,value:r.value})}case V.DOLLAR:if(t)if(this.expectToken(V.DOLLAR),this._lexer.token.kind===V.NAME){const n=this._lexer.token.value;throw ke(this._lexer.source,r.start,`Unexpected variable "$${n}" in constant value.`)}else throw this.unexpected(r);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:ee.STRING,value:t.value,block:t.kind===V.BLOCK_STRING})}parseList(t){const r=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:ee.LIST,values:this.any(V.BRACKET_L,r,V.BRACKET_R)})}parseObject(t){const r=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:ee.OBJECT,fields:this.any(V.BRACE_L,r,V.BRACE_R)})}parseObjectField(t){const r=this._lexer.token,n=this.parseName();return this.expectToken(V.COLON),this.node(r,{kind:ee.OBJECT_FIELD,name:n,value:this.parseValueLiteral(t)})}parseDirectives(t){const r=[];for(;this.peek(V.AT);)r.push(this.parseDirective(t));return r}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const r=this._lexer.token;return this.expectToken(V.AT),this.node(r,{kind:ee.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let r;if(this.expectOptionalToken(V.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(V.BRACKET_R),r=this.node(t,{kind:ee.LIST_TYPE,type:n})}else r=this.parseNamedType();return this.expectOptionalToken(V.BANG)?this.node(t,{kind:ee.NON_NULL_TYPE,type:r}):r}parseNamedType(){return this.node(this._lexer.token,{kind:ee.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(V.STRING)||this.peek(V.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(V.BRACE_L,this.parseOperationTypeDefinition,V.BRACE_R);return this.node(t,{kind:ee.SCHEMA_DEFINITION,description:r,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const t=this._lexer.token,r=this.parseOperationType();this.expectToken(V.COLON);const n=this.parseNamedType();return this.node(t,{kind:ee.OPERATION_TYPE_DEFINITION,operation:r,type:n})}parseScalarTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:ee.SCALAR_TYPE_DEFINITION,description:r,name:n,directives:i})}parseObjectTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:ee.OBJECT_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(V.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(V.BRACE_L,this.parseFieldDefinition,V.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(V.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:ee.FIELD_DEFINITION,description:r,name:n,arguments:i,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(V.PAREN_L,this.parseInputValueDef,V.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseName();this.expectToken(V.COLON);const i=this.parseTypeReference();let s;this.expectOptionalToken(V.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(t,{kind:ee.INPUT_VALUE_DEFINITION,description:r,name:n,type:i,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:ee.INTERFACE_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:s,fields:o})}parseUnionTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:ee.UNION_TYPE_DEFINITION,description:r,name:n,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(V.EQUALS)?this.delimitedMany(V.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:ee.ENUM_TYPE_DEFINITION,description:r,name:n,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(V.BRACE_L,this.parseEnumValueDefinition,V.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,r=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:ee.ENUM_VALUE_DEFINITION,description:r,name:n,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw ke(this._lexer.source,this._lexer.token.start,`${li(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:ee.INPUT_OBJECT_TYPE_DEFINITION,description:r,name:n,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(V.BRACE_L,this.parseInputValueDef,V.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===V.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const r=this.parseConstDirectives(),n=this.optionalMany(V.BRACE_L,this.parseOperationTypeDefinition,V.BRACE_R);if(r.length===0&&n.length===0)throw this.unexpected();return this.node(t,{kind:ee.SCHEMA_EXTENSION,directives:r,operationTypes:n})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const r=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(t,{kind:ee.SCALAR_TYPE_EXTENSION,name:r,directives:n})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:ee.OBJECT_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:s})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:ee.INTERFACE_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:s})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:ee.UNION_TYPE_EXTENSION,name:r,directives:n,types:i})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:ee.ENUM_TYPE_EXTENSION,name:r,directives:n,values:i})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:ee.INPUT_OBJECT_TYPE_EXTENSION,name:r,directives:n,fields:i})}parseDirectiveDefinition(){const t=this._lexer.token,r=this.parseDescription();this.expectKeyword("directive"),this.expectToken(V.AT);const n=this.parseName(),i=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(t,{kind:ee.DIRECTIVE_DEFINITION,description:r,name:n,arguments:i,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(V.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,r=this.parseName();if(Object.prototype.hasOwnProperty.call(uo,r.value))return r;throw this.unexpected(t)}node(t,r){return this._options.noLocation!==!0&&(r.loc=new Qy(t,this._lexer.lastToken,this._lexer.source)),r}peek(t){return this._lexer.token.kind===t}expectToken(t){const r=this._lexer.token;if(r.kind===t)return this.advanceLexer(),r;throw ke(this._lexer.source,r.start,`Expected ${Zc(t)}, found ${li(r)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const r=this._lexer.token;if(r.kind===V.NAME&&r.value===t)this.advanceLexer();else throw ke(this._lexer.source,r.start,`Expected "${t}", found ${li(r)}.`)}expectOptionalKeyword(t){const r=this._lexer.token;return r.kind===V.NAME&&r.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const r=t!=null?t:this._lexer.token;return ke(this._lexer.source,r.start,`Unexpected ${li(r)}.`)}any(t,r,n){this.expectToken(t);const i=[];for(;!this.expectOptionalToken(n);)i.push(r.call(this));return i}optionalMany(t,r,n){if(this.expectOptionalToken(t)){const i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}return[]}many(t,r,n){this.expectToken(t);const i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}delimitedMany(t,r){this.expectOptionalToken(t);const n=[];do n.push(r.call(this));while(this.expectOptionalToken(t));return n}advanceLexer(){const{maxTokens:t}=this._options,r=this._lexer.advance();if(r.kind!==V.EOF&&(++this._tokenCounter,t!==void 0&&this._tokenCounter>t))throw ke(this._lexer.source,r.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function li(e){const t=e.value;return Zc(e.kind)+(t!=null?` "${t}"`:"")}function Zc(e){return ib(e)?`"${e}"`:e}function _b(e){return`"${e.replace(Tb,Eb)}"`}const Tb=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Eb(e){return Ib[e.charCodeAt(0)]}const Ib=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],Cb=Object.freeze({});function Zb(e,t,r=bc){const n=new Map;for(const v of Object.values(ee))n.set(v,Lb(t,v));let i,s=Array.isArray(e),o=[e],l=-1,u=[],a=e,h,c;const f=[],d=[];do{l++;const v=l===o.length,y=v&&u.length!==0;if(v){if(h=d.length===0?void 0:f[f.length-1],a=c,c=d.pop(),y)if(s){a=a.slice();let _=0;for(const[w,b]of u){const R=w-_;b===null?(a.splice(R,1),_++):a[R]=b}}else{a=x({},a);for(const[_,w]of u)a[_]=w}l=i.index,o=i.keys,u=i.edits,s=i.inArray,i=i.prev}else if(c){if(h=s?l:o[l],a=c[h],a==null)continue;f.push(h)}let S;if(!Array.isArray(a)){var p,m;vc(a)||Qe(!1,`Invalid AST Node: ${fo(a)}.`);const _=v?(p=n.get(a.kind))===null||p===void 0?void 0:p.leave:(m=n.get(a.kind))===null||m===void 0?void 0:m.enter;if(S=_==null?void 0:_.call(t,a,h,c,f,d),S===Cb)break;if(S===!1){if(!v){f.pop();continue}}else if(S!==void 0&&(u.push([h,S]),!v))if(vc(S))a=S;else{f.pop();continue}}if(S===void 0&&y&&u.push([h,a]),v)f.pop();else{var g;i={inArray:s,index:l,keys:o,edits:u,prev:i},s=Array.isArray(a),o=s?a:(g=r[a.kind])!==null&&g!==void 0?g:[],l=-1,u=[],c&&d.push(c),c=a}}while(i!==void 0);return u.length!==0?u[u.length-1][1]:e}function Lb(e,t){const r=e[t];return typeof r=="object"?r:typeof r=="function"?{enter:r,leave:void 0}:{enter:e.enter,leave:e.leave}}function po(e){return Zb(e,Nb)}const xb=80,Nb={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>J(e.definitions,`
|
|
23
|
+
|
|
24
|
+
`)},OperationDefinition:{leave(e){const t=ue("(",J(e.variableDefinitions,", "),")"),r=J([e.operation,J([e.name,t]),J(e.directives," ")]," ");return(r==="query"?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n})=>e+": "+t+ue(" = ",r)+ue(" ",J(n," "))},SelectionSet:{leave:({selections:e})=>yt(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){const s=ue("",e,": ")+t;let o=s+ue("(",J(r,", "),")");return o.length>xb&&(o=s+ue(`(
|
|
25
|
+
`,ui(J(r,`
|
|
26
|
+
`)),`
|
|
27
|
+
)`)),J([o,J(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+ue(" ",J(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>J(["...",ue("on ",e),J(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i})=>`fragment ${e}${ue("(",J(r,", "),")")} on ${t} ${ue("",J(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?rb(e):_b(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+J(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+J(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+ue("(",J(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>ue("",e,`
|
|
28
|
+
`)+J(["schema",J(t," "),yt(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>ue("",e,`
|
|
29
|
+
`)+J(["scalar",t,J(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>ue("",e,`
|
|
30
|
+
`)+J(["type",t,ue("implements ",J(r," & ")),J(n," "),yt(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>ue("",e,`
|
|
31
|
+
`)+t+(Lc(r)?ue(`(
|
|
32
|
+
`,ui(J(r,`
|
|
33
|
+
`)),`
|
|
34
|
+
)`):ue("(",J(r,", "),")"))+": "+n+ue(" ",J(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>ue("",e,`
|
|
35
|
+
`)+J([t+": "+r,ue("= ",n),J(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>ue("",e,`
|
|
36
|
+
`)+J(["interface",t,ue("implements ",J(r," & ")),J(n," "),yt(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:n})=>ue("",e,`
|
|
37
|
+
`)+J(["union",t,J(r," "),ue("= ",J(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:n})=>ue("",e,`
|
|
38
|
+
`)+J(["enum",t,J(r," "),yt(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>ue("",e,`
|
|
39
|
+
`)+J([t,J(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>ue("",e,`
|
|
40
|
+
`)+J(["input",t,J(r," "),yt(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,repeatable:n,locations:i})=>ue("",e,`
|
|
41
|
+
`)+"directive @"+t+(Lc(r)?ue(`(
|
|
42
|
+
`,ui(J(r,`
|
|
43
|
+
`)),`
|
|
44
|
+
)`):ue("(",J(r,", "),")"))+(n?" repeatable":"")+" on "+J(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>J(["extend schema",J(e," "),yt(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>J(["extend scalar",e,J(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>J(["extend type",e,ue("implements ",J(t," & ")),J(r," "),yt(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>J(["extend interface",e,ue("implements ",J(t," & ")),J(r," "),yt(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>J(["extend union",e,J(t," "),ue("= ",J(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>J(["extend enum",e,J(t," "),yt(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>J(["extend input",e,J(t," "),yt(r)]," ")}};function J(e,t=""){var r;return(r=e==null?void 0:e.filter(n=>n).join(t))!==null&&r!==void 0?r:""}function yt(e){return ue(`{
|
|
45
|
+
`,ui(J(e,`
|
|
46
|
+
`)),`
|
|
47
|
+
}`)}function ue(e,t,r=""){return t!=null&&t!==""?e+t+r:""}function ui(e){return ue(" ",e.replace(/\n/g,`
|
|
48
|
+
`))}function Lc(e){var t;return(t=e==null?void 0:e.some(r=>r.includes(`
|
|
49
|
+
`)))!==null&&t!==void 0?t:!1}const mo=JSON,Ob=e=>e.toUpperCase(),Gb=e=>{const t={};return e.forEach((r,n)=>{t[n]=r}),t},Vb=(e,t,r)=>e.document?e:{document:e,variables:t,requestHeaders:r,signal:void 0},kb=(e,t,r)=>e.query?e:{query:e,variables:t,requestHeaders:r,signal:void 0},Xb=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0},xc=e=>{var n,i;let t;const r=e.definitions.filter(s=>s.kind==="OperationDefinition");return r.length===1&&(t=(i=(n=r[0])==null?void 0:n.name)==null?void 0:i.value),t},go=e=>{if(typeof e=="string"){let r;try{const n=Cc(e);r=xc(n)}catch(n){}return{query:e,operationName:r}}const t=xc(e);return{query:po(e),operationName:t}};class Vr extends Error{constructor(t,r){const n=`${Vr.extractMessage(t)}: ${JSON.stringify({response:t,request:r})}`;super(n),Object.setPrototypeOf(this,Vr.prototype),this.response=t,this.request=r,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Vr)}static extractMessage(t){var r,n,i;return(i=(n=(r=t.errors)==null?void 0:r[0])==null?void 0:n.message)!=null?i:`GraphQL Error (Code: ${t.status})`}}var yo=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ci(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bo={exports:{}};(function(e,t){var r=typeof self!="undefined"?self:yo,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(o){var l={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch(Z){return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function u(Z){return Z&&DataView.prototype.isPrototypeOf(Z)}if(l.arrayBuffer)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(Z){return Z&&a.indexOf(Object.prototype.toString.call(Z))>-1};function c(Z){if(typeof Z!="string"&&(Z=String(Z)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(Z))throw new TypeError("Invalid character in header field name");return Z.toLowerCase()}function f(Z){return typeof Z!="string"&&(Z=String(Z)),Z}function d(Z){var T={next:function(){var W=Z.shift();return{done:W===void 0,value:W}}};return l.iterable&&(T[Symbol.iterator]=function(){return T}),T}function p(Z){this.map={},Z instanceof p?Z.forEach(function(T,W){this.append(W,T)},this):Array.isArray(Z)?Z.forEach(function(T){this.append(T[0],T[1])},this):Z&&Object.getOwnPropertyNames(Z).forEach(function(T){this.append(T,Z[T])},this)}p.prototype.append=function(Z,T){Z=c(Z),T=f(T);var W=this.map[Z];this.map[Z]=W?W+", "+T:T},p.prototype.delete=function(Z){delete this.map[c(Z)]},p.prototype.get=function(Z){return Z=c(Z),this.has(Z)?this.map[Z]:null},p.prototype.has=function(Z){return this.map.hasOwnProperty(c(Z))},p.prototype.set=function(Z,T){this.map[c(Z)]=f(T)},p.prototype.forEach=function(Z,T){for(var W in this.map)this.map.hasOwnProperty(W)&&Z.call(T,this.map[W],W,this)},p.prototype.keys=function(){var Z=[];return this.forEach(function(T,W){Z.push(W)}),d(Z)},p.prototype.values=function(){var Z=[];return this.forEach(function(T){Z.push(T)}),d(Z)},p.prototype.entries=function(){var Z=[];return this.forEach(function(T,W){Z.push([W,T])}),d(Z)},l.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function m(Z){if(Z.bodyUsed)return Promise.reject(new TypeError("Already read"));Z.bodyUsed=!0}function g(Z){return new Promise(function(T,W){Z.onload=function(){T(Z.result)},Z.onerror=function(){W(Z.error)}})}function v(Z){var T=new FileReader,W=g(T);return T.readAsArrayBuffer(Z),W}function y(Z){var T=new FileReader,W=g(T);return T.readAsText(Z),W}function S(Z){for(var T=new Uint8Array(Z),W=new Array(T.length),k=0;k<T.length;k++)W[k]=String.fromCharCode(T[k]);return W.join("")}function _(Z){if(Z.slice)return Z.slice(0);var T=new Uint8Array(Z.byteLength);return T.set(new Uint8Array(Z)),T.buffer}function w(){return this.bodyUsed=!1,this._initBody=function(Z){this._bodyInit=Z,Z?typeof Z=="string"?this._bodyText=Z:l.blob&&Blob.prototype.isPrototypeOf(Z)?this._bodyBlob=Z:l.formData&&FormData.prototype.isPrototypeOf(Z)?this._bodyFormData=Z:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(Z)?this._bodyText=Z.toString():l.arrayBuffer&&l.blob&&u(Z)?(this._bodyArrayBuffer=_(Z.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(Z)||h(Z))?this._bodyArrayBuffer=_(Z):this._bodyText=Z=Object.prototype.toString.call(Z):this._bodyText="",this.headers.get("content-type")||(typeof Z=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(Z)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var Z=m(this);if(Z)return Z;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?m(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var Z=m(this);if(Z)return Z;if(this._bodyBlob)return y(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(S(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(I)}),this.json=function(){return this.text().then(JSON.parse)},this}var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function R(Z){var T=Z.toUpperCase();return b.indexOf(T)>-1?T:Z}function E(Z,T){T=T||{};var W=T.body;if(Z instanceof E){if(Z.bodyUsed)throw new TypeError("Already read");this.url=Z.url,this.credentials=Z.credentials,T.headers||(this.headers=new p(Z.headers)),this.method=Z.method,this.mode=Z.mode,this.signal=Z.signal,!W&&Z._bodyInit!=null&&(W=Z._bodyInit,Z.bodyUsed=!0)}else this.url=String(Z);if(this.credentials=T.credentials||this.credentials||"same-origin",(T.headers||!this.headers)&&(this.headers=new p(T.headers)),this.method=R(T.method||this.method||"GET"),this.mode=T.mode||this.mode||null,this.signal=T.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&W)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(W)}E.prototype.clone=function(){return new E(this,{body:this._bodyInit})};function I(Z){var T=new FormData;return Z.trim().split("&").forEach(function(W){if(W){var k=W.split("="),M=k.shift().replace(/\+/g," "),D=k.join("=").replace(/\+/g," ");T.append(decodeURIComponent(M),decodeURIComponent(D))}}),T}function C(Z){var T=new p,W=Z.replace(/\r?\n[\t ]+/g," ");return W.split(/\r?\n/).forEach(function(k){var M=k.split(":"),D=M.shift().trim();if(D){var U=M.join(":").trim();T.append(D,U)}}),T}w.call(E.prototype);function N(Z,T){T||(T={}),this.type="default",this.status=T.status===void 0?200:T.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in T?T.statusText:"OK",this.headers=new p(T.headers),this.url=T.url||"",this._initBody(Z)}w.call(N.prototype),N.prototype.clone=function(){return new N(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},N.error=function(){var Z=new N(null,{status:0,statusText:""});return Z.type="error",Z};var G=[301,302,303,307,308];N.redirect=function(Z,T){if(G.indexOf(T)===-1)throw new RangeError("Invalid status code");return new N(null,{status:T,headers:{location:Z}})},o.DOMException=s.DOMException;try{new o.DOMException}catch(Z){o.DOMException=function(T,W){this.message=T,this.name=W;var k=Error(T);this.stack=k.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function Q(Z,T){return new Promise(function(W,k){var M=new E(Z,T);if(M.signal&&M.signal.aborted)return k(new o.DOMException("Aborted","AbortError"));var D=new XMLHttpRequest;function U(){D.abort()}D.onload=function(){var q={status:D.status,statusText:D.statusText,headers:C(D.getAllResponseHeaders()||"")};q.url="responseURL"in D?D.responseURL:q.headers.get("X-Request-URL");var fe="response"in D?D.response:D.responseText;W(new N(fe,q))},D.onerror=function(){k(new TypeError("Network request failed"))},D.ontimeout=function(){k(new TypeError("Network request failed"))},D.onabort=function(){k(new o.DOMException("Aborted","AbortError"))},D.open(M.method,M.url,!0),M.credentials==="include"?D.withCredentials=!0:M.credentials==="omit"&&(D.withCredentials=!1),"responseType"in D&&l.blob&&(D.responseType="blob"),M.headers.forEach(function(q,fe){D.setRequestHeader(fe,q)}),M.signal&&(M.signal.addEventListener("abort",U),D.onreadystatechange=function(){D.readyState===4&&M.signal.removeEventListener("abort",U)}),D.send(typeof M._bodyInit=="undefined"?null:M._bodyInit)})}return Q.polyfill=!0,s.fetch||(s.fetch=Q,s.Headers=p,s.Request=E,s.Response=N),o.Headers=p,o.Request=E,o.Response=N,o.fetch=Q,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t})(bo,bo.exports);var vo=bo.exports;const di=ci(vo),Wb=Object.freeze(Object.defineProperty({__proto__:null,default:di},Symbol.toStringTag,{value:"Module"})),kr=e=>{let t={};return e&&(typeof Headers!="undefined"&&e instanceof Headers||Wb&&vo.Headers&&e instanceof vo.Headers?t=Gb(e):Array.isArray(e)?e.forEach(([r,n])=>{r&&n!==void 0&&(t[r]=n)}):t=e),t},Nc=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),Pb=e=>{if(!Array.isArray(e.query)){const n=e,i=[`query=${encodeURIComponent(Nc(n.query))}`];return e.variables&&i.push(`variables=${encodeURIComponent(n.jsonSerializer.stringify(n.variables))}`),n.operationName&&i.push(`operationName=${encodeURIComponent(n.operationName)}`),i.join("&")}if(typeof e.variables!="undefined"&&!Array.isArray(e.variables))throw new Error("Cannot create query with given variable type, array expected");const t=e,r=e.query.reduce((n,i,s)=>(n.push({query:Nc(i),variables:t.variables?t.jsonSerializer.stringify(t.variables[s]):void 0}),n),[]);return`query=${encodeURIComponent(t.jsonSerializer.stringify(r))}`},Mb=e=>t=>$(this,null,function*(){var m;const{url:r,query:n,variables:i,operationName:s,fetch:o,fetchOptions:l,middleware:u}=t,a=x({},t.headers);let h="",c;e==="POST"?(c=Ab(n,i,s,l.jsonSerializer),typeof c=="string"&&(a["Content-Type"]="application/json")):h=Pb({query:n,variables:i,operationName:s,jsonSerializer:(m=l.jsonSerializer)!=null?m:mo});const f=x({method:e,headers:a,body:c},l);let d=r,p=f;if(u){const g=yield Promise.resolve(u(B(x({},f),{url:r,operationName:s,variables:i}))),{url:y}=g,S=et(g,["url"]);d=y,p=S}return h&&(d=`${d}?${h}`),yield o(d,p)});class So{constructor(t,r={}){this.url=t,this.requestConfig=r,this.rawRequest=(...n)=>$(this,null,function*(){const[i,s,o]=n,l=kb(i,s,o),g=this.requestConfig,{headers:u,fetch:a=di,method:h="POST",requestMiddleware:c,responseMiddleware:f}=g,d=et(g,["headers","fetch","method","requestMiddleware","responseMiddleware"]),{url:p}=this;l.signal!==void 0&&(d.signal=l.signal);const{operationName:m}=go(l.query);return wo({url:p,query:l.query,variables:l.variables,headers:x(x({},kr(Ro(u))),kr(l.requestHeaders)),operationName:m,fetch:a,method:h,fetchOptions:d,middleware:c}).then(v=>(f&&f(v),v)).catch(v=>{throw f&&f(v),v})})}request(t,...r){return $(this,null,function*(){const[n,i]=r,s=Vb(t,n,i),m=this.requestConfig,{headers:o,fetch:l=di,method:u="POST",requestMiddleware:a,responseMiddleware:h}=m,c=et(m,["headers","fetch","method","requestMiddleware","responseMiddleware"]),{url:f}=this;s.signal!==void 0&&(c.signal=s.signal);const{query:d,operationName:p}=go(s.document);return wo({url:f,query:d,variables:s.variables,headers:x(x({},kr(Ro(o))),kr(s.requestHeaders)),operationName:p,fetch:l,method:u,fetchOptions:c,middleware:a}).then(g=>(h&&h(g),g.data)).catch(g=>{throw h&&h(g),g})})}batchRequests(t,r){var a;const n=Xb(t,r),u=this.requestConfig,{headers:i}=u,s=et(u,["headers"]);n.signal!==void 0&&(s.signal=n.signal);const o=n.documents.map(({document:h})=>go(h).query),l=n.documents.map(({variables:h})=>h);return wo({url:this.url,query:o,variables:l,headers:x(x({},kr(Ro(i))),kr(n.requestHeaders)),operationName:void 0,fetch:(a=this.requestConfig.fetch)!=null?a:di,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware}).then(h=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(h),h.data)).catch(h=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(h),h})}setHeaders(t){return this.requestConfig.headers=t,this}setHeader(t,r){const{headers:n}=this.requestConfig;return n?n[t]=r:this.requestConfig.headers={[t]:r},this}setEndpoint(t){return this.url=t,this}}const wo=e=>$(this,null,function*(){var h,c;const{query:t,variables:r,fetchOptions:n}=e,i=Mb(Ob((h=e.method)!=null?h:"post")),s=Array.isArray(e.query),o=yield i(e),l=yield Ub(o,(c=n.jsonSerializer)!=null?c:mo),u=Array.isArray(l)?!l.some(({data:d})=>!d):!!l.data,a=Array.isArray(l)||!l.errors||Array.isArray(l.errors)&&!l.errors.length||n.errorPolicy==="all"||n.errorPolicy==="ignore";if(o.ok&&a&&u){const f=(Array.isArray(l),l),{errors:d}=f,p=et(f,["errors"]),m=n.errorPolicy==="ignore"?p:l;return B(x({},s?{data:m}:m),{headers:o.headers,status:o.status})}else{const d=typeof l=="string"?{error:l}:l;throw new Vr(B(x({},d),{status:o.status,headers:o.headers}),{query:t,variables:r})}}),Ab=(e,t,r,n)=>{const i=n!=null?n:mo;if(!Array.isArray(e))return i.stringify({query:e,variables:t,operationName:r});if(typeof t!="undefined"&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");const s=e.reduce((o,l,u)=>(o.push({query:l,variables:t?t[u]:void 0}),o),[]);return i.stringify(s)},Ub=(e,t)=>$(this,null,function*(){let r;return e.headers.forEach((n,i)=>{i.toLowerCase()==="content-type"&&(r=n)}),r&&(r.toLowerCase().startsWith("application/json")||r.toLowerCase().startsWith("application/graphql+json")||r.toLowerCase().startsWith("application/graphql-response+json"))?t.parse(yield e.text()):e.text()}),Ro=e=>typeof e=="function"?e():e;var _o={exports:{}};(function(e,t){t=e.exports=r,t.getSerialize=n;function r(i,s,o,l){return JSON.stringify(i,n(s,l),o)}function n(i,s){var o=[],l=[];return s==null&&(s=function(u,a){return o[0]===a?"[Circular ~]":"[Circular ~."+l.slice(0,o.indexOf(a)).join(".")+"]"}),function(u,a){if(o.length>0){var h=o.indexOf(this);~h?o.splice(h+1):o.push(this),~h?l.splice(h,1/0,u):l.push(u),~o.indexOf(a)&&(a=s.call(this,u,a))}else o.push(a);return i==null?a:i.call(this,u,a)}}})(_o,_o.exports);var Db=_o.exports;const bt=ci(Db);var Fb=Object.defineProperty,Jb=(e,t,r)=>t in e?Fb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,X=(e,t,r)=>Jb(e,typeof t!="symbol"?t+"":t,r),Oc,Hb=Object.defineProperty,Yb=(e,t,r)=>t in e?Hb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gc=(e,t,r)=>Yb(e,typeof t!="symbol"?t+"":t,r),Ge=(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",e))(Ge||{});const hi=new Map,Vc=new WeakSet;function kc(e){return e!==null&&typeof e=="object"&&"complete"in e&&"naturalWidth"in e&&"naturalHeight"in e&&"src"in e&&"onload"in e}function Bb(e){if(Vc.has(e))return;Vc.add(e);const t=e.drawImage.bind(e);e.drawImage=function(r,...n){const i=hi.get(e);i&&(i.cancelled=!0);const s=()=>{n.length===2&&kc(r)&&n.push(r.naturalWidth||r.width,r.naturalHeight||r.height),t(r,...n)};if(kc(r)&&!r.complete){const o={cancelled:!1};hi.set(e,o);const l=()=>{o.cancelled||(hi.delete(e),s())},u=()=>{if(!o.cancelled){hi.delete(e);try{s()}catch(a){}}};r.onload=l,r.onerror=u}else s()}}const Xc={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Wc={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},fi={},Pc={},zb=()=>!!globalThis.Zone;function To(e){if(fi[e])return fi[e];const t=globalThis[e],r=t.prototype,n=e in Xc?Xc[e]:void 0,i=!!(n&&n.every(l=>{var u,a;return!!((a=(u=Object.getOwnPropertyDescriptor(r,l))==null?void 0:u.get)!=null&&a.toString().includes("[native code]"))})),s=e in Wc?Wc[e]:void 0,o=!!(s&&s.every(l=>{var u;return typeof r[l]=="function"&&((u=r[l])==null?void 0:u.toString().includes("[native code]"))}));if(i&&o&&!zb())return fi[e]=t.prototype,t.prototype;try{const l=document.createElement("iframe");l.style.display="none",document.body.appendChild(l);const u=l.contentWindow;if(!u)return t.prototype;const a=u[e].prototype;if(!a)return l.remove(),r;const h=navigator.userAgent;return h.includes("Safari")&&!h.includes("Chrome")?(l.classList.add("rr-block"),l.setAttribute("__rrwebUntaintedMutationObserver",""),Pc[e]=()=>l.remove()):l.remove(),fi[e]=a}catch(l){return r}}const Eo={};function Ot(e,t,r){var n;const i=`${e}.${String(r)}`;if(Eo[i])return Eo[i].call(t);const s=To(e),o=(n=Object.getOwnPropertyDescriptor(s,r))==null?void 0:n.get;return o?(Eo[i]=o,o.call(t)):t[r]}const Io={};function Mc(e,t,r){const n=`${e}.${String(r)}`;if(Io[n])return Io[n].bind(t);const s=To(e)[r];return typeof s!="function"?t[r]:(Io[n]=s,s.bind(t))}function Kb(e){return Ot("Node",e,"ownerDocument")}function jb(e){return Ot("Node",e,"childNodes")}function Qb(e){return Ot("Node",e,"parentNode")}function $b(e){return Ot("Node",e,"parentElement")}function qb(e){return Ot("Node",e,"textContent")}function ev(e,t){return Mc("Node",e,"contains")(t)}function tv(e){return Mc("Node",e,"getRootNode")()}function rv(e){return!e||!("host"in e)?null:Ot("ShadowRoot",e,"host")}function nv(e){return e.styleSheets}function iv(e){return!e||!("shadowRoot"in e)?null:Ot("Element",e,"shadowRoot")}function sv(e,t){return Ot("Element",e,"querySelector")(t)}function ov(e,t){return Ot("Element",e,"querySelectorAll")(t)}function av(){var e;return[To("MutationObserver").constructor,(e=Pc.MutationObserver)!=null?e:()=>{}]}let Ac=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Ac=()=>new Date().getTime());function lv(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(n){return()=>{}}}const Ae={ownerDocument:Kb,childNodes:jb,parentNode:Qb,parentElement:$b,textContent:qb,contains:ev,getRootNode:tv,host:rv,styleSheets:nv,shadowRoot:iv,querySelector:sv,querySelectorAll:ov,nowTimestamp:Ac,mutationObserverCtor:av,patch:lv,wrapCanvasContextDrawImage:Bb};function Uc(e){return e.nodeType===e.ELEMENT_NODE}function dn(e){const t=e&&"host"in e&&"mode"in e&&Ae.host(e)||null;return!!(t&&"shadowRoot"in t&&Ae.shadowRoot(t)===e)}function hn(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function uv(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function cv(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function Co(e){try{const t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);const n=Array.from(t,i=>Dc(i,r)).join("");return uv(n)}catch(t){return null}}function Dc(e,t){if(Fc(e)){let r;try{r=Co(e.styleSheet)||cv(e)}catch(n){r=e.cssText}return e.styleSheet.href?gi(r,e.styleSheet.href):r}else{let r=e.cssText;return hv(e)&&e.selectorText.includes(":")&&(r=dv(r)),t?gi(r,t):r}}function dv(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function Fc(e){return"styleSheet"in e}function hv(e){return"selectorText"in e}class Jc{constructor(){Gc(this,"idNodeMap",new Map),Gc(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))==null?void 0:r.id;return n!=null?n:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){const n=this.getNode(t);if(n){const i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(r,i)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function fv(){return new Jc}function pi({element:e,maskInputOptions:t,tagName:r,type:n,value:i,overwriteRecord:s,maskInputFn:o}){let l=i||"";return zc({maskInputOptions:t,tagName:r,type:n,overwriteRecord:s})&&(o?l=o(l,e):l="*".repeat(l.length)),l}function ur(e){return e.toLowerCase()}const Hc="__rrweb_original__";function pv(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let n=0;n<e.width;n+=r)for(let i=0;i<e.height;i+=r){const s=t.getImageData,o=Hc in s?s[Hc]:s;if(new Uint32Array(o.call(t,n,i,Math.min(r,e.width-n),Math.min(r,e.height-i)).data.buffer).some(u=>u!==0))return!1}return!0}function mi(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ur(t):null}function Yc(e,t){var s;let r;try{r=new URL(e,window.location.href)}catch(o){return null}const n=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(n);return(s=i==null?void 0:i[1])!=null?s:null}function mv(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}const gv=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,yv=/^(?:[a-z+]+:)?\/\//i,bv=/^www\..*/i,vv=/^(data:)([^,]*),(.*)/i;function gi(e,t){return(e||"").replace(gv,(r,n,i,s,o,l)=>{const u=i||o||l,a=n||s||"";if(!u)return r;if(yv.test(u)||bv.test(u))return`url(${a}${u}${a})`;if(vv.test(u))return`url(${a}${u}${a})`;if(u[0]==="/")return`url(${a}${mv(t)+u}${a})`;const h=u.split("#")[0],c=u.substring(h.length),f=t.split("#")[0].split("/"),d=h.split("/");f.pop();for(const p of d)p!=="."&&(p===".."?f.pop():f.push(p));return`url(${a}${f.join("/")}${c}${a})`})}function yi(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Sv(e,t,r=!1){const n=Array.from(t.childNodes),i=[];let s=0;if(n.length>1&&e&&typeof e=="string"){let o=yi(e,r);const l=o.length/e.length;for(let u=1;u<n.length;u++)if(n[u].textContent&&typeof n[u].textContent=="string"){const a=yi(n[u].textContent,r),h=100;let c=3;for(;c<a.length&&(a[c].match(/[a-zA-Z0-9]/)||a.indexOf(a.substring(0,c),1)!==-1);c++);for(;c<a.length;c++){let f=a.substring(0,c),d=o.split(f),p=-1;if(d.length===2)p=d[0].length;else if(d.length>2&&d[0]===""&&n[u-1].textContent!=="")p=o.indexOf(f,1);else if(d.length===1){if(f=f.substring(0,f.length-1),d=o.split(f),d.length<=1)return i.push(e),i;c=h+1}else c===a.length-1&&(p=o.indexOf(f));if(d.length>=2&&c>h){const m=n[u-1].textContent;if(m&&typeof m=="string"){const g=yi(m).length;p=o.indexOf(f,g)}p===-1&&(p=d[0].length)}if(p!==-1){let m=Math.floor(p/l);for(;m>0&&m<e.length;){if(s+=1,s>50*n.length)return i.push(e),i;const g=yi(e.substring(0,m),r);if(g.length===p){i.push(e.substring(0,m)),e=e.substring(m),o=o.substring(p);break}else g.length<p?m+=Math.max(1,Math.floor((p-g.length)/l)):m-=Math.max(1,Math.floor((g.length-p)*l))}break}}}}return i.push(e),i}function wv(e,t){return Sv(e,t).join("/* rr_split */")}function Zo(e){return e=e.replace(/[^ -~]+/g,""),e=(e==null?void 0:e.split(" ").map(t=>t?Math.random().toString(20).substring(2,t.length+2):"").join(" "))||"",e}function Lo(e){return e==="img"||e==="video"||e==="audio"||e==="source"}const Rv=new RegExp(/[a-zA-Z0-9.!#$%&'*+=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*/),_v=new RegExp(/[0-9]{9,16}/),Tv=new RegExp(/[0-9]{3}-?[0-9]{2}-?[0-9]{4}/),Ev=new RegExp(/[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}/),Iv=new RegExp(/[0-9]{4}-?[0-9]{4}-?[0-9]{4}-?[0-9]{4}/),Cv=new RegExp(/[0-9]{1,5}.?[0-9]{0,3}\s[a-zA-Z]{2,30}\s[a-zA-Z]{2,15}/),Zv=new RegExp(/(?:[0-9]{1,3}.){3}[0-9]{1,3}/),Lv=[Rv,_v,Tv,Ev,Iv,Cv,Zv];function Bc(e){return e?Lv.some(t=>t.test(e)):!1}const zc=({maskInputOptions:e,tagName:t,type:r,overwriteRecord:n})=>{const i=r&&r.toLowerCase();return n!=="true"&&(!!e[t.toLowerCase()]||!!(i&&e[i]))};let xv=1;const Nv=new RegExp("[^a-z0-9-_:]"),fn=-2;function Kc(){return xv++}function Ov(e){if(e instanceof HTMLFormElement)return"form";const t=ur(e.tagName);return Nv.test(t)?"div":t}let Xr,jc;const Gv=/^[^ \t\n\r\u000c]+/,Vv=/^[, \t\n\r\u000c]+/;function kv(e,t){if(t.trim()==="")return t;let r=0;function n(s){let o;const l=s.exec(t.substring(r));return l?(o=l[0],r+=o.length,o):""}const i=[];for(;n(Vv),!(r>=t.length);){let s=n(Gv);if(s.slice(-1)===",")s=Wr(e,s.substring(0,s.length-1)),i.push(s);else{let o="";s=Wr(e,s);let l=!1;for(;;){const u=t.charAt(r);if(u===""){i.push((s+o).trim());break}else if(l)u===")"&&(l=!1);else if(u===","){r+=1,i.push((s+o).trim());break}else u==="("&&(l=!0);o+=u,r+=1}}}return i.join(", ")}const Qc=new WeakMap;function Wr(e,t){return!t||t.trim()===""?t:xo(e,t)}function Xv(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function xo(e,t){let r=Qc.get(e);if(r||(r=e.createElement("a"),Qc.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function $c(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?Wr(e,n):r==="srcset"?kv(e,n):r==="style"?gi(n,xo(e)):t==="object"&&r==="data"?Wr(e,n):n)}function qc(e,t,r){return["video","audio"].includes(e)&&t==="autoplay"}function ed(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch(n){}return!1}function bi(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?bi(Ae.parentNode(e),t,r):!1;for(let n=e.classList.length;n--;){const i=e.classList[n];if(t.test(i))return!0}return r?bi(Ae.parentNode(e),t,r):!1}function td(e,t,r,n){let i;if(Uc(e)){if(i=e,!Ae.childNodes(i).length)return!1}else{if(Ae.parentElement(e)===null)return!1;i=Ae.parentElement(e)}try{if(typeof t=="string"){if(n){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(bi(i,t,n))return!0;if(r){if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch(s){}return!1}function Wv(e,t,r){const n=e.contentWindow;if(!n)return;let i=!1,s;try{s=n.document.readyState}catch(l){return}if(s!=="complete"){const l=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(l),i=!0,t()});return}const o="about:blank";if(n.location.href!==o||e.src===o||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Pv(e,t,r){let n=!1,i;try{i=e.sheet}catch(o){return}if(i)return;const s=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(s),n=!0,t()})}function Mv(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:s,needsMask:o,inlineStylesheet:l,maskInputOptions:u={},maskTextClass:a,maskTextFn:h,maskInputFn:c,dataURLOptions:f={},inlineImages:d,inlineVideos:p,recordCanvas:m,keepIframeSrcFn:g,newlyAddedElement:v=!1,cssCaptured:y=!1,privacySetting:S}=t,_=Av(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Ge.Document,childNodes:[],compatMode:e.compatMode}:{type:Ge.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ge.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:_};case e.ELEMENT_NODE:return Dv(e,{doc:r,blockClass:i,blockSelector:s,inlineStylesheet:l,maskInputOptions:u,maskInputFn:c,maskTextClass:a,dataURLOptions:f,inlineImages:d,inlineVideos:p,recordCanvas:m,keepIframeSrcFn:g,newlyAddedElement:v,privacySetting:S,rootId:_});case e.TEXT_NODE:return Uv(e,{doc:r,needsMask:o,maskTextFn:h,privacySetting:S,rootId:_,cssCaptured:y});case e.CDATA_SECTION_NODE:return{type:Ge.CDATA,textContent:"",rootId:_};case e.COMMENT_NODE:return{type:Ge.Comment,textContent:Ae.textContent(e)||"",rootId:_};default:return!1}}function Av(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function Uv(e,t){var r;const{needsMask:n,maskTextFn:i,privacySetting:s,rootId:o,cssCaptured:l}=t,u=Ae.parentNode(e),a=u&&u.tagName;let h="";const c=a==="STYLE"?!0:void 0,f=a==="SCRIPT"?!0:void 0;f?h="SCRIPT_PLACEHOLDER":l||(h=Ae.textContent(e),c&&h&&(h=gi(h,xo(t.doc)))),!c&&!f&&h&&n&&(h=i?i(h,Ae.parentElement(e)):h.replace(/[\S]/g,"*"));const d=s==="strict",p=(r=e.parentElement)==null?void 0:r.getAttribute("data-hl-record"),m=s==="default"&&Bc(h);return(d||m)&&!p&&a&&!new Set(["HEAD","TITLE","STYLE","SCRIPT","HTML","BODY","NOSCRIPT"]).has(a)&&h&&(h=Zo(h)),{type:Ge.Text,textContent:h||"",rootId:o}}function Dv(e,t){const{doc:r,blockClass:n,blockSelector:i,inlineStylesheet:s,maskInputOptions:o={},maskInputFn:l,maskTextClass:u,dataURLOptions:a={},inlineImages:h,inlineVideos:c,recordCanvas:f,keepIframeSrcFn:d,newlyAddedElement:p=!1,privacySetting:m,rootId:g}=t;let v=ed(e,n,i);const y=ed(e,u,null),S=m==="strict";let _=Ov(e),w={};const b=e.attributes.length;for(let I=0;I<b;I++){const C=e.attributes[I];qc(_,C.name)||(w[C.name]=$c(r,_,ur(C.name),C.value))}if(_==="link"&&s){const I=Array.from(r.styleSheets).find(N=>N.href===e.href);let C=null;I&&(C=Co(I)),C&&(delete w.rel,delete w.href,w._cssText=C)}if(_==="style"&&e.sheet){let I=Co(e.sheet);I&&(e.childNodes.length>1&&(I=wv(I,e)),w._cssText=I)}if(["input","textarea","select"].includes(_)){const I=e.value,C=e.checked;w.type!=="radio"&&w.type!=="checkbox"&&w.type!=="submit"&&w.type!=="button"&&I?w.value=pi({element:e,type:mi(e),tagName:_,value:I,overwriteRecord:e.getAttribute("data-hl-record"),maskInputOptions:o,maskInputFn:l}):C&&(w.checked=C)}if(_==="option"&&(e.selected&&!o.select?w.selected=!0:delete w.selected),_==="dialog"&&e.open&&(w.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),_==="canvas"&&f){if(e.__context==="2d")pv(e);else if(!("__context"in e)){const I=e.toDataURL(a.type,a.quality),C=r.createElement("canvas");C.width=e.width,C.height=e.height;const N=C.toDataURL(a.type,a.quality);I!==N&&(w.rr_dataURL=I)}}if(_==="img"&&h&&!v&&!y&&!S){Xr||(Xr=r.createElement("canvas"),jc=Xr.getContext("2d"));const I=e,C=I.currentSrc||I.getAttribute("src")||"<unknown-src>",N=I.crossOrigin,G=()=>{I.removeEventListener("load",G);try{Xr.width=I.naturalWidth,Xr.height=I.naturalHeight,jc.drawImage(I,0,0),w.rr_dataURL=Xr.toDataURL(a.type,a.quality)}catch(Q){if(I.crossOrigin!=="anonymous"){I.crossOrigin="anonymous",I.complete&&I.naturalWidth!==0?G():I.addEventListener("load",G);return}else console.warn(`Cannot inline img src=${C}! Error: ${Q}`)}I.crossOrigin==="anonymous"&&(N?w.crossOrigin=N:I.removeAttribute("crossorigin"))};I.complete&&I.naturalWidth!==0?G():I.addEventListener("load",G)}if(["audio","video"].includes(_)){const I=w;I.rr_mediaState=e.paused?"paused":"played",I.rr_mediaCurrentTime=e.currentTime,I.rr_mediaPlaybackRate=e.playbackRate,I.rr_mediaMuted=e.muted,I.rr_mediaLoop=e.loop,I.rr_mediaVolume=e.volume}if(p||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop)),v||y||S&&Lo(_)){const{width:I,height:C}=e.getBoundingClientRect();w={class:w.class,rr_width:`${I}px`,rr_height:`${C}px`}}S&&Lo(_)&&(v=!0),_==="iframe"&&!d(w.src)&&(e.contentDocument||(w.rr_src=w.src),delete w.src);let R;try{customElements.get(_)&&(R=!0)}catch(I){}const E=I=>{const{width:C,height:N}=I.getBoundingClientRect();w={width:C,height:N,rr_width:`${C}px`,rr_height:`${N}px`,rr_inlined_video:!0,class:w.class,style:w.style},_="canvas";const G=r.createElement("canvas");G.width=e.width,G.height=e.height,w.rr_dataURL=G.toDataURL(a.type,a.quality)};if(_==="video"){const I=e;h&&(I.src===""||I.src.indexOf("blob:")!==-1)&&E(I),c&&I.src!==""&&I.src.indexOf("blob:")===-1&&E(I)}return{type:Ge.Element,tagName:_,attributes:w,childNodes:[],isSVG:Xv(e)||void 0,needBlock:v,needMask:y,rootId:g,isCustom:R}}function we(e){return e==null?"":e.toLowerCase()}function rd(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function Fv(e,t){if(t.comment&&e.type===Ge.Comment)return!0;if(e.type===Ge.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Yc(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(we(e.attributes.name).match(/^msapplication-tile(image|color)$/)||we(e.attributes.name)==="application-name"||we(e.attributes.rel)==="icon"||we(e.attributes.rel)==="apple-touch-icon"||we(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&we(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(we(e.attributes.property).match(/^(og|twitter|fb):/)||we(e.attributes.name).match(/^(og|twitter):/)||we(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(we(e.attributes.name)==="robots"||we(e.attributes.name)==="googlebot"||we(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(we(e.attributes.name)==="author"||we(e.attributes.name)==="generator"||we(e.attributes.name)==="framework"||we(e.attributes.name)==="publisher"||we(e.attributes.name)==="progid"||we(e.attributes.property).match(/^article:/)||we(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(we(e.attributes.name)==="google-site-verification"||we(e.attributes.name)==="yandex-verification"||we(e.attributes.name)==="csrf-token"||we(e.attributes.name)==="p:domain_verify"||we(e.attributes.name)==="verify-v1"||we(e.attributes.name)==="verification"||we(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Pr(e,t){const{doc:r,mirror:n,blockClass:i,blockSelector:s,maskTextClass:o,maskTextSelector:l,skipChild:u=!1,inlineStylesheet:a=!0,maskInputOptions:h={},maskTextFn:c,maskInputFn:f,slimDOMOptions:d,dataURLOptions:p={},inlineImages:m=!1,inlineVideos:g=!1,recordCanvas:v=!1,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:_=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:b=5e3,keepIframeSrcFn:R=()=>!1,newlyAddedElement:E=!1,cssCaptured:I=!1,privacySetting:C}=t;let{needsMask:N}=t,{preserveWhiteSpace:G=!0}=t;N||(N=td(e,o,l,N===void 0));const Q=Mv(e,{doc:r,mirror:n,blockClass:i,blockSelector:s,needsMask:N,inlineStylesheet:a,maskInputOptions:h,maskTextClass:o,maskTextFn:c,maskInputFn:f,dataURLOptions:p,inlineImages:m,inlineVideos:g,recordCanvas:v,keepIframeSrcFn:R,newlyAddedElement:E,cssCaptured:I,privacySetting:C});if(!Q)return console.warn(e,"not serialized"),null;let Z;n.hasNode(e)?Z=n.getId(e):Fv(Q,d)||!G&&Q.type===Ge.Text&&!Q.textContent.replace(/^\s+|\s+$/gm,"").length?Z=fn:Z=Kc();const T=Object.assign(Q,{id:Z});if(n.add(e,T),Z===fn)return null;y&&y(e);let W=!u,k=C,M=C==="strict";if(T.type===Ge.Element){if(W=W&&!T.needBlock,M||(M=!!T.needBlock||!!T.needMask),k=M?"strict":k,M&&Lo(T.tagName)){const q=e.cloneNode();q.src="",n.add(q,T)}delete T.needBlock,delete T.needMask;const U=Ae.shadowRoot(e);U&&hn(U)&&(T.isShadowHost=!0)}if((T.type===Ge.Document||T.type===Ge.Element)&&W){d.headWhitespace&&T.type===Ge.Element&&T.tagName==="head"&&(G=!1);const U={doc:r,mirror:n,blockClass:i,blockSelector:s,needsMask:N,maskTextClass:o,maskTextSelector:l,skipChild:u,inlineStylesheet:a,maskInputOptions:h,maskTextFn:c,maskInputFn:f,slimDOMOptions:d,dataURLOptions:p,inlineImages:m,inlineVideos:g,recordCanvas:v,preserveWhiteSpace:G,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:_,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:R,cssCaptured:!1,privacySetting:k};if(!(T.type===Ge.Element&&T.tagName==="textarea"&&T.attributes.value!==void 0)){T.type===Ge.Element&&T.attributes._cssText!==void 0&&typeof T.attributes._cssText=="string"&&(U.cssCaptured=!0);for(const fe of Array.from(Ae.childNodes(e))){const O=Pr(fe,U);O&&T.childNodes.push(O)}}let q=null;if(Uc(e)&&(q=Ae.shadowRoot(e)))for(const fe of Array.from(Ae.childNodes(q))){const O=Pr(fe,U);O&&(hn(q)&&(O.isShadow=!0),T.childNodes.push(O))}}const D=Ae.parentNode(e);return D&&dn(D)&&hn(D)&&(T.isShadow=!0),T.type===Ge.Element&&T.tagName==="iframe"&&Wv(e,()=>{const U=e.contentDocument;if(U&&S){const q=Pr(U,{doc:U,mirror:n,blockClass:i,blockSelector:s,needsMask:N,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:a,maskInputOptions:h,maskTextFn:c,maskInputFn:f,slimDOMOptions:d,dataURLOptions:p,inlineImages:m,inlineVideos:g,recordCanvas:v,preserveWhiteSpace:G,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:_,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:R,privacySetting:C});q&&S(e,q)}},_),T.type===Ge.Element&&T.tagName==="link"&&typeof T.attributes.rel=="string"&&(T.attributes.rel==="stylesheet"||T.attributes.rel==="preload"&&typeof T.attributes.href=="string"&&Yc(T.attributes.href)==="css")&&Pv(e,()=>{if(w){const U=Pr(e,{doc:r,mirror:n,blockClass:i,blockSelector:s,needsMask:N,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:a,maskInputOptions:h,maskTextFn:c,maskInputFn:f,slimDOMOptions:d,dataURLOptions:p,inlineImages:m,inlineVideos:g,recordCanvas:v,preserveWhiteSpace:G,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:_,onStylesheetLoad:w,stylesheetLoadTimeout:b,keepIframeSrcFn:R,privacySetting:C});U&&w(e,U)}},b),T}function Jv(e,t){const{mirror:r=new Jc,blockClass:n="highlight-block",blockSelector:i=null,maskTextClass:s="highlight-mask",maskTextSelector:o=null,inlineStylesheet:l=!0,inlineImages:u=!1,inlineVideos:a=!1,recordCanvas:h=!1,maskAllInputs:c=!1,maskTextFn:f,maskInputFn:d,slimDOM:p=!1,dataURLOptions:m,preserveWhiteSpace:g,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:S,onStylesheetLoad:_,stylesheetLoadTimeout:w,keepIframeSrcFn:b=()=>!1,privacySetting:R="default"}=t||{},E=c===!0?{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}:c===!1?{password:!0}:c,I=rd(p);return Pr(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:E,maskTextFn:f,maskInputFn:d,slimDOMOptions:I,dataURLOptions:m,inlineImages:u,inlineVideos:a,recordCanvas:h,preserveWhiteSpace:g,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:S,onStylesheetLoad:_,stylesheetLoadTimeout:w,keepIframeSrcFn:b,newlyAddedElement:!1,privacySetting:R})}function Hv(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?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(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var vi={exports:{}},nd;function Yv(){if(nd)return vi.exports;nd=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return vi.exports=t(),vi.exports.createColors=t,vi.exports}const vt=Hv(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var No,id;function Oo(){if(id)return No;id=1;let e=Yv(),t=vt;class r extends Error{constructor(i,s,o,l,u,a){super(i),this.name="CssSyntaxError",this.reason=i,u&&(this.file=u),l&&(this.source=l),a&&(this.plugin=a),typeof s!="undefined"&&typeof o!="undefined"&&(typeof s=="number"?(this.line=s,this.column=o):(this.line=s.line,this.column=s.column,this.endLine=o.line,this.endColumn=o.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(i){if(!this.source)return"";let s=this.source;i==null&&(i=e.isColorSupported);let o=d=>d,l=d=>d,u=d=>d;if(i){let{bold:d,gray:p,red:m}=e.createColors(!0);l=g=>d(m(g)),o=g=>p(g),t&&(u=g=>t(g))}let a=s.split(/\r?\n/),h=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),f=String(c).length;return a.slice(h,c).map((d,p)=>{let m=h+1+p,g=" "+(" "+m).slice(-f)+" | ";if(m===this.line){if(d.length>160){let y=20,S=Math.max(0,this.column-y),_=Math.max(this.column+y,this.endColumn+y),w=d.slice(S,_),b=o(g.replace(/\d/g," "))+d.slice(0,Math.min(this.column-1,y-1)).replace(/[^\t]/g," ");return l(">")+o(g)+u(w)+`
|
|
50
|
+
`+b+l("^")}let v=o(g.replace(/\d/g," "))+d.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+o(g)+u(d)+`
|
|
51
|
+
`+v+l("^")}return" "+o(g)+u(d)}).join(`
|
|
52
|
+
`)}toString(){let i=this.showSourceCode();return i&&(i=`
|
|
53
|
+
|
|
54
|
+
`+i+`
|
|
55
|
+
`),this.name+": "+this.message+i}}return No=r,r.default=r,No}var Go,sd;function od(){if(sd)return Go;sd=1;const e=/(<)(\/?style\b)/gi,t=/(<)(!--)/g,r=/[\t\n\f\r "#'()/;[\\\]{}]/;function n(h){return typeof h!="string"||!h.includes("<")?h:h.replace(e,"\\3c $2").replace(t,"\\3c $2")}const i={after:`
|
|
56
|
+
`,beforeClose:`
|
|
57
|
+
`,beforeComment:`
|
|
58
|
+
`,beforeDecl:`
|
|
59
|
+
`,beforeOpen:" ",beforeRule:`
|
|
60
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function s(h){return h[0].toUpperCase()+h.slice(1)}function o(h,c){let f="@"+c.name,d=c.params?h.rawValue(c,"params"):"",p=c.raws.afterName;return typeof p=="undefined"?p=d?" ":"":p===""&&d&&!r.test(d[0])&&(p=" "),f+p+d}function l(h,c,f){let d=f.nodes,p=d.length-1;for(;p>0&&d[p].type==="comment";)p-=1;let m=h.raw(f,"semicolon"),g=f.type==="document";for(let v=d.length-1;v>=0;v--){let y=d[v],S=p!==v||m;!S&&v<d.length-1&&(y.type==="atrule"&&!y.nodes||y.type==="decl"&&y.prop.startsWith("--"))&&(S=!0),c.push({document:g,node:y,semicolon:S})}}function u(h,c,f,d){let p=h.raw(f,"between","beforeOpen");h.builder(n(d+p)+"{",f,"start");let m=f.nodes&&f.nodes.length,g=()=>{let v=m?h.raw(f,"after"):h.raw(f,"after","emptyBody");v&&h.builder(n(v)),h.builder("}",f,"end"),f.type==="rule"&&f.raws.ownSemicolon&&h.builder(n(f.raws.ownSemicolon),f,"end")};m?(c.push(g),l(h,c,f)):g()}class a{constructor(c){this.builder=c}atrule(c,f){let d=o(this,c);if(c.nodes)this.block(c,d);else{let p=(c.raws.between||"")+(f?";":"");this.builder(n(d+p),c)}}beforeAfter(c,f){let d;c.type==="decl"?d=this.raw(c,null,"beforeDecl"):c.type==="comment"?d=this.raw(c,null,"beforeComment"):f==="before"?d=this.raw(c,null,"beforeRule"):d=this.raw(c,null,"beforeClose");let p=c.parent,m=0;for(;p&&p.type!=="root";)m+=1,p=p.parent;if(d.includes(`
|
|
61
|
+
`)){let g=this.raw(c,null,"indent");if(g.length)for(let v=0;v<m;v++)d+=g}return d}block(c,f){let d=this.raw(c,"between","beforeOpen");this.builder(n(f+d)+"{",c,"start");let p;c.nodes&&c.nodes.length?(this.body(c),p=this.raw(c,"after")):p=this.raw(c,"after","emptyBody"),p&&this.builder(n(p)),this.builder("}",c,"end")}body(c){let f=a.prototype,d=["atrule","block","body","rule","stringify"].every(m=>this[m]===f[m]),p=[];for(l(this,p,c);p.length>0;){let m=p.pop();if(typeof m=="function"){m();continue}let g=m.node,v=this.raw(g,"before");v&&this.builder(m.document?v:n(v)),d&&g.type==="rule"?u(this,p,g,this.rawValue(g,"selector")):d&&g.type==="atrule"&&g.nodes?u(this,p,g,o(this,g)):this.stringify(g,m.semicolon)}}comment(c){let f=this.raw(c,"left","commentLeft"),d=this.raw(c,"right","commentRight");this.builder(n("/*"+f+c.text+d+"*/"),c)}decl(c,f){let d=c.raws,p=this.raw(c,"between","colon"),m=c.prop+p+this.rawValue(c,"value");c.important&&(m+=d.important||" !important"),f&&(m+=";"),this.builder(n(m),c)}document(c){this.body(c)}raw(c,f,d){let p;if(d||(d=f),f&&(p=c.raws[f],typeof p!="undefined"))return p;let m=c.parent;if(d==="before"&&(!m||m.type==="root"&&m.first===c||m&&m.type==="document"))return"";if(!m)return i[d];let g=c.root(),v=g.rawCache||(g.rawCache={});if(typeof v[d]!="undefined")return v[d];if(d==="before"||d==="after")return this.beforeAfter(c,d);{let y="raw"+s(d);this[y]?p=this[y](g,c):g.walk(S=>{if(p=S.raws[f],typeof p!="undefined")return!1})}return typeof p=="undefined"&&(p=i[d]),v[d]=p,p}rawBeforeClose(c){let f;return c.walk(d=>{if(d.nodes&&d.nodes.length>0&&typeof d.raws.after!="undefined")return f=d.raws.after,f.includes(`
|
|
62
|
+
`)&&(f=f.replace(/[^\n]+$/,"")),!1}),f&&(f=f.replace(/\S/g,"")),f}rawBeforeComment(c,f){let d;return c.walkComments(p=>{if(typeof p.raws.before!="undefined")return d=p.raws.before,d.includes(`
|
|
63
|
+
`)&&(d=d.replace(/[^\n]+$/,"")),!1}),typeof d=="undefined"?d=this.raw(f,null,"beforeDecl"):d&&(d=d.replace(/\S/g,"")),d}rawBeforeDecl(c,f){let d;return c.walkDecls(p=>{if(typeof p.raws.before!="undefined")return d=p.raws.before,d.includes(`
|
|
64
|
+
`)&&(d=d.replace(/[^\n]+$/,"")),!1}),typeof d=="undefined"?d=this.raw(f,null,"beforeRule"):d&&(d=d.replace(/\S/g,"")),d}rawBeforeOpen(c){let f;return c.walk(d=>{if(d.type!=="decl"&&(f=d.raws.between,typeof f!="undefined"))return!1}),f}rawBeforeRule(c){let f;return c.walk(d=>{if(d.nodes&&(d.parent!==c||c.first!==d)&&typeof d.raws.before!="undefined")return f=d.raws.before,f.includes(`
|
|
65
|
+
`)&&(f=f.replace(/[^\n]+$/,"")),!1}),f&&(f=f.replace(/\S/g,"")),f}rawColon(c){let f;return c.walkDecls(d=>{if(typeof d.raws.between!="undefined")return f=d.raws.between.replace(/[^\s:]/g,""),!1}),f}rawEmptyBody(c){let f;return c.walk(d=>{if(d.nodes&&d.nodes.length===0&&(f=d.raws.after,typeof f!="undefined"))return!1}),f}rawIndent(c){if(c.raws.indent)return c.raws.indent;let f;return c.walk(d=>{let p=d.parent;if(p&&p!==c&&p.parent&&p.parent===c&&typeof d.raws.before!="undefined"){let m=d.raws.before.split(`
|
|
66
|
+
`);return f=m[m.length-1],f=f.replace(/\S/g,""),!1}}),f}rawSemicolon(c){let f;return c.walk(d=>{if(d.nodes&&d.nodes.length&&d.last.type==="decl"&&(f=d.raws.semicolon,typeof f!="undefined"))return!1}),f}rawValue(c,f){let d=c[f],p=c.raws[f];return p&&p.value===d?p.raw:d}root(c){if(c.source&&c.source.input.hasBOM&&this.builder("\uFEFF",c,"start"),this.body(c),c.raws.after){let f=c.raws.after,d=c.parent&&c.parent.type==="document";this.builder(d?f:n(f))}}rule(c){this.block(c,this.rawValue(c,"selector")),c.raws.ownSemicolon&&this.builder(n(c.raws.ownSemicolon),c,"end")}stringify(c,f){if(!this[c.type])throw new Error("Unknown AST node type "+c.type+". Maybe you need to change PostCSS stringifier.");this[c.type](c,f)}}return Go=a,a.default=a,Go}var Vo,ad;function Si(){if(ad)return Vo;ad=1;let e=od();function t(r,n){new e(n).stringify(r)}return Vo=t,t.default=t,Vo}var wi={},ld;function Ri(){return ld||(ld=1,wi.isClean=Symbol("isClean"),wi.my=Symbol("my")),wi}var ko,ud;function _i(){if(ud)return ko;ud=1;let e=Oo(),t=od(),r=Si(),{isClean:n,my:i}=Ri();function s(u,a){let h=new u.constructor,c=[[u,h,a]];for(;c.length>0;){let[f,d,p]=c.pop();for(let m in f){if(!Object.prototype.hasOwnProperty.call(f,m)||m==="proxyCache")continue;let g=f[m],v=typeof g;if(m==="parent"&&v==="object")p&&(d[m]=p);else if(m==="source")d[m]=g;else if(Array.isArray(g)){let y=[];d[m]=y;for(let S of g){let _=new S.constructor;y.push(_),c.push([S,_,d])}}else{if(v==="object"&&g!==null){let y=new g.constructor;c.push([g,y,void 0]),g=y}d[m]=g}}}return h}function o(u,a){if(a&&typeof a.offset!="undefined")return a.offset;let h=1,c=1,f=0;for(let d=0;d<u.length;d++){if(c===a.line&&h===a.column){f=d;break}u[d]===`
|
|
67
|
+
`?(h=1,c+=1):h+=1}return f}class l{get proxyOf(){return this}constructor(a={}){this.raws={},this[n]=!1,this[i]=!0;for(let h of Object.keys(a))if(h!=="__proto__")if(h==="nodes"){this.nodes=[];for(let c of a[h])typeof c.clone=="function"&&c.parent?this.append(c.clone()):this.append(c)}else this[h]=a[h]}addToError(a){if(a.postcssNode=this,a.stack&&this.source&&/\n\s{4}at /.test(a.stack)){let h=this.source;a.stack=a.stack.replace(/\n\s{4}at /,`$&${h.input.from}:${h.start.line}:${h.start.column}$&`)}return a}after(a){return this.parent.insertAfter(this,a),this}assign(a={}){for(let h in a)this[h]=a[h];return this}before(a){return this.parent.insertBefore(this,a),this}cleanRaws(a){delete this.raws.before,delete this.raws.after,a||delete this.raws.between}clone(a={}){let h=s(this);for(let c in a)h[c]=a[c];return h}cloneAfter(a={}){let h=this.clone(a);return this.parent.insertAfter(this,h),h}cloneBefore(a={}){let h=this.clone(a);return this.parent.insertBefore(this,h),h}error(a,h={}){if(this.source){let{end:c,start:f}=this.rangeBy(h);return this.source.input.error(a,{column:f.column,line:f.line},{column:c.column,line:c.line},h)}return new e(a)}getProxyProcessor(){return{get(a,h){return h==="proxyOf"?a:h==="root"?()=>a.root().toProxy():a[h]},set(a,h,c){return a[h]===c||(a[h]=c,(h==="prop"||h==="value"||h==="name"||h==="params"||h==="important"||h==="text")&&a.markDirty()),!0}}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let a=this;for(;a=a.parent;)a[n]=!1}}next(){if(!this.parent)return;let a=this.parent.index(this);return this.parent.nodes[a+1]}positionBy(a={}){let h="document"in this.source.input?this.source.input.document:this.source.input.css,c={column:this.source.start.column,line:this.source.start.line,offset:o(h,this.source.start)};if(a.index)c=this.positionInside(a.index);else if(a.word){let d=h.slice(o(h,this.source.start),o(h,this.source.end)).indexOf(a.word);d!==-1&&(c=this.positionInside(d))}return c}positionInside(a){let h=this.source.start.column,c=this.source.start.line,f="document"in this.source.input?this.source.input.document:this.source.input.css,d=o(f,this.source.start),p=d+a;for(let m=d;m<p;m++)f[m]===`
|
|
68
|
+
`?(h=1,c+=1):h+=1;return{column:h,line:c,offset:p}}prev(){if(!this.parent)return;let a=this.parent.index(this);return this.parent.nodes[a-1]}rangeBy(a={}){let h="document"in this.source.input?this.source.input.document:this.source.input.css,c={column:this.source.start.column,line:this.source.start.line,offset:o(h,this.source.start)},f=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:o(h,this.source.end)+1}:{column:c.column+1,line:c.line,offset:c.offset+1};if(a.word){let p=h.slice(o(h,this.source.start),o(h,this.source.end)).indexOf(a.word);p!==-1&&(c=this.positionInside(p),f=this.positionInside(p+a.word.length))}else a.start?c={column:a.start.column,line:a.start.line,offset:o(h,a.start)}:typeof a.index=="number"&&(c=this.positionInside(a.index)),a.end?f={column:a.end.column,line:a.end.line,offset:o(h,a.end)}:typeof a.endIndex=="number"?f=this.positionInside(a.endIndex):typeof a.index=="number"&&(f=this.positionInside(a.index+1));return(f.line<c.line||f.line===c.line&&f.column<=c.column)&&(f={column:c.column+1,line:c.line,offset:c.offset+1}),{end:f,start:c}}raw(a,h){return new t().raw(this,a,h)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...a){if(this.parent){let h=this,c=!1;for(let f of a)f===this?c=!0:c?(this.parent.insertAfter(h,f),h=f):this.parent.insertBefore(h,f);c||this.remove()}return this}root(){let a=this;for(;a.parent&&a.parent.type!=="document";)a=a.parent;return a}toJSON(a,h){let c=h==null;h=h||new Map;let f=[],d=[[this,f,0]];for(let m=0;m<d.length;m++){let[g,v,y]=d[m],S={};v[y]=S;for(let _ in g){if(!Object.prototype.hasOwnProperty.call(g,_)||_==="parent"||_==="proxyCache")continue;let w=g[_];if(Array.isArray(w)){let b=[];S[_]=b;for(let R=0;R<w.length;R++){let E=w[R];typeof E=="object"&&E.toJSON?E.toJSON===l.prototype.toJSON?d.push([E,b,R]):b[R]=E.toJSON(null,h):b[R]=E}}else if(typeof w=="object"&&w.toJSON)w.toJSON===l.prototype.toJSON?d.push([w,S,_]):S[_]=w.toJSON(null,h);else if(_==="source"){if(w==null)continue;let b=h.get(w.input);b==null&&(b=h.size,h.set(w.input,b)),S[_]={end:w.end,inputId:b,start:w.start}}else S[_]=w}}let p=f[0];return c&&(p.inputs=[...h.keys()].map(m=>m.toJSON())),p}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(a=r){a.stringify&&(a=a.stringify);let h="";return a(this,c=>{h+=c}),h}warn(a,h,c={}){let f={node:this};for(let d in c)f[d]=c[d];return a.warn(h,f)}}return ko=l,l.default=l,ko}var Xo,cd;function Ti(){if(cd)return Xo;cd=1;let e=_i();class t extends e{constructor(n){super(n),this.type="comment"}}return Xo=t,t.default=t,Xo}var Wo,dd;function Ei(){if(dd)return Wo;dd=1;let e=_i();class t extends e{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(n){n&&typeof n.value!="undefined"&&typeof n.value!="string"&&(n=B(x({},n),{value:String(n.value)})),super(n),this.type="decl"}}return Wo=t,t.default=t,Wo}var Po,hd;function Ht(){if(hd)return Po;hd=1;let e=Ti(),t=Ei(),r=_i(),{isClean:n,my:i}=Ri(),s,o,l,u;function a(f){let d=f.slice();for(;d.length>0;){let p=d.pop();if(delete p.source,p.nodes){p.nodes=p.nodes.slice();for(let m of p.nodes)d.push(m)}}return f.slice()}function h(f){let d=[f];for(;d.length>0;){let p=d.pop();if(p[n]=!1,p.proxyOf.nodes)for(let m of p.proxyOf.nodes)d.push(m)}}class c extends 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]}append(...d){for(let p of d){let m=this.normalize(p,this.last);for(let g of m)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(d){let p=[this];for(;p.length>0;){let m=p.pop();if(m!==this&&m.cleanRaws!==c.prototype.cleanRaws){m.cleanRaws(d);continue}if(r.prototype.cleanRaws.call(m,d),m.nodes)for(let g of m.nodes)p.push(g)}}each(d){if(!this.proxyOf.nodes)return;let p=this.getIterator(),m,g;for(;this.indexes[p]<this.proxyOf.nodes.length&&(m=this.indexes[p],g=d(this.proxyOf.nodes[m],m),g!==!1);)this.indexes[p]+=1;return delete this.indexes[p],g}every(d){return this.nodes.every(d)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let d=this.lastEach;return this.indexes[d]=0,d}getProxyProcessor(){return{get(d,p){return p==="proxyOf"?d:d[p]?p==="each"||typeof p=="string"&&p.startsWith("walk")?(...m)=>d[p](...m.map(g=>typeof g=="function"?(v,y)=>g(v.toProxy(),y):g)):p==="every"||p==="some"?m=>d[p]((g,...v)=>m(g.toProxy(),...v)):p==="root"?()=>d.root().toProxy():p==="nodes"?d.nodes.map(m=>m.toProxy()):p==="first"||p==="last"?d[p].toProxy():d[p]:d[p]},set(d,p,m){return d[p]===m||(d[p]=m,(p==="name"||p==="params"||p==="selector")&&d.markDirty()),!0}}}index(d){return typeof d=="number"?d:(d.proxyOf&&(d=d.proxyOf),this.proxyOf.nodes.indexOf(d))}insertAfter(d,p){let m=this.index(d),g=this.normalize(p,this.proxyOf.nodes[m]).reverse();m=this.index(d);for(let y of g)this.proxyOf.nodes.splice(m+1,0,y);let v;for(let y in this.indexes)v=this.indexes[y],m<v&&(this.indexes[y]=v+g.length);return this.markDirty(),this}insertBefore(d,p){let m=this.index(d),g=m===0?"prepend":!1,v=this.normalize(p,this.proxyOf.nodes[m],g).reverse();m=this.index(d);for(let S of v)this.proxyOf.nodes.splice(m,0,S);let y;for(let S in this.indexes)y=this.indexes[S],m<=y&&(this.indexes[S]=y+v.length);return this.markDirty(),this}normalize(d,p){if(typeof d=="string")d=a(o(d).nodes);else if(typeof d=="undefined")d=[];else if(Array.isArray(d)){d=d.slice(0);for(let g of d)g.parent&&g.parent.removeChild(g,"ignore")}else if(d.type==="root"&&this.type!=="document"){d=d.nodes.slice(0);for(let g of d)g.parent&&g.parent.removeChild(g,"ignore")}else if(d.type)d=[d];else if(d.prop){if(typeof d.value=="undefined")throw new Error("Value field is missed in node creation");typeof d.value!="string"&&(d.value=String(d.value)),d=[new t(d)]}else if(d.selector||d.selectors)d=[new u(d)];else if(d.name)d=[new s(d)];else if(d.text)d=[new e(d)];else throw new Error("Unknown node type in node creation");return d.map(g=>(g[i]||c.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[n]&&h(g),g.raws||(g.raws={}),typeof g.raws.before=="undefined"&&p&&typeof p.raws.before!="undefined"&&(g.raws.before=p.raws.before.replace(/\S/g,"")),g.parent=this.proxyOf,g))}prepend(...d){d=d.reverse();for(let p of d){let m=this.normalize(p,this.first,"prepend").reverse();for(let g of m)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+m.length}return this.markDirty(),this}push(d){return d.parent=this,this.proxyOf.nodes.push(d),this}removeAll(){for(let d of this.proxyOf.nodes)d.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(d){d=this.index(d),this.proxyOf.nodes[d].parent=void 0,this.proxyOf.nodes.splice(d,1);let p;for(let m in this.indexes)p=this.indexes[m],p>=d&&(this.indexes[m]=p-1);return this.markDirty(),this}replaceValues(d,p,m){return m||(m=p,p={}),this.walkDecls(g=>{p.props&&!p.props.includes(g.prop)||p.fast&&!g.value.includes(p.fast)||(g.value=g.value.replace(d,m))}),this.markDirty(),this}some(d){return this.nodes.some(d)}walk(d){if(!this.proxyOf.nodes)return;let p=[{iterator:this.getIterator(),node:this.proxyOf}];for(;p.length>0;){let{iterator:m,node:g}=p[p.length-1],v=g.indexes[m];if(v>=g.proxyOf.nodes.length){delete g.indexes[m],p.pop();let _=p[p.length-1];_&&(_.node.indexes[_.iterator]+=1);continue}let y=g.proxyOf.nodes[v],S;try{S=d(y,v)}catch(_){throw y.addToError(_)}if(S===!1){for(let _ of p)delete _.node.indexes[_.iterator];return!1}y.walk&&y.proxyOf.nodes?p.push({iterator:y.getIterator(),node:y}):g.indexes[m]+=1}}walkAtRules(d,p){return p?d instanceof RegExp?this.walk((m,g)=>{if(m.type==="atrule"&&d.test(m.name))return p(m,g)}):this.walk((m,g)=>{if(m.type==="atrule"&&m.name===d)return p(m,g)}):(p=d,this.walk((m,g)=>{if(m.type==="atrule")return p(m,g)}))}walkComments(d){return this.walk((p,m)=>{if(p.type==="comment")return d(p,m)})}walkDecls(d,p){return p?d instanceof RegExp?this.walk((m,g)=>{if(m.type==="decl"&&d.test(m.prop))return p(m,g)}):this.walk((m,g)=>{if(m.type==="decl"&&m.prop===d)return p(m,g)}):(p=d,this.walk((m,g)=>{if(m.type==="decl")return p(m,g)}))}walkRules(d,p){return p?d instanceof RegExp?this.walk((m,g)=>{if(m.type==="rule"&&d.test(m.selector))return p(m,g)}):this.walk((m,g)=>{if(m.type==="rule"&&m.selector===d)return p(m,g)}):(p=d,this.walk((m,g)=>{if(m.type==="rule")return p(m,g)}))}}return c.registerParse=f=>{o=f},c.registerRule=f=>{u=f},c.registerAtRule=f=>{s=f},c.registerRoot=f=>{l=f},Po=c,c.default=c,c.rebuild=f=>{let d=[f];for(;d.length>0;){let p=d.pop();if(p.type==="atrule"?Object.setPrototypeOf(p,s.prototype):p.type==="rule"?Object.setPrototypeOf(p,u.prototype):p.type==="decl"?Object.setPrototypeOf(p,t.prototype):p.type==="comment"?Object.setPrototypeOf(p,e.prototype):p.type==="root"&&Object.setPrototypeOf(p,l.prototype),p[i]=!0,p.nodes)for(let m of p.nodes)d.push(m)}},Po}var Mo,fd;function Ao(){if(fd)return Mo;fd=1;let e=Ht();class t extends e{constructor(n){super(n),this.type="atrule"}append(...n){return this.proxyOf.nodes||(this.nodes=[]),super.append(...n)}prepend(...n){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...n)}}return Mo=t,t.default=t,e.registerAtRule(t),Mo}var Uo,pd;function Do(){if(pd)return Uo;pd=1;let e=Ht(),t,r;class n extends e{constructor(s){super(x({type:"document"},s)),this.nodes||(this.nodes=[])}toResult(s={}){return new t(new r,this,s).stringify()}}return n.registerLazyResult=i=>{t=i},n.registerProcessor=i=>{r=i},Uo=n,n.default=n,Uo}var Fo,md;function Bv(){if(md)return Fo;md=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return Fo={nanoid:(n=21)=>{let i="",s=n|0;for(;s-- >0;)i+=e[Math.random()*64|0];return i},customAlphabet:(n,i=21)=>(s=i)=>{let o="",l=s|0;for(;l-- >0;)o+=n[Math.random()*n.length|0];return o}},Fo}var Jo,gd;function yd(){if(gd)return Jo;gd=1;let{existsSync:e,readFileSync:t,realpathSync:r}=vt,{dirname:n,isAbsolute:i,join:s,relative:o,sep:l}=vt,{SourceMapConsumer:u,SourceMapGenerator:a}=vt;function h(d){try{return r(d)}catch(p){return d}}function c(d){return Buffer?Buffer.from(d,"base64").toString():window.atob(d)}class f{constructor(p,m){if(m.map===!1)return;m.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(p),this.inline=this.startWith(this.annotation,"data:");let g=m.map?m.map.prev:void 0,v=this.loadMap(m.from,g);!this.mapFile&&m.from&&(this.mapFile=m.from),this.mapFile&&(this.root=n(this.mapFile)),v&&(this.text=v)}consumer(){return this.consumerCache||(this.consumerCache=new u(this.json||this.text)),this.consumerCache}decodeInline(p){let m=/^data:application\/json;charset=utf-?8;base64,/,g=/^data:application\/json;base64,/,v=/^data:application\/json;charset=utf-?8,/,y=/^data:application\/json,/,S=p.match(v)||p.match(y);if(S)return decodeURIComponent(p.substr(S[0].length));let _=p.match(m)||p.match(g);if(_)return c(p.substr(_[0].length));let w=p.slice(22);throw w=w.slice(0,w.indexOf(",")),new Error("Unsupported source map encoding "+w)}getAnnotationURL(p){return p.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(p){return typeof p!="object"?!1:typeof p.mappings=="string"||typeof p._mappings=="string"||Array.isArray(p.sections)}loadAnnotation(p){let m=p.match(/\/\*\s*# sourceMappingURL=/g);if(!m)return;let g=p.lastIndexOf(m.pop()),v=p.indexOf("*/",g);g>-1&&v>-1&&(this.annotation=this.getAnnotationURL(p.substring(g,v)))}loadFile(p,m,g){if(!g&&!this.unsafeMap){if(!/\.map$/i.test(p)||!m)return;let v=o(h(n(m)),h(p));if(v===".."||v.startsWith(".."+l)||i(v))return}if(this.root=n(p),e(p))return this.mapFile=p,t(p,"utf-8").toString().trim()}loadMap(p,m){if(m===!1)return!1;if(m){if(typeof m=="string")return m;if(typeof m=="function"){let g=m(p);if(g){let v=this.loadFile(g,p,!0);if(!v)throw new Error("Unable to load previous source map: "+g.toString());return v}}else{if(m instanceof u)return a.fromSourceMap(m).toString();if(m instanceof a)return m.toString();if(this.isMap(m))return JSON.stringify(m);throw new Error("Unsupported previous source map format: "+m.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let g=this.annotation;p&&(g=s(n(p),g));let v=this.loadFile(g,p,!1);if(v)try{this.json=JSON.parse(v.replace(/^\)]}'[^\n]*\n/,""))}catch(y){return}return v}}}startWith(p,m){return p?p.substr(0,m.length)===m:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Jo=f,f.default=f,Jo}var Ho,bd;function Ii(){if(bd)return Ho;bd=1;let{nanoid:e}=Bv(),{isAbsolute:t,resolve:r}=vt,{SourceMapConsumer:n,SourceMapGenerator:i}=vt,{fileURLToPath:s,pathToFileURL:o}=vt,l=Oo(),u=yd(),a=vt,h=Symbol("lineToIndexCache"),c=!!(n&&i),f=!!(r&&t);function d(m){if(m[h])return m[h];let g=m.css.split(`
|
|
69
|
+
`),v=new Array(g.length),y=0;for(let S=0,_=g.length;S<_;S++)v[S]=y,y+=g[S].length+1;return m[h]=v,v}class p{get from(){return this.file||this.id}constructor(g,v={}){if(g===null||typeof g=="undefined"||typeof g=="object"&&!g.toString)throw new Error(`PostCSS received ${g} instead of CSS string`);if(this.css=g.toString(),this.css[0]==="\uFEFF"||this.css[0]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,v.document&&(this.document=v.document.toString()),v.from&&(!f||/^\w+:\/\//.test(v.from)||t(v.from)?this.file=v.from:this.file=r(v.from)),f&&c){let y=new u(this.css,v);if(y.text){this.map=y;let S=y.consumer().file;!this.file&&S&&(this.file=this.mapResolve(S))}}this.file||(this.id="<input css "+e(6)+">"),this.map&&(this.map.file=this.from)}error(g,v,y,S={}){let _,w,b,R,E;if(v&&typeof v=="object"){let C=v,N=y;if(typeof C.offset=="number"){R=C.offset;let G=this.fromOffset(R);v=G.line,y=G.col}else v=C.line,y=C.column,R=this.fromLineAndColumn(v,y);if(typeof N.offset=="number"){b=N.offset;let G=this.fromOffset(b);w=G.line,_=G.col}else w=N.line,_=N.column,b=this.fromLineAndColumn(N.line,N.column)}else if(y)R=this.fromLineAndColumn(v,y);else{R=v;let C=this.fromOffset(R);v=C.line,y=C.col}let I=this.origin(v,y,w,_);return I?E=new l(g,I.endLine===void 0?I.line:{column:I.column,line:I.line},I.endLine===void 0?I.column:{column:I.endColumn,line:I.endLine},I.source,I.file,S.plugin):E=new l(g,w===void 0?v:{column:y,line:v},w===void 0?y:{column:_,line:w},this.css,this.file,S.plugin),E.input={column:y,endColumn:_,endLine:w,endOffset:b,line:v,offset:R,source:this.css},this.file&&(o&&(E.input.url=o(this.file).toString()),E.input.file=this.file),E}fromLineAndColumn(g,v){return d(this)[g-1]+v-1}fromOffset(g){let v=d(this),y=v[v.length-1],S=0;if(g>=y)S=v.length-1;else{let _=v.length-2,w;for(;S<_;)if(w=S+(_-S>>1),g<v[w])_=w-1;else if(g>=v[w+1])S=w+1;else{S=w;break}}return{col:g-v[S]+1,line:S+1}}mapResolve(g){return/^\w+:\/\//.test(g)?g:r(this.map.consumer().sourceRoot||this.map.root||".",g)}origin(g,v,y,S){if(!this.map)return!1;let _=this.map.consumer(),w=_.originalPositionFor({column:v-1,line:g});if(!w.source)return!1;let b;if(typeof y=="number"){let C=_.originalPositionFor({column:S-1,line:y});C.source&&(b=C)}let R;t(w.source)?R=o(w.source):R=new URL(w.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let E={column:w.column+1,endColumn:b&&b.column+1,endLine:b&&b.line,line:w.line,url:R.toString()};if(R.protocol==="file:")if(s)E.file=s(R);else throw new Error("file: protocol is not available in this PostCSS build");let I=_.sourceContentFor(w.source);return I&&(E.source=I),E}toJSON(){let g={};for(let v of["hasBOM","css","file","id"])this[v]!=null&&(g[v]=this[v]);return this.map&&(g.map=x({},this.map),g.map.consumerCache&&(g.map.consumerCache=void 0)),g}}return Ho=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Ho}var Yo,vd;function pn(){if(vd)return Yo;vd=1;let e=Ht(),t,r;class n extends e{constructor(s){super(s),this.type="root",this.nodes||(this.nodes=[])}normalize(s,o,l){let u=new Set;for(let h of Array.isArray(s)?s:[s])h&&typeof h=="object"&&!h.parent&&h.raws&&typeof h.raws.before!="undefined"&&u.add(h.raws);let a=super.normalize(s);if(o){if(l==="prepend")this.nodes.length>1?o.raws.before=this.nodes[1].raws.before:delete o.raws.before;else if(this.first!==o)for(let h of a)u.has(h.raws)||(h.raws.before=o.raws.before)}return a}removeChild(s,o){let l=this.index(s);return!o&&l===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[l].raws.before),super.removeChild(s)}toResult(s={}){return new t(new r,this,s).stringify()}}return n.registerLazyResult=i=>{t=i},n.registerProcessor=i=>{r=i},Yo=n,n.default=n,e.registerRoot(n),Yo}var Bo,Sd;function wd(){if(Sd)return Bo;Sd=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`
|
|
70
|
+
`," "];return e.split(t,r)},split(t,r,n){if(typeof t!="string")return[];let i=[],s="",o=!1,l=0,u=!1,a="",h=!1;for(let c of t)h?h=!1:c==="\\"?h=!0:u?c===a&&(u=!1):c==='"'||c==="'"?(u=!0,a=c):c==="("?l+=1:c===")"?l>0&&(l-=1):l===0&&r.includes(c)&&(o=!0),o?(s!==""&&i.push(s.trim()),s="",o=!1):s+=c;return(n||s!=="")&&i.push(s.trim()),i}};return Bo=e,e.default=e,Bo}var zo,Rd;function Ko(){if(Rd)return zo;Rd=1;let e=Ht(),t=wd();class r extends e{get selectors(){return t.comma(this.selector)}set selectors(i){let s=this.selector?this.selector.match(/,\s*/):null,o=s?s[0]:","+this.raw("between","beforeOpen");this.selector=i.join(o)}constructor(i){super(i),this.type="rule",this.nodes||(this.nodes=[])}}return zo=r,r.default=r,e.registerRule(r),zo}var jo,_d;function zv(){if(_d)return jo;_d=1;let e=Ao(),t=Ti(),r=Ei(),n=Ii(),i=yd(),s=pn(),o=Ko();function l(h,c){return h.inputs?h.inputs.map(f=>{let d=B(x({},f),{__proto__:n.prototype});return d.map&&(d.map=B(x({},d.map),{__proto__:i.prototype})),d}):c}function u(h,c,f){let d=x({},h);if(delete d.inputs,delete d.nodes,d.source){let m=d.source,{inputId:g}=m,v=et(m,["inputId"]);d.source=v,g!=null&&(d.source.input=c[g])}let p;if(d.type==="root")p=new s(d);else if(d.type==="decl")p=new r(d);else if(d.type==="rule")p=new o(d);else if(d.type==="comment")p=new t(d);else if(d.type==="atrule")p=new e(d);else throw new Error("Unknown node type: "+h.type);if(f){p.nodes=f;for(let g of f)g.parent=p}return p}function a(h,c){if(Array.isArray(h))return h.map(p=>a(p));let f,d=[{childIndex:0,children:[],inputs:l(h,c),json:h}];for(;d.length>0;){let p=d[d.length-1],m=p.json.nodes;if(m&&p.childIndex<m.length){let v=m[p.childIndex];p.childIndex+=1,d.push({childIndex:0,children:[],inputs:l(v,p.inputs),json:v});continue}d.pop();let g=u(p.json,p.inputs,m?p.children:void 0);d.length>0?d[d.length-1].children.push(g):f=g}return f}return jo=a,a.default=a,jo}var Qo,Td;function Ed(){if(Td)return Qo;Td=1;let{dirname:e,relative:t,resolve:r,sep:n}=vt,{SourceMapConsumer:i,SourceMapGenerator:s}=vt,{pathToFileURL:o}=vt,l=Ii(),u=!!(i&&s),a=!!(e&&r&&t&&n);class h{constructor(f,d,p,m){this.stringify=f,this.mapOpts=p.map||{},this.root=d,this.opts=p,this.css=m,this.originalCSS=m,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let f;this.isInline()?f="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?f=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?f=this.mapOpts.annotation(this.opts.to,this.root):f=this.outputFile()+".map";let d=`
|
|
71
|
+
`;this.css.includes(`\r
|
|
72
|
+
`)&&(d=`\r
|
|
73
|
+
`),this.css+=d+"/*# sourceMappingURL="+f+" */"}applyPrevMaps(){for(let f of this.previous()){let d=this.toUrl(this.path(f.file)),p=f.root||e(f.file),m;this.mapOpts.sourcesContent===!1?(m=new i(f.text),m.sourcesContent&&(m.sourcesContent=null)):m=f.consumer(),this.map.applySourceMap(m,d,this.toUrl(this.path(p)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let f;for(let d=this.root.nodes.length-1;d>=0;d--)f=this.root.nodes[d],f.type==="comment"&&f.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(d)}else if(this.css){let f;for(;(f=this.css.lastIndexOf("/*#"))!==-1;){let d=this.css.indexOf("*/",f+3);if(d===-1)break;for(;f>0&&this.css[f-1]===`
|
|
74
|
+
`;)f--;this.css=this.css.slice(0,f)+this.css.slice(d+2)}}}}generate(){if(this.clearAnnotation(),a&&u&&this.isMap())return this.generateMap();{let f="";return this.stringify(this.root,d=>{f+=d}),[f]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let f=this.previous()[0].consumer();f.file=this.outputFile(),this.map=s.fromSourceMap(f,{ignoreInvalidMapping:!0})}else this.map=new s({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 s({file:this.outputFile(),ignoreInvalidMapping:!0});let f=1,d=1,p="<no source>",m={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,v;this.stringify(this.root,(y,S,_)=>{if(this.css+=y,S&&_!=="end"&&(m.generated.line=f,m.generated.column=d-1,S.source&&S.source.start?(m.source=this.sourcePath(S),m.original.line=S.source.start.line,m.original.column=S.source.start.column-1,this.map.addMapping(m)):(m.source=p,m.original.line=1,m.original.column=0,this.map.addMapping(m))),v=y.match(/\n/g),v?(f+=v.length,g=y.lastIndexOf(`
|
|
75
|
+
`),d=y.length-g):d+=y.length,S&&_!=="start"){let w=S.parent||{raws:{}};(!(S.type==="decl"||S.type==="atrule"&&!S.nodes)||S!==w.last||w.raws.semicolon)&&(S.source&&S.source.end?(m.source=this.sourcePath(S),m.original.line=S.source.end.line,m.original.column=S.source.end.column-1,m.generated.line=f,m.generated.column=d-2,this.map.addMapping(m)):(m.source=p,m.original.line=1,m.original.column=0,m.generated.line=f,m.generated.column=d-1,this.map.addMapping(m)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(f=>f.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let f=this.mapOpts.annotation;return typeof f!="undefined"&&f!==!0?!1:this.previous().length?this.previous().some(d=>d.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(f=>f.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(f){if(this.mapOpts.absolute||f.charCodeAt(0)===60||/^\w+:\/\//.test(f))return f;let d=this.memoizedPaths.get(f);if(d)return d;let p=this.opts.to?e(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(p=e(r(p,this.mapOpts.annotation)));let m=t(p,f);return this.memoizedPaths.set(f,m),m}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(f=>{if(f.source&&f.source.input.map){let d=f.source.input.map;this.previousMaps.includes(d)||this.previousMaps.push(d)}});else{let f=new l(this.originalCSS,this.opts);f.map&&this.previousMaps.push(f.map)}return this.previousMaps}setSourcesContent(){let f={};if(this.root)this.root.walk(d=>{if(d.source){let p=d.source.input.from;if(p&&!f[p]){f[p]=!0;let m=this.usesFileUrls?this.toFileUrl(p):this.toUrl(this.path(p));this.map.setSourceContent(m,d.source.input.css)}}});else if(this.css){let d=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(d,this.css)}}sourcePath(f){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(f.source.input.from):this.toUrl(this.path(f.source.input.from))}toBase64(f){return Buffer?Buffer.from(f).toString("base64"):window.btoa(unescape(encodeURIComponent(f)))}toFileUrl(f){let d=this.memoizedFileURLs.get(f);if(d)return d;if(o){let p=o(f).toString();return this.memoizedFileURLs.set(f,p),p}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(f){let d=this.memoizedURLs.get(f);if(d)return d;n==="\\"&&(f=f.replace(/\\/g,"/"));let p=encodeURI(f).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(f,p),p}}return Qo=h,Qo}var $o,Id;function Kv(){if(Id)return $o;Id=1;const e=39,t=34,r=92,n=47,i=10,s=32,o=12,l=9,u=13,a=91,h=93,c=40,f=41,d=123,p=125,m=59,g=42,v=58,y=64,S=/[\t\n\f\r "#'()/;[\\\]{}]/g,_=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,w=/.[\r\n"'(/\\]/,b=/[\da-f]/i;return $o=function(E,I={}){let C=E.css.valueOf(),N=I.ignoreErrors,G,Q,Z,T,W,k,M,D,U,q,fe=C.length,O=0,pe=[],P=[],F=-1;function Y(){return O}function j(K){throw E.error("Unclosed "+K,O)}function ne(){return P.length===0&&O>=fe}function ae(K){if(P.length)return P.pop();if(O>=fe)return;let le=K?K.ignoreUnclosed:!1;switch(G=C.charCodeAt(O),G){case i:case s:case l:case u:case o:{T=O;do T+=1,G=C.charCodeAt(T);while(G===s||G===i||G===l||G===u||G===o);k=["space",C.slice(O,T)],O=T-1;break}case a:case h:case d:case p:case v:case m:case f:{let Te=String.fromCharCode(G);k=[Te,Te,O];break}case c:{if(q=pe.length?pe.pop()[1]:"",U=C.charCodeAt(O+1),q==="url"&&U!==e&&U!==t&&U!==s&&U!==i&&U!==l&&U!==o&&U!==u){T=O;do{if(M=!1,T=C.indexOf(")",T+1),T===-1)if(N||le){T=O;break}else j("bracket");for(D=T;C.charCodeAt(D-1)===r;)D-=1,M=!M}while(M);k=["brackets",C.slice(O,T+1),O,T],O=T}else O<=F?k=["(","(",O]:(T=C.indexOf(")",O+1),Q=C.slice(O,T+1),T===-1||w.test(Q)?(F=T===-1?fe:T,k=["(","(",O]):(k=["brackets",Q,O,T],O=T));break}case e:case t:{W=G===e?"'":'"',T=O;do{if(M=!1,T=C.indexOf(W,T+1),T===-1)if(N||le){T=O+1;break}else j("string");for(D=T;C.charCodeAt(D-1)===r;)D-=1,M=!M}while(M);k=["string",C.slice(O,T+1),O,T],O=T;break}case y:{S.lastIndex=O+1,S.test(C),S.lastIndex===0?T=C.length-1:T=S.lastIndex-2,k=["at-word",C.slice(O,T+1),O,T],O=T;break}case r:{for(T=O,Z=!0;C.charCodeAt(T+1)===r;)T+=1,Z=!Z;if(G=C.charCodeAt(T+1),Z&&G!==n&&G!==s&&G!==i&&G!==l&&G!==u&&G!==o&&(T+=1,b.test(C.charAt(T)))){for(;b.test(C.charAt(T+1));)T+=1;C.charCodeAt(T+1)===s&&(T+=1)}k=["word",C.slice(O,T+1),O,T],O=T;break}default:{G===n&&C.charCodeAt(O+1)===g?(T=C.indexOf("*/",O+2)+1,T===0&&(N||le?T=C.length:j("comment")),k=["comment",C.slice(O,T+1),O,T],O=T):(_.lastIndex=O+1,_.test(C),_.lastIndex===0?T=C.length-1:T=_.lastIndex-2,k=["word",C.slice(O,T+1),O,T],pe.push(k),O=T);break}}return O++,k}function ge(K){P.push(K)}return{back:ge,endOfFile:ne,nextToken:ae,position:Y}},$o}var qo,Cd;function jv(){if(Cd)return qo;Cd=1;let e=Ao(),t=Ti(),r=Ei(),n=pn(),i=Ko(),s=Kv();const o={empty:!0,space:!0};function l(h){for(let c=h.length-1;c>=0;c--){let f=h[c],d=f[3]||f[2];if(d)return d}}function u(h,c,f){let d="";for(let p=c;p<f;p++)d+=h[p][1];return d}class a{constructor(c){this.input=c,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:c,start:{column:1,line:1,offset:0}}}atrule(c){let f=new e;f.name=c[1].slice(1),f.name===""&&this.unnamedAtrule(f,c),this.init(f,c[2]);let d,p,m,g=!1,v=!1,y=[],S=[];for(;!this.tokenizer.endOfFile();){if(c=this.tokenizer.nextToken(),d=c[0],d==="("||d==="["?S.push(d==="("?")":"]"):d==="{"&&S.length>0?S.push("}"):d===S[S.length-1]&&S.pop(),S.length===0)if(d===";"){f.source.end=this.getPosition(c[2]),f.source.end.offset++,this.semicolon=!0;break}else if(d==="{"){v=!0;break}else if(d==="}"){if(y.length>0){for(m=y.length-1,p=y[m];p&&p[0]==="space";)p=y[--m];p&&(f.source.end=this.getPosition(p[3]||p[2]),f.source.end.offset++)}this.end(c);break}else y.push(c);else y.push(c);if(this.tokenizer.endOfFile()){g=!0;break}}f.raws.between=this.spacesAndCommentsFromEnd(y),y.length?(f.raws.afterName=this.spacesAndCommentsFromStart(y),this.raw(f,"params",y),g&&(c=y[y.length-1],f.source.end=this.getPosition(c[3]||c[2]),f.source.end.offset++,this.spaces=f.raws.between,f.raws.between="")):(f.raws.afterName="",f.params=""),v&&(f.nodes=[],this.current=f)}checkMissedSemicolon(c){let f=this.colon(c);if(f===!1)return;let d=0,p;for(let m=f-1;m>=0&&(p=c[m],!(p[0]!=="space"&&(d+=1,d===2)));m--);throw this.input.error("Missed semicolon",p[0]==="word"?p[3]+1:p[2])}colon(c){let f=0,d,p,m;for(let[g,v]of c.entries()){if(p=v,m=p[0],m==="("&&(f+=1),m===")"&&(f-=1),f===0&&m===":")if(!d)this.doubleColon(p);else{if(d[0]==="word"&&d[1]==="progid")continue;return g}d=p}return!1}comment(c){let f=new t;this.init(f,c[2]),f.source.end=this.getPosition(c[3]||c[2]),f.source.end.offset++;let d=c[1].slice(2,-2);if(!d.trim())f.text="",f.raws.left=d,f.raws.right="";else{let p=d.match(/^(\s*)([^]*\S)(\s*)$/);f.text=p[2],f.raws.left=p[1],f.raws.right=p[3]}}createTokenizer(){this.tokenizer=s(this.input)}decl(c,f){let d=new r;this.init(d,c[0][2]);let p=c[c.length-1];p[0]===";"&&(this.semicolon=!0,c.pop()),d.source.end=this.getPosition(p[3]||p[2]||l(c)),d.source.end.offset++;let m=0;for(;c[m][0]!=="word";)m===c.length-1&&this.unknownWord([c[m]]),m++;d.raws.before+=u(c,0,m),d.source.start=this.getPosition(c[m][2]);let g=m;for(;m<c.length;){let b=c[m][0];if(b===":"||b==="space"||b==="comment")break;m++}d.prop=u(c,g,m);let v=m,y;for(;m<c.length&&(y=c[m],m++,y[0]!==":");)y[0]==="word"&&/\w/.test(y[1])&&this.unknownWord([y]);d.raws.between=u(c,v,m),(d.prop[0]==="_"||d.prop[0]==="*")&&(d.raws.before+=d.prop[0],d.prop=d.prop.slice(1));let S=m;for(;m<c.length;){let b=c[m][0];if(b!=="space"&&b!=="comment")break;m++}let _=c.slice(S,m);c=c.slice(m),this.precheckMissedSemicolon(c);for(let b=c.length-1;b>=0;b--){if(y=c[b],y[1].toLowerCase()==="!important"){d.important=!0;let R=this.stringFrom(c,b);R=this.spacesFromEnd(c)+R,R!==" !important"&&(d.raws.important=R);break}else if(y[1].toLowerCase()==="important"){let R=c.slice(0),E="";for(let I=b;I>0;I--){let C=R[I][0];if(E.trim().startsWith("!")&&C!=="space")break;E=R.pop()[1]+E}E.trim().startsWith("!")&&(d.important=!0,d.raws.important=E,c=R)}if(y[0]!=="space"&&y[0]!=="comment")break}c.some(b=>b[0]!=="space"&&b[0]!=="comment")&&(d.raws.between+=_.map(b=>b[1]).join(""),_=[]),this.raw(d,"value",_.concat(c),f),d.value.includes(":")&&!f&&this.checkMissedSemicolon(c)}doubleColon(c){throw this.input.error("Double colon",{offset:c[2]},{offset:c[2]+c[1].length})}emptyRule(c){let f=new i;this.init(f,c[2]),f.selector="",f.raws.between="",this.current=f}end(c){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(c[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(c)}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(c){if(this.spaces+=c[1],this.current.nodes){let f=this.current.nodes[this.current.nodes.length-1];f&&f.type==="rule"&&!f.raws.ownSemicolon&&(f.raws.ownSemicolon=this.spaces,this.spaces="",f.source.end=this.getPosition(c[2]),f.source.end.offset+=f.raws.ownSemicolon.length)}}getPosition(c){let f=this.input.fromOffset(c);return{column:f.col,line:f.line,offset:c}}init(c,f){this.current.push(c),c.source={input:this.input,start:this.getPosition(f)},c.raws.before=this.spaces,this.spaces="",c.type!=="comment"&&(this.semicolon=!1)}other(c){let f=!1,d=null,p=!1,m=null,g=[],v=c[1].startsWith("--"),y=[],S=c;for(;S;){if(d=S[0],y.push(S),d==="("||d==="[")m||(m=S),g.push(d==="("?")":"]");else if(v&&p&&d==="{")m||(m=S),g.push("}");else if(g.length===0)if(d===";")if(p){this.decl(y,v);return}else break;else if(d==="{"){this.rule(y);return}else if(d==="}"){this.tokenizer.back(y.pop()),f=!0;break}else d===":"&&(p=!0);else d===g[g.length-1]&&(g.pop(),g.length===0&&(m=null));S=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(f=!0),g.length>0&&this.unclosedBracket(m),f&&p){if(!v)for(;y.length&&(S=y[y.length-1][0],!(S!=="space"&&S!=="comment"));)this.tokenizer.back(y.pop());this.decl(y,v)}else this.unknownWord(y)}parse(){let c;for(;!this.tokenizer.endOfFile();)switch(c=this.tokenizer.nextToken(),c[0]){case"space":this.spaces+=c[1];break;case";":this.freeSemicolon(c);break;case"}":this.end(c);break;case"comment":this.comment(c);break;case"at-word":this.atrule(c);break;case"{":this.emptyRule(c);break;default:this.other(c);break}this.endFile()}precheckMissedSemicolon(){}raw(c,f,d,p){let m,g,v=d.length,y="",S=!0,_,w;for(let b=0;b<v;b+=1)m=d[b],g=m[0],g==="space"&&b===v-1&&!p?S=!1:g==="comment"?(w=d[b-1]?d[b-1][0]:"empty",_=d[b+1]?d[b+1][0]:"empty",!o[w]&&!o[_]?y.slice(-1)===","?S=!1:y+=m[1]:S=!1):y+=m[1];if(!S){let b=d.reduce((R,E)=>R+E[1],"");c.raws[f]={raw:b,value:y}}c[f]=y}rule(c){c.pop();let f=new i;this.init(f,c[0][2]),f.raws.between=this.spacesAndCommentsFromEnd(c),this.raw(f,"selector",c),this.current=f}spacesAndCommentsFromEnd(c){let f,d="";for(;c.length&&(f=c[c.length-1][0],!(f!=="space"&&f!=="comment"));)d=c.pop()[1]+d;return d}spacesAndCommentsFromStart(c){let f,d="";for(;c.length&&(f=c[0][0],!(f!=="space"&&f!=="comment"));)d+=c.shift()[1];return d}spacesFromEnd(c){let f,d="";for(;c.length&&(f=c[c.length-1][0],f==="space");)d=c.pop()[1]+d;return d}stringFrom(c,f){let d="";for(let p=f;p<c.length;p++)d+=c[p][1];return c.splice(f,c.length-f),d}unclosedBlock(){let c=this.current.source.start;throw this.input.error("Unclosed block",c.line,c.column)}unclosedBracket(c){throw this.input.error("Unclosed bracket",{offset:c[2]},{offset:c[2]+1})}unexpectedClose(c){throw this.input.error("Unexpected }",{offset:c[2]},{offset:c[2]+1})}unknownWord(c){throw this.input.error("Unknown word "+c[0][1],{offset:c[0][2]},{offset:c[0][2]+c[0][1].length})}unnamedAtrule(c,f){throw this.input.error("At-rule without name",{offset:f[2]},{offset:f[2]+f[1].length})}}return qo=a,qo}var ea,Zd;function ta(){if(Zd)return ea;Zd=1;let e=Ht(),t=Ii(),r=jv();function n(i,s){let o=new t(i,s),l=new r(o);try{l.parse()}catch(u){throw process.env.NODE_ENV!=="production"&&u.name==="CssSyntaxError"&&s&&s.from&&(/\.scss$/i.test(s.from)?u.message+=`
|
|
76
|
+
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(s.from)?u.message+=`
|
|
77
|
+
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(s.from)&&(u.message+=`
|
|
78
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),u}return l.root}return ea=n,n.default=n,e.registerParse(n),ea}var ra,Ld;function xd(){if(Ld)return ra;Ld=1;let e=Ht(),{my:t}=Ri();class r{constructor(i,s={}){if(this.type="warning",this.text=i,s.node&&s.node.source){s.node[t]||e.rebuild(s.node);let o=s.node.rangeBy(s);this.line=o.start.line,this.column=o.start.column,this.endLine=o.end.line,this.endColumn=o.end.column}for(let o in s)this[o]=s[o]}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}}return ra=r,r.default=r,ra}var na,Nd;function ia(){if(Nd)return na;Nd=1;let e=xd();class t{get content(){return this.css}constructor(n,i,s){this.processor=n,this.messages=[],this.root=i,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(n,i={}){i.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(i.plugin=this.lastPlugin.postcssPlugin);let s=new e(n,i);return this.messages.push(s),s}warnings(){return this.messages.filter(n=>n.type==="warning")}}return na=t,t.default=t,na}var sa,Od;function Gd(){if(Od)return sa;Od=1;let e={};return sa=function(r){e[r]||(e[r]=!0,typeof console!="undefined"&&console.warn&&console.warn(r))},sa}var oa,Vd;function kd(){if(Vd)return oa;Vd=1;let e=Ht(),t=Do(),r=Ed(),n=ta(),i=ia(),s=pn(),o=Si(),{isClean:l,my:u}=Ri(),a=Gd();const h={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},c={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},f={Once:!0,postcssPlugin:!0,prepare:!0},d=0;function p(_){return typeof _=="object"&&typeof _.then=="function"}function m(_){let w=!1,b=h[_.type];return _.type==="decl"?w=_.prop.toLowerCase():_.type==="atrule"&&(w=_.name.toLowerCase()),w&&_.append?[b,b+"-"+w,d,b+"Exit",b+"Exit-"+w]:w?[b,b+"-"+w,b+"Exit",b+"Exit-"+w]:_.append?[b,d,b+"Exit"]:[b,b+"Exit"]}function g(_){let w;return _.type==="document"?w=["Document",d,"DocumentExit"]:_.type==="root"?w=["Root",d,"RootExit"]:w=m(_),{eventIndex:0,events:w,iterator:0,node:_,visitorIndex:0,visitors:[]}}function v(_){let w=[_];for(;w.length>0;){let b=w.pop();if(b[l]=!1,b.nodes)for(let R of b.nodes)w.push(R)}return _}let y={};class S{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"}constructor(w,b,R){this.stringified=!1,this.processed=!1;let E;if(typeof b=="object"&&b!==null&&(b.type==="root"||b.type==="document"))E=v(b);else if(b instanceof S||b instanceof i)E=v(b.root),b.map&&(typeof R.map=="undefined"&&(R.map={}),R.map.inline||(R.map.inline=!1),R.map.prev=b.map);else{let I=n;R.syntax&&(I=R.syntax.parse),R.parser&&(I=R.parser),I.parse&&(I=I.parse);try{E=I(b,R)}catch(C){this.processed=!0,this.error=C}E&&!E[u]&&e.rebuild(E)}this.result=new i(w,E,R),this.helpers=B(x({},y),{postcss:y,result:this.result}),this.plugins=this.processor.plugins.map(I=>typeof I=="object"&&I.prepare?x(x({},I),I.prepare(this.result)):I)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(w){return this.async().catch(w)}finally(w){return this.async().then(w,w)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(w,b){let R=this.result.lastPlugin;try{if(b&&b.addToError(w),this.error=w,w.name==="CssSyntaxError"&&!w.plugin)w.plugin=R.postcssPlugin,w.setMessage();else if(R.postcssVersion&&process.env.NODE_ENV!=="production"){let E=R.postcssPlugin,I=R.postcssVersion,C=this.result.processor.version,N=I.split("."),G=C.split(".");(N[0]!==G[0]||parseInt(N[1])>parseInt(G[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+C+", but "+E+" uses "+I+". Perhaps this is the source of the error below.")}}catch(E){console&&console.error&&console.error(E)}return w}prepareVisitors(){this.listeners={};let w=(b,R,E)=>{this.listeners[R]||(this.listeners[R]=[]),this.listeners[R].push([b,E])};for(let b of this.plugins)if(typeof b=="object")for(let R in b){if(!c[R]&&/^[A-Z]/.test(R))throw new Error(`Unknown event ${R} in ${b.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!f[R])if(typeof b[R]=="object")for(let E in b[R])E==="*"?w(b,R,b[R][E]):w(b,R+"-"+E.toLowerCase(),b[R][E]);else typeof b[R]=="function"&&w(b,R,b[R])}this.hasListener=Object.keys(this.listeners).length>0}runAsync(){return $(this,null,function*(){this.plugin=0;for(let w=0;w<this.plugins.length;w++){let b=this.plugins[w],R=this.runOnRoot(b);if(p(R))try{yield R}catch(E){throw this.handleError(E)}}if(this.prepareVisitors(),this.hasListener){let w=this.result.root;for(;!w[l];){w[l]=!0;let b=[g(w)];for(;b.length>0;){let R=this.visitTick(b);if(p(R))try{yield R}catch(E){let I=b[b.length-1].node;throw this.handleError(E,I)}}}if(this.listeners.OnceExit)for(let[b,R]of this.listeners.OnceExit){this.result.lastPlugin=b;try{if(w.type==="document"){let E=w.nodes.map(I=>R(I,this.helpers));yield Promise.all(E)}else yield R(w,this.helpers)}catch(E){throw this.handleError(E)}}}return this.processed=!0,this.stringify()})}runOnRoot(w){this.result.lastPlugin=w;try{if(typeof w=="object"&&w.Once){if(this.result.root.type==="document"){let b=this.result.root.nodes.map(R=>w.Once(R,this.helpers));return p(b[0])?Promise.all(b):b}return w.Once(this.result.root,this.helpers)}else if(typeof w=="function")return w(this.result.root,this.result)}catch(b){throw this.handleError(b)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let w=this.result.opts,b=o;w.syntax&&(b=w.syntax.stringify),w.stringifier&&(b=w.stringifier),b.stringify&&(b=b.stringify);let R=this.result.root.source;if(w.map===void 0&&!(R&&R.input&&R.input.map)){let C="";return b(this.result.root,N=>{C+=N}),this.result.css=C,this.result}let I=new r(b,this.result.root,this.result.opts).generate();return this.result.css=I[0],this.result.map=I[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 w of this.plugins){let b=this.runOnRoot(w);if(p(b))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let w=this.result.root;for(;!w[l];)w[l]=!0,this.walkSync(w);if(this.listeners.OnceExit)if(w.type==="document")for(let b of w.nodes)this.visitSync(this.listeners.OnceExit,b);else this.visitSync(this.listeners.OnceExit,w)}return this.result}then(w,b){return process.env.NODE_ENV!=="production"&&("from"in this.opts||a("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(w,b)}toString(){return this.css}visitSync(w,b){for(let[R,E]of w){this.result.lastPlugin=R;let I;try{I=E(b,this.helpers)}catch(C){throw this.handleError(C,b.proxyOf)}if(b.type!=="root"&&b.type!=="document"&&!b.parent)return!0;if(p(I))throw this.getAsyncError()}}visitTick(w){let b=w[w.length-1],{node:R,visitors:E}=b;if(R.type!=="root"&&R.type!=="document"&&!R.parent){w.pop();return}if(E.length>0&&b.visitorIndex<E.length){let[C,N]=E[b.visitorIndex];b.visitorIndex+=1,b.visitorIndex===E.length&&(b.visitors=[],b.visitorIndex=0),this.result.lastPlugin=C;try{return N(R.toProxy(),this.helpers)}catch(G){throw this.handleError(G,R)}}if(b.iterator!==0){let C=b.iterator;b.descending&&(b.descending=!1,R.indexes[C]+=1);let N;for(;N=R.nodes[R.indexes[C]];){if(!N[l]){N[l]=!0,b.descending=!0,w.push(g(N));return}R.indexes[C]+=1}b.iterator=0,delete R.indexes[C]}let I=b.events;for(;b.eventIndex<I.length;){let C=I[b.eventIndex];if(b.eventIndex+=1,C===d){R.nodes&&R.nodes.length&&(R[l]=!0,b.iterator=R.getIterator());return}else if(this.listeners[C]){b.visitors=this.listeners[C];return}}w.pop()}walkSync(w){w[l]=!0;let b=[{eventIndex:0,events:m(w),iterator:0,node:w}];for(;b.length>0;){let R=b[b.length-1],E=R.node;if(R.iterator!==0){let I=R.iterator;R.descending&&(R.descending=!1,E.indexes[I]+=1);let C,N=!1;for(;C=E.nodes[E.indexes[I]];){if(!C[l]){C[l]=!0,R.descending=!0,b.push({eventIndex:0,events:m(C),iterator:0,node:C}),N=!0;break}E.indexes[I]+=1}if(N)continue;R.iterator=0,delete E.indexes[I]}if(R.eventIndex<R.events.length){let I=R.events[R.eventIndex];if(R.eventIndex+=1,I===d)E.nodes&&E.nodes.length&&(R.iterator=E.getIterator());else{let C=this.listeners[I];C&&this.visitSync(C,E.toProxy())&&b.pop()}continue}b.pop()}}warnings(){return this.sync().warnings()}}return S.registerPostcss=_=>{y=_},oa=S,S.default=S,s.registerLazyResult(S),t.registerLazyResult(S),oa}var aa,Xd;function Qv(){if(Xd)return aa;Xd=1;let e=Ed(),t=ta(),r=ia(),n=Si(),i=Gd();class s{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 l,u=t;try{l=u(this._css,this._opts)}catch(a){this.error=a}if(this.error)throw this.error;return this._root=l,l}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(l,u,a){u=u.toString(),this.stringified=!1,this._processor=l,this._css=u,this._opts=a,this._map=void 0;let h=n;this.result=new r(this._processor,void 0,this._opts),this.result.css=u;let c=this;Object.defineProperty(this.result,"root",{get(){return c.root}});let f=new e(h,void 0,this._opts,u);if(f.isMap()){let[d,p]=f.generate();d&&(this.result.css=d),p&&(this.result.map=p)}else f.clearAnnotation(),this.result.css=f.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(l){return this.async().catch(l)}finally(l){return this.async().then(l,l)}sync(){if(this.error)throw this.error;return this.result}then(l,u){return process.env.NODE_ENV!=="production"&&("from"in this._opts||i("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(l,u)}toString(){return this._css}warnings(){return[]}}return aa=s,s.default=s,aa}var la,Wd;function $v(){if(Wd)return la;Wd=1;let e=Do(),t=kd(),r=Qv(),n=pn();class i{constructor(o=[]){this.version="8.5.26",this.plugins=this.normalize(o)}normalize(o){let l=[];for(let u of o)if(u.postcss===!0?u=u():u.postcss&&(u=u.postcss),typeof u=="object"&&Array.isArray(u.plugins))l=l.concat(u.plugins);else if(typeof u=="object"&&u.postcssPlugin)l.push(u);else if(typeof u=="function")l.push(u);else if(typeof u=="object"&&(u.parse||u.stringify)){if(process.env.NODE_ENV!=="production")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.")}else throw new Error(u+" is not a PostCSS plugin");return l}process(o,l={}){return!this.plugins.length&&!l.parser&&!l.stringifier&&!l.syntax?new r(this,o,l):new t(this,o,l)}use(o){return this.plugins=this.plugins.concat(this.normalize([o])),this}}return la=i,i.default=i,n.registerProcessor(i),e.registerProcessor(i),la}var ua,Pd;function qv(){if(Pd)return ua;Pd=1;let e=Ao(),t=Ti(),r=Ht(),n=Oo(),i=Ei(),s=Do(),o=zv(),l=Ii(),u=kd(),a=wd(),h=_i(),c=ta(),f=$v(),d=ia(),p=pn(),m=Ko(),g=Si(),v=xd();function y(...S){return S.length===1&&Array.isArray(S[0])&&(S=S[0]),new f(S)}return y.plugin=function(_,w){let b=!1;function R(...I){console&&console.warn&&!b&&(b=!0,console.warn(_+`: postcss.plugin was deprecated. Migration guide:
|
|
79
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(_+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
80
|
+
https://www.w3ctech.com/topic/2226`));let C=w(...I);return C.postcssPlugin=_,C.postcssVersion=new f().version,C}let E;return Object.defineProperty(R,"postcss",{get(){return E||(E=R()),E}}),R.process=function(I,C,N){return y([R(N)]).process(I,C)},R},y.stringify=g,y.parse=c,y.fromJSON=o,y.list=a,y.comment=S=>new t(S),y.atRule=S=>new e(S),y.decl=S=>new i(S),y.rule=S=>new m(S),y.root=S=>new p(S),y.document=S=>new s(S),y.CssSyntaxError=n,y.Declaration=i,y.Container=r,y.Processor=f,y.Document=s,y.Comment=t,y.Warning=v,y.AtRule=e,y.Result=d,y.Input=l,y.Rule=m,y.Root=p,y.Node=h,u.registerPostcss(y),ua=y,y.default=y,ua}qv();var e0=Object.defineProperty,t0=(e,t,r)=>t in e?e0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,st=(e,t,r)=>t0(e,typeof t!="symbol"?t+"":t,r);Date.now().toString();function r0(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?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(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var Ci={exports:{}},Md;function n0(){if(Md)return Ci.exports;Md=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return Ci.exports=t(),Ci.exports.createColors=t,Ci.exports}const St=r0(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var ca,Ad;function da(){if(Ad)return ca;Ad=1;let e=n0(),t=St;class r extends Error{constructor(i,s,o,l,u,a){super(i),this.name="CssSyntaxError",this.reason=i,u&&(this.file=u),l&&(this.source=l),a&&(this.plugin=a),typeof s!="undefined"&&typeof o!="undefined"&&(typeof s=="number"?(this.line=s,this.column=o):(this.line=s.line,this.column=s.column,this.endLine=o.line,this.endColumn=o.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(i){if(!this.source)return"";let s=this.source;i==null&&(i=e.isColorSupported);let o=d=>d,l=d=>d,u=d=>d;if(i){let{bold:d,gray:p,red:m}=e.createColors(!0);l=g=>d(m(g)),o=g=>p(g),t&&(u=g=>t(g))}let a=s.split(/\r?\n/),h=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),f=String(c).length;return a.slice(h,c).map((d,p)=>{let m=h+1+p,g=" "+(" "+m).slice(-f)+" | ";if(m===this.line){if(d.length>160){let y=20,S=Math.max(0,this.column-y),_=Math.max(this.column+y,this.endColumn+y),w=d.slice(S,_),b=o(g.replace(/\d/g," "))+d.slice(0,Math.min(this.column-1,y-1)).replace(/[^\t]/g," ");return l(">")+o(g)+u(w)+`
|
|
81
|
+
`+b+l("^")}let v=o(g.replace(/\d/g," "))+d.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+o(g)+u(d)+`
|
|
82
|
+
`+v+l("^")}return" "+o(g)+u(d)}).join(`
|
|
83
|
+
`)}toString(){let i=this.showSourceCode();return i&&(i=`
|
|
84
|
+
|
|
85
|
+
`+i+`
|
|
86
|
+
`),this.name+": "+this.message+i}}return ca=r,r.default=r,ca}var ha,Ud;function Dd(){if(Ud)return ha;Ud=1;const e=/(<)(\/?style\b)/gi,t=/(<)(!--)/g,r=/[\t\n\f\r "#'()/;[\\\]{}]/;function n(h){return typeof h!="string"||!h.includes("<")?h:h.replace(e,"\\3c $2").replace(t,"\\3c $2")}const i={after:`
|
|
87
|
+
`,beforeClose:`
|
|
88
|
+
`,beforeComment:`
|
|
89
|
+
`,beforeDecl:`
|
|
90
|
+
`,beforeOpen:" ",beforeRule:`
|
|
91
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function s(h){return h[0].toUpperCase()+h.slice(1)}function o(h,c){let f="@"+c.name,d=c.params?h.rawValue(c,"params"):"",p=c.raws.afterName;return typeof p=="undefined"?p=d?" ":"":p===""&&d&&!r.test(d[0])&&(p=" "),f+p+d}function l(h,c,f){let d=f.nodes,p=d.length-1;for(;p>0&&d[p].type==="comment";)p-=1;let m=h.raw(f,"semicolon"),g=f.type==="document";for(let v=d.length-1;v>=0;v--){let y=d[v],S=p!==v||m;!S&&v<d.length-1&&(y.type==="atrule"&&!y.nodes||y.type==="decl"&&y.prop.startsWith("--"))&&(S=!0),c.push({document:g,node:y,semicolon:S})}}function u(h,c,f,d){let p=h.raw(f,"between","beforeOpen");h.builder(n(d+p)+"{",f,"start");let m=f.nodes&&f.nodes.length,g=()=>{let v=m?h.raw(f,"after"):h.raw(f,"after","emptyBody");v&&h.builder(n(v)),h.builder("}",f,"end"),f.type==="rule"&&f.raws.ownSemicolon&&h.builder(n(f.raws.ownSemicolon),f,"end")};m?(c.push(g),l(h,c,f)):g()}class a{constructor(c){this.builder=c}atrule(c,f){let d=o(this,c);if(c.nodes)this.block(c,d);else{let p=(c.raws.between||"")+(f?";":"");this.builder(n(d+p),c)}}beforeAfter(c,f){let d;c.type==="decl"?d=this.raw(c,null,"beforeDecl"):c.type==="comment"?d=this.raw(c,null,"beforeComment"):f==="before"?d=this.raw(c,null,"beforeRule"):d=this.raw(c,null,"beforeClose");let p=c.parent,m=0;for(;p&&p.type!=="root";)m+=1,p=p.parent;if(d.includes(`
|
|
92
|
+
`)){let g=this.raw(c,null,"indent");if(g.length)for(let v=0;v<m;v++)d+=g}return d}block(c,f){let d=this.raw(c,"between","beforeOpen");this.builder(n(f+d)+"{",c,"start");let p;c.nodes&&c.nodes.length?(this.body(c),p=this.raw(c,"after")):p=this.raw(c,"after","emptyBody"),p&&this.builder(n(p)),this.builder("}",c,"end")}body(c){let f=a.prototype,d=["atrule","block","body","rule","stringify"].every(m=>this[m]===f[m]),p=[];for(l(this,p,c);p.length>0;){let m=p.pop();if(typeof m=="function"){m();continue}let g=m.node,v=this.raw(g,"before");v&&this.builder(m.document?v:n(v)),d&&g.type==="rule"?u(this,p,g,this.rawValue(g,"selector")):d&&g.type==="atrule"&&g.nodes?u(this,p,g,o(this,g)):this.stringify(g,m.semicolon)}}comment(c){let f=this.raw(c,"left","commentLeft"),d=this.raw(c,"right","commentRight");this.builder(n("/*"+f+c.text+d+"*/"),c)}decl(c,f){let d=c.raws,p=this.raw(c,"between","colon"),m=c.prop+p+this.rawValue(c,"value");c.important&&(m+=d.important||" !important"),f&&(m+=";"),this.builder(n(m),c)}document(c){this.body(c)}raw(c,f,d){let p;if(d||(d=f),f&&(p=c.raws[f],typeof p!="undefined"))return p;let m=c.parent;if(d==="before"&&(!m||m.type==="root"&&m.first===c||m&&m.type==="document"))return"";if(!m)return i[d];let g=c.root(),v=g.rawCache||(g.rawCache={});if(typeof v[d]!="undefined")return v[d];if(d==="before"||d==="after")return this.beforeAfter(c,d);{let y="raw"+s(d);this[y]?p=this[y](g,c):g.walk(S=>{if(p=S.raws[f],typeof p!="undefined")return!1})}return typeof p=="undefined"&&(p=i[d]),v[d]=p,p}rawBeforeClose(c){let f;return c.walk(d=>{if(d.nodes&&d.nodes.length>0&&typeof d.raws.after!="undefined")return f=d.raws.after,f.includes(`
|
|
93
|
+
`)&&(f=f.replace(/[^\n]+$/,"")),!1}),f&&(f=f.replace(/\S/g,"")),f}rawBeforeComment(c,f){let d;return c.walkComments(p=>{if(typeof p.raws.before!="undefined")return d=p.raws.before,d.includes(`
|
|
94
|
+
`)&&(d=d.replace(/[^\n]+$/,"")),!1}),typeof d=="undefined"?d=this.raw(f,null,"beforeDecl"):d&&(d=d.replace(/\S/g,"")),d}rawBeforeDecl(c,f){let d;return c.walkDecls(p=>{if(typeof p.raws.before!="undefined")return d=p.raws.before,d.includes(`
|
|
95
|
+
`)&&(d=d.replace(/[^\n]+$/,"")),!1}),typeof d=="undefined"?d=this.raw(f,null,"beforeRule"):d&&(d=d.replace(/\S/g,"")),d}rawBeforeOpen(c){let f;return c.walk(d=>{if(d.type!=="decl"&&(f=d.raws.between,typeof f!="undefined"))return!1}),f}rawBeforeRule(c){let f;return c.walk(d=>{if(d.nodes&&(d.parent!==c||c.first!==d)&&typeof d.raws.before!="undefined")return f=d.raws.before,f.includes(`
|
|
96
|
+
`)&&(f=f.replace(/[^\n]+$/,"")),!1}),f&&(f=f.replace(/\S/g,"")),f}rawColon(c){let f;return c.walkDecls(d=>{if(typeof d.raws.between!="undefined")return f=d.raws.between.replace(/[^\s:]/g,""),!1}),f}rawEmptyBody(c){let f;return c.walk(d=>{if(d.nodes&&d.nodes.length===0&&(f=d.raws.after,typeof f!="undefined"))return!1}),f}rawIndent(c){if(c.raws.indent)return c.raws.indent;let f;return c.walk(d=>{let p=d.parent;if(p&&p!==c&&p.parent&&p.parent===c&&typeof d.raws.before!="undefined"){let m=d.raws.before.split(`
|
|
97
|
+
`);return f=m[m.length-1],f=f.replace(/\S/g,""),!1}}),f}rawSemicolon(c){let f;return c.walk(d=>{if(d.nodes&&d.nodes.length&&d.last.type==="decl"&&(f=d.raws.semicolon,typeof f!="undefined"))return!1}),f}rawValue(c,f){let d=c[f],p=c.raws[f];return p&&p.value===d?p.raw:d}root(c){if(c.source&&c.source.input.hasBOM&&this.builder("\uFEFF",c,"start"),this.body(c),c.raws.after){let f=c.raws.after,d=c.parent&&c.parent.type==="document";this.builder(d?f:n(f))}}rule(c){this.block(c,this.rawValue(c,"selector")),c.raws.ownSemicolon&&this.builder(n(c.raws.ownSemicolon),c,"end")}stringify(c,f){if(!this[c.type])throw new Error("Unknown AST node type "+c.type+". Maybe you need to change PostCSS stringifier.");this[c.type](c,f)}}return ha=a,a.default=a,ha}var fa,Fd;function Zi(){if(Fd)return fa;Fd=1;let e=Dd();function t(r,n){new e(n).stringify(r)}return fa=t,t.default=t,fa}var Li={},Jd;function xi(){return Jd||(Jd=1,Li.isClean=Symbol("isClean"),Li.my=Symbol("my")),Li}var pa,Hd;function Ni(){if(Hd)return pa;Hd=1;let e=da(),t=Dd(),r=Zi(),{isClean:n,my:i}=xi();function s(u,a){let h=new u.constructor,c=[[u,h,a]];for(;c.length>0;){let[f,d,p]=c.pop();for(let m in f){if(!Object.prototype.hasOwnProperty.call(f,m)||m==="proxyCache")continue;let g=f[m],v=typeof g;if(m==="parent"&&v==="object")p&&(d[m]=p);else if(m==="source")d[m]=g;else if(Array.isArray(g)){let y=[];d[m]=y;for(let S of g){let _=new S.constructor;y.push(_),c.push([S,_,d])}}else{if(v==="object"&&g!==null){let y=new g.constructor;c.push([g,y,void 0]),g=y}d[m]=g}}}return h}function o(u,a){if(a&&typeof a.offset!="undefined")return a.offset;let h=1,c=1,f=0;for(let d=0;d<u.length;d++){if(c===a.line&&h===a.column){f=d;break}u[d]===`
|
|
98
|
+
`?(h=1,c+=1):h+=1}return f}class l{get proxyOf(){return this}constructor(a={}){this.raws={},this[n]=!1,this[i]=!0;for(let h of Object.keys(a))if(h!=="__proto__")if(h==="nodes"){this.nodes=[];for(let c of a[h])typeof c.clone=="function"&&c.parent?this.append(c.clone()):this.append(c)}else this[h]=a[h]}addToError(a){if(a.postcssNode=this,a.stack&&this.source&&/\n\s{4}at /.test(a.stack)){let h=this.source;a.stack=a.stack.replace(/\n\s{4}at /,`$&${h.input.from}:${h.start.line}:${h.start.column}$&`)}return a}after(a){return this.parent.insertAfter(this,a),this}assign(a={}){for(let h in a)this[h]=a[h];return this}before(a){return this.parent.insertBefore(this,a),this}cleanRaws(a){delete this.raws.before,delete this.raws.after,a||delete this.raws.between}clone(a={}){let h=s(this);for(let c in a)h[c]=a[c];return h}cloneAfter(a={}){let h=this.clone(a);return this.parent.insertAfter(this,h),h}cloneBefore(a={}){let h=this.clone(a);return this.parent.insertBefore(this,h),h}error(a,h={}){if(this.source){let{end:c,start:f}=this.rangeBy(h);return this.source.input.error(a,{column:f.column,line:f.line},{column:c.column,line:c.line},h)}return new e(a)}getProxyProcessor(){return{get(a,h){return h==="proxyOf"?a:h==="root"?()=>a.root().toProxy():a[h]},set(a,h,c){return a[h]===c||(a[h]=c,(h==="prop"||h==="value"||h==="name"||h==="params"||h==="important"||h==="text")&&a.markDirty()),!0}}}markClean(){this[n]=!0}markDirty(){if(this[n]){this[n]=!1;let a=this;for(;a=a.parent;)a[n]=!1}}next(){if(!this.parent)return;let a=this.parent.index(this);return this.parent.nodes[a+1]}positionBy(a={}){let h="document"in this.source.input?this.source.input.document:this.source.input.css,c={column:this.source.start.column,line:this.source.start.line,offset:o(h,this.source.start)};if(a.index)c=this.positionInside(a.index);else if(a.word){let d=h.slice(o(h,this.source.start),o(h,this.source.end)).indexOf(a.word);d!==-1&&(c=this.positionInside(d))}return c}positionInside(a){let h=this.source.start.column,c=this.source.start.line,f="document"in this.source.input?this.source.input.document:this.source.input.css,d=o(f,this.source.start),p=d+a;for(let m=d;m<p;m++)f[m]===`
|
|
99
|
+
`?(h=1,c+=1):h+=1;return{column:h,line:c,offset:p}}prev(){if(!this.parent)return;let a=this.parent.index(this);return this.parent.nodes[a-1]}rangeBy(a={}){let h="document"in this.source.input?this.source.input.document:this.source.input.css,c={column:this.source.start.column,line:this.source.start.line,offset:o(h,this.source.start)},f=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:o(h,this.source.end)+1}:{column:c.column+1,line:c.line,offset:c.offset+1};if(a.word){let p=h.slice(o(h,this.source.start),o(h,this.source.end)).indexOf(a.word);p!==-1&&(c=this.positionInside(p),f=this.positionInside(p+a.word.length))}else a.start?c={column:a.start.column,line:a.start.line,offset:o(h,a.start)}:typeof a.index=="number"&&(c=this.positionInside(a.index)),a.end?f={column:a.end.column,line:a.end.line,offset:o(h,a.end)}:typeof a.endIndex=="number"?f=this.positionInside(a.endIndex):typeof a.index=="number"&&(f=this.positionInside(a.index+1));return(f.line<c.line||f.line===c.line&&f.column<=c.column)&&(f={column:c.column+1,line:c.line,offset:c.offset+1}),{end:f,start:c}}raw(a,h){return new t().raw(this,a,h)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...a){if(this.parent){let h=this,c=!1;for(let f of a)f===this?c=!0:c?(this.parent.insertAfter(h,f),h=f):this.parent.insertBefore(h,f);c||this.remove()}return this}root(){let a=this;for(;a.parent&&a.parent.type!=="document";)a=a.parent;return a}toJSON(a,h){let c=h==null;h=h||new Map;let f=[],d=[[this,f,0]];for(let m=0;m<d.length;m++){let[g,v,y]=d[m],S={};v[y]=S;for(let _ in g){if(!Object.prototype.hasOwnProperty.call(g,_)||_==="parent"||_==="proxyCache")continue;let w=g[_];if(Array.isArray(w)){let b=[];S[_]=b;for(let R=0;R<w.length;R++){let E=w[R];typeof E=="object"&&E.toJSON?E.toJSON===l.prototype.toJSON?d.push([E,b,R]):b[R]=E.toJSON(null,h):b[R]=E}}else if(typeof w=="object"&&w.toJSON)w.toJSON===l.prototype.toJSON?d.push([w,S,_]):S[_]=w.toJSON(null,h);else if(_==="source"){if(w==null)continue;let b=h.get(w.input);b==null&&(b=h.size,h.set(w.input,b)),S[_]={end:w.end,inputId:b,start:w.start}}else S[_]=w}}let p=f[0];return c&&(p.inputs=[...h.keys()].map(m=>m.toJSON())),p}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(a=r){a.stringify&&(a=a.stringify);let h="";return a(this,c=>{h+=c}),h}warn(a,h,c={}){let f={node:this};for(let d in c)f[d]=c[d];return a.warn(h,f)}}return pa=l,l.default=l,pa}var ma,Yd;function Oi(){if(Yd)return ma;Yd=1;let e=Ni();class t extends e{constructor(n){super(n),this.type="comment"}}return ma=t,t.default=t,ma}var ga,Bd;function Gi(){if(Bd)return ga;Bd=1;let e=Ni();class t extends e{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(n){n&&typeof n.value!="undefined"&&typeof n.value!="string"&&(n=B(x({},n),{value:String(n.value)})),super(n),this.type="decl"}}return ga=t,t.default=t,ga}var ya,zd;function Yt(){if(zd)return ya;zd=1;let e=Oi(),t=Gi(),r=Ni(),{isClean:n,my:i}=xi(),s,o,l,u;function a(f){let d=f.slice();for(;d.length>0;){let p=d.pop();if(delete p.source,p.nodes){p.nodes=p.nodes.slice();for(let m of p.nodes)d.push(m)}}return f.slice()}function h(f){let d=[f];for(;d.length>0;){let p=d.pop();if(p[n]=!1,p.proxyOf.nodes)for(let m of p.proxyOf.nodes)d.push(m)}}class c extends 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]}append(...d){for(let p of d){let m=this.normalize(p,this.last);for(let g of m)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(d){let p=[this];for(;p.length>0;){let m=p.pop();if(m!==this&&m.cleanRaws!==c.prototype.cleanRaws){m.cleanRaws(d);continue}if(r.prototype.cleanRaws.call(m,d),m.nodes)for(let g of m.nodes)p.push(g)}}each(d){if(!this.proxyOf.nodes)return;let p=this.getIterator(),m,g;for(;this.indexes[p]<this.proxyOf.nodes.length&&(m=this.indexes[p],g=d(this.proxyOf.nodes[m],m),g!==!1);)this.indexes[p]+=1;return delete this.indexes[p],g}every(d){return this.nodes.every(d)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let d=this.lastEach;return this.indexes[d]=0,d}getProxyProcessor(){return{get(d,p){return p==="proxyOf"?d:d[p]?p==="each"||typeof p=="string"&&p.startsWith("walk")?(...m)=>d[p](...m.map(g=>typeof g=="function"?(v,y)=>g(v.toProxy(),y):g)):p==="every"||p==="some"?m=>d[p]((g,...v)=>m(g.toProxy(),...v)):p==="root"?()=>d.root().toProxy():p==="nodes"?d.nodes.map(m=>m.toProxy()):p==="first"||p==="last"?d[p].toProxy():d[p]:d[p]},set(d,p,m){return d[p]===m||(d[p]=m,(p==="name"||p==="params"||p==="selector")&&d.markDirty()),!0}}}index(d){return typeof d=="number"?d:(d.proxyOf&&(d=d.proxyOf),this.proxyOf.nodes.indexOf(d))}insertAfter(d,p){let m=this.index(d),g=this.normalize(p,this.proxyOf.nodes[m]).reverse();m=this.index(d);for(let y of g)this.proxyOf.nodes.splice(m+1,0,y);let v;for(let y in this.indexes)v=this.indexes[y],m<v&&(this.indexes[y]=v+g.length);return this.markDirty(),this}insertBefore(d,p){let m=this.index(d),g=m===0?"prepend":!1,v=this.normalize(p,this.proxyOf.nodes[m],g).reverse();m=this.index(d);for(let S of v)this.proxyOf.nodes.splice(m,0,S);let y;for(let S in this.indexes)y=this.indexes[S],m<=y&&(this.indexes[S]=y+v.length);return this.markDirty(),this}normalize(d,p){if(typeof d=="string")d=a(o(d).nodes);else if(typeof d=="undefined")d=[];else if(Array.isArray(d)){d=d.slice(0);for(let g of d)g.parent&&g.parent.removeChild(g,"ignore")}else if(d.type==="root"&&this.type!=="document"){d=d.nodes.slice(0);for(let g of d)g.parent&&g.parent.removeChild(g,"ignore")}else if(d.type)d=[d];else if(d.prop){if(typeof d.value=="undefined")throw new Error("Value field is missed in node creation");typeof d.value!="string"&&(d.value=String(d.value)),d=[new t(d)]}else if(d.selector||d.selectors)d=[new u(d)];else if(d.name)d=[new s(d)];else if(d.text)d=[new e(d)];else throw new Error("Unknown node type in node creation");return d.map(g=>(g[i]||c.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[n]&&h(g),g.raws||(g.raws={}),typeof g.raws.before=="undefined"&&p&&typeof p.raws.before!="undefined"&&(g.raws.before=p.raws.before.replace(/\S/g,"")),g.parent=this.proxyOf,g))}prepend(...d){d=d.reverse();for(let p of d){let m=this.normalize(p,this.first,"prepend").reverse();for(let g of m)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+m.length}return this.markDirty(),this}push(d){return d.parent=this,this.proxyOf.nodes.push(d),this}removeAll(){for(let d of this.proxyOf.nodes)d.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(d){d=this.index(d),this.proxyOf.nodes[d].parent=void 0,this.proxyOf.nodes.splice(d,1);let p;for(let m in this.indexes)p=this.indexes[m],p>=d&&(this.indexes[m]=p-1);return this.markDirty(),this}replaceValues(d,p,m){return m||(m=p,p={}),this.walkDecls(g=>{p.props&&!p.props.includes(g.prop)||p.fast&&!g.value.includes(p.fast)||(g.value=g.value.replace(d,m))}),this.markDirty(),this}some(d){return this.nodes.some(d)}walk(d){if(!this.proxyOf.nodes)return;let p=[{iterator:this.getIterator(),node:this.proxyOf}];for(;p.length>0;){let{iterator:m,node:g}=p[p.length-1],v=g.indexes[m];if(v>=g.proxyOf.nodes.length){delete g.indexes[m],p.pop();let _=p[p.length-1];_&&(_.node.indexes[_.iterator]+=1);continue}let y=g.proxyOf.nodes[v],S;try{S=d(y,v)}catch(_){throw y.addToError(_)}if(S===!1){for(let _ of p)delete _.node.indexes[_.iterator];return!1}y.walk&&y.proxyOf.nodes?p.push({iterator:y.getIterator(),node:y}):g.indexes[m]+=1}}walkAtRules(d,p){return p?d instanceof RegExp?this.walk((m,g)=>{if(m.type==="atrule"&&d.test(m.name))return p(m,g)}):this.walk((m,g)=>{if(m.type==="atrule"&&m.name===d)return p(m,g)}):(p=d,this.walk((m,g)=>{if(m.type==="atrule")return p(m,g)}))}walkComments(d){return this.walk((p,m)=>{if(p.type==="comment")return d(p,m)})}walkDecls(d,p){return p?d instanceof RegExp?this.walk((m,g)=>{if(m.type==="decl"&&d.test(m.prop))return p(m,g)}):this.walk((m,g)=>{if(m.type==="decl"&&m.prop===d)return p(m,g)}):(p=d,this.walk((m,g)=>{if(m.type==="decl")return p(m,g)}))}walkRules(d,p){return p?d instanceof RegExp?this.walk((m,g)=>{if(m.type==="rule"&&d.test(m.selector))return p(m,g)}):this.walk((m,g)=>{if(m.type==="rule"&&m.selector===d)return p(m,g)}):(p=d,this.walk((m,g)=>{if(m.type==="rule")return p(m,g)}))}}return c.registerParse=f=>{o=f},c.registerRule=f=>{u=f},c.registerAtRule=f=>{s=f},c.registerRoot=f=>{l=f},ya=c,c.default=c,c.rebuild=f=>{let d=[f];for(;d.length>0;){let p=d.pop();if(p.type==="atrule"?Object.setPrototypeOf(p,s.prototype):p.type==="rule"?Object.setPrototypeOf(p,u.prototype):p.type==="decl"?Object.setPrototypeOf(p,t.prototype):p.type==="comment"?Object.setPrototypeOf(p,e.prototype):p.type==="root"&&Object.setPrototypeOf(p,l.prototype),p[i]=!0,p.nodes)for(let m of p.nodes)d.push(m)}},ya}var ba,Kd;function va(){if(Kd)return ba;Kd=1;let e=Yt();class t extends e{constructor(n){super(n),this.type="atrule"}append(...n){return this.proxyOf.nodes||(this.nodes=[]),super.append(...n)}prepend(...n){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...n)}}return ba=t,t.default=t,e.registerAtRule(t),ba}var Sa,jd;function wa(){if(jd)return Sa;jd=1;let e=Yt(),t,r;class n extends e{constructor(s){super(x({type:"document"},s)),this.nodes||(this.nodes=[])}toResult(s={}){return new t(new r,this,s).stringify()}}return n.registerLazyResult=i=>{t=i},n.registerProcessor=i=>{r=i},Sa=n,n.default=n,Sa}var Ra,Qd;function i0(){if(Qd)return Ra;Qd=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return Ra={nanoid:(n=21)=>{let i="",s=n|0;for(;s-- >0;)i+=e[Math.random()*64|0];return i},customAlphabet:(n,i=21)=>(s=i)=>{let o="",l=s|0;for(;l-- >0;)o+=n[Math.random()*n.length|0];return o}},Ra}var _a,$d;function qd(){if($d)return _a;$d=1;let{existsSync:e,readFileSync:t,realpathSync:r}=St,{dirname:n,isAbsolute:i,join:s,relative:o,sep:l}=St,{SourceMapConsumer:u,SourceMapGenerator:a}=St;function h(d){try{return r(d)}catch(p){return d}}function c(d){return Buffer?Buffer.from(d,"base64").toString():window.atob(d)}class f{constructor(p,m){if(m.map===!1)return;m.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(p),this.inline=this.startWith(this.annotation,"data:");let g=m.map?m.map.prev:void 0,v=this.loadMap(m.from,g);!this.mapFile&&m.from&&(this.mapFile=m.from),this.mapFile&&(this.root=n(this.mapFile)),v&&(this.text=v)}consumer(){return this.consumerCache||(this.consumerCache=new u(this.json||this.text)),this.consumerCache}decodeInline(p){let m=/^data:application\/json;charset=utf-?8;base64,/,g=/^data:application\/json;base64,/,v=/^data:application\/json;charset=utf-?8,/,y=/^data:application\/json,/,S=p.match(v)||p.match(y);if(S)return decodeURIComponent(p.substr(S[0].length));let _=p.match(m)||p.match(g);if(_)return c(p.substr(_[0].length));let w=p.slice(22);throw w=w.slice(0,w.indexOf(",")),new Error("Unsupported source map encoding "+w)}getAnnotationURL(p){return p.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(p){return typeof p!="object"?!1:typeof p.mappings=="string"||typeof p._mappings=="string"||Array.isArray(p.sections)}loadAnnotation(p){let m=p.match(/\/\*\s*# sourceMappingURL=/g);if(!m)return;let g=p.lastIndexOf(m.pop()),v=p.indexOf("*/",g);g>-1&&v>-1&&(this.annotation=this.getAnnotationURL(p.substring(g,v)))}loadFile(p,m,g){if(!g&&!this.unsafeMap){if(!/\.map$/i.test(p)||!m)return;let v=o(h(n(m)),h(p));if(v===".."||v.startsWith(".."+l)||i(v))return}if(this.root=n(p),e(p))return this.mapFile=p,t(p,"utf-8").toString().trim()}loadMap(p,m){if(m===!1)return!1;if(m){if(typeof m=="string")return m;if(typeof m=="function"){let g=m(p);if(g){let v=this.loadFile(g,p,!0);if(!v)throw new Error("Unable to load previous source map: "+g.toString());return v}}else{if(m instanceof u)return a.fromSourceMap(m).toString();if(m instanceof a)return m.toString();if(this.isMap(m))return JSON.stringify(m);throw new Error("Unsupported previous source map format: "+m.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let g=this.annotation;p&&(g=s(n(p),g));let v=this.loadFile(g,p,!1);if(v)try{this.json=JSON.parse(v.replace(/^\)]}'[^\n]*\n/,""))}catch(y){return}return v}}}startWith(p,m){return p?p.substr(0,m.length)===m:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return _a=f,f.default=f,_a}var Ta,eh;function Vi(){if(eh)return Ta;eh=1;let{nanoid:e}=i0(),{isAbsolute:t,resolve:r}=St,{SourceMapConsumer:n,SourceMapGenerator:i}=St,{fileURLToPath:s,pathToFileURL:o}=St,l=da(),u=qd(),a=St,h=Symbol("lineToIndexCache"),c=!!(n&&i),f=!!(r&&t);function d(m){if(m[h])return m[h];let g=m.css.split(`
|
|
100
|
+
`),v=new Array(g.length),y=0;for(let S=0,_=g.length;S<_;S++)v[S]=y,y+=g[S].length+1;return m[h]=v,v}class p{get from(){return this.file||this.id}constructor(g,v={}){if(g===null||typeof g=="undefined"||typeof g=="object"&&!g.toString)throw new Error(`PostCSS received ${g} instead of CSS string`);if(this.css=g.toString(),this.css[0]==="\uFEFF"||this.css[0]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,v.document&&(this.document=v.document.toString()),v.from&&(!f||/^\w+:\/\//.test(v.from)||t(v.from)?this.file=v.from:this.file=r(v.from)),f&&c){let y=new u(this.css,v);if(y.text){this.map=y;let S=y.consumer().file;!this.file&&S&&(this.file=this.mapResolve(S))}}this.file||(this.id="<input css "+e(6)+">"),this.map&&(this.map.file=this.from)}error(g,v,y,S={}){let _,w,b,R,E;if(v&&typeof v=="object"){let C=v,N=y;if(typeof C.offset=="number"){R=C.offset;let G=this.fromOffset(R);v=G.line,y=G.col}else v=C.line,y=C.column,R=this.fromLineAndColumn(v,y);if(typeof N.offset=="number"){b=N.offset;let G=this.fromOffset(b);w=G.line,_=G.col}else w=N.line,_=N.column,b=this.fromLineAndColumn(N.line,N.column)}else if(y)R=this.fromLineAndColumn(v,y);else{R=v;let C=this.fromOffset(R);v=C.line,y=C.col}let I=this.origin(v,y,w,_);return I?E=new l(g,I.endLine===void 0?I.line:{column:I.column,line:I.line},I.endLine===void 0?I.column:{column:I.endColumn,line:I.endLine},I.source,I.file,S.plugin):E=new l(g,w===void 0?v:{column:y,line:v},w===void 0?y:{column:_,line:w},this.css,this.file,S.plugin),E.input={column:y,endColumn:_,endLine:w,endOffset:b,line:v,offset:R,source:this.css},this.file&&(o&&(E.input.url=o(this.file).toString()),E.input.file=this.file),E}fromLineAndColumn(g,v){return d(this)[g-1]+v-1}fromOffset(g){let v=d(this),y=v[v.length-1],S=0;if(g>=y)S=v.length-1;else{let _=v.length-2,w;for(;S<_;)if(w=S+(_-S>>1),g<v[w])_=w-1;else if(g>=v[w+1])S=w+1;else{S=w;break}}return{col:g-v[S]+1,line:S+1}}mapResolve(g){return/^\w+:\/\//.test(g)?g:r(this.map.consumer().sourceRoot||this.map.root||".",g)}origin(g,v,y,S){if(!this.map)return!1;let _=this.map.consumer(),w=_.originalPositionFor({column:v-1,line:g});if(!w.source)return!1;let b;if(typeof y=="number"){let C=_.originalPositionFor({column:S-1,line:y});C.source&&(b=C)}let R;t(w.source)?R=o(w.source):R=new URL(w.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let E={column:w.column+1,endColumn:b&&b.column+1,endLine:b&&b.line,line:w.line,url:R.toString()};if(R.protocol==="file:")if(s)E.file=s(R);else throw new Error("file: protocol is not available in this PostCSS build");let I=_.sourceContentFor(w.source);return I&&(E.source=I),E}toJSON(){let g={};for(let v of["hasBOM","css","file","id"])this[v]!=null&&(g[v]=this[v]);return this.map&&(g.map=x({},this.map),g.map.consumerCache&&(g.map.consumerCache=void 0)),g}}return Ta=p,p.default=p,a&&a.registerInput&&a.registerInput(p),Ta}var Ea,th;function mn(){if(th)return Ea;th=1;let e=Yt(),t,r;class n extends e{constructor(s){super(s),this.type="root",this.nodes||(this.nodes=[])}normalize(s,o,l){let u=new Set;for(let h of Array.isArray(s)?s:[s])h&&typeof h=="object"&&!h.parent&&h.raws&&typeof h.raws.before!="undefined"&&u.add(h.raws);let a=super.normalize(s);if(o){if(l==="prepend")this.nodes.length>1?o.raws.before=this.nodes[1].raws.before:delete o.raws.before;else if(this.first!==o)for(let h of a)u.has(h.raws)||(h.raws.before=o.raws.before)}return a}removeChild(s,o){let l=this.index(s);return!o&&l===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[l].raws.before),super.removeChild(s)}toResult(s={}){return new t(new r,this,s).stringify()}}return n.registerLazyResult=i=>{t=i},n.registerProcessor=i=>{r=i},Ea=n,n.default=n,e.registerRoot(n),Ea}var Ia,rh;function nh(){if(rh)return Ia;rh=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`
|
|
101
|
+
`," "];return e.split(t,r)},split(t,r,n){if(typeof t!="string")return[];let i=[],s="",o=!1,l=0,u=!1,a="",h=!1;for(let c of t)h?h=!1:c==="\\"?h=!0:u?c===a&&(u=!1):c==='"'||c==="'"?(u=!0,a=c):c==="("?l+=1:c===")"?l>0&&(l-=1):l===0&&r.includes(c)&&(o=!0),o?(s!==""&&i.push(s.trim()),s="",o=!1):s+=c;return(n||s!=="")&&i.push(s.trim()),i}};return Ia=e,e.default=e,Ia}var Ca,ih;function Za(){if(ih)return Ca;ih=1;let e=Yt(),t=nh();class r extends e{get selectors(){return t.comma(this.selector)}set selectors(i){let s=this.selector?this.selector.match(/,\s*/):null,o=s?s[0]:","+this.raw("between","beforeOpen");this.selector=i.join(o)}constructor(i){super(i),this.type="rule",this.nodes||(this.nodes=[])}}return Ca=r,r.default=r,e.registerRule(r),Ca}var La,sh;function s0(){if(sh)return La;sh=1;let e=va(),t=Oi(),r=Gi(),n=Vi(),i=qd(),s=mn(),o=Za();function l(h,c){return h.inputs?h.inputs.map(f=>{let d=B(x({},f),{__proto__:n.prototype});return d.map&&(d.map=B(x({},d.map),{__proto__:i.prototype})),d}):c}function u(h,c,f){let d=x({},h);if(delete d.inputs,delete d.nodes,d.source){let m=d.source,{inputId:g}=m,v=et(m,["inputId"]);d.source=v,g!=null&&(d.source.input=c[g])}let p;if(d.type==="root")p=new s(d);else if(d.type==="decl")p=new r(d);else if(d.type==="rule")p=new o(d);else if(d.type==="comment")p=new t(d);else if(d.type==="atrule")p=new e(d);else throw new Error("Unknown node type: "+h.type);if(f){p.nodes=f;for(let g of f)g.parent=p}return p}function a(h,c){if(Array.isArray(h))return h.map(p=>a(p));let f,d=[{childIndex:0,children:[],inputs:l(h,c),json:h}];for(;d.length>0;){let p=d[d.length-1],m=p.json.nodes;if(m&&p.childIndex<m.length){let v=m[p.childIndex];p.childIndex+=1,d.push({childIndex:0,children:[],inputs:l(v,p.inputs),json:v});continue}d.pop();let g=u(p.json,p.inputs,m?p.children:void 0);d.length>0?d[d.length-1].children.push(g):f=g}return f}return La=a,a.default=a,La}var xa,oh;function ah(){if(oh)return xa;oh=1;let{dirname:e,relative:t,resolve:r,sep:n}=St,{SourceMapConsumer:i,SourceMapGenerator:s}=St,{pathToFileURL:o}=St,l=Vi(),u=!!(i&&s),a=!!(e&&r&&t&&n);class h{constructor(f,d,p,m){this.stringify=f,this.mapOpts=p.map||{},this.root=d,this.opts=p,this.css=m,this.originalCSS=m,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let f;this.isInline()?f="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?f=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?f=this.mapOpts.annotation(this.opts.to,this.root):f=this.outputFile()+".map";let d=`
|
|
102
|
+
`;this.css.includes(`\r
|
|
103
|
+
`)&&(d=`\r
|
|
104
|
+
`),this.css+=d+"/*# sourceMappingURL="+f+" */"}applyPrevMaps(){for(let f of this.previous()){let d=this.toUrl(this.path(f.file)),p=f.root||e(f.file),m;this.mapOpts.sourcesContent===!1?(m=new i(f.text),m.sourcesContent&&(m.sourcesContent=null)):m=f.consumer(),this.map.applySourceMap(m,d,this.toUrl(this.path(p)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let f;for(let d=this.root.nodes.length-1;d>=0;d--)f=this.root.nodes[d],f.type==="comment"&&f.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(d)}else if(this.css){let f;for(;(f=this.css.lastIndexOf("/*#"))!==-1;){let d=this.css.indexOf("*/",f+3);if(d===-1)break;for(;f>0&&this.css[f-1]===`
|
|
105
|
+
`;)f--;this.css=this.css.slice(0,f)+this.css.slice(d+2)}}}}generate(){if(this.clearAnnotation(),a&&u&&this.isMap())return this.generateMap();{let f="";return this.stringify(this.root,d=>{f+=d}),[f]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let f=this.previous()[0].consumer();f.file=this.outputFile(),this.map=s.fromSourceMap(f,{ignoreInvalidMapping:!0})}else this.map=new s({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 s({file:this.outputFile(),ignoreInvalidMapping:!0});let f=1,d=1,p="<no source>",m={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,v;this.stringify(this.root,(y,S,_)=>{if(this.css+=y,S&&_!=="end"&&(m.generated.line=f,m.generated.column=d-1,S.source&&S.source.start?(m.source=this.sourcePath(S),m.original.line=S.source.start.line,m.original.column=S.source.start.column-1,this.map.addMapping(m)):(m.source=p,m.original.line=1,m.original.column=0,this.map.addMapping(m))),v=y.match(/\n/g),v?(f+=v.length,g=y.lastIndexOf(`
|
|
106
|
+
`),d=y.length-g):d+=y.length,S&&_!=="start"){let w=S.parent||{raws:{}};(!(S.type==="decl"||S.type==="atrule"&&!S.nodes)||S!==w.last||w.raws.semicolon)&&(S.source&&S.source.end?(m.source=this.sourcePath(S),m.original.line=S.source.end.line,m.original.column=S.source.end.column-1,m.generated.line=f,m.generated.column=d-2,this.map.addMapping(m)):(m.source=p,m.original.line=1,m.original.column=0,m.generated.line=f,m.generated.column=d-1,this.map.addMapping(m)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(f=>f.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let f=this.mapOpts.annotation;return typeof f!="undefined"&&f!==!0?!1:this.previous().length?this.previous().some(d=>d.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(f=>f.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(f){if(this.mapOpts.absolute||f.charCodeAt(0)===60||/^\w+:\/\//.test(f))return f;let d=this.memoizedPaths.get(f);if(d)return d;let p=this.opts.to?e(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(p=e(r(p,this.mapOpts.annotation)));let m=t(p,f);return this.memoizedPaths.set(f,m),m}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(f=>{if(f.source&&f.source.input.map){let d=f.source.input.map;this.previousMaps.includes(d)||this.previousMaps.push(d)}});else{let f=new l(this.originalCSS,this.opts);f.map&&this.previousMaps.push(f.map)}return this.previousMaps}setSourcesContent(){let f={};if(this.root)this.root.walk(d=>{if(d.source){let p=d.source.input.from;if(p&&!f[p]){f[p]=!0;let m=this.usesFileUrls?this.toFileUrl(p):this.toUrl(this.path(p));this.map.setSourceContent(m,d.source.input.css)}}});else if(this.css){let d=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(d,this.css)}}sourcePath(f){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(f.source.input.from):this.toUrl(this.path(f.source.input.from))}toBase64(f){return Buffer?Buffer.from(f).toString("base64"):window.btoa(unescape(encodeURIComponent(f)))}toFileUrl(f){let d=this.memoizedFileURLs.get(f);if(d)return d;if(o){let p=o(f).toString();return this.memoizedFileURLs.set(f,p),p}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(f){let d=this.memoizedURLs.get(f);if(d)return d;n==="\\"&&(f=f.replace(/\\/g,"/"));let p=encodeURI(f).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(f,p),p}}return xa=h,xa}var Na,lh;function o0(){if(lh)return Na;lh=1;const e=39,t=34,r=92,n=47,i=10,s=32,o=12,l=9,u=13,a=91,h=93,c=40,f=41,d=123,p=125,m=59,g=42,v=58,y=64,S=/[\t\n\f\r "#'()/;[\\\]{}]/g,_=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,w=/.[\r\n"'(/\\]/,b=/[\da-f]/i;return Na=function(E,I={}){let C=E.css.valueOf(),N=I.ignoreErrors,G,Q,Z,T,W,k,M,D,U,q,fe=C.length,O=0,pe=[],P=[],F=-1;function Y(){return O}function j(K){throw E.error("Unclosed "+K,O)}function ne(){return P.length===0&&O>=fe}function ae(K){if(P.length)return P.pop();if(O>=fe)return;let le=K?K.ignoreUnclosed:!1;switch(G=C.charCodeAt(O),G){case i:case s:case l:case u:case o:{T=O;do T+=1,G=C.charCodeAt(T);while(G===s||G===i||G===l||G===u||G===o);k=["space",C.slice(O,T)],O=T-1;break}case a:case h:case d:case p:case v:case m:case f:{let Te=String.fromCharCode(G);k=[Te,Te,O];break}case c:{if(q=pe.length?pe.pop()[1]:"",U=C.charCodeAt(O+1),q==="url"&&U!==e&&U!==t&&U!==s&&U!==i&&U!==l&&U!==o&&U!==u){T=O;do{if(M=!1,T=C.indexOf(")",T+1),T===-1)if(N||le){T=O;break}else j("bracket");for(D=T;C.charCodeAt(D-1)===r;)D-=1,M=!M}while(M);k=["brackets",C.slice(O,T+1),O,T],O=T}else O<=F?k=["(","(",O]:(T=C.indexOf(")",O+1),Q=C.slice(O,T+1),T===-1||w.test(Q)?(F=T===-1?fe:T,k=["(","(",O]):(k=["brackets",Q,O,T],O=T));break}case e:case t:{W=G===e?"'":'"',T=O;do{if(M=!1,T=C.indexOf(W,T+1),T===-1)if(N||le){T=O+1;break}else j("string");for(D=T;C.charCodeAt(D-1)===r;)D-=1,M=!M}while(M);k=["string",C.slice(O,T+1),O,T],O=T;break}case y:{S.lastIndex=O+1,S.test(C),S.lastIndex===0?T=C.length-1:T=S.lastIndex-2,k=["at-word",C.slice(O,T+1),O,T],O=T;break}case r:{for(T=O,Z=!0;C.charCodeAt(T+1)===r;)T+=1,Z=!Z;if(G=C.charCodeAt(T+1),Z&&G!==n&&G!==s&&G!==i&&G!==l&&G!==u&&G!==o&&(T+=1,b.test(C.charAt(T)))){for(;b.test(C.charAt(T+1));)T+=1;C.charCodeAt(T+1)===s&&(T+=1)}k=["word",C.slice(O,T+1),O,T],O=T;break}default:{G===n&&C.charCodeAt(O+1)===g?(T=C.indexOf("*/",O+2)+1,T===0&&(N||le?T=C.length:j("comment")),k=["comment",C.slice(O,T+1),O,T],O=T):(_.lastIndex=O+1,_.test(C),_.lastIndex===0?T=C.length-1:T=_.lastIndex-2,k=["word",C.slice(O,T+1),O,T],pe.push(k),O=T);break}}return O++,k}function ge(K){P.push(K)}return{back:ge,endOfFile:ne,nextToken:ae,position:Y}},Na}var Oa,uh;function a0(){if(uh)return Oa;uh=1;let e=va(),t=Oi(),r=Gi(),n=mn(),i=Za(),s=o0();const o={empty:!0,space:!0};function l(h){for(let c=h.length-1;c>=0;c--){let f=h[c],d=f[3]||f[2];if(d)return d}}function u(h,c,f){let d="";for(let p=c;p<f;p++)d+=h[p][1];return d}class a{constructor(c){this.input=c,this.root=new n,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:c,start:{column:1,line:1,offset:0}}}atrule(c){let f=new e;f.name=c[1].slice(1),f.name===""&&this.unnamedAtrule(f,c),this.init(f,c[2]);let d,p,m,g=!1,v=!1,y=[],S=[];for(;!this.tokenizer.endOfFile();){if(c=this.tokenizer.nextToken(),d=c[0],d==="("||d==="["?S.push(d==="("?")":"]"):d==="{"&&S.length>0?S.push("}"):d===S[S.length-1]&&S.pop(),S.length===0)if(d===";"){f.source.end=this.getPosition(c[2]),f.source.end.offset++,this.semicolon=!0;break}else if(d==="{"){v=!0;break}else if(d==="}"){if(y.length>0){for(m=y.length-1,p=y[m];p&&p[0]==="space";)p=y[--m];p&&(f.source.end=this.getPosition(p[3]||p[2]),f.source.end.offset++)}this.end(c);break}else y.push(c);else y.push(c);if(this.tokenizer.endOfFile()){g=!0;break}}f.raws.between=this.spacesAndCommentsFromEnd(y),y.length?(f.raws.afterName=this.spacesAndCommentsFromStart(y),this.raw(f,"params",y),g&&(c=y[y.length-1],f.source.end=this.getPosition(c[3]||c[2]),f.source.end.offset++,this.spaces=f.raws.between,f.raws.between="")):(f.raws.afterName="",f.params=""),v&&(f.nodes=[],this.current=f)}checkMissedSemicolon(c){let f=this.colon(c);if(f===!1)return;let d=0,p;for(let m=f-1;m>=0&&(p=c[m],!(p[0]!=="space"&&(d+=1,d===2)));m--);throw this.input.error("Missed semicolon",p[0]==="word"?p[3]+1:p[2])}colon(c){let f=0,d,p,m;for(let[g,v]of c.entries()){if(p=v,m=p[0],m==="("&&(f+=1),m===")"&&(f-=1),f===0&&m===":")if(!d)this.doubleColon(p);else{if(d[0]==="word"&&d[1]==="progid")continue;return g}d=p}return!1}comment(c){let f=new t;this.init(f,c[2]),f.source.end=this.getPosition(c[3]||c[2]),f.source.end.offset++;let d=c[1].slice(2,-2);if(!d.trim())f.text="",f.raws.left=d,f.raws.right="";else{let p=d.match(/^(\s*)([^]*\S)(\s*)$/);f.text=p[2],f.raws.left=p[1],f.raws.right=p[3]}}createTokenizer(){this.tokenizer=s(this.input)}decl(c,f){let d=new r;this.init(d,c[0][2]);let p=c[c.length-1];p[0]===";"&&(this.semicolon=!0,c.pop()),d.source.end=this.getPosition(p[3]||p[2]||l(c)),d.source.end.offset++;let m=0;for(;c[m][0]!=="word";)m===c.length-1&&this.unknownWord([c[m]]),m++;d.raws.before+=u(c,0,m),d.source.start=this.getPosition(c[m][2]);let g=m;for(;m<c.length;){let b=c[m][0];if(b===":"||b==="space"||b==="comment")break;m++}d.prop=u(c,g,m);let v=m,y;for(;m<c.length&&(y=c[m],m++,y[0]!==":");)y[0]==="word"&&/\w/.test(y[1])&&this.unknownWord([y]);d.raws.between=u(c,v,m),(d.prop[0]==="_"||d.prop[0]==="*")&&(d.raws.before+=d.prop[0],d.prop=d.prop.slice(1));let S=m;for(;m<c.length;){let b=c[m][0];if(b!=="space"&&b!=="comment")break;m++}let _=c.slice(S,m);c=c.slice(m),this.precheckMissedSemicolon(c);for(let b=c.length-1;b>=0;b--){if(y=c[b],y[1].toLowerCase()==="!important"){d.important=!0;let R=this.stringFrom(c,b);R=this.spacesFromEnd(c)+R,R!==" !important"&&(d.raws.important=R);break}else if(y[1].toLowerCase()==="important"){let R=c.slice(0),E="";for(let I=b;I>0;I--){let C=R[I][0];if(E.trim().startsWith("!")&&C!=="space")break;E=R.pop()[1]+E}E.trim().startsWith("!")&&(d.important=!0,d.raws.important=E,c=R)}if(y[0]!=="space"&&y[0]!=="comment")break}c.some(b=>b[0]!=="space"&&b[0]!=="comment")&&(d.raws.between+=_.map(b=>b[1]).join(""),_=[]),this.raw(d,"value",_.concat(c),f),d.value.includes(":")&&!f&&this.checkMissedSemicolon(c)}doubleColon(c){throw this.input.error("Double colon",{offset:c[2]},{offset:c[2]+c[1].length})}emptyRule(c){let f=new i;this.init(f,c[2]),f.selector="",f.raws.between="",this.current=f}end(c){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(c[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(c)}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(c){if(this.spaces+=c[1],this.current.nodes){let f=this.current.nodes[this.current.nodes.length-1];f&&f.type==="rule"&&!f.raws.ownSemicolon&&(f.raws.ownSemicolon=this.spaces,this.spaces="",f.source.end=this.getPosition(c[2]),f.source.end.offset+=f.raws.ownSemicolon.length)}}getPosition(c){let f=this.input.fromOffset(c);return{column:f.col,line:f.line,offset:c}}init(c,f){this.current.push(c),c.source={input:this.input,start:this.getPosition(f)},c.raws.before=this.spaces,this.spaces="",c.type!=="comment"&&(this.semicolon=!1)}other(c){let f=!1,d=null,p=!1,m=null,g=[],v=c[1].startsWith("--"),y=[],S=c;for(;S;){if(d=S[0],y.push(S),d==="("||d==="[")m||(m=S),g.push(d==="("?")":"]");else if(v&&p&&d==="{")m||(m=S),g.push("}");else if(g.length===0)if(d===";")if(p){this.decl(y,v);return}else break;else if(d==="{"){this.rule(y);return}else if(d==="}"){this.tokenizer.back(y.pop()),f=!0;break}else d===":"&&(p=!0);else d===g[g.length-1]&&(g.pop(),g.length===0&&(m=null));S=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(f=!0),g.length>0&&this.unclosedBracket(m),f&&p){if(!v)for(;y.length&&(S=y[y.length-1][0],!(S!=="space"&&S!=="comment"));)this.tokenizer.back(y.pop());this.decl(y,v)}else this.unknownWord(y)}parse(){let c;for(;!this.tokenizer.endOfFile();)switch(c=this.tokenizer.nextToken(),c[0]){case"space":this.spaces+=c[1];break;case";":this.freeSemicolon(c);break;case"}":this.end(c);break;case"comment":this.comment(c);break;case"at-word":this.atrule(c);break;case"{":this.emptyRule(c);break;default:this.other(c);break}this.endFile()}precheckMissedSemicolon(){}raw(c,f,d,p){let m,g,v=d.length,y="",S=!0,_,w;for(let b=0;b<v;b+=1)m=d[b],g=m[0],g==="space"&&b===v-1&&!p?S=!1:g==="comment"?(w=d[b-1]?d[b-1][0]:"empty",_=d[b+1]?d[b+1][0]:"empty",!o[w]&&!o[_]?y.slice(-1)===","?S=!1:y+=m[1]:S=!1):y+=m[1];if(!S){let b=d.reduce((R,E)=>R+E[1],"");c.raws[f]={raw:b,value:y}}c[f]=y}rule(c){c.pop();let f=new i;this.init(f,c[0][2]),f.raws.between=this.spacesAndCommentsFromEnd(c),this.raw(f,"selector",c),this.current=f}spacesAndCommentsFromEnd(c){let f,d="";for(;c.length&&(f=c[c.length-1][0],!(f!=="space"&&f!=="comment"));)d=c.pop()[1]+d;return d}spacesAndCommentsFromStart(c){let f,d="";for(;c.length&&(f=c[0][0],!(f!=="space"&&f!=="comment"));)d+=c.shift()[1];return d}spacesFromEnd(c){let f,d="";for(;c.length&&(f=c[c.length-1][0],f==="space");)d=c.pop()[1]+d;return d}stringFrom(c,f){let d="";for(let p=f;p<c.length;p++)d+=c[p][1];return c.splice(f,c.length-f),d}unclosedBlock(){let c=this.current.source.start;throw this.input.error("Unclosed block",c.line,c.column)}unclosedBracket(c){throw this.input.error("Unclosed bracket",{offset:c[2]},{offset:c[2]+1})}unexpectedClose(c){throw this.input.error("Unexpected }",{offset:c[2]},{offset:c[2]+1})}unknownWord(c){throw this.input.error("Unknown word "+c[0][1],{offset:c[0][2]},{offset:c[0][2]+c[0][1].length})}unnamedAtrule(c,f){throw this.input.error("At-rule without name",{offset:f[2]},{offset:f[2]+f[1].length})}}return Oa=a,Oa}var Ga,ch;function Va(){if(ch)return Ga;ch=1;let e=Yt(),t=Vi(),r=a0();function n(i,s){let o=new t(i,s),l=new r(o);try{l.parse()}catch(u){throw process.env.NODE_ENV!=="production"&&u.name==="CssSyntaxError"&&s&&s.from&&(/\.scss$/i.test(s.from)?u.message+=`
|
|
107
|
+
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(s.from)?u.message+=`
|
|
108
|
+
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(s.from)&&(u.message+=`
|
|
109
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),u}return l.root}return Ga=n,n.default=n,e.registerParse(n),Ga}var ka,dh;function hh(){if(dh)return ka;dh=1;let e=Yt(),{my:t}=xi();class r{constructor(i,s={}){if(this.type="warning",this.text=i,s.node&&s.node.source){s.node[t]||e.rebuild(s.node);let o=s.node.rangeBy(s);this.line=o.start.line,this.column=o.start.column,this.endLine=o.end.line,this.endColumn=o.end.column}for(let o in s)this[o]=s[o]}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}}return ka=r,r.default=r,ka}var Xa,fh;function Wa(){if(fh)return Xa;fh=1;let e=hh();class t{get content(){return this.css}constructor(n,i,s){this.processor=n,this.messages=[],this.root=i,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(n,i={}){i.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(i.plugin=this.lastPlugin.postcssPlugin);let s=new e(n,i);return this.messages.push(s),s}warnings(){return this.messages.filter(n=>n.type==="warning")}}return Xa=t,t.default=t,Xa}var Pa,ph;function mh(){if(ph)return Pa;ph=1;let e={};return Pa=function(r){e[r]||(e[r]=!0,typeof console!="undefined"&&console.warn&&console.warn(r))},Pa}var Ma,gh;function yh(){if(gh)return Ma;gh=1;let e=Yt(),t=wa(),r=ah(),n=Va(),i=Wa(),s=mn(),o=Zi(),{isClean:l,my:u}=xi(),a=mh();const h={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},c={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},f={Once:!0,postcssPlugin:!0,prepare:!0},d=0;function p(_){return typeof _=="object"&&typeof _.then=="function"}function m(_){let w=!1,b=h[_.type];return _.type==="decl"?w=_.prop.toLowerCase():_.type==="atrule"&&(w=_.name.toLowerCase()),w&&_.append?[b,b+"-"+w,d,b+"Exit",b+"Exit-"+w]:w?[b,b+"-"+w,b+"Exit",b+"Exit-"+w]:_.append?[b,d,b+"Exit"]:[b,b+"Exit"]}function g(_){let w;return _.type==="document"?w=["Document",d,"DocumentExit"]:_.type==="root"?w=["Root",d,"RootExit"]:w=m(_),{eventIndex:0,events:w,iterator:0,node:_,visitorIndex:0,visitors:[]}}function v(_){let w=[_];for(;w.length>0;){let b=w.pop();if(b[l]=!1,b.nodes)for(let R of b.nodes)w.push(R)}return _}let y={};class S{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"}constructor(w,b,R){this.stringified=!1,this.processed=!1;let E;if(typeof b=="object"&&b!==null&&(b.type==="root"||b.type==="document"))E=v(b);else if(b instanceof S||b instanceof i)E=v(b.root),b.map&&(typeof R.map=="undefined"&&(R.map={}),R.map.inline||(R.map.inline=!1),R.map.prev=b.map);else{let I=n;R.syntax&&(I=R.syntax.parse),R.parser&&(I=R.parser),I.parse&&(I=I.parse);try{E=I(b,R)}catch(C){this.processed=!0,this.error=C}E&&!E[u]&&e.rebuild(E)}this.result=new i(w,E,R),this.helpers=B(x({},y),{postcss:y,result:this.result}),this.plugins=this.processor.plugins.map(I=>typeof I=="object"&&I.prepare?x(x({},I),I.prepare(this.result)):I)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(w){return this.async().catch(w)}finally(w){return this.async().then(w,w)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(w,b){let R=this.result.lastPlugin;try{if(b&&b.addToError(w),this.error=w,w.name==="CssSyntaxError"&&!w.plugin)w.plugin=R.postcssPlugin,w.setMessage();else if(R.postcssVersion&&process.env.NODE_ENV!=="production"){let E=R.postcssPlugin,I=R.postcssVersion,C=this.result.processor.version,N=I.split("."),G=C.split(".");(N[0]!==G[0]||parseInt(N[1])>parseInt(G[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+C+", but "+E+" uses "+I+". Perhaps this is the source of the error below.")}}catch(E){console&&console.error&&console.error(E)}return w}prepareVisitors(){this.listeners={};let w=(b,R,E)=>{this.listeners[R]||(this.listeners[R]=[]),this.listeners[R].push([b,E])};for(let b of this.plugins)if(typeof b=="object")for(let R in b){if(!c[R]&&/^[A-Z]/.test(R))throw new Error(`Unknown event ${R} in ${b.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!f[R])if(typeof b[R]=="object")for(let E in b[R])E==="*"?w(b,R,b[R][E]):w(b,R+"-"+E.toLowerCase(),b[R][E]);else typeof b[R]=="function"&&w(b,R,b[R])}this.hasListener=Object.keys(this.listeners).length>0}runAsync(){return $(this,null,function*(){this.plugin=0;for(let w=0;w<this.plugins.length;w++){let b=this.plugins[w],R=this.runOnRoot(b);if(p(R))try{yield R}catch(E){throw this.handleError(E)}}if(this.prepareVisitors(),this.hasListener){let w=this.result.root;for(;!w[l];){w[l]=!0;let b=[g(w)];for(;b.length>0;){let R=this.visitTick(b);if(p(R))try{yield R}catch(E){let I=b[b.length-1].node;throw this.handleError(E,I)}}}if(this.listeners.OnceExit)for(let[b,R]of this.listeners.OnceExit){this.result.lastPlugin=b;try{if(w.type==="document"){let E=w.nodes.map(I=>R(I,this.helpers));yield Promise.all(E)}else yield R(w,this.helpers)}catch(E){throw this.handleError(E)}}}return this.processed=!0,this.stringify()})}runOnRoot(w){this.result.lastPlugin=w;try{if(typeof w=="object"&&w.Once){if(this.result.root.type==="document"){let b=this.result.root.nodes.map(R=>w.Once(R,this.helpers));return p(b[0])?Promise.all(b):b}return w.Once(this.result.root,this.helpers)}else if(typeof w=="function")return w(this.result.root,this.result)}catch(b){throw this.handleError(b)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let w=this.result.opts,b=o;w.syntax&&(b=w.syntax.stringify),w.stringifier&&(b=w.stringifier),b.stringify&&(b=b.stringify);let R=this.result.root.source;if(w.map===void 0&&!(R&&R.input&&R.input.map)){let C="";return b(this.result.root,N=>{C+=N}),this.result.css=C,this.result}let I=new r(b,this.result.root,this.result.opts).generate();return this.result.css=I[0],this.result.map=I[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 w of this.plugins){let b=this.runOnRoot(w);if(p(b))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let w=this.result.root;for(;!w[l];)w[l]=!0,this.walkSync(w);if(this.listeners.OnceExit)if(w.type==="document")for(let b of w.nodes)this.visitSync(this.listeners.OnceExit,b);else this.visitSync(this.listeners.OnceExit,w)}return this.result}then(w,b){return process.env.NODE_ENV!=="production"&&("from"in this.opts||a("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(w,b)}toString(){return this.css}visitSync(w,b){for(let[R,E]of w){this.result.lastPlugin=R;let I;try{I=E(b,this.helpers)}catch(C){throw this.handleError(C,b.proxyOf)}if(b.type!=="root"&&b.type!=="document"&&!b.parent)return!0;if(p(I))throw this.getAsyncError()}}visitTick(w){let b=w[w.length-1],{node:R,visitors:E}=b;if(R.type!=="root"&&R.type!=="document"&&!R.parent){w.pop();return}if(E.length>0&&b.visitorIndex<E.length){let[C,N]=E[b.visitorIndex];b.visitorIndex+=1,b.visitorIndex===E.length&&(b.visitors=[],b.visitorIndex=0),this.result.lastPlugin=C;try{return N(R.toProxy(),this.helpers)}catch(G){throw this.handleError(G,R)}}if(b.iterator!==0){let C=b.iterator;b.descending&&(b.descending=!1,R.indexes[C]+=1);let N;for(;N=R.nodes[R.indexes[C]];){if(!N[l]){N[l]=!0,b.descending=!0,w.push(g(N));return}R.indexes[C]+=1}b.iterator=0,delete R.indexes[C]}let I=b.events;for(;b.eventIndex<I.length;){let C=I[b.eventIndex];if(b.eventIndex+=1,C===d){R.nodes&&R.nodes.length&&(R[l]=!0,b.iterator=R.getIterator());return}else if(this.listeners[C]){b.visitors=this.listeners[C];return}}w.pop()}walkSync(w){w[l]=!0;let b=[{eventIndex:0,events:m(w),iterator:0,node:w}];for(;b.length>0;){let R=b[b.length-1],E=R.node;if(R.iterator!==0){let I=R.iterator;R.descending&&(R.descending=!1,E.indexes[I]+=1);let C,N=!1;for(;C=E.nodes[E.indexes[I]];){if(!C[l]){C[l]=!0,R.descending=!0,b.push({eventIndex:0,events:m(C),iterator:0,node:C}),N=!0;break}E.indexes[I]+=1}if(N)continue;R.iterator=0,delete E.indexes[I]}if(R.eventIndex<R.events.length){let I=R.events[R.eventIndex];if(R.eventIndex+=1,I===d)E.nodes&&E.nodes.length&&(R.iterator=E.getIterator());else{let C=this.listeners[I];C&&this.visitSync(C,E.toProxy())&&b.pop()}continue}b.pop()}}warnings(){return this.sync().warnings()}}return S.registerPostcss=_=>{y=_},Ma=S,S.default=S,s.registerLazyResult(S),t.registerLazyResult(S),Ma}var Aa,bh;function l0(){if(bh)return Aa;bh=1;let e=ah(),t=Va(),r=Wa(),n=Zi(),i=mh();class s{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 l,u=t;try{l=u(this._css,this._opts)}catch(a){this.error=a}if(this.error)throw this.error;return this._root=l,l}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(l,u,a){u=u.toString(),this.stringified=!1,this._processor=l,this._css=u,this._opts=a,this._map=void 0;let h=n;this.result=new r(this._processor,void 0,this._opts),this.result.css=u;let c=this;Object.defineProperty(this.result,"root",{get(){return c.root}});let f=new e(h,void 0,this._opts,u);if(f.isMap()){let[d,p]=f.generate();d&&(this.result.css=d),p&&(this.result.map=p)}else f.clearAnnotation(),this.result.css=f.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(l){return this.async().catch(l)}finally(l){return this.async().then(l,l)}sync(){if(this.error)throw this.error;return this.result}then(l,u){return process.env.NODE_ENV!=="production"&&("from"in this._opts||i("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(l,u)}toString(){return this._css}warnings(){return[]}}return Aa=s,s.default=s,Aa}var Ua,vh;function u0(){if(vh)return Ua;vh=1;let e=wa(),t=yh(),r=l0(),n=mn();class i{constructor(o=[]){this.version="8.5.26",this.plugins=this.normalize(o)}normalize(o){let l=[];for(let u of o)if(u.postcss===!0?u=u():u.postcss&&(u=u.postcss),typeof u=="object"&&Array.isArray(u.plugins))l=l.concat(u.plugins);else if(typeof u=="object"&&u.postcssPlugin)l.push(u);else if(typeof u=="function")l.push(u);else if(typeof u=="object"&&(u.parse||u.stringify)){if(process.env.NODE_ENV!=="production")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.")}else throw new Error(u+" is not a PostCSS plugin");return l}process(o,l={}){return!this.plugins.length&&!l.parser&&!l.stringifier&&!l.syntax?new r(this,o,l):new t(this,o,l)}use(o){return this.plugins=this.plugins.concat(this.normalize([o])),this}}return Ua=i,i.default=i,n.registerProcessor(i),e.registerProcessor(i),Ua}var Da,Sh;function c0(){if(Sh)return Da;Sh=1;let e=va(),t=Oi(),r=Yt(),n=da(),i=Gi(),s=wa(),o=s0(),l=Vi(),u=yh(),a=nh(),h=Ni(),c=Va(),f=u0(),d=Wa(),p=mn(),m=Za(),g=Zi(),v=hh();function y(...S){return S.length===1&&Array.isArray(S[0])&&(S=S[0]),new f(S)}return y.plugin=function(_,w){let b=!1;function R(...I){console&&console.warn&&!b&&(b=!0,console.warn(_+`: postcss.plugin was deprecated. Migration guide:
|
|
110
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(_+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
111
|
+
https://www.w3ctech.com/topic/2226`));let C=w(...I);return C.postcssPlugin=_,C.postcssVersion=new f().version,C}let E;return Object.defineProperty(R,"postcss",{get(){return E||(E=R()),E}}),R.process=function(I,C,N){return y([R(N)]).process(I,C)},R},y.stringify=g,y.parse=c,y.fromJSON=o,y.list=a,y.comment=S=>new t(S),y.atRule=S=>new e(S),y.decl=S=>new i(S),y.rule=S=>new m(S),y.root=S=>new p(S),y.document=S=>new s(S),y.CssSyntaxError=n,y.Declaration=i,y.Container=r,y.Processor=f,y.Document=s,y.Comment=t,y.Warning=v,y.AtRule=e,y.Result=d,y.Input=l,y.Rule=m,y.Root=p,y.Node=h,u.registerPostcss(y),Da=y,y.default=y,Da}c0();class Fa{constructor(...t){st(this,"parentElement",null),st(this,"parentNode",null),st(this,"ownerDocument"),st(this,"firstChild",null),st(this,"lastChild",null),st(this,"previousSibling",null),st(this,"nextSibling",null),st(this,"ELEMENT_NODE",1),st(this,"TEXT_NODE",3),st(this,"nodeType"),st(this,"nodeName"),st(this,"RRNodeType")}get childNodes(){const t=[];let r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof Fa){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}Date.now().toString();const ki=new Map,wh=new WeakSet;function Rh(e){return e!==null&&typeof e=="object"&&"complete"in e&&"naturalWidth"in e&&"naturalHeight"in e&&"src"in e&&"onload"in e}function d0(e){if(wh.has(e))return;wh.add(e);const t=e.drawImage.bind(e);e.drawImage=function(r,...n){const i=ki.get(e);i&&(i.cancelled=!0);const s=()=>{n.length===2&&Rh(r)&&n.push(r.naturalWidth||r.width,r.naturalHeight||r.height),t(r,...n)};if(Rh(r)&&!r.complete){const o={cancelled:!1};ki.set(e,o);const l=()=>{o.cancelled||(ki.delete(e),s())},u=()=>{if(!o.cancelled){ki.delete(e);try{s()}catch(a){}}};r.onload=l,r.onerror=u}else s()}}const _h={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Th={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Xi={},Eh={},h0=()=>!!globalThis.Zone;function Ja(e){if(Xi[e])return Xi[e];const t=globalThis[e],r=t.prototype,n=e in _h?_h[e]:void 0,i=!!(n&&n.every(l=>{var u,a;return!!((a=(u=Object.getOwnPropertyDescriptor(r,l))==null?void 0:u.get)!=null&&a.toString().includes("[native code]"))})),s=e in Th?Th[e]:void 0,o=!!(s&&s.every(l=>{var u;return typeof r[l]=="function"&&((u=r[l])==null?void 0:u.toString().includes("[native code]"))}));if(i&&o&&!h0())return Xi[e]=t.prototype,t.prototype;try{const l=document.createElement("iframe");l.style.display="none",document.body.appendChild(l);const u=l.contentWindow;if(!u)return t.prototype;const a=u[e].prototype;if(!a)return l.remove(),r;const h=navigator.userAgent;return h.includes("Safari")&&!h.includes("Chrome")?(l.classList.add("rr-block"),l.setAttribute("__rrwebUntaintedMutationObserver",""),Eh[e]=()=>l.remove()):l.remove(),Xi[e]=a}catch(l){return r}}const Ha={};function Gt(e,t,r){var n;const i=`${e}.${String(r)}`;if(Ha[i])return Ha[i].call(t);const s=Ja(e),o=(n=Object.getOwnPropertyDescriptor(s,r))==null?void 0:n.get;return o?(Ha[i]=o,o.call(t)):t[r]}const Ya={};function Ih(e,t,r){const n=`${e}.${String(r)}`;if(Ya[n])return Ya[n].bind(t);const s=Ja(e)[r];return typeof s!="function"?t[r]:(Ya[n]=s,s.bind(t))}function f0(e){return Gt("Node",e,"ownerDocument")}function p0(e){return Gt("Node",e,"childNodes")}function m0(e){return Gt("Node",e,"parentNode")}function g0(e){return Gt("Node",e,"parentElement")}function y0(e){return Gt("Node",e,"textContent")}function b0(e,t){return Ih("Node",e,"contains")(t)}function v0(e){return Ih("Node",e,"getRootNode")()}function S0(e){return!e||!("host"in e)?null:Gt("ShadowRoot",e,"host")}function w0(e){return e.styleSheets}function R0(e){return!e||!("shadowRoot"in e)?null:Gt("Element",e,"shadowRoot")}function _0(e,t){return Gt("Element",e,"querySelector")(t)}function T0(e,t){return Gt("Element",e,"querySelectorAll")(t)}function Ch(){var e;return[Ja("MutationObserver").constructor,(e=Eh.MutationObserver)!=null?e:()=>{}]}let gn=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(gn=()=>new Date().getTime());function cr(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(n){return()=>{}}}const oe={ownerDocument:f0,childNodes:p0,parentNode:m0,parentElement:g0,textContent:y0,contains:b0,getRootNode:v0,host:S0,styleSheets:w0,shadowRoot:R0,querySelector:_0,querySelectorAll:T0,nowTimestamp:gn,mutationObserverCtor:Ch,patch:cr,wrapCanvasContextDrawImage:d0};function He(e,t,r=document){const n={capture:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const Mr=`Please stop import mirror directly. Instead of that,\r
|
|
112
|
+
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
113
|
+
or you can use record.mirror to access the mirror instance during recording.`;let Zh={map:{},getId(){return console.error(Mr),-1},getNode(){return console.error(Mr),null},removeNodeFromMap(){console.error(Mr)},has(){return console.error(Mr),!1},reset(){console.error(Mr)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Zh=new Proxy(Zh,{get(e,t,r){return t==="map"&&console.error(Mr),Reflect.get(e,t,r)}}));function yn(e,t,r={}){let n=null,i=0;return function(...s){const o=Date.now();!i&&r.leading===!1&&(i=o);const l=t-(o-i),u=this;l<=0||l>t?(n&&(clearTimeout(n),n=null),i=o,e.apply(u,s)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{i=r.leading===!1?0:Date.now(),n=null,e.apply(u,s)},l))}}function Wi(e,t,r,n,i=window){const s=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(o){setTimeout(()=>{r.set.call(this,o)},0),s&&s.set&&s.set.call(this,o)}}),()=>Wi(e,t,s||{},!0)}function Lh(e){var t,r,n,i;const s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:s.documentElement.scrollLeft||(s==null?void 0:s.body)&&((t=oe.parentElement(s.body))==null?void 0:t.scrollLeft)||((r=s==null?void 0:s.body)==null?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(s==null?void 0:s.documentElement.scrollTop)||(s==null?void 0:s.body)&&((n=oe.parentElement(s.body))==null?void 0:n.scrollTop)||((i=s==null?void 0:s.body)==null?void 0:i.scrollTop)||0}}function xh(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Nh(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Oh(e){return e?e.nodeType===e.ELEMENT_NODE?e:oe.parentElement(e):null}const E0=e=>{try{if(e instanceof HTMLElement)return e.tagName==="CANVAS"}catch(t){return!1}return!1};function Ue(e,t,r,n){if(!e)return!1;const i=Oh(e);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||n&&i.closest("."+t)!==null)return!0}else if(bi(i,t,n))return!0}catch(s){}return!!(r&&(i.matches(r)||n&&i.closest(r)!==null))}function I0(e,t){return t.getId(e)!==-1}function Ba(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===fn}function Gh(e,t){if(dn(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const n=oe.parentNode(e);return n&&n.nodeType===e.DOCUMENT_NODE?!1:n?Gh(n,t):!0}function za(e){return!!e.changedTouches}function C0(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)}function Vh(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function kh(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ka(e){return e?e instanceof Fa&&"shadowRoot"in e?!!e.shadowRoot:!!oe.shadowRoot(e):!1}class Z0{constructor(){X(this,"id",1),X(this,"styleIDMap",new WeakMap),X(this,"idStyleMap",new Map)}getId(t){var r;return(r=this.styleIDMap.get(t))!=null?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Xh(e){var t;let r=null;return"getRootNode"in e&&((t=oe.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&oe.host(oe.getRootNode(e))&&(r=oe.host(oe.getRootNode(e))),r}function L0(e){let t=e,r;for(;r=Xh(t);)t=r;return t}function x0(e){const t=oe.ownerDocument(e);if(!t)return!1;const r=L0(e);return oe.contains(t,r)}function Wh(e){const t=oe.ownerDocument(e);return t?oe.contains(t,e)||x0(e):!1}var me=(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[e.Asset=7]="Asset",e))(me||{}),ce=(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[e.CustomElement=16]="CustomElement",e))(ce||{}),qe=(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))(qe||{}),Bt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Bt||{}),Ar=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ar||{}),Ur=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Ur||{}),Ph=(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",e))(Ph||{});function Mh(e){return"__ln"in e}class N0{constructor(){X(this,"length",0),X(this,"head",null),X(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=(r==null?void 0:r.next)||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&Mh(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&Mh(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){const r=t.__ln;this.head&&(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const Ah=(e,t)=>`${e}@${t}`;class O0{constructor(){X(this,"frozen",!1),X(this,"locked",!1),X(this,"texts",[]),X(this,"attributes",[]),X(this,"attributeMap",new WeakMap),X(this,"removes",[]),X(this,"mapRemoves",[]),X(this,"movedMap",{}),X(this,"addedSet",new Set),X(this,"movedSet",new Set),X(this,"droppedSet",new Set),X(this,"removesSubTreeCache",new Set),X(this,"mutationCb"),X(this,"blockClass"),X(this,"blockSelector"),X(this,"maskTextClass"),X(this,"maskTextSelector"),X(this,"inlineStylesheet"),X(this,"maskInputOptions"),X(this,"maskTextFn"),X(this,"maskInputFn"),X(this,"keepIframeSrcFn"),X(this,"recordCanvas"),X(this,"inlineImages"),X(this,"inlineVideos"),X(this,"privacySetting"),X(this,"slimDOMOptions"),X(this,"dataURLOptions"),X(this,"doc"),X(this,"mirror"),X(this,"iframeManager"),X(this,"stylesheetManager"),X(this,"shadowDomManager"),X(this,"canvasManager"),X(this,"processedNodeManager"),X(this,"unattachedDoc"),X(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),X(this,"emit",()=>{if(this.frozen||this.locked)return;const t=[],r=new Set,n=new N0,i=u=>{let a=u,h=fn;for(;h===fn;)a=a&&a.nextSibling,h=a&&this.mirror.getId(a);return h},s=u=>{const a=oe.parentNode(u);if(!a||!Wh(u))return;let h=!1;if(u.nodeType===Node.TEXT_NODE){const p=a.tagName;if(p==="TEXTAREA")return;p==="STYLE"&&this.addedSet.has(a)&&(h=!0)}const c=dn(a)?this.mirror.getId(Xh(u)):this.mirror.getId(a),f=i(u);if(c===-1||f===-1)return n.addNode(u);const d=Pr(u,{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,inlineVideos:this.inlineVideos,privacySetting:this.privacySetting,onSerialize:p=>{Vh(p,this.mirror)&&this.iframeManager.addIframe(p),kh(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Ka(u)&&this.shadowDomManager.addShadowRoot(oe.shadowRoot(u),this.doc)},onIframeLoad:(p,m)=>{this.iframeManager.attachIframe(p,m),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,m)=>{this.stylesheetManager.attachLinkElement(p,m)},cssCaptured:h});d&&(t.push({parentId:c,nextId:f,node:d}),r.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const u of this.movedSet)Uh(this.removesSubTreeCache,u)&&!this.movedSet.has(oe.parentNode(u))||s(u);for(const u of this.addedSet)!Dh(this.droppedSet,u)&&!Uh(this.removesSubTreeCache,u)||Dh(this.movedSet,u)?s(u):this.droppedSet.add(u);let o=null;for(;n.length;){let u=null;if(o){const a=this.mirror.getId(oe.parentNode(o.value)),h=i(o.value);a!==-1&&h!==-1&&(u=o)}if(!u){let a=n.tail;for(;a;){const h=a;if(a=a.previous,h){const c=this.mirror.getId(oe.parentNode(h.value));if(i(h.value)===-1)continue;if(c!==-1){u=h;break}else{const d=h.value,p=oe.parentNode(d);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const m=oe.host(p);if(this.mirror.getId(m)!==-1){u=h;break}}}}}}if(!u){for(;n.head;)n.removeNode(n.head.value);break}o=u.previous,n.removeNode(u.value),s(u.value)}const l={texts:this.texts.map(u=>{var a,h;const c=u.node,f=oe.parentNode(c);f&&f.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(f);let d=u.value;const p=this.privacySetting==="strict",m=this.privacySetting==="default"&&Bc(d),g=(h=(a=u.node)==null?void 0:a.parentElement)==null?void 0:h.getAttribute("data-hl-record");return(p||m)&&!g&&d&&(d=Zo(d)),{id:this.mirror.getId(c),value:d}}).filter(u=>!r.has(u.id)).filter(u=>this.mirror.has(u.id)),attributes:this.attributes.map(u=>{const{attributes:a}=u;if(typeof a.style=="string"){const h=JSON.stringify(u.styleDiff),c=JSON.stringify(u._unchangedStyles);h.length<a.style.length&&(h+c).split("var(").length===a.style.split("var(").length&&(a.style=u.styleDiff)}return{id:this.mirror.getId(u.node),attributes:a}}).filter(u=>!r.has(u.id)).filter(u=>this.mirror.has(u.id)),removes:this.removes,adds:t};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(l))}),X(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));const n=Array.from(oe.childNodes(t),i=>oe.textContent(i)||"").join("");r.attributes.value=pi({overwriteRecord:null,element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:mi(t),value:n,maskInputFn:this.maskInputFn})}),X(this,"processMutation",t=>{if(!Ba(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const r=oe.textContent(t.target);!Ue(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:td(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,Oh(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.attributeName,i=t.target.getAttribute(n);if(n==="value"){const o=mi(r);i=pi({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:i,overwriteRecord:r.getAttribute("data-hl-record"),maskInputFn:this.maskInputFn})}if(Ue(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;let s=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(i))if(!r.contentDocument)n="rr_src";else return;if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!qc(r.tagName,n)){if(t.target.tagName==="INPUT"){const l=t.target;if(l.type==="password"){s.attributes.value="*".repeat(l.value.length);break}}if(s.attributes[n]=$c(this.doc,ur(r.tagName),ur(n),i),n==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(u){this.unattachedDoc=this.doc}const l=this.unattachedDoc.createElement("span");t.oldValue&&l.setAttribute("style",t.oldValue);for(const u of Array.from(r.style)){const a=r.style.getPropertyValue(u),h=r.style.getPropertyPriority(u);a!==l.style.getPropertyValue(u)||h!==l.style.getPropertyPriority(u)?h===""?s.styleDiff[u]=a:s.styleDiff[u]=[a,h]:s._unchangedStyles[u]=[a,h]}for(const u of Array.from(l.style))r.style.getPropertyValue(u)===""&&(s.styleDiff[u]=!1)}else n==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal")}break}case"childList":{if(Ue(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),i=dn(t.target)?this.mirror.getId(oe.host(t.target)):this.mirror.getId(t.target);Ue(t.target,this.blockClass,this.blockSelector,!1)||Ba(r,this.mirror,this.slimDOMOptions)||!I0(r,this.mirror)||(this.addedSet.has(r)?(ja(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||Gh(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[Ah(n,i)]?ja(this.movedSet,r):(this.removes.push({parentId:i,id:n,isShadow:dn(t.target)&&hn(t.target)?!0:void 0}),G0(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),X(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Ba(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[Ah(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ue(t,this.blockClass,this.blockSelector,!1)||(oe.childNodes(t).forEach(n=>this.genAdds(n)),Ka(t)&&oe.childNodes(oe.shadowRoot(t)).forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","inlineVideos","privacySetting","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}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 ja(e,t){e.delete(t),oe.childNodes(t).forEach(r=>ja(e,r))}function G0(e,t){const r=[e];for(;r.length;){const n=r.pop();t.has(n)||(t.add(n),oe.childNodes(n).forEach(i=>r.push(i)))}}function Uh(e,t,r){return e.size===0?!1:V0(e,t)}function V0(e,t,r){const n=oe.parentNode(t);return n?e.has(n):!1}function Dh(e,t){return e.size===0?!1:Fh(e,t)}function Fh(e,t){const r=oe.parentNode(t);return r?e.has(r)?!0:Fh(e,r):!1}let bn;function k0(e){bn=e}function X0(){bn=void 0}const de=e=>bn?(...r)=>{try{return e(...r)}catch(n){if(bn&&bn(n)===!0)return;throw n}}:e,dr=[];function vn(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]}catch(t){}return e&&e.target}function Jh(e,t){const r=new O0;dr.push(r),r.init(e);const[n,i]=Ch(),s=new n(de(r.processMutations.bind(r)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[s,i]}function W0({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const i=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let o=[],l;const u=yn(de(c=>{const f=Date.now()-l;e(o.map(d=>(d.timeOffset-=f,d)),c),o=[],l=null}),s),a=de(yn(de(c=>{const f=vn(c),{clientX:d,clientY:p}=za(c)?c.changedTouches[0]:c;l||(l=gn()),o.push({x:d,y:p,id:n.getId(f),timeOffset:gn()-l}),u(typeof DragEvent!="undefined"&&c instanceof DragEvent?ce.Drag:c instanceof MouseEvent?ce.MouseMove:ce.TouchMove)}),i,{trailing:!1})),h=[He("mousemove",a,r),He("touchmove",a,r),He("drag",a,r)];return de(()=>{h.forEach(c=>c())})}function P0({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:s}){if(s.mouseInteraction===!1)return()=>{};const o=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,l=[];let u=null;const a=h=>c=>{const f=vn(c);if(Ue(f,n,i,!0)||E0(f))return;let d=null,p=h;if("pointerType"in c){switch(c.pointerType){case"mouse":d=Bt.Mouse;break;case"touch":d=Bt.Touch;break;case"pen":d=Bt.Pen;break}d===Bt.Touch&&(qe[h]===qe.MouseDown?p="TouchStart":qe[h]===qe.MouseUp&&(p="TouchEnd"))}else za(c)&&(d=Bt.Touch);d!==null?(u=d,(p.startsWith("Touch")&&d===Bt.Touch||p.startsWith("Mouse")&&d===Bt.Mouse)&&(d=null)):qe[h]===qe.Click&&(d=u,u=null);const m=za(c)?c.changedTouches[0]:c;if(!m)return;const g=r.getId(f),{clientX:v,clientY:y}=m;de(e)(x({type:qe[p],id:g,x:v,y},d!==null&&{pointerType:d}))};return Object.keys(qe).filter(h=>Number.isNaN(Number(h))&&!h.endsWith("_Departed")&&o[h]!==!1).forEach(h=>{let c=ur(h);const f=a(h);if(window.PointerEvent)switch(qe[h]){case qe.MouseDown:case qe.MouseUp:c=c.replace("mouse","pointer");break;case qe.TouchStart:case qe.TouchEnd:return}l.push(He(c,f,t))}),de(()=>{l.forEach(h=>h())})}function Hh({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,sampling:s}){const o=de(yn(de(l=>{const u=vn(l);if(!u||Ue(u,n,i,!0))return;const a=r.getId(u);if(u===t&&t.defaultView){const h=Lh(t.defaultView);e({id:a,x:h.left,y:h.top})}else e({id:a,x:u.scrollLeft,y:u.scrollTop})}),s.scroll||100));return He("scroll",o,t)}function M0({viewportResizeCb:e},{win:t}){let r=-1,n=-1;const i=de(yn(de(()=>{const s=xh(),o=Nh();(r!==s||n!==o)&&(e({width:Number(o),height:Number(s)}),r=s,n=o)}),200));return He("resize",i,t)}const A0=["INPUT","TEXTAREA","SELECT"],Yh=new WeakMap;function U0({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:i,ignoreClass:s,ignoreSelector:o,maskInputOptions:l,maskInputFn:u,sampling:a,userTriggeredOnInput:h}){function c(y){let S=vn(y);const _=y.isTrusted,w=S&&S.tagName;if(S&&w==="OPTION"&&(S=oe.parentElement(S)),!S||!w||A0.indexOf(w)<0||Ue(S,n,i,!0)||S.classList.contains(s)||o&&S.matches(o))return;let b=S.value,R=!1;const E=mi(S)||"",I=S.getAttribute("data-hl-record");E==="radio"||E==="checkbox"?R=S.checked:zc({maskInputOptions:l,type:E,tagName:w,overwriteRecord:I})&&(b=pi({element:S,maskInputOptions:l,tagName:w,type:E,value:b,overwriteRecord:I,maskInputFn:u})),f(S,h?{text:b,isChecked:R,userTriggered:_}:{text:b,isChecked:R});const C=S.name;E==="radio"&&C&&R&&t.querySelectorAll(`input[type="radio"][name="${C}"]`).forEach(N=>{if(N!==S){const G=N.value;f(N,h?{text:G,isChecked:!R,userTriggered:!1}:{text:G,isChecked:!R})}})}function f(y,S){const _=Yh.get(y);if(!_||_.text!==S.text||_.isChecked!==S.isChecked){Yh.set(y,S);const w=r.getId(y);de(e)(B(x({},S),{id:w}))}}const p=(a.input==="last"?["change"]:["input","change"]).map(y=>He(y,de(c),t)),m=t.defaultView;if(!m)return()=>{p.forEach(y=>y())};const g=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),v=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push(...v.map(y=>Wi(y[0],y[1],{set(){de(c)({target:this,isTrusted:!1})}},!1,m))),de(()=>{p.forEach(y=>y())})}function Pi(e){const t=[];function r(n,i){if(Mi("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Mi("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Mi("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Mi("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){const o=Array.from(n.parentRule.cssRules).indexOf(n);return i.unshift(o),r(n.parentRule,i)}else if(n.parentStyleSheet){const o=Array.from(n.parentStyleSheet.cssRules).indexOf(n);i.unshift(o)}return i}return r(e,t)}function zt(e,t,r){let n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function Kt(e,t,r,n){e[t]===r&&(e[t]=n)}const D0=5;function F0({styleSheetRuleCb:e,mirror:t,stylesheetManager:r,doc:n,styleSheetResyncInterval:i},{win:s}){if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const o=new WeakMap,l=new WeakSet;let u=!1,a=!1,h=!1,c,f=!1,d=!1,p=!1;const m=(P,F)=>{const Y=o.get(P);Y&&(Y.reported=Math.max(0,Y.reported+F),Y.everSeen=Math.max(Y.everSeen,Y.reported))},g=P=>new Proxy(P,{apply:de((F,Y,j)=>{if(u)return a=!0,F.apply(Y,j);if(f||d)return F.apply(Y,j);const[ne,ae]=j,{id:ge,styleId:K}=zt(Y,t,r.styleMirror),le=ge&&ge!==-1||K&&K!==-1;le&&e({id:ge,styleId:K,adds:[{rule:ne,index:ae}]}),d=!0;let Te;try{Te=F.apply(Y,j)}finally{d=!1}return le&&m(Y,1),Te})}),v=P=>new Proxy(P,{apply:de((F,Y,j)=>{if(u)return h=!0,F.apply(Y,j);if(f||p)return F.apply(Y,j);const[ne]=j,{id:ae,styleId:ge}=zt(Y,t,r.styleMirror),K=ae&&ae!==-1||ge&&ge!==-1;K&&e({id:ae,styleId:ge,removes:[{index:ne}]}),p=!0;let le;try{le=F.apply(Y,j)}finally{p=!1}return K&&m(Y,-1),le})}),y=s.CSSStyleSheet.prototype.insertRule;let S=g(y),_=y;s.CSSStyleSheet.prototype.insertRule=S;const w=s.CSSStyleSheet.prototype.addRule,b=function(P,F,Y=this.cssRules.length){const j=`${P} { ${F} }`;return s.CSSStyleSheet.prototype.insertRule.apply(this,[j,Y])};s.CSSStyleSheet.prototype.addRule=b;const R=s.CSSStyleSheet.prototype.deleteRule;let E=v(R),I=R;s.CSSStyleSheet.prototype.deleteRule=E;const C=s.CSSStyleSheet.prototype.removeRule,N=function(P){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[P])};s.CSSStyleSheet.prototype.removeRule=N;let G,Q;s.CSSStyleSheet.prototype.replace&&(G=s.CSSStyleSheet.prototype.replace,Q=new Proxy(G,{apply:de((P,F,Y)=>{if(f)return P.apply(F,Y);const[j]=Y,{id:ne,styleId:ae}=zt(F,t,r.styleMirror);return(ne&&ne!==-1||ae&&ae!==-1)&&e({id:ne,styleId:ae,replace:j}),P.apply(F,Y)})}),s.CSSStyleSheet.prototype.replace=Q);let Z,T;s.CSSStyleSheet.prototype.replaceSync&&(Z=s.CSSStyleSheet.prototype.replaceSync,T=new Proxy(Z,{apply:de((P,F,Y)=>{if(f)return P.apply(F,Y);const[j]=Y,{id:ne,styleId:ae}=zt(F,t,r.styleMirror);return(ne&&ne!==-1||ae&&ae!==-1)&&e({id:ne,styleId:ae,replaceSync:j}),P.apply(F,Y)})}),s.CSSStyleSheet.prototype.replaceSync=T);const W={};Ai("CSSGroupingRule")?W.CSSGroupingRule=s.CSSGroupingRule:(Ai("CSSMediaRule")&&(W.CSSMediaRule=s.CSSMediaRule),Ai("CSSConditionRule")&&(W.CSSConditionRule=s.CSSConditionRule),Ai("CSSSupportsRule")&&(W.CSSSupportsRule=s.CSSSupportsRule));const k={},M={};Object.entries(W).forEach(([P,F])=>{k[P]={insertRule:F.prototype.insertRule,deleteRule:F.prototype.deleteRule},M[P]={},M[P].insertRule=new Proxy(k[P].insertRule,{apply:de((Y,j,ne)=>{if(f)return Y.apply(j,ne);const[ae,ge]=ne,{id:K,styleId:le}=zt(j.parentStyleSheet,t,r.styleMirror);return(K&&K!==-1||le&&le!==-1)&&e({id:K,styleId:le,adds:[{rule:ae,index:[...Pi(j),ge||0]}]}),Y.apply(j,ne)})}),M[P].deleteRule=new Proxy(k[P].deleteRule,{apply:de((Y,j,ne)=>{if(f)return Y.apply(j,ne);const[ae]=ne,{id:ge,styleId:K}=zt(j.parentStyleSheet,t,r.styleMirror);return(ge&&ge!==-1||K&&K!==-1)&&e({id:ge,styleId:K,removes:[{index:[...Pi(j),ae]}]}),Y.apply(j,ne)})}),F.prototype.insertRule=M[P].insertRule,F.prototype.deleteRule=M[P].deleteRule});const D=()=>{u=!0,a=!1,h=!1;try{const P=c!=null?c:c=new s.CSSStyleSheet;P.insertRule(":root {}",0),P.deleteRule(0)}catch(P){return{insertRule:s.CSSStyleSheet.prototype.insertRule===S,deleteRule:s.CSSStyleSheet.prototype.deleteRule===E}}finally{u=!1}return{insertRule:a,deleteRule:h}};let U=0;const q=P=>{U>=D0||(U+=1,P.insertRule||(_=s.CSSStyleSheet.prototype.insertRule,S=g(_),s.CSSStyleSheet.prototype.insertRule=S),P.deleteRule||(I=s.CSSStyleSheet.prototype.deleteRule,E=v(I),s.CSSStyleSheet.prototype.deleteRule=E))},fe=P=>{for(let F=0;F<n.styleSheets.length;F++){const Y=n.styleSheets[F];if(l.has(Y))continue;const j=Y.ownerNode;if(!j||ur(j.nodeName)!=="style"||(j.textContent||"").trim().length)continue;const ne=t.getId(j);if(!ne||ne===-1)continue;let ae;try{ae=Y.cssRules}catch(le){continue}const ge=ae.length;let K=o.get(Y);if(!K){if(Array.from(ae).some(le=>Fc(le))){l.add(Y);continue}if(K={reported:ge,everSeen:ge},o.set(Y,K),P)continue;O(ne,K,ae);continue}if(K.everSeen=Math.max(K.everSeen,ge),ge!==K.reported)if(ge>K.reported){const le=[];for(let Te=K.reported;Te<ge;Te++)le.push({rule:ae[Te].cssText,index:Te});e({id:ne,adds:le}),K.reported=ge}else O(ne,K,ae)}};function O(P,F,Y){const j=[];for(let ne=F.everSeen-1;ne>=0;ne--)j.push({index:ne});j.length&&e({id:P,removes:j}),e({id:P,adds:Array.from(Y,(ne,ae)=>({rule:ne.cssText,index:ae}))}),F.reported=Y.length,F.everSeen=Y.length}let pe;return i>0&&(pe=s.setInterval(de(()=>{const P=D(),F=P.insertRule&&P.deleteRule;F||q(P),fe(F)}),i)),de(()=>{pe!==void 0&&s.clearInterval(pe),f=!0;const P=s.CSSStyleSheet.prototype;Kt(P,"insertRule",S,_),Kt(P,"deleteRule",E,I),Kt(P,"addRule",b,w),Kt(P,"removeRule",N,C),Q&&Kt(P,"replace",Q,G),T&&Kt(P,"replaceSync",T,Z),Object.entries(W).forEach(([F,Y])=>{Kt(Y.prototype,"insertRule",M[F].insertRule,k[F].insertRule),Kt(Y.prototype,"deleteRule",M[F].deleteRule,k[F].deleteRule)})})}function Bh({mirror:e,stylesheetManager:t},r){var n,i,s;let o=null;r.nodeName==="#document"?o=e.getId(r):o=e.getId(oe.host(r));const l=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(s=(i=r.ownerDocument)==null?void 0:i.defaultView)==null?void 0:s.ShadowRoot,u=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!u?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var a;return(a=u.get)==null?void 0:a.call(this)},set(a){var h;const c=(h=u.set)==null?void 0:h.call(this,a);if(o!==null&&o!==-1)try{t.adoptStyleSheets(a,o)}catch(f){}return c}}),de(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))}function J0({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:i}){const s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:de((l,u,a)=>{var h;const[c,f,d]=a;if(r.has(c))return s.apply(u,[c,f,d]);const{id:p,styleId:m}=zt((h=u.parentRule)==null?void 0:h.parentStyleSheet,t,n.styleMirror);return(p&&p!==-1||m&&m!==-1)&&e({id:p,styleId:m,set:{property:c,value:f,priority:d},index:Pi(u.parentRule)}),l.apply(u,a)})});const o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:de((l,u,a)=>{var h;const[c]=a;if(r.has(c))return o.apply(u,[c]);const{id:f,styleId:d}=zt((h=u.parentRule)==null?void 0:h.parentStyleSheet,t,n.styleMirror);return(f&&f!==-1||d&&d!==-1)&&e({id:f,styleId:d,remove:{property:c},index:Pi(u.parentRule)}),l.apply(u,a)})}),de(()=>{i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=o})}function H0({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:i,doc:s}){const o=de(u=>yn(de(a=>{const h=vn(a);if(!h||Ue(h,t,r,!0))return;const{currentTime:c,volume:f,muted:d,playbackRate:p,loop:m}=h;e({type:u,id:n.getId(h),currentTime:c,volume:f,muted:d,playbackRate:p,loop:m})}),i.media||500)),l=[He("play",o(Ur.Play),s),He("pause",o(Ur.Pause),s),He("seeked",o(Ur.Seeked),s),He("volumechange",o(Ur.VolumeChange),s),He("ratechange",o(Ur.RateChange),s)];return de(()=>{l.forEach(u=>u())})}function Y0({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],i=new WeakMap,s=r.FontFace;r.FontFace=function(u,a,h){const c=new s(u,a,h);return i.set(c,{family:u,buffer:typeof a!="string",descriptors:h,fontSource:typeof a=="string"?a:JSON.stringify(Array.from(new Uint8Array(a)))}),c};const o=cr(t.fonts,"add",function(l){return function(u){return setTimeout(de(()=>{const a=i.get(u);a&&(e(a),i.delete(u))}),0),l.apply(this,[u])}});return n.push(()=>{r.FontFace=s}),n.push(o),de(()=>{n.forEach(l=>l())})}function B0(e){const{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:s}=e;let o=!0;const l=de(()=>{const u=t.getSelection();if(!u||o&&(u!=null&&u.isCollapsed))return;o=u.isCollapsed||!1;const a=[],h=u.rangeCount||0;for(let c=0;c<h;c++){const f=u.getRangeAt(c),{startContainer:d,startOffset:p,endContainer:m,endOffset:g}=f;Ue(d,n,i,!0)||Ue(m,n,i,!0)||a.push({start:r.getId(d),startOffset:p,end:r.getId(m),endOffset:g})}s({ranges:a})});return l(),He("selectionchange",l)}function z0({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:cr(r.customElements,"define",function(i){return function(s,o,l){try{t({define:{name:s}})}catch(u){console.warn(`Custom element callback failed for ${s}`)}return i.apply(this,[s,o,l])}})}function K0(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:s,viewportResizeCb:o,inputCb:l,mediaInteractionCb:u,styleSheetRuleCb:a,styleDeclarationCb:h,canvasMutationCb:c,fontCb:f,selectionCb:d,customElementCb:p}=e;e.mutationCb=(...m)=>{t.mutation&&t.mutation(...m),r(...m)},e.mousemoveCb=(...m)=>{t.mousemove&&t.mousemove(...m),n(...m)},e.mouseInteractionCb=(...m)=>{t.mouseInteraction&&t.mouseInteraction(...m),i(...m)},e.scrollCb=(...m)=>{t.scroll&&t.scroll(...m),s(...m)},e.viewportResizeCb=(...m)=>{t.viewportResize&&t.viewportResize(...m),o(...m)},e.inputCb=(...m)=>{t.input&&t.input(...m),l(...m)},e.mediaInteractionCb=(...m)=>{t.mediaInteaction&&t.mediaInteaction(...m),u(...m)},e.styleSheetRuleCb=(...m)=>{t.styleSheetRule&&t.styleSheetRule(...m),a(...m)},e.styleDeclarationCb=(...m)=>{t.styleDeclaration&&t.styleDeclaration(...m),h(...m)},e.canvasMutationCb=(...m)=>{t.canvasMutation&&t.canvasMutation(...m),c(...m)},e.fontCb=(...m)=>{t.font&&t.font(...m),f(...m)},e.selectionCb=(...m)=>{t.selection&&t.selection(...m),d(...m)},e.customElementCb=(...m)=>{t.customElement&&t.customElement(...m),p(...m)}}function j0(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};K0(e,t);let n,i=()=>{};e.recordDOM&&([n,i]=Jh(e,e.doc));const s=W0(e),o=P0(e),l=Hh(e),u=M0(e,{win:r}),a=U0(e),h=H0(e);let c=()=>{},f=()=>{},d=()=>{},p=()=>{};e.recordDOM&&(c=F0(e,{win:r}),f=Bh(e,e.doc),d=J0(e,{win:r}),e.collectFonts&&(p=Y0(e)));const m=B0(e),g=z0(e),v=[];for(const y of e.plugins)v.push(y.observer(y.callback,r,y.options));return de(()=>{dr.forEach(y=>y.reset()),n==null||n.disconnect(),i(),s(),o(),l(),u(),a(),h(),c(),f(),d(),p(),m(),g(),v.forEach(y=>y())})}function Mi(e){return typeof window[e]!="undefined"}function Ai(e){return!!(typeof window[e]!="undefined"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class zh{constructor(t){X(this,"iframeIdToRemoteIdMap",new WeakMap),X(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,n,i){const s=n||this.getIdToRemoteIdMap(t),o=i||this.getRemoteIdToIdMap(t);let l=s.get(r);return l||(l=this.generateIdFn(),s.set(r,l),o.set(l,r)),l}getIds(t,r){const n=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return r.map(s=>this.getId(t,s,n,i))}getRemoteId(t,r,n){const i=n||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;const s=i.get(r);return s||-1}getRemoteIds(t,r){const n=this.getRemoteIdToIdMap(t);return r.map(i=>this.getRemoteId(t,i,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}}class Q0{constructor(t){X(this,"iframes",new WeakMap),X(this,"crossOriginIframeMap",new WeakMap),X(this,"crossOriginIframeMirror",new zh(Kc)),X(this,"crossOriginIframeStyleMirror"),X(this,"crossOriginIframeRootIdMap",new WeakMap),X(this,"mirror"),X(this,"mutationCb"),X(this,"wrappedEmit"),X(this,"loadListener"),X(this,"stylesheetManager"),X(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new zh(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var n,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((n=t.contentWindow)==null||n.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin)return;const n=t.source;if(!n)return;const i=this.crossOriginIframeMap.get(n);if(!i)return;const s=this.transformCrossOriginEvent(i,r.data.event);s&&this.wrappedEmit(s,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case me.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const i=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(r.data.node,i),{timestamp:r.timestamp,type:me.IncrementalSnapshot,data:{source:ce.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case me.Meta:case me.Load:case me.DomContentLoaded:return!1;case me.Plugin:return r;case me.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case me.IncrementalSnapshot:switch(r.data.source){case ce.Mutation:return r.data.adds.forEach(i=>{this.replaceIds(i,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,t);const s=this.crossOriginIframeRootIdMap.get(t);s&&this.patchRootIdOnNode(i.node,s)}),r.data.removes.forEach(i=>{this.replaceIds(i,t,["parentId","id"])}),r.data.attributes.forEach(i=>{this.replaceIds(i,t,["id"])}),r.data.texts.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case ce.Drag:case ce.TouchMove:case ce.MouseMove:return r.data.positions.forEach(i=>{this.replaceIds(i,t,["id"])}),r;case ce.ViewportResize:return!1;case ce.MediaInteraction:case ce.MouseInteraction:case ce.Scroll:case ce.CanvasMutation:case ce.Input:return this.replaceIds(r.data,t,["id"]),r;case ce.StyleSheetRule:case ce.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case ce.Font:return r;case ce.Selection:return r.data.ranges.forEach(i=>{this.replaceIds(i,t,["start","end"])}),r;case ce.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(i=>{this.replaceStyleIds(i,t,["styleId"])}),r}}return!1}replace(t,r,n,i){for(const s of i)!Array.isArray(r[s])&&typeof r[s]!="number"||(Array.isArray(r[s])?r[s]=t.getIds(n,r[s]):r[s]=t.getId(n,r[s]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==Ph.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}}class $0{constructor(t){X(this,"shadowDoms",new WeakSet),X(this,"mutationCb"),X(this,"scrollCb"),X(this,"bypassOptions"),X(this,"mirror"),X(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!hn(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const[n]=Jh(B(x({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Hh(B(x({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(oe.host(t))),this.restoreHandlers.push(Bh({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){const n=this;this.restoreHandlers.push(cr(t.prototype,"attachShadow",function(i){return function(s){const o=i.call(this,s),l=oe.shadowRoot(this);return l&&Wh(this)&&n.addShadowRoot(l,r),o}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch(r){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Dr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",q0=typeof Uint8Array=="undefined"?[]:new Uint8Array(256),Ui=0;Ui<Dr.length;Ui++)q0[Dr.charCodeAt(Ui)]=Ui;var eS=function(e){var t=new Uint8Array(e),r,n=t.length,i="";for(r=0;r<n;r+=3)i+=Dr[t[r]>>2],i+=Dr[(t[r]&3)<<4|t[r+1]>>4],i+=Dr[(t[r+1]&15)<<2|t[r+2]>>6],i+=Dr[t[r+2]&63];return n%3===2?i=i.substring(0,i.length-1)+"=":n%3===1&&(i=i.substring(0,i.length-2)+"=="),i};const Kh=new Map;function tS(e,t){let r=Kh.get(e);return r||(r=new Map,Kh.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const jh=(e,t,r)=>{if(!e||!($h(e,t)||typeof e=="object"))return;const n=e.constructor.name,i=tS(r,n);let s=i.indexOf(e);return s===-1&&(s=i.length,i.push(e)),s};function Di(e,t,r){if(e instanceof Array)return e.map(n=>Di(n,t,r));if(e===null)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 n=e.constructor.name,i=eS(e);return{rr_type:n,base64:i}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Di(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",i=e.toDataURL();return{rr_type:n,src:i}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Di(e.data,t,r),e.width,e.height]};if($h(e,t)||typeof e=="object"){const n=e.constructor.name,i=jh(e,t,r);return{rr_type:n,index:i}}}}return e}const Qh=(e,t,r)=>e.map(n=>Di(n,t,r)),$h=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof t[i]=="function").find(i=>e instanceof t[i]);function rS(e,t,r,n){const i=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const o of s)try{if(typeof t.CanvasRenderingContext2D.prototype[o]!="function")continue;const l=cr(t.CanvasRenderingContext2D.prototype,o,function(u){return function(...a){return Ue(this.canvas,r,n,!0)||setTimeout(()=>{const h=Qh(a,t,this);e(this.canvas,{type:Ar["2D"],property:o,args:h})},0),u.apply(this,a)}});i.push(l)}catch(l){const u=Wi(t.CanvasRenderingContext2D.prototype,o,{set(a){e(this.canvas,{type:Ar["2D"],property:o,args:[a],setter:!0})}});i.push(u)}return()=>{i.forEach(o=>o())}}function nS(e){return e==="experimental-webgl"?"webgl":e}function qh(e,t,r,n){const i=[];try{const s=cr(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...u){if(!Ue(this,t,r,!0)){const a=nS(l);if("__context"in this||(this.__context=a),n&&["webgl","webgl2"].includes(a))if(u[0]&&typeof u[0]=="object"){const h=u[0];h.preserveDrawingBuffer||(h.preserveDrawingBuffer=!0)}else u.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...u])}});i.push(s)}catch(s){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(s=>s())}}function ef(e,t,r,n,i,s){const o=[],l=Object.getOwnPropertyNames(e);for(const u of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))try{if(typeof e[u]!="function")continue;const a=cr(e,u,function(h){return function(...c){const f=h.apply(this,c);if(jh(f,s,this),"tagName"in this.canvas&&!Ue(this.canvas,n,i,!0)){const d=Qh(c,s,this),p={type:t,property:u,args:d};r(this.canvas,p)}return f}});o.push(a)}catch(a){const h=Wi(e,u,{set(c){r(this.canvas,{type:t,property:u,args:[c],setter:!0})}});o.push(h)}return o}function iS(e,t,r,n){const i=[];return typeof t.WebGLRenderingContext!="undefined"&&i.push(...ef(t.WebGLRenderingContext.prototype,Ar.WebGL,e,r,n,t)),typeof t.WebGL2RenderingContext!="undefined"&&i.push(...ef(t.WebGL2RenderingContext.prototype,Ar.WebGL2,e,r,n,t)),()=>{i.forEach(s=>s())}}const tf=`(function() {
|
|
114
|
+
"use strict";
|
|
115
|
+
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
116
|
+
var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
|
|
117
|
+
for (var i = 0; i < chars.length; i++) {
|
|
118
|
+
lookup[chars.charCodeAt(i)] = i;
|
|
119
|
+
}
|
|
120
|
+
var encode = function(arraybuffer) {
|
|
121
|
+
var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";
|
|
122
|
+
for (i2 = 0; i2 < len; i2 += 3) {
|
|
123
|
+
base64 += chars[bytes[i2] >> 2];
|
|
124
|
+
base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];
|
|
125
|
+
base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];
|
|
126
|
+
base64 += chars[bytes[i2 + 2] & 63];
|
|
127
|
+
}
|
|
128
|
+
if (len % 3 === 2) {
|
|
129
|
+
base64 = base64.substring(0, base64.length - 1) + "=";
|
|
130
|
+
} else if (len % 3 === 1) {
|
|
131
|
+
base64 = base64.substring(0, base64.length - 2) + "==";
|
|
132
|
+
}
|
|
133
|
+
return base64;
|
|
134
|
+
};
|
|
135
|
+
const lastBlobMap = /* @__PURE__ */ new Map();
|
|
136
|
+
const transparentBlobMap = /* @__PURE__ */ new Map();
|
|
137
|
+
async function getTransparentBlobFor(width, height, dataURLOptions) {
|
|
138
|
+
const id = \`\${width}-\${height}\`;
|
|
139
|
+
if ("OffscreenCanvas" in globalThis) {
|
|
140
|
+
if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);
|
|
141
|
+
const offscreen = new OffscreenCanvas(width, height);
|
|
142
|
+
offscreen.getContext("2d");
|
|
143
|
+
const blob = await offscreen.convertToBlob(dataURLOptions);
|
|
144
|
+
const arrayBuffer = await blob.arrayBuffer();
|
|
145
|
+
const base64 = encode(arrayBuffer);
|
|
146
|
+
transparentBlobMap.set(id, base64);
|
|
147
|
+
return base64;
|
|
148
|
+
} else {
|
|
149
|
+
return "";
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
const worker = self;
|
|
153
|
+
let logDebug = false;
|
|
154
|
+
const debug = (...args) => {
|
|
155
|
+
if (logDebug) {
|
|
156
|
+
console.debug(...args);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
worker.onmessage = async function(e) {
|
|
160
|
+
logDebug = !!e.data.logDebug;
|
|
161
|
+
if ("OffscreenCanvas" in globalThis) {
|
|
162
|
+
const { id, bitmap, width, height, dx, dy, dw, dh, dataURLOptions } = e.data;
|
|
163
|
+
const transparentBase64 = getTransparentBlobFor(
|
|
164
|
+
width,
|
|
165
|
+
height,
|
|
166
|
+
dataURLOptions
|
|
167
|
+
);
|
|
168
|
+
const offscreen = new OffscreenCanvas(width, height);
|
|
169
|
+
const ctx = offscreen.getContext("2d");
|
|
170
|
+
ctx.drawImage(bitmap, 0, 0, width, height);
|
|
171
|
+
bitmap.close();
|
|
172
|
+
const blob = await offscreen.convertToBlob(dataURLOptions);
|
|
173
|
+
const type = blob.type;
|
|
174
|
+
const arrayBuffer = await blob.arrayBuffer();
|
|
175
|
+
const base64 = encode(arrayBuffer);
|
|
176
|
+
if (!lastBlobMap.has(id) && await transparentBase64 === base64) {
|
|
177
|
+
debug("[highlight-worker] canvas bitmap is transparent", {
|
|
178
|
+
id,
|
|
179
|
+
base64
|
|
180
|
+
});
|
|
181
|
+
lastBlobMap.set(id, base64);
|
|
182
|
+
return worker.postMessage({ id, status: "transparent" });
|
|
183
|
+
}
|
|
184
|
+
if (lastBlobMap.get(id) === base64) {
|
|
185
|
+
debug("[highlight-worker] canvas bitmap is unchanged", {
|
|
186
|
+
id,
|
|
187
|
+
base64
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
const msg = {
|
|
191
|
+
id,
|
|
192
|
+
type,
|
|
193
|
+
base64,
|
|
194
|
+
width,
|
|
195
|
+
height,
|
|
196
|
+
dx,
|
|
197
|
+
dy,
|
|
198
|
+
dw,
|
|
199
|
+
dh
|
|
200
|
+
};
|
|
201
|
+
debug("[highlight-worker] canvas bitmap processed", msg);
|
|
202
|
+
worker.postMessage(msg);
|
|
203
|
+
lastBlobMap.set(id, base64);
|
|
204
|
+
} else {
|
|
205
|
+
debug("[highlight-worker] no offscreencanvas support", {
|
|
206
|
+
id: e.data.id
|
|
207
|
+
});
|
|
208
|
+
return worker.postMessage({ id: e.data.id, status: "unsupported" });
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
})();
|
|
212
|
+
//# sourceMappingURL=image-bitmap-data-url-worker-DwtK8A0z.js.map
|
|
213
|
+
`,rf=typeof self!="undefined"&&self.Blob&&new Blob([tf],{type:"text/javascript;charset=utf-8"});function sS(e){let t;try{if(t=rf&&(self.URL||self.webkitURL).createObjectURL(rf),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch(r){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(tf),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class oS{constructor(t){X(this,"pendingCanvasMutations",new Map),X(this,"rafStamps",{latestId:0,invokeId:null}),X(this,"mirror"),X(this,"logger"),X(this,"worker"),X(this,"snapshotInProgressMap",new Map),X(this,"lastSnapshotTime",new Map),X(this,"options"),X(this,"mutationCb"),X(this,"resetObservers"),X(this,"frozen",!1),X(this,"locked",!1),X(this,"processMutation",(c,f)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(f)});const{sampling:r,win:n,blockClass:i,blockSelector:s,recordCanvas:o,recordLocalVideos:l,recordRemoteVideos:u,initialSnapshotDelay:a,dataURLOptions:h}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,this.logger=t.logger,this.worker=new sS,this.worker.onmessage=c=>{const{id:f}=c.data;if(this.snapshotInProgressMap.set(f,!1),!("base64"in c.data)){this.debug(null,"canvas worker received empty message",{id:f,data:c.data,status:c.data.status});return}const{base64:d,type:p,dx:m,dy:g,dw:v,dh:y}=c.data,S={id:f,type:Ar["2D"],commands:[{property:"clearRect",args:[m,g,v,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:d}],type:p}]},m,g,v,y]}]};this.debug(null,"canvas worker recording mutation",S),this.mutationCb(S)},this.options=t,o&&r==="all"?(this.debug(null,"initializing canvas mutation observer",{sampling:r}),this.initCanvasMutationObserver(n,i,s)):o&&typeof r=="number"&&(this.debug(null,"initializing canvas fps observer",{sampling:r}),this.initCanvasFPSObserver(l,u,r,n,i,s,{initialSnapshotDelay:a,dataURLOptions:h},t.resizeFactor,t.maxSnapshotDimension))}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}debug(t,...r){if(!this.logger)return;const n=this.mirror.getId(t);let i="[highlight-canvas-manager]";t&&(i=`[highlight-canvas] [id:${n}]`,t.tagName.toLowerCase()==="canvas"&&(i+=` [ctx:${t.__context}]`)),this.logger.debug(i,t,...r)}snapshot(t){return $(this,null,function*(){var r;const n=this.mirror.getId(t);if(this.snapshotInProgressMap.get(n)){this.debug(t,"snapshotting already in progress for",n);return}const i=1e3/(typeof this.options.samplingManual=="number"?this.options.samplingManual:1),s=this.lastSnapshotTime.get(n);if(!(s&&new Date().getTime()-s<i)){if(this.debug(t,"starting snapshotting"),t.width===0||t.height===0){this.debug(t,"not yet ready",{width:t.width,height:t.height});return}this.lastSnapshotTime.set(n,new Date().getTime()),this.snapshotInProgressMap.set(n,!0);try{if(this.options.clearWebGLBuffer!==!1&&["webgl","webgl2"].includes(t.__context)){const h=t.getContext(t.__context);((r=h==null?void 0:h.getContextAttributes())==null?void 0:r.preserveDrawingBuffer)===!1&&(h.clear(h.COLOR_BUFFER_BIT),this.debug(t,"cleared webgl canvas to load it into memory",{attributes:h==null?void 0:h.getContextAttributes()}))}if(t.width===0||t.height===0){this.debug(t,"not yet ready",{width:t.width,height:t.height});return}let o=this.options.resizeFactor||1;if(this.options.maxSnapshotDimension){const h=Math.max(t.width,t.height);o=Math.min(o,this.options.maxSnapshotDimension/h)}const l=t.width*o,u=t.height*o,a=yield createImageBitmap(t,{resizeWidth:l,resizeHeight:u});this.debug(t,"created image bitmap",{width:a.width,height:a.height}),this.worker.postMessage({id:n,bitmap:a,width:l,height:u,dx:0,dy:0,dw:t.width,dh:t.height,dataURLOptions:this.options.dataURLOptions,logDebug:!!this.logger},[a]),this.debug(t,"sent message")}catch(o){this.debug(t,"failed to snapshot",o)}finally{this.snapshotInProgressMap.set(n,!1)}}})}initCanvasFPSObserver(t,r,n,i,s,o,l,u,a){const h=qh(i,s,o,!0),c=1e3/n;let f=0,d;const p=new Map,m=(S,_)=>{const w=[];S.querySelectorAll(_).forEach(E=>w.push(E));const b=document.createNodeIterator(S,Node.ELEMENT_NODE);let R;for(;R=b.nextNode();)R!=null&&R.shadowRoot&&w.push(...m(R.shadowRoot,_));return w},g=S=>{const _=[];return m(i.document,"canvas").forEach(w=>{if(!Ue(w,s,o,!0)){this.debug(w,"discovered canvas"),_.push(w);const b=this.mirror.getId(w);p.has(b)||p.set(b,S)}}),_},v=S=>{const _=[];return(t||r)&&m(i.document,"video").forEach(w=>{if(!(!r&&w.src!==""&&w.src.indexOf("blob:")===-1)&&!(!t&&(w.src===""||w.src.indexOf("blob:")!==-1))&&!Ue(w,s,o,!0)){_.push(w);const b=this.mirror.getId(w);p.has(b)||p.set(b,S)}}),_},y=S=>$(this,null,function*(){if(f&&S-f<c){d=requestAnimationFrame(b=>void y(b));return}f=S;const _=b=>{const R=this.mirror.getId(b),E=p.get(R),I=!l.initialSnapshotDelay||S-E>l.initialSnapshotDelay;return this.debug(b,{delay:l.initialSnapshotDelay,delta:S-E,hadLoadingTime:I}),I},w=[];w.push(...g(S).filter(_).map(b=>this.snapshot(b))),w.push(...v(S).filter(_).map(b=>$(this,null,function*(){this.debug(b,"starting video snapshotting");const R=this.mirror.getId(b);if(this.snapshotInProgressMap.get(R)){this.debug(b,"video snapshotting already in progress for",R);return}this.snapshotInProgressMap.set(R,!0);try{const{width:E,height:I}=b.getBoundingClientRect(),{actualWidth:C,actualHeight:N}={actualWidth:b.videoWidth,actualHeight:b.videoHeight},G=Math.max(C,N);if(G===0){this.debug(b,"not yet ready",{width:b.width,height:b.height,actualWidth:C,actualHeight:N,boxWidth:E,boxHeight:I});return}let Q=u||1;a&&(Q=Math.min(Q,a/G));const Z=C*Q,T=N*Q,W=yield createImageBitmap(b,{resizeWidth:Z,resizeHeight:T}),k=Math.max(E,I)/G,M=C*k,D=N*k,U=(E-M)/2,q=(I-D)/2;this.debug(b,"created image bitmap",{actualWidth:C,actualHeight:N,boxWidth:E,boxHeight:I,outputWidth:M,outputHeight:D,resizeWidth:Z,resizeHeight:T,scale:Q,outputScale:k,offsetX:U,offsetY:q}),this.worker.postMessage({id:R,bitmap:W,width:Z,height:T,dx:U,dy:q,dw:M,dh:D,dataURLOptions:l.dataURLOptions,logDebug:!!this.logger},[W]),this.debug(b,"send message")}catch(E){this.debug(b,"failed to snapshot",E)}finally{this.snapshotInProgressMap.set(R,!1)}}))),yield Promise.all(w).catch(console.error),d=requestAnimationFrame(b=>void y(b))});d=requestAnimationFrame(S=>void y(S)),this.resetObservers=()=>{h(),d&&cancelAnimationFrame(d)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=qh(t,r,n,!1),s=rS(this.processMutation.bind(this),t,r,n),o=iS(this.processMutation.bind(this),t,r,n);this.resetObservers=()=>{i(),s(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const i=n.map(o=>{const a=o,{type:l}=a;return et(a,["type"])}),{type:s}=n[0];this.mutationCb({id:r,type:s,commands:i}),this.pendingCanvasMutations.delete(t)}}class aS{constructor(t){X(this,"trackedLinkElements",new WeakSet),X(this,"mutationCb"),X(this,"adoptedStyleSheetCb"),X(this,"styleMirror",new Z0),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const n={id:r,styleIds:[]},i=[];for(const s of t){let o;this.styleMirror.has(s)?o=this.styleMirror.getId(s):(o=this.styleMirror.add(s),i.push({styleId:o,rules:Array.from(s.rules||CSSRule,(l,u)=>({rule:Dc(l,s.href),index:u}))})),n.styleIds.push(o)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class lS{constructor(){X(this,"nodeMap",new WeakMap),X(this,"active",!1)}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(i=>i!==r)}add(t,r){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}}let Ie,Fi,Sn,Ji=!1;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Oc=e.contentWindow)==null?void 0:Oc.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const wt=fv();function ot(e={}){var t;const{emit:r,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:s="highlight-block",blockSelector:o=null,ignoreClass:l="highlight-ignore",ignoreSelector:u=null,maskTextClass:a="highlight-mask",maskTextSelector:h=null,inlineStylesheet:c=!0,maskAllInputs:f,maskInputOptions:d,slimDOMOptions:p,maskInputFn:m,maskTextFn:g=Zo,hooks:v,packFn:y,sampling:S={},mousemoveWait:_,recordDOM:w=!0,recordCanvas:b=!1,recordCrossOriginIframes:R=!1,recordAfter:E=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:I=!1,collectFonts:C=!1,inlineImages:N=!1,inlineVideos:G=!1,plugins:Q,keepIframeSrcFn:Z=()=>!1,privacySetting:T="default",ignoreCSSAttributes:W=new Set([]),styleSheetResyncInterval:k=2e3,errorHandler:M,logger:D}=e,U=x(x({},e.dataURLOptions),typeof((t=e.sampling)==null?void 0:t.canvas)=="object"?e.sampling.canvas.dataURLOptions:void 0);k0(M);const q=R?window.parent===window:!0;let fe=!1;if(!q)try{window.parent.document&&(fe=!1)}catch(be){fe=!0}if(q&&!r)throw new Error("emit function is required");if(!q&&!fe)return()=>{};_!==void 0&&S.mousemove===void 0&&(S.mousemove=_),wt.reset();const O=f===!0?{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}:d!==void 0?d:{password:!0},pe=rd(p);C0();let P,F=0;const Y=be=>{for(const Tt of Q||[])Tt.eventProcessor&&(be=Tt.eventProcessor(be));return y&&!fe&&(be=y(be)),be};Ie=(be,Tt)=>{var Ze;const Le=be;if(Le.timestamp=gn(),(Ze=dr[0])!=null&&Ze.isFrozen()&&Le.type!==me.FullSnapshot&&!(Le.type===me.IncrementalSnapshot&&Le.data.source===ce.Mutation)&&dr.forEach(nt=>nt.unfreeze()),q)r==null||r(Y(Le),Tt);else if(fe){const nt={type:"rrweb",event:Y(Le),origin:window.location.origin,isCheckout:Tt};window.parent.postMessage(nt,"*")}if(Le.type===me.FullSnapshot)P=Le,F=0;else if(Le.type===me.IncrementalSnapshot){if(Le.data.source===ce.Mutation&&Le.data.isAttachIframe)return;F++;const nt=i&&F>=i,ve=n&&Le.timestamp-P.timestamp>n;(nt||ve)&&Fi(!0)}};const j=be=>{Ie({type:me.IncrementalSnapshot,data:x({source:ce.Mutation},be)})},ne=be=>Ie({type:me.IncrementalSnapshot,data:x({source:ce.Scroll},be)}),ae=be=>Ie({type:me.IncrementalSnapshot,data:x({source:ce.CanvasMutation},be)}),ge=be=>Ie({type:me.IncrementalSnapshot,data:x({source:ce.AdoptedStyleSheet},be)}),K=new aS({mutationCb:j,adoptedStyleSheetCb:ge}),le=new Q0({mirror:wt,mutationCb:j,stylesheetManager:K,recordCrossOriginIframes:R,wrappedEmit:Ie});for(const be of Q||[])be.getMirror&&be.getMirror({nodeMirror:wt,crossOriginIframeMirror:le.crossOriginIframeMirror,crossOriginIframeStyleMirror:le.crossOriginIframeStyleMirror});const Te=new lS,Jt=typeof(S==null?void 0:S.canvas)=="object"?S.canvas:{fps:S==null?void 0:S.canvas};Sn=new oS({recordCanvas:b,recordLocalVideos:N,recordRemoteVideos:G,mutationCb:ae,win:window,blockClass:s,blockSelector:o,mirror:wt,sampling:Jt.fps,samplingManual:Jt.fpsManual,clearWebGLBuffer:Jt.clearWebGLBuffer,initialSnapshotDelay:Jt.initialSnapshotDelay,dataURLOptions:U,resizeFactor:Jt.resizeFactor,maxSnapshotDimension:Jt.maxSnapshotDimension,logger:D});const no=new $0({mutationCb:j,scrollCb:ne,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:O,dataURLOptions:U,maskTextFn:g,maskInputFn:m,recordCanvas:b,inlineImages:N,inlineVideos:G,privacySetting:T,sampling:S,slimDOMOptions:pe,iframeManager:le,stylesheetManager:K,canvasManager:Sn,keepIframeSrcFn:Z,processedNodeManager:Te},mirror:wt});Fi=(be=!1)=>{if(!w)return;Ie({type:me.Meta,data:{href:window.location.href,width:Nh(),height:xh()}},be),K.reset(),no.init(),dr.forEach(Ze=>Ze.lock());const Tt=Jv(document,{mirror:wt,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:O,maskTextFn:g,maskInputFn:m,slimDOM:pe,dataURLOptions:U,recordCanvas:b,inlineImages:N,inlineVideos:G,privacySetting:T,onSerialize:Ze=>{Vh(Ze,wt)&&le.addIframe(Ze),kh(Ze,wt)&&K.trackLinkElement(Ze),Ka(Ze)&&no.addShadowRoot(oe.shadowRoot(Ze),document)},onIframeLoad:(Ze,Le)=>{le.attachIframe(Ze,Le),no.observeAttachShadow(Ze)},onStylesheetLoad:(Ze,Le)=>{K.attachLinkElement(Ze,Le)},keepIframeSrcFn:Z});if(!Tt)return console.warn("Failed to snapshot the document");Ie({type:me.FullSnapshot,data:{node:Tt,initialOffset:Lh(window)}},be),dr.forEach(Ze=>Ze.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&K.adoptStyleSheets(document.adoptedStyleSheets,wt.getId(document))};try{const be=[],Tt=Le=>{var nt;return de(j0)({mutationCb:j,mousemoveCb:(ve,lc)=>Ie({type:me.IncrementalSnapshot,data:{source:lc,positions:ve}}),mouseInteractionCb:ve=>Ie({type:me.IncrementalSnapshot,data:x({source:ce.MouseInteraction},ve)}),scrollCb:ne,viewportResizeCb:ve=>Ie({type:me.IncrementalSnapshot,data:x({source:ce.ViewportResize},ve)}),inputCb:ve=>Ie({type:me.IncrementalSnapshot,data:x({source:ce.Input},ve)}),mediaInteractionCb:ve=>Ie({type:me.IncrementalSnapshot,data:x({source:ce.MediaInteraction},ve)}),styleSheetRuleCb:ve=>Ie({type:me.IncrementalSnapshot,data:x({source:ce.StyleSheetRule},ve)}),styleDeclarationCb:ve=>Ie({type:me.IncrementalSnapshot,data:x({source:ce.StyleDeclaration},ve)}),canvasMutationCb:ae,fontCb:ve=>Ie({type:me.IncrementalSnapshot,data:x({source:ce.Font},ve)}),selectionCb:ve=>{Ie({type:me.IncrementalSnapshot,data:x({source:ce.Selection},ve)})},customElementCb:ve=>{Ie({type:me.IncrementalSnapshot,data:x({source:ce.CustomElement},ve)})},blockClass:s,ignoreClass:l,ignoreSelector:u,maskTextClass:a,maskTextSelector:h,maskInputOptions:O,inlineStylesheet:c,sampling:S,recordDOM:w,recordCanvas:b,inlineImages:N,inlineVideos:G,userTriggeredOnInput:I,collectFonts:C,doc:Le,maskInputFn:m,maskTextFn:g,keepIframeSrcFn:Z,blockSelector:o,slimDOMOptions:pe,dataURLOptions:U,mirror:wt,iframeManager:le,stylesheetManager:K,shadowDomManager:no,processedNodeManager:Te,canvasManager:Sn,ignoreCSSAttributes:W,styleSheetResyncInterval:k,privacySetting:T,plugins:((nt=Q==null?void 0:Q.filter(ve=>ve.observer))==null?void 0:nt.map(ve=>({observer:ve.observer,options:ve.options,callback:lc=>Ie({type:me.Plugin,data:{plugin:ve.name,payload:lc}})})))||[]},v)};le.addLoadListener(Le=>{try{be.push(Tt(Le.contentDocument))}catch(nt){console.warn(nt)}});const Ze=()=>{Fi(),be.push(Tt(document)),Ji=!0};return["interactive","complete"].includes(document.readyState)?Ze():(be.push(He("DOMContentLoaded",()=>{Ie({type:me.DomContentLoaded,data:{}}),E==="DOMContentLoaded"&&Ze()})),be.push(He("load",()=>{Ie({type:me.Load,data:{}}),E==="load"&&Ze()},window))),()=>{be.forEach(Le=>{try{Le()}catch(nt){String(nt).toLowerCase().includes("cross-origin")||console.warn(nt)}}),Te.destroy(),Ji=!1,X0()}}catch(be){console.warn(be)}}ot.addCustomEvent=(e,t)=>{Ji&&Ie({type:me.Custom,data:{tag:e,payload:t}})},ot.freezePage=()=>{dr.forEach(e=>e.freeze())},ot.takeFullSnapshot=e=>{if(!Ji)throw new Error("please take full snapshot after start recording");Fi(e)},ot.snapshotCanvas=e=>$(this,null,function*(){if(!Sn)throw new Error("canvas manager is not initialized");yield Sn.snapshot(e)}),ot.mirror=wt;var nf;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(nf||(nf={}));const{addCustomEvent:Hi}=ot;var Yi=function(){return Yi=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Yi.apply(this,arguments)},Bi=new Map,Qa=new Map,sf=!0,zi=!1;function of(e){return e.replace(/[\s,]+/g," ").trim()}function uS(e){return of(e.source.body.substring(e.start,e.end))}function cS(e){var t=new Set,r=[];return e.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,s=uS(n.loc),o=Qa.get(i);o&&!o.has(s)?sf&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
214
|
+
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
215
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Qa.set(i,o=new Set),o.add(s),t.has(s)||(t.add(s),r.push(n))}else r.push(n)}),Yi(Yi({},e),{definitions:r})}function dS(e){var t=new Set(e.definitions);t.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var s=n[i];s&&typeof s=="object"&&t.add(s)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}function hS(e){var t=of(e);if(!Bi.has(t)){var r=Cc(e,{experimentalFragmentVariables:zi,allowLegacyFragmentVariables:zi});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Bi.set(t,dS(cS(r)))}return Bi.get(t)}function Ye(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];typeof e=="string"&&(e=[e]);var n=e[0];return t.forEach(function(i,s){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=e[s+1]}),hS(n)}function fS(){Bi.clear(),Qa.clear()}function pS(){sf=!1}function mS(){zi=!0}function gS(){zi=!1}var wn={gql:Ye,resetCaches:fS,disableFragmentWarnings:pS,enableExperimentalFragmentVariables:mS,disableExperimentalFragmentVariables:gS};(function(e){e.gql=wn.gql,e.resetCaches=wn.resetCaches,e.disableFragmentWarnings=wn.disableFragmentWarnings,e.enableExperimentalFragmentVariables=wn.enableExperimentalFragmentVariables,e.disableExperimentalFragmentVariables=wn.disableExperimentalFragmentVariables})(Ye||(Ye={})),Ye.default=Ye;const af=Ye`
|
|
216
|
+
fragment MatchParts on MatchConfig {
|
|
217
|
+
regexValue
|
|
218
|
+
matchValue
|
|
219
|
+
}
|
|
220
|
+
`,yS=Ye`
|
|
221
|
+
mutation PushPayload(
|
|
222
|
+
$session_secure_id: String!
|
|
223
|
+
$payload_id: ID!
|
|
224
|
+
$events: ReplayEventsInput!
|
|
225
|
+
$messages: String!
|
|
226
|
+
$resources: String!
|
|
227
|
+
$web_socket_events: String!
|
|
228
|
+
$errors: [ErrorObjectInput]!
|
|
229
|
+
$is_beacon: Boolean
|
|
230
|
+
$has_session_unloaded: Boolean
|
|
231
|
+
$highlight_logs: String
|
|
232
|
+
) {
|
|
233
|
+
pushPayload(
|
|
234
|
+
session_secure_id: $session_secure_id
|
|
235
|
+
payload_id: $payload_id
|
|
236
|
+
events: $events
|
|
237
|
+
messages: $messages
|
|
238
|
+
resources: $resources
|
|
239
|
+
web_socket_events: $web_socket_events
|
|
240
|
+
errors: $errors
|
|
241
|
+
is_beacon: $is_beacon
|
|
242
|
+
has_session_unloaded: $has_session_unloaded
|
|
243
|
+
highlight_logs: $highlight_logs
|
|
244
|
+
)
|
|
245
|
+
}
|
|
246
|
+
`,$a=Ye`
|
|
247
|
+
mutation PushSessionEvents(
|
|
248
|
+
$session_secure_id: String!
|
|
249
|
+
$payload_id: Int64ID!
|
|
250
|
+
$data: String!
|
|
251
|
+
) {
|
|
252
|
+
pushSessionEvents(
|
|
253
|
+
session_secure_id: $session_secure_id
|
|
254
|
+
payload_id: $payload_id
|
|
255
|
+
data: $data
|
|
256
|
+
)
|
|
257
|
+
}
|
|
258
|
+
`,bS=Ye`
|
|
259
|
+
mutation identifySession(
|
|
260
|
+
$session_secure_id: String!
|
|
261
|
+
$user_identifier: String!
|
|
262
|
+
$user_object: Any
|
|
263
|
+
) {
|
|
264
|
+
identifySession(
|
|
265
|
+
session_secure_id: $session_secure_id
|
|
266
|
+
user_identifier: $user_identifier
|
|
267
|
+
user_object: $user_object
|
|
268
|
+
)
|
|
269
|
+
}
|
|
270
|
+
`,vS=Ye`
|
|
271
|
+
mutation addSessionProperties(
|
|
272
|
+
$session_secure_id: String!
|
|
273
|
+
$properties_object: Any
|
|
274
|
+
) {
|
|
275
|
+
addSessionProperties(
|
|
276
|
+
session_secure_id: $session_secure_id
|
|
277
|
+
properties_object: $properties_object
|
|
278
|
+
)
|
|
279
|
+
}
|
|
280
|
+
`,SS=Ye`
|
|
281
|
+
mutation pushMetrics($metrics: [MetricInput]!) {
|
|
282
|
+
pushMetrics(metrics: $metrics)
|
|
283
|
+
}
|
|
284
|
+
`,wS=Ye`
|
|
285
|
+
mutation addSessionFeedback(
|
|
286
|
+
$session_secure_id: String!
|
|
287
|
+
$user_name: String
|
|
288
|
+
$user_email: String
|
|
289
|
+
$verbatim: String!
|
|
290
|
+
$timestamp: Timestamp!
|
|
291
|
+
) {
|
|
292
|
+
addSessionFeedback(
|
|
293
|
+
session_secure_id: $session_secure_id
|
|
294
|
+
user_name: $user_name
|
|
295
|
+
user_email: $user_email
|
|
296
|
+
verbatim: $verbatim
|
|
297
|
+
timestamp: $timestamp
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
|
+
`,RS=Ye`
|
|
301
|
+
mutation initializeSession(
|
|
302
|
+
$session_secure_id: String!
|
|
303
|
+
$session_key: String
|
|
304
|
+
$organization_verbose_id: String!
|
|
305
|
+
$enable_strict_privacy: Boolean!
|
|
306
|
+
$privacy_setting: String!
|
|
307
|
+
$enable_recording_network_contents: Boolean!
|
|
308
|
+
$clientVersion: String!
|
|
309
|
+
$firstloadVersion: String!
|
|
310
|
+
$clientConfig: String!
|
|
311
|
+
$environment: String!
|
|
312
|
+
$id: String!
|
|
313
|
+
$appVersion: String
|
|
314
|
+
$serviceName: String!
|
|
315
|
+
$client_id: String!
|
|
316
|
+
$network_recording_domains: [String!]
|
|
317
|
+
$disable_session_recording: Boolean
|
|
318
|
+
) {
|
|
319
|
+
initializeSession(
|
|
320
|
+
session_secure_id: $session_secure_id
|
|
321
|
+
session_key: $session_key
|
|
322
|
+
organization_verbose_id: $organization_verbose_id
|
|
323
|
+
enable_strict_privacy: $enable_strict_privacy
|
|
324
|
+
enable_recording_network_contents: $enable_recording_network_contents
|
|
325
|
+
clientVersion: $clientVersion
|
|
326
|
+
firstloadVersion: $firstloadVersion
|
|
327
|
+
clientConfig: $clientConfig
|
|
328
|
+
environment: $environment
|
|
329
|
+
appVersion: $appVersion
|
|
330
|
+
serviceName: $serviceName
|
|
331
|
+
fingerprint: $id
|
|
332
|
+
client_id: $client_id
|
|
333
|
+
network_recording_domains: $network_recording_domains
|
|
334
|
+
disable_session_recording: $disable_session_recording
|
|
335
|
+
privacy_setting: $privacy_setting
|
|
336
|
+
) {
|
|
337
|
+
secure_id
|
|
338
|
+
project_id
|
|
339
|
+
sampling {
|
|
340
|
+
spans {
|
|
341
|
+
name {
|
|
342
|
+
...MatchParts
|
|
343
|
+
}
|
|
344
|
+
attributes {
|
|
345
|
+
key {
|
|
346
|
+
...MatchParts
|
|
347
|
+
}
|
|
348
|
+
attribute {
|
|
349
|
+
...MatchParts
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
events {
|
|
353
|
+
name {
|
|
354
|
+
...MatchParts
|
|
355
|
+
}
|
|
356
|
+
attributes {
|
|
357
|
+
key {
|
|
358
|
+
...MatchParts
|
|
359
|
+
}
|
|
360
|
+
attribute {
|
|
361
|
+
...MatchParts
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
samplingRatio
|
|
366
|
+
}
|
|
367
|
+
logs {
|
|
368
|
+
message {
|
|
369
|
+
...MatchParts
|
|
370
|
+
}
|
|
371
|
+
severityText {
|
|
372
|
+
...MatchParts
|
|
373
|
+
}
|
|
374
|
+
attributes {
|
|
375
|
+
key {
|
|
376
|
+
...MatchParts
|
|
377
|
+
}
|
|
378
|
+
attribute {
|
|
379
|
+
...MatchParts
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
samplingRatio
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
${af}
|
|
388
|
+
`,_S=Ye`
|
|
389
|
+
query Ignore($id: ID!) {
|
|
390
|
+
ignore(id: $id)
|
|
391
|
+
}
|
|
392
|
+
`,TS=Ye`
|
|
393
|
+
query GetSamplingConfig($organization_verbose_id: String!) {
|
|
394
|
+
sampling(organization_verbose_id: $organization_verbose_id) {
|
|
395
|
+
spans {
|
|
396
|
+
name {
|
|
397
|
+
...MatchParts
|
|
398
|
+
}
|
|
399
|
+
attributes {
|
|
400
|
+
key {
|
|
401
|
+
...MatchParts
|
|
402
|
+
}
|
|
403
|
+
attribute {
|
|
404
|
+
...MatchParts
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
events {
|
|
408
|
+
name {
|
|
409
|
+
...MatchParts
|
|
410
|
+
}
|
|
411
|
+
attributes {
|
|
412
|
+
key {
|
|
413
|
+
...MatchParts
|
|
414
|
+
}
|
|
415
|
+
attribute {
|
|
416
|
+
...MatchParts
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
samplingRatio
|
|
421
|
+
}
|
|
422
|
+
logs {
|
|
423
|
+
message {
|
|
424
|
+
...MatchParts
|
|
425
|
+
}
|
|
426
|
+
severityText {
|
|
427
|
+
...MatchParts
|
|
428
|
+
}
|
|
429
|
+
attributes {
|
|
430
|
+
key {
|
|
431
|
+
...MatchParts
|
|
432
|
+
}
|
|
433
|
+
attribute {
|
|
434
|
+
...MatchParts
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
samplingRatio
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
${af}
|
|
442
|
+
`,ES=(e,t,r,n)=>e();function qa(e,t=ES){return{PushPayload(r,n){return t(i=>e.request(yS,r,x(x({},n),i)),"PushPayload","mutation",r)},PushSessionEvents(r,n){return t(i=>e.request($a,r,x(x({},n),i)),"PushSessionEvents","mutation",r)},identifySession(r,n){return t(i=>e.request(bS,r,x(x({},n),i)),"identifySession","mutation",r)},addSessionProperties(r,n){return t(i=>e.request(vS,r,x(x({},n),i)),"addSessionProperties","mutation",r)},pushMetrics(r,n){return t(i=>e.request(SS,r,x(x({},n),i)),"pushMetrics","mutation",r)},addSessionFeedback(r,n){return t(i=>e.request(wS,r,x(x({},n),i)),"addSessionFeedback","mutation",r)},initializeSession(r,n){return t(i=>e.request(RS,r,x(x({},n),i)),"initializeSession","mutation",r)},Ignore(r,n){return t(i=>e.request(_S,r,x(x({},n),i)),"Ignore","query",r)},GetSamplingConfig(r,n){return t(i=>e.request(TS,r,x(x({},n),i)),"GetSamplingConfig","query",r)}}}const el=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"];var Ve=(e=>(e.DeviceMemory="DeviceMemory",e.ViewportHeight="ViewportHeight",e.ViewportWidth="ViewportWidth",e.ScreenHeight="ScreenHeight",e.ScreenWidth="ScreenWidth",e.ViewportArea="ViewportArea",e))(Ve||{}),Ce=(e=>(e.Device="Device",e.WebVital="WebVital",e.Performance="Performance",e.Frontend="Frontend",e.Backend="Backend",e))(Ce||{});function IS(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(n){return()=>{}}}function CS(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let r=e.localName;if(!r)break;r=r.toLowerCase();let n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(let s=0;s<n.children.length;s++){let o=n.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&i.push(o)}i.length>1&&(r+=":eq("+i.indexOf(e)+")"),t=r+(t?">"+t:""),e=n}return t}function tl(e){return Object.prototype.toString.call(e)==="[object Object]"}function lf(e,t){if(t===0)return!0;const r=Object.keys(e);for(const n of r)if(tl(e[n])&&lf(e[n],t-1))return!0;return!1}function rl(e,t){const r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);const n=[],i=[];return JSON.stringify(e,function(l,u){if(n.length>0){const a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?i.splice(a,1/0,l):i.push(l),~n.indexOf(u)&&(n[0]===u?u="[Circular ~]":u="[Circular ~."+i.slice(0,n.indexOf(u)).join(".")+"]")}else n.push(u);if(u==null)return u;if(s(u))return o(u);if(u instanceof Event){const a={};for(const h in u){const c=u[h];Array.isArray(c)?a[h]=CS(c.length?c[0]:null):a[h]=c}return a}else{if(u instanceof Node)return u instanceof HTMLElement?u?u.outerHTML:"":u.nodeName;if(u instanceof Error)return u.name+": "+u.message}return u});function s(l){return tl(l)&&Object.keys(l).length>r.numOfKeysLimit||typeof l=="function"?!0:l instanceof Event&&l.isTrusted===!1?Object.keys(l).length===1:!!(tl(l)&&lf(l,r.depthOfLimit))}function o(l){let u=l.toString();return r.stringLengthLimit&&u.length>r.stringLengthLimit&&(u=`${u.slice(0,r.stringLengthLimit)}...`),u}}function ZS(){var e=document.createElement("canvas");return e.getContext&&e.getContext("2d")?e.toDataURL("image/webp").indexOf("data:image/webp")==0:!1}function uf(){return ZS()?{type:"image/webp",quality:.9}:{type:"image/jpeg",quality:.6}}function cf(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}var df={exports:{}},nl={exports:{}},hf;function LS(){return hf||(hf=1,function(e,t){(function(r,n){e.exports=n()})(yo,function(){function r(m){return!isNaN(parseFloat(m))&&isFinite(m)}function n(m){return m.charAt(0).toUpperCase()+m.substring(1)}function i(m){return function(){return this[m]}}var s=["isConstructor","isEval","isNative","isToplevel"],o=["columnNumber","lineNumber"],l=["fileName","functionName","source"],u=["args"],a=["evalOrigin"],h=s.concat(o,l,u,a);function c(m){if(m)for(var g=0;g<h.length;g++)m[h[g]]!==void 0&&this["set"+n(h[g])](m[h[g]])}c.prototype={getArgs:function(){return this.args},setArgs:function(m){if(Object.prototype.toString.call(m)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=m},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(m){if(m instanceof c)this.evalOrigin=m;else if(m instanceof Object)this.evalOrigin=new c(m);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var m=this.getFileName()||"",g=this.getLineNumber()||"",v=this.getColumnNumber()||"",y=this.getFunctionName()||"";return this.getIsEval()?m?"[eval] ("+m+":"+g+":"+v+")":"[eval]:"+g+":"+v:y?y+" ("+m+":"+g+":"+v+")":m+":"+g+":"+v}},c.fromString=function(g){var v=g.indexOf("("),y=g.lastIndexOf(")"),S=g.substring(0,v),_=g.substring(v+1,y).split(","),w=g.substring(y+1);if(w.indexOf("@")===0)var b=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(w,""),R=b[1],E=b[2],I=b[3];return new c({functionName:S,args:_||void 0,fileName:R,lineNumber:E||void 0,columnNumber:I||void 0})};for(var f=0;f<s.length;f++)c.prototype["get"+n(s[f])]=i(s[f]),c.prototype["set"+n(s[f])]=function(m){return function(g){this[m]=!!g}}(s[f]);for(var d=0;d<o.length;d++)c.prototype["get"+n(o[d])]=i(o[d]),c.prototype["set"+n(o[d])]=function(m){return function(g){if(!r(g))throw new TypeError(m+" must be a Number");this[m]=Number(g)}}(o[d]);for(var p=0;p<l.length;p++)c.prototype["get"+n(l[p])]=i(l[p]),c.prototype["set"+n(l[p])]=function(m){return function(g){this[m]=String(g)}}(l[p]);return c})}(nl)),nl.exports}(function(e,t){(function(r,n){e.exports=n(LS())})(yo,function(n){var i=/(^|@)\S+:\d+/,s=/^\s*at .*(\S+:\d+|\(native\))/m,o=/^(eval@)?(\[native code])?$/;return{parse:function(u){if(typeof u.stacktrace!="undefined"||typeof u["opera#sourceloc"]!="undefined")return this.parseOpera(u);if(u.stack&&u.stack.match(s))return this.parseV8OrIE(u);if(u.stack)return this.parseFFOrSafari(u);throw new Error("Cannot parse given Error object")},extractLocation:function(u){if(u.indexOf(":")===-1)return[u];var a=/(.+?)(?::(\d+))?(?::(\d+))?$/,h=a.exec(u.replace(/[()]/g,""));return[h[1],h[2]||void 0,h[3]||void 0]},parseV8OrIE:function(u){var a=u.stack.split(`
|
|
443
|
+
`).filter(function(h){return!!h.match(s)},this);return a.map(function(h){h.indexOf("(eval ")>-1&&(h=h.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var c=h.replace(/^\s+/,"").replace(/\(eval code/g,"("),f=c.match(/ (\((.+):(\d+):(\d+)\)$)/);c=f?c.replace(f[0],""):c;var d=c.split(/\s+/).slice(1),p=this.extractLocation(f?f[1]:d.pop()),m=d.join(" ")||void 0,g=["eval","<anonymous>"].indexOf(p[0])>-1?void 0:p[0];return new n({functionName:m,fileName:g,lineNumber:p[1],columnNumber:p[2],source:h})},this)},parseFFOrSafari:function(u){var a=u.stack.split(`
|
|
444
|
+
`).filter(function(h){return!h.match(o)},this);return a.map(function(h){if(h.indexOf(" > eval")>-1&&(h=h.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),h.indexOf("@")===-1&&h.indexOf(":")===-1)return new n({functionName:h});var c=/((.*".+"[^@]*)?[^@]*)(?:@)/,f=h.match(c),d=f&&f[1]?f[1]:void 0,p=this.extractLocation(h.replace(c,""));return new n({functionName:d,fileName:p[0],lineNumber:p[1],columnNumber:p[2],source:h})},this)},parseOpera:function(u){return!u.stacktrace||u.message.indexOf(`
|
|
445
|
+
`)>-1&&u.message.split(`
|
|
446
|
+
`).length>u.stacktrace.split(`
|
|
447
|
+
`).length?this.parseOpera9(u):u.stack?this.parseOpera11(u):this.parseOpera10(u)},parseOpera9:function(u){for(var a=/Line (\d+).*script (?:in )?(\S+)/i,h=u.message.split(`
|
|
448
|
+
`),c=[],f=2,d=h.length;f<d;f+=2){var p=a.exec(h[f]);p&&c.push(new n({fileName:p[2],lineNumber:p[1],source:h[f]}))}return c},parseOpera10:function(u){for(var a=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,h=u.stacktrace.split(`
|
|
449
|
+
`),c=[],f=0,d=h.length;f<d;f+=2){var p=a.exec(h[f]);p&&c.push(new n({functionName:p[3]||void 0,fileName:p[2],lineNumber:p[1],source:h[f]}))}return c},parseOpera11:function(u){var a=u.stack.split(`
|
|
450
|
+
`).filter(function(h){return!!h.match(i)&&!h.match(/^Error created at/)},this);return a.map(function(h){var c=h.split("@"),f=this.extractLocation(c.pop()),d=c.shift()||"",p=d.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,m;d.match(/\(([^)]*)\)/)&&(m=d.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var g=m===void 0||m==="[arguments not available]"?void 0:m.split(",");return new n({functionName:p,args:g,fileName:f[0],lineNumber:f[1],columnNumber:f[2],source:h})},this)}}})})(df);var xS=df.exports;const ff=ci(xS);function Rn(e){try{return ff.parse(e)}catch(t){try{return ff.parse(new Error)}catch(r){return console.warn("Highlight Warning: failed to parse error",{originalError:t,secondaryError:r}),[]}}}const pf={level:[...el],logger:"console",stringifyOptions:{depthOfLimit:10,numOfKeysLimit:100,stringLengthLimit:1e3}};function mf(e,t){const r=t.logger;if(!r)return()=>{};let n;typeof r=="string"?n=window[r]:n=r;const i=[];if(t.level.includes("error")&&window){const o=l=>{const{message:u,error:a}=l;let h=[];a&&(h=Rn(a));const c=[rl(u,t.stringifyOptions)];e({type:"Error",trace:h,time:Date.now(),value:c})};window.addEventListener("error",o),i.push(()=>{window&&window.removeEventListener("error",o)})}for(const o of t.level)i.push(s(n,o));return()=>{i.forEach(o=>o())};function s(o,l){return o[l]?IS(o,l,u=>(...a)=>{u.apply(this,a);try{e(gf(l,t,...a))}catch(h){u("highlight logger error:",h,...a)}}):()=>{}}}function gf(e,t,...r){const n=Rn(new Error),i=t.serializeConsoleAttributes?r.map(s=>typeof s=="object"?rl(s,t.stringifyOptions):s):r.filter(s=>typeof s!="object").map(s=>`${s}`);return{type:e,trace:n,value:i,attributes:rl(r.filter(s=>typeof s=="object").reduce((s,o)=>x(x({},s),o),{}),t.stringifyOptions),time:Date.now()}}const NS={start:0,end:3},OS={start:4,end:5},il={start:6,end:7},sl={start:8,end:8},GS={start:9,end:9},VS={start:10,end:15};function kS(){if(crypto&&crypto.getRandomValues){const t=new Uint8Array(16);return crypto.getRandomValues(t),[...t.values()]}const e=[];for(let t=0;t<16;t+=1)e.push(Math.floor(Math.random()*256));return e}function Fr(e,t){let r="";for(let n=t.start;n<=t.end;n+=1)r+=e[n].toString(16).padStart(2,"0");return r}function XS(e){return e[sl.start]=(e[sl.start]|128)&191,e[il.start]=e[il.start]&15|64,`${Fr(e,NS)}-${Fr(e,OS)}-${Fr(e,il)}-${Fr(e,sl)}${Fr(e,GS)}-${Fr(e,VS)}`}function WS(){const e=kS();return XS(e)}function _n(){return typeof crypto!="undefined"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():WS()}function ol(e,t,r,n){var u,a,h,c;let i=n!=null?n:t,s=Rn(i),o={};if(t instanceof Error){const f=t.cause;t=t.message,f&&(o={"exception.cause":f})}const l=PS(s);e({error:i,event:bt(t),type:"window.onerror",url:window.location.href,source:r!=null?r:"",lineNumber:(u=l[0])!=null&&u.lineNumber?(a=l[0])==null?void 0:a.lineNumber:0,columnNumber:(h=l[0])!=null&&h.columnNumber?(c=l[0])==null?void 0:c.columnNumber:0,stackTrace:l,timestamp:new Date().toISOString(),payload:o?bt(o):void 0,id:_n()})}const yf=(e,{enablePromisePatch:t})=>{if(typeof window=="undefined")return()=>{};const r=window.onerror;window.onerror=(o,l,u,a,h)=>{ol(e,o,l,h)};const n=window.onunhandledrejection;window.onunhandledrejection=o=>{if(o.reason){const l=o.promise;l.getStack?ol(e,o.reason,o.type,l.getStack()):ol(e,o.reason,o.type)}};const i=window.Promise,s=class extends i{constructor(u){super(u);L(this,"promiseCreationError");this.promiseCreationError=new Error}getStack(){return this.promiseCreationError}static shouldPatch(){const u=typeof window.Zone=="undefined";return t&&u}};return s.shouldPatch()&&(window.Promise=s),()=>{window.Promise=i,window.onunhandledrejection=n,window.onerror=r}},PS=e=>{var r,n;if(e.length===0)return e;const t=e[0];return(r=t.fileName)!=null&&r.includes("highlight.run")||(n=t.fileName)!=null&&n.includes("highlight.io")||t.functionName==="new highlightPromise"?e.slice(1):e},al=['["\\"Script error.\\""]','"Script error."','["\\"Load failed.\\""]','"Load failed."','["\\"Network request failed.\\""]','"Network request failed."','["\\"Document is not focused.\\""]','"Document is not focused."','["\\"Failed to fetch\\""]','"Failed to fetch"','[{"isTrusted":true}]','{"isTrusted":true}','["{}"]','"{}"','[""]','""','["\\"\\""]','""'],ll=["websocket error",'\\"ResizeObserver loop'];var MS=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},hr="1.9.0",bf=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function AS(e){var t=new Set([e]),r=new Set,n=e.match(bf);if(!n)return function(){return!1};var i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(i.prerelease!=null)return function(u){return u===e};function s(l){return r.add(l),!1}function o(l){return t.add(l),!0}return function(u){if(t.has(u))return!0;if(r.has(u))return!1;var a=u.match(bf);if(!a)return s(u);var h={major:+a[1],minor:+a[2],patch:+a[3],prerelease:a[4]};return h.prerelease!=null||i.major!==h.major?s(u):i.major===0?i.minor===h.minor&&i.patch<=h.patch?o(u):s(u):i.minor<=h.minor?o(u):s(u)}}var US=AS(hr),DS=hr.split(".")[0],Tn=Symbol.for("opentelemetry.js.api."+DS),En=MS;function In(e,t,r,n){var i;n===void 0&&(n=!1);var s=En[Tn]=(i=En[Tn])!==null&&i!==void 0?i:{version:hr};if(!n&&s[e]){var o=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(o.stack||o.message),!1}if(s.version!==hr){var o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+e+" does not match previously registered API v"+hr);return r.error(o.stack||o.message),!1}return s[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+hr+"."),!0}function fr(e){var t,r,n=(t=En[Tn])===null||t===void 0?void 0:t.version;if(!(!n||!US(n)))return(r=En[Tn])===null||r===void 0?void 0:r[e]}function Cn(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+hr+".");var r=En[Tn];r&&delete r[e]}var FS=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},JS=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},HS=function(){function e(t){this._namespace=t.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Zn("debug",this._namespace,t)},e.prototype.error=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Zn("error",this._namespace,t)},e.prototype.info=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Zn("info",this._namespace,t)},e.prototype.warn=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Zn("warn",this._namespace,t)},e.prototype.verbose=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Zn("verbose",this._namespace,t)},e}();function Zn(e,t,r){var n=fr("diag");if(n)return r.unshift(t),n[e].apply(n,JS([],FS(r),!1))}var xe;(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"})(xe||(xe={}));function YS(e,t){e<xe.NONE?e=xe.NONE:e>xe.ALL&&(e=xe.ALL),t=t||{};function r(n,i){var s=t[n];return typeof s=="function"&&e>=i?s.bind(t):function(){}}return{error:r("error",xe.ERROR),warn:r("warn",xe.WARN),info:r("info",xe.INFO),debug:r("debug",xe.DEBUG),verbose:r("verbose",xe.VERBOSE)}}var BS=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},zS=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},KS="diag",Et=function(){function e(){function t(i){return function(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];var l=fr("diag");if(l)return l[i].apply(l,zS([],BS(s),!1))}}var r=this,n=function(i,s){var o,l,u;if(s===void 0&&(s={logLevel:xe.INFO}),i===r){var a=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return r.error((o=a.stack)!==null&&o!==void 0?o:a.message),!1}typeof s=="number"&&(s={logLevel:s});var h=fr("diag"),c=YS((l=s.logLevel)!==null&&l!==void 0?l:xe.INFO,i);if(h&&!s.suppressOverrideMessage){var f=(u=new Error().stack)!==null&&u!==void 0?u:"<failed to generate stacktrace>";h.warn("Current logger will be overwritten from "+f),c.warn("Current logger will overwrite one already registered from "+f)}return In("diag",c,r,!0)};r.setLogger=n,r.disable=function(){Cn(KS,r)},r.createComponentLogger=function(i){return new HS(i)},r.verbose=t("verbose"),r.debug=t("debug"),r.info=t("info"),r.warn=t("warn"),r.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}(),jS=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},QS=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},$S=function(){function e(t){this._entries=t?new Map(t):new Map}return e.prototype.getEntry=function(t){var r=this._entries.get(t);if(r)return Object.assign({},r)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(t){var r=jS(t,2),n=r[0],i=r[1];return[n,i]})},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=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var s=new e(this._entries);try{for(var o=QS(n),l=o.next();!l.done;l=o.next()){var u=l.value;s._entries.delete(u)}}catch(a){t={error:a}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return s},e.prototype.clear=function(){return new e},e}(),qS=Symbol("BaggageEntryMetadata"),ew=Et.instance();function tw(e){return e===void 0&&(e={}),new $S(new Map(Object.entries(e)))}function rw(e){return typeof e!="string"&&(ew.error("Cannot create baggage metadata from unknown type: "+typeof e),e=""),{__TYPE__:qS,toString:function(){return e}}}function ul(e){return Symbol.for(e)}var nw=function(){function e(t){var r=this;r._currentContext=t?new Map(t):new Map,r.getValue=function(n){return r._currentContext.get(n)},r.setValue=function(n,i){var s=new e(r._currentContext);return s._currentContext.set(n,i),s},r.deleteValue=function(n){var i=new e(r._currentContext);return i._currentContext.delete(n),i}}return e}(),pr=new nw,mr=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),iw=function(){function e(){}return e.prototype.createGauge=function(t,r){return fw},e.prototype.createHistogram=function(t,r){return pw},e.prototype.createCounter=function(t,r){return hw},e.prototype.createUpDownCounter=function(t,r){return mw},e.prototype.createObservableGauge=function(t,r){return yw},e.prototype.createObservableCounter=function(t,r){return gw},e.prototype.createObservableUpDownCounter=function(t,r){return bw},e.prototype.addBatchObservableCallback=function(t,r){},e.prototype.removeBatchObservableCallback=function(t){},e}(),Ki=function(){function e(){}return e}(),sw=function(e){mr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.add=function(r,n){},t}(Ki),ow=function(e){mr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.add=function(r,n){},t}(Ki),aw=function(e){mr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.record=function(r,n){},t}(Ki),lw=function(e){mr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.record=function(r,n){},t}(Ki),cl=function(){function e(){}return e.prototype.addCallback=function(t){},e.prototype.removeCallback=function(t){},e}(),uw=function(e){mr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(cl),cw=function(e){mr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(cl),dw=function(e){mr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(cl),vf=new iw,hw=new sw,fw=new aw,pw=new lw,mw=new ow,gw=new uw,yw=new cw,bw=new dw;function vw(){return vf}var jt;(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(jt||(jt={}));var Sw={get:function(e,t){if(e!=null)return e[t]},keys:function(e){return e==null?[]:Object.keys(e)}},ww={set:function(e,t,r){e!=null&&(e[t]=r)}},Rw=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},_w=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},Tw=function(){function e(){}return e.prototype.active=function(){return pr},e.prototype.with=function(t,r,n){for(var i=[],s=3;s<arguments.length;s++)i[s-3]=arguments[s];return r.call.apply(r,_w([n],Rw(i),!1))},e.prototype.bind=function(t,r){return r},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),Ew=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},Iw=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},dl="context",Cw=new Tw,ji=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(t){return In(dl,t,Et.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(t,r,n){for(var i,s=[],o=3;o<arguments.length;o++)s[o-3]=arguments[o];return(i=this._getContextManager()).with.apply(i,Iw([t,r,n],Ew(s),!1))},e.prototype.bind=function(t,r){return this._getContextManager().bind(t,r)},e.prototype._getContextManager=function(){return fr(dl)||Cw},e.prototype.disable=function(){this._getContextManager().disable(),Cn(dl,Et.instance())},e}(),Vt;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(Vt||(Vt={}));var Sf="0000000000000000",wf="00000000000000000000000000000000",Rf={traceId:wf,spanId:Sf,traceFlags:Vt.NONE},Ln=function(){function e(t){t===void 0&&(t=Rf),this._spanContext=t}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(t,r){return this},e.prototype.setAttributes=function(t){return this},e.prototype.addEvent=function(t,r){return this},e.prototype.addLink=function(t){return this},e.prototype.addLinks=function(t){return this},e.prototype.setStatus=function(t){return this},e.prototype.updateName=function(t){return this},e.prototype.end=function(t){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(t,r){},e}(),hl=ul("OpenTelemetry Context Key SPAN");function fl(e){return e.getValue(hl)||void 0}function Zw(){return fl(ji.getInstance().active())}function pl(e,t){return e.setValue(hl,t)}function Lw(e){return e.deleteValue(hl)}function xw(e,t){return pl(e,new Ln(t))}function _f(e){var t;return(t=fl(e))===null||t===void 0?void 0:t.spanContext()}var Nw=/^([0-9a-f]{32})$/i,Ow=/^[0-9a-f]{16}$/i;function Tf(e){return Nw.test(e)&&e!==wf}function Gw(e){return Ow.test(e)&&e!==Sf}function Qi(e){return Tf(e.traceId)&&Gw(e.spanId)}function Vw(e){return new Ln(e)}var ml=ji.getInstance(),Ef=function(){function e(){}return e.prototype.startSpan=function(t,r,n){n===void 0&&(n=ml.active());var i=!!(r!=null&&r.root);if(i)return new Ln;var s=n&&_f(n);return kw(s)&&Qi(s)?new Ln(s):new Ln},e.prototype.startActiveSpan=function(t,r,n,i){var s,o,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(s=r,l=n):(s=r,o=n,l=i);var u=o!=null?o:ml.active(),a=this.startSpan(t,s,u),h=pl(u,a);return ml.with(h,l,void 0,a)}},e}();function kw(e){return typeof e=="object"&&typeof e.spanId=="string"&&typeof e.traceId=="string"&&typeof e.traceFlags=="number"}var Xw=new Ef,Ww=function(){function e(t,r,n,i){this._provider=t,this.name=r,this.version=n,this.options=i}return e.prototype.startSpan=function(t,r,n){return this._getTracer().startSpan(t,r,n)},e.prototype.startActiveSpan=function(t,r,n,i){var s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Xw},e}(),Pw=function(){function e(){}return e.prototype.getTracer=function(t,r,n){return new Ef},e}(),Mw=new Pw,If=function(){function e(){}return e.prototype.getTracer=function(t,r,n){var i;return(i=this.getDelegateTracer(t,r,n))!==null&&i!==void 0?i:new Ww(this,t,r,n)},e.prototype.getDelegate=function(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Mw},e.prototype.setDelegate=function(t){this._delegate=t},e.prototype.getDelegateTracer=function(t,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getTracer(t,r,n)},e}(),$i;(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})($i||($i={}));var xn;(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"})(xn||(xn={}));var qi;(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(qi||(qi={}));var he=ji.getInstance(),H=Et.instance(),Aw=function(){function e(){}return e.prototype.getMeter=function(t,r,n){return vf},e}(),Uw=new Aw,gl="metrics",Dw=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalMeterProvider=function(t){return In(gl,t,Et.instance())},e.prototype.getMeterProvider=function(){return fr(gl)||Uw},e.prototype.getMeter=function(t,r,n){return this.getMeterProvider().getMeter(t,r,n)},e.prototype.disable=function(){Cn(gl,Et.instance())},e}(),yl=Dw.getInstance(),Fw=function(){function e(){}return e.prototype.inject=function(t,r){},e.prototype.extract=function(t,r){return t},e.prototype.fields=function(){return[]},e}(),bl=ul("OpenTelemetry Baggage Key");function Cf(e){return e.getValue(bl)||void 0}function Jw(){return Cf(ji.getInstance().active())}function Hw(e,t){return e.setValue(bl,t)}function Yw(e){return e.deleteValue(bl)}var vl="propagation",Bw=new Fw,zw=function(){function e(){this.createBaggage=tw,this.getBaggage=Cf,this.getActiveBaggage=Jw,this.setBaggage=Hw,this.deleteBaggage=Yw}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(t){return In(vl,t,Et.instance())},e.prototype.inject=function(t,r,n){return n===void 0&&(n=ww),this._getGlobalPropagator().inject(t,r,n)},e.prototype.extract=function(t,r,n){return n===void 0&&(n=Sw),this._getGlobalPropagator().extract(t,r,n)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){Cn(vl,Et.instance())},e.prototype._getGlobalPropagator=function(){return fr(vl)||Bw},e}(),at=zw.getInstance(),Sl="trace",Kw=function(){function e(){this._proxyTracerProvider=new If,this.wrapSpanContext=Vw,this.isSpanContextValid=Qi,this.deleteSpan=Lw,this.getSpan=fl,this.getActiveSpan=Zw,this.getSpanContext=_f,this.setSpan=pl,this.setSpanContext=xw}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(t){var r=In(Sl,this._proxyTracerProvider,Et.instance());return r&&this._proxyTracerProvider.setDelegate(t),r},e.prototype.getTracerProvider=function(){return fr(Sl)||this._proxyTracerProvider},e.prototype.getTracer=function(t,r){return this.getTracerProvider().getTracer(t,r)},e.prototype.disable=function(){Cn(Sl,Et.instance()),this._proxyTracerProvider=new If},e}(),Se=Kw.getInstance(),Zf=ul("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Lf(e){return e.setValue(Zf,!0)}function wl(e){return e.getValue(Zf)===!0}var jw="=",Rl=";",_l=",",Tl="baggage",Qw=180,$w=4096,qw=8192,eR=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s};function tR(e){return e.reduce(function(t,r){var n=""+t+(t!==""?_l:"")+r;return n.length>qw?t:n},"")}function rR(e){return e.getAllEntries().map(function(t){var r=eR(t,2),n=r[0],i=r[1],s=encodeURIComponent(n)+"="+encodeURIComponent(i.value);return i.metadata!==void 0&&(s+=Rl+i.metadata.toString()),s})}function nR(e){var t=e.split(Rl);if(!(t.length<=0)){var r=t.shift();if(r){var n=r.indexOf(jw);if(!(n<=0)){var i=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),o;return t.length>0&&(o=rw(t.join(Rl))),{key:i,value:s,metadata:o}}}}}var xf=function(){function e(){}return e.prototype.inject=function(t,r,n){var i=at.getBaggage(t);if(!(!i||wl(t))){var s=rR(i).filter(function(l){return l.length<=$w}).slice(0,Qw),o=tR(s);o.length>0&&n.set(r,Tl,o)}},e.prototype.extract=function(t,r,n){var i=n.get(r,Tl),s=Array.isArray(i)?i.join(_l):i;if(!s)return t;var o={};if(s.length===0)return t;var l=s.split(_l);return l.forEach(function(u){var a=nR(u);if(a){var h={value:a.value};a.metadata&&(h.metadata=a.metadata),o[a.key]=h}}),Object.entries(o).length===0?t:at.setBaggage(t,at.createBaggage(o))},e.prototype.fields=function(){return[Tl]},e}(),Nf=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},iR=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s};function es(e){var t,r,n={};if(typeof e!="object"||e==null)return n;try{for(var i=Nf(Object.entries(e)),s=i.next();!s.done;s=i.next()){var o=iR(s.value,2),l=o[0],u=o[1];if(!sR(l)){H.warn("Invalid attribute key: "+l);continue}if(!Of(u)){H.warn("Invalid attribute value set for key: "+l);continue}Array.isArray(u)?n[l]=u.slice():n[l]=u}}catch(a){t={error:a}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}function sR(e){return typeof e=="string"&&e.length>0}function Of(e){return e==null?!0:Array.isArray(e)?oR(e):Gf(e)}function oR(e){var t,r,n;try{for(var i=Nf(e),s=i.next();!s.done;s=i.next()){var o=s.value;if(o!=null){if(!n){if(Gf(o)){n=typeof o;continue}return!1}if(typeof o!==n)return!1}}}catch(l){t={error:l}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return!0}function Gf(e){switch(typeof e){case"number":case"boolean":case"string":return!0}return!1}function aR(){return function(e){H.error(lR(e))}}function lR(e){return typeof e=="string"?e:JSON.stringify(uR(e))}function uR(e){for(var t={},r=e;r!==null;)Object.getOwnPropertyNames(r).forEach(function(n){if(!t[n]){var i=r[n];i&&(t[n]=String(i))}}),r=Object.getPrototypeOf(r);return t}var cR=aR();function Qt(e){try{cR(e)}catch(t){}}var It;(function(e){e.AlwaysOff="always_off",e.AlwaysOn="always_on",e.ParentBasedAlwaysOff="parentbased_always_off",e.ParentBasedAlwaysOn="parentbased_always_on",e.ParentBasedTraceIdRatio="parentbased_traceidratio",e.TraceIdRatio="traceidratio"})(It||(It={}));var dR=",",hR=["OTEL_SDK_DISABLED"];function fR(e){return hR.indexOf(e)>-1}var pR=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];function mR(e){return pR.indexOf(e)>-1}var gR=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];function yR(e){return gR.indexOf(e)>-1}var ts=1/0,rs=128,bR=128,vR=128,Vf={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:xe.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:ts,OTEL_ATTRIBUTE_COUNT_LIMIT:rs,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:ts,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:rs,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:ts,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:rs,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:bR,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:vR,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:It.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};function SR(e,t,r){if(typeof r[e]!="undefined"){var n=String(r[e]);t[e]=n.toLowerCase()==="true"}}function wR(e,t,r,n,i){if(n===void 0&&(n=-1/0),i===void 0&&(i=1/0),typeof r[e]!="undefined"){var s=Number(r[e]);isNaN(s)||(s<n?t[e]=n:s>i?t[e]=i:t[e]=s)}}function RR(e,t,r,n){n===void 0&&(n=dR);var i=r[e];typeof i=="string"&&(t[e]=i.split(n).map(function(s){return s.trim()}))}var _R={ALL:xe.ALL,VERBOSE:xe.VERBOSE,DEBUG:xe.DEBUG,INFO:xe.INFO,WARN:xe.WARN,ERROR:xe.ERROR,NONE:xe.NONE};function TR(e,t,r){var n=r[e];if(typeof n=="string"){var i=_R[n.toUpperCase()];i!=null&&(t[e]=i)}}function kf(e){var t={};for(var r in Vf){var n=r;switch(n){case"OTEL_LOG_LEVEL":TR(n,t,e);break;default:if(fR(n))SR(n,t,e);else if(mR(n))wR(n,t,e);else if(yR(n))RR(n,t,e);else{var i=e[n];typeof i!="undefined"&&i!==null&&(t[n]=String(i))}}}return t}var Nn=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{};function Jr(){var e=kf(Nn);return Object.assign({},Vf,e)}function ER(){return kf(Nn)}function Xf(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function El(e){for(var t=new Uint8Array(e.length/2),r=0,n=0;n<e.length;n+=2){var i=Xf(e.charCodeAt(n)),s=Xf(e.charCodeAt(n+1));t[r++]=i<<4|s}return t}var lt=performance,IR="1.30.1",CR="process.runtime.name",ZR="telemetry.sdk.name",LR="telemetry.sdk.language",xR="telemetry.sdk.version",NR=CR,OR=ZR,GR=LR,VR=xR,kR="webjs",XR=kR,Hr,Il=(Hr={},Hr[OR]="opentelemetry",Hr[NR]="browser",Hr[GR]=XR,Hr[VR]=IR,Hr),WR=9,PR=6,MR=Math.pow(10,PR),ns=Math.pow(10,WR);function ut(e){var t=e/1e3,r=Math.trunc(t),n=Math.round(e%1e3*MR);return[r,n]}function Cl(){var e=lt.timeOrigin;if(typeof e!="number"){var t=lt;e=t.timing&&t.timing.fetchStart}return e}function gr(e){var t=ut(Cl()),r=ut(typeof e=="number"?e:lt.now());return Pf(t,r)}function On(e){if(Zl(e))return e;if(typeof e=="number")return e<Cl()?gr(e):ut(e);if(e instanceof Date)return ut(e.getTime());throw TypeError("Invalid input type")}function AR(e,t){var r=t[0]-e[0],n=t[1]-e[1];return n<0&&(r-=1,n+=ns),[r,n]}function kt(e){return e[0]*ns+e[1]}function is(e){return e[0]*1e6+e[1]/1e3}function Zl(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}function Wf(e){return Zl(e)||typeof e=="number"||e instanceof Date}function Pf(e,t){var r=[e[0]+t[0],e[1]+t[1]];return r[1]>=ns&&(r[1]-=ns,r[0]+=1),r}var _e;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(_e||(_e={}));var UR=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Mf=function(){function e(t){t===void 0&&(t={});var r;this._propagators=(r=t.propagators)!==null&&r!==void 0?r:[],this._fields=Array.from(new Set(this._propagators.map(function(n){return typeof n.fields=="function"?n.fields():[]}).reduce(function(n,i){return n.concat(i)},[])))}return e.prototype.inject=function(t,r,n){var i,s;try{for(var o=UR(this._propagators),l=o.next();!l.done;l=o.next()){var u=l.value;try{u.inject(t,r,n)}catch(a){H.warn("Failed to inject with "+u.constructor.name+". Err: "+a.message)}}}catch(a){i={error:a}}finally{try{l&&!l.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}},e.prototype.extract=function(t,r,n){return this._propagators.reduce(function(i,s){try{return s.extract(i,r,n)}catch(o){H.warn("Failed to extract with "+s.constructor.name+". Err: "+o.message)}return i},t)},e.prototype.fields=function(){return this._fields.slice()},e}(),Ll="[_0-9a-z-*/]",DR="[a-z]"+Ll+"{0,255}",FR="[a-z0-9]"+Ll+"{0,240}@[a-z]"+Ll+"{0,13}",JR=new RegExp("^(?:"+DR+"|"+FR+")$"),HR=/^[ -~]{0,255}[!-~]$/,YR=/,|=/;function BR(e){return JR.test(e)}function zR(e){return HR.test(e)&&!YR.test(e)}var Af=32,KR=512,Uf=",",Df="=",jR=function(){function e(t){this._internalState=new Map,t&&this._parse(t)}return e.prototype.set=function(t,r){var n=this._clone();return n._internalState.has(t)&&n._internalState.delete(t),n._internalState.set(t,r),n},e.prototype.unset=function(t){var r=this._clone();return r._internalState.delete(t),r},e.prototype.get=function(t){return this._internalState.get(t)},e.prototype.serialize=function(){var t=this;return this._keys().reduce(function(r,n){return r.push(n+Df+t.get(n)),r},[]).join(Uf)},e.prototype._parse=function(t){t.length>KR||(this._internalState=t.split(Uf).reverse().reduce(function(r,n){var i=n.trim(),s=i.indexOf(Df);if(s!==-1){var o=i.slice(0,s),l=i.slice(s+1,n.length);BR(o)&&zR(l)&&r.set(o,l)}return r},new Map),this._internalState.size>Af&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Af))))},e.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},e.prototype._clone=function(){var t=new e;return t._internalState=new Map(this._internalState),t},e}(),ss="traceparent",xl="tracestate",QR="00",$R="(?!ff)[\\da-f]{2}",qR="(?![0]{32})[\\da-f]{32}",e_="(?![0]{16})[\\da-f]{16}",t_="[\\da-f]{2}",r_=new RegExp("^\\s?("+$R+")-("+qR+")-("+e_+")-("+t_+")(-.*)?\\s?$");function n_(e){var t=r_.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Ff=function(){function e(){}return e.prototype.inject=function(t,r,n){var i=Se.getSpanContext(t);if(!(!i||wl(t)||!Qi(i))){var s=QR+"-"+i.traceId+"-"+i.spanId+"-0"+Number(i.traceFlags||Vt.NONE).toString(16);n.set(r,ss,s),i.traceState&&n.set(r,xl,i.traceState.serialize())}},e.prototype.extract=function(t,r,n){var i=n.get(r,ss);if(!i)return t;var s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return t;var o=n_(s);if(!o)return t;o.isRemote=!0;var l=n.get(r,xl);if(l){var u=Array.isArray(l)?l.join(","):l;o.traceState=new jR(typeof u=="string"?u:void 0)}return Se.setSpanContext(t,o)},e.prototype.fields=function(){return[ss,xl]},e}(),i_="[object Object]",s_="[object Null]",o_="[object Undefined]",a_=Function.prototype,Jf=a_.toString,l_=Jf.call(Object),u_=c_(Object.getPrototypeOf,Object),Hf=Object.prototype,Yf=Hf.hasOwnProperty,yr=Symbol?Symbol.toStringTag:void 0,Bf=Hf.toString;function c_(e,t){return function(r){return e(t(r))}}function zf(e){if(!d_(e)||h_(e)!==i_)return!1;var t=u_(e);if(t===null)return!0;var r=Yf.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Jf.call(r)===l_}function d_(e){return e!=null&&typeof e=="object"}function h_(e){return e==null?e===void 0?o_:s_:yr&&yr in Object(e)?f_(e):p_(e)}function f_(e){var t=Yf.call(e,yr),r=e[yr],n=!1;try{e[yr]=void 0,n=!0}catch(s){}var i=Bf.call(e);return n&&(t?e[yr]=r:delete e[yr]),i}function p_(e){return Bf.call(e)}var m_=20;function Kf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=e.shift(),n=new WeakMap;e.length>0;)r=jf(r,e.shift(),0,n);return r}function Nl(e){return os(e)?e.slice():e}function jf(e,t,r,n){r===void 0&&(r=0);var i;if(!(r>m_)){if(r++,as(e)||as(t)||$f(t))i=Nl(t);else if(os(e)){if(i=e.slice(),os(t))for(var s=0,o=t.length;s<o;s++)i.push(Nl(t[s]));else if(Gn(t))for(var l=Object.keys(t),s=0,o=l.length;s<o;s++){var u=l[s];i[u]=Nl(t[u])}}else if(Gn(e))if(Gn(t)){if(!g_(e,t))return t;i=Object.assign({},e);for(var l=Object.keys(t),s=0,o=l.length;s<o;s++){var u=l[s],a=t[u];if(as(a))typeof a=="undefined"?delete i[u]:i[u]=a;else{var h=i[u],c=a;if(Qf(e,u,n)||Qf(t,u,n))delete i[u];else{if(Gn(h)&&Gn(c)){var f=n.get(h)||[],d=n.get(c)||[];f.push({obj:e,key:u}),d.push({obj:t,key:u}),n.set(h,f),n.set(c,d)}i[u]=jf(i[u],a,r,n)}}}}else i=t;return i}}function Qf(e,t,r){for(var n=r.get(e[t])||[],i=0,s=n.length;i<s;i++){var o=n[i];if(o.key===t&&o.obj===e)return!0}return!1}function os(e){return Array.isArray(e)}function $f(e){return typeof e=="function"}function Gn(e){return!as(e)&&!os(e)&&!$f(e)&&typeof e=="object"}function as(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="undefined"||e instanceof Date||e instanceof RegExp||e===null}function g_(e,t){return!(!zf(e)||!zf(t))}var y_=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function qf(e,t){return typeof t=="string"?e===t:!!e.match(t)}function ep(e,t){var r,n;if(!t)return!1;try{for(var i=y_(t),s=i.next();!s.done;s=i.next()){var o=s.value;if(qf(e,o))return!0}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1}var b_=function(){function e(){var t=this;this._promise=new Promise(function(r,n){t._resolve=r,t._reject=n})}return Object.defineProperty(e.prototype,"promise",{get:function(){return this._promise},enumerable:!1,configurable:!0}),e.prototype.resolve=function(t){this._resolve(t)},e.prototype.reject=function(t){this._reject(t)},e}(),v_=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},S_=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},w_=function(){function e(t,r){this._callback=t,this._that=r,this._isCalled=!1,this._deferred=new b_}return Object.defineProperty(e.prototype,"isCalled",{get:function(){return this._isCalled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"promise",{get:function(){return this._deferred.promise},enumerable:!1,configurable:!0}),e.prototype.call=function(){for(var t,r=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(!this._isCalled){this._isCalled=!0;try{Promise.resolve((t=this._callback).call.apply(t,S_([this._that],v_(n),!1))).then(function(s){return r._deferred.resolve(s)},function(s){return r._deferred.reject(s)})}catch(s){this._deferred.reject(s)}}return this._deferred.promise},e}();function R_(e,t){return new Promise(function(r){he.with(Lf(he.active()),function(){e.export(t,function(n){r(n)})})})}var __={_export:R_},tp=function(){function e(){}return e.prototype.emit=function(t){},e}(),T_=new tp,E_=function(){function e(){}return e.prototype.getLogger=function(t,r,n){return new tp},e}(),rp=new E_,I_=function(){function e(t,r,n,i){this._provider=t,this.name=r,this.version=n,this.options=i}return e.prototype.emit=function(t){this._getLogger().emit(t)},e.prototype._getLogger=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):T_},e}(),np=function(){function e(){}return e.prototype.getLogger=function(t,r,n){var i;return(i=this.getDelegateLogger(t,r,n))!==null&&i!==void 0?i:new I_(this,t,r,n)},e.prototype.getDelegate=function(){var t;return(t=this._delegate)!==null&&t!==void 0?t:rp},e.prototype.setDelegate=function(t){this._delegate=t},e.prototype.getDelegateLogger=function(t,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getLogger(t,r,n)},e}(),C_=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{},ls=Symbol.for("io.opentelemetry.js.api.logs"),Vn=C_;function Z_(e,t,r){return function(n){return n===e?t:r}}var ip=1,L_=function(){function e(){this._proxyLoggerProvider=new np}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalLoggerProvider=function(t){return Vn[ls]?this.getLoggerProvider():(Vn[ls]=Z_(ip,t,rp),this._proxyLoggerProvider.setDelegate(t),t)},e.prototype.getLoggerProvider=function(){var t,r;return(r=(t=Vn[ls])===null||t===void 0?void 0:t.call(Vn,ip))!==null&&r!==void 0?r:this._proxyLoggerProvider},e.prototype.getLogger=function(t,r,n){return this.getLoggerProvider().getLogger(t,r,n)},e.prototype.disable=function(){delete Vn[ls],this._proxyLoggerProvider=new np},e}(),sp=L_.getInstance();function x_(e,t,r,n){for(var i=0,s=e.length;i<s;i++){var o=e[i];t&&o.setTracerProvider(t),r&&o.setMeterProvider(r),n&&o.setLoggerProvider&&o.setLoggerProvider(n),o.getConfig().enabled||o.enable()}}function N_(e){e.forEach(function(t){return t.disable()})}function O_(e){var t,r,n=e.tracerProvider||Se.getTracerProvider(),i=e.meterProvider||yl.getMeterProvider(),s=e.loggerProvider||sp.getLoggerProvider(),o=(r=(t=e.instrumentations)===null||t===void 0?void 0:t.flat())!==null&&r!==void 0?r:[];return x_(o,n,i,s),function(){N_(o)}}function Ol(e){return typeof e=="function"}var Be=console.error.bind(console);function kn(e,t,r){var n=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:n,writable:!0,value:r})}function Xn(e){e&&e.logger&&(Ol(e.logger)?Be=e.logger:Be("new logger isn't a function, not replacing"))}function op(e,t,r){if(!e||!e[t]){Be("no original function "+t+" to wrap");return}if(!r){Be("no wrapper function"),Be(new Error().stack);return}if(!Ol(e[t])||!Ol(r)){Be("original object and wrapper must be functions");return}var n=e[t],i=r(n,t);return kn(i,"__original",n),kn(i,"__unwrap",function(){e[t]===i&&kn(e,t,n)}),kn(i,"__wrapped",!0),kn(e,t,i),i}function G_(e,t,r){if(e)Array.isArray(e)||(e=[e]);else{Be("must provide one or more modules to patch"),Be(new Error().stack);return}if(!(t&&Array.isArray(t))){Be("must provide one or more functions to wrap on modules");return}e.forEach(function(n){t.forEach(function(i){op(n,i,r)})})}function ap(e,t){if(!e||!e[t]){Be("no function to unwrap."),Be(new Error().stack);return}if(!e[t].__unwrap)Be("no original to unwrap to -- has "+t+" already been unwrapped?");else return e[t].__unwrap()}function V_(e,t){if(e)Array.isArray(e)||(e=[e]);else{Be("must provide one or more modules to patch"),Be(new Error().stack);return}if(!(t&&Array.isArray(t))){Be("must provide one or more functions to unwrap on modules");return}e.forEach(function(r){t.forEach(function(n){ap(r,n)})})}Xn.wrap=op,Xn.massWrap=G_,Xn.unwrap=ap,Xn.massUnwrap=V_;var us=Xn,Gl=function(){return Gl=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Gl.apply(this,arguments)},k_=function(){function e(t,r,n){this.instrumentationName=t,this.instrumentationVersion=r,this._config={},this._wrap=us.wrap,this._unwrap=us.unwrap,this._massWrap=us.massWrap,this._massUnwrap=us.massUnwrap,this.setConfig(n),this._diag=H.createComponentLogger({namespace:t}),this._tracer=Se.getTracer(t,r),this._meter=yl.getMeter(t,r),this._logger=sp.getLogger(t,r),this._updateMetricInstruments()}return Object.defineProperty(e.prototype,"meter",{get:function(){return this._meter},enumerable:!1,configurable:!0}),e.prototype.setMeterProvider=function(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()},Object.defineProperty(e.prototype,"logger",{get:function(){return this._logger},enumerable:!1,configurable:!0}),e.prototype.setLoggerProvider=function(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)},e.prototype.getModuleDefinitions=function(){var t,r=(t=this.init())!==null&&t!==void 0?t:[];return Array.isArray(r)?r:[r]},e.prototype._updateMetricInstruments=function(){},e.prototype.getConfig=function(){return this._config},e.prototype.setConfig=function(t){this._config=Gl({enabled:!0},t)},e.prototype.setTracerProvider=function(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)},Object.defineProperty(e.prototype,"tracer",{get:function(){return this._tracer},enumerable:!1,configurable:!0}),e.prototype._runSpanCustomizationHook=function(t,r,n,i){if(t)try{t(n,i)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},s)}},e}(),X_=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wn=function(e){X_(t,e);function t(r,n,i){var s=e.call(this,r,n,i)||this;return s._config.enabled&&s.enable(),s}return t}(k_);function cs(e,t,r){var n,i;try{i=e()}catch(s){n=s}finally{return t(n,i),i}}function Xe(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}var W_="exception.type",P_="exception.message",M_="exception.stacktrace",Vl=W_,kl=P_,A_=M_,U_="exception",Xl=function(){return Xl=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Xl.apply(this,arguments)},D_=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},lp=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},F_=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},J_=function(){function e(t,r,n,i,s,o,l,u,a,h){l===void 0&&(l=[]),this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:qi.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=n,this._spanContext=i,this.parentSpanId=o,this.kind=s,this.links=l;var c=Date.now();this._performanceStartTime=lt.now(),this._performanceOffset=c-(this._performanceStartTime+Cl()),this._startTimeProvided=u!=null,this.startTime=this._getTime(u!=null?u:c),this.resource=t.resource,this.instrumentationLibrary=t.instrumentationLibrary,this._spanLimits=t.getSpanLimits(),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,h!=null&&this.setAttributes(h),this._spanProcessor=t.getActiveSpanProcessor(),this._spanProcessor.onStart(this,r)}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(t,r){return r==null||this._isSpanEnded()?this:t.length===0?(H.warn("Invalid attribute key: "+t),this):Of(r)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,t)?(this._droppedAttributesCount++,this):(this.attributes[t]=this._truncateToSize(r),this):(H.warn("Invalid attribute value set for key: "+t),this)},e.prototype.setAttributes=function(t){var r,n;try{for(var i=D_(Object.entries(t)),s=i.next();!s.done;s=i.next()){var o=lp(s.value,2),l=o[0],u=o[1];this.setAttribute(l,u)}}catch(a){r={error:a}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return this},e.prototype.addEvent=function(t,r,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return H.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&H.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),Wf(r)&&(Wf(n)||(n=r),r=void 0);var i=es(r);return this.events.push({name:t,attributes:i,time:this._getTime(n),droppedAttributesCount:0}),this},e.prototype.addLink=function(t){return this.links.push(t),this},e.prototype.addLinks=function(t){var r;return(r=this.links).push.apply(r,F_([],lp(t),!1)),this},e.prototype.setStatus=function(t){return this._isSpanEnded()?this:(this.status=Xl({},t),this.status.message!=null&&typeof t.message!="string"&&(H.warn("Dropping invalid status.message of type '"+typeof t.message+"', expected 'string'"),delete this.status.message),this)},e.prototype.updateName=function(t){return this._isSpanEnded()?this:(this.name=t,this)},e.prototype.end=function(t){if(this._isSpanEnded()){H.error(this.name+" "+this._spanContext.traceId+"-"+this._spanContext.spanId+" - You can only call end() on a span once.");return}this._ended=!0,this.endTime=this._getTime(t),this._duration=AR(this.startTime,this.endTime),this._duration[0]<0&&(H.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&&H.warn("Dropped "+this._droppedEventsCount+" events because eventCountLimit reached"),this._spanProcessor.onEnd(this)},e.prototype._getTime=function(t){if(typeof t=="number"&&t<=lt.now())return gr(t+this._performanceOffset);if(typeof t=="number")return ut(t);if(t instanceof Date)return ut(t.getTime());if(Zl(t))return t;if(this._startTimeProvided)return ut(Date.now());var r=lt.now()-this._performanceStartTime;return Pf(this.startTime,ut(r))},e.prototype.isRecording=function(){return this._ended===!1},e.prototype.recordException=function(t,r){var n={};typeof t=="string"?n[kl]=t:t&&(t.code?n[Vl]=t.code.toString():t.name&&(n[Vl]=t.name),t.message&&(n[kl]=t.message),t.stack&&(n[A_]=t.stack)),n[Vl]||n[kl]?this.addEvent(U_,n,r):H.warn("Failed to record an exception "+t)},Object.defineProperty(e.prototype,"duration",{get:function(){return this._duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ended",{get:function(){return this._ended},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"droppedAttributesCount",{get:function(){return this._droppedAttributesCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"droppedEventsCount",{get:function(){return this._droppedEventsCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"droppedLinksCount",{get:function(){return this._droppedLinksCount},enumerable:!1,configurable:!0}),e.prototype._isSpanEnded=function(){return this._ended&&H.warn("Can not execute the operation on ended Span {traceId: "+this._spanContext.traceId+", spanId: "+this._spanContext.spanId+"}"),this._ended},e.prototype._truncateToLimitUtil=function(t,r){return t.length<=r?t:t.substring(0,r)},e.prototype._truncateToSize=function(t){var r=this,n=this._attributeValueLengthLimit;return n<=0?(H.warn("Attribute value limit must be positive, got "+n),t):typeof t=="string"?this._truncateToLimitUtil(t,n):Array.isArray(t)?t.map(function(i){return typeof i=="string"?r._truncateToLimitUtil(i,n):i}):t},e}(),Yr;(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Yr||(Yr={}));var ds=function(){function e(){}return e.prototype.shouldSample=function(){return{decision:Yr.NOT_RECORD}},e.prototype.toString=function(){return"AlwaysOffSampler"},e}(),Br=function(){function e(){}return e.prototype.shouldSample=function(){return{decision:Yr.RECORD_AND_SAMPLED}},e.prototype.toString=function(){return"AlwaysOnSampler"},e}(),Wl=function(){function e(t){var r,n,i,s;this._root=t.root,this._root||(Qt(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Br),this._remoteParentSampled=(r=t.remoteParentSampled)!==null&&r!==void 0?r:new Br,this._remoteParentNotSampled=(n=t.remoteParentNotSampled)!==null&&n!==void 0?n:new ds,this._localParentSampled=(i=t.localParentSampled)!==null&&i!==void 0?i:new Br,this._localParentNotSampled=(s=t.localParentNotSampled)!==null&&s!==void 0?s:new ds}return e.prototype.shouldSample=function(t,r,n,i,s,o){var l=Se.getSpanContext(t);return!l||!Qi(l)?this._root.shouldSample(t,r,n,i,s,o):l.isRemote?l.traceFlags&Vt.SAMPLED?this._remoteParentSampled.shouldSample(t,r,n,i,s,o):this._remoteParentNotSampled.shouldSample(t,r,n,i,s,o):l.traceFlags&Vt.SAMPLED?this._localParentSampled.shouldSample(t,r,n,i,s,o):this._localParentNotSampled.shouldSample(t,r,n,i,s,o)},e.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},e}(),up=function(){function e(t){t===void 0&&(t=0),this._ratio=t,this._ratio=this._normalize(t),this._upperBound=Math.floor(this._ratio*4294967295)}return e.prototype.shouldSample=function(t,r){return{decision:Tf(r)&&this._accumulate(r)<this._upperBound?Yr.RECORD_AND_SAMPLED:Yr.NOT_RECORD}},e.prototype.toString=function(){return"TraceIdRatioBased{"+this._ratio+"}"},e.prototype._normalize=function(t){return typeof t!="number"||isNaN(t)?0:t>=1?1:t<=0?0:t},e.prototype._accumulate=function(t){for(var r=0,n=0;n<t.length/8;n++){var i=n*8,s=parseInt(t.slice(i,i+8),16);r=(r^s)>>>0}return r},e}(),H_=It.AlwaysOn,zr=1;function cp(){var e=Jr();return{sampler:dp(e),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:e.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:e.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:e.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:e.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:e.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:e.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:e.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:e.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT},mergeResourceWithDefaults:!0}}function dp(e){switch(e===void 0&&(e=Jr()),e.OTEL_TRACES_SAMPLER){case It.AlwaysOn:return new Br;case It.AlwaysOff:return new ds;case It.ParentBasedAlwaysOn:return new Wl({root:new Br});case It.ParentBasedAlwaysOff:return new Wl({root:new ds});case It.TraceIdRatio:return new up(hp(e));case It.ParentBasedTraceIdRatio:return new Wl({root:new up(hp(e))});default:return H.error('OTEL_TRACES_SAMPLER value "'+e.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+H_+'".'),new Br}}function hp(e){if(e.OTEL_TRACES_SAMPLER_ARG===void 0||e.OTEL_TRACES_SAMPLER_ARG==="")return H.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+zr+"."),zr;var t=Number(e.OTEL_TRACES_SAMPLER_ARG);return isNaN(t)?(H.error("OTEL_TRACES_SAMPLER_ARG="+e.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+zr+"."),zr):t<0||t>1?(H.error("OTEL_TRACES_SAMPLER_ARG="+e.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+zr+"."),zr):t}function Y_(e){var t={sampler:dp()},r=cp(),n=Object.assign({},r,t,e);return n.generalLimits=Object.assign({},r.generalLimits,e.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,e.spanLimits||{}),n}function B_(e){var t,r,n,i,s,o,l,u,a,h,c,f,d=Object.assign({},e.spanLimits),p=ER();return d.attributeCountLimit=(o=(s=(i=(r=(t=e.spanLimits)===null||t===void 0?void 0:t.attributeCountLimit)!==null&&r!==void 0?r:(n=e.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&i!==void 0?i:p.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:p.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&o!==void 0?o:rs,d.attributeValueLengthLimit=(f=(c=(h=(u=(l=e.spanLimits)===null||l===void 0?void 0:l.attributeValueLengthLimit)!==null&&u!==void 0?u:(a=e.generalLimits)===null||a===void 0?void 0:a.attributeValueLengthLimit)!==null&&h!==void 0?h:p.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&c!==void 0?c:p.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&f!==void 0?f:ts,Object.assign({},e,{spanLimits:d})}var z_=function(){function e(t,r){this._exporter=t,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=Jr();this._maxExportBatchSize=typeof(r==null?void 0:r.maxExportBatchSize)=="number"?r.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof(r==null?void 0:r.maxQueueSize)=="number"?r.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof(r==null?void 0:r.scheduledDelayMillis)=="number"?r.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof(r==null?void 0:r.exportTimeoutMillis)=="number"?r.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new w_(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(H.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}return e.prototype.forceFlush=function(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()},e.prototype.onStart=function(t,r){},e.prototype.onEnd=function(t){this._shutdownOnce.isCalled||(t.spanContext().traceFlags&Vt.SAMPLED)!==0&&this._addToBuffer(t)},e.prototype.shutdown=function(){return this._shutdownOnce.call()},e.prototype._shutdown=function(){var t=this;return Promise.resolve().then(function(){return t.onShutdown()}).then(function(){return t._flushAll()}).then(function(){return t._exporter.shutdown()})},e.prototype._addToBuffer=function(t){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&H.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(H.warn("Dropped "+this._droppedSpansCount+" spans because maxQueueSize reached"),this._droppedSpansCount=0),this._finishedSpans.push(t),this._maybeStartTimer()},e.prototype._flushAll=function(){var t=this;return new Promise(function(r,n){for(var i=[],s=Math.ceil(t._finishedSpans.length/t._maxExportBatchSize),o=0,l=s;o<l;o++)i.push(t._flushOneBatch());Promise.all(i).then(function(){r()}).catch(n)})},e.prototype._flushOneBatch=function(){var t=this;return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise(function(r,n){var i=setTimeout(function(){n(new Error("Timeout"))},t._exportTimeoutMillis);he.with(Lf(he.active()),function(){var s;t._finishedSpans.length<=t._maxExportBatchSize?(s=t._finishedSpans,t._finishedSpans=[]):s=t._finishedSpans.splice(0,t._maxExportBatchSize);for(var o=function(){return t._exporter.export(s,function(c){var f;clearTimeout(i),c.code===_e.SUCCESS?r():n((f=c.error)!==null&&f!==void 0?f:new Error("BatchSpanProcessor: span export failed"))})},l=null,u=0,a=s.length;u<a;u++){var h=s[u];h.resource.asyncAttributesPending&&h.resource.waitForAsyncAttributes&&(l!=null||(l=[]),l.push(h.resource.waitForAsyncAttributes()))}l===null?o():Promise.all(l).then(o,function(c){Qt(c),n(c)})})})},e.prototype._maybeStartTimer=function(){var t=this;if(!this._isExporting){var r=function(){t._isExporting=!0,t._flushOneBatch().finally(function(){t._isExporting=!1,t._finishedSpans.length>0&&(t._clearTimer(),t._maybeStartTimer())}).catch(function(n){t._isExporting=!1,Qt(n)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return r();this._timer===void 0&&(this._timer=setTimeout(function(){return r()},this._scheduledDelayMillis))}},e.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},e}(),K_=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),fp=function(e){K_(t,e);function t(r,n){var i=e.call(this,r,n)||this;return i.onInit(n),i}return t.prototype.onInit=function(r){var n=this;(r==null?void 0:r.disableAutoFlushOnDocumentHide)!==!0&&typeof document!="undefined"&&(this._visibilityChangeListener=function(){document.visibilityState==="hidden"&&n.forceFlush().catch(function(i){Qt(i)})},this._pageHideListener=function(){n.forceFlush().catch(function(i){Qt(i)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))},t.prototype.onShutdown=function(){typeof document!="undefined"&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))},t}(z_),j_=8,Q_=16,$_=function(){function e(){this.generateTraceId=pp(Q_),this.generateSpanId=pp(j_)}return e}(),hs=Array(32);function pp(e){return function(){for(var r=0;r<e*2;r++)hs[r]=Math.floor(Math.random()*16)+48,hs[r]>=58&&(hs[r]+=39);return String.fromCharCode.apply(null,hs.slice(0,e*2))}}var q_=function(){function e(t,r,n){this._tracerProvider=n;var i=Y_(r);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=r.idGenerator||new $_,this.resource=n.resource,this.instrumentationLibrary=t}return e.prototype.startSpan=function(t,r,n){var i,s,o;r===void 0&&(r={}),n===void 0&&(n=he.active()),r.root&&(n=Se.deleteSpan(n));var l=Se.getSpan(n);if(wl(n)){H.debug("Instrumentation suppressed, returning Noop Span");var u=Se.wrapSpanContext(Rf);return u}var a=l==null?void 0:l.spanContext(),h=this._idGenerator.generateSpanId(),c,f,d;!a||!Se.isSpanContextValid(a)?c=this._idGenerator.generateTraceId():(c=a.traceId,f=a.traceState,d=a.spanId);var p=(i=r.kind)!==null&&i!==void 0?i:xn.INTERNAL,m=((s=r.links)!==null&&s!==void 0?s:[]).map(function(b){return{context:b.context,attributes:es(b.attributes)}}),g=es(r.attributes),v=this._sampler.shouldSample(n,c,t,p,g,m);f=(o=v.traceState)!==null&&o!==void 0?o:f;var y=v.decision===$i.RECORD_AND_SAMPLED?Vt.SAMPLED:Vt.NONE,S={traceId:c,spanId:h,traceFlags:y,traceState:f};if(v.decision===$i.NOT_RECORD){H.debug("Recording is off, propagating context in a non-recording span");var u=Se.wrapSpanContext(S);return u}var _=es(Object.assign(g,v.attributes)),w=new J_(this,n,t,S,p,d,m,r.startTime,void 0,_);return w},e.prototype.startActiveSpan=function(t,r,n,i){var s,o,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(s=r,l=n):(s=r,o=n,l=i);var u=o!=null?o:he.active(),a=this.startSpan(t,s,u),h=Se.setSpan(u,a);return he.with(h,l,void 0,a)}},e.prototype.getGeneralLimits=function(){return this._generalLimits},e.prototype.getSpanLimits=function(){return this._spanLimits},e.prototype.getActiveSpanProcessor=function(){return this._tracerProvider.getActiveSpanProcessor()},e}(),eT="service.name",tT="telemetry.sdk.name",rT="telemetry.sdk.language",nT="telemetry.sdk.version",iT=eT,mp=tT,gp=rT,yp=nT;function sT(){return"unknown_service"}var $t=function(){return $t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},$t.apply(this,arguments)},oT=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(h){try{a(n.next(h))}catch(c){o(c)}}function u(h){try{a(n.throw(h))}catch(c){o(c)}}function a(h){h.done?s(h.value):i(h.value).then(l,u)}a((n=n.apply(e,t||[])).next())})},aT=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(a){return function(h){return u([a,h])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(h){a=[6,h],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},lT=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},Pn=function(){function e(t,r){var n=this,i;this._attributes=t,this.asyncAttributesPending=r!=null,this._syncAttributes=(i=this._attributes)!==null&&i!==void 0?i:{},this._asyncAttributesPromise=r==null?void 0:r.then(function(s){return n._attributes=Object.assign({},n._attributes,s),n.asyncAttributesPending=!1,s},function(s){return H.debug("a resource's async attributes promise rejected: %s",s),n.asyncAttributesPending=!1,{}})}return e.empty=function(){return e.EMPTY},e.default=function(){var t;return new e((t={},t[iT]=sT(),t[gp]=Il[gp],t[mp]=Il[mp],t[yp]=Il[yp],t))},Object.defineProperty(e.prototype,"attributes",{get:function(){var t;return this.asyncAttributesPending&&H.error("Accessing resource attributes before async attributes settled"),(t=this._attributes)!==null&&t!==void 0?t:{}},enumerable:!1,configurable:!0}),e.prototype.waitForAsyncAttributes=function(){return oT(this,void 0,void 0,function(){return aT(this,function(t){switch(t.label){case 0:return this.asyncAttributesPending?[4,this._asyncAttributesPromise]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},e.prototype.merge=function(t){var r=this,n;if(!t)return this;var i=$t($t({},this._syncAttributes),(n=t._syncAttributes)!==null&&n!==void 0?n:t.attributes);if(!this._asyncAttributesPromise&&!t._asyncAttributesPromise)return new e(i);var s=Promise.all([this._asyncAttributesPromise,t._asyncAttributesPromise]).then(function(o){var l,u=lT(o,2),a=u[0],h=u[1];return $t($t($t($t({},r._syncAttributes),a),(l=t._syncAttributes)!==null&&l!==void 0?l:t.attributes),h)});return new e(i,s)},e.EMPTY=new e({}),e}(),fs=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},bp=function(){function e(t){this._spanProcessors=t}return e.prototype.forceFlush=function(){var t,r,n=[];try{for(var i=fs(this._spanProcessors),s=i.next();!s.done;s=i.next()){var o=s.value;n.push(o.forceFlush())}}catch(l){t={error:l}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return new Promise(function(l){Promise.all(n).then(function(){l()}).catch(function(u){Qt(u||new Error("MultiSpanProcessor: forceFlush failed")),l()})})},e.prototype.onStart=function(t,r){var n,i;try{for(var s=fs(this._spanProcessors),o=s.next();!o.done;o=s.next()){var l=o.value;l.onStart(t,r)}}catch(u){n={error:u}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}},e.prototype.onEnd=function(t){var r,n;try{for(var i=fs(this._spanProcessors),s=i.next();!s.done;s=i.next()){var o=s.value;o.onEnd(t)}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},e.prototype.shutdown=function(){var t,r,n=[];try{for(var i=fs(this._spanProcessors),s=i.next();!s.done;s=i.next()){var o=s.value;n.push(o.shutdown())}}catch(l){t={error:l}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return new Promise(function(l,u){Promise.all(n).then(function(){l()},u)})},e}(),uT=function(){function e(){}return e.prototype.onStart=function(t,r){},e.prototype.onEnd=function(t){},e.prototype.shutdown=function(){return Promise.resolve()},e.prototype.forceFlush=function(){return Promise.resolve()},e}(),cT=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},dT=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},br;(function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"})(br||(br={}));var hT=function(){function e(t){t===void 0&&(t={});var r,n;this._registeredSpanProcessors=[],this._tracers=new Map;var i=Kf({},cp(),B_(t));if(this.resource=(r=i.resource)!==null&&r!==void 0?r:Pn.empty(),i.mergeResourceWithDefaults&&(this.resource=Pn.default().merge(this.resource)),this._config=Object.assign({},i,{resource:this.resource}),!((n=t.spanProcessors)===null||n===void 0)&&n.length)this._registeredSpanProcessors=dT([],cT(t.spanProcessors),!1),this.activeSpanProcessor=new bp(this._registeredSpanProcessors);else{var s=this._buildExporterFromEnv();if(s!==void 0){var o=new fp(s);this.activeSpanProcessor=o}else this.activeSpanProcessor=new uT}}return e.prototype.getTracer=function(t,r,n){var i=t+"@"+(r||"")+":"+((n==null?void 0:n.schemaUrl)||"");return this._tracers.has(i)||this._tracers.set(i,new q_({name:t,version:r,schemaUrl:n==null?void 0:n.schemaUrl},this._config,this)),this._tracers.get(i)},e.prototype.addSpanProcessor=function(t){this._registeredSpanProcessors.length===0&&this.activeSpanProcessor.shutdown().catch(function(r){return H.error("Error while trying to shutdown current span processor",r)}),this._registeredSpanProcessors.push(t),this.activeSpanProcessor=new bp(this._registeredSpanProcessors)},e.prototype.getActiveSpanProcessor=function(){return this.activeSpanProcessor},e.prototype.register=function(t){t===void 0&&(t={}),Se.setGlobalTracerProvider(this),t.propagator===void 0&&(t.propagator=this._buildPropagatorFromEnv()),t.contextManager&&he.setGlobalContextManager(t.contextManager),t.propagator&&at.setGlobalPropagator(t.propagator)},e.prototype.forceFlush=function(){var t=this._config.forceFlushTimeoutMillis,r=this._registeredSpanProcessors.map(function(n){return new Promise(function(i){var s,o=setTimeout(function(){i(new Error("Span processor did not completed within timeout period of "+t+" ms")),s=br.timeout},t);n.forceFlush().then(function(){clearTimeout(o),s!==br.timeout&&(s=br.resolved,i(s))}).catch(function(l){clearTimeout(o),s=br.error,i(l)})})});return new Promise(function(n,i){Promise.all(r).then(function(s){var o=s.filter(function(l){return l!==br.resolved});o.length>0?i(o):n()}).catch(function(s){return i([s])})})},e.prototype.shutdown=function(){return this.activeSpanProcessor.shutdown()},e.prototype._getPropagator=function(t){var r;return(r=this.constructor._registeredPropagators.get(t))===null||r===void 0?void 0:r()},e.prototype._getSpanExporter=function(t){var r;return(r=this.constructor._registeredExporters.get(t))===null||r===void 0?void 0:r()},e.prototype._buildPropagatorFromEnv=function(){var t=this,r=Array.from(new Set(Jr().OTEL_PROPAGATORS)),n=r.map(function(s){var o=t._getPropagator(s);return o||H.warn('Propagator "'+s+'" requested through environment variable is unavailable.'),o}),i=n.reduce(function(s,o){return o&&s.push(o),s},[]);if(i.length!==0)return r.length===1?i[0]:new Mf({propagators:i})},e.prototype._buildExporterFromEnv=function(){var t=Jr().OTEL_TRACES_EXPORTER;if(!(t==="none"||t==="")){var r=this._getSpanExporter(t);return r||H.error('Exporter "'+t+'" requested through environment variable is unavailable.'),r}},e._registeredPropagators=new Map([["tracecontext",function(){return new Ff}],["baggage",function(){return new xf}]]),e._registeredExporters=new Map,e}(),fT=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},pT=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},vp=function(){function e(){this._enabled=!1,this._currentContext=pr}return e.prototype._bindFunction=function(t,r){t===void 0&&(t=pr);var n=this,i=function(){for(var s=this,o=[],l=0;l<arguments.length;l++)o[l]=arguments[l];return n.with(t,function(){return r.apply(s,o)})};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:r.length}),i},e.prototype.active=function(){return this._currentContext},e.prototype.bind=function(t,r){return t===void 0&&(t=this.active()),typeof r=="function"?this._bindFunction(t,r):r},e.prototype.disable=function(){return this._currentContext=pr,this._enabled=!1,this},e.prototype.enable=function(){return this._enabled?this:(this._enabled=!0,this._currentContext=pr,this)},e.prototype.with=function(t,r,n){for(var i=[],s=3;s<arguments.length;s++)i[s-3]=arguments[s];var o=this._currentContext;this._currentContext=t||pr;try{return r.call.apply(r,pT([n],fT(i),!1))}finally{this._currentContext=o}},e}(),mT=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),gT=function(e){mT(t,e);function t(r){r===void 0&&(r={});var n=e.call(this,r)||this;if(r.contextManager)throw"contextManager should be defined in register method not in constructor";if(r.propagator)throw"propagator should be defined in register method not in constructor";return n}return t.prototype.register=function(r){r===void 0&&(r={}),r.contextManager===void 0&&(r.contextManager=new vp),r.contextManager&&r.contextManager.enable(),e.prototype.register.call(this,r)},t}(hT),re;(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.UNLOAD_EVENT_END="unloadEventEnd",e.UNLOAD_EVENT_START="unloadEventStart"})(re||(re={}));var yT="http.response_content_length",bT="http.response_content_length_uncompressed",vT=yT,ST=bT,Pl;function wT(){return Pl||(Pl=document.createElement("a")),Pl}function qt(e,t){return t in e}function We(e,t,r,n){var i=void 0,s=void 0;qt(r,t)&&typeof r[t]=="number"&&(i=r[t]);var o=re.FETCH_START;if(qt(r,o)&&typeof r[o]=="number"&&(s=r[o]),i!==void 0&&s!==void 0&&i>=s)return e.addEvent(t,i),e}function Kr(e,t,r){r===void 0&&(r=!1),r||(We(e,re.FETCH_START,t),We(e,re.DOMAIN_LOOKUP_START,t),We(e,re.DOMAIN_LOOKUP_END,t),We(e,re.CONNECT_START,t),qt(t,"name")&&t.name.startsWith("https:")&&We(e,re.SECURE_CONNECTION_START,t),We(e,re.CONNECT_END,t),We(e,re.REQUEST_START,t),We(e,re.RESPONSE_START,t),We(e,re.RESPONSE_END,t));var n=t[re.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(vT,n);var i=t[re.DECODED_BODY_SIZE];i!==void 0&&n!==i&&e.setAttribute(ST,i)}function RT(e){return e.slice().sort(function(t,r){var n=t[re.FETCH_START],i=r[re.FETCH_START];return n>i?1:n<i?-1:0})}function Sp(){return typeof location!="undefined"?location.origin:void 0}function wp(e,t,r,n,i,s){i===void 0&&(i=new WeakSet);var o=Xt(e);e=o.toString();var l=TT(e,t,r,n,i,s);if(l.length===0)return{mainRequest:void 0};if(l.length===1)return{mainRequest:l[0]};var u=RT(l);if(o.origin!==Sp()&&u.length>1){var a=u[0],h=_T(u,a[re.RESPONSE_END],r),c=a[re.RESPONSE_END],f=h[re.FETCH_START];return f<c&&(h=a,a=void 0),{corsPreFlightRequest:a,mainRequest:h}}else return{mainRequest:l[0]}}function _T(e,t,r){for(var n=kt(r),i=kt(On(t)),s=e[1],o,l=e.length,u=1;u<l;u++){var a=e[u],h=kt(On(a[re.FETCH_START])),c=kt(On(a[re.RESPONSE_END])),f=n-c;h>=i&&(!o||f<o)&&(o=f,s=a)}return s}function TT(e,t,r,n,i,s){var o=kt(t),l=kt(r),u=n.filter(function(a){var h=kt(On(a[re.FETCH_START])),c=kt(On(a[re.RESPONSE_END]));return a.initiatorType.toLowerCase()===(s||"xmlhttprequest")&&a.name===e&&h>=o&&c<=l});return u.length>0&&(u=u.filter(function(a){return!i.has(a)})),u}function Xt(e){if(typeof URL=="function")return new URL(e,typeof document!="undefined"?document.baseURI:typeof location!="undefined"?location.href:void 0);var t=wT();return t.href=e,t}function Rp(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return"/";var r=IT(e,t);if(t&&r.indexOf("@id")>0)return r;var n="";return e.parentNode&&(n+=Rp(e.parentNode,!1)),n+=r,n}function ET(e){if(!e.parentNode)return 0;var t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);var r=Array.from(e.parentNode.childNodes);return r=r.filter(function(n){var i=n.localName;return t.indexOf(n.nodeType)>=0&&i===e.localName}),r.length>=1?r.indexOf(e)+1:0}function IT(e,t){var r=e.nodeType,n=ET(e),i="";if(r===Node.ELEMENT_NODE){var s=e.getAttribute("id");if(t&&s)return'//*[@id="'+s+'"]';i=e.localName}else if(r===Node.TEXT_NODE||r===Node.CDATA_SECTION_NODE)i="text()";else if(r===Node.COMMENT_NODE)i="comment()";else return"";return i&&n>1?"/"+i+"["+n+"]":"/"+i}function _p(e,t){var r=t||[];(typeof r=="string"||r instanceof RegExp)&&(r=[r]);var n=Xt(e);return n.origin===Sp()?!0:r.some(function(i){return qf(e,i)})}var Mn;(function(e){e.DOCUMENT_LOAD="documentLoad",e.DOCUMENT_FETCH="documentFetch",e.RESOURCE_FETCH="resourceFetch"})(Mn||(Mn={}));var CT="0.44.0",ZT="@opentelemetry/instrumentation-document-load";const LT="http.method",xT="http.url",NT="http.status_code",OT="http.user_agent",GT=LT,jr=xT,VT=NT,kT=OT,Ml="exception.message",XT="exception.stacktrace",Al="exception.type",Tp="http.response.status_code",WT="server.address",PT="service.name",MT="service.version",Ep="telemetry.sdk.name",Ip="telemetry.sdk.version",er="url.full",ps="url.path",AT="url.query",UT="user_agent.original";var ms;(function(e){e.FIRST_PAINT="firstPaint",e.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"})(ms||(ms={}));var DT=function(){var e,t,r={},n=(t=(e=lt).getEntriesByType)===null||t===void 0?void 0:t.call(e,"navigation")[0];if(n){var i=Object.values(re);i.forEach(function(l){if(qt(n,l)){var u=n[l];typeof u=="number"&&(r[l]=u)}})}else{var s=lt,o=s.timing;if(o){var i=Object.values(re);i.forEach(function(u){if(qt(o,u)){var a=o[u];typeof a=="number"&&(r[u]=a)}})}}return r},Cp={"first-paint":ms.FIRST_PAINT,"first-contentful-paint":ms.FIRST_CONTENTFUL_PAINT},FT=function(e){var t,r,n=(r=(t=lt).getEntriesByType)===null||r===void 0?void 0:r.call(t,"paint");n&&n.forEach(function(i){var s=i.name,o=i.startTime;qt(Cp,s)&&e.addEvent(Cp[s],o)})},JT=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),HT=function(e){JT(t,e);function t(r){r===void 0&&(r={});var n=e.call(this,ZT,CT,r)||this;return n.component="document-load",n.version="1",n.moduleName=n.component,n}return t.prototype.init=function(){},t.prototype._onDocumentLoaded=function(){var r=this;window.setTimeout(function(){r._collectPerformance()})},t.prototype._addResourcesSpans=function(r){var n=this,i,s,o=(s=(i=lt).getEntriesByType)===null||s===void 0?void 0:s.call(i,"resource");o&&o.forEach(function(l){n._initResourceSpan(l,r)})},t.prototype._collectPerformance=function(){var r=this,n=Array.from(document.getElementsByTagName("meta")).find(function(o){return o.getAttribute("name")===ss}),i=DT(),s=n&&n.content||"";he.with(at.extract(pr,{traceparent:s}),function(){var o,l=r._startSpan(Mn.DOCUMENT_LOAD,re.FETCH_START,i);l&&(he.with(Se.setSpan(he.active(),l),function(){var u=r._startSpan(Mn.DOCUMENT_FETCH,re.FETCH_START,i);u&&(u.setAttribute(jr,location.href),he.with(Se.setSpan(he.active(),u),function(){var a;r.getConfig().ignoreNetworkEvents||Kr(u,i),r._addCustomAttributesOnSpan(u,(a=r.getConfig().applyCustomAttributesOnSpan)===null||a===void 0?void 0:a.documentFetch),r._endSpan(u,re.RESPONSE_END,i)}))}),l.setAttribute(jr,location.href),l.setAttribute(kT,navigator.userAgent),r._addResourcesSpans(l),r.getConfig().ignoreNetworkEvents||(We(l,re.FETCH_START,i),We(l,re.UNLOAD_EVENT_START,i),We(l,re.UNLOAD_EVENT_END,i),We(l,re.DOM_INTERACTIVE,i),We(l,re.DOM_CONTENT_LOADED_EVENT_START,i),We(l,re.DOM_CONTENT_LOADED_EVENT_END,i),We(l,re.DOM_COMPLETE,i),We(l,re.LOAD_EVENT_START,i),We(l,re.LOAD_EVENT_END,i)),r.getConfig().ignorePerformancePaintEvents||FT(l),r._addCustomAttributesOnSpan(l,(o=r.getConfig().applyCustomAttributesOnSpan)===null||o===void 0?void 0:o.documentLoad),r._endSpan(l,re.LOAD_EVENT_END,i))})},t.prototype._endSpan=function(r,n,i){r&&(qt(i,n)?r.end(i[n]):r.end())},t.prototype._initResourceSpan=function(r,n){var i,s=this._startSpan(Mn.RESOURCE_FETCH,re.FETCH_START,r,n);s&&(s.setAttribute(jr,r.name),this.getConfig().ignoreNetworkEvents||Kr(s,r),this._addCustomAttributesOnResourceSpan(s,r,(i=this.getConfig().applyCustomAttributesOnSpan)===null||i===void 0?void 0:i.resourceFetch),this._endSpan(s,re.RESPONSE_END,r))},t.prototype._startSpan=function(r,n,i,s){if(qt(i,n)&&typeof i[n]=="number"){var o=this.tracer.startSpan(r,{startTime:i[n]},s?Se.setSpan(he.active(),s):void 0);return o}},t.prototype._waitForPageLoad=function(){window.document.readyState==="complete"?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))},t.prototype._addCustomAttributesOnSpan=function(r,n){var i=this;n&&cs(function(){return n(r)},function(s){s&&i._diag.error("addCustomAttributesOnSpan",s)})},t.prototype._addCustomAttributesOnResourceSpan=function(r,n,i){var s=this;i&&cs(function(){return i(r,n)},function(o){o&&s._diag.error("addCustomAttributesOnResourceSpan",o)})},t.prototype.enable=function(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()},t.prototype.disable=function(){window.removeEventListener("load",this._onDocumentLoaded)},t}(Wn),gs;(function(e){e.COMPONENT="component",e.HTTP_ERROR_NAME="http.error_name",e.HTTP_STATUS_TEXT="http.status_text"})(gs||(gs={}));var YT="http.method",BT="http.url",zT="http.host",KT="http.scheme",jT="http.status_code",QT="http.user_agent",$T="http.request_content_length_uncompressed",qT=YT,eE=BT,tE=zT,rE=KT,nE=jT,iE=QT,sE=$T,oE=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(h){try{a(n.next(h))}catch(c){o(c)}}function u(h){try{a(n.throw(h))}catch(c){o(c)}}function a(h){h.done?s(h.value):i(h.value).then(l,u)}a((n=n.apply(e,t||[])).next())})},aE=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(a){return function(h){return u([a,h])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(h){a=[6,h],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},lE=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},uE=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},Zp=H.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function cE(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e[0]instanceof URL||typeof e[0]=="string"){var r=e[1];if(!(r!=null&&r.body))return Promise.resolve();if(r.body instanceof ReadableStream){var n=dE(r.body),i=n.body,s=n.length;return r.body=i,s}else return Promise.resolve(hE(r.body))}else{var o=e[0];return o!=null&&o.body?o.clone().text().then(function(l){return Ul(l)}):Promise.resolve()}}function dE(e){if(!e.pipeThrough)return Zp.warn("Platform has ReadableStream but not pipeThrough!"),{body:e,length:Promise.resolve(void 0)};var t=0,r,n=new Promise(function(s){r=s}),i=new TransformStream({start:function(){},transform:function(s,o){return oE(this,void 0,void 0,function(){var l;return aE(this,function(u){switch(u.label){case 0:return[4,s];case 1:return l=u.sent(),t+=l.byteLength,o.enqueue(s),[2]}})})},flush:function(){r(t)}});return{body:e.pipeThrough(i),length:n}}function hE(e){if(typeof Document!="undefined"&&e instanceof Document)return new XMLSerializer().serializeToString(document).length;if(e instanceof Blob)return e.size;if(e.byteLength!==void 0)return e.byteLength;if(e instanceof FormData)return pE(e);if(e instanceof URLSearchParams)return Ul(e.toString());if(typeof e=="string")return Ul(e);Zp.warn("unknown body type")}var fE=new TextEncoder;function Ul(e){return fE.encode(e).byteLength}function pE(e){var t,r,n=0;try{for(var i=lE(e.entries()),s=i.next();!s.done;s=i.next()){var o=uE(s.value,2),l=o[0],u=o[1];n+=l.length,u instanceof Blob?n+=u.size:n+=u.length}}catch(a){t={error:a}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}var Lp="0.57.2",mE=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),gE=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},yE=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},Dl,bE=300,xp=typeof process=="object"&&((Dl=process.release)===null||Dl===void 0?void 0:Dl.name)==="node",vE=function(e){mE(t,e);function t(r){r===void 0&&(r={});var n=e.call(this,"@opentelemetry/instrumentation-fetch",Lp,r)||this;return n.component="fetch",n.version=Lp,n.moduleName=n.component,n._usedResources=new WeakSet,n._tasksCount=0,n}return t.prototype.init=function(){},t.prototype._addChildSpan=function(r,n){var i=this.tracer.startSpan("CORS Preflight",{startTime:n[re.FETCH_START]},Se.setSpan(he.active(),r));Kr(i,n,this.getConfig().ignoreNetworkEvents),i.end(n[re.RESPONSE_END])},t.prototype._addFinalSpanAttributes=function(r,n){var i=Xt(n.url);r.setAttribute(nE,n.status),n.statusText!=null&&r.setAttribute(gs.HTTP_STATUS_TEXT,n.statusText),r.setAttribute(tE,i.host),r.setAttribute(rE,i.protocol.replace(":","")),typeof navigator!="undefined"&&r.setAttribute(iE,navigator.userAgent)},t.prototype._addHeaders=function(r,n){if(!_p(n,this.getConfig().propagateTraceHeaderCorsUrls)){var i={};at.inject(he.active(),i),Object.keys(i).length>0&&this._diag.debug("headers inject skipped due to CORS policy");return}if(r instanceof Request)at.inject(he.active(),r.headers,{set:function(s,o,l){return s.set(o,typeof l=="string"?l:String(l))}});else if(r.headers instanceof Headers)at.inject(he.active(),r.headers,{set:function(s,o,l){return s.set(o,typeof l=="string"?l:String(l))}});else if(r.headers instanceof Map)at.inject(he.active(),r.headers,{set:function(s,o,l){return s.set(o,typeof l=="string"?l:String(l))}});else{var i={};at.inject(he.active(),i),r.headers=Object.assign({},i,r.headers||{})}},t.prototype._clearResources=function(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)},t.prototype._createSpan=function(r,n){var i;if(n===void 0&&(n={}),ep(r,this.getConfig().ignoreUrls)){this._diag.debug("ignoring span as url matches ignored url");return}var s=(n.method||"GET").toUpperCase(),o="HTTP "+s;return this.tracer.startSpan(o,{kind:xn.CLIENT,attributes:(i={},i[gs.COMPONENT]=this.moduleName,i[qT]=s,i[eE]=r,i)})},t.prototype._findResourceAndAddNetworkEvents=function(r,n,i){var s=n.entries;if(!s.length){if(!performance.getEntriesByType)return;s=performance.getEntriesByType("resource")}var o=wp(n.spanUrl,n.startTime,i,s,this._usedResources,"fetch");if(o.mainRequest){var l=o.mainRequest;this._markResourceAsUsed(l);var u=o.corsPreFlightRequest;u&&(this._addChildSpan(r,u),this._markResourceAsUsed(u)),Kr(r,l,this.getConfig().ignoreNetworkEvents)}},t.prototype._markResourceAsUsed=function(r){this._usedResources.add(r)},t.prototype._endSpan=function(r,n,i){var s=this,o=ut(Date.now()),l=gr();this._addFinalSpanAttributes(r,i),setTimeout(function(){var u;(u=n.observer)===null||u===void 0||u.disconnect(),s._findResourceAndAddNetworkEvents(r,n,l),s._tasksCount--,s._clearResources(),r.end(o)},bE)},t.prototype._patchConstructor=function(){var r=this;return function(n){var i=r;return function(){for(var o=[],l=0;l<arguments.length;l++)o[l]=arguments[l];var u=this,a=Xt(o[0]instanceof Request?o[0].url:String(o[0])).href,h=o[0]instanceof Request?o[0]:o[1]||{},c=i._createSpan(a,h);if(!c)return n.apply(this,o);var f=i._prepareSpanData(a);i.getConfig().measureRequestSize&&cE.apply(void 0,yE([],gE(o),!1)).then(function(v){v&&c.setAttribute(sE,v)}).catch(function(v){i._diag.warn("getFetchBodyLength",v)});function d(v,y){i._applyAttributesAfterFetch(v,h,y),i._endSpan(v,f,{status:y.status||0,statusText:y.message,url:a})}function p(v,y){i._applyAttributesAfterFetch(v,h,y),y.status>=200&&y.status<400?i._endSpan(v,f,y):i._endSpan(v,f,{status:y.status,statusText:y.statusText,url:a})}function m(v,y,S){try{var _=S.clone(),w=S.clone(),b=_.body;if(b){var R=b.getReader(),E=function(){R.read().then(function(I){var C=I.done;C?p(v,w):E()},function(I){d(v,I)})};E()}else p(v,S)}finally{y(S)}}function g(v,y,S){try{d(v,S)}finally{y(S)}}return new Promise(function(v,y){return he.with(Se.setSpan(he.active(),c),function(){return i._addHeaders(h,a),i._tasksCount++,n.apply(u,h instanceof Request?[h]:[a,h]).then(m.bind(u,c,v),g.bind(u,c,y))})})}}},t.prototype._applyAttributesAfterFetch=function(r,n,i){var s=this,o=this.getConfig().applyCustomAttributesOnSpan;o&&cs(function(){return o(r,n,i)},function(l){l&&s._diag.error("applyCustomAttributesOnSpan",l)})},t.prototype._prepareSpanData=function(r){var n=gr(),i=[];if(typeof PerformanceObserver!="function")return{entries:i,startTime:n,spanUrl:r};var s=new PerformanceObserver(function(o){var l=o.getEntries();l.forEach(function(u){u.initiatorType==="fetch"&&u.name===r&&i.push(u)})});return s.observe({entryTypes:["resource"]}),{entries:i,observer:s,startTime:n,spanUrl:r}},t.prototype.enable=function(){if(xp){this._diag.warn("this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()");return}Xe(fetch)&&(this._unwrap(Nn,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(Nn,"fetch",this._patchConstructor())},t.prototype.disable=function(){xp||(this._unwrap(Nn,"fetch"),this._usedResources=new WeakSet)},t}(Wn),SE="http.method",wE="http.url",RE="http.host",_E="http.scheme",TE="http.status_code",EE="http.user_agent",IE="http.request_content_length_uncompressed",CE=SE,ZE=wE,LE=RE,xE=_E,NE=TE,OE=EE,GE=IE,Wt;(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"})(Wt||(Wt={}));var VE=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},kE=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},XE=H.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function WE(e){if(typeof Document!="undefined"&&e instanceof Document)return new XMLSerializer().serializeToString(document).length;if(e instanceof Blob)return e.size;if(e.byteLength!==void 0)return e.byteLength;if(e instanceof FormData)return ME(e);if(e instanceof URLSearchParams)return Np(e.toString());if(typeof e=="string")return Np(e);XE.warn("unknown body type")}var PE=new TextEncoder;function Np(e){return PE.encode(e).byteLength}function ME(e){var t,r,n=0;try{for(var i=VE(e.entries()),s=i.next();!s.done;s=i.next()){var o=kE(s.value,2),l=o[0],u=o[1];n+=l.length,u instanceof Blob?n+=u.size:n+=u.length}}catch(a){t={error:a}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}var Op="0.57.2",Fl;(function(e){e.HTTP_STATUS_TEXT="http.status_text"})(Fl||(Fl={}));var AE=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),UE=300,DE=function(e){AE(t,e);function t(r){r===void 0&&(r={});var n=e.call(this,"@opentelemetry/instrumentation-xml-http-request",Op,r)||this;return n.component="xml-http-request",n.version=Op,n.moduleName=n.component,n._tasksCount=0,n._xhrMem=new WeakMap,n._usedResources=new WeakSet,n}return t.prototype.init=function(){},t.prototype._addHeaders=function(r,n){var i=Xt(n).href;if(!_p(i,this.getConfig().propagateTraceHeaderCorsUrls)){var s={};at.inject(he.active(),s),Object.keys(s).length>0&&this._diag.debug("headers inject skipped due to CORS policy");return}var o={};at.inject(he.active(),o),Object.keys(o).forEach(function(l){r.setRequestHeader(l,String(o[l]))})},t.prototype._addChildSpan=function(r,n){var i=this;he.with(Se.setSpan(he.active(),r),function(){var s=i.tracer.startSpan("CORS Preflight",{startTime:n[re.FETCH_START]});Kr(s,n,i.getConfig().ignoreNetworkEvents),s.end(n[re.RESPONSE_END])})},t.prototype._addFinalSpanAttributes=function(r,n,i){if(typeof i=="string"){var s=Xt(i);n.status!==void 0&&r.setAttribute(NE,n.status),n.statusText!==void 0&&r.setAttribute(Fl.HTTP_STATUS_TEXT,n.statusText),r.setAttribute(LE,s.host),r.setAttribute(xE,s.protocol.replace(":","")),r.setAttribute(OE,navigator.userAgent)}},t.prototype._applyAttributesAfterXHR=function(r,n){var i=this,s=this.getConfig().applyCustomAttributesOnSpan;typeof s=="function"&&cs(function(){return s(r,n)},function(o){o&&i._diag.error("applyCustomAttributesOnSpan",o)})},t.prototype._addResourceObserver=function(r,n){var i=this._xhrMem.get(r);!i||typeof PerformanceObserver!="function"||typeof PerformanceResourceTiming!="function"||(i.createdResources={observer:new PerformanceObserver(function(s){var o=s.getEntries(),l=Xt(n);o.forEach(function(u){u.initiatorType==="xmlhttprequest"&&u.name===l.href&&i.createdResources&&i.createdResources.entries.push(u)})}),entries:[]},i.createdResources.observer.observe({entryTypes:["resource"]}))},t.prototype._clearResources=function(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(lt.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)},t.prototype._findResourceAndAddNetworkEvents=function(r,n,i,s,o){if(!(!i||!s||!o||!r.createdResources)){var l=r.createdResources.entries;(!l||!l.length)&&(l=lt.getEntriesByType("resource"));var u=wp(Xt(i).href,s,o,l,this._usedResources);if(u.mainRequest){var a=u.mainRequest;this._markResourceAsUsed(a);var h=u.corsPreFlightRequest;h&&(this._addChildSpan(n,h),this._markResourceAsUsed(h)),Kr(n,a,this.getConfig().ignoreNetworkEvents)}}},t.prototype._cleanPreviousSpanInformation=function(r){var n=this._xhrMem.get(r);if(n){var i=n.callbackToRemoveEvents;i&&i(),this._xhrMem.delete(r)}},t.prototype._createSpan=function(r,n,i){var s;if(ep(n,this.getConfig().ignoreUrls)){this._diag.debug("ignoring span as url matches ignored url");return}var o=i.toUpperCase(),l=this.tracer.startSpan(o,{kind:xn.CLIENT,attributes:(s={},s[CE]=i,s[ZE]=Xt(n).toString(),s)});return l.addEvent(Wt.METHOD_OPEN),this._cleanPreviousSpanInformation(r),this._xhrMem.set(r,{span:l,spanUrl:n}),l},t.prototype._markResourceAsUsed=function(r){this._usedResources.add(r)},t.prototype._patchOpen=function(){var r=this;return function(n){var i=r;return function(){for(var o=[],l=0;l<arguments.length;l++)o[l]=arguments[l];var u=o[0],a=o[1];return i._createSpan(this,a,u),n.apply(this,o)}}},t.prototype._patchSend=function(){var r=this;function n(h,c,f,d){var p=c.callbackToRemoveEvents;typeof p=="function"&&p();var m=c.span,g=c.spanUrl,v=c.sendStartTime;m&&(r._findResourceAndAddNetworkEvents(c,m,g,v,f),m.addEvent(h,d),r._addFinalSpanAttributes(m,c,g),m.end(d),r._tasksCount--),r._clearResources()}function i(h,c){var f=r._xhrMem.get(c);if(f){f.status=c.status,f.statusText=c.statusText,r._xhrMem.delete(c),f.span&&r._applyAttributesAfterXHR(f.span,c);var d=gr(),p=Date.now();setTimeout(function(){n(h,f,d,p)},UE)}}function s(){i(Wt.EVENT_ERROR,this)}function o(){i(Wt.EVENT_ABORT,this)}function l(){i(Wt.EVENT_TIMEOUT,this)}function u(){this.status<299?i(Wt.EVENT_LOAD,this):i(Wt.EVENT_ERROR,this)}function a(h){h.removeEventListener("abort",o),h.removeEventListener("error",s),h.removeEventListener("load",u),h.removeEventListener("timeout",l);var c=r._xhrMem.get(h);c&&(c.callbackToRemoveEvents=void 0)}return function(h){return function(){for(var f=this,d=[],p=0;p<arguments.length;p++)d[p]=arguments[p];var m=r._xhrMem.get(this);if(!m)return h.apply(this,d);var g=m.span,v=m.spanUrl;if(g&&v){if(r.getConfig().measureRequestSize&&(d!=null&&d[0])){var y=d[0],S=WE(y);S!==void 0&&g.setAttribute(GE,S)}he.with(Se.setSpan(he.active(),g),function(){r._tasksCount++,m.sendStartTime=gr(),g.addEvent(Wt.METHOD_SEND),f.addEventListener("abort",o),f.addEventListener("error",s),f.addEventListener("load",u),f.addEventListener("timeout",l),m.callbackToRemoveEvents=function(){a(f),m.createdResources&&m.createdResources.observer.disconnect()},r._addHeaders(f,v),r._addResourceObserver(f,v)})}return h.apply(this,d)}}},t.prototype.enable=function(){this._diag.debug("applying patch to",this.moduleName,this.version),Xe(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),Xe(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())},t.prototype.disable=function(){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},t}(Wn);const Jl=/\b(query|mutation|subscription)\b\s*([A-Za-z_]\w*)?/g;function FE(e){var a;const t=HE(e);if(t===null||typeof t!="object")return null;const r=Array.isArray(t)?t[0]:t;if(!r||typeof r!="object")return null;const n=r,i=typeof n.query=="string"?n.query:void 0,s=typeof n.operationName=="string"?n.operationName:void 0;if(i===void 0&&s===void 0)return null;const o=i?JE(i,s):null,l=(a=o==null?void 0:o[1])!=null?a:YE(i),u=s!=null?s:o==null?void 0:o[2];return u===void 0&&l===void 0?null:{name:u,type:l}}function JE(e,t){Jl.lastIndex=0;let r=null;for(let n=Jl.exec(e);n!==null;n=Jl.exec(e)){if(t===void 0||n[2]===t)return n;r===null&&(r=n)}return r}function HE(e){if(e==null)return null;if(typeof e=="object")return e;if(typeof e!="string")return null;try{return JSON.parse(e)}catch(t){return null}}function YE(e){if(e!==void 0&&/^\s*\{/.test(e))return"query"}const BE=0,Gp=2e3;class zE{constructor(t=BE,r=Gp){this.lastRecordedAt=new Map,this.windowMillis=t,this.maxSize=r>0?r:Gp}shouldRecord(t,r=Date.now()){if(this.windowMillis<=0)return!0;const n=this.lastRecordedAt.get(t);return n===void 0||n<=r-this.windowMillis}markRecorded(t,r=Date.now()){if(!(this.windowMillis<=0))for(this.lastRecordedAt.delete(t),this.lastRecordedAt.set(t,r);this.lastRecordedAt.size>this.maxSize;){const n=this.lastRecordedAt.keys().next().value;if(n===void 0)break;this.lastRecordedAt.delete(n)}}reset(){this.lastRecordedAt.clear()}}const ys=1e3,Vp=1e3*2,kp=4*60*60*1e3,Hl=15*60*1e3,bs={normal:{bytes:1e7,time:4*60*1e3},canvas:{bytes:16e6,time:5e3}},Xp=100,An="app.highlight.io",Wp="https://app.launchdarkly.com",KE={"observability.ld-stg.launchdarkly.com":"ld-stg.launchdarkly.com","observability.app.launchdarkly.com":"app.launchdarkly.com","observability.app.ld.catamorphic.com":"app.ld.catamorphic.com"},jE="/projects/default",QE=new RegExp("pub\\.(?<domain>.+)");/*! js-cookie v3.0.8 | MIT */function vs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)n!=="__proto__"&&(e[n]=r[n])}return e}var $E={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Yl(e,t){function r(i,s,o){if(typeof document!="undefined"){o=vs({},t,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var u in o)o[u]&&(l+="; "+u,o[u]!==!0&&(l+="="+o[u].split(";")[0]));return document.cookie=i+"="+e.write(s,i)+l}}function n(i){if(!(typeof document=="undefined"||arguments.length&&!i)){for(var s=document.cookie?document.cookie.split("; "):[],o={},l=0;l<s.length;l++){var u=s[l].split("="),a=u.slice(1).join("=");try{var h=decodeURIComponent(u[0]);if(h in o||(o[h]=e.read(a,h)),i===h)break}catch(c){}}return i?o[i]:o}}return Object.create({set:r,get:n,remove:function(i,s){r(i,"",vs({},s,{expires:-1}))},withAttributes:function(i){return Yl(this.converter,vs({},this.attributes,i))},withConverter:function(i){return Yl(vs({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Ss=Yl($E,{path:"/"});const Pp=Object.create(null),De=(e,t,...r)=>{const n=`[@launchdarkly plugins]: (${e}): `;console[t].apply(console,[n,...r]),qE(n,...r)},vr=(e,t,r,...n)=>{Pp[`${e}-${t}`]||(Pp[`${e}-${t}`]=!0,De(e,r,...n))},qE=(e,...t)=>$(this,null,function*(){try{const{LDObserve:r}=yield Promise.resolve().then(()=>YN);r.recordLog(`${e}${t}`,"warn")}catch(r){}});var Un=(e=>(e.CLIENT_ID="highlightClientID",e))(Un||{});let ws="localStorage",Bl=!0;class eI{constructor(){L(this,"storage",{})}get length(){return Object.keys(this.storage).length}key(t){var n;return(n=Object.keys(this.storage)[t])!=null?n:null}getItem(t){var r;return(r=this.storage[t])!=null?r:""}setItem(t,r){this.storage[t]=r}removeItem(t){delete this.storage[t]}}class tI{getItem(t){var r;return(r=Ss.get(t))!=null?r:""}setItem(t,r){if(!Bl)return;const n=new Date;n.setTime(n.getTime()+Hl),Ss.set(t,r,{expires:n})}removeItem(t){Bl&&Ss.remove(t)}keys(){var t;return Object.keys((t=Ss.get())!=null?t:{})}}const Qr=new eI,$r=new tI,Rs=()=>{let e=null;if(typeof window=="undefined")return Qr;try{switch(ws){case"localStorage":e=window.localStorage;break;case"sessionStorage":e=window.sessionStorage;break}e||(vr("storage","getPersistentStorage","debug",`persistent storage was not found for mode ${ws}; using global storage`),e=Qr)}catch(t){vr("storage","getPersistentStorage","debug","failed to get persistent storage; using global storage",t),e=Qr}return e},Mp=e=>{ws=e},_s=e=>{Bl=e},Fe=e=>{try{return Rs().getItem(e)}catch(t){return vr("storage","getItem","debug",`failed to get item ${e}; using global storage`,t),Qr.getItem(e)}},ct=(e,t)=>{$r.setItem(e,t);try{return Rs().setItem(e,t)}catch(r){return vr("storage","setItem","debug",`failed to set item ${e}; using global storage`,r),Qr.setItem(e,t)}},qr=e=>{$r.removeItem(e);try{return Rs().removeItem(e)}catch(t){return vr("storage","removeItem","debug",`failed to remove item ${e}; using global storage`,t),Qr.removeItem(e)}},rI=e=>{if(ws==="sessionStorage"){console.warn("highlight.io cannot use local storage; segment integration will not work");return}if(typeof window=="undefined"){console.warn("highlight.io cannot use local storage (not a window); segment integration will not work");return}const t=window.localStorage.setItem;window.localStorage.setItem=function(){const[r,n]=arguments;e({keyName:r,keyValue:n}),t.apply(this,[r,n])}};var Ne=(e=>(e.SEGMENT_LAST_SENT_HASH_KEY="HIGHLIGHT_SEGMENT_LAST_SENT_HASH_KEY",e.SESSION_ID="sessionID",e.SESSION_DATA="sessionData",e.USER_IDENTIFIER="highlightIdentifier",e.USER_OBJECT="highlightUserObject",e))(Ne||{});const Ts=e=>`${Ne.SESSION_DATA}_${e}`,Pt=()=>{var e;return typeof globalThis!="undefined"&&((e=globalThis.persistentSessionSecureID)!=null&&e.length)?globalThis.persistentSessionSecureID:Ap()},nI=e=>{typeof globalThis!="undefined"&&(e!=null&&e.length)&&(globalThis.persistentSessionSecureID=e)},Ap=()=>{var e;return(e=Fe(Ne.SESSION_ID))!=null?e:""},tr=e=>{ct(Ne.SESSION_ID,e)},iI=e=>{const t=Ts(e);return JSON.parse(Fe(t)||"{}")},Mt=e=>{e||(e=Ap());let t=iI(e);if(t&&t.lastPushTime&&Date.now()-t.lastPushTime<Hl)return t;qr(Ts(e))},dt=function(e){if(!(e!=null&&e.sessionSecureID))return;const t=e.sessionSecureID;nI(t);const r=Ts(t);ct(r,JSON.stringify(e)),sI(r)},Up=function(){const e=$r.getItem(Ne.SESSION_ID);tr(e);const t=Ts(e),r=$r.getItem(t);try{dt(JSON.parse(r))}catch(n){}};function sI(e){var i;const t=`${Ne.SESSION_DATA}_`,r=new Set,n=Rs();for(let s=n.length-1;s>=0;s--){const o=n.key(s);o&&o.startsWith(t)&&o!==e&&r.add(o)}for(const s of $r.keys())s.startsWith(t)&&s!==e&&r.add(s);for(const s of r){let o=!0;try{const l=Fe(s)||$r.getItem(s)||"{}",u=JSON.parse(l),a=(i=u.lastPushTime)!=null?i:u.sessionStartTime;o=a===void 0||Date.now()-a>=Hl}catch(l){}o&&(vr("highlightSession","pruneSessionData","debug",`removing session data for stale key ${s}`),qr(s))}}const Dp=(e,t,r)=>{const n=Es(t,e.headers,r);return B(x({},e),{headers:n})},Es=(e,t,r)=>{var i,s;const n=x({},t);return r?((i=Object.keys(n))==null||i.forEach(o=>{[...r].includes(o==null?void 0:o.toLowerCase())||(n[o]="[REDACTED]")}),n):((s=Object.keys(n))==null||s.forEach(o=>{[...oI,...e].includes(o==null?void 0:o.toLowerCase())&&(n[o]="[REDACTED]")}),n)},oI=["authorization","cookie","proxy-authorization","set-cookie","token"],Fp=["https://www.googleapis.com/identitytoolkit","https://securetoken.googleapis.com","browser-intake-datadoghq.com","browser-intake-datadoghq.eu","browser-intake-us3-datadoghq.com","browser-intake-us5-datadoghq.com","browser-intake-ap1-datadoghq.com","browser-intake-ddog-gov.com","r.lr-ingest.io","r.lr-in-prod.com","r.logrocket.io","data.pendo.io","ingest.sentry.io","ingest.us.sentry.io","ingest.de.sentry.io","bam.nr-data.net","bam-cell.nr-data.net","rs.fullstory.com","in.hotjar.com","api2.amplitude.com","api.mixpanel.com","api.segment.io/v1","google-analytics.com/g/collect","analytics.google.com/g/collect"],aI=["awsaccesskeyid","signature","sig","x-goog-signature","access_token","id_token","token","code","refresh_token","session_state"],lI=["access_token","id_token","token","code","refresh_token","session_state"],Jp=e=>{var t,r;try{return new URL(e)}catch(n){return new URL(e,(r=(t=globalThis.location)==null?void 0:t.origin)!=null?r:"http://example.com")}},uI=e=>{if(!e||e==="#")return"";const t=e.slice(1);if(!t.includes("="))return e;const r=t.indexOf("?"),n=r>=0?t.slice(r+1):t,i=new URLSearchParams(n);for(const s of i.keys())if(lI.includes(s.toLowerCase()))return"";return e},Is=e=>{try{const t=Jp(e);(t.username||t.password)&&(t.username="REDACTED",t.password="REDACTED");const r=t.searchParams;aI.forEach(i=>{for(const s of Array.from(r.keys()))s.toLowerCase()===i&&r.set(s,"REDACTED")});const n=uI(t.hash);if(t.hash=n,!e.includes("://")&&!e.startsWith("//"))return t.pathname+t.search+n;if(e.startsWith("//")){let i="//";return(t.username||t.password)&&(i+=t.username+":"+t.password+"@"),i+=t.host+t.pathname+t.search+n,i}return t.toString()}catch(t){return e}},cI=new RegExp("sdk\\/evalx\\/[^/]+\\/contexts\\/(?<context>[^/?]*)\\??.*?"),dI=new RegExp("\\/eval\\/[^/]+\\/(?<context>[^/?]*)\\??.*?");function hI(e){return!!(e.includes("/sdk/evalx")&&e.match(cI)||e.includes("/eval/")&&e.match(dI))}const Hp="X-Highlight-Request",Yp=e=>{let t=e;return!e.startsWith("https://")&&!e.startsWith("http://")&&(t=`${window.location.origin}${t}`),t.replace(/\/+$/,"")},fI=(e,{headersToRedact:t,headersToRecord:r,requestResponseSanitizer:n})=>{var u,a;let i=e;if(n){let c=!0;try{i.request.body=JSON.parse(i.request.body)}catch(d){c=!1}let f=!0;try{i.response.body=JSON.parse(i.response.body)}catch(d){f=!1}try{i=n(i)}catch(d){}finally{c=c&&!!((u=i==null?void 0:i.request)!=null&&u.body),f=f&&!!((a=i==null?void 0:i.response)!=null&&a.body),c&&(i.request.body=JSON.stringify(i.request.body)),f&&(i.response.body=JSON.stringify(i.response.body))}if(!i)return null}const h=i,{request:s,response:o}=h,l=et(h,["request","response"]);return x({request:Dp(s,t,r),response:Dp(o,t,r)},l)},Bp=(e,t,r,n)=>{e.sort((u,a)=>u.responseEnd-a.responseEnd);const i={xmlhttprequest:{},others:{},fetch:{}},s=e.reduce((u,a)=>{const h=Yp(a.name);return a.initiatorType===r?u[r][h]=[...u[r][h]||[],a]:u.others[h]=[...u.others[h]||[],a],u},i);let o={};o=t.reduce((u,a)=>{const h=Yp(a.request.url);return u[h]=[...u[h]||[],a],u},o);for(let u in s[r]){const a=s[r][u],h=o[u];if(!h)continue;const c=Math.max(a.length-h.length,0);for(let f=c;f<a.length;f++)a[f]&&(a[f].requestResponsePair=h[f-c])}let l=[];for(let u in s)for(let a in s[u])l=l.concat(s[u][a]);return l.sort((u,a)=>u.fetchStart-a.fetchStart).reduce((u,a)=>{let h=a.requestResponsePair;return h&&(h=fI(a.requestResponsePair,n),!h)||(a.toJSON=function(){const c=window.performance.timeOrigin;return{initiatorType:this.initiatorType,startTimeAbs:c+this.startTime,connectStartAbs:c+this.connectStart,connectEndAbs:c+this.connectEnd,domainLookupStartAbs:c+this.domainLookupStart,domainLookupEndAbs:c+this.domainLookupEnd,fetchStartAbs:c+this.fetchStart,redirectStartAbs:c+this.redirectStart,redirectEndAbs:c+this.redirectEnd,requestStartAbs:c+this.requestStart,responseStartAbs:c+this.responseStart,responseEndAbs:c+this.responseEnd,secureConnectionStartAbs:c+this.secureConnectionStart,workerStartAbs:c+this.workerStart,name:this.name,transferSize:this.transferSize,encodedBodySize:this.encodedBodySize,decodedBodySize:this.decodedBodySize,nextHopProtocol:this.nextHopProtocol,requestResponsePairs:h}},u.push(a)),u},[])},pI=e=>["events.ld.catamorphic.com","events.launchdarkly.com"].some(t=>e.toLocaleLowerCase().includes(t)),mI=e=>hI(e),gI=(e,t)=>t.some(r=>e.toLocaleLowerCase().includes(r)),Cs=(e,t,r)=>!gI(e,t)&&!mI(e)&&!pI(e),zl=(e,t,r)=>{var o;if(r.some(l=>e.toLowerCase().includes(l)))return!1;let n=[];t===!0?(n=["localhost",/^\//],(o=window==null?void 0:window.location)!=null&&o.host&&n.push(zp(window.location.host))):t instanceof Array&&(n=t);const i=bI(e);let s=!1;return n.forEach(l=>{i.match(l)&&(s=!0)}),s},yI=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),zp=e=>new RegExp("^https?://([^/]+\\.)?"+yI(e)+"([:/?#]|$)"),bI=e=>{if(e.startsWith("/")&&!e.startsWith("//"))return e;try{return new URL(e).origin}catch(t){return e}};function vI(e){for(var t="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=r.length,i=0;i<e;i++)t+=r.charAt(Math.floor(Math.random()*n));return t}const Kl=()=>{const e=vI(10),t=cx(),r=t==null?void 0:t.spanContext().traceId;return[Pt(),r!=null?r:e]},Kp=(e,t)=>e+"/"+t,SI=(e,t,r,n,i,s)=>{const o=XMLHttpRequest.prototype,l=o.open,u=o.send,a=o.setRequestHeader;return o.open=function(h,c){return typeof c=="string"?this._url=c:this._url=c.toString(),this._method=h,this._requestHeaders={},this._shouldRecordHeaderAndBody=!n.some(f=>this._url.toLowerCase().includes(f)),l.apply(this,arguments)},o.setRequestHeader=function(h,c){return this._requestHeaders[h]=c,a.apply(this,arguments)},o.send=function(h){if(!Cs(this._url,t))return u.apply(this,arguments);const[c,f]=Kl();zl(this._url,r,n)&&this.setRequestHeader(Hp,Kp(c,f));const d=this._shouldRecordHeaderAndBody,p={sessionSecureID:c,id:f,url:this._url,verb:this._method,headers:d?this._requestHeaders:{},body:void 0};if(d&&h){const m=jl(h,p.url);m&&(this._body=m,p.body=Ct(m,i,s,p.headers))}return this.addEventListener("load",function(){return $(this,null,function*(){const m={status:this.status,headers:{},body:void 0};if(d){const y=this.getAllResponseHeaders().trim().split(/[\r\n]+/),S={};if(y.forEach(function(_){const w=_.split(": "),b=w.shift();S[b]=w.join(": ")}),m.headers=S,h){const _=jl(h,p.url);_&&(p.body=Ct(_,i,s,m.headers))}if(this.responseType===""||this.responseType==="text")m.body=Ct(this.responseText,i,s,m.headers),m.size=this.responseText.length*8;else if(this.responseType==="blob"){if(this.response instanceof Blob)try{const _=yield this.response.text();m.body=Ct(_,i,s,m.headers),m.size=this.response.size}catch(_){}}else try{m.body=Ct(this.response,i,s,m.headers)}catch(_){}}e({request:p,response:m,urlBlocked:!d})})}),this.addEventListener("error",function(){return $(this,null,function*(){const m={status:this.status,headers:void 0,body:void 0};e({request:p,response:m,urlBlocked:!1})})}),u.apply(this,arguments)},()=>{o.open=l,o.send=u,o.setRequestHeader=a}},wI=/^\[object (ArrayBuffer|SharedArrayBuffer|DataView|(?:Ui|I)nt(?:8|16|32)Array|Uint8ClampedArray|Float(?:16|32|64)Array|Big(?:Ui|I)nt64Array|Blob|File|FormData|URLSearchParams|ReadableStream)\]$/,RI=e=>typeof e=="object"&&e!==null&&wI.test(Object.prototype.toString.call(e)),_I=e=>{var r,n;return typeof Blob!="undefined"&&e instanceof Blob?`[Blob type="${e.type}" size=${e.size}]`:typeof FormData!="undefined"&&e instanceof FormData?"[FormData]":typeof URLSearchParams!="undefined"&&e instanceof URLSearchParams?e.toString().slice(0,Ql):`[binary size=${(n=(r=e==null?void 0:e.byteLength)!=null?r:e==null?void 0:e.size)!=null?n:0}]`},jl=(e,t)=>{if(RI(e))return _I(e);if(typeof e=="string"){if(!((t!=null&&t.includes("localhost")||t!=null&&t.includes("highlight.run"))&&(e.includes("pushPayload")||e.includes("pushSessionEvents"))))return e}else if(typeof e=="object"||typeof e=="number"||typeof e=="boolean")return bt(e);return null},Ql=64*1024,TI={"application/json":256*1024,"text/plain":256*1024},jp=(e,t)=>`[body omitted: ${e} bytes exceeds the ${t} byte limit]`,$l=e=>{var r,n;if(!e)return Ql;let t="";if(typeof e.get=="function")t=(r=e.get("content-type"))!=null?r:"";else{const i=e,s=Object.keys(i).find(o=>o.toLowerCase()==="content-type");t=s&&i[s]||""}try{t=t.split(";")[0].trim()}catch(i){}return(n=TI[t])!=null?n:Ql},Qp=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ct=(e,t,r,n)=>{const i=$l(n);if(typeof e=="string"&&e.length>i)return jp(e.length,i);if(e){if(t)try{const s=JSON.parse(e);Array.isArray(s)?s.forEach(o=>{Qp(o)&&Object.keys(o).forEach(l=>{t.includes(l.toLocaleLowerCase())&&(o[l]="[REDACTED]")})}):Object.keys(s).forEach(o=>{t.includes(o.toLocaleLowerCase())&&(s[o]="[REDACTED]")}),e=JSON.stringify(s)}catch(s){}if(r)try{const s=JSON.parse(e);Array.isArray(s)?s.forEach((o,l)=>{if(!Qp(o)){s[l]="[REDACTED]";return}Object.keys(o).forEach(u=>{r.includes(u.toLocaleLowerCase())||(o[u]="[REDACTED]")})}):Object.keys(s).forEach(o=>{r.includes(o.toLocaleLowerCase())||(s[o]="[REDACTED]")}),e=JSON.stringify(s)}catch(s){}}try{e=e.slice(0,i)}catch(s){}return e},EI=(e,t,r,n,i,s)=>{const o=window._fetchProxy;return window._fetchProxy=function(l,u){const{method:a,url:h}=II(l,u);if(!Cs(h,t))return o.call(this,l,u);const[c,f]=Kl();if(zl(h,r,n)){u=u||{};let g=new Headers(u.headers);l instanceof Request&&[...l.headers].forEach(([v,y])=>g.set(v,y)),g.set(Hp,Kp(c,f)),u.headers=Object.fromEntries(g.entries())}const d={sessionSecureID:c,id:f,headers:{},body:void 0,url:h,verb:a},p=!n.some(g=>h.toLowerCase().includes(g));p&&(d.headers=Object.fromEntries(new Headers(u==null?void 0:u.headers).entries()),d.body=Ct(u==null?void 0:u.body,i,s,u==null?void 0:u.headers));let m=o.call(this,l,u);return CI(m,d,e,p,i,s),m},()=>{window._fetchProxy=o}},II=(e,t)=>{const r=t&&t.method||typeof e=="object"&&"method"in e&&e.method||"GET";let n;return typeof e=="object"?"url"in e&&e.url?n=e.url:n=e.toString():n=e,{method:r,url:n}},CI=(e,t,r,n,i,s)=>{const o=l=>$(this,null,function*(){let u={body:void 0,headers:void 0,status:0,size:0},a=!1,h=!n;"stack"in l||l instanceof Error?(u=B(x({},u),{body:l.message,status:0,size:void 0}),a=!0):"status"in l&&(u=B(x({},u),{status:l.status}),n&&(u.body=yield $p(l,s,i),u.headers=Object.fromEntries(l.headers.entries()),u.size=u.body.length*8),(l.type==="opaque"||l.type==="opaqueredirect")&&(h=!0,u=B(x({},u),{body:"CORS blocked request"})),a=!0),a&&r({request:t,response:u,urlBlocked:h})});e.then(o).catch(()=>{})},$p=(e,t,r)=>$(this,null,function*(){let n;try{const s=e.clone().body;if(s){let o=s.getReader(),l=new TextDecoder,u;const a=$l(e.headers);let h="",c=!1;for(;!(u=yield o.read()).done;){let f=u.value;if(h+=l.decode(f,{stream:!0}),h.length>a){c=!0,o.cancel().catch(()=>{});break}}c||(h+=l.decode()),n=c?jp(Number(e.headers.get("content-length"))||h.length,a):h,n=Ct(n,r,t,e.headers)}else n=""}catch(i){n=`Unable to clone response: ${i}`}return n});var qp=function(){function e(t){this._delegate=t}return e.prototype.export=function(t,r){this._delegate.export(t,r)},e.prototype.forceFlush=function(){return this._delegate.forceFlush()},e.prototype.shutdown=function(){return this._delegate.shutdown()},e}(),ZI=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),em=function(e){ZI(t,e);function t(r,n,i){var s=e.call(this,r)||this;return s.name="OTLPExporterError",s.data=i,s.code=n,s}return t}(Error);function LI(e){if(!Number.isNaN(e)&&Number.isFinite(e)&&e>0)return e;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+e+"')")}function xI(e){if(e!=null)return function(){return e}}function NI(e,t,r){var n,i,s,o,l,u;return{timeoutMillis:LI((i=(n=e.timeoutMillis)!==null&&n!==void 0?n:t.timeoutMillis)!==null&&i!==void 0?i:r.timeoutMillis),concurrencyLimit:(o=(s=e.concurrencyLimit)!==null&&s!==void 0?s:t.concurrencyLimit)!==null&&o!==void 0?o:r.concurrencyLimit,compression:(u=(l=e.compression)!==null&&l!==void 0?l:t.compression)!==null&&u!==void 0?u:r.compression}}function OI(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}var GI=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(h){try{a(n.next(h))}catch(c){o(c)}}function u(h){try{a(n.throw(h))}catch(c){o(c)}}function a(h){h.done?s(h.value):i(h.value).then(l,u)}a((n=n.apply(e,t||[])).next())})},VI=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(a){return function(h){return u([a,h])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(h){a=[6,h],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},kI=function(){function e(t){this._sendingPromises=[],this._concurrencyLimit=t}return e.prototype.pushPromise=function(t){var r=this;if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(t);var n=function(){var i=r._sendingPromises.indexOf(t);r._sendingPromises.splice(i,1)};t.then(n,n)},e.prototype.hasReachedLimit=function(){return this._sendingPromises.length>=this._concurrencyLimit},e.prototype.awaitAll=function(){return GI(this,void 0,void 0,function(){return VI(this,function(t){switch(t.label){case 0:return[4,Promise.all(this._sendingPromises)];case 1:return t.sent(),[2]}})})},e}();function XI(e){return new kI(e.concurrencyLimit)}function WI(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}function PI(){return{handleResponse:function(e){e==null||!WI(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||H.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}var MI=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(h){try{a(n.next(h))}catch(c){o(c)}}function u(h){try{a(n.throw(h))}catch(c){o(c)}}function a(h){h.done?s(h.value):i(h.value).then(l,u)}a((n=n.apply(e,t||[])).next())})},AI=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(a){return function(h){return u([a,h])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(h){a=[6,h],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},UI=function(){function e(t,r,n,i,s){this._transport=t,this._serializer=r,this._responseHandler=n,this._promiseQueue=i,this._timeout=s,this._diagLogger=H.createComponentLogger({namespace:"OTLPExportDelegate"})}return e.prototype.export=function(t,r){var n=this;if(this._diagLogger.debug("items to be sent",t),this._promiseQueue.hasReachedLimit()){r({code:_e.FAILED,error:new Error("Concurrent export limit reached")});return}var i=this._serializer.serializeRequest(t);if(i==null){r({code:_e.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(i,this._timeout).then(function(s){if(s.status==="success"){if(s.data!=null)try{n._responseHandler.handleResponse(n._serializer.deserializeResponse(s.data))}catch(o){n._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",o,s.data)}r({code:_e.SUCCESS});return}else if(s.status==="failure"&&s.error){r({code:_e.FAILED,error:s.error});return}else s.status==="retryable"?r({code:_e.FAILED,error:new em("Export failed with retryable status")}):r({code:_e.FAILED,error:new em("Export failed with unknown error")})},function(s){return r({code:_e.FAILED,error:s})}))},e.prototype.forceFlush=function(){return this._promiseQueue.awaitAll()},e.prototype.shutdown=function(){return MI(this,void 0,void 0,function(){return AI(this,function(t){switch(t.label){case 0:return this._diagLogger.debug("shutdown started"),[4,this.forceFlush()];case 1:return t.sent(),this._transport.shutdown(),[2]}})})},e}();function DI(e,t){return new UI(e.transport,e.serializer,PI(),e.promiseHandler,t.timeout)}function tm(e,t,r){return DI({transport:r,serializer:t,promiseHandler:XI(e)},{timeout:e.timeoutMillis})}function rm(e){var t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}function FI(e){var t=Number(BigInt.asUintN(32,e)),r=Number(BigInt.asUintN(32,e>>BigInt(32)));return{low:t,high:r}}function nm(e){var t=rm(e);return FI(t)}function JI(e){var t=rm(e);return t.toString()}var HI=typeof BigInt!="undefined"?JI:kt;function im(e){return e}function sm(e){if(e!==void 0)return El(e)}var YI={encodeHrTime:nm,encodeSpanContext:El,encodeOptionalSpanContext:sm};function om(e){var t,r;if(e===void 0)return YI;var n=(t=e.useLongBits)!==null&&t!==void 0?t:!0,i=(r=e.useHex)!==null&&r!==void 0?r:!1;return{encodeHrTime:n?nm:HI,encodeSpanContext:i?im:El,encodeOptionalSpanContext:i?im:sm}}var BI=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s};function am(e){return{attributes:Sr(e.attributes),droppedAttributesCount:0}}function lm(e){return{name:e.name,version:e.version}}function Sr(e){return Object.keys(e).map(function(t){return um(t,e[t])})}function um(e,t){return{key:e,value:cm(t)}}function cm(e){var t=typeof e;return t==="string"?{stringValue:e}:t==="number"?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:t==="boolean"?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(cm)}}:t==="object"&&e!=null?{kvlistValue:{values:Object.entries(e).map(function(r){var n=BI(r,2),i=n[0],s=n[1];return um(i,s)})}}:{}}var Rt;(function(e){e[e.DELTA=0]="DELTA",e[e.CUMULATIVE=1]="CUMULATIVE"})(Rt||(Rt={}));var Zt;(function(e){e[e.HISTOGRAM=0]="HISTOGRAM",e[e.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",e[e.GAUGE=2]="GAUGE",e[e.SUM=3]="SUM"})(Zt||(Zt={}));var zI=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),dm=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(h){try{a(n.next(h))}catch(c){o(c)}}function u(h){try{a(n.throw(h))}catch(c){o(c)}}function a(h){h.done?s(h.value):i(h.value).then(l,u)}a((n=n.apply(e,t||[])).next())})},hm=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(a){return function(h){return u([a,h])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(h){a=[6,h],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},KI=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},jI=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},QI=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function $I(e){return e!=null}function fm(e){var t=Object.keys(e);return t.length===0?"":(t=t.sort(),JSON.stringify(t.map(function(r){return[r,e[r]]})))}function qI(e){var t,r;return e.name+":"+((t=e.version)!==null&&t!==void 0?t:"")+":"+((r=e.schemaUrl)!==null&&r!==void 0?r:"")}var pm=function(e){zI(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return t}(Error);function Dn(e,t){var r,n=new Promise(function(s,o){r=setTimeout(function(){o(new pm("Operation timed out."))},t)});return Promise.race([e,n]).then(function(i){return clearTimeout(r),i},function(i){throw clearTimeout(r),i})}function eC(e){return dm(this,void 0,void 0,function(){var t=this;return hm(this,function(r){return[2,Promise.all(e.map(function(n){return dm(t,void 0,void 0,function(){var i,s;return hm(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,n];case 1:return i=o.sent(),[2,{status:"fulfilled",value:i}];case 2:return s=o.sent(),[2,{status:"rejected",reason:s}];case 3:return[2]}})})}))]})})}function tC(e){return e.status==="rejected"}function mm(e,t){var r=[];return e.forEach(function(n){r.push.apply(r,jI([],KI(t(n)),!1))}),r}function rC(e,t){var r,n;if(e.size!==t.size)return!1;try{for(var i=QI(e),s=i.next();!s.done;s=i.next()){var o=s.value;if(!t.has(o))return!1}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!0}function nC(e,t){for(var r=0,n=e.length-1,i=e.length;n>=r;){var s=r+Math.trunc((n-r)/2);e[s]<t?r=s+1:(i=s,n=s-1)}return i}function iC(e,t){return e.toLowerCase()===t.toLowerCase()}var wr;(function(e){e[e.DROP=0]="DROP",e[e.SUM=1]="SUM",e[e.LAST_VALUE=2]="LAST_VALUE",e[e.HISTOGRAM=3]="HISTOGRAM",e[e.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(wr||(wr={}));var sC=function(){function e(){this.kind=wr.DROP}return e.prototype.createAccumulation=function(){},e.prototype.merge=function(t,r){},e.prototype.diff=function(t,r){},e.prototype.toMetricData=function(t,r,n,i){},e}(),ie;(function(e){e.COUNTER="COUNTER",e.GAUGE="GAUGE",e.HISTOGRAM="HISTOGRAM",e.UP_DOWN_COUNTER="UP_DOWN_COUNTER",e.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",e.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",e.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(ie||(ie={}));function rr(e,t,r){var n,i,s,o;return uC(e)||H.warn('Invalid metric name: "'+e+'". The metric name should be a ASCII string with a length no greater than 255 characters.'),{name:e,type:t,description:(n=r==null?void 0:r.description)!==null&&n!==void 0?n:"",unit:(i=r==null?void 0:r.unit)!==null&&i!==void 0?i:"",valueType:(s=r==null?void 0:r.valueType)!==null&&s!==void 0?s:jt.DOUBLE,advice:(o=r==null?void 0:r.advice)!==null&&o!==void 0?o:{}}}function oC(e,t){var r,n;return{name:(r=e.name)!==null&&r!==void 0?r:t.name,description:(n=e.description)!==null&&n!==void 0?n:t.description,type:t.type,unit:t.unit,valueType:t.valueType,advice:t.advice}}function aC(e,t){return iC(e.name,t.name)&&e.unit===t.unit&&e.type===t.type&&e.valueType===t.valueType}var lC=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function uC(e){return e.match(lC)!=null}var cC=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s};function dC(e){var t=e.map(function(){return 0});return t.push(0),{buckets:{boundaries:e,counts:t},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var ql=function(){function e(t,r,n,i){n===void 0&&(n=!0),i===void 0&&(i=dC(r)),this.startTime=t,this._boundaries=r,this._recordMinMax=n,this._current=i}return e.prototype.record=function(t){if(!Number.isNaN(t)){this._current.count+=1,this._current.sum+=t,this._recordMinMax&&(this._current.min=Math.min(t,this._current.min),this._current.max=Math.max(t,this._current.max),this._current.hasMinMax=!0);var r=nC(this._boundaries,t);this._current.buckets.counts[r]+=1}},e.prototype.setStartTime=function(t){this.startTime=t},e.prototype.toPointValue=function(){return this._current},e}(),gm=function(){function e(t,r){this._boundaries=t,this._recordMinMax=r,this.kind=wr.HISTOGRAM}return e.prototype.createAccumulation=function(t){return new ql(t,this._boundaries,this._recordMinMax)},e.prototype.merge=function(t,r){for(var n=t.toPointValue(),i=r.toPointValue(),s=n.buckets.counts,o=i.buckets.counts,l=new Array(s.length),u=0;u<s.length;u++)l[u]=s[u]+o[u];var a=1/0,h=-1/0;return this._recordMinMax&&(n.hasMinMax&&i.hasMinMax?(a=Math.min(n.min,i.min),h=Math.max(n.max,i.max)):n.hasMinMax?(a=n.min,h=n.max):i.hasMinMax&&(a=i.min,h=i.max)),new ql(t.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:l},count:n.count+i.count,sum:n.sum+i.sum,hasMinMax:this._recordMinMax&&(n.hasMinMax||i.hasMinMax),min:a,max:h})},e.prototype.diff=function(t,r){for(var n=t.toPointValue(),i=r.toPointValue(),s=n.buckets.counts,o=i.buckets.counts,l=new Array(s.length),u=0;u<s.length;u++)l[u]=o[u]-s[u];return new ql(r.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:l},count:i.count-n.count,sum:i.sum-n.sum,hasMinMax:!1,min:1/0,max:-1/0})},e.prototype.toMetricData=function(t,r,n,i){return{descriptor:t,aggregationTemporality:r,dataPointType:Zt.HISTOGRAM,dataPoints:n.map(function(s){var o=cC(s,2),l=o[0],u=o[1],a=u.toPointValue(),h=t.type===ie.GAUGE||t.type===ie.UP_DOWN_COUNTER||t.type===ie.OBSERVABLE_GAUGE||t.type===ie.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:l,startTime:u.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:h?void 0:a.sum,buckets:a.buckets,count:a.count}}})}},e}(),eu=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},tu=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},ym=function(){function e(t,r,n,i){t===void 0&&(t=new hC),r===void 0&&(r=0),n===void 0&&(n=0),i===void 0&&(i=0),this.backing=t,this.indexBase=r,this.indexStart=n,this.indexEnd=i}return Object.defineProperty(e.prototype,"offset",{get:function(){return this.indexStart},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1},enumerable:!1,configurable:!0}),e.prototype.counts=function(){var t=this;return Array.from({length:this.length},function(r,n){return t.at(n)})},e.prototype.at=function(t){var r=this.indexBase-this.indexStart;return t<r&&(t+=this.backing.length),t-=r,this.backing.countAt(t)},e.prototype.incrementBucket=function(t,r){this.backing.increment(t,r)},e.prototype.decrementBucket=function(t,r){this.backing.decrement(t,r)},e.prototype.trim=function(){for(var t=0;t<this.length;t++)if(this.at(t)!==0){this.indexStart+=t;break}else if(t===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(var t=this.length-1;t>=0;t--)if(this.at(t)!==0){this.indexEnd-=this.length-t-1;break}this._rotate()},e.prototype.downscale=function(t){this._rotate();for(var r=1+this.indexEnd-this.indexStart,n=1<<t,i=0,s=0,o=this.indexStart;o<=this.indexEnd;){var l=o%n;l<0&&(l+=n);for(var u=l;u<n&&i<r;u++)this._relocateBucket(s,i),i++,o++;s++}this.indexStart>>=t,this.indexEnd>>=t,this.indexBase=this.indexStart},e.prototype.clone=function(){return new e(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)},e.prototype._rotate=function(){var t=this.indexBase-this.indexStart;t!==0&&(t>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,t),this.backing.reverse(t,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+t)),this.indexBase=this.indexStart)},e.prototype._relocateBucket=function(t,r){t!==r&&this.incrementBucket(t,this.backing.emptyBucket(r))},e}(),hC=function(){function e(t){t===void 0&&(t=[0]),this._counts=t}return Object.defineProperty(e.prototype,"length",{get:function(){return this._counts.length},enumerable:!1,configurable:!0}),e.prototype.countAt=function(t){return this._counts[t]},e.prototype.growTo=function(t,r,n){var i=new Array(t).fill(0);i.splice.apply(i,tu([n,this._counts.length-r],eu(this._counts.slice(r)),!1)),i.splice.apply(i,tu([0,r],eu(this._counts.slice(0,r)),!1)),this._counts=i},e.prototype.reverse=function(t,r){for(var n=Math.floor((t+r)/2)-t,i=0;i<n;i++){var s=this._counts[t+i];this._counts[t+i]=this._counts[r-i-1],this._counts[r-i-1]=s}},e.prototype.emptyBucket=function(t){var r=this._counts[t];return this._counts[t]=0,r},e.prototype.increment=function(t,r){this._counts[t]+=r},e.prototype.decrement=function(t,r){this._counts[t]>=r?this._counts[t]-=r:this._counts[t]=0},e.prototype.clone=function(){return new e(tu([],eu(this._counts),!1))},e}(),fC=52,pC=2146435072,mC=1048575,ru=1023,bm=-ru+1,vm=ru,nu=Math.pow(2,-1022);function Sm(e){var t=new DataView(new ArrayBuffer(8));t.setFloat64(0,e);var r=t.getUint32(0),n=(r&pC)>>20;return n-ru}function wm(e){var t=new DataView(new ArrayBuffer(8));t.setFloat64(0,e);var r=t.getUint32(0),n=t.getUint32(4),i=(r&mC)*Math.pow(2,32);return i+n}function iu(e,t){return e===0||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY||Number.isNaN(e)?e:e*Math.pow(2,t)}function gC(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}var yC=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fn=function(e){yC(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Error),bC=function(){function e(t){this._shift=-t}return e.prototype.mapToIndex=function(t){if(t<nu)return this._minNormalLowerBoundaryIndex();var r=Sm(t),n=this._rightShift(wm(t)-1,fC);return r+n>>this._shift},e.prototype.lowerBoundary=function(t){var r=this._minNormalLowerBoundaryIndex();if(t<r)throw new Fn("underflow: "+t+" is < minimum lower boundary: "+r);var n=this._maxNormalLowerBoundaryIndex();if(t>n)throw new Fn("overflow: "+t+" is > maximum lower boundary: "+n);return iu(1,t<<this._shift)},Object.defineProperty(e.prototype,"scale",{get:function(){return this._shift===0?0:-this._shift},enumerable:!1,configurable:!0}),e.prototype._minNormalLowerBoundaryIndex=function(){var t=bm>>this._shift;return this._shift<2&&t--,t},e.prototype._maxNormalLowerBoundaryIndex=function(){return vm>>this._shift},e.prototype._rightShift=function(t,r){return Math.floor(t*Math.pow(2,-r))},e}(),vC=function(){function e(t){this._scale=t,this._scaleFactor=iu(Math.LOG2E,t),this._inverseFactor=iu(Math.LN2,-t)}return e.prototype.mapToIndex=function(t){if(t<=nu)return this._minNormalLowerBoundaryIndex()-1;if(wm(t)===0){var r=Sm(t);return(r<<this._scale)-1}var n=Math.floor(Math.log(t)*this._scaleFactor),i=this._maxNormalLowerBoundaryIndex();return n>=i?i:n},e.prototype.lowerBoundary=function(t){var r=this._maxNormalLowerBoundaryIndex();if(t>=r){if(t===r)return 2*Math.exp((t-(1<<this._scale))/this._scaleFactor);throw new Fn("overflow: "+t+" is > maximum lower boundary: "+r)}var n=this._minNormalLowerBoundaryIndex();if(t<=n){if(t===n)return nu;if(t===n-1)return Math.exp((t+(1<<this._scale))/this._scaleFactor)/2;throw new Fn("overflow: "+t+" is < minimum lower boundary: "+n)}return Math.exp(t*this._inverseFactor)},Object.defineProperty(e.prototype,"scale",{get:function(){return this._scale},enumerable:!1,configurable:!0}),e.prototype._minNormalLowerBoundaryIndex=function(){return bm<<this._scale},e.prototype._maxNormalLowerBoundaryIndex=function(){return(vm+1<<this._scale)-1},e}(),Rm=-10,_m=20,SC=Array.from({length:31},function(e,t){return t>10?new vC(t-10):new bC(t-10)});function Tm(e){if(e>_m||e<Rm)throw new Fn("expected scale >= "+Rm+" && <= "+_m+", got: "+e);return SC[e+10]}var wC=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},Zs=function(){function e(t,r){this.low=t,this.high=r}return e.combine=function(t,r){return new e(Math.min(t.low,r.low),Math.max(t.high,r.high))},e}(),RC=20,_C=160,su=2,TC=function(){function e(t,r,n,i,s,o,l,u,a,h,c){t===void 0&&(t=t),r===void 0&&(r=_C),n===void 0&&(n=!0),i===void 0&&(i=0),s===void 0&&(s=0),o===void 0&&(o=0),l===void 0&&(l=Number.POSITIVE_INFINITY),u===void 0&&(u=Number.NEGATIVE_INFINITY),a===void 0&&(a=new ym),h===void 0&&(h=new ym),c===void 0&&(c=Tm(RC)),this.startTime=t,this._maxSize=r,this._recordMinMax=n,this._sum=i,this._count=s,this._zeroCount=o,this._min=l,this._max=u,this._positive=a,this._negative=h,this._mapping=c,this._maxSize<su&&(H.warn("Exponential Histogram Max Size set to "+this._maxSize+", changing to the minimum size of: "+su),this._maxSize=su)}return e.prototype.record=function(t){this.updateByIncrement(t,1)},e.prototype.setStartTime=function(t){this.startTime=t},e.prototype.toPointValue=function(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}},Object.defineProperty(e.prototype,"sum",{get:function(){return this._sum},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"min",{get:function(){return this._min},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this._max},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zeroCount",{get:function(){return this._zeroCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this._count===this._zeroCount?0:this._mapping.scale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"positive",{get:function(){return this._positive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"negative",{get:function(){return this._negative},enumerable:!1,configurable:!0}),e.prototype.updateByIncrement=function(t,r){if(!Number.isNaN(t)){if(t>this._max&&(this._max=t),t<this._min&&(this._min=t),this._count+=r,t===0){this._zeroCount+=r;return}this._sum+=t*r,t>0?this._updateBuckets(this._positive,t,r):this._updateBuckets(this._negative,-t,r)}},e.prototype.merge=function(t){this._count===0?(this._min=t.min,this._max=t.max):t.count!==0&&(t.min<this.min&&(this._min=t.min),t.max>this.max&&(this._max=t.max)),this.startTime=t.startTime,this._sum+=t.sum,this._count+=t.count,this._zeroCount+=t.zeroCount;var r=this._minScale(t);this._downscale(this.scale-r),this._mergeBuckets(this.positive,t,t.positive,r),this._mergeBuckets(this.negative,t,t.negative,r)},e.prototype.diff=function(t){this._min=1/0,this._max=-1/0,this._sum-=t.sum,this._count-=t.count,this._zeroCount-=t.zeroCount;var r=this._minScale(t);this._downscale(this.scale-r),this._diffBuckets(this.positive,t,t.positive,r),this._diffBuckets(this.negative,t,t.negative,r)},e.prototype.clone=function(){return new e(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)},e.prototype._updateBuckets=function(t,r,n){var i=this._mapping.mapToIndex(r),s=!1,o=0,l=0;if(t.length===0?(t.indexStart=i,t.indexEnd=t.indexStart,t.indexBase=t.indexStart):i<t.indexStart&&t.indexEnd-i>=this._maxSize?(s=!0,l=i,o=t.indexEnd):i>t.indexEnd&&i-t.indexStart>=this._maxSize&&(s=!0,l=t.indexStart,o=i),s){var u=this._changeScale(o,l);this._downscale(u),i=this._mapping.mapToIndex(r)}this._incrementIndexBy(t,i,n)},e.prototype._incrementIndexBy=function(t,r,n){if(n!==0){if(t.length===0&&(t.indexStart=t.indexEnd=t.indexBase=r),r<t.indexStart){var i=t.indexEnd-r;i>=t.backing.length&&this._grow(t,i+1),t.indexStart=r}else if(r>t.indexEnd){var i=r-t.indexStart;i>=t.backing.length&&this._grow(t,i+1),t.indexEnd=r}var s=r-t.indexBase;s<0&&(s+=t.backing.length),t.incrementBucket(s,n)}},e.prototype._grow=function(t,r){var n=t.backing.length,i=t.indexBase-t.indexStart,s=n-i,o=gC(r);o>this._maxSize&&(o=this._maxSize);var l=o-i;t.backing.growTo(o,s,l)},e.prototype._changeScale=function(t,r){for(var n=0;t-r>=this._maxSize;)t>>=1,r>>=1,n++;return n},e.prototype._downscale=function(t){if(t!==0){if(t<0)throw new Error("impossible change of scale: "+this.scale);var r=this._mapping.scale-t;this._positive.downscale(t),this._negative.downscale(t),this._mapping=Tm(r)}},e.prototype._minScale=function(t){var r=Math.min(this.scale,t.scale),n=Zs.combine(this._highLowAtScale(this.positive,this.scale,r),this._highLowAtScale(t.positive,t.scale,r)),i=Zs.combine(this._highLowAtScale(this.negative,this.scale,r),this._highLowAtScale(t.negative,t.scale,r));return Math.min(r-this._changeScale(n.high,n.low),r-this._changeScale(i.high,i.low))},e.prototype._highLowAtScale=function(t,r,n){if(t.length===0)return new Zs(0,-1);var i=r-n;return new Zs(t.indexStart>>i,t.indexEnd>>i)},e.prototype._mergeBuckets=function(t,r,n,i){for(var s=n.offset,o=r.scale-i,l=0;l<n.length;l++)this._incrementIndexBy(t,s+l>>o,n.at(l))},e.prototype._diffBuckets=function(t,r,n,i){for(var s=n.offset,o=r.scale-i,l=0;l<n.length;l++){var u=s+l>>o,a=u-t.indexBase;a<0&&(a+=t.backing.length),t.decrementBucket(a,n.at(l))}t.trim()},e}(),EC=function(){function e(t,r){this._maxSize=t,this._recordMinMax=r,this.kind=wr.EXPONENTIAL_HISTOGRAM}return e.prototype.createAccumulation=function(t){return new TC(t,this._maxSize,this._recordMinMax)},e.prototype.merge=function(t,r){var n=r.clone();return n.merge(t),n},e.prototype.diff=function(t,r){var n=r.clone();return n.diff(t),n},e.prototype.toMetricData=function(t,r,n,i){return{descriptor:t,aggregationTemporality:r,dataPointType:Zt.EXPONENTIAL_HISTOGRAM,dataPoints:n.map(function(s){var o=wC(s,2),l=o[0],u=o[1],a=u.toPointValue(),h=t.type===ie.GAUGE||t.type===ie.UP_DOWN_COUNTER||t.type===ie.OBSERVABLE_GAUGE||t.type===ie.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:l,startTime:u.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:h?void 0:a.sum,positive:{offset:a.positive.offset,bucketCounts:a.positive.bucketCounts},negative:{offset:a.negative.offset,bucketCounts:a.negative.bucketCounts},count:a.count,scale:a.scale,zeroCount:a.zeroCount}}})}},e}(),IC=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},ou=function(){function e(t,r,n){r===void 0&&(r=0),n===void 0&&(n=[0,0]),this.startTime=t,this._current=r,this.sampleTime=n}return e.prototype.record=function(t){this._current=t,this.sampleTime=ut(Date.now())},e.prototype.setStartTime=function(t){this.startTime=t},e.prototype.toPointValue=function(){return this._current},e}(),CC=function(){function e(){this.kind=wr.LAST_VALUE}return e.prototype.createAccumulation=function(t){return new ou(t)},e.prototype.merge=function(t,r){var n=is(r.sampleTime)>=is(t.sampleTime)?r:t;return new ou(t.startTime,n.toPointValue(),n.sampleTime)},e.prototype.diff=function(t,r){var n=is(r.sampleTime)>=is(t.sampleTime)?r:t;return new ou(r.startTime,n.toPointValue(),n.sampleTime)},e.prototype.toMetricData=function(t,r,n,i){return{descriptor:t,aggregationTemporality:r,dataPointType:Zt.GAUGE,dataPoints:n.map(function(s){var o=IC(s,2),l=o[0],u=o[1];return{attributes:l,startTime:u.startTime,endTime:i,value:u.toPointValue()}})}},e}(),ZC=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},Jn=function(){function e(t,r,n,i){n===void 0&&(n=0),i===void 0&&(i=!1),this.startTime=t,this.monotonic=r,this._current=n,this.reset=i}return e.prototype.record=function(t){this.monotonic&&t<0||(this._current+=t)},e.prototype.setStartTime=function(t){this.startTime=t},e.prototype.toPointValue=function(){return this._current},e}(),Em=function(){function e(t){this.monotonic=t,this.kind=wr.SUM}return e.prototype.createAccumulation=function(t){return new Jn(t,this.monotonic)},e.prototype.merge=function(t,r){var n=t.toPointValue(),i=r.toPointValue();return r.reset?new Jn(r.startTime,this.monotonic,i,r.reset):new Jn(t.startTime,this.monotonic,n+i)},e.prototype.diff=function(t,r){var n=t.toPointValue(),i=r.toPointValue();return this.monotonic&&n>i?new Jn(r.startTime,this.monotonic,i,!0):new Jn(r.startTime,this.monotonic,i-n)},e.prototype.toMetricData=function(t,r,n,i){return{descriptor:t,aggregationTemporality:r,dataPointType:Zt.SUM,dataPoints:n.map(function(s){var o=ZC(s,2),l=o[0],u=o[1];return{attributes:l,startTime:u.startTime,endTime:i,value:u.toPointValue()}}),isMonotonic:this.monotonic}},e}(),Rr=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),At=function(){function e(){}return e.Drop=function(){return Im},e.Sum=function(){return Cm},e.LastValue=function(){return Zm},e.Histogram=function(){return Lm},e.ExponentialHistogram=function(){return XC},e.Default=function(){return WC},e}(),LC=function(e){Rr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.createAggregator=function(r){return t.DEFAULT_INSTANCE},t.DEFAULT_INSTANCE=new sC,t}(At),xC=function(e){Rr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.createAggregator=function(r){switch(r.type){case ie.COUNTER:case ie.OBSERVABLE_COUNTER:case ie.HISTOGRAM:return t.MONOTONIC_INSTANCE;default:return t.NON_MONOTONIC_INSTANCE}},t.MONOTONIC_INSTANCE=new Em(!0),t.NON_MONOTONIC_INSTANCE=new Em(!1),t}(At),NC=function(e){Rr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.createAggregator=function(r){return t.DEFAULT_INSTANCE},t.DEFAULT_INSTANCE=new CC,t}(At),OC=function(e){Rr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.createAggregator=function(r){return t.DEFAULT_INSTANCE},t.DEFAULT_INSTANCE=new gm([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0),t}(At),GC=function(e){Rr(t,e);function t(r,n){n===void 0&&(n=!0);var i=e.call(this)||this;if(i._recordMinMax=n,r==null)throw new Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array");r=r.concat(),r=r.sort(function(l,u){return l-u});var s=r.lastIndexOf(-1/0),o=r.indexOf(1/0);return o===-1&&(o=void 0),i._boundaries=r.slice(s+1,o),i}return t.prototype.createAggregator=function(r){return new gm(this._boundaries,this._recordMinMax)},t}(At),VC=function(e){Rr(t,e);function t(r,n){r===void 0&&(r=160),n===void 0&&(n=!0);var i=e.call(this)||this;return i._maxSize=r,i._recordMinMax=n,i}return t.prototype.createAggregator=function(r){return new EC(this._maxSize,this._recordMinMax)},t}(At),kC=function(e){Rr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._resolve=function(r){switch(r.type){case ie.COUNTER:case ie.UP_DOWN_COUNTER:case ie.OBSERVABLE_COUNTER:case ie.OBSERVABLE_UP_DOWN_COUNTER:return Cm;case ie.GAUGE:case ie.OBSERVABLE_GAUGE:return Zm;case ie.HISTOGRAM:return r.advice.explicitBucketBoundaries?new GC(r.advice.explicitBucketBoundaries):Lm}return H.warn("Unable to recognize instrument type: "+r.type),Im},t.prototype.createAggregator=function(r){return this._resolve(r).createAggregator(r)},t}(At),Im=new LC,Cm=new xC,Zm=new NC,Lm=new OC,XC=new VC,WC=new kC,PC=function(e){return At.Default()},MC=function(e){return Rt.CUMULATIVE},au=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(h){try{a(n.next(h))}catch(c){o(c)}}function u(h){try{a(n.throw(h))}catch(c){o(c)}}function a(h){h.done?s(h.value):i(h.value).then(l,u)}a((n=n.apply(e,t||[])).next())})},lu=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(a){return function(h){return u([a,h])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(h){a=[6,h],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},xm=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},AC=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},UC=function(){function e(t){var r,n,i;this._shutdown=!1,this._aggregationSelector=(r=t==null?void 0:t.aggregationSelector)!==null&&r!==void 0?r:PC,this._aggregationTemporalitySelector=(n=t==null?void 0:t.aggregationTemporalitySelector)!==null&&n!==void 0?n:MC,this._metricProducers=(i=t==null?void 0:t.metricProducers)!==null&&i!==void 0?i:[],this._cardinalitySelector=t==null?void 0:t.cardinalitySelector}return e.prototype.setMetricProducer=function(t){if(this._sdkMetricProducer)throw new Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=t,this.onInitialized()},e.prototype.selectAggregation=function(t){return this._aggregationSelector(t)},e.prototype.selectAggregationTemporality=function(t){return this._aggregationTemporalitySelector(t)},e.prototype.selectCardinalityLimit=function(t){return this._cardinalitySelector?this._cardinalitySelector(t):2e3},e.prototype.onInitialized=function(){},e.prototype.collect=function(t){return au(this,void 0,void 0,function(){var r,n,i,s,o,l;return lu(this,function(u){switch(u.label){case 0:if(this._sdkMetricProducer===void 0)throw new Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw new Error("MetricReader is shutdown");return[4,Promise.all(AC([this._sdkMetricProducer.collect({timeoutMillis:t==null?void 0:t.timeoutMillis})],xm(this._metricProducers.map(function(a){return a.collect({timeoutMillis:t==null?void 0:t.timeoutMillis})})),!1))];case 1:return r=xm.apply(void 0,[u.sent()]),n=r[0],i=r.slice(1),s=n.errors.concat(mm(i,function(a){return a.errors})),o=n.resourceMetrics.resource,l=n.resourceMetrics.scopeMetrics.concat(mm(i,function(a){return a.resourceMetrics.scopeMetrics})),[2,{resourceMetrics:{resource:o,scopeMetrics:l},errors:s}]}})})},e.prototype.shutdown=function(t){return au(this,void 0,void 0,function(){return lu(this,function(r){switch(r.label){case 0:return this._shutdown?(H.error("Cannot call shutdown twice."),[2]):(t==null?void 0:t.timeoutMillis)!=null?[3,2]:[4,this.onShutdown()];case 1:return r.sent(),[3,4];case 2:return[4,Dn(this.onShutdown(),t.timeoutMillis)];case 3:r.sent(),r.label=4;case 4:return this._shutdown=!0,[2]}})})},e.prototype.forceFlush=function(t){return au(this,void 0,void 0,function(){return lu(this,function(r){switch(r.label){case 0:return this._shutdown?(H.warn("Cannot forceFlush on already shutdown MetricReader."),[2]):(t==null?void 0:t.timeoutMillis)!=null?[3,2]:[4,this.onForceFlush()];case 1:return r.sent(),[2];case 2:return[4,Dn(this.onForceFlush(),t.timeoutMillis)];case 3:return r.sent(),[2]}})})},e}(),DC=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ls=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(h){try{a(n.next(h))}catch(c){o(c)}}function u(h){try{a(n.throw(h))}catch(c){o(c)}}function a(h){h.done?s(h.value):i(h.value).then(l,u)}a((n=n.apply(e,t||[])).next())})},xs=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(a){return function(h){return u([a,h])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(h){a=[6,h],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},FC=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},JC=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},HC=function(e){DC(t,e);function t(r){var n,i,s,o,l=e.call(this,{aggregationSelector:(n=r.exporter.selectAggregation)===null||n===void 0?void 0:n.bind(r.exporter),aggregationTemporalitySelector:(i=r.exporter.selectAggregationTemporality)===null||i===void 0?void 0:i.bind(r.exporter),metricProducers:r.metricProducers})||this;if(r.exportIntervalMillis!==void 0&&r.exportIntervalMillis<=0)throw Error("exportIntervalMillis must be greater than 0");if(r.exportTimeoutMillis!==void 0&&r.exportTimeoutMillis<=0)throw Error("exportTimeoutMillis must be greater than 0");if(r.exportTimeoutMillis!==void 0&&r.exportIntervalMillis!==void 0&&r.exportIntervalMillis<r.exportTimeoutMillis)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");return l._exportInterval=(s=r.exportIntervalMillis)!==null&&s!==void 0?s:6e4,l._exportTimeout=(o=r.exportTimeoutMillis)!==null&&o!==void 0?o:3e4,l._exporter=r.exporter,l}return t.prototype._runOnce=function(){return Ls(this,void 0,void 0,function(){var r;return xs(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Dn(this._doRun(),this._exportTimeout)];case 1:return n.sent(),[3,3];case 2:return r=n.sent(),r instanceof pm?(H.error("Export took longer than %s milliseconds and timed out.",this._exportTimeout),[2]):(Qt(r),[3,3]);case 3:return[2]}})})},t.prototype._doRun=function(){var r,n;return Ls(this,void 0,void 0,function(){var i,s,o,l,u,a;return xs(this,function(h){switch(h.label){case 0:return[4,this.collect({timeoutMillis:this._exportTimeout})];case 1:if(i=h.sent(),s=i.resourceMetrics,o=i.errors,o.length>0&&(a=H).error.apply(a,JC(["PeriodicExportingMetricReader: metrics collection errors"],FC(o),!1)),!s.resource.asyncAttributesPending)return[3,5];h.label=2;case 2:return h.trys.push([2,4,,5]),[4,(n=(r=s.resource).waitForAsyncAttributes)===null||n===void 0?void 0:n.call(r)];case 3:return h.sent(),[3,5];case 4:return l=h.sent(),H.debug("Error while resolving async portion of resource: ",l),Qt(l),[3,5];case 5:return s.scopeMetrics.length===0?[2]:[4,__._export(this._exporter,s)];case 6:if(u=h.sent(),u.code!==_e.SUCCESS)throw new Error("PeriodicExportingMetricReader: metrics export failed (error "+u.error+")");return[2]}})})},t.prototype.onInitialized=function(){var r=this;this._interval=setInterval(function(){r._runOnce()},this._exportInterval)},t.prototype.onForceFlush=function(){return Ls(this,void 0,void 0,function(){return xs(this,function(r){switch(r.label){case 0:return[4,this._runOnce()];case 1:return r.sent(),[4,this._exporter.forceFlush()];case 2:return r.sent(),[2]}})})},t.prototype.onShutdown=function(){return Ls(this,void 0,void 0,function(){return xs(this,function(r){switch(r.label){case 0:return this._interval&&clearInterval(this._interval),[4,this.onForceFlush()];case 1:return r.sent(),[4,this._exporter.shutdown()];case 2:return r.sent(),[2]}})})},t}(UC),YC=function(){function e(){this._registeredViews=[]}return e.prototype.addView=function(t){this._registeredViews.push(t)},e.prototype.findViews=function(t,r){var n=this,i=this._registeredViews.filter(function(s){return n._matchInstrument(s.instrumentSelector,t)&&n._matchMeter(s.meterSelector,r)});return i},e.prototype._matchInstrument=function(t,r){return(t.getType()===void 0||r.type===t.getType())&&t.getNameFilter().match(r.name)&&t.getUnitFilter().match(r.unit)},e.prototype._matchMeter=function(t,r){return t.getNameFilter().match(r.name)&&(r.version===void 0||t.getVersionFilter().match(r.version))&&(r.schemaUrl===void 0||t.getSchemaUrlFilter().match(r.schemaUrl))},e}(),_r=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ns=function(){function e(t,r){this._writableMetricStorage=t,this._descriptor=r}return e.prototype._record=function(t,r,n){if(r===void 0&&(r={}),n===void 0&&(n=he.active()),typeof t!="number"){H.warn("non-number value provided to metric "+this._descriptor.name+": "+t);return}this._descriptor.valueType===jt.INT&&!Number.isInteger(t)&&(H.warn("INT value type cannot accept a floating-point value for "+this._descriptor.name+", ignoring the fractional digits."),t=Math.trunc(t),!Number.isInteger(t))||this._writableMetricStorage.record(t,r,n,ut(Date.now()))},e}(),BC=function(e){_r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.add=function(r,n,i){this._record(r,n,i)},t}(Ns),zC=function(e){_r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.add=function(r,n,i){if(r<0){H.warn("negative value provided to counter "+this._descriptor.name+": "+r);return}this._record(r,n,i)},t}(Ns),KC=function(e){_r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.record=function(r,n,i){this._record(r,n,i)},t}(Ns),jC=function(e){_r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.record=function(r,n,i){if(r<0){H.warn("negative value provided to histogram "+this._descriptor.name+": "+r);return}this._record(r,n,i)},t}(Ns),Os=function(){function e(t,r,n){this._observableRegistry=n,this._descriptor=t,this._metricStorages=r}return e.prototype.addCallback=function(t){this._observableRegistry.addCallback(t,this)},e.prototype.removeCallback=function(t){this._observableRegistry.removeCallback(t,this)},e}(),QC=function(e){_r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Os),$C=function(e){_r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Os),qC=function(e){_r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Os);function uu(e){return e instanceof Os}var eZ=function(){function e(t){this._meterSharedState=t}return e.prototype.createGauge=function(t,r){var n=rr(t,ie.GAUGE,r),i=this._meterSharedState.registerMetricStorage(n);return new KC(i,n)},e.prototype.createHistogram=function(t,r){var n=rr(t,ie.HISTOGRAM,r),i=this._meterSharedState.registerMetricStorage(n);return new jC(i,n)},e.prototype.createCounter=function(t,r){var n=rr(t,ie.COUNTER,r),i=this._meterSharedState.registerMetricStorage(n);return new zC(i,n)},e.prototype.createUpDownCounter=function(t,r){var n=rr(t,ie.UP_DOWN_COUNTER,r),i=this._meterSharedState.registerMetricStorage(n);return new BC(i,n)},e.prototype.createObservableGauge=function(t,r){var n=rr(t,ie.OBSERVABLE_GAUGE,r),i=this._meterSharedState.registerAsyncMetricStorage(n);return new $C(n,i,this._meterSharedState.observableRegistry)},e.prototype.createObservableCounter=function(t,r){var n=rr(t,ie.OBSERVABLE_COUNTER,r),i=this._meterSharedState.registerAsyncMetricStorage(n);return new QC(n,i,this._meterSharedState.observableRegistry)},e.prototype.createObservableUpDownCounter=function(t,r){var n=rr(t,ie.OBSERVABLE_UP_DOWN_COUNTER,r),i=this._meterSharedState.registerAsyncMetricStorage(n);return new qC(n,i,this._meterSharedState.observableRegistry)},e.prototype.addBatchObservableCallback=function(t,r){this._meterSharedState.observableRegistry.addBatchCallback(t,r)},e.prototype.removeBatchObservableCallback=function(t,r){this._meterSharedState.observableRegistry.removeBatchCallback(t,r)},e}(),Nm=function(){function e(t){this._instrumentDescriptor=t}return e.prototype.getInstrumentDescriptor=function(){return this._instrumentDescriptor},e.prototype.updateDescription=function(t){this._instrumentDescriptor=rr(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:t,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})},e}(),tZ=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Om=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(a){return function(h){return u([a,h])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(h){a=[6,h],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},rZ=function(){function e(t){this._hash=t,this._valueMap=new Map,this._keyMap=new Map}return e.prototype.get=function(t,r){return r!=null||(r=this._hash(t)),this._valueMap.get(r)},e.prototype.getOrDefault=function(t,r){var n=this._hash(t);if(this._valueMap.has(n))return this._valueMap.get(n);var i=r();return this._keyMap.has(n)||this._keyMap.set(n,t),this._valueMap.set(n,i),i},e.prototype.set=function(t,r,n){n!=null||(n=this._hash(t)),this._keyMap.has(n)||this._keyMap.set(n,t),this._valueMap.set(n,r)},e.prototype.has=function(t,r){return r!=null||(r=this._hash(t)),this._valueMap.has(r)},e.prototype.keys=function(){var t,r;return Om(this,function(n){switch(n.label){case 0:t=this._keyMap.entries(),r=t.next(),n.label=1;case 1:return r.done===!0?[3,3]:[4,[r.value[1],r.value[0]]];case 2:return n.sent(),r=t.next(),[3,1];case 3:return[2]}})},e.prototype.entries=function(){var t,r;return Om(this,function(n){switch(n.label){case 0:t=this._valueMap.entries(),r=t.next(),n.label=1;case 1:return r.done===!0?[3,3]:[4,[this._keyMap.get(r.value[0]),r.value[1],r.value[0]]];case 2:return n.sent(),r=t.next(),[3,1];case 3:return[2]}})},Object.defineProperty(e.prototype,"size",{get:function(){return this._valueMap.size},enumerable:!1,configurable:!0}),e}(),Tr=function(e){tZ(t,e);function t(){return e.call(this,fm)||this}return t}(rZ),nZ=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},Gm=function(){function e(t,r){this._aggregator=t,this._activeCollectionStorage=new Tr,this._cumulativeMemoStorage=new Tr,this._overflowAttributes={"otel.metric.overflow":!0},this._cardinalityLimit=(r!=null?r:2e3)-1,this._overflowHashCode=fm(this._overflowAttributes)}return e.prototype.record=function(t,r,n,i){var s=this,o=this._activeCollectionStorage.get(r);if(!o){if(this._activeCollectionStorage.size>=this._cardinalityLimit){var l=this._activeCollectionStorage.getOrDefault(this._overflowAttributes,function(){return s._aggregator.createAccumulation(i)});l==null||l.record(t);return}o=this._aggregator.createAccumulation(i),this._activeCollectionStorage.set(r,o)}o==null||o.record(t)},e.prototype.batchCumulate=function(t,r){var n=this;Array.from(t.entries()).forEach(function(i){var s=nZ(i,3),o=s[0],l=s[1],u=s[2],a=n._aggregator.createAccumulation(r);a==null||a.record(l);var h=a;if(n._cumulativeMemoStorage.has(o,u)){var c=n._cumulativeMemoStorage.get(o,u);h=n._aggregator.diff(c,a)}else if(n._cumulativeMemoStorage.size>=n._cardinalityLimit&&(o=n._overflowAttributes,u=n._overflowHashCode,n._cumulativeMemoStorage.has(o,u))){var c=n._cumulativeMemoStorage.get(o,u);h=n._aggregator.diff(c,a)}if(n._activeCollectionStorage.has(o,u)){var f=n._activeCollectionStorage.get(o,u);h=n._aggregator.merge(f,h)}n._cumulativeMemoStorage.set(o,a,u),n._activeCollectionStorage.set(o,h,u)})},e.prototype.collect=function(){var t=this._activeCollectionStorage;return this._activeCollectionStorage=new Tr,t},e}(),cu=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Vm=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},km=function(){function e(t,r){var n=this;this._aggregator=t,this._unreportedAccumulations=new Map,this._reportHistory=new Map,r.forEach(function(i){n._unreportedAccumulations.set(i,[])})}return e.prototype.buildMetrics=function(t,r,n,i){this._stashAccumulations(n);var s=this._getMergedUnreportedAccumulations(t),o=s,l;if(this._reportHistory.has(t)){var u=this._reportHistory.get(t),a=u.collectionTime;l=u.aggregationTemporality,l===Rt.CUMULATIVE?o=e.merge(u.accumulations,s,this._aggregator):o=e.calibrateStartTime(u.accumulations,s,a)}else l=t.selectAggregationTemporality(r.type);this._reportHistory.set(t,{accumulations:o,collectionTime:i,aggregationTemporality:l});var h=iZ(o);if(h.length!==0)return this._aggregator.toMetricData(r,l,h,i)},e.prototype._stashAccumulations=function(t){var r,n,i=this._unreportedAccumulations.keys();try{for(var s=cu(i),o=s.next();!o.done;o=s.next()){var l=o.value,u=this._unreportedAccumulations.get(l);u===void 0&&(u=[],this._unreportedAccumulations.set(l,u)),u.push(t)}}catch(a){r={error:a}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}},e.prototype._getMergedUnreportedAccumulations=function(t){var r,n,i=new Tr,s=this._unreportedAccumulations.get(t);if(this._unreportedAccumulations.set(t,[]),s===void 0)return i;try{for(var o=cu(s),l=o.next();!l.done;l=o.next()){var u=l.value;i=e.merge(i,u,this._aggregator)}}catch(a){r={error:a}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},e.merge=function(t,r,n){for(var i=t,s=r.entries(),o=s.next();o.done!==!0;){var l=Vm(o.value,3),u=l[0],a=l[1],h=l[2];if(t.has(u,h)){var c=t.get(u,h),f=n.merge(c,a);i.set(u,f,h)}else i.set(u,a,h);o=s.next()}return i},e.calibrateStartTime=function(t,r,n){var i,s;try{for(var o=cu(t.keys()),l=o.next();!l.done;l=o.next()){var u=Vm(l.value,2),a=u[0],h=u[1],c=r.get(a,h);c==null||c.setStartTime(n)}}catch(f){i={error:f}}finally{try{l&&!l.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}return r},e}();function iZ(e){return Array.from(e.entries())}var sZ=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),oZ=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},aZ=function(e){sZ(t,e);function t(r,n,i,s,o){var l=e.call(this,r)||this;return l._attributesProcessor=i,l._aggregationCardinalityLimit=o,l._deltaMetricStorage=new Gm(n,l._aggregationCardinalityLimit),l._temporalMetricStorage=new km(n,s),l}return t.prototype.record=function(r,n){var i=this,s=new Tr;Array.from(r.entries()).forEach(function(o){var l=oZ(o,2),u=l[0],a=l[1];s.set(i._attributesProcessor.process(u),a)}),this._deltaMetricStorage.batchCumulate(s,n)},t.prototype.collect=function(r,n){var i=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(r,this._instrumentDescriptor,i,n)},t}(Nm);function Xm(e,t){var r="";return e.unit!==t.unit&&(r+=" - Unit '"+e.unit+"' does not match '"+t.unit+`'
|
|
451
|
+
`),e.type!==t.type&&(r+=" - Type '"+e.type+"' does not match '"+t.type+`'
|
|
452
|
+
`),e.valueType!==t.valueType&&(r+=" - Value Type '"+e.valueType+"' does not match '"+t.valueType+`'
|
|
453
|
+
`),e.description!==t.description&&(r+=" - Description '"+e.description+"' does not match '"+t.description+`'
|
|
454
|
+
`),r}function lZ(e,t){return" - use valueType '"+e.valueType+"' on instrument creation or use an instrument name other than '"+t.name+"'"}function uZ(e,t){return" - use unit '"+e.unit+"' on instrument creation or use an instrument name other than '"+t.name+"'"}function cZ(e,t){var r={name:t.name,type:t.type,unit:t.unit},n=JSON.stringify(r);return" - create a new view with a name other than '"+e.name+"' and InstrumentSelector '"+n+"'"}function dZ(e,t){var r={name:t.name,type:t.type,unit:t.unit},n=JSON.stringify(r);return" - create a new view with a name other than '"+e.name+"' and InstrumentSelector '"+n+`'
|
|
455
|
+
- OR - create a new view with the name `+e.name+" and description '"+e.description+"' and InstrumentSelector "+n+`
|
|
456
|
+
- OR - create a new view with the name `+t.name+" and description '"+e.description+"' and InstrumentSelector "+n}function Wm(e,t){return e.valueType!==t.valueType?lZ(e,t):e.unit!==t.unit?uZ(e,t):e.type!==t.type?cZ(e,t):e.description!==t.description?dZ(e,t):""}var du=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},hZ=function(){function e(){this._sharedRegistry=new Map,this._perCollectorRegistry=new Map}return e.create=function(){return new e},e.prototype.getStorages=function(t){var r,n,i,s,o=[];try{for(var l=du(this._sharedRegistry.values()),u=l.next();!u.done;u=l.next()){var a=u.value;o=o.concat(a)}}catch(d){r={error:d}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}var h=this._perCollectorRegistry.get(t);if(h!=null)try{for(var c=du(h.values()),f=c.next();!f.done;f=c.next()){var a=f.value;o=o.concat(a)}}catch(d){i={error:d}}finally{try{f&&!f.done&&(s=c.return)&&s.call(c)}finally{if(i)throw i.error}}return o},e.prototype.register=function(t){this._registerStorage(t,this._sharedRegistry)},e.prototype.registerForCollector=function(t,r){var n=this._perCollectorRegistry.get(t);n==null&&(n=new Map,this._perCollectorRegistry.set(t,n)),this._registerStorage(r,n)},e.prototype.findOrUpdateCompatibleStorage=function(t){var r=this._sharedRegistry.get(t.name);return r===void 0?null:this._findOrUpdateCompatibleStorage(t,r)},e.prototype.findOrUpdateCompatibleCollectorStorage=function(t,r){var n=this._perCollectorRegistry.get(t);if(n===void 0)return null;var i=n.get(r.name);return i===void 0?null:this._findOrUpdateCompatibleStorage(r,i)},e.prototype._registerStorage=function(t,r){var n=t.getInstrumentDescriptor(),i=r.get(n.name);if(i===void 0){r.set(n.name,[t]);return}i.push(t)},e.prototype._findOrUpdateCompatibleStorage=function(t,r){var n,i,s=null;try{for(var o=du(r),l=o.next();!l.done;l=o.next()){var u=l.value,a=u.getInstrumentDescriptor();aC(a,t)?(a.description!==t.description&&(t.description.length>a.description.length&&u.updateDescription(t.description),H.warn("A view or instrument with the name ",t.name,` has already been registered, but has a different description and is incompatible with another registered view.
|
|
457
|
+
`,`Details:
|
|
458
|
+
`,Xm(a,t),`The longer description will be used.
|
|
459
|
+
To resolve the conflict:`,Wm(a,t))),s=u):H.warn("A view or instrument with the name ",t.name,` has already been registered and is incompatible with another registered view.
|
|
460
|
+
`,`Details:
|
|
461
|
+
`,Xm(a,t),`To resolve the conflict:
|
|
462
|
+
`,Wm(a,t))}}catch(h){n={error:h}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return s},e}(),fZ=function(){function e(t){this._backingStorages=t}return e.prototype.record=function(t,r,n,i){this._backingStorages.forEach(function(s){s.record(t,r,n,i)})},e}(),pZ=function(){function e(t,r){this._instrumentName=t,this._valueType=r,this._buffer=new Tr}return e.prototype.observe=function(t,r){if(r===void 0&&(r={}),typeof t!="number"){H.warn("non-number value provided to metric "+this._instrumentName+": "+t);return}this._valueType===jt.INT&&!Number.isInteger(t)&&(H.warn("INT value type cannot accept a floating-point value for "+this._instrumentName+", ignoring the fractional digits."),t=Math.trunc(t),!Number.isInteger(t))||this._buffer.set(r,t)},e}(),mZ=function(){function e(){this._buffer=new Map}return e.prototype.observe=function(t,r,n){if(n===void 0&&(n={}),!!uu(t)){var i=this._buffer.get(t);if(i==null&&(i=new Tr,this._buffer.set(t,i)),typeof r!="number"){H.warn("non-number value provided to metric "+t._descriptor.name+": "+r);return}t._descriptor.valueType===jt.INT&&!Number.isInteger(r)&&(H.warn("INT value type cannot accept a floating-point value for "+t._descriptor.name+", ignoring the fractional digits."),r=Math.trunc(r),!Number.isInteger(r))||i.set(n,r)}},e}(),hu=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(h){try{a(n.next(h))}catch(c){o(c)}}function u(h){try{a(n.throw(h))}catch(c){o(c)}}function a(h){h.done?s(h.value):i(h.value).then(l,u)}a((n=n.apply(e,t||[])).next())})},fu=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(a){return function(h){return u([a,h])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(h){a=[6,h],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},Pm=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},Mm=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},gZ=function(){function e(){this._callbacks=[],this._batchCallbacks=[]}return e.prototype.addCallback=function(t,r){var n=this._findCallback(t,r);n>=0||this._callbacks.push({callback:t,instrument:r})},e.prototype.removeCallback=function(t,r){var n=this._findCallback(t,r);n<0||this._callbacks.splice(n,1)},e.prototype.addBatchCallback=function(t,r){var n=new Set(r.filter(uu));if(n.size===0){H.error("BatchObservableCallback is not associated with valid instruments",r);return}var i=this._findBatchCallback(t,n);i>=0||this._batchCallbacks.push({callback:t,instruments:n})},e.prototype.removeBatchCallback=function(t,r){var n=new Set(r.filter(uu)),i=this._findBatchCallback(t,n);i<0||this._batchCallbacks.splice(i,1)},e.prototype.observe=function(t,r){return hu(this,void 0,void 0,function(){var n,i,s,o;return fu(this,function(l){switch(l.label){case 0:return n=this._observeCallbacks(t,r),i=this._observeBatchCallbacks(t,r),[4,eC(Mm(Mm([],Pm(n),!1),Pm(i),!1))];case 1:return s=l.sent(),o=s.filter(tC).map(function(u){return u.reason}),[2,o]}})})},e.prototype._observeCallbacks=function(t,r){var n=this;return this._callbacks.map(function(i){var s=i.callback,o=i.instrument;return hu(n,void 0,void 0,function(){var l,u;return fu(this,function(a){switch(a.label){case 0:return l=new pZ(o._descriptor.name,o._descriptor.valueType),u=Promise.resolve(s(l)),r!=null&&(u=Dn(u,r)),[4,u];case 1:return a.sent(),o._metricStorages.forEach(function(h){h.record(l._buffer,t)}),[2]}})})})},e.prototype._observeBatchCallbacks=function(t,r){var n=this;return this._batchCallbacks.map(function(i){var s=i.callback,o=i.instruments;return hu(n,void 0,void 0,function(){var l,u;return fu(this,function(a){switch(a.label){case 0:return l=new mZ,u=Promise.resolve(s(l)),r!=null&&(u=Dn(u,r)),[4,u];case 1:return a.sent(),o.forEach(function(h){var c=l._buffer.get(h);c!=null&&h._metricStorages.forEach(function(f){f.record(c,t)})}),[2]}})})})},e.prototype._findCallback=function(t,r){return this._callbacks.findIndex(function(n){return n.callback===t&&n.instrument===r})},e.prototype._findBatchCallback=function(t,r){return this._batchCallbacks.findIndex(function(n){return n.callback===t&&rC(n.instruments,r)})},e}(),yZ=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),bZ=function(e){yZ(t,e);function t(r,n,i,s,o){var l=e.call(this,r)||this;return l._attributesProcessor=i,l._aggregationCardinalityLimit=o,l._deltaMetricStorage=new Gm(n,l._aggregationCardinalityLimit),l._temporalMetricStorage=new km(n,s),l}return t.prototype.record=function(r,n,i,s){n=this._attributesProcessor.process(n,i),this._deltaMetricStorage.record(r,n,i,s)},t.prototype.collect=function(r,n){var i=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(r,this._instrumentDescriptor,i,n)},t}(Nm),Am=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),pu=function(){function e(){}return e.Noop=function(){return SZ},e}(),vZ=function(e){Am(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.process=function(r,n){return r},t}(pu);(function(e){Am(t,e);function t(r){var n=e.call(this)||this;return n._allowedAttributeNames=r,n}return t.prototype.process=function(r,n){var i=this,s={};return Object.keys(r).filter(function(o){return i._allowedAttributeNames.includes(o)}).forEach(function(o){return s[o]=r[o]}),s},t})(pu);var SZ=new vZ,wZ=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(h){try{a(n.next(h))}catch(c){o(c)}}function u(h){try{a(n.throw(h))}catch(c){o(c)}}function a(h){h.done?s(h.value):i(h.value).then(l,u)}a((n=n.apply(e,t||[])).next())})},RZ=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(a){return function(h){return u([a,h])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(h){a=[6,h],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},_Z=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},TZ=function(){function e(t,r){this._meterProviderSharedState=t,this._instrumentationScope=r,this.metricStorageRegistry=new hZ,this.observableRegistry=new gZ,this.meter=new eZ(this)}return e.prototype.registerMetricStorage=function(t){var r=this._registerMetricStorage(t,bZ);return r.length===1?r[0]:new fZ(r)},e.prototype.registerAsyncMetricStorage=function(t){var r=this._registerMetricStorage(t,aZ);return r},e.prototype.collect=function(t,r,n){return wZ(this,void 0,void 0,function(){var i,s,o;return RZ(this,function(l){switch(l.label){case 0:return[4,this.observableRegistry.observe(r,n==null?void 0:n.timeoutMillis)];case 1:return i=l.sent(),s=this.metricStorageRegistry.getStorages(t),s.length===0?[2,null]:(o=s.map(function(u){return u.collect(t,r)}).filter($I),o.length===0?[2,{errors:i}]:[2,{scopeMetrics:{scope:this._instrumentationScope,metrics:o},errors:i}])}})})},e.prototype._registerMetricStorage=function(t,r){var n=this,i=this._meterProviderSharedState.viewRegistry.findViews(t,this._instrumentationScope),s=i.map(function(u){var a=oC(u,t),h=n.metricStorageRegistry.findOrUpdateCompatibleStorage(a);if(h!=null)return h;var c=u.aggregation.createAggregator(a),f=new r(a,c,u.attributesProcessor,n._meterProviderSharedState.metricCollectors,u.aggregationCardinalityLimit);return n.metricStorageRegistry.register(f),f});if(s.length===0){var o=this._meterProviderSharedState.selectAggregations(t.type),l=o.map(function(u){var a=_Z(u,2),h=a[0],c=a[1],f=n.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(h,t);if(f!=null)return f;var d=c.createAggregator(t),p=h.selectCardinalityLimit(t.type),m=new r(t,d,pu.Noop(),[h],p);return n.metricStorageRegistry.registerForCollector(h,m),m});s=s.concat(l)}return s},e}(),EZ=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},IZ=function(){function e(t){this.resource=t,this.viewRegistry=new YC,this.metricCollectors=[],this.meterSharedStates=new Map}return e.prototype.getMeterSharedState=function(t){var r=qI(t),n=this.meterSharedStates.get(r);return n==null&&(n=new TZ(this,t),this.meterSharedStates.set(r,n)),n},e.prototype.selectAggregations=function(t){var r,n,i=[];try{for(var s=EZ(this.metricCollectors),o=s.next();!o.done;o=s.next()){var l=o.value;i.push([l,l.selectAggregation(t)])}}catch(u){r={error:u}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i},e}(),Gs=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(h){try{a(n.next(h))}catch(c){o(c)}}function u(h){try{a(n.throw(h))}catch(c){o(c)}}function a(h){h.done?s(h.value):i(h.value).then(l,u)}a((n=n.apply(e,t||[])).next())})},Vs=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(a){return function(h){return u([a,h])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(h){a=[6,h],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},CZ=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},ZZ=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},LZ=function(){function e(t,r){this._sharedState=t,this._metricReader=r}return e.prototype.collect=function(t){return Gs(this,void 0,void 0,function(){var r,n,i,s,o=this;return Vs(this,function(l){switch(l.label){case 0:return r=ut(Date.now()),n=[],i=[],s=Array.from(this._sharedState.meterSharedStates.values()).map(function(u){return Gs(o,void 0,void 0,function(){var a;return Vs(this,function(h){switch(h.label){case 0:return[4,u.collect(this,r,t)];case 1:return a=h.sent(),(a==null?void 0:a.scopeMetrics)!=null&&n.push(a.scopeMetrics),(a==null?void 0:a.errors)!=null&&i.push.apply(i,ZZ([],CZ(a.errors),!1)),[2]}})})}),[4,Promise.all(s)];case 1:return l.sent(),[2,{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:n},errors:i}]}})})},e.prototype.forceFlush=function(t){return Gs(this,void 0,void 0,function(){return Vs(this,function(r){switch(r.label){case 0:return[4,this._metricReader.forceFlush(t)];case 1:return r.sent(),[2]}})})},e.prototype.shutdown=function(t){return Gs(this,void 0,void 0,function(){return Vs(this,function(r){switch(r.label){case 0:return[4,this._metricReader.shutdown(t)];case 1:return r.sent(),[2]}})})},e.prototype.selectAggregationTemporality=function(t){return this._metricReader.selectAggregationTemporality(t)},e.prototype.selectAggregation=function(t){return this._metricReader.selectAggregation(t)},e.prototype.selectCardinalityLimit=function(t){var r,n,i;return(i=(n=(r=this._metricReader).selectCardinalityLimit)===null||n===void 0?void 0:n.call(r,t))!==null&&i!==void 0?i:2e3},e}(),Um=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(h){try{a(n.next(h))}catch(c){o(c)}}function u(h){try{a(n.throw(h))}catch(c){o(c)}}function a(h){h.done?s(h.value):i(h.value).then(l,u)}a((n=n.apply(e,t||[])).next())})},Dm=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(a){return function(h){return u([a,h])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(h){a=[6,h],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},Fm=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function xZ(e,t){var r=t!=null?t:Pn.empty();return e?Pn.default().merge(r):r}var NZ=function(){function e(t){var r,n,i,s,o;if(this._shutdown=!1,this._sharedState=new IZ(xZ((o=t==null?void 0:t.mergeResourceWithDefaults)!==null&&o!==void 0?o:!0,t==null?void 0:t.resource)),(t==null?void 0:t.views)!=null&&t.views.length>0)try{for(var l=Fm(t.views),u=l.next();!u.done;u=l.next()){var a=u.value;this._sharedState.viewRegistry.addView(a)}}catch(d){r={error:d}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}if((t==null?void 0:t.readers)!=null&&t.readers.length>0)try{for(var h=Fm(t.readers),c=h.next();!c.done;c=h.next()){var f=c.value;this.addMetricReader(f)}}catch(d){i={error:d}}finally{try{c&&!c.done&&(s=h.return)&&s.call(h)}finally{if(i)throw i.error}}}return e.prototype.getMeter=function(t,r,n){return r===void 0&&(r=""),n===void 0&&(n={}),this._shutdown?(H.warn("A shutdown MeterProvider cannot provide a Meter"),vw()):this._sharedState.getMeterSharedState({name:t,version:r,schemaUrl:n.schemaUrl}).meter},e.prototype.addMetricReader=function(t){var r=new LZ(this._sharedState,t);t.setMetricProducer(r),this._sharedState.metricCollectors.push(r)},e.prototype.shutdown=function(t){return Um(this,void 0,void 0,function(){return Dm(this,function(r){switch(r.label){case 0:return this._shutdown?(H.warn("shutdown may only be called once per MeterProvider"),[2]):(this._shutdown=!0,[4,Promise.all(this._sharedState.metricCollectors.map(function(n){return n.shutdown(t)}))]);case 1:return r.sent(),[2]}})})},e.prototype.forceFlush=function(t){return Um(this,void 0,void 0,function(){return Dm(this,function(r){switch(r.label){case 0:return this._shutdown?(H.warn("invalid attempt to force flush after MeterProvider shutdown"),[2]):[4,Promise.all(this._sharedState.metricCollectors.map(function(n){return n.forceFlush(t)}))];case 1:return r.sent(),[2]}})})},e}();function OZ(e,t){var r=om(t);return{resource:am(e.resource),schemaUrl:void 0,scopeMetrics:GZ(e.scopeMetrics,r)}}function GZ(e,t){return Array.from(e.map(function(r){return{scope:lm(r.scope),metrics:r.metrics.map(function(n){return VZ(n,t)}),schemaUrl:r.scope.schemaUrl}}))}function VZ(e,t){var r={name:e.descriptor.name,description:e.descriptor.description,unit:e.descriptor.unit},n=PZ(e.aggregationTemporality);switch(e.dataPointType){case Zt.SUM:r.sum={aggregationTemporality:n,isMonotonic:e.isMonotonic,dataPoints:Jm(e,t)};break;case Zt.GAUGE:r.gauge={dataPoints:Jm(e,t)};break;case Zt.HISTOGRAM:r.histogram={aggregationTemporality:n,dataPoints:XZ(e,t)};break;case Zt.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:n,dataPoints:WZ(e,t)};break}return r}function kZ(e,t,r){var n={attributes:Sr(e.attributes),startTimeUnixNano:r.encodeHrTime(e.startTime),timeUnixNano:r.encodeHrTime(e.endTime)};switch(t){case jt.INT:n.asInt=e.value;break;case jt.DOUBLE:n.asDouble=e.value;break}return n}function Jm(e,t){return e.dataPoints.map(function(r){return kZ(r,e.descriptor.valueType,t)})}function XZ(e,t){return e.dataPoints.map(function(r){var n=r.value;return{attributes:Sr(r.attributes),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)}})}function WZ(e,t){return e.dataPoints.map(function(r){var n=r.value;return{attributes:Sr(r.attributes),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)}})}function PZ(e){switch(e){case Rt.DELTA:return 1;case Rt.CUMULATIVE:return 2}}function MZ(e,t){return{resourceMetrics:e.map(function(r){return OZ(r,t)})}}var AZ=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},UZ=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s};function DZ(e,t){var r,n=e.spanContext(),i=e.status;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:t.encodeOptionalSpanContext(e.parentSpanId),traceState:(r=n.traceState)===null||r===void 0?void 0:r.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:Sr(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(function(s){return JZ(s,t)}),droppedEventsCount:e.droppedEventsCount,status:{code:i.code,message:i.message},links:e.links.map(function(s){return FZ(s,t)}),droppedLinksCount:e.droppedLinksCount}}function FZ(e,t){var r;return{attributes:e.attributes?Sr(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:(r=e.context.traceState)===null||r===void 0?void 0:r.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function JZ(e,t){return{attributes:e.attributes?Sr(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function HZ(e,t){var r=om(t);return{resourceSpans:BZ(e,r)}}function YZ(e){var t,r,n=new Map;try{for(var i=AZ(e),s=i.next();!s.done;s=i.next()){var o=s.value,l=n.get(o.resource);l||(l=new Map,n.set(o.resource,l));var u=o.instrumentationLibrary.name+"@"+(o.instrumentationLibrary.version||"")+":"+(o.instrumentationLibrary.schemaUrl||""),a=l.get(u);a||(a=[],l.set(u,a)),a.push(o)}}catch(h){t={error:h}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}function BZ(e,t){for(var r=YZ(e),n=[],i=r.entries(),s=i.next();!s.done;){for(var o=UZ(s.value,2),l=o[0],u=o[1],a=[],h=u.values(),c=h.next();!c.done;){var f=c.value;if(f.length>0){var d=f.map(function(m){return DZ(m,t)});a.push({scope:lm(f[0].instrumentationLibrary),spans:d,schemaUrl:f[0].instrumentationLibrary.schemaUrl})}c=h.next()}var p={resource:am(l),scopeSpans:a,schemaUrl:void 0};n.push(p),s=i.next()}return n}var Hm={serializeRequest:function(e){var t=MZ([e],{useLongBits:!1}),r=new TextEncoder;return r.encode(JSON.stringify(t))},deserializeResponse:function(e){var t=new TextDecoder;return JSON.parse(t.decode(e))}},Ym={serializeRequest:function(e){var t=HZ(e,{useHex:!0,useLongBits:!1}),r=new TextEncoder;return r.encode(JSON.stringify(t))},deserializeResponse:function(e){var t=new TextDecoder;return JSON.parse(t.decode(e))}},zZ=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(h){try{a(n.next(h))}catch(c){o(c)}}function u(h){try{a(n.throw(h))}catch(c){o(c)}}function a(h){h.done?s(h.value):i(h.value).then(l,u)}a((n=n.apply(e,t||[])).next())})},KZ=function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(a){return function(h){return u([a,h])}}function u(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(h){a=[6,h],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},jZ=5,QZ=1e3,$Z=5e3,qZ=1.5,Bm=.2;function eL(){return Math.random()*(2*Bm)-Bm}var tL=function(){function e(t){this._transport=t}return e.prototype.retry=function(t,r,n){var i=this;return new Promise(function(s,o){setTimeout(function(){i._transport.send(t,r).then(s,o)},n)})},e.prototype.send=function(t,r){var n;return zZ(this,void 0,void 0,function(){var i,s,o,l,u,a,h;return KZ(this,function(c){switch(c.label){case 0:return i=Date.now()+r,[4,this._transport.send(t,r)];case 1:s=c.sent(),o=jZ,l=QZ,c.label=2;case 2:return s.status==="retryable"&&o>0?(o--,u=Math.max(Math.min(l,$Z)+eL(),0),l=l*qZ,a=(n=s.retryInMillis)!==null&&n!==void 0?n:u,h=i-Date.now(),a>h?[2,s]:[4,this.retry(t,h,a)]):[3,4];case 3:return s=c.sent(),[3,2];case 4:return[2,s]}})})},e.prototype.shutdown=function(){return this._transport.shutdown()},e}();function zm(e){return new tL(e.transport)}function rL(e){var t=[429,502,503,504];return t.includes(e)}function nL(e){if(e!=null){var t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;var r=new Date(e).getTime()-Date.now();return r>=0?r:0}}var iL=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s},sL=function(){function e(t){this._parameters=t}return e.prototype.send=function(t,r){var n=this;return new Promise(function(i){var s=new XMLHttpRequest;s.timeout=r,s.open("POST",n._parameters.url);var o=n._parameters.headers();Object.entries(o).forEach(function(l){var u=iL(l,2),a=u[0],h=u[1];s.setRequestHeader(a,h)}),s.ontimeout=function(l){i({status:"failure",error:new Error("XHR request timed out")})},s.onreadystatechange=function(){s.status>=200&&s.status<=299?(H.debug("XHR success"),i({status:"success"})):s.status&&rL(s.status)?i({status:"retryable",retryInMillis:nL(s.getResponseHeader("Retry-After"))}):s.status!==0&&i({status:"failure",error:new Error("XHR request failed with non-retryable status")})},s.onabort=function(){i({status:"failure",error:new Error("XHR request aborted")})},s.onerror=function(){i({status:"failure",error:new Error("XHR request errored")})},s.send(t)})},e.prototype.shutdown=function(){},e}();function oL(e){return new sL(e)}var aL=function(){function e(t){this._params=t}return e.prototype.send=function(t){var r=this;return new Promise(function(n){navigator.sendBeacon(r._params.url,new Blob([t],{type:r._params.blobType}))?(H.debug("SendBeacon success"),n({status:"success"})):n({status:"failure",error:new Error("SendBeacon failed")})})},e.prototype.shutdown=function(){},e}();function lL(e){return new aL(e)}function uL(e,t){return tm(e,t,zm({transport:oL(e)}))}function cL(e,t){return tm(e,t,zm({transport:lL({url:e.url,blobType:e.headers()["Content-Type"]})}))}var dL=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s};function hL(e){return function(){var t,r={};return Object.entries((t=e==null?void 0:e())!==null&&t!==void 0?t:{}).forEach(function(n){var i=dL(n,2),s=i[0],o=i[1];typeof o!="undefined"?r[s]=String(o):H.warn('Header "'+s+'" has invalid value ('+o+") and will be ignored")}),r}}var Er=function(){return Er=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Er.apply(this,arguments)};function fL(e,t,r){var n=Er({},r()),i={};return function(){return t!=null&&Object.assign(i,t()),e!=null&&Object.assign(i,e()),Object.assign(i,n)}}function pL(e){if(e!=null)try{return new URL(e),e}catch(t){throw new Error("Configuration: Could not parse user-provided export URL: '"+e+"'")}}function mL(e,t,r){var n,i,s,o;return Er(Er({},NI(e,t,r)),{headers:fL(hL(e.headers),t.headers,r.headers),url:(i=(n=pL(e.url))!==null&&n!==void 0?n:t.url)!==null&&i!==void 0?i:r.url,agentOptions:(o=(s=e.agentOptions)!==null&&s!==void 0?s:t.agentOptions)!==null&&o!==void 0?o:r.agentOptions})}function gL(e,t){return Er(Er({},OI()),{headers:function(){return e},url:"http://localhost:4318/"+t,agentOptions:{keepAlive:!0}})}function yL(e,t,r){return mL({url:e.url,timeoutMillis:e.timeoutMillis,headers:xI(e.headers),concurrencyLimit:e.concurrencyLimit},{},gL(r,t))}function Km(e,t,r,n){var i=!!e.headers||typeof navigator.sendBeacon!="function",s=yL(e,r,n);return i?uL(s,t):cL(s,t)}var bL=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),vL=function(e){bL(t,e);function t(r){return r===void 0&&(r={}),e.call(this,Km(r,Ym,"v1/traces",{"Content-Type":"application/json"}))||this}return t}(qp),ks;(function(e){e[e.DELTA=0]="DELTA",e[e.CUMULATIVE=1]="CUMULATIVE",e[e.LOWMEMORY=2]="LOWMEMORY"})(ks||(ks={}));var SL=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),mu=function(){return Rt.CUMULATIVE},jm=function(e){switch(e){case ie.COUNTER:case ie.OBSERVABLE_COUNTER:case ie.GAUGE:case ie.HISTOGRAM:case ie.OBSERVABLE_GAUGE:return Rt.DELTA;case ie.UP_DOWN_COUNTER:case ie.OBSERVABLE_UP_DOWN_COUNTER:return Rt.CUMULATIVE}},Qm=function(e){switch(e){case ie.COUNTER:case ie.HISTOGRAM:return Rt.DELTA;case ie.GAUGE:case ie.UP_DOWN_COUNTER:case ie.OBSERVABLE_UP_DOWN_COUNTER:case ie.OBSERVABLE_COUNTER:case ie.OBSERVABLE_GAUGE:return Rt.CUMULATIVE}};function wL(){var e=Jr(),t=e.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE.trim().toLowerCase();return t==="cumulative"?mu:t==="delta"?jm:t==="lowmemory"?Qm:(H.warn("OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '"+e.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE+"', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead."),mu)}function RL(e){return e!=null?e===ks.DELTA?jm:e===ks.LOWMEMORY?Qm:mu:wL()}function _L(e){return e!=null&&e.aggregationPreference?e.aggregationPreference:function(t){return At.Default()}}var TL=function(e){SL(t,e);function t(r,n){var i=e.call(this,r)||this;return i._aggregationSelector=_L(n),i._aggregationTemporalitySelector=RL(n==null?void 0:n.temporalityPreference),i}return t.prototype.selectAggregation=function(r){return this._aggregationSelector(r)},t.prototype.selectAggregationTemporality=function(r){return this._aggregationTemporalitySelector(r)},t}(qp),EL=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),IL=function(e){EL(t,e);function t(r){return e.call(this,Km(r!=null?r:{},Hm,"v1/metrics",{"Content-Type":"application/json"}),r)||this}return t}(TL),$m=(e=>(e.BillingQuotaExceeded="BillingQuotaExceeded",e))($m||{});const gu=3,yu=1e3,bu=500,CL=[$m.BillingQuotaExceeded.toString()],ZL=e=>{var r;return((r=e.response.errors)==null?void 0:r.find(n=>CL.includes(n.message)))===void 0},vu=()=>{const e=(t,r,n,i,s=0)=>$(this,null,function*(){try{return yield t()}catch(o){if(o instanceof Vr&&!ZL(o))throw o;if(s<gu)return yield new Promise(l=>setTimeout(l,yu+bu*Math.pow(2,s))),yield e(t,r,n,i,s+1);throw console.error(`highlight.io: data request failed after ${s} retries`),o}});return e};function LL(e,t){const r=e.spanContext();return{name:e.name,kind:e.kind,spanContext:()=>r,parentSpanId:e.parentSpanId,startTime:e.startTime,endTime:e.endTime,status:e.status,attributes:Kf(e.attributes,t),links:e.links,events:e.events,duration:e.duration,ended:e.ended,resource:e.resource,instrumentationLibrary:e.instrumentationLibrary,droppedAttributesCount:e.droppedAttributesCount,droppedEventsCount:e.droppedEventsCount,droppedLinksCount:e.droppedLinksCount}}function xL(e,t){if(!t.isSamplingEnabled())return e;const r=[],n={},i={};for(const s of e){s.parentSpanId&&(i[s.parentSpanId]=i[s.parentSpanId]||[],i[s.parentSpanId].push(s.spanContext().spanId));const o=t.shouldSample(s);o.sample?o.attributes?n[s.spanContext().spanId]=LL(s,o.attributes):n[s.spanContext().spanId]=s:r.push(s.spanContext().spanId)}for(;r.length>0;){const s=r.shift(),o=i[s];if(o)for(const l of o)delete n[l],r.push(l)}return Object.values(n)}const NL=(e,t,r)=>{if(typeof navigator=="undefined"||!navigator.sendBeacon)return!1;try{const n=new Blob([t],{type:r});return navigator.sendBeacon(e,n)}catch(n){return!1}},qm=(e,t,r,n)=>{const i=s=>{if(NL(e,t,r))return n({code:_e.SUCCESS});n({code:_e.FAILED,error:s})};try{const s=new Blob([t],{type:r});fetch(e,{method:"POST",body:s,keepalive:!0,headers:{"Content-Type":r},credentials:"omit"}).then(o=>{if(o.ok)return n({code:_e.SUCCESS});n({code:_e.FAILED,error:new Error(`keepalive fetch export failed with status ${o.status}`)})},o=>i(o))}catch(s){i(s)}};class OL extends vL{constructor(r,n){var i;super(B(x({},r),{headers:{}}));L(this,"url");L(this,"unloading",!1);this.sampler=n,this.url=(i=r==null?void 0:r.url)!=null?i:""}setUnloading(r){this.unloading=r}export(r,n){const i=xL(r,this.sampler);if(i.length===0)return n({code:_e.SUCCESS});if(this.unloading){const l=Ym.serializeRequest(i);if(!l||!this.url)return n({code:_e.FAILED,error:new Error("keepalive export failed: serializer returned empty or url missing")});qm(this.url,l,"application/json",n);return}let s=0;const o=l=>{if(l.code===_e.SUCCESS)return n({code:_e.SUCCESS});if(s++,s>gu)return n({code:_e.FAILED,error:l.error});new Promise(u=>setTimeout(u,yu+bu*Math.pow(2,s))).then(()=>{super.export(i,o)})};super.export(i,o)}}class GL extends IL{constructor(r){var n;super(B(x({},r),{headers:{}}));L(this,"url");L(this,"unloading",!1);this.url=(n=r==null?void 0:r.url)!=null?n:""}setUnloading(r){this.unloading=r}export(r,n){if(this.unloading){const o=Hm.serializeRequest(r);if(!o||!this.url)return n({code:_e.FAILED,error:new Error("keepalive export failed: serializer returned empty or url missing")});qm(this.url,o,"application/json",n);return}let i=0;const s=o=>{var l;if(o.code===_e.SUCCESS)return n({code:_e.SUCCESS});if(i++,i>gu)return console.error(`[@launchdarkly/observability] failed to export OTeL metrics: ${(l=o.error)==null?void 0:l.message}`,o.error),n({code:_e.FAILED,error:o.error});new Promise(u=>setTimeout(u,yu+bu*Math.pow(2,i))).then(()=>{var u;console.warn(`[@launchdarkly/observability] retry ${i}, failed to export OTeL metrics: ${(u=o.error)==null?void 0:u.message}`,o.error),super.export(r,s)})};super.export(r,s)}}const VL="OT_ZONE_CONTEXT",kL="Navigation:";function XL(){return!1}const xt=class xt extends Wn{constructor(r={}){var n,i;super(xt.moduleName,xt.version,r);L(this,"_spansData",new WeakMap);L(this,"_zonePatched");L(this,"_wrappedListeners",new WeakMap);L(this,"_eventsSpanMap",new WeakMap);L(this,"_eventNames");L(this,"_shouldPreventSpanCreation");L(this,"_getLDContextKeyAttributes");this._getLDContextKeyAttributes=r.getLDContextKeyAttributes,this._eventNames=new Set((n=r==null?void 0:r.eventNames)!=null?n:[]),((i=r.productAnalyticsEvents)==null?void 0:i.clicks)!==!1&&this._eventNames.add("click"),this._shouldPreventSpanCreation=typeof(r==null?void 0:r.shouldPreventSpanCreation)=="function"?r.shouldPreventSpanCreation:XL}init(){}_checkForTimeout(r,n){const i=this._spansData.get(n);i&&(r.source==="setTimeout"?i.hrTimeLastTimeout=gr():r.source!=="Promise.then"&&r.source!=="setTimeout"&&(i.hrTimeLastTimeout=void 0))}_allowEventName(r){return this._eventNames.has(r)}_createSpan(r,n){var l,u;const i=r==null?void 0:r.target,s=r==null?void 0:r.type;if(!(i instanceof HTMLElement)||!i.getAttribute||i.hasAttribute("disabled")||!this._allowEventName(s))return;const o=Rp(i,!0);try{const a=this.tracer.startSpan(s,{attributes:{[er]:window.location.href,"event.type":s,"event.tag":i.tagName,"event.xpath":o,"event.id":i.id,"event.classname":i.className,"event.text":(l=i.textContent)!=null?l:"","event.url":window.location.href,"viewport.width":window.innerWidth,"viewport.height":window.innerHeight}},n?Se.setSpan(he.active(),n):void 0);r instanceof MouseEvent&&(a.setAttribute("event.x",r.clientX),a.setAttribute("event.y",r.clientY),a.setAttribute("event.relativeX",r.clientX/window.innerWidth),a.setAttribute("event.relativeY",r.clientY/window.innerHeight),s==="scroll"&&(a.setAttribute("event.scrollX",window.scrollX),a.setAttribute("event.scrollY",window.scrollY)));const h=(u=this._getLDContextKeyAttributes)==null?void 0:u.call(this);return h&&a.setAttributes(h),this._shouldPreventSpanCreation(s,i,a)===!0?void 0:(this._spansData.set(a,{taskCount:0}),a)}catch(a){this._diag.error("failed to start create new user interaction span",a)}}_decrementTask(r){const n=this._spansData.get(r);n&&(n.taskCount--,n.taskCount===0&&this._tryToEndSpan(r,n.hrTimeLastTimeout))}_getCurrentSpan(r){const n=r.get(VL);return n&&Se.getSpan(n)}_incrementTask(r){const n=this._spansData.get(r);n&&n.taskCount++}addPatchedListener(r,n,i,s){let o=this._wrappedListeners.get(i);o||(o=new Map,this._wrappedListeners.set(i,o));let l=o.get(n);return l||(l=new Map,o.set(n,l)),l.has(r)?!1:(l.set(r,s),!0)}removePatchedListener(r,n,i){const s=this._wrappedListeners.get(i);if(!s)return;const o=s.get(n);if(!o)return;const l=o.get(r);return l&&(o.delete(r),o.size===0&&(s.delete(n),s.size===0&&this._wrappedListeners.delete(i))),l}_invokeListener(r,n,i){return typeof r=="function"?r.apply(n,i):r.handleEvent(i[0])}_patchAddEventListener(){const r=this;let n=new Map;return i=>function(o,l,u){if(!l)return i.call(this,o,l,u);const a=u&&typeof u=="object"&&u.once,h=function(...c){var m;let f;const d=c[0];if(!(d!=null&&d.type))return r._invokeListener(l,this,c);if(Date.now()-((m=n.get(d.type))!=null?m:0)<1e3/60)return r._invokeListener(l,this,c);n.set(d.type,Date.now()),d&&(f=r._eventsSpanMap.get(d)),a&&r.removePatchedListener(this,o,l);const p=r._createSpan(d,f);return p?(d&&r._eventsSpanMap.set(d,p),he.with(Se.setSpan(he.active(),p),()=>{const g=r._invokeListener(l,this,c);return p.end(),g})):r._invokeListener(l,this,c)};if(r.addPatchedListener(this,o,l,h))return i.call(this,o,h,u)}}_patchRemoveEventListener(){const r=this;return n=>function(s,o,l){const u=r.removePatchedListener(this,s,o);return u?n.call(this,s,u,l):n.call(this,s,o,l)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._unpatchHistoryApi(),this._wrap(history,"replaceState",this._patchHistoryMethod()),this._wrap(history,"pushState",this._patchHistoryMethod()),this._wrap(history,"back",this._patchHistoryMethod()),this._wrap(history,"forward",this._patchHistoryMethod()),this._wrap(history,"go",this._patchHistoryMethod())}_patchHistoryMethod(){const r=this;return n=>function(...s){const o=`${location.pathname}${location.hash}${location.search}`,l=n.apply(this,s),u=`${location.pathname}${location.hash}${location.search}`;return o!==u&&r._updateInteractionName(u),l}}_unpatchHistoryApi(){Xe(history.replaceState)&&this._unwrap(history,"replaceState"),Xe(history.pushState)&&this._unwrap(history,"pushState"),Xe(history.back)&&this._unwrap(history,"back"),Xe(history.forward)&&this._unwrap(history,"forward"),Xe(history.go)&&this._unwrap(history,"go")}_updateInteractionName(r){const n=Se.getSpan(he.active());n&&typeof n.updateName=="function"&&n.updateName(`${kL} ${r}`)}_patchZoneCancelTask(){const r=this;return n=>function(s){const o=Zone.current,l=r._getCurrentSpan(o);return l&&r._shouldCountTask(s,o)&&r._decrementTask(l),n.call(this,s)}}_patchZoneScheduleTask(){const r=this;return n=>function(s){const o=Zone.current,l=r._getCurrentSpan(o);return l&&r._shouldCountTask(s,o)&&(r._incrementTask(l),r._checkForTimeout(s,l)),n.call(this,s)}}_patchZoneRunTask(){const r=this;return n=>function(s,o,l){const u=Array.isArray(l)&&l[0]instanceof Event?l[0]:void 0,a=u==null?void 0:u.target;let h;const c=this;if(a){if(h=r._createSpan(u),h)return r._incrementTask(h),c.run(()=>{try{return he.with(Se.setSpan(he.active(),h),()=>{const f=Zone.current;return s._zone=f,n.call(f,s,o,l)})}finally{r._decrementTask(h)}})}else h=r._getCurrentSpan(c);try{return n.call(c,s,o,l)}finally{h&&r._shouldCountTask(s,c)&&r._decrementTask(h)}}}_shouldCountTask(r,n){if(r._zone&&(n=r._zone),!n||!r.data||r.data.isPeriodic)return!1;const i=this._getCurrentSpan(n);return!i||!this._spansData.get(i)?!1:r.type==="macroTask"||r.type==="microTask"}_tryToEndSpan(r,n){r&&this._spansData.get(r)&&(r.end(n),this._spansData.delete(r))}enable(){const r=this._getZoneWithPrototype();this._diag.debug("applying patch to",xt.moduleName,xt.version,"zone:",!!r),r?(Xe(r.prototype.runTask)&&(this._unwrap(r.prototype,"runTask"),this._diag.debug("removing previous patch from method runTask")),Xe(r.prototype.scheduleTask)&&(this._unwrap(r.prototype,"scheduleTask"),this._diag.debug("removing previous patch from method scheduleTask")),Xe(r.prototype.cancelTask)&&(this._unwrap(r.prototype,"cancelTask"),this._diag.debug("removing previous patch from method cancelTask")),this._zonePatched=!0,this._wrap(r.prototype,"runTask",this._patchZoneRunTask()),this._wrap(r.prototype,"scheduleTask",this._patchZoneScheduleTask()),this._wrap(r.prototype,"cancelTask",this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach(i=>{Xe(i.addEventListener)&&(this._unwrap(i,"addEventListener"),this._diag.debug("removing previous patch from method addEventListener")),Xe(i.removeEventListener)&&(this._unwrap(i,"removeEventListener"),this._diag.debug("removing previous patch from method removeEventListener")),this._wrap(i,"addEventListener",this._patchAddEventListener()),this._wrap(i,"removeEventListener",this._patchRemoveEventListener())})),this._patchHistoryApi()}disable(){const r=this._getZoneWithPrototype();this._diag.debug("removing patch from",xt.moduleName,xt.version,"zone:",!!r),r&&this._zonePatched?(Xe(r.prototype.runTask)&&this._unwrap(r.prototype,"runTask"),Xe(r.prototype.scheduleTask)&&this._unwrap(r.prototype,"scheduleTask"),Xe(r.prototype.cancelTask)&&this._unwrap(r.prototype,"cancelTask")):this._getPatchableEventTargets().forEach(i=>{Xe(i.addEventListener)&&this._unwrap(i,"addEventListener"),Xe(i.removeEventListener)&&this._unwrap(i,"removeEventListener")}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}};L(xt,"version","0.1.1"),L(xt,"moduleName","user-interaction");let Su=xt;const WL=e=>{if(typeof XMLHttpRequest=="undefined")return()=>{};const t=XMLHttpRequest.prototype,r=t.open,n=t.setRequestHeader,i=t.send,s=a=>!!a&&e.some(h=>a.toLowerCase().includes(h)),o=function(a,h){return this._method=a,this._url=typeof h=="string"?h:String(h),this._requestHeaders={},this._body=void 0,r.apply(this,arguments)},l=function(a,h){return this._requestHeaders||(this._requestHeaders={}),this._requestHeaders[a]=h,n.apply(this,arguments)},u=function(a){if(this._body===void 0&&a!==void 0&&a!==null&&!s(this._url)){const h=jl(a,this._url);h&&(this._body=h)}return i.apply(this,arguments)};return t.open=o,t.setRequestHeader=l,t.send=u,()=>{t.open===o&&(t.open=r),t.setRequestHeader===l&&(t.setRequestHeader=n),t.send===u&&(t.send=i)}},PL=256*1024,ML=e=>!!e&&e.split(";")[0].trim().toLowerCase()==="multipart/form-data",eg=e=>{if(!e||typeof e!="object")return{};if(typeof Headers!="undefined"&&e instanceof Headers)return Object.fromEntries(e.entries());if(Array.isArray(e))try{return Object.fromEntries(new Headers(e).entries())}catch(t){return Object.fromEntries(e.map(([r,n])=>[String(r),String(n)]))}return x({},e)},Xs=e=>Object.prototype.toString.call(e),AL=e=>typeof ArrayBuffer!="undefined"&&e instanceof ArrayBuffer||Xs(e)==="[object ArrayBuffer]"||Xs(e)==="[object SharedArrayBuffer]",tg=e=>{if(typeof File!="undefined"&&e instanceof File||Xs(e)==="[object File]"){const t=e;return`[File name="${t.name}" type="${t.type}" size=${t.size}]`}return`[Blob type="${e.type}" size=${e.size}]`},wu=(e,t,r)=>{const n=e[t];n===void 0?e[t]=r:Array.isArray(n)?n.push(r):e[t]=[n,r]},UL=e=>{const t={};return e.forEach((r,n)=>{wu(t,n,typeof r=="string"?r:tg(r))}),JSON.stringify(t)},DL=e=>{const t=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e);if(t.byteLength>PL)return`[binary size=${t.byteLength}]`;try{return new TextDecoder("utf-8",{fatal:!0}).decode(t)}catch(r){return`[binary size=${t.byteLength}]`}},rg=e=>{if(e==null)return;switch(typeof e){case"string":return e;case"number":case"boolean":case"bigint":return String(e);case"object":break;default:return}const t=Xs(e);if(typeof URLSearchParams!="undefined"&&e instanceof URLSearchParams||t==="[object URLSearchParams]")return e.toString();if(typeof FormData!="undefined"&&e instanceof FormData||t==="[object FormData]")return UL(e);if(typeof Blob!="undefined"&&e instanceof Blob||t==="[object Blob]"||t==="[object File]")return tg(e);if(AL(e)||ArrayBuffer.isView(e))return DL(e);if(!(typeof ReadableStream!="undefined"&&e instanceof ReadableStream||t==="[object ReadableStream]")){if(typeof Document!="undefined"&&e instanceof Document)try{return new XMLSerializer().serializeToString(e)}catch(r){return}try{return bt(e)}catch(r){return}}},Ru=new WeakMap,FL=e=>Ru.get(e),JL=(e,t)=>$(this,null,function*(){const r=e.getReader(),n=[];let i=0;for(;i<t;){const{done:s,value:o}=yield r.read();if(s)return{chunks:n,byteLength:i,truncated:!1};const l=t-i,u=o.byteLength>l?o.subarray(0,l):o;n.push(u),i+=u.byteLength}return r.cancel().catch(()=>{}),{chunks:n,byteLength:i,truncated:!0}}),HL=({chunks:e,byteLength:t})=>{const r=new Uint8Array(t);let n=0;for(const i of e)r.set(i,n),n+=i.byteLength;return r},YL=e=>{const t=new TextDecoder("utf-8",{fatal:!0});try{let r="";for(const n of e.chunks)r+=t.decode(n,{stream:!0});return e.truncated?r:r+t.decode()}catch(r){return`[binary size${e.truncated?">":"="}${e.byteLength}]`}},Ws=e=>`[multipart/form-data size${e.truncated?">":"="}${e.byteLength}]`,BL=(e,t)=>{var i,s,o,l,u,a,h;const r=/;\s*boundary=(?:"([^"]*)"|([^;]*))/i.exec(t),n=(s=(i=r==null?void 0:r[1])!=null?i:r==null?void 0:r[2])==null?void 0:s.trim();if(!n)return Ws(e);try{const c=HL(e),f=new TextDecoder("windows-1252").decode(c),d=`--${n}`,p={};let m=f.indexOf(d);if(m===-1)return Ws(e);for(;m!==-1&&(m+=d.length,!f.startsWith("--",m));){const g=f.indexOf(`\r
|
|
463
|
+
`,m),v=g===-1?-1:f.indexOf(`\r
|
|
464
|
+
\r
|
|
465
|
+
`,g);if(v===-1)break;const y=new TextDecoder().decode(c.subarray(g+2,v)),S=v+4,_=f.indexOf(`\r
|
|
466
|
+
${d}`,S),w=_===-1,b=w?f.length:_,R=(o=/\bname="([^"]*)"/i.exec(y))==null?void 0:o[1];if(R!==void 0){const E=(l=/\bfilename="([^"]*)"/i.exec(y))==null?void 0:l[1];if(E!==void 0){const I=(h=(a=(u=/^content-type:[ \t]*(.*)$/im.exec(y))==null?void 0:u[1])==null?void 0:a.trim())!=null?h:"",C=b-S;wu(p,R,`[File name="${E}" type="${I}" size${w?">=":"="}${C}]`)}else wu(p,R,new TextDecoder().decode(c.subarray(S,b)))}m=w?-1:_+2}return e.truncated&&Object.keys(p).length===0?Ws(e):JSON.stringify(p)}catch(c){return Ws(e)}},zL=(e,t)=>{try{if(t&&t.body!==void 0&&t.body!==null)return Promise.resolve(rg(t.body));if(!e.body||e.bodyUsed)return Promise.resolve(void 0);const r=e.clone();if(!r.body)return Promise.resolve(void 0);const n=e.headers.get("content-type");return JL(r.body,$l(e.headers)).then(i=>ML(n)?BL(i,n):YL(i)).catch(()=>{})}catch(r){return Promise.resolve(void 0)}},KL=(e=[])=>{if(typeof window=="undefined"||typeof window.fetch!="function"||typeof Request=="undefined")return()=>{};const t=i=>e.some(s=>i.toLowerCase().includes(s)),r=window.fetch,n=function(i,s){return i instanceof Request&&!Ru.has(i)&&!t(i.url)&&Ru.set(i,zL(i,s)),r.call(this!=null?this:window,i,s)};return window.fetch=n,()=>{window.fetch===n&&(window.fetch=r)}};class _u{constructor(t,r){L(this,"debug");L(this,"name");this.debug=t,this.name=r}log(...t){if(this.debug){let r=`[${Date.now()}]`;this.name&&(r+=` - ${this.name}`),console.log.apply(console,[r,...t])}}warn(...t){let r=`[${Date.now()}]`;this.name&&(r+=` - ${this.name}`),console.warn.apply(console,[r,...t])}}class Tu{constructor(){L(this,"_sdk");L(this,"_isLoaded",!1);L(this,"_callBuffer",[]);L(this,"_capacity",1e5);L(this,"_droppedEvents",0);L(this,"_exceededCapacity",!1);L(this,"_logger",new _u)}_bufferCall(t,r){if(this._isLoaded)try{return this._sdk[t](...r)}catch(n){De(`Error executing buffered call to ${t}:`,"error",n)}else{this._enqueue({method:t,args:r});return}}_enqueue(t){this._callBuffer.length<this._capacity?(this._callBuffer.push(t),this._exceededCapacity=!1):(this._exceededCapacity||(this._exceededCapacity=!0,De("Exceeded event queue capacity. Increase capacity to avoid dropping events.","warn")),this._droppedEvents+=1)}load(t){this._sdk=t,this._isLoaded=!0;for(const{method:r,args:n}of this._callBuffer)try{this._sdk[r](...n)}catch(i){De(`Error executing buffered call to ${r}:`,"error",i)}this._callBuffer=[]}}const Je="feature_flag",ng="launchdarkly",Eu="evaluation",jL=`${Je}.${Eu}`,ig=`${Je}.set.id`,sg=`${Je}.key`,og=`${Je}.contextKeys`,ag=`${Je}.context.id`,lg=`${Je}.result.value`,Iu=`${Je}.provider.name`,Ps={kind:`${Je}.result.reason.kind`,errorKind:`${Je}.result.reason.errorKind`,ruleIndex:`${Je}.result.reason.ruleIndex`,ruleId:`${Je}.result.reason.ruleId`,prerequisiteKey:`${Je}.result.reason.prerequisiteKey`,inExperiment:`${Je}.result.reason.inExperiment`,bigSegmentsStatus:`${Je}.result.reason.bigSegmentsStatus`},ug=`${Je}.result.variationIndex`,cg=`${ng}.application.id`,dg=`${ng}.application.version`,QL="context.contextKeys",$L="$ld:telemetry:session:init",hg="$ld:telemetry:track",qL="launchdarkly.track",ex="page_view",tx="document_load",rx="result.status";function fg(e){return e.includes("%")||e.includes(":")?e.replace(/%/g,"%25").replace(/:/g,"%3A"):e}function pg(e){return e.kind==="multi"}function Ir(e){return pg(e)?Object.keys(e).sort().filter(t=>t!=="kind").map(t=>`${t}:${fg(e[t].key)}`).join(":"):"kind"in e&&e.kind==="user"?e.key:"kind"in e?`${e.kind}:${fg(e.key)}`:e.key}function Hn(e){return pg(e)?Object.keys(e).sort().filter(t=>t!=="kind").map(t=>({[t]:e[t].key})).reduce((t,r)=>x(x({},t),r),{}):"kind"in e?{[e.kind]:e.key}:{user:e.key}}function nx(e,t,r){t.addHook({getMetadata:()=>({name:"highlight.run"}),afterIdentify:(n,i,s)=>{var l,u;const o=B(x({},Hn(n.context)),{key:(u=(l=r==null?void 0:r.contextFriendlyName)==null?void 0:l.call(r,n.context))!=null?u:Ir(n.context)});return e.log("LD.identify","INFO",o),s.status==="completed"&&e.identify(o.key,o,"LaunchDarkly"),i},afterEvaluation:(n,i,s)=>{const o=x({[Iu]:"LaunchDarkly",[sg]:n.flagKey,[lg]:JSON.stringify(s.value)},s.variationIndex!==void 0&&s.variationIndex!==null?{[ug]:s.variationIndex}:{});if(s.reason)for(const l in Ps){const u=l,a=s.reason[u];a!=null&&(o[Ps[u]]=a)}return n.context&&(o[og]=JSON.stringify(Hn(n.context)),o[ag]=Ir(n.context)),e.startSpan(Eu,l=>{l&&l.addEvent(jL,o)}),i}})}class ix{constructor(t,r){L(this,"client");L(this,"metadata");this.client=t,this.metadata=r}getHooks(t){return[]}init(t){this.client.track($L,{sessionID:t})}recordGauge(t,r){}identify(t,r,n={},i){}error(t,r){}track(t,r){const n=r.event;this.client.track(n?`${hg}:${n}`:hg,B(x({},r),{sessionID:t}))}}class Ms extends Tu{constructor(r,n){super();L(this,"client");this.client=new ix(r,n)}getHooks(r){return[{getMetadata:()=>({name:"highlight.run/ld"}),afterIdentify:(n,i,s)=>(this.load(this.client),i)}]}init(r){return this._bufferCall("init",[r])}recordGauge(r,n){return this._bufferCall("recordGauge",[r,n])}identify(r,n,i={},s){return this._bufferCall("identify",[r,n,i,s])}error(r,n){return this._bufferCall("error",[r,n])}track(r,n){return this._bufferCall("track",[r,n])}}const Cu=e=>{e(window.location.href);const t=history.pushState;history.pushState=(s=>function(){var l=s.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),l})(history.pushState);const r=history.replaceState;history.replaceState=(s=>function(){var l=s.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),l})(history.replaceState);const n=()=>{window.dispatchEvent(new Event("locationchange"))};window.addEventListener("popstate",n);const i=function(){e(window.location.href)};return window.addEventListener("locationchange",i),()=>{window.removeEventListener("popstate",n),window.removeEventListener("locationchange",i),history.pushState=t,history.replaceState=r}},an=class an extends Wn{constructor(r={}){super(an.moduleName,an.version,r);L(this,"_getLDContextKeyAttributes");L(this,"_unlisten");L(this,"_lastUrl","");this._getLDContextKeyAttributes=r.getLDContextKeyAttributes}init(){}enable(){this._lastUrl=window.location.href,this._unlisten=Cu(r=>{var i;const n=this._lastUrl;if(this._lastUrl=r,n!==r)try{const s=this.tracer.startSpan(ex,{attributes:{[er]:r,"page_view.previous_url":n,"page_view.url":r}}),o=(i=this._getLDContextKeyAttributes)==null?void 0:i.call(this);o&&s.setAttributes(o),s.end()}catch(s){this._diag.error("failed to create page view span",s)}})}disable(){var r;(r=this._unlisten)==null||r.call(this),this._unlisten=void 0}};L(an,"version","0.1.0"),L(an,"moduleName","location-change");let Zu=an;const Lu={version:"1.2.0"}.version;let Me={},Ut,As,Cr,Zr;const Lr="highlight.record",sx="highlight.session_id",Us=new Map,xu=e=>`${e.spanContext().traceId}:${e.spanContext().spanId}`,mg="launchdarkly.js.log",ox="launchdarkly.exception.id",gg="launchdarkly.sampling.ratio",yg="log.severity",bg="log.message",vg=(e,t)=>{var g,v,y,S,_,w,b,R,E,I,C,N,G,Q;if(Me.tracerProvider||Me.meterProvider){console.warn("OTEL already initialized. Skipping...");return}Ut=e;const r=e.backendUrl||void 0||"https://pub.highlight.io",n=[...(v=(g=e.networkRecordingOptions)==null?void 0:g.urlBlocklist)!=null?v:[],...Fp],i=[r,e.otlpEndpoint].filter(Z=>!!Z).map(Z=>Z.toLowerCase()),s=(y=e.environment)!=null?y:"production",o={url:e.otlpEndpoint+"/v1/traces",concurrencyLimit:10,timeoutMillis:3e4,compression:"gzip",keepAlive:!0,httpAgentOptions:{timeout:6e4,keepAlive:!0}},l=new OL(o,t),u=new Ds(l,{maxExportBatchSize:1024,maxQueueSize:2048,exportTimeoutMillis:o.timeoutMillis,scheduledDelayMillis:5e3}),a=new Pn({[PT]:(S=e.serviceName)!=null?S:"highlight-browser",[MT]:e.serviceVersion,"deployment.environment.name":s,"highlight.project_id":e.projectId,[UT]:navigator.userAgent,"browser.language":navigator.language,"telemetry.distro.name":"@highlight-run/observability","telemetry.distro.version":Lu});Me.tracerProvider=new gT({resource:a,mergeResourceWithDefaults:!0,spanProcessors:[u]}),Se.setGlobalTracerProvider(Me.tracerProvider);const h=new GL(B(x({},o),{url:e.otlpEndpoint+"/v1/metrics"})),c=new HC({exporter:h,exportIntervalMillis:o.timeoutMillis,exportTimeoutMillis:o.timeoutMillis});Me.meterProvider=new NZ({resource:a,readers:[c]}),yl.setGlobalMeterProvider(Me.meterProvider);let f=[];if(((_=e.instrumentations)==null?void 0:_["@opentelemetry/instrumentation-document-load"])!==!1&&f.push(new HT({applyCustomAttributesOnSpan:{documentLoad:Tg,documentFetch:Tg,resourceFetch:bx}})),((w=e.instrumentations)==null?void 0:w["@opentelemetry/instrumentation-user-interaction"])!==!1&&f.push(new Su({productAnalyticsEvents:e.productAnalyticsEvents,getLDContextKeyAttributes:e.getLDContextKeyAttributes})),((b=e.productAnalyticsEvents)==null?void 0:b.pageViews)!==!1&&f.push(new Zu({getLDContextKeyAttributes:e.getLDContextKeyAttributes})),(R=e.networkRecordingOptions)!=null&&R.enabled){if(((E=e.instrumentations)==null?void 0:E["@opentelemetry/instrumentation-fetch"])!==!1){const W=new vE({propagateTraceHeaderCorsUrls:Ig(e.tracingOrigins),applyCustomAttributesOnSpan:(k,M,D)=>{var P;if(!k.attributes)return;const U=k;if(U.attributes[Lr]===!1)return;const q=typeof Request!="undefined"&&M instanceof Request,fe=q?FL(M):void 0;Rg(k,q?void 0:M.body,M.headers,e.networkRecordingOptions);const O=()=>$(this,null,function*(){const F=yield fe;F!==void 0&&dx(k,F,M.headers,e.networkRecordingOptions)}),pe=()=>{var F;return(F=e.networkRecordingOptions)!=null&&F.requestResponseSanitizer&&_g(k,e.networkRecordingOptions.requestResponseSanitizer),U.attributes[Lr]!==!1};if(!(D instanceof Response)){if(k.setAttributes({"http.response.error":D.message,[Tp]:D.status}),!pe())return;fe&&Us.set(xu(k),O().then(()=>{pe()}));return}if(pe()&&(P=e.networkRecordingOptions)!=null&&P.recordHeadersAndBody){const F=$(this,null,function*(){var ge,K,le,Te,Jt;yield O();const Y=yield $p(D,(ge=e.networkRecordingOptions)==null?void 0:ge.bodyKeysToRecord,(K=e.networkRecordingOptions)==null?void 0:K.networkBodyKeysToRedact),j=Object.fromEntries(D.headers.entries()),ne=Es((Te=(le=e.networkRecordingOptions)==null?void 0:le.networkHeadersToRedact)!=null?Te:[],j,(Jt=e.networkRecordingOptions)==null?void 0:Jt.headerKeysToRecord),ae=Ou(ne,"http.response.header");Object.assign(k.attributes,x({"http.response.body":Y},ae)),pe()});Us.set(xu(k),F)}}});f.push(W)}((I=e.instrumentations)==null?void 0:I["@opentelemetry/instrumentation-xml-http-request"])!==!1&&f.push(new DE({propagateTraceHeaderCorsUrls:Ig(e.tracingOrigins),applyCustomAttributesOnSpan:(W,k)=>{var U,q,fe,O;const M=k;if(!(!W.attributes||W.attributes[Lr]===!1)){if(Rg(W,M._body,M._requestHeaders,e.networkRecordingOptions),(U=e.networkRecordingOptions)!=null&&U.recordHeadersAndBody){let pe="";(k.responseType===""||k.responseType==="text")&&(pe=Ct(k.responseText,(q=e.networkRecordingOptions)==null?void 0:q.networkBodyKeysToRedact,(fe=e.networkRecordingOptions)==null?void 0:fe.bodyKeysToRecord,void 0));const P=hx(k.getAllResponseHeaders());gx(W,P,pe,e.networkRecordingOptions)}(O=e.networkRecordingOptions)!=null&&O.requestResponseSanitizer&&_g(W,e.networkRecordingOptions.requestResponseSanitizer)}}}))}O_({instrumentations:f}),(C=e.networkRecordingOptions)!=null&&C.enabled&&e.networkRecordingOptions.recordHeadersAndBody&&((N=e.instrumentations)==null?void 0:N["@opentelemetry/instrumentation-xml-http-request"])!==!1&&(Cr==null||Cr(),Cr=WL([...n,...i])),(G=e.networkRecordingOptions)!=null&&G.enabled&&e.networkRecordingOptions.recordHeadersAndBody&&((Q=e.instrumentations)==null?void 0:Q["@opentelemetry/instrumentation-fetch"])!==!1&&(Zr==null||Zr(),Zr=KL([...n,...i]));const m=new vp;return m.enable(),Me.tracerProvider.register({contextManager:m,propagator:new Mf({propagators:[new xf,new lx({backendUrl:r,otlpEndpoint:e.otlpEndpoint,tracingOrigins:e.tracingOrigins,urlBlocklist:n})]})}),As=ax(l,h,u,()=>Me),Me},ax=(e,t,r,n)=>{if(typeof document=="undefined"||typeof window=="undefined")return()=>{};const i=()=>{var u,a;e.setUnloading(!0),t.setUnloading(!0),r.setSkipPendingOnFlush(!0);const l=n();(u=l.tracerProvider)==null||u.forceFlush().catch(()=>{}),(a=l.meterProvider)==null||a.forceFlush().catch(()=>{})},s=()=>{document.visibilityState==="hidden"?i():document.visibilityState==="visible"&&(e.setUnloading(!1),t.setUnloading(!1),r.setSkipPendingOnFlush(!1))},o=()=>i();return document.addEventListener("visibilitychange",s),window.addEventListener("pagehide",o),()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("pagehide",o)}};class Ds extends fp{constructor(){super(...arguments);L(this,"_pendingSpans",new Set);L(this,"_skipPendingOnFlush",!1)}setSkipPendingOnFlush(r){this._skipPendingOnFlush=r}onStart(r,n){r.setAttribute(sx,Pt()),super.onStart(r,n)}onEnd(r){if(r.attributes[Lr]===!1)return;const n=xu(r),i=Us.get(n);if(i){const s=i.catch(o=>{console.warn("[CustomBatchSpanProcessor] Failed to capture response body attributes",o)}).finally(()=>{Us.delete(n),this._pendingSpans.delete(s),r.attributes[Lr]!==!1&&super.onEnd(r)});this._pendingSpans.add(s);return}super.onEnd(r)}shutdown(){return $(this,null,function*(){return this._skipPendingOnFlush||(yield Promise.allSettled(this._pendingSpans)),hc(Ds.prototype,this,"shutdown").call(this)})}forceFlush(){return $(this,null,function*(){return this._skipPendingOnFlush||(yield Promise.allSettled(this._pendingSpans)),hc(Ds.prototype,this,"forceFlush").call(this)})}}class lx extends Ff{constructor(r){super();L(this,"highlightEndpoints");L(this,"tracingOrigins");L(this,"urlBlocklist");this.highlightEndpoints=[r.backendUrl,`${r.otlpEndpoint}/v1/traces`,`${r.otlpEndpoint}/v1/logs`,`${r.otlpEndpoint}/v1/metrics`],this.tracingOrigins=r.tracingOrigins,this.urlBlocklist=r.urlBlocklist}inject(r,n,i){var l;const s=Se.getSpan(r);if(!s||!s.attributes)return;const o=Cg(s);typeof o=="string"&&(yx(o,this.highlightEndpoints,this.tracingOrigins,this.urlBlocklist)||s.setAttribute(Lr,!1),!zl(o,(l=this.tracingOrigins)!=null?l:[],this.urlBlocklist))||super.inject(r,n,i)}}const Sg="highlight-browser",ux=Sg,Fs=()=>{var e;return(e=Me.tracerProvider)==null?void 0:e.getTracer(Sg)},nr=()=>{var e;return(e=Me.meterProvider)==null?void 0:e.getMeter(ux)},cx=()=>Se.getActiveSpan(),Nu=()=>$(this,null,function*(){As&&(As(),As=void 0),Cr&&(Cr(),Cr=void 0),Zr&&(Zr(),Zr=void 0),yield Promise.allSettled([$(this,null,function*(){Me.tracerProvider?(yield Me.tracerProvider.shutdown(),Me.tracerProvider=void 0):console.warn("OTEL shutdown called without initialized tracerProvider.")}),$(this,null,function*(){Me.meterProvider?(yield Me.meterProvider.shutdown(),Me.meterProvider=void 0):console.warn("OTEL shutdown called without initialized meterProvider.")})])}),wg=e=>{const t=FE(e),r={};return t!=null&&t.name&&(r["graphql.operation.name"]=t.name),t!=null&&t.type&&(r["graphql.operation.type"]=t.type),r},dx=(e,t,r,n)=>{if(!e.attributes)return;const i=e.attributes;Object.assign(i,wg(t)),n!=null&&n.recordHeadersAndBody&&Object.assign(i,{"http.request.body":Ct(t,n.networkBodyKeysToRedact,n.bodyKeysToRecord,eg(r))})},Rg=(e,t,r,n)=>{var h;if(!e.attributes)return;const s=Cg(e),o=Is(s),l=Jp(o),u=rg(t),a=eg(r);if(e.setAttributes(wg(u!=null?u:t)),e.setAttributes({"highlight.type":"http.request",[jr]:o,[er]:o,[ps]:l.pathname,[AT]:l.search}),e.setAttributes(fx(l.searchParams,"url.query_params")),n!=null&&n.recordHeadersAndBody){u!==void 0&&e.setAttribute("http.request.body",Ct(u,n.networkBodyKeysToRedact,n.bodyKeysToRecord,a));const c=Es((h=n.networkHeadersToRedact)!=null?h:[],a,n.headerKeysToRecord),f=Ou(c,"http.request.header");e.setAttributes(f)}},hx=e=>{const t={};return e&&e.trim().split(/[\r\n]+/).forEach(r=>{const n=r.split(": "),i=n.shift();i&&(t[i]=n.join(": "))}),t},Ou=(e,t)=>{const r={};return Object.entries(e).forEach(([n,i])=>{const s=n.toLowerCase().replace(/_/g,"-"),o=`${t}.${s}`,l=mx(s,i);if(r[o]){const u=r[o];Array.isArray(u)?r[o]=[...u,...l]:r[o]=[u,...l]}else r[o]=l.length===1?l[0]:l}),r},fx=(e,t)=>{const r={};for(const[n,i]of e.entries()){const s=`${t}.${n}`,o=r[s];o===void 0?r[s]=i:Array.isArray(o)?o.push(i):r[s]=[o,i]}return r},px=new Set(["accept","accept-charset","accept-encoding","accept-language","accept-ranges","allow","cache-control","connection","content-encoding","content-language","expect","if-match","if-none-match","pragma","proxy-authenticate","te","trailer","transfer-encoding","upgrade","vary","via","warning","www-authenticate","access-control-allow-headers","access-control-allow-methods","access-control-expose-headers","access-control-request-headers"]),mx=(e,t)=>px.has(e)?t.split(",").map(r=>r.trim()).filter(r=>r.length>0):[t],gx=(e,t,r,n)=>{var o;e.setAttribute("http.response.body",r);const i=Es((o=n.networkHeadersToRedact)!=null?o:[],t,n.headerKeysToRecord),s=Ou(i,"http.response.header");e.setAttributes(s)},_g=(e,t)=>{var c,f,d,p,m,g,v,y,S,_,w,b;const n=e.attributes,i={},s={};for(const[R,E]of Object.entries(n))R.startsWith("http.request.header.")&&(i[R.slice(20)]=String(E)),R.startsWith("http.response.header.")&&(s[R.slice(21)]=String(E));let l={request:{sessionSecureID:"",id:"",url:(f=(c=n[er])!=null?c:n[jr])!=null?f:"",verb:(p=(d=n["http.request.method"])!=null?d:n[GT])!=null?p:"GET",headers:i,body:(m=n["http.request.body"])!=null?m:""},response:{status:Number((v=(g=n[Tp])!=null?g:n[VT])!=null?v:0),headers:s,body:(y=n["http.response.body"])!=null?y:""},urlBlocked:!1},u=!0;try{l.request.body=JSON.parse(l.request.body)}catch(R){u=!1}let a=!0;try{l.response.body=JSON.parse(l.response.body)}catch(R){a=!1}let h;try{h=t(l)}catch(R){return}if(!h){Object.assign(e.attributes,{[Lr]:!1});return}u&&((S=h.request)!=null&&S.body)&&(h.request.body=JSON.stringify(h.request.body)),a&&((_=h.response)!=null&&_.body)&&(h.response.body=JSON.stringify(h.response.body)),Object.assign(e.attributes,{"http.request.body":(w=h.request.body)!=null?w:"","http.response.body":(b=h.response.body)!=null?b:""})},yx=(e,t,r,n)=>n!=null&&n.some(s=>e.toLowerCase().includes(s))?!1:Cs(e,t),Tg=e=>{var s,o,l;if(!e.events)return;const r=e.events,n={unload:ht("unloadEventStart","unloadEventEnd",r),dom_interactive:ht("fetchStart","domInteractive",r),dom_content_loaded:ht("domContentLoadedEventStart","domContentLoadedEventEnd",r),dom_complete:ht("fetchStart","domComplete",r),load_event:ht("loadEventStart","loadEventEnd",r),document_load:ht("fetchStart","loadEventEnd",r),first_paint:ht("fetchStart","firstPaint",r),first_contentful_paint:ht("fetchStart","firstContentfulPaint",r),domain_lookup:ht("domainLookupStart","domainLookupEnd",r),connect:ht("connectStart","connectEnd",r),request:ht("requestStart","requestEnd",r),response:ht("responseStart","responseEnd",r)},i=(o=(s=Ut==null?void 0:Ut.getIntegrations)==null?void 0:s.call(Ut))!=null?o:[];if(n.document_load!==void 0)for(const u of i)u.recordGauge((l=Ut==null?void 0:Ut.sessionSecureId)!=null?l:"",{name:tx,value:n.document_load/1e6});Object.entries(n).forEach(([u,a])=>{a!==void 0&&(e.setAttribute(`timings.${u}.ns`,a),e.setAttribute(`timings.${u}.readable`,Eg(a)))})};function ht(e,t,r){const n=r.find(l=>l.name===e),i=r.find(l=>l.name===t);if(!n||!i)return;const s=n.time[0]*1e9+n.time[1];return i.time[0]*1e9+i.time[1]-s}const bx=(e,t)=>{const r={domain_lookup:(t.domainLookupEnd-t.domainLookupStart)*1e6,connect:(t.connectEnd-t.connectStart)*1e6,request:(t.responseEnd-t.requestStart)*1e6,response:(t.responseEnd-t.responseStart)*1e6};Object.entries(r).forEach(([n,i])=>{e.setAttribute(`timings.${n}.ns`,i),e.setAttribute(`timings.${n}.readable`,Eg(i))})},Eg=e=>{if(e>=36e11){const o=e/36e11;return`${Number(o.toFixed(1))}h`}else if(e>=6e10){const o=e/6e10;return`${Number(o.toFixed(1))}m`}else if(e>=1e9){const o=e/1e9;return`${Number(o.toFixed(1))}s`}else if(e>=1e6){const o=e/1e6;return`${Number(o.toFixed(1))}ms`}else if(e>=1e3){const o=e/1e3;return`${Number(o.toFixed(1))}µs`}else return`${Number(e.toFixed(1))}ns`},Ig=e=>e===!0?[/localhost/,/^\//,zp(window.location.host)]:Array.isArray(e)?e.map(t=>typeof t=="string"?new RegExp(t):t):/^$/,Cg=e=>e.attributes[er]?e.attributes[er]:e.attributes[jr],vx=(e,t,r)=>{const n=window._highlightWebSocketRequestCallback;window._highlightWebSocketRequestCallback=e;const i=window._highlightWebSocketEventCallback;return window._highlightWebSocketEventCallback=s=>{const c=s,{message:o,size:l}=c,u=et(c,["message","size"]),h=r.some(f=>s.name.toLowerCase().includes(f))?u:s;t(h)},()=>{window._highlightWebSocketRequestCallback=n,window._highlightWebSocketEventCallback=i}},Sx=({xhrCallback:e,fetchCallback:t,webSocketRequestCallback:r,webSocketEventCallback:n,disableWebSocketRecording:i,bodyKeysToRedact:s,highlightEndpoints:o,tracingOrigins:l,urlBlocklist:u,bodyKeysToRecord:a})=>{const h=SI(e,o,l,u,s,a),c=EI(t,o,l,u,s,a),f=i?()=>{}:vx(r,n,u);return()=>{h(),c(),f()}};class Dt{constructor(t){L(this,"disableConsoleRecording");L(this,"reportConsoleErrors");L(this,"enablePromisePatch");L(this,"consoleMethodsToRecord");L(this,"listeners");L(this,"errors");L(this,"messages");L(this,"options");L(this,"hasNetworkRecording",!0);L(this,"disableNetworkRecording");L(this,"enableRecordingNetworkContents");L(this,"xhrNetworkContents");L(this,"fetchNetworkContents");L(this,"disableRecordingWebSocketContents");L(this,"webSocketNetworkContents");L(this,"webSocketEventContents");L(this,"tracingOrigins");L(this,"networkHeadersToRedact");L(this,"networkBodyKeysToRedact");L(this,"networkBodyKeysToRecord");L(this,"networkHeaderKeysToRecord");L(this,"lastNetworkRequestTimestamp");L(this,"urlBlocklist");L(this,"highlightEndpoints");L(this,"requestResponseSanitizer");var r,n;this.options=t,this.disableConsoleRecording=!!t.disableConsoleRecording,this.reportConsoleErrors=(r=t.reportConsoleErrors)!=null?r:!1,this.enablePromisePatch=(n=t.enablePromisePatch)!=null?n:!1,this.consoleMethodsToRecord=t.consoleMethodsToRecord||[...el],this.listeners=[],this.errors=[],this.messages=[],this.lastNetworkRequestTimestamp=0}isListening(){return this.listeners.length>0}startListening(){if(this.isListening())return;const t=this;this.disableConsoleRecording||this.listeners.push(mf(r=>{var n,i,s;if(this.reportConsoleErrors&&(r.type==="Error"||r.type==="error")&&r.value&&r.trace){const o=bt(r.value);if(al.includes(o)||ll.some(l=>o.includes(l)))return;t.errors.push({event:o,type:"console.error",url:window.location.href,source:(n=r.trace[0])!=null&&n.fileName?r.trace[0].fileName:"",lineNumber:(i=r.trace[0])!=null&&i.lineNumber?r.trace[0].lineNumber:0,columnNumber:(s=r.trace[0])!=null&&s.columnNumber?r.trace[0].columnNumber:0,stackTrace:r.trace,timestamp:new Date().toISOString(),id:_n()})}t.messages.push(r)},B(x({},pf),{level:this.consoleMethodsToRecord}))),this.listeners.push(yf(r=>{al.includes(r.event)||ll.some(n=>r.event.includes(n))||t.errors.push(r)},{enablePromisePatch:this.enablePromisePatch})),this.listeners.push(Nu),Dt.setupNetworkListener(this,this.options)}stopListening(){this.listeners.forEach(t=>t()),this.listeners=[]}static setupNetworkListener(t,r){var s,o,l,u,a,h,c,f,d,p,m,g;const n=(r==null?void 0:r.backendUrl)||void 0||"https://pub.highlight.io",i=r.otlpEndpoint||"https://otel.highlight.io";t.highlightEndpoints=[n,`${i}/v1/traces`,`${i}/v1/logs`,`${i}/v1/metrics`],t.xhrNetworkContents=[],t.fetchNetworkContents=[],t.webSocketNetworkContents=[],t.webSocketEventContents=[],t.networkHeadersToRedact=[],t.urlBlocklist=[],t.tracingOrigins=r.tracingOrigins||[],(r==null?void 0:r.disableNetworkRecording)!==void 0?(t.disableNetworkRecording=r==null?void 0:r.disableNetworkRecording,t.enableRecordingNetworkContents=!1,t.disableRecordingWebSocketContents=!0,t.networkHeadersToRedact=[],t.networkBodyKeysToRedact=[],t.urlBlocklist=[],t.networkBodyKeysToRecord=[]):typeof(r==null?void 0:r.networkRecording)=="boolean"?(t.disableNetworkRecording=!r.networkRecording,t.enableRecordingNetworkContents=!1,t.disableRecordingWebSocketContents=!0,t.networkHeadersToRedact=[],t.networkBodyKeysToRedact=[],t.urlBlocklist=[]):(((s=r.networkRecording)==null?void 0:s.enabled)!==void 0?t.disableNetworkRecording=!r.networkRecording.enabled:t.disableNetworkRecording=!1,t.enableRecordingNetworkContents=((o=r.networkRecording)==null?void 0:o.recordHeadersAndBody)||!1,t.disableRecordingWebSocketContents=((l=r.networkRecording)==null?void 0:l.disableWebSocketEventRecordings)||!1,t.networkHeadersToRedact=((a=(u=r.networkRecording)==null?void 0:u.networkHeadersToRedact)==null?void 0:a.map(v=>v.toLowerCase()))||[],t.networkBodyKeysToRedact=((c=(h=r.networkRecording)==null?void 0:h.networkBodyKeysToRedact)==null?void 0:c.map(v=>v.toLowerCase()))||[],t.urlBlocklist=((d=(f=r.networkRecording)==null?void 0:f.urlBlocklist)==null?void 0:d.map(v=>v.toLowerCase()))||[],t.urlBlocklist=[...t.urlBlocklist,...Fp],t.requestResponseSanitizer=(p=r.networkRecording)==null?void 0:p.requestResponseSanitizer,t.networkHeaderKeysToRecord=(m=r.networkRecording)==null?void 0:m.headerKeysToRecord,t.networkHeaderKeysToRecord&&(t.networkHeadersToRedact=[],t.networkHeaderKeysToRecord=t.networkHeaderKeysToRecord.map(v=>v.toLocaleLowerCase())),t.networkBodyKeysToRecord=(g=r.networkRecording)==null?void 0:g.bodyKeysToRecord,t.networkBodyKeysToRecord&&(t.networkBodyKeysToRedact=[],t.networkBodyKeysToRecord=t.networkBodyKeysToRecord.map(v=>v.toLocaleLowerCase()))),!t.disableNetworkRecording&&t.enableRecordingNetworkContents&&(t.hasNetworkRecording=!0,t.listeners.push(Sx({xhrCallback:v=>{t.xhrNetworkContents.push(v)},fetchCallback:v=>{t.fetchNetworkContents.push(v)},webSocketRequestCallback:v=>{t.webSocketNetworkContents&&t.webSocketNetworkContents.push(v)},webSocketEventCallback:v=>{t.webSocketEventContents.push(v)},disableWebSocketRecording:t.disableRecordingWebSocketContents,bodyKeysToRedact:t.networkBodyKeysToRedact,highlightEndpoints:t.highlightEndpoints,tracingOrigins:t.tracingOrigins,urlBlocklist:t.urlBlocklist,bodyKeysToRecord:t.networkBodyKeysToRecord})))}static getRecordedNetworkResources(t,r){var s,o;let n=[],i=[];if(!t.disableNetworkRecording){const l=((s=window==null?void 0:window.performance)==null?void 0:s.timeOrigin)||0;n=performance.getEntriesByType("resource");const u=(r-l)*2;if(n=n.filter(a=>a.responseEnd<t.lastNetworkRequestTimestamp?!1:Cs(a.name,t.highlightEndpoints)).map(a=>B(x({},a.toJSON()),{offsetStartTime:a.startTime-u,offsetResponseEnd:a.responseEnd-u,offsetFetchStart:a.fetchStart-u})),t.lastNetworkRequestTimestamp=((o=n.at(-1))==null?void 0:o.responseEnd)||t.lastNetworkRequestTimestamp,t.enableRecordingNetworkContents){const a={headersToRedact:t.networkHeadersToRedact,headersToRecord:t.networkHeaderKeysToRecord,requestResponseSanitizer:t.requestResponseSanitizer};n=Bp(n,t.xhrNetworkContents,"xmlhttprequest",a),n=Bp(n,t.fetchNetworkContents,"fetch",a)}}return t.disableRecordingWebSocketContents||(i=t.webSocketNetworkContents||[]),[...n,...i]}static getRecordedWebSocketEvents(t){let r=[];return!t.disableNetworkRecording&&!t.disableRecordingWebSocketContents&&(r=t.webSocketEventContents),r}static clearRecordedNetworkResources(t){t.disableNetworkRecording||(t.xhrNetworkContents=[],t.fetchNetworkContents=[],t.webSocketNetworkContents=[],t.webSocketEventContents=[],performance.clearResourceTimings())}}const Zg=(e,t,r)=>{switch(e){case"strict":return[!0,void 0];case"default":return[!0,void 0];case"none":return[!!t,B(x({},r),{password:!0})]}};let ft,Gu;function Lg(e,t){return e.nodeType,Node.ELEMENT_NODE,Pu(e);return wx(e,t)}function Vu(e){if(e.id.length)return`#${e.id}`;if(e.classList.length){let t=[];for(const r of e.classList)t.push(`.${r}`);return`${e.nodeName.toLowerCase()}${t.join(",")}`}return e.nodeName.toLowerCase()}function wx(e,t){if(e.tagName.toLowerCase()==="html")return"html";try{const r={root:document.body,idName:i=>!0,className:i=>!0,tagName:i=>!0,attr:(i,s)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:50,maxNumberOfTries:1e3,optimized:!0};ft=x(x({},r),t),Gu=Rx(ft.root,r);let n=ku(e,0,()=>ku(e,1,()=>ku(e,2)));if(n){if(ft.optimized){const i=Vg(kg(n,e));i.length>0&&(n=i[0])}return Js(n)}else return Pu(e)}catch(r){return Pu(e)}}function Rx(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function ku(e,t,r){let n=null,i=[],s=e,o=0;for(;s&&s!==ft.root.parentElement;){let l=Hs(_x(s))||Hs(...Tx(s))||Hs(...Ex(s))||Hs(Ix(s))||[Cx()];const u=Zx(s);if(t===0)u&&(l=l.concat(l.filter(Wu).map(a=>Xu(a,u))));else if(t===1)l=l.slice(0,1),u&&(l=l.concat(l.filter(Wu).map(a=>Xu(a,u))));else if(t===2){const[a]=l=l.slice(0,1);u&&Wu(a)&&(l=[Xu(a,u)])}for(let a of l)a.level=o;if(i.push(l),i.length>=ft.seedMinLength&&(n=xg(i,r),n))break;s=s.parentElement,o++}return n||(n=xg(i,r)),n}function xg(e,t){const r=Vg(Gg(e));if(r.length>ft.threshold)return t?t():null;for(let n of r)if(Og(n))return n;return null}function Js(e){let t=e[0],r=t.name;for(let n=1;n<e.length;n++){const i=e[n].level||0;t.level===i-1?r=`${e[n].name} > ${r}`:r=`${e[n].name} ${r}`,t=e[n]}return r}function Ng(e){return e.map(t=>t.penalty).reduce((t,r)=>t+r,0)}function Og(e){switch(Gu.querySelectorAll(Js(e)).length){case 0:return!0;case 1:return!0;default:return!1}}function _x(e){const t=e.getAttribute("id");return t&&ft.idName(t)?{name:"#"+Ys(t,{isIdentifier:!0}),penalty:0}:null}function Tx(e){return Array.from(e.attributes).filter(r=>ft.attr(r.name,r.value)).map(r=>({name:"["+Ys(r.name,{isIdentifier:!0})+'="'+Ys(r.value)+'"]',penalty:.5}))}function Ex(e){return Array.from(e.classList).filter(ft.className).map(r=>({name:"."+Ys(r,{isIdentifier:!0}),penalty:1}))}function Ix(e){const t=e.tagName.toLowerCase();return ft.tagName(t)?{name:t,penalty:2}:null}function Cx(){return{name:"*",penalty:3}}function Zx(e){const t=e.parentNode;if(!t)return null;let r=t.firstChild;if(!r)return null;let n=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&n++,r!==e);)r=r.nextSibling;return n}function Xu(e,t){return{name:e.name+`:nth-child(${t})`,penalty:e.penalty+1}}function Wu(e){return e.name!=="html"&&!e.name.startsWith("#")}function Hs(...e){const t=e.filter(Lx);return t.length>0?t:null}function Lx(e){return e!=null}function*Gg(e,t=[]){if(e.length>0)for(let r of e[0])yield*fc(Gg(e.slice(1,e.length),t.concat(r)));else yield t}function Vg(e){return Array.from(e).sort((t,r)=>Ng(t)-Ng(r))}function*kg(e,t,r={counter:0,visited:new Map}){if(e.length>2&&e.length>ft.optimizedMinLength)for(let n=1;n<e.length-1;n++){if(r.counter>ft.maxNumberOfTries)return;r.counter+=1;const i=[...e];i.splice(n,1);const s=Js(i);if(r.visited.has(s))return;Og(i)&&xx(i,t)&&(yield i,r.visited.set(s,!0),yield*fc(kg(i,t,r)))}}function xx(e,t){return Gu.querySelector(Js(e))===t}const Nx=/[ -,\.\/:-@\[-\^`\{-~]/,Ox=/[ -,\.\/:-@\[\]\^`\{-~]/,Gx=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,Vx={escapeEverything:!1,isIdentifier:!1,quotes:"single",wrap:!1};function Ys(e,t={}){const r=x(x({},Vx),t);r.quotes!="single"&&r.quotes!="double"&&(r.quotes="single");const n=r.quotes=="double"?'"':"'",i=r.isIdentifier,s=e.charAt(0);let o="",l=0;const u=e.length;for(;l<u;){const a=e.charAt(l++);let h=a.charCodeAt(0),c;if(h<32||h>126){if(h>=55296&&h<=56319&&l<u){const f=e.charCodeAt(l++);(f&64512)==56320?h=((h&1023)<<10)+(f&1023)+65536:l--}c="\\"+h.toString(16).toUpperCase()+" "}else r.escapeEverything?Nx.test(a)?c="\\"+a:c="\\"+h.toString(16).toUpperCase()+" ":/[\t\n\f\r\x0B]/.test(a)?c="\\"+h.toString(16).toUpperCase()+" ":a=="\\"||!i&&(a=='"'&&n==a||a=="'"&&n==a)||i&&Ox.test(a)?c="\\"+a:c=a;o+=c}return i&&(/^-[-\d]/.test(o)?o="\\-"+o.slice(1):/\d/.test(s)&&(o="\\3"+s+" "+o.slice(1))),o=o.replace(Gx,function(a,h,c){return h&&h.length%2?a:(h||"")+c}),!i&&r.wrap?n+o+n:o}const Pu=e=>{let t="";const r=e.getAttribute("class"),n=e.getAttribute("id");return n&&(t=t.concat(Xg(n,"#"))),r&&(t=t.concat(Xg(r,"."))),t===""&&(t=t.concat(e.tagName.toLowerCase())),t},Xg=(e,t)=>`${t}${e.trim().split(" ").join(t)}`,Wg=e=>{const t=n=>{if(n.target){const i=n.target,s=Lg(i);e(s,n)}},r={capture:!0};return window.addEventListener("click",t,r),()=>window.removeEventListener("click",t,r)},Pg=e=>{const t=r=>{if(r.target){const n=Lg(r.target);e(n)}};return window.addEventListener("focusin",t),()=>window.removeEventListener("focusin",t)},kx=30,Xx=()=>new Promise(e=>requestAnimationFrame(t=>requestAnimationFrame(r=>e(r-t)))),Wx=()=>$(this,null,function*(){const e=[];for(let t=0;t<kx;t++)e.push(yield Xx());return e.reduce((t,r)=>t+r,0)/e.length}),Mg=(e,t)=>{let r={},n=16.666666666666668;Wx().then(u=>n=u);const i=u=>{var a;r!=null&&r.event||(r={event:u,location:window.location.href,timerStart:(a=window.performance)==null?void 0:a.now()},window.requestAnimationFrame(s))},s=()=>{if(!(r!=null&&r.timerStart))return;const u=window.performance.now()-r.timerStart-n;o(u),r={}},o=u=>{const a=(new Date().getTime()-t)/1e3;e({relativeTimestamp:a,jankAmount:u,querySelector:l(),newLocation:window.location.href!=r.location?window.location.href:void 0})},l=()=>{var u;return(u=r==null?void 0:r.event)!=null&&u.target?Vu(r.event.target):""};return window.addEventListener("click",i,!0),window.addEventListener("keydown",i,!0),()=>{window.removeEventListener("keydown",i,!0),window.removeEventListener("click",i,!0)}},Ag=e=>{let t,r;if(typeof document.hidden!="undefined"?(t="hidden",r="visibilitychange"):typeof document.msHidden!="undefined"?(t="msHidden",r="msvisibilitychange"):typeof document.webkitHidden!="undefined"&&(t="webkitHidden",r="webkitvisibilitychange"),r===void 0)return()=>{};if(t===void 0)return()=>{};const n=t,i=()=>{const o=document[n];e(!!o)};document.addEventListener(r,i);const s=r;return()=>document.removeEventListener(s,i)},Ug=typeof window!="undefined"&&"performance"in window&&"memory"in performance?performance:{memory:{}},Dg=(e,t)=>{let r=0,n=0;const i=()=>{const h=(new Date().getTime()-t)/1e3,c=Ug.memory.jsHeapSizeLimit||0,f=Ug.memory.usedJSHeapSize||0;e({jsHeapSizeLimit:c,usedJSHeapSize:f,relativeTimestamp:h,fps:r})};i();let s;s=setInterval(()=>{i()},1e3);let o=0,l=Date.now();const u=function(){var a=Date.now();o++,a>1e3+l&&(r=Math.round(o*1e3/(a-l)),o=0,l=a),n=requestAnimationFrame(u)};return u(),()=>{clearInterval(s),cancelAnimationFrame(n)}},Fg=e=>{e(window.location.href);var t=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(s){setTimeout(()=>{var l;var o;try{o=JSON.parse((l=s==null?void 0:s.toString())!=null?l:"")}catch(u){return}(o.type==="track"||o.type==="identify")&&Mu(o)&&e(o)},100),t.call(this,s)};const r=s=>{if(s.key==="ajs_user_id"||s.key==="ajs_anonymous_id"||s.key==="ajs_user_traits"){const{userId:o,userTraits:l}=Jg();if(o){let u={};l&&(u=JSON.parse(l));const a={type:"identify",userId:o.toString(),traits:u};Mu(a)&&e(a)}}},{userId:n,userTraits:i}=Jg();if(n){let s={};i&&(s=JSON.parse(i));const o={type:"identify",userId:n.toString(),traits:s};Mu(o)&&e(o)}return window.addEventListener("storage",r),rI(({keyName:s})=>{r({key:s})}),()=>{window.removeEventListener("storage",r),XMLHttpRequest.prototype.send=t}},Jg=()=>{const e=Fe("ajs_user_id"),t=Fe("ajs_user_traits"),r=Fe("ajs_anonymous_id");return{userId:e,userTraits:t,anonymousId:r}},Mu=e=>{if(!e)return!1;let t="";try{t=JSON.stringify(e)}catch(i){return!1}const r=Px(t),n=Fe(Ne.SEGMENT_LAST_SENT_HASH_KEY);return n===void 0||r!==n?(ct(Ne.SEGMENT_LAST_SENT_HASH_KEY,r),!0):!1},Px=e=>{var t=0,r=e.length,n=0;if(r>0)for(;n<r;)t=(t<<5)-t+e.charCodeAt(n++)|0;return t.toString()},Hg=(e,t)=>{const r=Mx(e);let n=[];const i=!1,s=!0,o=[];for(let u=0;u<r.length;u++){let a=r[u].split("+");n=[],a.length>1&&(n=Dx(Bg,a)),a=a[a.length-1],a=a==="*"?"*":Ux(a),a in _t||(_t[a]=[]);const h={mods:n,shortcut:r[u],key:r[u],method:t,keyup:i,keydown:s,scope:"all",splitKey:"+"};_t[a].push(h),o.push({key:a,handler:h})}const l=u=>Hx(u);return Fx(document,"keydown",l),()=>{document.removeEventListener("keydown",l);for(const{key:u,handler:a}of o){const h=_t[u],c=h?h.indexOf(a):-1;c>-1&&h.splice(c,1)}}};let ze=[];function Mx(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");const t=e.split(",");let r=t.lastIndexOf("");for(;r>=0;)t[r-1]+=",",t.splice(r,1),r=t.lastIndexOf("");return t}const _t={},Au=typeof navigator!="undefined"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1,Ax={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Au?173:189,"=":Au?61:187,";":Au?59:186,"'":222,"[":219,"]":221,"\\":220},Yg={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Ke={16:!1,18:!1,17:!1,91:!1},Bg={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Ux=e=>Ax[e.toLowerCase()]||Bg[e.toLowerCase()]||e.toUpperCase().charCodeAt(0);function Dx(e,t){const r=t.slice(0,t.length-1);for(let n=0;n<r.length;n++)r[n]=e[r[n].toLowerCase()];return r}function Fx(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent&&e.attachEvent(`on${t}`,()=>{r(window.event)})}function Jx(e,t,r){let n;if(t.scope===r||t.scope==="all"){n=t.mods.length>0;for(const i in Ke)Object.prototype.hasOwnProperty.call(Ke,i)&&(!Ke[i]&&t.mods.indexOf(+i)>-1||Ke[i]&&t.mods.indexOf(+i)===-1)&&(n=!1);(t.mods.length===0&&!Ke[16]&&!Ke[18]&&!Ke[17]&&!Ke[91]||n||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function Hx(e){const t=_t["*"];let r=e.keyCode||e.which||e.charCode;if((r===93||r===224)&&(r=91),ze.indexOf(r)===-1&&r!==229&&ze.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(n=>{const i=Yg[n];e[n]&&ze.indexOf(i)===-1?ze.push(i):!e[n]&&ze.indexOf(i)>-1?ze.splice(ze.indexOf(i),1):n==="metaKey"&&e[n]&&ze.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(ze=ze.slice(ze.indexOf(i))))}),!(r in Ke&&(Ke[r]=!0,!t))){for(const n in Ke)Object.prototype.hasOwnProperty.call(Ke,n)&&(Ke[n]=e[Yg[n]]);if(e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(ze.indexOf(17)===-1&&ze.push(17),ze.indexOf(18)===-1&&ze.push(18),Ke[17]=!0,Ke[18]=!0),r in _t){for(let n=0;n<_t[r].length;n++)if((e.type==="keydown"&&_t[r][n].keydown||e.type==="keyup"&&_t[r][n].keyup)&&_t[r][n].key){const i=_t[r][n];Jx(e,i,"all")}}}}const Uu=e=>{let t;const n=()=>{clearTimeout(t),t=setTimeout(()=>{var i,s;e({height:window.innerHeight,width:window.innerWidth,availHeight:window.screen.availHeight,availWidth:window.screen.availWidth,colorDepth:window.screen.colorDepth,pixelDepth:window.screen.pixelDepth,orientation:(s=(i=window.screen.orientation)==null?void 0:i.angle)!=null?s:0})},500)};return window.addEventListener("resize",n),n(),()=>window.removeEventListener("resize",n)};var ir,Yn,zg,Bs,Du,en=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},Bn=function(e){if(document.readyState==="loading")return"loading";var t=en();if(t){if(e<t.domInteractive)return"loading";if(t.domContentLoadedEventStart===0||e<t.domContentLoadedEventStart)return"dom-interactive";if(t.domComplete===0||e<t.domComplete)return"dom-content-loaded"}return"complete"},Yx=function(e){var t=e.nodeName;return e.nodeType===1?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},zs=function(e,t){var r="";try{for(;e&&e.nodeType!==9;){var n=e,i=n.id?"#"+n.id:Yx(n)+(n.classList&&n.classList.value&&n.classList.value.trim()&&n.classList.value.trim().length?"."+n.classList.value.trim().replace(/\s+/g,"."):"");if(r.length+i.length>99)return r||i;if(r=r?i+">"+r:i,n.id)break;e=n.parentNode}}catch(s){}return r},Kg=-1,jg=function(){return Kg},xr=function(e){addEventListener("pageshow",function(t){t.persisted&&(Kg=t.timeStamp,e(t))},!0)},Ks=function(){var e=en();return e&&e.activationStart||0},pt=function(e,t){var r=en(),n="navigate";return jg()>=0?n="back-forward-cache":r&&(document.prerendering||Ks()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},tn=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(i){Promise.resolve().then(function(){t(i.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(i){}},mt=function(e,t,r,n){var i,s;return function(o){t.value>=0&&(o||n)&&((s=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=s,t.rating=function(l,u){return l>u[1]?"poor":l>u[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Fu=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},js=function(e){var t=function(r){r.type!=="pagehide"&&document.visibilityState!=="hidden"||e(r)};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},Ju=function(e){var t=!1;return function(r){t||(e(r),t=!0)}},rn=-1,Qg=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Qs=function(e){document.visibilityState==="hidden"&&rn>-1&&(rn=e.type==="visibilitychange"?e.timeStamp:0,Bx())},$g=function(){addEventListener("visibilitychange",Qs,!0),addEventListener("prerenderingchange",Qs,!0)},Bx=function(){removeEventListener("visibilitychange",Qs,!0),removeEventListener("prerenderingchange",Qs,!0)},Hu=function(){return rn<0&&(rn=Qg(),$g(),xr(function(){setTimeout(function(){rn=Qg(),$g()},0)})),{get firstHiddenTime(){return rn}}},zn=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},qg=[1800,3e3],ey=function(e,t){t=t||{},zn(function(){var r,n=Hu(),i=pt("FCP"),s=tn("paint",function(o){o.forEach(function(l){l.name==="first-contentful-paint"&&(s.disconnect(),l.startTime<n.firstHiddenTime&&(i.value=Math.max(l.startTime-Ks(),0),i.entries.push(l),r(!0)))})});s&&(r=mt(e,i,qg,t.reportAllChanges),xr(function(o){i=pt("FCP"),r=mt(e,i,qg,t.reportAllChanges),Fu(function(){i.value=performance.now()-o.timeStamp,r(!0)})}))})},ty=[.1,.25],zx=function(e,t){(function(r,n){n=n||{},ey(Ju(function(){var i,s=pt("CLS",0),o=0,l=[],u=function(h){h.forEach(function(c){if(!c.hadRecentInput){var f=l[0],d=l[l.length-1];o&&c.startTime-d.startTime<1e3&&c.startTime-f.startTime<5e3?(o+=c.value,l.push(c)):(o=c.value,l=[c])}}),o>s.value&&(s.value=o,s.entries=l,i())},a=tn("layout-shift",u);a&&(i=mt(r,s,ty,n.reportAllChanges),js(function(){u(a.takeRecords()),i(!0)}),xr(function(){o=0,s=pt("CLS",0),i=mt(r,s,ty,n.reportAllChanges),Fu(function(){return i()})}),setTimeout(i,0))}))})(function(r){(function(n){if(n.entries.length){var i=n.entries.reduce(function(l,u){return l&&l.value>u.value?l:u});if(i&&i.sources&&i.sources.length){var s=(o=i.sources).find(function(l){return l.node&&l.node.nodeType===1})||o[0];if(s)return void(n.attribution={largestShiftTarget:zs(s.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:s,largestShiftEntry:i,loadState:Bn(i.startTime)})}}var o;n.attribution={}})(r),e(r)},t)},Kx=function(e,t){ey(function(r){(function(n){if(n.entries.length){var i=en(),s=n.entries[n.entries.length-1];if(i){var o=i.activationStart||0,l=Math.max(0,i.responseStart-o);return void(n.attribution={timeToFirstByte:l,firstByteToFCP:n.value-l,loadState:Bn(n.entries[0].startTime),navigationEntry:i,fcpEntry:s})}}n.attribution={timeToFirstByte:0,firstByteToFCP:n.value,loadState:Bn(jg())}})(r),e(r)},t)},Kn={passive:!0,capture:!0},jx=new Date,ry=function(e,t){ir||(ir=t,Yn=e,zg=new Date,iy(removeEventListener),ny())},ny=function(){if(Yn>=0&&Yn<zg-jx){var e={entryType:"first-input",name:ir.type,target:ir.target,cancelable:ir.cancelable,startTime:ir.timeStamp,processingStart:ir.timeStamp+Yn};Bs.forEach(function(t){t(e)}),Bs=[]}},Qx=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;e.type=="pointerdown"?function(r,n){var i=function(){ry(r,n),o()},s=function(){o()},o=function(){removeEventListener("pointerup",i,Kn),removeEventListener("pointercancel",s,Kn)};addEventListener("pointerup",i,Kn),addEventListener("pointercancel",s,Kn)}(t,e):ry(t,e)}},iy=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,Qx,Kn)})},sy=[100,300],$x=function(e,t){t=t||{},zn(function(){var r,n=Hu(),i=pt("FID"),s=function(u){u.startTime<n.firstHiddenTime&&(i.value=u.processingStart-u.startTime,i.entries.push(u),r(!0))},o=function(u){u.forEach(s)},l=tn("first-input",o);r=mt(e,i,sy,t.reportAllChanges),l&&js(Ju(function(){o(l.takeRecords()),l.disconnect()})),l&&xr(function(){var u;i=pt("FID"),r=mt(e,i,sy,t.reportAllChanges),Bs=[],Yn=-1,ir=null,iy(addEventListener),u=s,Bs.push(u),ny()})})},qx=function(e,t){$x(function(r){(function(n){var i=n.entries[0];n.attribution={eventTarget:zs(i.target),eventType:i.name,eventTime:i.startTime,eventEntry:i,loadState:Bn(i.startTime)}})(r),e(r)},t)},oy=0,Yu=1/0,$s=0,eN=function(e){e.forEach(function(t){t.interactionId&&(Yu=Math.min(Yu,t.interactionId),$s=Math.max($s,t.interactionId),oy=$s?($s-Yu)/7+1:0)})},ay=function(){return Du?oy:performance.interactionCount||0},tN=function(){"interactionCount"in performance||Du||(Du=tn("event",eN,{type:"event",buffered:!0,durationThreshold:0}))},ly=[200,500],uy=0,cy=function(){return ay()-uy},Lt=[],Bu={},dy=function(e){var t=Lt[Lt.length-1],r=Bu[e.interactionId];if(r||Lt.length<10||e.duration>t.latency){if(r)r.entries.push(e),r.latency=Math.max(r.latency,e.duration);else{var n={id:e.interactionId,latency:e.duration,entries:[e]};Bu[n.id]=n,Lt.push(n)}Lt.sort(function(i,s){return s.latency-i.latency}),Lt.splice(10).forEach(function(i){delete Bu[i.id]})}},rN=function(e,t){t=t||{},zn(function(){var r;tN();var n,i=pt("INP"),s=function(l){l.forEach(function(h){h.interactionId&&dy(h),h.entryType==="first-input"&&!Lt.some(function(c){return c.entries.some(function(f){return h.duration===f.duration&&h.startTime===f.startTime})})&&dy(h)});var u,a=(u=Math.min(Lt.length-1,Math.floor(cy()/50)),Lt[u]);a&&a.latency!==i.value&&(i.value=a.latency,i.entries=a.entries,n())},o=tn("event",s,{durationThreshold:(r=t.durationThreshold)!==null&&r!==void 0?r:40});n=mt(e,i,ly,t.reportAllChanges),o&&("interactionId"in PerformanceEventTiming.prototype&&o.observe({type:"first-input",buffered:!0}),js(function(){s(o.takeRecords()),i.value<0&&cy()>0&&(i.value=0,i.entries=[]),n(!0)}),xr(function(){Lt=[],uy=ay(),i=pt("INP"),n=mt(e,i,ly,t.reportAllChanges)}))})},nN=function(e,t){rN(function(r){(function(n){if(n.entries.length){var i=n.entries.sort(function(s,o){return o.duration-s.duration||o.processingEnd-o.processingStart-(s.processingEnd-s.processingStart)})[0];n.attribution={eventTarget:zs(i.target),eventType:i.name,eventTime:i.startTime,eventEntry:i,loadState:Bn(i.startTime)}}else n.attribution={}})(r),e(r)},t)},hy=[2500,4e3],zu={},iN=function(e,t){(function(r,n){n=n||{},zn(function(){var i,s=Hu(),o=pt("LCP"),l=function(h){var c=h[h.length-1];c&&c.startTime<s.firstHiddenTime&&(o.value=Math.max(c.startTime-Ks(),0),o.entries=[c],i())},u=tn("largest-contentful-paint",l);if(u){i=mt(r,o,hy,n.reportAllChanges);var a=Ju(function(){zu[o.id]||(l(u.takeRecords()),u.disconnect(),zu[o.id]=!0,i(!0))});["keydown","click"].forEach(function(h){addEventListener(h,function(){return setTimeout(a,0)},!0)}),js(a),xr(function(h){o=pt("LCP"),i=mt(r,o,hy,n.reportAllChanges),Fu(function(){o.value=performance.now()-h.timeStamp,zu[o.id]=!0,i(!0)})})}})})(function(r){(function(n){if(n.entries.length){var i=en();if(i){var s=i.activationStart||0,o=n.entries[n.entries.length-1],l=o.url&&performance.getEntriesByType("resource").filter(function(d){return d.name===o.url})[0],u=Math.max(0,i.responseStart-s),a=Math.max(u,l?(l.requestStart||l.startTime)-s:0),h=Math.max(a,l?l.responseEnd-s:0),c=Math.max(h,o?o.startTime-s:0),f={element:zs(o.element),timeToFirstByte:u,resourceLoadDelay:a-u,resourceLoadTime:h-a,elementRenderDelay:c-h,navigationEntry:i,lcpEntry:o};return o.url&&(f.url=o.url),l&&(f.lcpResourceEntry=l),void(n.attribution=f)}}n.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadTime:0,elementRenderDelay:n.value}})(r),e(r)},t)},fy=[800,1800],sN=function e(t){document.prerendering?zn(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},oN=function(e,t){t=t||{};var r=pt("TTFB"),n=mt(e,r,fy,t.reportAllChanges);sN(function(){var i=en();if(i){var s=i.responseStart;if(s<=0||s>performance.now())return;r.value=Math.max(s-Ks(),0),r.entries=[i],n(!0),xr(function(){r=pt("TTFB",0),(n=mt(e,r,fy,t.reportAllChanges))(!0)})}})},aN=function(e,t){oN(function(r){(function(n){if(n.entries.length){var i=n.entries[0],s=i.activationStart||0,o=Math.max(i.domainLookupStart-s,0),l=Math.max(i.connectStart-s,0),u=Math.max(i.requestStart-s,0);n.attribution={waitingTime:o,dnsTime:l-o,connectionTime:u-l,requestTime:n.value-u,navigationEntry:i}}else n.attribution={waitingTime:0,dnsTime:0,connectionTime:0,requestTime:0}})(r),e(r)},t)};const py=e=>(zx(e),Kx(e),qx(e),iN(e),aN(e),nN(e),()=>{}),nn=typeof navigator!="undefined"&&"connection"in navigator?navigator.connection:{},my=(e,t)=>{const r=()=>{const s=(new Date().getTime()-t)/1e3;e({relativeTimestamp:s,downlink:nn.downlink,downlinkMax:nn.downlinkMax,effectiveType:nn.effectiveType,rtt:nn.rtt,saveData:nn.saveData,type:nn.type})};r();let n;return n=setInterval(()=>{r()},1e3),()=>{clearInterval(n)}},qs="iframe parent ready",eo="iframe ok",jn="highlightLogs",lN=e=>{let t=Fe(jn)||"";t=t+"["+new Date().getTime()+"] "+e+`
|
|
467
|
+
`,ct(jn,t)},gy=()=>Fe(jn)||"",yy=e=>{if(!e)return;let t=Fe(jn)||"";t&&(t.startsWith(e)?(t=t.slice(e.length),ct(jn,t)):lN("Unable to clear logs "+e.replace(`
|
|
468
|
+
`," ")+" from "+t.replace(`
|
|
469
|
+
`," ")))},by=()=>{if(!("performance"in window&&"memory"in performance))return{getDeviceDetails:void 0,getCurrentDeviceDetails:void 0};const e=window.performance;return{getDeviceDetails:()=>({deviceMemory:uN(navigator.deviceMemory||0)}),getCurrentDeviceDetails:()=>{const n=Ku(e.memory.jsHeapSizeLimit),i=Ku(e.memory.totalJSHeapSize),s=Ku(e.memory.usedJSHeapSize);return{jsHeapSizeLimit:n,totalJSHeapSize:i,usedJSHeapSize:s}}}},Ku=e=>e/Math.pow(1e3,2),uN=e=>1024*e;var vy={exports:{}};/**
|
|
470
|
+
* @preserve
|
|
471
|
+
* JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
|
|
472
|
+
*
|
|
473
|
+
* @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
|
|
474
|
+
* @see http://github.com/homebrewing/brauhaus-diff
|
|
475
|
+
* @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
|
|
476
|
+
* @see http://github.com/garycourt/murmurhash-js
|
|
477
|
+
* @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
|
|
478
|
+
* @see http://sites.google.com/site/murmurhash/
|
|
479
|
+
*/(function(e){(function(){var t;function r(n,i){var s=this instanceof r?this:t;if(s.reset(i),typeof n=="string"&&n.length>0&&s.hash(n),s!==this)return s}r.prototype.hash=function(n){var i,s,o,l,u;switch(u=n.length,this.len+=u,s=this.k1,o=0,this.rem){case 0:s^=u>o?n.charCodeAt(o++)&65535:0;case 1:s^=u>o?(n.charCodeAt(o++)&65535)<<8:0;case 2:s^=u>o?(n.charCodeAt(o++)&65535)<<16:0;case 3:s^=u>o?(n.charCodeAt(o)&255)<<24:0,s^=u>o?(n.charCodeAt(o++)&65280)>>8:0}if(this.rem=u+this.rem&3,u-=this.rem,u>0){for(i=this.h1;s=s*11601+(s&65535)*3432906752&4294967295,s=s<<15|s>>>17,s=s*13715+(s&65535)*461832192&4294967295,i^=s,i=i<<13|i>>>19,i=i*5+3864292196&4294967295,!(o>=u);)s=n.charCodeAt(o++)&65535^(n.charCodeAt(o++)&65535)<<8^(n.charCodeAt(o++)&65535)<<16,l=n.charCodeAt(o++),s^=(l&255)<<24^(l&65280)>>8;switch(s=0,this.rem){case 3:s^=(n.charCodeAt(o+2)&65535)<<16;case 2:s^=(n.charCodeAt(o+1)&65535)<<8;case 1:s^=n.charCodeAt(o)&65535}this.h1=i}return this.k1=s,this},r.prototype.result=function(){var n,i;return n=this.k1,i=this.h1,n>0&&(n=n*11601+(n&65535)*3432906752&4294967295,n=n<<15|n>>>17,n=n*13715+(n&65535)*461832192&4294967295,i^=n),i^=this.len,i^=i>>>16,i=i*51819+(i&65535)*2246770688&4294967295,i^=i>>>13,i=i*44597+(i&65535)*3266445312&4294967295,i^=i>>>16,i>>>0},r.prototype.reset=function(n){return this.h1=typeof n=="number"?n:0,this.rem=this.k1=this.len=0,this},t=new r,e.exports=r})()})(vy);var cN=vy.exports;const dN=ci(cN),ju=28,sn="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",hN=2246822507,gt=e=>{var r;var t="";if(e){const n=dN(e).result();for(let i=0;i<ju;i++){const o=((n^i*hN)>>>0)%sn.length;t+=sn.charAt(o)}}else{const n=typeof window!="undefined"&&((r=window.crypto)==null?void 0:r.getRandomValues),i=new Uint32Array(ju);n&&window.crypto.getRandomValues(i);for(let s=0;s<ju;s++)n?t+=sn.charAt(i[s]%sn.length):t+=sn.charAt(Math.floor(Math.random()*sn.length))}return t},fN={TTFB:"ms",FCP:"ms",LCP:"ms",INP:"ms",FID:"ms",Jank:"ms",CLS:"1",usedJSHeapSize:"By",jsHeapSizeLimit:"By",totalJSHeapSize:"By",fps:"{frames}/s",[Ve.ViewportHeight]:"{px}",[Ve.ViewportWidth]:"{px}",[Ve.ScreenHeight]:"{px}",[Ve.ScreenWidth]:"{px}",[Ve.ViewportArea]:"{px2}",[Ve.DeviceMemory]:"MiBy",downlink:"Mbit/s",downlinkMax:"Mbit/s",rtt:"ms","long_task.duration":"ms"};function sr(e,t){const r=t!=null?t:fN[e];return r?{unit:r}:void 0}var tt=Uint8Array,rt=Uint16Array,Qu=Int32Array,$u=new tt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),qu=new tt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Sy=new tt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),wy=function(e,t){for(var r=new rt(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var i=new Qu(r[30]),n=1;n<30;++n)for(var s=r[n];s<r[n+1];++s)i[s]=s-r[n]<<5|n;return{b:r,r:i}},Ry=wy($u,2),pN=Ry.b,ec=Ry.r;pN[28]=258,ec[258]=28;for(var mN=wy(qu,0),_y=mN.r,tc=new rt(32768),Re=0;Re<32768;++Re){var or=(Re&43690)>>1|(Re&21845)<<1;or=(or&52428)>>2|(or&13107)<<2,or=(or&61680)>>4|(or&3855)<<4,tc[Re]=((or&65280)>>8|(or&255)<<8)>>1}for(var Qn=function(e,t,r){for(var n=e.length,i=0,s=new rt(t);i<n;++i)e[i]&&++s[e[i]-1];var o=new rt(t);for(i=1;i<t;++i)o[i]=o[i-1]+s[i-1]<<1;var l;if(r){l=new rt(1<<t);var u=15-t;for(i=0;i<n;++i)if(e[i])for(var a=i<<4|e[i],h=t-e[i],c=o[e[i]-1]++<<h,f=c|(1<<h)-1;c<=f;++c)l[tc[c]>>u]=a}else for(l=new rt(n),i=0;i<n;++i)e[i]&&(l[i]=tc[o[e[i]-1]++]>>15-e[i]);return l},Nr=new tt(288),Re=0;Re<144;++Re)Nr[Re]=8;for(var Re=144;Re<256;++Re)Nr[Re]=9;for(var Re=256;Re<280;++Re)Nr[Re]=7;for(var Re=280;Re<288;++Re)Nr[Re]=8;for(var to=new tt(32),Re=0;Re<32;++Re)to[Re]=5;var gN=Qn(Nr,9,0),yN=Qn(to,5,0),Ty=function(e){return(e+7)/8|0},Ey=function(e,t,r){return(r==null||r>e.length)&&(r=e.length),new tt(e.subarray(t,r))},Ft=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},$n=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},rc=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,s=r.slice();if(!i)return{t:Ly,l:0};if(i==1){var o=new tt(r[0].s+1);return o[r[0].s]=1,{t:o,l:1}}r.sort(function(w,b){return w.f-b.f}),r.push({s:-1,f:25001});var l=r[0],u=r[1],a=0,h=1,c=2;for(r[0]={s:-1,f:l.f+u.f,l,r:u};h!=i-1;)l=r[r[a].f<r[c].f?a++:c++],u=r[a!=h&&r[a].f<r[c].f?a++:c++],r[h++]={s:-1,f:l.f+u.f,l,r:u};for(var f=s[0].s,n=1;n<i;++n)s[n].s>f&&(f=s[n].s);var d=new rt(f+1),p=nc(r[h-1],d,0);if(p>t){var n=0,m=0,g=p-t,v=1<<g;for(s.sort(function(b,R){return d[R.s]-d[b.s]||b.f-R.f});n<i;++n){var y=s[n].s;if(d[y]>t)m+=v-(1<<p-d[y]),d[y]=t;else break}for(m>>=g;m>0;){var S=s[n].s;d[S]<t?m-=1<<t-d[S]++-1:++n}for(;n>=0&&m;--n){var _=s[n].s;d[_]==t&&(--d[_],++m)}p=t}return{t:new tt(d),l:p}},nc=function(e,t,r){return e.s==-1?Math.max(nc(e.l,t,r+1),nc(e.r,t,r+1)):t[e.s]=r},Iy=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new rt(++t),n=0,i=e[0],s=1,o=function(u){r[n++]=u},l=1;l<=t;++l)if(e[l]==i&&l!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[l]}return{c:r.subarray(0,n),n:t}},qn=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},Cy=function(e,t,r){var n=r.length,i=Ty(t+2);e[i]=n&255,e[i+1]=n>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s<n;++s)e[i+s+4]=r[s];return(i+4+n)*8},Zy=function(e,t,r,n,i,s,o,l,u,a,h){Ft(t,h++,r),++i[256];for(var c=rc(i,15),f=c.t,d=c.l,p=rc(s,15),m=p.t,g=p.l,v=Iy(f),y=v.c,S=v.n,_=Iy(m),w=_.c,b=_.n,R=new rt(19),E=0;E<y.length;++E)++R[y[E]&31];for(var E=0;E<w.length;++E)++R[w[E]&31];for(var I=rc(R,7),C=I.t,N=I.l,G=19;G>4&&!C[Sy[G-1]];--G);var Q=a+5<<3,Z=qn(i,Nr)+qn(s,to)+o,T=qn(i,f)+qn(s,m)+o+14+3*G+qn(R,C)+2*R[16]+3*R[17]+7*R[18];if(u>=0&&Q<=Z&&Q<=T)return Cy(t,h,e.subarray(u,u+a));var W,k,M,D;if(Ft(t,h,1+(T<Z)),h+=2,T<Z){W=Qn(f,d,0),k=f,M=Qn(m,g,0),D=m;var U=Qn(C,N,0);Ft(t,h,S-257),Ft(t,h+5,b-1),Ft(t,h+10,G-4),h+=14;for(var E=0;E<G;++E)Ft(t,h+3*E,C[Sy[E]]);h+=3*G;for(var q=[y,w],fe=0;fe<2;++fe)for(var O=q[fe],E=0;E<O.length;++E){var pe=O[E]&31;Ft(t,h,U[pe]),h+=C[pe],pe>15&&(Ft(t,h,O[E]>>5&127),h+=O[E]>>12)}}else W=gN,k=Nr,M=yN,D=to;for(var E=0;E<l;++E){var P=n[E];if(P>255){var pe=P>>18&31;$n(t,h,W[pe+257]),h+=k[pe+257],pe>7&&(Ft(t,h,P>>23&31),h+=$u[pe]);var F=P&31;$n(t,h,M[F]),h+=D[F],F>3&&($n(t,h,P>>5&8191),h+=qu[F])}else $n(t,h,W[P]),h+=k[P]}return $n(t,h,W[256]),h+k[256]},bN=new Qu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ly=new tt(0),vN=function(e,t,r,n,i,s){var o=s.z||e.length,l=new tt(n+o+5*(1+Math.ceil(o/7e3))+i),u=l.subarray(n,l.length-i),a=s.l,h=(s.r||0)&7;if(t){h&&(u[0]=s.r>>3);for(var c=bN[t-1],f=c>>13,d=c&8191,p=(1<<r)-1,m=s.p||new rt(32768),g=s.h||new rt(p+1),v=Math.ceil(r/3),y=2*v,S=function(Te){return(e[Te]^e[Te+1]<<v^e[Te+2]<<y)&p},_=new Qu(25e3),w=new rt(288),b=new rt(32),R=0,E=0,I=s.i||0,C=0,N=s.w||0,G=0;I+2<o;++I){var Q=S(I),Z=I&32767,T=g[Q];if(m[Z]=T,g[Q]=Z,N<=I){var W=o-I;if((R>7e3||C>24576)&&(W>423||!a)){h=Zy(e,u,0,_,w,b,E,C,G,I-G,h),C=R=E=0,G=I;for(var k=0;k<286;++k)w[k]=0;for(var k=0;k<30;++k)b[k]=0}var M=2,D=0,U=d,q=Z-T&32767;if(W>2&&Q==S(I-q))for(var fe=Math.min(f,W)-1,O=Math.min(32767,I),pe=Math.min(258,W);q<=O&&--U&&Z!=T;){if(e[I+M]==e[I+M-q]){for(var P=0;P<pe&&e[I+P]==e[I+P-q];++P);if(P>M){if(M=P,D=q,P>fe)break;for(var F=Math.min(q,P-2),Y=0,k=0;k<F;++k){var j=I-q+k&32767,ne=m[j],ae=j-ne&32767;ae>Y&&(Y=ae,T=j)}}}Z=T,T=m[Z],q+=Z-T&32767}if(D){_[C++]=268435456|ec[M]<<18|_y[D];var ge=ec[M]&31,K=_y[D]&31;E+=$u[ge]+qu[K],++w[257+ge],++b[K],N=I+M,++R}else _[C++]=e[I],++w[e[I]]}}for(I=Math.max(I,N);I<o;++I)_[C++]=e[I],++w[e[I]];h=Zy(e,u,a,_,w,b,E,C,G,I-G,h),a||(s.r=h&7|u[h/8|0]<<3,h-=7,s.h=g,s.p=m,s.i=I,s.w=N)}else{for(var I=s.w||0;I<o+a;I+=65535){var le=I+65535;le>=o&&(u[h/8|0]=a,le=o),h=Cy(u,h+1,e.subarray(I,le))}s.i=o}return Ey(l,0,n+Ty(h)+i)},SN=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r}return e}(),wN=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=SN[r&255^t[n]]^r>>>8;e=r},d:function(){return~e}}},RN=function(e,t,r,n,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),o=new tt(s.length+e.length);o.set(s),o.set(e,s.length),e=o,i.w=s.length}return vN(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,i)},ic=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},_N=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&ic(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;n<=r.length;++n)e[n+10]=r.charCodeAt(n)}},TN=function(e){return 10+(e.filename?e.filename.length+1:0)};function EN(e,t){t||(t={});var r=wN(),n=e.length;r.p(e);var i=RN(e,t,TN(t),8),s=i.length;return _N(i,t),ic(i,s-8,r.d()),ic(i,s-4,n),i}var xy=typeof TextEncoder!="undefined"&&new TextEncoder,IN=typeof TextDecoder!="undefined"&&new TextDecoder;try{IN.decode(Ly,{stream:!0})}catch(e){}function CN(e,t){var r;if(xy)return xy.encode(e);for(var n=e.length,i=new tt(e.length+(e.length>>1)),s=0,o=function(a){i[s++]=a},r=0;r<n;++r){if(s+5>i.length){var l=new tt(s+8+(n-r<<1));l.set(i),i=l}var u=e.charCodeAt(r);u<128||t?o(u):u<2048?(o(192|u>>6),o(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|e.charCodeAt(++r)&1023,o(240|u>>18),o(128|u>>12&63),o(128|u>>6&63),o(128|u&63)):(o(224|u>>12),o(128|u>>6&63),o(128|u&63))}return Ey(i,0,s)}function Ny(e){return $(this,null,function*(){const t=CN(JSON.stringify(e)),r=EN(t),n=yield new Promise(i=>{const s=new FileReader;s.onload=()=>i(s.result),s.readAsDataURL(new Blob([new Uint8Array(r)]))});return{compressedBase64:n.slice(n.indexOf(",")+1),compressedSize:r.length,bufferLength:t.length}})}const Oy="dmFyIFVyPU9iamVjdC5kZWZpbmVQcm9wZXJ0eSxWcj1PYmplY3QuZGVmaW5lUHJvcGVydGllczt2YXIgcXI9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcnM7dmFyICRlPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHM7dmFyIHRuPU9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHksbm49T2JqZWN0LnByb3RvdHlwZS5wcm9wZXJ0eUlzRW51bWVyYWJsZTt2YXIgaHQ9KEYsJCxCKT0+JCBpbiBGP1VyKEYsJCx7ZW51bWVyYWJsZTohMCxjb25maWd1cmFibGU6ITAsd3JpdGFibGU6ITAsdmFsdWU6Qn0p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hZ2UuYmFja2VuZCxuPXYuZGF0YS5tZXNzYWdlLnNlc3Npb25TZWN1cmVJRCxzPXYuZGF0YS5tZXNzYWdlLmRlYnVnLG89di5kYXRhLm1lc3NhZ2UucmVjb3JkaW5nU3RhcnRUaW1lLGMuZGVidWc9cyxlPXByKG5ldyBIbih0LHtoZWFkZXJzOnt9fSksTXIoKSkseWllbGQgcSgpO3JldHVybn1pZih2LmRhdGEubWVzc2FnZS50eXBlPT09Wi5SZXNldCl7ZC5sZW5ndGg9MCxoLmxlbmd0aD0wLGk9MCxyPTAsbj0iIixvPTA7cmV0dXJufWlmKHYuZGF0YS5tZXNzYWdlLnR5cGU9PT1aLkdldFN0YXR1cyl7U2UucG9zdE1lc3NhZ2Uoe3Jlc3BvbnNlOnt0eXBlOlouR2V0U3RhdHVzLHBlbmRpbmdDb3VudDpkLmxlbmd0aCxpbml0aWFsaXplZDp1KCl9fSk7cmV0dXJufWlmKCF1KCkpe2QucHVzaCh2LmRhdGEubWVzc2FnZSk7cmV0dXJufXRyeXt5aWVsZCBQKHYuZGF0YS5tZXNzYWdlKSxpPTAseWllbGQgcSgpfWNhdGNoKEUpe3MmJmNvbnNvbGUuZXJyb3IoRSksaSs9MX19KX19fSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9aGlnaGxpZ2h0LWNsaWVudC13b3JrZXItRHNiS01weHEuanMubWFwCg==",ZN=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),Gy=typeof self!="undefined"&&self.Blob&&new Blob([ZN(Oy)],{type:"text/javascript;charset=utf-8"});function Vy(e){let t;try{if(t=Gy&&(self.URL||self.webkitURL).createObjectURL(Gy),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch(r){return new Worker("data:text/javascript;base64,"+Oy,{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Pe=(e=>(e[e.Initialize=0]="Initialize",e[e.Reset=1]="Reset",e[e.AsyncEvents=2]="AsyncEvents",e[e.Identify=3]="Identify",e[e.Properties=4]="Properties",e[e.Metrics=5]="Metrics",e[e.Feedback=6]="Feedback",e[e.CustomEvent=7]="CustomEvent",e[e.Stop=8]="Stop",e[e.GetStatus=9]="GetStatus",e))(Pe||{});function LN(e){return"regexValue"in e}function xN(e){return"matchValue"in e}function NN(e){const t=Math.trunc(e);return t===1?!0:t===0?!1:Math.floor(Math.random()*t)===0}class ky{constructor(t=NN){L(this,"regexCache",new Map);L(this,"config");this.sampler=t}setConfig(t){this.config=t}isSamplingEnabled(){var t,r,n,i;return!!((r=(t=this.config)==null?void 0:t.logs)!=null&&r.length||(i=(n=this.config)==null?void 0:n.spans)!=null&&i.length)}shouldSample(t){var r,n;return t.name===mg?this.sampleLog((r=this.config)==null?void 0:r.logs,t):this.sampleSpan((n=this.config)==null?void 0:n.spans,t)}matchesValue(t,r){if(!t)return!1;if(xN(t))return t.matchValue===r;if(LN(t)){const n=t.regexValue;if(n===null)return!1;this.regexCache.has(n)||this.regexCache.set(n,new RegExp(n));const i=this.regexCache.get(n);if(typeof r=="string")return i.test(r)}return!1}matchesAttributes(t,r){if(t)for(const n of t){let i=!1;for(const s of Object.keys(r))if(this.matchesValue(n.key,s)){const o=r[s];if(this.matchesValue(n.attribute,o)){i=!0;break}}if(!i)return!1}return!0}matchEvent(t,r){return!(t.name&&!this.matchesValue(t.name,r.name)||t.attributes&&(!r.attributes||!this.matchesAttributes(t.attributes,r.attributes)))}matchesEvents(t,r){if(t)for(const n of t){let i=!1;for(const s of r)if(this.matchEvent(n,s)){i=!0;break}if(!i)return!1}return!0}matchesSpanConfig(t,r){return!(t.name&&!this.matchesValue(t.name,r.name)||!this.matchesAttributes(t.attributes,r.attributes)||!this.matchesEvents(t.events,r.events))}matchesLogConfig(t,r){if(t.severityText){const n=r[yg];if(!this.matchesValue(t.severityText,n))return!1}if(t.message){const n=r[bg];if(!this.matchesValue(t.message,n))return!1}return!!this.matchesAttributes(t.attributes,r)}sampleSpan(t,r){if(t){for(const n of t)if(this.matchesSpanConfig(n,r))return{sample:this.sampler(n.samplingRatio),attributes:{[gg]:n.samplingRatio}}}return{sample:!0}}sampleLog(t,r){if(t){for(const n of t)if(this.matchesLogConfig(n,r.attributes))return{sample:this.sampler(n.samplingRatio),attributes:{[gg]:n.samplingRatio}}}return{sample:!0}}}const ei=(e,t)=>{console.warn(`Highlight Warning: (${e}): `,{output:t})},ac=class ac{constructor(t,r){L(this,"options");L(this,"isRunningOnHighlight");L(this,"organizationID");oo(this,ni);L(this,"events");L(this,"sessionData");L(this,"ready");L(this,"manualStopped");L(this,"state");L(this,"logger");L(this,"enableSegmentIntegration");L(this,"privacySetting");L(this,"enableCanvasRecording");L(this,"enablePerformanceRecording");L(this,"samplingStrategy");L(this,"inlineImages");L(this,"inlineVideos");L(this,"inlineStylesheet");L(this,"styleSheetResyncInterval");L(this,"debugOptions");L(this,"listeners");L(this,"firstloadVersion");L(this,"environment");L(this,"sessionShortcut");L(this,"appVersion");L(this,"serviceName");L(this,"_worker");L(this,"_optionsInternal");L(this,"_backendUrl");L(this,"_recordingStartTime");L(this,"_isOnLocalHost");L(this,"_onToggleFeedbackFormVisibility");L(this,"_firstLoadListeners");L(this,"_isCrossOriginIframe");L(this,"_eventBytesSinceSnapshot");L(this,"_lastSnapshotTime");L(this,"_lastVisibilityChangeTime");L(this,"pushPayloadTimerId");L(this,"hasSessionUnloaded");L(this,"hasPushedData");L(this,"reloaded");L(this,"_hasPreviouslyInitialized");L(this,"_recordStop");L(this,"_gauges",new Map);L(this,"_counters",new Map);L(this,"_histograms",new Map);L(this,"_up_down_counters",new Map);L(this,"_integrations",[]);var i,s,o,l,u;t.sessionSecureID||(t.sessionSecureID=gt()),this.options=t,typeof((i=this.options)==null?void 0:i.debug)=="boolean"?this.debugOptions=this.options.debug?{clientInteractions:!0}:{}:this.debugOptions=(o=(s=this.options)==null?void 0:s.debug)!=null?o:{},this.logger=new _u(this.debugOptions.clientInteractions),t.storageMode&&(this.logger.log(`initializing in ${t.storageMode} session mode`),Mp(t.storageMode)),_s(!!(t!=null&&t.sessionCookie)),this._worker=new Vy,this._worker.onmessage=a=>{var h,c,f;((h=a.data.response)==null?void 0:h.type)===Pe.AsyncEvents?(this._eventBytesSinceSnapshot+=a.data.response.eventsSize,this.logger.log(`Web worker sent payloadID ${a.data.response.id} size ${a.data.response.eventsSize} bytes, compression ratio ${a.data.response.eventsSize/a.data.response.compressedSize}.
|
|
480
|
+
Total since snapshot: ${(this._eventBytesSinceSnapshot/1e6).toFixed(1)}MB`)):((c=a.data.response)==null?void 0:c.type)===Pe.CustomEvent?this.addCustomEvent(a.data.response.tag,a.data.response.payload):((f=a.data.response)==null?void 0:f.type)===Pe.Stop&&(ei("Stopping recording due to worker failure",a.data.response),this.stopRecording(!1))};let n=Mt();if(this.reloaded=!1,!((l=this.sessionData)!=null&&l.sessionSecureID)&&(n!=null&&n.sessionSecureID))this.sessionData=n,this.options.sessionSecureID=n.sessionSecureID,this.reloaded=!0,this.logger.log(`Tab reloaded, continuing previous session: ${this.sessionData.sessionSecureID}`);else{for(const a of Object.values(Ne))qr(a);this.sessionData={sessionSecureID:this.options.sessionSecureID,projectID:0,sessionStartTime:Date.now()}}this._hasPreviouslyInitialized=!1,this._firstLoadListeners=r||new Dt(this.options);try{window.parent.document&&(this._isCrossOriginIframe=!1)}catch(a){this._isCrossOriginIframe=(u=this.options.recordCrossOriginIframe)!=null?u:!0}this._initMembers(this.options)}static create(t){return new ac(t)}_reset(n){return $(this,arguments,function*({forceNew:t,sessionKey:r}){this.pushPayloadTimerId&&(clearTimeout(this.pushPayloadTimerId),this.pushPayloadTimerId=void 0);let i,s;if(!t)try{i=Fe(Ne.USER_IDENTIFIER);const o=Fe(Ne.USER_OBJECT);o&&(s=JSON.parse(o))}catch(o){}for(const o of Object.values(Ne))qr(o);this.sessionData.sessionSecureID=r?gt(`${this.organizationID}-${r}`):gt(),this.sessionData.sessionKey=r,this.sessionData.sessionStartTime=Date.now(),this.options.sessionSecureID=this.sessionData.sessionSecureID,this.stopRecording(),this._firstLoadListeners.stopListening(),this._firstLoadListeners=new Dt(this.options),yield this.initialize(),i&&s&&this.identify(i,s)})}_initMembers(t){var s,o,l,u,a,h,c,f,d,p,m;this.sessionShortcut=!1,this._recordingStartTime=0,this._isOnLocalHost=window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"||window.location.hostname==="",this.ready=!1,this.state="NotRecording",this.manualStopped=!1,this.enableSegmentIntegration=!!t.enableSegmentIntegration,this.privacySetting=(s=t.privacySetting)!=null?s:"default",this.enableCanvasRecording=(o=t.enableCanvasRecording)!=null?o:!1,this.enablePerformanceRecording=(l=t.enablePerformanceRecording)!=null?l:!0,this.inlineImages=(u=t.inlineImages)!=null?u:this._isOnLocalHost,this.inlineVideos=(a=t.inlineVideos)!=null?a:this._isOnLocalHost,this.inlineStylesheet=(h=t.inlineStylesheet)!=null?h:this._isOnLocalHost,this.styleSheetResyncInterval=(c=t.styleSheetResyncInterval)!=null?c:2e3,this.samplingStrategy=x({canvasFactor:.5,canvasMaxSnapshotDimension:360,canvasClearWebGLBuffer:!0,dataUrlOptions:uf()},(f=t.samplingStrategy)!=null?f:{canvas:2}),this._backendUrl=(d=t==null?void 0:t.backendUrl)!=null?d:"https://pub.highlight.io",this._backendUrl[0]==="/"&&(this._backendUrl=new URL(this._backendUrl,document.baseURI).href);const r=new So(`${this._backendUrl}`,{headers:{}});ao(this,ni,qa(r,vu())),this.environment=(p=t.environment)!=null?p:"production",this.appVersion=t.appVersion,this.serviceName=(m=t.serviceName)!=null?m:"",typeof t.organizationID=="string"?this.organizationID=t.organizationID:this.organizationID=t.organizationID.toString(),this.isRunningOnHighlight=this.organizationID==="1"||this.organizationID==="1jdkoe52",this.firstloadVersion=t.firstloadVersion||"unknown",this.sessionShortcut=t.sessionShortcut||!1,this._onToggleFeedbackFormVisibility=()=>{};const g=t,{firstloadVersion:n}=g,i=et(g,["firstloadVersion"]);this._optionsInternal=i,this.listeners=[],this.events=[],this.hasSessionUnloaded=!1,this.hasPushedData=!1,window.Intercom&&window.Intercom("onShow",()=>{window.Intercom("update",{highlightSessionURL:this.getCurrentSessionURLWithTimestamp()}),this.addProperties({event:"Intercom onShow"})}),this._eventBytesSinceSnapshot=0,this._lastSnapshotTime=new Date().getTime(),this._lastVisibilityChangeTime=new Date().getTime()}identify(t,r={},n){if(!t||t===""){console.warn("Highlight's identify() call was passed an empty identifier.",{user_identifier:t,user_object:r});return}this.sessionData.userIdentifier=t.toString(),this.sessionData.userObject=r,ct(Ne.USER_IDENTIFIER,t.toString()),ct(Ne.USER_OBJECT,JSON.stringify(r)),this._worker.postMessage({message:{type:Pe.Identify,userIdentifier:t,userObject:r,source:n}});for(const i of this._integrations)i.identify(this.sessionData.sessionSecureID,t,r,n)}log(t,r,n){this._firstLoadListeners.messages.push(gf(r,pf,t,n))}pushCustomError(t,r){return this.consumeCustomError(new Error(t),void 0,r)}consumeCustomError(t,r,n){let i={};if(n)try{i=x(x({},JSON.parse(n)),i)}catch(s){}return this.consumeError(t,{message:r,payload:i})}consumeError(t,{message:r,payload:n,source:i,type:s}){var a,h,c,f;t.cause&&(n=B(x({},n),{"exception.cause":t.cause}));let o=r?r+":"+t.message:t.message;s==="React.ErrorBoundary"&&(o="ErrorBoundary: "+o);const l=Rn(t),u={event:o,type:s!=null?s:"custom",url:window.location.href,source:i!=null?i:"",lineNumber:(a=l[0])!=null&&a.lineNumber?(h=l[0])==null?void 0:h.lineNumber:0,columnNumber:(c=l[0])!=null&&c.columnNumber?(f=l[0])==null?void 0:f.columnNumber:0,stackTrace:l,timestamp:new Date().toISOString(),payload:JSON.stringify(n),id:_n()};this._firstLoadListeners.errors.push(u);for(const d of this._integrations)d.error(this.sessionData.sessionSecureID,u)}addProperties(t={},r){const n=x({},t);Object.entries(n).forEach(([i,s])=>{try{structuredClone(s)}catch(o){delete n[i]}}),this._worker.postMessage({message:{type:Pe.Properties,propertiesObject:n,propertyType:r}});for(const i of this._integrations)i.track(this.sessionData.sessionSecureID,x({sessionSecureID:this.sessionData.sessionSecureID,propertyType:r},t))}initialize(t){return $(this,null,function*(){var r,n,i,s,o,l,u,a,h,c,f,d,p,m,g,v,y,S,_,w,b,R,E,I,C;if(navigator!=null&&navigator.webdriver&&!window.Cypress||(r=navigator==null?void 0:navigator.userAgent)!=null&&r.includes("Googlebot")||(n=navigator==null?void 0:navigator.userAgent)!=null&&n.includes("AdsBot")){(i=this._firstLoadListeners)==null||i.stopListening();return}try{if(t!=null&&t.forceNew){yield this._reset(t);return}if(t!=null&&t.sessionKey&&(t==null?void 0:t.sessionKey)!==this.sessionData.sessionKey){yield this._reset(B(x({},t),{forceNew:!0}));return}const N=new ky;vg({backendUrl:(o=(s=this.options)==null?void 0:s.backendUrl)!=null?o:"https://pub.highlight.io",otlpEndpoint:(u=(l=this.options)==null?void 0:l.otlpEndpoint)!=null?u:"https://otel.highlight.io",projectId:(a=this.options)==null?void 0:a.organizationID,sessionSecureId:(h=this.options)==null?void 0:h.sessionSecureID,environment:(f=(c=this.options)==null?void 0:c.environment)!=null?f:"production",networkRecordingOptions:typeof((d=this.options)==null?void 0:d.networkRecording)=="object"?this.options.networkRecording:void 0,tracingOrigins:(p=this.options)==null?void 0:p.tracingOrigins,serviceName:(g=(m=this.options)==null?void 0:m.serviceName)!=null?g:"highlight-browser",instrumentations:(y=(v=this.options)==null?void 0:v.otel)==null?void 0:y.instrumentations,getIntegrations:()=>[...this._integrations],productAnalyticsEvents:this._productAnalyticsEvents()},N),this._gauges.clear(),this._counters.clear(),this._histograms.clear(),this._up_down_counters.clear(),this.logger.log("Initializing...",t,this.sessionData,this.options),this.sessionData=(S=Mt(this.sessionData.sessionSecureID))!=null?S:this.sessionData,(_=this.sessionData)!=null&&_.sessionStartTime?this._recordingStartTime=(w=this.sessionData)==null?void 0:w.sessionStartTime:(this._recordingStartTime=new Date().getTime(),this.sessionData.sessionStartTime=this._recordingStartTime),tr(""),dt(this.sessionData);let G=Fe(Un.CLIENT_ID);G||(G=gt(),ct(Un.CLIENT_ID,G));let Q;this.options.disableSessionRecording||this.options.disableNetworkRecording!==void 0||typeof this.options.networkRecording=="boolean"?Q=!1:Q=((b=this.options.networkRecording)==null?void 0:b.recordHeadersAndBody)||!1;let Z=[];if(typeof this.options.networkRecording=="object"&&((R=this.options.networkRecording.destinationDomains)!=null&&R.length)&&(Z=this.options.networkRecording.destinationDomains),this._isCrossOriginIframe)yield this._setupCrossOriginIframe();else{const U=yield so(this,ni).initializeSession({organization_verbose_id:this.organizationID,enable_strict_privacy:this.privacySetting==="strict",privacy_setting:this.privacySetting,enable_recording_network_contents:Q,clientVersion:this.firstloadVersion,firstloadVersion:this.firstloadVersion,clientConfig:JSON.stringify(this._optionsInternal),environment:this.environment,id:G,appVersion:this.appVersion,serviceName:this.serviceName,session_secure_id:this.sessionData.sessionSecureID,session_key:this.sessionData.sessionKey,client_id:G,network_recording_domains:Z,disable_session_recording:this.options.disableSessionRecording});if(U.initializeSession.secure_id!==this.sessionData.sessionSecureID&&this.logger.log(`Unexpected secure id returned by initializeSession: ${U.initializeSession.secure_id}, expected ${this.sessionData.sessionSecureID}`),this.sessionData.sessionSecureID=U.initializeSession.secure_id,this.sessionData.projectID=parseInt(((E=U==null?void 0:U.initializeSession)==null?void 0:E.project_id)||"0"),N.setConfig(U.initializeSession.sampling),!this.sessionData.projectID||!this.sessionData.sessionSecureID){console.error("Failed to initialize Highlight; an error occurred on our end.",this.sessionData);return}}this.logger.log(`Loaded Highlight
|
|
481
|
+
Remote: ${this._backendUrl}
|
|
482
|
+
Project ID: ${this.sessionData.projectID}
|
|
483
|
+
SessionSecureID: ${this.sessionData.sessionSecureID}`),this.options.sessionSecureID=this.sessionData.sessionSecureID,this._worker.postMessage({message:{type:Pe.Initialize,sessionSecureID:this.sessionData.sessionSecureID,backend:this._backendUrl,debug:!!this.debugOptions.clientInteractions,recordingStartTime:this._recordingStartTime}});for(const U of this._integrations)U.init(this.sessionData.sessionSecureID);if(this.sessionData.userIdentifier&&this.identify(this.sessionData.userIdentifier,this.sessionData.userObject),this._firstLoadListeners.isListening()?this._firstLoadListeners.hasNetworkRecording||Dt.setupNetworkListener(this._firstLoadListeners,this.options):this._firstLoadListeners.startListening(),this.pushPayloadTimerId&&(clearTimeout(this.pushPayloadTimerId),this.pushPayloadTimerId=void 0),this._isCrossOriginIframe||(this.pushPayloadTimerId=setTimeout(()=>{this._save()},ys)),this.options.disableSessionRecording){this.logger.log("Highlight is NOT RECORDING a session replay per H.init setting."),this.ready=!0,this.state="Recording",this.manualStopped=!1;return}const{getDeviceDetails:T}=by();T&&this.recordGauge({name:Ve.DeviceMemory,value:T().deviceMemory,category:Ce.Device,group:window.location.href});const W=(U,q)=>{q&&this.logger.log("received isCheckout emit",{event:U}),this.events.push(U)};W.bind(this);const k=!!this._recordStop;this._recordStop&&(this._recordStop(),this._recordStop=void 0);const[M,D]=Zg(this.privacySetting,this.options.maskAllInputs,this.options.maskInputOptions);this._recordStop=ot({ignoreClass:(I=this.options.ignoreClass)!=null?I:"highlight-ignore",ignoreSelector:this.options.ignoreSelector,blockClass:(C=this.options.blockClass)!=null?C:"highlight-block",blockSelector:this.options.blockSelector,emit:W,recordCrossOriginIframes:this.options.recordCrossOriginIframe,privacySetting:this.privacySetting,maskAllInputs:M,maskInputOptions:D,maskTextClass:this.options.maskTextClass,maskTextSelector:this.options.maskTextSelector,recordCanvas:this.enableCanvasRecording,sampling:{canvas:{fps:this.samplingStrategy.canvas,fpsManual:this.samplingStrategy.canvasManualSnapshot,resizeFactor:this.samplingStrategy.canvasFactor,clearWebGLBuffer:this.samplingStrategy.canvasClearWebGLBuffer,initialSnapshotDelay:this.samplingStrategy.canvasInitialSnapshotDelay,dataURLOptions:this.samplingStrategy.dataUrlOptions,maxSnapshotDimension:this.samplingStrategy.canvasMaxSnapshotDimension}},keepIframeSrcFn:U=>!this.options.recordCrossOriginIframe,inlineImages:this.inlineImages,inlineVideos:this.inlineVideos,collectFonts:this.inlineImages,inlineStylesheet:this.inlineStylesheet,styleSheetResyncInterval:this.styleSheetResyncInterval,plugins:[Ee()],logger:typeof this.options.debug=="boolean"&&this.options.debug||typeof this.options.debug=="object"&&this.options.debug.domRecording?{debug:this.logger.log,warn:ei}:void 0}),k||this.options.recordCrossOriginIframe&&this._setupCrossOriginIframeParent(),document.referrer&&(window&&document.referrer.includes(window.location.origin)||(this.addCustomEvent("Referrer",document.referrer),this.addProperties({referrer:document.referrer},{type:"session"}))),this.sessionData.sessionKey&&this.addProperties({sessionKey:this.sessionData.sessionKey},{type:"session"}),this._setupWindowListeners(),this.ready=!0,this.state="Recording",this.manualStopped=!1}catch(N){this._isOnLocalHost&&(console.error(N),ei("initializeSession",N))}})}_productAnalyticsEvents(){var n;const t=(n=this.options)==null?void 0:n.productAnalytics;if(t===!1)return{};const r={clicks:!0,pageViews:!0,trackEvents:!0};if(t===void 0||t===!0)return r;for(const i of Object.keys(t))t[i]===!1&&(r[i]=!1);return r}_visibilityHandler(t){return $(this,null,function*(){if(this.manualStopped){this.logger.log("Ignoring visibility event due to manual stop.");return}new Date().getTime()-this._lastVisibilityChangeTime<Xp||(this._lastVisibilityChangeTime=new Date().getTime(),this.logger.log(`Detected window ${t?"hidden":"visible"}.`),t?(this.addCustomEvent("TabHidden",!0),this.options.disableBackgroundRecording&&this.stopRecording()):(this.options.disableBackgroundRecording&&(yield this.initialize()),this.addCustomEvent("TabHidden",!1)))})}_setupCrossOriginIframe(){return $(this,null,function*(){this.logger.log("highlight in cross-origin iframe is waiting "),yield new Promise(t=>{const r=n=>{if(n.data.highlight===qs){const i=n.data;this.logger.log("highlight got window message ",i),this.sessionData.projectID=i.projectID,this.sessionData.sessionSecureID=i.sessionSecureID,window.parent.postMessage({highlight:eo},"*"),window.removeEventListener("message",r),t()}};window.addEventListener("message",r)})})}_setupCrossOriginIframeParent(){this.logger.log("highlight setting up cross origin iframe parent notification"),setInterval(()=>{window.document.querySelectorAll("iframe").forEach(t=>{var r;(r=t.contentWindow)==null||r.postMessage({highlight:qs,projectID:this.sessionData.projectID,sessionSecureID:this.sessionData.sessionSecureID},"*")})},ys),window.addEventListener("message",t=>{t.data.highlight===eo&&this.logger.log("highlight got response from initialized iframe")})}_setupWindowListeners(){var n;try{const i=this;this.enableSegmentIntegration&&this.listeners.push(Fg(o=>{if(o.type==="track"){const l={};l["segment-event"]=o.event,i.addProperties(l,{type:"track",source:"segment"})}else if(o.type==="identify"){const l=o.userId.replace(/^"(.*)"$/,"$1");i.identify(l,o.traits,"segment")}})),this.listeners.push(Cu(o=>{this.reloaded?(this.addCustomEvent("Reload",o),this.reloaded=!1,i.addProperties({reload:!0},{type:"session"})):this.addCustomEvent("Navigate",o)})),this.listeners.push(Uu(o=>{this.addCustomEvent("Viewport",o),this.submitViewportMetrics(o)})),this.listeners.push(Wg((o,l)=>{let u=null,a=null;if(l&&l.target){const h=l.target;u=Vu(h),a=h.textContent,a&&a.length>2e3&&(a=a.substring(0,2e3))}this.addCustomEvent("Click",{clickTarget:o,clickTextContent:a,clickSelector:u})})),this.listeners.push(Pg(o=>{o&&this.addCustomEvent("Focus",o)})),this.listeners.push(py(o=>{const{name:l,value:u}=o,a=[],h=(c,f)=>{f&&a.push({name:c,value:f})};switch(o.name){case"LCP":{const c=o.attribution;h("web_vital.element",c.element),h("web_vital.attribution.url",c.url?Is(c.url):void 0);break}case"CLS":{const c=o.attribution;h("web_vital.element",c.largestShiftTarget),h("web_vital.load_state",c.loadState);break}case"INP":{const c=o.attribution;h("web_vital.element",c.eventTarget),h("web_vital.event_type",c.eventType),h("web_vital.load_state",c.loadState);break}case"FID":{const c=o.attribution;h("web_vital.element",c.eventTarget),h("web_vital.event_type",c.eventType);break}case"FCP":{const c=o.attribution;h("web_vital.load_state",c.loadState);break}}this.recordGauge({name:l,value:u,group:window.location.href,category:Ce.WebVital,tags:a.length?a:void 0})})),this.listeners.push(my(o=>{const l=[];o.saveData!==void 0&&l.push({name:"saveData",value:o.saveData.toString()}),o.effectiveType!==void 0&&l.push({name:"effectiveType",value:o.effectiveType.toString()}),o.type!==void 0&&l.push({name:"type",value:o.type.toString()}),Object.entries(o).forEach(([u,a])=>{cf(a)&&this.recordGauge({name:u,value:a,category:Ce.Performance,group:window.location.href,tags:l})})},this._recordingStartTime)),this.sessionShortcut&&this.listeners.push(Hg(this.sessionShortcut,()=>{window.open(this.getCurrentSessionURLWithTimestamp(),"_blank")})),this.enablePerformanceRecording&&(this.listeners.push(Dg(o=>{this.addCustomEvent("Performance",bt(o)),Object.entries(o).filter(([l])=>l!=="relativeTimestamp").forEach(([l,u])=>u&&this.recordGauge({name:l,value:u,category:Ce.Performance,group:window.location.href}))},this._recordingStartTime)),this.listeners.push(Mg(o=>{this.addCustomEvent("Jank",bt(o)),this.recordGauge({name:"Jank",value:o.jankAmount,category:Ce.WebVital,group:o.querySelector})},this._recordingStartTime))),this._hasPreviouslyInitialized||((n=window.electron)!=null&&n.ipcRenderer?(window.electron.ipcRenderer.on("highlight.run",({visible:o})=>{this._visibilityHandler(!o)}),this.logger.log("Set up Electron highlight.run events.")):(Ag(o=>this._visibilityHandler(o)),this.logger.log("Set up document visibility listener.")),this._hasPreviouslyInitialized=!0);const s=()=>{this.hasSessionUnloaded=!0,this.pushPayloadTimerId&&(clearTimeout(this.pushPayloadTimerId),this.pushPayloadTimerId=void 0)};window.addEventListener("beforeunload",s),this.listeners.push(()=>window.removeEventListener("beforeunload",s))}catch(i){this._isOnLocalHost&&(console.error(i),ei("initializeSession _setupWindowListeners",i))}const t=()=>{this.addCustomEvent("Page Unload",""),tr(this.sessionData.sessionSecureID),dt(this.sessionData)};if(window.addEventListener("beforeunload",t),this.listeners.push(()=>window.removeEventListener("beforeunload",t)),navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPhone/i)){const i=()=>{this.addCustomEvent("Page Unload",""),tr(this.sessionData.sessionSecureID),dt(this.sessionData)};window.addEventListener("pagehide",i),this.listeners.push(()=>window.removeEventListener("pagehide",i))}}submitViewportMetrics({height:t,width:r,availHeight:n,availWidth:i}){this.recordGauge({name:Ve.ViewportHeight,value:t,category:Ce.Device,group:window.location.href}),this.recordGauge({name:Ve.ViewportWidth,value:r,category:Ce.Device,group:window.location.href}),this.recordGauge({name:Ve.ScreenHeight,value:n,category:Ce.Device,group:window.location.href}),this.recordGauge({name:Ve.ScreenWidth,value:i,category:Ce.Device,group:window.location.href}),this.recordGauge({name:Ve.ViewportArea,value:t*r,category:Ce.Device,group:window.location.href})}recordGauge(t){var n,i;let r=this._gauges.get(t.name);if(!r){if(r=(n=nr())==null?void 0:n.createGauge(t.name,sr(t.name,t.unit)),!r)return;this._gauges.set(t.name,r)}r.record(t.value,B(x({},(i=t.tags)==null?void 0:i.reduce((s,o)=>B(x({},s),{[o.name]:o.value}),{})),{group:t.group,category:t.category,"highlight.session_id":this.sessionData.sessionSecureID}));for(const s of this._integrations)s.recordGauge(this.sessionData.sessionSecureID,t)}recordCount(t){var n,i;let r=this._counters.get(t.name);if(!r){if(r=(n=nr())==null?void 0:n.createCounter(t.name,sr(t.name,t.unit)),!r)return;this._counters.set(t.name,r)}r.add(t.value,B(x({},(i=t.tags)==null?void 0:i.reduce((s,o)=>B(x({},s),{[o.name]:o.value}),{})),{group:t.group,category:t.category,"highlight.session_id":this.sessionData.sessionSecureID}))}recordIncr(t){this.recordCount(B(x({},t),{value:1}))}recordHistogram(t){var n,i;let r=this._histograms.get(t.name);if(!r){if(r=(n=nr())==null?void 0:n.createHistogram(t.name,sr(t.name,t.unit)),!r)return;this._histograms.set(t.name,r)}r.record(t.value,B(x({},(i=t.tags)==null?void 0:i.reduce((s,o)=>B(x({},s),{[o.name]:o.value}),{})),{group:t.group,category:t.category,"highlight.session_id":this.sessionData.sessionSecureID}))}recordUpDownCounter(t){var n,i;let r=this._up_down_counters.get(t.name);if(!r){if(r=(n=nr())==null?void 0:n.createUpDownCounter(t.name,sr(t.name,t.unit)),!r)return;this._up_down_counters.set(t.name,r)}r.add(t.value,B(x({},(i=t.tags)==null?void 0:i.reduce((s,o)=>B(x({},s),{[o.name]:o.value}),{})),{group:t.group,category:t.category,"highlight.session_id":this.sessionData.sessionSecureID}))}stopRecording(t){this.manualStopped=!!t,this.manualStopped&&this.addCustomEvent("Stop","H.stop() was called which stops Highlight from recording."),this.state="NotRecording",t&&this._recordStop&&(this._recordStop(),this._recordStop=void 0),this.listeners.forEach(r=>r()),this.listeners=[],Nu()}getCurrentSessionTimestamp(){return this._recordingStartTime}getCurrentSessionURLWithTimestamp(){const t=new Date().getTime(),{projectID:r,sessionSecureID:n}=this.sessionData,i=(t-this._recordingStartTime)/1e3;return`https://${An}/${r}/sessions/${n}?ts=${i}`}getCurrentSessionURL(){const t=this.sessionData.projectID,r=this.sessionData.sessionSecureID;return t&&r?`https://${An}/${t}/sessions/${r}`:null}snapshot(t){return $(this,null,function*(){yield ot.snapshotCanvas(t)})}addSessionFeedback({timestamp:t,verbatim:r,user_email:n,user_name:i}){var s;this._worker.postMessage({message:{type:Pe.Feedback,verbatim:r,timestamp:t,userName:i||this.sessionData.userIdentifier,userEmail:n||((s=this.sessionData.userObject)==null?void 0:s.name)}})}_save(){return $(this,null,function*(){var t;try{this.state==="Recording"&&this.listeners&&!this.sessionData.sessionKey&&this.sessionData.sessionStartTime&&Date.now()-this.sessionData.sessionStartTime>kp&&(this.logger.log("Resetting session",{start:this.sessionData.sessionStartTime}),yield this._reset({}));let r;((t=this.options)==null?void 0:t.sendMode)==="local"&&(r=n=>$(this,null,function*(){let i=new Blob([JSON.stringify({query:po($a),variables:n})],{type:"application/json"});return yield window.fetch(`${this._backendUrl}`,{method:"POST",body:i}),0})),yield this._sendPayload({sendFn:r}),this.hasPushedData=!0,this.sessionData.lastPushTime=Date.now(),dt(this.sessionData)}catch(r){this._isOnLocalHost&&(console.error(r),ei("_save",r))}this.state==="Recording"&&(this.pushPayloadTimerId&&(clearTimeout(this.pushPayloadTimerId),this.pushPayloadTimerId=void 0),this.pushPayloadTimerId=setTimeout(()=>{this._save()},Vp))})}addCustomEvent(t,r){if(this.state==="NotRecording"){let n;const i=()=>{clearInterval(n),this.state==="Recording"&&this.events.length>0?Hi(t,r):n=setTimeout(i,500)};n=setTimeout(i,500)}else this.state==="Recording"&&(this.events.length>0||this.hasPushedData)&&Hi(t,r)}_sendPayload(r){return $(this,arguments,function*({sendFn:t}){const n=Dt.getRecordedNetworkResources(this._firstLoadListeners,this._recordingStartTime),i=Dt.getRecordedWebSocketEvents(this._firstLoadListeners),s=[...this.events],o=[...this._firstLoadListeners.messages],l=[...this._firstLoadListeners.errors],{bytes:u,time:a}=this.enableCanvasRecording?bs.canvas:bs.normal;this._eventBytesSinceSnapshot>=u&&new Date().getTime()-this._lastSnapshotTime>=a&&this.takeFullSnapshot(),this.logger.log(`Sending: ${s.length} events, ${o.length} messages, ${n.length} network resources, ${l.length} errors
|
|
484
|
+
To: ${this._backendUrl}
|
|
485
|
+
Org: ${this.organizationID}
|
|
486
|
+
SessionSecureID: ${this.sessionData.sessionSecureID}`);const h=new Date().getTime(),c=gy();if(t){const f={session_secure_id:this.sessionData.sessionSecureID,payload_id:h.toString(),events:{events:s},messages:bt({messages:o}),resources:JSON.stringify({resources:n}),web_socket_events:JSON.stringify({webSocketEvents:i}),errors:l,is_beacon:!1,has_session_unloaded:this.hasSessionUnloaded,highlight_logs:c||void 0},{compressedBase64:d}=yield Ny(f);yield t({session_secure_id:this.sessionData.sessionSecureID,payload_id:new Date().getTime().toString(),data:d})}else this._worker.postMessage({message:{type:Pe.AsyncEvents,id:h,events:s,messages:o,errors:l,resourcesString:JSON.stringify({resources:n}),webSocketEventsString:JSON.stringify({webSocketEvents:i}),hasSessionUnloaded:this.hasSessionUnloaded,highlightLogs:c}});dt(this.sessionData),Dt.clearRecordedNetworkResources(this._firstLoadListeners),this.events=this.events.slice(s.length),this._firstLoadListeners.messages=this._firstLoadListeners.messages.slice(o.length),this._firstLoadListeners.errors=this._firstLoadListeners.errors.slice(l.length),yy(c)})}takeFullSnapshot(){if(!this._recordStop){this.logger.log("skipping full snapshot as rrweb is not running");return}this.logger.log("taking full snapshot",{bytesSinceSnapshot:this._eventBytesSinceSnapshot,lastSnapshotTime:this._lastSnapshotTime}),ot.takeFullSnapshot(),this._eventBytesSinceSnapshot=0,this._lastSnapshotTime=new Date().getTime()}registerLD(t){this._integrations.length||this._integrations.push(new Ms(t))}};ni=new WeakMap;let sc=ac;const Xy=({apiKey:e})=>{(function(t,r){var n=t.amplitude||{_q:[],_iq:{}},i=r.createElement("script");i.type="text/javascript",i.integrity="sha384-+EO59vL/X7v6VE2s6/F4HxfHlK0nDUVWKVg8K9oUlvffAeeaShVBmbORTC2D3UF+",i.crossOrigin="anonymous",i.async=!0,i.src="https://cdn.amplitude.com/libs/amplitude-8.17.0-min.gz.js",i.onload=function(){t.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK"),amplitude.getInstance().init(e)};var s=r.getElementsByTagName("script")[0];s.parentNode.insertBefore(i,s);function o(m,g){m.prototype[g]=function(){return this._q.push([g].concat(Array.prototype.slice.call(arguments,0))),this}}for(var l=function(){return this._q=[],this},u=["add","append","clearAll","prepend","set","setOnce","unset","preInsert","postInsert","remove"],a=0;a<u.length;a++)o(l,u[a]);n.Identify=l;for(var h=function(){return this._q=[],this},c=["setProductId","setQuantity","setPrice","setRevenueType","setEventProperties"],f=0;f<c.length;f++)o(h,c[f]);n.Revenue=h;var d=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","enableTracking","setGlobalUserProperties","identify","clearUserProperties","setGroup","logRevenueV2","regenerateDeviceId","groupIdentify","onInit","logEventWithTimestamp","logEventWithGroups","setSessionId","resetSessionId"];function p(m){function g(y){m[y]=function(){m._q.push([y].concat(Array.prototype.slice.call(arguments,0)))}}for(var v=0;v<d.length;v++)g(d[v])}p(n),n.getInstance=function(m){return m=(!m||m.length===0?"$default_instance":m).toLowerCase(),Object.prototype.hasOwnProperty.call(n._iq,m)||(n._iq[m]={_q:[]},p(n._iq[m])),n._iq[m]},t.amplitude=n})(window,document)},Wy=({projectToken:e})=>{if(window.mixpanel)return;(function(r,n){if(!n.__SV){var i,s;window.mixpanel=n,n._i=[],n.init=function(o,l,u){function a(f,d){var p=d.split(".");p.length==2&&(f=f[p[0]],d=p[1]),f[d]=function(){f.push([d].concat(Array.prototype.slice.call(arguments,0)))}}var h=n;for(typeof u!="undefined"?h=n[u]=[]:u="mixpanel",h.people=h.people||[],h.toString=function(f){var d="mixpanel";return u!=="mixpanel"&&(d+="."+u),f||(d+=" (stub)"),d},h.people.toString=function(){return h.toString(1)+".people (stub)"},i="disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split(" "),s=0;s<i.length;s++)a(h,i[s]);var c="set set_once union unset remove delete".split(" ");h.get_group=function(){function f(g){d[g]=function(){call2_args=arguments,call2=[g].concat(Array.prototype.slice.call(call2_args,0)),h.push([p,call2])}}for(var d={},p=["get_group"].concat(Array.prototype.slice.call(arguments,0)),m=0;m<c.length;m++)f(c[m]);return d},n._i.push([o,l,u])},n.__SV=1.2}})(document,window.mixpanel||[]);const t=document.createElement("script");t.src=ON,document.head.appendChild(t),t.addEventListener("load",()=>{var r;(r=window.mixpanel)==null||r.init(e)})},ON="https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js",GN=()=>{var e,t;typeof chrome!="undefined"&&((e=chrome==null?void 0:chrome.runtime)!=null&&e.onMessage)&&((t=chrome==null?void 0:chrome.runtime)==null||t.onMessage.addListener((r,n,i)=>{const s=r.action;switch(console.log(`[highlight] received '${s}' event from extension.`),s){case"init":{ye.init(1,{debug:!0}),ye.getSessionURL().then(o=>{i({url:o})});break}case"stop":{ye.stop(),i({success:!0});break}}return!0}))};function VN(e){var t;e.on&&((t=e.webContents)!=null&&t.send)&&(e.on("focus",()=>{e.webContents.send("highlight.run",{visible:!0})}),e.on("blur",()=>{e.webContents.send("highlight.run",{visible:!1})}),e.on("close",()=>{e.webContents.send("highlight.run",{visible:!1})}))}const kN=({next:e,payload:t})=>{if(typeof window!="undefined"&&typeof document!="undefined"&&"H"in window){if(t.obj.type==="track"){const r=t.obj.event,n=t.obj.properties;window.H.track(r,n)}else if(t.obj.type==="identify"){const r=t.obj.userId;if(r!=null&&r.length){const n=t.obj.traits;window.H.identify(r,n)}}}e(t)},Py=()=>{if(typeof window!="undefined"){if(typeof window._highlightFetchPatch!="undefined")return;window._originalFetch=window.fetch,window._fetchProxy=(e,t)=>window._originalFetch(e,t),window._highlightFetchPatch=(e,t)=>window._fetchProxy.call(window||global,e,t),window.fetch=window._highlightFetchPatch}},My=()=>null,Ay=()=>{if(typeof window!="undefined"){if(typeof window._highlightWebSocketRequestCallback!="undefined")return;window._highlightWebSocketRequestCallback=My,window._highlightWebSocketEventCallback=My;const e=new Proxy(window.WebSocket,{construct(t,r){const[,n]=Kl(),i=new t(...r),s=h=>{window._highlightWebSocketRequestCallback({socketId:n,initiatorType:"websocket",type:"open",name:i.url,startTimeAbs:performance.timeOrigin+h.timeStamp})},o=h=>{window._highlightWebSocketRequestCallback({socketId:n,initiatorType:"websocket",type:"close",name:i.url,responseEndAbs:performance.timeOrigin+h.timeStamp}),i.removeEventListener("open",s),i.removeEventListener("error",u),i.removeEventListener("message",l),i.removeEventListener("close",o)},l=h=>{const{data:c}=h,f=typeof c=="string"?h.data:void 0;let d;typeof c=="string"?d=c.length:c instanceof Blob?d=c.size:d=c.byteLength||0,window._highlightWebSocketEventCallback({socketId:n,type:"received",name:i.url,timeStamp:performance.timeOrigin+h.timeStamp,size:d,message:f})},u=h=>{window._highlightWebSocketEventCallback({socketId:n,type:"error",name:i.url,timeStamp:performance.timeOrigin+h.timeStamp,size:0})};i.addEventListener("open",s),i.addEventListener("error",u),i.addEventListener("message",l),i.addEventListener("close",o);const a=new Proxy(i.send,{apply:function(h,c,f){const d=f[0],p=typeof d=="string"?d:void 0;let m;typeof d=="string"?m=d.length:d instanceof Blob?m=d.size:m=d.byteLength||0,window._highlightWebSocketEventCallback({socketId:n,type:"sent",name:i.url,timeStamp:performance.timeOrigin+performance.now(),size:m,message:p}),h.apply(c,f)}});return i.send=a,i}});window.WebSocket=e}},on=()=>{const e={end:()=>{},spanContext:()=>({traceId:"",spanId:"",traceFlags:0}),setAttribute:(t,r)=>e,setAttributes:t=>e,addEvent:(t,r,n)=>e,addLinks:t=>e,setStatus:t=>e,recordException:()=>{},addLink:()=>e,updateName:()=>e,isRecording:()=>!1};return e},XN=()=>{if(typeof window=="undefined"||typeof PerformanceObserver=="undefined")return!1;const e=PerformanceObserver.supportedEntryTypes;return Array.isArray(e)&&e.includes("longtask")},WN=e=>{if(!XN())return()=>{};let t;try{t=new PerformanceObserver(r=>{var n;for(const i of r.getEntries()){const s=(n=i.attribution)==null?void 0:n[0];e({duration:i.duration,name:i.name,startTime:i.startTime,containerType:s==null?void 0:s.containerType,containerSrc:s==null?void 0:s.containerSrc,containerId:s==null?void 0:s.containerId,containerName:s==null?void 0:s.containerName})}}),t.observe({type:"longtask",buffered:!0})}catch(r){return()=>{}}return()=>{try{t.disconnect()}catch(r){}}},PN=new Set(["string","number","boolean"]),MN=()=>typeof window!="undefined"&&typeof window.ReportingObserver!="undefined",AN=e=>{const t={};if(!e||typeof e!="object")return t;for(const[r,n]of Object.entries(e))if(n!=null)if(PN.has(typeof n))t[`report.body.${r}`]=n;else try{t[`report.body.${r}`]=JSON.stringify(n)}catch(i){}return t},UN=e=>{var n;const t=(n=e.body)!=null?n:{},r=t.message||t.reason||t.id||e.type;return typeof r=="string"?r:e.type},DN=(e,t)=>{if(!MN())return()=>{};const r=["deprecation","intervention","csp-violation"],n=window.ReportingObserver;let i;try{i=new n(s=>{var o,l;for(const u of s){const a=(o=u.type)!=null?o:"unknown",h=(l=u.body)!=null?l:{},c=x({"report.type":a,"report.url":u.url},AN(h)),f=UN({type:a,body:h});e(a==="deprecation"?{kind:"log",level:"warn",type:a,message:f,url:u.url,attributes:c}:{kind:"error",type:a,message:f,url:u.url,attributes:c})}},{buffered:!0,types:r}),i.observe()}catch(s){return()=>{}}return()=>{try{i.disconnect()}catch(s){}}},FN="exception",JN=function(e,t,r){if(!e)return;const n=x({},r);typeof t=="string"?n[Ml]=t:t&&(t.code?n[Al]=t.code.toString():t.name&&(n[Al]=t.name),t.message&&(n[Ml]=t.message),t.stack&&(n[XT]=t.stack)),n[Al]||n[Ml]?e.addEvent(FN,n):vr("otel","recordException","warn",`Failed to record an exception ${t}`)};class HN{constructor(t){L(this,"organizationID");L(this,"_options");L(this,"_integrations",[]);L(this,"_gauges",new Map);L(this,"_counters",new Map);L(this,"_histograms",new Map);L(this,"_up_down_counters",new Map);L(this,"sampler",new ky);L(this,"_started",!1);L(this,"_ldContextKeys");oo(this,ii);this._options=t,this.organizationID=t.projectId}_productAnalyticsEvents(){var n;const t=(n=this._options)==null?void 0:n.productAnalytics;if(t===!1)return{};const r={clicks:!0,pageViews:!0,trackEvents:!0};if(t===void 0||t===!0)return r;for(const i of Object.keys(t))t[i]===!1&&(r[i]=!1);return r}setLDContextKeyAttributes(t){t&&(this._ldContextKeys=Object.fromEntries(Object.entries(t).map(([r,n])=>[`${QL}.${r}`,n])))}getLDContextKeyAttributes(){return this._ldContextKeys}start(){return $(this,null,function*(){var r,n,i,s,o,l,u,a,h,c,f,d,p,m,g;if(this._started)return;this._started=!0,vg({backendUrl:(n=(r=this._options)==null?void 0:r.backendUrl)!=null?n:"https://pub.observability.app.launchdarkly.com",otlpEndpoint:(o=(s=(i=this._options)==null?void 0:i.otel)==null?void 0:s.otlpEndpoint)!=null?o:"https://otel.observability.app.launchdarkly.com",projectId:this._options.projectId,sessionSecureId:this._options.sessionSecureId,environment:(u=(l=this._options)==null?void 0:l.environment)!=null?u:"production",networkRecordingOptions:typeof((a=this._options)==null?void 0:a.networkRecording)=="object"?this._options.networkRecording:void 0,tracingOrigins:(h=this._options)==null?void 0:h.tracingOrigins,serviceName:(f=(c=this._options)==null?void 0:c.serviceName)!=null?f:"browser",serviceVersion:(d=this._options)==null?void 0:d.version,instrumentations:(m=(p=this._options)==null?void 0:p.otel)==null?void 0:m.instrumentations,productAnalyticsEvents:this._productAnalyticsEvents(),getLDContextKeyAttributes:()=>this.getLDContextKeyAttributes(),getIntegrations:()=>this._integrations},this.sampler),this._gauges.clear(),this._counters.clear(),this._histograms.clear(),this._up_down_counters.clear();const t=new So((g=this._options.backendUrl)!=null?g:"https://pub.observability.app.launchdarkly.com",{headers:{}});ao(this,ii,qa(t,vu())),yield this.configureSampling(),this.setupListeners()})}stop(){return $(this,null,function*(){this._started&&(this._started=!1,yield Nu())})}configureSampling(){return $(this,null,function*(){try{const t=yield so(this,ii).GetSamplingConfig({organization_verbose_id:`${this.organizationID}`});this.sampler.setConfig(t.sampling)}catch(t){De("sampling","warn",`LaunchDarkly Observability: Failed to configure sampling: ${t}`)}})}_recordLog(t,r,n,i){this.startSpan(mg,s=>{var u,a,h,c,f;const o=typeof t=="string"?t:bt(t),l=i?i.map(d=>d.toString()).join(`
|
|
487
|
+
`):void 0;if(s==null||s.addEvent("log",x(x({[yg]:r,[bg]:o,"code.stacktrace":l},(u=this._ldContextKeys)!=null?u:{}),n)),this._options.reportConsoleErrors&&r==="error"){const d=new Error(o);s==null||s.recordException(d),s==null||s.setStatus({code:qi.ERROR,message:o}),i?this._recordErrorMessage({error:d,event:d.message,type:"custom",url:window.location.href,source:"frontend",lineNumber:(h=(a=i[0])==null?void 0:a.lineNumber)!=null?h:0,columnNumber:(f=(c=i[0])==null?void 0:c.columnNumber)!=null?f:0,stackTrace:i,timestamp:new Date().toISOString(),id:_n()}):this.recordError(d)}})}_recordErrorMessage(t,r){try{t.payload&&(r=x(x({},JSON.parse(t.payload)),r||{}))}catch(o){}this.startSpan("highlight.exception",o=>{var l;JN(o,(l=t.error)!=null?l:new Error(t.event),{[ox]:t.id}),o==null||o.setAttributes(x({event:t.event,type:t.type,url:t.url,source:t.source,lineNumber:t.lineNumber,columnNumber:t.columnNumber},r))});const s=t,{payload:n}=s,i=et(s,["payload"]);for(const o of this._integrations)o.error(Pt(),B(x({},i),{payload:JSON.stringify(r)}))}recordError(t,r,n,i,s){var a,h,c,f;t=t||new Error("Unknown error"),t instanceof Error&&t.cause&&(n=B(x({},n),{"exception.cause":JSON.stringify(t.cause)}));let o=r?r+":"+t.message:t.message;s==="React.ErrorBoundary"&&(o="ErrorBoundary: "+o);const l=Rn(t),u={error:t,event:o,type:s!=null?s:"custom",url:window.location.href,source:i!=null?i:"frontend",lineNumber:(a=l[0])!=null&&a.lineNumber?(h=l[0])==null?void 0:h.lineNumber:0,columnNumber:(c=l[0])!=null&&c.columnNumber?(f=l[0])==null?void 0:f.columnNumber:0,stackTrace:l,timestamp:new Date().toISOString(),id:_n()};this._recordErrorMessage(u,n)}recordCount(t){var n,i;let r=this._counters.get(t.name);if(!r){if(r=(n=nr())==null?void 0:n.createCounter(t.name,sr(t.name,t.unit)),!r)return;this._counters.set(t.name,r)}r.add(t.value,B(x(x({},(i=this._ldContextKeys)!=null?i:{}),t.attributes),{"highlight.session_id":Pt()}))}recordGauge(t){var s,o,l;let r=this._gauges.get(t.name);if(!r){if(r=(s=nr())==null?void 0:s.createGauge(t.name,sr(t.name,t.unit)),!r)return;this._gauges.set(t.name,r)}const n=x(x({},(o=this._ldContextKeys)!=null?o:{}),t.attributes);r.record(t.value,B(x({},n),{"highlight.session_id":Pt()}));const i={name:t.name,value:t.value,unit:t.unit,category:n.category,group:(l=n.group)==null?void 0:l.toString(),tags:Object.entries(n).map(([u,a])=>{var h;return{name:u!=null?u:"",value:(h=a==null?void 0:a.toString())!=null?h:""}})};for(const u of this._integrations)u.recordGauge(Pt(),i)}recordIncr(t){this.recordCount(B(x({},t),{value:1}))}recordHistogram(t){var n,i;let r=this._histograms.get(t.name);if(!r){if(r=(n=nr())==null?void 0:n.createHistogram(t.name,sr(t.name,t.unit)),!r)return;this._histograms.set(t.name,r)}r.record(t.value,B(x(x({},(i=this._ldContextKeys)!=null?i:{}),t.attributes),{"highlight.session_id":Pt()}))}recordUpDownCounter(t){var n,i;let r=this._up_down_counters.get(t.name);if(!r){if(r=(n=nr())==null?void 0:n.createUpDownCounter(t.name,sr(t.name,t.unit)),!r)return;this._up_down_counters.set(t.name,r)}r.add(t.value,B(x(x({},(i=this._ldContextKeys)!=null?i:{}),t.attributes),{"highlight.session_id":Pt()}))}startSpan(t,r,n,i){const s=Fs();if(!s){const l=on();return i===void 0&&n===void 0?r(l):i===void 0?n(l):i(l)}const o=(l,u)=>{this._ldContextKeys&&l.setAttributes(this._ldContextKeys);const a=u(l);return a instanceof Promise?a.finally(()=>l.end()):(l.end(),a)};return i===void 0&&n===void 0?s.startActiveSpan(t,l=>o(l,r)):i===void 0?s.startActiveSpan(t,r,l=>o(l,n)):s.startActiveSpan(t,r,n,l=>o(l,i))}startManualSpan(t,r,n,i){const s=Fs();if(!s){const o=on();return i===void 0&&n===void 0?r(o):i===void 0?n(o):i(o)}return i===void 0&&n===void 0?s.startActiveSpan(t,r):i===void 0?s.startActiveSpan(t,r,n):s.startActiveSpan(t,r,n,i)}register(t,r){this._integrations.push(new Ms(t,r))}getHooks(t){return this._integrations.flatMap(r=>{var n,i;return(i=(n=r.getHooks)==null?void 0:n.call(r,t))!=null?i:[]})}submitViewportMetrics({height:t,width:r,availHeight:n,availWidth:i}){this.recordGauge({name:Ve.ViewportHeight,value:t,attributes:{category:Ce.Device,group:window.location.href}}),this.recordGauge({name:Ve.ViewportWidth,value:r,attributes:{category:Ce.Device,group:window.location.href}}),this.recordGauge({name:Ve.ScreenHeight,value:n,attributes:{category:Ce.Device,group:window.location.href}}),this.recordGauge({name:Ve.ScreenWidth,value:i,attributes:{category:Ce.Device,group:window.location.href}}),this.recordGauge({name:Ve.ViewportArea,value:t*r,attributes:{category:Ce.Device,group:window.location.href}})}setupListeners(){var r;this._options.disableConsoleRecording||mf(n=>{var i;this._recordLog((i=n.value)==null?void 0:i.join(" "),n.type,n.attributes?JSON.parse(n.attributes):{},n.trace)},{level:(r=this._options.consoleMethodsToRecord)!=null?r:[...el],logger:"console",stringifyOptions:{depthOfLimit:10,numOfKeysLimit:100,stringLengthLimit:1e3}}),this._options.enablePerformanceRecording!==!1&&(Dg(n=>{Object.entries(n).filter(([i])=>i!=="relativeTimestamp").forEach(([i,s])=>s&&this.recordGauge({name:i,value:s,attributes:{category:Ce.Performance,group:window.location.href}}))},0),Mg(n=>{this.recordGauge({name:"Jank",value:n.jankAmount,attributes:{category:Ce.WebVital,group:n.querySelector}})},0)),yf(n=>{var o;if(al.includes(n.event)||ll.some(l=>n.event.includes(l)))return;const i=new Error(n.event);i.stack=bt(n.stackTrace.map(l=>l.toString()));let s={};try{n.payload&&(s=JSON.parse(n.payload))}catch(l){}this._recordErrorMessage(B(x({},n),{error:(o=n.error)!=null?o:i}),s)},{enablePromisePatch:!!this._options.enablePromisePatch}),py(n=>{const{name:i,value:s}=n,{hostname:o,pathname:l,href:u}=window.location,a={group:window.location.pathname,category:Ce.WebVital,[er]:Is(u),[ps]:l,[WT]:o};switch(n.name){case"LCP":{const h=n.attribution;h.element&&(a["web_vital.element"]=h.element),h.url&&(a["web_vital.attribution.url"]=Is(h.url));break}case"CLS":{const h=n.attribution;h.largestShiftTarget&&(a["web_vital.element"]=h.largestShiftTarget),h.loadState&&(a["web_vital.load_state"]=h.loadState);break}case"INP":{const h=n.attribution;h.eventTarget&&(a["web_vital.element"]=h.eventTarget),h.eventType&&(a["web_vital.event_type"]=h.eventType),h.loadState&&(a["web_vital.load_state"]=h.loadState);break}case"FID":{const h=n.attribution;h.eventTarget&&(a["web_vital.element"]=h.eventTarget),h.eventType&&(a["web_vital.event_type"]=h.eventType);break}case"FCP":{const h=n.attribution;h.loadState&&(a["web_vital.load_state"]=h.loadState);break}}this.recordGauge({name:i,value:s,attributes:a})}),Uu(n=>{this.submitViewportMetrics(n)}),my(n=>{const i={category:Ce.Performance,group:window.location.href};n.saveData!==void 0&&(i.saveData=n.saveData.toString()),n.effectiveType!==void 0&&(i.effectiveType=n.effectiveType.toString()),n.type!==void 0&&(i.type=n.type.toString()),Object.entries(n).filter(([s])=>s!=="relativeTimestamp").forEach(([s,o])=>{cf(o)&&this.recordGauge({name:s,value:o,attributes:i})})},new Date().getTime());const{getDeviceDetails:t}=by();t&&this.recordGauge({name:Ve.DeviceMemory,value:t().deviceMemory,attributes:{category:Ce.Device,group:window.location.href}}),this._options.enableLongtaskRecording!==!1&&WN(n=>{const i={category:Ce.Performance,name:n.name,[ps]:window.location.pathname};n.containerType&&(i.container_type=n.containerType),n.containerSrc&&(i.container_src=n.containerSrc),n.containerId&&(i.container_id=n.containerId),n.containerName&&(i.container_name=n.containerName),this.recordHistogram({name:"long_task.duration",value:n.duration,attributes:i})}),this._options.enableReportingObserver!==!1&&DN(n=>{var s;const i=B(x({},n.attributes),{[ps]:window.location.pathname});if(n.kind==="log")this._recordLog(n.message,(s=n.level)!=null?s:"warn",i);else{const o=new Error(n.message);this.recordError(o,void 0,Object.fromEntries(Object.entries(i).map(([l,u])=>[l,u===void 0?"":String(u)])),"reporting-observer","custom")}})}recordLog(t,r,n){return this._recordLog(t,r,n)}}ii=new WeakMap;function Uy(e,t,r){if(typeof r=="function")return r;if(typeof t=="function")return t;if(typeof e=="function")return e}class Dy extends Tu{start(){return this._sdk.start()}stop(){return this._sdk.stop()}recordGauge(t){return this._bufferCall("recordGauge",[t])}recordCount(t){return this._bufferCall("recordCount",[t])}recordIncr(t){return this._bufferCall("recordIncr",[t])}recordHistogram(t){return this._bufferCall("recordHistogram",[t])}recordUpDownCounter(t){return this._bufferCall("recordUpDownCounter",[t])}startSpan(t,r,n,i){var s;return this._isLoaded?this._bufferCall("startSpan",[t,r,n,i]):(s=Uy(r,n,i))==null?void 0:s(on())}startManualSpan(t,r,n,i){var s;return this._isLoaded?this._bufferCall("startManualSpan",[t,r,n,i]):(s=Uy(r,n,i))==null?void 0:s(on())}register(t,r){return this._bufferCall("register",[t,r])}recordLog(t,r,n){return this._bufferCall("recordLog",[t,r,n])}recordError(t,r,n,i,s){return this._bufferCall("recordError",[t,r,n,i,s])}setLDContextKeyAttributes(t){return this._bufferCall("setLDContextKeyAttributes",[t])}getLDContextKeyAttributes(){return this._bufferCall("getLDContextKeyAttributes",[])}}A.LDObserve=void 0,typeof globalThis!="undefined"?globalThis.LDObserve?A.LDObserve=globalThis.LDObserve:(A.LDObserve=new Dy,globalThis.LDObserve=A.LDObserve):A.LDObserve=new Dy;const YN=Object.freeze(Object.defineProperty({__proto__:null,get LDObserve(){return A.LDObserve}},Symbol.toStringTag,{value:"Module"}));class Fy{constructor(t){L(this,"sessionSecureID");try{t!=null&&t.storageMode&&Mp(t==null?void 0:t.storageMode),_s(!!(t!=null&&t.sessionCookie)),t!=null&&t.sessionCookie?Up():_s(!1)}catch(r){De("Error initializing @launchdarkly observability plugin","error",r)}}configureSession(t,r){try{const n=Pt();let i=Mt(n);i!=null&&i.sessionSecureID?this.sessionSecureID=i.sessionSecureID:(r!=null&&r.sessionKey?this.sessionSecureID=gt(`${t}-${r.sessionKey}`):this.sessionSecureID=gt(),tr(this.sessionSecureID),dt({sessionSecureID:this.sessionSecureID,sessionKey:r==null?void 0:r.sessionKey,projectID:0,sessionStartTime:Date.now(),lastPushTime:Date.now()}))}catch(n){De("Error configuring session in @launchdarkly observability plugin","error",n)}}}class BN extends Fy{constructor(r){super(r);L(this,"observe");L(this,"options");L(this,"exposureDeduper");this.options=r,this.exposureDeduper=new zE(r==null?void 0:r.flagExposureDedupeWindowMillis,r==null?void 0:r.flagExposureDedupeMaxSize)}initialize(r,n){try{if(typeof window=="undefined"||typeof document=="undefined"){console.warn("@launchdarkly/observability is not initializing because it is not supported in this environment.");return}if(!r){console.warn("@launchdarkly/observability is not initializing because the SDK credential is undefined.");return}this.configureSession(r,n),this.observe=new HN(B(x({},n),{projectId:r,sessionSecureId:this.sessionSecureID})),n!=null&&n.manualStart||this.observe.start(),A.LDObserve.load(this.observe)}catch(i){De("Error initializing @launchdarkly/observability SDK","error",i)}}getMetadata(){return{name:"@launchdarkly/observability"}}register(r,n){var i;(i=this.observe)==null||i.register(r,n)}getHooks(r){var i,s,o,l;const n=x(x({[Ep]:r.sdk.name,[Ip]:r.sdk.version,[ig]:r.clientSideId,[Iu]:"LaunchDarkly"},(i=r.application)!=null&&i.id?{[cg]:r.application.id}:{}),(s=r.application)!=null&&s.version?{[dg]:r.application.version}:{});return this.initialize((l=(o=r.sdkKey)!=null?o:r.mobileKey)!=null?l:r.clientSideId,this.options),[{getMetadata:()=>({name:"@launchdarkly/observability/hooks"}),afterIdentify:(u,a,h)=>{var f,d,p,m,g,v,y,S,_;for(const w of(p=(d=(f=this.observe)==null?void 0:f.getHooks)==null?void 0:d.call(f,r))!=null?p:[])(m=w.afterIdentify)==null||m.call(w,u,a,h);const c=Hn(u.context);if((g=this.observe)==null||g.setLDContextKeyAttributes(c),h.status==="completed"){this.exposureDeduper.reset();const w=B(x({},c),{key:(S=(y=(v=this.options)==null?void 0:v.contextFriendlyName)==null?void 0:y.call(v,u.context))!=null?S:Ir(u.context),timeout:u.timeout,canonicalKey:Ir(u.context),[rx]:h.status});(_=this.observe)==null||_.recordLog("LD.identify","info",x(x({},n),w))}return a},afterEvaluation:(u,a,h)=>{var m,g,v,y,S,_,w,b,R;for(const E of(v=(g=(m=this.observe)==null?void 0:m.getHooks)==null?void 0:g.call(m,r))!=null?v:[])(y=E.afterEvaluation)==null||y.call(E,u,a,h);const c=x({[sg]:u.flagKey,[lg]:JSON.stringify(h.value)},h.variationIndex!==void 0&&h.variationIndex!==null?{[ug]:h.variationIndex}:{});if(h.reason)for(const E in Ps){const I=E,C=h.reason[I];C!=null&&(c[Ps[I]]=C)}const f=u.context?Ir(u.context):void 0;u.context&&(c[og]=JSON.stringify(Hn(u.context)),c[ag]=f);const d=[u.flagKey,JSON.stringify(h.value),(S=h.variationIndex)!=null?S:"",(w=(_=h.reason)==null?void 0:_.kind)!=null?w:"",(R=(b=h.reason)==null?void 0:b.ruleId)!=null?R:"",f!=null?f:""].join("|");if(!this.observe||!this.exposureDeduper.shouldRecord(d))return a;const p=x(x({},n),c);return this.observe.startSpan(Eu,E=>{E!=null&&E.isRecording()&&(E.addEvent(Je,p),this.exposureDeduper.markRecorded(d))}),a},afterTrack:u=>{var c,f,d,p,m,g,v,y,S;for(const _ of(d=(f=(c=this.observe)==null?void 0:c.getHooks)==null?void 0:f.call(c,r))!=null?d:[])(p=_.afterTrack)==null||p.call(_,u);if(!(((m=this.options)==null?void 0:m.productAnalytics)!==!1&&(typeof((g=this.options)==null?void 0:g.productAnalytics)!="object"||this.options.productAnalytics.trackEvents!==!1)))return;const h=x(B(x(x({[er]:window.location.href},(y=(v=this.observe)==null?void 0:v.getLDContextKeyAttributes())!=null?y:{}),n),{key:u.key,value:u.metricValue}),typeof u.data=="object"?u.data:{});(S=this.observe)==null||S.startSpan(qL,_=>{_&&_.setAttributes(h)})}}]}}class zN{constructor(t){L(this,"options");L(this,"isRunningOnHighlight");L(this,"organizationID");oo(this,si);L(this,"events");L(this,"sessionData");L(this,"ready");L(this,"manualStopped");L(this,"state");L(this,"logger");L(this,"enableSegmentIntegration");L(this,"privacySetting");L(this,"enableCanvasRecording");L(this,"samplingStrategy");L(this,"inlineImages");L(this,"inlineVideos");L(this,"inlineStylesheet");L(this,"styleSheetResyncInterval");L(this,"debugOptions");L(this,"listeners");L(this,"firstloadVersion");L(this,"environment");L(this,"sessionShortcut");L(this,"appVersion");L(this,"serviceName");L(this,"_worker");L(this,"_optionsInternal");L(this,"_backendUrl");L(this,"_recordingStartTime");L(this,"_isOnLocalHost");L(this,"_onToggleFeedbackFormVisibility");L(this,"_isCrossOriginIframe");L(this,"_eventBytesSinceSnapshot");L(this,"_lastSnapshotTime");L(this,"_lastVisibilityChangeTime");L(this,"pushPayloadTimerId");L(this,"hasSessionUnloaded");L(this,"hasPushedData");L(this,"reloaded");L(this,"_hasPreviouslyInitialized");L(this,"_recordStop");L(this,"_integrations",[]);var n,i,s,o,l;this.options=t,typeof((n=this.options)==null?void 0:n.debug)=="boolean"?this.debugOptions=this.options.debug?{clientInteractions:!0}:{}:this.debugOptions=(s=(i=this.options)==null?void 0:i.debug)!=null?s:{},this.logger=new _u(this.debugOptions.clientInteractions),this._worker=new Vy,this._worker.onmessage=u=>{var a,h,c;((a=u.data.response)==null?void 0:a.type)===Pe.AsyncEvents?(this._eventBytesSinceSnapshot+=u.data.response.eventsSize,this.logger.log(`Web worker sent payloadID ${u.data.response.id} size ${u.data.response.eventsSize} bytes, compression ratio ${u.data.response.eventsSize/u.data.response.compressedSize}.
|
|
488
|
+
Total since snapshot: ${(this._eventBytesSinceSnapshot/1e6).toFixed(1)}MB`)):((h=u.data.response)==null?void 0:h.type)===Pe.CustomEvent?this.addCustomEvent(u.data.response.tag,u.data.response.payload):((c=u.data.response)==null?void 0:c.type)===Pe.Stop&&(De("worker.onmessage","warn","Stopping recording due to worker failure",u.data.response),this.stop(!1))};let r=Mt();if(this.reloaded=!1,!((o=this.sessionData)!=null&&o.sessionSecureID)&&(r!=null&&r.sessionSecureID))this.sessionData=r,this.options.sessionSecureID=r.sessionSecureID,this.reloaded=!0,this.logger.log(`Tab reloaded, continuing previous session: ${this.sessionData.sessionSecureID}`);else{for(const u of Object.values(Ne))qr(u);this.sessionData={sessionSecureID:this.options.sessionSecureID,projectID:0,sessionStartTime:Date.now()}}this._hasPreviouslyInitialized=!1;try{window.parent.document&&(this._isCrossOriginIframe=!1)}catch(u){this._isCrossOriginIframe=(l=this.options.recordCrossOriginIframe)!=null?l:!0}this._initMembers(this.options)}_reset(n){return $(this,arguments,function*({forceNew:t,sessionKey:r}){this.pushPayloadTimerId&&(clearTimeout(this.pushPayloadTimerId),this.pushPayloadTimerId=void 0);let i,s;if(!t)try{i=Fe(Ne.USER_IDENTIFIER);const o=Fe(Ne.USER_OBJECT);o&&(s=JSON.parse(o))}catch(o){}for(const o of Object.values(Ne))qr(o);this.sessionData.sessionSecureID=r?gt(`${this.organizationID}-${r}`):gt(),this.sessionData.sessionKey=r,this.sessionData.sessionStartTime=Date.now(),this.options.sessionSecureID=this.sessionData.sessionSecureID,this.stop(),this._worker.postMessage({message:{type:Pe.Reset}}),yield this.start(),i&&s&&this.identify(i,s)})}_initMembers(t){var s,o,l,u,a,h,c,f,d,p;this.sessionShortcut=!1,this._recordingStartTime=0,this._isOnLocalHost=window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"||window.location.hostname==="",this.ready=!1,this.state="NotRecording",this.manualStopped=!1,this.enableSegmentIntegration=!!t.enableSegmentIntegration,this.privacySetting=(s=t.privacySetting)!=null?s:"default",this.enableCanvasRecording=(o=t.enableCanvasRecording)!=null?o:!1,this.inlineImages=(l=t.inlineImages)!=null?l:this._isOnLocalHost,this.inlineVideos=(u=t.inlineVideos)!=null?u:this._isOnLocalHost,this.inlineStylesheet=(a=t.inlineStylesheet)!=null?a:this._isOnLocalHost,this.styleSheetResyncInterval=(h=t.styleSheetResyncInterval)!=null?h:2e3,this.samplingStrategy=x({canvasFactor:.5,canvasMaxSnapshotDimension:360,canvasClearWebGLBuffer:!0,dataUrlOptions:uf()},(c=t.samplingStrategy)!=null?c:{canvas:2}),this._backendUrl=(f=t==null?void 0:t.backendUrl)!=null?f:"https://pub.observability.app.launchdarkly.com",this._backendUrl[0]==="/"&&(this._backendUrl=new URL(this._backendUrl,document.baseURI).href);const r=new So(`${this._backendUrl}`,{headers:{}});ao(this,si,qa(r,vu())),this.environment=(d=t.environment)!=null?d:"production",this.appVersion=t.appVersion,this.serviceName=(p=t.serviceName)!=null?p:"browser",typeof t.organizationID=="string"?this.organizationID=t.organizationID:this.organizationID=t.organizationID.toString(),this.isRunningOnHighlight=this.organizationID==="1"||this.organizationID==="1jdkoe52",this.firstloadVersion=t.firstloadVersion||"unknown",this.sessionShortcut=t.sessionShortcut||!1,this._onToggleFeedbackFormVisibility=()=>{};const m=t,{firstloadVersion:n}=m,i=et(m,["firstloadVersion"]);this._optionsInternal=i,this.listeners=[],this.events=[],this.hasSessionUnloaded=!1,this.hasPushedData=!1,window.Intercom&&window.Intercom("onShow",()=>{window.Intercom("update",{highlightSessionURL:this.getCurrentSessionURLWithTimestamp()}),this.addProperties({event:"Intercom onShow"})}),this._eventBytesSinceSnapshot=0,this._lastSnapshotTime=new Date().getTime(),this._lastVisibilityChangeTime=new Date().getTime()}identify(t,r={},n){if(!t||t===""){De("identify","warn","Highlight's identify() call was passed an empty identifier.",{user_identifier:t,user_object:r});return}this.sessionData.userIdentifier=t.toString(),this.sessionData.userObject=r,ct(Ne.USER_IDENTIFIER,t.toString()),ct(Ne.USER_OBJECT,JSON.stringify(r)),this._worker.postMessage({message:{type:Pe.Identify,userIdentifier:t,userObject:r,source:n}})}track(t,r){this.addProperties(B(x({},r),{event:t}))}addProperties(t={},r){const n=x({},t);Object.entries(n).forEach(([i,s])=>{try{structuredClone(s)}catch(o){delete n[i]}}),this._worker.postMessage({message:{type:Pe.Properties,propertiesObject:n,propertyType:r}})}addSessionProperties(t){this.addProperties(t,{type:"session"})}start(t){return $(this,null,function*(){var r,n,i,s,o,l,u,a,h,c;if(!((r=navigator==null?void 0:navigator.userAgent)!=null&&r.includes("Googlebot")||(n=navigator==null?void 0:navigator.userAgent)!=null&&n.includes("AdsBot")))try{if(t!=null&&t.forceNew){yield this._reset(t);return}if(t!=null&&t.sessionKey&&(t==null?void 0:t.sessionKey)!==this.sessionData.sessionKey){yield this._reset(B(x({},t),{forceNew:!0}));return}this.logger.log("Initializing...",t,this.sessionData,this.options),this.sessionData=(i=Mt(this.sessionData.sessionSecureID))!=null?i:this.sessionData,(s=this.sessionData)!=null&&s.sessionStartTime?this._recordingStartTime=(o=this.sessionData)==null?void 0:o.sessionStartTime:(this._recordingStartTime=new Date().getTime(),this.sessionData.sessionStartTime=this._recordingStartTime);let f=Fe(Un.CLIENT_ID);f||(f=gt(),ct(Un.CLIENT_ID,f));let d;this.options.disableSessionRecording||this.options.disableNetworkRecording!==void 0||typeof this.options.networkRecording=="boolean"?d=!1:d=((l=this.options.networkRecording)==null?void 0:l.recordHeadersAndBody)||!1;let p=[];if(typeof this.options.networkRecording=="object"&&((u=this.options.networkRecording.destinationDomains)!=null&&u.length)&&(p=this.options.networkRecording.destinationDomains),this._isCrossOriginIframe)yield this._setupCrossOriginIframe();else{const S=yield so(this,si).initializeSession({organization_verbose_id:this.organizationID,enable_strict_privacy:this.privacySetting==="strict",privacy_setting:this.privacySetting,enable_recording_network_contents:d,clientVersion:this.firstloadVersion,firstloadVersion:this.firstloadVersion,clientConfig:JSON.stringify(this._optionsInternal),environment:this.environment,id:f,appVersion:this.appVersion,serviceName:this.serviceName,session_secure_id:this.sessionData.sessionSecureID,session_key:this.sessionData.sessionKey,client_id:f,network_recording_domains:p,disable_session_recording:this.options.disableSessionRecording});if(S.initializeSession.secure_id!==this.sessionData.sessionSecureID&&this.logger.log(`Unexpected secure id returned by initializeSession: ${S.initializeSession.secure_id}, expected ${this.sessionData.sessionSecureID}`),this.sessionData.sessionSecureID=S.initializeSession.secure_id,this.sessionData.projectID=parseInt(((a=S==null?void 0:S.initializeSession)==null?void 0:a.project_id)||"0"),!this.sessionData.projectID||!this.sessionData.sessionSecureID){console.error("Failed to initialize Highlight; an error occurred on our end.",this.sessionData);return}}tr(""),dt(this.sessionData),this.logger.log(`Loaded Highlight
|
|
489
|
+
Remote: ${this._backendUrl}
|
|
490
|
+
Project ID: ${this.sessionData.projectID}
|
|
491
|
+
SessionSecureID: ${this.sessionData.sessionSecureID}`),this.options.sessionSecureID=this.sessionData.sessionSecureID,this._worker.postMessage({message:{type:Pe.Initialize,sessionSecureID:this.sessionData.sessionSecureID,backend:this._backendUrl,debug:!!this.debugOptions.clientInteractions,recordingStartTime:this._recordingStartTime}});for(const S of this._integrations)S.init(this.sessionData.sessionSecureID);if(this.sessionData.userIdentifier&&this.identify(this.sessionData.userIdentifier,this.sessionData.userObject),this.pushPayloadTimerId&&(clearTimeout(this.pushPayloadTimerId),this.pushPayloadTimerId=void 0),this._isCrossOriginIframe||(this.pushPayloadTimerId=setTimeout(()=>{this._save()},ys)),this.options.disableSessionRecording){this.logger.log("Highlight is NOT RECORDING a session replay per H.init setting."),this.ready=!0,this.state="Recording",this.manualStopped=!1;return}const m=(S,_)=>{_&&this.logger.log("received isCheckout emit",{event:S}),this.events.push(S)};m.bind(this);const g=!!this._recordStop;this._recordStop&&(this._recordStop(),this._recordStop=void 0);const[v,y]=Zg(this.privacySetting,this.options.maskAllInputs,this.options.maskInputOptions);this._recordStop=ot({ignoreClass:(h=this.options.ignoreClass)!=null?h:"highlight-ignore",ignoreSelector:this.options.ignoreSelector,blockClass:(c=this.options.blockClass)!=null?c:"highlight-block",blockSelector:this.options.blockSelector,emit:m,recordCrossOriginIframes:this.options.recordCrossOriginIframe,privacySetting:this.privacySetting,maskAllInputs:v,maskInputOptions:y,maskTextClass:this.options.maskTextClass,maskTextSelector:this.options.maskTextSelector,recordCanvas:this.enableCanvasRecording,sampling:{canvas:{fps:this.samplingStrategy.canvas,fpsManual:this.samplingStrategy.canvasManualSnapshot,resizeFactor:this.samplingStrategy.canvasFactor,clearWebGLBuffer:this.samplingStrategy.canvasClearWebGLBuffer,initialSnapshotDelay:this.samplingStrategy.canvasInitialSnapshotDelay,dataURLOptions:this.samplingStrategy.dataUrlOptions,maxSnapshotDimension:this.samplingStrategy.canvasMaxSnapshotDimension}},keepIframeSrcFn:S=>!this.options.recordCrossOriginIframe,inlineImages:this.inlineImages,inlineVideos:this.inlineVideos,collectFonts:this.inlineImages,inlineStylesheet:this.inlineStylesheet,styleSheetResyncInterval:this.styleSheetResyncInterval,plugins:[Ee()],logger:typeof this.options.debug=="boolean"&&this.options.debug||typeof this.options.debug=="object"&&this.options.debug.domRecording?{debug:this.logger.log,warn:De.bind(null,"RecordSDK","warn")}:void 0}),g||this.options.recordCrossOriginIframe&&this._setupCrossOriginIframeParent(),document.referrer&&(window&&document.referrer.includes(window.location.origin)||(this.addCustomEvent("Referrer",document.referrer),this.addProperties({referrer:document.referrer},{type:"session"}))),this.sessionData.sessionKey&&this.addProperties({sessionKey:this.sessionData.sessionKey},{type:"session"}),this._setupWindowListeners(),this.ready=!0,this.state="Recording",this.manualStopped=!1}catch(f){De("initializeSession _setupWindowListeners","warn",f)}})}_visibilityHandler(t){return $(this,null,function*(){if(this.manualStopped){this.logger.log("Ignoring visibility event due to manual stop.");return}new Date().getTime()-this._lastVisibilityChangeTime<Xp||(this._lastVisibilityChangeTime=new Date().getTime(),this.logger.log(`Detected window ${t?"hidden":"visible"}.`),t?(this.addCustomEvent("TabHidden",!0),this.options.disableBackgroundRecording&&this.stop()):(this.options.disableBackgroundRecording&&(yield this.start()),this.addCustomEvent("TabHidden",!1)))})}_setupCrossOriginIframe(){return $(this,null,function*(){this.logger.log("highlight in cross-origin iframe is waiting "),yield new Promise(t=>{const r=n=>{if(n.data.highlight===qs){const i=n.data;this.logger.log("highlight got window message ",i),this.sessionData.projectID=i.projectID,this.sessionData.sessionSecureID=i.sessionSecureID,window.parent.postMessage({highlight:eo},"*"),window.removeEventListener("message",r),t()}};window.addEventListener("message",r)})})}_setupCrossOriginIframeParent(){this.logger.log("highlight setting up cross origin iframe parent notification"),setInterval(()=>{window.document.querySelectorAll("iframe").forEach(t=>{var r;(r=t.contentWindow)==null||r.postMessage({highlight:qs,projectID:this.sessionData.projectID,sessionSecureID:this.sessionData.sessionSecureID},"*")})},ys),window.addEventListener("message",t=>{t.data.highlight===eo&&this.logger.log("highlight got response from initialized iframe")})}_setupWindowListeners(){var n;try{const i=this;this.enableSegmentIntegration&&this.listeners.push(Fg(o=>{if(o.type==="track"){const l={};l["segment-event"]=o.event,i.addProperties(l,{type:"track",source:"segment"})}else if(o.type==="identify"){const l=o.userId.replace(/^"(.*)"$/,"$1");i.identify(l,o.traits,"segment")}})),this.listeners.push(Cu(o=>{this.reloaded?(this.addCustomEvent("Reload",o),this.reloaded=!1,i.addProperties({reload:!0},{type:"session"})):this.addCustomEvent("Navigate",o)})),this.listeners.push(Uu(o=>{this.addCustomEvent("Viewport",o)})),this.listeners.push(Wg((o,l)=>{let u=null,a=null;if(l&&l.target){const h=l.target;u=Vu(h),a=h.textContent,a&&a.length>2e3&&(a=a.substring(0,2e3))}this.addCustomEvent("Click",{clickTarget:o,clickTextContent:a,clickSelector:u})})),this.listeners.push(Pg(o=>{o&&this.addCustomEvent("Focus",o)})),this.sessionShortcut&&this.listeners.push(Hg(this.sessionShortcut,()=>{window.open(this.getCurrentSessionURLWithTimestamp(),"_blank")})),this._hasPreviouslyInitialized||((n=window.electron)!=null&&n.ipcRenderer?(window.electron.ipcRenderer.on("highlight.run",({visible:o})=>{this._visibilityHandler(!o)}),this.logger.log("Set up Electron highlight.run events.")):(Ag(o=>this._visibilityHandler(o)),this.logger.log("Set up document visibility listener.")),this._hasPreviouslyInitialized=!0);const s=()=>{this.hasSessionUnloaded=!0,this.pushPayloadTimerId&&(clearTimeout(this.pushPayloadTimerId),this.pushPayloadTimerId=void 0)};window.addEventListener("beforeunload",s),this.listeners.push(()=>window.removeEventListener("beforeunload",s))}catch(i){De("initializeSession _setupWindowListeners","warn",i)}const t=()=>{this.addCustomEvent("Page Unload",""),tr(this.sessionData.sessionSecureID),dt(this.sessionData)};if(window.addEventListener("beforeunload",t),this.listeners.push(()=>window.removeEventListener("beforeunload",t)),navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPhone/i)){const i=()=>{this.addCustomEvent("Page Unload",""),tr(this.sessionData.sessionSecureID),dt(this.sessionData)};window.addEventListener("pagehide",i),this.listeners.push(()=>window.removeEventListener("beforeunload",i))}}stop(t){this.manualStopped=!!t,this.manualStopped&&this.addCustomEvent("Stop","H.stop() was called which stops Highlight from recording."),this.state="NotRecording",t&&this._recordStop&&(this._recordStop(),this._recordStop=void 0),this.listeners.forEach(r=>r()),this.listeners=[]}getCurrentSessionURLWithTimestamp(){const t=new Date().getTime(),{projectID:r,sessionSecureID:n}=this.sessionData,i=(t-this._recordingStartTime)/1e3;return`https://${An}/${r}/sessions/${n}?ts=${i}`}getCurrentSessionURL(){const t=this.sessionData.projectID,r=this.sessionData.sessionSecureID;return t&&r?`https://${An}/${t}/sessions/${r}`:null}snapshot(t){return $(this,null,function*(){yield ot.snapshotCanvas(t)})}addSessionFeedback({timestamp:t,verbatim:r,user_email:n,user_name:i}){var s;this._worker.postMessage({message:{type:Pe.Feedback,verbatim:r,timestamp:t,userName:i||this.sessionData.userIdentifier,userEmail:n||((s=this.sessionData.userObject)==null?void 0:s.name)}})}_save(){return $(this,null,function*(){var t;try{this.state==="Recording"&&this.listeners&&!this.sessionData.sessionKey&&this.sessionData.sessionStartTime&&Date.now()-this.sessionData.sessionStartTime>kp&&(this.logger.log("Resetting session",{start:this.sessionData.sessionStartTime}),yield this._reset({}));let r;((t=this.options)==null?void 0:t.sendMode)==="local"&&(r=n=>$(this,null,function*(){let i=new Blob([JSON.stringify({query:po($a),variables:n})],{type:"application/json"});return yield window.fetch(`${this._backendUrl}`,{method:"POST",body:i}),0})),yield this._sendPayload({sendFn:r}),this.hasPushedData=!0,this.sessionData.lastPushTime=Date.now(),dt(this.sessionData)}catch(r){De("_save","warn",r)}this.state==="Recording"&&(this.pushPayloadTimerId&&(clearTimeout(this.pushPayloadTimerId),this.pushPayloadTimerId=void 0),this.pushPayloadTimerId=setTimeout(()=>{this._save()},Vp))})}addCustomEvent(t,r){if(this.state==="NotRecording"){let n;const i=()=>{clearInterval(n),this.state==="Recording"&&this.events.length>0?Hi(t,r):n=setTimeout(i,500)};n=setTimeout(i,500)}else this.state==="Recording"&&(this.events.length>0||this.hasPushedData)&&Hi(t,r)}_sendPayload(r){return $(this,arguments,function*({sendFn:t}){const n=[...this.events],{bytes:i,time:s}=this.enableCanvasRecording?bs.canvas:bs.normal;this._eventBytesSinceSnapshot>=i&&new Date().getTime()-this._lastSnapshotTime>=s&&this.takeFullSnapshot(),this.logger.log(`Sending: ${n.length} events,
|
|
492
|
+
To: ${this._backendUrl}
|
|
493
|
+
Org: ${this.organizationID}
|
|
494
|
+
SessionSecureID: ${this.sessionData.sessionSecureID}`);const o=new Date().getTime(),l=gy();if(t){const u={session_secure_id:this.sessionData.sessionSecureID,payload_id:o.toString(),events:{events:n},messages:bt({messages:[]}),resources:JSON.stringify({resources:[]}),web_socket_events:JSON.stringify({webSocketEvents:[]}),errors:[],is_beacon:!1,has_session_unloaded:this.hasSessionUnloaded,highlight_logs:l||void 0},{compressedBase64:a}=yield Ny(u);yield t({session_secure_id:this.sessionData.sessionSecureID,payload_id:o.toString(),data:a})}else this._worker.postMessage({message:{type:Pe.AsyncEvents,id:o,events:n,messages:[],errors:[],resourcesString:JSON.stringify({resources:[]}),webSocketEventsString:JSON.stringify({webSocketEvents:[]}),hasSessionUnloaded:this.hasSessionUnloaded,highlightLogs:l}});dt(this.sessionData),this.events=this.events.slice(n.length),yy(l)})}takeFullSnapshot(){if(!this._recordStop){this.logger.log("skipping full snapshot as rrweb is not running");return}this.logger.log("taking full snapshot",{bytesSinceSnapshot:this._eventBytesSinceSnapshot,lastSnapshotTime:this._lastSnapshotTime}),ot.takeFullSnapshot(),this._eventBytesSinceSnapshot=0,this._lastSnapshotTime=new Date().getTime()}register(t,r){this._integrations.push(new Ms(t,r))}getHooks(t){return this._integrations.flatMap(r=>{var n,i;return(i=(n=r.getHooks)==null?void 0:n.call(r,t))!=null?i:[]})}getRecordingState(){var t;return(t=this==null?void 0:this.state)!=null?t:"NotRecording"}getSession(){const t=this.sessionData.sessionSecureID,r=Mt(t);if(!r)return null;const n=`${this.getFrontendUrl()}/sessions/${t}`;if(!n||!(r==null?void 0:r.sessionStartTime))return null;const s=new Date().getTime();let o;try{o=new URL(n)}catch(a){return De("identify","warn",`failed to construct session url from ${n}`,a),null}const l=new URL(o),u=(s-this._recordingStartTime)/1e3;return l.searchParams.set("ts",u.toString()),{url:o.toString(),urlWithTimestamp:l.toString(),sessionSecureID:t}}getFrontendUrl(){var r,n;const t=this._backendUrl.match(QE);if(t&&((r=t==null?void 0:t.groups)!=null&&r.domain)){const i=(n=t.groups.domain)!=null?n:"",s=KE[i];return s?`https://${s}${jE}`:Wp}return Wp}}si=new WeakMap;class Jy extends Tu{getSession(){return this._isLoaded?this._bufferCall("getSession",[]):null}start(t){return $(this,null,function*(){return this._sdk.start(t)})}stop(){return this._sdk.stop()}addSessionProperties(t){return this._bufferCall("addSessionProperties",[t])}getRecordingState(){return this._isLoaded?this._bufferCall("getRecordingState",[]):"NotRecording"}snapshot(t){return this._isLoaded?this._bufferCall("snapshot",[t]):Promise.resolve(void 0)}register(t,r){return this._bufferCall("register",[t,r])}}A.LDRecord=void 0,typeof globalThis!="undefined"?globalThis.LDRecord?A.LDRecord=globalThis.LDRecord:(A.LDRecord=new Jy,globalThis.LDRecord=A.LDRecord):A.LDRecord=new Jy;class KN extends Fy{constructor(r){super(r);L(this,"record");L(this,"options");this.options=r}initialize(r,n){var i,s,o,l,u,a,h,c,f;try{if(typeof window=="undefined"||typeof document=="undefined"){console.warn("@launchdarkly/session-replay is not initializing because it is not supported in this environment.");return}if(typeof Worker=="undefined"){console.warn("@launchdarkly/session-replay is not initializing because Worker is not supported.");return}if(!r){console.warn("@launchdarkly/session-replay is not initializing because the SDK credential is undefined.");return}this.configureSession(r,n);const d=B(x({},n),{organizationID:r,firstloadVersion:Lu,environment:(n==null?void 0:n.environment)||"production",appVersion:n==null?void 0:n.version,sessionSecureID:this.sessionSecureID,privacySetting:(i=n==null?void 0:n.privacySetting)!=null?i:"strict"});this.record=new zN(d),n!=null&&n.manualStart||this.record.start(),A.LDRecord.load(this.record),!((o=(s=n==null?void 0:n.integrations)==null?void 0:s.mixpanel)!=null&&o.disabled)&&((u=(l=n==null?void 0:n.integrations)==null?void 0:l.mixpanel)!=null&&u.projectToken)&&Wy(n.integrations.mixpanel),!((h=(a=n==null?void 0:n.integrations)==null?void 0:a.amplitude)!=null&&h.disabled)&&((f=(c=n==null?void 0:n.integrations)==null?void 0:c.amplitude)!=null&&f.apiKey)&&Xy(n.integrations.amplitude)}catch(d){De("Error initializing @launchdarkly/session-replay SDK","error",d)}}getMetadata(){return{name:"@launchdarkly/session-replay"}}register(r,n){var i;(i=this.record)==null||i.register(r,n)}getHooks(r){var i,s,o,l;const n=x(x({[Ep]:r.sdk.name,[Ip]:r.sdk.version,[ig]:r.clientSideId,[Iu]:"LaunchDarkly"},(i=r.application)!=null&&i.id?{[cg]:r.application.id}:{}),(s=r.application)!=null&&s.version?{[dg]:r.application.version}:{});return this.initialize((l=(o=r.sdkKey)!=null?o:r.mobileKey)!=null?l:r.clientSideId,this.options),[{getMetadata:()=>({name:"@launchdarkly/session-replay/hooks"}),afterIdentify:(u,a,h)=>{var c,f,d,p,m,g,v,y;for(const S of(d=(f=(c=this.record)==null?void 0:c.getHooks)==null?void 0:f.call(c,r))!=null?d:[])(p=S.afterIdentify)==null||p.call(S,u,a,h);if(h.status==="completed"){const S=B(x({},Hn(u.context)),{key:(v=(g=(m=this.options)==null?void 0:m.contextFriendlyName)==null?void 0:g.call(m,u.context))!=null?v:Ir(u.context),canonicalKey:Ir(u.context)});(y=this.record)==null||y.identify(S.key,x(x({},n),S),"LaunchDarkly")}return a},afterEvaluation:(u,a,h)=>{var c,f,d,p;for(const m of(d=(f=(c=this.record)==null?void 0:c.getHooks)==null?void 0:f.call(c,r))!=null?d:[])(p=m.afterEvaluation)==null||p.call(m,u,a,h);return a},afterTrack:u=>{var a,h,c,f,d;for(const p of(c=(h=(a=this.record)==null?void 0:a.getHooks)==null?void 0:h.call(a,r))!=null?c:[])(f=p.afterTrack)==null||f.call(p,u);(d=this.record)==null||d.track(u.key,{data:u.data,value:u.metricValue})}}]}}var Hy=(e=>(e.Device="Device",e.WebVital="WebVital",e.Frontend="Frontend",e.Backend="Backend",e))(Hy||{});const je=(e,t)=>{console.warn(`highlight.run warning: (${e}): `,t)},jN=200;let ti=[],ro,te,ri,Yy=[],oc=!1;const ye={options:void 0,init:(e,t)=>{var r,n,i,s,o,l,u,a;try{if(ye.options=t,typeof window=="undefined"||typeof document=="undefined")return;if(!e){console.info("Highlight is not initializing because projectID was passed undefined.");return}t!=null&&t.sessionCookie?Up():_s(!1);const h=Mt();let c=gt();if(t!=null&&t.sessionKey?c=gt(`${e}-${t.sessionKey}`):h!=null&&h.sessionSecureID&&(c=h.sessionSecureID),oc)return{sessionSecureID:c};oc=!0,Py(),Ay();const f=B(x({},t),{organizationID:e,firstloadVersion:Lu,environment:(t==null?void 0:t.environment)||"production",appVersion:t==null?void 0:t.version,sessionSecureID:c});return ri=new Dt(f),t!=null&&t.manualStart||ri.startListening(),te=te!=null?te:new sc(f,ri),t!=null&&t.manualStart||te.initialize(),!((n=(r=t==null?void 0:t.integrations)==null?void 0:r.mixpanel)!=null&&n.disabled)&&((s=(i=t==null?void 0:t.integrations)==null?void 0:i.mixpanel)!=null&&s.projectToken)&&Wy(t.integrations.mixpanel),!((l=(o=t==null?void 0:t.integrations)==null?void 0:o.amplitude)!=null&&l.disabled)&&((a=(u=t==null?void 0:t.integrations)==null?void 0:u.amplitude)!=null&&a.apiKey)&&Xy(t.integrations.amplitude),{sessionSecureID:c}}catch(h){je("init",h)}},snapshot:e=>$(this,null,function*(){try{if(te&&te.ready)return yield te.snapshot(e)}catch(t){je("snapshot",t)}}),addSessionFeedback:({verbatim:e,userName:t,userEmail:r,timestampOverride:n})=>{try{ye.onHighlightReady(()=>te.addSessionFeedback({verbatim:e,timestamp:n||new Date().toISOString(),user_email:r,user_name:t}))}catch(i){je("error",i)}},consumeError:(e,t,r)=>{try{ye.onHighlightReady(()=>te.consumeCustomError(e,t,JSON.stringify(r)))}catch(n){je("error",n)}},consume:(e,t)=>{try{ye.onHighlightReady(()=>te.consumeError(e,t))}catch(r){je("error",r)}},error:(e,t)=>{try{ye.onHighlightReady(()=>te.pushCustomError(e,JSON.stringify(t)))}catch(r){je("error",r)}},track:(e,t={})=>{var r,n,i,s,o,l,u,a,h,c,f;try{ye.onHighlightReady(()=>{te.addProperties(B(x({},t),{event:e})),te.log("H.track","INFO",B(x({},t!=null?t:{}),{event:e}))});const d=te==null?void 0:te.getCurrentSessionURL();(i=(n=(r=ye.options)==null?void 0:r.integrations)==null?void 0:n.mixpanel)!=null&&i.disabled||(s=window.mixpanel)!=null&&s.track&&window.mixpanel.track(e,B(x({},t),{highlightSessionURL:d})),(u=(l=(o=ye.options)==null?void 0:o.integrations)==null?void 0:l.amplitude)!=null&&u.disabled||(a=window.amplitude)!=null&&a.getInstance&&window.amplitude.getInstance().logEvent(e,B(x({},t),{highlightSessionURL:d})),(f=(c=(h=ye.options)==null?void 0:h.integrations)==null?void 0:c.intercom)!=null&&f.disabled||window.Intercom&&window.Intercom("trackEvent",e,t)}catch(d){je("track",d)}},log:(e,t,r)=>{try{ye.onHighlightReady(()=>te.log(e,t,r!=null?r:{}))}catch(n){je("log",n)}},start:e=>{var t;(te==null?void 0:te.state)==="Recording"&&!(e!=null&&e.forceNew)?e!=null&&e.silent||console.warn("Highlight is already recording. Please `H.stop()` the current session before starting a new one."):(((t=te==null?void 0:te._firstLoadListeners)!=null?t:ri).startListening(),ye.onHighlightReady(()=>$(this,null,function*(){yield te.initialize(e)}),{waitForReady:!1}))},stop:e=>{(te==null?void 0:te.state)!=="Recording"?e!=null&&e.silent||console.warn("Highlight is already stopped. Please call `H.start()`."):ye.onHighlightReady(()=>te.stopRecording(!0))},identify:(e,t={},r)=>{var n,i,s,o,l,u,a,h;try{ye.onHighlightReady(()=>te.identify(e,t,r))}catch(c){je("identify",c)}if((s=(i=(n=ye.options)==null?void 0:n.integrations)==null?void 0:i.mixpanel)!=null&&s.disabled||(o=window.mixpanel)!=null&&o.identify&&(window.mixpanel.identify(typeof(t==null?void 0:t.email)=="string"?t==null?void 0:t.email:e),t&&(window.mixpanel.track("identify",t),window.mixpanel.people.set(t))),!((a=(u=(l=ye.options)==null?void 0:l.integrations)==null?void 0:u.amplitude)!=null&&a.disabled)&&(h=window.amplitude)!=null&&h.getInstance&&(window.amplitude.getInstance().setUserId(e),Object.keys(t).length>0)){const c=Object.keys(t).reduce((f,d)=>(f.set(d,t[d]),f),new window.amplitude.Identify);window.amplitude.getInstance().identify(c)}},metrics:e=>{try{for(const t of e)ye.recordMetric(t)}catch(t){je("metrics",t)}},recordMetric:e=>{try{ye.onHighlightReady(()=>{var t;te.recordGauge(B(x({},e),{tags:(t=e.tags)!=null?t:[],group:window.location.href,category:"Frontend"}))})}catch(t){je("recordMetric",t)}},recordCount:e=>{try{ye.onHighlightReady(()=>{te.recordCount(e)})}catch(t){je("recordCount",t)}},recordIncr:e=>{try{ye.onHighlightReady(()=>{te.recordIncr(e)})}catch(t){je("recordIncr",t)}},recordHistogram:e=>{try{ye.onHighlightReady(()=>{te.recordHistogram(e)})}catch(t){je("recordHistogram",t)}},recordUpDownCounter:e=>{try{ye.onHighlightReady(()=>{te.recordUpDownCounter(e)})}catch(t){je("recordUpDownCounter",t)}},startSpan:(e,t,r,n)=>{const i=Fs();if(!i){const o=on();return n===void 0&&r===void 0?t(o):n===void 0?r(o):n(o)}const s=(o,l)=>{const u=l(o);return u instanceof Promise?u.finally(()=>o.end()):(o.end(),u)};return n===void 0&&r===void 0?i.startActiveSpan(e,o=>s(o,t)):n===void 0?i.startActiveSpan(e,t,o=>s(o,r)):i.startActiveSpan(e,t,r,o=>s(o,n))},startManualSpan:(e,t,r,n)=>{const i=Fs();if(!i){const s=on();return n===void 0&&r===void 0?t(s):n===void 0?r(s):n(s)}return n===void 0&&r===void 0?i.startActiveSpan(e,t):n===void 0?i.startActiveSpan(e,t,r):i.startActiveSpan(e,t,r,n)},getSessionURL:()=>new Promise((e,t)=>{ye.onHighlightReady(()=>{const r=te.sessionData.sessionSecureID,n=Mt(r);n?e(`https://${An}/${n.projectID}/sessions/${r}`):t(new Error(`Unable to get session URL: ${r}`))})}),getSessionDetails:()=>new Promise((e,t)=>{ye.onHighlightReady(()=>$(this,null,function*(){try{const r=yield ye.getSessionURL();if(!r)throw new Error("Could not get session URL");const n=te.sessionData.sessionSecureID,i=Mt(n),s=i==null?void 0:i.sessionStartTime;if(!s)throw new Error("Could not get session start timestamp");const o=new Date().getTime(),l=new URL(r),u=new URL(r);u.searchParams.set("ts",((o-s)/1e3).toString()),e({url:l.toString(),urlWithTimestamp:u.toString(),sessionSecureID:n})}catch(r){t(r)}}))}),getRecordingState:()=>{var e;return(e=te==null?void 0:te.state)!=null?e:"NotRecording"},onHighlightReady:(e,t)=>{if(te&&te.ready){e();return}if(ti.push({options:t,func:e}),ro!==void 0)return;const r=()=>{ti=ti.filter(i=>{var s;return!te||((s=i.options)==null?void 0:s.waitForReady)!==!1&&!te.ready?!0:(i.func(),!1)}),ro=void 0,ti.length>0&&(ro=setTimeout(r,jN))};r()},registerLD(e){Yy.length||(ye.onHighlightReady(()=>{te.registerLD(e)}),nx(this,e,ye.options),Yy.push(new Ms(e)))}};typeof window!="undefined"&&(window.H=ye),GN(),Py(),Ay();const QN={reset:()=>{oc=!1,te=void 0,ti=[],ro=void 0,ri=void 0},setHighlightObj:e=>{te=e}};A.GenerateSecureID=gt,A.H=ye,A.HighlightSegmentMiddleware=kN,A.MetricCategory=Hy,A.Observe=BN,A.Record=KN,A.__testing=QN,A.configureElectronHighlight=VN,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
|
|
495
|
+
//# sourceMappingURL=index.umd.js.map
|