PageSourceSearch

https://app.twinmind.com/_next/static/chunks/2nl_8kurxd9-j.js?dpl=dpl_4QgG1NoxtNYFXWaSoGW23Ni1TP4J

js twinmind.com collected 2026-09-25 02:42:28 UTC 287,004 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69431,e=>{"use strict";var t=e.i(247167);e.s(["isProduction",0,function(){return void 0!==t.default&&!!t.default.env}])},66563,50270,736796,687085,42261,644804,273401,493532,508419,539752,566912,64243,950542,e=>{"use strict";let t;e.s([],38570),e.i(38570),(ts=tc||(tc={})).assertEqual=e=>{},ts.assertIs=function(e){},ts.assertNever=function(e){throw Error()},ts.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},ts.getValidEnumValues=e=>{let t=ts.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),r={};for(let n of t)r[n]=e[n];return ts.objectValues(r)},ts.objectValues=e=>ts.objectKeys(e).map(function(t){return e[t]}),ts.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},ts.find=(e,t)=>{for(let r of e)if(t(r))return r},ts.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,ts.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},ts.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(td||(td={})).mergeShapes=(e,t)=>({...e,...t});let r=tc.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),n=e=>{switch(typeof e){case"undefined":return r.undefined;case"string":return r.string;case"number":return Number.isNaN(e)?r.nan:r.number;case"boolean":return r.boolean;case"function":return r.function;case"bigint":return r.bigint;case"symbol":return r.symbol;case"object":if(Array.isArray(e))return r.array;if(null===e)return r.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return r.promise;if("u">typeof Map&&e instanceof Map)return r.map;if("u">typeof Set&&e instanceof Set)return r.set;if("u">typeof Date&&e instanceof Date)return r.date;return r.object;default:return r.unknown}};e.s(["ZodParsedType",0,r,"getParsedType",0,n,"objectUtil",0,td,"util",0,tc],904783);
1let i=tc.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),o=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class a extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(let i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;n<i.path.length;){let r=i.path[n];n===i.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(i))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof a))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,tc.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},r=[];for(let n of this.issues)if(n.path.length>0){let r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}a.create=e=>new a(e),e.s(["ZodError",0,a,"ZodIssueCode",0,i,"quotelessJson",0,o],169790);let s=(e,t)=>{let n;switch(e.code){case i.invalid_type:n=e.received===r.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case i.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,tc.jsonStringifyReplacer)}`;break;case i.unrecognized_keys:n=`Unrecognized key(s) in object: ${tc.joinValues(e.keys,", ")}`;break;case i.invalid_union:n="Invalid input";break;case i.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${tc.joinValues(e.options)}`;break;case i.invalid_enum_value:n=`Invalid enum value. Expected ${tc.joinValues(e.options)}, received '${e.received}'`;break;case i.invalid_arguments:n="Invalid function arguments";break;case i.invalid_return_type:n="Invalid function return type";break;case i.invalid_date:n="Invalid date";break;case i.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:tc.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case i.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case i.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case i.custom:n="Invalid input";break;case i.invalid_intersection_types:n="Intersection results could not be merged";break;case i.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case i.not_finite:n="Number must be finite";break;default:n=t.defaultError,tc.assertNever(e)}return{message:n}},l=s;function u(e){l=e}function c(){return l}e.s(["getErrorMap",0,c,"setErrorMap",0,u],937904),e.i(937904),e.s(["defaultErrorMap",0,s,"getErrorMap",0,c,"setErrorMap",0,u],27729
10),e.i(277290);let d=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],a={...i,path:o};if(void 0!==i.message)return{...i,path:o,message:i.message};let s="";for(let e of n.filter(e=>!!e).slice().reverse())s=e(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}},f=[];function p(e,t){let r=c(),n=d({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===s?void 0:s].filter(e=>!!e)});e.common.issues.push(n)}class h{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let n of t){if("aborted"===n.status)return g;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return h.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:t,value:i}=n;if("aborted"===t.status||"aborted"===i.status)return g;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==i.value||n.alwaysSet)&&(r[t.value]=i.value)}return{status:e.value,value:r}}}let g=Object.freeze({status:"aborted"}),m=e=>({status:"dirty",value:e}),v=e=>({status:"valid",value:e}),y=e=>"aborted"===e.status,_=e=>"dirty"===e.status,b=e=>"valid"===e.status,w=e=>"u">typeof Promise&&e instanceof Promise;e.s(["DIRTY",0,m,"EMPTY_PATH",0,f,"INVALID",0,g,"OK",0,v,"ParseStatus",0,h,"addIssueToContext",0,p,"isAborted",0,y,"isAsync",0,w,"isDirty",0,_,"isValid",0,b,"makeIssue",0,d],665354),e.i(665354),e.s([],527404),e.i(527404),e.i(904783),(tl=tf||(tf={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},tl.toString=e=>"string"==typeof e?e:e?.message;class k{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let x=(e,t)=>{if(b(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new a(e.common.issues);return this._error=t,this._error}}};function E(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:o}=e;return"invalid_enum_value"===t.code?{message:o??i.defaultError}:void 0===i.data?{message:o??n??i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:o??r??i.defaultError}},description:i}}class T{get description(){return this._def.description}_getType(e){return n(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new h,ctx:{common:e.parent.common,data:e.data,parsedType:n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(w(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:n(e)},i=this._parseSync({data:e,path:r.path,parent:r});return x(r,i)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:n(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return b(r)?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>b(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:n(e)},i=this._parse({data:e,path:r.path,parent:r});return x(r,await (w(i)?i:Promise.resolve(i)))}refine(e,t){return this._refinement((r,n)=>{let o=e(r),a=()=>n.addIssue({code:i.custom,..."string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(r):t});return"u">typeof Promise&&o instanceof Promise?o.then(e=>!!e||(a(),!1)):!!o||(a(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new e_({schema:this,typeName:tp.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return eb.create(this,this._def)}nullable(){return ew.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return er.create(this)}promise(){return ey.create(this,this._def)}or(e){return ei.create([this,e],this._def)}and(e){return es.create(this,e,this._def)}transform(e){return new e_({...E(this._def),schema:this,typeName:tp.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new ek({...E(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:tp.ZodDefault})}brand(){return new eS({typeName:tp.ZodBranded,type:this,...E(this._def)})}catch(e){return new ex({...E(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:tp.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return eA.create(this,e)}readonly(){return eI.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let S=/^c[^\s-]{8,}
1$/i,A=/^[0-9a-z]+$/,I=/^[0-9A-HJKMNP-TV-Z]{26}$/i,O=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,P=/^[a-z0-9_-]{21}$/i,C=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,R=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,N=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,j=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,D=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,L=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,M=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Z=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,U=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,F="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",z=RegExp(`^${F}$`);function q(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function $(e){let t=`${F}T${q(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,RegExp(`^${t}$`)}class B extends T{_parse(e){var n,o,a,s;let l;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==r.string){let t=this._getOrReturnCtx(e);return p(t,{code:i.invalid_type,expected:r.string,received:t.parsedType}),g}let u=new h;for(let r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(p(l=this._getOrReturnCtx(e,l),{code:i.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),u.dirty());else if("max"===r.kind)e.data.length>r.value&&(p(l=this._getOrReturnCtx(e,l),{code:i.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),u.dirty());else if("length"===r.kind){let t=e.data.length>r.value,n=e.data.length<r.value;(t||n)&&(l=this._getOrReturnCtx(e,l),t?p(l,{code:i.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):n&&p(l,{code:i.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),u.dirty())}else if("email"===r.kind)N.test(e.data)||(p(l=this._getOrReturnCtx(e,l),{validation:"email",code:i.invalid_string,message:r.message}),u.dirty());else if("emoji"===r.kind)t||(t=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),t.test(e.data)||(p(l=this._getOrReturnCtx(e,l),{validation:"emoji",code:i.invalid_string,message:r.message}),u.dirty());else if("uuid"===r.kind)O.test(e.data)||(p(l=this._getOrReturnCtx(e,l),{validation:"uuid",code:i.invalid_string,message:r.message}),u.dirty());else if("nanoid"===r.kind)P.test(e.data)||(p(l=this._getOrReturnCtx(e,l),{validation:"nanoid",code:i.invalid_string,message:r.message}),u.dirty());else if("cuid"===r.kind)S.test(e.data)||(p(l=this._getOrReturnCtx(e,l),{validation:"cuid",code:i.invalid_string,message:r.message}),u.dirty());else if("cuid2"===r.kind)A.test(e.data)||(p(l=this._getOrReturnCtx(e,l),{validation:"cuid2",code:i.invalid_string,message:r.message}),u.dirty());else if("ulid"===r.kind)I.test(e.data)||(p(l=this._getOrReturnCtx(e,l),{validation:"ulid",code:i.invalid_string,message:r.message}),u.dirty());else if("url"===r.kind)try{new URL(e.data)}catch{p(l=this._getOrReturnCtx(e,l),{validation:"url",code:i.invalid_string,message:r.message}),u.dirty()}else"regex"===r.kind?(r.regex.lastIndex=0,r.regex.test(e.data)||(p(l=this._getOrReturnCtx(e,l),{validation:"regex",code:i.invalid_string,message:r.message}),u.dirty())):"trim"===r.kind?e.data=e.data.trim():"includes"===r.kind?e.data.includes(r.value,r.position)||(p(l=this._getOrReturnCtx(e,l),{code:i.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),u.dirty()):"toLowerCase"===r.kind?e.data=e.data.toLowerCase():"toUpperCase"===r.kind?e.data=e.data.toUpperCase():"startsWith"===r.kind?e.data.startsWith(r.value)||(p(l=this._getOrReturnCtx(e,l),{code:i.invalid_string,validation:{startsWith:r.value},message:r.message}),u.dirty()):"endsWith"===r.kind?e.data.endsWith(r.value)||(p(l=this._getOrReturnCtx(e,l),{code:i.invalid_string,validation:{endsWith:r.value},message:r.message}),u.dirty()):"datetime"===r.kind?$(r).test(e.data)||(p(l=this._getOrReturnCtx(e,l),{code:i.invalid_string,validation:"datetime",message:r.message}),u.dirty()):"date"===r.kind?z.test(e.data)||(p(l=this._getOrReturnCtx(e,l),{code:i.invalid_string,validation:"date",message:r.message}),u.dirty()):"time"===r.kind?RegExp(`^${q(r)}$`).test(e.data)||(p(l=this._getOrReturnCtx(e,l),{code:i.invalid_string,validation:"time",message:r.message}),u.dirty()):"duration"===r.kind?R.test(e.data)||(p(l=this._getOrReturnCtx(e,l),{validation:"duration",code:i.invalid_string,message:r.message}),u.dirty()):"ip"===r.kind?(n=e.data,!(("v4"===(o=r.version)||!o)&&j.test(n)||("v6"===o||!o)&&L.test(n))&&1&&
1(p(l=this._getOrReturnCtx(e,l),{validation:"ip",code:i.invalid_string,message:r.message}),u.dirty())):"jwt"===r.kind?!function(e,t){if(!C.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));if("object"!=typeof i||null===i||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)return!1;return!0}catch{return!1}}(e.data,r.alg)&&(p(l=this._getOrReturnCtx(e,l),{validation:"jwt",code:i.invalid_string,message:r.message}),u.dirty()):"cidr"===r.kind?(a=e.data,!(("v4"===(s=r.version)||!s)&&D.test(a)||("v6"===s||!s)&&M.test(a))&&1&&(p(l=this._getOrReturnCtx(e,l),{validation:"cidr",code:i.invalid_string,message:r.message}),u.dirty())):"base64"===r.kind?Z.test(e.data)||(p(l=this._getOrReturnCtx(e,l),{validation:"base64",code:i.invalid_string,message:r.message}),u.dirty()):"base64url"===r.kind?U.test(e.data)||(p(l=this._getOrReturnCtx(e,l),{validation:"base64url",code:i.invalid_string,message:r.message}),u.dirty()):tc.assertNever(r);return{status:u.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:i.invalid_string,...tf.errToObj(r)})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...tf.errToObj(e)})}url(e){return this._addCheck({kind:"url",...tf.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...tf.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...tf.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...tf.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...tf.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...tf.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...tf.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...tf.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...tf.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...tf.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...tf.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...tf.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...tf.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...tf.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...tf.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...tf.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...tf.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...tf.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...tf.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...tf.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...tf.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...tf.errToObj(t)})}nonempty(e){return this.min(1,tf.errToObj(e))}trim(){return new B({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new B({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new B({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}B.create=e=>new B({checks:[],typeName:tp.ZodString,coerce:e?.coerce??!1,...E(e)});class V extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==r.number){let t=this._getOrReturnCtx(e);return p(t,{code:i.invalid_type,expected:r.number,received:t.parsedType}),g}let n=new h;for(let r of this._def.checks)"int"===r.kind?tc.isInteger(e.data)||(p(t=this._getOrReturnCtx(e,t),{code:i.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(p(t=this._getOrReturnCtx(e,t),{code:i.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(p(t=this._getOrReturnCtx(e,t),{code:i.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"multipleOf"===r.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(e.data,r.value)&&(p(t=this._getOrReturnCtx(e,t),{code:i.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(p(t=this._getOrReturnCtx(e,t),{code:i.not_finite,message:r.message}),n.dirty()):tc.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,tf.toString(t))}gt(e,t){return this.setLimit("min",e,!1,tf.toString(t))}lte(e,t){return this.setLimit("max",e,!0,tf.toString(t))}lt(e,t){return this.setLimit("max",e,!1,tf.toString(t))}setLimit(e,t,r,n){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:tf.toString(n)}]})}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:tf.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:tf.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:tf.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:tf.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:tf.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:tf.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:tf.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:tf.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:tf.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&tc.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;else"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value);return Number.isFinite(t)&&Number.isFinite(e)}}V.create=e=>new V({checks:[],typeName:tp.ZodNumber,coerce:e?.coerce||!1,...E(e)});class K extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==r.bigint)return this._getInvalidInput(e);let n=new h;for(let r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(p(t=this._getOrReturnCtx(e,t),{code:i.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(p(t=this._getOrReturnCtx(e,t),{code:i.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(p(t=this._getOrReturnCtx(e,t),{code:i.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):tc.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return p(t,{code:i.invalid_type,expected:r.bigint,received:t.parsedType}),g}gte(e,t){return this.setLimit("min",e,!0,tf.toString(t))}gt(e,t){return this.setLimit("min",e,!1,tf.toString(t))}lte(e,t){return this.setLimit("max",e,!0,tf.toString(t))}lt(e,t){return this.setLimit("max",e,!1,tf.toString(t))}setLimit(e,t,r,n){return new K({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:tf.toString(n)}]})}_addCheck(e){return new K({...this._def,checks:[...this._def.checks,e]})}
1positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:tf.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:tf.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:tf.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:tf.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:tf.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}K.create=e=>new K({checks:[],typeName:tp.ZodBigInt,coerce:e?.coerce??!1,...E(e)});class H extends T{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==r.boolean){let t=this._getOrReturnCtx(e);return p(t,{code:i.invalid_type,expected:r.boolean,received:t.parsedType}),g}return v(e.data)}}H.create=e=>new H({typeName:tp.ZodBoolean,coerce:e?.coerce||!1,...E(e)});class W extends T{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==r.date){let t=this._getOrReturnCtx(e);return p(t,{code:i.invalid_type,expected:r.date,received:t.parsedType}),g}if(Number.isNaN(e.data.getTime()))return p(this._getOrReturnCtx(e),{code:i.invalid_date}),g;let n=new h;for(let r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(p(t=this._getOrReturnCtx(e,t),{code:i.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(p(t=this._getOrReturnCtx(e,t),{code:i.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):tc.assertNever(r);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:tf.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:tf.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}W.create=e=>new W({checks:[],coerce:e?.coerce||!1,typeName:tp.ZodDate,...E(e)});class J extends T{_parse(e){if(this._getType(e)!==r.symbol){let t=this._getOrReturnCtx(e);return p(t,{code:i.invalid_type,expected:r.symbol,received:t.parsedType}),g}return v(e.data)}}J.create=e=>new J({typeName:tp.ZodSymbol,...E(e)});class G extends T{_parse(e){if(this._getType(e)!==r.undefined){let t=this._getOrReturnCtx(e);return p(t,{code:i.invalid_type,expected:r.undefined,received:t.parsedType}),g}return v(e.data)}}G.create=e=>new G({typeName:tp.ZodUndefined,...E(e)});class X extends T{_parse(e){if(this._getType(e)!==r.null){let t=this._getOrReturnCtx(e);return p(t,{code:i.invalid_type,expected:r.null,received:t.parsedType}),g}return v(e.data)}}X.create=e=>new X({typeName:tp.ZodNull,...E(e)});class Y extends T{constructor(){super(...arguments),this._any=!0}_parse(e){return v(e.data)}}Y.create=e=>new Y({typeName:tp.ZodAny,...E(e)});class Q extends T{constructor(){super(...arguments),this._unknown=!0}_parse(e){return v(e.data)}}Q.create=e=>new Q({typeName:tp.ZodUnknown,...E(e)});class ee extends T{_parse(e){let t=this._getOrReturnCtx(e);return p(t,{code:i.invalid_type,expected:r.never,received:t.parsedType}),g}}ee.create=e=>new ee({typeName:tp.ZodNever,...E(e)});class et extends T{_parse(e){if(this._getType(e)!==r.undefined){let t=this._getOrReturnCtx(e);return p(t,{code:i.invalid_type,expected:r.void,received:t.parsedType}),g}return v(e.data)}}et.create=e=>new et({typeName:tp.ZodVoid,...E(e)});class er extends T{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),o=this._def;if(t.parsedType!==r.array)return p(t,{code:i.invalid_type,expected:r.array,received:t.parsedType}),g;if(null!==o.exactLength){let e=t.data.length>o.exactLength.value,r=t.data.length<o.exactLength.value;(e||r)&&(p(t,{code:e?i.too_big:i.too_small,minimum:r?o.exactLength.value:void 0,maximum:e?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(null!==o.minLength&&t.data.length<o.minLength.value&&(p(t,{code:i.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),null!==o.maxLength&&t.data.length>o.maxLength.value&&(p(t,{code:i.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>o.type._parseAsync(new k(t,e,t.path,r)))).then(e=>h.mergeArray(n,e));let a=[...t.data].map((e,r)=>o.type._parseSync(new k(t,e,t.path,r)));return h.mergeArray(n,a)}
1get element(){return this._def.type}min(e,t){return new er({...this._def,minLength:{value:e,message:tf.toString(t)}})}max(e,t){return new er({...this._def,maxLength:{value:e,message:tf.toString(t)}})}length(e,t){return new er({...this._def,exactLength:{value:e,message:tf.toString(t)}})}nonempty(e){return this.min(1,e)}}er.create=(e,t)=>new er({type:e,minLength:null,maxLength:null,exactLength:null,typeName:tp.ZodArray,...E(t)});class en extends T{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=tc.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==r.object){let t=this._getOrReturnCtx(e);return p(t,{code:i.invalid_type,expected:r.object,received:t.parsedType}),g}let{status:t,ctx:n}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof ee&&"strip"===this._def.unknownKeys))for(let e in n.data)a.includes(e)||s.push(e);let l=[];for(let e of a){let t=o[e],r=n.data[e];l.push({key:{status:"valid",value:e},value:t._parse(new k(n,r,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof ee){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of s)l.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)s.length>0&&(p(n,{code:i.unrecognized_keys,keys:s}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of s){let r=n.data[t];l.push({key:{status:"valid",value:t},value:e._parse(new k(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of l){let r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>h.mergeObjectSync(t,e)):h.mergeObjectSync(t,l)}get shape(){return this._def.shape()}strict(e){return tf.errToObj,new en({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{let n=this._def.errorMap?.(t,r).message??r.defaultError;return"unrecognized_keys"===t.code?{message:tf.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new en({...this._def,unknownKeys:"strip"})}passthrough(){return new en({...this._def,unknownKeys:"passthrough"})}extend(e){return new en({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new en({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:tp.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new en({...this._def,catchall:e})}pick(e){let t={};for(let r of tc.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new en({...this._def,shape:()=>t})}omit(e){let t={};for(let r of tc.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new en({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof en){let r={};for(let n in t.shape){let i=t.shape[n];r[n]=eb.create(e(i))}return new en({...t._def,shape:()=>r})}if(t instanceof er)return new er({...t._def,type:e(t.element)});if(t instanceof eb)return eb.create(e(t.unwrap()));if(t instanceof ew)return ew.create(e(t.unwrap()));if(t instanceof el)return el.create(t.items.map(t=>e(t)));else return t}(this)}partial(e){let t={};for(let r of tc.objectKeys(this.shape)){let n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new en({...this._def,shape:()=>t})}required(e){let t={};for(let r of tc.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof eb;)e=e._def.innerType;t[r]=e}return new en({...this._def,shape:()=>t})}keyof(){return eg(tc.objectKeys(this.shape))}}en.create=(e,t)=>new en({shape:()=>e,unknownKeys:"strip",catchall:ee.create(),typeName:tp.ZodObject,...E(t)}),en.strictCreate=(e,t)=>new en({shape:()=>e,unknownKeys:"strict",catchall:ee.create(),typeName:tp.ZodObject,...E(t)}),en.lazycreate=(e,t)=>new en({shape:e,unknownKeys:"strip",catchall:ee.create(),typeName:tp.ZodObject,...E(t)});class ei extends T{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new a(e.ctx.common.issues));return p(t,{code:i.invalid_union,unionErrors:r}),g});{let e,n=[];for(let i of r){let r={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let o=n.map(e=>new a(e));return p(t,{code:i.invalid_union,unionErrors:o}),g}}get options(){return this._def.options}}ei.create=(e,t)=>
1new ei({options:e,typeName:tp.ZodUnion,...E(t)});let eo=e=>{if(e instanceof ep)return eo(e.schema);if(e instanceof e_)return eo(e.innerType());if(e instanceof eh)return[e.value];if(e instanceof em)return e.options;if(e instanceof ev)return tc.objectValues(e.enum);else if(e instanceof ek)return eo(e._def.innerType);else if(e instanceof G)return[void 0];else if(e instanceof X)return[null];else if(e instanceof eb)return[void 0,...eo(e.unwrap())];else if(e instanceof ew)return[null,...eo(e.unwrap())];else if(e instanceof eS)return eo(e.unwrap());else if(e instanceof eI)return eo(e.unwrap());else if(e instanceof ex)return eo(e._def.innerType);else return[]};class ea extends T{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==r.object)return p(t,{code:i.invalid_type,expected:r.object,received:t.parsedType}),g;let n=this.discriminator,o=t.data[n],a=this.optionsMap.get(o);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(p(t,{code:i.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),g)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let r of t){let t=eo(r.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of t){if(n.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,r)}}return new ea({typeName:tp.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...E(r)})}}class es extends T{_parse(e){let{status:t,ctx:o}=this._processInputParams(e),a=(e,a)=>{if(y(e)||y(a))return g;let s=function e(t,i){let o=n(t),a=n(i);if(t===i)return{valid:!0,data:t};if(o===r.object&&a===r.object){let r=tc.objectKeys(i),n=tc.objectKeys(t).filter(e=>-1!==r.indexOf(e)),o={...t,...i};for(let r of n){let n=e(t[r],i[r]);if(!n.valid)return{valid:!1};o[r]=n.data}return{valid:!0,data:o}}if(o===r.array&&a===r.array){if(t.length!==i.length)return{valid:!1};let r=[];for(let n=0;n<t.length;n++){let o=e(t[n],i[n]);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}if(o===r.date&&a===r.date&&+t==+i)return{valid:!0,data:t};return{valid:!1}}(e.value,a.value);return s.valid?((_(e)||_(a))&&t.dirty(),{status:t.value,value:s.data}):(p(o,{code:i.invalid_intersection_types}),g)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([e,t])=>a(e,t)):a(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}es.create=(e,t,r)=>new es({left:e,right:t,typeName:tp.ZodIntersection,...E(r)});class el extends T{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==r.array)return p(n,{code:i.invalid_type,expected:r.array,received:n.parsedType}),g;if(n.data.length<this._def.items.length)return p(n,{code:i.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g;!this._def.rest&&n.data.length>this._def.items.length&&(p(n,{code:i.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let o=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new k(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(o).then(e=>h.mergeArray(t,e)):h.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new el({...this._def,rest:e})}}el.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new el({items:e,typeName:tp.ZodTuple,rest:null,...E(t)})};class eu extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==r.object)return p(n,{code:i.invalid_type,expected:r.object,received:n.parsedType}),g;let o=[],a=this._def.keyType,s=this._def.valueType;for(let e in n.data)o.push({key:a._parse(new k(n,e,n.path,e)),value:s._parse(new k(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?h.mergeObjectAsync(t,o):h.mergeObjectSync(t,o)}
1get element(){return this._def.valueType}static create(e,t,r){return new eu(t instanceof T?{keyType:e,valueType:t,typeName:tp.ZodRecord,...E(r)}:{keyType:B.create(),valueType:e,typeName:tp.ZodRecord,...E(t)})}}class ec extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==r.map)return p(n,{code:i.invalid_type,expected:r.map,received:n.parsedType}),g;let o=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map(([e,t],r)=>({key:o._parse(new k(n,e,n.path,[r,"key"])),value:a._parse(new k(n,t,n.path,[r,"value"]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of s){let n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return g;("dirty"===n.status||"dirty"===i.status)&&t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of s){let n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return g;("dirty"===n.status||"dirty"===i.status)&&t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}ec.create=(e,t,r)=>new ec({valueType:t,keyType:e,typeName:tp.ZodMap,...E(r)});class ed extends T{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==r.set)return p(n,{code:i.invalid_type,expected:r.set,received:n.parsedType}),g;let o=this._def;null!==o.minSize&&n.data.size<o.minSize.value&&(p(n,{code:i.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),t.dirty()),null!==o.maxSize&&n.data.size>o.maxSize.value&&(p(n,{code:i.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),t.dirty());let a=this._def.valueType;function s(e){let r=new Set;for(let n of e){if("aborted"===n.status)return g;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}let l=[...n.data.values()].map((e,t)=>a._parse(new k(n,e,n.path,t)));return n.common.async?Promise.all(l).then(e=>s(e)):s(l)}min(e,t){return new ed({...this._def,minSize:{value:e,message:tf.toString(t)}})}max(e,t){return new ed({...this._def,maxSize:{value:e,message:tf.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ed.create=(e,t)=>new ed({valueType:e,minSize:null,maxSize:null,typeName:tp.ZodSet,...E(t)});class ef extends T{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==r.function)return p(t,{code:i.invalid_type,expected:r.function,received:t.parsedType}),g;function n(e,r){return d({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,c(),s].filter(e=>!!e),issueData:{code:i.invalid_arguments,argumentsError:r}})}function o(e,r){return d({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,c(),s].filter(e=>!!e),issueData:{code:i.invalid_return_type,returnTypeError:r}})}let l={errorMap:t.common.contextualErrorMap},u=t.data;if(this._def.returns instanceof ey){let e=this;return v(async function(...t){let r=new a([]),i=await e._def.args.parseAsync(t,l).catch(e=>{throw r.addIssue(n(t,e)),r}),s=await Reflect.apply(u,this,i);return await e._def.returns._def.type.parseAsync(s,l).catch(e=>{throw r.addIssue(o(s,e)),r})})}{let e=this;return v(function(...t){let r=e._def.args.safeParse(t,l);if(!r.success)throw new a([n(t,r.error)]);let i=Reflect.apply(u,this,r.data),s=e._def.returns.safeParse(i,l);if(!s.success)throw new a([o(i,s.error)]);return s.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ef({...this._def,args:el.create(e).rest(Q.create())})}returns(e){return new ef({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ef({args:e||el.create([]).rest(Q.create()),returns:t||Q.create(),typeName:tp.ZodFunction,...E(r)})}}class ep extends T{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ep.create=(e,t)=>
1new ep({getter:e,typeName:tp.ZodLazy,...E(t)});class eh extends T{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return p(t,{received:t.data,code:i.invalid_literal,expected:this._def.value}),g}return{status:"valid",value:e.data}}get value(){return this._def.value}}function eg(e,t){return new em({values:e,typeName:tp.ZodEnum,...E(t)})}eh.create=(e,t)=>new eh({value:e,typeName:tp.ZodLiteral,...E(t)});class em extends T{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return p(t,{expected:tc.joinValues(r),received:t.parsedType,code:i.invalid_type}),g}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return p(t,{received:t.data,code:i.invalid_enum_value,options:r}),g}return v(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return em.create(e,{...this._def,...t})}exclude(e,t=this._def){return em.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}em.create=eg;class ev extends T{_parse(e){let t=tc.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==r.string&&n.parsedType!==r.number){let e=tc.objectValues(t);return p(n,{expected:tc.joinValues(e),received:n.parsedType,code:i.invalid_type}),g}if(this._cache||(this._cache=new Set(tc.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=tc.objectValues(t);return p(n,{received:n.data,code:i.invalid_enum_value,options:e}),g}return v(e.data)}get enum(){return this._def.values}}ev.create=(e,t)=>new ev({values:e,typeName:tp.ZodNativeEnum,...E(t)});class ey extends T{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==r.promise&&!1===t.common.async?(p(t,{code:i.invalid_type,expected:r.promise,received:t.parsedType}),g):v((t.parsedType===r.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ey.create=(e,t)=>new ey({type:e,typeName:tp.ZodPromise,...E(t)});class e_ extends T{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===tp.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{p(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===n.type){let e=n.transform(r.data,i);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return g;let n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?g:"dirty"===n.status||"dirty"===t.value?m(n.value):n});{if("aborted"===t.value)return g;let n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?g:"dirty"===n.status||"dirty"===t.value?m(n.value):n}}if("refinement"===n.type){let e=e=>{let t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?g:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?g:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}}if("transform"===n.type)if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>b(e)?Promise.resolve(n.transform(e.value,i)).then(e=>({status:t.value,value:e})):g);else{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!b(e))return g;let o=n.transform(e.value,i);if(o instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}tc.assertNever(n)}}e_.create=(e,t,r)=>new e_({schema:e,typeName:tp.ZodEffects,effect:t,...E(r)}),e_.createWithPreprocess=(e,t,r)=>new e_({schema:t,effect:{type:"preprocess",transform:e},typeName:tp.ZodEffects,...E(r)});class eb extends T{_parse(e){return this._getType(e)===r.undefined?v(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eb.create=(e,t)=>
1new eb({innerType:e,typeName:tp.ZodOptional,...E(t)});class ew extends T{_parse(e){return this._getType(e)===r.null?v(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ew.create=(e,t)=>new ew({innerType:e,typeName:tp.ZodNullable,...E(t)});class ek extends T{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===r.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ek.create=(e,t)=>new ek({innerType:e,typeName:tp.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...E(t)});class ex extends T{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return w(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new a(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new a(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ex.create=(e,t)=>new ex({innerType:e,typeName:tp.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...E(t)});class eE extends T{_parse(e){if(this._getType(e)!==r.nan){let t=this._getOrReturnCtx(e);return p(t,{code:i.invalid_type,expected:r.nan,received:t.parsedType}),g}return{status:"valid",value:e.data}}}eE.create=e=>new eE({typeName:tp.ZodNaN,...E(e)});let eT=Symbol("zod_brand");class eS extends T{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class eA extends T{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?g:"dirty"===e.status?(t.dirty(),m(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?g:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new eA({in:e,out:t,typeName:tp.ZodPipeline})}}class eI extends T{_parse(e){let t=this._def.innerType._parse(e),r=e=>(b(e)&&(e.value=Object.freeze(e.value)),e);return w(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}function eO(e,t){let r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r}function eP(e,t={},r){return e?Y.create().superRefine((n,i)=>{let o=e(n);if(o instanceof Promise)return o.then(e=>{if(!e){let e=eO(t,n),o=e.fatal??r??!0;i.addIssue({code:"custom",...e,fatal:o})}});if(!o){let e=eO(t,n),o=e.fatal??r??!0;i.addIssue({code:"custom",...e,fatal:o})}}):Y.create()}eI.create=(e,t)=>new eI({innerType:e,typeName:tp.ZodReadonly,...E(t)});let eC={object:en.lazycreate};(tu=tp||(tp={})).ZodString="ZodString",tu.ZodNumber="ZodNumber",tu.ZodNaN="ZodNaN",tu.ZodBigInt="ZodBigInt",tu.ZodBoolean="ZodBoolean",tu.ZodDate="ZodDate",tu.ZodSymbol="ZodSymbol",tu.ZodUndefined="ZodUndefined",tu.ZodNull="ZodNull",tu.ZodAny="ZodAny",tu.ZodUnknown="ZodUnknown",tu.ZodNever="ZodNever",tu.ZodVoid="ZodVoid",tu.ZodArray="ZodArray",tu.ZodObject="ZodObject",tu.ZodUnion="ZodUnion",tu.ZodDiscriminatedUnion="ZodDiscriminatedUnion",tu.ZodIntersection="ZodIntersection",tu.ZodTuple="ZodTuple",tu.ZodRecord="ZodRecord",tu.ZodMap="ZodMap",tu.ZodSet="ZodSet",tu.ZodFunction="ZodFunction",tu.ZodLazy="ZodLazy",tu.ZodLiteral="ZodLiteral",tu.ZodEnum="ZodEnum",tu.ZodEffects="ZodEffects",tu.ZodNativeEnum="ZodNativeEnum",tu.ZodOptional="ZodOptional",tu.ZodNullable="ZodNullable",tu.ZodDefault="ZodDefault",tu.ZodCatch="ZodCatch",tu.ZodPromise="ZodPromise",tu.ZodBranded="ZodBranded",tu.ZodPipeline="ZodPipeline",tu.ZodReadonly="ZodReadonly";let eR=(e,t={message:`Input not instance of ${e.name}`})=>eP(t=>t instanceof e,t),eN=B.create,ej=V.create,eD=eE.create,eL=K.create,eM=H.create,eZ=W.create,eU=J.create,eF=G.create,ez=X.create,eq=Y.create,e$=Q.create,eB=ee.create,eV=et.create,eK=er.create,eH=en.create,eW=en.strictCreate,eJ=ei.create,eG=ea.create,eX=es.create,eY=el.create,eQ=eu.create,e0=ec.create,e1=ed.create,e2=ef.create,e4=ep.create,e3=eh.create,e9=em.create,e5=ev.create,e6=ey.create,e7=e_.create,e8=eb.create,te=ew.create,tt=e_.createWithPreprocess,tr=eA.create,tn=()=>eN().optional(),ti=()=>ej().optional(),to=()=>eM().optional(),ta={string:e=>B.create({...e,coerce:!0}),number:e=>V.create({...e,coerce:!0}),boolean:e=>H.create({...e,coerce:!0}),bigint:e=>K.create({...e,coerce:!0}),date:e=>W.create({...e,coerce:!0})};e.s(["BRAND",0,eT,"NEVER",0,g,"Schema",0,T,"ZodAny",0,Y,"ZodArray",0,er,"ZodBigInt",0,K,"ZodBoolean",0,H,"ZodBranded",0,eS,"ZodCatch",0,ex,"ZodDate",0,W,"ZodDefault",0,ek,"ZodDiscriminatedUnion",0,ea,"ZodEffects",0,e_,"ZodEnum",0,em,"ZodFirstPartyTypeKind",0,tp,"ZodFunction",0,ef,"ZodIntersection",0,es,"ZodLazy",0,ep,"ZodLiteral",0,eh,"ZodMap",0,ec,"ZodNaN",0,eE,"ZodNativeEnum",0,ev,"ZodNever",0,ee,"ZodNull",0,X,"ZodNullable",0,ew,"ZodNumber",0,V,"ZodObject",0,en,"ZodOptional",0,eb,"ZodPipeline",0,eA,"ZodPromise",0,ey,"ZodReadonly",0,eI,"ZodRecord",0,eu,"ZodSchema",0,T,"ZodSet",0,ed,"ZodString",0,B,"ZodSymbol",0,J,"ZodTransformer",0,e_,"ZodTuple",0,el,"ZodType",0,T,"ZodUndefined",0,G,"ZodUnion",0,ei,"ZodUnknown",0,Q,"ZodVoid",0,et,"any",0,eq,"array",0,eK,"bigint",0,eL,"boolean",0,eM,"coerce",0,ta,"custom",0,eP,"date",0,eZ,"datetimeRegex",0,$,"discriminatedUnion",0,eG,"effect",0,e7,"enum",0,e9,"function",0,e2,"instanceof",0,eR,"intersection",0,eX,"late",0,eC,"lazy",0,e4,"literal",0,e3,"map",0,e0,"nan",0,eD,"nativeEnum",0,e5,"never",0,eB,"null",0,ez,"nullable",0,te,"number",0,ej,"object",0,eH,"oboolean",0,to,"onumber",0,ti,"optional",0,e8,"ostring",0,tn,"pipeline",0,tr,"preprocess",0,tt,"promise",0,e6,"record",0,eQ,"set",0,e1,"strictObject",0,eW,"string",0,eN,"symbol",0,eU,"transformer",0,e7,"tuple",0,eY,"undefined",0,eF,"union",0,eJ,"unknown",0,e$,"void",0,eV],965638),e.i(965638),e.i(169790),e.s(["BRAND",0,eT,"DIRTY",0,m,"EMPTY_PATH",0,f,"INVALID",0,g,"NEVER",0,g,"OK",0,v,"ParseStatus",0,h,"Schema",0,T,"ZodAny",0,Y,"ZodArray",0,er,"ZodBigInt",0,K,"ZodBoolean",0,H,"ZodBranded",0,eS,"ZodCatch",0,ex,"ZodDate",0,W,"ZodDefault",0,ek,"ZodDiscriminatedUnion",0,ea,"ZodEffects",0,e_,"ZodEnum",0,em,"ZodError",0,a,"ZodFirstPartyTypeKind",0,tp,"ZodFunction",0,ef,"ZodIntersection",0,es,"ZodIssueCode",0,i,"ZodLazy",0,ep,"ZodLiteral",0,eh,"ZodMap",0,ec,"ZodNaN",0,eE,"ZodNativeEnum",0,ev,"ZodNever",0,ee,"ZodNull",0,X,"ZodNullable",0,ew,"ZodNumber",0,V,"ZodObject",0,en,"ZodOptional",0,eb,"ZodParsedType",0,r,"ZodPipeline",0,eA,"ZodPromise",0,ey,"ZodReadonly",0,eI,"ZodRecord",0,eu,"ZodSchema",0,T,"ZodSet",0,ed,"ZodString",0,B,"ZodSymbol",0,J,"ZodTransformer",0,e_,"ZodTuple",0,el,"ZodType",0,T,"ZodUndefined",0,G,"ZodUnion",0,ei,"ZodUnknown",0,Q,"ZodVoid",0,et,"addIssueToContext",0,p,"any",0,eq,"array",0,eK,"bigint",0,eL,"boolean",0,eM,"coerce",0,ta,"custom",0,eP,"date",0,eZ,"datetimeRegex",0,$,"defaultErrorMap",0,s,"discriminatedUnion",0,eG,"effect",0,e7,"enum",0,e9,"function",0,e2,"getErrorMap",0,c,"getParsedType",0,n,"instanceof",0,eR,"intersection",0,eX,"isAborted",0,y,"isAsync",0,w,"isDirty",0,_,"isValid",0,b,"late",0,eC,"lazy",0,e4,"literal",0,e3,"makeIssue",0,d,"map",0,e0,"nan",0,eD,"nativeEnum",0,e5,"never",0,eB,"null",0,ez,"nullable",0,te,"number",0,ej,"object",0,eH,"objectUtil",0,td,"oboolean",0,to,"onumber",0,ti,"optional",0,e8,"ostring",0,tn,"pipeline",0,tr,"preprocess",0,tt,"promise",0,e6,"quotelessJson",0,o,"record",0,eQ,"set",0,e1,"setErrorMap",0,u,"strictObject",0,eW,"string",0,eN,"symbol",0,eU,"transformer",0,e7,"tuple",0,eY,"undefined",0,eF,"union",0,eJ,"unknown",0,e$,"util",0,tc,"void",0,eV],788685);var ts,tl,tu,tc,td,tf,tp,th=e.i(788685);e.s(["z",0,th],50270);var th=th,th=th;let tg=/^[\p{L}\p{M}\s\-'.]*$/u,tm=[/<script/i,/javascript:/i,/on\w+=/i,/<iframe/i,/<object/i,/<embed/i,/data:/i,/vbscript:/i];function tv(e){return tm.some(t=>t.test(e))}function ty(e,t={}){let r,{escapeHtmlEntities:n=!0,normalizeSpaces:i=!0}=t,o=e.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,"");return o=i?o.trim().replace(/\s+/g," "):o.trim(),n&&(r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;","`":"&#x60;"},o=o.replace(/[&<>"'`/]/g,e=>r[e]||e)),o}let t_=th.string().max(100,{message:"Name must be 100 characters or less"}).refine(e=>!tv(e),{message:"Name contains potentially unsafe content"}).refine(e=>
10===e.length||tg.test(e),{message:"Name contains invalid characters"}).transform(e=>ty(e,{escapeHtmlEntities:!1})),tb=th.string().max(200,{message:"Occupation must be 200 characters or less"}).refine(e=>!tv(e),{message:"Occupation contains potentially unsafe content"}).refine(e=>0===e.length||tg.test(e),{message:"Occupation contains invalid characters"}).transform(e=>ty(e,{escapeHtmlEntities:!1})),tw=th.string().max(50,{message:"Language must be 50 characters or less"}).refine(e=>!tv(e),{message:"Language contains potentially unsafe content"}).refine(e=>0===e.length||tg.test(e),{message:"Language contains invalid characters"}).transform(e=>ty(e,{escapeHtmlEntities:!1})),tk=th.string().max(5e3,{message:"Personalization prompt must be 5000 characters or less"}).refine(e=>!tv(e),{message:"Personalization prompt contains potentially unsafe content"}).transform(e=>ty(e,{escapeHtmlEntities:!1,normalizeSpaces:!1})),tx=th.string().refine(e=>!tv(e),{message:"Vocabulary entry contains potentially unsafe content"}).transform(e=>ty(e,{escapeHtmlEntities:!1})),tE=th.object({translationEnabled:th.boolean(),translationLanguage:tw,vocabulary:th.array(tx).transform(e=>e.filter(e=>e.length>0))}),tT=th.object({name:t_,occupation:tb,preferredLanguage:tw,personalizationPrompt:tk,transcriptionSettings:tE.default({translationEnabled:!1,translationLanguage:"",vocabulary:[]})});class tS extends Error{fieldErrors;constructor(e,t){super(e),this.name="PersonalizationValidationError",this.fieldErrors=t}}function tA(e){let t=tT.safeParse(e);if(!t.success){let e={};for(let r of t.error.issues){let t=r.path[0]?.toString()??"unknown";e[t]||(e[t]=[]),e[t].push(r.message)}let r=Object.entries(e).map(([e,t])=>`${e}: ${t.join(", ")}`).join("; ");throw new tS(`Personalization settings validation failed: ${r}`,e)}return t.data}e.s(["PersonalizationValidationError",0,tS,"containsDangerousPatterns",0,tv,"sanitizeTextField",0,ty,"validatePersonalizationSettings",0,tA],736796);let tI=th.object({name:th.string().min(1,"Name is required").max(100,"Name must be less than 100 characters").refine(e=>!tv(e),{message:"Name contains potentially unsafe content"}).transform(e=>ty(e)),instructions:th.string().min(1,"Instructions are required").max(5e3,"Instructions must be less than 5000 characters").refine(e=>!tv(e),{message:"Instructions contain potentially unsafe content"}).transform(e=>ty(e,{normalizeSpaces:!1}))}),tO=tI.partial();var tP=e.i(479578);let tC=(0,tP.createModuleLogger)("api:custom-templates");e.s(["CustomTemplatesClient",0,class{client;constructor(e){this.client=e}async list(){tC.debug("Fetching custom templates");let e=await this.client.get("/api/v2/custom-templates");if(!e)throw Error("Empty response from list templates API");if("string"==typeof e)throw Error("Unexpected string response from list templates API");if(!("templates"in e))throw Error("Response missing templates field");return tC.debug({count:e.templates.length},"Templates fetched successfully"),e.templates}async create(e){tC.debug({name:e.name,instructionsPreview:e.instructions.slice(0,50)},"Creating custom template");let t=tI.parse(e),r=await this.client.post("/api/v2/custom-templates",t);if(!r)throw Error("Empty response from create template API");if("string"==typeof r)throw Error("Unexpected string response from create template API");if(!("template"in r))throw Error("Response missing template field");return tC.info({id:r.template.id,name:r.template.name},"Template created successfully"),r.template}async update(e,t){if(!e?.trim())throw Error("Template ID is required");tC.debug({id:e},"Updating custom template");let r=tO.parse(t),n=await this.client.patch(`/api/v2/custom-templates/${e}`,r);if(!n)throw Error("Empty response from update template API");if("string"==typeof n)throw Error("Unexpected string response from update template API");if(!("id"in n))throw Error("Response missing id field");return tC.info({id:e},"Template updated successfully"),n}async delete(e){if(!e?.trim())throw Error("Template ID is required");tC.debug({id:e},"Deleting custom template"),await this.client.delete(`/api/v2/custom-templates/${e}`),tC.info({id:e},"Template deleted successfully")}}],687085);var tR=e.i(247167),tN=e.i(69431);let tj=[/\.\./,/^\//,/\s{2,}/],tD=(0,tP.createModuleLogger)("PrefetchCache"),tL=null;
1function tM(){tL&&(tL.destroy(),tL=null)}e.s(["getPrefetchCache",0,function(){return!tL&&(tL=function(e={}){let t=new Map,r=new Map,n=e.ttl??3e5,i=e.cleanupInterval??6e4,o=e.maxSize??100,a=0,s=0,l=null;i>0&&(l=setInterval(()=>{let e=Date.now();for(let[r,i]of t.entries())e-i.timestamp>n&&t.delete(r)},i));let u=e=>{let r=t.get(e);return!!r&&(!(Date.now()-r.timestamp>n)||(t.delete(e),!1))},c=()=>{t.clear(),r.clear()};return{prefetch:async(e,n)=>{if(!function(e,t="Cache"){let r=function(e){if("string"!=typeof e)return{valid:!1,error:"Key must be a string"};if(!e.trim())return{valid:!1,error:"Key must not be empty"};if(e.length>256)return{valid:!1,error:"Key exceeds max length of 256"};for(let t of tj)if(t.test(e))return{valid:!1,error:`Key contains invalid pattern: ${t}`};return{valid:!0}}(e);return!!r.valid||((0,tN.isProduction)()||console.warn(`[${t}] Invalid cache key "${e}": ${r.error}`),!1)}(e,"PrefetchCache")||u(e)||r.has(e))return;let i=n().then(n=>{if(t.size>=o){let e=null,r=1/0;for(let[n,i]of t.entries())i.timestamp<r&&(r=i.timestamp,e=n);e&&t.delete(e)}t.set(e,{data:n,timestamp:Date.now()}),r.delete(e)}).catch(t=>{r.delete(e),tD.warn({key:e,err:t},"Failed to prefetch")});r.set(e,i),await i},get:e=>{let r=t.get(e);return r?Date.now()-r.timestamp>n?(t.delete(e),s++,null):(a++,r.data):(s++,null)},has:u,invalidate:e=>{t.delete(e),r.delete(e)},clear:c,destroy:()=>{l&&(clearInterval(l),l=null),c()},size:()=>t.size,getStats:()=>{let e=a+s;return{hits:a,misses:s,hitRate:e>0?a/e:0,entries:t.size,inFlightRequests:r.size}}}}(),void 0!==tR.default&&tR.default.on&&tR.default.on("beforeExit",tM)),tL}],42261),(0,tP.createModuleLogger)("ResponseCache");let tZ=(0,tP.createModuleLogger)("StorageCache");e.s(["StorageCache",0,class{static DEFAULT_TTL=3e5;static MAX_EVICTION_ATTEMPTS=5;static PREFIX="@twinmind:";static prefixKey(e){return`${this.PREFIX}${e}`}static isOurKey(e){return e.startsWith(this.PREFIX)}static save(e,t){let r=this.prefixKey(e),n={timestamp:Date.now(),data:t};try{return localStorage.setItem(r,JSON.stringify(n)),!0}catch(e){if(this.isQuotaError(e))return tZ.warn({key:r},"Quota exceeded, attempting LRU eviction"),this.saveWithEviction(r,JSON.stringify(n));return tZ.error({err:e,key:r},"Failed to save"),!1}}static isQuotaError(e){return e instanceof DOMException&&("QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name||22===e.code)}static saveWithEviction(e,t){for(let r=0;r<this.MAX_EVICTION_ATTEMPTS;r++){if(!this.evictOldest())return tZ.warn({key:e},"No cache entries to evict"),!1;try{return localStorage.setItem(e,t),tZ.info({key:e,attempts:r+1},"Saved after eviction"),!0}catch(t){if(!this.isQuotaError(t))return tZ.error({err:t,key:e},"Failed to save after eviction"),!1}}return tZ.warn({key:e},"Max eviction attempts reached"),!1}static evictOldest(){let e=null,t=1/0;try{for(let r=0;r<localStorage.length;r++){let n=localStorage.key(r);if(n&&this.isOurKey(n))try{let r=localStorage.getItem(n);if(!r)continue;let i=JSON.parse(r);"number"==typeof i?.timestamp&&i.timestamp<t&&(t=i.timestamp,e=n)}catch{}}if(e)return localStorage.removeItem(e),tZ.info({key:e},"Evicted oldest entry"),!0}catch(e){tZ.error({err:e},"Failed during eviction")}return!1}static get(e,t){let r=this.prefixKey(e);try{let n=localStorage.getItem(r);if(!n)return null;let{timestamp:i,data:o}=JSON.parse(n),a=Date.now()-i,s=t??this.DEFAULT_TTL;if(a>s)return this.invalidate(e),null;return o}catch(e){return tZ.error({err:e,key:r},"Failed to get"),null}}static invalidate(e){let t=this.prefixKey(e);try{localStorage.removeItem(t)}catch(e){tZ.error({err:e,key:t},"Failed to invalidate")}}static invalidatePattern(e){try{let t=[];for(let r=0;r<localStorage.length;r++){let n=localStorage.key(r);n&&this.isOurKey(n)&&n.includes(e)&&t.push(n)}t.forEach(e=>localStorage.removeItem(e))}catch(t){tZ.error({err:t,pattern:e},"Failed to invalidate pattern")}}static isFresh(e,t){return null!==this.get(e,t)}static getAge(e){let t=this.prefixKey(e);try{let e=localStorage.getItem(t);if(!e)return null;let{timestamp:r}=JSON.parse(e);return Date.now()-r}
1catch(e){return tZ.error({err:e,key:t},"Failed to get age"),null}}}],644804),(0,tP.createModuleLogger)("api"),(0,tP.createModuleLogger)("api:errors");let tU={id:"recommended",displayName:"TwinMind"};e.s(["DEFAULT_MODEL_CONFIG",0,{name:"auto",displayName:"Basic",minimumTier:"free",isDefault:!0},"RECOMMENDED_MODEL_SECTION",0,tU],273401);let tF={free:{rank:0,badge:null},pro:{rank:1,badge:"PRO"},max:{rank:2,badge:"MAX"}},tz=new Set(Object.keys(tF));function tq(e){return"string"==typeof e&&tz.has(e)}function t$(e,t){return tF[e].rank>=tF[t].rank}e.s(["canAccessTier",0,t$,"isKnownTier",0,tq,"resolveTierBadge",0,function(e,t){return"free"===e||t$(t,e)?null:tF[e].badge},"resolveUserTier",0,function({isPro:e,isMax:t}){return t?"max":e?"pro":"free"}],493532);let tB=(0,tP.createModuleLogger)("api:models");class tV extends Error{constructor(e){super(e),this.name="InvalidResponseError"}}function tK(e){return!!e&&"object"==typeof e&&"string"==typeof e.name&&"string"==typeof e.display_name&&tq(e.minimum_tier)}let tH="/api/v3/chat/models",tW=null,tJ=0;function tG(e,t){return{name:e.name,displayName:e.display_name,minimumTier:e.minimum_tier,isDefault:t}}async function tX(e,t){if(null!==tW&&Date.now()-tJ<3e5)return tW;let r=t?.timeout??15e3;try{let i=await e.get(tH,{timeout:r,signal:t?.signal});if(function(e){if(!e||"object"!=typeof e||!Array.isArray(e.providers)||!tK(e.default_model))return!1;for(let t of e.providers){if(!t||"object"!=typeof t||"string"!=typeof t.id||"string"!=typeof t.display_name||!Array.isArray(t.models))return!1;for(let e of t.models)if(!tK(e))return!1}return!0}(i)){var n;let e,t=(e=i.default_model.name,n=i.default_model,{sections:[{...tU,models:[tG(n,!0)]},...i.providers.map(t=>({id:t.id,displayName:t.display_name,models:t.models.map(t=>tG(t,t.name===e))}))],defaultModelName:e});return tW=t,tJ=Date.now(),tB.debug({sectionsCount:t.sections.length},"models fetched successfully"),t}throw new tV(`Invalid API response shape from ${tH}`)}catch(n){let e=function(e){if(e instanceof tV)return"invalid-response";if(e instanceof Error){let t=e.message.toLowerCase(),r=e.name.toLowerCase();if(t.includes("timeout")||r.includes("timeout")||"aborterror"===r)return"timeout";if(t.includes("fetch failed")||t.includes("network")||t.includes("econnrefused")||r.includes("network"))return"network-error"}return"api-error"}(n);tB.warn({err:n instanceof Error?n.message:String(n),endpoint:tH,timeout:r,reason:e},"models API call failed");var i=t?.onFallback,o=n instanceof Error?n:void 0;if(i)try{i(e,o)}catch(e){tB.debug({err:e instanceof Error?e.message:String(e)},"onFallback callback threw an error")}throw n}}e.s(["fetchModels",0,tX,"getCachedModels",0,function(){if(tW&&Date.now()-tJ<3e5)return tW}],508419);var tY=e.i(624709),tQ=e.i(359136);let t0=(0,tP.createModuleLogger)("api:personalization");function t1(){let e=window.location.hostname;return"app.twinmind.com"!==e&&"twinmind.com"!==e&&"localhost"!==e&&"127.0.0.1"!==e}class t2 extends Error{constructor(e){super(e),this.name="PersonalizationConfigurationError"}}class t4 extends Error{status;statusText;constructor(e,t,r){super(e),this.name="PersonalizationRequestError",this.status=t,this.statusText=r}}function t3(e){if(!e)throw new t2("A signed-in user is required to load personalization settings.");return e}let t9=(e,t)=>{if(t1())return(0,tY.createApiClient)({getBaseUrl:()=>"",getToken:()=>e.getIdToken(),fetchImpl:t?.fetchImpl});let r=(e=>{let t=e??(void 0!==tR.default?"https://api.twinmind.com":void 0),r=t?.trim();if(!r||"undefined"===r||"null"===r)throw new t2("NEXT_PUBLIC_BACKEND_API_URL must be configured to call personalization APIs.");return r})(t?.baseUrl);return(0,tY.createApiClient)({getBaseUrl:()=>r,getToken:()=>e.getIdToken(),fetchImpl:t?.fetchImpl})},t5=()=>t1()?"/api/personalize":"/api/v2/personalization",t6=async(e,t)=>{let r=t9(t3(e),t),n=t5();try{let e=await r.get(n,{signal:t?.signal});return t0.debug({endpoint:n,useProxy:t1()},"personalization settings fetched"),(e=>{if(!e?.data)return{name:"",occupation:"",preferredLanguage:"English",personalizationPrompt:"",transcriptionSettings:{translationEnabled:!1,translationLanguage:"",vocabulary:[]}};let{name:t,occupation:r,preferred_language:n,user_preferences:i,transcription_settings:o}=e.data;return{name:t??"",occupation:r??"",preferredLanguage:n??"English",personalizationPrompt:i?.personalization_prompt??"",transcriptionSettings:{translationEnabled:o?.translation_enabled??!1,translationLanguage:o?.translation_language??"",vocabulary:Array.isArray(o?.vocabulary)?o.vocabulary:[]}}})(e)}catch(e){if(e instanceof tQ.ApiRequestError)throw t0.warn({endpoint:n,status:e.status,statusText:e.statusText},"failed to fetch personalization settings"),new t4(`Failed to fetch personalization settings (${e.status} ${e.statusText}).`,e.status,e.statusText);throw t0.error({endpoint:n,err:e instanceof Error?e.message:String(e)},"unexpected error fetching personalization settings"),e}},t7=async(e,t,r)=>{let n,i=t3(e);try{n=tA(t),t0.debug("personalization settings validated successfully")}catch(e){throw e instanceof tS&&t0.warn({fieldErrors:e.fieldErrors},"personalization settings validation failed"),e}let o=t9(i,r),a=t5();try{let e;await o.put(a,{name:(e=n).name,occupation:e.occupation,preferred_language:e.preferredLanguage,user_preferences:{personalization_prompt:e.personalizationPrompt},transcription_settings:{translation_enabled:e.transcriptionSettings.translationEnabled,translation_language:e.transcriptionSettings.translationLanguage,vocabulary:e.transcriptionSettings.vocabulary}},{signal:r?.signal}),t0.debug({endpoint:a,useProxy:t1()},"personalization settings updated")}catch(e){if(e instanceof tQ.ApiRequestError)throw t0.warn({endpoint:a,status:e.status,statusText:e.statusText},"failed to update personalization settings"),new t4(`Failed to update personalization settings (${e.status} ${e.statusText}).`,e.status,e.statusText);throw t0.error({endpoint:a,err:e instanceof Error?e.message:String(e)},"unexpected error updating personalization settings"),e}};e.s(["fetchPersonalizationSettings",0,t6,"updatePersonalizationSettings",0,t7],539752),e.i(394451),e.i(357477),e.i(527671),e.s([],566912);let t8=(0,tP.createModuleLogger)("api:transcription"),re="/api/py/audio/transcribe";
1class rt extends Error{constructor(e){super(e),this.name="TranscriptionConfigurationError"}}class rr extends Error{status;statusText;constructor(e,t,r){super(e),this.name="TranscriptionRequestError",this.status=t,this.statusText=r}}async function rn(e,t){let r,n=function(e){let t=e??(void 0!==tR.default?"https://api.twinmind.com":void 0),r=t?.trim();if(!r||"undefined"===r||"null"===r)throw new rt("NEXT_PUBLIC_BACKEND_API_URL must be configured to call transcription APIs.");return r}(t?.baseUrl),i=t?.fetchImpl??fetch,o=t?.timeout??6e4;t?.getToken&&(r=await t.getToken());let a=new FormData,s=e.type||"audio/webm",l=s.includes("webm")?"webm":s.includes("mp4")||s.includes("m4a")?"m4a":s.includes("mp3")||s.includes("mpeg")?"mp3":s.includes("wav")?"wav":s.includes("ogg")?"ogg":"webm";a.append("file",e,`audio.${l}`);let u=null,c=null,d=t?.signal;o>0&&(c=new AbortController,d&&d.addEventListener("abort",()=>c?.abort(),{once:!0}),d=c.signal,u=setTimeout(()=>c?.abort(),o));try{let t=`${n}${re}`;t8.debug({endpoint:re,mimeType:s,blobSize:e.size},"Sending audio for transcription");let o={};r&&(o.Authorization=`Bearer ${r}`);let l=await i(t,{method:"POST",body:a,signal:d,headers:o});if(!l.ok)throw t8.warn({status:l.status,statusText:l.statusText},"Transcription request failed"),new rr(`Transcription failed: ${l.status} ${l.statusText}`,l.status,l.statusText);let u=await l.json();if("success"===u.status&&u.text){let e=u.text.trim();return t8.debug({textLength:e.length},"Transcription successful"),e||null}return t8.warn({result:u},"Unexpected transcription response format"),null}catch(e){if(e instanceof DOMException&&"AbortError"===e.name){let e=c?.signal.aborted,t=e?`Transcription timeout after ${o}ms`:"Transcription aborted";return t8.warn({timeout:o,isTimeout:e},t),null}if(e instanceof rr||e instanceof rt)throw e;return t8.error({err:e instanceof Error?e.message:String(e)},"Transcription failed"),null}finally{u&&clearTimeout(u)}}e.s(["transcribeAudio",0,rn],64243);let ri=(0,tP.createModuleLogger)("api:annual-recap"),ro="/api/v2/annual-recap/share";class ra extends Error{constructor(e){super(e),this.name="AnnualRecapConfigurationError"}}class rs extends Error{status;statusText;constructor(e,t,r){super(e),this.name="AnnualRecapRequestError",this.status=t,this.statusText=r}}let rl=e=>{let t=e??(void 0!==tR.default?"https://api.twinmind.com":void 0),r=t?.trim();if(!r||"undefined"===r||"null"===r)throw new ra("NEXT_PUBLIC_BACKEND_API_URL must be configured to call annual recap APIs.");return r};function ru(e){if(!e)throw new ra("A signed-in user is required to access annual recap data.");return e}let rc=(e,t)=>{let r=rl(t?.baseUrl);return(0,tY.createApiClient)({getBaseUrl:()=>r,getToken:()=>e.getIdToken(),fetchImpl:t?.fetchImpl})},rd=e=>({status:"not_found",year:e,name:"",available:!1,is_shared:!1,is_owner:!1,pages:[]}),rf=async(e,t,r)=>{let n=rc(ru(e),r),i=`/api/v2/annual-recap?year=${t}&pages=true`;try{let e=await n.get(i,{signal:r?.signal});if(ri.debug({year:t,endpoint:i},"annual recap fetched"),null===e)return rd(t);return e}catch(e){if(e instanceof tQ.ApiRequestError){if(404===e.status)return ri.debug({year:t},"annual recap not found"),rd(t);throw ri.warn({endpoint:i,status:e.status,statusText:e.statusText},"failed to fetch annual recap"),new rs(`Failed to fetch annual recap (${e.status} ${e.statusText}).`,e.status,e.statusText)}throw ri.error({endpoint:i,err:e instanceof Error?e.message:String(e)},"unexpected error fetching annual recap"),e}},rp=async(e,t)=>{let r=rl(t?.baseUrl),n=`/api/v2/annual-recap/view/${e}?pages=true`,i=`${r}${n}`;try{let r=t?.fetchImpl??fetch,o=await r(i,{method:"GET",headers:{"Content-Type":"application/json"},signal:t?.signal});if(!o.ok){if(404===o.status)throw ri.debug({shareId:e},"shared recap not found"),new rs("This shared recap was not found or is no longer available.",404,"Not Found");throw new rs(`Failed to fetch shared recap (${o.status} ${o.statusText}).`,o.status,o.statusText)}let a=await o.json();return ri.debug({shareId:e,endpoint:n},"shared recap fetched"),a}catch(e){if(e instanceof rs)throw e;throw ri.error({endpoint:n,err:e instanceof Error?e.message:String(e)},"unexpected error fetching shared recap"),e}},rh=async(e,t,r)=>{let n=rc(ru(e),r);try{let e=await n.post(ro,{year:t},{signal:r?.signal});if(ri.debug({year:t},"annual recap sharing enabled"),null===e)throw new rs("Empty response from share API");return e}catch(e){if(e instanceof tQ.ApiRequestError)throw ri.warn({endpoint:ro,status:e.status,statusText:e.statusText},"failed to enable recap sharing"),new rs(`Failed to enable sharing (${e.status} ${e.statusText}).`,e.status,e.statusText);if(e instanceof rs)throw e;throw ri.error({endpoint:ro,err:e instanceof Error?e.message:String(e)},"unexpected error enabling recap sharing"),e}},rg=async(e,t,r)=>{let n=rc(ru(e),r),i=`${ro}?year=${t}`;try{let e=await n.delete(i,{signal:r?.signal});if(ri.debug({year:t},"annual recap sharing disabled"),null===e)return{success:!0,message:"Sharing disabled",year:t};return e}catch(e){if(e instanceof tQ.ApiRequestError)throw ri.warn({endpoint:i,status:e.status,statusText:e.statusText},"failed to disable recap sharing"),new rs(`Failed to disable sharing (${e.status} ${e.statusText}).`,e.status,e.statusText);throw ri.error({endpoint:i,err:e instanceof Error?e.message:String(e)},"unexpected error disabling recap sharing"),e}};
1e.s(["disableRecapSharing",0,rg,"enableRecapSharing",0,rh,"fetchAnnualRecap",0,rf,"fetchSharedRecap",0,rp],950542),e.s([],66563)},290571,e=>{"use strict";var t=function(e,r){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,r)},r=function(){return(r=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"==typeof SuppressedError&&SuppressedError,e.s(["__assign",()=>r,"__awaiter",0,function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}l((n=n.apply(e,t||[])).next())})},"__extends",0,function(e,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)},"__generator",0,function(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){var u=[s,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},"__read",0,function(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},"__rest",0,function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},"__spreadArray",0,function(e,t,r){if(r||2==arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},"__values",0,function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}])},977981,304230,135382,e=>{"use strict";var t,r,n,i,o,a,s,l,u,c,d,f,p,h,g,m,v,y,_,b,w,k,x,E,T,S=e.i(247167),A=e.i(290571);(t=p||(p={}))[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose",t[t.Debug=4]="Debug";var I=function(e){return void 0===e&&(e=0),(Error().stack||"").split("\n").slice(2+e).map(function(e){return e.trim()})},O=function(e){return function(){var t=(0,A.__assign)({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},P=function(e,t){var r,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=(0,A.__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},C=function(e,t){return function(){var r,n,i={};try{for(var o=(0,A.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;i[s]=P(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}},R=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(),l=s.logger,u=s.logLevel;if(u&&u<p.Debug||!u||!l)return e.apply(i,o);var c={type:"invoke public method",name:t,args:o,stacktrace:I(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()),l.debug(JSON.stringify(c,null,2))}):(n&&c.states&&(c.states.after=n()),c.time&&(c.time.end=new Date().toISOString()),l.debug(JSON.stringify(c,null,2))),d}};(r=h||(h={})).SET="$set",r.SET_ONCE="$setOnce",r.ADD="$add",r.APPEND="$append",r.PREPEND="$prepend",r.REMOVE="$remove",r.PREINSERT="$preInsert",r.POSTINSERT="$postInsert",r.UNSET="$unset",r.CLEAR_ALL="$clearAll",(n=g||(g={})).IDENTIFY="$identify",n.GROUP_IDENTIFY="$groupidentify",n.REVENUE="revenue_amount";var N="".concat("AMP","_unsent"),j="$default_instance",D="https://api2.amplitude.com/2/httpapi",L="dclid",M="fbclid",Z="gbraid",U="gclid",F="ko_click_id",z="li_fat_id",q="msclkid",$="rdt_cid",B="ttclid",V="twclid",K="wbraid",H={utm_campaign:void 0,utm_c
1ontent: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},W=["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"],J=["authorization","cookie","set-cookie"],G=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var r=e[t];if(!X(t,r))return!1}return!0},X=function(e,t){var r,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=(0,A.__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&&G(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 G(t);else if(!["number","string","boolean"].includes(typeof t))return!1;return!0},Y=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return(0,A.__assign)({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(m.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(m.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(m.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(m.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(m.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(m.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(m.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(m.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(m.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[m.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[m.CLEAR_ALL]||this._propertySet.has(t))&&(e===m.ADD?"number"==typeof r:e===m.UNSET||e===m.REMOVE||X(t,r))},e}();(i=m||(m={})).SET="$set",i.SET_ONCE="$setOnce",i.ADD="$add",i.APPEND="$append",i.PREPEND="$prepend",i.REMOVE="$remove",i.PREINSERT="$preInsert",i.POSTINSERT="$postInsert",i.UNSET="$unset",i.CLEAR_ALL="$clearAll";var Q=[m.CLEAR_ALL,m.UNSET,m.SET,m.SET_ONCE,m.ADD,m.APPEND,m.PREPEND,m.PREINSERT,m.POSTINSERT,m.REMOVE];(o=v||(v={})).Unknown="unknown",o.Skipped="skipped",o.Success="success",o.RateLimit="rate_limit",o.PayloadTooLarge="payload_too_large",o.Invalid="invalid",o.Failed="failed",o.Timeout="Timeout",o.SystemError="SystemError";var ee=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=v.Unknown),{event:e,code:t,message:r}},et=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},er=(0,A.__spreadArray)([],(0,A.__read)(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),en=function(e){var t,r=et();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,en);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,(0,A.__spreadArray)([],(0,A.__read)(n.entries()),!1).map(function(e){var t=(0,A.__read)(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(er[n]):er[n]}).join("")},ei=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){var r,n;return(0,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__generator)(this,function(i){switch(i.label){case 0:if(this.plugins.some(function(t){return t.name===e.name}))return this.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2];return void 0===e.name&&(e.name=en(),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."))),e.type=null!=(r=e.type)?r:"enrichment",[4,null==(n=e.setup)?void 0:n.call(e,t,this.client)];case 1:return i.sent(),this.plugins.push(e),[2]}})})},e.prototype.deregister=function(e,t){var r;return(0,A.__awaiter)(this,void 0,void 0,function(){var n,i;return(0,A.__generator)(this,function(o){switch(o.label){case 0:if(-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.applying=!1,this.plugins.map(function(e){var t;return null==(t=e.teardown)?void 0:t.call(e)}),this.plugins=[],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,A.__awaiter)(this,void 0,void 0,function(){var t,r,n,i,o,a,s,l,u,c,d,f,p,h,g;return(0,A.__generator)(this,function(m){switch(m.label){case 0:if(!e)return[2];t=(0,A.__read)(e,1)[0],r=(0,A.__read)(e,2)[1],this.loggerProvider.log("Timeline.apply: Initial event",t),n=this.plugins.filter(function(e){return"before"===e.type}),m.label=1;case 1:m.trys.push([1,6,7,8]),o=(i=(0,A.__values)(n)).next(),m.label=2;case 2:if(o.done)return[3,5];if(!(a=o.value).execute)return[3,4];return[4,a.execute((0,A.__assign)({},t))];case 3:if(null===(s=m.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))),m.label=4;case 4:return o=i.next(),[3,2];case 5:return[3,8];case 6:return f={error:m.sent()},[3,8];
1case 7:try{o&&!o.done&&(p=i.return)&&p.call(i)}finally{if(f)throw f.error}return[7];case 8:l=this.plugins.filter(function(e){return"enrichment"===e.type||void 0===e.type}),m.label=9;case 9:m.trys.push([9,14,15,16]),c=(u=(0,A.__values)(l)).next(),m.label=10;case 10:if(c.done)return[3,13];if(!(a=c.value).execute)return[3,12];return[4,a.execute((0,A.__assign)({},t))];case 11:if(null===(s=m.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))),m.label=12;case 12:return c=u.next(),[3,10];case 13:return[3,16];case 14:return h={error:m.sent()},[3,16];case 15:try{c&&!c.done&&(g=u.return)&&g.call(u)}finally{if(h)throw h.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,A.__assign)({},t);return e.execute(r).catch(function(e){return ee(r,0,String(e))})})).then(function(e){var n=(0,A.__read)(e,1)[0]||ee(t,100,"Event not tracked, no destination plugins on the instance");r(n)}),[2]}})})},e.prototype.flush=function(){return(0,A.__awaiter)(this,void 0,void 0,function(){var e,t=this;return(0,A.__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.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)})},e.prototype.onReset=function(){this.plugins.forEach(function(e){var t;null==(t=e.onReset)||t.call(e)})},e}(),eo=function(e,t){return(0,A.__assign)((0,A.__assign)({},t),{event_type:g.IDENTIFY,user_properties:e.getUserProperties()})},ea=function(e,t,r,n){var i;return(0,A.__assign)((0,A.__assign)({},n),{event_type:g.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:((i={})[e]=t,i)})},es=function(e,t,r){var n,i=new Y;return i.set(e,t),(0,A.__assign)((0,A.__assign)({},r),{event_type:g.IDENTIFY,user_properties:i.getUserProperties(),groups:((n={})[e]=t,n)})},el=function(e){return{promise:e||Promise.resolve()}},eu=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 ei(this),this.name=e}return e.prototype._init=function(e){return(0,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__generator)(this,function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(e){return(0,A.__awaiter)(this,void 0,void 0,function(){var t,r,n,i,o,a;return(0,A.__generator)(this,function(s){switch(s.label){case 0:t=this[e],this[e]=[],s.label=1;case 1:s.trys.push([1,8,9,10]),n=(r=(0,A.__values)(t)).next(),s.label=2;case 2:if(n.done)return[3,7];if(!((i=(0,n.value)())&&"promise"in i))return[3,4];return[4,i.promise];case 3:return s.sent(),[3,6];case 4:return[4,i];case 5:s.sent(),s.label=6;case 6:return n=r.next(),[3,2];case 7:return[3,10];case 8:return o={error:s.sent()},[3,10];case 9:try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}return[7];case 10:if(!this[e].length)return[3,12];return[4,this.runQueuedFunctions(e)];case 11:s.sent(),s.label=12;case 12:return[2]}})})},e.prototype.track=function(e,t,r){var n=(0,A.__assign)((0,A.__assign)((0,A.__assign)({},"string"==typeof e?{event_type:e}:e),r),t&&{event_properties:t});return el(this.dispatch(n))},e.prototype.identify=function(e,t){var r=eo(e,t);return el(this.dispatch(r))},e.prototype.groupIdentify=function(e,t,r,n){var i=ea(e,t,r,n);return el(this.dispatch(i))},e.prototype.setGroup=function(e,t,r){var n=es(e,t,r);return el(this.dispatch(n))},e.prototype.revenue=function(e,t){var r=(0,A.__assign)((0,A.__assign)({},t),{event_type:g.REVENUE,event_properties:e.getEventProperties()});return el(this.dispatch(r))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),el())},e.prototype._addPlugin=function(e){return el(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)),el())},e.prototype._removePlugin=function(e){return el(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(ee(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return(0,A.__awaiter)(this,void 0,void 0,function(){var t=this;return(0,A.__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={};if(void 0===e)return t;var r={};return Object.keys(e).forEach(function(t){Object.values(h).includes(t)||(r[t]=e[t])}),Q.forEach(function(r){if(Object.keys(e).includes(r)){var n=e[r];switch(r){case h.CLEAR_ALL:Object.keys(t).forEach(function(e){delete t[e]});break;
1case h.UNSET:Object.keys(n).forEach(function(e){delete t[e]});break;case h.SET:Object.assign(t,n)}}}),Object.assign(t,r),t},e.prototype.process=function(e){return(0,A.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,A.__generator)(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),this.config.optOut)return[2,ee(e,0,"Event skipped due to optOut config")];return e.event_type===g.IDENTIFY&&(t=this.getOperationAppliedUserProperties(e.user_properties),this.timeline.onIdentityChanged({userProperties:t})),[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=ee(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.timeline.onOptOutChanged(e),this.config.optOut=!!e)},e.prototype.flush=function(){return el(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}(),ec=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},[])},ed="Amplitude Logger ",ef=function(){function e(){this.logLevel=p.None}return e.prototype.disable=function(){this.logLevel=p.None},e.prototype.enable=function(e){void 0===e&&(e=p.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.Verbose||console.log("".concat(ed,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.Warn||console.warn("".concat(ed,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.Error||console.error("".concat(ed,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<p.Debug||console.log("".concat(ed,"[Debug]: ").concat(e.join(" ")))},e}(),ep=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:j,logLevel:p.Warn,loggerProvider:new ef,offline:!1,optOut:!1,serverUrl:D,serverZone:"US",useBatch:!1}},eh=function(){function e(e){this._optOut=!1;var t,r,n,i,o=ep();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=eg(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},enumerable:!1,configurable:!0}),e}(),eg=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=ep().serverZone),void 0===r&&(r=ep().useBatch),e)return{serverUrl:e,serverZone:void 0};var n,i=["US","EU"].includes(t)?t:ep().serverZone;return{serverZone:i,serverUrl:(n=r,"EU"===i?n?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":n?"https://api2.amplitude.com/batch":
1D)}},em=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function ev(e){return e>=200&&e<300}function ey(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var e_=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,A.__awaiter)(this,void 0,void 0,function(){var r,n=this;return(0,A.__generator)(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(N,"_").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=en()),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,A.__awaiter)(this,void 0,void 0,function(){var t,r,n=this;return(0,A.__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,ec(t,this.config.flushQueueSize).reduce(function(t,r){return(0,A.__awaiter)(n,void 0,void 0,function(){return(0,A.__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,A.__awaiter)(this,void 0,void 0,function(){var n,i,o,a;return(0,A.__generator)(this,function(s){switch(s.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,A.__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 em,s.label=1;case 1:return s.trys.push([1,3,,4]),i=eg(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,n)];case 2:if(null===(o=s.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t)return"body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(ey(o))):this.fulfillRequest(e,o.statusCode,o.status),[2];return this.handleResponse(o,e),[3,4];case 3:var l;return a=(l=s.sent())instanceof Error?l.message:String(l),this.config.loggerProvider.error(a),null==(r=this.diagnosticsClient)||r.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:a,stack_trace:I()}),this.handleResponse({status:v.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(e,t){ev(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:ey(e),stack_trace:I()});var r,n=e.status;switch(n){case v.Success:this.handleSuccessResponse(e,t);break;case v.Invalid:this.handleInvalidResponse(e,t);break;case v.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case v.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,A.__spreadArray)((0,A.__spreadArray)((0,A.__spreadArray)((0,A.__spreadArray)([],(0,A.__read)(Object.values(e.body.eventsWithInvalidFields)),!1),(0,A.__read)(Object.values(e.body.eventsWithMissingFields)),!1),(0,A.__read)(Object.values(e.body.eventsWithInvalidIdLengths)),!1),(0,A.__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(ey(e));
1var 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(ey(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),l=new Set(o),u=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):(l.has(n)&&(t.timeout=r.throttleTimeout),!0)});u.length>0&&this.config.loggerProvider.warn(ey(e));var c=this.removeEventsExceedFlushMaxRetries(u);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;ev(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:I()})),this.removeEvents(e),e.forEach(function(e){return e.callback(ee(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}(),eb=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){return G(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?(0,A.__assign)({},this.properties):{};return e[y.REVENUE_PRODUCT_ID]=this.productId,e[y.REVENUE_QUANTITY]=this.quantity,e[y.REVENUE_PRICE]=this.price,e[y.REVENUE_TYPE]=this.revenueType,e[y.REVENUE_CURRENCY]=this.currency,e[y.REVENUE]=this.revenue,e[y.RECEIPT]=this.receipt,e[y.RECEIPT_SIG]=this.receiptSig,e},e}();(a=y||(y={})).REVENUE_PRODUCT_ID="$productId",a.REVENUE_QUANTITY="$quantity",a.REVENUE_PRICE="$price",a.REVENUE_TYPE="$revenueType",a.REVENUE_CURRENCY="$currency",a.REVENUE="$revenue",a.RECEIPT="$receipt",a.RECEIPT_SIG="$receiptSig";var ew=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:ek(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),ek=function(){return"u">typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},ex=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}(),eE=function(){return(eE=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 eT(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);
1if(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 eS(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 eA=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=eT(["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),l=Array.isArray(t);if(s!==l)return!1;if(s&&l){for(var u=0;u<e.length;u++)if(!eA(e[u],t[u]))return!1}else{if(!eA(Object.keys(e).sort(),Object.keys(t).sort()))return!1;var c=!0;return Object.keys(e).forEach(function(r){eA(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 eI=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=eE({},this.identity.userProperties),r=eE(eE({},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,l=r.userProperties||{};try{for(var u=eT(Object.entries(e)),c=u.next();!c.done;c=u.next()){var d=eS(c.value,2),f=d[0],p=d[1];switch(f){case"$set":try{for(var h=(i=void 0,eT(Object.entries(p))),g=h.next();!g.done;g=h.next()){var m=eS(g.value,2),v=m[0],y=m[1];l[v]=y}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}break;case"$unset":try{for(var _=(a=void 0,eT(Object.keys(p))),b=_.next();!b.done;b=_.next()){var v=b.value;delete l[v]}}catch(e){a={error:e}}finally{try{b&&!b.done&&(s=_.return)&&s.call(_)}finally{if(a)throw a.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return eE({},this.identity)},e.prototype.setIdentity=function(e){var t=eE({},this.identity);this.identity=eE({},e),eA(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}(),eO="u">typeof globalThis?globalThis:e.g,eP=function(){function e(){this.identityStore=new eI,this.eventBridge=new ex,this.applicationContextProvider=new ew}return e.getInstance=function(t){return eO.analyticsConnectorInstances||(eO.analyticsConnectorInstances={}),eO.analyticsConnectorInstances[t]||(eO.analyticsConnectorInstances[t]=new e),eO.analyticsConnectorInstances[t]},e}();e.s(["AnalyticsConnector",0,eP],304230);var eC=function(e){return void 0===e&&(e=j),eP.getInstance(e)},eR=function(e,t){eC(t).identityStore.editIdentity().setUserId(e).commit()},eN=function(e,t){eC(t).identityStore.editIdentity().setDeviceId(e).commit()},ej=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},eD=function(){function e(){this.name="identity",this.type="before",this.identityStore=eC().identityStore}return e.prototype.execute=function(e){return(0,A.__awaiter)(this,void 0,void 0,function(){var t;return(0,A.__generator)(this,function(r){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return(0,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__generator)(this,function(t){return e.instanceName&&(this.identityStore=eC(e.instanceName).identityStore),[2]})})},e}(),eL=function(){var e,t=et();return(null==(e=null==t?void 0:t.location)?void 0:e.search)?t.location.search.substring(1).split("&").filter(
1Boolean).reduce(function(e,t){var r=t.split("=",2),n=eM(r[0]),i=eM(r[1]);return i&&(e[n]=i),e},{}):{}},eM=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},eZ=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}(),eU=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,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 eZ(e,t)}return e.prototype.subscribe=function(e,t,r){var n=en(),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,A.__awaiter)(this,void 0,void 0,function(){var e,t=this;return(0,A.__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.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,A.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,A.__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
1allback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return(0,A.__awaiter)(this,void 0,void 0,function(){var r,n;return(0,A.__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,A.__awaiter)(this,void 0,void 0,function(){var r,n,i,o,a,s,l=this;return(0,A.__generator)(this,function(u){switch(u.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},i=function(n){var i,a,s,u,c;return(0,A.__generator)(this,function(d){switch(d.label){case 0:i=new AbortController,a=setTimeout(function(){return i.abort()},t),d.label=1;case 1:return d.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:i.signal})];case 2:if((s=d.sent()).ok)return[3,4];return[4,s.text()];case 3:return u=d.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(s.status,": ").concat(u)),[3,6];case 4:return[4,s.json()];case 5:return[2,{value:{remoteConfig:d.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(c=d.sent())instanceof Error&&"AbortError"===c.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: "),c),[3,9];case 8:return clearTimeout(a),[7];case 9:if(!(n<e-1))return[3,11];return[4,new Promise(function(e){return setTimeout(e,l.getJitterDelay(r))})];case 10:d.sent(),d.label=11;case 11:return[2]}})},o=this,a=0,u.label=1;case 1:if(!(a<e))return[3,4];return[5,i(a)];case 2:if("object"==typeof(s=u.sent()))return[2,s.value];u.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}(),eF="tags",ez="counters",eq="histograms",e$="events",eB="internal",eV="last_flush_timestamp",eK=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=et())?void 0:e.indexedDB)!==void 0},e.prototype.getDB=function(){return(0,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__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(t){var r=t.target.result;e.createTables(r)}})},e.prototype.createTables=function(e){e.objectStoreNames.contains(eF)||e.createObjectStore(eF,{keyPath:"key"}),e.objectStoreNames.contains(ez)||e.createObjectStore(ez,{keyPath:"key"}),e.objectStoreNames.contains(eq)||e.createObjectStore(eq,{keyPath:"key"}),e.objectStoreNames.contains(e$)||e.createObjectStore(e$,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1}),e.objectStoreNames.contains(eB)||e.createObjectStore(eB,{keyPath:"key"})},e.prototype.setTags=function(e){return(0,A.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,A.__generator)(this,function(o){switch(o.label){case 0:if(o.tr
1ys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return r=(t=o.sent().transaction([eF],"readwrite")).objectStore(eF),[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,A.__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,A.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,A.__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([ez],"readwrite")).objectStore(ez),[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,A.__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,A.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,A.__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([eq],"readwrite")).objectStore(eq),[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,A.__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,A.__awaiter)(this,void 0,void 0,function(){var t,r,n,i=this;return(0,A.__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([e$],"readwrite")).objectStore(e$),[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,A.__awaiter)(this,void 0,void 0,function(){var r,n,i;return(0,A.__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([eB],"readwrite")).objectStore(eB),[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,A.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,A.__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([eB],"readonly")).objectStore(eB),[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,A.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,A.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getInternal(eV)];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,A.__awaiter)(this,void 0,void 0,function(){var t;return(0,A.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.setInternal(eV,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,A.__awaiter)(this,void 0,void 0,function(){var e,t,r,n,i,o,a;return(0,A.__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([eF,ez,eq,e$],"readwrite"),[4,Promise.all([this.getAllFromStore(e,eF),this.getAllFromStore(e,ez),this.getAllFromStore(e,eq),this.getAllFromStore(e,e$)])];case 2:return r=(t=A.__read.apply(void 0,[s.sent(),4]))[0],n=t[1],i=t[2],o=t[3],[4,Promise.all([this.clearTable(e,ez),this.clearTable(e,eq),this.clearTable(e,e$)])];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}(),eH=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}
1,eW=function(e,t){return 31*Math.abs(eH(e.toString()))%1e5/1e5<t},eJ=function(){var e=et();return null==e?void 0:e.__AMPLITUDE_SCRIPT_URL__},eG=function(e){var t=et();if(t&&"function"==typeof t.addEventListener){var r=function(t){e.recordEvent("sdk.error.uncaught",(0,A.__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=eX({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=eY(i),a=eX({filename:o,stack:i});a&&r({type:"unhandledrejection",message:null!=(t=null==n?void 0:n.message)?t:eQ(e.reason),stack:i,filename:o,errorName:null==n?void 0:n.name,metadata:{isTrusted:e.isTrusted,matchReason:a}})},!0)}},eX=function(e){var t=eJ();if(t){if(e.filename&&e.filename.includes(t))return"filename";if(e.stack&&e.stack.includes(t))return"stack"}},eY=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},eQ=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},e0=function(){function e(e,t,r,n){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,A.__assign)({enabled:!0,sampleRate:0},n),this.startTimestamp=Date.now(),this.shouldTrack=eW(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,eK.isSupported()?this.storage=new eK(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),eG(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,A.__awaiter)(this,void 0,void 0,function(){var e,t,r,n;return(0,A.__generator)(this,function(i){switch(i.label){case 0:if(!this.storage)return[2];return e=(0,A.__assign)({},this.inMemoryTags),t=(0,A.__assign)({},this.inMemoryCounters),r=(0,A.__assign)({},this.inMemoryHistograms),n=(0,A.__spreadArray)([],(0,A.__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,A.__awaiter)(this,void 0,void 0,function(){var e,t,r,n,i,o,a,s,l,u;return(0,A.__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={}
1,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}}),l=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===l.length)return[2];return u={tags:o,histogram:s,counters:a,events:l},this.fetch(u),[2]}})})},e.prototype.fetch=function(e){return(0,A.__awaiter)(this,void 0,void 0,function(){var t;return(0,A.__generator)(this,function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!et())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,A.__awaiter)(this,void 0,void 0,function(){var e,t,r;return(0,A.__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=eW(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),e1=function(e,t){return"boolean"==typeof e?e:(null==e?void 0:e[t])!==!1},e2=function(e){return e1(e,"attribution")},e4=function(e){return e1(e,"formInteractions")},e3=function(e){return e1(e,"pageViews")},e9=function(e){return e1(e,"sessions")},e5=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},e6=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},e7=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},e8=function(e){if(e6(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},te=function(e){if(e7(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},tt=function(e){var t;if(e5(e.autocapture)){var r=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?r=e.autocapture.networkTracking:e.networkTrackingOptions&&(r=e.networkTrackingOptions),(0,A.__assign)((0,A.__assign)({},r),{captureRules:null==(t=null==r?void 0:r.captureRules)?void 0:t.map(function(t){var r,n,i;if((null==(r=t.urls)?void 0:r.length)&&(null==(n=t.hosts)?void 0:n.length)){var o=JSON.stringify(t.hosts),a=JSON.stringify(t.urls);return null==(i=e.loggerProvider)||i.warn("Found network capture rule with both urls='".concat(a,"' and hosts='").concat(o,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),(0,A.__assign)((0,A.__assign)({},t),{hosts:void 0})}return t})})}},tr=function(e){var t,r=function(){return!1},n=void 0,i=e.pageCounter;return e3(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}},tn=function(e){if(e4(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions},ti=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 l=s.apply(e,o);"function"==typeof a&&a(null==l?void 0:l.promise)}}return e},to=function(e){return e&&void 0!==e._q},ta=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:""},ts="2.34.0",tl="amplitude-ts",tu=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(tl,"/").concat(ts),"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,A.__awaiter)(this,void 0,void 0,function(){var n,i,o;return(0,A.__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,A.__assign)((0,A.__assign)((0,A.__assign)((0,A.__assign)((0,A.__assign)((0,A.__assign)((0,A.__assign)((0,A.__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:ta()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:en(),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}(),tc=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return(0,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__generator)(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return(0,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__generator)(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return(0,A.__awaiter)(this,void 0,void 0,function(){var t;return(0,A.__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,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__generator)(this,function(r){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return(0,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__generator)(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return(0,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__generator)(this,function(e){return this.memoryStorage.clear(),[2]})})},e}(),td=function(){function e(e,t){void 0===t&&(t={}),this.options=(0,A.__assign)({},e),this.config=t}return e.prototype.isEnabled=function(){return(0,A.__awaiter)(this,void 0,void 0,function(){var t,r;return(0,A.__generator)(this,function(n){switch(n.label){case 0:if(!et())return[2,!1];e.testValue=String(Date.now()),t=new e((0,A.__assign)((0,A.__assign)({},this.options),{expirationDays:.003})),r="AMP_TEST_".concat(en().substring(0,8)),n.label=1;case 1:return n.trys.push([1,4,5,7]),[4,t.set(r,e.testValue)];case 2:return n.sent(),[4,t.get(r)];case 3:return[2,n.sent()===e.testValue];case 4:return n.sent(),[2,!1];case 5:return[4,t.remove(r)];case 6:return n.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return(0,A.__awaiter)(this,void 0,void 0,function(){var t,r;return(0,A.__generator)(this,function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:if(!(t=n.sent()))return[2,void 0];try{if(r=th(t),void 0===r)return console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t)),[2,void 0];return[2,JSON.parse(r)]}catch(r){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t)),[2,void 0]}}})})},e.prototype.getRaw=function(e){var t,r,n,i;return(0,A.__awaiter)(this,void 0,void 0,function(){var o,a,s,l,u,c,d,f,p,h,g,m,v=this;return(0,A.__generator)(this,function(y){switch(y.label){case 0:a=o=et(),y.label=1;case 1:if(y.trys.push([1,4,,5]),!(s=null==a?void 0:a.cookieStore))return[3,3];return[4,s.getAll(e)];case 2:if(l=y.sent()){l.length>1&&(null==(t=this.config.diagnosticsClient)||t.recordEvent("cookies.duplicate",{cookies:l.map(function(e){return e.domain})}),null==(r=this.config.diagnosticsClient)||r.increment("cookies.duplicate.occurrence.cookieStore"));try{for(c=(u=(0,A.__values)(l)).next();!c.done;c=u.next())if(d=c.value,tg(d.domain,this.options.domain))return[2,d.value]}catch(e){g={error:e}}finally{try{c&&!c.done&&(m=u.return)&&m.call(u)}finally{if(g)throw g.error}}}y.label=3;case 3:return[3,5];case 4:return y.sent(),[3,5];case 5:if(f=(null!=(i=null==(n=null==o?void 0:o.document)?void 0:n.cookie.split("; "))?i:[]).filter(function(t){return 0===t.indexOf(e+"=")}),p=void 0,"function"==typeof(h=this.config.duplicateResolverFn)&&f.length>1&&(p=f.find(function(t){var r;try{var n=h(t.substring(e.length+1));return n||null==(r=v.config.diagnosticsClient)||r.increment("cookies.duplicate.occurrence.document.cookie"),n}catch(e){return!1}}
1)),p||(p=f[0]),!p)return[2,void 0];return[2,p.substring(e.length+1)]}})})},e.prototype.set=function(e,t){var r;return(0,A.__awaiter)(this,void 0,void 0,function(){var n,i,o,a,s,l,u;return(0,A.__generator)(this,function(c){try{n=null!=(r=this.options.expirationDays)?r:0,i=null!==t?n:-1,o=void 0,i&&((a=new Date).setTime(a.getTime()+24*i*36e5),o=a),s="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),o&&(s+="; expires=".concat(o.toUTCString())),s+="; path=/",this.options.domain&&(s+="; domain=".concat(this.options.domain)),this.options.secure&&(s+="; Secure"),this.options.sameSite&&(s+="; SameSite=".concat(this.options.sameSite)),(l=et())&&(l.document.cookie=s)}catch(t){u=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(u))}return[2]})})},e.prototype.remove=function(e){return(0,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__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,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__generator)(this,function(e){return[2]})})},e}(),tf=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},tp=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},th=function(e){var t;return null!=(t=tf(e))?t:tp(e)},tg=function(e,t){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()},tm=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),["AMP",t,e.substring(0,r)].filter(Boolean).join("_")},tv=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){if("object"!=typeof e)return null;var t,r,n,i,o,a,s,l,u,c,d,f,p,h,g,m,y,_,b,w,k,x,E=e.code||0,T=this.buildStatus(E);switch(T){case v.Success:return{status:T,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 v.Invalid:return{status:T,statusCode:E,body:{error:null!=(i=e.error)?i:"",missingField:null!=(o=e.missing_field)?o:"",eventsWithInvalidFields:null!=(a=e.events_with_invalid_fields)?a:{},eventsWithMissingFields:null!=(s=e.events_with_missing_fields)?s:{},eventsWithInvalidIdLengths:null!=(l=e.events_with_invalid_id_lengths)?l:{},epsThreshold:null!=(u=e.eps_threshold)?u: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!=(p=e.throttled_devices)?p:{},throttledEvents:null!=(h=e.throttled_events)?h:[]}};case v.PayloadTooLarge:return{status:T,statusCode:E,body:{error:null!=(g=e.error)?g:""}};case v.RateLimit:return{status:T,statusCode:E,body:{error:null!=(m=e.error)?m:"",epsThreshold:null!=(y=e.eps_threshold)?y:0,throttledDevices:null!=(_=e.throttled_devices)?_:{},throttledUsers:null!=(b=e.throttled_users)?b:{},exceededDailyQuotaDevices:null!=(w=e.exceeded_daily_quota_devices)?w:{},exceededDailyQuotaUsers:null!=(k=e.exceeded_daily_quota_users)?k:{},throttledEvents:null!=(x=e.throttled_events)?x:[]}};case v.Timeout:default:return{status:T,statusCode:E}}},e.prototype.buildStatus=function(e){return ev(e)?v.Success:429===e?v.RateLimit:413===e?v.PayloadTooLarge:408===e?v.Timeout:e>=400&&e<500?v.Invalid:e>=500?v.Failed:v.Unknown},e}(),ty=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return(0,A.__extends)(t,e),t.prototype.send=function(e,t){return(0,A.__awaiter)(this,void 0,void 0,function(){var r,n;return(0,A.__generator)(this,function(i){switch(i.label){case 0:if("u"<typeof fetch)throw Error("FetchTransport is not supported");return[4,fetch(e,{headers:(0,A.__assign)({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(t),method:"POST"})];case 1:return[4,(r=i.sent()).text()];case 2:n=i.sent();try{return[2,this.buildResponse(JSON.parse(n))]}catch(e){return[2,this.buildResponse({code:r.status})]}}})})},t}(tv),t_=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return(0,A.__awaiter)(this,void 0,void 0,function(){var t,r,n;return(0,A.__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,A.__awaiter)(this,void 0,void 0,function(){var t;return(0,A.__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,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__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,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__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,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__generator)(this,function(r){try{null==(t=this.storage)||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return(0,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__generator)(this,function(t){try{null==(e=this.storage)||e.clear()}catch(e){}return[2]})})},e}(),tb=function(e){function t(t){var r,n,i,o=this;try{i=null==(r=et())?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,A.__extends)(t,e),t.prototype.set=function(t,r){var n;return(0,A.__awaiter)(this,void 0,void 0,function(){var i;return(0,A.__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}(t_),tw=function(e){function t(){var t;return e.call(this,null==(t=et())?void 0:t.sessionStorage)||this}return(0,A.__extends)(t,e),t}(t_),tk=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,A.__extends)(t,e),t.prototype.send=function(e,t){return(0,A.__awaiter)(this,void 0,void 0,function(){var r=this;return(0,A.__generator)(this,function(n){return[2,new Promise(function(n,i){"u"<typeof XMLHttpRequest&&i(Error("XHRTransport is not supported."));var o,a,s=new XMLHttpRequest;s.open("POST",e,!0),s.onreadystatechange=function(){if(s.readyState===r.state.done){var e=s.responseText;try{n(r.buildResponse(JSON.parse(e)))}catch(e){n(r.buildResponse({code:s.status}))}}};var l=(0,A.__assign)({"Content-Type":"application/json",Accept:"*/*"},r.customHeaders);try{for(var u=(0,A.__values)(Object.entries(l)),c=u.next();!c.done;c=u.next()){var d=(0,A.__read)(c.value,2),f=d[0],p=d[1];s.setRequestHeader(f,p)}}catch(e){o={error:e}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(o)throw o.error}}s.send(JSON.stringify(t))})]})})},t}(tv),tx=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,A.__extends)(t,e),t.prototype.send=function(e,t){return(0,A.__awaiter)(this,void 0,void 0,function(){var r=this;return(0,A.__generator)(this,function(n){return[2,new Promise(function(n,i){var o=et();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,JSON.stringify(t)))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}(tv),tE=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},tT=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},tS="[Amplitude]",tA="".concat(tS," Form Started"),tI="".concat(tS," Form Submitted"),tO="".concat(tS," File Downloaded"),tP="session_start",tC="session_end",tR="".concat(tS," File Extension"),tN="".concat(tS," File Name"),tj="".concat(tS," Link ID"),tD="".concat(tS," Link Text"),tL="".concat(tS," Link URL"),tM="".concat(tS," Form ID"),tZ="".concat(tS," Form Name"),tU="".concat(tS," Form Destination"),tF="cookie",tz=function(e){function t(t,r,n,i,o,a,s,l,u,c,d,f,h,g,m,v,y,_,b,w,k,x,E,T,S,A,I,O,P,C,R,N,j,D,L,M,Z,U,F,z){void 0===n&&(n=new tc),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===l&&(l=1e3),void 0===u&&(u=5),void 0===c&&(c=30),void 0===d&&(d=tF),void 0===v&&(v=new ef),void 0===y&&(y=p.Warn),void 0===b&&(b=!1),void 0===w&&(w=!1),void 0===E&&(E=""),void 0===T&&(T="US"),void 0===A&&(A=18e5),void 0===I&&(I=new tb({loggerProvider:v})),void 0===O&&(O={ipAddress:!0,language:!0,platform:!0}),void 0===P&&(P="fetch"),void 0===C&&(C=!1),void 0===R&&(R=!0),void 0===Z&&(Z=!0),void 0===U&&(U=0);var q,$=this;($=e.call(this,{apiKey:t,storageProvider:I,transportProvider:tB(P)})||this).apiKey=t,$.appVersion=r,$.cookieOptions=i,$.defaultTracking=o,$.autocapture=a,$.flushIntervalMillis=l,$.flushMaxRetries=u,$.flushQueueSize=c,$.identityStorage=d,$.ingestionMetadata=f,$.instanceName=h,$.loggerProvider=v,$.logLevel=y,$.minIdLength=_,$.offline=b,$.partnerId=k,$.plan=x,$.serverUrl=E,$.serverZone=T,$.sessionTimeout=A,$.storageProvider=I,$.trackingOptions=O,$.transport=P,$.useBatch=C,$.fetchRemoteConfig=R,$.networkTrackingOptions=L,$.identify=M,$.enableDiagnostics=Z,$.diagnosticsSampleRate=U,$.diagnosticsClient=F,$.remoteConfig=z,$.version=ts,$._optOut=!1,$._cookieStorage=n,$.deviceId=s,$.lastEventId=g,$.lastEventTime=m,$.optOut=w,$.sessionId=S,$.page
1Counter=j,$.userId=N,$.debugLogsEnabled=D,$.loggerProvider.enable(D?p.Debug:$.logLevel),$.networkTrackingOptions=L,$.identify=M,$.enableDiagnostics=Z,$.diagnosticsSampleRate=U,$.diagnosticsClient=F;var B=null!=(q=null==z?void 0:z.fetchRemoteConfig)?q:R;return $.remoteConfig=$.remoteConfig||{},$.remoteConfig.fetchRemoteConfig=B,$.fetchRemoteConfig=B,$}return(0,A.__extends)(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},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,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,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof td&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(tm(this.apiKey),e)},t}(eh),tq=function(e,t,r){switch(void 0===e&&(e=tF),void 0===t&&(t={}),e){case"localStorage":return new tb;case"sessionStorage":return new tw;case"none":return new tc;default:return new td((0,A.__assign)((0,A.__assign)({},t),{expirationDays:t.expiration}),r)}},t$=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},tB=function(e){var t="object"==typeof e?e.type:e,r="object"==typeof e?e.headers:void 0;return"xhr"===t?new tk(r):"beacon"===t?new tx:new ty(r)},tV="data-amp-mask",tK="*****",tH=/\b(?:\d[ -]*?){13,16}\b/,tW=/(\d{3}-?\d{2}-?\d{4})/g,tJ=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,tG=function(e,t){if(void 0===t&&(t=[]),"string"!=typeof e)return"";var r,n,i=e;i=(i=(i=i.replace(tH,tK)).replace(tW,tK)).replace(tJ,tK);try{for(var o=(0,A.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;try{i=i.replace(s,tK)}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},tX=function(e){if("u"<typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(tV)?tK:e?e(document.title):document.title},tY=function(){function e(){}return e.prototype.parse=function(){return(0,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__generator)(this,function(e){return[2,(0,A.__assign)((0,A.__assign)((0,A.__assign)((0,A.__assign)({},H),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=eL();
1return{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=eL();return(e={})[L]=t[L],e[M]=t[M],e[Z]=t[Z],e[U]=t[U],e[F]=t[F],e[z]=t[z],e[q]=t[q],e[$]=t[$],e[B]=t[B],e[V]=t[V],e[K]=t[K],e},e}(),tQ=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},t0=function(e){void 0===e&&(e={});var t,r,n=et(),i=void 0,o=!1,a=e.trackOn,s=e.trackHistoryChanges,l=e.eventType,u=void 0===l?"[Amplitude] Page Viewed":l,c=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==i||i.error("Malformed URI sequence: ",e)}return t},d=function(){return(0,A.__awaiter)(void 0,void 0,void 0,function(){var e,t,r;return(0,A.__generator)(this,function(n){switch(n.label){case 0:return e=c("u">typeof location&&location.href||""),r={event_type:u},t=[{}],[4,t1()];case 1:return[2,(r.event_properties=A.__assign.apply(void 0,[A.__assign.apply(void 0,t.concat([n.sent()])),{"[Amplitude] Page Domain":"u">typeof location&&location.hostname||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":"u">typeof location&&c(location.pathname)||"","[Amplitude] Page Title":tX(tG),"[Amplitude] Page URL":e.split("?")[0]}]),r)]}})})},f=function(){return void 0===a||"function"==typeof a&&a()},p="u">typeof location?location.href:null,h=function(){return(0,A.__awaiter)(void 0,void 0,void 0,function(){var e,r,n,o;return(0,A.__generator)(this,function(a){switch(a.label){case 0:if(r=t4(s,e=location.href,p||"")&&f(),p=e,!r)return[3,4];if(null==i||i.log("Tracking page view event"),null!=t)return[3,1];return[3,3];case 1:return o=(n=t).track,[4,d()];case 2:o.apply(n,[a.sent()]),a.label=3;case 3:a.label=4;case 4:return[2]}})})},g=function(){h()};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,a){return(0,A.__awaiter)(void 0,void 0,void 0,function(){var s,l;return(0,A.__generator)(this,function(u){switch(u.label){case 0:if(t=a,r=e,(i=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),o=!0,n&&(n.addEventListener("popstate",g),n.history.pushState=new Proxy(n.history.pushState,{apply:function(e,t,r){var n=(0,A.__read)(r,3),i=n[0],a=n[1],s=n[2];e.apply(t,[i,a,s]),o&&h()}})),!f())return[3,2];return i.log("Tracking page view event"),l=(s=t).track,[4,d()];case 1:l.apply(s,[u.sent()]),u.label=2;case 2:return[2]}})})},execute:function(e){return(0,A.__awaiter)(void 0,void 0,void 0,function(){var t;return(0,A.__generator)(this,function(n){switch(n.label){case 0:if(!("attribution"===a&&t2(e)))return[3,2];return null==i||i.log("Enriching campaign event to page view event with campaign parameters"),[4,d()];case 1:e.event_type=(t=n.sent()).event_type,e.event_properties=(0,A.__assign)((0,A.__assign)({},e.event_properties),t.event_properties),n.label=2;case 2:return r&&e.event_type===u&&(r.pageCounter=r.pageCounter?r.pageCounter+1:1,e.event_properties=(0,A.__assign)((0,A.__assign)({},e.event_properties),{"[Amplitude] Page Counter":r.pageCounter})),[2,e]}})})},teardown:function(){return(0,A.__awaiter)(void 0,void 0,void 0,function(){return(0,A.__generator)(this,function(e){return n&&(n.removeEventListener("popstate",g),o=!1),[2]})})}}},t1=function(){return(0,A.__awaiter)(void 0,void 0,void 0,function(){var e;return(0,A.__generator)(this,function(t){switch(t.label){case 0:return e=tQ,[4,new tY().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},t2=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,r=t[h.SET]||{},n=t[h.UNSET]||{},i=(0,A.__spreadArray)((0,A.__spreadArray)([],(0,A.__read)(Object.keys(r)),!1),(0,A.__read)(Object.keys(n)),!1);return Object.keys(H).every(function(e){return i.includes(e)})}return!1},t4=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},t3=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,A.__awaiter)(void 0,void 0,void 0,function(){var o,a;return(0,A.__generator)(this,function(s){return t=tn(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=function(e){var o=!1;n(e,"change",function(){var t,r=t5(e);o||i.track(tA,((t={})[tM]=t9(e.id),t[tZ]=t9(e.name),t[tU]=r,t)),o=!0}),n(e,"submit",function(n){var a,s,l=t5(e);if(o||i.track(tA,((a={})[tM]=t9(e.id),a[tZ]=t9(e.name),a[tU]=l,a)),o=!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(tI,((s={})[tM]=t9(e.id),s[tZ]=t9(e.name),s[tU]=l,s)),o=!1})};
1Array.from(document.getElementsByTagName("form")).forEach(o),"u">typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"FORM"===e.nodeName&&o(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(o)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?o():(a=et())?a.addEventListener("load",o):r.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,A.__awaiter)(void 0,void 0,void 0,function(){return(0,A.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,A.__awaiter)(void 0,void 0,void 0,function(){return(0,A.__generator)(this,function(t){return null==e||e.disconnect(),i(),[2]})})}}},t9=function(e){if("string"==typeof e)return e},t5=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},t6=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,A.__awaiter)(void 0,void 0,void 0,function(){var i,o;return(0,A.__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(tO,((r={})[tR]=a,r[tN]=t.pathname,r[tj]=e.id,r[tD]=e.text,r[tL]=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){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?i():(o=et())?o.addEventListener("load",i):t.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,A.__awaiter)(void 0,void 0,void 0,function(){return(0,A.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,A.__awaiter)(void 0,void 0,void 0,function(){return(0,A.__generator)(this,function(t){return null==e||e.disconnect(),n(),[2]})})}}},t7=!1,t8=function(e){t7||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."),t7=!0)},re=function(){var e=et(),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,A.__awaiter)(void 0,void 0,void 0,function(){return(0,A.__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(){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,A.__awaiter)(void 0,void 0,void 0,function(){return(0,A.__generator)(this,function(e){return n(),[2]})})}}};function rt(e,t,r){var n,i,o=[];try{for(var a=(0,A.__values)(null!=t?t:[]),s=a.next();!s.done;s=a.next()){var l=s.value;try{o.push(new RegExp(l))}catch(e){r.loggerProvider.warn("Invalid regex pattern: ".concat(l),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 rr=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],rn="data-amp-track-",ri=["div","span","h1","h2","h3","h4","h5","h6"];function ro(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ra(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function rs(e,t,r){return t&&ra(e.prototype,t),r&&ra(e,r),e}var rl=function(){return"function"==typeof Symbol},ru=function(e){return rl()&&!!Symbol[e]},rc=function(e){return ru(e)?Symbol[e]:"@@"+e};rl()&&!ru("observable")&&(Symbol.observable=Symbol("observable"));var rd=rc("iterator"),rf=rc("observable"),rp=rc("species");function rh(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw TypeError(r+" is not a function");return r}}function rg(e){var t=e.constructor;return void 0!==t&&null===(t=t[rp])&&(t=void 0),void 0!==t?t:rE}function rm(e){rm.log?rm.log(e):setTimeout(function(){throw e})}function rv(e){Promise.resolve().then(function(){try{e()}catch(e){rm(e)}})}function ry(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=rh(t,"unsubscribe");r&&r.call(t)}}catch(e){rm(e)}}function r_(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function rb(e,t,r){e._state="running";var n=e._observer;try{var i=rh(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(r_(e),i)i.call(n,r);else throw r;break;case"complete":r_(e),i&&i.call(n)}}catch(e){rm(e)}"closed"===e._state?ry(e):"running"===e._state&&(e._state="ready")}function rw(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}],rv(function(){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(rb(e,t[r].type,t[r].value),"closed"!==e._state);++r);}});return}rb(e,t,r)}}var rk=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var r=new rx(this);try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(r_(this),ry(this))},rs(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),rx=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){rw(this._subscription,"next",e)},t.error=function(e){rw(this._subscription,"error",e)},t.complete=function(){rw(this._subscription,"complete")},rs(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),rE=function(){function e(t){if(!(this instanceof e))throw TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return("object"!=typeof e||null===e)&&(e={next:e,error:arguments[1],complete:arguments[2]}),new rk(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise(function(r,n){if("function"!=typeof e)return void n(TypeError(e+" is not a function"));function i(){o.unsubscribe(),r()}var o=t.subscribe({next:function(t){try{e(t,i)}catch(e){n(e),o.unsubscribe()}},error:n,complete:r})})},t.map=function(e){var t=this;if("function"!=typeof e)throw TypeError(e+" is not a function");return new(rg(this))(function(r){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})})},t.filter=function(e){var t=this;if("function"!=typeof e)throw TypeError(e+" is not a function");return new(rg(this))(function(r){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})})},t.reduce=function(e){var t=this;if("function"!=typeof e)throw TypeError(e+" is not a function");var r=rg(this),n=arguments.length>1,i=!1,o=arguments[1],a=o;return new r(function(r){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||n)try{a=e(a,t)}catch(e){return r.error(e)}else a=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(TypeError("Cannot reduce an empty sequence"));r.next(a),r.complete()}})})},t.concat=function(){for(var e=this,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=rg(this);return new i(function(t){var n,o=0;return!function e(a){n=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===r.length?(n=void 0,t.complete()):e(i.from(r[o++]
1))}})}(e),function(){n&&(n.unsubscribe(),n=void 0)}})},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw TypeError(e+" is not a function");var r=rg(this);return new r(function(n){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return n.error(e)}var o=r.from(t).subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){n.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&n.complete()}return function(){i.forEach(function(e){return e.unsubscribe()}),o.unsubscribe()}})},t[rf]=function(){return this},e.from=function(t){var r="function"==typeof this?this:e;if(null==t)throw TypeError(t+" is not an object");var n=rh(t,rf);if(n){var i=n.call(t);if(Object(i)!==i)throw TypeError(i+" is not an object");return i instanceof rE&&i.constructor===r?i:new r(function(e){return i.subscribe(e)})}if(ru("iterator")&&(n=rh(t,rd)))return new r(function(e){rv(function(){if(!e.closed){for(var r,i=function(e){var t="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return ro(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ro(e,void 0)}}(e))){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n.call(t));!(r=i()).done;){var o=r.value;if(e.next(o),e.closed)return}e.complete()}})});if(Array.isArray(t))return new r(function(e){rv(function(){if(!e.closed){for(var r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}})});throw TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return new("function"==typeof this?this:e)(function(e){rv(function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}})})},rs(e,null,[{key:rp,get:function(){return this}}]),e}();function rT(e,t){return new rE(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 rS(e,t){return new rE(function(r){var n=!1,i=new Set,o=function(){var e,t;n=!0;try{for(var r=(0,A.__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 rA(e){var t=new Set,r=null;function n(){null==r||r.unsubscribe(),r=null,t.clear()}return new rE(function(i){return t.add(i),null===r&&(r=e.subscribe({next:function(e){try{for(var r,n,i,o=(0,A.__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,A.__values)(t),s=a.next();!s.done;s=a.next()){var l=s.value;null==(o=l.error)||o.call(l,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,A.__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)}})}rl()&&Object.defineProperty(rE,Symbol("extensions"),{value:{symbol:rf,hostReportError:rm},configurable:!0});var rI="1.19.0",rO="[Amplitude] Element Clicked",rP="[Amplitude] Element Tag",rC="[Amplitude] Element Text",rR="[Amplitude] Page URL",rN="https://app.amplitude.com",rj={US:rN,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},rD="data-amp-mask-attributes",rL=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},rM=function(e,t){var r=e;try{r=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return r},rZ=["input","select","textarea"],rU=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},rF=function(e,t,r){return void 0===r&&(r=!1),function(n,i){var o,a,s=e.pageUrlAllowlist,l=e.pageUrlExcludelist,u=e.shouldTrackEventResolver,c=null==(a=null==(o=null==i?void 0:i.tagName)?void 0:o.toLowerCase)?void 0:a.call(o);if(!c)return!1;if(u)return u(n,i);if(!rL(window.location.href,s)||l&&l.length>0&&rL(window.location.href,l))return!1;var d=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof d)switch(d.toLowerCase()){case"hidden":case"password":return!1}var f=rU(i,n);if(r&&f)return!0;
1if(t&&!t.some(function(e){var t;return!!(null==(t=null==i?void 0:i.matches)?void 0:t.call(i,e))}))return!1;switch(c){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:if(f)return!0;return"click"===n}}},rz=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!rZ.includes(i)&&!o},rq=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},{})},r$=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:r$(null==e?void 0:e.parentElement,t):null},rB=function(e){return null!==e.event.target&&!!e.closestTrackedAncestor};(s=_||(_={}))[s.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",s[s.MIDDLE=1]="MIDDLE",s[s.RIGHT=2]="RIGHT";var rV=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",rD,tV]),rK=["type"],rH=["svg","path","g"],rW=["password","hidden"],rJ=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){}},rG=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}})},rX=function(e,t){var r,n,i,o=this;this.replaceSensitiveString=function(e){return tG(e,o.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,r,n,i,a=performance.now(),s=[];if(!e)return[];for(var l=function(e){var t=[];if(!e)return t;
1t.push(e);for(var r=e.parentElement;r&&"HTML"!==r.tagName;)t.push(r),r=r.parentElement;return t}(e),u=new Map,c=l.length-1;c>=0;c--){var d=l[c];if(d){var f,p=(f=d.getAttribute(rD))?f.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[],h=c===l.length-1?[]:null!=(n=u.get(l[c+1]))?n:new Set,g=new Set((0,A.__spreadArray)((0,A.__spreadArray)([],(0,A.__read)(h),!1),(0,A.__read)(p),!1));u.set(d,g)}}s=l.map(function(e){var t;return function(e,t){if(null===e)return null;var r,n,i,o,a,s,l=String(e.tagName).toLowerCase(),u={tag:l},c=Array.from(null!=(o=null==(i=e.parentElement)?void 0:i.children)?o:[]);c.length&&(u.index=c.indexOf(e),u.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&&(u.prevSib=String(d));var f=e.getAttribute("id");f&&(u.id=String(f));var p=Array.from(e.classList);p.length&&(u.classes=p);var h={},g=Array.from(e.attributes).filter(function(e){return!rV.has(e.name)}),m=!rz(e);if(!rW.includes(String(e.getAttribute("type")))&&!rH.includes(l))try{for(var v=(0,A.__values)(g),y=v.next();!y.done;y=v.next()){var _=y.value;if(!m||rK.includes(_.name)){if(t.has(_.name)){h[_.name]=tK;continue}h[_.name]=String(_.value).substring(0,128)}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(n=v.return)&&n.call(v)}finally{if(r)throw r.error}}return Object.keys(h).length&&(u.attrs=h),u}(e,null!=(t=u.get(e))?t:new Set)});var m=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var r=(0,A.__read)(t,2),n=r[0],i=r[1];e.attrs&&(e.attrs[n]=o.replaceSensitiveString(i))})};try{for(var v=(0,A.__values)(s),y=v.next();!y.done;y=v.next()){var _=y.value;m(_)}}catch(e){t={error:e}}finally{try{y&&!y.done&&(r=v.return)&&r.call(v)}finally{if(t)throw t.error}}var b=performance.now();return null==(i=o.diagnosticsClient)||i.recordHistogram("autocapturePlugin.getHierarchy",b-a),s},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?o.getText(t):o.getNearestLabel(r)},this.getEventProperties=function(e,t,r){var n,i,a,s,l=null==(a=null==(i=null==t?void 0:t.tagName)?void 0:i.toLowerCase)?void 0:a.call(i),u="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},c=o.getHierarchy(t),d=null==(s=c[0])?void 0:s.attrs,f=o.getNearestLabel(t),p=Object.entries(null!=d?d:{}).reduce(function(e,t){var n=(0,A.__read)(t,2),i=n[0],o=n[1];if(i.startsWith(r)){var a=i.replace(r,"");a&&(e[a]=o||"")}return e},{}),h=((n={})["[Amplitude] Element Hierarchy"]=c,n[rP]=l,n[rC]=o.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"]=p,n["[Amplitude] Element Parent Label"]=f,n[rR]=rM(window.location.href.split("?")[0]),n["[Amplitude] Page Title"]=tX(o.replaceSensitiveString),n["[Amplitude] Viewport Height"]=window.innerHeight,n["[Amplitude] Viewport Width"]=window.innerWidth,n);if(h["[Amplitude] Element ID"]=t.getAttribute("id")||"",h["[Amplitude] Element Class"]=t.getAttribute("class"),h["[Amplitude] Element Aria Label"]=null==d?void 0:d["aria-label"],"a"===l&&"click"===e&&t instanceof HTMLAnchorElement){var g=t.href.substring(0,128);h["[Amplitude] Element Href"]=o.replaceSensitiveString(g)}return rq(h)},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 a=o.addTypeAndTimestamp(e,t);if(("click"===a.type||"change"===a.type)&&null!==a.event.target){if(i&&rU(a.event.target,a.type))return a.closestTrackedAncestor=a.event.target,a.targetElementProperties=o.getEventProperties(a.type,a.closestTrackedAncestor,n),a;var s=r$(a.event.target,r);s&&(a.closestTrackedAncestor=s,a.targetElementProperties=o.getEventProperties(a.type,s,n))}return a},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var r=rJ(e,t);if(r){if("TEXT"===e.elementExtractType)return o.getText(r);if("ATTRIBUTE"===e.elementExtractType&&e.attribute)return r.getAttribute(e.attribute)}}},this.getText=function(e){if(null!==e.closest("[".concat(tV,"]")))return tK;var t="";if(e.querySelector("[".concat(tV,"], [contenteditable]"))){var r=e.cloneNode(!0);r.querySelectorAll("[".concat(tV,"], [contenteditable]")).forEac
1h(function(e){e.innerText=tK}),t=r.innerText||""}else t=e.innerText||"";return o.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 rq(((t={})[rP]=i,t[rC]=o.getText(e),t[rR]=window.location.href.split("?")[0],t))},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var a=null!=(i=e.maskTextRegex)?i:[],s=[];try{for(var l=(0,A.__values)(a),u=l.next();!u.done;u=l.next()){var c=u.value;if(s.length>=25)break;if(c instanceof RegExp)s.push(c);else if("pattern"in c&&"string"==typeof c.pattern)try{s.push(RegExp(c.pattern,"i"))}catch(e){}}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}this.additionalMaskTextPatterns=s},rY=function(){function e(e){var t=(void 0===e?{}:e).origin,r=this;this.endpoint=rN,this.requestCallbacks={},this.onSelect=function(e){r.notify({action:"element-selected",data:e})},this.onTrack=function(e,t){"selector-mode-changed"===e?r.notify({action:"track-selector-mode-changed",data:t}):"selector-moved"===e&&r.notify({action:"track-selector-moved",data:t})},this.endpoint=void 0===t?rN: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),(null==r?void 0: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.setup=function(e){var t=this,r=void 0===e?{dataExtractor:new rX({})}:e,n=r.logger,i=r.endpoint,o=r.isElementSelectable,a=r.cssSelectorAllowlist,s=r.actionClickAllowlist,l=r.dataExtractor;this.logger=n,i&&this.endpoint===rN&&(this.endpoint=i);var u=null;window.addEventListener("message",function(e){if(null==(n=null==(r=t.logger)?void 0:r.debug)||n.call(r,"Message received: ",JSON.stringify(e)),t.endpoint===e.origin){var r,n,i,c,d,f=null==e?void 0:e.data,p=null==f?void 0:f.action;if(p)if("id"in f)null==(c=null==(i=t.logger)?void 0:i.debug)||c.call(i,"Received Response to previous request: ",JSON.stringify(e)),t.handleResponse(f);else if("ping"===p)t.notify({action:"pong"});else if("initialize-visual-tagging-selector"===p){var h,g=null==f?void 0:f.data;(h="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise(function(e,t){var r;try{var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src=h,n.addEventListener("load",function(){e({status:!0})},{once:!0}),n.addEventListener("error",function(){t({status:!1,message:"Failed to load the script ".concat(h)})}),null==(r=document.head)||r.appendChild(n)}catch(e){t(e)}})).then(function(){var e;u=null==(e=null==window?void 0:window.amplitudeVisualTaggingSelector)?void 0:e.call(window,{getEventTagProps:l.getEventTagProps,isElementSelectable:function(e){return!o||o((null==g?void 0:g.actionType)||"click",e)},onTrack:t.onTrack,onSelect:t.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:t,cssSelectorAllowlist:a,actionClickAllowlist:s,extractDataFromDataSource:l.extractDataFromDataSource,dataExtractor:l,diagnostics:{autocapture:{version:rI}}}),t.notify({action:"selector-loaded"})}).catch(function(){var e;null==(e=t.logger)||e.warn("Failed to initialize visual tagging selector")})}else"close-visual-tagging-selector"===p&&(null==(d=null==u?void 0:u.close)||d.call(u))}}),this.notify({action:"page-loaded"})},e}(),rQ=et(),r0=null==rQ?void 0:rQ.console,r1={},r2={},r4=!1,r3=function(e,t){if(!r0||"function"!=typeof r0[e]||!r2[e]&&(r2[e]=r0[e],r0[e]=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{if(r1[e]&&!r4){r4=!0;var n=r1[e];
1n&&n.forEach(function(r){try{r(e,t)}catch(e){}})}}catch(e){}return r4=!1,r2[e].apply(r0,t)},0))return Error("Console override failed");r1[e]?r1[e].push(t):r1[e]=[t]},r9=function(e){var t,r;try{for(var n=(0,A.__values)(Object.values(r1)),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}}},r5=et(),r6=function(){return new rE(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()}})},r7=function(e){return void 0===e&&(e="click"),new rE(function(t){var r=function(e){t.next(e)};return r5.document.addEventListener(e,r,{capture:!0}),function(){r5.document.removeEventListener(e,r,{capture:!0})}})},r8=function(){var e=rS(new rE(function(e){var t=function(t){var r={kind:"error"};t.error instanceof Error?r=(0,A.__assign)((0,A.__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 r5.addEventListener("error",t),function(){r5.removeEventListener("error",t)}}),new rE(function(e){var t=function(t){var r={kind:"unhandledrejection"};t.reason instanceof Error?(r.message=t.reason.message,r.stack=t.reason.stack):"string"==typeof t.reason&&(r.message=t.reason),e.next(r)};return r5.addEventListener("unhandledrejection",t),function(){r5.removeEventListener("unhandledrejection",t)}}));return rS(e,new rE(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 r3("error",t),function(){r9(t)}}))},ne=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},nt={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},nr=function(e){var t,r,n,i,o=Object.values(nt).reduce(function(e,t){return e[t]=new Set,e},{});if(!e)return o;try{for(var a=(0,A.__values)(e),s=a.next();!s.done;s=a.next()){var l=s.value;try{try{for(var u=(n=void 0,(0,A.__values)(l.definition)),c=u.next();!c.done;c=u.next()){var d=nt[c.value.event_type];d&&o[d].add(l.id)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==l?void 0:l.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},nn=function(e){var t,r,n,i,o=new Map;try{for(var a=(0,A.__values)(e),s=a.next();!s.done;s=a.next()){var l=s.value;try{for(var u=(n=void 0,(0,A.__values)(l.conditions)),c=u.next();!c.done;c=u.next()){var d=c.value;if("LABELED_EVENT"===d.type){var f=d.match.eventId,p=o.get(f);p||(p=[],o.set(f,p)),p.push(l)}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}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},ni=function(e,t){var r,n,i,o,a=new Set;try{for(var s=(0,A.__values)(e),l=s.next();!l.done;l=s.next()){var u=l.value,c=t.get(u.id);if(c)try{for(var d=(i=void 0,(0,A.__values)(c)),f=d.next();!f.done;f=d.next()){var p=f.value;a.add(p)}}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{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return Array.from(a)},no=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=ni(Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return n.labeledEvents[e]}).filter(function(t){return t.definition.some(function(t){return nt[t.event_type]===e.type&&t.filters.every(function(t){return ne(e,t)})})}),this.labeledEventToTriggerMap);try{for(var o=(0,A.__values)(i),a=o.next();!a.done;a=o.next()){var s=a.value;rG(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}();(l=b||(b={})).ClickObservable="clickObservable",l.ChangeObservable="changeObservable",l.NavigateObservable="navigateObservable",l.MutationObservable="mutationObservable",l.BrowserErrorObservable="browserErrorObservable",l.SelectionObservable="selectionObservable";var na=function(e,t){void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",rI);var r,n,i,o,a,s,l,u,c=e.dataAttributePrefix,d=void 0===c?rn:c,f=e.visualTaggingOptions,p=void 0===f?{enabled:!0,messenger:new rY}:f;e.cssSelectorAllowlist=null!=(r=e.cssSelectorAllowlist)?r:rr,e.actionClickAllowlist=null!=(n=e.actionClickAllowlist)?n:ri,e.debounceTime=null!=(i=e.debounceTime)?i:0,e.pageUrlExcludelist=null==(o=e.pageUrlExcludelist)?void 0:o.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 h="@amplitude/plugin-autocapture-browser",g=[],m=new rX(e,t),v=function(){var t,r,n=rA(r7().map(function(t){return m.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,d)})),i=rA(new rE(function(t){var r,n=function(r){var n=m.addAdditionalEventProperties(r,"change",e.cssSelectorAllowlist,d);t.next(n)};
1return null==(r=et())||r.document.addEventListener("change",n,{capture:!0}),function(){var e;return null==(e=et())?void 0:e.document.removeEventListener("change",n)}}));window.navigation&&(r=rA(new rE(function(t){var r=function(r){var n=m.addAdditionalEventProperties(r,"navigate",e.cssSelectorAllowlist,d);t.next(n)};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}})));var o=rA(r6().map(function(t){return m.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,d)}));return(t={})[b.ChangeObservable]=i,t[b.ClickObservable]=n,t[b.MutationObservable]=o,t[b.NavigateObservable]=r,t},y=nr(Object.values(null!=(s=null==(a=e.pageActions)?void 0:a.labeledEvents)?s:{})),_=nn(null!=(u=null==(l=e.pageActions)?void 0:l.triggers)?u:[]),w=new no(y,_,m,e),k=function(t){var r,n;t&&(e.pageActions=(0,A.__assign)((0,A.__assign)({},e.pageActions),t),y=nr(Object.values(null!=(r=e.pageActions.labeledEvents)?r:{})),_=nn(null!=(n=e.pageActions.triggers)?n:[]),w.update(y,_,e))};return{name:h,type:"enrichment",setup:function(t,r){return(0,A.__awaiter)(void 0,void 0,void 0,function(){var n,i,o,a,s,l,u,c,f,y;return(0,A.__generator)(this,function(_){var b,x,E,T,S,I,O,P,C,R,N,j,D,L,M,Z,U,F,z,q,$,B,V,K,H,W;return"u"<typeof document?[2]:(t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(e){k(e)}):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),n=rF(e,e.cssSelectorAllowlist),i=rF(e,e.actionClickAllowlist),x=(b={allObservables:o=v(),amplitude:r,shouldTrackEvent:n,evaluateTriggers:w.evaluate.bind(w)}).amplitude,E=b.allObservables,T=b.shouldTrackEvent,S=b.evaluateTriggers,a=E.clickObservable.filter(rB).filter(function(e){return T("click",e.closestTrackedAncestor)}).map(function(e){return S(e)}).subscribe(function(e){null==x||x.track(rO,e.targetElementProperties)}),g.push(a),O=(I={allObservables:o,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return m.getEventProperties.apply(m,(0,A.__spreadArray)((0,A.__spreadArray)([],(0,A.__read)(e),!1),[d],!1))},amplitude:r,shouldTrackEvent:n,evaluateTriggers:w.evaluate.bind(w)}).amplitude,P=I.allObservables,C=I.getEventProperties,R=I.shouldTrackEvent,N=I.evaluateTriggers,s=P.changeObservable.filter(rB).filter(function(e){return R("change",e.closestTrackedAncestor)}).map(function(e){return N(e)}).subscribe(function(e){null==O||O.track("[Amplitude] Element Changed",C("change",e.closestTrackedAncestor))}),g.push(s),D=(j={allObservables:o,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return m.getEventProperties.apply(m,(0,A.__spreadArray)((0,A.__spreadArray)([],(0,A.__read)(e),!1),[d],!1))},amplitude:r,shouldTrackEvent:n,shouldTrackActionClick:i}).amplitude,L=j.allObservables,M=j.options,Z=j.getEventProperties,U=j.shouldTrackEvent,F=j.shouldTrackActionClick,z=L.clickObservable,q=L.mutationObservable,$=L.navigateObservable,B=z.filter(function(e){return!U("click",e.closestTrackedAncestor)}).map(function(e){var t=r$(e.event.target,M.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=Z(e.type,e.closestTrackedAncestor)),e}).filter(rB).filter(function(e){return F("click",e.closestTrackedAncestor)}),V=$?rS(q,$):q,K=rS(B,V),H=null,W=null,(l=rT(K,function(e){if(H&&(clearTimeout(H),H=null),"click"===e.type)W=e,H=setTimeout(function(){H=null,W=null},500);else if(W){var t=W;return W=null,Promise.resolve(t)}return Promise.resolve(null)}).subscribe(function(e){e&&(null==D||D.track(rO,Z("click",e.closestTrackedAncestor)))}))&&g.push(l),null==(f=null==t?void 0:t.loggerProvider)||f.log("".concat(h," has been successfully added.")),window.opener&&p.enabled&&(u=e.cssSelectorAllowlist,c=e.actionClickAllowlist,null==(y=p.messenger)||y.setup((0,A.__assign)((0,A.__assign)({dataExtractor:m,logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:rj[t.serverZone]}),{isElementSelectable:rF(e,(0,A.__spreadArray)((0,A.__spreadArray)([],(0,A.__read)(u),!1),(0,A.__read)(c),!1)),cssSelectorAllowlist:u,actionClickAllowlist:c}))),[2])})})},execute:function(e){return(0,A.__awaiter)(void 0,void 0,void 0,function(){return(0,A.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,A.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n;return(0,A.__generator)(this,function(i){try{for(t=(e=(0,A.__values)(g)).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]})})}}},ns=(0,A.__spreadArray)(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],(0,A.__read)(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),nl=["*"],nu=["mutation","navigate"];function nc(e,t){var r,n,i,o,a=t.event,s=a.pageX,l=a.pageY;e.yMin=Math.min(null!=(r=e.yMin)?r:l,l),e.yMax=Math.max(null!=(n=e.yMax)?n:l,l),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}
1function nd(e){if(0===e.length)return null;var t=e[0],r=e[e.length-1];return{rageClickEvent:(0,A.__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}}function nf(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 np=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=nf(e,"rageClicks",nl,a),l=nf(e,"deadClicks",ns,o),u=nf(e,"errorClicks",ns,i),c=null!=(t=e.dataAttributePrefix)?t:rn,d=new rX(e),f=(0,A.__spreadArray)([],(0,A.__read)(new Set((0,A.__spreadArray)((0,A.__spreadArray)((0,A.__spreadArray)([],(0,A.__read)(s),!1),(0,A.__read)(l),!1),(0,A.__read)(u),!1))),!1),p=function(){var e,t,r=rA(r7("pointerdown").map(function(e){return d.addAdditionalEventProperties(e,"click",f,c,!0)})),n=rA(r8().map(function(e){return d.addTypeAndTimestamp(e,"error")})),i=rA(r6().map(function(e){return d.addAdditionalEventProperties(e,"mutation",f,c)}));window.navigation&&(t=rA(new rE(function(e){var t=function(t){e.next((0,A.__assign)((0,A.__assign)({},t),{type:"navigate"}))};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}}).map(function(e){return d.addAdditionalEventProperties(e,"navigate",f,c)})));var o=rA(new rE(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)}}));return(e={})[b.ClickObservable]=r,e[b.MutationObservable]=i,e[b.NavigateObservable]=t,e[b.BrowserErrorObservable]=n,e[b.SelectionObservable]=o,e};return{name:r,type:"enrichment",setup:function(t,f){return(0,A.__awaiter)(void 0,void 0,void 0,function(){var h,g,m,v,y;return(0,A.__generator)(this,function(b){var w,k,x,E,T,S,I,O,P,C,R,N,j,D,L,M,Z,U,F,z,q,$;return"u"<typeof document?[2]:(h=p(),a&&(g=function(e){var t=this,r=e.amplitude,n=e.allObservables,i=e.shouldTrackRageClick,o=n.clickObservable,a=n.selectionObservable,s=[],l={},u=null;function c(e){s=[],l={},e&&(nc(l,e),s.push(e))}var d=rT(o.filter(function(e){return i("click",e.closestTrackedAncestor)}),function(e){return(0,A.__awaiter)(t,void 0,void 0,function(){var t;return(0,A.__generator)(this,function(r){var n,i,o,a;return(nc(l,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)||l.isOutOfBounds)?(u&&(t=nd(s)),c(e)):s.push(e),(u&&(clearTimeout(u.timerId),u.resolve(t),u=null),s.length>=4)?[2,new Promise(function(e){u={resolve:e,timerId:setTimeout(function(){e(nd(s))},1e3)}})]:[2,null]})})}),f=null==a?void 0:a.subscribe(function(){c()}),p=d.subscribe(function(e){null!==e&&r.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})});return{unsubscribe:function(){p.unsubscribe(),null==f||f.unsubscribe()}}}({allObservables:h,amplitude:f,shouldTrackRageClick:rF(e,s)}),n.push(g)),o&&(k=(w={amplitude:f,allObservables:h,getEventProperties:function(e,t){return d.getEventProperties(e,t,c)},shouldTrackDeadClick:rF(e,l)}).amplitude,x=w.allObservables,E=w.getEventProperties,T=w.shouldTrackDeadClick,S=x.clickObservable,I=x.mutationObservable,O=x.navigateObservable,P=S.filter(function(e){return rB(e)&&T("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===_.LEFT_OR_TOUCH_CONTACT}),C=O?rS(I,O):I,R=rS(P,C),N=null,m=rT(R,function(e){if(N&&nu.includes(e.type))clearTimeout(N),N=null;else if("click"===e.type)return N?Promise.resolve(null):new Promise(function(t){N=setTimeout(function(){t(e),N=null},3e3)});return Promise.resolve(null)}).subscribe(function(e){if(e){var t={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};k.track("[Amplitude] Dead Click",(0,A.__assign)((0,A.__assign)({},E("click",e.closestTrackedAncestor)),t),{time:e.timestamp})}}),n.push(m)),i&&(D=(j={amplitude:f,allObservables:h,shouldTrackErrorClick:rF(e,u)}).amplitude,L=j.allObservables,M=j.shouldTrackErrorClick,Z=L.clickObservable,U=L.browserErrorObservable,F=Z.filter(function(e){return rB(e)&&M("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===_.LEFT_OR_TOUCH_CONTACT}),z=null,q=null,$=function(){null!==z&&(clearTimeout(z),z=null),q=null},v=rS(F,U).subscribe(function(e){var t;if("click"===e.type){$(),q=e,z=setTimeout($,2e3);return}"error"===e.type&&q&&(D.track("[Amplitude] Error Click",(0,A.__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),q.targetElementProperties)),$())}),n.push(v)),null==(y=null==t?void 0:t.loggerProvider)||y.log("".concat(r," has been successfully added.")),[2])})})},execute:function(e){return(0,A.__awaiter)(void 0,void 0,void 0,function(){return(0,A.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,A.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,i;return(0,A.__generator)(this,function(o){try{for(t=(e=(0,A.__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 nh(e,t,r){e&&function e(t){var r,n,i=t.json,o=t.targetObject,a=t.allowlist,s=t.excludelist,l=t.ancestors,u=t.parentObject,c=t.targetKey;o||(o=i);var d=Object.keys(o);try{for(var f=(0,A.__values)(d),p=f.next();!p.done;p=f.next()){var h,g=p.value,m=(0,A.__spreadArray)((0,A.__spreadArray)([],(0,A.__read)(l),!1),[g],!1);(h=o[g],"string"==typeof h||"number"==typeof h||"boolean"==typeof h||null==h)?(!nm(m,a)||nm(m,s))&&delete o[g]:e({json:i,targetObject:o[g],allowlist:a,excludelist:s,ancestors:m,parentObject:o,targetKey:g})}}catch(e){r={error:e}}finally{try{p&&!p.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}0===Object.keys(o).length&&u&&c&&delete u[c]}({json:e,allowlist:t.map(ng),excludelist:r.map(ng),ancestors:[]})}function ng(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function nm(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 nv=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,A.__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,A.__values)(Object.entries(n)),a=o.next();!a.done;a=o.next()){var s=(0,A.__read)(a.value,2),l=s[0],u=s[1];i[l]=u}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return nE(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=et();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=n_(t,100),this._bodySize}}
1,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,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__generator)(this,function(r){return 0===e.length?[2,null]:[2,nk(this.body,e,t)]})})},e}(),ny=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),nE(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return n_(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,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__generator)(this,function(r){return 0===e.length?[2,null]:[2,nk(this.body,e,t)]})})},e}();function n_(e,t){var r,n,i,o,a=et(),s=null==a?void 0:a.TextEncoder;if(s){if("string"==typeof e)o=e,i=new s().encode(o).length;else if(e instanceof Blob)i=(o=e).size;else if(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(e instanceof FormData){var l=0,u=0;try{for(var c=(0,A.__values)(e.entries()),d=c.next();!d.done;d=c.next()){var f=(0,A.__read)(d.value,2),p=f[0],h=f[1];if(l+=p.length,"string"==typeof h)l+=new s().encode(h).length;else{if(!(h instanceof Blob))return;l+=h.size}if(++u>=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=l}else if(e instanceof ReadableStream){o=e;return}return i}}var nb=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}),nE(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,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__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,A.__awaiter)(this,void 0,void 0,function(){return(0,A.__generator)(this,function(r){switch(r.label){case 0:if(0===e.length)return[2,null];return[4,this.text()];case 1:return[2,nk(r.sent(),e,t)]}})})},e}(),nw=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,A.__values)(i),a=o.next();!a.done;a=o.next()){var s=a.value,l=(0,A.__read)(s.split(": "),2),u=l[0],c=l[1];u&&c&&(n[u]=c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return nE(n,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,A.__awaiter)(this,void 0,void 0,function(){var r;return(0,A.__generator)(this,function(n){return 0===e.length?[2,null]:(r=this.getJson())?(nh(r,e,t),[2,r]):[2,null]})})},e}();function nk(e,t,r){if(!e)return null;try{var n=JSON.parse(e);return nh(n,t,r),n}catch(e){return null}}(u=w||(w={})).REDACT="redact",u.REMOVE="remove";var nx="[REDACTED]",nE=function(e,t){var r,n,i=t.allow,o=void 0===i?[]:i,a=t.strategy,s=void 0===a?w.REMOVE:a,l=(0,A.__spreadArray)([],(0,A.__read)(J),!1),u={};try{for(var c=(0,A.__values)(Object.keys(e)),d=c.next();!d.done;d=c.next()){var f=d.value;!function(t){var r=t.toLowerCase();l.find(function(e){return e.toLowerCase()===r})?s===w.REDACT&&(u[t]=nx):o.find(function(e){return e.toLowerCase()===r})?u[t]=e[t]:s===w.REDACT&&(u[t]=nx)}(f)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}return u},nT=function(){function e(e,t,r,n,i,o,a,s,l,u,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=l,this.error=u,this.endTime=c}return e.prototype.toSerializable=function(){var e,t,r,n;
1return 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,A.__spreadArray)([],(0,A.__read)(W),!1)),requestBodySize:null==(t=this.requestWrapper)?void 0:t.bodySize,responseHeaders:null==(r=this.responseWrapper)?void 0:r.headers((0,A.__spreadArray)([],(0,A.__read)(W),!1)),responseBodySize:null==(n=this.responseWrapper)?void 0:n.bodySize}).filter(function(e){var t=(0,A.__read)(e,2);return void 0!==(t[0],t[1])}))},e}(),nS=function(e,t){void 0===t&&(t=en()),this.callback=e,this.id=t},nA=new(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=et();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var e=et();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var r,n,i,o,a,s,l,u,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,p=null==(s=null==(a=null==(o=this.globalScope)?void 0:o.XMLHttpRequest)?void 0:a.prototype)?void 0:s.send,h=null==(c=null==(u=null==(l=this.globalScope)?void 0:l.XMLHttpRequest)?void 0:u.prototype)?void 0:c.setRequestHeader;f&&p&&h&&this.observeXhr(f,p,h);var g=null==(d=this.globalScope)?void 0:d.fetch;g&&this.observeFetch(g),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){var n;try{r.callback(e)}catch(e){null==(n=t.logger)||n.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,l,u,c,d="GET";if("object"==typeof t&&null!==t&&"url"in t&&"method"in t?(l=t.url,d=t.method):l=null==(s=null==t?void 0:t.toString)?void 0:s.call(t),l)try{var f=new URL(l);l="".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&&(u=n.status),i&&(c={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},u=0);var p=Math.floor(performance.now()-a),h=Math.floor(o+p),g=new nT(e,d,o,o,l,r,u,p,n,c,h);this.triggerEventCallbacks(g)}},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,A.__awaiter)(t,void 0,void 0,function(){var t,i,o,a,s;return(0,A.__generator)(this,function(l){switch(l.label){case 0:try{t=this.getTimestamps()}catch(e){null==(a=this.logger)||a.debug("an unexpected error occurred while retrieving timestamps",e)}l.label=1;case 1:return l.trys.push([1,3,,4]),[4,e(r,n)];case 2:return i=l.sent(),[3,4];case 3:return o=l.sent(),[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",r,n?new nv(n):void 0,i?new nb(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){null==(s=this.logger)||s.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,n;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&&(null==(n=t.logger)||n.error("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=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=(0,A.__read)(n,2),s=a[0],l=a[1];try{this.$$AmplitudeAnalyticsEvent=(0,A.__assign)({method:s,url:null==(e=null==l?void 0:l.toString)?void 0:e.call(l),headers:{}},o.getTimestamps())}catch(e){null==(r=o.logger)||r.error("an unexpected error occurred while calling xhr open",e)}return t.apply(this,n)},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],l=i.$$AmplitudeAnalyticsEvent;return i.addEventListener("loadend",function(){var e;try{var t=i.getAllResponseHeaders(),r=i.getResponseHeader("content-length"),n=new nw(i.status,t,r?parseInt(r,10):void 0,a),u=i.$$AmplitudeAnalyticsEvent.headers,c=new ny(s,u);l.status=i.status,o.handleNetworkRequestEvent("xhr",{url:l.url,method:l.method},c,n,void 0,l.startTime,l.durationStart)}catch(t){null==(e=o.logger)||e.error("an unexpected error occurred while handling xhr send",t)}}),r.apply(i,t)},i.setRequestHeader=function(e,t){var r;try{this.$$AmplitudeAnalyticsEvent.headers[e]=t}catch(e){null==(r=o.logger)||r.error("an unexpected error occurred while calling xhr setRequestHeader",e)}n.apply(this,[e,t])}}},e}()),nI="[Amplitude] Network Request",nO="500-599";function nP(e,t){return RegExp("^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$").test(e)}function nC(e,t){var r,n,i=t.split(",");try{for(var o=(0,A.__values)(i),a=o.next();!a.done;a=o.next()){var s=a.value,l=(0,A.__read)(s.split("-").map(Number),2),u=l[0],c=l[1];if(e===u&&void 0===c||e>=u&&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 nR(e){var t;if(e)try{var r=null==(t=et())?void 0:t.location.href,n=new URL(e,r),i=n.searchParams.toString(),o=n.hash.replace("#",""),a=n.href,s=n.host;n.hash="",n.search="";var l=n.href;return{query:i,fragment:o,href:a,hrefWithoutQueryOrHash:l,host:s}}catch(e){return}}function nN(e){return"object"!=typeof e||null===e?e?(0,A.__spreadArray)([],(0,A.__read)(W),!1):void 0:0!==e.length?e:void 0}function nj(e){var t,r;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)}(k||(k={})).NetworkObservable="networkObservable";var nD=function(e){void 0===e&&(e={});var t,r="@amplitude/plugin-network-capture-browser",n=function(){var e,r=new rE(function(e){var r=new nS(function(t){var r={event:t,timestamp:Date.now(),type:"network"};e.next(r)});return nA.subscribe(r,t),function(){nA.unsubscribe(r)}});return(e={})[k.NetworkObservable]=r,e};return{name:r,type:"enrichment",setup:function(i,o){return(0,A.__awaiter)(void 0,void 0,void 0,function(){var a;return(0,A.__generator)(this,function(s){var l,u,c,d,f;return"u"<typeof document?[2]:(a=n(),t=null==i?void 0:i.loggerProvider,u=(l={allObservables:a,networkTrackingOptions:e,amplitude:o,loggerProvider:t}).allObservables,c=l.networkTrackingOptions,d=l.amplitude,f=l.loggerProvider,x=u.networkObservable.filter(function(e){return function(e,t){void 0===t&&(t={});var r,n,i=nR(e.url);if(!i)return!1;var o=i.host;return!(!1!==t.ignoreAmplitudeRequests&&(nP(o,"*.amplitude.com")||nP(o,"amplitude.com"))||(null==(r=t.ignoreHosts)?void 0:r.find(function(e){return nP(o,e)})))&&(!!t.captureRules||void 0===e.status||!!nC(e.status,nO))&&(!t.captureRules||((0,A.__spreadArray)([],(0,A.__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 nP(t,e)}))&&(!n||!e.urls||rL(n,e.urls))&&(!i||!e.methods||e.methods.find(function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})))return(!r&&0!==r||!!nC(r,e.statusCodeRange||nO))&&!0}(t,o,e.status,e.url,e.method)){var r=nN(t.responseHeaders);if(e.responseWrapper&&r){var i=e.responseWrapper.headers(r);i&&(e.responseHeaders=i)}var a=nN(t.requestHeaders);if(e.requestWrapper&&a){var s=e.requestWrapper.headers(a);s&&(e.requestHeaders=s)}e.responseWrapper&&t.responseBody&&!nj(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!nj(t.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,t.requestBody.blocklist))}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===nI}))return!0}catch(e){}return!1}(o,e.requestWrapper))}(e.event,c)}).subscribe(function(e){var t,r,n,i=e.event,o=nR(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,A.__awaiter)(this,void 0,void 0,function(){var i,o,a;return(0,A.__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=A.__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(nI,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,d,f)}}),null==t||t.log("".concat(r," has been successfully added.")),[2])})})},execute:function(e){return(0,A.__awaiter)(void 0,void 0,void 0,function(){return(0,A.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,A.__awaiter)(void 0,void 0,void 0,function(){return(0,A.__generator)(this,function(e){return x.unsubscribe(),[2]})})}}},nL=e.i(291826);function nM(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 nZ=function(){var e=null,t=et(),r=null==t?void 0:t.document,n=null==t?void 0:t.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(t,i){return(0,A.__awaiter)(void 0,void 0,void 0,function(){var o,a;return(0,A.__generator)(this,function(s){return void 0===r||(o=rM((null==n?void 0:n.href)||"",t.loggerProvider),a={"[Amplitude] Page Domain":(null==n?void 0:n.hostname)||"","[Amplitude] Page Location":o,"[Amplitude] Page Path":rM((null==n?void 0:n.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"u">typeof document&&document.title||"","[Amplitude] Page URL":rM(o.split("?")[0],t.loggerProvider)},(0,nL.onLCP)(function(e){a["[Amplitude] LCP"]=nM(e)}),(0,nL.onFCP)(function(e){a["[Amplitude] FCP"]=nM(e)}),(0,nL.onINP)(function(e){a["[Amplitude] INP"]=nM(e)}),(0,nL.onCLS)(function(e){a["[Amplitude] CLS"]=nM(e)}),(0,nL.onTTFB)(function(e){a["[Amplitude] TTFB"]=nM(e)}),e=function(){"hidden"===r.visibilityState&&e&&(i.track("[Amplitude] Web Vitals",a),r.removeEventListener("visibilitychange",e),e=null)},r.addEventListener("visibilitychange",e)),[2]})})},execute:function(e){return(0,A.__awaiter)(void 0,void 0,void 0,function(){return(0,A.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,A.__awaiter)(void 0,void 0,void 0,function(){return(0,A.__generator)(this,function(t){return e&&(null==r||r.removeEventListener("visibilitychange",e)),[2]})})}}},nU=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),["AMP",t,e.substring(0,r)].filter(
1Boolean).join("_")},nF=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},nz=function(e,t,r,n,i){void 0===i&&(i=!0),e.referrer;var o=e.referring_domain,a=(0,A.__rest)(e,["referrer","referring_domain"]),s=t||{},l=(s.referrer,s.referring_domain),u=(0,A.__rest)(s,["referrer","referring_domain"]);if(nq(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 c=JSON.stringify(a)!==JSON.stringify(u),d=nF(o||"")!==nF(l||""),f=!t||c||d;return f?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."),f},nq=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})},n$=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},nB=function(){function e(e,t){var r;this.shouldTrackNewCampaign=!1,this.options=(0,A.__assign)({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:n$(null==(r=t.cookieOptions)?void 0:r.domain)},e),this.storage=t.cookieStorage,this.storageKey=nU(t.apiKey,"MKTG"),this.webExpStorageKey=nU(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=H,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return(0,A.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,A.__generator)(this,function(r){switch(r.label){case 0:return[4,this.fetchCampaign()];case 1:if(t=A.__read.apply(void 0,[r.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||ej(this.sessionTimeout,this.lastEventTime),!nz(this.currentCampaign,this.previousCampaign,this.options,this.logger,e))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,A.__awaiter)(this,void 0,void 0,function(){var e;return(0,A.__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 tY().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,eo(Object.entries((0,A.__assign)((0,A.__assign)({},H),t)).reduce(function(e,t){var n,i=(0,A.__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 Y)));return e&&(n.event_id=e),n},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),nV="AMP_CURRENT_PAGE",nK="AMP_PREVIOUS_PAGE",nH="AMP_URL_INFO";(c=E||(E={})).Direct="direct",c.Internal="internal",c.External="external";var nW=new Set([g.IDENTIFY,g.GROUP_IDENTIFY,g.REVENUE]),nJ=function(e){var t=(void 0===e?{}:e).internalDomains,r=void 0===t?[]:t,n=et(),i=void 0,o=!1,a=void 0,s=!1,l=!1,u=function(e){var t;try{var r=rM(e,a);t=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?u(e):void 0;if(!n)return E.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?E.Internal:E.External},d=function(){(0,A.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n,a;return(0,A.__generator)(this,function(s){switch(s.label){case 0:if(!(i&&o))return[3,3];return[4,i.get(nH)];case 1:return e=s.sent(),t=rM("u">typeof location&&location.href||""),r=(null==e?void 0:e[nV])||"",n=void 0,n=t===r?(null==e?void 0:e[nK])||"":r||document.referrer||"",[4,i.set(nH,((a={})[nV]=t,a[nK]=n,a))];case 2:s.sent(),s.label=3;case 3:return[2]}})})};return{name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return(0,A.__awaiter)(void 0,void 0,void 0,function(){return(0,A.__generator)(this,function(t){switch(t.label){case 0:if((a=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),l=!0,!n)return[3,2];return[4,(i=new t_(n.sessionStorage)).isEnabled()];case 1:o=t.sent(),n.addEventListener("popstate",d),s||(n.history.pushState=new Proxy(n.history.pushState,{apply:function(e,t,r){var n=(0,A.__read)(r,3),i=n[0],o=n[1],a=n[2];e.apply(t,[i,o,a]),l&&d()}}),n.history.replaceState=new Proxy(n.history.replaceState,{apply:function(e,t,r){var n=(0,A.__read)(r,3),i=n[0],o=n[1],a=n[2];e.apply(t,[i,o,a]),l&&d()}}),s=!0),t.label=2;case 2:return[2]}})})},execute:function(e){return(0,A.__awaiter)(void 0,void 0,void 0,function(){var t,r,n,a,s;return(0,A.__generator)(this,function(l){switch(l.label){case 0:if(t=rM("u">typeof location&&location.href||""),!(i&&o))return[3,5];return[4,i.get(nH)];case 1:if(null==(r=l.sent())?void 0:r[nV])return[3,3];return[4,i.set(nH,((s={})[nV]=t,s[nK]=document.referrer||"",s))];case 2:l.sent(),l.label=3;case 3:return[4,i.get(nH)];case 4:if(n=l.sent(),a="",n&&(a=n[nK]||""),nW.has(e.event_type))return[2,e];e.event_properties=(0,A.__assign)((0,A.__assign)({},e.event_properties||{}),{"[Amplitude] Page Domain":nG(e,"[Amplitude] Page Domain","u">typeof location&&location.hostname||""),"[Amplitude] Page Location":nG(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":nG(e,"[Amplitude] Page Path","u">typeof location&&rM(location.pathname)||""),"[Amplitude] Page Title":nG(e,"[Amplitude] Page Title",tX(tG)),"[Amplitude] Page URL":nG(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":a,"[Amplitude] Previous Page Type":c(a)}),l.label=5;case 5:return[2,e]}})})},teardown:function(){return(0,A.__awaiter)(void 0,void 0,void 0,function(){return(0,A.__generator)(this,function(e){switch(e.label){case 0:if(n&&(n.removeEventListener("popstate",d),l=!1),!(i&&o))return[3,2];return[4,i.set(nH,{})];case 1:e.sent(),e.label=2;case 2:return[2]}})})}}};function nG(e,t,r){return(e.event_properties||(e.event_properties={}),void 0===e.event_properties[t])?r:e.event_properties[t]}let nX={init:R((d=new(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return(0,A.__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),el(this._init((0,A.__assign)((0,A.__assign)({},i),{userId:n,apiKey:e})))},t.prototype._init=function(t){var r,n,i,o,a,s,l;return(0,A.__awaiter)(this,void 0,void 0,function(){var u,c,d,f,p,h,g,m,v,y,_,b,w,k=this;return(0,A.__generator)(this,function(x){var E,T,S,I,O,P,C;switch(x.label){case 0:if(this.initializing)return[2];if(this.initializing=!0,u=t$(t),c=null!=(r=t.loggerProvider)?r:new ef,d=null!=(n=t.serverZone)?n:"US",p=this._diagnosticsSampleRate,h=null==(i=t.enableDiagnostics)||i,!u)return[3,2];return f=new eU(t.apiKey,c,d,null==(o=t.remoteConfig)?void 0:o.serverUrl),[4,new Promise(function(e){null==f||f.subscribe("configs.diagnostics.browserSDK","all",function(t,r,n){if(c.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&&(h=o)}e()})})];case 1:x.sent(),x.label=2;case 2:return(g=new e0(t.apiKey,c,d,{enabled:h,sampleRate:p})).setTag("library","".concat(tl,"/").concat(ts)),"u">typeof navigator&&g.setTag("user_agent",navigator.userAgent),[4,(E=t.a
1piKey,T=t,S=this,I=g,O={loggerProvider:c,serverZone:d,enableDiagnostics:h,diagnosticsSampleRate:p},void 0===T&&(T={}),(0,A.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n,i,o,a,s,l,u,c,d,f,p,h,g,m,v,y,_,b,w,k,x,P,C,R,N,j,D,L,M,Z,U,F,z,q,$,B,V,K,H,W,J,G,X,Y,Q,ee,et;return(0,A.__generator)(this,function(er){switch(er.label){case 0:if(e=T.identityStorage||tF,w={},e===tF)return[3,1];return r="",[3,5];case 1:if(null==(x=null==(k=T.cookieOptions)?void 0:k.domain))return[3,2];return n=x,[3,4];case 2:return[4,(0,A.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n,i,o,a;return(0,A.__generator)(this,function(s){switch(s.label){case 0:return[4,new td().isEnabled()];case 1:if(!s.sent()||"u"<typeof location||!location.hostname)return[2,""];for(e=(0,location.hostname).split("."),t=[],r=en(),n="AMP_TLDTEST_".concat(r.substring(0,8)),i=e.length-2;i>=0;--i)t.push(e.slice(i).join("."));i=0,s.label=2;case 2:if(!(i<t.length))return[3,7];return[4,(a=new td({domain:"."+(o=t[i]),expirationDays:.003})).set(n,1)];case 3:return s.sent(),[4,a.get(n)];case 4:if(!s.sent())return[3,6];return[4,a.remove(n)];case 5:return s.sent(),[2,"."+o];case 6:return i++,[3,2];case 7:return[2,""]}})})];case 3:n=er.sent(),er.label=4;case 4:r=n,er.label=5;case 5:var ei,eo;return t=A.__assign.apply(void 0,[(w.domain=r,w.expiration=365,w.sameSite="Lax",w.secure=!1,w.upgrade=!0,w),T.cookieOptions]),i={duplicateResolverFn:function(e){var r=th(e);return!!r&&tg(JSON.parse(r).cookieDomain,t.domain)},diagnosticsClient:I},[4,(ei=o=tq(T.identityStorage,t,i),void 0===(eo=null==(C=null==(P=T.cookieOptions)?void 0:P.upgrade)||C)&&(eo=!0),(0,A.__awaiter)(void 0,void 0,void 0,function(){var e,t,r,n,i,o,a,s,l;return(0,A.__generator)(this,function(u){switch(u.label){case 0:return e="".concat("amp","_").concat(E.substring(0,6)),[4,ei.getRaw(e)];case 1:if(!(t=u.sent()))return[2,{optOut:!1}];if(!eo)return[3,3];return[4,ei.remove(e)];case 2:u.sent(),u.label=3;case 3:return n=(r=(0,A.__read)(t.split("."),6))[0],i=r[1],o=r[2],a=r[3],s=r[4],l=r[5],[2,{deviceId:n,userId:tT(i),sessionId:tE(a),lastEventId:tE(l),lastEventTime:tE(s),optOut:!!o}]}})}))];case 6:return a=er.sent(),[4,o.get(tm(E))];case 7:return s=er.sent(),c=!(u=(l=eL()).ampTimestamp?Number(l.ampTimestamp):void 0)||Date.now()<u,d=null!=(L=null!=(D=null!=(j=null!=(R=T.deviceId)?R:c?null!=(N=l.ampDeviceId)?N:l.deviceId:void 0)?j:null==s?void 0:s.deviceId)?D:a.deviceId)?L:en(),f=null!=(M=null==s?void 0:s.lastEventId)?M:a.lastEventId,p=null!=(Z=null==s?void 0:s.lastEventTime)?Z:a.lastEventTime,h=null!=(F=null!=(U=T.optOut)?U:null==s?void 0:s.optOut)?F:a.optOut,g=null!=(z=null==s?void 0:s.sessionId)?z:a.sessionId,m=null!=($=null!=(q=T.userId)?q:null==s?void 0:s.userId)?$:a.userId,S.previousSessionDeviceId=null!=(B=null==s?void 0:s.deviceId)?B:a.deviceId,S.previousSessionUserId=null!=(V=null==s?void 0:s.userId)?V:a.userId,v={ipAddress:null==(H=null==(K=T.trackingOptions)?void 0:K.ipAddress)||H,language:null==(J=null==(W=T.trackingOptions)?void 0:W.language)||J,platform:null==(X=null==(G=T.trackingOptions)?void 0:G.platform)||X},y=null==s?void 0:s.pageCounter,_=null==s?void 0:s.debugLogsEnabled,void 0!==T.autocapture&&(T.defaultTracking=T.autocapture),[4,(b=new tz(E,T.appVersion,o,t,T.defaultTracking,T.autocapture,d,T.flushIntervalMillis,T.flushMaxRetries,T.flushQueueSize,e,T.ingestionMetadata,T.instanceName,f,p,null!=(Y=null==O?void 0:O.loggerProvider)?Y:T.loggerProvider,T.logLevel,T.minIdLength,T.offline,h,T.partnerId,T.plan,T.serverUrl,null!=(Q=null==O?void 0:O.serverZone)?Q:T.serverZone,g,T.sessionTimeout,T.storageProvider,v,T.transport,T.useBatch,T.fetchRemoteConfig,m,y,_,T.networkTrackingOptions,T.identify,null!=(ee=null==O?void 0:O.enableDiagnostics)?ee:T.enableDiagnostics,null!=(et=null==O?void 0:O.diagnosticsSampleRate)?et:S._diagnosticsSampleRate,I,T.remoteConfig)).storageProvider.isEnabled()];case 8:return er.sent()||(b.loggerProvider.warn("Storage provider ".concat(b.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),b.storageProvider=new tc),[2,b]}})}))];case 3:if(m=x.sent(),!(u&&f))return[3,5];return[4,new Promise(function(e){null==f||f.subscribe("configs.analyticsSDK.browserSDK","all",function(t,r,n){m.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t&&function(e,t){if(e){!function e(t){if("object"==typeof t&&null!==t&&!Array.isArray(t)){var r,n,i,o,a,s,l,u,c,d,f,p=Object.keys(t);try{for(var h=(0,A.__values)(p),g=h.next();!g.done;g=h.next()){var m=g.value;try{var v=t[m];"boolean"==typeof(null==v?void 0:v.enabled)&&(v.enabled?(delete v.enabled,0===Object.keys(v).length&&(t[m]=!0)):t[m]=!1),e(v)}catch(e){}}}catch(e){r={error:e}}finally{try{g&&!g.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}
1try{if(null==(c=null==(u=null==(l=t.autocapture)?void 0:l.networkTracking)?void 0:u.captureRules)?void 0:c.length)try{for(var y=(0,A.__values)(t.autocapture.networkTracking.captureRules),_=y.next();!_.done;_=y.next()){var b=_.value;try{for(var w=(a=void 0,(0,A.__values)(["responseHeaders","requestHeaders"])),k=w.next();!k.done;k=w.next()){var x=k.value,E=null!=(d=b[x])?d:{},T=E.captureSafeHeaders,S=E.allowlist;if(T||S){if(void 0!==S&&!Array.isArray(S)){delete b[x];continue}b[x]=(0,A.__spreadArray)((0,A.__spreadArray)([],(0,A.__read)(T?W:[]),!1),(0,A.__read)(null!=S?S:[]),!1)}}}catch(e){a={error:e}}finally{try{k&&!k.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}}}catch(e){i={error:e}}finally{try{_&&!_.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}}catch(e){}var I=null==(f=t.autocapture)?void 0:f.frustrationInteractions;I&&(I.rageClick&&(I.rageClicks=I.rageClick,delete I.rageClick),I.deadClick&&(I.deadClicks=I.deadClick,delete I.deadClick))}}(e);try{var r,n,i,o,a,s,l;if(t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e)),e&&"autocapture"in e){if("boolean"==typeof e.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture&&null!==e.autocapture){var u=(0,A.__assign)({},e.autocapture);if(void 0===t.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture.elementInteractions&&null!==e.autocapture.elementInteractions&&(null==(i=e.autocapture.elementInteractions.pageUrlAllowlistRegex)?void 0:i.length)){u.elementInteractions=(0,A.__assign)({},e.autocapture.elementInteractions);var c=u.elementInteractions,d=null!=(o=c.pageUrlAllowlist)?o:[],f=e.autocapture.elementInteractions.pageUrlAllowlistRegex;c.pageUrlAllowlist=rt(d,f,t),delete c.pageUrlAllowlistRegex}if("object"==typeof e.autocapture.networkTracking&&null!==e.autocapture.networkTracking&&(null==(a=e.autocapture.networkTracking.captureRules)?void 0:a.length)){u.networkTracking=(0,A.__assign)({},e.autocapture.networkTracking);var p=null!=(s=u.networkTracking.captureRules)?s:[];try{for(var h=(0,A.__values)(p),g=h.next();!g.done;g=h.next()){var m=g.value;m.urls=rt(null!=(l=m.urls)?l:[],m.urlsRegex,t),delete m.urlsRegex}}catch(e){r={error:e}}finally{try{g&&!g.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}}"boolean"==typeof t.autocapture&&(t.autocapture=(0,A.__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},u)),"object"==typeof t.autocapture&&(t.autocapture=(0,A.__assign)((0,A.__assign)({},t.autocapture),u))}t.defaultTracking=t.autocapture}t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(e){t.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}(t,m),e()})})];case 4:x.sent(),x.label=5;case 5:return[4,e.prototype._init.call(this,m)];case 6:if(x.sent(),this.logBrowserOptions(m),this.config.remoteConfigClient=f,!e2(this.config.defaultTracking))return[3,8];return v=e2((P=this.config).defaultTracking)&&P.defaultTracking&&"object"==typeof P.defaultTracking&&P.defaultTracking.attribution&&"object"==typeof P.defaultTracking.attribution?(0,A.__assign)({},P.defaultTracking.attribution):{},this.webAttribution=new nB(v,this.config),[4,this.webAttribution.init()];case 7:x.sent(),x.label=8;case 8:if(b=!(!(_=(y=eL()).ampTimestamp?Number(y.ampTimestamp):void 0)||Date.now()<_)||Number.isNaN(Number(y.ampSessionId))?void 0:Number(y.ampSessionId),this.setSessionId(null!=(l=null!=(s=null!=(a=t.sessionId)?a:b)?s:this.config.sessionId)?l:Date.now()),(w=eC(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline)return[3,10];return[4,this.add(re()).promise];case 9:x.sent(),x.label=10;case 10:return[4,this.add(new e_({diagnosticsClient:g})).promise];case 11:return x.sent(),[4,this.add(new tu).promise];case 12:return x.sent(),[4,this.add(new eD).promise];case 13:if(x.sent(),t8(this.config),!e1(this.config.defaultTracking,"fileDownloads"))return[3,15];return this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(t6()).promise];case 14:x.sent(),x.label=15;case 15:if(!e4(this.config.defaultTracking))return[3,17];return this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(t3()).promise];case 16:x.sent(),x.label=17;case 17:if(!e3(this.config.defaultTracking))return[3,19];return this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(t0(tr(this.config))).promise];case 18:x.sent(),x.label=19;case 19:if(!e6(this.config.autocapture))return[3,21];return this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(na(e8(this.config),{diagnosticsClient:g})).promise];case 20:x.sent(),x.label=21;case 21:if(!e7(this.config.autocapture))return[3,23];return this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(np(te(this.config))).promise];case 22:x.sent(),x.label=23;case 23:if(!e5(this.config.autocapture))return[3,25];return this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(nD(tt(this.config))).promise];case 24:x.sent(),x.label=25;case 25:if(!("boolean"==typeof(C=this.config.autocapture)?C:"object"==typeof C&&!0===C.webVitals))return[3,27];return this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(nZ()).promise];case 26:x.sent(),x.label=27;case 27:if(!e1(this.config.autocapture,"pageUrlEnrichment"))return[3,29];return this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(nJ()).promise];case 28:x.sent(),x.label=29;case 29:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 30:return x.sent(),w.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{},r=t.time,n=(0,A.__rest)(t,["time"]);k.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}),eR(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}),eN(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(en()),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.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)),el(Promise.resolve());if(e===this.config.sessionId)return el(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,e9(this.config.defaultTracking)&&(n&&i&&r.push(this.track(tC,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(eo(this.config.identify)).promise),e9(this.config.defaultTracking)&&r.push(this.track(tP,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,el(Promise.all(r))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=
1Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=tB(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,r){if(to(t)){var n=t._q;t._q=[],t=ti(new Y,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(to(n)){var o=n._q;n._q=[],n=ti(new Y,o)}return e.prototype.groupIdentify.call(this,t,r,n,i)},t.prototype.revenue=function(t,r){if(to(t)){var n=t._q;t._q=[],t=ti(new eb,n)}return e.prototype.revenue.call(this,t,r)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)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,A.__awaiter)(this,void 0,void 0,function(){var r,n,i;return(0,A.__generator)(this,function(o){return r=Date.now(),n=ej(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type!==tP&&t.event_type!==tC&&(!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()),t.event_type===g.IDENTIFY&&t.user_properties&&(this.userProperties=this.getOperationAppliedUserProperties(t.user_properties)),[2,e.prototype.process.call(this,t)]})})},t.prototype.logBrowserOptions=function(e){try{var t=(0,A.__assign)((0,A.__assign)({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",JSON.stringify(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}(eu))).init.bind(d),"init",O(d),C(d,["config"])),add:R(d.add.bind(d),"add",O(d),C(d,["config.apiKey","timeline.plugins"])),remove:R(d.remove.bind(d),"remove",O(d),C(d,["config.apiKey","timeline.plugins"])),track:R(d.track.bind(d),"track",O(d),C(d,["config.apiKey","timeline.queue.length"])),logEvent:R(d.logEvent.bind(d),"logEvent",O(d),C(d,["config.apiKey","timeline.queue.length"])),identify:R(d.identify.bind(d),"identify",O(d),C(d,["config.apiKey","timeline.queue.length"])),groupIdentify:R(d.groupIdentify.bind(d),"groupIdentify",O(d),C(d,["config.apiKey","timeline.queue.length"])),setGroup:R(d.setGroup.bind(d),"setGroup",O(d),C(d,["config.apiKey","timeline.queue.length"])),revenue:R(d.revenue.bind(d),"revenue",O(d),C(d,["config.apiKey","timeline.queue.length"])),flush:R(d.flush.bind(d),"flush",O(d),C(d,["config.apiKey","timeline.queue.length"])),getUserId:R(d.getUserId.bind(d),"getUserId",O(d),C(d,["config","config.userId"])),setUserId:R(d.setUserId.bind(d),"setUserId",O(d),C(d,["config","config.userId"])),getDeviceId:R(d.getDeviceId.bind(d),"getDeviceId",O(d),C(d,["config","config.deviceId"])),setDeviceId:R(d.setDeviceId.bind(d),"setDeviceId",O(d),C(d,["config","config.deviceId"])),reset:R(d.reset.bind(d),"reset",O(d),C(d,["config","config.userId","config.deviceId"])),getSessionId:R(d.getSessionId.bind(d),"getSessionId",O(d),C(d,["config"])),setSessionId:R(d.setSessionId.bind(d),"setSessionId",O(d),C(d,["config"])),extendSession:R(d.extendSession.bind(d),"extendSession",O(d),C(d,["config"])),setOptOut:R(d.setOptOut.bind(d),"setOptOut",O(d),C(d,["config"])),setTransport:R(d.setTransport.bind(d),"setTransport",O(d),C(d,["config"])),getIdentity:R(d.getIdentity.bind(d),"getIdentity",O(d),C(d,["config"])),getOptOut:R(d.getOptOut.bind(d),"getOptOut",O(d),C(d,["config"])),_setDiagnosticsSampleRate:R(d._setDiagnosticsSampleRate.bind(d),"_setDiagnosticsSampleRate",O(d),C(d,["config"]))};e.s([],641521),e.i(641521),(f=T||(T={})).US="US",f.EU="EU",f.STAGING="STAGING",e.s(["DEFAULT_ACTION_CLICK_ALLOWLIST",0,ri,"DEFAULT_CSS_SELECTOR_ALLOWLIST",0,rr,"DEFAULT_DATA_ATTRIBUTE_PREFIX",0,rn,"IdentifyOperation",0,h,"LogLevel",0,p,"OfflineDisabled",0,null,"RevenueProperty",0,y,"ServerZone",0,T,"SpecialEventType",0,g],991973),e.i(991973),nX.add,nX.extendSession,nX.flush,nX.getDeviceId,nX.getIdentity,nX.getOptOut,nX.getSessionId,nX.getUserId,nX.groupIdentify,nX.identify;var nY=nX.init,nQ=(nX.logEvent,nX.remove,nX.reset,nX.revenue,nX.setDeviceId,nX.setGroup,nX.setOptOut,nX.setSessionId,nX.setTransport,nX.setUserId),n0=nX.track;nX._setDiagnosticsSampleRate;var n1=e.i(69431);function n2(e){try{let t=e.split(".")[1];if(!t)return null;let r=t.replace(/-/g,"+").replace(/_/g,"/"),n=JSON.parse(atob(r));return n.transformed_sub||n.transfromed_sub||null}catch{return null}}function n4(){return!!(0,n1.isProduction)()||"true"===S.default.env.NEXT_PUBLIC_AMPLITUDE_DEV}e.s(["decodeJWT",0,e=>{try{if(!e)return null;let t=e.split(".")[1];if(!t)return null;let r=t.replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(r).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(n)}catch(e){return console.error("Error decoding JWT:",e),null}},"extractTransformedSub",0,n2],135382);let n3=(()=>
1{if("u">typeof navigator)try{return new Intl.Locale(navigator.language).region||void 0}catch{return}})(),n9=(e,t)=>{if(!n4())return{promise:Promise.resolve({event:{event_type:e},code:200,message:"Development mode - event not sent"})};let r={...t,source_platform:"webapp",...n3&&{source_country:n3}};(0,n1.isProduction)()||console.debug("[Amplitude]",e,r);try{let t=n0(e,r);return t.promise.catch(()=>{}),t}catch(t){return{promise:Promise.resolve({event:{event_type:e},code:200,message:"Analytics error caught - event not sent"})}}};e.s(["getAmplitudeUserId",0,function(e,t){if(e)return n2(e)??t??void 0},"init",0,(e,t)=>n4()&&e?nY(e,t):{promise:Promise.resolve()},"setUserId",0,function(e){n4()&&nQ(e)},"track",0,n9,"trackAmplitude",0,n9],977981)},340974,207670,919056,e=>{"use strict";var t=e.i(247167);function r(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=function e(t){var r,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(r=0;r<o;r++)t[r]&&(n=e(t[r]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}(e))&&(n&&(n+=" "),n+=t);return n}e.s(["clsx",0,r,"default",0,r],207670);let n=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),i=[],o=(e,t,r)=>{if(0==e.length-t)return r.classGroupId;let n=e[t],i=r.nextPart.get(n);if(i){let r=o(e,t+1,i);if(r)return r}let a=r.validators;if(null===a)return;let s=0===t?e.join("-"):e.slice(t).join("-"),l=a.length;for(let e=0;e<l;e++){let t=a[e];if(t.validator(s))return t.classGroupId}},a=(e,t)=>{let r=n();for(let n in e)s(e[n],r,n,t);return r},s=(e,t,r,n)=>{let i=e.length;for(let o=0;o<i;o++)l(e[o],t,r,n)},l=(e,t,r,n)=>{"string"==typeof e?u(e,t,r):"function"==typeof e?c(e,t,r,n):d(e,t,r,n)},u=(e,t,r)=>{(""===e?t:f(t,e)).classGroupId=r},c=(e,t,r,n)=>{p(e)?s(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:r,validator:e}))},d=(e,t,r,n)=>{let i=Object.entries(e),o=i.length;for(let e=0;e<o;e++){let[o,a]=i[e];s(a,f(t,o),r,n)}},f=(e,t)=>{let r=e,i=t.split("-"),o=i.length;for(let e=0;e<o;e++){let t=i[e],o=r.nextPart.get(t);o||(o=n(),r.nextPart.set(t,o)),r=o}return r},p=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,h=[],g=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),m=/\s+/,v=e=>{let t;if("string"==typeof e)return e;let r="";for(let n=0;n<e.length;n++)e[n]&&(t=v(e[n]))&&(r&&(r+=" "),r+=t);return r},y=[],_=e=>{let t=t=>t[e]||y;return t.isThemeGetter=!0,t},b=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,w=/^\((?:(\w[\w-]*):)?(.+)\)$/i,k=/^\d+\/\d+$/,x=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,E=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,T=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,S=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,A=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,I=e=>k.test(e),O=e=>!!e&&!Number.isNaN(Number(e)),P=e=>!!e&&Number.isInteger(Number(e)),C=e=>e.endsWith("%")&&O(e.slice(0,-1)),R=e=>x.test(e),N=()=>!0,j=e=>E.test(e)&&!T.test(e),D=()=>!1,L=e=>S.test(e),M=e=>A.test(e),Z=e=>!F(e)&&!K(e),U=e=>Q(e,en,D),F=e=>b.test(e),z=e=>Q(e,ei,j),q=e=>Q(e,eo,O),$=e=>Q(e,et,D),B=e=>Q(e,er,M),V=e=>Q(e,es,L),K=e=>w.test(e),H=e=>ee(e,ei),W=e=>ee(e,ea),J=e=>ee(e,et),G=e=>ee(e,en),X=e=>ee(e,er),Y=e=>ee(e,es,!0),Q=(e,t,r)=>{let n=b.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},ee=(e,t,r=!1)=>{let n=w.exec(e);return!!n&&(n[1]?t(n[1]):r)},et=e=>"position"===e||"percentage"===e,er=e=>"image"===e||"url"===e,en=e=>"length"===e||"size"===e||"bg-size"===e,ei=e=>"length"===e,eo=e=>"number"===e,ea=e=>"family-name"===e,es=e=>"shadow"===e,el=((e,...t)=>{let r,n,s,l,u=e=>{let t=n(e);if(t)return t;let i=((e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:o}=t,a=[],s=e.trim().split(m),l="";for(let e=s.length-1;e>=0;e-=1){let t=s[e],{isExternal:u,modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=r(t);if(u){l=t+(l.length>0?" "+l:l);continue}let h=!!p,g=n(h?f.substring(0,p):f);if(!g){if(!h||!(g=n(f))){l=t+(l.length>0?" "+l:l);continue}h=!1}let m=0===c.length?"":1===c.length?c[0]:o(c).join(":"),v=d?m+"!":m,y=v+g;if(a.indexOf(y)>-1)continue;a.push(y);let _=i(g,h);for(let e=0;e<_.length;++e){let t=_[e];a.push(v+t)}l=t+(l.length>0?" "+l:l)}return l})(e,r);return s(e,i),i};return l=c=>{var d;let f;return n=(r={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null),i=(i,o)=>{r[i]=o,++t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(i(e,t),t):void 0},set(e,t){e in r?r[e]=t:i(e,t)}}})((d=t.reduce((e,t)=>
1t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:r}=e,n=e=>{let t,r=[],n=0,i=0,o=0,a=e.length;for(let s=0;s<a;s++){let a=e[s];if(0===n&&0===i){if(":"===a){r.push(e.slice(o,s)),o=s+1;continue}if("/"===a){t=s;continue}}"["===a?n++:"]"===a?n--:"("===a?i++:")"===a&&i--}let s=0===r.length?e:e.slice(o),l=s,u=!1;return s.endsWith("!")?(l=s.slice(0,-1),u=!0):s.startsWith("!")&&(l=s.slice(1),u=!0),g(r,u,l,t&&t>o?t-o:void 0)};if(t){let e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):g(h,!1,t,void 0,!0)}if(r){let e=n;n=t=>r({className:t,parseClassName:e})}return n})(d),sortModifiers:(f=new Map,d.orderSensitiveModifiers.forEach((e,t)=>{f.set(e,1e6+t)}),e=>{let t=[],r=[];for(let n=0;n<e.length;n++){let i=e[n],o="["===i[0],a=f.has(i);o||a?(r.length>0&&(r.sort(),t.push(...r),r=[]),t.push(i)):r.push(i)}return r.length>0&&(r.sort(),t.push(...r)),t}),...(e=>{let t=(e=>{let{theme:t,classGroups:r}=e;return a(r,t)})(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var r;let t,n,i;return -1===(r=e).slice(1,-1).indexOf(":")?void 0:(n=(t=r.slice(1,-1)).indexOf(":"),(i=t.slice(0,n))?"arbitrary.."+i:void 0)}let n=e.split("-"),i=+(""===n[0]&&n.length>1);return o(n,i,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=n[e],o=r[e];if(t){if(o){let e=Array(o.length+t.length);for(let t=0;t<o.length;t++)e[t]=o[t];for(let r=0;r<t.length;r++)e[o.length+r]=t[r];return e}return t}return o||i}return r[e]||i}}})(d)}).cache.get,s=r.cache.set,l=u,u(c)},(...e)=>l(((...e)=>{let t,r,n=0,i="";for(;n<e.length;)(t=e[n++])&&(r=v(t))&&(i&&(i+=" "),i+=r);return i})(...e))})(()=>{let e=_("color"),t=_("font"),r=_("text"),n=_("font-weight"),i=_("tracking"),o=_("leading"),a=_("breakpoint"),s=_("container"),l=_("spacing"),u=_("radius"),c=_("shadow"),d=_("inset-shadow"),f=_("text-shadow"),p=_("drop-shadow"),h=_("blur"),g=_("perspective"),m=_("aspect"),v=_("ease"),y=_("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...w(),K,F],x=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],T=()=>[K,F,l],S=()=>[I,"full","auto",...T()],A=()=>[P,"none","subgrid",K,F],j=()=>["auto",{span:["full",P,K,F]},P,K,F],D=()=>[P,"auto",K,F],L=()=>["auto","min","max","fr",K,F],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],ee=()=>["auto",...T()],et=()=>[I,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],er=()=>[e,K,F],en=()=>[...w(),J,$,{position:[K,F]}],ei=()=>["no-repeat",{repeat:["","x","y","space","round"]}],eo=()=>["auto","cover","contain",G,U,{size:[K,F]}],ea=()=>[C,H,z],es=()=>["","none","full",u,K,F],el=()=>["",O,H,z],eu=()=>["solid","dashed","dotted","double"],ec=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ed=()=>[O,C,J,$],ef=()=>["","none",h,K,F],ep=()=>["none",O,K,F],eh=()=>["none",O,K,F],eg=()=>[O,K,F],em=()=>[I,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[R],breakpoint:[R],color:[N],container:[R],"drop-shadow":[R],ease:["in","out","in-out"],font:[Z],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[R],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[R],shadow:[R],spacing:["px",O],text:[R],"text-shadow":[R],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",I,F,K,m]}],container:["container"],columns:[{columns:[O,F,K,s]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:S()}],"inset-x":[{"inset-x":S()}],"inset-y":[{"inset-y":S()}],start:[{start:S()}],end:[{end:S()}],top:[{top:S()}
vendor: 11,371 bytes, line 1
1],right:[{right:S()}],bottom:[{bottom:S()}],left:[{left:S()}],visibility:["visible","invisible","collapse"],z:[{z:[P,"auto",K,F]}],basis:[{basis:[I,"full","auto",s,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[O,I,"auto","initial","none",F]}],grow:[{grow:["",O,K,F]}],shrink:[{shrink:["",O,K,F]}],order:[{order:[P,"first","last","none",K,F]}],"grid-cols":[{"grid-cols":A()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":A()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:ee()}],mx:[{mx:ee()}],my:[{my:ee()}],ms:[{ms:ee()}],me:[{me:ee()}],mt:[{mt:ee()}],mr:[{mr:ee()}],mb:[{mb:ee()}],ml:[{ml:ee()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:et()}],w:[{w:[s,"screen",...et()]}],"min-w":[{"min-w":[s,"screen","none",...et()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...et()]}],h:[{h:["screen","lh",...et()]}],"min-h":[{"min-h":["screen","lh","none",...et()]}],"max-h":[{"max-h":["screen","lh",...et()]}],"font-size":[{text:["base",r,H,z]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,K,q]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",C,F]}],"font-family":[{font:[W,F,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,K,F]}],"line-clamp":[{"line-clamp":[O,"none",K,q]}],leading:[{leading:[o,...T()]}],"list-image":[{"list-image":["none",K,F]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",K,F]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:er()}],"text-color":[{text:er()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...eu(),"wavy"]}],"text-decoration-thickness":[{decoration:[O,"from-font","auto",K,z]}],"text-decoration-color":[{decoration:er()}],"underline-offset":[{"underline-offset":[O,"auto",K,F]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",K,F]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",K,F]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:en()}],"bg-repeat":[{bg:ei()}],"bg-size":[{bg:eo()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},P,K,F],radial:["",K,F],conic:[P,K,F]},X,B]}],"bg-color":[{bg:er()}],"gradient-from-pos":[{from:ea()}],"gradient-via-pos":[{via:ea()}],"gradient-to-pos":[{to:ea()}],"gradient-from":[{from:er()}],"gradient-via":[{via:er()}],"gradient-to":[{to:er()}],rounded:[{rounded:es()}],"rounded-s":[{"rounded-s":es()}],"rounded-e":[{"rounded-e":es()}],"rounded-t":[{"rounded-t":es()}],"rounded-r":[{"rounded-r":es()}],"rounded-b":[{"rounded-b":es()}],"rounded-l":[{"rounded-l":es()}],"rounded-ss":[{"rounded-ss":es()}],"rounded-se":[{"rounded-se":es()}],"rounded-ee":[{"rounded-ee":es()}],"rounded-es":[{"rounded-es":es()}],"rounded-tl":[{"rounded-tl":es()}],"rounded-tr":[{"rounded-tr":es()}],"rounded-br":[{"rounded-br":es()}],"rounded-bl":[{"rounded-bl":es()}],"border-w":[{border:el()}],"border-w-x":[{"border-x":el()}],"border-w-y":[{"border-y":el()}],"border-w-s":[{"border-s":el()}],"border-w-e":[{"border-e":el()}],"border-w-t":[{"border-t":el()}],"border-w-r":[{"border-r":el()}],"border-w-b":[{"border-b":el()}],"border-w-l":[{"border-l":el()}],"divide-x":[{"divide-x":el()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":el()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...eu(),"hidden","none"]}],"divide-style":[{divide:[...eu(),"hidden","none"]}],"border-color":[{border:er()}],"border-color-x":[{"border-x":er()}],"border-color-y":[{"border-y":er()}],"border-color-s":[{"border-s":er()}],"border-color-e":[{"border-e":er()}],"border-color-t":[{"border-t":er()}],"border-color-r":[{"border-r":er()}],"border-color-b":[{"border-b":er()}],"border-color-l":[{"border-l":er()}],"divide-color":[{divide:er()}],"outline-style":[{outline:[...eu(),"none","hidden"]}],"outline-offset":[{"outline-offset":[O,K,F]}],"outline-w":[{outline:["",O,H,z]}],"outline-color":[{outline:er()}],shadow:[{shadow:["","none",c,Y,V]}],"shadow-color":[{shadow:er()}],"inset-shadow":[{"inset-shadow":["none",d,Y,V]}],"inset-shadow-color":[{"inset-shadow":er()}],"ring-w":[{ring:el()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:er()}],"ring-offset-w":[{"ring-offset":[O,z]}],"ring-offset-color":[{"ring-offset":er()}],"inset-ring-w":[{"inset-ring":el()}],"inset-ring-color":[{"inset-ring":er()}],"text-shadow":[{"text-shadow":["none",f,Y,V]}],"text-shadow-color":[{"text-shadow":er()}],opacity:[{opacity:[O,K,F]}],"mix-blend":[{"mix-blend":[...ec(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ec()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[O]}],"mask-image-linear-from-pos":[{"mask-linear-from":ed()}],"mask-image-linear-to-pos":[{"mask-linear-to":ed()}],"mask-image-linear-from-color":[{"mask-linear-from":er()}],"mask-image-linear-to-color":[{"mask-linear-to":er()}],"mask-image-t-from-pos":[{"mask-t-from":ed()}],"mask-image-t-to-pos":[{"mask-t-to":ed()}],"mask-image-t-from-color":[{"mask-t-from":er()}],"mask-image-t-to-color":[{"mask-t-to":er()}],"mask-image-r-from-pos":[{"mask-r-from":ed()}],"mask-image-r-to-pos":[{"mask-r-to":ed()}],"mask-image-r-from-color":[{"mask-r-from":er()}],"mask-image-r-to-color":[{"mask-r-to":er()}],"mask-image-b-from-pos":[{"mask-b-from":ed()}],"mask-image-b-to-pos":[{"mask-b-to":ed()}],"mask-image-b-from-color":[{"mask-b-from":er()}],"mask-image-b-to-color":[{"mask-b-to":er()}],"mask-image-l-from-pos":[{"mask-l-from":ed()}],"mask-image-l-to-pos":[{"mask-l-to":ed()}],"mask-image-l-from-color":[{"mask-l-from":er()}],"mask-image-l-to-color":[{"mask-l-to":er()}],"mask-image-x-from-pos":[{"mask-x-from":ed()}],"mask-image-x-to-pos":[{"mask-x-to":ed()}],"mask-image-x-from-color":[{"mask-x-from":er()}],"mask-image-x-to-color":[{"mask-x-to":er()}],"mask-image-y-from-pos":[{"mask-y-from":ed()}],"mask-image-y-to-pos":[{"mask-y-to":ed()}],"mask-image-y-from-color":[{"mask-y-from":er()}],"mask-image-y-to-color":[{"mask-y-to":er()}],"mask-image-radial":[{"mask-radial":[K,F]}],"mask-image-radial-from-pos":[{"mask-radial-from":ed()}],"mask-image-radial-to-pos":[{"mask-radial-to":ed()}],"mask-image-radial-from-color":[{"mask-radial-from":er()}],"mask-image-radial-to-color":[{"mask-radial-to":er()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[O]}],"mask-image-conic-from-pos":[{"mask-conic-from":ed()}],"mask-image-conic-to-pos":[{"mask-conic-to":ed()}],"mask-image-conic-from-color":[{"mask-conic-from":er()}],"mask-image-conic-to-color":[{"mask-conic-to":er()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:en()}],"mask-repeat":[{mask:ei()}],"mask-size":[{mask:eo()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",K,F]}],filter:[{filter:["","none",K,F]}],blur:[{blur:ef()}],brightness:[{brightness:[O,K,F]}],contrast:[{contrast:[O,K,F]}],"drop-shadow":[{"drop-shadow":["","none",p,Y,V]}],"drop-shadow-color":[{"drop-shadow":er()}],grayscale:[{grayscale:["",O,K,F]}],"hue-rotate":[{"hue-rotate":[O,K,F]}],invert:[{invert:["",O,K,F]}],saturate:[{saturate:[O,K,F]}],sepia:[{sepia:["",O,K,F]}],"backdrop-filter":[{"backdrop-filter":["","none",K,F]}],"backdrop-blur":[{"backdrop-blur":ef()}],"backdrop-brightness":[{"backdrop-brightness":[O,K,F]}],"backdrop-contrast":[{"backdrop-contrast":[O,K,F]}],"backdrop-grayscale":[{"backdrop-grayscale":["",O,K,F]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[O,K,F]}],"backdrop-invert":[{"backdrop-invert":["",O,K,F]}],"backdrop-opacity":[{"backdrop-opacity":[O,K,F]}],"backdrop-saturate":[{"backdrop-saturate":[O,K,F]}],"backdrop-sepia":[{"backdrop-sepia":["",O,K,F]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",K,F]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[O,"initial",K,F]}],ease:[{ease:["linear","initial",v,K,F]}],delay:[{delay:[O,K,F]}],animate:[{animate:["none",y,K,F]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,K,F]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:ep()}],"rotate-x":[{"rotate-x":ep()}],"rotate-y":[{"rotate-y":ep()}],"rotate-z":[{"rotate-z":ep()}],scale:[{scale:eh()}],"scale-x":[{"scale-x":eh()}],"scale-y":[{"scale-y":eh()}],"scale-z":[{"scale-z":eh()}],"scale-3d":["scale-3d"],skew:[{skew:eg()}],"skew-x":[{"skew-x":eg()}],"skew-y":[{"skew-y":eg()}],transform:[{transform:[K,F,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:em()}],"translate-x":[{"translate-x":em()}],"translate-y":[{"translate-y":em()}
1],"translate-z":[{"translate-z":em()}],"translate-none":["translate-none"],accent:[{accent:er()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:er()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",K,F]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",K,F]}],fill:[{fill:["none",...er()]}],"stroke-w":[{stroke:[O,H,z,q]}],stroke:[{stroke:["none",...er()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});e.s(["twMerge",0,el],919056);var eu=e.i(69431);e.s(["cn",0,function(...e){return el(r(e))},"getFirebaseTenantConfig",0,()=>{let e=(0,eu.isProduction)();return{tenantId:"PRODTwinMind-dcnoy",apiKey:t.default.env.FIREBASE_WEB_API_KEY||"AIzaSyD2Sd_NP3vA4rwvoroKqDefpXZeCMDXcIQ",environment:e?"production":"development",isProd:e,isDev:!e}},"getTranscriberUrl",0,()=>t.default.env.NEXT_PUBLIC_TRANSCRIBER_URL?t.default.env.NEXT_PUBLIC_TRANSCRIBER_URL:(0,eu.isProduction)()?"https://audio-process-gcloud-581170638713.us-central1.run.app":"https://audio-process-gcloud-dev-581170638713.us-central1.run.app","sanitizeTranscript",0,e=>{if(!e)return"";let t=String(e),r=/\n?\s*---\s*\n[\s\S]*?\n\s*---\s*\n?\s*$/;for(;r.test(t);)t=t.replace(r,"\n").trimEnd();return t},"shouldProxyRequests",0,function(){let e=window.location.hostname;return"app.twinmind.com"!==e&&"twinmind.com"!==e&&"localhost"!==e&&"127.0.0.1"!==e}],340974)}]);

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.