1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="dbf698a3-a5ec-c17b-dfab-bc3ba772ccee")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,3139,492366,676098,28792,508460,536497,643717,589863,e=>{"use strict";let t;var r=e.i(914300),n=e.i(524188),i=e.i(163264),o=e.i(60943),a=e.i(886641),s=e.i(859869),u=e.i(827800),l=e.i(477577),c=e.i(782599),d=e.i(280941),f=e.i(52340),h=e.i(237228),p=e.i(352351),v=e.i(260292),g=e.i(810739),m=e.i(693825),y=e.i(719420),b=e.i(490342),_=e.i(1231),w=e.i(52841),S=e.i(451060),k=e.i(36826),E=e.i(303660),O=e.i(964701),x=e.i(416475),T=e.i(410846),C=e.i(334806),P=e.i(566628),A=e.i(742924),I=e.i(693436),R=e.i(226226),D=e.i(691926),N=e.i(306902),M=e.i(837637),j=e.i(971657),L=e.i(272315),F=e.i(161375),q=e.i(320487);class U extends Error{static is(e){return(0,q.isBranded)(e,"UnconventionalError")}constructor(e){super("An error of unexpected shape occurred.",{cause:e}),this.name="UnconventionalError",(0,q.brand)(this),Object.setPrototypeOf(this,U.prototype)}}let V=Symbol();function z(e){return"extensions"in e&&F.CombinedProtocolErrors.is(e.extensions[V])}function B(e){return null!==e&&"object"==typeof e&&"string"==typeof e.message&&"string"==typeof e.name&&("string"==typeof e.stack||void 0===e.stack)?e:"string"==typeof e?Error(e,{cause:e}):new U(e)}e.s(["PROTOCOL_ERRORS_SYMBOL",0,V,"graphQLResultHasProtocolErrors",0,z,"toErrorLike",0,B],492366);let W=new WeakSet;var $=e.i(133160);function Q(e=[]){let t={};return e.forEach(e=>{t[e.name.value]=e}),t}function H(e){return e.definitions.filter(e=>"FragmentDefinition"===e.kind)}var K=e.i(379176);function G(e){return e.alias?e.alias.value:e.name.value}var J=e.i(508288);let Y=new(e.i(397055)).Slot;
2function X(e,t,r){return Y.withValue(!0,()=>{let n=function e(t,r,n,i,o){let{knownChanged:a}=n,u=function(e,t){if(t.has(e))return t.get(e);let r=Array.isArray(e)?[]:{};return t.set(e,r),r}(t,n.mutableTargets);if(Array.isArray(t)){for(let[l,c]of Array.from(t.entries())){if(null===c){u[l]=null;continue}let t=e(c,r,n,i,s.__DEV__?`${o||""}[${l}]`:void 0);a.has(t)&&a.add(u),u[l]=t}return a.has(u)?u:t}for(let l of r.selections){let r;if(i&&a.add(u),l.kind===b.Kind.FIELD){let c=G(l),d=l.selectionSet;if(void 0===(r=u[c]||t[c]))continue;if(d&&null!==r){let u=e(t[c],d,n,i,s.__DEV__?`${o||""}.${c}`:void 0);a.has(u)&&(r=u)}s.__DEV__||(u[c]=r),s.__DEV__&&(i&&"__typename"!==c&&!Object.getOwnPropertyDescriptor(u,c)?.value?Object.defineProperty(u,c,function(e,t,r,n,i){let o=()=>(Y.getValue()||(s.__DEV__&&v.invariant.warn(40,n?`${i} '${n}'`:`anonymous ${i}`,`${r}.${e}`.replace(/^\./,"")),o=()=>t),t);return{get:()=>o(),set(e){o=()=>e},enumerable:!0,configurable:!0}}(c,r,o||"",n.operationName,n.operationType)):(delete u[c],u[c]=r))}if(l.kind===b.Kind.INLINE_FRAGMENT&&(!l.typeCondition||n.cache.fragmentMatches(l,t.__typename))&&(r=e(t,l.selectionSet,n,i,o)),l.kind===b.Kind.FRAGMENT_SPREAD){let i=l.name.value,a=n.fragmentMap[i]||(n.fragmentMap[i]=n.cache.lookupFragment(i));(0,v.invariant)(a,39,i);let u=function(e){let t=e.directives?.find(({name:e})=>"unmask"===e.value);if(!t)return"mask";let r=t.arguments?.find(({name:e})=>"mode"===e.value);return(s.__DEV__&&r&&(r.value.kind===b.Kind.VARIABLE?s.__DEV__&&v.invariant.warn(44):r.value.kind!==b.Kind.STRING?s.__DEV__&&v.invariant.warn(45):"migrate"!==r.value.value&&s.__DEV__&&v.invariant.warn(46,r.value.value)),r&&"value"in r.value&&"migrate"===r.value.value)?"migrate":"unmask"}(l);"mask"!==u&&(r=e(t,a.selectionSet,n,"migrate"===u,o))}a.has(r)&&a.add(u)}return"__typename"in t&&!("__typename"in u)&&(u.__typename=t.__typename),Object.keys(u).length!==Object.keys(t).length&&a.add(u),a.has(u)?u:t}(e,t,r,!1);return Object.isFrozen(e)&&(0,K.maybeDeepFreeze)(n),n})}var Z=e.i(791387),ee=e.i(865439);function et(e){return 7===e||8===e}var er=e.i(828589);let en=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function ei(e){return eo[e.charCodeAt(0)]}let eo=["\\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"],ea={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>es(e.definitions,"\n\n")},OperationDefinition:{leave(e){let t=ed(e.variableDefinitions)?el("(\n",es(e.variableDefinitions,"\n"),"\n)"):el("(",es(e.variableDefinitions,", "),")"),r=el("",e.description,"\n")+es([e.operation,es([e.name,t]),es(e.directives," ")]," ");return("query"===r?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n,description:i})=>el("",i,"\n")+e+": "+t+el(" = ",r)+el(" ",es(n," "))},SelectionSet:{leave:({selections:e})=>eu(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){let o=el("",e,": ")+t,a=o+el("(",es(r,", "),")");return a.length>80&&(a=o+el("(\n",ec(es(r,"\n")),"\n)")),es([a,es(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+el(" ",es(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>es(["...",el("on ",e),es(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i,description:o})=>el("",o,"\n")+`fragment ${e}${el("(",es(r,", "),")")} `+`on ${t} ${el("",es(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e}
2,StringValue:{leave:({value:e,block:t})=>t?(0,er.printBlockString)(e):`"${e.replace(en,ei)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+es(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+es(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+el("(",es(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>el("",e,"\n")+es(["schema",es(t," "),eu(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>el("",e,"\n")+es(["scalar",t,es(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>el("",e,"\n")+es(["type",t,el("implements ",es(r," & ")),es(n," "),eu(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>el("",e,"\n")+t+(ed(r)?el("(\n",ec(es(r,"\n")),"\n)"):el("(",es(r,", "),")"))+": "+n+el(" ",es(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>el("",e,"\n")+es([t+": "+r,el("= ",n),es(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>el("",e,"\n")+es(["interface",t,el("implements ",es(r," & ")),es(n," "),eu(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:n})=>el("",e,"\n")+es(["union",t,es(r," "),el("= ",es(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:n})=>el("",e,"\n")+es(["enum",t,es(r," "),eu(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>el("",e,"\n")+es([t,es(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>el("",e,"\n")+es(["input",t,es(r," "),eu(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,directives:n,repeatable:i,locations:o})=>el("",e,"\n")+"directive @"+t+(ed(r)?el("(\n",ec(es(r,"\n")),"\n)"):el("(",es(r,", "),")"))+el(" ",es(n," "))+(i?" repeatable":"")+" on "+es(o," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>es(["extend schema",es(e," "),eu(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>es(["extend scalar",e,es(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>es(["extend type",e,el("implements ",es(t," & ")),es(r," "),eu(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>es(["extend interface",e,el("implements ",es(t," & ")),es(r," "),eu(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>es(["extend union",e,es(t," "),el("= ",es(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>es(["extend enum",e,es(t," "),eu(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>es(["extend input",e,es(t," "),eu(r)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>es(["extend directive @"+e,es(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>es([e,el(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:r})=>es([e,el(".",t),el("(",r,":)")])},DirectiveCoordinate:{leave:({name:e})=>es(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>es(["@",e,el("(",t,":)")])}};function es(e,t=""){var r;return null!=(r=null==e?void 0:e.filter(e=>e).join(t))?r:""}function eu(e){return el("{\n",ec(es(e,"\n")),"\n}")}function el(e,t,r=""){return null!=t&&""!==t?e+t+r:""}function ec(e){return el(" ",e.replace(/\n/g,"\n "))}function ed(e){var t;return null!=(t=null==e?void 0:e.some(e=>e.includes("\n")))&&t}var ef=e.i(200812),eh=e.i(100);let ep=Object.assign(e=>{let r=t.get(e);!r&&(r=(0,y.visit)(e,ea),t.set(e,r));return r},{reset(){t=new ef.AutoCleanedWeakCache(ee.cacheSizes.print||2e3)}});ep.reset(),s.__DEV__&&(0,eh.registerGlobalCache)("print",()=>t?t.size:0),e.s(["print",0,ep],676098);var ev=e.i(722603);function eg(e,t=()=>void 0){return r=>new _.Observable(n=>{let i=t();return r.subscribe({next(t){let r;try{r=e(t,i)}catch(e){n.error(e)}void 0!==r&&n.next(r)},error(e){n.error(e)},complete(){n.complete()}})})}function em(e,t,r,n){if(r.kind===b.Kind.INT||r.kind===b.Kind.FLOAT)e[t.value]=Number(r.value);else if(r.kind===b.Kind.BOOLEAN||r.kind===b.Kind.STRING)e[t.value]=r.value;else if(r.kind===b.Kind.OBJECT){let i={};r.fields.map(e=>em(i,e.name,e.value,n)),e[t.value]=i}else if(r.kind===b.Kind.VARIABLE){let i=(n||{})[r.name.value];e[t.value]=i}else if(r.kind===b.Kind.LIST)e[t.value]=r.values.map(e=>{let r={};return em(r,t,e,n),r[t.value]});else if(r.kind===b.Kind.ENUM)e[t.value]=r.value;else if(r.kind===b.Kind.NULL)e[t.value]=null;else throw(0,v.newInvariantError)(19,t.value,r.kind)}function ey(e){let t={},r=e&&e.variableDefinitions;
2return r&&r.length&&r.forEach(e=>{e.defaultValue&&em(t,e.variable.name,e.defaultValue)}),t}function eb(e){return!!e.errors?.length}var e_=e.i(604197),ew=e.i(732359),eS=e.i(150455);function ek(e){(0,v.invariant)("Document"===e.kind,6),(0,v.invariant)(e.definitions.length<=1,7);let t=e.definitions[0];return(0,v.invariant)("FragmentDefinition"===t.kind,8),t}let eE=Array.isArray;function eO(e){return Array.isArray(e)&&e.length>0}function ex(e){let t=new Map;return function(r=e){let n=t.get(r);return n||t.set(r,n={variables:new Set,fragmentSpreads:new Set}),n}}function eT(e){let t={data:e.data};return e.error&&(t.error=e.error),t}var eC=e.i(409775),eP=e.i(274466),eA=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return(0,eP.__extends)(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return r.closed||t.next(this._value),r},t.prototype.getValue=function(){var e=this.hasError,t=this.thrownError,r=this._value;if(e)throw t;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(N.Subject);function eI(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{let r=e.name.value;if("function"==typeof t)return t(r);let n=t&&t[r];return(0,v.invariant)(n,9,r),n||null}default:return null}}function eR(e){let t;for(let r of((0,u.checkDocument)(e),e.definitions)){if("OperationDefinition"===r.kind)return r;"FragmentDefinition"!==r.kind||t||(t=r)}if(t)return t;throw(0,v.newInvariantError)(12)}function eD(e){return"Field"===e.kind}function eN({directives:e},t){var r;let n;return!e||!e.length||(n=[],(r=e)&&r.length&&r.forEach(e=>{if(!function({name:{value:e}}){return"skip"===e||"include"===e}(e))return;let t=e.arguments,r=e.name.value;(0,v.invariant)(t&&1===t.length,16,r);let i=t[0];(0,v.invariant)(i.name&&"if"===i.name.value,17,r);let o=i.value;(0,v.invariant)(o&&("Variable"===o.kind||"BooleanValue"===o.kind),18,r),n.push({directive:e,ifArgument:i})}),n).every(({directive:e,ifArgument:r})=>{let n=!1;return"Variable"===r.value.kind?(n=t&&t[r.value.name.value],(0,v.invariant)(void 0!==n,15,e.name.value)):n=r.value.value,"skip"===e.name.value?!n:n})}function eM(e,{data:t,...r},{data:n,...i},o){return(0,$.equal)(r,i)&&function e(t,r,n,i){if(r===n)return!0;let o=new Set;return t.selections.every(t=>{if(o.has(t)||(o.add(t),!eN(t,i.variables)||ej(t)))return!0;if(eD(t)){let o=G(t),a=r&&r[o],s=n&&n[o],u=t.selectionSet;if(!u)return(0,$.equal)(a,s);let l=Array.isArray(a),c=Array.isArray(s);if(l!==c)return!1;if(l&&c){let t=a.length;if(s.length!==t)return!1;for(let r=0;r<t;++r)if(!e(u,a[r],s[r],i))return!1;return!0}return e(u,a,s,i)}{let o=eI(t,i.fragmentMap);if(o)return!!ej(o)||e(o.selectionSet,r,n,i)}})}(eR(e).selectionSet,t,n,{fragmentMap:Q(H(e)),variables:o})}function ej(e){return!!e.directives&&e.directives.some(eL)}function eL(e){return"nonreactive"===e.name.value}function eF(e){let t=(0,Z.getOperationDefinition)(e);return(0,v.invariant)(t&&"query"===t.operation,13),t}var eq=e.i(956071);let{assign:eU,hasOwnProperty:eV}=Object,ez={loading:!0,networkStatus:eC.NetworkStatus.loading,data:void 0,dataState:"empty",partial:!0},eB={loading:!1,networkStatus:eC.NetworkStatus.ready,data:void 0,dataState:"empty",partial:!0};class eW{options;queryName;variablesUnknown=!1;_lastWrite;get query(){return this.lastQuery}get variables(){return this.options.variables}unsubscribeFromCache;input;subject;isTornDown;queryManager;subscriptions=new Set;waitForNetworkResult;lastQuery;linkSubscription;pollingInfo;get networkStatus(){return this.subject.getValue().result.networkStatus}get cache(){return this.queryManager.cache}constructor({queryManager:e,options:t,transformedQuery:r=e.transform(t.query)}){this.queryManager=e,this.waitForNetworkResult="network-only"===t.fetchPolicy,this.isTornDown=!1,this.subscribeToMore=this.subscribeToMore.bind(this),this.maskResult=this.maskResult.bind(this);const{watchQuery:{fetchPolicy:n="cache-first"}={}}=e.defaultOptions,{fetchPolicy:i=n,initialFetchPolicy:o="standby"===i?n:i}=t;t[ev.variablesUnknownSymbol]&&((0,v.invariant)("standby"===i,82),this.variablesUnknown=!0),this.lastQuery=r,this.options={...t,initialFetchPolicy:o,fetchPolicy:i,variables:this.getVariablesWithDefaults(t.variables)},this.initializeObservablesQueue(),this["@@observable"]=()=>this,Symbol.observable&&(this[Symbol.observable]=()=>this);const a=(0,Z.getOperationDefinition)(this.query);this.queryName=a&&a.name&&a.name.value}
2initializeObservablesQueue(){this.subject=new eA({query:this.query,variables:this.variables,result:ez,meta:{}});let e=this.subject.pipe((0,M.tap)({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),eg(({query:e,variables:t,result:r,meta:n},i)=>{let{shouldEmit:o}=n;if(r===ez&&(i.previous=void 0,i.previousVariables=void 0),"standby"===this.options.fetchPolicy||2===o)return;if(1===o)return u();let{previous:a,previousVariables:s}=i;if(a){let n=this.queryManager.getDocumentInfo(e),i=this.queryManager.dataMasking,o=i?n.nonReactiveQuery:e;if((i||n.hasNonreactiveDirective?eM(o,a,r,t):(0,$.equal)(a,r))&&(0,$.equal)(s,t))return}if(!(3===o&&(!this.options.notifyOnNetworkStatusChange||(0,$.equal)(a,r))))return u();function u(){return i.previous=r,i.previousVariables=t,r}},()=>({})));this.pipe=e.pipe.bind(e),this.subscribe=e.subscribe.bind(e),this.input=new N.Subject,this.input.complete=()=>{},this.input.pipe(this.operator).subscribe(this.subject)}subscribe;pipe;[Symbol.observable];"@@observable";getCacheDiff({optimistic:e=!0}={}){return this.cache.diff({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:e})}getInitialResult(e){let t=e||this.options.fetchPolicy;this.queryManager.prioritizeCacheValues&&("network-only"===t||"cache-and-network"===t)&&(t="cache-first");let r=()=>{let e=this.getCacheDiff(),t=this.options.returnPartialData||e.complete?e.result??void 0:void 0;return this.maskResult({data:t,dataState:e.complete?"complete":void 0===t?"empty":"partial",loading:!e.complete,networkStatus:e.complete?eC.NetworkStatus.ready:eC.NetworkStatus.loading,partial:!e.complete})};switch(t){case"cache-only":return{...r(),loading:!1,networkStatus:eC.NetworkStatus.ready};case"cache-first":return r();case"cache-and-network":return{...r(),loading:!0,networkStatus:eC.NetworkStatus.loading};case"standby":return eB;default:return ez}}resubscribeCache(){let{variables:e,fetchPolicy:t}=this.options,r=this.query,n="standby"===t||"no-cache"===t||this.waitForNetworkResult,i=!e$({query:r,variables:e},this.unsubscribeFromCache)&&!this.waitForNetworkResult;if((n||i)&&this.unsubscribeFromCache?.(),n||!i)return;let o={query:r,variables:e,optimistic:!0,watcher:this,callback:e=>{let t=this.queryManager.getDocumentInfo(r);if((t.hasClientExports||t.hasForcedResolvers)&&(o.lastDiff=void 0),o.lastOwnDiff===e)return;let{result:n}=this.subject.getValue();(e.complete||!n.error&&n!==ez&&n!==eB)&&((0,$.equal)(n.data,e.result)||this.scheduleNotify())}},a=this.cache.watch(o);this.unsubscribeFromCache=Object.assign(()=>{this.unsubscribeFromCache=void 0,a()},{query:r,variables:e})}stableLastResult;getCurrentResult(){let{result:e}=this.subject.getValue(),t=e.networkStatus===eC.NetworkStatus.error||this.hasObservers()||"no-cache"===this.options.fetchPolicy?e:this.getInitialResult();return t===ez&&(t=this.getInitialResult()),(0,$.equal)(this.stableLastResult,t)||(this.stableLastResult=t),this.stableLastResult}refetch(e){let{fetchPolicy:t}=this.options,r={pollInterval:0};if("no-cache"===t?r.fetchPolicy="no-cache":r.fetchPolicy="network-only",s.__DEV__&&e&&eV.call(e,"variables")){let t=eF(this.query),r=t.variableDefinitions;r&&r.some(e=>"variables"===e.variable.name.value)||!s.__DEV__||v.invariant.warn(83,e,t.name?.value||t)}return e&&!(0,$.equal)(this.variables,e)&&(r.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...e})),this._lastWrite=void 0,this._reobserve(r,{newNetworkStatus:eC.NetworkStatus.refetch})}fetchMore({query:e,variables:t,context:r,errorPolicy:n,updateQuery:i}){(0,v.invariant)("cache-only"!==this.options.fetchPolicy,84,(0,d.getOperationName)(this.query,"(anonymous)"));let o={...(0,l.compact)(this.options,{errorPolicy:"none"},{query:e,context:r,errorPolicy:n}),variables:e?t:{...this.variables,...t},fetchPolicy:"no-cache",notifyOnNetworkStatusChange:this.options.notifyOnNetworkStatusChange};o.query=this.transformDocument(o.query),this.lastQuery=e?this.transformDocument(this.options.query):o.query;let a=!1,s="no-cache"!==this.options.fetchPolicy;s||(0,v.invariant)(i,85);let{finalize:u,pushNotification:c}=this.pushOperation(eC.NetworkStatus.fetchMore);c({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3});let{promise:f,operator:h}=eQ(),{observable:p}=this.queryManager.fetchObservableWithInfo(o,{networkStatus:eC.NetworkStatus.fetchMore,exposeExtensions:!0}
2),g=p.pipe(h,(0,O.filter)(e=>"N"===e.kind&&"network"===e.source)).subscribe({next:e=>{a=!1;let t=e.value,r=t[ev.extensionsSymbol];if(et(e.value.networkStatus)&&u(),s){let e=this.getCacheDiff();this.cache.batch({update:e=>{i?e.updateQuery({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:!1,extensions:r},e=>i(e,{fetchMoreResult:t.data,variables:o.variables})):e.writeQuery({query:o.query,variables:o.variables,data:t.data,extensions:r})},onWatchUpdated:(r,n)=>{if(r.watcher===this&&!(0,$.equal)(n.result,e.result)){a=!0;let e=this.getCurrentResult();et(t.networkStatus)||c({kind:"N",source:"network",value:{...e,networkStatus:t.networkStatus===eC.NetworkStatus.error?eC.NetworkStatus.ready:t.networkStatus,loading:!1,data:n.result,dataState:"streaming"===t.dataState?"streaming":"complete"}})}}})}else{let e=this.getCurrentResult(),r=i(e.data,{fetchMoreResult:t.data,variables:o.variables});c({kind:"N",value:{...e,networkStatus:eC.NetworkStatus.ready,loading:!1,data:r,dataState:"streaming"===e.dataState?"streaming":"complete"},source:"network"})}}});return(0,eq.preventUnhandledRejection)(f.then(e=>eT(this.maskResult(e))).finally(()=>{if(g.unsubscribe(),u(),s&&!a){let e=this.getCurrentResult();"streaming"===e.dataState?c({kind:"N",source:"network",value:{...e,dataState:"complete",networkStatus:eC.NetworkStatus.ready}}):c({kind:"N",source:"newNetworkStatus",value:{}},{shouldEmit:1})}}))}subscribeToMore(e){let t=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:t=>{let{updateQuery:r,onError:n}=e,{error:i}=t;i?n?n(i):v.invariant.error(86,i):r&&this.updateQuery((e,n)=>r(e,{subscriptionData:t,...n}))}});return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)&&t.unsubscribe()}}applyOptions(e){let t=(0,l.compact)(this.options,e||{});eU(this.options,t),this.updatePolling()}async setVariables(e){return(e=this.getVariablesWithDefaults(e),(0,$.equal)(this.variables,e))?eT(this.getCurrentResult()):(this.options.variables=e,this.hasObservers())?this._reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},{newNetworkStatus:eC.NetworkStatus.setVariables}):eT(this.getCurrentResult())}updateQuery(e){let{queryManager:t}=this,{result:r,complete:n}=this.getCacheDiff({optimistic:!1}),i=e(r,{variables:this.variables,complete:!!n,previousData:r});i&&(this.cache.writeQuery({query:this.options.query,data:i,variables:this.variables}),t.broadcastQueries())}startPolling(e){this.options.pollInterval=e,this.updatePolling()}stopPolling(){this.options.pollInterval=0,this.updatePolling()}applyNextFetchPolicy(e,t){if(t.nextFetchPolicy){let{fetchPolicy:r="cache-first",initialFetchPolicy:n=r}=t;"standby"===r||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy.call(t,r,{reason:e,options:t,observable:this,initialFetchPolicy:n}):"variables-changed"===e?t.fetchPolicy=n:t.fetchPolicy=t.nextFetchPolicy)}return t.fetchPolicy}fetch(e,t,r,n){let i=this.options.fetchPolicy;e.context??={};let o=!1,a=e=>new _.Observable(r=>{try{return e.subscribe({next(e){o=!0,r.next(e)},error:e=>r.error(e),complete:()=>r.complete()})}finally{o||(d.override=t,this.input.next({kind:"N",source:"newNetworkStatus",value:{resetError:!0},query:l,variables:c,meta:{shouldEmit:3,fetchPolicy:i}}))}}),{observable:s,fromLink:u}=this.queryManager.fetchObservableWithInfo(e,{networkStatus:t,query:r,onCacheHit:()=>{o=!0},fetchQueryOperator:a,observableQuery:this}),{query:l,variables:c}=this,d={abort:()=>{h.unsubscribe()},query:l,variables:c};this.activeOperations.add(d);let f=t==eC.NetworkStatus.refetch||t==eC.NetworkStatus.setVariables,h=(s=s.pipe(n,(0,R.share)())).pipe((0,M.tap)({next:e=>{"newNetworkStatus"===e.source||"N"===e.kind&&e.value.loading?d.override=t:delete d.override},finalize:()=>this.activeOperations.delete(d)})).subscribe({next:e=>{let t={};f&&"N"===e.kind&&"loading"in e.value&&!e.value.loading&&(f=!1,t.shouldEmit=1),this.input.next({...e,query:l,variables:c,meta:t})}});return{fromLink:u,subscription:h,observable:s}}didWarnCacheOnlyPolling=!1;updatePolling(){if(this.queryManager.ssrMode)return;let{pollingInfo:e,options:{fetchPolicy:t,pollInterval:r}}=this,n=()=>{let{options:e}=this;
2return!e.pollInterval||!this.hasObservers()||"cache-only"===e.fetchPolicy||"standby"===e.fetchPolicy};if(n()){s.__DEV__&&!this.didWarnCacheOnlyPolling&&r&&"cache-only"===t&&(s.__DEV__&&v.invariant.warn(87,(0,d.getOperationName)(this.query,"(anonymous)")),this.didWarnCacheOnlyPolling=!0),this.cancelPolling();return}if(e?.interval===r)return;(e||(this.pollingInfo={})).interval=r;let i=()=>{if(n())return this.cancelPolling();this.pollingInfo&&(!et(this.networkStatus)||this.options.skipPollAttempt?.()?o():this._reobserve({fetchPolicy:"no-cache"===this.options.initialFetchPolicy?"no-cache":"network-only"},{newNetworkStatus:eC.NetworkStatus.poll}).then(o,o))},o=()=>{let e=this.pollingInfo;e&&(clearTimeout(e.timeout),e.timeout=setTimeout(i,e.interval))};o()}cancelPolling(){this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),delete this.pollingInfo)}reobserve(e){return this._reobserve(e)}_reobserve(e,t){this.isTornDown=!1;let{newNetworkStatus:r}=t||{};this.queryManager.obsQueries.add(this);let n=r===eC.NetworkStatus.refetch||r===eC.NetworkStatus.poll,i=this.variables,o=this.options.fetchPolicy,a=(0,l.compact)(this.options,e||{});this.variablesUnknown&&="standby"===a.fetchPolicy;let s=n?a:eU(this.options,a),u=this.transformDocument(s.query);this.lastQuery=u,e&&"variables"in e&&(s.variables=this.getVariablesWithDefaults(e.variables)),!n&&(this.updatePolling(),e&&e.variables&&!(0,$.equal)(e.variables,i)&&"standby"!==s.fetchPolicy&&(s.fetchPolicy===o||"function"==typeof s.nextFetchPolicy)&&(this.applyNextFetchPolicy("variables-changed",s),void 0===r&&(r=eC.NetworkStatus.setVariables)));let c=this.networkStatus;r||(r=eC.NetworkStatus.loading,c!==eC.NetworkStatus.loading&&e?.variables&&!(0,$.equal)(e.variables,i)&&(r=eC.NetworkStatus.setVariables),"standby"===s.fetchPolicy&&(r=eC.NetworkStatus.ready)),"standby"===s.fetchPolicy&&this.cancelPolling(),this.resubscribeCache();let{promise:d,operator:f}=eQ("standby"===s.fetchPolicy?{data:void 0}:void 0),{subscription:h,observable:p,fromLink:v}=this.fetch(s,r,u,f);n||!v&&this.linkSubscription||(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=h);let g=Object.assign((0,eq.preventUnhandledRejection)(d.then(e=>eT(this.maskResult(e))).finally(()=>{this.hasObservers()||0!==this.activeOperations.size||this.tearDownQuery()})),{retain:()=>{let e=p.subscribe({}),t=()=>e.unsubscribe();return d.then(t,t),g}});return g}hasObservers(){return this.subject.observed}stop(){this.subject.complete(),this.initializeObservablesQueue(),this.tearDownQuery()}tearDownQuery(){this.isTornDown||(this.resetNotifications(),this.unsubscribeFromCache?.(),this.linkSubscription&&(this.linkSubscription.unsubscribe(),delete this.linkSubscription),this.stopPolling(),this.subscriptions.forEach(e=>e.unsubscribe()),this.subscriptions.clear(),this.queryManager.obsQueries.delete(this),this.isTornDown=!0,this.abortActiveOperations(),this._lastWrite=void 0)}transformDocument(e){return this.queryManager.transform(e)}maskResult(e){let t=this.queryManager.maskOperation({document:this.query,data:e.data,fetchPolicy:this.options.fetchPolicy,cause:this});return t===e.data?e:{...e,data:t}}dirty=!1;notifyTimeout;resetNotifications(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0),this.dirty=!1}scheduleNotify(){!this.dirty&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(()=>this.notify(!0),0)))}notify(e=!1){if(!e){let e=this.queryManager.getDocumentInfo(this.query);if(e.hasClientExports||e.hasForcedResolvers)return}let{dirty:t}=this;if(this.resetNotifications(),t&&("cache-only"===this.options.fetchPolicy||"cache-and-network"===this.options.fetchPolicy||!this.activeOperations.size)){let e=this.getCacheDiff();(0,$.equal)(e.result,this.getCacheDiff({optimistic:!1}).result)?this.reobserveCacheFirst():this.input.next({kind:"N",value:{data:e.result,dataState:e.complete?"complete":e.result?"partial":"empty",networkStatus:eC.NetworkStatus.ready,loading:!1,error:void 0,partial:!e.complete},source:"cache",query:this.query,variables:this.variables,meta:{}})}}activeOperations=new Set;pushOperation(e){let t=!1,{query:r,variables:n}=this,i=()=>{this.activeOperations.delete(o)},o={override:e,abort:()=>{t=!0,i()},query:r,variables:n};return this.activeOperations.add(o),{finalize:i,pushNotification:(e,i)=>{t||this.input.next({...e,query:r,variables:n,meta:{...i}})}}}calculateNetworkStatus(e){if(e===eC.NetworkStatus.streaming)return e;let t=Array.from(this.activeOperations.values()).reverse().find(e=>e$(e,this)&&void 0!==e.override);return t?.override??e}
2abortActiveOperations(){this.activeOperations.forEach(e=>e.abort())}reset(){let e="cache-only"===this.options.fetchPolicy;this.setResult(e?eB:ez,{shouldEmit:e?1:2}),this.abortActiveOperations()}setResult(e,t){this.input.next({source:"setResult",kind:"N",value:e,query:this.query,variables:this.variables,meta:{...t}})}operator=eg(e=>{let t,{query:r,meta:n}=e;if("setResult"===e.source)return{query:r,variables:this.variables,result:e.value,meta:n};if("C"===e.kind)return;let i="resolvedVariables"in e?e.resolvedVariables:void 0;if(e.query!==this.query)return;if(!(0,$.equal)(i,this.variables)){if(!(0,$.equal)(e.variables,this.variables))return;i&&(this.options.variables=i,this.resubscribeCache())}let o=this.variables,a=this.subject.getValue();if("cache"===e.source){if((t=e.value).networkStatus===eC.NetworkStatus.ready&&t.partial&&(!this.options.returnPartialData||a.result.networkStatus===eC.NetworkStatus.error)&&"cache-only"!==this.options.fetchPolicy)return}else if("network"===e.source)this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),t="E"===e.kind?{...e$(a,e)||i&&(0,$.equal)(i,a.variables)?a.result:{data:void 0,dataState:"empty",partial:!0},error:e.error,networkStatus:eC.NetworkStatus.error,loading:!1}:e.value,"E"===e.kind&&"streaming"===t.dataState&&(t.dataState="complete"),t.error&&(n.shouldEmit=1);else if("newNetworkStatus"===e.source){let r=e$(a,e)?a.result:this.getInitialResult(n.fetchPolicy),{resetError:i}=e.value,o=i?void 0:r.error,s=o?eC.NetworkStatus.error:eC.NetworkStatus.ready;t={...r,error:o,networkStatus:s}}return(0,v.invariant)(t),t.error||delete t.error,t.networkStatus=this.calculateNetworkStatus(t.networkStatus),t.loading=!et(t.networkStatus),t=this.maskResult(t),void 0!==a.result.data&&t.data!==a.result.data&&(0,$.equal)(t.data,a.result.data)&&(t.data=a.result.data),{query:r,variables:o,result:t,meta:n}});reobserveCacheFirst(){let{fetchPolicy:e,nextFetchPolicy:t}=this.options;"cache-and-network"===e||"network-only"===e?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy(r,n){return(this.nextFetchPolicy=t,"function"==typeof this.nextFetchPolicy)?this.nextFetchPolicy(r,n):e}}):this.reobserve()}getVariablesWithDefaults(e){return this.queryManager.getVariables(this.query,e)}}function e$(e,t){return!!(e&&t&&e.query===t.query&&(0,$.equal)(e.variables,t.variables))}function eQ(e){let t=e,r,n;return{promise:new Promise((e,t)=>{r=e,n=t}),operator:(0,M.tap)({next(e){if("E"===e.kind)return n(e.error);"N"!==e.kind||"newNetworkStatus"===e.source||e.value.loading||(t=e.value)},finalize:()=>{if(t)r(t);else{let e="The operation was aborted.",t="AbortError";n("u">typeof DOMException?new DOMException(e,t):Object.assign(Error(e),{name:t}))}}})}}let eH={},eK=new WeakMap;function eG(e,t){let r=e[t];"function"==typeof r&&(e[t]=function(){return eK.set(e,(eK.get(e)+1)%1e15),r.apply(this,arguments)})}let eJ=new WeakMap;class eY{cache;queryManager;id;observableQuery;incremental;constructor(e,t){const r=this.cache=e.cache,n=(eJ.get(e)||0)+1;eJ.set(e,n),this.id=n+"",this.observableQuery=t,this.queryManager=e,eK.has(r)||(eK.set(r,0),eG(r,"evict"),eG(r,"modify"),eG(r,"reset"))}_lastWrite;get lastWrite(){return(this.observableQuery||this)._lastWrite}set lastWrite(e){(this.observableQuery||this)._lastWrite=e}resetLastWrite(){this.lastWrite=void 0}shouldWrite(e,t){let{lastWrite:r}=this;return!(r&&r.dmCount===eK.get(this.cache)&&(0,$.equal)(t,r.variables)&&(0,$.equal)(e.data,r.result.data)&&e.extensions?.[ev.streamInfoSymbol]===r.result.extensions?.[ev.streamInfoSymbol])}get hasNext(){return!!this.incremental&&this.incremental.hasNext}maybeHandleIncrementalResult(e,t,r){let{incrementalHandler:n}=this.queryManager;return n.isIncrementalResult(t)?(this.incremental||=n.startRequest({query:r}),this.incremental.handle(e,t)):t}markQueryResult(e,{document:t,variables:r,errorPolicy:n,cacheWriteBehavior:i}){let o={query:t,variables:r,returnPartialData:!0,optimistic:!0};this.observableQuery?.resetNotifications();let a=0===i,u=a?void 0:this.cache.diff(o),l=this.maybeHandleIncrementalResult(u?.result,e,t);if(a)return l;if(eX(l,n)){let e=!1;this.cache.batch({onWatchUpdated:(e,t)=>{e.watcher===this.observableQuery&&(e.lastOwnDiff=t)}
2,update:n=>{var a,c,f;if(this.shouldWrite(l,r))n.writeQuery({query:t,data:l.data,variables:r,overwrite:1===i,extensions:l.extensions}),e=!0,this.lastWrite={result:l,variables:r,dmCount:eK.get(this.cache)};else if(u&&u.complete){l={...l,data:u.result};return}let h=n.diff(o);h.complete?l={...l,data:h.result}:s.__DEV__&&e&&!this.hasNext&&(a=t,c=l.data,f=h,s.__DEV__&&v.invariant.warn(89,(0,d.getOperationName)(a,"(anonymous)"),f.missing?.missing,c,f.result))}})}else this.lastWrite=void 0;return l}markMutationResult(e,t,r=this.cache){let n=[],i=0===t.cacheWriteBehavior,o=this.maybeHandleIncrementalResult(i?void 0:r.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}).result,e,t.document);if("ignore"===t.errorPolicy&&(o={...o,errors:[]}),eb(o)&&"none"===t.errorPolicy)return Promise.resolve(o);let a=()=>({...o,dataState:this.hasNext?"streaming":"complete"});if(!i&&eX(o,t.errorPolicy)){n.push({result:o.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables,extensions:o.extensions});let{updateQueries:e}=t;e&&this.queryManager.getObservableQueries("all").forEach(t=>{let r=t&&t.queryName;if(!r||!Object.hasOwnProperty.call(e,r))return;let i=e[r],{query:o,variables:s}=t,{result:u,complete:l}=t.getCacheDiff({optimistic:!1});if(l&&u){let e=i(u,{mutationResult:a(),queryName:o&&(0,d.getOperationName)(o)||void 0,queryVariables:s});e&&n.push({result:e,dataId:"ROOT_QUERY",query:o,variables:s})}})}let s=t.refetchQueries;if("function"==typeof s&&(s=s(a())),n.length>0||(s||"").length>0||t.update||t.onQueryUpdated||t.removeOptimistic){let e=[];
2if(this.queryManager.refetchQueries({updateCache:e=>{i||n.forEach(t=>e.write(t));let{update:r}=t;if(r){if(!i){let r=e.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});r.complete&&(o={...o,data:r.result})}this.hasNext||r(e,o,{context:t.context,variables:t.variables})}i||t.keepRootFields||this.hasNext||e.modify({id:"ROOT_MUTATION",fields:(e,{fieldName:t,DELETE:r})=>"__typename"===t?e:r})},include:s,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(t=>e.push(t)),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(e).then(()=>o)}return Promise.resolve(o)}markMutationOptimistic(e,t){let r="function"==typeof e?e(t.variables,{IGNORE:eH}):e;return r!==eH&&(this.cache.recordOptimisticTransaction(e=>{try{this.markMutationResult({data:r},t,e)}catch(e){v.invariant.error(e)}},this.id),!0)}markSubscriptionResult(e,{document:t,variables:r,errorPolicy:n,cacheWriteBehavior:i}){0!==i&&(eX(e,n)&&this.cache.write({query:t,result:e.data,dataId:"ROOT_SUBSCRIPTION",variables:r,extensions:e.extensions}),this.queryManager.broadcastQueries())}}function eX(e,t="none"){let r=!eb(e);return!r&&("ignore"===t||"all"===t)&&e.data&&(r=!0),r}class eZ{defaultOptions;client;clientOptions;assumeImmutableResults;documentTransform;ssrMode;defaultContext;dataMasking;incrementalHandler;localState;queryDeduplication;prioritizeCacheValues=!1;onBroadcast;mutationStore;obsQueries=new Set;fetchCancelFns=new Map;constructor(e){const t=new a.DocumentTransform(e=>this.cache.transformDocument(e),{cache:!1});this.client=e.client,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientOptions=e.clientOptions,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults,this.dataMasking=e.dataMasking,this.localState=e.localState,this.incrementalHandler=e.incrementalHandler;const r=e.documentTransform;this.documentTransform=r?t.concat(r).concat(t):t,this.defaultContext=e.defaultContext||{},(this.onBroadcast=e.onBroadcast)&&(this.mutationStore={})}get link(){return this.client.link}get cache(){return this.client.cache}stop(){this.obsQueries.forEach(e=>e.stop()),this.cancelPendingFetches((0,v.newInvariantError)(90))}cancelPendingFetches(e){this.fetchCancelFns.forEach(t=>t(e)),this.fetchCancelFns.clear()}async mutate({mutation:e,variables:t,optimisticResponse:r,updateQueries:i,refetchQueries:o=[],awaitRefetchQueries:a=!1,update:u,onQueryUpdated:l,fetchPolicy:c,errorPolicy:f,keepRootFields:h,context:p}){let g=new eY(this);e=this.cache.transformForLink(this.transform(e));let{hasClientExports:m}=this.getDocumentInfo(e);t=this.getVariables(e,t),m&&(s.__DEV__&&(0,v.invariant)(this.localState,91,(0,d.getOperationName)(e,"(anonymous)")),t=await this.localState.getExportedVariables({client:this.client,document:e,variables:t,context:p}));let y=this.mutationStore&&(this.mutationStore[g.id]={mutation:e,variables:t,loading:!0,error:null}),b=r&&g.markMutationOptimistic(r,{document:e,variables:t,cacheWriteBehavior:2*("no-cache"!==c),errorPolicy:f,context:p,updateQueries:i,update:u,keepRootFields:h});return this.broadcastQueries(),new Promise((s,d)=>{let v={};return this.getObservableFromLink(e,{...p,optimisticResponse:b?r:void 0},t,c,{},!1).observable.pipe(e0(),(0,A.mergeMap)(r=>{let n={...r};return(0,T.from)(g.markMutationResult(n,{document:e,variables:t,cacheWriteBehavior:2*("no-cache"!==c),errorPolicy:f,context:p,update:u,updateQueries:i,awaitRefetchQueries:a,refetchQueries:o,removeOptimistic:b?g.id:void 0,onQueryUpdated:l,keepRootFields:h}))})).pipe((0,n.map)(e=>{if(eb(e)&&"none"===f)throw new L.CombinedGraphQLErrors(e1(e));return y&&(y.loading=!1,y.error=null),e})).subscribe({next:t=>{if(this.broadcastQueries(),!g.hasNext){let r={data:this.maskOperation({document:e,data:t.data,fetchPolicy:c,cause:v})};eb(t)&&(r.error=new L.CombinedGraphQLErrors(t)),Object.keys(t.extensions||{}).length&&(r.extensions=t.extensions),s(r)}},error:e=>(y&&(y.loading=!1,y.error=e),b&&this.cache.removeOptimistic(g.id),this.broadcastQueries(),"ignore"===f)?s({data:void 0}):"all"===f?s({data:void 0,error:e}):void d(e)})})}fetchQuery(e,t){return(0,u.checkDocument)(e.query,r.OperationTypeNode.QUERY),(async()=>
2(0,C.lastValueFrom)(this.fetchObservableWithInfo(e,{networkStatus:t}).observable.pipe(eg(e=>{switch(e.kind){case"E":throw e.error;case"N":if("newNetworkStatus"!==e.source)return eT(e.value)}})),{defaultValue:{data:void 0}}))()}transform(e){return this.documentTransform.transformDocument(e)}transformCache=new ef.AutoCleanedWeakCache(ee.cacheSizes["queryManager.getDocumentInfo"]||2e3);getDocumentInfo(e){let{transformCache:t}=this;if(!t.has(e)){var r;let n,i=(0,Z.getOperationDefinition)(e),o={hasClientExports:(0,e_.hasDirectives)(["client","export"],e,!0),hasForcedResolvers:(n=!1,(0,y.visit)(e,{Directive:{enter(e){if("client"===e.name.value&&e.arguments&&(n=e.arguments.some(e=>"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value)))return y.BREAK}}}),n),hasNonreactiveDirective:(0,e_.hasDirectives)(["nonreactive"],e),hasIncrementalDirective:(0,e_.hasDirectives)(["defer"],e),nonReactiveQuery:(r=e,(0,y.visit)(r,{FragmentSpread:e=>{if(!e.directives?.some(e=>"unmask"===e.name.value))return{...e,directives:[...e.directives||[],{kind:b.Kind.DIRECTIVE,name:{kind:b.Kind.NAME,value:"nonreactive"}}
2]}}})),clientQuery:(0,e_.hasDirectives)(["client"],e)?e:null,serverQuery:function(e,t){var r,n;let i,o;(0,u.checkDocument)(t);let a=ex(""),s=ex(""),l=e=>{for(let t=0,r;t<e.length&&(r=e[t]);++t)if(!eE(r)){if(r.kind===b.Kind.OPERATION_DEFINITION)return a(r.name&&r.name.value);if(r.kind===b.Kind.FRAGMENT_DEFINITION)return s(r.name.value)}return v.invariant.error(14),null},c=0;for(let e=t.definitions.length-1;e>=0;--e)t.definitions[e].kind===b.Kind.OPERATION_DEFINITION&&++c;let d=(r=e,i=new Map,o=new Map,r.forEach(e=>{e&&(e.name?i.set(e.name,e):e.test&&o.set(e.test,e))}),e=>{let t=i.get(e.name.value);return!t&&o.size&&o.forEach((r,n)=>{n(e)&&(t=r)}),t}),f=e=>eO(e)&&e.map(d).some(e=>e&&e.remove),h=new Map,p=!1,g={enter(e){if(f(e.directives))return p=!0,null}},m=(0,y.visit)(t,{Field:g,InlineFragment:g,VariableDefinition:{enter:()=>!1},Variable:{enter(e,t,r,n,i){let o=l(i);o&&o.variables.add(e.name.value)}},FragmentSpread:{enter(e,t,r,n,i){if(f(e.directives))return p=!0,null;let o=l(i);o&&o.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter(e,t,r,n){h.set(JSON.stringify(n),e)},leave:(e,t,r,n)=>e===h.get(JSON.stringify(n))?e:c>0&&e.selectionSet.selections.every(e=>e.kind===b.Kind.FIELD&&"__typename"===e.name.value)?(s(e.name.value).removed=!0,p=!0,null):void 0},Directive:{leave(e){if(d(e))return p=!0,null}}});if(!p)return t;let _=e=>(!e.transitiveVars&&(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach(t=>{_(s(t)).transitiveVars.forEach(t=>{e.transitiveVars.add(t)})})),e),w=new Set;m.definitions.forEach(e=>{e.kind===b.Kind.OPERATION_DEFINITION?_(a(e.name&&e.name.value)).fragmentSpreads.forEach(e=>{w.add(e)}):e.kind!==b.Kind.FRAGMENT_DEFINITION||0!==c||s(e.name.value).removed||w.add(e.name.value)}),w.forEach(e=>{_(s(e)).fragmentSpreads.forEach(e=>{w.add(e)})});let S={enter(e){let t;if(t=e.name.value,!w.has(t)||s(t).removed)return null}};return n=(0,y.visit)(m,{FragmentSpread:S,FragmentDefinition:S,OperationDefinition:{leave(e){if(e.variableDefinitions){let t=_(a(e.name&&e.name.value)).transitiveVars;if(t.size<e.variableDefinitions.length)return{...e,variableDefinitions:e.variableDefinitions.filter(e=>t.has(e.variable.name.value))}}}}}),!function e(t,r){return!t||t.selectionSet.selections.every(t=>t.kind===b.Kind.FRAGMENT_SPREAD&&e(r[t.name.value],r))}((0,Z.getOperationDefinition)(n)||ek(n),Q(H(n)))?n:null}([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),operationType:i?.operation,defaultVars:ey(i),asQuery:{...e,definitions:e.definitions.map(e=>"OperationDefinition"===e.kind&&"query"!==e.operation?{...e,operation:"query"}:e)}};t.set(e,o)}let n=t.get(e);if(n.violation)throw n.violation;return n}getVariables(e,t){let r=this.getDocumentInfo(e).defaultVars,n=Object.entries(t??{}).map(([e,t])=>[e,void 0===t?r[e]:t]);return{...r,...Object.fromEntries(n)}}watchQuery(e){(0,u.checkDocument)(e.query,r.OperationTypeNode.QUERY);let t=this.transform(e.query);return void 0===(e={...e,variables:this.getVariables(t,e.variables)}).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!0),new eW({queryManager:this,options:e,transformedQuery:t})}query(e){let t=this.transform(e.query);return this.fetchQuery({...e,query:t}).then(r=>({...r,data:this.maskOperation({document:t,data:r?.data,fetchPolicy:e.fetchPolicy})}))}clearStore(e={discardWatches:!0}){return this.cancelPendingFetches((0,v.newInvariantError)(92)),this.obsQueries.forEach(e=>{e.reset()}),this.mutationStore&&(this.mutationStore={}),this.cache.reset(e)}getObservableQueries(e="active"){let t=new Set,r=new Map,n=new Map,i=new Set;return Array.isArray(e)&&e.forEach(e=>{if("string"==typeof e)r.set(e,e),n.set(e,!1);else if((0,ew.isNonNullObject)(e)&&"Document"===e.kind&&Array.isArray(e.definitions)){let t=ep(this.transform(e));r.set(t,(0,d.getOperationName)(e)),n.set(t,!1)}else(0,ew.isNonNullObject)(e)&&e.query&&i.add(e)}),this.obsQueries.forEach(r=>{let i=ep(this.transform(r.options.query));if("all"===e)return void t.add(r);let{queryName:o,options:{fetchPolicy:a}}=r;("active"!==e||"standby"!==a)&&("active"===e||o&&n.has(o)||i&&n.has(i))&&(t.add(r),o&&n.set(o,!0),i&&n.set(i,!0))}
2),i.size&&i.forEach(e=>{let r=new eW({queryManager:this,options:{...(0,h.mergeOptions)(this.defaultOptions.watchQuery,e),fetchPolicy:"network-only"}});t.add(r)}),s.__DEV__&&n.size&&n.forEach((e,t)=>{if(!e){let e=r.get(t);e?s.__DEV__&&v.invariant.warn(93,e):s.__DEV__&&v.invariant.warn(94)}}),t}refetchObservableQueries(e=!1){let t=[];return this.getObservableQueries(e?"all":"active").forEach(r=>{let{fetchPolicy:n}=r.options;(e||"standby"!==n)&&"cache-only"!==n&&t.push(r.refetch())}),this.broadcastQueries(),Promise.all(t)}startGraphQLSubscription(e){let t,{query:i,variables:o}=e,{fetchPolicy:a="cache-first",errorPolicy:l="none",context:c={},extensions:f={}}=e;return(0,u.checkDocument)(i,r.OperationTypeNode.SUBSCRIPTION),i=this.transform(i),o=this.getVariables(i,o),s.__DEV__&&(0,v.invariant)(!this.getDocumentInfo(i).hasClientExports||this.localState,95,(0,d.getOperationName)(i,"(anonymous)")),Object.assign((this.getDocumentInfo(i).hasClientExports?(0,T.from)(this.localState.getExportedVariables({client:this.client,document:i,variables:o,context:c})):(0,I.of)(o)).pipe((0,A.mergeMap)(e=>{let{observable:r,restart:o}=this.getObservableFromLink(i,c,e,a,f),s=new eY(this);return t=o,r.pipe((0,n.map)(t=>{s.markSubscriptionResult(t,{document:i,variables:e,errorPolicy:l,cacheWriteBehavior:2*("no-cache"!==a)});let r={data:t.data??void 0};return eb(t)?r.error=new L.CombinedGraphQLErrors(t):z(t)&&(r.error=t.extensions[V],delete t.extensions[V]),t.extensions&&Object.keys(t.extensions).length&&(r.extensions=t.extensions),r.error&&"none"===l&&(r.data=void 0),"ignore"===l&&delete r.error,r}),(0,S.catchError)(e=>"ignore"===l?(0,I.of)({data:void 0}):(0,I.of)({data:void 0,error:e})),(0,O.filter)(e=>!!(e.data||e.error)))})),{restart:()=>t?.()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(e=>e.notify())}inFlightLinkObservables=new m.Trie(!1);getObservableFromLink(e,t,n,i,a,u=t?.queryDeduplication??this.queryDeduplication){let l={},{serverQuery:c,clientQuery:f,operationType:h,hasIncrementalDirective:p}=this.getDocumentInfo(e),g=(0,d.getOperationName)(e),m={client:this.client};if(c){let{inFlightLinkObservables:e,link:i}=this;try{let s=this.incrementalHandler.prepareRequest({query:c,variables:n,context:{...this.defaultContext,...t,queryDeduplication:u},extensions:a});function y(e){return new _.Observable(t=>{function r(){return e.subscribe({next:t.next.bind(t),complete:t.complete.bind(t),error:t.error.bind(t)})}let n=r();return l.restart||=()=>{n.unsubscribe(),n=r()},()=>{n.unsubscribe(),l.restart=void 0}})}if(t=s.context,u){let t=ep(c),a=(0,j.canonicalStringify)(n);(l=e.lookup(t,a)).observable||(l.observable=(0,o.execute)(i,s,m).pipe(y,(0,x.finalize)(()=>{e.peek(t,a)===l&&e.remove(t,a)}),h===r.OperationTypeNode.SUBSCRIPTION?(0,R.share)():(0,D.shareReplay)({refCount:!0})))}else l.observable=(0,o.execute)(i,s,m).pipe(y)}catch(e){l.observable=(0,w.throwError)(()=>e)}}else l.observable=(0,I.of)({data:{}});if(f){let{operation:r}=(0,Z.getOperationDefinition)(e);s.__DEV__&&(0,v.invariant)(this.localState,96,r[0].toUpperCase()+r.slice(1),g??"(anonymous)"),(0,v.invariant)(!p,97,r[0].toUpperCase()+r.slice(1),g??"(anonymous)"),l.observable=l.observable.pipe((0,A.mergeMap)(e=>(0,T.from)(this.localState.execute({client:this.client,document:f,remoteResult:e,context:t,variables:n,fetchPolicy:i}))))}return{restart:()=>l.restart?.(),observable:l.observable.pipe((0,S.catchError)(e=>{var t;throw t=e=B(e),W.add(t),e}))}}getResultsFromLink(e,{queryInfo:t,cacheWriteBehavior:r,observableQuery:i,exposeExtensions:o}){let{errorPolicy:a}=e,s=this.cache.transformForLink(e.query);return this.getObservableFromLink(s,e.context,e.variables,e.fetchPolicy).observable.pipe((0,n.map)(n=>{let u=t.markQueryResult(n,{...e,document:s,cacheWriteBehavior:r}),l=eb(u);if(l&&"none"===a)throw t.resetLastWrite(),i?.resetNotifications(),new L.CombinedGraphQLErrors(e1(u));let c={data:u.data,...t.hasNext?{loading:!0,networkStatus:eC.NetworkStatus.streaming,dataState:"streaming",partial:!0}:{dataState:u.data?"complete":"empty",loading:!1,networkStatus:eC.NetworkStatus.ready,partial:!u.data}};return o&&"extensions"in u&&(c[ev.extensionsSymbol]=u.extensions),l&&("none"===a&&(c.data=void 0,c.dataState="empty"),"ignore"!==a&&(c.error=new L.CombinedGraphQLErrors(e1(u)),"streaming"!==c.dataState&&(c.networkStatus=eC.NetworkStatus.error))),c}),(0,S.catchError)(e=>{if("none"===a)throw t.resetLastWrite(),i?.resetNotifications(),e;let r={data:void 0,dataState:"empty",loading:!1,networkStatus:eC.NetworkStatus.ready,partial:!0};return"ignore"!==a&&(r.error=e,r.networkStatus=eC.NetworkStatus.error),(0,I.of)(r)}))}fetchObservableWithInfo(e,{networkStatus:t=eC.NetworkStatus.loading,query:r=e.query,fetchQueryOperator:n=e=>e,onCacheHit:i=()=>{},observableQuery:o,exposeExtensions:a}){let u,l,c=this.getVariables(r,e.variables),{fetchPolicy:f="cache-first",errorPolicy:h="none",returnPartialData:p=!1,notifyOnNetworkStatusChange:g=!0,context:m={}}=e;this.prioritizeCacheValues&&("network-only"===f||"cache-and-network"===f)&&(f="cache-first");let y=Object.assign({},e,{query:r,variables:c,fetchPolicy:f,errorPolicy:h,returnPartialData:p,notifyOnNetworkStatusChange:g,context:m}),b=new eY(this,o),w=r=>{y.variables=r;let s="no-cache"===f?0:t===eC.NetworkStatus.refetch&&"merge"!==y.refetchWritePolicy?1:2,u=this.fetchQueryByPolicy(y,{queryInfo:b,cacheWriteBehavior:s,onCacheHit:i,observableQuery:o,exposeExtensions:a});return u.observable=u.observable.pipe(n),"standby"!==y.fetchPolicy&&o?.applyNextFetchPolicy("after-fetch",e),u},S=()=>
2{this.fetchCancelFns.delete(b.id)};this.fetchCancelFns.set(b.id,e=>{k.next({kind:"E",error:e,source:"network"})});let k=new N.Subject;if(this.getDocumentInfo(y.query).hasClientExports)s.__DEV__&&(0,v.invariant)(this.localState,98,(0,d.getOperationName)(y.query,"(anonymous)")),u=(0,T.from)(this.localState.getExportedVariables({client:this.client,document:y.query,variables:y.variables,context:y.context})).pipe((0,A.mergeMap)(e=>w(e).observable)),l=!0;else{let e=w(y.variables);l=e.fromLink,u=e.observable}return{observable:new _.Observable(e=>{e.add(S),u.subscribe(e),k.subscribe(e)}).pipe((0,R.share)()),fromLink:l}}refetchQueries({updateCache:e,include:t,optimistic:r=!1,removeOptimistic:n=r?(0,eS.makeUniqueId)("refetchQueries"):void 0,onQueryUpdated:i}){let o=new Map;t&&this.getObservableQueries(t).forEach(e=>{if("cache-only"===e.options.fetchPolicy||e.variablesUnknown)return;let t=e.getCurrentResult();o.set(e,{oq:e,lastDiff:{result:t?.data,complete:!t?.partial}})});let a=new Map;if(e){let t=new Set;this.cache.batch({update:e,optimistic:r&&n||!1,removeOptimistic:n,onWatchUpdated(e,r,n){let s=e.watcher;if(s instanceof eW&&!t.has(s)){if(t.add(s),i){o.delete(s);let e=i(s,r,n);return!0===e&&(e=s.refetch().retain()),!1!==e&&a.set(s,e),e}null!==i&&"cache-only"!==s.options.fetchPolicy&&o.set(s,{oq:s,lastDiff:n,diff:r})}}})}return o.size&&o.forEach(({oq:e,lastDiff:t,diff:r})=>{let n;i&&(r||(r=e.getCacheDiff()),n=i(e,r,t)),i&&!0!==n||(n=e.refetch().retain()),!1!==n&&a.set(e,n)}),n&&this.cache.removeOptimistic(n),a}noCacheWarningsByCause=new WeakSet;maskOperation(e){var t,r;let n,{document:i,data:o}=e;if(s.__DEV__){let t,{fetchPolicy:n,cause:o={}}=e,a=(0,Z.getOperationDefinition)(i)?.operation;this.dataMasking&&"no-cache"===n&&(r=i,t=!0,(0,y.visit)(r,{FragmentSpread:e=>{if(!(t=!!e.directives&&e.directives.some(e=>"unmask"===e.name.value)))return y.BREAK}}),!t)&&!this.noCacheWarningsByCause.has(o)&&(this.noCacheWarningsByCause.add(o),s.__DEV__&&v.invariant.warn(99,(0,d.getOperationName)(i,`Unnamed ${a??"operation"}`)))}return this.dataMasking?(t=this.cache,n=(0,Z.getOperationDefinition)(i),((0,v.invariant)(n,43),null==o)?o:X(o,n.selectionSet,{operationType:n.operation,operationName:n.name?.value,fragmentMap:Q(H(i)),cache:t,mutableTargets:new WeakMap,knownChanged:new WeakSet})):o}maskFragment(e){var t,r;let n,i,{data:o,fragment:a,fragmentName:s}=e;return this.dataMasking?(t=this.cache,r=s,n=a.definitions.filter(e=>e.kind===b.Kind.FRAGMENT_DEFINITION),void 0===r&&((0,v.invariant)(1===n.length,41,n.length),r=n[0].name.value),i=n.find(e=>e.name.value===r),((0,v.invariant)(!!i,42,r),null==o||(0,$.equal)(o,{}))?o:X(o,i.selectionSet,{operationType:"fragment",operationName:i.name.value,fragmentMap:Q(H(a)),cache:t,mutableTargets:new WeakMap,knownChanged:new WeakSet})):o}fetchQueryByPolicy({query:e,variables:t,fetchPolicy:r,errorPolicy:i,returnPartialData:o,context:a},{cacheWriteBehavior:u,onCacheHit:l,queryInfo:c,observableQuery:f,exposeExtensions:h}){let p=()=>this.cache.diff({query:e,variables:t,returnPartialData:!0,optimistic:!0}),g=(n,u)=>{var c;let f=n.result;s.__DEV__&&!o&&null!==f&&(c=n.missing,s.__DEV__&&c&&s.__DEV__&&v.invariant.debug(88,c));let h=e=>(n.complete||o||(e=void 0),{data:e,dataState:n.complete?"complete":e?"partial":"empty",loading:!et(u),networkStatus:u,partial:!n.complete}),p=e=>(0,I.of)({kind:"N",value:h(e),resolvedVariables:t,source:"cache"});return(n.complete||o)&&this.getDocumentInfo(e).hasForcedResolvers?(s.__DEV__&&(0,v.invariant)(this.localState,100,(0,d.getOperationName)(e,"(anonymous)")),l(),(0,T.from)(this.localState.execute({client:this.client,document:e,remoteResult:f?{data:f}:void 0,context:a,variables:t,onlyRunForcedResolvers:!0,returnPartialData:!0,fetchPolicy:r}).then(e=>({kind:"N",value:h(e.data||void 0),resolvedVariables:t,source:"cache"})))):p("none"===i&&u===eC.NetworkStatus.refetch&&n.missing?void 0:f||void 0)},m=()=>this.getResultsFromLink({query:e,variables:t,context:a,fetchPolicy:r,errorPolicy:i},{cacheWriteBehavior:u,queryInfo:c,observableQuery:f,exposeExtensions:h}).pipe(e0(),(0,P.materialize)(),(0,n.map)(e=>({...e,resolvedVariables:t,source:"network"})));switch(r){default:case"cache-first":{let e=p();if(e.complete)return{fromLink:!1,observable:g(e,eC.NetworkStatus.ready)};if(o)return{fromLink:!0,observable:(0,k.concat)(g(e,eC.NetworkStatus.loading),m())};return{fromLink:!0,observable:m()}}case"cache-and-network":{let e=p();if(e.complete||o)return{fromLink:!0,observable:(0,k.concat)(g(e,eC.NetworkStatus.loading),m())};return{fromLink:!0,observable:m()}}case"cache-only":return{fromLink:!1,observable:(0,k.concat)(g(p(),eC.NetworkStatus.ready))};case"network-only":case"no-cache":return{fromLink:!0,observable:m()};case"standby":return{fromLink:!1,observable:E.EMPTY}}}}function e0(){let e=!1;return(0,M.tap)({next(){e=!0},complete(){(0,v.invariant)(e,101)}})}function e1(e){if(e.extensions?.[ev.streamInfoSymbol]==null)return e;let{extensions:{[ev.streamInfoSymbol]:t,...r},...n}=e;return Object.keys(r).length>0&&(n.extensions=r),n}let e2=!1;class e3{link;cache;disableNetworkFetches;set prioritizeCacheValues(e){this.queryManager.prioritizeCacheValues=e}get prioritizeCacheValues(){return this.queryManager.prioritizeCacheValues}version;queryDeduplication;defaultOptions;devtoolsConfig;refetchEventManager;queryManager;devToolsHookCb;resetStoreCallbacks=[];clearStoreCallbacks=[];constructor(e){s.__DEV__&&((0,v.invariant)(e.cache,68),(0,v.invariant)(e.link,69));const{cache:t,documentTransform:r,ssrMode:n=!1,ssrForceFetchDelay:o=0,queryDeduplication:a=!0,defaultOptions:u,defaultContext:l,assumeImmutableResults:c=t.assumeImmutableResults,localState:d,devtools:f,dataMasking:h,link:p,incrementalHandler:m=new i.NotImplementedHandler,experiments:y=[],refetchEventManager:b}=e;this.link=p,this.cache=t,this.queryDeduplication=a,this.defaultOptions=u||{},this.devtoolsConfig={...f,enabled:f?.enabled??s.__DEV__},this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.refetchObservableQueries=this.refetchObservableQueries.bind(this),this.version=g.version,this.queryManager=new eZ({client:this,defaultOptions:this.defaultOptions,defaultContext:l,documentTransform:r,queryDeduplication:a,ssrMode:n,dataMasking:!!h,clientOptions:e,incrementalHandler:m,assumeImmutableResults:c,onBroadcast:this.devtoolsConfig.enabled?()=>{this.devToolsHookCb&&this.devToolsHookCb()}:void 0,localState:d}),this.prioritizeCacheValues=n||o>0,o&&setTimeout(()=>{this.prioritizeCacheValues=!1},o),this.devtoolsConfig.enabled&&this.connectToDevTools(),y.forEac
2h(t=>t.call(this,e)),this.refetchEventManager=b,this.refetchEventManager?.connect(this)}connectToDevTools(){if("u"<typeof window)return;let e=window,t=Symbol.for("apollo.devtools");if((e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this,!e2&&s.__DEV__){let e;e2=!0;let t=window,r=t.navigator.userAgent;"string"==typeof r&&(r.indexOf("Chrome/")>-1?e="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":r.indexOf("Firefox/")>-1&&(e="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),t.document&&t.top===t.self&&/^(https?|file):$/.test(t.location.protocol)&&e&&setTimeout(()=>{!t.__APOLLO_DEVTOOLS_GLOBAL_HOOK__&&s.__DEV__&&v.invariant.log("Download the Apollo DevTools for a better development experience: %s",e)},1e4)}}get documentTransform(){return this.queryManager.documentTransform}get localState(){return this.queryManager.localState}set localState(e){this.queryManager.localState=e}stop(){this.queryManager.stop(),this.refetchEventManager?.disconnect(this)}watchQuery(e){let{refetchOn:t}=e;if(this.defaultOptions.watchQuery){let r,n=this.defaultOptions.watchQuery.refetchOn;t&&"object"==typeof t&&("object"==typeof n?r={...n,...t}:null!=n&&(r=e=>{let r=t[e.source]??n;return"function"==typeof r?r(e):r})),e=(0,h.mergeOptions)(this.defaultOptions.watchQuery,e),r&&(e.refetchOn=r)}if(s.__DEV__){let{query:r}=e,{refetchEventManager:n}=this;if(t){let e=(0,d.getOperationName)(r,"(anonymous)");n?"object"==typeof t&&Object.keys(t).forEach(t=>{!n.hasSource(t)&&s.__DEV__&&v.invariant.warn(71,t,e)}):s.__DEV__&&v.invariant.warn(70,e)}}return this.queryManager.watchQuery(e)}query=e=>(this.defaultOptions.query&&(e=(0,h.mergeOptions)(this.defaultOptions.query,e)),s.__DEV__&&((0,v.invariant)("cache-and-network"!==e.fetchPolicy,72),(0,v.invariant)("standby"!==e.fetchPolicy,73),(0,v.invariant)(e.query,74),(0,v.invariant)("Document"===e.query.kind,75),(0,v.invariant)(!e.returnPartialData,76),(0,v.invariant)(!e.pollInterval,77),(0,v.invariant)(!e.notifyOnNetworkStatusChange,78)),this.queryManager.query(e));mutate=e=>{let t=(0,h.mergeOptions)((0,l.compact)({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),e);return s.__DEV__&&((0,v.invariant)(t.mutation,79),(0,v.invariant)("network-only"===t.fetchPolicy||"no-cache"===t.fetchPolicy,80)),(0,u.checkDocument)(t.mutation,r.OperationTypeNode.MUTATION),this.queryManager.mutate(t)};subscribe(e){let t={},r=this.queryManager.startGraphQLSubscription(e);return Object.assign(r.pipe((0,n.map)(r=>({...r,data:this.queryManager.maskOperation({document:e.query,data:r.data,fetchPolicy:e.fetchPolicy,cause:t})}))),{restart:r.restart})}readQuery(e,t=!!e.optimistic){return this.cache.readQuery({...e,query:this.transform(e.query)},t)}watchFragment(e){let t=this.queryManager.dataMasking,r=this.cache.watchFragment({...e,fragment:this.transform(e.fragment,t)});return s.__DEV__?(0,f.mapObservableFragmentMemoized)(r,Symbol.for("apollo.transform.dev.mask"),t=>({...t,data:this.queryManager.maskFragment({...e,data:t.data})})):r}readFragment(e,t=!!e.optimistic){return this.cache.readFragment({...e,fragment:this.transform(e.fragment)},t)}writeQuery(e){let t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t}writeFragment(e){let t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t}__actionHookForDevTools(e){this.devToolsHookCb=e}__requestRaw(e){return(0,o.execute)(this.link,e,{client:this})}resetStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!1})).then(()=>Promise.all(this.resetStoreCallbacks.map(e=>e()))).then(()=>this.refetchObservableQueries())}clearStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!0})).then(()=>Promise.all(this.clearStoreCallbacks.map(e=>e())))}onResetStore(e){return this.resetStoreCallbacks.push(e),()=>{this.resetStoreCallbacks=this.resetStoreCallbacks.filter(t=>t!==e)}}onClearStore(e){return this.clearStoreCallbacks.push(e),()=>{this.clearStoreCallbacks=this.clearStoreCallbacks.filter(t=>t!==e)}}reFetchObservableQueries;refetchObservableQueries(e){return this.queryManager.refetchObservableQueries(e)}refetchQueries(e){let t=this.queryManager.refetchQueries(e),r=[],n=[];t.forEach((e,t)=>{r.push(t),n.push(e)});let i=Promise.all(n);return i.queries=r,i.results=n,i.catch(e=>{s.__DEV__&&v.invariant.debug(81,e)}),i}getObservableQueries(e="active"){return this.queryManager.getObservableQueries(e)}extract(e){return this.cache.extract(e)}restore(e){return this.cache.restore(e)}setLink(e){this.link=e}get defaultContext(){return this.queryManager.defaultContext}maskedFragmentTransform=new a.DocumentTransform(p.removeMaskedFragmentSpreads);transform(e,t=!1){let r=this.queryManager.transform(e);return t?this.maskedFragmentTransform.transformDocument(r):r}}s.__DEV__&&(e3.prototype.getMemoryInternals=c.getApolloClientMemoryInternals),e.s(["ApolloClient",0,e3],3139);let e4={kind:b.Kind.FIELD,name:{kind:b.Kind.NAME,value:"__typename"}},e8=Object.assign(function(e){return(0,y.visit)(e,{SelectionSet:{enter(e,t,r){if(r&&r.kind===b.Kind.OPERATION_DEFINITION)return;let{selections:n}=e;if(!(!n||n.some(e=>e.kind===b.Kind.FIELD&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))))&&!(r.kind===b.Kind.FIELD&&r.directives&&r.directives.some(e=>"export"===e.name.value)))return{...e,selections:[...n,e4]}}}})},{added:e=>e===e4});function e6(e){return!!(e&&"object"==typeof e&&"string"==typeof e.__ref)}
2var e5=e.i(619717),e9=e.i(225106),e7=e.i(490766),te=e.i(235250);function tt(e,t){return e===t}var tr=e.i(147582),tn=e.i(538619),ti=new(e.i(443610)).AsyncScheduler(tn.AsyncAction);function to(e,t){let r=t,n=[];return e.definitions.forEach(e=>{if("OperationDefinition"===e.kind)throw(0,v.newInvariantError)(10,e.operation,e.name?` named '${e.name.value}'`:"");"FragmentDefinition"===e.kind&&n.push(e)}),void 0===r&&((0,v.invariant)(1===n.length,11,n.length),r=n[0].name.value),{...e,definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}},...e.definitions]}}e.i(899553);class ta{assumeImmutableResults=!1;lookupFragment(e){return null}batch(e){let t,r="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction(()=>t=e.update(this),r),t}recordOptimisticTransaction(e,t){this.performTransaction(e,t)}transformDocument(e){return e}transformForLink(e){return e}identify(e){}gc(){return[]}modify(e){return!1}readQuery(e,t=!!e.optimistic){return this.read({...e,rootId:e.id||"ROOT_QUERY",optimistic:t})}fragmentWatches=new m.Trie(!0);watchFragment(e){let t,{fragment:r,fragmentName:i,from:o}=e,a=this.getFragmentDoc(r,i),u=(Array.isArray(o)?o:[o]).map(e=>{let t=null==e?e:this.toCacheId(e);if(s.__DEV__){let e=i||ek(r).name.value;void 0===t&&s.__DEV__&&v.invariant.warn(119,e)}return t});if(!Array.isArray(o)){let t=this.watchSingleFragment(u[0],a,e);return null===o?t:(0,f.mapObservableFragmentMemoized)(t,Symbol.for("apollo.transform.individualResult"),e=>({...e,data:e.data??{}}))}function l(e){let r=e.reduce((e,t,r)=>(e.data.push(t.data),e.complete&&=t.complete,e.dataState=e.complete?"complete":"partial",t.missing&&(e.missing||={},e.missing[r]=t.missing),e),{data:[],dataState:"complete",complete:!0});return(0,$.equal)(t,r)||(t=r),t}if(0===u.length)return tc;let c=!1,d=u.map(t=>this.watchSingleFragment(t,a,e));return Object.assign((0===d.length?E.EMPTY:new _.Observable(e=>{let t,{length:r}=d,n=Array(r),i=new Map;d.forEach((e,t)=>{i.has(e)||i.set(e,new Set),i.get(e).add(t)});let o=i.size,a=i.size;i.forEach((r,i)=>{let s=!1,u=i.subscribe({next:o=>{r.forEach(e=>n[e]=o),!s&&(s=!0,a--),!a&&((t||=new Set(d.filter(e=>e.dirty))).delete(i),t.size||(e.next(n.slice()),t=void 0))},complete:()=>{--o||e.complete()},error:e.error.bind(e)});e.add(u)})})).pipe((0,n.map)(l),(0,M.tap)({subscribe:()=>c=!0,unsubscribe:()=>c=!1}),(0,D.shareReplay)({bufferSize:1,refCount:!0})),{getCurrentResult:()=>c&&t?t:l(d.map(e=>e.getCurrentResult()))})}onAfterBroadcast=e=>e();watchSingleFragment(e,t,r){if(null===e)return tu;let{optimistic:n=!0,variables:i}=r,o=[t,(0,j.canonicalStringify)({id:e,optimistic:n,variables:i})],a=this.fragmentWatches.lookupArray(o);if(!a.observable){var s,u;let c,d=!1;function l(e){let n=e.result;return c&&eM(t,{data:c.data},{data:n},r.variables)||(c={data:n,dataState:e.complete?"complete":"partial",complete:e.complete},e.missing&&(c.missing=e.missing.missing)),c}let f=new _.Observable(r=>{d=!0;let a=this.watch({variables:i,returnPartialData:!0,id:e,query:t,optimistic:n,immediate:!0,callback:e=>{f.dirty=!0,this.onAfterBroadcast(()=>{r.next(l(e)),f.dirty=!1})}});return()=>{d=!1,a(),this.fragmentWatches.removeArray(o)}}).pipe((void 0===u&&(u=e9.identity),s=null!=s?s:tt,(0,e7.operate)(function(e,t){var r,n=!0;e.subscribe((0,te.createOperatorSubscriber)(t,function(e){var i=u(e);(n||!s(r,i))&&(n=!1,r=i,t.next(e))}))})),(0,R.share)({connector:()=>new tr.ReplaySubject(1),resetOnRefCountZero:()=>{var e;return void 0===e&&(e=ti),new _.Observable(function(t){var r=0;r<0&&(r=0);var n=0;return e.schedule(function(){t.closed||(t.next(n++),t.complete())},r)})}}));a.observable=Object.assign(f,{dirty:!1,getCurrentResult:()=>d&&c?c:l(this.diff({id:e,query:t,returnPartialData:!0,optimistic:n,variables:i}))})}return a.observable}getFragmentDoc=(0,J.wrap)(to,{max:ee.cacheSizes["cache.fragmentQueryDocuments"]||1e3,cache:e5.WeakCache,makeCacheKey:function(...e){return J.defaultMakeCacheKey.bind(null,...e)}(this)});readFragment(e,t=!!e.optimistic){let r=void 0!==e.from?this.toCacheId(e.from):e.id;return this.read({...e,query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:r,optimistic:t})}writeQuery({id:e,data:t,...r}){return this.write(Object.assign(r,{dataId:e||"ROOT_QUERY",result:t}))}writeFragment({data:e,fragment:t,fragmentName:r,...n}){let i=void 0!==n.from?this.toCacheId(n.from):n.id;return this.write(Object.assign(n,{query:this.getFragmentDoc(t,r),dataId:i,result:e}))}updateQuery(e,t){return this.batch({update(r){let n=r.readQuery(e),i=t(n);return null==i?n:(r.writeQuery({...e,data:i}),i)}})}updateFragment(e,t){return this.batch({update(r){let n=r.readFragment(e),i=t(n);return null==i?n:(r.writeFragment({...e,data:i}),i)}})}toCacheId(e){return"string"==typeof e?e:this.identify(e)}}s.__DEV__&&(ta.prototype.getMemoryInternals=c.getApolloCacheMemoryInternals);let ts=Object.freeze({data:null,dataState:"complete",complete:!0}),tu=Object.assign(new _.Observable(e=>{e.next(ts)}),{dirty:!1,getCurrentResult:()=>ts}),tl=Object.freeze({data:[],dataState:"complete",complete:!0}),tc=Object.assign(new _.Observable(e=>{e.next(tl)}),{getCurrentResult:()=>tl});var td=e.i(745796);let{hasOwnProperty:tf}
2=Object.prototype,th=function(e,t,r){return this.merge(e[r],t[r])},tp=e=>isNaN(+e)?{}:[];class tv{options;reconciler;constructor(e={}){this.options=e,this.reconciler=e.reconciler||th}merge(e,t,r={}){let n=r.atPath;if(n?.length){let[i,...o]=n;void 0===e&&(e=tp(i));let a=e[i];void 0===a&&o.length&&(a=tp(o[0]));let s=this.merge(a,t,{...r,atPath:o});return a!==s&&((e=this.shallowCopyForMerge(e))[i]=s),e}return(Array.isArray(e)&&Array.isArray(t)&&"truncate"===this.options.arrayMerge&&e.length>t.length&&(e=e.slice(0,t.length),this.pastCopies.add(e)),(0,ew.isNonNullObject)(t)&&(0,ew.isNonNullObject)(e))?(Object.keys(t).forEach(r=>{if(tf.call(e,r)){let n=e[r];if(t[r]!==n){let i=this.reconciler(e,t,r);i!==n&&((e=this.shallowCopyForMerge(e))[r]=i)}}else(e=this.shallowCopyForMerge(e))[r]=t[r]}),e):t}isObject=ew.isNonNullObject;pastCopies=new Set;shallowCopyForMerge(e){return(0,ew.isNonNullObject)(e)&&!this.pastCopies.has(e)&&(e=Array.isArray(e)?e.slice(0):{__proto__:Object.getPrototypeOf(e),...e},this.pastCopies.add(e)),e}}function tg(e){return{__ref:String(e)}}let{hasOwnProperty:tm}=Object.prototype;function ty({__typename:e,id:t,_id:r},n){if("string"==typeof e&&(n&&(n.keyObject=null!=t?{id:t}:null!=r?{_id:r}:void 0),null==t&&null!=r&&(t=r),null!=t))return`${e}:${"number"==typeof t||"string"==typeof t?t:JSON.stringify(t)}`}let tb={dataIdFromObject:ty,resultCaching:!0},t_=/^[_a-z][_0-9a-z]*/i;function tw(e){let t=e.match(t_);return t?t[0]:e}function tS(e){return(0,ew.isNonNullObject)(e)&&!e6(e)&&!eE(e)}function tk(e,t){let r=Q(H(e));return{fragmentMap:r,lookupFragment(e){let n=r[e];return!n&&t&&(n=t.lookup(e)),n||null}}}let tE={},tO=()=>tE,tx={};class tT{policies;group;data={};constructor(e,t){this.policies=e,this.group=t}toObject(){return{...this.data}}has(e){return void 0!==this.lookup(e,!0)}get(e,t){if(this.group.depend(e,t),tm.call(this.data,e)){let r=this.data[e];if(r&&tm.call(r,t))return r[t]}return"__typename"===t&&tm.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof tI?this.parent.get(e,t):void 0}lookup(e,t){return(t&&this.group.depend(e,"__exists"),tm.call(this.data,e))?this.data[e]:this instanceof tI?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?{}:void 0}merge(e,t){let r;e6(e)&&(e=e.__ref),e6(t)&&(t=t.__ref);let n="string"==typeof e?this.lookup(r=e):e,i="string"==typeof t?this.lookup(r=t):t;if(!i)return;(0,v.invariant)("string"==typeof r,105);let o=new tv({reconciler:tD}).merge(n,i);if(this.data[r]=o,o!==n&&(delete this.refs[r],this.group.caching)){let e={};
2n||(e.__exists=1),Object.keys(i).forEach(t=>{if(!n||n[t]!==o[t]){e[t]=1;let r=tw(t);r===t||this.policies.hasKeyArgs(o.__typename,r)||(e[r]=1),void 0!==o[t]||this instanceof tI||delete o[t]}}),e.__typename&&!(n&&n.__typename)&&this.policies.rootTypenamesById[r]===o.__typename&&delete e.__typename,Object.keys(e).forEach(e=>this.group.dirty(r,e))}}modify(e,t,r){let n=this.lookup(e);if(n){let i={},o=!1,a=!0,u={DELETE:tE,INVALIDATE:tx,isReference:e6,toReference:this.toReference,canRead:this.canRead,readField:(t,r)=>this.policies.readField("string"==typeof t?{fieldName:t,from:r||tg(e)}:t,{store:this})};if(Object.keys(n).forEach(l=>{let c=tw(l),d=n[l];if(void 0===d)return;let f="function"==typeof t?t:t[l]||(r?void 0:t[c]);if(f){let t=f===tO?tE:f((0,K.maybeDeepFreeze)(d),{...u,fieldName:c,storeFieldName:l,storage:this.getStorage(e,l)});if(t===tx)this.group.dirty(e,l);else if(t===tE&&(t=void 0),t!==d&&(i[l]=t,o=!0,d=t,s.__DEV__)){let e=e=>{if(void 0===this.lookup(e.__ref))return s.__DEV__&&v.invariant.warn(106,e),!0};if(e6(t))e(t);else if(Array.isArray(t)){let r,n=!1;for(let i of t){if(e6(i)){if(n=!0,e(i))break}else if("object"==typeof i&&i){let[e]=this.policies.identify(i);e&&(r=i)}if(n&&void 0!==r){s.__DEV__&&v.invariant.warn(107,r);break}}}}}void 0!==d&&(a=!1)}),o)return this.merge(e,i),a&&(this instanceof tI?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1}delete(e,t,r){let n=this.lookup(e);if(n){let i=this.getFieldValue(n,"__typename"),o=t&&r?this.policies.getStoreFieldName({typename:i,fieldName:t,args:r}):t;return this.modify(e,o?{[o]:tO}:tO,!!r)}return!1}evict(e,t){let r=!1;return e.id&&(tm.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof tI&&this!==t&&(r=this.parent.evict(e,t)||r),(e.fieldName||r)&&this.group.dirty(e.id,e.fieldName||"__exists")),r}clear(){this.replace(null)}extract(){let e=this.toObject(),t=[];return this.getRootIdSet().forEach(e=>{tm.call(this.policies.rootTypenamesById,e)||t.push(e)}),t.length&&(e.__META={extraRootIds:t.sort()}),e}replace(e){if(Object.keys(this.data).forEach(t=>{e&&tm.call(e,t)||this.delete(t)}),e){let{__META:t,...r}=e;Object.keys(r).forEach(e=>{this.merge(e,r[e])}),t&&t.extraRootIds.forEach(this.retain,this)}}rootIds={};retain(e){return this.rootIds[e]=(this.rootIds[e]||0)+1}release(e){if(this.rootIds[e]>0){let t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0}getRootIdSet(e=new Set){return Object.keys(this.rootIds).forEach(e.add,e),this instanceof tI?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e}gc(){let e=this.getRootIdSet(),t=this.toObject();e.forEach(r=>{tm.call(t,r)&&(Object.keys(this.findChildRefIds(r)).forEach(e.add,e),delete t[r])});let r=Object.keys(t);if(r.length){let e=this;for(;e instanceof tI;)e=e.parent;r.forEach(t=>e.delete(t))}return r}refs={};findChildRefIds(e){if(!tm.call(this.refs,e)){let t=this.refs[e]={},r=this.data[e];if(!r)return t;let n=new Set([r]);n.forEach(e=>{e6(e)&&(t[e.__ref]=!0),(0,ew.isNonNullObject)(e)&&Object.keys(e).forEach(t=>{let r=e[t];(0,ew.isNonNullObject)(r)&&n.add(r)})})}return this.refs[e]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}getFieldValue=(e,t)=>(0,K.maybeDeepFreeze)(e6(e)?this.get(e.__ref,t):e&&e[t]);canRead=e=>e6(e)?this.has(e.__ref):"object"==typeof e;toReference=(e,t)=>{if("string"==typeof e)return tg(e);if(e6(e))return e;let[r]=this.policies.identify(e);if(r){let n=tg(r);return t&&this.merge(r,e),n}};get supportsResultCaching(){return this.group.caching}}class tC{caching;parent;d=null;keyMaker;constructor(e,t=null){this.caching=e,this.parent=t,this.resetCaching()}resetCaching(){this.d=this.caching?(0,td.dep)():null,this.keyMaker=new m.Trie}depend(e,t){if(this.d){this.d(t+"#"+e);let r=tw(t);r!==t&&this.d(r+"#"+e),this.parent&&this.parent.depend(e,t)}}dirty(e,t){this.d&&this.d.dirty(t+"#"+e,"__exists"===t?"forget":"setDirty")}}function tP(e,t){tN(e)&&e.group.depend(t,"__exists")}class tA extends tT{constructor({policies:e,resultCaching:t=!0,seed:r}){super(e,new tC(t)),r&&this.replace(r)}stump=new tR(this);addLayer(e,t){return this.stump.addLayer(e,t)}removeLayer(){return this}storageTrie=new m.Trie;getStorage(){return this.storageTrie.lookupArray(arguments)}}tT.Root=tA;class tI extends tT{id;parent;replay;group;constructor(e,t,r,n){super(t.policies,n),this.id=e,this.parent=t,this.replay=r,this.group=n,r(this)}addLayer(e,t){return new tI(e,this,t,this.group)}removeLayer(e){let t=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEac
2h(e=>{let r=this.data[e],n=t.lookup(e);n?r?r!==n&&Object.keys(r).forEach(t=>{(0,$.equal)(r[t],n[t])||this.group.dirty(e,t)}):(this.group.dirty(e,"__exists"),Object.keys(n).forEach(t=>{this.group.dirty(e,t)})):this.delete(e)}),t):t===this.parent?this:t.addLayer(this.id,this.replay)}toObject(){return{...this.parent.toObject(),...this.data}}findChildRefIds(e){let t=this.parent.findChildRefIds(e);return tm.call(this.data,e)?{...t,...super.findChildRefIds(e)}:t}getStorage(...e){let t=this.parent;for(;t.parent;)t=t.parent;return t.getStorage(...e)}}class tR extends tI{constructor(e){super("EntityStore.Stump",e,()=>{},new tC(e.group.caching,e.group))}removeLayer(){return this}merge(e,t){return this.parent.merge(e,t)}}function tD(e,t,r){let n=e[r],i=t[r];return(0,$.equal)(n,i)?n:i}function tN(e){return!!(e&&e.supportsResultCaching)}function tM(e,t){if(e.arguments&&e.arguments.length){let r={};return e.arguments.forEach(({name:e,value:n})=>em(r,e,n,t)),r}return null}let tj=["connection","include","skip","client","rest","export","nonreactive","stream"],tL=j.canonicalStringify,tF=Object.assign(function(e,t,r){if(t&&r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){let e=r.connection.filter?r.connection.filter:[];e.sort();let n={};e.forEach(e=>{n[e]=t[e]});let i=tL(n);if("{}"!==i)return`${r.connection.key}(${i})`}return r.connection.key}let n=e;if(t){let e=tL(t);"{}"!==e&&(n+=`(${e})`)}return r&&Object.keys(r).forEach(e=>{-1===tj.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?n+=`@${e}(${tL(r[e])})`:n+=`@${e}`)}),n},{setStringify(e){let t=tL;return tL=e,t}});var tq=e.i(491164);let tU={};function tV(e){let t=JSON.stringify(e);return tU[t]||(tU[t]={})}function tz(e){let t=tV(e);return t.keyFieldsFn||(t.keyFieldsFn=(t,r)=>{let n=(e,t)=>r.readField(t,e),i=r.keyObject=tW(e,e=>{let i=tQ(r.storeObject,e,n);return void 0===i&&t!==r.storeObject&&tm.call(t,e[0])&&(i=tQ(t,e,t$)),(0,v.invariant)(void 0!==i,108,e.join("."),t),i});return`${r.typename}:${JSON.stringify(i)}`})}function tB(e){let t=tV(e);return t.keyArgsFn||(t.keyArgsFn=(t,{field:r,variables:n,fieldName:i})=>{let o=JSON.stringify(tW(e,e=>{let i=e[0],o=i.charAt(0);if("@"===o){if(r&&eO(r.directives)){let t=i.slice(1),o=r.directives.find(e=>e.name.value===t),a=o&&tM(o,n);return a&&tQ(a,e.slice(1))}return}if("$"===o){let t=i.slice(1);if(n&&tm.call(n,t)){let r=e.slice(0);return r[0]=t,tQ(n,r)}return}if(t)return tQ(t,e)}));return(t||"{}"!==o)&&(i+=":"+o),i})}function tW(e,t){let r=new tv;return(function e(t){let r=tV(t);if(!r.paths){let n=r.paths=[],i=[];t.forEach((r,o)=>{eE(r)?(e(r).forEach(e=>n.push(i.concat(e))),i.length=0):(i.push(r),eE(t[o+1])||(n.push(i.slice(0)),i.length=0))})}return r.paths})(e).reduce((e,n)=>{let i=t(n);if(void 0!==i){for(let e=n.length-1;e>=0;--e)i={[n[e]]:i};e=r.merge(e,i)}return e},{})}function t$(e,t){return e[t]}function tQ(e,t,r){return r=r||t$,function e(t){return(0,ew.isNonNullObject)(t)?eE(t)?t.map(e):tW(Object.keys(t).sort(),e=>tQ(t,e)):t}(t.reduce(function e(t,n){return eE(t)?t.map(t=>e(t,n)):t&&r(t,n)},e))}var tH=e.i(403792);function tK(e){return void 0!==e.args?e.args:e.field?tM(e.field,e.variables):null}let tG=()=>void 0,tJ=(e,t)=>t.fieldName,tY=(e,t,{mergeObjects:r})=>r(e,t),tX=(e,t)=>t,tZ=(e,t,{streamFieldInfo:r,existingData:n})=>{if(!e&&!n)return t;let i=[],o=e??n,a=r?.isLastChunk?t.length:Math.max(o.length,t.length);for(let e=0;e<a;e++)i[e]=void 0===t[e]?o[e]:t[e];return i};class t0{config;typePolicies={};toBeAdded={};supertypeMap=new Map;fuzzySubtypes=new Map;cache;rootIdsByTypename={};rootTypenamesById={};usingPossibleTypes=!1;constructor(e){this.config=e,this.config={dataIdFromObject:ty,...e},this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}identify(e,t){let r,n=this,i=t&&(t.typename||t.storeObject?.__typename)||e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];let o=t&&t.storeObject||e,a={...t,typename:i,storeObject:o,readField:t&&t.readField||((...e)=>{let t=t2(e,o);return n.readField(t,{store:n.cache.data,variables:t.variables})})},s=i&&this.getTypePolicy(i),u=s&&s.keyFn||this.config.dataIdFromObject;
2return Y.withValue(!0,()=>{for(;u;){let t=u({...e,...o},a);if(eE(t))u=tz(t);else{r=t;break}}}),r=r?String(r):void 0,a.keyObject?[r,a.keyObject]:[r]}addTypePolicies(e){Object.keys(e).forEach(t=>{let{queryType:r,mutationType:n,subscriptionType:i,...o}=e[t];r&&this.setRootTypename("Query",t),n&&this.setRootTypename("Mutation",t),i&&this.setRootTypename("Subscription",t),tm.call(this.toBeAdded,t)?this.toBeAdded[t].push(o):this.toBeAdded[t]=[o]})}updateTypePolicy(e,t,r){let n=this.getTypePolicy(e),{keyFields:i,fields:o}=t;function a(e,t){e.merge="function"==typeof t?t:!0===t?tY:!1===t?tX:e.merge}a(n,t.merge),n.keyFn=!1===i?tG:eE(i)?tz(i):"function"==typeof i?i:n.keyFn,o&&Object.keys(o).forEach(t=>{let n=r[t];n&&n?.typename===e||(n=r[t]={typename:e});let i=o[t];if("function"==typeof i)n.read=i;else{let{keyArgs:e,read:t,merge:r}=i;n.keyFn=!1===e?tJ:eE(e)?tB(e):"function"==typeof e?e:n.keyFn,"function"==typeof t&&(n.read=t),a(n,r)}n.read&&n.merge&&(n.keyFn=n.keyFn||tJ)})}setRootTypename(e,t=e){let r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&((0,v.invariant)(!n||n===e,109,e),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=r,this.rootTypenamesById[r]=t)}addPossibleTypes(e){this.usingPossibleTypes=!0,Object.keys(e).forEach(t=>{this.getSupertypeSet(t,!0),e[t].forEach(e=>{this.getSupertypeSet(e,!0).add(t);let r=e.match(t_);r&&r[0]===e||this.fuzzySubtypes.set(e,new RegExp(e))})})}getTypePolicy(e){if(!tm.call(this.typePolicies,e)){let t=this.typePolicies[e]={};t.fields={};let r=this.supertypeMap.get(e);!r&&this.fuzzySubtypes.size&&(r=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach((t,n)=>{if(t.test(e)){let e=this.supertypeMap.get(n);e&&e.forEach(e=>r.add(e))}})),r&&r.size&&r.forEach(e=>{let{fields:r,...n}=this.getTypePolicy(e);Object.assign(t,n),Object.assign(t.fields,r)})}let t=this.toBeAdded[e];return t&&t.length&&t.splice(0).forEach(t=>{this.updateTypePolicy(e,t,this.typePolicies[e].fields)}),this.typePolicies[e]}getFieldPolicy(e,t){if(e)return this.getTypePolicy(e).fields[t]}getSupertypeSet(e,t){let r=this.supertypeMap.get(e);return!r&&t&&this.supertypeMap.set(e,r=new Set),r}fragmentMatches(e,t,r,n){if(!e.typeCondition)return!0;if(!t)return!1;let i=e.typeCondition.name.value;if(t===i)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(i)){let o=this.getSupertypeSet(t,!0),a=[o],u=e=>{let t=this.getSupertypeSet(e,!1);t&&t.size&&0>a.indexOf(t)&&a.push(t)},l=!!(r&&this.fuzzySubtypes.size),c=!1;for(let d=0;d<a.length;++d){let f=a[d];if(f.has(i))return o.has(i)||(c&&s.__DEV__&&v.invariant.warn(110,t,i),o.add(i)),!0;f.forEach(u),l&&d===a.length-1&&function e(t,r,n){return!!(0,ew.isNonNullObject)(r)&&(eE(r)?r.every(r=>e(t,r,n)):t.selections.every(t=>{if(eD(t)&&eN(t,n)){let i=G(t);return tm.call(r,i)&&(!t.selectionSet||e(t.selectionSet,r[i],n))}return!0}))}(e.selectionSet,r,n)&&(l=!1,c=!0,this.fuzzySubtypes.forEach((e,r)=>{let n=t.match(e);n&&n[0]===t&&u(r)}))}}return!1}hasKeyArgs(e,t){let r=this.getFieldPolicy(e,t);return!!(r&&r.keyFn)}getStoreFieldName(e){var t,r;let n,i,o,{typename:a,fieldName:s}=e,u=this.getFieldPolicy(a,s),l=u&&u.keyFn;if(l&&a){let t={typename:a,fieldName:s,field:e.field||null,variables:e.variables},r=tK(e);for(;l;){let e=l(r,t);if(eE(e))l=tB(e);else{n=e||s;break}}}return(void 0===n&&(n=e.field?(t=e.field,r=e.variables,i=null,t.directives&&(i={},t.directives.forEach(e=>{i[e.name.value]={},e.arguments&&e.arguments.forEach(({name:t,value:n})=>em(i[e.name.value],t,n,r))})),o=null,t.arguments&&t.arguments.length&&(o={},t.arguments.forEach(({name:e,value:t})=>em(o,e,t,r))),tF(t.name.value,o,i)):tF(s,tK(e))),!1===n)?s:s===tw(n)?n:s+":"+n}readField(e,t){let r=e.from;if(!r||!(e.field||e.fieldName))return;if(void 0===e.typename){let n=t.store.getFieldValue(r,"__typename");n&&(e.typename=n)}let n=this.getStoreFieldName(e),i=tw(n),o=t.store.getFieldValue(r,n),a=this.getFieldPolicy(e.typename,i),s=a&&a.read;if(s){let i=t1(this,r,e,t,t.store.getStorage(e6(r)?r.__ref:r,n));return tH.cacheSlot.withValue(this.cache,s,[o,i])}return o}getReadFunction(e,t){let r=this.getFieldPolicy(e,t);return r&&r.read}getMergeFunction(e,t,r){let n=this.getFieldPolicy(e,t),i=n&&n.merge;return!i&&r&&(i=(n=this.getTypePolicy(r))&&n.merge),i}runMergeFunction(e,t,{field:r,typename:n,merge:i,path:o},a,s){let u=e;if(i===tY)return t3(a.store)(e,t);if(i===tX)return t;a.overwrite&&(e=void 0);let l=a.extensions?.[ev.streamInfoSymbol]?.deref()?.peekArray(o);if(l){let{current:e,previous:r}=l;if(r&&(0,$.equal)(r.incoming,t)&&(0,$.equal)(r.streamFieldInfo,e))return r.result}let c=i(e,t,function(e,t,r,n,i,o){let a={...t1(e,t,r,n,i),extensions:n.extensions,existingData:o},s=n.extensions;
2if(s&&ev.streamInfoSymbol in s){let{[ev.streamInfoSymbol]:e,...t}=s,n=e?.deref()?.peekArray(r.path);n&&(a.streamFieldInfo=n.current),a.extensions=0===Object.keys(t).length?void 0:t}return a}(this,void 0,{typename:n,fieldName:r.name.value,field:r,variables:a.variables,path:o},a,s||{},u));return l&&(l.previous={incoming:t,streamFieldInfo:l.current,result:c}),c}}function t1(e,t,r,n,i){let o=e.getStoreFieldName(r),a=tw(o),s=r.variables||n.variables,{toReference:u,canRead:l}=n.store;return{args:tK(r),field:r.field||null,fieldName:a,storeFieldName:o,variables:s,isReference:e6,toReference:u,storage:i,cache:e.cache,canRead:l,readField:(...r)=>e.readField(t2(r,t,s),n),mergeObjects:t3(n.store)}}function t2(e,t,r){let n,{0:i,1:o,length:a}=e;return"string"==typeof i?n={fieldName:i,from:a>1?o:t}:(n={...i},tm.call(n,"from")||(n.from=t)),s.__DEV__&&void 0===n.from&&s.__DEV__&&v.invariant.warn(111,(0,tq.stringifyForDisplay)(Array.from(e))),void 0===n.variables&&(n.variables=r),n}function t3(e){return function(t,r){if(eE(t)||eE(r))throw(0,v.newInvariantError)(112);if((0,ew.isNonNullObject)(t)&&(0,ew.isNonNullObject)(r)){let n=e.getFieldValue(t,"__typename"),i=e.getFieldValue(r,"__typename");if(n&&i&&n!==i)return r;if(e6(t)&&tS(r))return e.merge(t.__ref,r),t;if(tS(t)&&e6(r))return e.merge(t,r.__ref),r;if(tS(t)&&tS(r))return{...t,...r}}return r}}class t4 extends Error{message;path;query;variables;constructor(e,t,r,n){if(super(e),this.message=e,this.path=t,this.query=r,this.variables=n,this.name="MissingFieldError",Array.isArray(this.path)){this.missing=this.message;for(let e=this.path.length-1;e>=0;--e)this.missing={[this.path[e]]:this.missing}}else this.missing=this.path;this.__proto__=t4.prototype}missing}function t8(e){return[e.selectionSet,e.objectOrReference,e.context]}class t6{executeSelectionSet;executeSubSelectedArray;config;knownResults=new WeakMap;constructor(e){this.config=e,this.executeSelectionSet=(0,J.wrap)(e=>{let t=t8(e),r=this.executeSelectionSet.peek(...t);return r||(tP(e.context.store,e.enclosingRef.__ref),this.execSelectionSetImpl(e))},{max:ee.cacheSizes["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:t8,makeCacheKey(e,t,r){if(tN(r.store))return r.store.makeCacheKey(e,e6(t)?t.__ref:t,r.varString)}}),this.executeSubSelectedArray=(0,J.wrap)(e=>(tP(e.context.store,e.enclosingRef.__ref),this.execSubSelectedArrayImpl(e)),{max:ee.cacheSizes["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:e,array:t,context:r}){if(tN(r.store))return r.store.makeCacheKey(e,t,r.varString)}})}diffQueryAgainstStore({store:e,query:t,rootId:r="ROOT_QUERY",variables:n,returnPartialData:i=!0}){let o,a=this.config.cache.policies;n=(0,l.compact)(ey(eF(t)),n);let s=tg(r),u=this.executeSelectionSet({selectionSet:eR(t).selectionSet,objectOrReference:s,enclosingRef:s,context:{store:e,query:t,policies:a,variables:n,varString:(0,j.canonicalStringify)(n),...tk(t,this.config.fragments)}});u.missing&&(o=new t4(function(e){try{JSON.stringify(e,(e,t)=>{if("string"==typeof t)throw t;return t})}catch(e){return e}}(u.missing),u.missing,t,n));let c=!o,{result:d}=u;return{result:c?d:i?0===Object.keys(d).length?null:d:null,complete:c,missing:o}}isFresh(e,t,r,n){if(tN(n.store)&&this.knownResults.get(e)===r){let i=this.executeSelectionSet.peek(r,t,n);if(i&&e===i.result)return!0}return!1}execSelectionSetImpl({selectionSet:e,objectOrReference:t,enclosingRef:r,context:n}){let i;if(e6(t)&&!n.policies.rootTypenamesById[t.__ref]&&!n.store.has(t.__ref))return{result:{},missing:`Dangling reference to missing ${t.__ref} object`};let{variables:o,policies:a,store:s}=n,u=s.getFieldValue(t,"__typename"),l=[],c=new tv;function d(e,t){return e.missing&&(i=c.merge(i,{[t]:e.missing})),e.result}"string"!=typeof u||a.rootIdsByTypename[u]||l.push({__typename:u});let f=new Set(e.selections);f.forEach(e=>{if(eN(e,o))if(eD(e)){let o=a.readField({fieldName:e.name.value,field:e,variables:n.variables,from:t},n),s=G(e);void 0===o?e8.added(e)||(i=c.merge(i,{[s]:`Can't find field '${e.name.value}' on ${e6(t)?t.__ref+" object":"object "+JSON.stringify(t,null,2)}`})):eE(o)?o.length>0&&(o=d(this.executeSubSelectedArray({field:e,array:o,enclosingRef:r,context:n}),s)):e.selectionSet&&null!=o&&(o=d(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:o,enclosingRef:e6(o)?o:r,context:n}),s)),void 0!==o&&l.push({[s]:o})}else{let t=eI(e,n.lookupFragment);if(!t&&e.kind===b.Kind.FRAGMENT_SPREAD)throw(0,v.newInvariantError)(113,e.name.value);t&&a.fragmentMatches(t,u)&&t.selectionSet.selections.forEach(f.add,f)}});let h={result:function(e){let t=e[0]||{},r=e.length;if(r>1){let n=new tv;for(let i=1;i<r;++i)t=n.merge(t,e[i])}return t}(l),missing:i},p=(0,K.maybeDeepFreeze)(h);return p.result&&this.knownResults.set(p.result,e),p}execSubSelectedArrayImpl({field:e,array:t,enclosingRef:r,context:n}){let i,o=new tv;function a(e,t){return e.missing&&(i=o.merge(i,{[t]:e.missing})),e.result}return e.selectionSet&&(t=t.filter(e=>void 0===e||n.store.canRead(e))),{result:t=t.map((t,i)=>null===t?null:eE(t)?a(this.executeSubSelectedArray({field:e,array:t,enclosingRef:r,context:n}),i):e.selectionSet?a(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:t,enclosingRef:e6(t)?t:r,context:n}),i):(s.__DEV__&&function(e,t,r){if(!t.selectionSet){let n=new Set([r]);
2n.forEach(r=>{(0,ew.isNonNullObject)(r)&&((0,v.invariant)(!e6(r),114,e6(r)?e.get(r.__ref,"__typename"):r&&r.__typename,t.name.value),Object.values(r).forEach(n.add,n))})}}(n.store,e,t),t)),missing:i}}}let{toString:t5}=Object.prototype;function t9(e,t,r){let n=`${t}${r}`,i=e.flavors.get(n);return i||e.flavors.set(n,i=e.clientOnly===t&&e.deferred===r?e:{...e,clientOnly:t,deferred:r}),i}class t7{cache;reader;fragments;constructor(e,t,r){this.cache=e,this.reader=t,this.fragments=r}writeToStore(e,{query:t,result:r,dataId:n,variables:i,overwrite:o,extensions:a}){let u=(0,Z.getOperationDefinition)(t),l=new tv,c={store:e,written:{},merge:(e,t)=>l.merge(e,t),variables:i={...ey(u),...i},varString:(0,j.canonicalStringify)(i),...tk(t,this.fragments),overwrite:!!o,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map,extensions:a},d=this.processSelectionSet({result:r||{},dataId:n,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:c,path:[]});if(!e6(d))throw(0,v.newInvariantError)(115,r);return c.incomingById.forEach(({storeObject:t,mergeTree:r,fieldNodeSet:n},i)=>{let o=tg(i);if(r&&r.map.size){let e=this.applyMerges(r,o,t,c);if(e6(e))return;t=e}if(s.__DEV__&&!c.overwrite){let e={};n.forEach(t=>{t.selectionSet&&(e[t.name.value]=!0)}),Object.keys(t).forEach(n=>{let i;!0!==e[tw(n)]||(i=r&&r.map.get(n))&&i.info&&i.info.merge||function(e,t,r,n){let i=e=>{let t=n.getFieldValue(e,r);return"object"==typeof t&&t},o=i(e);if(!o)return;let a=i(t);if(!a||e6(o)||(0,$.equal)(o,a)||Object.keys(o).every(e=>void 0!==n.getFieldValue(a,e)))return;let u=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),l=tw(r),c=`${u}.${l}`;if(ri.has(c))return;ri.add(c);let d=[];eE(o)||eE(a)||[o,a].forEach(e=>{let t=n.getFieldValue(e,"__typename");"string"!=typeof t||d.includes(t)||d.push(t)}),s.__DEV__&&v.invariant.warn(118,l,u,d.length?"either ensure all objects of type "+d.join(" and ")+" have an ID or a custom merge function, or ":"",c,Array.isArray(o)?[...o]:{...o},Array.isArray(a)?[...a]:{...a})}(o,t,n,c.store)})}e.merge(i,t)}),e.retain(d.__ref),d}processSelectionSet({dataId:e,result:t,selectionSet:r,context:n,mergeTree:i,path:o}){let{policies:a}=this.cache,u={},l=e&&a.rootTypenamesById[e]||ro(t,r,n.fragmentMap)||e&&n.store.get(e,"__typename");"string"==typeof l&&(u.__typename=l);let c=(...e)=>{let t=t2(e,u,n.variables);if(e6(t.from)){let e=n.incomingById.get(t.from.__ref);if(e){let r=a.readField({...t,from:e.storeObject},n);if(void 0!==r)return r}}return a.readField(t,n)},d=new Set;this.flattenFields(r,t,n,l).forEach((e,r)=>{let n=t[G(r)],f=[...o,r.name.value];if(d.add(r),void 0!==n){var h;let t,o=a.getStoreFieldName({typename:l,fieldName:r.name.value,field:r,variables:e.variables}),s=rt(i,o),d=this.processFieldValue(n,r,r.selectionSet?t9(e,!1,!1):e,s,f);
2r.selectionSet&&(e6(d)||tS(d))&&(t=c("__typename",d));let p=a.getMergeFunction(l,r.name.value,t);p?s.info={field:r,typename:l,merge:p,path:f}:e.extensions?.[ev.streamInfoSymbol]&&Array.isArray(d)&&(h=r).directives&&h.directives.some(e=>"stream"===e.name.value)?s.info={field:r,typename:l,merge:tZ,path:f}:rn(i,o),u=e.merge(u,{[o]:d})}else!s.__DEV__||e.clientOnly||e.deferred||e8.added(r)||a.getReadFunction(l,r.name.value)||v.invariant.error(116,G(r),t)});try{let[i,o]=a.identify(t,{typename:l,selectionSet:r,fragmentMap:n.fragmentMap,storeObject:u,readField:c});e=e||i,o&&(u=n.merge(u,o))}catch(t){if(!e)throw t}if("string"==typeof e){let o=tg(e),a=n.written[e]||(n.written[e]=[]);if(a.indexOf(r)>=0||(a.push(r),this.reader&&this.reader.isFresh(t,o,r,n)))return o;let s=n.incomingById.get(e);return s?(s.storeObject=n.merge(s.storeObject,u),s.mergeTree=function e(t,r){if(t===r||!r||rr(r))return t;if(!t||rr(t))return r;let n=t.info&&r.info?{...t.info,...r.info}:t.info||r.info,i=t.map.size&&r.map.size,o={info:n,map:i?new Map:t.map.size?t.map:r.map};if(i){let n=new Set(r.map.keys());t.map.forEach((t,i)=>{o.map.set(i,e(t,r.map.get(i))),n.delete(i)}),n.forEach(n=>{o.map.set(n,e(r.map.get(n),t.map.get(n)))})}return o}(s.mergeTree,i),d.forEach(e=>s.fieldNodeSet.add(e))):n.incomingById.set(e,{storeObject:u,mergeTree:rr(i)?void 0:i,fieldNodeSet:d}),o}return u}processFieldValue(e,t,r,n,i){return t.selectionSet&&null!==e?eE(e)?e.map((e,o)=>{let a=this.processFieldValue(e,t,r,rt(n,o),[...i,o]);return rn(n,o),a}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n,path:i}):s.__DEV__?function e(t,r){switch(t5.call(t)){case"[object Array]":{if((r=r||new Map).has(t))return r.get(t);let n=t.slice(0);return r.set(t,n),n.forEach(function(t,i){n[i]=e(t,r)}),n}case"[object Object]":{if((r=r||new Map).has(t))return r.get(t);let n=Object.create(Object.getPrototypeOf(t));return r.set(t,n),Object.keys(t).forEach(i=>{n[i]=e(t[i],r)}),n}default:return t}}(e):e}flattenFields(e,t,r,n=ro(t,e,r.fragmentMap)){let i=new Map,{policies:o}=this.cache,a=new m.Trie(!1);return!function e(s,u){let l=a.lookup(s,u.clientOnly,u.deferred);l.visited||(l.visited=!0,s.selections.forEach(a=>{if(!eN(a,r.variables))return;let{clientOnly:s,deferred:l}=u;if(!(s&&l)&&eO(a.directives)&&a.directives.forEach(e=>{let t=e.name.value;if("client"===t&&(s=!0),"defer"===t){let t=tM(e,r.variables);t&&!1===t.if||(l=!0)}}),eD(a)){let e=i.get(a);e&&(s=s&&e.clientOnly,l=l&&e.deferred),i.set(a,t9(r,s,l))}else{let i=eI(a,r.lookupFragment);if(!i&&a.kind===b.Kind.FRAGMENT_SPREAD)throw(0,v.newInvariantError)(117,a.name.value);i&&o.fragmentMatches(i,n,t,r.variables)&&e(i.selectionSet,t9(r,s,l))}}))}(e,r),i}applyMerges(e,t,r,n,i){if(e.map.size&&!e6(r)){let o,a=!eE(r)&&(e6(t)||tS(t))?t:void 0,s=r;a&&!i&&(i=[e6(a)?a.__ref:a]);let u=(e,t)=>eE(e)?"number"==typeof t?e[t]:void 0:n.store.getFieldValue(e,String(t));e.map.forEach((e,t)=>{let r=u(a,t),l=u(s,t);if(void 0===l)return;i&&i.push(t);let c=this.applyMerges(e,r,l,n,i);c!==l&&(o=o||new Map).set(t,c),i&&(0,v.invariant)(i.pop()===t)}),o&&(r=eE(s)?s.slice(0):{...s},o.forEach((e,t)=>{r[t]=e}))}return e.info?this.cache.policies.runMergeFunction(t,r,e.info,n,i&&n.store.getStorage(...i)):r}}let re=[];function rt({map:e},t){return e.has(t)||e.set(t,re.pop()||{map:new Map}),e.get(t)}function rr(e){return!e||!(e.info||e.map.size)}function rn({map:e},t){let r=e.get(t);r&&rr(r)&&(re.push(r),e.delete(t))}let ri=new Set;function ro(e,t,r){let n;for(let r of t.selections)if(eD(r)){if("__typename"===r.name.value)return e[G(r)]}else n?n.push(r):n=[r];if("string"==typeof e.__typename)return e.__typename;if(n)for(let t of n){let n=ro(e,eI(t,r).selectionSet,r);if("string"==typeof n)return n}}class ra extends ta{data;optimisticData;config;watches=new Set;storeReader;storeWriter;addTypenameTransform=new a.DocumentTransform(e8);maybeBroadcastWatch;assumeImmutableResults=!0;policies;makeVar=tH.makeVar;constructor(e={}){super(),this.config=function(e){return(0,l.compact)(tb,e)}(e),this.policies=new t0({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){let e=this.data=new tT.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()}resetResultCache(){let{fragments:e}=this.config;this.addTypenameTransform.resetCache(),e?.resetCaches(),this.storeWriter=new t7(this,this.storeReader=new t6({cache:this,fragments:e}),e),this.maybeBroadcastWatch=(0,J.wrap)((e,t)=>this.broadcastWatch(e,t),{max:ee.cacheSizes["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:e=>{let t=e.optimistic?this.optimisticData:this.data;if(tN(t)){let{optimistic:r,id:n,variables:i}=e;return t.makeCacheKey(e.query,e.callback,(0,j.canonicalStringify)({optimistic:r,id:n,variables:i}))}}}
2),new Set([this.data.group,this.optimisticData.group]).forEach(e=>e.resetCaching())}restore(e){return this.init(),e&&this.data.replace(e),this}extract(e=!1){return(e?this.optimisticData:this.data).extract()}read(e){let{returnPartialData:t=!1}=e;return this.storeReader.diffQueryAgainstStore({...e,store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:t}).result}write(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}}modify(e){if(tm.call(e,"id")&&!e.id)return!1;let t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields,!1)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}}diff(e){return this.storeReader.diffQueryAgainstStore({...e,store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config})}watch(e){return this.watches.size||(0,tH.recallCache)(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),()=>{this.watches.delete(e)&&!this.watches.size&&(0,tH.forgetCache)(this),this.maybeBroadcastWatch.forget(e)}}gc(e){j.canonicalStringify.reset(),ep.reset();let t=this.optimisticData.gc();return e&&!this.txCount&&e.resetResultCache&&this.resetResultCache(),t}retain(e,t){return(t?this.optimisticData:this.data).retain(e)}release(e,t){return(t?this.optimisticData:this.data).release(e)}identify(e){if(e6(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){s.__DEV__&&v.invariant.warn(e)}}evict(e){if(!e.id){if(tm.call(e,"id"))return!1;e={...e,id:"ROOT_QUERY"}}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}}reset(e){return this.init(),j.canonicalStringify.reset(),e&&e.discardWatches?(this.watches.forEach(e=>this.maybeBroadcastWatch.forget(e)),this.watches.clear(),(0,tH.forgetCache)(this)):this.broadcastWatches(),Promise.resolve()}removeOptimistic(e){let t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())}txCount=0;batch(e){let t,{update:r,optimistic:n=!0,removeOptimistic:i,onWatchUpdated:o}=e,a=e=>{let{data:n,optimisticData:i}=this;++this.txCount,e&&(this.data=this.optimisticData=e);try{return t=r(this)}finally{--this.txCount,this.data=n,this.optimisticData=i}},s=new Set;return o&&!this.txCount&&this.broadcastWatches({...e,onWatchUpdated:e=>(s.add(e),!1)}),"string"==typeof n?this.optimisticData=this.optimisticData.addLayer(n,a):!1===n?a(this.data):a(),"string"==typeof i&&(this.optimisticData=this.optimisticData.removeLayer(i)),o&&s.size?(this.broadcastWatches({...e,onWatchUpdated(e,t){let r=o.call(this,e,t);return!1!==r&&s.delete(e),r}}),s.size&&s.forEach(e=>this.maybeBroadcastWatch.dirty(e))):this.broadcastWatches(e),t}performTransaction(e,t){return this.batch({update:e,optimistic:t||null!==t})}transformDocument(e){return this.addTypenameTransform.transformDocument(this.addFragmentsToDocument(e))}fragmentMatches(e,t){return this.policies.fragmentMatches(e,t)}lookupFragment(e){return this.config.fragments?.lookup(e)||null}resolvesClientField(e,t){return!!this.policies.getReadFunction(e,t)}broadcastWatches(e){if(!this.txCount){let t=this.onAfterBroadcast,r=new Set;this.onAfterBroadcast=e=>{r.add(e)};try{this.watches.forEach(t=>this.maybeBroadcastWatch(t,e)),r.forEach(e=>e())}finally{this.onAfterBroadcast=t}}}addFragmentsToDocument(e){let{fragments:t}=this.config;return t?t.transform(e):e}broadcastWatch(e,t){let{lastDiff:r}=e,n=this.diff(e);(!t||(e.optimistic&&"string"==typeof t.optimistic&&(n.fromOptimisticTransaction=!0),!t.onWatchUpdated||!1!==t.onWatchUpdated.call(this,e,n,r)))&&(r&&(0,$.equal)(r.result,n.result)||e.callback(e.lastDiff=n,r))}}s.__DEV__&&(ra.prototype.getMemoryInternals=c.getInMemoryCacheMemoryInternals),e.s(["InMemoryCache",0,ra],28792);var rs=e.i(65646);class ru extends rs.ApolloLink{constructor(e={}){super((t,r)=>{let n=t.client,i=n.queryManager.clientOptions,o=t.getContext();{let{name:r,version:n,transport:a="headers"}=(0,l.compact)({},i.clientAwareness,e.clientAwareness,o.clientAwareness);"headers"===a&&t.setContext(({headers:e})=>
2({headers:(0,l.compact)({"apollographql-client-name":r,"apollographql-client-version":n},e)}))}{let{transport:r="extensions"}=(0,l.compact)({},i.enhancedClientAwareness,e.enhancedClientAwareness);"extensions"===r&&(t.extensions=(0,l.compact)({clientLibrary:{name:"@apollo/client",version:n.version}},t.extensions)),"headers"===r&&t.setContext(({headers:e})=>({headers:(0,l.compact)({"apollographql-library-name":"@apollo/client","apollographql-library-version":n.version},e)}))}return r(t)})}}function rl(e,t){return(0,Z.getOperationDefinition)(e)?.operation===t}e.s(["ClientAwarenessLink",0,ru],508460),e.s(["filterOperationVariables",0,function(e,t){let r={...e},n=new Set(Object.keys(e));return(0,y.visit)(t,{Variable(e,t,r){r&&"VariableDefinition"!==r.kind&&n.delete(e.name.value)}}),n.forEach(e=>{delete r[e]}),r}],536497),e.s(["isMutationOperation",0,function(e){return rl(e,"mutation")},"isSubscriptionOperation",0,function(e){return rl(e,"subscription")}],643717),e.s(["checkFetcher",0,e=>{(0,v.invariant)(e||"u">typeof fetch,61)}],589863)},272315,320487,161375,e=>{"use strict";function t(e,t){return"object"==typeof e&&null!==e&&e[Symbol.for("apollo.error")]===t}function r(e){Object.defineProperty(e,Symbol.for("apollo.error"),{value:e.name,enumerable:!1,writable:!1,configurable:!1})}function n(e){return e.filter(e=>e).map(e=>e.message||"Error message not found.").join("\n")}e.s(["brand",0,r,"isBranded",0,t],320487);class i extends Error{static is(e){return t(e,"CombinedGraphQLErrors")}static formatMessage=n;errors;data;extensions;constructor(e,t=e.errors||[]){super(i.formatMessage(t,{result:e,defaultFormatMessage:n})),this.errors=t,this.data=e.data,this.extensions=e.extensions,this.name="CombinedGraphQLErrors",r(this),Object.setPrototypeOf(this,i.prototype)}}function o(e){return e.map(e=>e.message||"Error message not found.").join("\n")}e.s(["CombinedGraphQLErrors",0,i],272315);class a extends Error{static is(e){return t(e,"CombinedProtocolErrors")}static formatMessage=o;errors;constructor(e){super(a.formatMessage(e,{defaultFormatMessage:o})),this.name="CombinedProtocolErrors",this.errors=e,r(this),Object.setPrototypeOf(this,a.prototype)}}e.s(["CombinedProtocolErrors",0,a],161375)},71563,998187,e=>{"use strict";var t=e.i(320487);class r extends Error{static is(e){return(0,t.isBranded)(e,"ServerError")}response;statusCode;bodyText;constructor(e,n){super(e),this.name="ServerError",this.response=n.response,this.statusCode=n.response.status,this.bodyText=n.bodyText,(0,t.brand)(this),Object.setPrototypeOf(this,r.prototype)}}e.s(["ServerError",0,r],71563);class n extends Error{static is(e){return(0,t.isBranded)(e,"ServerParseError")}response;statusCode;bodyText;constructor(e,r){super(e instanceof Error?e.message:"Could not parse server response",{cause:e}),this.name="ServerParseError",this.response=r.response,this.statusCode=r.response.status,this.bodyText=r.bodyText,(0,t.brand)(this),Object.setPrototypeOf(this,n.prototype)}}e.s(["ServerParseError",0,n],998187)},527248,569442,e=>{"use strict";var t=e.i(65646),r=e.i(508460),n=e.i(1231),i=t,o=e.i(536497),a=e.i(643717),s=e.i(859869),u=e.i(477577),l=e.i(745581),c=e.i(589863),d=e.i(161375),f=e.i(492366),h=e.i(71563),p=e.i(998187),v=e.i(732359),g=e.i(260292);let{hasOwnProperty:m}=Object.prototype;async function*y(e){let t,r=new TextDecoder("utf-8"),n=e.headers?.get("content-type"),i=n?.match(/;\s*boundary=(?:'([^']+)'|"([^"]+)"|([^"'].+?))\s*(?:;|$)/i),o="\r\n--"+(i?i[1]??i[2]??i[3]??"-":"-"),a="";(0,g.invariant)(e.body&&"function"==typeof e.body.getReader,62);let s=e.body.getReader(),u=!1,l=!1,c=()=>l&&"-"==a[0]&&"-"==a[1];try{for(;!u;){({value:t,done:u}=await s.read());let e="string"==typeof t?t:r.decode(t,{stream:!u}),n=a.length-o.length+1,i=(a+=e).indexOf(o,n);for(;i>-1&&!c();){let e;l=!0,[e,a]=[a.slice(0,i),a.slice(i+o.length)];let t=e.indexOf("\r\n\r\n"),r=function(e){let t={};return e.split("\n").forEach(e=>{let r=e.indexOf(":");if(r>-1){let n=e.slice(0,r).trim().toLowerCase(),i=e.slice(r+1).trim();t[n]=i}}),t}(e.slice(0,t))["content-type"];if(r&&-1===r.toLowerCase().indexOf("application/json"))throw Error("Unsupported patch content type: application/json is required.");let n=e.slice(t);n&&(yield n),i=a.indexOf(o)}if(c())return}throw Error("premature end of multipart body")}finally{s.cancel()}}async function b(e,t){for await(let r of y(e)){let n=_(e,r);if(0!=Object.keys(n).length)if((0,v.isNonNullObject)(n)&&"payload"in n){if(1===Object.keys(n).length&&null===n.payload)return;let e={...n.payload};
2"errors"in n&&(e.extensions={...e.extensions,[f.PROTOCOL_ERRORS_SYMBOL]:new d.CombinedProtocolErrors(n.errors??[])}),t(e)}else t(n)}}function _(e,t){if(e.status>=300)throw new h.ServerError(`Response not successful: Received status code ${e.status}`,{response:e,bodyText:t});try{return JSON.parse(t)}catch(r){throw new p.ServerParseError(r,{response:e,bodyText:t})}}var w=e.i(676098);let S={http:{includeQuery:!0,includeExtensions:!0,preserveHeaderCase:!1},headers:{accept:"application/graphql-response+json,application/json;q=0.9","content-type":"application/json"},options:{method:"POST"}},k=(e,t)=>t(e),E=(0,l.maybe)(()=>fetch);function O(){}class x extends i.ApolloLink{constructor(e={}){let{uri:t="/graphql",fetch:r,print:i=k,includeExtensions:d,preserveHeaderCase:f,useGETForQueries:v,includeUnusedVariables:g=!1,...y}=e;s.__DEV__&&(0,c.checkFetcher)(r||E);const x={http:(0,u.compact)({includeExtensions:d,preserveHeaderCase:f}),options:y.fetchOptions,credentials:y.credentials,headers:y.headers};super(e=>{let s,u=(s=e.getContext().uri)||("function"==typeof t?t(e):t||"/graphql"),c=e.getContext(),d={...c.http};(0,a.isSubscriptionOperation)(e.query)&&(d.accept=["multipart/mixed;boundary=graphql;subscriptionSpec=1.0",...d.accept||[]]);let{options:f,body:y}=function(e,t,...r){let n={},i={};r.forEach(e=>{n={...n,...e.options,headers:{...n.headers,...e.headers}},e.credentials&&(n.credentials=e.credentials),n.headers.accept=(e.http?.accept||[]).concat(n.headers.accept).join(","),i={...i,...e.http}}),n.headers=function(e,t){if(!t){let t={};
2return Object.keys(Object(e)).forEach(r=>{t[r.toLowerCase()]=e[r]}),t}let r={};Object.keys(Object(e)).forEach(t=>{r[t.toLowerCase()]={originalName:t,value:e[t]}});let n={};return Object.keys(r).forEach(e=>{n[r[e].originalName]=r[e].value}),n}(n.headers,i.preserveHeaderCase);let{operationName:o,extensions:a,variables:s,query:u}=e,l={operationName:o,variables:s};return i.includeExtensions&&Object.keys(a||{}).length&&(l.extensions=a),i.includeQuery&&(l.query=t(u,w.print)),{options:n,body:l}}(e,i,S,x,{http:d,options:c.fetchOptions,credentials:c.credentials,headers:c.headers});y.variables&&!g&&(y.variables=(0,o.filterOperationVariables)(y.variables,e.query));let k=new AbortController,T=()=>{k=void 0};if(f.signal){let e=f.signal,t=()=>{k?.abort(e.reason)};e.addEventListener("abort",t,{once:!0}),T=()=>{k?.signal.removeEventListener("abort",T),k=void 0,e.removeEventListener("abort",t),T=O},k.signal.addEventListener("abort",T,{once:!0})}return f.signal=k.signal,v&&!(0,a.isMutationOperation)(e.query)&&(f.method="GET"),new n.Observable(t=>{if("GET"===f.method){let{newURI:e,parseError:t}=function(e,t){let r=[],n=(e,t)=>{r.push(`${e}=${encodeURIComponent(t)}`)};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){let e;try{e=JSON.stringify(t.variables)}catch(e){return{parseError:e}}n("variables",e)}if(t.extensions){let e;try{e=JSON.stringify(t.extensions)}catch(e){return{parseError:e}}n("extensions",e)}let i="",o=e,a=e.indexOf("#");-1!==a&&(i=e.substr(a),o=e.substr(0,a));let s=-1===o.indexOf("?")?"?":"&";return{newURI:o+s+r.join("&")+i}}(u,y);if(t)throw t;u=e}else f.body=JSON.stringify(y);let n=r||(0,l.maybe)(()=>fetch)||E,i=t.next.bind(t);return n(u,f).then(t=>{e.setContext({response:t});let r=t.headers?.get("content-type");return null!==r&&/^multipart\/mixed/i.test(r)?b(t,i):(t=>t.text().then(r=>{let n=function(e,t){let r=e.headers.get("content-type");if(r?.includes("application/graphql-response+json"))try{return JSON.parse(t)}catch(r){throw new p.ServerParseError(r,{response:e,bodyText:t})}return _(e,t)}(t,r);if(!Array.isArray(n)&&!m.call(n,"data")&&!m.call(n,"errors"))throw new h.ServerError(`Server response was malformed for query '${Array.isArray(e)?e.map(e=>e.operationName):e.operationName}'.`,{response:t,bodyText:r});return n}))(t).then(i)}).then(()=>{T(),t.complete()}).catch(e=>{T(),t.error(e)}),()=>{k&&k.abort()}})})}}class T extends t.ApolloLink{constructor(e={}){const{left:n,right:i,request:o}=t.ApolloLink.from([new r.ClientAwarenessLink(e),new x(e)]);super(o),Object.assign(this,{left:n,right:i})}}e.s(["HttpLink",0,T],527248);var C=t;class P extends C.ApolloLink{constructor(e){super((t,r)=>{let{...i}=t;return Object.defineProperty(i,"client",{enumerable:!1,value:t.client}),new n.Observable(n=>{let o=!1;return Promise.resolve(i).then(r=>e(t.getContext(),r)).then(t.setContext).then(()=>{o||r(t).subscribe(n)}).catch(n.error.bind(n)),()=>{o=!0}})})}}e.s(["SetContextLink",0,P],569442)},377902,e=>{"use strict";var t=e.i(999161),r=e.i(953525);e.s(["useReactiveVar",0,function(e){return(0,r.useSyncExternalStore)(t.useCallback(t=>e.onNextChange(function r(){t(),e.onNextChange(r)}),[e]),e,e)}])},913492,(e,t,r)=>{"use strict";let n;Object.defineProperty(r,"__esModule",{value:!0}),r.parse=function(e,t){let r=new l,n=e.length;if(n<2)return r;let i=t?.decode||f,o=0;do{let t=e.indexOf("=",o);if(-1===t)break;let a=e.indexOf(";",o),s=-1===a?n:a;if(t>s){o=e.lastIndexOf(";",t-1)+1;continue}let u=c(e,o,t),l=d(e,t,u),f=e.slice(u,l);if(void 0===r[f]){let n=c(e,t+1,s),o=d(e,s,n),a=i(e.slice(n,o));r[f]=a}o=s+1}while(o<n)return r},r.serialize=function(e,t,r){let n=r?.encode||encodeURIComponent;if(!i.test(e))throw TypeError(`argument name is invalid: ${e}`);let l=n(t);if(!o.test(l))throw TypeError(`argument val is invalid: ${t}`);let c=e+"="+l;if(!r)return c;if(void 0!==r.maxAge){if(!Number.isInteger(r.maxAge))throw TypeError(`option maxAge is invalid: ${r.maxAge}`);c+="; Max-Age="+r.maxAge}if(r.domain){if(!a.test(r.domain))throw TypeError(`option domain is invalid: ${r.domain}`);c+="; Domain="+r.domain}if(r.path){if(!s.test(r.path))throw TypeError(`option path is invali
2d: ${r.path}`);c+="; Path="+r.path}if(r.expires){var d;if(d=r.expires,"[object Date]"!==u.call(d)||!Number.isFinite(r.expires.valueOf()))throw TypeError(`option expires is invalid: ${r.expires}`);c+="; Expires="+r.expires.toUTCString()}if(r.httpOnly&&(c+="; HttpOnly"),r.secure&&(c+="; Secure"),r.partitioned&&(c+="; Partitioned"),r.priority)switch("string"==typeof r.priority?r.priority.toLowerCase():void 0){case"low":c+="; Priority=Low";break;case"medium":c+="; Priority=Medium";break;case"high":c+="; Priority=High";break;default:throw TypeError(`option priority is invalid: ${r.priority}`)}if(r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:case"strict":c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"none":c+="; SameSite=None";break;default:throw TypeError(`option sameSite is invalid: ${r.sameSite}`)}return c};let i=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,o=/^[\u0021-\u003A\u003C-\u007E]*$/,a=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,s=/^[\u0020-\u003A\u003D-\u007E]*$/,u=Object.prototype.toString,l=((n=function(){}).prototype=Object.create(null),n);function c(e,t,r){do{let r=e.charCodeAt(t);if(32!==r&&9!==r)return t}while(++t<r)return r}function d(e,t,r){for(;t>r;){let r=e.charCodeAt(--t);if(32!==r&&9!==r)return t+1}return r}function f(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}},576837,(e,t,r)=>{"use strict";var n=e.e&&e.e.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=e.e&&e.e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=e.e&&e.e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.CookieProvider=r.CookieContext=void 0;var s=a(e.r(999161)),u=e.r(201590),l=e.r(824310);r.CookieContext=(0,s.createContext)(null),r.CookieProvider=function(e){var t=e.children,i=e.pollingOptions,o=(0,s.useState)({}),a=o[0],c=o[1];(0,s.useEffect)(function(){var e=(0,u.getCookies)();e&&c(e)},[]),(0,u.useCookiesPolling)(function(e){e&&c(e)},i);var d=(0,s.useMemo)(function(){return{cookies:a,set:function(e,t){c(function(r){var i;return n(n({},r),((i={})[e]=encodeURIComponent((0,l.stringify)(t)),i))})},get:function(e){return null==a?void 0:a[e]},getAll:function(){return a},has:function(e){return a.hasOwnProperty(e)},delete:function(e){a.hasOwnProperty(e)&&c(function(t){var r=n({},t);return delete r[e],r})},revalidateCookiesState:function(){(0,u.revalidateCookies)(function(e){e&&c(e)},a)}}},[a]);return s.default.createElement(r.CookieContext.Provider,{value:d},t)}},214377,(e,t,r)=>{"use strict";var n=e.e&&e.e.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(r,"__esModule",{value:!0}),r.revalidateCookies=r.hasCookie=r.deleteCookie=r.setCookie=r.getCookie=r.getCookies=void 0;var i=e.r(913492),o=e.r(824310),a=function(e){if(!(0,o.isClientSide)(e))throw Error("You are trying to access cookies on the server side. Please, use the server-side import with `cookies-next/server` instead.")},s=function(e){if(a(e),"server"!==(0,o.getRenderPhase)()){for(var t={},r=document.cookie?document.cookie.split("; "):[],n=0,i=r.length;n<i;n++){var s=r[n].split("="),u=s.slice(1).join("=");t[s[0]]=u}return t}};r.getCookies=s,r.getCookie=function(e,t){a(t);var r=s(t),n=null==r?void 0:r[e];if(void 0!==n)return(0,o.decode)(n)};var u=function(e,t,r){if(a(r),"server"!==(0,o.getRenderPhase)()){var s=(0,i.serialize)(e,(0,o.stringify)(t),n({path:"/"},r||{}));document.cookie=s}};r.setCookie=u,r.deleteCookie=function(e,t){a(t),u(e,"",n(n({},t),{maxAge:-1}))},r.hasCookie=function(e,t){if(a(t),!e)return!1;var r=s(t);return!!r&&Object.prototype.hasOwnProperty.call(r,e)},r.revalidateCookies=function(e,t){if(a(),"server"!==(0,o.getRenderPhase)()){var r=s();Object.keys(n(n({},r),t)).some(function(e){return(null==r?void 0:r[e])!==(null==t?void 0:t[e])})&&(e(r),t=r)}}},45121,(e,t,r)=>{"use strict";
2Object.defineProperty(r,"__esModule",{value:!0}),r.useRevalidateCookiesState=r.useReactiveHasCookie=r.useReactiveDeleteCookie=r.useReactiveSetCookie=r.useReactiveGetCookie=r.useReactiveGetCookies=r.useReactiveCookiesNext=r.useCookiesNext=r.useHasCookie=r.useDeleteCookie=r.useSetCookie=r.useGetCookie=r.useGetCookies=r.useCookiesPolling=void 0;var n=e.r(576837),i=e.r(999161),o=e.r(214377),a=function(e){var t=(0,i.useState)(!1),r=t[0],n=t[1];return(0,i.useEffect)(function(){n(!0)},[]),r?e:function(){}},s=function(){var e=(0,i.useContext)(n.CookieContext);if(!e)throw Error("useCookieContext must be used within a CookieProvider");return e};r.useCookiesPolling=function(e,t){var r=t||{},n=r.intervalMs,a=void 0===n?1e3:n,s=r.enabled,u=void 0!==s&&s;(0,i.useEffect)(function(){if(u){var t=(0,o.getCookies)(),r=setInterval(function(){(0,o.revalidateCookies)(e,t)},a);return function(){return clearInterval(r)}}},[e,a])};var u=function(){return a(o.getCookies)};r.useGetCookies=u;var l=function(){return a(o.getCookie)};r.useGetCookie=l;var c=function(){return a(o.hasCookie)};r.useHasCookie=c;var d=function(){return a(o.setCookie)};r.useSetCookie=d;var f=function(){return a(o.deleteCookie)};r.useDeleteCookie=f,r.useCookiesNext=function(){return{getCookies:u(),getCookie:l(),hasCookie:c(),setCookie:d(),deleteCookie:f()}};var h=function(){var e=s();return function(){return null==e?void 0:e.getAll()}};r.useReactiveGetCookies=h;var p=function(){var e=s();return function(t){return null==e?void 0:e.get(t)}};r.useReactiveGetCookie=p;var v=function(){var e=s();return function(t,r,n){return null==e||e.set(t,r),(0,o.setCookie)(t,r,n)}};r.useReactiveSetCookie=v;var g=function(){var e=s();return function(t,r){return null==e||e.delete(t),(0,o.deleteCookie)(t,r)}};r.useReactiveDeleteCookie=g;var m=function(){var e=s();return function(t){return null==e?void 0:e.has(t)}};r.useReactiveHasCookie=m;var y=function(){var e=s();return function(){null==e||e.revalidateCookiesState()}};r.useRevalidateCookiesState=y,r.useReactiveCookiesNext=function(){return{getCookies:h(),getCookie:p(),hasCookie:m(),setCookie:v(),deleteCookie:g(),revalidateCookiesState:y()}}},201590,(e,t,r)=>{"use strict";var n=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=e.e&&e.e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.CookiesNextProvider=void 0,i(e.r(428096),r),i(e.r(214377),r);var o=e.r(576837);Object.defineProperty(r,"CookiesNextProvider",{enumerable:!0,get:function(){return o.CookieProvider}}),i(e.r(45121),r)},428096,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0})},824310,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getRenderPhase=r.isClientSide=r.decode=r.stringify=void 0,r.stringify=function(e){try{if("string"==typeof e)return e;return JSON.stringify(e)}catch(t){return e}},r.decode=function(e){return e?e.replace(/(%[0-9A-Z]{2}
2)+/g,decodeURIComponent):e},r.isClientSide=function(e){return!(null==e?void 0:e.req)&&!(null==e?void 0:e.res)&&!(e&&"cookies"in e&&(null==e?void 0:e.cookies))},r.getRenderPhase=function(){return"u"<typeof window?"server":"client"}},366164,e=>{"use strict";var t=e.i(265525),r=e.i(487021);e.s(["addDays",0,function(e,n,i){let o=(0,r.toDate)(e,i?.in);return isNaN(n)?(0,t.constructFrom)(i?.in||e,NaN):(n&&o.setDate(o.getDate()+n),o)}])},663382,(e,t,r)=>{t.exports=e.r(971640).Uint8Array},852190,(e,t,r)=>{t.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}},212943,(e,t,r)=>{t.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}},595992,(e,t,r)=>{var n=e.r(151193),i=e.r(663382),o=e.r(422367),a=e.r(873908),s=e.r(852190),u=e.r(212943),l=n?n.prototype:void 0,c=l?l.valueOf:void 0;t.exports=function(e,t,r,n,l,d,f){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!d(new i(e),new i(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var h=s;case"[object Set]":var p=1&n;if(h||(h=u),e.size!=t.size&&!p)break;var v=f.get(e);if(v)return v==t;n|=2,f.set(e,t);var g=a(h(e),h(t),n,l,d,f);return f.delete(e),g;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},203941,(e,t,r)=>{t.exports=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}},456666,(e,t,r)=>{var n=e.r(422367);t.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return -1}},103869,(e,t,r)=>{var n=e.r(456666),i=Array.prototype.splice;t.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():i.call(t,r,1),--this.size,!0)}},325651,(e,t,r)=>{var n=e.r(456666);t.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},66675,(e,t,r)=>{var n=e.r(456666);t.exports=function(e){return n(this.__data__,e)>-1}},197051,(e,t,r)=>{var n=e.r(456666);t.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},17131,(e,t,r)=>{var n=e.r(7405),i=e.r(103869),o=e.r(325651),a=e.r(66675),s=e.r(197051);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},210635,(e,t,r)=>{var n=e.r(17131);t.exports=function(){this.__data__=new n,this.size=0}},16673,(e,t,r)=>{t.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},283458,(e,t,r)=>{t.exports=function(e){return this.__data__.get(e)}},2692,(e,t,r)=>{t.exports=function(e){return this.__data__.has(e)}},33757,(e,t,r)=>{var n=e.r(203941),i=e.r(145948);t.exports=function(e,t,r){var o=t(e);return i(e)?o:n(o,r(e))}},889752,(e,t,r)=>{t.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}},525485,(e,t,r)=>{t.exports=function(){return[]}},526480,(e,t,r)=>{var n=e.r(889752),i=e.r(525485),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return null==e?[]:n(a(e=Object(e)),function(t){return o.call(e,t)})}:i},983872,(e,t,r)=>{var n=e.r(924519),i=e.r(460779);t.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},225083,(e,t,r)=>{var n=e.r(983872),i=e.r(460779),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")}},763287,(e,t,r)=>{var n=e.r(924519),i=e.r(358566),o=e.r(460779),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exp
2orts=function(e){return o(e)&&i(e.length)&&!!a[n(e)]}},916306,(e,t,r)=>{t.exports=function(e){return function(t){return e(t)}}},78231,(e,t,r)=>{var n=Math.floor,i=Math.random;t.exports=function(e,t){return e+n(i()*(t-e+1))}},768258,(e,t,r)=>{var n=e.r(78231);t.exports=function(e){var t=e.length;return t?e[n(0,t-1)]:void 0}},604329,(e,t,r)=>{t.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},577846,(e,t,r)=>{var n=e.r(714530);t.exports=function(e,t){return n(t,function(t){return e[t]})}},314433,(e,t,r)=>{var n=e.r(145948),i=e.r(795386),o=e.r(733740),a=e.r(213296);t.exports=function(e,t){return n(e)?e:i(e,t)?[e]:o(a(e))}},277993,(e,t,r)=>{var n=e.r(983631),i=1/0;t.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-i?"-0":t}},209092,(e,t,r)=>{var n=e.r(314433),i=e.r(277993);t.exports=function(e,t){t=n(t,e);for(var r=0,o=t.length;null!=e&&r<o;)e=e[i(t[r++])];return r&&r==o?e:void 0}},691152,(e,t,r)=>{var n=e.r(209092);t.exports=function(e,t,r){var i=null==e?void 0:n(e,t);return void 0===i?r:i}},933534,(e,t,r)=>{t.exports=function(e,t){return null!=e&&t in Object(e)}},129718,(e,t,r)=>{var n=e.r(314433),i=e.r(225083),o=e.r(145948),a=e.r(194910),s=e.r(358566),u=e.r(277993);t.exports=function(e,t,r){t=n(t,e);for(var l=-1,c=t.length,d=!1;++l<c;){var f=u(t[l]);if(!(d=null!=e&&r(e,f)))break;e=e[f]}return d||++l!=c?d:!!(c=null==e?0:e.length)&&s(c)&&a(f,c)&&(o(e)||i(e))}},963069,(e,t,r)=>{var n=e.r(933534),i=e.r(129718);t.exports=function(e,t){return null!=e&&i(e,t,n)}},954985,(e,t,r)=>{var n=e.r(895772),i=e.r(691152),o=e.r(963069),a=e.r(795386),s=e.r(332145),u=e.r(793165),l=e.r(277993);t.exports=function(e,t){return a(e)&&s(t)?u(l(e),t):function(r){var a=i(r,e);return void 0===a&&a===t?o(r,e):n(t,a,3)}}},172696,(e,t,r)=>{t.exports=function(e){return e}},378081,(e,t,r)=>{t.exports=function(e){return function(t){return null==t?void 0:t[e]}}},809412,(e,t,r)=>{var n=e.r(209092);t.exports=function(e){return function(t){return n(t,e)}}},801924,(e,t,r)=>{var n=e.r(378081),i=e.r(809412),o=e.r(795386),a=e.r(277993);t.exports=function(e){return o(e)?n(a(e)):i(e)}},729077,(e,t,r)=>{var n=e.r(324940),i=e.r(954985),o=e.r(172696),a=e.r(145948),s=e.r(801924);t.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):n(e):s(e)}},400338,(e,t,r)=>{var n=e.r(275887);t.exports=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}()},406305,(e,t,r)=>{var n=e.r(400338);t.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},271963,(e,t,r)=>{var n=e.r(406305),i=e.r(422367),o=Object.prototype.hasOwnProperty;t.exports=function(e,t,r){var a=e[t];o.call(e,t)&&i(a,r)&&(void 0!==r||t in e)||n(e,t,r)}},100183,(e,t,r)=>{var n=e.r(271963),i=e.r(314433),o=e.r(194910),a=e.r(377882),s=e.r(277993);t.exports=function(e,t,r,u){if(!a(e))return e;t=i(t,e);for(var l=-1,c=t.length,d=c-1,f=e;null!=f&&++l<c;){var h=s(t[l]),p=r;if("__proto__"===h||"constructor"===h||"prototype"===h)break;if(l!=d){var v=f[h];void 0===(p=u?u(v,h,f):void 0)&&(p=a(v)?v:o(t[l+1])?[]:{})}n(f,h,p),f=f[h]}return e}},394146,(e,t,r)=>{var n=e.r(209092),i=e.r(100183),o=e.r(314433);t.exports=function(e,t,r){for(var a=-1,s=t.length,u={};++a<s;){var l=t[a],c=n(e,l);r(c,l)&&i(u,o(l,e),c)}return u}},970818,(e,t,r)=>{t.exports=e.r(947453)(Object.getPrototypeOf,Object)},491355,(e,t,r)=>{var n=e.r(203941),i=e.r(970818),o=e.r(526480),a=e.r(525485);t.exports=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,o(e)),e=i(e);return t}:a},493967,(e,t,r)=>{t.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},119919,(e,t,r)=>{var n=e.r(377882),i=e.r(85057),o=e.r(493967),a=Object.prototype.hasOwnProperty;t.exports=function(e){if(!n(e))return o(e);var t=i(e),r=[];for(var s in e)"constructor"==s&&(t||!a.call(e,s))||r.push(s);return r}},409516,(e,t,r)=>{var n=e.r(312069),i=e.r(119919),o=e.r(775484);t.exports=function(e){return o(e)?n(e,!0):i(e)}},477739,(e,t,r)=>{var n=e.r(33757),i=e.r(491355),o=e.r(409516);t.exports=function(e){return n(e,o,i)}},754361,(e,t,r)=>{var n=e.r(714530),i=e.r(729077),o=e.r(394146),a=e.r(477739);t.exports=function(e,t){if(null==e)return{};var r=n(a(e),function(e){return[e]});return t=i(t),o(e,r,function(e,r){return t(e,r[0])})}},81793,(e,t,r)=>{t.exports=e.r(971640)["__core-js_shared__"]},159225,(e,t,r)=>{var n,i=e.r(81793),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(sr
2c)_1."+n:"";t.exports=function(e){return!!o&&o in e}},430062,(e,t,r)=>{var n=Function.prototype.toString;t.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},545297,(e,t,r)=>{var n=e.r(95840),i=e.r(159225),o=e.r(377882),a=e.r(430062),s=/^\[object .+?Constructor\]$/,u=Object.prototype,l=Function.prototype.toString,c=u.hasOwnProperty,d=RegExp("^"+l.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!o(e)||i(e))&&(n(e)?d:s).test(a(e))}},50448,(e,t,r)=>{t.exports=function(e,t){return null==e?void 0:e[t]}},275887,(e,t,r)=>{var n=e.r(545297),i=e.r(50448);t.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},966355,(e,t,r)=>{t.exports=e.r(275887)(e.r(971640),"Map")},310139,(e,t,r)=>{t.exports=e.r(275887)(Object,"create")},540988,(e,t,r)=>{var n=e.r(310139);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},893245,(e,t,r)=>{t.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t}},117234,(e,t,r)=>{var n=e.r(310139),i=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},860182,(e,t,r)=>{var n=e.r(310139),i=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},62169,(e,t,r)=>{var n=e.r(310139);t.exports=function(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},128202,(e,t,r)=>{var n=e.r(540988),i=e.r(893245),o=e.r(117234),a=e.r(860182),s=e.r(62169);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},182828,(e,t,r)=>{var n=e.r(128202),i=e.r(17131),o=e.r(966355);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},276576,(e,t,r)=>{t.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},539656,(e,t,r)=>{var n=e.r(276576);t.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},697934,(e,t,r)=>{var n=e.r(539656);t.exports=function(e){var t=n(this,e).delete(e);return this.size-=!!t,t}},102410,(e,t,r)=>{var n=e.r(539656);t.exports=function(e){return n(this,e).get(e)}},528649,(e,t,r)=>{var n=e.r(539656);t.exports=function(e){return n(this,e).has(e)}},928106,(e,t,r)=>{var n=e.r(539656);t.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=+(r.size!=i),this}},622632,(e,t,r)=>{var n=e.r(182828),i=e.r(697934),o=e.r(102410),a=e.r(528649),s=e.r(928106);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},966404,(e,t,r)=>{var n=e.r(17131),i=e.r(966355),o=e.r(622632);t.exports=function(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new o(a)}return r.set(e,t),this.size=r.size,this}},318732,(e,t,r)=>{var n=e.r(17131),i=e.r(210635),o=e.r(16673),a=e.r(283458),s=e.r(2692),u=e.r(966404);function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=i,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=s,l.prototype.set=u,t.exports=l},752064,(e,t,r)=>{t.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},256962,(e,t,r)=>{t.exports=function(e){return this.__data__.has(e)}},417772,(e,t,r)=>{var n=e.r(622632),i=e.r(752064),o=e.r(256962);function a(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,t.exports=a},761452,(e,t,r)=>{t.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},454345,(e,t,r)=>{t.exports=function(e,t){return e.has(t)}},873908,(e,t,r)=>{var n=e.r(417772),i=e.r(761452),o=e.r(454345);t.exports=function(e,t,r,a,s,u){var l=1&r,c=e.length,d=t.length;if(c!=d&&!(l&&d>c))return!1;var f=u.get(e),h=u.get(t);if(f&&h)return f==t&&h==e;var p=-1,v=!0,g=2&r?new n:void 0;for(u.set(e,t),u.set(t,e);++p<c;){var m=e[p],y=t[p];if(a)var b=l?a(y,m,p,t,e,u):a(m,y,p,e,t,u);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!i(t,function(e,t){if(!o(g,t)&&(m===e||s(m,e,r,a,u)))return g.push(t)})){v=!1;break}}else if(!(m===y||s(m,y,r,a,u))){v=!1;break}}return u.delete(e),u.delete(t),v}},950710,(e,t,r)=>{var n=e.r(33757),i=e.r(526480),o=e.r(375493);t.exports=function(e){return n(e,o,i)}},226480,(e,t,r)=>{var n=e.r(950710),i=Object.prototype.hasOwnProperty;t.exports=function(e,t,r,o,a,s){var u=1&r,l=n(e),c=l.length;if(c!=n(t).length&&!u)return!1;for(var d=c;d--;){var f=l[d];if(!(u?f in t:i.call(t,f)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var v=!0;s.set(e,t),s.set(t,e);for(var g=u;++d<c;){var m=e[f=l[d]],y=t[f];if(o)var b=u?o(y,m,f,t,e,s):o(m,y,f,e,t,s);if(!(void 0===b?m===y||a(m,y,r,o,s):b)){v=!1;break}g||(g="constructor"==f)}if(v&&!g){var _=e.constructor,w=t.constructor;_!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof _&&_ instanceof _&&"function"==typeof w&&w instanceof w)&&(v=!1)}return s.delete(e),s.delete(t),v}},22624,(e,t,r)=>{t.exports=e.r(275887)(e.r(971640),"DataView")},451248,(e,t,r)=>{t.exports=e.r(275887)(e.r(971640),"Promise")},463871,(e,t,r)=>{t.exports=e.r(275887)(e.r(971640),"Set")},729415,(e,t,r)=>{t.exports=e.r(275887)(e.r(971640),"WeakMap")},854059,(e,t,r)=>{var n=e.r(22624),i=e.r(966355),o=e.r(451248),a=e.r(463871),s=e.r(729415),u=e.r(924519),l=e.r(430062),c="[object Map]",d="[object Promise]",f="[object Set]",h="[object WeakMap]",p="[object DataView]",v=l(n),g=l(i),m=l(o),y=l(a),b=l(s),_=u;
2(n&&_(new n(new ArrayBuffer(1)))!=p||i&&_(new i)!=c||o&&_(o.resolve())!=d||a&&_(new a)!=f||s&&_(new s)!=h)&&(_=function(e){var t=u(e),r="[object Object]"==t?e.constructor:void 0,n=r?l(r):"";if(n)switch(n){case v:return p;case g:return c;case m:return d;case y:return f;case b:return h}return t}),t.exports=_},99004,(e,t,r)=>{var n=e.r(318732),i=e.r(873908),o=e.r(595992),a=e.r(226480),s=e.r(854059),u=e.r(145948),l=e.r(904216),c=e.r(562081),d="[object Arguments]",f="[object Array]",h="[object Object]",p=Object.prototype.hasOwnProperty;t.exports=function(e,t,r,v,g,m){var y=u(e),b=u(t),_=y?f:s(e),w=b?f:s(t);_=_==d?h:_,w=w==d?h:w;var S=_==h,k=w==h,E=_==w;if(E&&l(e)){if(!l(t))return!1;y=!0,S=!1}if(E&&!S)return m||(m=new n),y||c(e)?i(e,t,r,v,g,m):o(e,t,_,r,v,g,m);if(!(1&r)){var O=S&&p.call(e,"__wrapped__"),x=k&&p.call(t,"__wrapped__");if(O||x){var T=O?e.value():e,C=x?t.value():t;return m||(m=new n),g(T,C,r,v,m)}}return!!E&&(m||(m=new n),a(e,t,r,v,g,m))}},895772,(e,t,r)=>{var n=e.r(99004),i=e.r(460779);t.exports=function e(t,r,o,a,s){return t===r||(null!=t&&null!=r&&(i(t)||i(r))?n(t,r,o,a,e,s):t!=t&&r!=r)}},682299,(e,t,r)=>{var n=e.r(318732),i=e.r(895772);t.exports=function(e,t,r,o){var a=r.length,s=a,u=!o;if(null==e)return!s;for(e=Object(e);a--;){var l=r[a];if(u&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<s;){var c=(l=r[a])[0],d=e[c],f=l[1];if(u&&l[2]){if(void 0===d&&!(c in e))return!1}else{var h=new n;if(o)var p=o(d,f,c,e,t,h);if(!(void 0===p?i(f,d,3,o,h):p))return!1}}return!0}},332145,(e,t,r)=>{var n=e.r(377882);t.exports=function(e){return e==e&&!n(e)}},186078,(e,t,r)=>{var n=e.r(332145),i=e.r(375493);t.exports=function(e){for(var t=i(e),r=t.length;r--;){var o=t[r],a=e[o];t[r]=[o,a,n(a)]}return t}},793165,(e,t,r)=>{t.exports=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}},324940,(e,t,r)=>{var n=e.r(682299),i=e.r(186078),o=e.r(793165);t.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}},194910,(e,t,r)=>{var n=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var r=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},795386,(e,t,r)=>{var n=e.r(145948),i=e.r(983631),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!!("number"==r||"symbol"==r||"boolean"==r||null==e||i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},323338,(e,t,r)=>{var n=e.r(622632);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(i.Cache||n),r}
2i.Cache=n,t.exports=i},618862,(e,t,r)=>{var n=e.r(323338);t.exports=function(e){var t=n(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}},733740,(e,t,r)=>{var n=e.r(618862),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g;t.exports=n(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,function(e,r,n,i){t.push(n?i.replace(o,"$1"):r||e)}),t})},7405,(e,t,r)=>{t.exports=function(){this.__data__=[],this.size=0}},376750,(e,t,r)=>{var n=e.r(186231),i=r&&!r.nodeType&&r,o=i&&t&&!t.nodeType&&t,a=o&&o.exports===i&&n.process;t.exports=function(){try{var e=o&&o.require&&o.require("util").types;if(e)return e;return a&&a.binding&&a.binding("util")}catch(e){}}()},562081,(e,t,r)=>{var n=e.r(763287),i=e.r(916306),o=e.r(376750),a=o&&o.isTypedArray;t.exports=a?i(a):n},312069,(e,t,r)=>{var n=e.r(604329),i=e.r(225083),o=e.r(145948),a=e.r(904216),s=e.r(194910),u=e.r(562081),l=Object.prototype.hasOwnProperty;t.exports=function(e,t){var r=o(e),c=!r&&i(e),d=!r&&!c&&a(e),f=!r&&!c&&!d&&u(e),h=r||c||d||f,p=h?n(e.length,String):[],v=p.length;for(var g in e)(t||l.call(e,g))&&!(h&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,v)))&&p.push(g);return p}},85057,(e,t,r)=>{var n=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},947453,(e,t,r)=>{t.exports=function(e,t){return function(r){return e(t(r))}}},179434,(e,t,r)=>{t.exports=e.r(947453)(Object.keys,Object)},358849,(e,t,r)=>{var n=e.r(85057),i=e.r(179434),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))o.call(e,r)&&"constructor"!=r&&t.push(r);return t}},422367,(e,t,r)=>{t.exports=function(e,t){return e===t||e!=e&&t!=t}},775484,(e,t,r)=>{var n=e.r(95840),i=e.r(358566);t.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},95840,(e,t,r)=>{var n=e.r(924519),i=e.r(377882);t.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},358566,(e,t,r)=>{t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}},377882,(e,t,r)=>{t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},375493,(e,t,r)=>{var n=e.r(312069),i=e.r(358849),o=e.r(775484);t.exports=function(e){return o(e)?n(e):i(e)}},718459,(e,t,r)=>{t.exports=function(){return!1}},904216,(e,t,r)=>{var n=e.r(971640),i=e.r(718459),o=r&&!r.nodeType&&r,a=o&&t&&!t.nodeType&&t,s=a&&a.exports===o?n.Buffer:void 0;t.exports=(s?s.isBuffer:void 0)||i},943262,(e,t,r)=>{var n=e.r(577846),i=e.r(375493);t.exports=function(e){return null==e?[]:n(e,i(e))}},71694,(e,t,r)=>{var n=e.r(768258),i=e.r(943262);t.exports=function(e){return n(i(e))}},914751,(e,t,r)=>{var n=e.r(768258),i=e.r(71694),o=e.r(145948);t.exports=function(e){return(o(e)?n:i)(e)}},18016,e=>{"use strict";var t=e.i(914751);e.s(["default",0,function(e){let r=Math.random()*(e.reduce((e,t)=>e+t.weight,0)||e.length),n=0,i=e.find(e=>r<(n+=e.weight));return i||(0,t.default)(e)||e[0]}])},524188,719420,604197,163264,225106,1231,303660,865439,280941,619717,200812,827800,791387,65646,60943,886641,782599,306902,147582,226226,691926,52340,352351,52841,451060,742924,899553,410846,36826,964701,416475,334806,693436,566628,837637,100,971657,e=>{"use strict";let t;var r,n,i=e.i(490766),o=e.i(235250);function a(e,t){return(0,i.operate)(function(r,n){var i=0;r.subscribe((0,o.createOperatorSubscriber)(n,function(r){n.next(e.call(t,r,i++))}))})}e.s(["map",0,a],524188);var s=e.i(820065),u=e.i(871595),l=e.i(914300),c=e.i(490342);let d=Object.freeze({});function f(e,t,r=l.QueryDocumentKeys){let n,i,o,a=new Map;for(let e of Object.values(c.Kind))a.set(e,function(e,t){let r=e[t];return"object"==typeof r?r:"function"==typeof r?{enter:r,leave:void 0}:{enter:e.enter,leave:e.leave}}(t,e));let h=Array.isArray(e),p=[e],v=-1,g=[],m=e,y=[],b=[];do{var _,w,S;let e,c=++v===p.length,f=c&&0!==g.length;if(c){if(i=0===b.length?void 0:y[y.length-1],m=o,o=b.pop(),f)if(h){m=m.slice();let e=0;for(let[t,r]of g){let n=t-e;null===r?(m.splice(n,1),e++):m[n]=r}}else for(let[e,t]of(m={...m},g))m[e]=t;v=n.index,p=n.keys,g=n.edits,h=n.inArray,n=n.prev}else if(o){if(null==(m=o[i=h?v:p[v]]))continue;y.push(i)}if(!Array.isArray(m)){(0,l.isNode)(m)||(0,s.devAssert)(!1,`Invalid AST Node: ${(0,u.inspect)(m)}.`);let r=c?null==(_=a.get(m.kind))?void 0:_.leave:null==(w=a.get(m.kind))?void 0:w.enter;if((e=null==r?void 0:r.call(t,m,i,o,y,b))===d)break;if(!1===e){if(!c){y.pop();continue}}else if(void 0!==e&&(g.push([i,e]),!c))if((0,l.isNode)(e))m=e;else{y.pop();continue}}void 0===e&&f&&g.push([i,m]),c?y.pop():(n={inArray:h,index:v,keys:p,edits:g,prev:n},p=(h=Array.isArray(m))?m:null!=(S=r[m.kind])?S:[],v=-1,g=[],o&&b.push(o),o=m)}while(void 0!==n)return 0!==g.length?g[g.length-1][1]:e}function h(e,t,r){let n=new Set(e),i=n.size;return f(t,{Directive(e){if(n.delete(e.name.value)&&(!r||!n.size))return d}}),r?!n.size:n.size<i}e.s(["BREAK",0,d,"visit",0,f],719420),e.s(["hasDirectives",0,h],604197);var p=e.i(260292);e.s(["NotImplementedHandler",0,class{isIncrementalResult(e){return!1}prepareRequest(e){return(0,p.invariant)(!h(["defer","stream"],e.query),67),e}extractErrors(){}startRequest=void 0}],163264);var v=e.i(247803),g=e.i(420897),m="function"==typeof Symbol&&Symbol.observable||"@@observable";function y(e){return e}e.s(["identity",0,y],225106);var b=e.i(884448),_=e.i(382979),w=e.i(883360),S=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this,i=!function(e){return e&&e instanceof v.Subscriber||e&&(0,_.isFunction)(e.next)&&(0,_.isFunction)(e.error)&&(0,_.isFunction)(e.complete)&&(0,g.isSubscription)(e)}(e)?new v.SafeSubscriber(e,t,r):e;return(0,w.errorContext)(function(){var e=n.operator,t=n.source;i.add(e?e.call(i,t):t?n._subscribe(i):n._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;
2return new(t=k(t))(function(t,n){var i=new v.SafeSubscriber({next:function(t){try{e(t)}catch(e){n(e),i.unsubscribe()}},error:n,complete:t});r.subscribe(i)})},e.prototype._subscribe=function(e){var t;return null==(t=this.source)?void 0:t.subscribe(e)},e.prototype[m]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0===e.length?y:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=k(e))(function(e,r){var n;t.subscribe(function(e){return n=e},function(e){return r(e)},function(){return e(n)})})},e.create=function(t){return new e(t)},e}();function k(e){var t;return null!=(t=null!=e?e:b.config.Promise)?t:Promise}e.s(["Observable",0,S],1231);var E=new S(function(e){return e.complete()});e.s(["EMPTY",0,E],303660);var O=e.i(859869),x=e.i(617803);let T=Symbol.for("apollo.cacheSize"),C={...x.global[T]};function P(e,t){return e.definitions.find(e=>"OperationDefinition"===e.kind&&!!e.name)?.name.value??t}e.s(["cacheSizes",0,C],865439),e.s(["getOperationName",0,P],280941);var A=e.i(693825),I=e.i(293914);function R(){}let D="u">typeof WeakRef?WeakRef:function(e){return{deref:()=>e}},N="u">typeof WeakMap?WeakMap:Map,M="u">typeof FinalizationRegistry?FinalizationRegistry:function(){return{register:R,unregister:R}};class j{constructor(e=1/0,t=R){this.max=e,this.dispose=t,this.map=new N,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{let e=this.unfinalizedNodes.values();for(let t=0;t<10024;t++){let t=e.next().value;if(!t)break;this.unfinalizedNodes.delete(t);let r=t.key;delete t.key,t.keyRef=new D(r),this.registry.register(r,t,t)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new M(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){let t=this.getNode(e);return t&&t.value}getNode(e){let t=this.map.get(e);if(t&&t!==this.newest){let{older:e,newer:r}=t;r&&(r.older=e),e&&(e.newer=r),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=r)}return t}set(e,t){let r=this.getNode(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.scheduleFinalization(r),this.map.set(e,r),this.size++,r.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;let t=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,t),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),t&&this.map.delete(t)}delete(e){let t=this.map.get(e);return!!t&&(this.deleteNode(t),!0)}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}e.s(["WeakCache",0,j],619717);let L=new WeakSet;function F(e){!(e.size<=(e.max||-1))&&(L.has(e)||(L.add(e),setTimeout(()=>{e.clean(),L.delete(e)},100)))}let q=function(e,t){let r=new j(e,t);return r.set=function(e,t){let r=j.prototype.set.call(this,e,t);return F(this),r},r},U=function(e,t){let r=new I.StrongCache(e,t);return r.set=function(e,t){let r=I.StrongCache.prototype.set.call(this,e,t);return F(this),r},r};function V(e,{max:t,makeCacheKey:r=e=>e}){let n=new A.Trie(!0),i=new q(t);return(...t)=>{let o=n.lookupArray(r(t)),a=i.get(o);if(a){if(a.error)throw a.error;return a.result}let s=i.set(o,{});try{return s.result=e(...t)}catch(e){throw s.error=e,e}}}e.s(["AutoCleanedStrongCache",0,U,"AutoCleanedWeakCache",0,q],200812);let z=V((e,t)=>{(0,p.invariant)(e&&"Document"===e.kind,1);let r=e.definitions.filter(e=>"OperationDefinition"===e.kind);O.__DEV__&&(e.definitions.forEach(e=>{if("OperationDefinition"!==e.kind&&"FragmentDefinition"!==e.kind)throw(0,p.newInvariantError)(2,e.kind)}),(0,p.invariant)(r.length<=1,3,r.length)),t&&(0,p.invariant)(1==r.length&&r[0].operation===t,4,t,t,r[0].operation),f(e,{Field(t,n,i,o){if(t.alias&&("__typename"===t.alias.value||t.alias.value.startsWith("__ac_"))&&t.alias.value!==t.name.value){let n=e,i=[];for(let e of o)(n=n[e]).kind===c.Kind.FIELD&&i.push(n.alias?.value||n.name.value);throw i.splice(-1,1,t.name.value),(0,p.newInvariantError)(5,t.alias.value,i.join("."),r[0].operation,P(e,"(anonymous)"))}}})},{max:C.checkDocument||2e3});function B(e){return z(e),e.definitions.filter(e=>"OperationDefinition"===e.kind)[0]}e.s(["checkDocument",0,z],827800),e.s(["getOperationDefinition",0,B],791387);class W{static empty(){return new W(()=>E)}static from(e){if(0===e.length)return W.empty();let[t,...r]=e;return t.concat(...r)}static split(e,t,r=new W((e,t)=>
2t(e))){return Object.assign(new W((n,i)=>{let o=e(n);return O.__DEV__&&"boolean"!=typeof o&&O.__DEV__&&p.invariant.warn(63,o),o?t.request(n,i):r.request(n,i)}),{left:t,right:r})}static execute(e,t,r){return e.request(function(e,{client:t}){let r={query:e.query,variables:e.variables||{},extensions:e.extensions||{},operationName:P(e.query),operationType:B(e.query).operation},n={...e.context},i=()=>Object.freeze({...n});return Object.defineProperty(r,"setContext",{enumerable:!1,value:e=>{n="function"==typeof e?{...n,...e(i())}:{...n,...e}}}),Object.defineProperty(r,"getContext",{enumerable:!1,value:i}),Object.defineProperty(r,"client",{enumerable:!1,value:t}),r}(t,r),()=>(O.__DEV__&&O.__DEV__&&p.invariant.warn(64),E))}static concat(...e){return W.from(e)}constructor(e){e&&(this.request=e)}split(e,t,r){return this.concat(W.split(e,t,r))}concat(...e){return 0===e.length?this:e.reduce(this.combine.bind(this),this)}combine(e,t){return Object.assign(new W((r,n)=>e.request(r,e=>t.request(e,n))),{left:e,right:t})}request(e,t){throw(0,p.newInvariantError)(65)}left;right}e.s(["ApolloLink",0,W],65646);let $=W.execute;e.s(["execute",0,$],60943);var Q=e.i(508288);function H(e){return e}class K{transform;cached;resultCache=new WeakSet;getCacheKey(e){return[e]}static identity(){return new K(H,{cache:!1})}static split(e,t,r=K.identity()){return Object.assign(new K(n=>(e(n)?t:r).transformDocument(n),{cache:!1}),{left:t,right:r})}constructor(e,t={}){this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}resetCache(){if(this.cached){let e=new A.Trie;this.performWork=(0,Q.wrap)(K.prototype.performWork.bind(this),{makeCacheKey:t=>{let r=this.getCacheKey(t);if(r)return(0,p.invariant)(Array.isArray(r),20),e.lookupArray(r)},max:C["documentTransform.cache"],cache:j})}}performWork(e){return z(e),this.transform(e)}transformDocument(e){if(this.resultCache.has(e))return e;let t=this.performWork(e);return this.resultCache.add(t),t}concat(e){return Object.assign(new K(t=>e.transformDocument(this.transformDocument(t)),{cache:!1}),{left:this,right:e})}left;right}function G(){throw Error("only supported in development mode")}e.s(["DocumentTransform",0,K],886641),e.s(["getApolloCacheMemoryInternals",0,G,"getApolloClientMemoryInternals",0,G,"getInMemoryCacheMemoryInternals",0,G],782599);var J=e.i(274466),Y=e.i(157672),X=(0,Y.createErrorClass)(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Z=e.i(133048),ee=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return(0,J.__extends)(t,e),t.prototype.lift=function(e){var t=new et(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new X},t.prototype.next=function(e){var t=this;(0,w.errorContext)(function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=(0,J.__values)(t.currentObservers),o=i.next();!o.done;o=i.next())o.value.next(e)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var t=this;(0,w.errorContext)(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;(0,w.errorContext)(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null==(e=this.observers)?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this.hasError,n=this.isStopped,i=this.observers;return r||n?g.EMPTY_SUBSCRIPTION:(this.currentObservers=null,i.push(e),new g.Subscription(function(){t.currentObservers=null,(0,Z.arrRemove)(i,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this.thrownError,n=this.isStopped;t?e.error(r):n&&e.complete()},t.prototype.asObservable=function(){var e=new S;return e.source=this,e},t.create=function(e,t){return new et(e,t)},t}(S),et=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return(0,J.__extends)(t,e),t.prototype.next=function(e){var t,r;null==(r=null==(t=this.destination)?void 0:t.next)||r.call(t,e)},t.prototype.error=function(e){var t,r;null==(r=null==(t=this.destination)?void 0:t.error)||r.call(t,e)},t.prototype.complete=function(){var e,t;null==(t=null==(e=this.destination)?void 0:e.complete)||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!=(r=null==(t=this.source)?void 0:t.subscribe(e))?r:g.EMPTY_SUBSCRIPTION},t}(ee);e.s(["Subject",0,ee],306902);var er=e.i(96592),en=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=er.dateTimestampProvider);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}return(0,J.__extends)(t,e),t.prototype.next=function(t){var r=this.isStopped,n=this._buffer,i=this._infiniteTimeWindow,o=this._timestampProvider,a=this._windowTime;!r&&(n.push(t),i||n.push(o.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this._bufferSize,t=this._timestampProvider,r=this._buffer,n=this._infiniteTimeWindow,i=(n?1:2)*e;if(e<1/0&&i<r.length&&r.splice(0,r.length-i),!n){for(var o=t.now(),a=0,s=1;s<r.length&&r[s]<=o;s+=2)a=s;a&&r.splice(0,a+1)}},t}(ee);e.s(["ReplaySubject",0,en],147582);var ei=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function eo(e){return(0,_.isFunction)(null==e?void 0:e.then)}function ea(e){return(0,_.isFunction)(e[m])}function es(e){return Symbol.asyncIterator&&(0,_.isFunction)(null==e?void 0:e[Symbol.asyncIterator])}function eu(e){return TypeError("You provided "+(null!==e&&"object"==typeof e?"an invali
2d object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var el="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function ec(e){return(0,_.isFunction)(null==e?void 0:e[el])}function ed(e){return(0,J.__asyncGenerator)(this,arguments,function(){var t,r,n;return(0,J.__generator)(this,function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,(0,J.__await)(t.read())];case 3:if(n=(r=i.sent()).value,!r.done)return[3,5];return[4,(0,J.__await)(void 0)];case 4:return[2,i.sent()];case 5:return[4,(0,J.__await)(n)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function ef(e){return(0,_.isFunction)(null==e?void 0:e.getReader)}var eh=e.i(589440);function ep(e){if(e instanceof S)return e;if(null!=e){var t,r,n,i;if(ea(e)){return t=e,new S(function(e){var r=t[m]();if((0,_.isFunction)(r.subscribe))return r.subscribe(e);throw TypeError("Provided object does not correctly implement Symbol.observable")})}if(ei(e)){return r=e,new S(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}if(eo(e)){return n=e,new S(function(e){n.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,eh.reportUnhandledError)})}if(es(e))return ev(e);if(ec(e)){return i=e,new S(function(e){var t,r;try{for(var n=(0,J.__values)(i),o=n.next();!o.done;o=n.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}e.complete()})}if(ef(e))return ev(ed(e))}throw eu(e)}function ev(e){return new S(function(t){(function(e,t){var r,n,i,o;return(0,J.__awaiter)(this,void 0,void 0,function(){var a;return(0,J.__generator)(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),r=(0,J.__asyncValues)(e),s.label=1;case 1:return[4,r.next()];case 2:if((n=s.sent()).done)return[3,4];if(a=n.value,t.next(a),t.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return i={error:s.sent()},[3,11];case 6:if(s.trys.push([6,,9,10]),!(n&&!n.done&&(o=r.return)))return[3,8];return[4,o.call(r)];case 7:s.sent(),s.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})})(e,t).catch(function(e){return t.error(e)})})}function eg(e){void 0===e&&(e={});var t=e.connector,r=void 0===t?function(){return new ee}:t,n=e.resetOnError,o=void 0===n||n,a=e.resetOnComplete,s=void 0===a||a,u=e.resetOnRefCountZero,l=void 0===u||u;return function(e){var t,n,a,u=0,c=!1,d=!1,f=function(){null==n||n.unsubscribe(),n=void 0},h=function(){f(),t=a=void 0,c=d=!1},p=function(){var e=t;h(),null==e||e.unsubscribe()};return(0,i.operate)(function(e,i){u++,d||c||f();var g=a=null!=a?a:r();i.add(function(){0!=--u||d||c||(n=em(p,l))}),g.subscribe(i),!t&&u>0&&(t=new v.SafeSubscriber({next:function(e){return g.next(e)},error:function(e){d=!0,f(),n=em(h,o,e),g.error(e)},complete:function(){c=!0,f(),n=em(h,s),g.complete()}}),ep(e).subscribe(t))})(e)}}function em(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(!0===t)return void e();if(!1!==t){var i=new v.SafeSubscriber({next:function(){i.unsubscribe(),e()}});return ep(t.apply(void 0,(0,J.__spreadArray)([],(0,J.__read)(r)))).subscribe(i)}}function ey(e,t,r){var n,i,o,a,s=!1;return e&&"object"==typeof e?(a=void 0===(n=e.bufferSize)?1/0:n,t=void 0===(i=e.windowTime)?1/0:i,s=void 0!==(o=e.refCount)&&o,r=e.scheduler):a=null!=e?e:1/0,eg({connector:function(){return new en(a,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:s})}e.s(["share",0,eg],226226),e.s(["shareReplay",0,ey],691926);let eb=V(function(e,t,r){let n,i;function o(e){return e!==n&&(i=r(n=e)),i}return Object.assign(e.pipe(a(o),ey({bufferSize:1,refCount:!0})),{getCurrentResult:()=>o(e.getCurrentResult())})},{max:1,makeCacheKey:e=>e.slice(0,2)});function e_(e,t){var r=(0,_.isFunction)(e)?e:function(){return e}
2,n=function(e){return e.error(r())};return new S(t?function(e){return t.schedule(n,0,e)}:n)}e.s(["mapObservableFragmentMemoized",0,eb],52340),e.s(["removeMaskedFragmentSpreads",0,function(e){return f(e,{FragmentSpread(e){if(!e.directives?.some(({name:e})=>"unmask"===e.value))return null}})}],352351),e.s(["throwError",0,e_],52841),e.s(["catchError",0,function e(t){return(0,i.operate)(function(r,n){var i,a=null,s=!1;a=r.subscribe((0,o.createOperatorSubscriber)(n,void 0,void 0,function(o){i=ep(t(o,e(t)(r))),a?(a.unsubscribe(),a=null,i.subscribe(n)):s=!0})),s&&(a.unsubscribe(),a=null,i.subscribe(n))})}],451060);var ew=e.i(696676);function eS(e,t,r){return(void 0===r&&(r=1/0),(0,_.isFunction)(t))?eS(function(r,n){return a(function(e,i){return t(r,e,n,i)})(ep(e(r,n)))},r):("number"==typeof t&&(r=t),(0,i.operate)(function(t,n){var i,a,s,u,l,c,d,f;return i=r,a=[],s=0,u=0,l=!1,c=function(){!l||a.length||s||n.complete()},d=function(e){return s<i?f(e):a.push(e)},f=function(t){s++;var r=!1;ep(e(t,u++)).subscribe((0,o.createOperatorSubscriber)(n,function(e){n.next(e)},function(){r=!0},void 0,function(){if(r)try{for(s--;a.length&&s<i;)!function(){var e=a.shift();f(e)}();c()}catch(e){n.error(e)}}))},t.subscribe((0,o.createOperatorSubscriber)(n,d,function(){l=!0,c()})),function(){}}))}function ek(e){return e&&(0,_.isFunction)(e.schedule)}function eE(e){return ek(e[e.length-1])?e.pop():void 0}e.s(["mergeMap",0,eS],742924),e.s(["isScheduler",0,ek],899553);var eO=e.i(843229);function ex(e,t){return void 0===t&&(t=0),(0,i.operate)(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function eT(e,t){if(!e)throw Error("Iterable cannot be null");return new S(function(r){(0,ew.executeSchedule)(r,t,function(){var n=e[Symbol.asyncIterator]();(0,ew.executeSchedule)(r,t,function(){n.next().then(function(e){e.done?r.complete():r.next(e.value)})},0,!0)})})}function eC(e,t){return t?function(e,t){if(null!=e){if(ea(e))return ep(e).pipe(ex(t),(0,eO.observeOn)(t));if(ei(e))return new S(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})});if(eo(e))return ep(e).pipe(ex(t),(0,eO.observeOn)(t));if(es(e))return eT(e,t);if(ec(e))return new S(function(r){var n;return(0,ew.executeSchedule)(r,t,function(){n=e[el](),(0,ew.executeSchedule)(r,t,function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){r.error(e);return}i?r.complete():r.next(t)},0,!0)}),function(){return(0,_.isFunction)(null==n?void 0:n.return)&&n.return()}});if(ef(e))return eT(ed(e),t)}throw eu(e)}(e,t):ep(e)}e.s(["from",0,eC],410846),e.s(["concat",0,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return eS(y,1)(eC(e,eE(e)))}],36826),e.s(["filter",0,function(e,t){return(0,i.operate)(function(r,n){var i=0;r.subscribe((0,o.createOperatorSubscriber)(n,function(r){return e.call(t,r,i++)&&n.next(r)}))})}],964701),e.s(["finalize",0,function(e){return(0,i.operate)(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}],416475);var eP=(0,Y.createErrorClass)(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function eA(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=eE(e);return eC(e,r)}e.s(["lastValueFrom",0,function(e,t){var r="object"==typeof t;return new Promise(function(n,i){var o,a=!1;e.subscribe({next:function(e){o=e,a=!0},error:i,complete:function(){a?n(o):r?n(t.defaultValue):i(new eP)}})})}],334806),e.s(["of",0,eA],693436),(r=n||(n={})).NEXT="N",r.ERROR="E",r.COMPLETE="C";var eI=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){return function(e,t){var r,n,i,o=e.kind,a=e.value,s=e.error;if("string"!=typeof o)throw TypeError('Invalid notification, missing "kind"');"N"===o?null==(r=t.next)||r.call(t,a):"E"===o?null==(n=t.error)||n.call(t,s):null==(i=t.complete)||i.call(t)}(this,e)},e.prototype.do=function(e,t,r){var n=this.kind,i=this.value,o=this.error;return"N"===n?null==e?void 0:e(i):"E"===n?null==t?void 0:t(o):null==r?void 0:r()},e.prototype.accept=function(e,t,r){return(0,_.isFunction)(null==e?void 0:e.next)?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){var e=this.kind,t=this.value,r=this.error,n="N"===e?eA(t):"E"===e?e_(function(){return r}):"C"===e?E:0;if(!n)throw TypeError("Unexpected notification kind "+e);return n},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e}();e.s(["materialize",0,function(){return(0,i.operate)(function(e,t){e.subscribe((0,o.createOperatorSubscriber)(t,function(e){t.next(eI.createNext(e))},function(){t.next(eI.createComplete()),t.complete()},function(e){t.next(eI.createError(e)),t.complete()}
2))})}],566628),e.s(["tap",0,function(e,t,r){var n=(0,_.isFunction)(e)||t||r?{next:e,error:t,complete:r}:e;return n?(0,i.operate)(function(e,t){null==(r=n.subscribe)||r.call(n);var r,i=!0;e.subscribe((0,o.createOperatorSubscriber)(t,function(e){var r;null==(r=n.next)||r.call(n,e),t.next(e)},function(){var e;i=!1,null==(e=n.complete)||e.call(n),t.complete()},function(e){var r;i=!1,null==(r=n.error)||r.call(n,e),t.error(e)},function(){var e,t;i&&(null==(e=n.unsubscribe)||e.call(n)),null==(t=n.finalize)||t.call(n)}))}):y}],837637);let eR={};function eD(e,t){eR[e]=t}O.__DEV__,O.__DEV__,O.__DEV__;e.s(["registerGlobalCache",0,eD],100);let eN=Object.assign(function(e){return JSON.stringify(e,eM)},{reset(){t=new U(C.canonicalStringify||1e3)}});function eM(e,r){if(r&&"object"==typeof r){let e=Object.getPrototypeOf(r);if(e===Object.prototype||null===e){let n=Object.keys(r);if(n.every(ej))return r;let i=JSON.stringify(n),o=t.get(i);if(!o){n.sort();let e=JSON.stringify(n);o=t.get(e)||n,t.set(i,o),t.set(e,o)}let a=Object.create(e);return o.forEach(e=>{a[e]=r[e]}),a}}return r}function ej(e,t,r){return 0===t||r[t-1]<=e}O.__DEV__&&eD("canonicalStringify",()=>t.size),eN.reset(),e.s(["canonicalStringify",0,eN],971657)},37611,(e,t,r)=>{var n=Object.prototype.hasOwnProperty;function i(e){return"[Throws: "+(e?e.message:"?")+"]"}function o(e){var t=[];return function e(r){if(null===r||"object"!=typeof r)return r;if(-1!==t.indexOf(r))return"[Circular]";if(t.push(r),"function"==typeof r.toJSON)try{var o=e(r.toJSON());return t.pop(),o}catch(e){return i(e)}if(Array.isArray(r)){var a=r.map(e);return t.pop(),a}var s=Object.keys(r).reduce(function(t,o){return t[o]=e(function(e,t){if(n.call(e,t))try{return e[t]}catch(e){return i(e)}return e[t]}(r,o)),t},{});return t.pop(),s}(e)}t.exports=function(e,t,r){return JSON.stringify(o(e),t,r)},t.exports.ensureProperties=o},285665,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Observable=void 0;let n=e=>!!Symbol[e],i=e=>n(e)?Symbol[e]:"@@"+e,o=i("iterator"),a=i("observable"),s=i("species");function u(e,t){let r=e[t];if(null!=r){if("function"!=typeof r)throw TypeError(r+" is not a function");return r}}function l(e){let t=e.constructor;return void 0!==t&&null===(t=t[s])&&(t=void 0),void 0!==t?t:m}function c(e){c.log?c.log(e):setTimeout(()=>{throw e})}function d(e){Promise.resolve().then(()=>{try{e()}catch(e){c(e)}})}function f(e){let t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{let e=u(t,"unsubscribe");e&&e.call(t)}}catch(e){c(e)}}function h(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function p(e,t,r){e._state="running";let n=e._observer;try{let i=u(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(h(e),i)i.call(n,r);else throw r;break;case"complete":h(e),i&&i.call(n)}}catch(e){c(e)}"closed"===e._state?f(e):"running"===e._state&&(e._state="ready")}function v(e,t,r){if("closed"!==e._state){if("buffering"===e._state)return void e._queue.push({type:t,value:r});if("ready"!==e._state){e._state="buffering",e._queue=[{type:t,value:r}],d(()=>(function(e){let t=e._queue;if(t){e._queue=void 0,e._state="ready";for(let r=0;r<t.length&&(p(e,t[r].type,t[r].value),"closed"!==e._state);++r);}})(e));return}p(e,t,r)}}class g{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";let r=this,n={get closed(){return"closed"===r._state},next(e){v(r,"next",e)},error(e){v(r,"error",e)},complete(){v(r,"complete")}};try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(h(this),f(this))}}class m{constructor(e){if(!(this instanceof m))throw TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e){return("object"!=typeof e||null===e)&&(e={next:e,error:arguments[1],complete:arguments[2]}),new g(e,this._subscriber)}forEach(e){return new Promise((t,r)=>{if("function"!=typeof e)return void r(TypeError(e+" is not a function"));function n(){i.unsubscribe(),t()}let i=this.subscribe({next(t){try{e(t,n)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t})})}map(e){if("function"!=typeof e)throw TypeError(e+" is not a function");return new(l(this))(t=>this.subscribe({next(r){try{r=e(r)}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw TypeError(e+" is not a function");return new(l(this))(t=>this.subscribe({next(r){try{if(!e(r))return}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e){if("function"!=typeof e)throw TypeError(e+" is not a function");let t=l(this),r=arguments.length>1,n=!1,i=arguments[1],o=i;return new t(t=>this.subscribe({next(i){let a=!n;if(n=!0,!a||r)try{o=e(o,i)}catch(e){return t.error(e)}else o=i},error(e){t.error(e)},complete(){if(!n&&!r)return t.error(TypeError("Cannot reduce an empty sequence"));t.next(o),t.complete()}}))}async all(){let e=[];return await this.forEach(t=>e.push(t)),e}concat(...e){let t=l(this);return new t(r=>{let n,i=0;return!function o(a){n=a.subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){i===e.length?(n=void 0,r.complete()):o(t.from(e[i++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}})}flatMap(e){if("function"!=typeof e)throw TypeError(e+" is not a function");let t=l(this);return new t(r=>{let n=[],i=this.subscribe({next(i){if(e)try{i=e(i)}catch(e){return r.error(e)}let a=t.from(i).subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){let e=n.indexOf(a);e>=0&&n.splice(e,1),o()}});n.push(a)},error(e){r.error(e)},complete(){o()}});function o(){i.closed&&0===n.length&&r.complete()}return()=>
2{n.forEach(e=>e.unsubscribe()),i.unsubscribe()}})}[a](){return this}static from(e){let t="function"==typeof this?this:m;if(null==e)throw TypeError(e+" is not an object");let r=u(e,a);if(r){let n=r.call(e);if(Object(n)!==n)throw TypeError(n+" is not an object");return n instanceof m&&n.constructor===t?n:new t(e=>n.subscribe(e))}if(n("iterator")&&(r=u(e,o)))return new t(t=>{d(()=>{if(!t.closed){for(let n of r.call(e))if(t.next(n),t.closed)return;t.complete()}})});if(Array.isArray(e))return new t(t=>{d(()=>{if(!t.closed){for(let r=0;r<e.length;++r)if(t.next(e[r]),t.closed)return;t.complete()}})});throw TypeError(e+" is not observable")}static of(...e){return new("function"==typeof this?this:m)(t=>{d(()=>{if(!t.closed){for(let r=0;r<e.length;++r)if(t.next(e[r]),t.closed)return;t.complete()}})})}static get[s](){return this}}r.Observable=m,Object.defineProperty(m,Symbol("extensions"),{value:{symbol:a,hostReportError:c},configurable:!0})},79815,(e,t,r)=>{t.exports=e.r(285665).Observable},284325,607785,496391,e=>{"use strict";let t;var r,n,i,o,a,s,u,l,c,d,f,h,p,v,g,m,y,b,_,w,S,k,E,O,x,T,C,P,A,I,R,D,N=e.i(999161),M=e.i(562569),j=e.i(942627),L=e.i(531778),F=e.i(108550);e.i(833981);var q=e.i(542421),U=e.i(828856);e.i(47124);var V=e.i(61238);let z=({data:e,id:t})=>{if(e?.episode)return(0,q.normalizePlayerEpisode)(e.episode);let r=U.SUBSCRIBER_EXTRA_FRAGMENTS.find(e=>e.id===t);return r?(0,q.normalizePlayerEpisode)(r):void 0},B=async({id:e})=>{let{data:t}=await L.frontClient.query({errorPolicy:"all",fetchPolicy:"cache-first",query:V.GetPlayerEpisodeDocument,variables:{id:e}});return z({data:t,id:e})};e.s(["getPlayerEpisode",0,B,"usePlayerEpisode",0,({audioCompleteUrl:e,audioCompleteUrlHls:t,id:r})=>{let{loading:n,data:i}=(0,M.useQuery)(V.GetPlayerEpisodeDocument,{fetchPolicy:"cache-first",variables:{id:r}}),[o,a]=(0,N.useState)("checking"),{episodeAudioUrl:s,episodeAudioUrlHls:u,episodeTitle:l}=(0,N.useMemo)(()=>{if(n)return{episodeAudioUrl:void 0,episodeAudioUrlHls:void 0,episodeTitle:""};let o=z({data:i,id:r});return o?{episodeAudioUrl:e||o.audioCompleteUrl||o.audioFree,episodeAudioUrlHls:t||o.audioCompleteUrlHls,episodeTitle:o.title||""}:{episodeAudioUrl:void 0,episodeAudioUrlHls:void 0,episodeTitle:""}},[e,t,i,r,n]);return(0,N.useEffect)(()=>{s&&(u?(async()=>{try{if(!await (0,j.default)({url:u}))throw Error(`audio_complete.url_hls found on episode ${r} but file not found or corrupted`);a("available")}catch(e){(0,F.captureException)(e,{extra:{episodeId:r,audioCompleteUrlHls:u},level:"error"}),a("not-available")}})():a("not-available"))},[s,u,r]),{episodeAudioUrl:s,episodeAudioUrlHls:"available"===o&&u?u:null,episodeTitle:l,loading:n||"checking"===o}}],284325);var W=e.i(274466);(r=g||(g={}))[r.None=0]="None",r[r.Error=1]="Error",r[r.Warn=2]="Warn",r[r.Verbose=3]="Verbose",r[r.Debug=4]="Debug";var $=function(e){return void 0===e&&(e=0),(Error().stack||"").split("\n").slice(2+e).map(function(e){return e.trim()})},Q=function(e){return function(){var t=(0,W.__assign)({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},H=function(e,t){var r,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=(0,W.__values)(t.split(".")),o=i.next();!o.done;o=i.next()){var a=o.value;if(!(a in e))return;e=e[a]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e},K=function(e,t){return function(){var r,n,i={};try{for(var o=(0,W.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;i[s]=H(e,s)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}},G=function(e,t,r,n,i){return void 0===i&&(i=null),function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var s=r(),u=s.logger,l=s.logLevel;if(l&&l<g.Debug||!l||!u)return e.apply(i,o);var c={type:"invoke public method",name:t,args:o,stacktrace:$(1),time:{start:new Date().toISOString()},states:{}};n&&c.states&&(c.states.before=n());var d=e.apply(i,o);return d&&d.promise?d.promise.then(function(){n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=new Date().toISOString()),u.debug(JSON.stringify(c,null,2))}):(n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=new Date().toISOString()),u.debug(JSON.stringify(c,null,2))),d}};(n=m||(m={})).SET="$set",n.SET_ONCE="$setOnce",n.ADD="$add",n.APPEND="$append",n.PREPEND="$prepend",n.REMOVE="$remove",n.PREINSERT="$preInsert",n.POSTINSERT="$postInsert",n.UNSET="$unset",n.CLEAR_ALL="$clearAll",(i=y||(y={})).IDENTIFY="$identify",i.GROUP_IDENTIFY="$groupidentify",i.REVENUE="revenue_amount";var J="".concat("AMP","_unsent"),Y="$default_instance",X="https://api2.amplitude.com/2/httpapi",Z="https://api.eu.amplitude.com/2/httpapi",ee="https://api2.amplitude.com/batch",et="https://api.eu.amplitude.com/batch",er="dclid",en="fbclid",ei="gbraid",eo="gclid",ea="ko_click_id",es="li_fat_id",eu="msclkid",el="rdt_cid",ec="ttclid",ed="twclid",ef="wbraid",eh={utm_campaign:void 0,utm_c
2ontent:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},ep=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],ev=["authorization","cookie","set-cookie"],eg=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var r=e[t];if(!em(t,r))return!1}return!0},em=function(e,t){var r,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=(0,W.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;if(Array.isArray(s))return!1;if("object"==typeof s)i=i&&eg(s);else if(!["number","string"].includes(typeof s))return!1;if(!i)return!1}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}else if(null==t)return!1;else if("object"==typeof t)return eg(t);else if(!["number","string","boolean"].includes(typeof t))return!1;return!0},ey=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return(0,W.__assign)({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(b.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(b.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(b.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(b.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(b.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(b.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(b.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(b.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(b.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[b.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,r){if(this._validate(e,t,r)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=r,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,r){return!(void 0!==this._properties[b.CLEAR_ALL]||this._propertySet.has(t))&&(e===b.ADD?"number"==typeof r:e===b.UNSET||e===b.REMOVE||em(t,r))},e}();(o=b||(b={})).SET="$set",o.SET_ONCE="$setOnce",o.ADD="$add",o.APPEND="$append",o.PREPEND="$prepend",o.REMOVE="$remove",o.PREINSERT="$preInsert",o.POSTINSERT="$postInsert",o.UNSET="$unset",o.CLEAR_ALL="$clearAll";var eb=[b.CLEAR_ALL,b.UNSET,b.SET,b.SET_ONCE,b.ADD,b.APPEND,b.PREPEND,b.PREINSERT,b.POSTINSERT,b.REMOVE];e.s(["Identify",0,ey,"OrderedIdentifyOperations",0,eb],607785);var e_="Event skipped due to empty event type";(a=_||(_={})).Unknown="unknown",a.Skipped="skipped",a.Success="success",a.RateLimit="rate_limit",a.PayloadTooLarge="payload_too_large",a.Invalid="invalid",a.Failed="failed",a.Timeout="Timeout",a.SystemError="SystemError";var ew=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=_.Unknown),{event:e,code:t,message:r}},eS=function(){var t="ampIntegrationContext";return"u">typeof globalThis&&void 0!==globalThis[t]?globalThis[t]:"u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof self?self:e.g},ek=(0,W.__spreadArray)([],(0,W.__read)(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),eE=function(e){var t,r=eS();if(!(null==(t=null==r?void 0:r.crypto)?void 0:t.getRandomValues))return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,eE);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,(0,W.__spreadArray)([],(0,W.__read)(n.entries()),!1).map(function(e){var t=(0,W.__read)(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(ek[n]):ek[n]}).join("")},eO=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this.pluginStatus=new Map,this._optOutListeners=[]}return e.prototype.register=function(e,t){var r,n;return(0,W.__awaiter)(this,void 0,void 0,function(){var i;return(0,W.__generator)(this,function(o){switch(o.label){case 0:if(void 0===e.name&&(e.name=eE(),this.loggerProvider.warn("Plugin name is undefined.\n Generating a random UUID for plugin name: ".concat(e.name,".\n Set a name for the plugin to prevent it from being added multiple times."))),i=e.name,this.pluginStatus.has(i))return this.loggerProvider.warn("Plugin with name ".concat(i," already exists, skipping registration")),[2];return e.type=null!=(r=e.type)?r:"enrichment",this.pluginStatus.set(i,"locked"),[4,null==(n=e.setup)?void 0:n.call(e,t,this.client)];case 1:if(o.sent(),"locked"!==this.pluginStatus.get(i))return[2];return this.plugins.push(e),this.pluginStatus.set(i,"installed"),[2]}})})},e.prototype.deregister=function(e,t){var r;return(0,W.__awaiter)(this,void 0,void 0,function(){var n,i;return(0,W.__generator)(this,function(o){switch(o.label){case 0:if(this.pluginStatus.delete(e),-1===(n=this.plugins.findIndex(function(t){return t.name===e})))return t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2];return i=this.plugins[n],this.plugins.splice(n,1),[4,null==(r=i.teardown)?void 0:r.call(i)];case 1:return o.sent(),[2]}})})},e.prototype.reset=function(e){this._clearOptOutListeners(),this.applying=!1,this.plugins.map(function(e){var t;return null==(t=e.teardown)?void 0:t.call(e)}),this.plugins=[],this.pluginStatus.clear(),this.client=e},e.prototype.push=function(e){var t=this;return new Promise(function(r){t.queue.push([e,r]),t.scheduleApply(0)})},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout(function(){t.apply(t.queue.shift()).then(function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)})},e))},e.prototype.apply=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t,r,n,i,o,a,s,u,l,c,d,f,h,p,v;return(0,W.__generator)(this,function(g){switch(g.label){case 0:if(!e)return[2];t=(0,W.__read)(e,1)[0],r=(0,W.__read)(e,2)[1],this.loggerProvider.log("Timeline.apply: Initial event",t),n=this.plugins.filter(function(e){return"before"===e.type}),g.label=1;case 1:g.trys.push([1,6,7,8]),o=(i=(0,W.__values)(n)).next(),g.label=2;case 2:if(o.done)return[3,5];if(!(a=o.value).execute)return[3,4];return[4,a.execute((0,W.__assign)({},t))];case 3:if(null===(s=g.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(a.name),"', event: ").concat(JSON.stringify(t))),r({event:t,code:0,message:""}),[2];t=s,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(a.name),"', event: ").concat(JSON.stringify(t))),g.label=4;case 4:return o=i.next(),[3,2];case 5:return[3,8];case 6:return f={error:g.sent()},[3,8];case 7:try{o&&!o.done&&(h=i.return)&&h.call(i)}finally{if(f)throw f.error}
2return[7];case 8:u=this.plugins.filter(function(e){return"enrichment"===e.type||void 0===e.type}),g.label=9;case 9:g.trys.push([9,14,15,16]),c=(l=(0,W.__values)(u)).next(),g.label=10;case 10:if(c.done)return[3,13];if(!(a=c.value).execute)return[3,12];return[4,a.execute((0,W.__assign)({},t))];case 11:if(null===(s=g.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(a.name),"', event: ").concat(JSON.stringify(t))),r({event:t,code:0,message:""}),[2];t=s,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(a.name),"', event: ").concat(JSON.stringify(t))),g.label=12;case 12:return c=l.next(),[3,10];case 13:return[3,16];case 14:return p={error:g.sent()},[3,16];case 15:try{c&&!c.done&&(v=l.return)&&v.call(l)}finally{if(p)throw p.error}return[7];case 16:return d=this.plugins.filter(function(e){return"destination"===e.type}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(t))),Promise.all(d.map(function(e){var r=(0,W.__assign)({},t);return e.execute(r).catch(function(e){return ew(r,0,String(e))})})).then(function(e){var n=(0,W.__read)(e,1)[0]||ew(t,100,"Event not tracked, no destination plugins on the instance");r(n)}),[2]}})})},e.prototype.flush=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){var e,t=this;return(0,W.__generator)(this,function(r){switch(r.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return t.apply(e)}))];case 1:return r.sent(),[4,Promise.all(this.plugins.filter(function(e){return"destination"===e.type}).map(function(e){return e.flush&&e.flush()}))];case 2:return r.sent(),[2]}})})},e.prototype.addOptOutListener=function(e){this._optOutListeners.push(e)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(e){this.plugins.forEach(function(t){var r;null==(r=t.onIdentityChanged)||r.call(t,e)})},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(t){var r;null==(r=t.onSessionIdChanged)||r.call(t,e)})},e.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(t){var r;null==(r=t.onOptOutChanged)||r.call(t,e)}),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t,r,n,i,o,a;return(0,W.__generator)(this,function(s){switch(s.label){case 0:s.trys.push([0,7,8,9]),r=(t=(0,W.__values)(this._optOutListeners)).next(),s.label=1;case 1:if(r.done)return[3,6];n=r.value,s.label=2;case 2:return s.trys.push([2,4,,5]),[4,n(e)];case 3:return s.sent(),[3,5];case 4:return i=s.sent(),this.loggerProvider.error("Error calling optOut listener",i),[3,5];case 5:return r=t.next(),[3,1];case 6:return[3,9];case 7:return o={error:s.sent()},[3,9];case 8:try{r&&!r.done&&(a=t.return)&&a.call(t)}finally{if(o)throw o.error}return[7];case 9:return[2]}})})},e.prototype.onReset=function(){this.plugins.forEach(function(e){var t;null==(t=e.onReset)||t.call(e)})},e}(),ex=function(e,t){return(0,W.__assign)((0,W.__assign)({},t),{event_type:y.IDENTIFY,user_properties:e.getUserProperties()})},eT=function(e,t,r,n){var i;return(0,W.__assign)((0,W.__assign)({},n),{event_type:y.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:((i={})[e]=t,i)})},eC=function(e,t,r){var n,i=new ey;return i.set(e,t),(0,W.__assign)((0,W.__assign)({},r),{event_type:y.IDENTIFY,user_properties:i.getUserProperties(),groups:((n={})[e]=t,n)})},eP=function(e){return{promise:e||Promise.resolve()}},eA=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new eO(this),this.name=e}return e.prototype._init=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t=this;return(0,W.__generator)(this,function(r){switch(r.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q",function(){return t.isReady=!0})];case 1:return r.sent(),[2]}})})},e.prototype.runQueuedFunctions=function(e,t){return(0,W.__awaiter)(this,void 0,void 0,function(){var r,n,i,o,a,s;return(0,W.__generator)(this,function(u){switch(u.label){case 0:r=this[e],this[e]=[],u.label=1;case 1:u.trys.push([1,8,9,10]),i=(n=(0,W.__values)(r)).next(),u.label=2;case 2:if(i.done)return[3,7];if(!((o=(0,i.value)())&&"promise"in o))return[3,4];return[4,o.promise];case 3:return u.sent(),[3,6];case 4:return[4,o];case 5:u.sent(),u.label=6;case 6:return i=n.next(),[3,2];case 7:return[3,10];case 8:return a={error:u.sent()},[3,10];case 9:try{i&&!i.done&&(s=n.return)&&s.call(n)}finally{if(a)throw a.error}
2return[7];case 10:if(!this[e].length)return[3,12];return[4,this.runQueuedFunctions(e,t)];case 11:return u.sent(),[3,13];case 12:null==t||t(),u.label=13;case 13:return[2]}})})},e.prototype.track=function(e,t,r){var n=(0,W.__assign)((0,W.__assign)((0,W.__assign)({},"string"==typeof e?{event_type:e}:e),r),t&&{event_properties:t});return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),eP(this.dispatch(n))},e.prototype.identify=function(e,t){var r=ex(e,t);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),eP(this.dispatch(r))},e.prototype.groupIdentify=function(e,t,r,n){var i=eT(e,t,r,n);return eP(this.dispatch(i))},e.prototype.setGroup=function(e,t,r){var n=eC(e,t,r);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),eP(this.dispatch(n))},e.prototype.revenue=function(e,t){var r=(0,W.__assign)((0,W.__assign)({},t),{event_type:y.REVENUE,event_properties:e.getEventProperties()});return eP(this.dispatch(r))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),eP())},e.prototype._addPlugin=function(e){return eP(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),eP())},e.prototype._removePlugin=function(e){return eP(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(ew(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t=this;return(0,W.__generator)(this,function(r){return this.isReady?[2,this.process(e)]:[2,new Promise(function(r){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,r))})]})})},e.prototype.getOperationAppliedUserProperties=function(e){var t,r=null!=(t=this.userProperties)?t:{},n=(0,W.__assign)({},r);if(void 0===e)return n;var i={};return Object.keys(e).forEach(function(t){Object.values(m).includes(t)||(i[t]=e[t])}),eb.forEach(function(t){if(Object.keys(e).includes(t)){var r=e[t];switch(t){case m.CLEAR_ALL:Object.keys(n).forEach(function(e){delete n[e]});break;case m.UNSET:Object.keys(r).forEach(function(e){delete n[e]});break;case m.SET:Object.assign(n,r)}}}),Object.assign(n,i),n},e.prototype.process=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,W.__generator)(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),this.config.optOut)return[2,ew(e,0,"Event skipped due to optOut config")];if("string"!=typeof(t=e.event_type)||0===t.trim().length)return this.config.loggerProvider.error(e_),[2,ew(e,0,e_)];return e.event_type===y.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)];case 1:return 200===(r=i.sent()).code?this.config.loggerProvider.log(r.message):100===r.code?this.config.loggerProvider.warn(r.message):this.config.loggerProvider.error(r.message),[2,r];case 2:return n=String(i.sent()),this.config.loggerProvider.error(n),[2,r=ew(e,0,n)];case 3:return[2]}})})},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,!!e))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=!!e,this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return eP(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find(function(t){return t.name===e});return void 0===t?void this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e)):t},e.prototype.plugins=function(e){return this.timeline.plugins.filter(function(t){return t instanceof e})},e}(),eI=function(e,t){var r=Math.max(t,1);return e.reduce(function(e,t,n){var i=Math.floor(n/r);return e[i]||(e[i]=[]),e[i].push(t),e},[])},eR="Amplitude Logger ",eD=function(){function e(){this.logLevel=g.None}return e.prototype.disable=function(){this.logLevel=g.None},e.prototype.enable=function(e){void 0===e&&(e=g.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Verbose||console.log("".concat(eR,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Warn||console.warn("".concat(eR,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Error||console.error("".concat(eR,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<g.Debug||console.log("".concat(eR,"[Debug]: ").concat(e.join(" ")))},e}(),eN=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:Y,logLevel:g.Warn,loggerProvider:new eD,offline:!1,optOut:!1,serverUrl:X,serverZone:"US",useBatch:!1}},eM=function(){function e(e){this._optOut=!1;var t,r,n,i,o=eN();this.apiKey=e.apiKey,this.flushIntervalMillis=null!=(t=e.flushIntervalMillis)?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!=(r=e.logLevel)?r:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!=(n=e.optOut)?n:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!=(i=e.useBatch)?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var a=ej(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=a.serverZone,this.serverUrl=a.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e}
2,enumerable:!1,configurable:!0}),e}(),ej=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=eN().serverZone),void 0===r&&(r=eN().useBatch),e)return{serverUrl:e,serverZone:void 0};var n,i=["US","EU"].includes(t)?t:eN().serverZone;return{serverZone:i,serverUrl:(n=r,"EU"===i?n?et:Z:n?ee:X)}},eL=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function eF(e){return e>=200&&e<300}var eq=new Set([X,Z,ee,et]);function eU(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var eV=function(){function e(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return(0,W.__awaiter)(this,void 0,void 0,function(){var r,n=this;return(0,W.__generator)(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(J,"_").concat(this.config.apiKey.substring(0,10)),[4,null==(t=this.config.storageProvider)?void 0:t.get(this.storageKey)];case 1:return(r=i.sent())&&r.length>0&&Promise.all(r.map(function(e){return n.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=eE()),new Promise(function(r){t.queue.push({event:e,attempts:0,callback:function(e){return r(e)},timeout:0}),t.schedule(t.config.flushIntervalMillis),t.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter(function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)})},e.prototype.scheduleEvents=function(e){var t=this;e.forEach(function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)})},e.prototype.schedule=function(e){var t=this;if(!this.config.offline&&(null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,this.scheduleId=setTimeout(function(){t.queue=t.queue.map(function(e){return e.timeout=0,e}),t.flush(!0)},e);return}},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),(0,W.__awaiter)(this,void 0,void 0,function(){var t,r,n=this;return(0,W.__generator)(this,function(i){switch(i.label){case 0:if(this.config.offline)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2];if(this.flushId)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2];return this.flushId=this.scheduleId,this.resetSchedule(),t=[],r=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):r.push(e)}),[4,eI(t,this.config.flushQueueSize).reduce(function(t,r){return(0,W.__awaiter)(n,void 0,void 0,function(){return(0,W.__generator)(this,function(n){switch(n.label){case 0:return[4,t];case 1:return n.sent(),[4,this.send(r,e)];case 2:return[2,n.sent()]}})})},Promise.resolve())];case 1:return i.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(e,t){var r;return void 0===t&&(t=!0),(0,W.__awaiter)(this,void 0,void 0,function(){var n,i,o,a,s;return(0,W.__generator)(this,function(u){var l,c,d;switch(u.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];n={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;return t.extra,(0,W.__rest)(t,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new eL,u.label=1;case 1:return u.trys.push([1,3,,4]),l=i=ej(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,void 0===(c=this.config.enableRequestBodyCompression)&&(c=!1),o=!!eq.has(l)||c,[4,this.config.transportProvider.send(i,n,o)];case 2:if(null===(a=u.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t)return"body"in a?this.fulfillRequest(e,a.statusCode,"".concat(a.status,": ").concat(eU(a))):this.fulfillRequest(e,a.statusCode,a.status),[2];return this.handleResponse(a,e),[3,4];case 3:return s=(d=u.sent())instanceof Error?d.message:String(d),this.config.loggerProvider.error(s),null==(r=this.diagnosticsClient)||r.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:s,stack_trace:$()}),this.handleResponse({status:_.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(e,t){eF(e.statusCode)||null==(r=this.diagnosticsClient)||r.recordEvent("analytics.events.unsuccessful",{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:eU(e),stack_trace:$()});var r,n=e.status;switch(n){case _.Success:this.handleSuccessResponse(e,t);break;case _.Invalid:this.handleInvalidResponse(e,t);break;case _.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case _.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(n,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var r=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))return void this.fulfillRequest(t,e.statusCode,e.body.error);var n=new Set((0,W.__spreadArray)((0,W.__spreadArray)((0,W.__spreadArray)((0,W.__spreadArray)([],(0,W.__read)(Object.values(e.body.eventsWithInvalidFields)),!1),(0,W.__read)(Object.values(e.body.eventsWithMissingFields)),!1),(0,W.__read)(Object.values(e.body.eventsWithInvalidIdLengths)),!1),(0,W.__read)(e.body.silencedEvents),!1).flat()),i=t.filter(function(t,i){return!n.has(i)||void r.fulfillRequest([t],e.statusCode,e.body.error)});i.length>0&&this.config.loggerProvider.warn(eU(e));
2var o=this.removeEventsExceedFlushMaxRetries(i);this.scheduleEvents(o)},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1===t.length)return void this.fulfillRequest(t,e.statusCode,e.body.error);this.config.loggerProvider.warn(eU(e)),this.config.flushQueueSize/=2;var r=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(r)},e.prototype.handleRateLimitResponse=function(e,t){var r=this,n=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,a=new Set(n),s=new Set(i),u=new Set(o),l=t.filter(function(t,n){return t.event.user_id&&a.has(t.event.user_id)||t.event.device_id&&s.has(t.event.device_id)?void r.fulfillRequest([t],e.statusCode,e.body.error):(u.has(n)&&(t.timeout=r.throttleTimeout),!0)});l.length>0&&this.config.loggerProvider.warn(eU(e));var c=this.removeEventsExceedFlushMaxRetries(l);this.scheduleEvents(c)},e.prototype.handleOtherResponse=function(e){var t=this,r=e.map(function(e){return e.timeout=e.attempts*t.retryTimeout,e}),n=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(n)},e.prototype.fulfillRequest=function(e,t,r){var n,i,o;eF(t)?null==(o=this.diagnosticsClient)||o.increment("analytics.events.sent",e.length):(null==(n=this.diagnosticsClient)||n.increment("analytics.events.dropped",e.length),null==(i=this.diagnosticsClient)||i.recordEvent("analytics.events.dropped",{events:e.map(function(e){return e.event.event_type}),code:t,message:r,stack_trace:$()})),this.removeEvents(e),e.forEach(function(e){return e.callback(ew(e.event,t,r))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map(function(e){return e.event});this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter(function(t){return!e.some(function(e){return e.event.insert_id===t.event.insert_id})}),this.saveEvents()},e}(),ez=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){try{var t=JSON.parse(JSON.stringify(e));eg(t)&&(this.properties=t)}catch(e){}return this},e.prototype.getEventProperties=function(){var e=this.properties?(0,W.__assign)({},this.properties):{};return e[w.REVENUE_PRODUCT_ID]=this.productId,e[w.REVENUE_QUANTITY]=this.quantity,e[w.REVENUE_PRICE]=this.price,e[w.REVENUE_TYPE]=this.revenueType,e[w.REVENUE_CURRENCY]=this.currency,e[w.REVENUE]=this.revenue,e[w.RECEIPT]=this.receipt,e[w.RECEIPT_SIG]=this.receiptSig,e},e}();(s=w||(w={})).REVENUE_PRODUCT_ID="$productId",s.REVENUE_QUANTITY="$quantity",s.REVENUE_PRICE="$price",s.REVENUE_TYPE="$revenueType",s.REVENUE_CURRENCY="$currency",s.REVENUE="$revenue",s.RECEIPT="$receipt",s.RECEIPT_SIG="$receiptSig";var eB=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:eW(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),eW=function(){return"u">typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e$=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),eQ=function(){return(eQ=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function eH(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);
2if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function eK(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}"function"==typeof SuppressedError&&SuppressedError;var eG=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=eH(["string","number","boolean","undefined"]),a=o.next();!a.done;a=o.next())if(a.value===i)return e===t}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var s=Array.isArray(e),u=Array.isArray(t);if(s!==u)return!1;if(s&&u){for(var l=0;l<e.length;l++)if(!eG(e[l],t[l]))return!1}else{if(!eG(Object.keys(e).sort(),Object.keys(t).sort()))return!1;var c=!0;return Object.keys(e).forEach(function(r){eG(e[r],t[r])||(c=!1)}),c}return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var eJ=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=eQ({},this.identity.userProperties),r=eQ(eQ({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,i,o,a,s,u=r.userProperties||{};try{for(var l=eH(Object.entries(e)),c=l.next();!c.done;c=l.next()){var d=eK(c.value,2),f=d[0],h=d[1];switch(f){case"$set":try{for(var p=(i=void 0,eH(Object.entries(h))),v=p.next();!v.done;v=p.next()){var g=eK(v.value,2),m=g[0],y=g[1];u[m]=y}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(a=void 0,eH(Object.keys(h))),_=b.next();!_.done;_=b.next()){var m=_.value;delete u[m]}}catch(e){a={error:e}}finally{try{_&&!_.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}break;case"$clearAll":u={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return r.userProperties=u,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return eQ({},this.identity)},e.prototype.setIdentity=function(e){var t=eQ({},this.identity);this.identity=eQ({},e),eG(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),eY="u">typeof globalThis?globalThis:e.g,eX=function(){function e(){this.identityStore=new eJ,this.eventBridge=new e$,this.applicationContextProvider=new eB}return e.getInstance=function(t){return eY.analyticsConnectorInstances||(eY.analyticsConnectorInstances={}),eY.analyticsConnectorInstances[t]||(eY.analyticsConnectorInstances[t]=new e),eY.analyticsConnectorInstances[t]},e}(),eZ=function(e){return void 0===e&&(e=Y),eX.getInstance(e)},e0=function(e,t){eZ(t).identityStore.editIdentity().setUserId(e).commit()},e1=function(e,t){eZ(t).identityStore.editIdentity().setDeviceId(e).commit()},e2=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},e3=function(){function e(){this.name="identity",this.type="before",this.identityStore=eZ().identityStore}return e.prototype.execute=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t;return(0,W.__generator)(this,function(r){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(t){return e.instanceName&&(this.identityStore=eZ(e.instanceName).identityStore),[2]})})},e}(),e4=function(){var e,t=eS();return(null==(e=null==t?void 0:t.location)?void 0:e.search)?t.location.search.substring(1).split("&").filter(
2Boolean).reduce(function(e,t){var r=t.split("=",2),n=e8(r[0]),i=e8(r[1]);return i&&(e[n]=i),e},{}):{}},e8=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},e6=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),e5=function(){function e(e,t,r,n,i){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=n||("US"===r?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new e6(e,t),this.customFetch=i}return e.prototype.subscribe=function(e,t,r){var n=eE(),i={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),n},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return -1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){var e,t=this;return(0,W.__generator)(this,function(r){switch(r.label){case 0:if(this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5)return this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2];return[4,this.getOrCreateFetchPromise()];case 1:return e=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(r){t.sendCallback(r,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise||(this.isLastFetchInvalidApiKey?(this.logger.debug("Remote config client skipping fetch: Invalid API key"),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally(function(){e.fetchPromise=null})):this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null})),this.fetchPromise},e.prototype.subscribeAll=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,W.__generator)(this,function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)}),r=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,r])];case 1:return void 0!==(n=o.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),null!==n.remoteConfig?this.sendCallback(e,n,"cache"):this.logger.debug("Remote config client skips sending c
2allback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return(0,W.__awaiter)(this,void 0,void 0,function(){var r,n;return(0,W.__generator)(this,function(i){switch(i.label){case 0:r=new Promise(function(e,r){setTimeout(function(){r("Timeout exceeded")},t)}),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[3,5];case 3:return i.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(n=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),(0,W.__awaiter)(this,void 0,void 0,function(){var r,n,i,o,a,s,u=this;return(0,W.__generator)(this,function(l){switch(l.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},i=function(n){var i,a,s,l,c,d,f,h,p;return(0,W.__generator)(this,function(v){switch(v.label){case 0:i=!0,a=new AbortController,s=setTimeout(function(){return a.abort()},t),v.label=1;case 1:var g,m;if(v.trys.push([1,10,11,12]),l=o.getUrlParams(),c={Accept:"*/*"},!o.customFetch)return[3,3];return[4,(g=o.customFetch({url:l,method:"GET",headers:c,signal:a.signal}),m=a.signal,new Promise(function(e,t){var r=function(){var e=Error("Remote config custom fetch aborted by timeout");e.name="AbortError",t(e)};m.addEventListener("abort",r,{once:!0}),g.then(function(t){m.removeEventListener("abort",r),e(t)},function(e){m.removeEventListener("abort",r),t(e)})}))];case 2:return f=v.sent(),[3,5];case 3:return[4,fetch(l,{method:"GET",headers:c,signal:a.signal})];case 4:f=v.sent(),v.label=5;case 5:if((d=f).ok||d.status>=200&&d.status<300)return[3,7];return[4,d.text()];case 6:return h=v.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(d.status,": ").concat(h)),401===d.status||403===d.status?(o.logger.error("Remote config client fetch failed with ".concat(d.status,". Invalid API key; future fetches will be skipped.")),o.isLastFetchInvalidApiKey=!0,i=!1):d.status>=400&&d.status<500&&429!==d.status&&(i=!1),[3,9];case 7:return[4,d.json()];case 8:return[2,{value:{remoteConfig:v.sent(),lastFetch:new Date}}];case 9:return[3,12];case 10:return(p=v.sent())instanceof Error&&"AbortError"===p.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),p),[3,12];case 11:return clearTimeout(s),[7];case 12:if(!i)return[2,"break"];if(!(n<e-1))return[3,14];return[4,new Promise(function(e){return setTimeout(e,u.getJitterDelay(r))})];case 13:v.sent(),v.label=14;case 14:return[2]}})},o=this,a=0,l.label=1;case 1:if(!(a<e))return[3,4];return[5,i(a)];case 2:if("object"==typeof(s=l.sent()))return[2,s.value];if("break"===s)return[3,4];l.label=3;case 3:return a++,[3,1];case 4:return[2,n]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}(),e9="tags",e7="counters",te="histograms",tt="events",tr="internal",tn="last_flush_timestamp",ti=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return(null==(e=eS())?void 0:e.indexedDB)!==void 0},e.prototype.getDB=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var e=this;return new Promise(function(t,r){var n=indexedDB.open(e.dbName,1);n.onerror=function(){e.dbPromise=null,r(Error("Failed to open IndexedDB"))},n.onsuccess=function(){var r=n.result;r.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},r.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),r.close()},t(r)},n.onupgradeneeded=function(){var t=n.result;t?e.createTables(t):e.logger.debug("DiagnosticsStorage: Missing DB during upgrade.")}})},e.prototype.createTables=function(e){e.objectStoreNames.contains(e9)||e.createObjectStore(e9,{keyPath:"key"}),e.objectStoreNames.contains(e7)||e.createObjectStore(e7,{keyPath:"key"}),e.objectStoreNames.contains(te)||e.createObjectStore(te,{keyPath:"key"}),e.objectStoreNames.contains(tt)||e.createObjectStore(tt,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1}),e.objectStoreNames.contains(tr)||e.createObjectStore(tr,{keyPath:"key"})},e.prototype.setTags=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,W.__generator)(this,function(o){switch(o.label){case 0:if(o.tr
2ys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return r=(t=o.sent().transaction([e9],"readwrite")).objectStore(e9),[2,new Promise(function(n){var o=Object.entries(e);t.oncomplete=function(){n()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to set tags",e),n()},o.forEach(function(e){var t=(0,W.__read)(e,2),n=t[0],o=t[1];r.put({key:n,value:o}).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to set tag",n,o,e)}})})];case 2:return n=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",n),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,W.__generator)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return r=(t=o.sent().transaction([e7],"readwrite")).objectStore(e7),[2,new Promise(function(n){var o=Object.entries(e);t.oncomplete=function(){n()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to increment counters",e),n()},o.forEach(function(e){var t=(0,W.__read)(e,2),n=t[0],o=t[1],a=r.get(n);a.onsuccess=function(){var e=a.result,t=e?e.value:0;r.put({key:n,value:t+o}).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to update counter",n,e)}},a.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to read existing counter",n,e)}})})];case 2:return n=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",n),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,W.__generator)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return r=(t=o.sent().transaction([te],"readwrite")).objectStore(te),[2,new Promise(function(n){var o=Object.entries(e);t.oncomplete=function(){n()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),n()},o.forEach(function(e){var t=(0,W.__read)(e,2),n=t[0],o=t[1],a=r.get(n);a.onsuccess=function(){var e,t=a.result;e=t?{key:n,count:t.count+o.count,min:Math.min(t.min,o.min),max:Math.max(t.max,o.max),sum:t.sum+o.sum}:{key:n,count:o.count,min:o.min,max:o.max,sum:o.sum},r.put(e).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to set histogram stats",n,e)}},a.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",n,e)}})})];case 2:return n=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",n),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,W.__generator)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===e.length)return[2];return[4,this.getDB()];case 1:return r=(t=o.sent().transaction([tt],"readwrite")).objectStore(tt),[2,new Promise(function(n){t.oncomplete=function(){n()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to add event records",e),n()};var o=r.count();o.onsuccess=function(){var t=Math.max(0,10-o.result);t<e.length&&i.logger.debug("DiagnosticsStorage: Only added ".concat(t," of ").concat(e.length," events due to storage limit")),e.slice(0,t).forEach(function(e){r.add(e).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to add event record",e)}})},o.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}})];case 2:return n=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",n),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(e,t){return(0,W.__awaiter)(this,void 0,void 0,function(){var r,n,i;return(0,W.__generator)(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=(r=o.sent().transaction([tr],"readwrite")).objectStore(tr),[2,new Promise(function(i,o){r.onabort=function(){return o(Error("Failed to set internal value"))};var a=n.put({key:e,value:t});a.onsuccess=function(){return i()},a.onerror=function(){return o(Error("Failed to set internal value"))}})];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",i),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,W.__generator)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=(t=i.sent().transaction([tr],"readonly")).objectStore(tr),[2,new Promise(function(n,i){t.onabort=function(){return i(Error("Failed to get internal value"))};var o=r.get(e);o.onsuccess=function(){return n(o.result)},o.onerror=function(){return i(Error("Failed to get internal value"))}})];case 2:return n=i.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",n),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,W.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getInternal(tn)];case 1:return[2,(e=r.sent())?parseInt(e.value,10):void 0];case 2:return t=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t;return(0,W.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.setInternal(tn,e.toString())];case 1:return r.sent(),[3,3];case 2:return t=r.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(e,t){return new Promise(function(r,n){var i=e.objectStore(t).clear();i.onsuccess=function(){return r()},i.onerror=function(){return n(Error("Failed to clear table ".concat(t)))}})},e.prototype.getAllAndClear=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){var e,t,r,n,i,o,a;return(0,W.__generator)(this,function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=s.sent().transaction([e9,e7,te,tt],"readwrite"),[4,Promise.all([this.getAllFromStore(e,e9),this.getAllFromStore(e,e7),this.getAllFromStore(e,te),this.getAllFromStore(e,tt)])];case 2:return r=(t=W.__read.apply(void 0,[s.sent(),4]))[0],n=t[1],i=t[2],o=t[3],[4,Promise.all([this.clearTable(e,e7),this.clearTable(e,te),this.clearTable(e,tt)])];case 3:return s.sent(),[2,{tags:r,counters:n,histogramStats:i,events:o}];case 4:return a=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",a),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(e,t){return new Promise(function(r,n){var i=e.objectStore(t).getAll();i.onsuccess=function(){return r(i.result)},i.onerror=function(){return n(Error("Failed to get all from ".concat(t)))}})},e}(),to=function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return t}
2,ta=function(e,t){return 31*Math.abs(to(e.toString()))%1e5/1e5<t},ts=function(){var e=eS();if(!e)return[];var t=e.__AMPLITUDE_SCRIPT_URL__;return Array.isArray(t)?t:"string"==typeof t?[t]:[]},tu=function(e){var t=eS();if(t&&"function"==typeof t.addEventListener){var r=function(t){e.recordEvent("sdk.error.uncaught",(0,W.__assign)({type:t.type,message:t.message,filename:t.filename,error_name:t.errorName,stack:t.stack},t.metadata))};t.addEventListener("error",function(e){var t=e.error instanceof Error?e.error:void 0,n=null==t?void 0:t.stack,i=tl({filename:e.filename,stack:n});i&&r({type:"error",message:e.message,stack:n,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:i}})},!0),t.addEventListener("unhandledrejection",function(e){var t,n=e.reason instanceof Error?e.reason:void 0,i=null==n?void 0:n.stack,o=tc(i),a=tl({filename:o,stack:i});a&&r({type:"unhandledrejection",message:null!=(t=null==n?void 0:n.message)?t:td(e.reason),stack:i,filename:o,errorName:null==n?void 0:n.name,metadata:{isTrusted:e.isTrusted,matchReason:a}})},!0)}},tl=function(e){var t,r,n=ts();if(0!==n.length)try{for(var i=(0,W.__values)(n),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.filename&&e.filename.includes(a))return"filename";if(e.stack&&e.stack.includes(a))return"stack"}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},tc=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},td=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},tf=function(){function e(e,t,r,n,i){void 0===r&&(r="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===r?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(n,null,2)),this.config=(0,W.__assign)({enabled:!0,sampleRate:0},n),this.startTimestamp=Date.now(),this.shouldTrack=ta(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,i?this.storage=i:ti.isSupported()?this.storage=new ti(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),tu(this))}return e.prototype.isStorageAndTrackEnabled=function(){return!!this.storage&&!!this.shouldTrack},e.prototype.setTag=function(e,t){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryTags).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit");this.inMemoryTags[e]=t,this.startTimersIfNeeded()}},e.prototype.increment=function(e,t){if(void 0===t&&(t=1),this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryCounters).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit");this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()}},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryHistograms).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");var r=this.inMemoryHistograms[e];r?(r.count+=1,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){if(this.isStorageAndTrackEnabled()){if(this.inMemoryEvents.length>=10)return void this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit");this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()}},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout(function(){e.saveAllDataToStorage().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)}).finally(function(){e.saveTimer=null})},1e3)),this.flushTimer||(this.flushTimer=setTimeout(function(){e._flush().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)}).finally(function(){e.flushTimer=null})},3e5))},e.prototype.saveAllDataToStorage=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){var e,t,r,n;return(0,W.__generator)(this,function(i){switch(i.label){case 0:if(!this.storage)return[2];return e=(0,W.__assign)({},this.inMemoryTags),t=(0,W.__assign)({},this.inMemoryCounters),r=(0,W.__assign)({},this.inMemoryHistograms),n=(0,W.__spreadArray)([],(0,W.__read)(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(t),this.storage.setHistogramStats(r),this.storage.addEventRecords(n)])];case 1:return i.sent(),[2]}})})},e.prototype._flush=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){var e,t,r,n,i,o,a,s,u,l;return(0,W.__generator)(this,function(c){switch(c.label){case 0:if(!this.storage)return[2];return[4,this.saveAllDataToStorage()];case 1:return c.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:if(t=(e=c.sent()).tags,r=e.counters,n=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),o={},t.forEach(function(e){o[e.key]=e.value}),a={},r.forEach(function(e){a[e.key]=e.value}),s={}
2,n.forEach(function(e){s[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}}),u=i.map(function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}}),0===Object.keys(a).length&&0===Object.keys(s).length&&0===u.length)return[2];return l={tags:o,histogram:s,counters:a,events:u},this.fetch(l),[2]}})})},e.prototype.fetch=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t;return(0,W.__generator)(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!eS())throw Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:if(!r.sent().ok)return this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2];return this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3];case 2:return t=r.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){var e,t,r;return(0,W.__generator)(this,function(n){switch(n.label){case 0:if(!this.storage)return[2];return e=Date.now(),[4,this.storage.getLastFlushTimestamp()];case 1:if(-1===(t=n.sent()||-1))return this.storage.setLastFlushTimestamp(e),this._setFlushTimer(3e5),[2];return(r=e-t)>=3e5?this._flush():this._setFlushTimer(3e5-r),[2]}})})},e.prototype._setFlushTimer=function(e){var t=this;this.flushTimer=setTimeout(function(){t._flush().catch(function(e){t.logger.debug("DiagnosticsClient: Failed to flush",e)}).finally(function(){t.flushTimer=null})},e)},e.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=ta(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),th=e.i(37611),tp=th.default||th,tv=function(e,t){var r,n,i;return"boolean"==typeof e?e:(null==e?void 0:e[t])!==!1&&("string"!=typeof(null==(n=null==(r=null==(i=eS())?void 0:i.chrome)?void 0:r.runtime)?void 0:n.id)||!!(null==e?void 0:e[t]))},tg=function(e){return tv(e,"attribution")},tm=function(e){return tv(e,"formInteractions")},ty=function(e){return tv(e,"pageViews")},tb=function(e){return tv(e,"sessions")},t_=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},tw=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},tS=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},tk=function(e){if("object"==typeof e.autocapture){var t=e.autocapture.performanceTracking;if(!0===t)return{mainThreadBlock:!0};if("object"==typeof t&&null!==t)return t}},tE=function(e){if(tw(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},tO=function(e){if(tS(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},tx=function(e){if(t_(e.autocapture)){var t,r,n=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?n=e.autocapture.networkTracking:e.networkTrackingOptions&&(n=e.networkTrackingOptions),(0,W.__assign)((0,W.__assign)({},n),{captureRules:(t=null==n?void 0:n.captureRules,r=e.loggerProvider,null==t?void 0:t.map(function(e){var t,n;if((null==(t=e.urls)?void 0:t.length)&&(null==(n=e.hosts)?void 0:n.length)){var i=JSON.stringify(e.hosts),o=JSON.stringify(e.urls);return null==r||r.warn("Found network capture rule with both urls='".concat(o,"' and hosts='").concat(i,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),(0,W.__assign)((0,W.__assign)({},e),{hosts:void 0})}return e}))})}},tT=function(e){var t,r=function(){return!1},n=void 0,i=e.pageCounter;return ty(e.defaultTracking)&&(r=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:r,trackHistoryChanges:n,eventType:t,pageCounter:i}},tC=function(e){if(tm(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions},tP=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.name,o=n.args,a=n.resolve,s=e&&e[i];if("function"==typeof s){var u=s.apply(e,o);"function"==typeof a&&a(null==u?void 0:u.promise)}}return e},tA=function(e){return e&&void 0!==e._q},tI=function(e){var t,r;return"string"==typeof(null==(r=null==(t=e.chrome)?void 0:t.runtime)?void 0:r.id)},tR=function(e){var t=e.ServiceWorkerGlobalScope;return"function"==typeof t&&e instanceof t},tD=function(e){var t=e.WorkerGlobalScope;return"function"==typeof t&&e instanceof t},tN=function(e){var t,r;return"string"==typeof(null==(r=null==(t=e.process)?void 0:t.ver
2sions)?void 0:r.node)},tM=function(){if("u"<typeof navigator)return"";var e,t,r,n,i=navigator.userLanguage;return null!=(n=null!=(r=null!=(t=null==(e=navigator.languages)?void 0:e[0])?t:navigator.language)?r:i)?n:""},tj="2.45.8",tL="amplitude-ts",tF=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(tL,"/").concat(tj),"u">typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,r;return(0,W.__awaiter)(this,void 0,void 0,function(){var n,i,o;return(0,W.__generator)(this,function(a){return n=new Date().getTime(),i=null!=(t=this.config.lastEventId)?t:-1,o=null!=(r=e.event_id)?r:i+1,this.config.lastEventId=o,e.time||(this.config.lastEventTime=n),[2,(0,W.__assign)((0,W.__assign)((0,W.__assign)((0,W.__assign)((0,W.__assign)((0,W.__assign)((0,W.__assign)((0,W.__assign)({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:n},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:tM()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:eE(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:o,library:this.library,user_agent:this.userAgent})]})})},e}(),tq=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t;return(0,W.__generator)(this,function(r){switch(r.label){case 0:return[4,this.get(e)];case 1:return[2,(t=r.sent())?JSON.stringify(t):void 0]}})})},e.prototype.set=function(e,t){return(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(r){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(e){return this.memoryStorage.clear(),[2]})})},e}(),tU=function(){var e,t=eS();return null==(e=null==t?void 0:t.navigator)?void 0:e.locks},tV=function(){function e(e,t){void 0===t&&(t={}),this.options=(0,W.__assign)({},e),this.config=t}return e.prototype.isEnabled=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,W.__generator)(this,function(o){switch(o.label){case 0:return t="AMP_TEST",r=new e((0,W.__assign)({},this.options)),n=String(Date.now()),[4,r.transaction(t,function(e){var r,o;try{e.set(n);var a=e.get()===n;return!a&&i.config.diagnosticsClient&&(null==(r=i.config.diagnosticsClient)||r.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:t,testValue:n,sync:!0})),a}catch(e){if(i.config.diagnosticsClient){var s=e instanceof Error?e.message:String(e);null==(o=i.config.diagnosticsClient)||o.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:t,testValue:n,error:s,sync:!0})}return!1}finally{e.set(null)}})];case 1:return[2,o.sent()]}})})},e.prototype.get=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t;return(0,W.__generator)(this,function(r){switch(r.label){case 0:return[4,this.getRaw(e)];case 1:return t=r.sent(),[2,this.decodeCookieValue(e,t)]}})})},e.prototype.decodeCookieValue=function(e,t){if(t)try{var r=tW(t);if(void 0===r)return void console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t));return JSON.parse(r)}catch(r){console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t));return}},e.prototype.getSync=function(e){var t=this.getRawSync(e);return this.decodeCookieValue(e,t)},e.prototype.getRaw=function(e){var t,r;return(0,W.__awaiter)(this,void 0,void 0,function(){var n,i,o,a,s,u,l,c;return(0,W.__generator)(this,function(d){switch(d.label){case 0:n=eS(),d.label=1;case 1:if(d.trys.push([1,4,,5]),!(i=null==n?void 0:n.cookieStore))return[3,3];return[4,i.getAll(e)];case 2:if(o=d.sent()){o.length>1&&(null==(t=this.config.diagnosticsClient)||t.recordEvent("cookies.duplicate",{cookies:o.map(function(e){return e.domain})}),null==(r=this.config.diagnosticsClient)||r.increment("cookies.duplicate.occurrence.cookieStore"));try{for(s=(a=(0,W.__values)(o)).next();!s.done;s=a.next())if(u=s.value,t$(u.domain,this.options.domain))return[2,u.value]}catch(e){l={error:e}}finally{try{s&&!s.done&&(c=a.return)&&c.call(a)}finally{if(l)throw l.error}}}d.label=3;case 3:return[3,5];case 4:return d.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}})})},e.prototype.getRawSync=function(e){var t,r,n=this,i=eS(),o=(null!=(r=null==(t=null==i?void 0:i.document)?void 0:t.cookie.split("; "))?r:[]).filter(function(t){return 0===t.indexOf(e+"=")}),a=void 0,s=this.config.duplicateResolverFn;
2if("function"==typeof s&&o.length>1&&(a=o.find(function(t){var r;try{var i=s(t.substring(e.length+1));return i||null==(r=n.config.diagnosticsClient)||r.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(e){return!1}})),a||(a=o[0]),a)return a.substring(e.length+1)},e.prototype.set=function(e,t){return(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(r){return this.setSync(e,t),[2]})})},e.prototype.setSync=function(e,t){var r;try{var n=eS();if(!n||!n.document||"function"!=typeof n.btoa||"function"!=typeof n.encodeURIComponent)return;var i=null!=(r=this.options.expirationDays)?r:0,o=null!==t?i:-1,a=void 0;if(o){var s=new Date;s.setTime(s.getTime()+24*o*36e5),a=s}var u="".concat(e,"=").concat(n.btoa(n.encodeURIComponent(JSON.stringify(t))));a&&(u+="; expires=".concat(a.toUTCString())),u+="; path=/",this.options.domain&&(u+="; domain=".concat(this.options.domain)),this.options.secure&&(u+="; Secure"),this.options.sameSite&&(u+="; SameSite=".concat(this.options.sameSite)),n.document.cookie=u}catch(t){var l=t instanceof Error?t.message:String(t);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(l))}},e.prototype.remove=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}})})},e.prototype.reset=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(e){return[2]})})},e.isDomainWritable=function(t){return(0,W.__awaiter)(this,void 0,void 0,function(){var r,n;return(0,W.__generator)(this,function(i){switch(i.label){case 0:if(e.cachedTlds[t])return[2,!0];r="AMP_TLDTEST",n=new e({domain:"."+t}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.transaction(r,function(r){if(e.cachedTlds[t])return!0;try{r.set(1);var n=!!r.get();return n&&(e.cachedTlds[t]=!0),n}finally{r.set(null)}})];case 2:return[2,!!i.sent()];case 3:return i.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(e,t){return(0,W.__awaiter)(this,void 0,void 0,function(){var r,n,i=this;return(0,W.__generator)(this,function(o){switch(o.label){case 0:if(r=tU(),n=function(){return t({get:function(){return i.getSync(e)},set:function(t){return i.setSync(e,t)}})},!r)return[2,n()];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,r.request("com.amplitude:cookie-lock:".concat(e),n)];case 2:return[2,o.sent()];case 3:return o.sent(),[2,n()];case 4:return[2]}})})},e.cachedTlds={},e}(),tz=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},tB=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},tW=function(e){var t;return null!=(t=tz(e))?t:tB(e)},t$=function(e,t){if(""===e&&""===t)return!0;if(!e||!t)return!1;var r=e.startsWith(".")?e.substring(1):e,n=t.startsWith(".")?t.substring(1):t;return r.toLowerCase()===n.toLowerCase()},tQ=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),["AMP",t,e.substring(0,r)].filter(Boolean).join("_")},tH=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,W.__generator)(this,function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),r=new e(this.storage),n="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,r.set(n,t)];case 2:return i.sent(),[4,r.get(n)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t;return(0,W.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:if(!(t=r.sent()))return[2,void 0];return[2,JSON.parse(t)];case 2:return r.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){var t;return(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(r){return[2,(null==(t=this.storage)?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var r;return(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(n){try{null==(r=this.storage)||r.setItem(e,JSON.stringify(t))}catch(e){}return[2]})})},e.prototype.remove=function(e){var t;return(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(r){try{null==(t=this.storage)||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(t){try{null==(e=this.storage)||e.clear()}catch(e){}return[2]})})},e}(),tK=function(e){function t(t){var r,n,i,o=this;try{i=null==(r=eS())?void 0:r.localStorage}catch(e){null==(n=null==t?void 0:t.loggerProvider)||n.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return(0,W.__extends)(t,e),t.prototype.set=function(t,r){var n;return(0,W.__awaiter)(this,void 0,void 0,function(){var i;return(0,W.__generator)(this,function(o){switch(o.label){case 0:if(!(Array.isArray(r)&&r.length>1e3))return[3,2];return i=r.length-1e3,[4,e.prototype.set.call(this,t,r.slice(0,1e3))];case 1:return o.sent(),null==(n=this.loggerProvider)||n.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(1e3,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,r)];case 3:o.sent(),o.label=4;case 4:return[2]}})})},t}(tH),tG=function(e){function t(){var t;return e.call(this,null==(t=eS())?void 0:t.sessionStorage)||this}return(0,W.__extends)(t,e),t}(tH),tJ=function(){function e(){}return e.prototype.send=function(e,t,r){return Promise.resolve(null)},e.prototype.buildResponse=function(e){if("object"!=typeof e)return null;var t,r,n,i,o,a,s,u,l,c,d,f,h,p,v,g,m,y,b,w,S,k,E=e.code||0,O=this.buildStatus(E);switch(O){case _.Success:return{status:O,statusCode:E,body:{eventsIngested:null!=(t=e.events_ingested)?t:0,payloadSizeBytes:null!=(r=e.payload_size_bytes)?r:0,serverUploadTime:null!=(n=e.server_upload_time)?n:0}};case _.Invalid:return{status:O,statusCode:E,body:{error:null!=(i=e.error)?i:"",missingField:null!=(o=e.missing_field)?o:"",eventsWithInvalidFields:null!=(a=e.events_with_invali
2d_fields)?a:{},eventsWithMissingFields:null!=(s=e.events_with_missing_fields)?s:{},eventsWithInvalidIdLengths:null!=(u=e.events_with_invalid_id_lengths)?u:{},epsThreshold:null!=(l=e.eps_threshold)?l:0,exceededDailyQuotaDevices:null!=(c=e.exceeded_daily_quota_devices)?c:{},silencedDevices:null!=(d=e.silenced_devices)?d:[],silencedEvents:null!=(f=e.silenced_events)?f:[],throttledDevices:null!=(h=e.throttled_devices)?h:{},throttledEvents:null!=(p=e.throttled_events)?p:[]}};case _.PayloadTooLarge:return{status:O,statusCode:E,body:{error:null!=(v=e.error)?v:""}};case _.RateLimit:return{status:O,statusCode:E,body:{error:null!=(g=e.error)?g:"",epsThreshold:null!=(m=e.eps_threshold)?m:0,throttledDevices:null!=(y=e.throttled_devices)?y:{},throttledUsers:null!=(b=e.throttled_users)?b:{},exceededDailyQuotaDevices:null!=(w=e.exceeded_daily_quota_devices)?w:{},exceededDailyQuotaUsers:null!=(S=e.exceeded_daily_quota_users)?S:{},throttledEvents:null!=(k=e.throttled_events)?k:[]}};case _.Timeout:default:return{status:O,statusCode:E}}},e.prototype.buildStatus=function(e){return eF(e)?_.Success:429===e?_.RateLimit:413===e?_.PayloadTooLarge:408===e?_.Timeout:e>=400&&e<500?_.Invalid:e>=500?_.Failed:_.Unknown},e}();function tY(){return"u">typeof CompressionStream}function tX(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t;return(0,W.__generator)(this,function(r){switch(r.label){case 0:if(void 0===(t=CompressionStream))return[2,void 0];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,new Response(new Blob([e]).stream().pipeThrough(new t("gzip"))).arrayBuffer()];case 2:return[2,r.sent()];case 3:return r.sent(),[2,void 0];case 4:return[2]}})})}var tZ=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.state={done:4},r.customHeaders=t,r}return(0,W.__extends)(t,e),t.prototype.send=function(e,t,r){return void 0===r&&(r=!1),(0,W.__awaiter)(this,void 0,void 0,function(){var n=this;return(0,W.__generator)(this,function(i){return[2,new Promise(function(i,o){"u"<typeof XMLHttpRequest&&o(Error("XHRTransport is not supported."));var a=new XMLHttpRequest;a.open("POST",e,!0),a.onreadystatechange=function(){if(a.readyState===n.state.done){var e=a.responseText;try{i(n.buildResponse(JSON.parse(e)))}catch(e){i(n.buildResponse({code:a.status}))}}};var s={"Content-Type":"application/json",Accept:"*/*"},u=JSON.stringify(t),l=r&&u.length>=2048&&tY(),c=function(e){var t,r;s=(0,W.__assign)((0,W.__assign)({},n.customHeaders),s);try{for(var i=(0,W.__values)(Object.entries(s)),o=i.next();!o.done;o=i.next()){var u=(0,W.__read)(o.value,2),l=u[0],c=u[1];a.setRequestHeader(l,c)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}a.send(e)};(0,W.__awaiter)(n,void 0,void 0,function(){var e;return(0,W.__generator)(this,function(t){switch(t.label){case 0:if(!l)return[3,2];return[4,tX(u)];case 1:return(e=t.sent())?(s["Content-Encoding"]="gzip",c(e)):c(u),[3,3];case 2:c(u),t.label=3;case 3:return[2]}})}).catch(o)})]})})},t}(tJ),t0=function(e){function t(t,r,n){void 0===t&&(t={});var i=e.call(this)||this;return i.customHeaders=t,i.enableKeepalive=!1!==r,i.referrerPolicy=n,i}return(0,W.__extends)(t,e),t.prototype.send=function(e,t,r){return void 0===r&&(r=!1),(0,W.__awaiter)(this,void 0,void 0,function(){var n,i,o,a,s,u,l,c,d;return(0,W.__generator)(this,function(f){switch(f.label){case 0:if("u"<typeof fetch)throw Error("FetchTransport is not supported");if(n=JSON.stringify(t),i=r&&n.length>=2048&&tY(),o=n,a={"Content-Type":"application/json",Accept:"*/*"},!i)return[3,2];return[4,tX(n)];case 1:(s=f.sent())&&(a["Content-Encoding"]="gzip",o=s),f.label=2;case 2:return a=(0,W.__assign)((0,W.__assign)({},this.customHeaders),a),u="string"==typeof o?o.length:o.byteLength,l={headers:a,body:o,method:"POST",keepalive:this.enableKeepalive&&u<=16384},this.referrerPolicy&&(l.referrerPolicy=this.referrerPolicy),[4,fetch(e,l)];case 3:return[4,(c=f.sent()).text()];case 4:d=f.sent();try{return[2,this.buildResponse(JSON.parse(d))]}catch(e){return[2,this.buildResponse({code:c.status})]}}})})},t}(tJ),t1=function(e){function t(){return e.call(this)||this}return(0,W.__extends)(t,e),t.prototype.send=function(e,t,r){return void 0===r&&(r=!1),(0,W.__awaiter)(this,void 0,void 0,function(){var r=this;return(0,W.__generator)(this,function(n){return[2,new Promise(function(n,i){var o=eS();if(!(null==o?void 0:o.navigator.sendBeacon))throw Error("SendBeaconTransport is not supported");try{var a=JSON.stringify(t);if(o.navigator.sendBeacon(e,a))return n(r.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:a.length,server_upload_time:Date.now()}));return n(r.buildResponse({code:500}))}catch(e){i(e)}})]})})},t}(tJ),t2=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},t3=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},t4="[Amplitude]",t8="".concat(t4," Form Started"),t6="".concat(t4," Form Submitted"),t5="".concat(t4," File Downloaded"),t9="session_start",t7="session_end",re="".concat(t4," File Extension"),rt="".concat(t4," File Name"),rr="".concat(t4," Link ID"),rn="".concat(t4," Link Text"),ri="".concat(t4," Link URL"),ro="".concat(t4," Form ID"),ra="".concat(t4," Form Name"),rs="".concat(t4," Form Destination"),ru="cookie",rl={always:"always",ifEmptyCampaign:"ifEmptyCampaign"},rc=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},rd=function(e,t,r,n,i,o){void 0===i&&(i=!0),e.referrer;var a=e.referring_domain,s=(0,W.__rest)(e,["referrer","referring_domain"]),u=t||{},l=(u.referrer,u.referring_domain),c=(0,W.__rest)(u,["referrer","referring_domain"]),d=r.excludeInternalReferrers;if(d){var f=rv(d,n);if(!(f instanceof TypeError)&&e.referring_domain&&rb(e.referring_domain,o)){if
2("always"===f)return rg(f,e.referring_domain,n),!1;else if("ifEmptyCampaign"===f&&Object.values((0,W.__assign)((0,W.__assign)({},e),{referring_domain:void 0,referrer:void 0})).every(function(e){return!e}))return rg(f,e.referring_domain,n),!1}}if(rf(r.excludeReferrers,e.referring_domain))return n.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&Object.values(e).every(function(e){return!e})&&t)return n.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var h=JSON.stringify(s)!==JSON.stringify(c),p=rc(a||"")!==rc(l||""),v=!t||h||p;return v?n.debug("This is a new campaign. An $identify event will be sent."):n.debug("This is not a new campaign because it's the same as the previous one."),v},rf=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some(function(e){return e instanceof RegExp?e.test(t):e===t})},rh=function(e,t){var r=t.startsWith(".")?t:".".concat(t);return!!(e.startsWith(".")?e:".".concat(e)).endsWith(r)},rp=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},rv=function(e,t){if(!0===e)return rl.always;if("object"==typeof e){var r=e.condition;if("string"==typeof r&&Object.keys(rl).includes(r))return r;if(void 0===r)return rl.always}var n="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(n),TypeError(n)};function rg(e,t,r){var n="This is not a new campaign because referring_domain=".concat(t," is on the same domain as the current page and it is configured to exclude internal referrers");"always"===e?r.debug(n):"ifEmptyCampaign"===e&&r.debug("".concat(n," with empty campaign parameters"))}var rm=["ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.za","appspot.com","asn.au","azurewebsites.net","cloudfront.net","myshopify.com","blogspot.com","co.ca","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.ar","com.au","com.br","com.cn","com.hk","com.in","com.jp","com.kr","com.mx","com.pl","com.sg","com.tr","com.tw","ed.jp","edu.au","edu.br","edu.cn","edu.hk","edu.sg","edu.th","edu.tr","edu.tw","firebaseapp.com","fly.dev","gc.ca","geek.nz","github.io","gitlab.io","go.jp","go.kr","go.th","gob.ar","gob.mx","gov.au","gov.br","gov.cn","gov.hk","gov.in","gov.pl","gov.sg","gov.tr","gov.tw","gov.uk","gov.za","govt.nz","gr.jp","herokuapp.com","id.au","idv.hk","iwi.nz","lg.jp","ltd.uk","maori.nz","me.uk","mil.kr","ne.jp","ne.kr","net.au","net.br","net.cn","net.hk","net.in","net.nz","net.pl","net.sg","net.tr","net.tw","net.za","onrender.com","or.jp","or.kr","or.th","org.ar","org.au","org.br","org.cn","org.hk","org.in","org.mx","org.nz","org.pl","org.sg","org.tw","org.uk","org.za","pages.dev","pe.kr","plc.uk","re.kr","res.in","sch.uk","vercel.app","netlify.app","workers.dev"],ry=function(e){var t,r,n=e||(null==(r=null==(t=eS())?void 0:t.location)?void 0:r.hostname);if(!n)return"";var i=n.split("."),o=i[i.length-1],a=i[i.length-2];return(rm.find(function(e){return n.endsWith(".".concat(e))})&&(o=i[i.length-2]+"."+i[i.length-1],a=i[i.length-3]),a)?"".concat(a,".").concat(o):o},rb=function(e,t){var r=eS();return!!r&&rh(e,(t||"").trim()||ry(r.location.hostname))},r_=function(e){function t(t,r,n,i,o,a,s,u,l,c,d,f,h,p,v,m,y,b,_,w,S,k,E,O,x,T,C,P,A,I,R,D,N,M,j,L,F,q,U,V,z,B,W,$){void 0===n&&(n=new tq),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===u&&(u=1e3),void 0===l&&(l=5),void 0===c&&(c=30),void 0===d&&(d=ru),void 0===m&&(m=new eD),void 0===y&&(y=g.Warn),void 0===_&&(_=!1),void 0===w&&(w=!1),void 0===E&&(E=""),void 0===O&&(O="US"),void 0===C&&(C=18e5),void 0===P&&(P=new tK({loggerProvider:m})),void 0===A&&(A={ipAddress:!0,language:!0,platform:!0}),void 0===I&&(I="fetch"),void 0===R&&(R=!1),void 0===D&&(D=!0),void 0===q&&(q=!0),void 0===U&&(U=0),void 0===W&&(W=!1);var Q,H=this;(H=e.call(this,{apiKey:t,storageProvider:P,transportProvider:rk(I)})||this).apiKey=t,H.appVersion=r,H.cookieOptions=i,H.defaultTracking=o,H.autocapture=a,H.flushIntervalMillis=u,H.flushMaxRetries=l,H.flushQueueSize=c,H.identityStorage=d,H.ingestionMetadata=f,H.instanceName=h,H.loggerProvider=m,H.logLevel=y,H.minIdLength=b,H.offline=_,H.partnerId=S,H.plan=k,H.serverUrl=E,H.serverZone=O,H.sessionTimeout=C,H.storageProvider=P,H.trackingOptions=A,H.transport=I,H.useBatch=R,H.fetchRemoteConfig=D,H.networkTrackingOptions=L,H.identify=F,H.enableDiagnostics=q,H.diagnosticsSampleRate=U,H.diagnosticsClient=V,H.remoteConfig=z,H.topLevelDomain=B,H.enableRequestBodyCompression=W,H.customEnrichment=$,H.version=tj,H._optOut=!1,H._cookieStorage=n,H.deviceId=s,H.lastEventId=p,H.lastEventTime=v,H.optOut=w,H.deferredSessionId=T,H.sessionId=x,H.pageCounter=M,H.userId=N,H.debugLogsEnabled=j,H.loggerProvider.enable(j?g.Debug:H.logLevel),H.networkTrackingOptions=L,H.identify=F,H.enableDiagnostics=q,H.diagnosticsSampleRate=U,H.diagnosticsClient=V;var K=null!=(Q=null==z?void 0:z.fetchRemoteConfig)?Q:D;return H.remoteConfig=H.remoteConfig||{},H.remoteConfig.fetchRemoteConfig=K,H.fetchRemoteConfig=K,H.topLevelDomain=B||ry(),H}return(0,W.__extends)(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())}
2,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,void 0!==e&&void 0!==this._deferredSessionId&&(this._deferredSessionId=void 0),this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deferredSessionId",{get:function(){return this._deferredSessionId},set:function(e){this._deferredSessionId!==e&&e!==this.sessionId&&(this._deferredSessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,deferredSessionId:this._deferredSessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof tV&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(tQ(this.apiKey),e)},t}(eM),rw=function(e,t,r){switch(void 0===e&&(e=ru),void 0===t&&(t={}),e){case"localStorage":return new tK;case"sessionStorage":return new tG;case"none":return new tq;default:return new tV((0,W.__assign)((0,W.__assign)({},t),{expirationDays:t.expiration}),r)}},rS=function(e){var t,r;return void 0===e&&(e={}),(null==(t=e.remoteConfig)?void 0:t.fetchRemoteConfig)===!0||(null==(r=e.remoteConfig)?void 0:r.fetchRemoteConfig)!==!1&&!1!==e.fetchRemoteConfig},rk=function(e){var t="object"==typeof e?e.type:e,r="object"==typeof e?e.headers:void 0,n="object"==typeof e?e.enableKeepalive:void 0,i="object"==typeof e?e.referrerPolicy:void 0;return"xhr"===t?new tZ(r):"beacon"===t?new t1:new t0(r,n,i)},rE="data-amp-mask",rO="*****",rx=/\b(?:\d[ -]*?){13,16}\b/,rT=/(\d{3}-?\d{2}-?\d{4})/g,rC=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,rP=function(e,t){if(void 0===t&&(t=[]),"string"!=typeof e)return"";var r,n,i=e;i=(i=(i=i.replace(rx,rO)).replace(rT,rO)).replace(rC,rO);try{for(var o=(0,W.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;try{i=i.replace(s,rO)}catch(e){}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},rA=function(e){if("u"<typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(rE)?rO:e?e(document.title):document.title},rI=function(){function e(){}return e.prototype.parse=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(e){return[2,(0,W.__assign)((0,W.__assign)((0,W.__assign)((0,W.__assign)({},eh),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=e4();
2return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!=(t=null==(e=r.referrer)?void 0:e.split("/")[2])?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=e4();return(e={})[er]=t[er],e[en]=t[en],e[ei]=t[ei],e[eo]=t[eo],e[ea]=t[ea],e[es]=t[es],e[eu]=t[eu],e[el]=t[el],e[ec]=t[ec],e[ed]=t[ed],e[ef]=t[ef],e},e}(),rR=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},rD="AMP_PAGE_VIEW",rN=function(e){void 0===e&&(e={});var t,r,n,i=eS(),o=void 0,a=!1,s=e.trackOn,u=e.trackHistoryChanges,l=e.eventType,c=void 0===l?"[Amplitude] Page Viewed":l,d=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==o||o.error("Malformed URI sequence: ",e)}return t},f=function(e){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var t,r,n;return(0,W.__generator)(this,function(i){switch(i.label){case 0:return t=d("u">typeof location&&location.href||""),n={event_type:c},r=[{}],[4,rM()];case 1:return[2,(n.event_properties=W.__assign.apply(void 0,[W.__assign.apply(void 0,r.concat([i.sent()])),{"[Amplitude] Page Domain":"u">typeof location&&location.hostname||"","[Amplitude] Page Location":t,"[Amplitude] Page Path":"u">typeof location&&d(location.pathname)||"","[Amplitude] Page Title":rA(rP),"[Amplitude] Page URL":t.split("?")[0],"[Amplitude] Page View ID":e}]),n)]}})})},h=function(){return void 0===s||"function"==typeof s&&s()},p="u">typeof location?location.href:null,v=function(){(0,W.__awaiter)(void 0,void 0,void 0,function(){var e,r,i,a,s;return(0,W.__generator)(this,function(l){switch(l.label){case 0:if(r=rL(u,e=location.href,p||"")&&h(),p=e,!r)return[3,4];if(i=void 0,n&&(i=eE(),n.set(rD,{pageViewId:i})),null==o||o.log("Tracking page view event"),null!=t)return[3,1];return[3,3];case 1:return s=(a=t).track,[4,f(i)];case 2:s.apply(a,[l.sent()]),l.label=3;case 3:l.label=4;case 4:return[2]}})})};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,s){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var u,l,c;return(0,W.__generator)(this,function(d){switch(d.label){case 0:if(t=s,r=e,(o=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),a=!0,i){try{n=new tH(i.sessionStorage)}catch(e){null==o||o.debug("sessionStorage is not available in this environment.")}i.addEventListener("popstate",v),i.history.pushState=new Proxy(i.history.pushState,{apply:function(e,t,r){var n=(0,W.__read)(r,3),i=n[0],o=n[1],s=n[2];e.apply(t,[i,o,s]),a&&v()}})}if(!h())return[3,2];return o.log("Tracking page view event"),u=void 0,n&&(u=eE(),n.set(rD,{pageViewId:u})),c=(l=t).track,[4,f(u)];case 1:c.apply(l,[d.sent()]),d.label=2;case 2:return[2]}})})},execute:function(e){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var t,i,a;return(0,W.__generator)(this,function(u){switch(u.label){case 0:if(!("attribution"===s&&rj(e)))return[3,4];if(null==o||o.log("Enriching campaign event to page view event with campaign parameters"),t=void 0,!n)return[3,2];return[4,n.get(rD)];case 1:t=null==(i=u.sent())?void 0:i.pageViewId,u.label=2;case 2:return[4,f(t)];case 3:e.event_type=(a=u.sent()).event_type,e.event_properties=(0,W.__assign)((0,W.__assign)({},e.event_properties),a.event_properties),u.label=4;case 4:return r&&e.event_type===c&&(r.pageCounter=r.pageCounter?r.pageCounter+1:1,e.event_properties=(0,W.__assign)((0,W.__assign)({},e.event_properties),{"[Amplitude] Page Counter":r.pageCounter})),[2,e]}})})},teardown:function(){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(e){return i&&(i.removeEventListener("popstate",v),a=!1),[2]})})}}},rM=function(){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var e;return(0,W.__generator)(this,function(t){switch(t.label){case 0:return e=rR,[4,new rI().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},rj=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,r=t[m.SET]||{},n=t[m.UNSET]||{},i=(0,W.__spreadArray)((0,W.__spreadArray)([],(0,W.__read)(Object.keys(r)),!1),(0,W.__read)(Object.keys(n)),!1);return Object.keys(eh).every(function(e){return i.includes(e)})}return!1},rL=function(e,t,r){if("pathOnly"!==e)return t!==r;if(""==r)return!0;var n=new URL(t),i=new URL(r);return n.origin+n.pathname!==i.origin+i.pathname},rF=function(){var e,t,r=[],n=function(e,t,n){e.addEventListener(t,n),r.push({element:e,type:t,handler:n})},i=function(){r.forEach(function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)}),r=[]};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(r,i){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var o,a;return(0,W.__generator)(this,function(s){return t=tC(r),o=function(){if(!i)return void r.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");if("u">typeof document){var o=new WeakSet,a=function(e){if(!o.has(e)){o.add(e);var a=!1;n(e,"change",function(){var t,r=rU(e);a||i.track(t8,((t={})[ro]=rq(e.id),t[ra]=rq(e.name),t[rs]=r,t)),a=!0}),n(e,"submit",function(n){var o,s,u=rU(e);if(a||i.track(t8,((o={})[ro]=rq(e.id),o[ra]=rq(e.name),o[rs]=u,o)),a=!0,(null==t?void 0:t.shouldTrackSubmit)!==void 0)if("function"==typeof t.shouldTrackSubmit&&"u">typeof SubmitEvent&&n instanceof SubmitEvent)try{if(!t.shouldTrackSubmit(n))return}catch(e){r.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else r.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");i.track(t6,((s={})[ro]=rq(e.id),s[ra]=rq(e.name),s[rs]=u,s)),a=!1})}};
2Array.from(document.getElementsByTagName("form")).forEach(a),"u">typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){try{if("FORM"===e.nodeName&&a(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll){var t=e.querySelectorAll("form");null==t||t.forEach(a)}}catch(e){r.loggerProvider.warn("Failed to track form interactions for an added node: ".concat(String(e)))}})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?o():(a=eS())?a.addEventListener("load",o):r.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(t){return null==e||e.disconnect(),i(),[2]})})}}},rq=function(e){if("string"==typeof e)return e},rU=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},rV=function(){var e,t=[],r=function(e,r,n){e.addEventListener(r,n),t.push({element:e,type:r,handler:n})},n=function(){t.forEach(function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)}),t=[]};return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(t,n){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var i,o;return(0,W.__generator)(this,function(a){return i=function(){if(!n)return void t.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");if("u">typeof document){var i=function(e){try{t=new URL(e.href,window.location.href)}catch(e){return}var t,i=o.exec(t.href),a=null==i?void 0:i[1];a&&r(e,"click",function(){var r;a&&n.track(t5,((r={})[re]=a,r[rt]=t.pathname,r[rr]=e.id,r[rn]=e.text,r[ri]=e.href,r))})},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;Array.from(document.getElementsByTagName("a")).forEach(i),"u">typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){try{if("A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll){var r=e.querySelectorAll("a");null==r||r.forEach(i)}}catch(e){t.loggerProvider.warn("Failed to track file downloads for an added node: ".concat(String(e)))}})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?i():(o=eS())?o.addEventListener("load",i):t.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(t){return null==e||e.disconnect(),n(),[2]})})}}},rz=!1,rB=function(e){rz||void 0!==e.defaultTracking||(e.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),rz=!0)},rW=function(){var e=eS(),t=[],r=function(r,n){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(r,n),t.push({type:r,handler:n}))},n=function(){t.forEach(function(t){var r=t.type,n=t.handler;null==e||e.removeEventListener(r,n)}),t=[]};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(n){return"u"<typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1):(e.offline=!navigator.onLine,r("online",function(){!1!==e.offline&&(e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout(function(){t.flush()},e.flushIntervalMillis))}),r("offline",function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2]})})},teardown:function(){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(e){return n(),[2]})})}}};function r$(e,t,r){var n,i,o=[];try{for(var a=(0,W.__values)(null!=t?t:[]),s=a.next();!s.done;s=a.next()){var u=s.value;try{o.push(new RegExp(u))}catch(e){r.warn("Invalid regex pattern: ".concat(u),e)}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return e.concat(o)}var rQ=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],rH="data-amp-track-",rK=["div","span","h1","h2","h3","h4","h5","h6"],rG="https://app.amplitude.com",rJ={US:rG,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},rY="__AMPLITUDE_MESSENGER_INSTANCE__",rX="__AMPLITUDE_MESSENGER__",rZ=function(){function e(e){var t=(void 0===e?{}:e).origin;this[S]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=void 0===t?rG:t}return e.prototype.notify=function(e){var t,r,n,i;null==(r=null==(t=this.logger)?void 0:t.debug)||r.call(t,"Message sent: ",JSON.stringify(e)),null==(i=null==(n=window.opener)?void 0:n.postMessage)||i.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise(function(t,a){n.requestCallbacks[i]={resolve:t,reject:a},n.notify(o),r.timeout>0&&setTimeout(function(){a(Error("".concat(e," timed out (id: ").concat(i,")"))),delete n.requestCallbacks[i]},r.timeout)})},e.prototype.handleResponse=function(e){var t;if(!this.requestCallbacks[e.id]){null==(t=this.logger)||t.warn("No callback found for request id: ".concat(e.id));return}this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]},e.prototype.registerActionHandler=function(e,t){this.actionHandlers.has(e)&&(null==(o=null==(i=this.logger)?void 0:i.warn)||o.call(i,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var r,n,i,o,a=this.pendingMessages.get(e);if(a){this.pendingMessages.delete(e);try{for(var s=(0,W.__values)(a),u=s.next();!u.done;u=s.next()){var l=u.value;t(l)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(e){return(0,W.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,W.__generator)(this,function(i){switch(i.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];r=(document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,r){var n;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",function(){t({status:!0})},{once:!0}),i.addEventListener("error",function(){r({status:!1,message:"Failed to load the script ".concat(e)})}),null==(n=document.head)||n.appendChild(i)}catch(e){r(e)}})).then(function(){}),this.scriptLoadPromises.set(e,r),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r];case 2:return i.sent(),[3,4];case 3:throw n=i.sent(),this.scriptLoadPromises.delete(e),n;case 4:return[2]}})})},e.prototype.setup=function(e){var t,r,n=this,i=void 0===e?{}:e,o=i.logger,a=i.endpoint;o&&(this.logger=o),a&&this.endpoint===rG&&(this.endpoint=a),this.isSetup||(this.isSetup=!0,null==(r=null==(t=this.logger)?void 0:t.debug)||r.call(t,"Setting up messenger"),this.messageHandler=function(e){if(null==(r=null==(t=n.logger)?void 0:t.debug)||r.call(t,"Message received: ",JSON.stringify(e)),n.endpoint===e.origin){var t,r,i,o,a,s=e.data,u=null==s?void 0:s.action;if(u)if("id"in s&&s.id)null==(o=null==(i=n.logger)?void 0:i.debug)||o.call(i,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(s);else{if("ping"===u)return void n.notify({action:"pong"});var l=n.actionHandlers.get(u);if(l)l(s.data);else{var c=null!=(a=n.pendingMessages.get(u))?a:[];c.push(s.data),n.pendingMessages.set(u,c)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=eS();(null==e?void 0:e[rX])===this&&delete e[rX]},e}();S=rY;var r0="__AMPLITUDE_BACKGROUND_CAPTURE__",r1=e.i(79815);function r2(e,t){return new r1.default(function(r){e.subscribe({next:function(e){t(e).then(function(e){return r.next(e)}).catch(function(e){return r.error(e)})},error:function(e){r.error(e)},complete:function(){r.complete()}})})}function r3(e,t){return new r1.default(function(r){var n=!1,i=new Set,o=function(){var e,t;n=!0;try{for(var r=(0,W.__values)(i),o=r.next();!o.done;o=r.next()){var a=o.value;try{a.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}i.clear()},a=function(e){var t=e.subscribe({next:function(e){n||r.next(e)},error:function(e){n||(n=!0,r.error(e),o())},complete:function(){i.delete(t),n||0!==i.size||(r.complete(),o(),n=!0)}});i.add(t)};return a(e),a(t),o})}function r4(e){var t=new Set,r=null;function n(){null==r||r.unsubscribe(),r=null,t.clear()}return new r1.default(function(i){return t.add(i),null===r&&(r=e.subscribe({next:function(e){try{for(var r,n,i,o=(0,W.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;null==(i=s.next)||i.call(s,e)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},error:function(e){try{for(var r,i,o,a=(0,W.__values)(t),s=a.next();!s.done;s=a.next()){var u=s.value;null==(o=u.error)||o.call(u,e)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}n()},complete:function(){try{for(var e,r,i,o=(0,W.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;null==(i=s.complete)||i.call(s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}n()}})),function(){t.delete(i),0===t.size&&r&&(r.unsubscribe(),r=null)}})}var r8="1.29.0",r6="[Amplitude] Element Clicked",r5="[Amplitude] Element Tag",r9="[Amplitude] Element Text",r7="[Amplitude] Page URL",ne="[Amplitude] Viewport Height",nt="[Amplitude] Viewport Width",nr="[Amplitude] Page View ID",nn="data-amp-mask-attributes",ni="data-amp-internal-shadow",no=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},na=function(e,t){var r=e;try{r=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return r},ns=":scope > ";function nu(e){return"u">typeof ShadowRoot&&e instanceof ShadowRoot}function nl(e,t){var r,n,i,o;return(0,W.__generator)(this,function(a){switch(a.label){case 0:r=e,n=0,i=0,a.label=1;case 1:if(!(null!==r&&i<1024))return[3,3];return i+=1,[4,r];case 2:if(a.sent(),r.parentElement)return r=r.parentElement,[3,1];if(n<t&&"function"==typeof r.getRootNode&&(o=function(e){if(e.parentElement)return e.parentElement;var t=e.getRootNode();return nu(t)?t.host:null}(r))&&o!==r)return n+=1,r=o,[3,1];return[3,3];case 3:return[2]}})}function nc(e,t){var r=[];if(t<=0)return r;for(var n=[[e,0]],i=0;n.length&&i<5e4;){i+=1;var o=(0,W.__read)(n.pop(),2),a=o[0],s=o[1],u=a.shadowRoot;if(u&&s+1<=t){r.push({root:u,depth:s+1});for(var l=u.children,c=0;c<l.length;c++)n.push([l[c],s+1])}for(var d=a.children,c=0;c<d.length;c++)n.push([d[c],s])}return r}
2function nd(e,t){for(var r=[],n=e,i=0;null!==n&&i<1024;){i+=1;var o=function(e){var t,r=e.getRootNode();return nu(r)?r:null!=(t=e.ownerDocument)?t:document}(n);r.push({root:o,target:n});var a=n.getRootNode();if(!nu(a))break;n=a.host}var s=r.length-1,u=!1,l=r;return s>t&&(l=r.slice(s-t),u=!0),{segments:l.reverse(),truncated:u}}function nf(e,t){for(var r=0,n=0;n<t.length;n++){var i=t[n];if(i.tagName===e.tagName&&(r+=1,i===e))return r}return 1}var nh=Object.freeze({enabled:!1,maxDepth:0}),np=function(e){var t,r=null!=(t=e.maxShadowDomDepth)?t:1;return!e.shadowDomEnabled||r<=0?nh:Object.freeze({enabled:!0,maxDepth:r})},nv=function(){var e=nh,t=new Set,r=function(e){var r,n;try{for(var i=(0,W.__values)((0,W.__spreadArray)([],(0,W.__read)(t),!1)),o=i.next();!o.done;o=i.next()){var a=o.value;try{a(e)}catch(e){}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.clear()};return{get:function(){return e},arm:function(t){return e.enabled||!t.enabled||(e=t,r(t)),e},onArm:function(r){if(e.enabled){var n=e;try{r(n)}catch(e){}return function(){}}return t.add(r),function(){t.delete(r)}}}},ng=["input","select","textarea"],nm=function(e,t){var r,n=null==(r=null==window?void 0:window.getComputedStyle)?void 0:r.call(window,e);return(null==n?void 0:n.getPropertyValue("cursor"))==="pointer"&&"click"===t},ny=function(e){var t=e.pageUrlAllowlist,r=e.pageUrlExcludelist;return!(r&&r.length>0&&no(window.location.href,r))&&!!no(window.location.href,t)},nb=function(e,t){return function(r,n){var i,o,a=e.shouldTrackEventResolver,s=null==(o=null==(i=null==n?void 0:n.tagName)?void 0:i.toLowerCase)?void 0:o.call(i);if(!s)return!1;if(a)return a(r,n);if(!ny(e))return!1;var u=String(null==n?void 0:n.getAttribute("type"))||"";if("string"==typeof u)switch(u.toLowerCase()){case"hidden":case"password":return!1}if(t&&!t.some(function(e){var t;return!!(null==(t=null==n?void 0:n.matches)?void 0:t.call(n,e))}))return!1;switch(s){case"input":case"select":case"textarea":return"change"===r||"click"===r;default:return"click"===r}}},n_=function(e){var t,r,n,i=null==(r=null==(t=null==e?void 0:e.tagName)?void 0:t.toLowerCase)?void 0:r.call(t),o=e instanceof HTMLElement&&(null==(n=e.getAttribute("contenteditable"))?void 0:n.toLowerCase())==="true";return!ng.includes(i)&&!o},nw=function(e){return Object.keys(e).reduce(function(t,r){var n=e[r];return null!=n&&("object"!=typeof n||0!==Object.keys(n).length)&&("string"!=typeof n||0!==n.trim().length)&&(t[r]=n),t},{})},nS=function(){var e;try{var t=eS(),r=null==(e=null==t?void 0:t.sessionStorage)?void 0:e.getItem("AMP_PAGE_VIEW");if(!r)return;var n=JSON.parse(r);if("string"==typeof n.pageViewId)return n.pageViewId}catch(e){}},nk=function(e,t,r){return(void 0===r&&(r=nh),r.enabled)?nO(e,t,r.maxDepth):nE(e,t)},nE=function(e,t){return e?t.some(function(t){var r;return null==(r=null==e?void 0:e.matches)?void 0:r.call(e,t)})?e:nE(null==e?void 0:e.parentElement,t):null},nO=function(e,t,r){if(!e)return null;var n,i,o=function(e){if(t.some(function(t){var r;return null==(r=null==e?void 0:e.matches)?void 0:r.call(e,t)}))return{value:e}};try{for(var a=(0,W.__values)(nl(e,r)),s=a.next();!s.done;s=a.next()){var u=s.value,l=o(u);if("object"==typeof l)return l.value}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return null},nx=function(e,t,r){return void 0===r&&(r=nh),r.enabled?nC(e,t,r.maxDepth):nT(e,t)},nT=function(e,t){var r=[];return t&&e.querySelectorAll(t).forEach(function(e){return r.push(e)}),r},nC=function(e,t,r){var n=nT(e,t),i=e instanceof Document?e.documentElement:e;return i&&nc(i,r).forEach(function(e){e.root.querySelectorAll(t).forEach(function(e){return n.push(e)})}),n},nP=function(e,t){if(void 0===t&&(t=nh),!t.enabled)return e.target;var r,n,i=null==(r=e.composedPath)?void 0:r.call(e),o=null!=(n=e.target)?n:null;if(!i||0===i.length)return o;var a=i[0];if(!(a instanceof Element))return null!=a?a:o;var s=nd(a,t.maxDepth),u=s.segments;return s.truncated&&u.length>0?u[u.length-1].target:a},nA=function(e){return null!==e.event.target&&!!e.closestTrackedAncestor};function nI(e){if(!e)return"";try{var t=new URL(e);return t.search="",na(t.href)}catch(t){return na(e)}}function nR(e){var t,r;return void 0===e&&(e=eS()),nI(null!=(r=null==(t=null==e?void 0:e.location)?void 0:t.href)?r:"")}(u=E||(E={}))[u.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",u[u.MIDDLE=1]="MIDDLE",u[u.RIGHT=2]="RIGHT";var nD="__AMPLITUDE_VISUAL_TAGGING__",nN=r1,nM=eS(),nj=null==nM?void 0:nM.console,nL={},nF={},nq=!1,nU=function(e,t){if(!nj||"function"!=typeof nj[e]||!nF[e]&&(nF[e]=nj[e],nj[e]=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{if(nL[e]&&!nq){nq=!0;var n=nL[e];
2n&&n.forEach(function(r){try{r(e,t)}catch(e){}})}}catch(e){}return nq=!1,nF[e].apply(nj,t)},0))return Error("Console override failed");nL[e]?nL[e].push(t):nL[e]=[t]},nV=function(e){var t,r;try{for(var n=(0,W.__values)(Object.values(nL)),i=n.next();!i.done;i=n.next())for(var o=i.value,a=o.length-1;a>=0;a--)if(o[a]===e){o.splice(a,1);break}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},nz=eS(),nB=function(e){return e.get()},nW={childList:!0,attributes:!0,characterData:!0,subtree:!0},n$=function(e){return new nN.default(e?function(t){var r,n=new WeakSet,i=new WeakMap,o=function(e,t){n.has(e)||(n.add(e),nu(e)&&i.set(e,t),u.observe(e,nW))},a=function(e,t,r){var n=r-t;n<=0||nc(e,n).forEach(function(e){return o(e.root,t+e.depth)})},s=function(e){var t=e.getRootNode();if(!nu(t))return 0;var r=i.get(t);return null!=r?r:0},u=new MutationObserver(function(r){var n,i;t.next(r);try{var o=nB(e);if(!o.enabled)return;try{for(var u=(0,W.__values)(r),l=u.next();!l.done;l=u.next()){var c=l.value;!function(e){var t=s(e.target);e.addedNodes.forEach(function(e){e instanceof Element&&a(e,t,o.maxDepth)})}(c)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}catch(e){}});if(document.body){var l=document.body;o(l,0),r=e.onArm(function(e){a(l,0,e.maxDepth)})}return function(){null==r||r(),u.disconnect()}}:function(e){var t=new MutationObserver(function(t){e.next(t)});return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},nQ=function(e){return void 0===e&&(e="click"),new nN.default(function(t){var r,n=function(e){t.next(e)};return null==(r=eS())||r.document.addEventListener(e,n,{capture:!0}),function(){var t;null==(t=eS())||t.document.removeEventListener(e,n,{capture:!0})}})},nH=function(e,t,r,n){var i="function"==typeof r?r:void 0,o="function"==typeof r?n:r;return new nN.default(function(r){var n=eS();if(!(null==n?void 0:n.IntersectionObserver))return function(){};var a=new IntersectionObserver(function(e){e.forEach(function(e){r.next(e)})},{root:null,rootMargin:"0px",threshold:1}),s=t.join(","),u=function(e){e instanceof Element&&e.matches(s)&&a.observe(e),e.querySelectorAll(s).forEach(function(e){a.observe(e)})},l=function(e){if(o)try{nx(e,s,nB(o)).forEach(function(e){a.observe(e)})}catch(e){}},c=function(){var e=null==n?void 0:n.document;if(e){var t=[];try{t=o&&nB(o).enabled?nx(e,s,nB(o)):e.querySelectorAll(s)}catch(e){return}Array.from(t).forEach(function(e){a.unobserve(e),a.observe(e)})}};null==i||i(c),c();var d=null==o?void 0:o.onArm(function(){(null==n?void 0:n.document)&&l(n.document)}),f=e.subscribe(function(e){return e.event.forEach(function(e){return e.addedNodes.forEach(function(e){if(e instanceof DocumentFragment)return void u(e);if(e instanceof Element){if(!o||!nB(o).enabled)return void u(e);try{e.matches(s)&&a.observe(e)}catch(e){}l(e)}})})});return function(){null==i||i(void 0),null==d||d(),f.unsubscribe(),a.disconnect()}})},nK=function(){var e=r3(new nN.default(function(e){var t=function(t){if(t instanceof ErrorEvent){var r={kind:"error"};t.error instanceof Error||t.error instanceof DOMException?r=(0,W.__assign)((0,W.__assign)({},r),{message:t.error.message,stack:t.error.stack,filename:t.filename,lineNumber:t.lineno,columnNumber:t.colno}):"string"==typeof t.error&&(r.message=t.error),e.next(r)}};return nz.addEventListener("error",t),function(){nz.removeEventListener("error",t)}}),new nN.default(function(e){var t=function(t){var r={kind:"unhandledrejection"};t.reason instanceof Error||t.reason instanceof DOMException?(r.message=t.reason.message,r.stack=t.reason.stack):"string"==typeof t.reason&&(r.message=t.reason),e.next(r)};return nz.addEventListener("unhandledrejection",t),function(){nz.removeEventListener("unhandledrejection",t)}}));return r3(e,new nN.default(function(e){var t=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=void 0;Array.isArray(r[0])&&"string"==typeof r[0][0]&&(i=r[0][0]),e.next({kind:"console",message:i})};return nU("error",t),function(){nV(t)}}
2))},nG=function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(e){console.error("Error matching event to filter",e)}return!1},nJ=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var r=document.documentElement;if(e.scope&&t&&(r=t.closest(e.scope)),r&&e.selector)return r.querySelector(e.selector);return r}}catch(e){}},nY=function(e,t,r){e.forEach(function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var n=r.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=n}})},nX={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},nZ=function(e){var t,r,n,i,o=Object.values(nX).reduce(function(e,t){return e[t]=new Set,e},{});if(!e)return o;try{for(var a=(0,W.__values)(e),s=a.next();!s.done;s=a.next()){var u=s.value;try{try{for(var l=(n=void 0,(0,W.__values)(u.definition)),c=l.next();!c.done;c=l.next()){var d=nX[c.value.event_type];d&&o[d].add(u.id)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==u?void 0:u.id,e)}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return o},n0=function(e){var t,r,n,i,o=new Map;try{for(var a=(0,W.__values)(e),s=a.next();!s.done;s=a.next()){var u=s.value;try{for(var l=(n=void 0,(0,W.__values)(u.conditions)),c=l.next();!c.done;c=l.next()){var d=c.value;if("LABELED_EVENT"===d.type){var f=d.match.eventId,h=o.get(f);h||(h=[],o.set(f,h)),h.push(u)}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return o},n1=function(e,t){var r,n,i,o,a=new Set;try{for(var s=(0,W.__values)(e),u=s.next();!u.done;u=s.next()){var l=u.value,c=t.get(l.id);if(c)try{for(var d=(i=void 0,(0,W.__values)(c)),f=d.next();!f.done;f=d.next()){var h=f.value;a.add(h)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return Array.from(a)},n2=function(){function e(e,t,r,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=r,this.options=n}return e.prototype.evaluate=function(e){var t,r,n=this.options.pageActions;if(!n)return e;var i=n1(Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return n.labeledEvents[e]}).filter(function(t){return t.definition.some(function(t){return nX[t.event_type]===e.type&&t.filters.every(function(t){return nG(e,t)})})}),this.labeledEventToTriggerMap);try{for(var o=(0,W.__values)(i),a=o.next();!a.done;a=o.next()){var s=a.value;nY(s.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=r},e}(),n3=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",nn,rE,ni]),n4=["type"],n8=["svg","path","g"],n6=["password","hidden"];function n5(e,t){return(void 0===t&&(t=nh),e)?t.enabled?function(e,t){var r,n,i=[];try{for(var o=(0,W.__values)(nl(e,t)),a=o.next();!a.done;a=o.next()){var s=a.value;if("HTML"===s.tagName)break;i.push(s)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}(e,t.maxDepth):function(e){var t=[];t.push(e);for(var r=e.parentElement;r&&"HTML"!==r.tagName;)t.push(r),r=r.parentElement;return t}(e):[]}var n9=Object.freeze({enabled:!1,explicitTrackingAttribute:"data-amp-track-id",autogeneratedIdPatterns:(0,W.__spreadArray)([],(0,W.__read)([/^:r[0-9a-z]+:$/,/^radix-/,/^headlessui-/,/^mui-/,/^[a-f0-9]{16,}$/i,/-\d{8,}$/,/\d{4,}/]),!1),unstableClassPatterns:(0,W.__spreadArray)([],(0,W.__read)([/^(p|m|px|py|mx|my|pt|pb|pl|pr|mt|mb|ml|mr)-\d+$/,/^(w|h|min-w|max-w|min-h|max-h)-/,/^(text|bg|border|ring|fill|stroke)-/,/^(hover|focus|active|disabled|group-hover):/,/^(sm|md|lg|xl|2xl):/,/^z-\d+$/,/^data-\[/,/^\[/,/^css-[a-z0-9]{6,}$/,/^[a-zA-Z]+_[a-zA-Z0-9]{3,}__[a-zA-Z0-9]{5,}$/,/^sc-[a-zA-Z0-9]{6,}$/,/^jsx-\d+$/,/^swiper-slide-(visible|fully-visible|active|prev|next|duplicate)$/,/^is-(active|open|selected|hovered|focused|expanded)$/,/^Mui[A-Z][a-zA-Z]+-(focused|selected|disabled|expanded|focusVisible|active|checked)$/,/^Mui-(selected|focused|disabled|expanded|focusVisible|active|checked)$/,/^data-state-/]),!1),maxAncestorWalkDepth:void 0,shadowDomEnabled:!1,maxShadowDomDepth:1});function n7(e){var t;return(0,W.__assign)((0,W.__assign)({},e),{shadowDomEnabled:null!=(t=e.shadowDomEnabled)&&t,maxShadowDomDepth:it(e.maxShadowDomDepth)})}function ie(e,t){if(!e)return ir();var r=ir();return"boolean"==typeof e.enabled&&(r.enabled=e.enabled),"string"==typeof e.explicitTrackingAttribute&&""!==e.explicitTrackingAttribute&&(r.explicitTrackingAttribute=e.explicitTrackingAttribute),Array.isArray(e.autogeneratedIdPatterns)&&(r.autogeneratedIdPatterns=function(e,t){var r,n,i=[];try{for(var o=(0,W.__values)(e),a=o.next();!a.done;a=o.next()){var s=a.value;try{i.push(new RegExp(s))}catch(e){var u=e instanceof Error?e.message:String(e);null==t||t.warn('@amplitude/element-selector: ignoring invalid autogenerated-id pattern "'.concat(s,'" (').concat(u,")"))}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}(e.autogeneratedIdPatterns,t)),Array.isArray(e.unstableClassPatterns)&&(r.unstableClassPatterns=function(e,t){var r,n,i=[];try{for(var o=(0,W.__values)(e),a=o.next();!a.done;a=o.next()){var s=a.value;try{i.push(new RegExp(s))}catch(e){var u=e instanceof Error?e.message:String(e);null==t||t.warn('@amplitude/element-selector: ignoring invalid unstable-class pattern "'.concat(s,'" (').concat(u,")"))}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}(e.unstableClassPatterns,t)),r.maxAncestorWalkDepth=function(e){if("number"==typeof e&&Number.isFinite(e)&&!(e<=0))return Math.floor(e)}(e.maxAncestorWalkDepth),"boolean"==typeof e.shadowDomEnabled&&(r.shadowDomEnabled=e.shadowDomEnabled),r.maxShadowDomDepth=it(e.maxShadowDomDepth),n7(r)}function it(e){return"number"==typeof e&&Number.isFinite(e)?Math.min(Math.max(Math.floor(e),1),10):1}
2function ir(){return{enabled:n9.enabled,explicitTrackingAttribute:n9.explicitTrackingAttribute,autogeneratedIdPatterns:(0,W.__spreadArray)([],(0,W.__read)(n9.autogeneratedIdPatterns),!1),unstableClassPatterns:(0,W.__spreadArray)([],(0,W.__read)(n9.unstableClassPatterns),!1),maxAncestorWalkDepth:n9.maxAncestorWalkDepth,shadowDomEnabled:n9.shadowDomEnabled,maxShadowDomDepth:n9.maxShadowDomDepth}}function ii(e,t){var r=e.getAttribute(t.explicitTrackingAttribute);if(null!==r&&""===r)return null;var n=e.getAttribute("id");return null===n||""===n||!function(e,t){var r,n;if(null==e||""===e)return!1;try{for(var i=(0,W.__values)(t),o=i.next();!o.done;o=i.next())if(o.value.test(e))return!1}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!0}(n,t.autogeneratedIdPatterns)?null:n}function io(e){var t=globalThis.CSS;if(t&&"function"==typeof t.escape)return t.escape(e);for(var r=String(e),n=r.length,i="",o=0;o<n;o++){var a=r.charCodeAt(o);if(0===a){i+="�";continue}if(a>=1&&a<=31||127===a||0===o&&a>=48&&a<=57||1===o&&a>=48&&a<=57&&45===r.charCodeAt(0)){i+="\\".concat(a.toString(16)," ");continue}if(0===o&&1===n&&45===a){i+="\\-";continue}if(a>=128||45===a||95===a||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122){i+=r.charAt(o);continue}i+="\\".concat(r.charAt(o))}return i}function ia(e){var t=e.tagName.toLowerCase(),r=e.parentElement;if(null===r)return t;var n=function(e,t){for(var r=0,n=0;n<t.children.length;n++){var i=t.children[n];if(i.tagName===e.tagName&&(r+=1,i===e))return r}return 1}(e,r);return"".concat(t,":nth-of-type(").concat(n,")")}var is=[{name:"explicitTrackingAttribute",try:function(e,t){var r=t.config.explicitTrackingAttribute,n=e.getAttribute(r);return null===n||""===n?null:"[".concat(r,"=").concat(JSON.stringify(n),"]")}},{name:"stableId",try:function(e,t){var r=ii(e,t.config);return null===r?null:"".concat(e.tagName.toLowerCase(),"#").concat(io(r))}}];function iu(e,t,r,n,i){var o;try{o=e.querySelectorAll(t)}catch(e){var a=e instanceof Error?e.message:String(e);return null==i||i.debug('@amplitude/element-selector: strategy "'.concat(n,'" emitted a malformed selector "').concat(t,'" (').concat(a,")")),!1}return 1===o.length&&o[0]===r}var il=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),ic=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var r=[],n=e;n;){var i=id(n,!!t,n===e);if(!i||(r.push(i),i.optimized))break;n=n.parentElement}return r.reverse(),r.join(" > ")},id=function(e,t,r){if(e.nodeType!==Node.ELEMENT_NODE)return null;var n,i,o=e.getAttribute("id");if(t){if(o)return new il(ip(o),!0);var a=e.tagName.toLowerCase();if("body"===a||"head"===a||"html"===a)return new il(a,!0)}var s=e.tagName.toLowerCase();if(o)return new il(s+ip(o),!0);var u=e.parentNode;if(!u||u.nodeType===Node.DOCUMENT_NODE)return new il(s,!0);for(var l=ih(e),c=!1,d=!1,f=-1,h=-1,p=u.children,v=0;p&&(-1===f||!d)&&v<p.length;++v){var g=p[v];if(g.nodeType===Node.ELEMENT_NODE){if(h+=1,g===e){f=h;continue}if(!d&&g.tagName.toLowerCase()===s){c=!0;var m=new Set(l);if(!m.size){d=!0;continue}for(var y=ih(g),b=0;b<y.length;++b){var _=y[b];if(m.has(_)&&(m.delete(_),!m.size)){d=!0;break}}}}}var w=s;if(r&&"input"===s.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(w+="[type="+io(e.getAttribute("type")||"")+"]"),d)w+=":nth-child("+String(f+1)+")";else if(c)try{for(var S=(0,W.__values)(l),k=S.next();!k.done;k=S.next()){var E=k.value;w+="."+io(E.slice(1))}}catch(e){n={error:e}}finally{try{k&&!k.done&&(i=S.return)&&i.call(S)}finally{if(n)throw n.error}}return new il(w,!1)},ih=function(e){var t=e.getAttribute("class");return t?t.split(/\s+/g).filter(Boolean).map(function(e){return"$"+e}):[]},ip=function(e){return"#"+io(e)};function iv(e,t){try{return ic(e)}catch(e){var r=e instanceof Error?e.message:String(e);return null==t||t.warn("@amplitude/element-selector: legacyCssPath threw â emitting empty selector: ".concat(r)),""}}var ig=function(e,t){var r,n;return!!n5(e,t).some(function(e){return e.hasAttribute(rE)})||null!=(n=null==(r=document.documentElement)?void 0:r.hasAttribute(rE))&&n},im=function(e,t){var r,n,i,o,a,s,u,l,c,d,f,h=this;
2this.replaceSensitiveString=function(e){return rP(e,h.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,r,n,i,o=performance.now(),a=[];if(!e)return[];for(var s=h.getShadowMode(),u=n5(e,s),l=new Map,c=u.length-1;c>=0;c--){var d=u[c];if(d){var f,p=(f=d.getAttribute(nn))?f.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[],v=c===u.length-1?[]:null!=(n=l.get(u[c+1]))?n:new Set,g=new Set((0,W.__spreadArray)((0,W.__spreadArray)([],(0,W.__read)(v),!1),(0,W.__read)(p),!1));l.set(d,g)}}a=u.map(function(e){var t;return function(e,t,r){if(void 0===r&&(r=nh),null===e)return null;var n,i,o,a,s,u=String(e.tagName).toLowerCase(),l={tag:u},c=Array.from(function(e,t){if(e.parentElement)return e.parentElement.children;var r=e.getRootNode();return t&&nu(r)?r.children:[]}(e,r.enabled));c.length&&(l.index=c.indexOf(e),l.indexOfType=c.filter(function(t){return t.tagName===e.tagName}).indexOf(e));var d=null==(s=null==(a=e.previousElementSibling)?void 0:a.tagName)?void 0:s.toLowerCase();d&&(l.prevSib=String(d));var f=e.getAttribute("id");f&&(l.id=String(f));var h=Array.from(e.classList);h.length&&(l.classes=h);var p={},v=Array.from(e.attributes).filter(function(e){return!n3.has(e.name)}),g=!n_(e);if(!n6.includes(String(e.getAttribute("type")))&&!n8.includes(u))try{for(var m=(0,W.__values)(v),y=m.next();!y.done;y=m.next()){var b=y.value;if(!g||n4.includes(b.name)){if(t.has(b.name)){p[b.name]=rO;continue}p[b.name]=String(b.value).substring(0,128)}}}catch(e){n={error:e}}finally{try{y&&!y.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}return Object.keys(p).length&&(l.attrs=p),e.shadowRoot&&(l.attrs=(0,W.__assign)((0,W.__assign)({},l.attrs||{}),((o={})[ni]="true",o)),l.shadow=!0),l}(e,null!=(t=l.get(e))?t:new Set,s)});var m=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var r=(0,W.__read)(t,2),n=r[0],i=r[1];e.attrs&&(e.attrs[n]=h.replaceSensitiveString(i))})};try{for(var y=(0,W.__values)(a),b=y.next();!b.done;b=y.next()){var _=b.value;m(_)}}catch(e){t={error:e}}finally{try{b&&!b.done&&(r=y.return)&&r.call(y)}finally{if(t)throw t.error}}var w=performance.now();return null==(i=h.diagnosticsClient)||i.recordHistogram("autocapturePlugin.getHierarchy",w-o),a},this.getNearestLabel=function(e){var t,r=e.parentElement;if(!r)return"";try{t=r.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?h.getText(t):h.getNearestLabel(r)},this.getElementPath=function(e){if(!e)return"";var t,r=performance.now(),n=h.selectorEngine.generate(e),i=performance.now();return null==(t=h.diagnosticsClient)||t.recordHistogram("autocapturePlugin.getElementPath",i-r),n},this.updateSelectorConfig=function(e,t){if(null!=e){var r,n="boolean"==typeof e.enabled,i="boolean"==typeof e.shadowDomEnabled;if(!n&&!i){null==t||t.debug("@amplitude/element-selector: ignoring remote-config delivery without an explicit `enabled` or `shadowDomEnabled` flag â keeping current engine state.");return}var o=ie(e,t),a=h.selectorEngine.getConfig().enabled,s=h.shadowGate.get().enabled,u=h.shadowGate.arm(np(o));h.selectorEngine.updateConfig((0,W.__assign)((0,W.__assign)((0,W.__assign)({},n?o:h.selectorEngine.getConfig()),{shadowDomEnabled:u.enabled}),u.enabled&&{maxShadowDomDepth:u.maxDepth})),n&&a!==o.enabled&&(null==t||t.debug(o.enabled?"@amplitude/element-selector: engine enabled â now emitting new element-selector element paths for autocapture events.":"@amplitude/element-selector: engine disabled â reverting to legacy cssPath for element paths.")),!s&&u.enabled&&(null==(r=h.diagnosticsClient)||r.setTag("plugin.autocapture.shadowDom","enabled:".concat(u.maxDepth)))}}
2,this.getShadowMode=function(){return h.shadowGate.get()},this.getEventProperties=function(e,t,r){var n,i,o,a,s=null==(o=null==(i=null==t?void 0:t.tagName)?void 0:i.toLowerCase)?void 0:o.call(i),u="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},l=h.getHierarchy(t),c=null==(a=l[0])?void 0:a.attrs,d=h.getNearestLabel(t),f=Object.entries(null!=c?c:{}).reduce(function(e,t){var n=(0,W.__read)(t,2),i=n[0],o=n[1];if(i.startsWith(r)){var a=i.replace(r,"");a&&(e[a]=o||"")}return e},{}),p=((n={})["[Amplitude] Element Hierarchy"]=l,n[r5]=s,n[r9]=h.getText(t),n["[Amplitude] Element Position Left"]=null==u.left?null:Math.round(u.left),n["[Amplitude] Element Position Top"]=null==u.top?null:Math.round(u.top),n["[Amplitude] Element Attributes"]=f,n["[Amplitude] Element Path"]=h.getElementPath(t),n["[Amplitude] Element Parent Label"]=d,n[r7]=na(window.location.href.split("?")[0]),n["[Amplitude] Page Title"]=rA(h.replaceSensitiveString),n[ne]=window.innerHeight,n[nt]=window.innerWidth,n),v=nS();if(v&&(p[nr]=v),p["[Amplitude] Element ID"]=t.getAttribute("id")||"",p["[Amplitude] Element Class"]=t.getAttribute("class"),p["[Amplitude] Element Aria Label"]=null==c?void 0:c["aria-label"],"a"===s&&"click"===e&&t instanceof HTMLAnchorElement){var g=t.href.substring(0,128);p["[Amplitude] Element Href"]=h.replaceSensitiveString(g)}return nw(p)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,r,n,i){void 0===i&&(i=!1);var o=h.addTypeAndTimestamp(e,t);try{if(("click"===o.type||"change"===o.type)&&null!==o.event.target){var a=h.getShadowMode(),s=nP(o.event,a);if(i&&nm(s,o.type))return o.closestTrackedAncestor=s,o.targetElementProperties=h.getEventProperties(o.type,o.closestTrackedAncestor,n),o;var u=nk(s,r,a);u&&(o.closestTrackedAncestor=u,o.targetElementProperties=h.getEventProperties(o.type,u,n))}}catch(e){}return o},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var r=nJ(e,t);if(r){if("TEXT"===e.elementExtractType)return h.getText(r);if("ATTRIBUTE"===e.elementExtractType&&e.attribute)return r.getAttribute(e.attribute)}}},this.getTextWithMaskedDescendants=function(e){var t,r,n="[".concat(rE,"], [contenteditable]");if(!e.querySelector(n))return e.innerText;var i="",o=Array.from(e.childNodes);try{for(var a=(0,W.__values)(o),s=a.next();!s.done;s=a.next()){var u=s.value;if(u.nodeType===Node.TEXT_NODE){i+=u.textContent||"";continue}if(u instanceof Element){if(u.hasAttribute(rE)||u.hasAttribute("contenteditable")){i+=rO;continue}i+=h.getTextWithMaskedDescendants(u)}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return i},this.hasMaskedAncestor=function(e){var t=h.getShadowMode();return t.enabled?ig(e,t):null!==e.closest("[".concat(rE,"]"))},this.getText=function(e){if(h.hasMaskedAncestor(e))return rO;var t="";return t=e.querySelector("[".concat(rE,"], [contenteditable]"))?h.getTextWithMaskedDescendants(e):e.innerText||"",h.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){if(!e)return{};var t,r,n,i=null==(n=null==(r=null==e?void 0:e.tagName)?void 0:r.toLowerCase)?void 0:n.call(r);return nw(((t={})[r5]=i,t[r9]=h.getText(e),t[r7]=window.location.href.split("?")[0],t))},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient,this.selectorEngine=(O||(r=ie(),void 0===n&&(n={}),i=n7(r),o=new Set,a=n.logger,s=function(e){return iv(e,a)},u=function(e,t){var r;return null!=(r=function(e,t,r){void 0===r&&(r={});var n,i,o,a,s,u=n7(t),l=null!=(o=r.strategies)?o:is,c=null!=(s=null!=(a=r.scope)?a:e.ownerDocument)?s:document,d={scope:c,config:u},f=function(e,t){for(var r=[],n=e;null!==n&&(r.push(n),void 0===t||!(r.length>t));)n=n.parentElement;return r}(e,u.maxAncestorWalkDepth);try{for(var h=(0,W.__values)(l),p=h.next();!p.done;p=h.next())for(var v=p.value,g=0;g<f.length;g++){var m=f[g],y=v.try(m,d);if(null!==y){if(0===g){if(iu(c,y,e,v.name,r.logger))return y;continue}var b=f.slice(0,g).reverse().map(ia).join(" > "),_="".concat(y," > ").concat(b);if(iu(c,_,e,v.name,r.logger))return _}}}catch(e){n={error:e}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}return null}(e,i,{strategies:n.strategies,scope:t,logger:a}))?r:function(e,t,r){void 0===r&&(r={});for(var n,i,o=n7(t),a=null!=(i=null!=(n=r.scope)?n:e.ownerDocument)?i:document,s=nu(a),u=[],l=e,c=0,d=!(o.shadowDomEnabled&&s);null!==l&&(!d||void 0===o.maxAncestorWalkDepth||!(c>o.maxAncestorWalkDepth));){var f=ii(l,o);if(null!==f){var h="".concat(l.tagName.toLowerCase(),"#").concat(io(f)),p=(0,W.__spreadArray)([h],(0,W.__read)(u),!1).join(" > ");if(function(e,t,r){var n;try{n=e.querySelectorAll(t)}catch(e){return!1}return 1===n.length&&n[0]===r}(a,p,e))return p}u.unshift(function(e,t){var r=e.tagName.toLowerCase(),n=e.parentElement;if(null===n){var i=e.getRootNode();return t&&nu(i)?"".concat(r,":nth-of-type(").concat(nf(e,i.children),")"):r}return"".concat(r,":nth-of-type(").concat(nf(e,n.children),")")}(l,o.shadowDomEnabled)),l=l.parentElement,c+=1}var v=u.join(" > ");return o.shadowDomEnabled&&s&&null===l?"".concat(ns).concat(v):v}(e,i,{scope:t})},l=function(e,t){var r,n;return r=s(e),n=function(e){for(var t=e;null!==t;t=t.parentElement)if(t.getAttribute("id"))return!1;return!0}(e),r&&n&&nu(t)?"".concat(ns).concat(r):r},O={generate:function(e){try{if(!i.shadowDomEnabled)return(i.enabled?u:s)(e,null!=(r=null!=(t=n.scope)?t:e.ownerDocument)?r:document);return o=i.enabled?u:l,d=(c=nd(e,i.maxShadowDomDepth)).segments,c.truncated&&(null==a||a.debug("@amplitude/element-selector: target is nested deeper than maxShadowDomDepth (".concat(i.maxShadowDomDepth,") â emitting a best-effort selector for the outermost in-budget shadow host"))),d.map(function(e){return o(e.target,e.root)}).join(" >>> ")}catch(n){var t,r,o,c,d,f=n instanceof Error?n.message:String(n);return null==a||a.warn("@amplitude/element-selector: selector generation threw â falling back to legacy cssPath: ".concat(f)),iv(e,a)}},getConfig:function(){return i},updateConfig:function(e){var t,r;i=n7(e);try{for(var n=(0,W.__values)(o),s=n.next();!s.done;s=n.next()){var u=s.value;try{u(i)}catch(e){var l=e instanceof Error?e.message:String(e);null==a||a.warn("@amplitude/element-selector: onConfigChange subscriber threw â ".concat(l))}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},onConfigChange:function(e){return o.add(e),function(){o.delete(e)}}}),O),this.shadowGate=(k||(k=nv()),k);var p=null!=(f=e.maskTextRegex)?f:[],v=[];try{for(var g=(0,W.__values)(p),m=g.next();!m.done;m=g.next()){var y=m.value;if(v.length>=25)break;if(y instanceof RegExp)v.push(y);else if("pattern"in y&&"string"==typeof y.pattern)try{v.push(RegExp(y.pattern,"i"))}catch(e){}}}catch(e){c={error:e}}finally{try{m&&!m.done&&(d=g.return)&&d.call(g)}finally{if(c)throw c.error}}this.additionalMaskTextPatterns=v};function iy(e,t){var r=e.remoteConfigClient;if(e.fetchRemoteConfig&&r){var n=r.subscribe("configs.analyticsSDK.browserSDK.autocapture.elementSelector","all",function(r,n){e.loggerProvider.debug("@amplitude/element-selector: remote-config delivery (source=".concat(String(n),") ").concat(JSON.stringify(r))),t.updateSelectorConfig(r,e.loggerProvider)});return function(){r.unsubscribe(n)}}}var nN=r1;(l=x||(x={})).ClickObservable="clickObservable",l.PointerDownObservable="pointerDownObservable",l.ChangeObservable="changeObservable",l.NavigateObservable="navigateObservable",l.MutationObservable="mutationObservable",l.ScrollObservable="scrollObservable",l.ExposureObservable="exposureObservable",l.BrowserErrorObservable="browserErrorObservable",l.SelectionObservable="selectionObservable",l.MouseMoveObservable="mouseMoveObservable";var ib=function(e,t){void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",r8);var r,n,i,o,a,s,u,l,c,d,f,h,p,v,g=e.dataAttributePrefix,m=void 0===g?rH:g,y=e.visualTaggingOptions,b=void 0===y?{enabled:!0}:y;e.cssSelectorAllowlist=null!=(r=e.cssSelectorAllowlist)?r:rQ,e.actionClickAllowlist=null!=(n=e.actionClickAllowlist)?n:rK,e.debounceTime=null!=(i=e.debounceTime)?i:0;var _=(null==(o=e.viewportContentUpdated)?void 0:o.enabled)!==!1,w=null!=(u=null!=(s=null==(a=e.viewportContentUpdated)?void 0:a.exposureDuration)?s:e.exposureDuration)?u:150;e.viewportContentUpdated=(0,W.__assign)((0,W.__assign)({},e.viewportContentUpdated),{exposureDuration:w}),e.pageUrlExcludelist=null==(l=e.pageUrlExcludelist)?void 0:l.reduce(function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(e){console.warn("Invalid regex pattern: ".concat(t.pattern),e)}return e},[]);var S="@amplitude/plugin-autocapture-browser",k=[],E=new im(e,t),O=new Set,T=new Set,C=new Set,P=function(){var t,r,n=r4(nQ().map(function(t){return E.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,m)})),i=r4(new nN.default(function(t){var r,n=function(r){var n=E.addAdditionalEventProperties(r,"change",e.cssSelectorAllowlist,m);t.next(n)};
2return null==(r=eS())||r.document.addEventListener("change",n,{capture:!0}),function(){var e;return null==(e=eS())?void 0:e.document.removeEventListener("change",n)}}));window.navigation&&(r=r4(new nN.default(function(t){var r=function(r){var n=E.addAdditionalEventProperties(r,"navigate",e.cssSelectorAllowlist,m);t.next(n)};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}})));var o=E.shadowGate,a=r4(n$(o).map(function(t){return E.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,m)})),s=new nN.default(function(e){var t,r=function(t){e.next(t)};return null==(t=eS())||t.addEventListener("scroll",r),function(){var e;null==(e=eS())||e.removeEventListener("scroll",r)}}),u=nH(a,e.cssSelectorAllowlist,function(e){v=e},o);return(t={})[x.ChangeObservable]=i,t[x.ClickObservable]=n,t[x.MutationObservable]=a,t[x.NavigateObservable]=r,t[x.ScrollObservable]=s,t[x.ExposureObservable]=u,t},A=nZ(Object.values(null!=(d=null==(c=e.pageActions)?void 0:c.labeledEvents)?d:{})),I=n0(null!=(h=null==(f=e.pageActions)?void 0:f.triggers)?h:[]),R=new n2(A,I,E,e),D=function(t){var r,n;t&&(e.pageActions=(0,W.__assign)((0,W.__assign)({},e.pageActions),t),A=nZ(Object.values(null!=(r=e.pageActions.labeledEvents)?r:{})),I=n0(null!=(n=e.pageActions.triggers)?n:[]),R.update(A,I,e))};return{name:S,type:"enrichment",setup:function(t,r){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var n,i,o,a,s,u,l,c,d,f,h,g,y,A,I,N,M,j,L,F,q,U,V,z,B,$,Q;return(0,W.__generator)(this,function(H){if("u"<typeof document)return[2];if(n=!1,t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(e){D(e)}):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),(i=iy(t,E))&&k.push({unsubscribe:i}),o=nb(e,e.cssSelectorAllowlist),a=nb(e,e.actionClickAllowlist),G=(K={allObservables:s=P(),amplitude:r,shouldTrackEvent:o,evaluateTriggers:R.evaluate.bind(R)}).amplitude,J=K.allObservables,Y=K.shouldTrackEvent,X=K.evaluateTriggers,u=J.clickObservable.filter(nA).filter(function(e){return Y("click",e.closestTrackedAncestor)}).map(function(e){return X(e)}).subscribe(function(e){null==G||G.track(r6,e.targetElementProperties)}),k.push(u),ee=(Z={allObservables:s,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return E.getEventProperties.apply(E,(0,W.__spreadArray)((0,W.__spreadArray)([],(0,W.__read)(e),!1),[m],!1))},amplitude:r,shouldTrackEvent:o,evaluateTriggers:R.evaluate.bind(R)}).amplitude,et=Z.allObservables,er=Z.getEventProperties,en=Z.shouldTrackEvent,ei=Z.evaluateTriggers,l=et.changeObservable.filter(nA).filter(function(e){return en("change",e.closestTrackedAncestor)}).map(function(e){return ei(e)}).subscribe(function(e){null==ee||ee.track("[Amplitude] Element Changed",er("change",e.closestTrackedAncestor))}),k.push(l),ea=(eo={allObservables:s,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return E.getEventProperties.apply(E,(0,W.__spreadArray)((0,W.__spreadArray)([],(0,W.__read)(e),!1),[m],!1))},amplitude:r,shouldTrackEvent:o,shouldTrackActionClick:a}).amplitude,es=eo.allObservables,eu=eo.options,el=eo.getEventProperties,ec=eo.shouldTrackEvent,ed=eo.shouldTrackActionClick,ef=es.clickObservable,eh=es.mutationObservable,ep=es.navigateObservable,ev=ef.filter(function(e){return!ec("click",e.closestTrackedAncestor)}).map(function(e){var t=nk(e.event.target,eu.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=el(e.type,e.closestTrackedAncestor)),e}).filter(nA).filter(function(e){return ed("click",e.closestTrackedAncestor)}),eg=ep?r3(eh,ep):eh,em=r3(ev,eg),ey=null,eb=null,(c=r2(em,function(e){if(ey&&(clearTimeout(ey),ey=null),"click"===e.type)eb=e,ey=setTimeout(function(){ey=null,eb=null},500);else if(eb){var t=eb;return eb=null,Promise.resolve(t)}return Promise.resolve(null)}).subscribe(function(e){e&&(null==ea||ea.track(r6,el("click",e.closestTrackedAncestor)))}))&&k.push(c),(e_={allObservables:s,amplitude:r}).amplitude,ew=e_.allObservables.scrollObservable,ek={maxX:0,maxY:0},eE=ew.subscribe(function(){var e,t,r,n,i=eS(),o=Math.floor(null!=(t=null!=(e=null==i?void 0:i.scrollX)?e:null==i?void 0:i.pageXOffset)?t:0),a=Math.floor(null!=(n=null!=(r=null==i?void 0:i.scrollY)?r:null==i?void 0:i.pageYOffset)?
2n:0);ek.maxX=Math.max(ek.maxX,o),ek.maxY=Math.max(ek.maxY,a)}),d={unsubscribe:function(){eE.unsubscribe()},getState:function(){return ek},reset:function(){ek.maxX=0,ek.maxY=0}},k.push(d),f=(0,W.__assign)({},d.getState()),h={},g=eS(),A=function(e){e&&(null==y||y.reset()),e&&n||(e&&(n=!0,setTimeout(function(){n=!1},100)),function(e){var t,r,n,i=e.amplitude,o=e.scrollTracker,a=e.currentElementExposed,s=e.elementExposedForPage,u=e.elementExposedInSentEvents,l=e.exposureTracker,c=e.isPageEnd,d=e.lastScroll,f=o.getState(),h=eS(),p=null!=(r=null==h?void 0:h.innerWidth)?r:0,v=null!=(n=null==h?void 0:h.innerHeight)?n:0,g=Array.from(a).filter(function(e){return!u.has(e)}),m=((t={})[r7]=nR(h),t["[Amplitude] Max Page X"]=f.maxX+p,t["[Amplitude] Max Page Y"]=f.maxY+v,t[ne]=v,t[nt]=p,t["[Amplitude] Element Exposed"]=g,t),y=nS();y&&(m[nr]=y);var b=function(){o.reset();var e=o.getState();d.maxX=e.maxX,d.maxY=e.maxY,s.clear(),u.clear(),null==l||l.reset()};if(0===g.length&&f.maxX===d.maxX&&f.maxY===d.maxY){c&&b();return}null==i||i.track("[Amplitude] Viewport Content Updated",m),d.maxX=f.maxX,d.maxY=f.maxY,g.forEach(function(e){u.add(e)}),a.clear(),c&&b()}({amplitude:r,scrollTracker:d,currentElementExposed:C,elementExposedForPage:O,elementExposedInSentEvents:T,exposureTracker:h.exposure,isPageEnd:e,lastScroll:f}))},I=nR(g),N=function(){var e=nR(g);e!==I&&(I=e,A(!0))},M=function(e,t){var r=nR(g),n=function(e,t){if(void 0===t&&(t=eS()),null==e||""===e)return nR(t);var r,n=(null==(r=null==t?void 0:t.location)?void 0:r.href)||"http://localhost/";try{return nI(new URL(e,n).href)}catch(e){return nR(t)}}(t,g);r===n||(I=n,A(!0)),e()},j=function(e){!(O.has(e)||T.has(e))&&(O.add(e),C.add(e),JSON.stringify(Array.from(C)).length>=18e3&&A(!1))},_&&(ex=(eO={allObservables:s,onExposure:j,dataExtractor:E,exposureDuration:w}).allObservables,eT=eO.onExposure,eC=eO.dataExtractor,eA=void 0===(eP=eO.exposureDuration)?150:eP,eI=new Map,eR=new Map,eD=ex.exposureObservable.subscribe(function(e){var t=e.target;if(e.isIntersecting){if(!eI.get(t)){var r=eR.get(t);r&&clearTimeout(r);var n=setTimeout(function(){eI.set(t,!0),eT(eC.getElementPath(t)),eR.set(t,null)},eA);eR.set(t,n)}}else if(!e.isIntersecting&&e.intersectionRatio<1){var n=eR.get(t);n&&(clearTimeout(n),eR.set(t,null))}}),h.exposure={unsubscribe:function(){eD.unsubscribe()},reset:function(){eR.forEach(function(e){e&&clearTimeout(e)}),eR.clear(),eI.clear()}},h.exposure&&k.push(h.exposure),eU=(eN={mutationObservable:s[x.MutationObservable],onRescan:function(){var e,r;null==(r=null==(e=t.loggerProvider)?void 0:e.debug)||r.call(e,"@amplitude/plugin-autocapture-browser: initial exposure snapshot â rescanning DOM"),null==v||v()},onFlush:function(){var e,r;null==(r=null==(e=t.loggerProvider)?void 0:e.debug)||r.call(e,"@amplitude/plugin-autocapture-browser: initial exposure snapshot â flushing viewport content updated"),A(!1)},exposureDuration:w}).mutationObservable,eV=eN.onRescan,ez=eN.onFlush,eB=eN.exposureDuration,e$=void 0===(eW=eN.quietMs)?150:eW,eH=void 0===(eQ=eN.maxWaitMs)?4e3:eQ,eK=!1,eG=function(){eM&&(clearTimeout(eM),eM=void 0),ej&&(clearTimeout(ej),ej=void 0),eL&&(clearTimeout(eL),eL=void 0)},eJ=function(){eq&&(document.removeEventListener("DOMContentLoaded",eq),eq=void 0)},eY=function(){if(!eK){if(!("u">typeof document&&"loading"!==document.readyState)){eq||(eq=function(){eq=void 0,eX()},document.addEventListener("DOMContentLoaded",eq));return}eK=!0,eG(),eJ(),eV(),eL=setTimeout(function(){eL=void 0,ez()},eB+50)}},eX=function(){eK||(eM&&clearTimeout(eM),eM=setTimeout(eY,e$))},eZ=function(){eG(),eJ(),eK=!1,eX(),ej=setTimeout(eY,eH)},(y={start:function(){eF||(eF=eU.subscribe(function(){eX()}),eZ())},reset:function(){eZ()},stop:function(){null==eF||eF.unsubscribe(),eF=void 0,eG(),eJ()}}).start(),k.push({unsubscribe:function(){null==y||y.stop()}}),L=function(){A(!0)},null==g||g.addEventListener("beforeunload",L),p=function(){null==g||g.removeEventListener("beforeunload",L)},k.push({unsubscribe:function(){return p()}}),(F=s[x.NavigateObservable])?k.push(F.subscribe(function(e){var t,r,n=null==(r=null==(t=e.event)?void 0:t.destination)?void 0:r.url;if(n){var i=nI(n);if(i===I)return;I=i,A(!0);return}N()})):g&&(q=function(){N()},g.addEventListener("popstate",q),U=g.history.pushState,V=g.history.replaceState,g.history&&U&&(g.history.pushState=new Proxy(U,{apply:function(e,t,r){M(function(){e.apply(t,r)},r[2])}})),g.history&&V&&(g.history.replaceState=new Proxy(V,{apply:function(e,t,r){M(function(){e.apply(t,r)},r[2])}})),k.push({unsubscribe:function(){g.removeEventListener("popstate",q),g.history&&U&&(g.history.pushState=U),g.history&&V&&(g.history.replaceState=V)}}))),null==(Q=null==t?void 0:t.loggerProvider)||Q.log("".concat(S," has been successfully added.")),window.opener&&b.enabled){var K,G,J,Y,X,Z,ee,et,er,en,ei,eo,ea,es,eu,el,ec,ed,ef,eh,ep,ev,eg,em,ey,eb,e_,ew,ek,eE,eO,ex,eT,eC,eP,eA,eI,eR,eD,eN,eM,ej,eL,eF,eq,eU,eV,ez,eB,eW,e$,eQ,eH,eK,eG,eJ,eY,eX,eZ;if(z=e.cssSelectorAllowlist,B=e.actionClickAllowlist,function(e,t){if(!0!==e[nD]){e[nD]=!0;var r=t.dataExtractor,n=t.isElementSelectable,i=t.cssSelectorAllowlist,o=t.actionClickAllowlist,a=null,s=function(t){e.notify({action:"element-selected",data:t})},u=function(t,r){"selector-mode-changed"===t?e.notify({action:"track-selector-mode-changed",data:r}):"selector-moved"===t&&e.notify({action:"track-selector-moved",data:r})};e.registerActionHandler("initialize-visual-tagging-selector",function(t){e.loadScriptOnce("https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz").then(function(){var l;a=null==(l=null==window?void 0:window.amplitudeVisualTaggingSelector)?void 0:l.call(window,{getEventTagProps:r.getEventTagProps,isElementSelectable:function(e){return!n||n((null==t?void 0:t.actionType)||"click",e)},onTrack:u,onSelect:s,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:i,actionClickAllowlist:o,extractDataFromDataSource:r.extractDataFromDataSource,dataExtractor:r,diagnostics:{autocapture:{version:r8}}}),e.notify({action:"selector-loaded"})}).catch(function(){var t;null==(t=e.logger)||t.warn("Failed to initialize visual tagging selector")})}),e.registerActionHandler("close-visual-tagging-selector",function(){var e;null==(e=null==a?void 0:a.close)||e.call(a)})}}($=function(){var e=eS(),t=null==e?void 0:e[rX];if("object"==typeof t&&null!==t&&rY in t&&!0===t[rY])return t;var r=new rZ(void 0);return e&&(e[rX]=r),r}(),{dataExtractor:E,isElementSelectable:nb(e,(0,W.__spreadArray)((0,W.__spreadArray)([],(0,W.__read)(z),!1),(0,W.__read)(B),!1)),cssSelectorAllowlist:z,actionClickAllowlist:B}),!0!==$[r0]){$[r0]=!0;var e0="https://cdn.amplitude.com/libs/background-capture-1.0.3.js.gz",e1=null,e2=function(e,t){var r,n;"background-capture-complete"===e&&(null==(n=null==(r=$.logger)?void 0:r.debug)||n.call(r,"Backgroun
2d capture complete"),$.notify({action:"background-capture-complete",data:t}))};$.registerActionHandler("initialize-background-capture",function(){null==(t=null==(e=$.logger)?void 0:e.debug)||t.call(e,"Initializing background capture (external script)");var e,t,r=new URL(e0,$.endpoint).toString();$.loadScriptOnce(r).then(function(){var e,t,r;null==(t=null==(e=$.logger)?void 0:e.debug)||t.call(e,"Background capture script loaded (external)"),e1=null==(r=null==window?void 0:window.amplitudeBackgroundCapture)?void 0:r.call(window,{messenger:$,onBackgroundCapture:e2}),$.notify({action:"background-capture-loaded"})}).catch(function(){var e;null==(e=$.logger)||e.warn("Failed to initialize background capture")})}),$.registerActionHandler("close-background-capture",function(){var e;null==(e=null==e1?void 0:e1.close)||e.call(e1),e1=null})}$.setup((0,W.__assign)({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:rJ[t.serverZone]}))}return[2]})})},execute:function(e){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n;return(0,W.__generator)(this,function(i){try{for(t=(e=(0,W.__values)(k)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(n=e.return)&&n.call(e)}finally{if(r)throw r.error}}return[2]})})}}},nN=r1,i_=(0,W.__spreadArray)(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],(0,W.__read)(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),iw=["*"],iS=["mutation","navigate"];function ik(e,t){var r,n,i,o,a=t.event,s=a.pageX,u=a.pageY;e.yMin=Math.min(null!=(r=e.yMin)?r:u,u),e.yMax=Math.max(null!=(n=e.yMax)?n:u,u),e.xMin=Math.min(null!=(i=e.xMin)?i:s,s),e.xMax=Math.max(null!=(o=e.xMax)?o:s,s),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function iE(e){if(0===e.length)return null;var t=e[0],r=e[e.length-1];return{rageClickEvent:(0,W.__assign)({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(r.timestamp).toISOString(),"[Amplitude] Duration":r.timestamp-t.timestamp,"[Amplitude] Clicks":e.map(function(e){return{X:e.event.pageX,Y:e.event.pageY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}var nN=r1;(c=T||(T={})).INCREASING="increasing",c.DECREASING="decreasing",(d=C||(C={})).X="x",d.Y="y";var iO=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new nN.default(function(e){var r=null,n=null,i=null;return t.subscribe(function(t){var o={x:t.clientX,y:t.clientY};if(null===r){r=o;return}o.x>r.x?(n===T.DECREASING&&e.next(C.X),n=T.INCREASING):o.x<r.x&&(n===T.INCREASING&&e.next(C.X),n=T.DECREASING),o.y>r.y?(i===T.DECREASING&&e.next(C.Y),i=T.INCREASING):o.y<r.y&&(i===T.INCREASING&&e.next(C.Y),i=T.DECREASING),r=o})})};function ix(e){var t=e.changes,r=e.changesThreshold,n=e.thresholdMs;return!(t.length<r)&&t[t.length-1]-t[0]<n}function iT(e){e.changes=[],e.startTime=void 0}function iC(e){for(var t=e.changes,r=e.thresholdMs,n=0,i=t[t.length-1];n<t.length&&!(i-t[n]<r);n++);0!==n&&(e.startTime=t[n],e.changes.splice(0,n))}var iP=function(e){var t=e.mouseDirectionChangeObservable,r=e.directionChanges,n=void 0===r?20:r,i=e.thresholdMs,o=void 0===i?2e3:i;return new nN.default(function(e){var r={changes:[],changesThreshold:n,thresholdMs:o},i={changes:[],changesThreshold:n,thresholdMs:o},a=void 0,s=null;function u(){void 0!==a&&(e.next(a),a=void 0,null!==s&&clearTimeout(s),iT(r),iT(i))}return t.subscribe(function(e){null!==s&&clearTimeout(s),t=e===C.X?r:i,n=+Date.now(),t.startTime=t.startTime||n,l=t.changes,c=t.changesThreshold,l.push(n),l.length>c&&l.shift();var t,n,l,c,d=function(e,t){var r=void 0;if(ix(e)&&(r=e.startTime),ix(t)){var n=t.startTime;n&&(!r||n<r)&&(r=n)}return r}(r,i);return d?(a=a||d,s=setTimeout(function(){u(),s=null},o)):u(),iC(r),iC(i),function(){null!==s&&(clearTimeout(s),s=null)}})})},iA=function(e){var t=e.amplitude,r=e.options,n=e.allObservables,i=e.directionChanges,o=e.thresholdMs;return iP({mouseDirectionChangeObservable:iO({allWindowObservables:n}),directionChanges:void 0===i?20:i,thresholdMs:void 0===o?2e3:o}).subscribe(function(e){ny(r)&&t.track("[Amplitude] Thrashed Cursor",void 0,{time:e})})};function iI(e,t,r,n){if(!n)return[];var i=e[t];return"object"==typeof i&&null!==i&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:r}var iR=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-frustration-browser",n=[],i=!1!==e.errorClicks;e.errorClicks||(i=!1);var o=!1!==e.deadClicks&&null!==e.deadClicks,a=!1!==e.rageClicks&&null!==e.rageClicks,s=!1!==e.thrashedCursor&&null!==e.thrashedCursor;e.thrashedCursor||(s=!1);var u=iI(e,"rageClicks",iw,a),l=iI(e,"deadClicks",i_,o),c=iI(e,"errorClicks",i_,i),d=null!=(t=e.dataAttributePrefix)?t:rH,f=new im(e),h=(0,W.__spreadArray)([],(0,W.__read)(new Set((0,W.__spreadArray)((0,W.__spreadArray)((0,W.__spreadArray)([],(0,W.__read)(u),!1),(0,W.__read)(l),!1),(0,W.__read)(c),!1))),!1),p=function(){var e,t,r=function(e){return r4(nQ(e).map(function(e){return f.addAdditionalEventProperties(e,"click",h,d,!0)}))},n=r("click"),i=r("pointerdown"),o=r4(nK().map(function(e){return f.addTypeAndTimestamp(e,"error")})),a=r4(n$(f.shadowGate).map(function(e){return f.addAdditionalEventProperties(e,"mutation",h,d)}));window.navigation&&(t=r4(new nN.default(function(e){var t=function(t){e.next((0,W.__assign)((0,W.__assign)({},t),{type:"navigate"}))};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}}).map(function(e){return f.addAdditionalEventProperties(e,"navigate",h,d)})));var s=r4(new nN.default(function(e){var t=function(){var t=document.activeElement;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)){var r=void 0,n=void 0;try{if(r=t.selectionStart,n=t.selectionEnd,r===n)return}catch(e){return}return e.next()}var i=window.getSelection();if(i&&!i.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}})),u=r4(new nN.default(function(e){var t=function(t){e.next(t)},r={capture:!0};return nz.document.addEventListener("mousemove",t,r),function(){nz.document.removeEventListener("mousemove",t,r)}}));return(e={})[x.ClickObservable]=n,e[x.PointerDownObservable]=i,e[x.MutationObservable]=a,e[x.NavigateObservable]=t,e[x.BrowserErrorObservable]=o,e[x.SelectionObservable]=s,e[x.MouseMoveObservable]=u,e};return{name:r,type:"enrichment",setup:function(t,h){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var v,g,m,y,b,_,w,S,k;return(0,W.__generator)(this,function(O){var x,T,C,P,A,I,R,D,N,M,j,L,F,q,U,V,z,B,$,Q,H,K;return"u"<typeof document?[2]:(v=p(),(g=iy(t,f))&&n.push({unsubscribe:g}),a&&(m=function(e){var t=this,r=e.amplitude,n=e.allObservables,i=e.shouldTrackRageClick,o=n.pointerDownObservable,a=n.selectionObservable,s=[],u={},l=null;function c(e){s=[],u={},e&&(ik(u,e),s.push(e))}var d=r2(o.filter(function(e){return i("click",e.closestTrackedAncestor)}),function(e){return(0,W.__awaiter)(t,void 0,void 0,function(){var t;return(0,W.__generator)(this,function(r){var n,i,o,a;return(ik(u,e),t=null,0===s.length||(n=s).length>0&&n[n.length-1].closestTrackedAncestor!==e.closestTrackedAncestor||(o=Math.max(0,(i=s).length-4+1),a=i[o],e.timestamp-a.timestamp>=1e3)||u.isOutOfBounds)?(l&&(t=iE(s)),c(e)):s.push(e),(l&&(clearTimeout(l.timerId),l.resolve(t),l=null),s.length>=4)?[2,new Promise(function(e){l={resolve:e,timerId:setTimeout(function(){e(iE(s))},1e3)}})]:[2,null]})})}),f=null==a?void 0:a.subscribe(function(){c()}),h=d.subscribe(function(e){null!==e&&r.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})});return{unsubscribe:function(){h.unsubscribe(),null==f||f.unsubscribe()}}}({allObservables:v,amplitude:h,shouldTrackRageClick:nb(e,u)}),n.push(m)),o&&(T=(x={amplitude:h,allObservables:v,getEventProperties:function(e,t){return f.getEventProperties(e,t,d)},shouldTrackDeadClick:nb(e,l)}).amplitude,C=x.allObservables,P=x.getEventProperties,A=x.shouldTrackDeadClick,I=C.clickObservable,R=C.mutationObservable,D=C.navigateObservable,N=I.filter(function(e){return nA(e)&&A("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===E.LEFT_OR_TOUCH_CONTACT}),M=D?r3(R,D):R,j=r3(N,M),L=null,y=r2(j,function(e){if(L&&iS.includes(e.type))clearTimeout(L),L=null;else if("click"===e.type)return L?Promise.resolve(null):new Promise(function(t){L=setTimeout(function(){t(e),L=null},3e3)});return Promise.resolve(null)}).subscribe(function(e){if(e){var t={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};T.track("[Amplitude] Dead Click",(0,W.__assign)((0,W.__assign)({},P("click",e.closestTrackedAncestor)),t),{time:e.timestamp})}}),n.push(y)),i&&(q=(F={amplitude:h,allObservables:v,shouldTrackErrorClick:nb(e,c)}).amplitude,U=F.allObservables,V=F.shouldTrackErrorClick,z=U.pointerDownObservable,B=U.browserErrorObservable,$=z.filter(function(e){return nA(e)&&V("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===E.LEFT_OR_TOUCH_CONTACT}),Q=null,H=null,K=function(){null!==Q&&(clearTimeout(Q),Q=null),H=null},b=r3($,B).subscribe(function(e){var t;if("click"===e.type){K(),H=e,Q=setTimeout(K,2e3);return}"error"===e.type&&H&&(q.track("[Amplitude] Error Click",(0,W.__assign)(((t={})["[Amplitude] Kind"]=e.event.kind,t["[Amplitude] Message"]=e.event.message,t["[Amplitude] Stack"]=e.event.stack,t["[Amplitude] Filename"]=e.event.filename,t["[Amplitude] Line Number"]=e.event.lineNumber,t["[Amplitude] Column Number"]=e.event.columnNumber,t),H.targetElementProperties)),K())}),n.push(b)),s&&(_=void 0,w=void 0,"object"==typeof e.thrashedCursor&&(_=e.thrashedCursor.directionChanges,w=e.thrashedCursor.threshold,_&&_<5&&(t.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(_," is below the minimum of ").concat(5,", setting to ").concat(5)),_=5),w&&w>4e3&&(t.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(w," is above the maximum of ").concat(4e3,", setting to ").concat(4e3)),w=4e3)),S=iA({amplitude:h,options:e,allObservables:v,directionChanges:_,thresholdMs:w}),n.push(S)),null==(k=null==t?void 0:t.loggerProvider)||k.log("".concat(r," has been successfully added.")),[2])})})},execute:function(e){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,i;return(0,W.__generator)(this,function(o){try{for(t=(e=(0,W.__values)(n)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(r)throw r.error}}return[2]})})}}};function iD(e,t){var r=e.startTime+e.duration;return t.filter(function(t){return t.startTime<r&&t.startTime+t.duration>e.startTime}).map(function(e){return e.name})}var iN=function(e){void 0===e&&(e={});var t="@amplitude/plugin-performance-browser",r=[],n=!0===e.mainThreadBlock||"object"==typeof e.mainThreadBlock&&null!==e.mainThreadBlock;return{name:t,type:"enrichment",setup:function(i,o){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var a,s,u;return(0,W.__generator)(this,function(l){return"u"<typeof document||(n&&(a=100,"object"==typeof e.mainThreadBlock&&void 0!==e.mainThreadBlock.durationThreshold&&(a=e.mainThreadBlock.durationThreshold),s=function(e){var t=e.amplitude,r=e.options,n=e.durationThreshold,i=void 0===n?100:n,o=function(){if("u"<typeof PerformanceObserver)return null;try{var e=PerformanceObserver.supportedEntryTypes;if(e.includes("long-animation-frame"))return"long-animation-frame";if(e.includes("longtask"))return"longtask"}catch(e){}return null}();if(!o)return{unsubscribe:function(){}};var a=[],s=new PerformanceObserver(function(e){var t,r,n=performance.now();try{for(var i=(0,W.__values)(e.getEntries()),o=i.next();!o.done;o=i.next()){var s=o.value;a.push(s)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}for(var u=n-1e4;a.length>0&&a[0].startTime<u;)a.shift()});try{s.observe({entryTypes:["measure"]})}catch(e){}var u=new PerformanceObserver(function(e){var n,s;try{for(var u=(0,W.__values)(e.getEntries()),l=u.next();!l.done;l=u.next()){var c=l.value;if(!ny(r))return;if(!(c.duration<i)){var d="long-animation-frame"===o?function(e,t){var r,n=iD(e,t),i=null!=(r=e.scripts)?r:[],o=i.map(function(e){return e.sourceURL}
2).filter(Boolean),a=i.map(function(e){return e.sourceFunctionName}).filter(Boolean),s=i.map(function(e){return e.sourceCharPosition}).filter(function(e){return"number"==typeof e&&e>=0}),u=i.map(function(e){return e.invokerType}).filter(Boolean),l=i.map(function(e){return e.invoker}).filter(Boolean);return(0,W.__assign)((0,W.__assign)((0,W.__assign)((0,W.__assign)((0,W.__assign)((0,W.__assign)((0,W.__assign)({"[Amplitude] Main Thread Block Source":"long-animation-frame","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.blockingDuration,"[Amplitude] Main Thread Block Start Time":e.startTime},n.length>0&&{"[Amplitude] Main Thread Block Measures":n}),{"[Amplitude] Main Thread Block Render Start":e.renderStart,"[Amplitude] Main Thread Block Style And Layout Start":e.styleAndLayoutStart,"[Amplitude] Main Thread Block Script Count":i.length}),o.length>0&&{"[Amplitude] Main Thread Block Script URLs":o}),a.length>0&&{"[Amplitude] Main Thread Block Script Functions":a}),s.length>0&&{"[Amplitude] Main Thread Block Script Positions":s}),u.length>0&&{"[Amplitude] Main Thread Block Invoker Types":u}),l.length>0&&{"[Amplitude] Main Thread Block Invokers":l})}(c,a):function(e,t){var r,n=iD(e,t),i=null!=(r=e.attribution)?r:[];return(0,W.__assign)((0,W.__assign)({"[Amplitude] Main Thread Block Source":"long-task","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.duration,"[Amplitude] Main Thread Block Start Time":e.startTime},n.length>0&&{"[Amplitude] Main Thread Block Measures":n}),i.length>0&&{"[Amplitude] Main Thread Block Attribution":i.map(function(e){return e.name})})}(c,a);t.track("[Amplitude] Main Thread Block",d)}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(n)throw n.error}}});try{u.observe({entryTypes:[o]})}catch(e){return s.disconnect(),{unsubscribe:function(){}}}return{unsubscribe:function(){u.disconnect(),s.disconnect()}}}({amplitude:o,options:e,durationThreshold:a}),r.push(s)),null==(u=null==i?void 0:i.loggerProvider)||u.log("".concat(t," performance tracking has been successfully added."))),[2]})})},execute:function(e){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,i;return(0,W.__generator)(this,function(o){try{for(t=(e=(0,W.__values)(r)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(n)throw n.error}}return[2]})})}}};function iM(e,t,r){e&&function e(t){var r,n,i=t.json,o=t.targetObject,a=t.allowlist,s=t.excludelist,u=t.ancestors,l=t.parentObject,c=t.targetKey;o||(o=i);var d=Object.keys(o);try{for(var f=(0,W.__values)(d),h=f.next();!h.done;h=f.next()){var p,v=h.value,g=(0,W.__spreadArray)((0,W.__spreadArray)([],(0,W.__read)(u),!1),[v],!1);(p=o[v],"string"==typeof p||"number"==typeof p||"boolean"==typeof p||null==p)?(!iL(g,a)||iL(g,s))&&delete o[v]:e({json:i,targetObject:o[v],allowlist:a,excludelist:s,ancestors:g,parentObject:o,targetKey:v})}}catch(e){r={error:e}}finally{try{h&&!h.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}0===Object.keys(o).length&&l&&c&&delete l[c]}({json:e,allowlist:t.map(ij),excludelist:r.map(ij),ancestors:[]})}function ij(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function iL(e,t){return t.some(function(t){return function e(t,r,n,i){if(void 0===n&&(n=0),void 0===i&&(i=0),i===r.length)return n===t.length;if(n===t.length){for(;i<r.length&&"**"===r[i];)i++;return i===r.length}var o=r[i];if("**"===o){if(i+1===r.length)return!0;for(var a=n;a<=t.length;a++)if(e(t,r,a,i+1))return!0;return!1}return("*"===o||o===t[n])&&e(t,r,n+1,i+1)}(e,t)})}var iF=function(){function e(e){this.request=e}return e.prototype.headers=function(e){void 0===e&&(e=[]);var t,r,n=this.request.headers,i={};if(Array.isArray(n))n.forEach(function(e){var t=(0,W.__read)(e,2),r=t[0],n=t[1];i[r]=n});else if(n instanceof Headers)n.forEach(function(e,t){i[t]=e});else if("object"==typeof n&&null!==n)try{for(var o=(0,W.__values)(Object.entries(n)),a=o.next();!a.done;a=o.next()){var s=(0,W.__read)(a.value,2),u=s[0],l=s[1];i[u]=l}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i$(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=eS();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=iU(t,100),this._bodySize}}
2,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(r){return 0===e.length?[2,null]:[2,iB(this.body,e,t)]})})},e}(),iq=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),i$(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return iU(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(r){return 0===e.length?[2,null]:[2,iB(this.body,e,t)]})})},e}();function iU(e,t){var r,n,i,o,a=eS(),s=null==a?void 0:a.TextEncoder;if(s&&null!=e){if("string"==typeof e)o=e,i=new s().encode(o).length;else if("u">typeof Blob&&e instanceof Blob)i=(o=e).size;else if("u">typeof URLSearchParams&&e instanceof URLSearchParams)o=e,i=new s().encode(o.toString()).length;else if(ArrayBuffer.isView(e))i=(o=e).byteLength;else if(e instanceof ArrayBuffer)i=(o=e).byteLength;else if("u">typeof FormData&&e instanceof FormData){var u=0,l=0;try{for(var c=(0,W.__values)(e.entries()),d=c.next();!d.done;d=c.next()){var f=(0,W.__read)(d.value,2),h=f[0],p=f[1];if(u+=h.length,"string"==typeof p)u+=new s().encode(p).length;else{if(!("u">typeof Blob&&p instanceof Blob))return;u+=p.size}if(++l>=t)return}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}i=u}else if("u">typeof ReadableStream&&e instanceof ReadableStream){o=e;return}return i}}var iV=function(){function e(e){this.response=e}return e.prototype.headers=function(e){var t;if(void 0===e&&(e=[]),this.response.headers instanceof Headers){var r=this.response.headers,n={};return null==(t=null==r?void 0:r.forEach)||t.call(r,function(e,t){n[t]=e}),i$(n,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){if(void 0!==this._bodySize)return this._bodySize;var e,t,r=null==(t=null==(e=this.response.headers)?void 0:e.get)?void 0:t.call(e,"content-length"),n=r?parseInt(r,10):void 0;return this._bodySize=n,n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(e){switch(e.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Promise.race([this.clonedResponse.text(),new Promise(function(e){return setTimeout(function(){return e(null)},500)})])];case 2:return[2,e.sent()];case 3:return e.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,W.__awaiter)(this,void 0,void 0,function(){return(0,W.__generator)(this,function(r){switch(r.label){case 0:if(0===e.length)return[2,null];return[4,this.text()];case 1:return[2,iB(r.sent(),e,t)]}})})},e}(),iz=function(){function e(e,t,r,n){this.statusCode=e,this.headersString=t,this.size=r,this.getJson=n}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(e){if(void 0===e&&(e=[]),!this.headersString)return{};var t,r,n={},i=this.headersString.split("\r\n");try{for(var o=(0,W.__values)(i),a=o.next();!a.done;a=o.next()){var s=a.value,u=(0,W.__read)(s.split(": "),2),l=u[0],c=u[1];l&&c&&(n[l]=c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i$(n,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,W.__awaiter)(this,void 0,void 0,function(){var r;return(0,W.__generator)(this,function(n){return 0===e.length?[2,null]:(r=this.getJson())?(iM(r,e,t),[2,r]):[2,null]})})},e}();function iB(e,t,r){if(!e)return null;try{var n=JSON.parse(e);return iM(n,t,r),n}catch(e){return null}}(f=P||(P={})).REDACT="redact",f.REMOVE="remove";var iW="[REDACTED]",i$=function(e,t){var r,n,i=t.allow,o=void 0===i?[]:i,a=t.strategy,s=void 0===a?P.REMOVE:a,u=(0,W.__spreadArray)([],(0,W.__read)(ev),!1),l={};try{for(var c=(0,W.__values)(Object.keys(e)),d=c.next();!d.done;d=c.next()){var f=d.value;!function(t){var r=t.toLowerCase();u.find(function(e){return e.toLowerCase()===r})?s===P.REDACT&&(l[t]=iW):o.find(function(e){return e.toLowerCase()===r})?l[t]=e[t]:s===P.REDACT&&(l[t]=iW)}(f)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}return l},iQ=function(){function e(e,t,r,n,i,o,a,s,u,l,c){void 0===a&&(a=0),this.type=e,this.method=t,this.timestamp=r,this.startTime=n,this.url=i,this.requestWrapper=o,this.status=a,this.duration=s,this.responseWrapper=u,this.error=l,this.endTime=c}return e.prototype.toSerializable=function(){var e,t,r,n;
2return Object.fromEntries(Object.entries({type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null==(e=this.requestWrapper)?void 0:e.headers((0,W.__spreadArray)([],(0,W.__read)(ep),!1)),requestBodySize:null==(t=this.requestWrapper)?void 0:t.bodySize,responseHeaders:null==(r=this.responseWrapper)?void 0:r.headers((0,W.__spreadArray)([],(0,W.__read)(ep),!1)),responseBodySize:null==(n=this.responseWrapper)?void 0:n.bodySize}).filter(function(e){var t=(0,W.__read)(e,2);return void 0!==(t[0],t[1])}))},e}(),iH=function(e,t){void 0===t&&(t=eE()),this.callback=e,this.id=t};function iK(e){try{e()}catch(e){}}var iG=new(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=eS();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var e=eS();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var r,n,i,o,a,s,u,l,c,d;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var f=null==(i=null==(n=null==(r=this.globalScope)?void 0:r.XMLHttpRequest)?void 0:n.prototype)?void 0:i.open,h=null==(s=null==(a=null==(o=this.globalScope)?void 0:o.XMLHttpRequest)?void 0:a.prototype)?void 0:s.send,p=null==(c=null==(l=null==(u=this.globalScope)?void 0:u.XMLHttpRequest)?void 0:l.prototype)?void 0:c.setRequestHeader;f&&h&&p&&this.observeXhr(f,h,p);var v=null==(d=this.globalScope)?void 0:d.fetch;v&&this.observeFetch(v),this.isObserving=!0}},e.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},e.prototype.triggerEventCallbacks=function(e){var t=this;this.eventCallbacks.forEach(function(r){try{r.callback(e)}catch(e){iK(function(){var r;null==(r=t.logger)||r.debug("an unexpected error occurred while triggering event callbacks",e)})}})},e.prototype.handleNetworkRequestEvent=function(e,t,r,n,i,o,a){if(void 0!==o&&void 0!==a){var s,u,l,c,d="GET";if("object"==typeof t&&null!==t&&"url"in t&&"method"in t?(u=t.url,d=t.method):u=null==(s=null==t?void 0:t.toString)?void 0:s.call(t),u)try{var f=new URL(u);u="".concat(f.protocol,"//").concat(f.host).concat(f.pathname).concat(f.search).concat(f.hash)}catch(e){}d=(null==r?void 0:r.method)||d,n&&(l=n.status),i&&(c={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},l=0);var h=Math.floor(performance.now()-a),p=Math.floor(o+h),v=new iQ(e,d,o,o,u,r,l,h,n,c,p);this.triggerEventCallbacks(v)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null==(e=Date.now)?void 0:e.call(Date),durationStart:null==(t=null==performance?void 0:performance.now)?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(r,n){return(0,W.__awaiter)(t,void 0,void 0,function(){var t,i,o,a=this;return(0,W.__generator)(this,function(s){switch(s.label){case 0:try{t=this.getTimestamps()}catch(e){iK(function(){var t;return null==(t=a.logger)?void 0:t.debug("an unexpected error occurred while retrieving timestamps",e)})}s.label=1;case 1:return s.trys.push([1,3,,4]),[4,e(r,n)];case 2:return i=s.sent(),[3,4];case 3:return o=s.sent(),[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",r,n?new iF(n):void 0,i?new iV(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){iK(function(){var t;return null==(t=a.logger)?void 0:t.debug("an unexpected error occurred while handling fetch",e)})}if(i)return[2,i];throw o}})})})},e.createXhrJsonParser=function(e,t){return function(){var r;try{if("json"===e.responseType){if(null==(r=t.globalScope)?void 0:r.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(r){r instanceof Error&&"InvalidStateError"===r.name&&iK(function(){var r;return null==(r=t.logger)?void 0:r.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))})}return null}},e.prototype.observeXhr=function(t,r,n){if(this.globalScope&&t&&r){var i=this.globalScope.XMLHttpRequest.prototype,o=this;i.open=function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=(0,W.__read)(r,2),a=i[0],s=i[1];try{this.$$AmplitudeAnalyticsEvent=(0,W.__assign)({method:a,url:null==(e=null==s?void 0:s.toString)?void 0:e.call(s),headers:{}},o.getTimestamps())}catch(e){iK(function(){var t;return null==(t=o.logger)?void 0:t.debug("an unexpected error occurred while calling xhr open",e)})}return t.apply(this,r)},i.send=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=this,a=e.createXhrJsonParser(this,o),s=t[0],u=i.$$AmplitudeAnalyticsEvent;return i.$$AmplitudeAnalyticsEvent&&i.addEventListener("loadend",function(){try{var e=i.getAllResponseHeaders(),t=i.getResponseHeader("content-length"),r=new iz(i.status,e,t?parseInt(t,10):void 0,a),n=i.$$AmplitudeAnalyticsEvent.headers,l=new iq(s,n);u.status=i.status,o.handleNetworkRequestEvent("xhr",{url:u.url,method:u.method},l,r,void 0,u.startTime,u.durationStart)}catch(e){iK(function(){var t;return null==(t=o.logger)?void 0:t.debug("an unexpected error occurred while handling xhr send",e)})}}),r.apply(i,t)},i.setRequestHeader=function(e,t){try{var r=this.$$AmplitudeAnalyticsEvent;r&&(r.headers[e]=t)}catch(e){iK(function(){var t;return null==(t=o.logger)?void 0:t.debug("an unexpected error occurred while calling xhr setRequestHeader",e)})}n.apply(this,[e,t])}}},e}()),iJ="[Amplitude] Network Request",nN=r1,iY="500-599";function iX(e,t){return RegExp("^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$").test(e)}function iZ(e,t){var r,n,i=t.split(",");try{for(var o=(0,W.__values)(i),a=o.next();!a.done;a=o.next()){var s=a.value,u=(0,W.__read)(s.split("-").map(Number),2),l=u[0],c=u[1];if(e===l&&void 0===c||e>=l&&e<=c)return!0}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}function i0(e){if(e)try{var t,r,n,i,o,a,s,u,l,c=null==(t=eS())?void 0:t.location.href,d=new URL(e,c),f=d.searchParams.toString(),h=d.hash.replace("#",""),p=d.href,v=d.host;d.hash="",d.search="";var g=d.href;return{query:f,fragment:h,href:p,hrefWithoutQueryOrHash:g,host:v}}catch(t){try{return i=(n=e.indexOf("#"))>=0?e.slice(n+1):"",s=(a=(o=n>=0?e.slice(0,n):e).indexOf("?"))>=0?o.slice(a+1):"",l=(u=a>=0?o.slice(0,a):o).match(/^[a-z][a-z0-9+.-]*:\/\/([^/?#]+)/i),{query:s,fragment:i,href:e,hrefW
2ithoutQueryOrHash:u,host:null!=(r=null==l?void 0:l[1])?r:""}}catch(e){return}}}function i1(e){return"object"!=typeof e||null===e?e?(0,W.__spreadArray)([],(0,W.__read)(ep),!1):void 0:0!==e.length?e:void 0}function i2(e){var t,r,n;return!(null==(t=null==e?void 0:e.allowlist)?void 0:t.length)&&!(null==(r=null==e?void 0:e.blocklist)?void 0:r.length)&&!(null==(n=null==e?void 0:e.excludelist)?void 0:n.length)}(A||(A={})).NetworkObservable="networkObservable";var i3=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-network-capture-browser",n=function(){var e,r=new nN.default(function(e){var r=new iH(function(t){var r={event:t,timestamp:Date.now(),type:"network"};e.next(r)});return iG.subscribe(r,t),function(){iG.unsubscribe(r)}});return(e={})[A.NetworkObservable]=r,e};return{name:r,type:"enrichment",setup:function(i,o){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var a;return(0,W.__generator)(this,function(s){var u,l,c,d,f,h,p;return"u"<typeof document&&(null==(u=null==(l=eS())?void 0:l.navigator)?void 0:u.product)!=="ReactNative"?[2]:(a=n(),t=null==i?void 0:i.loggerProvider,d=(c={allObservables:a,networkTrackingOptions:e,amplitude:o,loggerProvider:t}).allObservables,f=c.networkTrackingOptions,h=c.amplitude,p=c.loggerProvider,I=d.networkObservable.filter(function(e){return function(e,t){void 0===t&&(t={});var r,n,i=i0(e.url);if(!i)return!1;var o=i.host;return!(!1!==t.ignoreAmplitudeRequests&&(iX(o,"*.amplitude.com")||iX(o,"amplitude.com"))||(null==(r=t.ignoreHosts)?void 0:r.find(function(e){return iX(o,e)})))&&(!!t.captureRules||void 0===e.status||!!iZ(e.status,iY))&&(!t.captureRules||((0,W.__spreadArray)([],(0,W.__read)(t.captureRules),!1).reverse().find(function(t){if(n=function(e,t,r,n,i){if((!e.hosts||e.hosts.find(function(e){return iX(t,e)}))&&(!n||!e.urls||no(n,e.urls))&&(!i||!e.methods||e.methods.find(function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})))return(!r&&0!==r||!!iZ(r,e.statusCodeRange||iY))&&!0}(t,o,e.status,e.url,e.method)){var r=i1(t.responseHeaders);if(e.responseWrapper&&r){var i=e.responseWrapper.headers(r);i&&(e.responseHeaders=i)}var a=i1(t.requestHeaders);if(e.requestWrapper&&a){var s=e.requestWrapper.headers(a);s&&(e.requestHeaders=s)}if(e.responseWrapper&&t.responseBody&&!i2(t.responseBody)){var u=t.responseBody.excludelist||t.responseBody.blocklist;e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,u)}if(e.requestWrapper&&t.requestBody&&!i2(t.requestBody)){var u=t.requestBody.excludelist||t.requestBody.blocklist;e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,u)}}return void 0!==n}),!!n))&&!(e.requestWrapper&&function(e,t){if(e.includes("amplitude.com"))try{var r=t.body;if("string"!=typeof r)return!1;if(JSON.parse(r).events.find(function(e){return e.event_type===iJ}))return!0}catch(e){}return!1}(o,e.requestWrapper))}(e.event,f)}).subscribe(function(e){var t,r,n,i=e.event,o=i0(i.url);if(o){var a=null==(r=i.responseWrapper)?void 0:r.bodySize,s=null==(n=i.requestWrapper)?void 0:n.bodySize;!function(e,t,r,n){(0,W.__awaiter)(this,void 0,void 0,function(){var i,o,a;return(0,W.__generator)(this,function(s){switch(s.label){case 0:if(!(t.requestBodyJson||t.responseBodyJson))return[3,2];return[4,Promise.all([t.requestBodyJson,t.responseBodyJson])];case 1:if(o=(i=W.__read.apply(void 0,[s.sent(),2]))[0],a=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(e){null==n||n.debug("Failed to stringify request body",e)}if(a)try{e["[Amplitude] Response Body"]=JSON.stringify(a)}catch(e){null==n||n.debug("Failed to stringify response body")}s.label=2;case 2:return null==r||r.track(iJ,e),[2]}})})}(((t={})["[Amplitude] URL"]=o.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=o.query,t["[Amplitude] URL Fragment"]=o.fragment,t["[Amplitude] Request Method"]=i.method,t["[Amplitude] Status Code"]=i.status,t["[Amplitude] Start Time"]=i.startTime,t["[Amplitude] Completion Time"]=i.endTime,t["[Amplitude] Duration"]=i.duration,t["[Amplitude] Request Body Size"]=s,t["[Amplitude] Response Body Size"]=a,t["[Amplitude] Request Type"]=i.type,t["[Amplitude] Request Headers"]=i.requestHeaders,t["[Amplitude] Response Headers"]=i.responseHeaders,t),i,h,p)}}),null==t||t.log("".concat(r," has been successfully added.")),[2])})})},execute:function(e){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(e){return I.unsubscribe(),[2]})})}}};let i4=-1,i8=e=>{addEventListener("pageshow",t=>{t.persisted&&(i4=t.timeStamp,e(t))},!0)},i6=(e,t,r,n)=>{let i,o;return a=>{let s;t.value>=0&&(a||n)&&((o=t.value-(i??0))||void 0===i)&&(i=t.value,t.delta=o,s=t.value,t.rating=s>r[1]?"poor":s>r[0]?"needs-improvement":"good",e(t))}},i5=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},i9=()=>{let e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},i7=()=>{let e=i9();return e?.activationStart??0},oe=(e,t=-1)=>{let r=i9(),n="navigate";return i4>=0?n="back-forward-cache":r&&(document.prerendering||i7()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(0x82f79cd8fff*Math.random())+1e12}`,navigationType:n}},ot=new WeakMap;function or(e,t){return ot.get(e)||ot.set(e,new t),ot.get(e)}class on{t;i=0;o=[];h(e){if(e.hadRecentInput)return;let t=this.o[0],r=this.o.at(-1);this.i&&t&&r&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}let oi=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let n=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return n.observe({type:e,buffered:!0,...r}),n}}catch{}},oo=e=>{let t=!1;return()=>{t||(e(),t=!0)}},oa=-1,os=new Set,ou=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,ol=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(let e of os)e();isFinite(oa)||(oa="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",ol,!0))}},oc=()=>
2{if(oa<0){let e=i7();oa=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime)??ou(),addEventListener("visibilitychange",ol,!0),addEventListener("prerenderingchange",ol,!0),i8(()=>{setTimeout(()=>{oa=ou()})})}return{get firstHiddenTime(){return oa},onHidden(e){os.add(e)}}},od=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},of=[1800,3e3],oh=(e,t={})=>{od(()=>{let r=oc(),n,i=oe("FCP"),o=oi("paint",e=>{for(let t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-i7(),0),i.entries.push(t),n(!0)))});o&&(n=i6(e,i,of,t.reportAllChanges),i8(r=>{n=i6(e,i=oe("FCP"),of,t.reportAllChanges),i5(()=>{i.value=performance.now()-r.timeStamp,n(!0)})}))})},op=[.1,.25],ov=0,og=1/0,om=0,oy=e=>{for(let t of e)t.interactionId&&(og=Math.min(og,t.interactionId),ov=(om=Math.max(om,t.interactionId))?(om-og)/7+1:0)},ob=()=>t?ov:performance.interactionCount??0,o_=0;class ow{u=[];l=new Map;m;p;v(){o_=ob(),this.u.length=0,this.l.clear()}L(){let e=Math.min(this.u.length-1,Math.floor((ob()-o_)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;let t=this.u.at(-1),r=this.l.get(e.interactionId);if(r||this.u.length<10||e.duration>t.P){if(r?e.duration>r.P?(r.entries=[e],r.P=e.duration):e.duration===r.P&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],P:e.duration},this.l.set(r.id,r),this.u.push(r)),this.u.sort((e,t)=>t.P-e.P),this.u.length>10)for(let e of this.u.splice(10))this.l.delete(e.id);this.p?.(r)}}}let oS=e=>{let t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(addEventListener("visibilitychange",e=oo(e),{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},ok=[200,500];class oE{m;h(e){this.m?.(e)}}let oO=[2500,4e3],ox=[800,1800],oT=e=>{document.prerendering?od(()=>oT(e)):"complete"!==document.readyState?addEventListener("load",()=>oT(e),!0):setTimeout(e)};function oC(e){var t,r;return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor((r=(null==(t=e.entries[0])?void 0:t.startTime)||0,performance.timeOrigin+r)),navigationStart:Math.floor(performance.timeOrigin)}}var oP=function(){var e=null,r=eS(),n=null==r?void 0:r.document,i=null==r?void 0:r.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(r,o){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var a,s;return(0,W.__generator)(this,function(u){return void 0===n||(a=na((null==i?void 0:i.href)||"",r.loggerProvider),s={"[Amplitude] Page Domain":(null==i?void 0:i.hostname)||"","[Amplitude] Page Location":a,"[Amplitude] Page Path":na((null==i?void 0:i.pathname)||"",r.loggerProvider),"[Amplitude] Page Title":"u">typeof document&&document.title||"","[Amplitude] Page URL":na(a.split("?")[0],r.loggerProvider)},((e,t={})=>{od(()=>{let r=oc(),n,i=oe("LCP"),o=or(t,oE),a=e=>{for(let a of(t.reportAllChanges||(e=e.slice(-1)),e))o.h(a),a.startTime<r.firstHiddenTime&&(i.value=Math.max(a.startTime-i7(),0),i.entries=[a],n())},s=oi("largest-contentful-paint",a);if(s){n=i6(e,i,oO,t.reportAllChanges);let r=oo(()=>{a(s.takeRecords()),s.disconnect(),n(!0)}),o=e=>{e.isTrusted&&(oS(r),removeEventListener(e.type,o,{capture:!0}))};for(let e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});i8(r=>{n=i6(e,i=oe("LCP"),oO,t.reportAllChanges),i5(()=>{i.value=performance.now()-r.timeStamp,n(!0)})})}})})(function(e){s["[Amplitude] LCP"]=oC(e)}),oh(function(e){s["[Amplitude] FCP"]=oC(e)}),((e,r={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;let n=oc();od(()=>{"interactionCount"in performance||t||(t=oi("event",oy,{type:"event",buffered:!0,durationThreshold:0}));let i,o=oe("INP"),a=or(r,ow),s=e=>{oS(()=>{for(let t of e)a.h(t);let t=a.L();t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,i())})},u=oi("event",s,{durationThreshold:r.durationThreshold??40});i=i6(e,o,ok,r.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{s(u.takeRecords()),i(!0)}),i8(()=>{a.v(),i=i6(e,o=oe("INP"),ok,r.reportAllChanges)}))})})(function(e){s["[Amplitude] INP"]=oC(e)}),((e,t={})=>{let r=oc();oh(oo(()=>{let n,i=oe("CLS",0),o=or(t,on),a=e=>{for(let t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,n())},s=oi("layout-shift",a);s&&(n=i6(e,i,op,t.reportAllChanges),r.onHidden(()=>{a(s.takeRecords()),n(!0)}),i8(()=>{o.i=0,n=i6(e,i=oe("CLS",0),op,t.reportAllChanges),i5(()=>n())}),setTimeout(n))}))})(function(e){s["[Amplitude] CLS"]=oC(e)}),((e,t={})=>{let r=oe("TTFB"),n=i6(e,r,ox,t.reportAllChanges);oT(()=>{let i=i9();i&&(r.value=Math.max(i.responseStart-i7(),0),r.entries=[i],n(!0),i8(()=>{(n=i6(e,r=oe("TTFB",0),ox,t.reportAllChanges))(!0)}))})})(function(e){s["[Amplitude] TTFB"]=oC(e)}),e=function(){"hidden"===n.visibilityState&&e&&(o.track("[Amplitude] Web Vitals",s),n.removeEventListener("visibilitychange",e),e=null)},n.addEventListener("visibilitychange",e)),[2]})})},execute:function(e){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(t){return e&&(null==n||n.removeEventListener("visibilitychange",e)),[2]})})}}},oA=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),["AMP",t,e.substring(0,r)].filter(
2Boolean).join("_")},oI=function(){function e(e,t){var r;this.shouldTrackNewCampaign=!1,this.options=(0,W.__assign)({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:rp((null==(r=t.cookieOptions)?void 0:r.domain)||t.topLevelDomain),optOut:t.optOut},e),this.storage=t.cookieStorage,this.storageKey=oA(t.apiKey,"MKTG"),this.webExpStorageKey=oA(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=eh,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,this.topLevelDomain=t.topLevelDomain,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,W.__generator)(this,function(r){switch(r.label){case 0:if(this.options.optOut)return[2];return[4,this.fetchCampaign()];case 1:if(t=W.__read.apply(void 0,[r.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||e2(this.sessionTimeout,this.lastEventTime),!rd(this.currentCampaign,this.previousCampaign,this.options,this.logger,e,this.topLevelDomain))return[3,3];return this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return(0,W.__awaiter)(this,void 0,void 0,function(){var e;return(0,W.__generator)(this,function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:if(!(e=t.sent()))return[3,3];return[4,this.storage.remove(this.webExpStorageKey)];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||new rI().parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,r,n=(t=this.currentCampaign,r=this.options,ex(Object.entries((0,W.__assign)((0,W.__assign)({},eh),t)).reduce(function(e,t){var n,i=(0,W.__read)(t,2),o=i[0],a=i[1];return(e.setOnce("initial_".concat(o),null!=(n=null!=a?a:r.initialEmptyValue)?n:"EMPTY"),a)?e.set(o,a):e.unset(o)},new ey)));return e&&(n.event_id=e),n},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),oR=new Set([y.IDENTIFY,y.GROUP_IDENTIFY]),oD=function(e){void 0===e&&(e={});var t,r,n,i,o,a,s,u=null!=(t=e.fallbackAttributionEvent)&&t,l=eS(),c={},d=!1,f=!1,h=function(){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(e){switch(e.label){case 0:return[4,new rI().parse()];case 1:return c=rR(e.sent()),u&&(null==n||n.log("Tracking attribution fallback event."),null==r||r.track("[Amplitude] Attribution",c)),[2]}})})},p=function(){h()},v=function(e){return new Proxy(e,{apply:function(e,t,r){Reflect.apply(e,t,r),d&&p()}})};return{name:"@amplitude/plugin-event-property-attribution-browser",type:"enrichment",setup:function(e,t){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(u){switch(u.label){case 0:return r=t,n=e.loggerProvider,d=!0,n.log("Installing event property attribution tracking."),[4,h()];case 1:if(u.sent(),!l)return[2];if(l.addEventListener("popstate",p),!f){if(i=Reflect.get(l.history,"pushState"),o=Reflect.get(l.history,"replaceState"),!i||!o)return[2];a=v(i),l.history.pushState=a,s=v(o),l.history.replaceState=s,f=!0}return[2]}})})},execute:function(e){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(t){return oR.has(e.event_type)||(e.event_properties=(0,W.__assign)((0,W.__assign)({},c),e.event_properties)),[2,e]})})},teardown:function(){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var e,t;return(0,W.__generator)(this,function(r){return l&&(l.removeEventListener("popstate",p),e=Reflect.get(l.history,"pushState"),t=Reflect.get(l.history,"replaceState"),f&&e===a&&i&&(l.history.pushState=i),f&&t===s&&o&&(l.history.replaceState=o)),d=!1,f=!1,i=void 0,o=void 0,a=void 0,s=void 0,c={},[2]})})}}},oN="AMP_CURRENT_PAGE",oM="AMP_PREVIOUS_PAGE",oj="AMP_URL_INFO";(h=R||(R={})).Direct="direct",h.Internal="internal",h.External="external";var oL=new Set([y.IDENTIFY,y.GROUP_IDENTIFY,y.REVENUE]),oF=function(e){var t=(void 0===e?{}:e).internalDomains,r=void 0===t?[]:t,n=eS(),i=void 0,o=!1,a=void 0,s=!1,u=!1,l=function(e){var t;try{var r=na(e,a);
2t=new URL(r).hostname}catch(e){null==a||a.error("Could not parse URL: ",e)}return t},c=function(e){var t="u">typeof location&&location.hostname||"",n=e?l(e):void 0;if(!n)return R.Direct;var i=r.some(function(e){return -1!==t.indexOf(e)}),o=r.some(function(e){return -1!==n.indexOf(e)});return t===n||o&&i?R.Internal:R.External},d=function(){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n,a;return(0,W.__generator)(this,function(s){switch(s.label){case 0:if(!(i&&o))return[3,3];return[4,i.get(oj)];case 1:return e=s.sent(),t=na("u">typeof location&&location.href||""),r=(null==e?void 0:e[oN])||"",n=void 0,n=t===r?(null==e?void 0:e[oM])||"":r||document.referrer||"",[4,i.set(oj,((a={})[oN]=t,a[oM]=n,a))];case 2:s.sent(),s.label=3;case 3:return[2]}})})},f=function(){d()};return{name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var t,r,c,h,p,v,g,m;return(0,W.__generator)(this,function(y){switch(y.label){case 0:if((a=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),u=!0,!n)return[3,7];try{i=new tH(n.sessionStorage)}catch(e){null==a||a.debug("sessionStorage is not available in this environment.")}return[4,null==i?void 0:i.isEnabled()];case 1:if(o=null!=(m=y.sent())&&m,!(i&&o))return[3,6];return r=(t="u">typeof document&&document.referrer||"")?l(t):void 0,c="u">typeof location&&location.hostname||"",h=na("u">typeof location&&location.href||""),[4,i.get(oj)];case 2:if(v=(null==(p=y.sent())?void 0:p[oN])||"",!(r&&r!==c&&v!==h))return[3,4];return[4,i.set(oj,((g={})[oN]=h,g[oM]=t,g))];case 3:return y.sent(),[3,6];case 4:return[4,d()];case 5:y.sent(),y.label=6;case 6:n.addEventListener("popstate",f),s||(n.history.pushState=new Proxy(n.history.pushState,{apply:function(e,t,r){var n=(0,W.__read)(r,3),i=n[0],o=n[1],a=n[2];e.apply(t,[i,o,a]),u&&f()}}),n.history.replaceState=new Proxy(n.history.replaceState,{apply:function(e,t,r){var n=(0,W.__read)(r,3),i=n[0],o=n[1],a=n[2];e.apply(t,[i,o,a]),u&&f()}}),s=!0),y.label=7;case 7:return[2]}})})},execute:function(e){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var t,r,n;return(0,W.__generator)(this,function(a){switch(a.label){case 0:if(t=na("u">typeof location&&location.href||""),!(i&&o))return[3,2];return[4,i.get(oj)];case 1:if(n=(null==(r=a.sent())?void 0:r[oM])||"",oL.has(e.event_type))return[2,e];e.event_properties=(0,W.__assign)((0,W.__assign)({},e.event_properties||{}),{"[Amplitude] Page Domain":oq(e,"[Amplitude] Page Domain","u">typeof location&&location.hostname||""),"[Amplitude] Page Location":oq(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":oq(e,"[Amplitude] Page Path","u">typeof location&&na(location.pathname)||""),"[Amplitude] Page Title":oq(e,"[Amplitude] Page Title",rA(rP)),"[Amplitude] Page URL":oq(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":n,"[Amplitude] Previous Page Type":c(n)}),a.label=2;case 2:return[2,e]}})})},teardown:function(){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(e){switch(e.label){case 0:if(n&&(n.removeEventListener("popstate",f),u=!1),!(i&&o))return[3,2];return[4,i.set(oj,{})];case 1:e.sent(),e.label=2;case 2:return[2]}})})}}};function oq(e,t,r){return(e.event_properties||(e.event_properties={}),void 0===e.event_properties[t])?r:e.event_properties[t]}var oU=function(){var e,t,r;function n(t){if(t)try{var r=Function("return "+t)();if("function"==typeof r)return r;null==e||e.error("Custom enrichment body did not evaluate to a function")}catch(t){null==e||e.error("Could not create custom enrichment function",t)}return function(e){return e}}return{name:"@amplitude/plugin-custom-enrichment-browser",type:"enrichment",setup:function(i,o){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var o,a;return(0,W.__generator)(this,function(s){return null==(e=i.loggerProvider)||e.log("Installing @amplitude/plugin-custom-enrichment-browser"),(null==(a=i.remoteConfig)?void 0:a.fetchRemoteConfig)&&(i.remoteConfigClient?(o=i.remoteConfigClient.subscribe("configs.analyticsSDK.browserSDK.customEnrichment","all",function(e){r=e&&"object"==typeof e&&null!==e&&"body"in e&&"string"==typeof e.body?n(e.body||""):n("")}),t=function(){var e;return null==(e=i.remoteConfigClient)?void 0:e.unsubscribe(o)}):null==e||e.debug("Remote config client is not provided, skipping remote config fetch")),[2]})})},execute:function(t){return(0,W.__awaiter)(void 0,void 0,void 0,function(){var n;return(0,W.__generator)(this,function(i){if(r)try{return[2,null!=(n=r(t))?n:null]}catch(t){null==e||e.error("Could not execute custom enrichment function",t)}return[2,t]})})},teardown:function(){return(0,W.__awaiter)(void 0,void 0,void 0,function(){return(0,W.__generator)(this,function(e){return t&&t(),[2]})})}}},oV="userProperty",oz="eventProperty",oB=function(e){return e===oV||e===oz},oW=[oV,oz],o$=function(e){var t=(0,W.__spreadArray)([],(0,W.__read)(new Set((Array.isArray(e)?e:[e]).filter(oB))),!1);return t.length>0?t:(0,W.__spreadArray)([],(0,W.__read)(oW),!1)},oQ=function(e,t){return o$(e.trackingMethod).includes(t)},oH=function(e){return oQ(e,oV)};let oK={init:G((p=new(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return(0,W.__extends)(t,e),t.prototype.init=function(e,t,r){var n,i;return void 0===e&&(e=""),arguments.length>2?(n=t,i=r):"string"==typeof t?(n=t,i=void 0):(n=null==t?void 0:t.userId,i=t),eP(this._init((0,W.__assign)((0,W.__assign)({},i),{userId:n,apiKey:e})))},t.prototype._init=function(t){var r,n,i,o,a,s,u,l;return(0,W.__awaiter)(this,void 0,void 0,function(){var c,d,f,h,p,v,m,y,b,_,w,S,k,E,O=this;return(0,W.__generator)(this,function(x){var T,C,P,A,I,R,D,N,M;switch(x.label){case 0:if(this.initializing)return[2];if(this.initializing=!0,c=rS(t),d=null!=(r=t.loggerProvider)?r:new eD,t.loggerProvider||d.enable(null!=(n=t.logLevel)?n:g.Warn),f=null!=(i=t.serverZone)?i:"US",p=this._diagnosticsSampleRate,v=null==(o=t.enableDiagnostics)||o,!c)return[3,2];return h=new e5(t.apiKey,d,f,null==(a=t.remoteConfig)?void 0:a.serverUrl),[4,new Promise(function(e){null==h||h.subscribe("configs.diagnostics.browserSDK","all",function(t,r,n){if(d.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(p=i);var o=t.enabled;"boolean"==typeof o&&(v=o)}e()})})];case 1:x.sent(),x.label=2;case 2:return(m=new tf(t.apiKey,d,f,{enabled:v,sampleRate:p})).setTag("library","".concat(tL,"/").concat(tj)),m.setTag("platform","Web"),m.setTag("web_environment",function(){var e=eS();if(!e)return"unknown";var t=tI(e);return tR(e)?t?"chrome_extension_service_worker":"service_worker":tD(e)?"web_worker":void 0!==e.document?t?"chrome_extension":"browser":tN(e)?"node":"unknown"}()),"u">typeof navigator&&m.setTag("user_agent",navigator.userAgent),[4,(T=t.apiKey,C=t,P=this,A=m,I={loggerProvider:d,serverZone:f,enableDiagnostics:v,diagnosticsSampleRate:p},void 0===C&&(C={}),(0,W.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n,i,o,a,s,u,l,c,d,f,h,p,v,g,m,y,b,_,w,S,k,E,O,x,R,D,N,M,j,L,F,q,U,V,z,B,$,Q,H,K,G,J,Y,X,Z,ee,et,er;return(0,W.__generator)(this,function(en){var ei,eo,ea,es;switch(en.label){case 0:if(e=C.identityStorage||ru,t="",!(e===ru&&!(null==(w=C.cookieOptions)?void 0:w.domain)&&(null==(S=C.cookieOptions)?void 0:S.domain)!==""))return[3,2];return[4,(ei=void 0,eo=A,(0,W.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n,i,o,a;return(0,W.__generator)(this,function(s){switch(s.label){case 0:return[4,new tV(void 0,{diagnosticsClient:eo}).isEnabled()];case 1:if(!s.sent()||!ei&&("u"<typeof location||!location.hostname)||1===(t=(e=null!=ei?ei:location.hostname).split(".")).length)return[2,""];for(r=[],n=1,rm.find(function(t){return e.endsWith(".".concat(t))})&&(n=2),i=t.length-n-1;i>=0;--i)r.push(t.slice(i).join("."));i=0,s.label=2;case 2:if(!(i<r.length))return[3,7];o=r[i],s.label=3;
2case 3:return s.trys.push([3,5,,6]),[4,tV.isDomainWritable(o)];case 4:if(s.sent())return[2,"."+o];return[3,6];case 5:return a=s.sent(),eo&&eo.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(o),error:a instanceof Error?a.message:String(a)}),[3,6];case 6:return i++,[3,2];case 7:return eo&&eo.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(e)}),[2,""]}})}))];case 1:t=en.sent(),en.label=2;case 2:return r=(0,W.__assign)({domain:null!=(E=null==(k=C.cookieOptions)?void 0:k.domain)?E:t,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},C.cookieOptions),n={duplicateResolverFn:function(e){var t=tW(e);return!!t&&t$(JSON.parse(t).cookieDomain,r.domain)},diagnosticsClient:A},[4,(ea=i=rw(C.identityStorage,r,n),void 0===(es=null==(x=null==(O=C.cookieOptions)?void 0:O.upgrade)||x)&&(es=!0),(0,W.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n,i,o,a,s,u;return(0,W.__generator)(this,function(l){switch(l.label){case 0:return e="".concat("amp","_").concat(T.substring(0,6)),[4,ea.getRaw(e)];case 1:if(!(t=l.sent()))return[2,{optOut:!1}];if(!es)return[3,3];return[4,ea.remove(e)];case 2:l.sent(),l.label=3;case 3:return n=(r=(0,W.__read)(t.split("."),6))[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],[2,{deviceId:n,userId:t3(i),sessionId:t2(a),lastEventId:t2(u),lastEventTime:t2(s),optOut:!!o}]}})}))];case 3:return o=en.sent(),[4,i.get(tQ(T))];case 4:return a=en.sent(),l=!(u=(s=e4()).ampTimestamp?Number(s.ampTimestamp):void 0)||Date.now()<u,c=null!=(j=null!=(M=null!=(N=null!=(R=C.deviceId)?R:l?null!=(D=s.ampDeviceId)?D:s.deviceId:void 0)?N:null==a?void 0:a.deviceId)?M:o.deviceId)?j:eE(),d=null!=(L=null==a?void 0:a.lastEventId)?L:o.lastEventId,f=null!=(F=null==a?void 0:a.lastEventTime)?F:o.lastEventTime,h=null!=(U=null!=(q=C.optOut)?q:null==a?void 0:a.optOut)?U:o.optOut,p=null!=(V=null==a?void 0:a.sessionId)?V:o.sessionId,v=null==a?void 0:a.deferredSessionId,g=null!=(B=null!=(z=C.userId)?z:null==a?void 0:a.userId)?B:o.userId,P.previousSessionDeviceId=null!=($=null==a?void 0:a.deviceId)?$:o.deviceId,P.previousSessionUserId=null!=(Q=null==a?void 0:a.userId)?Q:o.userId,m={ipAddress:null==(K=null==(H=C.trackingOptions)?void 0:H.ipAddress)||K,language:null==(J=null==(G=C.trackingOptions)?void 0:G.language)||J,platform:null==(X=null==(Y=C.trackingOptions)?void 0:Y.platform)||X},y=null==a?void 0:a.pageCounter,b=null==a?void 0:a.debugLogsEnabled,void 0!==C.autocapture&&(C.defaultTracking=C.autocapture),[4,(_=new r_(T,C.appVersion,i,r,C.defaultTracking,C.autocapture,c,C.flushIntervalMillis,C.flushMaxRetries,C.flushQueueSize,e,C.ingestionMetadata,C.instanceName,d,f,null!=(Z=null==I?void 0:I.loggerProvider)?Z:C.loggerProvider,C.logLevel,C.minIdLength,C.offline,h,C.partnerId,C.plan,C.serverUrl,null!=(ee=null==I?void 0:I.serverZone)?ee:C.serverZone,p,v,C.sessionTimeout,C.storageProvider,m,C.transport,C.useBatch,C.fetchRemoteConfig,g,y,b,C.networkTrackingOptions,C.identify,null!=(et=null==I?void 0:I.enableDiagnostics)?et:C.enableDiagnostics,null!=(er=null==I?void 0:I.diagnosticsSampleRate)?er:P._diagnosticsSampleRate,A,C.remoteConfig,t,C.enableRequestBodyCompression,C.customEnrichment)).storageProvider.isEnabled()];case 5:return en.sent()||(_.loggerProvider.warn("Storage provider ".concat(_.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),_.storageProvider=new tq),[2,_]}})}))];case 3:if(y=x.sent(),!(c&&h))return[3,5];return[4,new Promise(function(e){null==h||h.subscribe("configs.analyticsSDK.browserSDK","all",function(t,r,n){y.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t&&function(e,t){var r,n;if(e){!function e(t){if("object"==typeof t&&null!==t&&!Array.isArray(t)){var r,n,i,o,a,s,u,l,c,d,f,h,p=Object.keys(t);try{for(var v=(0,W.__values)(p),g=v.next();!g.done;g=v.next()){var m=g.value;try{var y=t[m];"boolean"==typeof(null==y?void 0:y.enabled)&&(y.enabled?(delete y.enabled,0===Object.keys(y).length&&(t[m]=!0)):t[m]=!1),e(y)}catch(e){}}}catch(e){r={error:e}}finally{try{g&&!g.done&&(n=v.return)&&n.call(v)}finally{if(r)throw r.error}}
2try{if(null==(c=null==(l=null==(u=t.autocapture)?void 0:u.networkTracking)?void 0:l.captureRules)?void 0:c.length)try{for(var b=(0,W.__values)(t.autocapture.networkTracking.captureRules),_=b.next();!_.done;_=b.next()){var w=_.value;try{for(var S=(a=void 0,(0,W.__values)(["responseHeaders","requestHeaders"])),k=S.next();!k.done;k=S.next()){var E=k.value,O=null!=(d=w[E])?d:{},x=O.captureSafeHeaders,T=O.allowlist;if(x||T){if(void 0!==T&&!Array.isArray(T)){delete w[E];continue}w[E]=(0,W.__spreadArray)((0,W.__spreadArray)([],(0,W.__read)(x?ep:[]),!1),(0,W.__read)(null!=T?T:[]),!1)}}}catch(e){a={error:e}}finally{try{k&&!k.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}}}catch(e){i={error:e}}finally{try{_&&!_.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}}catch(e){}var C=null==(f=t.autocapture)?void 0:f.frustrationInteractions;C&&(C.rageClick&&(C.rageClicks=C.rageClick,delete C.rageClick),C.deadClick&&(C.deadClicks=C.deadClick,delete C.deadClick));try{var P=null==(h=t.autocapture)?void 0:h.elementInteractions;if(P&&"object"==typeof P&&(!0===P.viewportContentUpdated&&(P.viewportContentUpdated={}),!1===P.viewportContentUpdated&&(P.viewportContentUpdated={enabled:!1}),void 0!==P.exposureDuration)){var A=P.viewportContentUpdated;void 0===A?P.viewportContentUpdated={exposureDuration:P.exposureDuration}:"object"==typeof A&&void 0===A.exposureDuration&&!1!==A.enabled&&(A.exposureDuration=P.exposureDuration),delete P.exposureDuration}}catch(e){}}}(e);try{if(t.loggerProvider.debug("Update browser config with remote configuration:",tp(e)),e&&"autocapture"in e){if("boolean"==typeof e.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture&&null!==e.autocapture){var i=(0,W.__assign)({},e.autocapture);if(void 0===t.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture.elementInteractions&&null!==e.autocapture.elementInteractions&&(null==(r=e.autocapture.elementInteractions.pageUrlAllowlistRegex)?void 0:r.length)){i.elementInteractions=(0,W.__assign)({},e.autocapture.elementInteractions);var o=i.elementInteractions,a=null!=(n=o.pageUrlAllowlist)?n:[],s=e.autocapture.elementInteractions.pageUrlAllowlistRegex;o.pageUrlAllowlist=r$(a,s,t.loggerProvider),delete o.pageUrlAllowlistRegex}var u=function(e,t){if("object"==typeof e&&null!==e&&(null==(i=e.captureRules)?void 0:i.length)){var r,n,i,o,a,s=(0,W.__assign)({},e),u=null!=(o=s.captureRules)?o:[];try{for(var l=(0,W.__values)(u),c=l.next();!c.done;c=l.next()){var d=c.value;d.urls=r$(null!=(a=d.urls)?a:[],d.urlsRegex,t),delete d.urlsRegex}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}return s}}(e.autocapture.networkTracking,t.loggerProvider);u&&(i.networkTracking=u),"boolean"==typeof t.autocapture&&(t.autocapture=(0,W.__assign)({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},i)),"object"==typeof t.autocapture&&(t.autocapture=(0,W.__assign)((0,W.__assign)({},t.autocapture),i))}t.defaultTracking=t.autocapture}"customEnrichment"in e&&null!==e.customEnrichment&&!1!==t.customEnrichment&&(t.customEnrichment=e.customEnrichment),t.loggerProvider.debug("Browser config after remote config update:",tp(t))}catch(e){t.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}(t,y),e()})})];case 4:x.sent(),x.label=5;case 5:return[4,e.prototype._init.call(this,y)];case 6:if(x.sent(),this.logBrowserOptions(y),this.config.remoteConfigClient=h,b=tg((R=this.config).defaultTracking)&&R.defaultTracking&&"object"==typeof R.defaultTracking&&R.defaultTracking.attribution&&"object"==typeof R.defaultTracking.attribution?(0,W.__assign)({},R.defaultTracking.attribution):{},!(tg(this.config.defaultTracking)&&oH(b)))return[3,8];return this.config.optOut&&this.timeline.addOptOutListener(function(e){return(0,W.__awaiter)(O,void 0,void 0,function(){return(0,W.__generator)(this,function(t){switch(t.label){case 0:if(e)return[3,2];return this.webAttribution=new oI(b,this.config),[4,this.webAttribution.init()];case 1:t.sent(),t.label=2;case 2:return[2]}})})}),this.webAttribution=new oI(b,this.config),[4,this.webAttribution.init()];case 7:x.sent(),x.label=8;case 8:if(S=!(!(w=(_=e4()).ampTimestamp?Number(_.ampTimestamp):void 0)||Date.now()<w)||Number.isNaN(Number(_.ampSessionId))?void 0:Number(_.ampSessionId),-1!==(k=this.config.deferredSessionId)||this.config.optOut||(k=Date.now()),this.setSessionId(null!=(l=null!=(u=null!=(s=t.sessionId)?s:S)?u:k)?l:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener(function(e){return(0,W.__awaiter)(O,void 0,void 0,function(){return(0,W.__generator)(this,function(t){return!e&&this.config.deferredSessionId&&(-1===this.config.deferredSessionId?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]})})}
2),(E=eZ(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline)return[3,10];return[4,this.add(rW()).promise];case 9:x.sent(),x.label=10;case 10:return[4,this.add(new eV({diagnosticsClient:m})).promise];case 11:return x.sent(),[4,this.add(new tF).promise];case 12:return x.sent(),[4,this.add(new e3).promise];case 13:if(x.sent(),rB(this.config),!tv(this.config.defaultTracking,"fileDownloads"))return[3,15];return this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(rV()).promise];case 14:x.sent(),x.label=15;case 15:if(!tm(this.config.defaultTracking))return[3,17];return this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(rF()).promise];case 16:x.sent(),x.label=17;case 17:if(!ty(this.config.defaultTracking))return[3,20];if(this.config.optOut)return[3,19];return this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(rN(tT(this.config))).promise];case 18:return x.sent(),[3,20];case 19:this.timeline.addOptOutListener(function(e){return(0,W.__awaiter)(O,void 0,void 0,function(){return(0,W.__generator)(this,function(t){switch(t.label){case 0:if(e)return[2];return this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(rN(tT(this.config))).promise];case 1:return t.sent(),[2]}})})}),x.label=20;case 20:if(!(tg(this.config.defaultTracking)&&oQ(b,oz)))return[3,22];return this.config.loggerProvider.debug("Adding event property attribution plugin"),[4,this.add(oD(b)).promise];case 21:x.sent(),x.label=22;case 22:if(!tw(this.config.autocapture))return[3,24];return this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(ib(tE(this.config),{diagnosticsClient:m})).promise];case 23:x.sent(),x.label=24;case 24:if(!tS(this.config.autocapture))return[3,26];return this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(iR(tO(this.config))).promise];case 25:x.sent(),x.label=26;case 26:if(!t_(this.config.autocapture))return[3,28];return this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(i3(tx(this.config))).promise];case 27:x.sent(),x.label=28;case 28:if(!("boolean"==typeof(D=this.config.autocapture)?D:"object"==typeof D&&!0===D.webVitals))return[3,30];return this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(oP()).promise];case 29:x.sent(),x.label=30;case 30:if("object"!=typeof(N=this.config.autocapture)||!0!==N.performanceTracking&&"object"!=typeof N.performanceTracking)return[3,32];return this.config.loggerProvider.debug("Adding performance tracking plugin"),[4,this.add(iN(tk(this.config))).promise];case 31:x.sent(),x.label=32;case 32:if(!tv(this.config.autocapture,"pageUrlEnrichment"))return[3,34];return this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(oF()).promise];case 33:x.sent(),x.label=34;case 34:if(!("boolean"==typeof(M=this.config.customEnrichment)?M:"object"==typeof M&&null!==M&&!1!==M.enabled))return[3,36];return this.config.loggerProvider.debug("Adding custom enrichment plugin"),[4,this.add(oU()).promise];case 35:x.sent(),x.label=36;case 36:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 37:return x.sent(),E.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{},r=t.time,n=(0,W.__rest)(t,["time"]);O.track(e.eventType,n,"number"==typeof r?{time:r}:void 0)}),[2]}})})},t.prototype.getUserId=function(){var e;return null==(e=this.config)?void 0:e.userId},t.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),(e!==this.config.userId||void 0===e)&&(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),e0(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null==(e=this.config)?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),e1(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(eE()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var e,t;return{deviceId:null==(e=this.config)?void 0:e.deviceId,userId:null==(t=this.config)?void 0:t.userId,userProperties:this.userProperties}},t.prototype.setIdentity=function(e){if("userId"in e&&this.setUserId(e.userId),"deviceId"in e&&e.deviceId&&this.setDeviceId(e.deviceId),"userProperties"in e){this.userProperties=e.userProperties;var t,r,n,i=new ey,o=null!=(n=e.userProperties)?n:{};try{for(var a=(0,W.__values)(Object.entries(o)),s=a.next();!s.done;s=a.next()){var u=(0,W.__read)(s.value,2),l=u[0],c=u[1];i.set(l,c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}this.identify(i)}},t.prototype.getOptOut=function(){var e;return null==(e=this.config)?void 0:e.optOut},t.prototype.getSessionId=function(){var e;return null==(e=this.config)?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,r=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),eP(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=null!=e?e:-1,eP(Promise.resolve());
2if(void 0===e&&(e=Date.now()),e===this.config.sessionId)return eP(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var n=this.getSessionId();n!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!=(t=this.config.lastEventId)?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,tb(this.config.defaultTracking)&&(n&&i&&r.push(this.track(t7,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:n,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var a=this.trackCampaignEventIfNeeded(++o,r);return this.config.identify&&r.push(this.track(ex(this.config.identify)).promise),tb(this.config.defaultTracking)&&r.push(this.track(t9,void 0,{event_id:a?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,eP(Promise.all(r))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=rk(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,r){if(tA(t)){var n=t._q;t._q=[],t=tP(new ey,n)}return(null==r?void 0:r.user_id)&&this.setUserId(r.user_id),(null==r?void 0:r.device_id)&&this.setDeviceId(r.device_id),e.prototype.identify.call(this,t,r)},t.prototype.groupIdentify=function(t,r,n,i){if(tA(n)){var o=n._q;n._q=[],n=tP(new ey,o)}return e.prototype.groupIdentify.call(this,t,r,n,i)},t.prototype.revenue=function(t,r){if(tA(t)){var n=t._q;t._q=[],t=tP(new ez,n)}return e.prototype.revenue.call(this,t,r)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign||!oH(this.webAttribution.options))return!1;var r=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(r).promise):this.track(r),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return(0,W.__awaiter)(this,void 0,void 0,function(){var r,n,i;return(0,W.__generator)(this,function(o){return r=Date.now(),n=e2(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type!==t9&&t.event_type!==t7&&(!t.session_id||t.session_id===this.getSessionId())&&(n||i?(this.setSessionId(r),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):n||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]})})},t.prototype.logBrowserOptions=function(e){try{var t=(0,W.__assign)((0,W.__assign)({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",tp(t))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},t.prototype._setDiagnosticsSampleRate=function(e){if(!(e>1)&&!(e<0)&&!this.config){this._diagnosticsSampleRate=e;return}},t}(eA))).init.bind(p),"init",Q(p),K(p,["config"])),add:G(p.add.bind(p),"add",Q(p),K(p,["config.apiKey","timeline.plugins"])),remove:G(p.remove.bind(p),"remove",Q(p),K(p,["config.apiKey","timeline.plugins"])),track:G(p.track.bind(p),"track",Q(p),K(p,["config.apiKey","timeline.queue.length"])),logEvent:G(p.logEvent.bind(p),"logEvent",Q(p),K(p,["config.apiKey","timeline.queue.length"])),identify:G(p.identify.bind(p),"identify",Q(p),K(p,["config.apiKey","timeline.queue.length"])),groupIdentify:G(p.groupIdentify.bind(p),"groupIdentify",Q(p),K(p,["config.apiKey","timeline.queue.length"])),setGroup:G(p.setGroup.bind(p),"setGroup",Q(p),K(p,["config.apiKey","timeline.queue.length"])),revenue:G(p.revenue.bind(p),"revenue",Q(p),K(p,["config.apiKey","timeline.queue.length"])),flush:G(p.flush.bind(p),"flush",Q(p),K(p,["config.apiKey","timeline.queue.length"])),getUserId:G(p.getUserId.bind(p),"getUserId",Q(p),K(p,["config","config.userId"])),setUserId:G(p.setUserId.bind(p),"setUserId",Q(p),K(p,["config","config.userId"])),getDeviceId:G(p.getDeviceId.bind(p),"getDeviceId",Q(p),K(p,["config","config.deviceId"])),setDeviceId:G(p.setDeviceId.bind(p),"setDeviceId",Q(p),K(p,["config","config.deviceId"])),reset:G(p.reset.bind(p),"reset",Q(p),K(p,["config","config.userId","config.deviceId"])),getSessionId:G(p.getSessionId.bind(p),"getSessionId",Q(p),K(p,["config"])),setSessionId:G(p.setSessionId.bind(p),"setSessionId",Q(p),K(p,["config"])),extendSession:G(p.extendSession.bind(p),"extendSession",Q(p
2),K(p,["config"])),setOptOut:G(p.setOptOut.bind(p),"setOptOut",Q(p),K(p,["config"])),setTransport:G(p.setTransport.bind(p),"setTransport",Q(p),K(p,["config"])),getIdentity:G(p.getIdentity.bind(p),"getIdentity",Q(p),K(p,["config"])),setIdentity:G(p.setIdentity.bind(p),"setIdentity",Q(p),K(p,["config","config.userId","config.deviceId"])),getOptOut:G(p.getOptOut.bind(p),"getOptOut",Q(p),K(p,["config"])),_setDiagnosticsSampleRate:G(p._setDiagnosticsSampleRate.bind(p),"_setDiagnosticsSampleRate",Q(p),K(p,["config"]))};e.s([],421543),e.i(421543),(v=D||(D={})).US="US",v.EU="EU",v.STAGING="STAGING",e.s(["DEFAULT_ACTION_CLICK_ALLOWLIST",0,rK,"DEFAULT_CSS_SELECTOR_ALLOWLIST",0,rQ,"DEFAULT_DATA_ATTRIBUTE_PREFIX",0,rH,"EXCLUDE_INTERNAL_REFERRERS_CONDITIONS",0,rl,"IdentifyOperation",0,m,"LogLevel",0,g,"OfflineDisabled",0,null,"RevenueProperty",0,w,"ServerZone",0,D,"SpecialEventType",0,y],749345),e.i(749345),oK.add,oK.extendSession,oK.flush,oK.getDeviceId,oK.getIdentity,oK.getOptOut,oK.getSessionId;var oG=oK.getUserId,oJ=(oK.groupIdentify,oK.identify),oY=oK.init,oX=(oK.logEvent,oK.remove,oK.reset),oZ=(oK.revenue,oK.setDeviceId,oK.setGroup,oK.setIdentity,oK.setOptOut,oK.setSessionId,oK.setTransport,oK.setUserId),o0=oK.track;oK._setDiagnosticsSampleRate,e.s(["getUserId",0,oG,"identify",0,oJ,"init",0,oY,"reset",0,oX,"setUserId",0,oZ,"track",0,o0],496391)},302278,70620,e=>{"use strict";e.i(999161),e.i(562569);var t=e.i(531778);let r=e=>({experiments:e?.experiments||{},player:e?.player?{code:e.player.code||"",queryString:e.player.query_string||"",source:e.player.source||"",trackId:e.player.track_id||""}:null,sharedEpisodesViewed:e?.shared_episodes_viewed??[]});e.i(47124);var n=e.i(61238);let i=async e=>{let{data:i}=await t.frontClient.query({...e,errorPolicy:e?.errorPolicy??"all",fetchPolicy:e?.fetchPolicy??"cache-first",query:n.GetSettingsDocument});return r(i?.me?.settings)},o=async({experiments:e,player:i,sharedEpisodesViewed:o})=>{let a={shared_episodes_viewed:o??void 0};void 0!==e&&(a.experiments=e),void 0!==i&&(a.player=i?{code:i.code,query_string:i.queryString,source:i.source,track_id:i.trackId,trackId:i.trackId}:null);let{data:s}=await t.frontClient.mutate({mutation:n.UpdateSettingsDocument,variables:{settings:a}});return r(s?.updateSettings?.settings)};e.s(["getSettings",0,i,"updateSettings",0,o],70620);let a=async e=>(await i()).experiments[e]??null,s=async({experimentId:e,variant:t})=>o({experiments:{...(await i()).experiments,[e]:t}});e.s(["getSettingsExperimentVariant",0,a,"setSettingsExperimentVariant",0,s],302278)},239161,e=>{"use strict";var t=e.i(403792);let r=(0,t.makeVar)(!0),n=(0,t.makeVar)(!1),i=(0,t.makeVar)(0),o=(0,t.makeVar)(0),a=(0,t.makeVar)(1),s=(0,t.makeVar)({level:100,isMuted:!1});e.s(["audioDurationVar",0,i,"audioIsLoadingVar",0,r,"audioIsPlayingVar",0,n,"audioPlaybackRateVar",0,a,"audioPositionVar",0,o,"audioVolumeVar",0,s,"resetAudio",0,()=>{r(!0),n(!1),i(0),o(0),a(1),s({level:100,isMuted:!1})},"setAudioDuration",0,e=>{i(e)},"setAudioIsLoading",0,e=>{r(e)},"setAudioIsPlaying",0,e=>{n(e)},"setAudioPlaybackRate",0,e=>{a(e)},"setAudioPosition",0,e=>{o(e)},"setAudioVolume",0,e=>{s(e)}])},368689,543530,983681,544620,523469,850823,348804,21232,293098,e=>{"use strict";e.s([],368689),e.s(["ExperimentId",()=>c,"addExperimentEventInfo",()=>_,"generateExperimentsEventProps",()=>y,"getExperimentsSearchParam",()=>b,"getVariant",()=>g,"loadExperimentVariant",()=>v,"useVariant",()=>m],543530),e.i(239161);var t,r,n=e.i(403792),i=e.i(377902),o=e.i(18016),a=e.i(302278);e.i(963142);var s=e.i(617698),u=e.i(658335);let l="experiment_";var c=((t={}).CANCEL_FLOW_TEST="cancel_flow_test",t);let d={cancel_flow_test:{name:"cancel_flow_test",store:"settings",variants:{control:{name:"control",weight:34},immediate_offer:{name:"immediate_offer",weight:33},conditional_offer:{name:"conditional_offer",weight:33}}}},f=(0,n.makeVar)({}),h=e=>{f({...f(),...e})},p=e=>{let{[e]:t,...r}=f();f(r)},v=async(e,{disableVariantAssignment:t=!1}={})=>{let r=d[e];if(!r)return void p(e);if("Playwright (e2e-client)"===window.navigator.userAgent)return void h({[e]:r.variants.control.name});let n="settings"===r.store?await (0,a.getSettingsExperimentVariant)(e):(0,u.getLocalStorageExperimentVariant)(e);if(n&&r.variants[n])return void h({[e]:n});if(t)return void p(e);let{name:i}
2=(0,o.default)(Object.values(r.variants));"settings"===r.store?await (0,a.setSettingsExperimentVariant)({experimentId:e,variant:i}):(0,u.setLocalStorageExperimentVariant)(e,i),h({[e]:i}),(0,s.trackEvent)(`Experiment ${e}`,{[`${l}${e}`]:i})},g=e=>{let t=d[e];if(!t)return;let r=f()[e];if(r)return t.variants[r]},m=e=>{let t=(0,i.useReactiveVar)(f),r=d[e];if(!r)return;let n=t[e];if(n)return r.variants[n]},y=()=>Object.entries(f()).reduce((e,[t,r])=>(e[`${l}${t}`]=r,e),{}),b=e=>{if(!e)return{};let t=JSON.parse(e),r=Object.keys(t);return r.length>5||!r.every(e=>e.startsWith(l))?{}:t},_=e=>Object.keys(e).some(e=>e.startsWith(l))?e:{...e,...y()},w=(0,n.makeVar)(!1);e.s(["initVar",0,w],983681);var S=((r={}).WAITING="waiting",r.STARTING_PIN_MODE="starting_pin_mode",r.STARTING_GOOGLE_MODE="starting_google_mode",r.STARTED="started",r);let k=(0,n.makeVar)("waiting");e.s(["LoginStatus",()=>S,"loginStatusVar",0,k,"resetLoginStatusVar",0,()=>k("waiting"),"setLoginStatusVar",0,e=>k(e)],544620);let E={sidebarOpen:!1,submenuId:null},O=(0,n.makeVar)(E);e.s(["menuVar",0,O,"resetMenuVar",0,()=>{O(E)},"setMenuVar",0,e=>{O({...E,...e})},"updateMenuVar",0,e=>{O({...O(),...e})}],523469),e.i(503817);let x=(0,n.makeVar)(null);e.s(["playerVar",0,x,"resetPlayerVar",0,()=>{x(null)},"setPlayerVar",0,e=>{x(e)}],850823);let T=(0,n.makeVar)("dark");e.s(["setThemeVar",0,e=>{T(e)},"themeVar",0,T],348804);let C=(0,n.makeVar)(null);e.s(["loadVideoPlayer",0,e=>{C({episodeId:e,isMuted:!1,isPlaying:!0,volume:1})},"resetVideoPlayerVar",0,()=>{C(null)},"toggleVideoPlayerPlaying",0,()=>{let e=C();e&&C({...e,isPlaying:!e.isPlaying})},"updateVideoPlayerPlaying",0,e=>{let t=C();t&&t.isPlaying!==e&&C({...t,isPlaying:e})},"updateVideoPlayerVolume",0,(e,t)=>{let r=C();r&&C({...r,isMuted:t,volume:e})},"videoPlayerVar",0,C],21232),(0,n.makeVar)({isMuted:!1,volume:100});var P=e.i(804569);let A=(0,n.makeVar)(null);e.s(["resetTokenVar",0,()=>{(0,P.deleteAuthCookie)(),A(null)},"setTokenVar",0,e=>{(0,P.setAuthCookie)(e),A(e)},"tokenVar",0,A],293098)},445641,e=>{"use strict";var t=e.i(272315),r=e.i(161375),n=e.i(71563),i=e.i(998187);let o="We couldn't verify your connection to the server. Please try again. If you're using a VPN or proxy, turn it off and retry.",a=[/blocked by aws waf/i,/blocked by waf/i],s=[/failed to fetch/i,/fetch failed/i,/load failed/i,/networkerror/i,/network request failed/i,/internet connection appears to be offline/i,/err_network/i],u=e=>"string"==typeof e&&e.trim()?e:e instanceof Error&&e.message?.trim()?e.message:void 0,l=e=>!!e&&a.some(t=>t.test(e)),c=e=>!!e&&s.some(t=>t.test(e)),d=(e,a)=>((e,a)=>{let s=(e=>{let t=[e],r=[],n=new Set;for(;t.length>0;){let e=t.shift();!(void 0===e||n.has(e))&&(n.add(e),r.push(e),e instanceof Error&&"cause"in e&&e.cause&&t.push(e.cause))}return r})(e),d=s.find(n.ServerError.is),f=s.some(i.ServerParseError.is),h=s.find(r.CombinedProtocolErrors.is),p=s.map(u).find(c),v=s.find(t.CombinedGraphQLErrors.is)?.errors?.[0]?.message;if(d&&(l(d.bodyText)||l(d.message))||f||d&&d.statusCode<300)return{code:"MALFORMED_GRAPHQL_RESPONSE",message:o};if("u">typeof navigator&&!navigator.onLine)return{code:"NETWORK_CONNECTIVITY",message:"You appear to be offline. Please check your internet connection and try again."};if(p||c(v))return{code:"NETWORK_CONNECTIVITY",message:"We couldn't connect to the server. Please check your internet connection and try again."};if(v)return{code:"GRAPHQL_MESSAGE",message:v};if(d){let e;return{code:"HTTP_SERVER_ERROR",message:(e=d.statusCode,`The server returned an error (HTTP ${e}). Please try again.`)}}return h?{code:"UNKNOWN",message:h.message??a}:{code:"UNKNOWN",message:s.map(u).find(Boolean)??a}})(e,a).message;e.s(["default",0,(e,t)=>{let r=d(e,t);return r?`Error: ${r}`:r},"getRawErrorMessage",0,d])},407238,343619,332936,820902,e=>{"use strict";e.i(47124);var t,r,n=e.i(845854),i=((t={}).ALL="all",t.APPEARANCES="appearances",t.BOOKS="books",t.MAKING_SENSE_EPISODES="making_sense_episodes",t.POSTS="posts",t.QA="qa",t.WAKING_UP_CONVERSATIONS="waking_up_conversations",t);e.s(["SearchCategory",()=>i],343619);let o={[i.ALL]:"All Content",[i.APPEARANCES]:"Appearances",[i.BOOKS]:"Books",[i.MAKING_SENSE_EPISODES]:"Making Sense Episodes",[i.POSTS]:"Posts",[i.QA]:"Q&A",[i.WAKING_UP_CONVERSATIONS]:"Waking Up Conversations"};e.s(["SEARCH_CATEGORY_NAMES",0,o],332936),e.s([],820902);var a=((r={}).APPEARANCE="appearance",r.EPISODE="episode",r);let s={appearances:"Appearance",[n.EpisodeSection.essentials]:"Essentials",[n.EpisodeSection.making_sense]:"Making Sense Episodes",[n.EpisodeSection.qa]:"Q&A",[n.EpisodeSection.subscriber_extras]:"Subscriber Extras",[n.EpisodeSection.waking_up]:"Waking Up Conversations",[i.BOOKS]:"Books",[i.MAKING_SENSE_EPISODES]:"Making Sense Episodes",[i.POSTS]:"Posts",[i.WAKING_UP_CONVERSATIONS]:"Waking Up Conversations",[i.ALL]:"All Content"},u=e=>{switch(e){case n.EpisodeSection.making_sense:return"making-sense-episodes";case"appearances":return"appearances";case n.EpisodeSection.qa:return"qa";case n.EpisodeSection.waking_up:return"waking-up-conversations";
2case n.EpisodeSection.subscriber_extras:default:return"subscriber-extras"}};e.s(["CONTENT_TYPE_DISPLAY_NAME",0,s,"ContentType",()=>a,"getSlugFromContentSection",0,u,"normalizeContentCard",0,e=>{let t=e?.section,r=u(t),n=e?.slug||"",i=e?.title||"";return{contentType:"episode",date:e?.date||"",subtitle:e?.subtitle||"",id:e?.id||"",imageAlt:"",imageUrl:e?.image?.thumbnails?.x1||"",isFree:e?.is_free??!1,section:t,title:i,url:`/podcasts/${r}/${n}`}}],407238)},833981,542421,828856,e=>{"use strict";var t=e.i(407238);e.s(["normalizeEpisodeVideo",0,e=>({id:e?.id,videoCompleteId:e?.video_complete?.id||"",videoCompleteUrl:e?.video_complete?.url||"",videoCompleteUrlHls:e?.video_complete?.url_hls||null}),"normalizePlayerEpisode",0,e=>({audioCompleteUrl:e?.audio_complete?.url||"",audioCompleteUrlHls:e?.audio_complete?.url_hls||null,audioFree:e?.audio_free||"",section:e?.section,title:e?.title||"",type:e?.type})],542421);var r=e.i(880683);e.i(47124);var n=e.i(845854);let i={[n.EpisodeSection.making_sense]:{label:"Making Sense Episodes",position:"left",nonSubscribers:"show",seoTitle:"Making Sense Episodes | Sam Harris",url:`/podcasts/${(0,t.getSlugFromContentSection)(n.EpisodeSection.making_sense)}`},appearances:{label:"Appearances",position:"left",nonSubscribers:"show",seoTitle:"Appearances | Sam Harris",url:"/podcasts/appearances"},[n.EpisodeSection.qa]:{label:"Q&A",position:"left",nonSubscribers:"show",seoTitle:"Q&A | Sam Harris",url:`/podcasts/${(0,t.getSlugFromContentSection)(n.EpisodeSection.qa)}`},[n.EpisodeSection.subscriber_extras]:{label:"Subscriber Extras",position:"left",nonSubscribers:"lock",seoTitle:"Subscriber Extras | Sam Harris",url:`/podcasts/${(0,t.getSlugFromContentSection)(n.EpisodeSection.subscriber_extras)}`},[n.EpisodeSection.waking_up]:{label:"Waking Up Conversations",position:"left",nonSubscribers:"lock",seoTitle:"Waking Up Conversations | Sam Harris",url:`/podcasts/${(0,t.getSlugFromContentSection)(n.EpisodeSection.waking_up)}`}},o=[{__typename:"Episode",audio_complete:{__typename:"Audio",id:"se-1-ac",url_hls:null,url:`${r.CLOUDFRONT_URL}/web/episodes/audios/sam_harris_live_town_hall/sam_harris_live_town_hall.mp3`},date:"2019-05-09",id:"se-1",image:{__typename:"Image",id:"se-1-i",thumbnails:{__typename:"Thumbnail",x1:`${r.CLOUDFRONT_URL}/web/episodes/images/town-hall/6ad0e164-de4a-4c26-88b2-8c7dcb93dea0_thumb_x1`,x2:`${r.CLOUDFRONT_URL}/web/episodes/images/town-hall/6ad0e164-de4a-4c26-88b2-8c7dcb93dea0_thumb_x2`},url:`${r.CLOUDFRONT_URL}/web/episodes/images/town-hall/6ad0e164-de4a-4c26-88b2-8c7dcb93dea0`},section:n.EpisodeSection.subscriber_extras,slug:"town-hall",subtitle:"Recorded in Los Angeles",title:"Live Town Hall",type:n.EpisodeType.ask_sam,video_complete:{__typename:"Video",id:"se-1-vc",url_hls:null,url:`${r.CLOUDFRONT_URL}/web/videos/sam_harris_live_town_hall.mp4`}},{__typename:"Episode",audio_complete:{__typename:"Audio",id:"se-2-ac",url_hls:null,url:`${r.CLOUDFRONT_URL}/web/episodes/audios/live-toronto-brian-greene/dd601438-db98-4ef1-b255-9e28958cea8f.mp3`},date:"",id:"se-2",image:{__typename:"Image",id:"se-2-i",thumbnails:{__typename:"Thumbnail",x1:`${r.CLOUDFRONT_URL}/web/episodes/images/live-toronto-brian-greene/013eb8fa-6e0d-4d91-8258-28584b97ac86_thumb_x1`,x2:`${r.CLOUDFRONT_URL}/web/episodes/images/live-toronto-brian-greene/013eb8fa-6e0d-4d91-8258-28584b97ac86_thumb_x2`},url:`${r.CLOUDFRONT_URL}/web/episodes/images/live-toronto-brian-greene/013eb8fa-6e0d-4d91-8258-28584b97ac86`},long_description:'<p><b>Brian Greene</b> is world-renowned for his groundbreaking discoveries in the field of superstring theory, including the co-discovery of mirror symmetry and the discovery of spatial topology change. He is the director of Columbiaâs Center for Theoretical Physics.<br></p><p>Professor Greene is known to the public through his <i>New York Times</i> bestselling books and numerous media appearances from <i>The Late Show withStephen Colbert to Charlie Rose. The Washington Post</i> called him âthe single best explainer of abstruse concepts in the world today.â Professor Greene has hosted two NOVA mini-series based on his books, receiving the George Foster Peabody award for <i>The Elegant Universe with Brian Greene</i>. Greene has had cameo roles in a number of Hollywood films including <i>Frequency, Maze and The Last Mimzy</i> and in 2008, with producer Tracy Day, co-founded the <a href="http://www.briangreene.org/world-science-festival/">World Science Festival</a>. He is the director of Columbiaâs Center for Theoretical Physics. <br></p><p>Website: <a href="https://www.briangreene.org/">
2https://www.briangreene.org/</a> <br><br>Twitter: <a href="https://twitter.com/bgreene">@bgreene</a></p>',section:n.EpisodeSection.subscriber_extras,slug:"live-toronto-brian-greene",subtitle:"Audio recording of the live event",title:"Live in Toronto with Brian Greene",type:n.EpisodeType.making_sense},{__typename:"Episode",audio_complete:{__typename:"Audio",id:"se-3-ac",url_hls:null,url:`${r.CLOUDFRONT_URL}/web/episodes/audios/live-philadelphia-janna-levin-maria-popova/d3bb8993-1317-4f8e-a513-6023fde06086.mp3`},date:"",id:"se-3",image:{__typename:"Image",id:"se-3-i",thumbnails:{__typename:"Thumbnail",x1:`${r.CLOUDFRONT_URL}/web/episodes/images/live-philadelphia-janna-levin-maria-popova/176683b2-b652-48b6-bb9a-d36fe0774f82_thumb_x1`,x2:`${r.CLOUDFRONT_URL}/web/episodes/images/live-philadelphia-janna-levin-maria-popova/176683b2-b652-48b6-bb9a-d36fe0774f82_thumb_x2`},url:`${r.CLOUDFRONT_URL}/web/episodes/images/live-philadelphia-janna-levin-maria-popova/176683b2-b652-48b6-bb9a-d36fe0774f82`},long_description:'<p><b>Maria Popova</b> is a reader, writer, interestingness hunter-gatherer, and curious mind at large. Sheâs previously written for <i>Wired UK, The Atlantic, The New York Times,</i>and Harvardâs Nieman Journalism Lab, among others, and is a MIT Futures of Entertainment Fellow.Her blog is <a href="BrainPickings.org">BrainPickings.org</a><br></p><p>Twitter: <a href="https://twitter.com/brainpicker">@brainpicker</a></p><p><b>Janna Levin</b> is the Tow Professor of physics and astronomy at BarnardCollege of Columbia University, and has contributed to an understanding of black holes, the cosmology of extra dimensions, and gravitational waves in the shape of spacetime. She is also director of sciences at <a href="https://pioneerworks.org/">Pioneer Works</a>. Her previous books include <a href="https://www.amazon.com/gp/product/B00BTM81Q8/ref=as_li_qf_asin_il_tl?ie=UTF8&tag=wwwsamharris03-20&creative=9325&linkCode=as2&creativeASIN=B00BTM81Q8&linkId=34202c4387b36a8a9599a46a0d1885bb">How the Universe Got Its Spots</a> and a novel, <a href="https://www.amazon.com/gp/product/1400032407/ref=as_li_qf_asin_il_tl?ie=UTF8&tag=wwwsamharris03-20&creative=9325&linkCode=as2&creativeASIN=1400032407&linkId=23ada91abf87297f711b4787b70fa944">A Madman Dreams of Turing Machines</a>, which won the PEN/Bingham Prize. She was recently named a <a href="https://www.gf.org/fellows/all-fellows/janna-levin/">Guggenheim Fellow</a>. Her latest book, <a href="https://www.amazon.com/gp/product/030794848X/ref=as_li_qf_asin_il_tl?ie=UTF8&tag=wwwsamharris03-20&creative=9325&linkCode=as2&creativeASIN=030794848X&linkId=ca20b00724b4ae78219778ba26bd4a29">Black Hole Blues and Other Songs from Outer Space</a>, is the inside story on the discovery of the century: the sound of spacetime ringing from the collision of two black hole over a billion years ago. <br></p><p> Twitter: <a href="https://twitter.com/JannaLevin">@JannaLevin</a></p>',section:n.EpisodeSection.subscriber_extras,slug:"live-philadelphia-janna-levin-maria-popova",subtitle:"Audio recording of the live event",title:"Live in Philadelphia with Janna Levin and Maria Popova",type:n.EpisodeType.making_sense},{__typename:"Episode",date:"",audio_complete:{__typename:"Audio",id:"se-4-ac",url_hls:null,url:`${r.CLOUDFRONT_URL}/web/episodes/audios/conversation-dan-harris/983c7dd6-85b0-4da5-946d-581c48179593.mp3`},id:"se-4",image:{__typename:"Image",id:"se-4-i",thumbnails:{__typename:"Thumbnail",x1:`${r.CLOUDFRONT_URL}/web/episodes/images/conversation-dan-harris/68481786-ab20-49d0-a198-9c6e2ac35d57_thumb_x1`,x2:`${r.CLOUDFRONT_URL}/web/episodes/images/conversation-dan-harris/68481786-ab20-49d0-a198-9c6e2ac35d57_thumb_x2`},url:`${r.CLOUDFRONT_URL}/web/episodes/images/conversation-dan-harris/68481786-ab20-49d0-a198-9c6e2ac35d57`},section:n.EpisodeSection.subscriber_extras,slug:"conversation-dan-harris",subtitle:"Meditation for Fidgety Skeptics",title:"Meditation for Fidgety Skeptics: A Conversation with Dan Harris",type:n.EpisodeType.making_sense},{__typename:"Episode",audio_complete:{__typename:"Audio",id:"se-5-ac",url_hls:null,url:`${r.CLOUDFRONT_URL}/web/episodes/audios/waking_up_with_sam_harris/waking_up_with_sam_harris.mp3`},date:"",id:"se-5",image:{__typename:"Image",id:"se-5-i",thumbnails:{__typename:"Thumbn
2ail",x1:`${r.CLOUDFRONT_URL}/web/episodes/images/waking-up-video/4b342c7c-4c55-4104-b3aa-1303acebed78_thumb_x1`,x2:`${r.CLOUDFRONT_URL}/web/episodes/images/waking-up-video/4b342c7c-4c55-4104-b3aa-1303acebed78_thumb_x2`},url:`${r.CLOUDFRONT_URL}/web/episodes/images/waking-up-video/4b342c7c-4c55-4104-b3aa-1303acebed78`},section:n.EpisodeSection.subscriber_extras,slug:"waking-up-video",title:"Waking Up Video",type:n.EpisodeType.ask_sam,video_complete:{__typename:"Video",id:"se-5-vc",url_hls:null,url:`${r.CLOUDFRONT_URL}/web/videos/waking_up_with_sam_harris.mp4`}},{__typename:"Episode",audio_complete:{__typename:"Audio",id:"se-6-ac",url_hls:null,url:`${r.CLOUDFRONT_URL}/web/episodes/audios/waking_up_book_club_with_sam_harris_and_steven_pinker/waking_up_book_club_with_sam_harris_and_steven_pinker.mp3`},date:"",id:"se-6",image:{__typename:"Image",id:"se-6-i",thumbnails:{__typename:"Thumbnail",x1:`${r.CLOUDFRONT_URL}/web/episodes/images/waking-book-club-1/c58de79d-ffe1-4f5f-8f3d-e13805709ddf_thumb_x1`,x2:`${r.CLOUDFRONT_URL}/web/episodes/images/waking-book-club-1/c58de79d-ffe1-4f5f-8f3d-e13805709ddf_thumb_x2`},url:`${r.CLOUDFRONT_URL}/web/episodes/images/waking-book-club-1/c58de79d-ffe1-4f5f-8f3d-e13805709ddf`},long_description:'<p>In this first Waking Up Book Club event, weâre streaming live from the Dolby Theatre in Hollywood. Watch Sam Harris interview Steven Pinker about his new book <a href="https://www.amazon.com/gp/product/0525427570?ie=UTF8&tag=wwwsamharris03-20&camp=1789&linkCode=xm2&creativeASIN=0525427570"><i>Enlightenment Now: The Case For Reason, Science, Humanism, and Progress.</i></a></p>',section:n.EpisodeSection.subscriber_extras,seo:{__typename:"Seo",description:"In this first Waking Up Book Club event, weâre streaming live from the Dolby Theatre in Hollywood. Watch Sam Harris interview Steven Pinker about his new book Enlightenment Now: The Case For Reason, Science, Humanism, and Progress....",image:null,title:null},slug:"waking-book-club-1",subtitle:"Live with Steven Pinker",title:"Waking Up Book Club 1",type:n.EpisodeType.ask_sam,video_complete:{__typename:"Video",id:"se-6-vc",url_hls:null,url:`${r.CLOUDFRONT_URL}/web/videos/waking_up_book_club_with_sam_harris_and_steven_pinker.mp4`}},{__typename:"Episode",audio_complete:{__typename:"Audio",id:"se-7-ac",url_hls:null,url:`${r.CLOUDFRONT_URL}/web/episodes/audios/waking-book-club-2/d4dd9833-87e1-42cb-affa-a587f0f22a44.mp3`},date:"",id:"se-7",image:{__typename:"Image",id:"se-7-i",thumbnails:{__typename:"Thumbnail",x1:`${r.CLOUDFRONT_URL}/web/episodes/images/waking-book-club-2/4b00f5f5-9fdf-4ce3-9186-e0c790590c31_thumb_x1`,x2:`${r.CLOUDFRONT_URL}/web/episodes/images/waking-book-club-2/4b00f5f5-9fdf-4ce3-9186-e0c790590c31_thumb_x2`},url:`${r.CLOUDFRONT_URL}/web/episodes/images/waking-book-club-2/4b00f5f5-9fdf-4ce3-9186-e0c790590c31`},long_description:'<p>In this second Waking Up Book Club event, weâre recording live from the Theatre at Ace Hotel in Los Angeles. Listen to Sam Harris interview Antonio Damasio about his new book <a href="https://www.amazon.com/gp/product/0307908755/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0307908755&linkCode=as2&tag=wwwsamharris03-20&linkId=436925fd2baa765e8ad6db9541f866e0"> The Strange Order of Things: Life, Feeling, and the Making of Cultures</a>.</p>',section:n.EpisodeSection.subscriber_extras,slug:"waking-book-club-2",subtitle:"With Antonio Damasio",title:"Waking Up Book Club 2",type:n.EpisodeType.making_sense}];e.s(["EPISODES_MENU_SECTIONS",0,i,"SUBSCRIBER_EXTRA_FRAGMENTS",0,o],828856),e.s([],833981)},963142,617698,e=>{"use strict";e.s([],963142),e.s(["registerAnalyticsUser",()=>b,"setUpAnalytics",()=>y,"trackEvent",()=>w,"trackMediaEvent",()=>S,"unregisterAnalyticsUser",()=>_],617698);var t=e.i(88293),r=e.i(658335),n=e.i(108550),i=e.i(284325),o=e.i(496391);e.i(607785);var a=e.i(754361),s=e.i(880683),u=e.i(445641);e.i(368689);var l=e.i(543530);let c=()=>s.isSSR||!s.AMPLITUDE_API_KEY,d=async()=>{if(!s.isSSR&&s.AMPLITUDE_API_KEY){let e=window.OptanonActiveGroups?.includes("C0002");await o.init(s.AMPLITUDE_API_KEY,{appVersion:s.APP_VERSION,identityStorage:e?"cookie":"none",autocapture:{pageViews:!1,sessions:!1,attribution:!1,formInteractions:!1,fileDownloads:!1}}).promise}},f=async(e,t={})=>
2{if(!c())try{let r={query_string:window?.location?.search||void 0,referrer:document?.referrer||void 0,url:window?.location?`${window.location.origin}${window.location.pathname}`:void 0,...t},n=(0,l.addExperimentEventInfo)(r),i=(0,a.default)(n,e=>void 0!==e);await o.track(e,i).promise,s.AMPLITUDE_LOGGING_ENABLED&&console.log(e,i)}catch(t){let e=(0,u.default)(t,"unknown");(0,n.captureMessage)(`Unable to track Amplitude event (${e})`)}},h={baseUrl:"https://sdk.iad-06.braze.com",enableLogging:s.BRAZE_LOGGING},p=()=>s.isSSR||!s.BRAZE_API_KEY,v=async()=>{if(!s.isSSR&&s.BRAZE_API_KEY)try{let{disableSDK:t,enableSDK:r,initialize:n,openSession:i,wipeData:o}=await e.A(801854);window.OptanonActiveGroups?.includes("C0002")?(r(),n(s.BRAZE_API_KEY,h),i()):(t(),o())}catch(t){let e=(0,u.default)(t,"unknown");(0,n.captureMessage)(`Unable to setup Braze (${e})`)}},g=async t=>{if(!p())try{let{changeUser:r}=await e.A(801854);r(t)}catch(r){let e=(0,u.default)(r,"unknown");(0,n.captureMessage)(`Unable to register Braze user ID: ${t} (${e})`)}},m=async(t,r={})=>{if(!p())try{let n={query_string:window?.location?.search||void 0,referrer:document?.referrer||void 0,url:window?.location?`${window.location.origin}${window.location.pathname}`:void 0,...r},i=(0,l.addExperimentEventInfo)(n),o=(0,a.default)(i,e=>void 0!==e),{logCustomEvent:s}=await e.A(801854);s(t,o)}catch(r){let e=(0,u.default)(r,"unknown");(0,n.captureMessage)(`Unable to track Braze event ${t} (${e})`)}},y=async()=>{await d(),await v()},b=e=>{if(!c())try{o.setUserId(e)}catch(r){let t=(0,u.default)(r,"unknown");(0,n.captureMessage)(`Unable to register Amplitude user ID: ${e} (${t})`)}g(e)},_=()=>{if(!c())try{o.getUserId()&&o.reset()}catch(t){let e=(0,u.default)(t,"unknown");(0,n.captureMessage)(`Unable to unregister Amplitude user (${e})`)}},w=(e,t={})=>{f(e,t),"Media Share Content"===e&&m(e,t)},S=async(e,o,a={})=>{try{let n=await (0,i.getPlayerEpisode)({id:o});if(!n)return;let s={name:n.title,platform:"web",section:n.section,trackID:o,type:n.type,...a},u=(0,r.getPlayerSettings)();if(u&&(s.audioType=u.audioType,s.code=u.code,s.source=u.source,s.mediaType="audio",u.queryString)){let e=(0,t.parse)(u.queryString);Object.keys(e).forEach(t=>{s[`link_${t}`]=e[t]})}f(e,s),m(e,s)}catch(t){(0,n.captureException)(t,{extra:{event:e,id:o,...a},level:"error"})}}},531778,e=>{"use strict";var t=e.i(3139),r=e.i(28792),n=e.i(527248),i=e.i(569442),o=e.i(880683),a=e.i(804569);let s=(({appClient:e,initialState:s,token:u})=>{let l=new r.InMemoryCache({typePolicies:{Image:{fields:{thumbnails:{merge:!1}}}}});s&&l.restore(s);let c=new n.HttpLink({credentials:"same-origin",uri:o.API_GRAPHQL_URL}),d=new i.SetContextLink(({headers:t})=>({headers:{...t,Accept:"application/json",Authorization:(0,a.getAuthCookie)()||void 0,"app-client":e||"web","x-sh-v":"287d2e3b-e31a-4b63-bcd1-29d4294c0dew","webapp-version":o.APP_VERSION}}));return new t.ApolloClient({cache:l,link:d.concat(c),ssrMode:!1})})({appClient:"web"});e.s(["frontClient",0,s])},804569,e=>{"use strict";var t=e.i(201590),r=e.i(366164),n=e.i(880683),i=e.i(658335);let o=()=>({domain:n.AUTH_COOKIE_DOMAIN,expires:(0,r.addDays)(new Date,365),sameSite:"lax",secure:!n.isLocal});e.s(["deleteAuthCookie",0,()=>{(0,t.deleteCookie)(n.AUTH_COOKIE_KEY,o()),(0,i.removeLocalStorage)(i.TOKEN_KEY)},"getAuthCookie",0,()=>(0,t.getCookie)(n.AUTH_COOKIE_KEY)||(0,i.getLocalStorage)(i.TOKEN_KEY),"setAuthCookie",0,e=>{(0,t.setCookie)(n.AUTH_COOKIE_KEY,e,o()),(0,i.setLocalStorage)(i.TOKEN_KEY,e)}])},108550,942627,e=>{"use strict";var t=e.i(7822),r=e.i(518312);async function n({timeout:e=2e3,url:t}){try{let r=new AbortController,n=setTimeout(()=>r.abort(),e),{ok:i}=await fetch(t,{method:"HEAD",signal:r.signal});if(clearTimeout(n),i)return!0;return!1}catch{return!1}}e.s(["captureException",0,function(e,n){try{t.withScope(t=>{n?.extra&&Object.entries(n.extra).forEach(([e,r])=>t.setExtra(e,r)),n?.level&&t.setLevel(n.level),r.captureException(e)})}catch{}},"captureMessage",0,function(e){try{r.captureMessage(e)}catch{}}],108550),e.s(["default",0,n],942627)},658335,e=>{"use strict";var t=e.i(880683);let r="sh-player-settings",n="sh.experiment.",i=()=>{try{return!t.isSSR&&"u">typeof localStorage}catch{return!1}},o=(e,t)=>{try{if(!i())return;localStorage.setItem(e,t)}catch{}},a=e=>{try{if(!i())return null;return localStorage.getItem(e)}catch{return null}},s=e=>{try{if(!i())return;localStorage.removeItem(e)}catch{}};e.s(["TOKEN_KEY",0,"token","getLocalStorage",0,a,"getLocalStorageExperimentVariant",0,e=>a(`${n}${e}`),"getPlayerSettings",0,()=>{let e=a(r);return e?JSON.parse(e):null},"removeLocalStorage",0,s,"removePlayerSettings",0,()=>{s(r)},"setLocalStorage",0,o,"setLocalStorageExperimentVariant",0,(e,t)=>o(`${n}${e}`,t),"setPlayerSettings",0,e=>{e?o(r,JSON.stringify(e)):s(r)}])}]); 3 4//# debugId=dbf698a3-a5ec-c17b-dfab-bc3ba772ccee
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.