@molin.ai/shop-ai 0.4.22 → 0.4.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
- var ef=Object.defineProperty;var tf=(t,e,r)=>e in t?ef(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var me=(t,e,r)=>(tf(t,typeof e!="symbol"?e+"":e,r),r),oo=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var L=(t,e,r)=>(oo(t,e,"read from private field"),r?r.call(t):e.get(t)),W=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},de=(t,e,r,i)=>(oo(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r);var vh=(t,e,r,i)=>({set _(n){de(t,e,n,r)},get _(){return L(t,e,i)}}),ue=(t,e,r)=>(oo(t,e,"access private method"),r);var _e;(function(t){t.assertEqual=n=>n;function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{let s={};for(let a of n)s[a]=a;return s},t.getValidEnumValues=n=>{let s=t.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),a={};for(let o of s)a[o]=n[o];return t.objectValues(a)},t.objectValues=n=>t.objectKeys(n).map(function(s){return n[s]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let s=[];for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.push(a);return s},t.find=(n,s)=>{for(let a of n)if(s(a))return a},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function i(n,s=" | "){return n.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=i,t.jsonStringifyReplacer=(n,s)=>typeof s=="bigint"?s.toString():s})(_e||(_e={}));var ho;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(ho||(ho={}));var G=_e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pr=t=>{switch(typeof t){case"undefined":return G.undefined;case"string":return G.string;case"number":return isNaN(t)?G.nan:G.number;case"boolean":return G.boolean;case"function":return G.function;case"bigint":return G.bigint;case"symbol":return G.symbol;case"object":return Array.isArray(t)?G.array:t===null?G.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?G.promise:typeof Map<"u"&&t instanceof Map?G.map:typeof Set<"u"&&t instanceof Set?G.set:typeof Date<"u"&&t instanceof Date?G.date:G.object;default:return G.unknown}},V=_e.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"]),rf=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),yt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},i={_errors:[]},n=s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)i._errors.push(r(a));else{let o=i,l=0;for(;l<a.path.length;){let h=a.path[l];l===a.path.length-1?(o[h]=o[h]||{_errors:[]},o[h]._errors.push(r(a))):o[h]=o[h]||{_errors:[]},o=o[h],l++}}};return n(this),i}toString(){return this.message}get message(){return JSON.stringify(this.issues,_e.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},i=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};yt.create=t=>new yt(t);var Qi=(t,e)=>{let r;switch(t.code){case V.invalid_type:t.received===G.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case V.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,_e.jsonStringifyReplacer)}`;break;case V.unrecognized_keys:r=`Unrecognized key(s) in object: ${_e.joinValues(t.keys,", ")}`;break;case V.invalid_union:r="Invalid input";break;case V.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${_e.joinValues(t.options)}`;break;case V.invalid_enum_value:r=`Invalid enum value. Expected ${_e.joinValues(t.options)}, received '${t.received}'`;break;case V.invalid_arguments:r="Invalid function arguments";break;case V.invalid_return_type:r="Invalid function return type";break;case V.invalid_date:r="Invalid date";break;case V.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:_e.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case V.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case V.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case V.custom:r="Invalid input";break;case V.invalid_intersection_types:r="Intersection results could not be merged";break;case V.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case V.not_finite:r="Number must be finite";break;default:r=e.defaultError,_e.assertNever(t)}return{message:r}},wh=Qi;function nf(t){wh=t}function es(){return wh}var ts=t=>{let{data:e,path:r,errorMaps:i,issueData:n}=t,s=[...r,...n.path||[]],a={...n,path:s},o="",l=i.filter(h=>!!h).slice().reverse();for(let h of l)o=h(a,{data:e,defaultError:o}).message;return{...n,path:s,message:n.message||o}},sf=[];function q(t,e){let r=ts({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,es(),Qi].filter(i=>!!i)});t.common.issues.push(r)}var Ke=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let n of r){if(n.status==="aborted")return le;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let n of r)i.push({key:await n.key,value:await n.value});return t.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let n of r){let{key:s,value:a}=n;if(s.status==="aborted"||a.status==="aborted")return le;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(i[s.value]=a.value)}return{status:e.value,value:i}}},le=Object.freeze({status:"aborted"}),xh=t=>({status:"dirty",value:t}),rt=t=>({status:"valid",value:t}),co=t=>t.status==="aborted",uo=t=>t.status==="dirty",en=t=>t.status==="valid",rs=t=>typeof Promise<"u"&&t instanceof Promise,re;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(re||(re={}));var At=class{constructor(e,r,i,n){this._cachedPath=[],this.parent=e,this.data=r,this._path=i,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},bh=(t,e)=>{if(en(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new yt(t.common.issues);return this._error=r,this._error}}};function he(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:n}=t;if(e&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(a,o)=>a.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:i??o.defaultError}:{message:r??o.defaultError},description:n}}var ce=class{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)}get description(){return this._def.description}_getType(e){return pr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:pr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ke,ctx:{common:e.parent.common,data:e.data,parsedType:pr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(rs(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){var i;let n={common:{issues:[],async:(i=r?.async)!==null&&i!==void 0?i:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pr(e)},s=this._parseSync({data:e,path:n.path,parent:n});return bh(n,s)}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pr(e)},n=this._parse({data:e,path:i.path,parent:i}),s=await(rs(n)?n:Promise.resolve(n));return bh(i,s)}refine(e,r){let i=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,s)=>{let a=e(n),o=()=>s.addIssue({code:V.custom,...i(n)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,r){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(e){return new vt({schema:this,typeName:ae.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Lt.create(this,this._def)}nullable(){return Qt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Kt.create(this,this._def)}promise(){return mr.create(this,this._def)}or(e){return $r.create([this,e],this._def)}and(e){return Or.create(this,e,this._def)}transform(e){return new vt({...he(this._def),schema:this,typeName:ae.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Nr({...he(this._def),innerType:this,defaultValue:r,typeName:ae.ZodDefault})}brand(){return new as({typeName:ae.ZodBranded,type:this,...he(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new fi({...he(this._def),innerType:this,catchValue:r,typeName:ae.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return tn.create(this,e)}readonly(){return gi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},af=/^c[^\s-]{8,}$/i,of=/^[a-z][a-z0-9]*$/,lf=/^[0-9A-HJKMNP-TV-Z]{26}$/,hf=/^[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,cf=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,uf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",lo,pf=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,df=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ff=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function mf(t,e){return!!((e==="v4"||!e)&&pf.test(t)||(e==="v6"||!e)&&df.test(t))}var dr=class t extends ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==G.string){let s=this._getOrReturnCtx(e);return q(s,{code:V.invalid_type,expected:G.string,received:s.parsedType}),le}let i=new Ke,n;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:V.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:V.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){let a=e.data.length>s.value,o=e.data.length<s.value;(a||o)&&(n=this._getOrReturnCtx(e,n),a?q(n,{code:V.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&q(n,{code:V.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")cf.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"email",code:V.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")lo||(lo=new RegExp(uf,"u")),lo.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"emoji",code:V.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")hf.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"uuid",code:V.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")af.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"cuid",code:V.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")of.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"cuid2",code:V.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")lf.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"ulid",code:V.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),q(n,{validation:"url",code:V.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"regex",code:V.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),q(n,{code:V.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),q(n,{code:V.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),q(n,{code:V.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?ff(s).test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{code:V.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="ip"?mf(e.data,s.version)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"ip",code:V.invalid_string,message:s.message}),i.dirty()):_e.assertNever(s);return{status:i.value,value:e.data}}_regex(e,r,i){return this.refinement(n=>e.test(n),{validation:r,code:V.invalid_string,...re.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...re.errToObj(e)})}url(e){return this._addCheck({kind:"url",...re.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...re.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...re.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...re.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...re.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...re.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...re.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,...re.errToObj(e?.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...re.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...re.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...re.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...re.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...re.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...re.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...re.errToObj(r)})}nonempty(e){return this.min(1,re.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};dr.create=t=>{var e;return new dr({checks:[],typeName:ae.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...he(t)})};function gf(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,s=parseInt(t.toFixed(n).replace(".","")),a=parseInt(e.toFixed(n).replace(".",""));return s%a/Math.pow(10,n)}var Cr=class t extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==G.number){let s=this._getOrReturnCtx(e);return q(s,{code:V.invalid_type,expected:G.number,received:s.parsedType}),le}let i,n=new Ke;for(let s of this._def.checks)s.kind==="int"?_e.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{code:V.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),q(i,{code:V.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),q(i,{code:V.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="multipleOf"?gf(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),q(i,{code:V.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{code:V.not_finite,message:s.message}),n.dirty()):_e.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,re.toString(r))}gt(e,r){return this.setLimit("min",e,!1,re.toString(r))}lte(e,r){return this.setLimit("max",e,!0,re.toString(r))}lt(e,r){return this.setLimit("max",e,!1,re.toString(r))}setLimit(e,r,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:re.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:re.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:re.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:re.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:re.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:re.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:re.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:re.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:re.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:re.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_e.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Cr.create=t=>new Cr({checks:[],typeName:ae.ZodNumber,coerce:t?.coerce||!1,...he(t)});var Tr=class t extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==G.bigint){let s=this._getOrReturnCtx(e);return q(s,{code:V.invalid_type,expected:G.bigint,received:s.parsedType}),le}let i,n=new Ke;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),q(i,{code:V.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),q(i,{code:V.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),q(i,{code:V.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):_e.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,re.toString(r))}gt(e,r){return this.setLimit("min",e,!1,re.toString(r))}lte(e,r){return this.setLimit("max",e,!0,re.toString(r))}lt(e,r){return this.setLimit("max",e,!1,re.toString(r))}setLimit(e,r,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:re.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:re.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:re.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:re.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:re.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:re.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Tr.create=t=>{var e;return new Tr({checks:[],typeName:ae.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...he(t)})};var Ir=class extends ce{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==G.boolean){let i=this._getOrReturnCtx(e);return q(i,{code:V.invalid_type,expected:G.boolean,received:i.parsedType}),le}return rt(e.data)}};Ir.create=t=>new Ir({typeName:ae.ZodBoolean,coerce:t?.coerce||!1,...he(t)});var Mr=class t extends ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==G.date){let s=this._getOrReturnCtx(e);return q(s,{code:V.invalid_type,expected:G.date,received:s.parsedType}),le}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return q(s,{code:V.invalid_date}),le}let i=new Ke,n;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:V.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:V.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):_e.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:re.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:re.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Mr.create=t=>new Mr({checks:[],coerce:t?.coerce||!1,typeName:ae.ZodDate,...he(t)});var ci=class extends ce{_parse(e){if(this._getType(e)!==G.symbol){let i=this._getOrReturnCtx(e);return q(i,{code:V.invalid_type,expected:G.symbol,received:i.parsedType}),le}return rt(e.data)}};ci.create=t=>new ci({typeName:ae.ZodSymbol,...he(t)});var Dr=class extends ce{_parse(e){if(this._getType(e)!==G.undefined){let i=this._getOrReturnCtx(e);return q(i,{code:V.invalid_type,expected:G.undefined,received:i.parsedType}),le}return rt(e.data)}};Dr.create=t=>new Dr({typeName:ae.ZodUndefined,...he(t)});var Fr=class extends ce{_parse(e){if(this._getType(e)!==G.null){let i=this._getOrReturnCtx(e);return q(i,{code:V.invalid_type,expected:G.null,received:i.parsedType}),le}return rt(e.data)}};Fr.create=t=>new Fr({typeName:ae.ZodNull,...he(t)});var fr=class extends ce{constructor(){super(...arguments),this._any=!0}_parse(e){return rt(e.data)}};fr.create=t=>new fr({typeName:ae.ZodAny,...he(t)});var Xt=class extends ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return rt(e.data)}};Xt.create=t=>new Xt({typeName:ae.ZodUnknown,...he(t)});var Bt=class extends ce{_parse(e){let r=this._getOrReturnCtx(e);return q(r,{code:V.invalid_type,expected:G.never,received:r.parsedType}),le}};Bt.create=t=>new Bt({typeName:ae.ZodNever,...he(t)});var ui=class extends ce{_parse(e){if(this._getType(e)!==G.undefined){let i=this._getOrReturnCtx(e);return q(i,{code:V.invalid_type,expected:G.void,received:i.parsedType}),le}return rt(e.data)}};ui.create=t=>new ui({typeName:ae.ZodVoid,...he(t)});var Kt=class t extends ce{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),n=this._def;if(r.parsedType!==G.array)return q(r,{code:V.invalid_type,expected:G.array,received:r.parsedType}),le;if(n.exactLength!==null){let a=r.data.length>n.exactLength.value,o=r.data.length<n.exactLength.value;(a||o)&&(q(r,{code:a?V.too_big:V.too_small,minimum:o?n.exactLength.value:void 0,maximum:a?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(q(r,{code:V.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(q(r,{code:V.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((a,o)=>n.type._parseAsync(new At(r,a,r.path,o)))).then(a=>Ke.mergeArray(i,a));let s=[...r.data].map((a,o)=>n.type._parseSync(new At(r,a,r.path,o)));return Ke.mergeArray(i,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:re.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:re.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:re.toString(r)}})}nonempty(e){return this.min(1,e)}};Kt.create=(t,e)=>new Kt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ae.ZodArray,...he(e)});function hi(t){if(t instanceof ht){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=Lt.create(hi(i))}return new ht({...t._def,shape:()=>e})}else return t instanceof Kt?new Kt({...t._def,type:hi(t.element)}):t instanceof Lt?Lt.create(hi(t.unwrap())):t instanceof Qt?Qt.create(hi(t.unwrap())):t instanceof Gt?Gt.create(t.items.map(e=>hi(e))):t}var ht=class t extends ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=_e.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==G.object){let h=this._getOrReturnCtx(e);return q(h,{code:V.invalid_type,expected:G.object,received:h.parsedType}),le}let{status:i,ctx:n}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Bt&&this._def.unknownKeys==="strip"))for(let h in n.data)a.includes(h)||o.push(h);let l=[];for(let h of a){let c=s[h],u=n.data[h];l.push({key:{status:"valid",value:h},value:c._parse(new At(n,u,n.path,h)),alwaysSet:h in n.data})}if(this._def.catchall instanceof Bt){let h=this._def.unknownKeys;if(h==="passthrough")for(let c of o)l.push({key:{status:"valid",value:c},value:{status:"valid",value:n.data[c]}});else if(h==="strict")o.length>0&&(q(n,{code:V.unrecognized_keys,keys:o}),i.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let h=this._def.catchall;for(let c of o){let u=n.data[c];l.push({key:{status:"valid",value:c},value:h._parse(new At(n,u,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let h=[];for(let c of l){let u=await c.key;h.push({key:u,value:await c.value,alwaysSet:c.alwaysSet})}return h}).then(h=>Ke.mergeObjectSync(i,h)):Ke.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(e){return re.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{var n,s,a,o;let l=(a=(s=(n=this._def).errorMap)===null||s===void 0?void 0:s.call(n,r,i).message)!==null&&a!==void 0?a:i.defaultError;return r.code==="unrecognized_keys"?{message:(o=re.errToObj(e).message)!==null&&o!==void 0?o:l}:{message:l}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ae.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return _e.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(r[i]=this.shape[i])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return _e.objectKeys(this.shape).forEach(i=>{e[i]||(r[i]=this.shape[i])}),new t({...this._def,shape:()=>r})}deepPartial(){return hi(this)}partial(e){let r={};return _e.objectKeys(this.shape).forEach(i=>{let n=this.shape[i];e&&!e[i]?r[i]=n:r[i]=n.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return _e.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])r[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Lt;)s=s._def.innerType;r[i]=s}}),new t({...this._def,shape:()=>r})}keyof(){return Sh(_e.objectKeys(this.shape))}};ht.create=(t,e)=>new ht({shape:()=>t,unknownKeys:"strip",catchall:Bt.create(),typeName:ae.ZodObject,...he(e)});ht.strictCreate=(t,e)=>new ht({shape:()=>t,unknownKeys:"strict",catchall:Bt.create(),typeName:ae.ZodObject,...he(e)});ht.lazycreate=(t,e)=>new ht({shape:t,unknownKeys:"strip",catchall:Bt.create(),typeName:ae.ZodObject,...he(e)});var $r=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function n(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(o=>new yt(o.ctx.common.issues));return q(r,{code:V.invalid_union,unionErrors:a}),le}if(r.common.async)return Promise.all(i.map(async s=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(n);{let s,a=[];for(let l of i){let h={...r,common:{...r.common,issues:[]},parent:null},c=l._parseSync({data:r.data,path:r.path,parent:h});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:h}),h.common.issues.length&&a.push(h.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let o=a.map(l=>new yt(l));return q(r,{code:V.invalid_union,unionErrors:o}),le}}get options(){return this._def.options}};$r.create=(t,e)=>new $r({options:t,typeName:ae.ZodUnion,...he(e)});var Qn=t=>t instanceof Rr?Qn(t.schema):t instanceof vt?Qn(t.innerType()):t instanceof Lr?[t.value]:t instanceof Br?t.options:t instanceof Vr?Object.keys(t.enum):t instanceof Nr?Qn(t._def.innerType):t instanceof Dr?[void 0]:t instanceof Fr?[null]:null,is=class t extends ce{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==G.object)return q(r,{code:V.invalid_type,expected:G.object,received:r.parsedType}),le;let i=this.discriminator,n=r.data[i],s=this.optionsMap.get(n);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(q(r,{code:V.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),le)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,i){let n=new Map;for(let s of r){let a=Qn(s.shape[e]);if(!a)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of a){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,s)}}return new t({typeName:ae.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...he(i)})}};function po(t,e){let r=pr(t),i=pr(e);if(t===e)return{valid:!0,data:t};if(r===G.object&&i===G.object){let n=_e.objectKeys(e),s=_e.objectKeys(t).filter(o=>n.indexOf(o)!==-1),a={...t,...e};for(let o of s){let l=po(t[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(r===G.array&&i===G.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let s=0;s<t.length;s++){let a=t[s],o=e[s],l=po(a,o);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return r===G.date&&i===G.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Or=class extends ce{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=(s,a)=>{if(co(s)||co(a))return le;let o=po(s.value,a.value);return o.valid?((uo(s)||uo(a))&&r.dirty(),{status:r.value,value:o.data}):(q(i,{code:V.invalid_intersection_types}),le)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,a])=>n(s,a)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Or.create=(t,e,r)=>new Or({left:t,right:e,typeName:ae.ZodIntersection,...he(r)});var Gt=class t extends ce{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==G.array)return q(i,{code:V.invalid_type,expected:G.array,received:i.parsedType}),le;if(i.data.length<this._def.items.length)return q(i,{code:V.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),le;!this._def.rest&&i.data.length>this._def.items.length&&(q(i,{code:V.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...i.data].map((a,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new At(i,a,i.path,o)):null}).filter(a=>!!a);return i.common.async?Promise.all(s).then(a=>Ke.mergeArray(r,a)):Ke.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Gt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gt({items:t,typeName:ae.ZodTuple,rest:null,...he(e)})};var ns=class t extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==G.object)return q(i,{code:V.invalid_type,expected:G.object,received:i.parsedType}),le;let n=[],s=this._def.keyType,a=this._def.valueType;for(let o in i.data)n.push({key:s._parse(new At(i,o,i.path,o)),value:a._parse(new At(i,i.data[o],i.path,o))});return i.common.async?Ke.mergeObjectAsync(r,n):Ke.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof ce?new t({keyType:e,valueType:r,typeName:ae.ZodRecord,...he(i)}):new t({keyType:dr.create(),valueType:e,typeName:ae.ZodRecord,...he(r)})}},pi=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==G.map)return q(i,{code:V.invalid_type,expected:G.map,received:i.parsedType}),le;let n=this._def.keyType,s=this._def.valueType,a=[...i.data.entries()].map(([o,l],h)=>({key:n._parse(new At(i,o,i.path,[h,"key"])),value:s._parse(new At(i,l,i.path,[h,"value"]))}));if(i.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let l of a){let h=await l.key,c=await l.value;if(h.status==="aborted"||c.status==="aborted")return le;(h.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(h.value,c.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let l of a){let h=l.key,c=l.value;if(h.status==="aborted"||c.status==="aborted")return le;(h.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(h.value,c.value)}return{status:r.value,value:o}}}};pi.create=(t,e,r)=>new pi({valueType:e,keyType:t,typeName:ae.ZodMap,...he(r)});var di=class t extends ce{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==G.set)return q(i,{code:V.invalid_type,expected:G.set,received:i.parsedType}),le;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(q(i,{code:V.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(q(i,{code:V.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let s=this._def.valueType;function a(l){let h=new Set;for(let c of l){if(c.status==="aborted")return le;c.status==="dirty"&&r.dirty(),h.add(c.value)}return{status:r.value,value:h}}let o=[...i.data.values()].map((l,h)=>s._parse(new At(i,l,i.path,h)));return i.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,r){return new t({...this._def,minSize:{value:e,message:re.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:re.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};di.create=(t,e)=>new di({valueType:t,minSize:null,maxSize:null,typeName:ae.ZodSet,...he(e)});var ss=class t extends ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==G.function)return q(r,{code:V.invalid_type,expected:G.function,received:r.parsedType}),le;function i(o,l){return ts({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,es(),Qi].filter(h=>!!h),issueData:{code:V.invalid_arguments,argumentsError:l}})}function n(o,l){return ts({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,es(),Qi].filter(h=>!!h),issueData:{code:V.invalid_return_type,returnTypeError:l}})}let s={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof mr){let o=this;return rt(async function(...l){let h=new yt([]),c=await o._def.args.parseAsync(l,s).catch(p=>{throw h.addIssue(i(l,p)),h}),u=await Reflect.apply(a,this,c);return await o._def.returns._def.type.parseAsync(u,s).catch(p=>{throw h.addIssue(n(u,p)),h})})}else{let o=this;return rt(function(...l){let h=o._def.args.safeParse(l,s);if(!h.success)throw new yt([i(l,h.error)]);let c=Reflect.apply(a,this,h.data),u=o._def.returns.safeParse(c,s);if(!u.success)throw new yt([n(c,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Gt.create(e).rest(Xt.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,i){return new t({args:e||Gt.create([]).rest(Xt.create()),returns:r||Xt.create(),typeName:ae.ZodFunction,...he(i)})}},Rr=class extends ce{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Rr.create=(t,e)=>new Rr({getter:t,typeName:ae.ZodLazy,...he(e)});var Lr=class extends ce{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return q(r,{received:r.data,code:V.invalid_literal,expected:this._def.value}),le}return{status:"valid",value:e.data}}get value(){return this._def.value}};Lr.create=(t,e)=>new Lr({value:t,typeName:ae.ZodLiteral,...he(e)});function Sh(t,e){return new Br({values:t,typeName:ae.ZodEnum,...he(e)})}var Br=class t extends ce{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return q(r,{expected:_e.joinValues(i),received:r.parsedType,code:V.invalid_type}),le}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),i=this._def.values;return q(r,{received:r.data,code:V.invalid_enum_value,options:i}),le}return rt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return t.create(e)}exclude(e){return t.create(this.options.filter(r=>!e.includes(r)))}};Br.create=Sh;var Vr=class extends ce{_parse(e){let r=_e.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==G.string&&i.parsedType!==G.number){let n=_e.objectValues(r);return q(i,{expected:_e.joinValues(n),received:i.parsedType,code:V.invalid_type}),le}if(r.indexOf(e.data)===-1){let n=_e.objectValues(r);return q(i,{received:i.data,code:V.invalid_enum_value,options:n}),le}return rt(e.data)}get enum(){return this._def.values}};Vr.create=(t,e)=>new Vr({values:t,typeName:ae.ZodNativeEnum,...he(e)});var mr=class extends ce{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==G.promise&&r.common.async===!1)return q(r,{code:V.invalid_type,expected:G.promise,received:r.parsedType}),le;let i=r.parsedType===G.promise?r.data:Promise.resolve(r.data);return rt(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};mr.create=(t,e)=>new mr({type:t,typeName:ae.ZodPromise,...he(e)});var vt=class extends ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:a=>{q(i,a),a.fatal?r.abort():r.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="preprocess"){let a=n.transform(i.data,s);return i.common.issues.length?{status:"dirty",value:i.data}:i.common.async?Promise.resolve(a).then(o=>this._def.schema._parseAsync({data:o,path:i.path,parent:i})):this._def.schema._parseSync({data:a,path:i.path,parent:i})}if(n.type==="refinement"){let a=o=>{let l=n.refinement(o,s);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?le:(o.status==="dirty"&&r.dirty(),a(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>o.status==="aborted"?le:(o.status==="dirty"&&r.dirty(),a(o.value).then(()=>({status:r.value,value:o.value}))))}if(n.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!en(a))return a;let o=n.transform(a.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>en(a)?Promise.resolve(n.transform(a.value,s)).then(o=>({status:r.value,value:o})):a);_e.assertNever(n)}};vt.create=(t,e,r)=>new vt({schema:t,typeName:ae.ZodEffects,effect:e,...he(r)});vt.createWithPreprocess=(t,e,r)=>new vt({schema:e,effect:{type:"preprocess",transform:t},typeName:ae.ZodEffects,...he(r)});var Lt=class extends ce{_parse(e){return this._getType(e)===G.undefined?rt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Lt.create=(t,e)=>new Lt({innerType:t,typeName:ae.ZodOptional,...he(e)});var Qt=class extends ce{_parse(e){return this._getType(e)===G.null?rt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Qt.create=(t,e)=>new Qt({innerType:t,typeName:ae.ZodNullable,...he(e)});var Nr=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return r.parsedType===G.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Nr.create=(t,e)=>new Nr({innerType:t,typeName:ae.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...he(e)});var fi=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),i={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return rs(n)?n.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new yt(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new yt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};fi.create=(t,e)=>new fi({innerType:t,typeName:ae.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...he(e)});var mi=class extends ce{_parse(e){if(this._getType(e)!==G.nan){let i=this._getOrReturnCtx(e);return q(i,{code:V.invalid_type,expected:G.nan,received:i.parsedType}),le}return{status:"valid",value:e.data}}};mi.create=t=>new mi({typeName:ae.ZodNaN,...he(t)});var yf=Symbol("zod_brand"),as=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},tn=class t extends ce{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?le:s.status==="dirty"?(r.dirty(),xh(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?le:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(e,r){return new t({in:e,out:r,typeName:ae.ZodPipeline})}},gi=class extends ce{_parse(e){let r=this._def.innerType._parse(e);return en(r)&&(r.value=Object.freeze(r.value)),r}};gi.create=(t,e)=>new gi({innerType:t,typeName:ae.ZodReadonly,...he(e)});var kh=(t,e={},r)=>t?fr.create().superRefine((i,n)=>{var s,a;if(!t(i)){let o=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,l=(a=(s=o.fatal)!==null&&s!==void 0?s:r)!==null&&a!==void 0?a:!0,h=typeof o=="string"?{message:o}:o;n.addIssue({code:"custom",...h,fatal:l})}}):fr.create(),vf={object:ht.lazycreate},ae;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ae||(ae={}));var bf=(t,e={message:`Input not instance of ${t.name}`})=>kh(r=>r instanceof t,e),Eh=dr.create,Ph=Cr.create,_f=mi.create,wf=Tr.create,Ah=Ir.create,xf=Mr.create,Sf=ci.create,kf=Dr.create,Ef=Fr.create,Pf=fr.create,Af=Xt.create,Cf=Bt.create,Tf=ui.create,If=Kt.create,Mf=ht.create,Df=ht.strictCreate,Ff=$r.create,$f=is.create,Of=Or.create,Rf=Gt.create,Lf=ns.create,Bf=pi.create,Vf=di.create,Nf=ss.create,zf=Rr.create,jf=Lr.create,Gf=Br.create,Hf=Vr.create,qf=mr.create,_h=vt.create,Uf=Lt.create,Wf=Qt.create,Zf=vt.createWithPreprocess,Yf=tn.create,Jf=()=>Eh().optional(),Xf=()=>Ph().optional(),Kf=()=>Ah().optional(),Qf={string:t=>dr.create({...t,coerce:!0}),number:t=>Cr.create({...t,coerce:!0}),boolean:t=>Ir.create({...t,coerce:!0}),bigint:t=>Tr.create({...t,coerce:!0}),date:t=>Mr.create({...t,coerce:!0})},em=le,pe=Object.freeze({__proto__:null,defaultErrorMap:Qi,setErrorMap:nf,getErrorMap:es,makeIssue:ts,EMPTY_PATH:sf,addIssueToContext:q,ParseStatus:Ke,INVALID:le,DIRTY:xh,OK:rt,isAborted:co,isDirty:uo,isValid:en,isAsync:rs,get util(){return _e},get objectUtil(){return ho},ZodParsedType:G,getParsedType:pr,ZodType:ce,ZodString:dr,ZodNumber:Cr,ZodBigInt:Tr,ZodBoolean:Ir,ZodDate:Mr,ZodSymbol:ci,ZodUndefined:Dr,ZodNull:Fr,ZodAny:fr,ZodUnknown:Xt,ZodNever:Bt,ZodVoid:ui,ZodArray:Kt,ZodObject:ht,ZodUnion:$r,ZodDiscriminatedUnion:is,ZodIntersection:Or,ZodTuple:Gt,ZodRecord:ns,ZodMap:pi,ZodSet:di,ZodFunction:ss,ZodLazy:Rr,ZodLiteral:Lr,ZodEnum:Br,ZodNativeEnum:Vr,ZodPromise:mr,ZodEffects:vt,ZodTransformer:vt,ZodOptional:Lt,ZodNullable:Qt,ZodDefault:Nr,ZodCatch:fi,ZodNaN:mi,BRAND:yf,ZodBranded:as,ZodPipeline:tn,ZodReadonly:gi,custom:kh,Schema:ce,ZodSchema:ce,late:vf,get ZodFirstPartyTypeKind(){return ae},coerce:Qf,any:Pf,array:If,bigint:wf,boolean:Ah,date:xf,discriminatedUnion:$f,effect:_h,enum:Gf,function:Nf,instanceof:bf,intersection:Of,lazy:zf,literal:jf,map:Bf,nan:_f,nativeEnum:Hf,never:Cf,null:Ef,nullable:Wf,number:Ph,object:Mf,oboolean:Kf,onumber:Xf,optional:Uf,ostring:Jf,pipeline:Yf,preprocess:Zf,promise:qf,record:Lf,set:Vf,strictObject:Df,string:Eh,symbol:Sf,transformer:_h,tuple:Rf,undefined:kf,union:Ff,unknown:Af,void:Tf,NEVER:em,ZodIssueCode:V,quotelessJson:rf,ZodError:yt});var nv=pe.object({wsApiUrl:pe.string(),url:pe.string(),logoSvg:pe.string().optional(),logoUrl:pe.string().optional(),title:pe.string(),status:pe.string(),color:pe.string(),showStillLearningBanner:pe.boolean().optional(),input:pe.object({placeholder:pe.string()}),bubble:pe.object({imageUrl:pe.string().optional(),position:pe.object({bottom:pe.string().optional(),right:pe.string().optional(),left:pe.string().optional()})}),header:pe.object({background:pe.string()}),examples:pe.object({title:pe.string(),items:pe.array(pe.string())}),instructions:pe.object({items:pe.array(pe.string())}),popup:pe.object({mobileEnabled:pe.boolean().optional(),desktopEnabled:pe.boolean().optional(),delayMs:pe.number().optional(),text:pe.string().optional()}).optional(),contactDetails:pe.object({email:pe.string().optional(),phone:pe.string().optional(),socialMedia:pe.object({facebook:pe.string().optional(),instagram:pe.string().optional(),twitter:pe.string().optional()}).optional()}).optional()});function tm(t){return t.replace(/[^A-Za-z0-9_-]/gi,"")}window.__INIT_MOLIN_SHOP_AI=function(e){if(!e)throw new Error("options is required");let{widgetId:r,config:i}=e;if(!r)throw new Error("widgetId is required");if(!i)throw new Error("config is required");r=tm(r);let n=document.createElement("molin-shop-ai");n.setAttribute("widget",r),n.config=i,document.body.appendChild(n)};var os=globalThis,hs=os.ShadowRoot&&(os.ShadyCSS===void 0||os.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Th=Symbol(),Ch=new WeakMap,ls=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==Th)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(hs&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=Ch.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Ch.set(r,e))}return e}toString(){return this.cssText}},Ih=t=>new ls(typeof t=="string"?t:t+"",void 0,Th);var fo=(t,e)=>{if(hs)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let i=document.createElement("style"),n=os.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},cs=hs?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return Ih(r)})(t):t;var{is:rm,defineProperty:im,getOwnPropertyDescriptor:nm,getOwnPropertyNames:sm,getOwnPropertySymbols:am,getPrototypeOf:om}=Object,us=globalThis,Mh=us.trustedTypes,lm=Mh?Mh.emptyScript:"",hm=us.reactiveElementPolyfillSupport,rn=(t,e)=>t,mo={toAttribute(t,e){switch(e){case Boolean:t=t?lm:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Fh=(t,e)=>!rm(t,e),Dh={attribute:!0,type:String,converter:mo,reflect:!1,hasChanged:Fh};Symbol.metadata??=Symbol("metadata"),us.litPropertyMetadata??=new WeakMap;var zr=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=Dh){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(e,r),!r.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(e,i,r);n!==void 0&&im(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){let{get:n,set:s}=nm(this.prototype,e)??{get(){return this[r]},set(a){this[r]=a}};return{get(){return n?.call(this)},set(a){let o=n?.call(this);s.call(this,a),this.requestUpdate(e,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Dh}static _$Ei(){if(this.hasOwnProperty(rn("elementProperties")))return;let e=om(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(rn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(rn("properties"))){let r=this.properties,i=[...sm(r),...am(r)];for(let n of i)this.createProperty(n,r[n])}let e=this[Symbol.metadata];if(e!==null){let r=litPropertyMetadata.get(e);if(r!==void 0)for(let[i,n]of r)this.elementProperties.set(i,n)}this._$Eh=new Map;for(let[r,i]of this.elementProperties){let n=this._$Eu(r,i);n!==void 0&&this._$Eh.set(n,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)r.unshift(cs(n))}else e!==void 0&&r.push(cs(e));return r}static _$Eu(e,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$ES(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$E_??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$E_?.delete(e)}_$ES(){let e=new Map,r=this.constructor.elementProperties;for(let i of r.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return fo(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$E_?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$E_?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:mo).toAttribute(r,i.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,r){let i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let s=i.getPropertyOptions(n),a=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:mo;this._$Em=n,this[n]=a.fromAttribute(r,s.type),this._$Em=null}}requestUpdate(e,r,i,n=!1,s){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??Fh)(n?s:this[e],r))return;this.C(e,r,i)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(e,r,i){this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[n,s]of i)s.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.C(n,this[n],s)}let e=!1,r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$E_?.forEach(i=>i.hostUpdate?.()),this.update(r)):this._$ET()}catch(i){throw e=!1,this._$ET(),i}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$E_?.forEach(r=>r.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach(r=>this._$EO(r,this[r])),this._$ET()}updated(e){}firstUpdated(e){}};zr.elementStyles=[],zr.shadowRootOptions={mode:"open"},zr[rn("elementProperties")]=new Map,zr[rn("finalized")]=new Map,hm?.({ReactiveElement:zr}),(us.reactiveElementVersions??=[]).push("2.0.2");var yo=globalThis,ps=yo.trustedTypes,$h=ps?ps.createPolicy("lit-html",{createHTML:t=>t}):void 0,vo="$lit$",er=`lit$${(Math.random()+"").slice(9)}$`,bo="?"+er,cm=`<${bo}>`,Hr=document,sn=()=>Hr.createComment(""),an=t=>t===null||typeof t!="object"&&typeof t!="function",Nh=Array.isArray,zh=t=>Nh(t)||typeof t?.[Symbol.iterator]=="function",go=`[
1
+ var ef=Object.defineProperty;var tf=(t,e,r)=>e in t?ef(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var me=(t,e,r)=>(tf(t,typeof e!="symbol"?e+"":e,r),r),oo=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var L=(t,e,r)=>(oo(t,e,"read from private field"),r?r.call(t):e.get(t)),W=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},de=(t,e,r,i)=>(oo(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r);var vh=(t,e,r,i)=>({set _(n){de(t,e,n,r)},get _(){return L(t,e,i)}}),ue=(t,e,r)=>(oo(t,e,"access private method"),r);var _e;(function(t){t.assertEqual=n=>n;function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{let s={};for(let a of n)s[a]=a;return s},t.getValidEnumValues=n=>{let s=t.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),a={};for(let o of s)a[o]=n[o];return t.objectValues(a)},t.objectValues=n=>t.objectKeys(n).map(function(s){return n[s]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let s=[];for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&s.push(a);return s},t.find=(n,s)=>{for(let a of n)if(s(a))return a},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function i(n,s=" | "){return n.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=i,t.jsonStringifyReplacer=(n,s)=>typeof s=="bigint"?s.toString():s})(_e||(_e={}));var ho;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(ho||(ho={}));var G=_e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pr=t=>{switch(typeof t){case"undefined":return G.undefined;case"string":return G.string;case"number":return isNaN(t)?G.nan:G.number;case"boolean":return G.boolean;case"function":return G.function;case"bigint":return G.bigint;case"symbol":return G.symbol;case"object":return Array.isArray(t)?G.array:t===null?G.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?G.promise:typeof Map<"u"&&t instanceof Map?G.map:typeof Set<"u"&&t instanceof Set?G.set:typeof Date<"u"&&t instanceof Date?G.date:G.object;default:return G.unknown}},V=_e.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"]),rf=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),yt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},i={_errors:[]},n=s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)i._errors.push(r(a));else{let o=i,l=0;for(;l<a.path.length;){let h=a.path[l];l===a.path.length-1?(o[h]=o[h]||{_errors:[]},o[h]._errors.push(r(a))):o[h]=o[h]||{_errors:[]},o=o[h],l++}}};return n(this),i}toString(){return this.message}get message(){return JSON.stringify(this.issues,_e.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},i=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};yt.create=t=>new yt(t);var Qi=(t,e)=>{let r;switch(t.code){case V.invalid_type:t.received===G.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case V.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,_e.jsonStringifyReplacer)}`;break;case V.unrecognized_keys:r=`Unrecognized key(s) in object: ${_e.joinValues(t.keys,", ")}`;break;case V.invalid_union:r="Invalid input";break;case V.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${_e.joinValues(t.options)}`;break;case V.invalid_enum_value:r=`Invalid enum value. Expected ${_e.joinValues(t.options)}, received '${t.received}'`;break;case V.invalid_arguments:r="Invalid function arguments";break;case V.invalid_return_type:r="Invalid function return type";break;case V.invalid_date:r="Invalid date";break;case V.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:_e.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case V.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case V.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case V.custom:r="Invalid input";break;case V.invalid_intersection_types:r="Intersection results could not be merged";break;case V.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case V.not_finite:r="Number must be finite";break;default:r=e.defaultError,_e.assertNever(t)}return{message:r}},wh=Qi;function nf(t){wh=t}function es(){return wh}var ts=t=>{let{data:e,path:r,errorMaps:i,issueData:n}=t,s=[...r,...n.path||[]],a={...n,path:s},o="",l=i.filter(h=>!!h).slice().reverse();for(let h of l)o=h(a,{data:e,defaultError:o}).message;return{...n,path:s,message:n.message||o}},sf=[];function q(t,e){let r=ts({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,es(),Qi].filter(i=>!!i)});t.common.issues.push(r)}var Ke=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let n of r){if(n.status==="aborted")return le;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let n of r)i.push({key:await n.key,value:await n.value});return t.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let n of r){let{key:s,value:a}=n;if(s.status==="aborted"||a.status==="aborted")return le;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(i[s.value]=a.value)}return{status:e.value,value:i}}},le=Object.freeze({status:"aborted"}),xh=t=>({status:"dirty",value:t}),rt=t=>({status:"valid",value:t}),co=t=>t.status==="aborted",uo=t=>t.status==="dirty",en=t=>t.status==="valid",rs=t=>typeof Promise<"u"&&t instanceof Promise,re;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(re||(re={}));var At=class{constructor(e,r,i,n){this._cachedPath=[],this.parent=e,this.data=r,this._path=i,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},bh=(t,e)=>{if(en(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new yt(t.common.issues);return this._error=r,this._error}}};function he(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:n}=t;if(e&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(a,o)=>a.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:i??o.defaultError}:{message:r??o.defaultError},description:n}}var ce=class{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)}get description(){return this._def.description}_getType(e){return pr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:pr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ke,ctx:{common:e.parent.common,data:e.data,parsedType:pr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(rs(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){var i;let n={common:{issues:[],async:(i=r?.async)!==null&&i!==void 0?i:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pr(e)},s=this._parseSync({data:e,path:n.path,parent:n});return bh(n,s)}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:pr(e)},n=this._parse({data:e,path:i.path,parent:i}),s=await(rs(n)?n:Promise.resolve(n));return bh(i,s)}refine(e,r){let i=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,s)=>{let a=e(n),o=()=>s.addIssue({code:V.custom,...i(n)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,r){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(e){return new vt({schema:this,typeName:ae.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Lt.create(this,this._def)}nullable(){return Qt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Kt.create(this,this._def)}promise(){return mr.create(this,this._def)}or(e){return $r.create([this,e],this._def)}and(e){return Or.create(this,e,this._def)}transform(e){return new vt({...he(this._def),schema:this,typeName:ae.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Nr({...he(this._def),innerType:this,defaultValue:r,typeName:ae.ZodDefault})}brand(){return new as({typeName:ae.ZodBranded,type:this,...he(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new fi({...he(this._def),innerType:this,catchValue:r,typeName:ae.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return tn.create(this,e)}readonly(){return gi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},af=/^c[^\s-]{8,}$/i,of=/^[a-z][a-z0-9]*$/,lf=/^[0-9A-HJKMNP-TV-Z]{26}$/,hf=/^[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,cf=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,uf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",lo,pf=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,df=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ff=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function mf(t,e){return!!((e==="v4"||!e)&&pf.test(t)||(e==="v6"||!e)&&df.test(t))}var dr=class t extends ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==G.string){let s=this._getOrReturnCtx(e);return q(s,{code:V.invalid_type,expected:G.string,received:s.parsedType}),le}let i=new Ke,n;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:V.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:V.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){let a=e.data.length>s.value,o=e.data.length<s.value;(a||o)&&(n=this._getOrReturnCtx(e,n),a?q(n,{code:V.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&q(n,{code:V.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")cf.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"email",code:V.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")lo||(lo=new RegExp(uf,"u")),lo.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"emoji",code:V.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")hf.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"uuid",code:V.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")af.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"cuid",code:V.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")of.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"cuid2",code:V.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")lf.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"ulid",code:V.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),q(n,{validation:"url",code:V.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"regex",code:V.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),q(n,{code:V.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),q(n,{code:V.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),q(n,{code:V.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?ff(s).test(e.data)||(n=this._getOrReturnCtx(e,n),q(n,{code:V.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="ip"?mf(e.data,s.version)||(n=this._getOrReturnCtx(e,n),q(n,{validation:"ip",code:V.invalid_string,message:s.message}),i.dirty()):_e.assertNever(s);return{status:i.value,value:e.data}}_regex(e,r,i){return this.refinement(n=>e.test(n),{validation:r,code:V.invalid_string,...re.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...re.errToObj(e)})}url(e){return this._addCheck({kind:"url",...re.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...re.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...re.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...re.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...re.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...re.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...re.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,...re.errToObj(e?.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...re.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...re.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...re.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...re.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...re.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...re.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...re.errToObj(r)})}nonempty(e){return this.min(1,re.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};dr.create=t=>{var e;return new dr({checks:[],typeName:ae.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...he(t)})};function gf(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,s=parseInt(t.toFixed(n).replace(".","")),a=parseInt(e.toFixed(n).replace(".",""));return s%a/Math.pow(10,n)}var Cr=class t extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==G.number){let s=this._getOrReturnCtx(e);return q(s,{code:V.invalid_type,expected:G.number,received:s.parsedType}),le}let i,n=new Ke;for(let s of this._def.checks)s.kind==="int"?_e.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{code:V.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),q(i,{code:V.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),q(i,{code:V.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="multipleOf"?gf(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),q(i,{code:V.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{code:V.not_finite,message:s.message}),n.dirty()):_e.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,re.toString(r))}gt(e,r){return this.setLimit("min",e,!1,re.toString(r))}lte(e,r){return this.setLimit("max",e,!0,re.toString(r))}lt(e,r){return this.setLimit("max",e,!1,re.toString(r))}setLimit(e,r,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:re.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:re.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:re.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:re.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:re.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:re.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:re.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:re.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:re.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:re.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_e.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Cr.create=t=>new Cr({checks:[],typeName:ae.ZodNumber,coerce:t?.coerce||!1,...he(t)});var Tr=class t extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==G.bigint){let s=this._getOrReturnCtx(e);return q(s,{code:V.invalid_type,expected:G.bigint,received:s.parsedType}),le}let i,n=new Ke;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),q(i,{code:V.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),q(i,{code:V.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),q(i,{code:V.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):_e.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,re.toString(r))}gt(e,r){return this.setLimit("min",e,!1,re.toString(r))}lte(e,r){return this.setLimit("max",e,!0,re.toString(r))}lt(e,r){return this.setLimit("max",e,!1,re.toString(r))}setLimit(e,r,i,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:re.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:re.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:re.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:re.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:re.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:re.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Tr.create=t=>{var e;return new Tr({checks:[],typeName:ae.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...he(t)})};var Ir=class extends ce{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==G.boolean){let i=this._getOrReturnCtx(e);return q(i,{code:V.invalid_type,expected:G.boolean,received:i.parsedType}),le}return rt(e.data)}};Ir.create=t=>new Ir({typeName:ae.ZodBoolean,coerce:t?.coerce||!1,...he(t)});var Mr=class t extends ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==G.date){let s=this._getOrReturnCtx(e);return q(s,{code:V.invalid_type,expected:G.date,received:s.parsedType}),le}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return q(s,{code:V.invalid_date}),le}let i=new Ke,n;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:V.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),q(n,{code:V.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):_e.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:re.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:re.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Mr.create=t=>new Mr({checks:[],coerce:t?.coerce||!1,typeName:ae.ZodDate,...he(t)});var ci=class extends ce{_parse(e){if(this._getType(e)!==G.symbol){let i=this._getOrReturnCtx(e);return q(i,{code:V.invalid_type,expected:G.symbol,received:i.parsedType}),le}return rt(e.data)}};ci.create=t=>new ci({typeName:ae.ZodSymbol,...he(t)});var Dr=class extends ce{_parse(e){if(this._getType(e)!==G.undefined){let i=this._getOrReturnCtx(e);return q(i,{code:V.invalid_type,expected:G.undefined,received:i.parsedType}),le}return rt(e.data)}};Dr.create=t=>new Dr({typeName:ae.ZodUndefined,...he(t)});var Fr=class extends ce{_parse(e){if(this._getType(e)!==G.null){let i=this._getOrReturnCtx(e);return q(i,{code:V.invalid_type,expected:G.null,received:i.parsedType}),le}return rt(e.data)}};Fr.create=t=>new Fr({typeName:ae.ZodNull,...he(t)});var fr=class extends ce{constructor(){super(...arguments),this._any=!0}_parse(e){return rt(e.data)}};fr.create=t=>new fr({typeName:ae.ZodAny,...he(t)});var Xt=class extends ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return rt(e.data)}};Xt.create=t=>new Xt({typeName:ae.ZodUnknown,...he(t)});var Bt=class extends ce{_parse(e){let r=this._getOrReturnCtx(e);return q(r,{code:V.invalid_type,expected:G.never,received:r.parsedType}),le}};Bt.create=t=>new Bt({typeName:ae.ZodNever,...he(t)});var ui=class extends ce{_parse(e){if(this._getType(e)!==G.undefined){let i=this._getOrReturnCtx(e);return q(i,{code:V.invalid_type,expected:G.void,received:i.parsedType}),le}return rt(e.data)}};ui.create=t=>new ui({typeName:ae.ZodVoid,...he(t)});var Kt=class t extends ce{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),n=this._def;if(r.parsedType!==G.array)return q(r,{code:V.invalid_type,expected:G.array,received:r.parsedType}),le;if(n.exactLength!==null){let a=r.data.length>n.exactLength.value,o=r.data.length<n.exactLength.value;(a||o)&&(q(r,{code:a?V.too_big:V.too_small,minimum:o?n.exactLength.value:void 0,maximum:a?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(q(r,{code:V.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(q(r,{code:V.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((a,o)=>n.type._parseAsync(new At(r,a,r.path,o)))).then(a=>Ke.mergeArray(i,a));let s=[...r.data].map((a,o)=>n.type._parseSync(new At(r,a,r.path,o)));return Ke.mergeArray(i,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:re.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:re.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:re.toString(r)}})}nonempty(e){return this.min(1,e)}};Kt.create=(t,e)=>new Kt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ae.ZodArray,...he(e)});function hi(t){if(t instanceof ht){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=Lt.create(hi(i))}return new ht({...t._def,shape:()=>e})}else return t instanceof Kt?new Kt({...t._def,type:hi(t.element)}):t instanceof Lt?Lt.create(hi(t.unwrap())):t instanceof Qt?Qt.create(hi(t.unwrap())):t instanceof Gt?Gt.create(t.items.map(e=>hi(e))):t}var ht=class t extends ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=_e.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==G.object){let h=this._getOrReturnCtx(e);return q(h,{code:V.invalid_type,expected:G.object,received:h.parsedType}),le}let{status:i,ctx:n}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Bt&&this._def.unknownKeys==="strip"))for(let h in n.data)a.includes(h)||o.push(h);let l=[];for(let h of a){let c=s[h],u=n.data[h];l.push({key:{status:"valid",value:h},value:c._parse(new At(n,u,n.path,h)),alwaysSet:h in n.data})}if(this._def.catchall instanceof Bt){let h=this._def.unknownKeys;if(h==="passthrough")for(let c of o)l.push({key:{status:"valid",value:c},value:{status:"valid",value:n.data[c]}});else if(h==="strict")o.length>0&&(q(n,{code:V.unrecognized_keys,keys:o}),i.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let h=this._def.catchall;for(let c of o){let u=n.data[c];l.push({key:{status:"valid",value:c},value:h._parse(new At(n,u,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let h=[];for(let c of l){let u=await c.key;h.push({key:u,value:await c.value,alwaysSet:c.alwaysSet})}return h}).then(h=>Ke.mergeObjectSync(i,h)):Ke.mergeObjectSync(i,l)}get shape(){return this._def.shape()}strict(e){return re.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{var n,s,a,o;let l=(a=(s=(n=this._def).errorMap)===null||s===void 0?void 0:s.call(n,r,i).message)!==null&&a!==void 0?a:i.defaultError;return r.code==="unrecognized_keys"?{message:(o=re.errToObj(e).message)!==null&&o!==void 0?o:l}:{message:l}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ae.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return _e.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(r[i]=this.shape[i])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return _e.objectKeys(this.shape).forEach(i=>{e[i]||(r[i]=this.shape[i])}),new t({...this._def,shape:()=>r})}deepPartial(){return hi(this)}partial(e){let r={};return _e.objectKeys(this.shape).forEach(i=>{let n=this.shape[i];e&&!e[i]?r[i]=n:r[i]=n.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return _e.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])r[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Lt;)s=s._def.innerType;r[i]=s}}),new t({...this._def,shape:()=>r})}keyof(){return Sh(_e.objectKeys(this.shape))}};ht.create=(t,e)=>new ht({shape:()=>t,unknownKeys:"strip",catchall:Bt.create(),typeName:ae.ZodObject,...he(e)});ht.strictCreate=(t,e)=>new ht({shape:()=>t,unknownKeys:"strict",catchall:Bt.create(),typeName:ae.ZodObject,...he(e)});ht.lazycreate=(t,e)=>new ht({shape:t,unknownKeys:"strip",catchall:Bt.create(),typeName:ae.ZodObject,...he(e)});var $r=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function n(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(o=>new yt(o.ctx.common.issues));return q(r,{code:V.invalid_union,unionErrors:a}),le}if(r.common.async)return Promise.all(i.map(async s=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(n);{let s,a=[];for(let l of i){let h={...r,common:{...r.common,issues:[]},parent:null},c=l._parseSync({data:r.data,path:r.path,parent:h});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:h}),h.common.issues.length&&a.push(h.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let o=a.map(l=>new yt(l));return q(r,{code:V.invalid_union,unionErrors:o}),le}}get options(){return this._def.options}};$r.create=(t,e)=>new $r({options:t,typeName:ae.ZodUnion,...he(e)});var Qn=t=>t instanceof Rr?Qn(t.schema):t instanceof vt?Qn(t.innerType()):t instanceof Lr?[t.value]:t instanceof Br?t.options:t instanceof Vr?Object.keys(t.enum):t instanceof Nr?Qn(t._def.innerType):t instanceof Dr?[void 0]:t instanceof Fr?[null]:null,is=class t extends ce{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==G.object)return q(r,{code:V.invalid_type,expected:G.object,received:r.parsedType}),le;let i=this.discriminator,n=r.data[i],s=this.optionsMap.get(n);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(q(r,{code:V.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),le)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,i){let n=new Map;for(let s of r){let a=Qn(s.shape[e]);if(!a)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of a){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,s)}}return new t({typeName:ae.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...he(i)})}};function po(t,e){let r=pr(t),i=pr(e);if(t===e)return{valid:!0,data:t};if(r===G.object&&i===G.object){let n=_e.objectKeys(e),s=_e.objectKeys(t).filter(o=>n.indexOf(o)!==-1),a={...t,...e};for(let o of s){let l=po(t[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(r===G.array&&i===G.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let s=0;s<t.length;s++){let a=t[s],o=e[s],l=po(a,o);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else return r===G.date&&i===G.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Or=class extends ce{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=(s,a)=>{if(co(s)||co(a))return le;let o=po(s.value,a.value);return o.valid?((uo(s)||uo(a))&&r.dirty(),{status:r.value,value:o.data}):(q(i,{code:V.invalid_intersection_types}),le)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,a])=>n(s,a)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Or.create=(t,e,r)=>new Or({left:t,right:e,typeName:ae.ZodIntersection,...he(r)});var Gt=class t extends ce{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==G.array)return q(i,{code:V.invalid_type,expected:G.array,received:i.parsedType}),le;if(i.data.length<this._def.items.length)return q(i,{code:V.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),le;!this._def.rest&&i.data.length>this._def.items.length&&(q(i,{code:V.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...i.data].map((a,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new At(i,a,i.path,o)):null}).filter(a=>!!a);return i.common.async?Promise.all(s).then(a=>Ke.mergeArray(r,a)):Ke.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Gt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gt({items:t,typeName:ae.ZodTuple,rest:null,...he(e)})};var ns=class t extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==G.object)return q(i,{code:V.invalid_type,expected:G.object,received:i.parsedType}),le;let n=[],s=this._def.keyType,a=this._def.valueType;for(let o in i.data)n.push({key:s._parse(new At(i,o,i.path,o)),value:a._parse(new At(i,i.data[o],i.path,o))});return i.common.async?Ke.mergeObjectAsync(r,n):Ke.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof ce?new t({keyType:e,valueType:r,typeName:ae.ZodRecord,...he(i)}):new t({keyType:dr.create(),valueType:e,typeName:ae.ZodRecord,...he(r)})}},pi=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==G.map)return q(i,{code:V.invalid_type,expected:G.map,received:i.parsedType}),le;let n=this._def.keyType,s=this._def.valueType,a=[...i.data.entries()].map(([o,l],h)=>({key:n._parse(new At(i,o,i.path,[h,"key"])),value:s._parse(new At(i,l,i.path,[h,"value"]))}));if(i.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let l of a){let h=await l.key,c=await l.value;if(h.status==="aborted"||c.status==="aborted")return le;(h.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(h.value,c.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let l of a){let h=l.key,c=l.value;if(h.status==="aborted"||c.status==="aborted")return le;(h.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(h.value,c.value)}return{status:r.value,value:o}}}};pi.create=(t,e,r)=>new pi({valueType:e,keyType:t,typeName:ae.ZodMap,...he(r)});var di=class t extends ce{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==G.set)return q(i,{code:V.invalid_type,expected:G.set,received:i.parsedType}),le;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(q(i,{code:V.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(q(i,{code:V.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let s=this._def.valueType;function a(l){let h=new Set;for(let c of l){if(c.status==="aborted")return le;c.status==="dirty"&&r.dirty(),h.add(c.value)}return{status:r.value,value:h}}let o=[...i.data.values()].map((l,h)=>s._parse(new At(i,l,i.path,h)));return i.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,r){return new t({...this._def,minSize:{value:e,message:re.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:re.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};di.create=(t,e)=>new di({valueType:t,minSize:null,maxSize:null,typeName:ae.ZodSet,...he(e)});var ss=class t extends ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==G.function)return q(r,{code:V.invalid_type,expected:G.function,received:r.parsedType}),le;function i(o,l){return ts({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,es(),Qi].filter(h=>!!h),issueData:{code:V.invalid_arguments,argumentsError:l}})}function n(o,l){return ts({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,es(),Qi].filter(h=>!!h),issueData:{code:V.invalid_return_type,returnTypeError:l}})}let s={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof mr){let o=this;return rt(async function(...l){let h=new yt([]),c=await o._def.args.parseAsync(l,s).catch(p=>{throw h.addIssue(i(l,p)),h}),u=await Reflect.apply(a,this,c);return await o._def.returns._def.type.parseAsync(u,s).catch(p=>{throw h.addIssue(n(u,p)),h})})}else{let o=this;return rt(function(...l){let h=o._def.args.safeParse(l,s);if(!h.success)throw new yt([i(l,h.error)]);let c=Reflect.apply(a,this,h.data),u=o._def.returns.safeParse(c,s);if(!u.success)throw new yt([n(c,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Gt.create(e).rest(Xt.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,i){return new t({args:e||Gt.create([]).rest(Xt.create()),returns:r||Xt.create(),typeName:ae.ZodFunction,...he(i)})}},Rr=class extends ce{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Rr.create=(t,e)=>new Rr({getter:t,typeName:ae.ZodLazy,...he(e)});var Lr=class extends ce{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return q(r,{received:r.data,code:V.invalid_literal,expected:this._def.value}),le}return{status:"valid",value:e.data}}get value(){return this._def.value}};Lr.create=(t,e)=>new Lr({value:t,typeName:ae.ZodLiteral,...he(e)});function Sh(t,e){return new Br({values:t,typeName:ae.ZodEnum,...he(e)})}var Br=class t extends ce{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return q(r,{expected:_e.joinValues(i),received:r.parsedType,code:V.invalid_type}),le}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),i=this._def.values;return q(r,{received:r.data,code:V.invalid_enum_value,options:i}),le}return rt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return t.create(e)}exclude(e){return t.create(this.options.filter(r=>!e.includes(r)))}};Br.create=Sh;var Vr=class extends ce{_parse(e){let r=_e.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==G.string&&i.parsedType!==G.number){let n=_e.objectValues(r);return q(i,{expected:_e.joinValues(n),received:i.parsedType,code:V.invalid_type}),le}if(r.indexOf(e.data)===-1){let n=_e.objectValues(r);return q(i,{received:i.data,code:V.invalid_enum_value,options:n}),le}return rt(e.data)}get enum(){return this._def.values}};Vr.create=(t,e)=>new Vr({values:t,typeName:ae.ZodNativeEnum,...he(e)});var mr=class extends ce{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==G.promise&&r.common.async===!1)return q(r,{code:V.invalid_type,expected:G.promise,received:r.parsedType}),le;let i=r.parsedType===G.promise?r.data:Promise.resolve(r.data);return rt(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};mr.create=(t,e)=>new mr({type:t,typeName:ae.ZodPromise,...he(e)});var vt=class extends ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:a=>{q(i,a),a.fatal?r.abort():r.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="preprocess"){let a=n.transform(i.data,s);return i.common.issues.length?{status:"dirty",value:i.data}:i.common.async?Promise.resolve(a).then(o=>this._def.schema._parseAsync({data:o,path:i.path,parent:i})):this._def.schema._parseSync({data:a,path:i.path,parent:i})}if(n.type==="refinement"){let a=o=>{let l=n.refinement(o,s);if(i.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?le:(o.status==="dirty"&&r.dirty(),a(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>o.status==="aborted"?le:(o.status==="dirty"&&r.dirty(),a(o.value).then(()=>({status:r.value,value:o.value}))))}if(n.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!en(a))return a;let o=n.transform(a.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>en(a)?Promise.resolve(n.transform(a.value,s)).then(o=>({status:r.value,value:o})):a);_e.assertNever(n)}};vt.create=(t,e,r)=>new vt({schema:t,typeName:ae.ZodEffects,effect:e,...he(r)});vt.createWithPreprocess=(t,e,r)=>new vt({schema:e,effect:{type:"preprocess",transform:t},typeName:ae.ZodEffects,...he(r)});var Lt=class extends ce{_parse(e){return this._getType(e)===G.undefined?rt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Lt.create=(t,e)=>new Lt({innerType:t,typeName:ae.ZodOptional,...he(e)});var Qt=class extends ce{_parse(e){return this._getType(e)===G.null?rt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Qt.create=(t,e)=>new Qt({innerType:t,typeName:ae.ZodNullable,...he(e)});var Nr=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return r.parsedType===G.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Nr.create=(t,e)=>new Nr({innerType:t,typeName:ae.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...he(e)});var fi=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),i={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return rs(n)?n.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new yt(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new yt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};fi.create=(t,e)=>new fi({innerType:t,typeName:ae.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...he(e)});var mi=class extends ce{_parse(e){if(this._getType(e)!==G.nan){let i=this._getOrReturnCtx(e);return q(i,{code:V.invalid_type,expected:G.nan,received:i.parsedType}),le}return{status:"valid",value:e.data}}};mi.create=t=>new mi({typeName:ae.ZodNaN,...he(t)});var yf=Symbol("zod_brand"),as=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},tn=class t extends ce{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?le:s.status==="dirty"?(r.dirty(),xh(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?le:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(e,r){return new t({in:e,out:r,typeName:ae.ZodPipeline})}},gi=class extends ce{_parse(e){let r=this._def.innerType._parse(e);return en(r)&&(r.value=Object.freeze(r.value)),r}};gi.create=(t,e)=>new gi({innerType:t,typeName:ae.ZodReadonly,...he(e)});var kh=(t,e={},r)=>t?fr.create().superRefine((i,n)=>{var s,a;if(!t(i)){let o=typeof e=="function"?e(i):typeof e=="string"?{message:e}:e,l=(a=(s=o.fatal)!==null&&s!==void 0?s:r)!==null&&a!==void 0?a:!0,h=typeof o=="string"?{message:o}:o;n.addIssue({code:"custom",...h,fatal:l})}}):fr.create(),vf={object:ht.lazycreate},ae;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ae||(ae={}));var bf=(t,e={message:`Input not instance of ${t.name}`})=>kh(r=>r instanceof t,e),Eh=dr.create,Ph=Cr.create,_f=mi.create,wf=Tr.create,Ah=Ir.create,xf=Mr.create,Sf=ci.create,kf=Dr.create,Ef=Fr.create,Pf=fr.create,Af=Xt.create,Cf=Bt.create,Tf=ui.create,If=Kt.create,Mf=ht.create,Df=ht.strictCreate,Ff=$r.create,$f=is.create,Of=Or.create,Rf=Gt.create,Lf=ns.create,Bf=pi.create,Vf=di.create,Nf=ss.create,zf=Rr.create,jf=Lr.create,Gf=Br.create,Hf=Vr.create,qf=mr.create,_h=vt.create,Uf=Lt.create,Wf=Qt.create,Zf=vt.createWithPreprocess,Yf=tn.create,Jf=()=>Eh().optional(),Xf=()=>Ph().optional(),Kf=()=>Ah().optional(),Qf={string:t=>dr.create({...t,coerce:!0}),number:t=>Cr.create({...t,coerce:!0}),boolean:t=>Ir.create({...t,coerce:!0}),bigint:t=>Tr.create({...t,coerce:!0}),date:t=>Mr.create({...t,coerce:!0})},em=le,pe=Object.freeze({__proto__:null,defaultErrorMap:Qi,setErrorMap:nf,getErrorMap:es,makeIssue:ts,EMPTY_PATH:sf,addIssueToContext:q,ParseStatus:Ke,INVALID:le,DIRTY:xh,OK:rt,isAborted:co,isDirty:uo,isValid:en,isAsync:rs,get util(){return _e},get objectUtil(){return ho},ZodParsedType:G,getParsedType:pr,ZodType:ce,ZodString:dr,ZodNumber:Cr,ZodBigInt:Tr,ZodBoolean:Ir,ZodDate:Mr,ZodSymbol:ci,ZodUndefined:Dr,ZodNull:Fr,ZodAny:fr,ZodUnknown:Xt,ZodNever:Bt,ZodVoid:ui,ZodArray:Kt,ZodObject:ht,ZodUnion:$r,ZodDiscriminatedUnion:is,ZodIntersection:Or,ZodTuple:Gt,ZodRecord:ns,ZodMap:pi,ZodSet:di,ZodFunction:ss,ZodLazy:Rr,ZodLiteral:Lr,ZodEnum:Br,ZodNativeEnum:Vr,ZodPromise:mr,ZodEffects:vt,ZodTransformer:vt,ZodOptional:Lt,ZodNullable:Qt,ZodDefault:Nr,ZodCatch:fi,ZodNaN:mi,BRAND:yf,ZodBranded:as,ZodPipeline:tn,ZodReadonly:gi,custom:kh,Schema:ce,ZodSchema:ce,late:vf,get ZodFirstPartyTypeKind(){return ae},coerce:Qf,any:Pf,array:If,bigint:wf,boolean:Ah,date:xf,discriminatedUnion:$f,effect:_h,enum:Gf,function:Nf,instanceof:bf,intersection:Of,lazy:zf,literal:jf,map:Bf,nan:_f,nativeEnum:Hf,never:Cf,null:Ef,nullable:Wf,number:Ph,object:Mf,oboolean:Kf,onumber:Xf,optional:Uf,ostring:Jf,pipeline:Yf,preprocess:Zf,promise:qf,record:Lf,set:Vf,strictObject:Df,string:Eh,symbol:Sf,transformer:_h,tuple:Rf,undefined:kf,union:Ff,unknown:Af,void:Tf,NEVER:em,ZodIssueCode:V,quotelessJson:rf,ZodError:yt});var nv=pe.object({wsApiUrl:pe.string(),url:pe.string(),logoSvg:pe.string().optional(),logoUrl:pe.string().optional(),title:pe.string(),status:pe.string(),color:pe.string(),showStillLearningBanner:pe.boolean().optional(),input:pe.object({placeholder:pe.string()}),bubble:pe.object({imageUrl:pe.string().optional(),position:pe.object({bottom:pe.string().optional(),right:pe.string().optional(),left:pe.string().optional()})}),header:pe.object({background:pe.string()}),examples:pe.object({title:pe.string(),items:pe.array(pe.string())}),instructions:pe.object({items:pe.array(pe.string())}),popup:pe.object({mobileEnabled:pe.boolean().optional(),desktopEnabled:pe.boolean().optional(),delayMs:pe.number().optional(),text:pe.string().optional()}).optional(),contactDetails:pe.object({email:pe.string().optional(),phone:pe.string().optional(),socialMedia:pe.object({facebook:pe.string().optional(),instagram:pe.string().optional(),twitter:pe.string().optional()}).optional()}).optional(),neverShowStillLearningBanner:pe.boolean().optional()});function tm(t){return t.replace(/[^A-Za-z0-9_-]/gi,"")}window.__INIT_MOLIN_SHOP_AI=function(e){if(!e)throw new Error("options is required");let{widgetId:r,config:i}=e;if(!r)throw new Error("widgetId is required");if(!i)throw new Error("config is required");r=tm(r);let n=document.createElement("molin-shop-ai");n.setAttribute("widget",r),n.config=i,document.body.appendChild(n)};var os=globalThis,hs=os.ShadowRoot&&(os.ShadyCSS===void 0||os.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Th=Symbol(),Ch=new WeakMap,ls=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==Th)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(hs&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=Ch.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Ch.set(r,e))}return e}toString(){return this.cssText}},Ih=t=>new ls(typeof t=="string"?t:t+"",void 0,Th);var fo=(t,e)=>{if(hs)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let i=document.createElement("style"),n=os.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},cs=hs?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return Ih(r)})(t):t;var{is:rm,defineProperty:im,getOwnPropertyDescriptor:nm,getOwnPropertyNames:sm,getOwnPropertySymbols:am,getPrototypeOf:om}=Object,us=globalThis,Mh=us.trustedTypes,lm=Mh?Mh.emptyScript:"",hm=us.reactiveElementPolyfillSupport,rn=(t,e)=>t,mo={toAttribute(t,e){switch(e){case Boolean:t=t?lm:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Fh=(t,e)=>!rm(t,e),Dh={attribute:!0,type:String,converter:mo,reflect:!1,hasChanged:Fh};Symbol.metadata??=Symbol("metadata"),us.litPropertyMetadata??=new WeakMap;var zr=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=Dh){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(e,r),!r.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(e,i,r);n!==void 0&&im(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){let{get:n,set:s}=nm(this.prototype,e)??{get(){return this[r]},set(a){this[r]=a}};return{get(){return n?.call(this)},set(a){let o=n?.call(this);s.call(this,a),this.requestUpdate(e,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Dh}static _$Ei(){if(this.hasOwnProperty(rn("elementProperties")))return;let e=om(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(rn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(rn("properties"))){let r=this.properties,i=[...sm(r),...am(r)];for(let n of i)this.createProperty(n,r[n])}let e=this[Symbol.metadata];if(e!==null){let r=litPropertyMetadata.get(e);if(r!==void 0)for(let[i,n]of r)this.elementProperties.set(i,n)}this._$Eh=new Map;for(let[r,i]of this.elementProperties){let n=this._$Eu(r,i);n!==void 0&&this._$Eh.set(n,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)r.unshift(cs(n))}else e!==void 0&&r.push(cs(e));return r}static _$Eu(e,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$ES(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$E_??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$E_?.delete(e)}_$ES(){let e=new Map,r=this.constructor.elementProperties;for(let i of r.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return fo(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$E_?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$E_?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:mo).toAttribute(r,i.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,r){let i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let s=i.getPropertyOptions(n),a=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:mo;this._$Em=n,this[n]=a.fromAttribute(r,s.type),this._$Em=null}}requestUpdate(e,r,i,n=!1,s){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??Fh)(n?s:this[e],r))return;this.C(e,r,i)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(e,r,i){this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[n,s]of i)s.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.C(n,this[n],s)}let e=!1,r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$E_?.forEach(i=>i.hostUpdate?.()),this.update(r)):this._$ET()}catch(i){throw e=!1,this._$ET(),i}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$E_?.forEach(r=>r.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach(r=>this._$EO(r,this[r])),this._$ET()}updated(e){}firstUpdated(e){}};zr.elementStyles=[],zr.shadowRootOptions={mode:"open"},zr[rn("elementProperties")]=new Map,zr[rn("finalized")]=new Map,hm?.({ReactiveElement:zr}),(us.reactiveElementVersions??=[]).push("2.0.2");var yo=globalThis,ps=yo.trustedTypes,$h=ps?ps.createPolicy("lit-html",{createHTML:t=>t}):void 0,vo="$lit$",er=`lit$${(Math.random()+"").slice(9)}$`,bo="?"+er,cm=`<${bo}>`,Hr=document,sn=()=>Hr.createComment(""),an=t=>t===null||typeof t!="object"&&typeof t!="function",Nh=Array.isArray,zh=t=>Nh(t)||typeof t?.[Symbol.iterator]=="function",go=`[
2
2
  \f\r]`,nn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Oh=/-->/g,Rh=/>/g,jr=RegExp(`>|${go}(?:([^\\s"'>=/]+)(${go}*=${go}*(?:[^
3
3
  \f\r"'\`<>=]|("|')|))|$)`,"g"),Lh=/'/g,Bh=/"/g,jh=/^(?:script|style|textarea|title)$/i,Gh=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),ye=Gh(1),mv=Gh(2),bt=Symbol.for("lit-noChange"),De=Symbol.for("lit-nothing"),Vh=new WeakMap,Gr=Hr.createTreeWalker(Hr,129);function Hh(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return $h!==void 0?$h.createHTML(e):e}var qh=(t,e)=>{let r=t.length-1,i=[],n,s=e===2?"<svg>":"",a=nn;for(let o=0;o<r;o++){let l=t[o],h,c,u=-1,f=0;for(;f<l.length&&(a.lastIndex=f,c=a.exec(l),c!==null);)f=a.lastIndex,a===nn?c[1]==="!--"?a=Oh:c[1]!==void 0?a=Rh:c[2]!==void 0?(jh.test(c[2])&&(n=RegExp("</"+c[2],"g")),a=jr):c[3]!==void 0&&(a=jr):a===jr?c[0]===">"?(a=n??nn,u=-1):c[1]===void 0?u=-2:(u=a.lastIndex-c[2].length,h=c[1],a=c[3]===void 0?jr:c[3]==='"'?Bh:Lh):a===Bh||a===Lh?a=jr:a===Oh||a===Rh?a=nn:(a=jr,n=void 0);let p=a===jr&&t[o+1].startsWith("/>")?" ":"";s+=a===nn?l+cm:u>=0?(i.push(h),l.slice(0,u)+vo+l.slice(u)+er+p):l+er+(u===-2?o:p)}return[Hh(t,s+(t[r]||"<?>")+(e===2?"</svg>":"")),i]},on=class t{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let s=0,a=0,o=e.length-1,l=this.parts,[h,c]=qh(e,r);if(this.el=t.createElement(h,i),Gr.currentNode=this.el.content,r===2){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(n=Gr.nextNode())!==null&&l.length<o;){if(n.nodeType===1){if(n.hasAttributes())for(let u of n.getAttributeNames())if(u.endsWith(vo)){let f=c[a++],p=n.getAttribute(u).split(er),m=/([.?@])?(.*)/.exec(f);l.push({type:1,index:s,name:m[2],strings:p,ctor:m[1]==="."?fs:m[1]==="?"?ms:m[1]==="@"?gs:Ur}),n.removeAttribute(u)}else u.startsWith(er)&&(l.push({type:6,index:s}),n.removeAttribute(u));if(jh.test(n.tagName)){let u=n.textContent.split(er),f=u.length-1;if(f>0){n.textContent=ps?ps.emptyScript:"";for(let p=0;p<f;p++)n.append(u[p],sn()),Gr.nextNode(),l.push({type:2,index:++s});n.append(u[f],sn())}}}else if(n.nodeType===8)if(n.data===bo)l.push({type:2,index:s});else{let u=-1;for(;(u=n.data.indexOf(er,u+1))!==-1;)l.push({type:7,index:s}),u+=er.length-1}s++}}static createElement(e,r){let i=Hr.createElement("template");return i.innerHTML=e,i}};function qr(t,e,r=t,i){if(e===bt)return e;let n=i!==void 0?r._$Co?.[i]:r._$Cl,s=an(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(t),n._$AT(t,r,i)),i!==void 0?(r._$Co??=[])[i]=n:r._$Cl=n),n!==void 0&&(e=qr(t,n._$AS(t,e.values),n,i)),e}var ds=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:r},parts:i}=this._$AD,n=(e?.creationScope??Hr).importNode(r,!0);Gr.currentNode=n;let s=Gr.nextNode(),a=0,o=0,l=i[0];for(;l!==void 0;){if(a===l.index){let h;l.type===2?h=new yi(s,s.nextSibling,this,e):l.type===1?h=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(h=new ys(s,this,e)),this._$AV.push(h),l=i[++o]}a!==l?.index&&(s=Gr.nextNode(),a++)}return Gr.currentNode=Hr,n}p(e){let r=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,r),r+=i.strings.length-2):i._$AI(e[r])),r++}},yi=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,i,n){this.type=2,this._$AH=De,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=qr(this,e,r),an(e)?e===De||e==null||e===""?(this._$AH!==De&&this._$AR(),this._$AH=De):e!==this._$AH&&e!==bt&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):zh(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==De&&an(this._$AH)?this._$AA.nextSibling.data=e:this.$(Hr.createTextNode(e)),this._$AH=e}g(e){let{values:r,_$litType$:i}=e,n=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=on.createElement(Hh(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(r);else{let s=new ds(n,this),a=s.u(this.options);s.p(r),this.$(a),this._$AH=s}}_$AC(e){let r=Vh.get(e.strings);return r===void 0&&Vh.set(e.strings,r=new on(e)),r}T(e){Nh(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,i,n=0;for(let s of e)n===r.length?r.push(i=new t(this.k(sn()),this.k(sn()),this,this.options)):i=r[n],i._$AI(s),n++;n<r.length&&(this._$AR(i&&i._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Ur=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,i,n,s){this.type=1,this._$AH=De,this._$AN=void 0,this.element=e,this.name=r,this._$AM=n,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=De}_$AI(e,r=this,i,n){let s=this.strings,a=!1;if(s===void 0)e=qr(this,e,r,0),a=!an(e)||e!==this._$AH&&e!==bt,a&&(this._$AH=e);else{let o=e,l,h;for(e=s[0],l=0;l<s.length-1;l++)h=qr(this,o[i+l],r,l),h===bt&&(h=this._$AH[l]),a||=!an(h)||h!==this._$AH[l],h===De?e=De:e!==De&&(e+=(h??"")+s[l+1]),this._$AH[l]=h}a&&!n&&this.O(e)}O(e){e===De?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},fs=class extends Ur{constructor(){super(...arguments),this.type=3}O(e){this.element[this.name]=e===De?void 0:e}},ms=class extends Ur{constructor(){super(...arguments),this.type=4}O(e){this.element.toggleAttribute(this.name,!!e&&e!==De)}},gs=class extends Ur{constructor(e,r,i,n,s){super(e,r,i,n,s),this.type=5}_$AI(e,r=this){if((e=qr(this,e,r,0)??De)===bt)return;let i=this._$AH,n=e===De&&i!==De||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==De&&(i===De||n);n&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},ys=class{constructor(e,r,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){qr(this,e)}},Uh={j:vo,P:er,A:bo,C:1,M:qh,L:ds,R:zh,V:qr,D:yi,I:Ur,H:ms,N:gs,U:fs,B:ys},um=yo.litHtmlPolyfillSupport;um?.(on,yi),(yo.litHtmlVersions??=[]).push("3.1.0");var Wh=(t,e,r)=>{let i=r?.renderBefore??e,n=i._$litPart$;if(n===void 0){let s=r?.renderBefore??null;i._$litPart$=n=new yi(e.insertBefore(sn(),s),s,void 0,r??{})}return n._$AI(t),n};var vs=globalThis,bs=vs.ShadowRoot&&(vs.ShadyCSS===void 0||vs.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,_o=Symbol(),Zh=new WeakMap,ln=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==_o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(bs&&e===void 0){let i=r!==void 0&&r.length===1;i&&(e=Zh.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Zh.set(r,e))}return e}toString(){return this.cssText}},Yh=t=>new ln(typeof t=="string"?t:t+"",void 0,_o),wo=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((i,n,s)=>i+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1],t[0]);return new ln(r,t,_o)},xo=(t,e)=>{if(bs)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let i=document.createElement("style"),n=vs.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},_s=bs?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let i of e.cssRules)r+=i.cssText;return Yh(r)})(t):t;var{is:pm,defineProperty:dm,getOwnPropertyDescriptor:fm,getOwnPropertyNames:mm,getOwnPropertySymbols:gm,getPrototypeOf:ym}=Object,ws=globalThis,Jh=ws.trustedTypes,vm=Jh?Jh.emptyScript:"",bm=ws.reactiveElementPolyfillSupport,hn=(t,e)=>t,So={toAttribute(t,e){switch(e){case Boolean:t=t?vm:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Kh=(t,e)=>!pm(t,e),Xh={attribute:!0,type:String,converter:So,reflect:!1,hasChanged:Kh};Symbol.metadata??=Symbol("metadata"),ws.litPropertyMetadata??=new WeakMap;var tr=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=Xh){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(e,r),!r.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(e,i,r);n!==void 0&&dm(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){let{get:n,set:s}=fm(this.prototype,e)??{get(){return this[r]},set(a){this[r]=a}};return{get(){return n?.call(this)},set(a){let o=n?.call(this);s.call(this,a),this.requestUpdate(e,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Xh}static _$Ei(){if(this.hasOwnProperty(hn("elementProperties")))return;let e=ym(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(hn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(hn("properties"))){let r=this.properties,i=[...mm(r),...gm(r)];for(let n of i)this.createProperty(n,r[n])}let e=this[Symbol.metadata];if(e!==null){let r=litPropertyMetadata.get(e);if(r!==void 0)for(let[i,n]of r)this.elementProperties.set(i,n)}this._$Eh=new Map;for(let[r,i]of this.elementProperties){let n=this._$Eu(r,i);n!==void 0&&this._$Eh.set(n,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let n of i)r.unshift(_s(n))}else e!==void 0&&r.push(_s(e));return r}static _$Eu(e,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$ES(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$E_??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$E_?.delete(e)}_$ES(){let e=new Map,r=this.constructor.elementProperties;for(let i of r.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return xo(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$E_?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$E_?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(n!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:So).toAttribute(r,i.type);this._$Em=e,s==null?this.removeAttribute(n):this.setAttribute(n,s),this._$Em=null}}_$AK(e,r){let i=this.constructor,n=i._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let s=i.getPropertyOptions(n),a=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:So;this._$Em=n,this[n]=a.fromAttribute(r,s.type),this._$Em=null}}requestUpdate(e,r,i,n=!1,s){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??Kh)(n?s:this[e],r))return;this.C(e,r,i)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(e,r,i){this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,s]of this._$Ep)this[n]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[n,s]of i)s.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.C(n,this[n],s)}let e=!1,r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$E_?.forEach(i=>i.hostUpdate?.()),this.update(r)):this._$ET()}catch(i){throw e=!1,this._$ET(),i}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$E_?.forEach(r=>r.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach(r=>this._$EO(r,this[r])),this._$ET()}updated(e){}firstUpdated(e){}};tr.elementStyles=[],tr.shadowRootOptions={mode:"open"},tr[hn("elementProperties")]=new Map,tr[hn("finalized")]=new Map,bm?.({ReactiveElement:tr}),(ws.reactiveElementVersions??=[]).push("2.0.2");var Pe=class extends tr{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Wh(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return bt}};Pe._$litElement$=!0,Pe.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:Pe});var _m=globalThis.litElementPolyfillSupport;_m?.({LitElement:Pe});(globalThis.litElementVersions??=[]).push("4.0.2");var vi={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},bi=t=>(...e)=>({_$litDirective$:t,values:e}),gr=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};var{D:wm}=Uh;var Qh=()=>document.createComment(""),_i=(t,e,r)=>{let i=t._$AA.parentNode,n=e===void 0?t._$AB:e._$AA;if(r===void 0){let s=i.insertBefore(Qh(),n),a=i.insertBefore(Qh(),n);r=new wm(s,a,t,t.options)}else{let s=r._$AB.nextSibling,a=r._$AM,o=a!==t;if(o){let l;r._$AQ?.(t),r._$AM=t,r._$AP!==void 0&&(l=t._$AU)!==a._$AU&&r._$AP(l)}if(s!==n||o){let l=r._$AA;for(;l!==s;){let h=l.nextSibling;i.insertBefore(l,n),l=h}}}return r},yr=(t,e,r=t)=>(t._$AI(e,r),t),xm={},ec=(t,e=xm)=>t._$AH=e,tc=t=>t._$AH,xs=t=>{t._$AP?.(!1,!0);let e=t._$AA,r=t._$AB.nextSibling;for(;e!==r;){let i=e.nextSibling;e.remove(),e=i}};var rc=(t,e,r)=>{let i=new Map;for(let n=e;n<=r;n++)i.set(t[n],n);return i},Ss=bi(class extends gr{constructor(t){if(super(t),t.type!==vi.CHILD)throw Error("repeat() can only be used in text expressions")}ht(t,e,r){let i;r===void 0?r=e:e!==void 0&&(i=e);let n=[],s=[],a=0;for(let o of t)n[a]=i?i(o,a):a,s[a]=r(o,a),a++;return{values:s,keys:n}}render(t,e,r){return this.ht(t,e,r).values}update(t,[e,r,i]){let n=tc(t),{values:s,keys:a}=this.ht(e,r,i);if(!Array.isArray(n))return this.dt=a,s;let o=this.dt??=[],l=[],h,c,u=0,f=n.length-1,p=0,m=s.length-1;for(;u<=f&&p<=m;)if(n[u]===null)u++;else if(n[f]===null)f--;else if(o[u]===a[p])l[p]=yr(n[u],s[p]),u++,p++;else if(o[f]===a[m])l[m]=yr(n[f],s[m]),f--,m--;else if(o[u]===a[m])l[m]=yr(n[u],s[m]),_i(t,l[m+1],n[u]),u++,m--;else if(o[f]===a[p])l[p]=yr(n[f],s[p]),_i(t,n[u],n[f]),f--,p++;else if(h===void 0&&(h=rc(a,p,m),c=rc(o,u,f)),h.has(o[u]))if(h.has(o[f])){let g=c.get(a[p]),d=g!==void 0?n[g]:null;if(d===null){let y=_i(t,n[u]);yr(y,s[p]),l[p]=y}else l[p]=yr(d,s[p]),_i(t,n[u],d),n[g]=null;p++}else xs(n[f]),f--;else xs(n[u]),u++;for(;p<=m;){let g=_i(t,l[m+1]);yr(g,s[p]),l[p++]=g}for(;u<=f;){let g=n[u++];g!==null&&xs(g)}return this.dt=a,ec(t,l),bt}});function Fo(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function Sm(t,e=","){return t.map(Fo).join(e)}var hc=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function ks(t){for(var e=9,r=t.length;r--;)e=Math.imul(e^t.charCodeAt(r),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function As(t,e="@media "){return e+Te(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(i=>`(${i}-width:${r[i]})`).join(" and "))).join(",")}function Te(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function ic(t){return t}function Cs(){}var Ne={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function cc(t){return t.match(/[-=:;]/g)?.length||0}function Co(t){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(t)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(cc(t),15)<<18}var km=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function $o({n:t,i:e,v:r=[]},i,n,s){t&&(t=Fo({n:t,i:e,v:r})),s=[...Te(s)];for(let o of r){let l=i.theme("screens",o);for(let h of Te(l&&As(l)||i.v(o))){var a;s.push(h),n|=l?67108864|Co(h):o=="dark"?1073741824:h[0]=="@"?Co(h):(a=h,1<<~(/:([a-z-]+)/.test(a)&&~km.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:n,r:s,i:e}}var uc=new Map;function To(t){if(t.d){let e=[],r=ko(t.r.reduce((i,n)=>n[0]=="@"?(e.push(n),i):n?ko(i,s=>ko(n,a=>{let o=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(a);if(o){let l=s.indexOf(o[1]);return~l?s.slice(0,l)+o[0]+s.slice(l+o[1].length):Eo(s,a)}return Eo(a,s)})):i,"&"),i=>Eo(i,t.n?"."+hc(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,n)=>n+"{"+i+"}",t.d)}}function ko(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,i,n)=>e(i)+n)}function Eo(t,e){return t.replace(/&/g,e)}var nc=new Intl.Collator("en",{numeric:!0});function pc(t,e){for(var r=0,i=t.length;r<i;){let n=i+r>>1;0>=dc(t[n],e)?r=n+1:i=n}return i}function dc(t,e){let r=t.p&Ne.o;return r==(e.p&Ne.o)&&(r==Ne.b||r==Ne.o)?0:t.p-e.p||t.o-e.o||nc.compare(sc(t.n),sc(e.n))||nc.compare(ac(t.n),ac(e.n))}function sc(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function ac(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Po(t,e){return Math.round(parseInt(t,16)*e)}function Ct(t,e={}){if(typeof t=="function")return t(e);let{opacityValue:r="1",opacityVariable:i}=e,n=i?`var(${i})`:r;if(t.includes("<alpha-value>"))return t.replace("<alpha-value>",n);if(t[0]=="#"&&(t.length==4||t.length==7)){let s=(t.length-1)/3,a=[17,1,.062272][s-1];return`rgba(${[Po(t.substr(1,s),a),Po(t.substr(1+s,s),a),Po(t.substr(1+2*s,s),a),n]})`}return n=="1"?t:n=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function fc(t,e,r,i,n=[]){return function s(a,{n:o,p:l,r:h=[],i:c},u){let f=[],p="",m=0,g=0;for(let v in a||{}){var d,y;let b=a[v];if(v[0]=="@"){if(!b)continue;if(v[1]=="a"){f.push(...Ro(o,l,Ps(""+b),u,l,h,c,!0));continue}if(v[1]=="l"){for(let _ of Te(b))f.push(...s(_,{n:o,p:(d=Ne[v[7]],l&~Ne.o|d),r:v[7]=="d"?[]:h,i:c},u));continue}if(v[1]=="i"){f.push(...Te(b).map(_=>({p:-1,o:0,r:[],d:v+" "+_})));continue}if(v[1]=="k"){f.push({p:Ne.d,o:0,r:[v],d:s(b,{p:Ne.d},u).map(To).join("")});continue}if(v[1]=="f"){f.push(...Te(b).map(_=>({p:Ne.d,o:0,r:[v],d:s(_,{p:Ne.d},u).map(To).join("")})));continue}}if(typeof b!="object"||Array.isArray(b))v=="label"&&b?o=b+ks(JSON.stringify([l,c,a])):(b||b===0)&&(v=v.replace(/[A-Z]/g,_=>"-"+_.toLowerCase()),g+=1,m=Math.max(m,(y=v)[0]=="-"?0:cc(y)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(y)?+!!RegExp.$1||-!!RegExp.$2:0)+1),p+=(p?";":"")+Te(b).map(_=>u.s(v,Oo(""+_,u.theme)+(c?" !important":""))).join(";"));else if(v[0]=="@"||v.includes("&")){let _=l;v[0]=="@"&&(v=v.replace(/\bscreen\(([^)]+)\)/g,(S,T)=>{let x=u.theme("screens",T);return x?(_|=67108864,As(x,"")):S}),_|=Co(v)),f.push(...s(b,{n:o,p:_,r:[...h,v],i:c},u))}else f.push(...s(b,{p:l,r:[...h,v]},u))}return f.unshift({n:o,p:l,o:Math.max(0,15-g)+1.5*Math.min(m||15,15),r:h,d:p}),f.sort(dc)}(t,$o(e,r,i,n),r)}function Oo(t,e){return t.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,i,n,s,a="")=>{let o=e(n,a);return typeof o=="function"&&/color|fill|stroke/i.test(n)?Ct(o):""+Te(o).filter(l=>Object(l)!==l)})}function mc(t,e){let r,i=[];for(let n of t)n.d&&n.n?r?.p==n.p&&""+r.r==""+n.r?(r.c=[r.c,n.c].filter(Boolean).join(" "),r.d=r.d+";"+n.d):i.push(r={...n,n:n.n&&e}):i.push({...n,n:n.n&&e});return i}function Es(t,e,r=Ne.u,i,n){let s=[];for(let a of t)for(let o of function(l,h,c,u,f){l={...l,i:l.i||f};let p=function(m,g){let d=uc.get(m.n);return d?d(m,g):g.r(m.n,m.v[0]=="dark")}(l,h);return p?typeof p=="string"?({r:u,p:c}=$o(l,h,c,u),mc(Es(Ps(p),h,c,u,l.i),l.n)):Array.isArray(p)?p.map(m=>{var g,d;return{o:0,...m,r:[...Te(u),...Te(m.r)],p:(g=c,d=m.p??c,g&~Ne.o|d)}}):fc(p,l,h,c,u):[{c:Fo(l),p:0,o:0,r:[]}]}(a,e,r,i,n))s.splice(pc(s,o),0,o);return s}function Ro(t,e,r,i,n,s,a,o){return mc((o?r.flatMap(l=>Es([l],i,n,s,a)):Es(r,i,n,s,a)).map(l=>l.p&Ne.o&&(l.n||e==Ne.b)?{...l,p:l.p&~Ne.o|e,o:0}:l),t)}function Em(t,e,r,i){var n;return n=(s,a)=>{let{n:o,p:l,r:h,i:c}=$o(s,a,e);return r&&Ro(o,e,r,a,l,h,c,i)},uc.set(t,n),t}function Ao(t,e,r){if(t[t.length-1]!="("){let i=[],n=!1,s=!1,a="";for(let o of t)if(!(o=="("||/[~@]$/.test(o))){if(o[0]=="!"&&(o=o.slice(1),n=!n),o.endsWith(":")){i[o=="dark:"?"unshift":"push"](o.slice(0,-1));continue}o[0]=="-"&&(o=o.slice(1),s=!s),o.endsWith("-")&&(o=o.slice(0,-1)),o&&o!="&"&&(a+=(a&&"-")+o)}a&&(s&&(a="-"+a),e[0].push({n:a,v:i.filter(Pm),i:n}))}}function Pm(t,e,r){return r.indexOf(t)==e}var oc=new Map;function Ps(t){let e=oc.get(t);if(!e){let r=[],i=[[]],n=0,s=0,a=null,o=0,l=(h,c=0)=>{n!=o&&(r.push(t.slice(n,o+c)),h&&Ao(r,i)),n=o+1};for(;o<t.length;o++){let h=t[o];if(s)t[o-1]!="\\"&&(s+=+(h=="[")||-(h=="]"));else if(h=="[")s+=1;else if(a)t[o-1]!="\\"&&a.test(t.slice(o))&&(a=null,n=o+RegExp.lastMatch.length);else if(h=="/"&&t[o-1]!="\\"&&(t[o+1]=="*"||t[o+1]=="/"))a=t[o+1]=="*"?/^\*\//:/^[\r\n]/;else if(h=="(")l(),r.push(h);else if(h==":")t[o+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(h)){l(!0);let c=r.lastIndexOf("(");if(h==")"){let u=r[c-1];if(/[~@]$/.test(u)){let f=i.shift();r.length=c,Ao([...r,"#"],i);let{v:p}=i[0].pop();for(let m of f)m.v.splice(+(m.v[0]=="dark")-+(p[0]=="dark"),p.length);Ao([...r,Em(u.length>1?u.slice(0,-1)+ks(JSON.stringify([u,f])):u+"("+Sm(f)+")",Ne.a,f,/@$/.test(u))],i)}c=r.lastIndexOf("(",c-1)}r.length=c+1}else/[~@]/.test(h)&&t[o+1]=="("&&i.unshift([])}l(!0),oc.set(t,e=i[0])}return e}function N(t,e,r){return[t,Io(e,r)]}function Io(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,i)=>({[t]:e?e(r,i):Mo(r,1)}):r=>t||{[r[1]]:Mo(r,2)}}function Mo(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function z(t,e,r,i){return[t,Lo(e,r,i)]}function Lo(t,e,r){let i=typeof e=="string"?(n,s)=>({[e]:r?r(n,s):n._}):e||(({1:n,_:s},a,o)=>({[n||o]:s}));return(n,s)=>{let a=gc(t||n[1]),o=s.theme(a,n.$$)??Ht(n.$$,a,s);if(o!=null)return n._=Mo(n,0,o),i(n,s,a)}}function ze(t,e={},r){return[t,Am(e,r)]}function Am(t={},e){return(r,i)=>{let{section:n=gc(r[0]).replace("-","")+"Color"}=t,[s,a]=Cm(r.$$);if(!s)return;let o=i.theme(n,s)||Ht(s,n,i);if(!o||typeof o=="object")return;let{opacityVariable:l=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:h=n.replace("Color","Opacity"),property:c=n,selector:u}=t,f=i.theme(h,a||"DEFAULT")||a&&Ht(a,h,i),p=e||(({_:g})=>{let d=cn(c,g);return u?{[u]:d}:d});r._={value:Ct(o,{opacityVariable:l||void 0,opacityValue:f||void 0}),color:g=>Ct(o,g),opacityVariable:l||void 0,opacityValue:f||void 0};let m=p(r,i);if(!r.dark){let g=i.d(n,s,o);g&&g!==o&&(r._={value:Ct(g,{opacityVariable:l||void 0,opacityValue:f||"1"}),color:d=>Ct(g,d),opacityVariable:l||void 0,opacityValue:f||void 0},m={"&":m,[i.v("dark")]:p(r,i)})}return m}}function Cm(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function cn(t,e){let r={};return typeof e=="string"?r[t]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(r[e.opacityVariable]=e.opacityValue||"1"),r[t]=e.value),r}function Ht(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=wi(Oo(t.slice(1,-1),r.theme)),!e)return t;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(t)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(t))||/image/i.test(e)&&!(/^image:/.test(t)||/^[a-z-]+\(/.test(t))||/weight/i.test(e)&&!(/^(number|any):/.test(t)||/^\d+$/.test(t))||/position/i.test(e)&&/^(length|size):/.test(t)))return t.replace(/^[a-z-]+:/,"")}}function gc(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function wi(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",i,n="")=>wi(r)+i+wi(n)):t.replace(/(^|[^\\])_+/g,(e,r)=>r+" ".repeat(e.length-r.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function Bo({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:Te(e.variants),rules:Te(e.rules),ignorelist:Te(e.ignorelist),hash:void 0,stringify:(i,n)=>i+":"+n,finalize:[]};for(let i of Te([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&Te(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:n,darkMode:s=r.darkMode,darkColor:a=r.darkColor,theme:o,variants:l,rules:h,ignorelist:c,hash:u=r.hash,stringify:f=r.stringify,finalize:p}=typeof i=="function"?i(r):i;r={preflight:r.preflight!==!1&&n!==!1&&[...r.preflight,...Te(n)],darkMode:s,darkColor:a,theme:{...r.theme,...o,extend:{...r.theme.extend,...o?.extend}},variants:[...r.variants,...Te(l)],rules:[...r.rules,...Te(h)],ignorelist:[...r.ignorelist,...Te(c)],hash:u,stringify:f,finalize:[...r.finalize,...Te(p)]}}return r}function lc(t,e,r,i,n,s){for(let a of e){let o=r.get(a);o||r.set(a,o=i(a));let l=o(t,n,s);if(l)return l}}function Tm(t){var e;return Do(t[0],typeof(e=t[1])=="function"?e:()=>e)}function Im(t){var e,r;return Array.isArray(t)?Do(t[0],Io(t[1],t[2])):Do(t,Io(e,r))}function Do(t,e){return yc(t,(r,i,n,s)=>{let a=i.exec(r);if(a)return a.$$=r.slice(a[0].length),a.dark=s,e(a,n)})}function yc(t,e){let r=Te(t).map(Mm);return(i,n,s)=>{for(let a of r){let o=e(i,a,n,s);if(o)return o}}}function Mm(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function vc(t,e){let r=Bo(t),i=function({theme:l,darkMode:h,darkColor:c=Cs,variants:u,rules:f,hash:p,stringify:m,ignorelist:g,finalize:d}){let y=new Map,v=new Map,b=new Map,_=new Map,S=yc(g,(w,M)=>M.test(w));u.push(["dark",Array.isArray(h)||h=="class"?`${Te(h)[1]||".dark"} &`:typeof h=="string"&&h!="media"?h:"@media (prefers-color-scheme:dark)"]);let T=typeof p=="function"?w=>p(w,ks):p?ks:ic;T!==ic&&d.push(w=>({...w,n:w.n&&T(w.n),d:w.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(M,k)=>"--"+T(k).replace("#",""))}));let x={theme:function({extend:w={},...M}){let k={},I={get colors(){return P("colors")},theme:P,negative(){return{}},breakpoints(E){let F={};for(let $ in E)typeof E[$]=="string"&&(F["screen-"+$]=E[$]);return F}};return P;function P(E,F,$,D){if(E){if({1:E,2:D}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(E)||[,E],/[.[]/.test(E)){let U=[];E.replace(/\[([^\]]+)\]|([^.[]+)/g,(Z,X,H=X)=>U.push(H)),E=U.shift(),$=F,F=U.join("-")}let R=k[E]||Object.assign(Object.assign(k[E]={},A(M,E)),A(w,E));if(F==null)return R;F||(F="DEFAULT");let B=R[F]??F.split("-").reduce((U,Z)=>U?.[Z],R)??$;return D?Ct(B,{opacityValue:Oo(D,P)}):B}let C={};for(let R of[...Object.keys(M),...Object.keys(w)])C[R]=P(R);return C}function A(E,F){let $=E[F];return typeof $=="function"&&($=$(I)),$&&/color|fill|stroke/i.test(F)?function D(C,R=[]){let B={};for(let U in C){let Z=C[U],X=[...R,U];B[X.join("-")]=Z,U=="DEFAULT"&&(X=R,B[R.join("-")]=Z),typeof Z=="object"&&Object.assign(B,D(Z,X))}return B}($):$}}(l),e:hc,h:T,s(w,M){return m(w,M,x)},d(w,M,k){return c(w,M,x,k)},v(w){return y.has(w)||y.set(w,lc(w,u,v,Tm,x)||"&:"+w),y.get(w)},r(w,M){let k=JSON.stringify([w,M]);return b.has(k)||b.set(k,!S(w,x)&&lc(w,f,_,Im,x,M)),b.get(k)},f(w){return d.reduce((M,k)=>k(M,x),w)}};return x}(r),n=new Map,s=[],a=new Set;e.resume(l=>n.set(l,l),(l,h)=>{e.insert(l,s.length,h),s.push(h),a.add(l)});function o(l){let h=i.f(l),c=To(h);if(c&&!a.has(c)){a.add(c);let u=pc(s,l);e.insert(c,u,l),s.splice(u,0,l)}return h.n}return Object.defineProperties(function(h){if(!n.size)for(let u of Te(r.preflight))typeof u=="function"&&(u=u(i)),u&&(typeof u=="string"?Ro("",Ne.b,Ps(u),i,Ne.b,[],!1,!0):fc(u,{},i,Ne.b)).forEach(o);h=""+h;let c=n.get(h);if(!c){let u=new Set;for(let f of Es(Ps(h),i))u.add(f.c).add(o(f));c=[...u].filter(Boolean).join(" "),n.set(h,c).set(c,c)}return c},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:i.theme,config:r,snapshot(){let l=e.snapshot(),h=new Set(a),c=new Map(n),u=[...s];return()=>{l(),a=h,n=c,s=u}},clear(){e.clear(),a=new Set,n=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Dm(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function bc(t){let e=new MutationObserver(r);return{observe(n){e.observe(n,{attributeFilter:["class"],subtree:!0,childList:!0}),i(n),r([{target:n,type:""}])},disconnect(){e.disconnect()}};function r(n){for(let{type:s,target:a}of n)if(s[0]=="a")i(a);else for(let o of a.querySelectorAll("[class]"))i(o);e.takeRecords()}function i(n){let s,a=n.getAttribute?.("class");a&&Dm(a,s=t(a))&&n.setAttribute("class",s)}}function Fm(t){let e=document.querySelector(t||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function Ts(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:Fm(t)).sheet;return{target:e,snapshot(){let r=Array.from(e.cssRules,i=>i.cssText);return()=>{this.clear(),r.forEach(this.insert)}},clear(){for(let r=e.cssRules.length;r--;)e.deleteRule(r)},destroy(){e.ownerNode?.remove()},insert(r,i){try{e.insertRule(r,i)}catch{e.insertRule(":root{}",i)}},resume:Cs}}var $m=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);function _c(t){return $m.get(t)}function wc(t){var e=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(t);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function xc(t,e){var r=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(t);return r?r[1]?/^sti/i.test(e)?1:0:r[2]?/^pat/i.test(e)?1:0:r[3]?/^image-/i.test(e)?1:0:r[4]?e[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(e)?4:0:0}var Om=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Sc(){return({stringify:t})=>({stringify(e,r,i){let n="",s=_c(e);s&&(n+=t(s,r,i)+";");let a=wc(e),o=xc(e,r);for(let l of Om)a&l[1]&&(n+=t(l[0]+e,r,i)+";"),o&l[1]&&(n+=t(e,l[0]+r,i)+";");return n+t(e,r,i)}})}function Ec(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",Lo("lineClamp",({_:t})=>kc(t))],["line-clamp-(\\d+)",({1:t})=>kc(t)]]}}function kc(t){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`}}var pn={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",..._t(4,"rem",4,.5,.5),..._t(12,"rem",4,5),14:"3.5rem",..._t(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:be("blur"),backdropBrightness:be("brightness"),backdropContrast:be("contrast"),backdropGrayscale:be("grayscale"),backdropHueRotate:be("hueRotate"),backdropInvert:be("invert"),backdropOpacity:be("opacity"),backdropSaturate:be("saturate"),backdropSepia:be("sepia"),backgroundColor:be("colors"),backgroundImage:{none:"none"},backgroundOpacity:be("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{..._t(200,"",100,0,50),..._t(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:be("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:be("spacing"),borderWidth:{DEFAULT:"1px",...Tt(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:be("colors"),caretColor:be("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{..._t(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:be("borderColor"),divideOpacity:be("borderOpacity"),divideWidth:be("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:t})=>({...t("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:t})=>({...t("spacing"),...un(2,6),...un(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:be("spacing"),gradientColorStops:be("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:t})=>({...t("spacing"),...un(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...un(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{..._t(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:t})=>({auto:"auto",...t("spacing")}),maxHeight:({theme:t})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...t("spacing")}),maxWidth:({theme:t,breakpoints:e})=>({...e(t("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{..._t(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:be("spacing"),placeholderColor:be("colors"),placeholderOpacity:be("opacity"),outlineColor:be("colors"),outlineOffset:Tt(8,"px"),outlineWidth:Tt(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:be("colors"),ringOffsetWidth:Tt(8,"px"),ringOpacity:({theme:t})=>({...t("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Tt(8,"px")},rotate:{...Tt(2,"deg"),...Tt(12,"deg",3),...Tt(180,"deg",45)},saturate:_t(200,"",100,0,50),scale:{..._t(150,"",100,0,50),..._t(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:be("spacing"),scrollPadding:be("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Tt(2,"deg"),...Tt(12,"deg",3)},space:be("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:_t(2),textColor:be("colors"),textDecorationColor:be("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Tt(8,"px")},textUnderlineOffset:{auto:"auto",...Tt(8,"px")},textIndent:be("spacing"),textOpacity:be("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:be("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:t})=>({...t("spacing"),...un(2,4),full:"100%"}),width:({theme:t})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...t("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{..._t(50,"",1,0,10),auto:"auto"}};function un(t,e){let r={};do for(var i=1;i<t;i++)r[`${i}/${t}`]=Number((i/t*100).toFixed(6))+"%";while(++t<=e);return r}function Tt(t,e,r=0){let i={};for(;r<=t;r=2*r||1)i[r]=r+e;return i}function _t(t,e="",r=1,i=0,n=1,s={}){for(;i<=t;i+=n)s[i]=i/r+e;return s}function be(t){return({theme:e})=>e(t)}var Pc={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${pn.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${pn.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var Dc=[N("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:Ht(`[${e}]`,"",r)}}})),N("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),z("aspect-","aspectRatio"),N("container",(t,{theme:e})=>{let{screens:r=e("screens"),center:i,padding:n}=e("container"),s={width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto",...a("xs")};for(let o in r){let l=r[o];typeof l=="string"&&(s[As(l)]={"&":{maxWidth:l,...a(o)}})}return s;function a(o){let l=n&&(typeof n=="string"?n:n[o]||n.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),z("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),N("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),N("box-(border|content)","boxSizing",({1:t})=>t+"-box"),N("hidden",{display:"none"}),N("table-(auto|fixed)","tableLayout"),N(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",N("isolate","isolation"),N("object-(contain|cover|fill|none|scale-down)","objectFit"),z("object-","objectPosition"),N("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Is),N("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),N("(static|fixed|absolute|relative|sticky)","position"),z("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:t!="-x"&&e,right:t!="-y"&&e,bottom:t!="-x"&&e,left:t!="-y"&&e})),z("-?(top|bottom|left|right)(?:$|-)","inset"),N("(visible|collapse)","visibility"),N("invisible",{visibility:"hidden"}),z("-?z-","zIndex"),N("flex-((row|col)(-reverse)?)","flexDirection",Ac),N("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),z("(flex-(?:grow|shrink))(?:$|-)"),z("(flex)-"),z("grow(?:$|-)","flexGrow"),z("shrink(?:$|-)","flexShrink"),z("basis-","flexBasis"),z("-?(order)-"),"-?(order)-(\\d+)",z("grid-cols-","gridTemplateColumns"),N("grid-cols-(\\d+)","gridTemplateColumns",Mc),z("col-","gridColumn"),N("col-(span)-(\\d+)","gridColumn",Ic),z("col-start-","gridColumnStart"),N("col-start-(auto|\\d+)","gridColumnStart"),z("col-end-","gridColumnEnd"),N("col-end-(auto|\\d+)","gridColumnEnd"),z("grid-rows-","gridTemplateRows"),N("grid-rows-(\\d+)","gridTemplateRows",Mc),z("row-","gridRow"),N("row-(span)-(\\d+)","gridRow",Ic),z("row-start-","gridRowStart"),N("row-start-(auto|\\d+)","gridRowStart"),z("row-end-","gridRowEnd"),N("row-end-(auto|\\d+)","gridRowEnd"),N("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>Is(Ac(t))),N("grid-flow-(dense)","gridAutoFlow"),z("auto-cols-","gridAutoColumns"),z("auto-rows-","gridAutoRows"),z("gap-x(?:$|-)","gap","columnGap"),z("gap-y(?:$|-)","gap","rowGap"),z("gap(?:$|-)","gap"),"(justify-(?:items|self))-",N("justify-","justifyContent",Cc),N("(content|items|self)-",t=>({["align-"+t[1]]:Cc(t)})),N("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),z("p([xytrbl])?(?:$|-)","padding",xi("padding")),z("-?m([xytrbl])?(?:$|-)","margin",xi("margin")),z("-?space-(x|y)(?:$|-)","space",({1:t,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[t]]:`calc(${e} * calc(1 - var(--tw-space-${t}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[t]]:`calc(${e} * var(--tw-space-${t}-reverse))`}})),N("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"1"}})),z("w-","width"),z("min-w-","minWidth"),z("max-w-","maxWidth"),z("h-","height"),z("min-h-","minHeight"),z("max-h-","maxHeight"),z("font-","fontWeight"),z("font-","fontFamily",({_:t})=>typeof(t=Te(t))[1]=="string"?{fontFamily:Vt(t)}:{fontFamily:Vt(t[0]),...t[1]}),N("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),N("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),N("italic","fontStyle"),N("not-italic",{fontStyle:"normal"}),N("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:t,2:e="",3:r})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(r?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":t)]:t,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...vr({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),z("tracking-","letterSpacing"),z("leading-","lineHeight"),N("list-(inside|outside)","listStylePosition"),z("list-","listStyleType"),N("list-","listStyleType"),z("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),ze("placeholder-",{property:"color",selector:"&::placeholder"}),N("text-(left|center|right|justify|start|end)","textAlign"),N("text-(ellipsis|clip)","textOverflow"),z("text-opacity-","textOpacity","--tw-text-opacity"),ze("text-",{property:"color"}),z("text-","fontSize",({_:t})=>typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}),z("indent-","textIndent"),N("(overline|underline|line-through)","textDecorationLine"),N("no-underline",{textDecorationLine:"none"}),z("underline-offset-","textUnderlineOffset"),ze("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),z("decoration-","textDecorationThickness"),N("decoration-","textDecorationStyle"),N("(uppercase|lowercase|capitalize)","textTransform"),N("normal-case",{textTransform:"none"}),N("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),N("align-","verticalAlign"),N("whitespace-","whiteSpace"),N("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),N("break-words",{overflowWrap:"break-word"}),N("break-all",{wordBreak:"break-all"}),N("break-keep",{wordBreak:"keep-all"}),ze("caret-",{opacityVariable:!1,opacitySection:"opacity"}),ze("accent-",{opacityVariable:!1,opacitySection:"opacity"}),N("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${Wr(t," ")},var(--tw-gradient-stops))`),ze("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-from":t.value,"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),ze("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${t.value},var(--tw-gradient-to)`})),ze("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),N("bg-(fixed|local|scroll)","backgroundAttachment"),N("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),N(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),N("bg-blend-","backgroundBlendMode"),N("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+(t=="text"?"":"-box")),z("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),ze("bg-",{section:"backgroundColor"}),z("bg-","backgroundImage"),z("bg-","backgroundPosition"),N("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Is),z("bg-","backgroundSize"),z("rounded(?:$|-)","borderRadius"),z("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:t,_:e})=>{let r={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[t]||[t,t];return{[`border-${Wr(r[0])}-radius`]:e,[`border-${Wr(r[1])}-radius`]:e}}),N("border-(collapse|separate)","borderCollapse"),z("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),N("border-(solid|dashed|dotted|double|none)","borderStyle"),z("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>({...vr({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(t||"-x")]:e,["--tw-border-spacing"+(t||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),ze("border-([xytrbl])-",{section:"borderColor"},xi("border","Color")),ze("border-"),z("border-([xytrbl])(?:$|-)","borderWidth",xi("border","Width")),z("border(?:$|-)","borderWidth"),z("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),N("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),N("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),z("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let r={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${Wr(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${Wr(r[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),ze("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),z("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),ze("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),z("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),N("ring-inset",{"--tw-ring-inset":"inset"}),ze("ring-",{property:"--tw-ring-color"}),z("ring(?:$|-)","ringWidth",({_:t},{theme:e})=>({...vr({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":Ct(e("ringOffsetColor","","#fff")),"--tw-ring-color":Ct(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${t} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),ze("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),z("shadow(?:$|-)","boxShadow",({_:t})=>({...vr({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":Vt(t),"--tw-shadow-colored":Vt(t).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),z("(opacity)-"),N("mix-blend-","mixBlendMode"),...Tc(),...Tc("backdrop-"),z("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:Vt(t),transitionTimingFunction:t._=="none"?void 0:Vt(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:Vt(e("transitionDuration",""))})),z("duration(?:$|-)","transitionDuration","transitionDuration",Vt),z("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",Vt),z("delay(?:$|-)","transitionDelay","transitionDelay",Vt),z("animate(?:$|-)","animation",(t,{theme:e,h:r,e:i})=>{let n=Vt(t),s=n.split(" "),a=e("keyframes",s[0]);return a?{["@keyframes "+(s[0]=i(r(s[0])))]:a,animation:s.join(" ")}:{animation:n}}),"(transform)-(none)",N("transform",No),N("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":Fc(t=="gpu")})),z("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...No()})),z("-?(rotate)-","rotate",Vo),z("-?(translate-[xy])-","translate",Vo),z("-?(skew-[xy])-","skew",Vo),N("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Is),"(appearance)-",z("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",z("(cursor)-"),"(cursor)-",N("snap-(none)","scroll-snap-type"),N("snap-(x|y|both)",({1:t})=>({...vr({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),N("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),N("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),N("snap-(normal|always)","scroll-snap-stop"),N("scroll-(auto|smooth)","scroll-behavior"),z("scroll-p([xytrbl])?(?:$|-)","padding",xi("scroll-padding")),z("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",xi("scroll-margin")),N("touch-(auto|none|manipulation)","touch-action"),N("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:r})=>({...vr({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":r?"pan-y":t}`]:t,"touch-action":"var(--tw-touch-action)"})),N("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),N("outline",{outlineStyle:"solid"}),N("outline-(dashed|dotted|double)","outlineStyle"),z("-?(outline-offset)-"),ze("outline-",{opacityVariable:!1,opacitySection:"opacity"}),z("outline-","outlineWidth"),"(pointer-events)-",z("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],N("select-(none|text|all|auto)","userSelect"),ze("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),ze("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),z("stroke-","strokeWidth"),N("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),N("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Is(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function Ac(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function Wr(t,e="-"){let r=[];for(let i of t)r.push({t:"top",r:"right",b:"bottom",l:"left"}[i]);return r.join(e)}function Vt(t){return t&&""+(t._||t)}function Cc({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function xi(t,e=""){return({1:r,_:i})=>{let n={x:"lr",y:"tb"}[r]||r+r;return n?{...cn(t+"-"+Wr(n[0])+e,i),...cn(t+"-"+Wr(n[1])+e,i)}:cn(t+e,i)}}function Tc(t=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",t&&"opacity","saturate","sepia",!t&&"drop-shadow"].filter(Boolean),r={};for(let i of e)r[`--tw-${t}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return r={...vr(r),[`${t}filter`]:e.map(i=>`var(--tw-${t}${i})`).join(" ")},[`(${t}filter)-(none)`,N(`${t}filter`,r),...e.map(i=>z(`${i[0]=="h"?"-?":""}(${t}${i})(?:$|-)`,i,({1:n,_:s})=>({[`--tw-${n}`]:Te(s).map(a=>`${i}(${a})`).join(" "),...r})))]}function Vo({1:t,_:e}){return{["--tw-"+t]:e,...No()}}function No(){return{...vr({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":Fc()}),transform:"var(--tw-transform)"}}function Fc(t){return[t?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function Ic({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function Mc({1:t}){return`repeat(${t},minmax(0,1fr))`}function vr(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var $c=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:t})=>`@media (orientation:${t})`],["contrast-(more|less)",({1:t})=>`@media (prefers-contrast:${t})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:t})=>`&::${t}`],["(marker|selection)",({1:t})=>`& *::${t},&::${t}`],["file","&::file-selector-button"],["(first|last|only)",({1:t})=>`&:${t}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:t,$$:e},r)=>e&&`&[${t}-${r.theme(t,e)||Ht(e,"",r)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:t,3:e="",4:r,5:i="",6:n=e},{e:s,h:a,v:o})=>{let l=wi(i)||(r[0]=="["?r:o(r.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(a(t+n))})`)}${t[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:t})=>`[dir="${t}"] &`],["supports-",({$$:t},e)=>{if(t&&(t=e.theme("supports",t)||Ht(t,"",e)),t)return t.includes(":")||(t+=":var(--tw)"),/^\w*\s*\(/.test(t)||(t=`(${t})`),`@supports ${t.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:t},e)=>{if(t&&(t=e.theme("screens",t)||Ht(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=Ht(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&wi(t).replace(/[}]+$/,"").split("{")]];function Oc({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:Pc,theme:{...pn,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:$c,rules:Dc,finalize(r){return r.n&&r.d&&r.r.some(i=>/^&::(before|after)$/.test(i))&&!/(^|;)content:/.test(r.d)?{...r,d:"content:var(--tw-content);"+r.d}:r}}}var Rm={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Lm={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Bm={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Vm={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Nm={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},zm={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},jm={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},Gm={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Hm={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},qm={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Um={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Wm={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Zm={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},Ym={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},Jm={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Xm={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},Km={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},Qm={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},eg={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},tg={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},rg={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},ig={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Rc={__proto__:null,slate:Rm,gray:Lm,zinc:Bm,neutral:Vm,stone:Nm,red:zm,orange:jm,amber:Gm,yellow:Hm,lime:qm,green:Um,emerald:Wm,teal:Zm,cyan:Ym,sky:Jm,blue:Xm,indigo:Km,violet:Qm,purple:eg,fuchsia:tg,pink:rg,rose:ig};function Lc({disablePreflight:t}={}){return Oc({colors:Rc,disablePreflight:t})}function Nc({className:t="prose",defaultColor:e="gray",extend:r={},colors:i={}}={}){return i={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...i,dark:i.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...i.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,a=s])=>[`${t}-${s}`,(o,l)=>zc(t,a[0]=="."?"."+l.e(l.h(a.slice(1))):a,l,h=>`& :is(${h.trim()})`)]),rules:[[`(lead|not-${t})`,({1:s},{h:a})=>[{c:a(s)}]],[`${t}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[t+"-",({$$:s},a)=>{let o=Vc(a.theme("fontSize",s));return o&&{"@layer components":o}}],[t+"-",({$$:s},a)=>n(s,a)],[t,(s,a)=>({...n(e,a),"@layer base":[Bc(t,a,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:Q(20,16),marginBottom:Q(20,16),paddingLeft:Q(26,16)},li:{marginTop:Q(8,16),marginBottom:Q(8,16)},"ol>li,ul>li":{paddingLeft:Q(6,16)},">ul>li p":{marginTop:Q(12,16),marginBottom:Q(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:Q(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:Q(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:Q(12,16),marginBottom:Q(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:Q(48,16),marginBottom:Q(48,16)},blockquote:{marginTop:Q(32,20),marginBottom:Q(32,20),paddingLeft:Q(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:Q(20,16),marginBottom:Q(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:Q(36,16),marginTop:"0",marginBottom:Q(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:Q(24,16),marginTop:Q(48,24),marginBottom:Q(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:Q(20,16),marginTop:Q(32,20),marginBottom:Q(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:Q(24,16),marginBottom:Q(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:Q(32,16),marginBottom:Q(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:Q(14,16),lineHeight:"1.4",marginTop:Q(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:Q(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:Q(21,24)},"h3 code":{fontSize:Q(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:Q(14,16),lineHeight:"1.7",marginTop:Q(24,14),marginBottom:Q(24,14),borderRadius:"0.375rem",paddingTop:Q(12,14),paddingRight:Q(16,14),paddingBottom:Q(12,14),paddingLeft:Q(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:Q(32,16),marginBottom:Q(32,16),fontSize:Q(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:Q(8,14),paddingBottom:Q(8,14),paddingLeft:Q(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:Q(8,14),paddingRight:Q(8,14),paddingBottom:Q(8,14),paddingLeft:Q(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${a.e(a.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:Q(20,16),lineHeight:"1.6",marginTop:Q(24,20),marginBottom:Q(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Bc(t,a,r)],"@layer components":{...Vc(a.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function n(s,a){let o={},l={},h=(c,u,f)=>{let p=a.theme(`colors.${s}.${u}`,u);f["--tw-prose-"+c]=Ct(p);let m=f!=l&&a.d("colors",`${s}-${u}`,p);m&&(l["--tw-prose-"+c]=Ct(m))};for(let c in i){let u=i[c];c!="dark"&&u&&h(c,u,o)}for(let c in i.dark||{}){let u=i.dark[c];u&&(i.dark?h("invert-"+c,u,o):h(c,u,l))}return Object.keys(o).length?{"@layer defaults":{"&":o,[a.v("dark")]:l}}:void 0}}function Bc(t,e,r){let i={};for(let n in r)i[zc(t,n,e,s=>`.${e.e(e.h(t))}${s}`)]=r[n];return i}function zc(t,e,{e:r,h:i},n){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,a=" ",o=s,l="")=>n(`${a}:where(${o}):not(:where(.${r(i("not-"+t))} *))${l}`))}function Vc(t){return t?typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}:void 0}function Q(t,e){return`${(t/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var zo=Bo({darkMode:"class",theme:{extend:{spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]},fontFamily:{sans:["system-ui","Roboto","Helvetica","Arial","sans-serif"],serif:["ui-serif","Georgia","Cambria","serif"],mono:["ui-monospace","Menlo","Monaco","monospace"]}}},presets:[Lc(),Sc(),Ec(),Nc()],hash:!1});function jc(t,e=!0){let r=function(){if(ng)try{let l=Ts(new CSSStyleSheet);return l.connect=h=>{let c=jo(h);c.adoptedStyleSheets=[...c.adoptedStyleSheets,l.target]},l.disconnect=Cs,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let a=[Ts(s)],o=new WeakMap;return{get target(){return a[0].target},snapshot(){let l=a.map(h=>h.snapshot());return()=>l.forEach(h=>h())},clear(){a.forEach(l=>l.clear())},destroy(){a.forEach(l=>l.destroy())},insert(l,h,c){a[0].insert(l,h,c);let u=this.target.cssRules[h];a.forEach((f,p)=>p&&f.target.insertRule(u.cssText,h))},resume(l,h){return a[0].resume(l,h)},connect(l){let h=document.createElement("style");jo(l).appendChild(h);let c=Ts(h),{cssRules:u}=this.target;for(let f=0;f<u.length;f++)c.target.insertRule(u[f].cssText,f);a.push(c),o.set(l,c)},disconnect(l){let h=a.indexOf(o.get(l));h>=0&&a.splice(h,1)}}}(),i=vc({...t,hash:t.hash??e},r),n=bc(i);return function(a){return class extends a{connectedCallback(){super.connectedCallback?.(),r.connect(this),n.observe(jo(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var ng=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function jo(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var Fe=t=>jc(zo)(t);var Ds,Gc,Fs,Hc,Ms=class extends Fe(Pe){constructor(){super();W(this,Ds);W(this,Fs);me(this,"render",()=>ye`
4
4
  <div class="${L(this,Ds,Gc)?"block":"hidden"} flex h-full w-full flex-col items-stretch justify-center space-y-8 px-4">
5
5
  <!-- examples section -->
6
- ${this.config.examples&&this.config.examples.items.length>0?ye`
7
- <div class="text-gray-500">
8
- <p class="text-md text-center font-semibold">${this.config.examples.title}</p>
6
+ <div class="text-gray-500">
7
+ <p class="text-md text-center font-semibold">${this.config.examples.title}</p>
8
+ ${this.config.examples&&this.config.examples.items.length>0?ye`
9
9
  <ul class="prose mt-2 text-left text-gray-400">
10
10
  ${Ss(this.config.examples.items,r=>r,r=>ye`<li class="w-full rounded-2xl bg-white px-4 py-3 text-sm outline outline-1 outline-[#eeedf1] transition-[color,outline] hover:cursor-pointer hover:outline-[#999]" @click="${()=>ue(this,Fs,Hc).call(this,r)}">“${r}” →</li>`)}
11
11
  </ul>
12
- </div>
13
- `:""}
12
+ `:""}
13
+ </div>
14
14
 
15
15
  <!-- spacer for visual alignment -->
16
16
  <div class="h-1/9"></div>
@@ -388,10 +388,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
388
388
  </p>
389
389
  `)}};customElements.define("mw-powered-by",Dl);var lr,wr,Tn=class{constructor(e){W(this,lr,[]);W(this,wr,new AbortController);e.addController(this),this.hostConnected()}deferCleanup(e){L(this,lr).push(e)}get signal(){return L(this,wr).signal}hostConnected(){de(this,lr,L(this,lr)||[]),de(this,wr,L(this,wr)||new AbortController)}hostDisconnected(){for(;L(this,lr).length>0;)L(this,lr).pop()?.();de(this,lr,[]),L(this,wr).abort(),de(this,wr,new AbortController)}};lr=new WeakMap,wr=new WeakMap;var In,ya=class{constructor(e,r,i){W(this,In,void 0);me(this,"delay");me(this,"callback");this.delay=r,this.callback=i,e.addController(this)}hostConnected(){de(this,In,setTimeout(()=>this.callback(),this.delay))}hostDisconnected(){clearTimeout(L(this,In))}};In=new WeakMap;var ba,Wt,Mn,Dn,_a,Dp,wa,Fp,xa,$p,Sa,Op,ka,Rp,va=class extends Fe(Pe){constructor(){super();W(this,_a);W(this,wa);W(this,xa);W(this,Sa);W(this,ka);W(this,ba,void 0);W(this,Wt,!1);W(this,Mn,!1);W(this,Dn,new Tn(this));me(this,"_handleInteraction",()=>{L(this,Mn)||(de(this,Mn,!0),window.removeEventListener("click",this._handleInteraction),window.removeEventListener("keydown",this._handleInteraction),ue(this,ka,Rp).call(this))});this.position={},this.aiName="Molin AI",this.aiColor="#601feb",this.dialogShown=!1,this.popupDelayMs=5e3,this.popupText="Hello there. How can we help?"}render(){return ye`
390
390
  <!-- shadow backdrop -->
391
- <div class="${L(this,Wt)?"visible opacity-100":"invisible opacity-0"} fixed inset-0 z-[99999999] bg-black bg-opacity-50 transition-[opacity,visibility] sm:hidden"></div>
391
+ <div class="${L(this,Wt)?"visible opacity-100":"invisible opacity-0"} fixed inset-0 z-[2147483647] bg-black bg-opacity-50 transition-[opacity,visibility] sm:hidden"></div>
392
392
 
393
393
  <!-- popup itself -->
394
- <div class="${L(this,Wt)?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${Object.keys(this.position).join(" ")} group fixed bottom-0 left-0 right-0 z-[99999999] overflow-visible rounded-t-2xl bg-white p-4 text-left font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:left-auto sm:top-auto sm:h-auto sm:w-[300px] sm:rounded-2xl" @click="${ue(this,xa,$p)}">
394
+ <div class="${L(this,Wt)?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${Object.keys(this.position).join(" ")} group fixed bottom-0 left-0 right-0 z-[2147483647] overflow-visible rounded-t-2xl bg-white p-4 text-left font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:left-auto sm:top-auto sm:h-auto sm:w-[300px] sm:rounded-2xl" @click="${ue(this,xa,$p)}">
395
395
  <!-- close button -->
396
396
  <button class="absolute right-2 inline-flex h-6 w-6 items-center justify-center rounded-full bg-gray-300 bg-opacity-50 text-center font-sans shadow-none duration-300 ease-in-out hover:scale-105 hover:text-gray-700 focus:outline-none sm:-top-2 sm:opacity-0 sm:shadow sm:transition-opacity sm:group-hover:opacity-100" @click="${ue(this,wa,Fp)}" aria-label="Close dialog">×</button>
397
397
 
@@ -415,17 +415,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
415
415
  `}};Pa=new WeakSet,Lp=function(){switch(this.position){case"top-left":return"top-0 left-0 -mt-1 -ml-1";case"top-right":return"top-0 right-0 -mt-1 -mr-1";case"bottom-left":return"bottom-0 left-0 -mb-1 -ml-1";case"bottom-right":return"bottom-0 right-0 -mb-1 -mr-1";default:return""}},me(Ea,"properties",{color:{type:String,attribute:"color"},animated:{type:Boolean,attribute:"animated"},position:{type:String,attribute:"position"}});customElements.define("mw-pulse-dot",Ea);var Bp=bi(class extends gr{constructor(t){if(super(t),t.type!==vi.ATTRIBUTE||t.name!=="class"||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter(i=>i!=="")));for(let i in e)e[i]&&!this.st?.has(i)&&this.it.add(i);return this.render(e)}let r=t.element.classList;for(let i of this.it)i in e||(r.remove(i),this.it.delete(i));for(let i in e){let n=!!e[i];n===this.it.has(i)||this.st?.has(i)||(n?(r.add(i),this.it.add(i)):(r.remove(i),this.it.delete(i)))}return bt}});var Fl=t=>t??De;var Fn,ut,Nt,$n,$l,Aa=class{constructor(e,r){W(this,$n);W(this,Fn,void 0);W(this,ut,void 0);W(this,Nt,void 0);if(!e)throw new Error("host is required");if(!r)throw new Error("config is required");de(this,Fn,e),L(this,Fn).addController(this),de(this,ut,r)}reconnect(e){de(this,ut,e),L(this,Nt)?.close(),de(this,Nt,ue(this,$n,$l).call(this))}hostConnected(){de(this,Nt,ue(this,$n,$l).call(this))}hostDisconnected(){L(this,Nt)?.close(),de(this,Nt,void 0)}send(e){L(this,Nt)?.send(e)}close(){L(this,Nt)?.close(1e3,"new_chat")}render(e={}){switch(L(this,Nt)?.readyState){case WebSocket.CLOSED:return e.closed?.();case WebSocket.CLOSING:return e.closing?.();case WebSocket.CONNECTING:return e.connecting?.();case WebSocket.OPEN:return e.open?.()}}};Fn=new WeakMap,ut=new WeakMap,Nt=new WeakMap,$n=new WeakSet,$l=function(){let e=new WebSocket(L(this,ut).url());return L(this,ut).onClose&&(e.onclose=L(this,ut).onClose),L(this,ut).onOpen&&(e.onopen=L(this,ut).onOpen),L(this,ut).onError&&(e.onerror=L(this,ut).onError),L(this,ut).onMessage&&(e.onmessage=L(this,ut).onMessage),e};var Zt,et,ti,qi,On,Ui,Ca,Rn,Ol,Ln,Rl,Bn,Ll,Vn,Bl,Ia,Vp,Ta=class{constructor(e,r){W(this,Ui);W(this,Rn);W(this,Ln);W(this,Bn);W(this,Vn);W(this,Ia);W(this,Zt,void 0);W(this,et,void 0);W(this,ti,void 0);W(this,qi,!1);me(this,"isStreaming",!1);me(this,"messages",[]);me(this,"conversationId","");W(this,On,0);e.addController(this),de(this,Zt,e),de(this,et,r),de(this,ti,new Aa(e,{url:()=>L(this,et).url(this.conversationId,{}),onOpen:i=>ue(this,Rn,Ol).call(this,i),onMessage:i=>ue(this,Ln,Rl).call(this,JSON.parse(i.data)),onError:i=>ue(this,Bn,Ll).call(this,i),onClose:i=>ue(this,Vn,Bl).call(this,i)}))}sendUserInput(e){ue(this,Ui,Ca).call(this,{type:"USER_INPUT",value:e},{expectStreaming:!0})}sendUserCancel(){ue(this,Ui,Ca).call(this,{type:"USER_CANCEL"})}reconnect(){vh(this,On)._++,setTimeout(()=>{L(this,et).onReconnect?.(),L(this,ti).reconnect({url:()=>L(this,et).url(this.conversationId,{resume:!0}),onOpen:e=>ue(this,Rn,Ol).call(this,e),onMessage:e=>ue(this,Ln,Rl).call(this,JSON.parse(e.data)),onError:e=>ue(this,Bn,Ll).call(this,e),onClose:e=>ue(this,Vn,Bl).call(this,e)})},1e3*L(this,On))}hostConnected(){let e=L(this,et).restoreConversationState?.()||{conversationId:crypto.randomUUID(),messages:[]};this.messages=e.messages,this.conversationId=e.conversationId,de(this,qi,!0)}hostDisconnected(){de(this,qi,!1)}reset(){L(this,ti).close(),L(this,et).onReset?.(),this.isStreaming=!1,this.messages=[],this.conversationId=crypto.randomUUID(),L(this,Zt).requestUpdate()}};Zt=new WeakMap,et=new WeakMap,ti=new WeakMap,qi=new WeakMap,On=new WeakMap,Ui=new WeakSet,Ca=function(e,{expectStreaming:r=!1}={}){r&&(this.isStreaming=!0,L(this,Zt).requestUpdate()),L(this,ti).send(JSON.stringify(e))},Rn=new WeakSet,Ol=function(e){this.messages.length>0&&setTimeout(()=>{ue(this,Ui,Ca).call(this,{type:"RESUME",messages:ue(this,Ia,Vp).call(this)})},10)},Ln=new WeakSet,Rl=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages.push(e.message),L(this,Zt).requestUpdate(),L(this,et).onNewMessage?.(e.message);break}case"UPDATE_MESSAGE":{let r=this.messages.find(i=>i.id===e.message.id);if(r)Object.assign(r,e.message),L(this,Zt).requestUpdate(),L(this,et).onUpdateMessage?.(e);else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let r=this.messages.find(i=>i.id===e.message.id);if(r?.content==="\xB7 \xB7 \xB7")this.messages=this.messages.filter(i=>i.id!==e.message.id);else if(r)Object.assign(r,e.message);else throw new Error(`Message with id ${e.message.id} not found`);L(this,et).persistConversationState?.(this.conversationId,this.messages),this.isStreaming=!1,L(this,Zt).requestUpdate(),L(this,et).onMessageDone?.(e);break}case"ERROR":{L(this,et).onMessageError?.(e);break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Bn=new WeakSet,Ll=function(e){L(this,et).onError?.(e)},Vn=new WeakSet,Bl=function(e){this.isStreaming=!1,L(this,Zt).requestUpdate(),L(this,qi)&&this.reconnect(),L(this,et).onClose?.()},Ia=new WeakSet,Vp=function(){return this.messages.map(({id:e,role:r,content:i,timestamp:n})=>({id:e,role:r,content:i,timestamp:n}))};function Np(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function ne(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Np(Object(r),!0).forEach(function(i){Y(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Np(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Hl(t){return Hl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hl(t)}function Oe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zp(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Re(t,e,r){return e&&zp(t.prototype,e),r&&zp(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Y(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ql(t,e)}function ja(t){return ja=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ja(t)}function ql(t,e){return ql=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ql(t,e)}function T0(t,e){if(t==null)return{};var r,i,n=function(a,o){if(a==null)return{};var l,h,c={},u=Object.keys(a);for(h=0;h<u.length;h++)l=u[h],o.indexOf(l)>=0||(c[l]=a[l]);return c}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function I0(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(t)}function _d(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var r,i=ja(t);if(e){var n=ja(this).constructor;r=Reflect.construct(i,arguments,n)}else r=i.apply(this,arguments);return I0(this,r)}}function zt(t,e){return function(r){if(Array.isArray(r))return r}(t)||function(r,i){var n=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(n!=null){var s,a,o=[],l=!0,h=!1;try{for(n=n.call(r);!(l=(s=n.next()).done)&&(o.push(s.value),!i||o.length!==i);l=!0);}catch(c){h=!0,a=c}finally{try{l||n.return==null||n.return()}finally{if(h)throw a}}return o}}(t,e)||oh(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
416
416
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ul(t){return function(e){if(Array.isArray(e))return Wl(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||oh(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
417
417
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function oh(t,e){if(t){if(typeof t=="string")return Wl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Wl(t,e):void 0}}function Wl(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function ai(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=oh(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(l){throw l},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
418
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{a||r.return==null||r.return()}finally{if(o)throw s}}}}var oi={DEBUG:!1,LIB_VERSION:"1.95.1"},M0=Array.isArray,wd=Object.prototype,xd=wd.hasOwnProperty,Yn=wd.toString,We=M0||function(t){return Yn.call(t)==="[object Array]"},jp=function(t){return Yn.call(t)==="[object Uint8Array]"},jt=function(t){return typeof t=="function"},Pr=function(t){return t===Object(t)&&!We(t)},D0=function(t){if(Pr(t)){for(var e in t)if(xd.call(t,e))return!1;return!0}return!1},ve=function(t){return t===void 0},St=function(t){return Yn.call(t)=="[object String]"},Ft=function(t){return t===null},cr=function(t){return Yn.call(t)=="[object Number]"},Zl=function(t){return Yn.call(t)==="[object Boolean]"},Sd=Array.prototype,Gp=Sd.forEach,Hp=Sd.indexOf,O=typeof window<"u"?window:void 0,qp=O?.navigator,K=O?.document,Ge=qp?.userAgent,tt=O??{},Up="[PostHog.js]",j={_log:function(t){if(O&&(oi.DEBUG||tt.POSTHOG_DEBUG)&&!ve(O.console)&&O.console){for(var e=("__rrweb_original__"in O.console[t])?O.console[t].__rrweb_original__:O.console[t],r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];e.apply(void 0,[Up].concat(i))}},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];j._log.apply(j,["log"].concat(e))},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];j._log.apply(j,["warn"].concat(e))},error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];j._log.apply(j,["error"].concat(e))},critical:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];(t=console).error.apply(t,[Up].concat(r))},uninitializedWarning:function(t){j.error("You must initialize PostHog before calling ".concat(t))}},lh={},Ga=function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Ji(t,e,r){if(We(t)){if(Gp&&t.forEach===Gp)t.forEach(e,r);else if("length"in t&&t.length===+t.length){for(var i=0,n=t.length;i<n;i++)if(i in t&&e.call(r,t[i],i)===lh)return}}}function Ce(t,e,r){if(!Ft(t)&&!ve(t)){if(We(t))return Ji(t,e,r);for(var i in t)if(xd.call(t,i)&&e.call(r,t[i],i)===lh)return}}var Ye=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return Ji(r,function(n){for(var s in n)n[s]!==void 0&&(t[s]=n[s])}),t};function xe(t,e){return t.indexOf(e)!==-1}function Ra(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}var kd=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Wp=function(t){try{return t()}catch{return}},Ed=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(this,r)}catch(n){j.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),j.critical(n)}}},Yl=function(t){var e={};return Ce(t,function(r,i){St(r)&&r.length>0&&(e[i]=r)}),e},F0=["$performance_raw"];function $0(t,e){return r=t,i=function(s,a){return a&&F0.indexOf(a)>-1?s:St(s)&&!Ft(e)?s.slice(0,e):s},n=new Set,function s(a,o){return a!==Object(a)?i?i(a,o):a:n.has(a)?void 0:(n.add(a),We(a)?(l=[],Ji(a,function(h){l.push(s(h))})):(l={},Ce(a,function(h,c){n.has(h)||(l[c]=s(h,c))})),l);var l}(r);var r,i,n}function hh(t){var e,r,i,n,s,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o=0,l=0,h="",c=[];if(!t)return t;t=O0(t);do e=(s=t.charCodeAt(o++)<<16|t.charCodeAt(o++)<<8|t.charCodeAt(o++))>>18&63,r=s>>12&63,i=s>>6&63,n=63&s,c[l++]=a.charAt(e)+a.charAt(r)+a.charAt(i)+a.charAt(n);while(o<t.length);switch(h=c.join(""),t.length%3){case 1:h=h.slice(0,-2)+"==";break;case 2:h=h.slice(0,-1)+"="}return h}var O0=function(t){var e,r,i,n,s="";for(e=r=0,i=(t=(t+"").replace(/\r\n/g,`
418
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{a||r.return==null||r.return()}finally{if(o)throw s}}}}var oi={DEBUG:!1,LIB_VERSION:"1.96.1"},M0=Array.isArray,wd=Object.prototype,xd=wd.hasOwnProperty,Yn=wd.toString,We=M0||function(t){return Yn.call(t)==="[object Array]"},jp=function(t){return Yn.call(t)==="[object Uint8Array]"},jt=function(t){return typeof t=="function"},Pr=function(t){return t===Object(t)&&!We(t)},D0=function(t){if(Pr(t)){for(var e in t)if(xd.call(t,e))return!1;return!0}return!1},ve=function(t){return t===void 0},St=function(t){return Yn.call(t)=="[object String]"},Ft=function(t){return t===null},cr=function(t){return Yn.call(t)=="[object Number]"},Zl=function(t){return Yn.call(t)==="[object Boolean]"},Sd=Array.prototype,Gp=Sd.forEach,Hp=Sd.indexOf,O=typeof window<"u"?window:void 0,qp=O?.navigator,K=O?.document,Ge=qp?.userAgent,tt=O??{},Up="[PostHog.js]",j={_log:function(t){if(O&&(oi.DEBUG||tt.POSTHOG_DEBUG)&&!ve(O.console)&&O.console){for(var e=("__rrweb_original__"in O.console[t])?O.console[t].__rrweb_original__:O.console[t],r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];e.apply(void 0,[Up].concat(i))}},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];j._log.apply(j,["log"].concat(e))},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];j._log.apply(j,["warn"].concat(e))},error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];j._log.apply(j,["error"].concat(e))},critical:function(){for(var t,e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];(t=console).error.apply(t,[Up].concat(r))},uninitializedWarning:function(t){j.error("You must initialize PostHog before calling ".concat(t))}},lh={},Ga=function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Ji(t,e,r){if(We(t)){if(Gp&&t.forEach===Gp)t.forEach(e,r);else if("length"in t&&t.length===+t.length){for(var i=0,n=t.length;i<n;i++)if(i in t&&e.call(r,t[i],i)===lh)return}}}function Ce(t,e,r){if(!Ft(t)&&!ve(t)){if(We(t))return Ji(t,e,r);for(var i in t)if(xd.call(t,i)&&e.call(r,t[i],i)===lh)return}}var Ye=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return Ji(r,function(n){for(var s in n)n[s]!==void 0&&(t[s]=n[s])}),t};function xe(t,e){return t.indexOf(e)!==-1}function Ra(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}var kd=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Wp=function(t){try{return t()}catch{return}},Ed=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(this,r)}catch(n){j.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),j.critical(n)}}},Yl=function(t){var e={};return Ce(t,function(r,i){St(r)&&r.length>0&&(e[i]=r)}),e},F0=["$performance_raw"];function $0(t,e){return r=t,i=function(s,a){return a&&F0.indexOf(a)>-1?s:St(s)&&!Ft(e)?s.slice(0,e):s},n=new Set,function s(a,o){return a!==Object(a)?i?i(a,o):a:n.has(a)?void 0:(n.add(a),We(a)?(l=[],Ji(a,function(h){l.push(s(h))})):(l={},Ce(a,function(h,c){n.has(h)||(l[c]=s(h,c))})),l);var l}(r);var r,i,n}function hh(t){var e,r,i,n,s,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o=0,l=0,h="",c=[];if(!t)return t;t=O0(t);do e=(s=t.charCodeAt(o++)<<16|t.charCodeAt(o++)<<8|t.charCodeAt(o++))>>18&63,r=s>>12&63,i=s>>6&63,n=63&s,c[l++]=a.charAt(e)+a.charAt(r)+a.charAt(i)+a.charAt(n);while(o<t.length);switch(h=c.join(""),t.length%3){case 1:h=h.slice(0,-2)+"==";break;case 2:h=h.slice(0,-1)+"="}return h}var O0=function(t){var e,r,i,n,s="";for(e=r=0,i=(t=(t+"").replace(/\r\n/g,`
419
419
  `).replace(/\r/g,`
420
- `)).length,n=0;n<i;n++){var a=t.charCodeAt(n),o=null;a<128?r++:o=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),Ft(o)||(r>e&&(s+=t.substring(e,r)),s+=o,e=r=n+1)}return r>e&&(s+=t.substring(e,t.length)),s},qn=function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation),e}return t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0},function(e,r,i,n,s){if(e)if(e.addEventListener&&!n)e.addEventListener(r,i,!!s);else{var a="on"+r,o=e[a];e[a]=function(l,h,c){return function(u){if(u=u||t(O?.event)){var f,p=!0;jt(c)&&(f=c(u));var m=h.call(l,u);return f!==!1&&m!==!1||(p=!1),p}}}(e,i,o)}else j.error("No valid element provided to register_event")}}();function Un(t,e){var r=function(){if(!K)return e("document not found");var i=K.createElement("script");i.type="text/javascript",i.src=t,i.onload=function(a){return e(void 0,a)},i.onerror=function(a){return e(a)};var n,s=K.querySelectorAll("body > script");s.length>0?(n=s[0].parentNode)===null||n===void 0||n.insertBefore(i,s[0]):K.body.appendChild(i)};K!=null&&K.body?r():K?.addEventListener("DOMContentLoaded",r)}function ch(t){return t?Ga(t).split(/\s+/):[]}function Ha(t){var e="";switch(Hl(t.className)){case"string":e=t.className;break;case"object":e=("baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return ch(e)}function qa(t){var e="";return La(t)&&!Ad(t)&&t.childNodes&&t.childNodes.length&&Ce(t.childNodes,function(r){Pd(r)&&r.textContent&&(e+=Ga(r.textContent).split(/(\s+)/).filter(Wi).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),Ga(e)}function Zp(t){return!!t&&t.nodeType===1}function si(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Pd(t){return!!t&&t.nodeType===3}function Yp(t){return!!t&&t.nodeType===11}var Vl=["a","button","form","input","select","textarea","label"];function La(t){for(var e=t;e.parentNode&&!si(e,"body");e=e.parentNode){var r=Ha(e);if(xe(r,"ph-sensitive")||xe(r,"ph-no-capture"))return!1}if(xe(Ha(t),"ph-include"))return!0;var i=t.type||"";if(St(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!(St(n)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))}function Ad(t){return!!(si(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||si(t,"select")||si(t,"textarea")||t.getAttribute("contenteditable")==="true")}function Wi(t){return!(Ft(t)||ve(t)||St(t)&&(t=Ga(t),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((t||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(t)))}function Jp(t){var e=qa(t);return Wi(e="".concat(e," ").concat(Cd(t)).trim())?e:""}function Cd(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Ce(t.childNodes,function(r){var i;if(r&&((i=r.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{var n=qa(r);e="".concat(e," ").concat(n).trim(),r.childNodes&&r.childNodes.length&&(e="".concat(e," ").concat(Cd(r)).trim())}catch(s){j.error(s)}}),e}function R0(t){return function(e){var r=e.map(function(i){var n,s,a="";if(i.tag_name&&(a+=i.tag_name),i.attr_class){i.attr_class.sort();var o,l=ai(i.attr_class);try{for(l.s();!(o=l.n()).done;){var h=o.value;a+=".".concat(h.replace(/"/g,""))}}catch(f){l.e(f)}finally{l.f()}}var c=ne(ne(ne(ne({},i.text?{text:i.text}:{}),{},{"nth-child":(n=i.nth_child)!==null&&n!==void 0?n:0,"nth-of-type":(s=i.nth_of_type)!==null&&s!==void 0?s:0},i.href?{href:i.href}:{}),i.attr_id?{attr_id:i.attr_id}:{}),i.attributes),u={};return Ra(c).sort(function(f,p){var m=zt(f,1)[0],g=zt(p,1)[0];return m.localeCompare(g)}).forEach(function(f){var p=zt(f,2),m=p[0],g=p[1];return u[Xp(m.toString())]=Xp(g.toString())}),a+=":",a+=Ra(c).map(function(f){var p=zt(f,2),m=p[0],g=p[1];return"".concat(m,'="').concat(g,'"')}).join("")});return r.join(";")}(function(e){return e.map(function(r){var i,n,s={text:(i=r.$el_text)===null||i===void 0?void 0:i.slice(0,400),tag_name:r.tag_name,href:(n=r.attr__href)===null||n===void 0?void 0:n.slice(0,2048),attr_class:L0(r),attr_id:r.attr__id,nth_child:r.nth_child,nth_of_type:r.nth_of_type,attributes:{}};return Ra(r).filter(function(a){return zt(a,1)[0].indexOf("attr__")===0}).forEach(function(a){var o=zt(a,2),l=o[0],h=o[1];return s.attributes[l]=h}),s})}(t))}function Xp(t){return t.replace(/"|\\"/g,'\\"')}function L0(t){var e=t.attr__class;return e?We(e)?e:ch(e):void 0}var B0=function(){function t(e){Oe(this,t),this.clicks=[],this.enabled=e}return Re(t,[{key:"isRageClick",value:function(e,r,i){if(!this.enabled)return!1;var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(r-n.y)<30&&i-n.timestamp<1e3){if(this.clicks.push({x:e,y:r,timestamp:i}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:r,timestamp:i}];return!1}}]),t}(),Td="$people_distinct_id",Ba="__alias",Gn="__timers",Kp="$autocapture_disabled_server_side",Jl="$session_recording_enabled_server_side",Qp="$console_log_recording_enabled_server_side",ed="$session_recording_recorder_version_server_side",td="$session_recording_network_payload_capture",Ua="$sesid",Va="$session_is_sampled",Zi="$enabled_feature_flags",Xl="$early_access_features",Yi="$stored_person_properties",kr="$stored_group_properties",Kl="$surveys",Wa="$flag_call_reported",Ql="$user_state",eh="$posthog_quota_limited",th="$client_session_props",V0=[Td,Ba,"__cmpns",Gn,Jl,Ua,Zi,Ql,eh,Xl,kr,Yi,Kl,Wa,th];function Nl(t,e){return e.length>t?e.slice(0,t)+"...":e}var Er={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(t){var e,r=Ft(this._isDisabledServerSide)?!((e=t.persistence)===null||e===void 0||!e.props[Kp]):this._isDisabledServerSide,i=!!t.config.autocapture;this._isAutocaptureEnabled=i&&!r},_previousElementSibling:function(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Zp(e));return e},_getAugmentPropertiesFromElement:function(t){if(!La(t))return{};var e={};return Ce(t.attributes,function(r){if(r.name.indexOf("data-ph-capture-attribute")===0){var i=r.name.replace("data-ph-capture-attribute-",""),n=r.value;i&&n&&Wi(n)&&(e[i]=n)}}),e},_getPropertiesFromElement:function(t,e,r){var i,n=t.tagName.toLowerCase(),s={tag_name:n};Vl.indexOf(n)>-1&&!r&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?s.$el_text=Nl(1024,Jp(t)):s.$el_text=Nl(1024,qa(t)));var a=Ha(t);a.length>0&&(s.classes=a.filter(function(u){return u!==""}));var o=(i=this.config)===null||i===void 0?void 0:i.element_attribute_ignorelist;Ce(t.attributes,function(u){var f;if((!Ad(t)||["name","id","class"].indexOf(u.name)!==-1)&&(o==null||!o.includes(u.name))&&!e&&Wi(u.value)&&(f=u.name,!St(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var p=u.value;u.name==="class"&&(p=ch(p).join(" ")),s["attr__"+u.name]=Nl(1024,p)}});for(var l=1,h=1,c=t;c=this._previousElementSibling(c);)l++,c.tagName===t.tagName&&h++;return s.nth_child=l,s.nth_of_type=h,s},_getDefaultProperties:function(t){return{$event_type:t,$ce_version:1}},_extractCustomPropertyValue:function(t){var e=[];return Ce(K?.querySelectorAll(t.css_selector),function(r){var i;["input","select"].indexOf(r.tagName.toLowerCase())>-1?i=r.value:r.textContent&&(i=r.textContent),Wi(i)&&e.push(i)}),e.join(", ")},_getCustomProperties:function(t){var e=this,r={};return Ce(this._customProperties,function(i){Ce(i.event_selectors,function(n){Ce(K?.querySelectorAll(n),function(s){xe(t,s)&&La(s)&&(r[i.name]=e._extractCustomPropertyValue(i))})})}),r},_getEventTarget:function(t){return ve(t.target)?t.srcElement||null:(e=t.target)!==null&&e!==void 0&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e},_captureEvent:function(t,e){var r,i=this,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"$autocapture",s=this._getEventTarget(t);if(Pd(s)&&(s=s.parentNode||null),n==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this._captureEvent(t,e,"$rageclick"),s&&function(g,d){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!O||!g||si(g,"html")||!Zp(g))return!1;if(y!=null&&y.url_allowlist){var v=O.location.href,b=y.url_allowlist;if(b&&!b.some(function(E){return v.match(E)}))return!1}if(y!=null&&y.dom_event_allowlist){var _=y.dom_event_allowlist;if(_&&!_.some(function(E){return d.type===E}))return!1}if(y!=null&&y.element_allowlist){var S=y.element_allowlist;if(S&&!S.some(function(E){return g.tagName.toLowerCase()===E}))return!1}if(y!=null&&y.css_selector_allowlist){var T=y.css_selector_allowlist;if(T&&!T.some(function(E){return g.matches(E)}))return!1}for(var x=!1,w=[g],M=!0,k=g;k.parentNode&&!si(k,"body");)if(Yp(k.parentNode))w.push(k.parentNode.host),k=k.parentNode.host;else{if(!(M=k.parentNode||!1))break;if(Vl.indexOf(M.tagName.toLowerCase())>-1)x=!0;else{var I=O.getComputedStyle(M);I&&I.getPropertyValue("cursor")==="pointer"&&(x=!0)}w.push(M),k=M}var P=O.getComputedStyle(g);if(P&&P.getPropertyValue("cursor")==="pointer"&&d.type==="click")return!0;var A=g.tagName.toLowerCase();switch(A){case"html":return!1;case"form":return d.type==="submit";case"input":case"select":case"textarea":return d.type==="change"||d.type==="click";default:return x?d.type==="click":d.type==="click"&&(Vl.indexOf(A)>-1||g.getAttribute("contenteditable")==="true")}}(s,t,this.config)){for(var a,o,l=[s],h=s;h.parentNode&&!si(h,"body");)Yp(h.parentNode)?(l.push(h.parentNode.host),h=h.parentNode.host):(l.push(h.parentNode),h=h.parentNode);var c,u=[],f={},p=!1;if(Ce(l,function(g){var d=La(g);g.tagName.toLowerCase()==="a"&&(c=g.getAttribute("href"),c=d&&Wi(c)&&c),xe(Ha(g),"ph-no-capture")&&(p=!0),u.push(i._getPropertiesFromElement(g,e.config.mask_all_element_attributes,e.config.mask_all_text));var y=i._getAugmentPropertiesFromElement(g);Ye(f,y)}),e.config.mask_all_text||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?u[0].$el_text=Jp(s):u[0].$el_text=qa(s)),c&&(u[0].attr__href=c),p)return!1;var m=Ye(this._getDefaultProperties(t.type),e.elementsChainAsString?{$elements_chain:R0(u)}:{$elements:u},(a=u[0])!==null&&a!==void 0&&a.$el_text?{$el_text:(o=u[0])===null||o===void 0?void 0:o.$el_text}:{},this._getCustomProperties(l),f);return e.capture(n,m),!0}},_navigate:function(t){O&&(O.location.href=t)},_addDomEventHandlers:function(t){var e=this;if(O&&K){var r=function(i){i=i||O?.event,e._captureEvent(i,t)};qn(K,"submit",r,!1,!0),qn(K,"change",r,!1,!0),qn(K,"click",r,!1,!0)}},_customProperties:[],rageclicks:null,config:void 0,init:function(t){var e;Zl(t.__autocapture)||(this.config=t.__autocapture),(e=this.config)!==null&&e!==void 0&&e.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map(function(r){return new RegExp(r)})),this.rageclicks=new B0(t.config.rageclick)},afterDecideResponse:function(t,e){var r=e.config.token;this._initializedTokens.indexOf(r)>-1?j.info('autocapture already initialized for token "'+r+'"'):(e.persistence&&e.persistence.register(Y({},Kp,!!t.autocapture_opt_out)),this._isDisabledServerSide=!!t.autocapture_opt_out,this._setIsAutocaptureEnabled(e),this._initializedTokens.push(r),t&&t.config&&t.config.enable_collect_everything&&this._isAutocaptureEnabled?(t.custom_properties&&(this._customProperties=t.custom_properties),this._addDomEventHandlers(e)):e.__autocapture=!1)},enabledForProject:function(t,e,r){if(!t)return!0;e=ve(e)?10:e,r=ve(r)?10:r;for(var i=0,n=0;n<t.length;n++)i+=t.charCodeAt(n);return i%e<r},isBrowserSupported:function(){return jt(K?.querySelectorAll)}};(function(t){for(var e in t)jt(t[e])&&(t[e]=t[e].bind(t))})(Er),function(t){for(var e in t)jt(t[e])&&(t[e]=Ed(t[e]))}(Er);var zl="$active_feature_flags",Ma="$override_feature_flags",rd="$feature_flag_payloads",id=function(t){var e,r={},i=ai(Ra(t||{}));try{for(i.s();!(e=i.n()).done;){var n=zt(e.value,2),s=n[0],a=n[1];a&&(r[s]=a)}}catch(o){i.e(o)}finally{i.f()}return r},N0=function(){function t(e){Oe(this,t),this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return Re(t,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Zi),r=this.instance.get_property(Ma);if(!r)return e||{};for(var i=Ye({},e),n=Object.keys(r),s=0;s<n.length;s++)r[n[s]]===!1?delete i[n[s]]:i[n[s]]=r[n[s]];return this._override_warning||(j.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:r,finalFlags:i}),this._override_warning=!0),i}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(rd)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var r=this.instance.config.token,i=this.instance.get_property(Yi),n=this.instance.get_property(kr),s=hh(JSON.stringify({token:r,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i,group_properties:n,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0}));this.instance._send_request(this.instance.config.api_host+"/decide/?v=3",{data:s},{method:"POST"},this.instance._prepare_callback(function(a){e.$anon_distinct_id=void 0,e.receivedFeatureFlags(a),e.setReloadingPaused(!1),e._startReloadTimer()}))}}},{key:"getFeatureFlag",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var i,n=this.getFlagVariants()[e],s="".concat(n),a=this.instance.get_property(Wa)||{};return(r.send_event||!("send_event"in r))&&(!(e in a)||!a[e].includes(s))&&(We(a[e])?a[e].push(s):a[e]=[s],(i=this.instance.persistence)===null||i===void 0||i.register(Y({},Wa,a)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}j.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,r);j.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(r){return r!==e})}},{key:"receivedFeatureFlags",value:function(e){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads();(function(n,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=n.featureFlags,h=n.featureFlagPayloads;if(l)if(We(l)){var c,u={};if(l)for(var f=0;f<l.length;f++)u[l[f]]=!0;s&&s.register((Y(c={},zl,l),Y(c,Zi,u),c))}else{var p,m=l,g=h;n.errorsWhileComputingFlags&&(m=ne(ne({},a),m),g=ne(ne({},o),g)),s&&s.register((Y(p={},zl,Object.keys(id(m))),Y(p,Zi,m||{}),Y(p,rd,g||{}),p))}})(e,this.instance.persistence,r,i),this._fireFeatureFlagsCallbacks()}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return j.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,e===!1)this.instance.persistence.unregister(Ma);else if(We(e)){for(var r={},i=0;i<e.length;i++)r[e[i]]=!0;this.instance.persistence.register(Y({},Ma,r))}else this.instance.persistence.register(Y({},Ma,e))}},{key:"onFeatureFlags",value:function(e){var r=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var i=this._prepareFeatureFlagsForCallbacks(),n=i.flags,s=i.flagVariants;e(n,s)}return function(){return r.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,r){var i,n,s=Y({},"$feature_enrollment/".concat(e),r);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:r,$set:s}),this.setPersonPropertiesForFlags(s,!1);var a=ne(ne({},this.getFlagVariants()),{},Y({},e,r));(i=this.instance.persistence)===null||i===void 0||i.register((Y(n={},zl,Object.keys(id(a))),Y(n,Zi,a),n)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.instance.get_property(Xl);if(n&&!i)return e(n);this.instance._send_request("".concat(this.instance.config.api_host,"/api/early_access_features/?token=").concat(this.instance.config.token),{},{method:"GET"},function(s){var a,o=s.earlyAccessFeatures;return(a=r.instance.persistence)===null||a===void 0||a.register(Y({},Xl,o)),e(o)})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),r=this.getFlagVariants();return{flags:e.filter(function(i){return r[i]}),flagVariants:Object.keys(r).filter(function(i){return r[i]}).reduce(function(i,n){return i[n]=r[n],i},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(){var e=this._prepareFeatureFlagsForCallbacks(),r=e.flags,i=e.flagVariants;this.featureFlagEventHandlers.forEach(function(n){return n(r,i)})}},{key:"setPersonPropertiesForFlags",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(Yi)||{};this.instance.register(Y({},Yi,ne(ne({},i),e))),r&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Yi)}},{key:"setGroupPropertiesForFlags",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(kr)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(function(n){i[n]=ne(ne({},i[n]),e[n]),delete e[n]}),this.instance.register(Y({},kr,ne(ne({},i),e))),r&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var r=this.instance.get_property(kr)||{};this.instance.register(Y({},kr,ne(ne({},r),{},Y({},e,{}))))}else this.instance.unregister(kr)}}]),t}();Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return cr(t)&&isFinite(t)&&Math.floor(t)===t});var nd="0123456789abcdef",z0=function(){function t(e){if(Oe(this,t),this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}return Re(t,[{key:"toString",value:function(){for(var e="",r=0;r<this.bytes.length;r++)e=e+nd.charAt(this.bytes[r]>>>4)+nd.charAt(15&this.bytes[r]),r!==3&&r!==5&&r!==7&&r!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new t(this.bytes.slice(0))}},{key:"equals",value:function(e){return this.compareTo(e)===0}},{key:"compareTo",value:function(e){for(var r=0;r<16;r++){var i=this.bytes[r]-e.bytes[r];if(i!==0)return Math.sign(i)}return 0}}],[{key:"fromFieldsV7",value:function(e,r,i,n){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(n)||e<0||r<0||i<0||n<0||e>0xffffffffffff||r>4095||i>1073741823||n>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|r>>>8,s[7]=r,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new t(s)}}]),t}(),j0=function(){function t(){Oe(this,t),Y(this,"timestamp",0),Y(this,"counter",0),Y(this,"random",new G0)}return Re(t,[{key:"generate",value:function(){var e=this.generateOrAbort();if(ve(e)){this.timestamp=0;var r=this.generateOrAbort();if(ve(r))throw new Error("Could not generate UUID after timestamp reset");return r}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return z0.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),t}(),Id=function(t){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};O&&!ve(O.crypto)&&crypto.getRandomValues&&(Id=function(t){return crypto.getRandomValues(t)});var sd,G0=function(){function t(){Oe(this,t),Y(this,"buffer",new Uint32Array(8)),Y(this,"cursor",1/0)}return Re(t,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(Id(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),t}(),ni=function(){return H0().toString()},H0=function(){return(sd||(sd=new j0)).generate()},q0="Thu, 01 Jan 1970 00:00:00 GMT",Nn="",U0=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,W0=function(t){var e=t.match(U0);return e?e[0]:""};function Z0(t,e){if(e){var r=function(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:K;if(Nn)return Nn;if(!s||["localhost","127.0.0.1"].includes(n))return"";for(var a=n.split("."),o=Math.min(a.length,8),l="dmn_chk_"+ni(),h=new RegExp("(^|;)\\s*"+l+"=1");!Nn&&o--;){var c=a.slice(o).join("."),u=l+"=1;domain=."+c;s.cookie=u,h.test(s.cookie)&&(s.cookie=u+";expires="+q0,Nn=c)}return Nn}(t);if(!r){var i=W0(t);i!==r&&j.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var Jt={is_supported:function(){return!!K},error:function(t){j.error("cookieStore error: "+t)},get:function(t){if(K){try{for(var e=t+"=",r=K.cookie.split(";").filter(function(s){return s.length}),i=0;i<r.length;i++){for(var n=r[i];n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return decodeURIComponent(n.substring(e.length,n.length))}}catch{}return null}},parse:function(t){var e;try{e=JSON.parse(Jt.get(t))||{}}catch{}return e},set:function(t,e,r,i,n){if(K)try{var s="",a="",o=Z0(K.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+24*r*60*60*1e3),s="; expires="+l.toUTCString()}n&&(a="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+o+a;return h.length>3686.4&&j.warn("cookieStore warning: large cookie, len="+h.length),K.cookie=h,h}catch{return}},remove:function(t,e){try{Jt.set(t,"",-1,e)}catch{return}}},jl=null,Le={is_supported:function(){if(!Ft(jl))return jl;var t=!0;if(ve(O))t=!1;else try{var e="__mplssupport__";Le.set(e,"xyz"),Le.get(e)!=='"xyz"'&&(t=!1),Le.remove(e)}catch{t=!1}return t||j.error("localStorage unsupported; falling back to cookie store"),jl=t,t},error:function(t){j.error("localStorage error: "+t)},get:function(t){try{return O?.localStorage.getItem(t)}catch(e){Le.error(e)}return null},parse:function(t){try{return JSON.parse(Le.get(t))||{}}catch{}return null},set:function(t,e){try{O?.localStorage.setItem(t,JSON.stringify(e))}catch(r){Le.error(r)}},remove:function(t){try{O?.localStorage.removeItem(t)}catch(e){Le.error(e)}}},Y0=["distinct_id",Ua,Va],Hn=ne(ne({},Le),{},{parse:function(t){try{var e={};try{e=Jt.parse(t)||{}}catch{}var r=Ye(e,JSON.parse(Le.get(t)||"{}"));return Le.set(t,r),r}catch{}return null},set:function(t,e,r,i,n){try{Le.set(t,e);var s={};Y0.forEach(function(a){e[a]&&(s[a]=e[a])}),Object.keys(s).length&&Jt.set(t,s,r,i,n)}catch(a){Le.error(a)}},remove:function(t,e){try{O?.localStorage.removeItem(t),Jt.remove(t,e)}catch(r){Le.error(r)}}}),Da={},J0={is_supported:function(){return!0},error:function(t){j.error("memoryStorage error: "+t)},get:function(t){return Da[t]||null},parse:function(t){return Da[t]||null},set:function(t,e){Da[t]=e},remove:function(t){delete Da[t]}},ri=null,Xe={is_supported:function(){if(!Ft(ri))return ri;if(ri=!0,ve(O))ri=!1;else try{var t="__support__";Xe.set(t,"xyz"),Xe.get(t)!=='"xyz"'&&(ri=!1),Xe.remove(t)}catch{ri=!1}return ri},error:function(t){j.error("sessionStorage error: ",t)},get:function(t){try{return O?.sessionStorage.getItem(t)}catch(e){Xe.error(e)}return null},parse:function(t){try{return JSON.parse(Xe.get(t))||null}catch{}return null},set:function(t,e){try{O?.sessionStorage.setItem(t,JSON.stringify(e))}catch(r){Xe.error(r)}},remove:function(t){try{O?.sessionStorage.removeItem(t)}catch(e){Xe.error(e)}}},X0=["localhost","127.0.0.1"],Md=function(t){var e=K?.createElement("a");return ve(e)?null:(e.href=t,e)},K0=function(t,e){return!!function(r){try{new RegExp(r)}catch{return!1}return!0}(e)&&new RegExp(e).test(t)},ad=function(t,e){for(var r,i=((t.split("#")[0]||"").split("?")[1]||"").split("&"),n=0;n<i.length;n++){var s=i[n].split("=");if(s[0]===e){r=s;break}}if(!We(r)||r.length<2)return"";var a=r[1];try{a=decodeURIComponent(a)}catch{j.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Za=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null},He={campaignParams:function(t){var e=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gbraid","wbraid","fbclid","msclkid"].concat(t||[]),r={};return Ce(e,function(i){var n=K?ad(K.URL,i):"";n.length&&(r[i]=n)}),r},searchEngine:function(){var t=K?.referrer;return t?t.search("https?://(.*)google.([^/?]*)")===0?"google":t.search("https?://(.*)bing.com")===0?"bing":t.search("https?://(.*)yahoo.com")===0?"yahoo":t.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null},searchInfo:function(){var t=He.searchEngine(),e=t!="yahoo"?"q":"p",r={};if(!Ft(t)){r.$search_engine=t;var i=K?ad(K.referrer,e):"";i.length&&(r.ph_keyword=i)}return r},browser:function(t,e,r){return e=e||"",r||xe(t," OPR/")?xe(t,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":xe(t,"IEMobile")||xe(t,"WPDesktop")?"Internet Explorer Mobile":xe(t,"SamsungBrowser/")?"Samsung Internet":xe(t,"Edge")||xe(t,"Edg/")?"Microsoft Edge":xe(t,"FBIOS")?"Facebook Mobile":xe(t,"Chrome")?"Chrome":xe(t,"CriOS")?"Chrome iOS":xe(t,"UCWEB")||xe(t,"UCBrowser")?"UC Browser":xe(t,"FxiOS")?"Firefox iOS":xe(e,"Apple")||function(i){return xe(i,"Safari")&&!xe(i,"Chrome")&&!xe(i,"Android")}(t)?xe(t,"Mobile")?"Mobile Safari":"Safari":xe(t,"Android")?"Android Mobile":xe(t,"Konqueror")||xe(t,"konqueror")?"Konqueror":xe(t,"Firefox")?"Firefox":xe(t,"MSIE")||xe(t,"Trident/")?"Internet Explorer":xe(t,"Gecko")?"Mozilla":""},browserVersion:function(t,e,r){var i={"Internet Explorer Mobile":[/rv:(\d+(\.\d+)?)/],"Microsoft Edge":[/Edge?\/(\d+(\.\d+)?)/],Chrome:[/Chrome\/(\d+(\.\d+)?)/],"Chrome iOS":[/CriOS\/(\d+(\.\d+)?)/],"UC Browser":[/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/],Safari:[/Version\/(\d+(\.\d+)?)/],"Mobile Safari":[/Version\/(\d+(\.\d+)?)/],Opera:[/(Opera|OPR)\/(\d+(\.\d+)?)/],Firefox:[/Firefox\/(\d+(\.\d+)?)/],"Firefox iOS":[/FxiOS\/(\d+(\.\d+)?)/],Konqueror:[/Konqueror[:/]?(\d+(\.\d+)?)/i],BlackBerry:[/BlackBerry (\d+(\.\d+)?)/,/Version\/(\d+(\.\d+)?)/],"Android Mobile":[/android\s(\d+(\.\d+)?)/],"Samsung Internet":[/SamsungBrowser\/(\d+(\.\d+)?)/],"Internet Explorer":[/(rv:|MSIE )(\d+(\.\d+)?)/],Mozilla:[/rv:(\d+(\.\d+)?)/]}[He.browser(t,e,r)];if(ve(i))return null;for(var n=0;n<i.length;n++){var s=i[n],a=t.match(s);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(t){if(/Windows/i.test(t)){if(/Phone/.test(t)||/WPDesktop/.test(t))return{os_name:"Windows Phone",os_version:""};var e=/Windows NT ([0-9.]+)/i.exec(t);return e&&e[1]?{os_name:"Windows",os_version:e[1]}:{os_name:"Windows",os_version:""}}if(/(iPhone|iPad|iPod)/.test(t)){var r=/OS (\d+)_(\d+)_?(\d+)?/i.exec(t);return r&&r[1]?{os_name:"iOS",os_version:[r[1],r[2],r[3]||"0"].join(".")}:{os_name:"iOS",os_version:""}}if(/Android/.test(t)){var i=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(t);return i&&i[1]?{os_name:"Android",os_version:[i[1],i[2],i[3]||"0"].join(".")}:{os_name:"Android",os_version:""}}if(/(BlackBerry|PlayBook|BB10)/i.test(t))return{os_name:"BlackBerry",os_version:""};if(/Mac/i.test(t)){var n=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(t);return n&&n[1]?{os_name:"Mac OS X",os_version:[n[1],n[2],n[3]||"0"].join(".")}:{os_name:"Mac OS X",os_version:""}}return/Linux/.test(t)?{os_name:"Linux",os_version:""}:/CrOS/.test(t)?{os_name:"Chrome OS",os_version:""}:{os_name:"",os_version:""}},device:function(t){return/Windows Phone/i.test(t)||/WPDesktop/.test(t)?"Windows Phone":/iPad/.test(t)?"iPad":/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":/Android/.test(t)&&!/Mobile/.test(t)?"Android Tablet":/Android/.test(t)?"Android":""},deviceType:function(t){var e=this.device(t);return e==="iPad"||e==="Android Tablet"?"Tablet":e?"Mobile":"Desktop"},referrer:function(){return K?.referrer||"$direct"},referringDomain:function(){var t;return K!=null&&K.referrer&&((t=Md(K.referrer))===null||t===void 0?void 0:t.host)||"$direct"},properties:function(){if(!Ge)return{};var t=He.os(Ge),e=t.os_name,r=t.os_version;return Ye(Yl({$os:e,$os_version:r,$browser:He.browser(Ge,navigator.vendor,tt.opera),$device:He.device(Ge),$device_type:He.deviceType(Ge)}),{$current_url:O?.location.href,$host:O?.location.host,$pathname:O?.location.pathname,$raw_user_agent:Ge.length>1e3?Ge.substring(0,997)+"...":Ge,$browser_version:He.browserVersion(Ge,navigator.vendor,tt.opera),$browser_language:He.browserLanguage(),$screen_height:O?.screen.height,$screen_width:O?.screen.width,$viewport_height:O?.innerHeight,$viewport_width:O?.innerWidth,$lib:"web",$lib_version:oi.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:kd()/1e3})},people_properties:function(){if(!Ge)return{};var t=He.os(Ge),e=t.os_name,r=t.os_version;return Ye(Yl({$os:e,$os_version:r,$browser:He.browser(Ge,navigator.vendor,tt.opera)}),{$browser_version:He.browserVersion(Ge,navigator.vendor,tt.opera)})}},Q0=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],od=function(){function t(e){Oe(this,t);var r="";e.token&&(r=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,this.custom_campaign_params=e.custom_campaign_params||[],e.persistence_name?this.name="ph_"+e.persistence_name:this.name="ph_"+r+"_posthog",Q0.indexOf(e.persistence.toLowerCase())===-1&&(j.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var i=e.persistence.toLowerCase();i==="localstorage"&&Le.is_supported()?this.storage=Le:i==="localstorage+cookie"&&Hn.is_supported()?this.storage=Hn:i==="sessionstorage"&&Xe.is_supported()?this.storage=Xe:i==="memory"?this.storage=J0:i==="cookie"?this.storage=Jt:Hn.is_supported()?this.storage=Hn:this.storage=Jt,this.user_state="anonymous",this.load(),this.update_config(e),this.save()}return Re(t,[{key:"properties",value:function(){var e={};return Ce(this.props,function(r,i){if(i===Zi&&Pr(r))for(var n=Object.keys(r),s=0;s<n.length;s++)e["$feature/".concat(n[s])]=r[n[s]];else o=i,l=!1,(Ft(a=V0)?l:Hp&&a.indexOf===Hp?a.indexOf(o)!=-1:(Ce(a,function(h){if(l||(l=h===o))return lh}),l))||(e[i]=r);var a,o,l}),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Ye({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,r,i){var n=this;if(Pr(e)){ve(r)&&(r="None"),this.expire_days=ve(i)?this.default_expiry:i;var s=!1;if(Ce(e,function(a,o){n.props.hasOwnProperty(o)&&n.props[o]!==r||(n.props[o]=a,s=!0)}),s)return this.save(),!0}return!1}},{key:"register",value:function(e,r){var i=this;if(Pr(e)){this.expire_days=ve(r)?this.default_expiry:r;var n=!1;if(Ce(e,function(s,a){e.hasOwnProperty(a)&&i.props[a]!==s&&(i.props[a]=s,n=!0)}),n)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(He.campaignParams(this.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(He.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||He.referrer(),$referring_domain:this.props.$referring_domain||He.referringDomain()})}},{key:"get_referrer_info",value:function(){return Yl({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return Ce(this.props,function(r,i){i in e||(e[i]=r)}),e}},{key:"update_config",value:function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,r){var i=this.props[Gn]||{};i[e]=r,this.props[Gn]=i,this.save()}},{key:"remove_event_timer",value:function(e){var r=(this.props[Gn]||{})[e];return ve(r)||(delete this.props[Gn][e],this.save()),r}},{key:"get_user_state",value:function(){return this.props[Ql]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[Ql]=e,this.save()}},{key:"get_quota_limits",value:function(){return this.props[eh]||{}}},{key:"set_quota_limits",value:function(e){this.props[eh]=e,this.save()}}]),t}(),ld=2,ey=4,Dd=3,ty=6,ry=0,iy="rrweb/console@1",ny=Re(function t(e){var r,i,n=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Oe(this,t),Y(this,"bucketSize",100),Y(this,"refillRate",10),Y(this,"mutationBuckets",{}),Y(this,"loggedTracker",{}),Y(this,"refillBuckets",function(){Object.keys(n.mutationBuckets).forEach(function(a){n.mutationBuckets[a]=n.mutationBuckets[a]+n.refillRate,n.mutationBuckets[a]>=n.bucketSize&&delete n.mutationBuckets[a]})}),Y(this,"getNodeOrRelevantParent",function(a){var o=n.rrweb.mirror.getNode(a);if(o?.nodeName!=="svg"&&o instanceof Element){var l=o.closest("svg");if(l)return[n.rrweb.mirror.getId(l),l]}return[a,o]}),Y(this,"numberOfChanges",function(a){var o,l,h,c,u,f,p,m;return((o=(l=a.removes)===null||l===void 0?void 0:l.length)!==null&&o!==void 0?o:0)+((h=(c=a.attributes)===null||c===void 0?void 0:c.length)!==null&&h!==void 0?h:0)+((u=(f=a.texts)===null||f===void 0?void 0:f.length)!==null&&u!==void 0?u:0)+((p=(m=a.adds)===null||m===void 0?void 0:m.length)!==null&&p!==void 0?p:0)}),Y(this,"throttleMutations",function(a){if(a.type!==Dd||a.data.source!==ry)return a;var o=a.data,l=n.numberOfChanges(o);o.attributes&&(o.attributes=o.attributes.filter(function(c){var u,f,p,m=zt(n.getNodeOrRelevantParent(c.id),2),g=m[0],d=m[1];return n.mutationBuckets[g]===0?!1:(n.mutationBuckets[g]=(u=n.mutationBuckets[g])!==null&&u!==void 0?u:n.bucketSize,n.mutationBuckets[g]=Math.max(n.mutationBuckets[g]-1,0),n.mutationBuckets[g]===0&&(n.loggedTracker[g]||(n.loggedTracker[g]=!0,(f=(p=n.options).onBlockedNode)===null||f===void 0||f.call(p,g,d))),c)}));var h=n.numberOfChanges(o);return h!==0||l===h?a:void 0}),this.rrweb=e,this.options=s,this.refillRate=(r=this.options.refillRate)!==null&&r!==void 0?r:this.refillRate,this.bucketSize=(i=this.options.bucketSize)!==null&&i!==void 0?i:this.bucketSize,setInterval(function(){n.refillBuckets()},1e3)}),Fd=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}(Fd||{}),sy={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(t){return t},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6},ay=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],oy=["/s/","/e/","/i/vo/e/"];function hd(t,e,r,i){var n=e?.["content-length"];return n&&parseInt(n)>r?"".concat(i," body too large to record"):t}var Yt,ly=function(t,e){var r,i,n,s=t.session_recording,a=s.recordHeaders!==!1&&e.recordHeaders,o=s.recordBody!==!1&&e.recordBody,l=s.recordPerformance!==!1&&e.recordPerformance,h=(r=s,n=Math.min(1e6,(i=r.payloadSizeLimitBytes)!==null&&i!==void 0?i:1e6),function(f){return f!=null&&f.requestBody&&(f.requestBody=hd(f.requestBody,f.requestHeaders,n,"Request")),f!=null&&f.responseBody&&(f.responseBody=hd(f.responseBody,f.responseHeaders,n,"Response")),f}),c=function(f){return h(function(g){var d=Md(g.name);if(!(d&&d.pathname&&oy.includes(d.pathname)))return g}((p=f,Object.keys((m=p.requestHeaders)!==null&&m!==void 0?m:{}).forEach(function(g){var d;ay.includes(g.toLowerCase())&&((d=p.requestHeaders)===null||d===void 0||delete d[g])}),p)));var p,m},u=jt(t.session_recording.maskNetworkRequestFn);return u&&jt(t.session_recording.maskCapturedNetworkRequestFn)&&j.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),u&&(t.session_recording.maskCapturedNetworkRequestFn=function(f){var p=t.session_recording.maskNetworkRequestFn({url:f.name});return ne(ne({},f),{},{name:p?.url})}),s.maskRequestFn=jt(t.session_recording.maskCapturedNetworkRequestFn)?function(f){var p,m,g,d=c(f);return d&&(p=(m=(g=t.session_recording).maskCapturedNetworkRequestFn)===null||m===void 0?void 0:m.call(g,d))!==null&&p!==void 0?p:void 0}:void 0,s.maskRequestFn||(s.maskRequestFn=c),ne(ne(ne({},sy),s),{},{recordHeaders:a,recordBody:o,recordPerformance:l,recordInitialRequests:l})},hy="/s/",cd=3e5;(function(t){t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet"})(Yt||(Yt={}));var cy=[Yt.MouseMove,Yt.MouseInteraction,Yt.Scroll,Yt.ViewportResize,Yt.Input,Yt.TouchMove,Yt.MediaInteraction,Yt.Drag],uy=function(){function t(e){var r=this;if(Oe(this,t),Y(this,"isIdle",!1),Y(this,"_linkedFlagSeen",!1),Y(this,"_lastActivityTimestamp",Date.now()),Y(this,"windowId",null),Y(this,"sessionId",null),Y(this,"_linkedFlag",null),Y(this,"_sampleRate",null),Y(this,"_minimumDuration",null),Y(this,"_forceAllowLocalhostNetworkCapture",!1),this.instance=e,this._captureStarted=!1,this._endpoint=hy,this.stopRrweb=void 0,this.receivedDecide=!1,O?.addEventListener("beforeunload",function(){r._flushBuffer()}),!this.instance.sessionManager)throw j.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");this.buffer=this.clearBuffer()}return Re(t,[{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw j.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){return cr(this._sampleRate)?this.instance.get_property(Va):null}},{key:"sessionDuration",get:function(){var e,r,i=(e=this.buffer)===null||e===void 0?void 0:e.data[((r=this.buffer)===null||r===void 0?void 0:r.data.length)-1],n=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return i?i.timestamp-n:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(Jl),r=!this.instance.config.disable_session_recording;return O&&e&&r}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(Qp),r=this.instance.config.enable_recording_console_log;return r??e}},{key:"recordingVersion",get:function(){var e,r=this.instance.get_property(ed);return((e=this.instance.config.session_recording)===null||e===void 0?void 0:e.recorderVersion)||r||"v1"}},{key:"networkPayloadCapture",get:function(){var e,r,i=this.instance.get_property(td),n={recordHeaders:(e=this.instance.config.session_recording)===null||e===void 0?void 0:e.recordHeaders,recordBody:(r=this.instance.config.session_recording)===null||r===void 0?void 0:r.recordBody},s=n?.recordHeaders||i?.recordHeaders,a=n?.recordBody||i?.recordBody,o=this.instance.config.capture_performance||i?.capturePerformance;return s||a||o?{recordHeaders:s,recordBody:a,recordPerformance:o}:void 0}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?St(this._linkedFlag)&&!this._linkedFlagSeen?"buffering":Zl(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"disabled":"buffering"}},{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled?this.startCaptureAndTrySendingQueuedSnapshots():(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1)}},{key:"makeSamplingDecision",value:function(e){var r,i=this.sessionId!==e;if(cr(this._sampleRate)){var n,s=this.isSampled;i||!Zl(s)?n=Math.random()<this._sampleRate:n=s,n||j.warn("[SessionSampling] Sample rate (".concat(this._sampleRate,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),(r=this.instance.persistence)===null||r===void 0||r.register(Y({},Va,n))}else{var a;(a=this.instance.persistence)===null||a===void 0||a.register(Y({},Va,null))}}},{key:"afterDecideResponse",value:function(e){var r,i,n,s,a,o,l,h,c=this;this.instance.persistence&&this.instance.persistence.register((Y(h={},Jl,!!e.sessionRecording),Y(h,Qp,(a=e.sessionRecording)===null||a===void 0?void 0:a.consoleLogRecordingEnabled),Y(h,ed,(o=e.sessionRecording)===null||o===void 0?void 0:o.recorderVersion),Y(h,td,ne({capturePerformance:e.capturePerformance},(l=e.sessionRecording)===null||l===void 0?void 0:l.networkPayloadCapture)),h));var u=(r=e.sessionRecording)===null||r===void 0?void 0:r.sampleRate;this._sampleRate=ve(u)||Ft(u)?null:parseFloat(u);var f,p=(i=e.sessionRecording)===null||i===void 0?void 0:i.minimumDurationMilliseconds;if(this._minimumDuration=ve(p)?null:p,this._linkedFlag=((n=e.sessionRecording)===null||n===void 0?void 0:n.linkedFlag)||null,(s=e.sessionRecording)!==null&&s!==void 0&&s.endpoint&&(this._endpoint=(f=e.sessionRecording)===null||f===void 0?void 0:f.endpoint),cr(this._sampleRate)&&this.sessionManager.onSessionId(function(g){c.makeSamplingDecision(g)}),St(this._linkedFlag)){var m=this._linkedFlag;this.instance.onFeatureFlags(function(g){c._linkedFlagSeen=g.includes(m)})}this.receivedDecide=!0,this.startRecordingIfEnabled()}},{key:"log",value:function(e){var r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(r=this.instance.sessionRecording)===null||r===void 0||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:i,trace:[],payload:[JSON.stringify(e)]}},timestamp:kd()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){this._startCapture()}},{key:"_startCapture",value:function(){var e=this;if(!ve(Object.assign)&&!this._captureStarted&&!this.instance.config.disable_session_recording){this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId();var r=this.recordingVersion==="v2"?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.recordingVersion?Un(this.instance.config.api_host+"/static/".concat(r,"?v=").concat(oi.LIB_VERSION),function(i){if(i)return j.error("Could not load ".concat(r),i);e._onScriptLoaded()}):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(e){var r;return e.type===Dd&&cy.indexOf((r=e.data)===null||r===void 0?void 0:r.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(e){var r=this._isInteractiveEvent(e);if(r||this.isIdle||e.timestamp-this._lastActivityTimestamp>cd&&(this.isIdle=!0,this._tryAddCustomEvent("sessionIdle",{reason:"user inactivity",timeSinceLastActive:e.timestamp-this._lastActivityTimestamp,threshold:cd})),r&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),this._tryTakeFullSnapshot())),!this.isIdle){var i=this.sessionManager.checkAndGetSessionAndWindowId(!r,e.timestamp),n=i.windowId,s=i.sessionId,a=this.sessionId!==s,o=this.windowId!==n;[ld,ey].indexOf(e.type)===-1&&(o||a)&&this._tryTakeFullSnapshot(),this.windowId=n,this.sessionId=s}}},{key:"_tryRRwebMethod",value:function(e){if(!this._captureStarted)return!1;try{return e(),!0}catch(r){return j.error("[Session-Recording] using rrweb when not started.",r),!1}}},{key:"_tryAddCustomEvent",value:function(e,r){var i=this;return this._tryRRwebMethod(function(){var n;return(n=i.rrwebRecord)===null||n===void 0?void 0:n.addCustomEvent(e,r)})}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRwebMethod(function(){var r;return(r=e.rrwebRecord)===null||r===void 0?void 0:r.takeFullSnapshot()})}},{key:"_onScriptLoaded",value:function(){var e,r=this,i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=O.rrweb?O.rrweb.record:O.rrwebRecord;for(var n=this.instance.config.session_recording,s=0,a=Object.entries(n||{});s<a.length;s++){var o=zt(a[s],2),l=o[0],h=o[1];l in i&&(i[l]=h)}this.rrwebRecord?(this.mutationRateLimiter=(e=this.mutationRateLimiter)!==null&&e!==void 0?e:new ny(this.rrwebRecord,{onBlockedNode:function(c,u){var f="Too many mutations on node '".concat(c,"'. Rate limiting. This could be due to SVG animations or something similar");j.info(f,{node:u}),r.log("[PostHog Recorder] "+f,"warn")}}),this.stopRrweb=this.rrwebRecord(ne({emit:function(c){r.onRRwebEmit(c)},plugins:this._gatherRRWebPlugins()},i)),this.instance._addCaptureHook(function(c){try{if(c==="$pageview"){var u=O?r._maskUrl(O.location.href):"";if(!u)return;r._tryAddCustomEvent("$pageview",{href:u})}}catch(f){j.error("Could not add $pageview to rrweb session",f)}}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1):j.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_gatherRRWebPlugins",value:function(){var e=[];return tt.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(tt.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&jt(tt.getRecordNetworkPlugin)&&(!X0.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(tt.getRecordNetworkPlugin(ly(this.instance.config,this.networkPayloadCapture))):j.info("[SessionReplay-NetworkCapture] not started because we are on localhost.")),e}},{key:"onRRwebEmit",value:function(e){if(e&&Pr(e)){if(e.type===Fd.Meta){var r=this._maskUrl(e.data.href);if(!r)return;e.data.href=r}var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var n=function(o){var l=o;if(l&&Pr(l)&&l.type===ty&&Pr(l.data)&&l.data.plugin===iy){l.data.payload.payload.length>10&&(l.data.payload.payload=l.data.payload.payload.slice(0,10),l.data.payload.payload.push("...[truncated]"));for(var h=[],c=0;c<l.data.payload.payload.length;c++)l.data.payload.payload[c]&&l.data.payload.payload[c].length>2e3?h.push(l.data.payload.payload[c].slice(0,2e3)+"...[truncated]"):h.push(l.data.payload.payload[c]);return l.data.payload.payload=h,o}return o}(i),s=JSON.stringify(n).length;if(this._updateWindowAndSessionIds(n),!this.isIdle){var a={$snapshot_bytes:s,$snapshot_data:n,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(a):this.clearBuffer()}}}}},{key:"_maskUrl",value:function(e){var r=this.instance.config.session_recording;if(r.maskNetworkRequestFn){var i,n={url:e};return(i=n=r.maskNetworkRequestFn(n))===null||i===void 0?void 0:i.url}return e}},{key:"clearBuffer",value:function(){return this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var r=this._minimumDuration,i=this.sessionDuration,n=cr(i)&&i>=0,s=cr(r)&&n&&i<r;return this.status==="buffering"||s?(this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3),this.buffer||this.clearBuffer()):this.buffer&&this.buffer.data.length!==0?(this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer()):this.buffer||this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var r,i=this,n=2+(((r=this.buffer)===null||r===void 0?void 0:r.data.length)||0);(!this.buffer||this.buffer.size+e.$snapshot_bytes+n>943718.4||this.buffer.sessionId&&this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),Ft(this.buffer.sessionId)&&!Ft(this.sessionId)&&(this.buffer.sessionId=this.sessionId,this.buffer.windowId=this.windowId),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){i._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this._endpoint,_noTruncate:!0,_batchKey:"recordings",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===ld}})}}]),t}(),py=function(){function t(e){Oe(this,t),this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return Re(t,[{key:"call",value:function(){var e=this,r=hh(JSON.stringify({token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Yi),group_properties:this.instance.get_property(kr),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0}));this.instance._send_request("".concat(this.instance.config.api_host,"/decide/?v=3"),{data:r,verbose:!0},{method:"POST"},function(i){return e.parseDecideResponse(i)})}},{key:"parseDecideResponse",value:function(e){var r,i=this;if(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer(),e?.status!==0){if(!K||!K.body)return j.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){i.parseDecideResponse(e)},500);this.instance.toolbar.afterDecideResponse(e),(r=this.instance.sessionRecording)===null||r===void 0||r.afterDecideResponse(e),Er.afterDecideResponse(e,this.instance),this.instance._afterDecideResponse(e),this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e);var n=O?.extendPostHogWithSurveys;e.surveys&&!n&&Un(this.instance.config.api_host+"/static/surveys.js",function(c){if(c)return j.error("Could not load surveys script",c);O.extendPostHogWithSurveys(i.instance)});var s=O?.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&ve(s)&&Un(this.instance.config.api_host+"/static/exception-autocapture.js",function(c){if(c)return j.error("Could not load exception autocapture script",c);O.extendPostHogWithExceptionAutocapture(i.instance,e)}),e.siteApps)if(this.instance.config.opt_in_site_apps){var a,o=this.instance.config.api_host,l=ai(e.siteApps);try{var h=function(){var c=a.value,u=c.id,f=c.url,p=[o,o[o.length-1]==="/"&&f[0]==="/"?f.substring(1):f].join("");tt["__$$ph_site_app_".concat(u)]=i.instance,Un(p,function(m){m&&j.error("Error while initializing PostHog app with config id ".concat(u),m)})};for(l.s();!(a=l.n()).done;)h()}catch(c){l.e(c)}finally{l.f()}}else e.siteApps.length>0&&j.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else j.error("Failed to fetch feature flags from PostHog.")}}]),t}(),dy=["https://app.posthog.com","https://eu.posthog.com"],fy=["source"],my=O!=null&&O.location?Za(O.location.hash,"__posthog")||Za(location.hash,"state"):null,gy=function(){function t(e){Oe(this,t),this.instance=e}return Re(t,[{key:"afterDecideResponse",value:function(e){var r=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&r.toolbarVersion&&r.toolbarVersion.indexOf("toolbar")===0&&this.loadToolbar(ne({},r))}},{key:"maybeLoadToolbar",value:function(){var e,r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!O||!K)return!1;i=(e=i)!==null&&e!==void 0?e:O.location,s=(r=s)!==null&&r!==void 0?r:O.history;try{if(!n){try{O.localStorage.setItem("test","test"),O.localStorage.removeItem("test")}catch{return!1}n=O?.localStorage}var a,o=my||Za(i.hash,"__posthog")||Za(i.hash,"state"),l=o?Wp(function(){return JSON.parse(atob(decodeURIComponent(o)))})||Wp(function(){return JSON.parse(decodeURIComponent(o))}):null;return l&&l.action==="ph_authorize"?((a=l).source="url",a&&Object.keys(a).length>0&&(l.desiredHash?i.hash=l.desiredHash:s?s.replaceState("",K.title,i.pathname+i.search):i.hash="")):((a=JSON.parse(n.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete a.userIntent),!(!a.token||this.instance.config.token!==a.token)&&(this.loadToolbar(a),!0)}catch{return!1}}},{key:"loadToolbar",value:function(e){var r=this;if(!O||tt._postHogToolbarLoaded)return!1;tt._postHogToolbarLoaded=!0;var i=this.instance.config.api_host,n=3e5,s=Math.floor(Date.now()/n)*n,a="".concat(i).concat(i.endsWith("/")?"":"/","static/toolbar.js?t=").concat(s),o=!dy.includes(this.instance.config.api_host)&&this.instance.config.advanced_disable_toolbar_metrics,l=ne(ne({token:this.instance.config.token},e),{},{apiURL:i},o?{instrument:!1}:{});l.source;var h=T0(l,fy);return O.localStorage.setItem("_postHogToolbarParams",JSON.stringify(h)),Un(a,function(c){c?j.error("Failed to load toolbar",c):(tt.ph_load_toolbar||tt.ph_load_editor)(l,r.instance)}),qn(O,"turbolinks:load",function(){tt._postHogToolbarLoaded=!1,r.loadToolbar(l)}),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,r,i)}}]),t}(),yy="__ph_opt_in_out_";function vy(t,e){Od(!0,t,e)}function by(t,e){Od(!1,t,e)}function _y(t,e){return $d(t,e)==="1"}function ud(t,e){return!!function(r){if(r&&r.respectDnt){var i=r&&r.window||O,n=i?.navigator,s=!1;return Ce([n?.doNotTrack,n.msDoNotTrack,i.doNotTrack],function(a){xe([!0,1,"1","yes"],a)&&(s=!0)}),s}return!1}(e)||$d(t,e)==="0"}function wy(t,e){uh(e=e||{}).remove(ph(t,e),!!e.crossSubdomainCookie)}function uh(t){return(t=t||{}).persistenceType==="localStorage"?Le:t.persistenceType==="localStorage+cookie"?Hn:Jt}function ph(t,e){return((e=e||{}).persistencePrefix||yy)+t}function $d(t,e){return uh(e).get(ph(t,e))}function Od(t,e,r){St(e)&&e.length?(uh(r=r||{}).set(ph(e,r),t?1:0,cr(r.cookieExpiration)?r.cookieExpiration:null,r.crossSubdomainCookie,r.secureCookie),r.capture&&t&&r.capture(r.captureEventName||"$opt_in",r.captureProperties||{},{send_instantly:!0})):j.error("gdpr."+(t?"optIn":"optOut")+" called with an invalid token")}var Rd=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:3e3;Oe(this,t),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=e}return Re(t,[{key:"setPollInterval",value:function(e){this._pollInterval=e,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return new Date().getTime()}}]),t}(),xy=function(t){bd(r,Rd);var e=_d(r);function r(i){var n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e3;return Oe(this,r),(n=e.call(this,s)).handlePollRequest=i,n}return Re(r,[{key:"enqueue",value:function(i,n,s){this._event_queue.push({url:i,data:n,options:s}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var i=this;clearTimeout(this._poller),this._poller=setTimeout(function(){if(i._event_queue.length>0){var n=i.formatQueue(),s=function(o){var l=n[o],h=l.url,c=l.data,u=l.options;Ce(c,function(f,p){c[p].offset=Math.abs(c[p].timestamp-i.getTime()),delete c[p].timestamp}),i.handlePollRequest(h,c,u)};for(var a in n)s(a);i._event_queue.length=0,i._empty_queue_count=0}else i._empty_queue_count++;i._empty_queue_count>4&&(i.isPolling=!1,i._empty_queue_count=0),i.isPolling&&i.poll()},this._pollInterval)}},{key:"unload",value:function(){var i=this;clearTimeout(this._poller);var n=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var s=Object.values(n);[].concat(Ul(s.filter(function(a){return a.url.indexOf("/e")===0})),Ul(s.filter(function(a){return a.url.indexOf("/e")!==0}))).map(function(a){var o=a.url,l=a.data,h=a.options;i.handlePollRequest(o,l,ne(ne({},h),{},{transport:"sendBeacon"}))})}},{key:"formatQueue",value:function(){var i={};return Ce(this._event_queue,function(n){var s=n.url,a=n.data,o=n.options,l=(o?o._batchKey:null)||s;ve(i[l])&&(i[l]={data:[],url:s,options:o}),o&&i[l].options&&i[l].options._metrics&&!i[l].options._metrics.rrweb_full_snapshot&&(i[l].options._metrics.rrweb_full_snapshot=o._metrics.rrweb_full_snapshot),i[l].data.push(a)}),i}}]),r}(),kt=Uint8Array,at=Uint16Array,Xi=Uint32Array,dh=new kt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fh=new kt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),pd=new kt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ld=function(t,e){for(var r=new at(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];var n=new Xi(r[30]);for(i=1;i<30;++i)for(var s=r[i];s<r[i+1];++s)n[s]=s-r[i]<<5|i;return[r,n]},Bd=Ld(dh,2),Sy=Bd[0],rh=Bd[1];Sy[28]=258,rh[258]=28;for(ih=Ld(fh,0)[1],Ya=new at(32768),Ie=0;Ie<32768;++Ie)xr=(43690&Ie)>>>1|(21845&Ie)<<1,xr=(61680&(xr=(52428&xr)>>>2|(13107&xr)<<2))>>>4|(3855&xr)<<4,Ya[Ie]=((65280&xr)>>>8|(255&xr)<<8)>>>1;var xr,ih,Ya,Ie,Wn=function(t,e,r){for(var i=t.length,n=0,s=new at(e);n<i;++n)++s[t[n]-1];var a,o=new at(e);for(n=0;n<e;++n)o[n]=o[n-1]+s[n-1]<<1;if(r){a=new at(1<<e);var l=15-e;for(n=0;n<i;++n)if(t[n])for(var h=n<<4|t[n],c=e-t[n],u=o[t[n]-1]++<<c,f=u|(1<<c)-1;u<=f;++u)a[Ya[u]>>>l]=h}else for(a=new at(i),n=0;n<i;++n)a[n]=Ya[o[t[n]-1]++]>>>15-t[n];return a},li=new kt(288);for(Ie=0;Ie<144;++Ie)li[Ie]=8;for(Ie=144;Ie<256;++Ie)li[Ie]=9;for(Ie=256;Ie<280;++Ie)li[Ie]=7;for(Ie=280;Ie<288;++Ie)li[Ie]=8;var Ja=new kt(32);for(Ie=0;Ie<32;++Ie)Ja[Ie]=5;var ii,ky=Wn(li,9,0),Ey=Wn(Ja,5,0),Vd=function(t){return(t/8>>0)+(7&t&&1)},Nd=function(t,e,r){(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length);var i=new(t instanceof at?at:t instanceof Xi?Xi:kt)(r-e);return i.set(t.subarray(e,r)),i},hr=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8},zn=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Gl=function(t,e){for(var r=[],i=0;i<t.length;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new kt(0),0];if(n==1){var a=new kt(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort(function(S,T){return S.f-T.f}),r.push({s:-1,f:25001});var o=r[0],l=r[1],h=0,c=1,u=2;for(r[0]={s:-1,f:o.f+l.f,l:o,r:l};c!=n-1;)o=r[r[h].f<r[u].f?h++:u++],l=r[h!=c&&r[h].f<r[u].f?h++:u++],r[c++]={s:-1,f:o.f+l.f,l:o,r:l};var f=s[0].s;for(i=1;i<n;++i)s[i].s>f&&(f=s[i].s);var p=new at(f+1),m=Py(r[c-1],p,0);if(m>e){i=0;var g=0,d=m-e,y=1<<d;for(s.sort(function(S,T){return p[T.s]-p[S.s]||S.f-T.f});i<n;++i){var v=s[i].s;if(!(p[v]>e))break;g+=y-(1<<m-p[v]),p[v]=e}for(g>>>=d;g>0;){var b=s[i].s;p[b]<e?g-=1<<e-p[b]++-1:++i}for(;i>=0&&g;--i){var _=s[i].s;p[_]==e&&(--p[_],++g)}m=e}return[new kt(p),m]},Py=function t(e,r,i){return e.s==-1?Math.max(t(e.l,r,i+1),t(e.r,r,i+1)):r[e.s]=i},dd=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new at(++e),i=0,n=t[0],s=1,a=function(l){r[i++]=l},o=1;o<=e;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[r.subarray(0,i),e]},jn=function(t,e){for(var r=0,i=0;i<e.length;++i)r+=t[i]*e[i];return r},Na=function(t,e,r){var i=r.length,n=Vd(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;s<i;++s)t[n+s+4]=r[s];return 8*(n+4+i)},fd=function(t,e,r,i,n,s,a,o,l,h,c){hr(e,c++,r),++n[256];for(var u=Gl(n,15),f=u[0],p=u[1],m=Gl(s,15),g=m[0],d=m[1],y=dd(f),v=y[0],b=y[1],_=dd(g),S=_[0],T=_[1],x=new at(19),w=0;w<v.length;++w)x[31&v[w]]++;for(w=0;w<S.length;++w)x[31&S[w]]++;for(var M=Gl(x,7),k=M[0],I=M[1],P=19;P>4&&!k[pd[P-1]];--P);var A,E,F,$,D=h+5<<3,C=jn(n,li)+jn(s,Ja)+a,R=jn(n,f)+jn(s,g)+a+14+3*P+jn(x,k)+(2*x[16]+3*x[17]+7*x[18]);if(D<=C&&D<=R)return Na(e,c,t.subarray(l,l+h));if(hr(e,c,1+(R<C)),c+=2,R<C){A=Wn(f,p,0),E=f,F=Wn(g,d,0),$=g;var B=Wn(k,I,0);for(hr(e,c,b-257),hr(e,c+5,T-1),hr(e,c+10,P-4),c+=14,w=0;w<P;++w)hr(e,c+3*w,k[pd[w]]);c+=3*P;for(var U=[v,S],Z=0;Z<2;++Z){var X=U[Z];for(w=0;w<X.length;++w){var H=31&X[w];hr(e,c,B[H]),c+=k[H],H>15&&(hr(e,c,X[w]>>>5&127),c+=X[w]>>>12)}}}else A=ky,E=li,F=Ey,$=Ja;for(w=0;w<o;++w)if(i[w]>255){H=i[w]>>>18&31,zn(e,c,A[H+257]),c+=E[H+257],H>7&&(hr(e,c,i[w]>>>23&31),c+=dh[H]);var ie=31&i[w];zn(e,c,F[ie]),c+=$[ie],ie>3&&(zn(e,c,i[w]>>>5&8191),c+=fh[ie])}else zn(e,c,A[i[w]]),c+=E[i[w]];return zn(e,c,A[256]),c+E[256]},Ay=new Xi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Cy=new kt(0),Ty=function(){for(var t=new Xi(256),e=0;e<256;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Iy=function(){var t=4294967295;return{p:function(e){for(var r=t,i=0;i<e.length;++i)r=Ty[255&r^e[i]]^r>>>8;t=r},d:function(){return 4294967295^t}}},My=function(t,e,r,i,n){return function(s,a,o,l,h,c){var u=s.length,f=new kt(l+u+5*(1+Math.floor(u/7e3))+h),p=f.subarray(l,f.length-h),m=0;if(!a||u<8)for(var g=0;g<=u;g+=65535){var d=g+65535;d<u?m=Na(p,m,s.subarray(g,d)):(p[g]=c,m=Na(p,m,s.subarray(g,u)))}else{for(var y=Ay[a-1],v=y>>>13,b=8191&y,_=(1<<o)-1,S=new at(32768),T=new at(_+1),x=Math.ceil(o/3),w=2*x,M=function(ot){return(s[ot]^s[ot+1]<<x^s[ot+2]<<w)&_},k=new Xi(25e3),I=new at(288),P=new at(32),A=0,E=0,F=(g=0,0),$=0,D=0;g<u;++g){var C=M(g),R=32767&g,B=T[C];if(S[R]=B,T[C]=R,$<=g){var U=u-g;if((A>7e3||F>24576)&&U>423){m=fd(s,p,0,k,I,P,E,F,D,g-D,m),F=A=E=0,D=g;for(var Z=0;Z<286;++Z)I[Z]=0;for(Z=0;Z<30;++Z)P[Z]=0}var X=2,H=0,ie=b,oe=R-B&32767;if(U>2&&C==M(g-oe))for(var se=Math.min(v,U)-1,te=Math.min(32767,g),ke=Math.min(258,U);oe<=te&&--ie&&R!=B;){if(s[g+X]==s[g+X-oe]){for(var fe=0;fe<ke&&s[g+fe]==s[g+fe-oe];++fe);if(fe>X){if(X=fe,H=oe,fe>se)break;var Me=Math.min(oe,fe-2),Ee=0;for(Z=0;Z<Me;++Z){var J=g-oe+Z+32768&32767,Ze=J-S[J]+32768&32767;Ze>Ee&&(Ee=Ze,B=J)}}}oe+=(R=B)-(B=S[R])+32768&32767}if(H){k[F++]=268435456|rh[X]<<18|ih[H];var Et=31&rh[X],Pt=31&ih[H];E+=dh[Et]+fh[Pt],++I[257+Et],++P[Pt],$=g+X,++A}else k[F++]=s[g],++I[s[g]]}}m=fd(s,p,c,k,I,P,E,F,D,g-D,m),c||(m=Na(p,m,Cy))}return Nd(f,0,l+Vd(m)+h)}(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i,!n)},nh=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},Dy=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&nh(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}},Fy=function(t){return 10+(t.filename&&t.filename.length+1||0)};function $y(t,e){e===void 0&&(e={});var r=Iy(),i=t.length;r.p(t);var n=My(t,e,Fy(e),8),s=n.length;return Dy(n,e),nh(n,s-8,r.d()),nh(n,s-4,i),n}function Oy(t,e){var r=t.length;if(!e&&typeof TextEncoder<"u")return new TextEncoder().encode(t);for(var i=new kt(t.length+(t.length>>>1)),n=0,s=function(h){i[n++]=h},a=0;a<r;++a){if(n+5>i.length){var o=new kt(n+8+(r-a<<1));o.set(i),i=o}var l=t.charCodeAt(a);l<128||e?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++a))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return Nd(i,0,n)}(function(t){t.GZipJS="gzip-js",t.Base64="base64"})(ii||(ii={}));var zd=function(t,e,r){var i=e||{};i.ip=r.ip?1:0,i._=new Date().getTime().toString(),i.ver=oi.LIB_VERSION;var n=t.split("?");if(n.length>1){var s,a=ai(n[1].split("&"));try{for(a.s();!(s=a.n()).done;){var o=s.value.split("=")[0];ve(i[o])||delete i[o]}}catch(h){a.e(h)}finally{a.f()}}var l=t.indexOf("?")>-1?"&":"?";return t+l+function(h){var c,u,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",p=[];return Ce(h,function(m,g){ve(m)||ve(g)||g==="undefined"||(c=encodeURIComponent(m.toString()),u=encodeURIComponent(g),p[p.length]=u+"="+c)}),p.join(f)}(i)},mh=function t(e,r){if(r.blob&&e.buffer)return new Blob([jp(e)?e:e.buffer],{type:"text/plain"});if(r.sendBeacon||r.blob){var i=t(e,{method:"POST"});return new Blob([i],{type:"application/x-www-form-urlencoded"})}return r.method!=="POST"?null:(n=We(e)||jp(e)?"data="+encodeURIComponent(e):"data="+encodeURIComponent(e.data),"compression"in e&&e.compression&&(n+="&compression="+e.compression),n);var n},jd=function(t){var e=t.url,r=t.data,i=t.headers,n=t.options,s=t.callback,a=t.retriesPerformedSoFar,o=t.retryQueue,l=t.onXHRError,h=t.timeout,c=h===void 0?6e4:h,u=t.onResponse;cr(a)&&a>0&&(e=zd(e,{retry_count:a},{}));var f=new XMLHttpRequest;f.open(n.method||"GET",e,!0);var p=mh(r,n);Ce(i,function(m,g){f.setRequestHeader(g,m)}),n.method!=="POST"||n.blob||f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.timeout=c,f.withCredentials=!0,f.onreadystatechange=function(){if(f.readyState===4)if(u?.(f),f.status===200){if(s){var m;try{m=JSON.parse(f.responseText)}catch(g){return void j.error(g)}s(m)}}else jt(l)&&l(f),(f.status<400||f.status>500)&&o.enqueue({url:e,data:r,options:n,headers:i,retriesPerformedSoFar:(a||0)+1,callback:s}),s?.({status:0})},f.send(p)},Ry=18e5,Ly=function(t){bd(r,Rd);var e=_d(r);function r(i,n){var s;return Oe(this,r),(s=e.call(this)).isPolling=!1,s.queue=[],s.areWeOnline=!0,s.onXHRError=i,s.rateLimiter=n,!ve(O)&&"onLine"in O.navigator&&(s.areWeOnline=O.navigator.onLine,O.addEventListener("online",function(){s._handleWeAreNowOnline()}),O.addEventListener("offline",function(){s.areWeOnline=!1})),s}return Re(r,[{key:"enqueue",value:function(i){var n=i.retriesPerformedSoFar||0;if(!(n>=10)){var s=function(l){var h=3e3*Math.pow(2,l),c=h/2,u=Math.min(Ry,h),f=(Math.random()-.5)*(u-c);return Math.ceil(u+f)}(n),a=new Date(Date.now()+s);this.queue.push({retryAt:a,requestData:i});var o="Enqueued failed request for retry in ".concat(s);navigator.onLine||(o+=" (Browser is offline)"),j.warn(o),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var i=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout(function(){i.areWeOnline&&i.queue.length>0&&i.flush(),i.poll()},this._pollInterval)}},{key:"flush",value:function(){var i=new Date(Date.now()),n=this.queue.filter(function(l){return l.retryAt<i});if(n.length>0){this.queue=this.queue.filter(function(l){return l.retryAt>=i});var s,a=ai(n);try{for(a.s();!(s=a.n()).done;){var o=s.value.requestData;this._executeXhrRequest(o)}}catch(l){a.e(l)}finally{a.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var i,n=ai(this.queue);try{for(n.s();!(i=n.n()).done;){var s=i.value.requestData,a=s.url,o=s.data,l=s.options;if(this.rateLimiter.isRateLimited(l._batchKey))j.warn("[RetryQueue] is quota limited. Dropping request.");else try{O?.navigator.sendBeacon(a,mh(o,ne(ne({},l),{},{sendBeacon:!0})))}catch(h){j.error(h)}}}catch(h){n.e(h)}finally{n.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(i){var n=i.url,s=i.data,a=i.options,o=i.headers,l=i.callback,h=i.retriesPerformedSoFar;this.rateLimiter.isRateLimited(a._batchKey)||jd({url:n,data:s||{},options:a||{},headers:o||{},retriesPerformedSoFar:h||0,callback:l,retryQueue:this,onXHRError:this.onXHRError,onResponse:this.rateLimiter.checkForLimiting})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),r}(),Fa=1800,md=60,By=864e5,Vy=function(){function t(e,r,i,n){Oe(this,t),Y(this,"_sessionIdChangedHandlers",[]),this.config=e,this.persistence=r,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=i||ni,this._windowIdGenerator=n||ni;var s=e.persistence_name||e.token,a=e.session_idle_timeout_seconds||Fa;if(cr(a)?a>Fa?j.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a<md&&j.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(j.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=Fa),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,md),Fa),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var o=Xe.parse(this._window_id_storage_key),l=Xe.parse(this._primary_window_exists_storage_key);o&&!l?this._windowId=o:Xe.remove(this._window_id_storage_key),Xe.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return Re(t,[{key:"onSessionId",value:function(e){var r=this;return ve(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){r._sessionIdChangedHandlers=r._sessionIdChangedHandlers.filter(function(i){return i!==e})}}},{key:"_canUseSessionStorage",value:function(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Xe.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Xe.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Xe.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,r,i){e===this._sessionId&&r===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=r,this._sessionId=e,this.persistence.register(Y({},Ua,[r,e,i])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Ua];return We(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;O?.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&Xe.remove(e._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),i=zt(this._getSessionId(),3),n=i[0],s=i[1],a=i[2],o=this._getWindowId(),l=a&&a>0&&Math.abs(r-a)>By,h=!1,c=!s,u=!e&&Math.abs(r-n)>this._sessionTimeoutMs;c||u||l?(s=this._sessionIdGenerator(),o=this._windowIdGenerator(),a=r,h=!0):o||(o=this._windowIdGenerator(),h=!0);var f=n===0||!e||l?r:n,p=a===0?new Date().getTime():a;return this._setWindowId(o),this._setSessionId(s,f,p),h&&this._sessionIdChangedHandlers.forEach(function(m){return m(s,o)}),{sessionId:s,windowId:o,sessionStartTimestamp:p}}}]),t}(),Ny=Re(function t(e,r,i,n){Oe(this,t),this.name="posthog-js",this.setupOnce=function(s){s(function(a){var o,l,h,c,u;if(a.level!=="error"||!e.__loaded)return a;a.tags||(a.tags={});var f=e.config.ui_host||e.config.api_host;a.tags["PostHog Person URL"]=f+"/person/"+e.get_distinct_id(),e.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=((o=a.exception)===null||o===void 0?void 0:o.values)||[],m={$exception_message:(l=p[0])===null||l===void 0?void 0:l.value,$exception_type:(h=p[0])===null||h===void 0?void 0:h.type,$exception_personURL:f+"/person/"+e.get_distinct_id(),$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:(c=p[0])===null||c===void 0?void 0:c.value,$sentry_exception_type:(u=p[0])===null||u===void 0?void 0:u.type,$sentry_tags:a.tags};return r&&i&&(m.$sentry_url=(n||"https://sentry.io/organizations/")+r+"/issues/?project="+i+"&query="+a.event_id),e.capture("$exception",m),a})}}),zy=function(t){Promise&&Promise.resolve||j.warn("This browser does not have Promise support, and can not use the segment integration");var e=function(r,i){r.event.userId||r.event.anonymousId===t.get_distinct_id()||t.reset(),r.event.userId&&r.event.userId!==t.get_distinct_id()&&(t.register({distinct_id:r.event.userId}),t.reloadFeatureFlags());var n=t._calculate_event_properties(i,r.event.properties);return r.event.properties=Object.assign({},n,r.event.properties),r};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(r){return e(r,r.event.event)},page:function(r){return e(r,"$pageview")},identify:function(r){return e(r,"$identify")},screen:function(r){return e(r,"$screen")}}},jy=function(){function t(){var e=this;Oe(this,t),Y(this,"_hasSeenPageView",!1),Y(this,"_updateScrollData",function(){var r,i,n,s;e._pageViewData||(e._pageViewData=e._createPageViewData());var a=e._pageViewData,o=e._scrollY(),l=e._scrollHeight(),h=e._contentY(),c=e._contentHeight();a.lastScrollY=o,a.maxScrollY=Math.max(o,(r=a.maxScrollY)!==null&&r!==void 0?r:0),a.maxScrollHeight=Math.max(l,(i=a.maxScrollHeight)!==null&&i!==void 0?i:0),a.lastContentY=h,a.maxContentY=Math.max(h,(n=a.maxContentY)!==null&&n!==void 0?n:0),a.maxContentHeight=Math.max(c,(s=a.maxContentHeight)!==null&&s!==void 0?s:0)})}return Re(t,[{key:"_createPageViewData",value:function(){var e;return{pathname:(e=O?.location.pathname)!==null&&e!==void 0?e:""}}},{key:"doPageView",value:function(){var e,r;return this._hasSeenPageView?(r=this._pageViewData,this._pageViewData=this._createPageViewData()):(this._hasSeenPageView=!0,r=void 0,this._pageViewData||(this._pageViewData=this._createPageViewData())),setTimeout(this._updateScrollData,0),ne({$prev_pageview_pathname:(e=r)===null||e===void 0?void 0:e.pathname},this._calculatePrevPageScrollProperties(r))}},{key:"doPageLeave",value:function(){var e=this._pageViewData;return ne({$prev_pageview_pathname:e?.pathname},this._calculatePrevPageScrollProperties(e))}},{key:"_calculatePrevPageScrollProperties",value:function(e){if(!e||e.maxScrollHeight==null||e.lastScrollY==null||e.maxScrollY==null||e.maxContentHeight==null||e.lastContentY==null||e.maxContentY==null)return{};var r=e.maxScrollHeight,i=e.lastScrollY,n=e.maxScrollY,s=e.maxContentHeight,a=e.lastContentY,o=e.maxContentY;return r=Math.ceil(r),i=Math.ceil(i),n=Math.ceil(n),s=Math.ceil(s),a=Math.ceil(a),o=Math.ceil(o),{$prev_pageview_last_scroll:i,$prev_pageview_last_scroll_percentage:r<=1?1:$a(i/r,0,1),$prev_pageview_max_scroll:n,$prev_pageview_max_scroll_percentage:r<=1?1:$a(n/r,0,1),$prev_pageview_last_content:a,$prev_pageview_last_content_percentage:s<=1?1:$a(a/s,0,1),$prev_pageview_max_content:o,$prev_pageview_max_content_percentage:s<=1?1:$a(o/s,0,1)}}},{key:"startMeasuringScrollPosition",value:function(){O?.addEventListener("scroll",this._updateScrollData),O?.addEventListener("scrollend",this._updateScrollData),O?.addEventListener("resize",this._updateScrollData)}},{key:"stopMeasuringScrollPosition",value:function(){O?.removeEventListener("scroll",this._updateScrollData),O?.removeEventListener("scrollend",this._updateScrollData),O?.removeEventListener("resize",this._updateScrollData)}},{key:"_scrollHeight",value:function(){return O?Math.max(0,O.document.documentElement.scrollHeight-O.document.documentElement.clientHeight):0}},{key:"_scrollY",value:function(){return O&&(O.scrollY||O.pageYOffset||O.document.documentElement.scrollTop)||0}},{key:"_contentHeight",value:function(){return O?.document.documentElement.scrollHeight||0}},{key:"_contentY",value:function(){var e=O?.document.documentElement.clientHeight||0;return this._scrollY()+e}}]),t}();function $a(t,e,r){return Math.max(e,Math.min(t,r))}var Zn,gh,Je,Gy={icontains:function(t){return!!O&&O.location.href.toLowerCase().indexOf(t.toLowerCase())>-1},regex:function(t){return!!O&&K0(O.location.href,t)},exact:function(t){return O?.location.href===t}},Hy=function(){function t(e){Oe(this,t),this.instance=e}return Re(t,[{key:"getSurveys",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.instance.get_property(Kl);if(n&&!i)return e(n);this.instance._send_request("".concat(this.instance.config.api_host,"/api/surveys/?token=").concat(this.instance.config.token),{},{method:"GET"},function(s){var a,o=s.surveys||[];return(a=r.instance.persistence)===null||a===void 0||a.register(Y({},Kl,o)),e(o)})}},{key:"getActiveMatchingSurveys",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(n){var s=n.filter(function(a){return!(!a.start_date||a.end_date)}).filter(function(a){var o,l,h,c;if(!a.conditions)return!0;var u=(o=a.conditions)===null||o===void 0||!o.url||Gy[(l=(h=a.conditions)===null||h===void 0?void 0:h.urlMatchType)!==null&&l!==void 0?l:"icontains"](a.conditions.url),f=(c=a.conditions)===null||c===void 0||!c.selector||K?.querySelector(a.conditions.selector);return u&&f}).filter(function(a){if(!a.linked_flag_key&&!a.targeting_flag_key)return!0;var o=!a.linked_flag_key||r.instance.featureFlags.isFeatureEnabled(a.linked_flag_key),l=!a.targeting_flag_key||r.instance.featureFlags.isFeatureEnabled(a.targeting_flag_key);return o&&l});return e(s)},i)}}]),t}(),qy=6e4,Uy=function(){function t(){var e=this;Oe(this,t),Y(this,"limits",{}),Y(this,"checkForLimiting",function(r){try{var i=r.responseText;if(!i||!i.length)return;(JSON.parse(i).quota_limited||[]).forEach(function(n){j.info("[RateLimiter] ".concat(n||"events"," is quota limited.")),e.limits[n]=new Date().getTime()+qy})}catch(n){return void j.error(n)}})}return Re(t,[{key:"isRateLimited",value:function(e){var r=this.limits[e||"events"]||!1;return r!==!1&&new Date().getTime()<r}}]),t}(),Wy=function(){return ne({initialPathName:O?.location.pathname||"",referringDomain:He.referringDomain()},He.campaignParams())},Zy=function(){function t(e,r,i){var n=this;Oe(this,t),Y(this,"_onSessionIdCallback",function(s){var a=n._getStoredProps();if(!a||a.sessionId!==s){var o={sessionId:s,props:n._sessionSourceParamGenerator()};n._persistence.register(Y({},th,o))}}),this._sessionIdManager=e,this._persistence=r,this._sessionSourceParamGenerator=i||Wy,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return Re(t,[{key:"_getStoredProps",value:function(){return this._persistence.props[th]}},{key:"getSessionProps",value:function(){var e,r=(e=this._getStoredProps())===null||e===void 0?void 0:e.props;return r?{$client_session_initial_referring_host:r.referringDomain,$client_session_initial_pathname:r.initialPathName,$client_session_initial_utm_source:r.utm_source,$client_session_initial_utm_campaign:r.utm_campaign,$client_session_initial_utm_medium:r.utm_medium,$client_session_initial_utm_content:r.utm_content,$client_session_initial_utm_term:r.utm_term}:{}}}]),t}(),Yy=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"],Jy=function(t,e){if(!t)return!1;var r=t.toLowerCase();return Yy.concat(e||[]).some(function(i){var n=i.toLowerCase();return r.includes?r.includes(n):r.indexOf(n)!==-1})};(function(t){t[t.INIT_MODULE=0]="INIT_MODULE",t[t.INIT_SNIPPET=1]="INIT_SNIPPET"})(Zn||(Zn={}));var sh=function(){},Oa={},pt="posthog",za=O?.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Gd=!za&&Ge?.indexOf("MSIE")===-1&&Ge?.indexOf("Mozilla")===-1,gd=function(){var t,e,r;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=K?.location,r=e?.hostname,!!St(r)&&r.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",cookie_name:"",loaded:sh,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:!0,debug:!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:(O==null||(t=O.location)===null||t===void 0?void 0:t.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(i){var n="Bad HTTP status: "+i.status+" "+i.statusText;j.error(n)},get_device_id:function(i){return i},_onCapture:sh,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800}},ah=function(t,e,r,i){var n,s=r!==pt&&Je?r?Je[r]:void 0:Je,a={initComplete:!1,syncCode:!1},o=function(l){return function(h){a[l]||(a[l]=!0,a.initComplete&&a.syncCode&&i?.(h))}};if(s&&gh===Zn.INIT_MODULE)n=s;else{if(s&&!We(s))return void j.error("You have already initialized "+r);n=new yh}return n._init(t,e,r,o("initComplete")),n.toolbar.maybeLoadToolbar(),n.sessionRecording=new uy(n),n.sessionRecording.startRecordingIfEnabled(),n.config.__preview_measure_pageview_stats&&n.pageViewManager.startMeasuringScrollPosition(),n.__autocapture=n.config.autocapture,Er._setIsAutocaptureEnabled(n),Er._isAutocaptureEnabled&&(n.__autocapture=n.config.autocapture,Er.enabledForProject(n.config.token,100,100)?Er.isBrowserSupported()?Er.init(n):(n.__autocapture=!1,j.info("Disabling Automatic Event Collection because this browser is not supported")):(n.__autocapture=!1,j.info("Not in active bucket: disabling Automatic Event Collection."))),oi.DEBUG=oi.DEBUG||n.config.debug,!ve(s)&&We(s)&&(n._execute_array.call(n.people,s.people),n._execute_array(s)),o("syncCode")(n),n},Xy=function(){function t(){Oe(this,t),Y(this,"__forceAllowLocalhost",!1)}return Re(t,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){j.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),t}(),yh=function(){function t(){var e=this;Oe(this,t),Y(this,"webPerformance",new Xy),this.config=gd(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=Ny,this.segmentIntegration=function(){return zy(e)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.analyticsDefaultEndpoint="/e/",this.elementsChainAsString=!1,this.featureFlags=new N0(this),this.toolbar=new gy(this),this.pageViewManager=new jy,this.surveys=new Hy(this),this.rateLimiter=new Uy,this.people={set:function(r,i,n){var s=St(r)?Y({},r,i):r;e.setPersonProperties(s),n?.({})},set_once:function(r,i,n){var s=St(r)?Y({},r,i):r;e.setPersonProperties(void 0,s),n?.({})}}}return Re(t,[{key:"init",value:function(e,r,i){if(ve(i))j.critical("You must name your new library: init(token, config, name)");else{if(i!==pt){var n=ah(e,r,i,function(s){Je[i]=s,s._loaded()});return Je[i]=n,n}j.critical("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var r,i,n,s=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,l=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var h,c={segmentRegister:!1,syncCode:!1},u=function(S){return function(){c[S]||(c[S]=!0,c.segmentRegister&&c.syncCode&&l?.(s))}};if(this.set_config(Ye({},gd(),a,{name:o,token:e,callback_fn:(o===pt?o:pt+"."+o)+"._jsc"})),this._jsc=function(){},(O!=null&&(r=O.rrweb)!==null&&r!==void 0&&r.record||O!=null&&O.rrwebRecord)&&(this.__loaded_recorder_version=O==null||(h=O.rrweb)===null||h===void 0?void 0:h.version),this.persistence=new od(this.config),this._requestQueue=new xy(this._handle_queued_event.bind(this)),this._retryQueue=new Ly(this.config.on_xhr_error,this.rateLimiter),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new Vy(this.config,this.persistence),this.sessionPropsManager=new Zy(this.sessionManager,this.persistence),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new od(ne(ne({},this.config),{},{persistence:"sessionStorage"})),this._gdpr_init(),a.segment?(this.config.get_device_id=function(){return a.segment.user().anonymousId()},a.segment.user().id()&&(this.register({distinct_id:a.segment.user().id()}),this.persistence.set_user_state("identified")),a.segment.register(this.segmentIntegration()).then(u("segmentRegister"))):u("segmentRegister")(),((i=a.bootstrap)===null||i===void 0?void 0:i.distinctID)!==void 0){var f,p,m=this.config.get_device_id(ni()),g=(f=a.bootstrap)!==null&&f!==void 0&&f.isIdentifiedID?m:a.bootstrap.distinctID;this.persistence.set_user_state((p=a.bootstrap)!==null&&p!==void 0&&p.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:g})}if(this._hasBootstrappedFeatureFlags()){var d,y,v=Object.keys(((d=a.bootstrap)===null||d===void 0?void 0:d.featureFlags)||{}).filter(function(S){var T,x;return!((T=a.bootstrap)===null||T===void 0||(x=T.featureFlags)===null||x===void 0||!x[S])}).reduce(function(S,T){var x,w;return S[T]=((x=a.bootstrap)===null||x===void 0||(w=x.featureFlags)===null||w===void 0?void 0:w[T])||!1,S},{}),b=Object.keys(((y=a.bootstrap)===null||y===void 0?void 0:y.featureFlagPayloads)||{}).filter(function(S){return v[S]}).reduce(function(S,T){var x,w,M,k;return(x=a.bootstrap)!==null&&x!==void 0&&(w=x.featureFlagPayloads)!==null&&w!==void 0&&w[T]&&(S[T]=(M=a.bootstrap)===null||M===void 0||(k=M.featureFlagPayloads)===null||k===void 0?void 0:k[T]),S},{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:b})}if(!this.get_distinct_id()){var _=this.config.get_device_id(ni());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_user_state("anonymous")}O==null||(n=O.addEventListener)===null||n===void 0||n.call(O,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),u("syncCode")()}},{key:"_afterDecideResponse",value:function(e){var r;if(this.compression={},e.supportedCompression&&!this.config.disable_compression){var i,n={},s=ai(e.supportedCompression);try{for(s.s();!(i=s.n()).done;)n[i.value]=!0}catch(a){s.e(a)}finally{s.f()}this.compression=n}(r=e.analytics)!==null&&r!==void 0&&r.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),e.elementsChainAsString&&(this.elementsChainAsString=e.elementsChainAsString)}},{key:"_loaded",value:function(){var e=this.config.advanced_disable_decide;e||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(r){j.critical("`loaded` function failed",r)}this._start_queue_if_opted_in(),this.config.capture_pageview&&K&&this.capture("$pageview",{title:K.title},{send_instantly:!0}),e||(new py(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)===null||e===void 0||e.poll())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||Ji(this.__request_queue,function(r){e._send_request.apply(e,Ul(r))}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,r){if(ve(e))return null;if(za)return function(a){e(a,r)};var i=this._jsc,n=""+Math.floor(1e8*Math.random()),s=this.config.callback_fn+"["+n+"]";return i[n]=function(a){delete i[n],e(a,r)},s}},{key:"_handle_unload",value:function(){var e,r;this.config.request_batching?(this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave"),(e=this._requestQueue)===null||e===void 0||e.unload(),(r=this._retryQueue)===null||r===void 0||r.unload()):this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(e,r,i){var n=JSON.stringify(r);this.__compress_and_send_json_request(e,n,i||Oa,sh)}},{key:"__compress_and_send_json_request",value:function(e,r,i,n){var s=function(h,c,u){return h===ii.GZipJS?[$y(Oy(c),{mtime:0}),ne(ne({},u),{},{blob:!0,urlQueryArgs:{compression:ii.GZipJS}})]:[{data:hh(c)},u]}(this.compression[ii.GZipJS]?ii.GZipJS:ii.Base64,r,i),a=zt(s,2),o=a[0],l=a[1];this._send_request(e,o,l,n)}},{key:"_send_request",value:function(e,r,i,n){if(this.__loaded&&this._retryQueue&&!this.rateLimiter.isRateLimited(i._batchKey))if(Gd)this.__request_queue.push([e,r,i,n]);else{var s={method:this.config.api_method,transport:this.config.api_transport,verbose:this.config.verbose};i=Ye(s,i||{}),za||(i.method="GET");var a=O&&"sendBeacon"in O.navigator&&i.transport==="sendBeacon";if(e=zd(e,i.urlQueryArgs||{},{ip:this.config.ip}),a)try{O?.navigator.sendBeacon(e,mh(r,ne(ne({},i),{},{sendBeacon:!0})))}catch{}else if(za||!K)try{jd({url:e,data:r,headers:this.config.xhr_headers,options:i,callback:n,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.config.on_xhr_error,onResponse:this.rateLimiter.checkForLimiting})}catch(c){j.error(c)}else{var o,l=K.createElement("script");l.type="text/javascript",l.async=!0,l.defer=!0,l.src=e;var h=K.getElementsByTagName("script")[0];(o=h.parentNode)===null||o===void 0||o.insertBefore(l,h)}}}},{key:"_execute_array",value:function(e){var r,i=this,n=[],s=[],a=[];Ji(e,function(l){l&&(r=l[0],We(r)?a.push(l):jt(l)?l.call(i):We(l)&&r==="alias"?n.push(l):We(l)&&r.indexOf("capture")!==-1&&jt(i[r])?a.push(l):s.push(l))});var o=function(l,h){Ji(l,function(c){if(We(c[0])){var u=h;Ce(c,function(f){u=u[f[0]].apply(u,f.slice(1))})}else this[c[0]].apply(this,c.slice(1))},h)};o(n,this),o(s,this),o(a,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,r;return((e=this.config.bootstrap)===null||e===void 0?void 0:e.featureFlags)&&Object.keys((r=this.config.bootstrap)===null||r===void 0?void 0:r.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Oa;if(!this.__loaded||!this.sessionPersistence||!this._requestQueue)return j.uninitializedWarning("posthog.capture");if(!function(c){var u=!1;try{var f=c.config.token,p=c.config.respect_dnt,m=c.config.opt_out_capturing_persistence_type,g=c.config.opt_out_capturing_cookie_prefix||void 0,d=c.config.window;f&&(u=ud(f,{respectDnt:p,persistenceType:m,persistencePrefix:g,window:d}))}catch(y){j.error("Unexpected error when checking capturing opt-out status: "+y)}return u}(this)){var n=(i=i||Oa).transport;if(n&&(i.transport=n),!ve(e)&&St(e)){if(!Ge||!Jy(Ge,this.config.custom_blocked_useragents)){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info();var s={uuid:ni(),event:e,properties:this._calculate_event_properties(e,r||{})};e==="$identify"&&(s.$set=i.$set,s.$set_once=i.$set_once),(s=$0(s,i._noTruncate?null:this.config.properties_string_max_length)).timestamp=i.timestamp||new Date;var a=ne(ne({},s.properties.$set),s.$set);D0(a)||this.setPersonPropertiesForFlags(a),j.info("send",s);var o=JSON.stringify(s),l=this.config.api_host+(i.endpoint||this.analyticsDefaultEndpoint),h=i!==Oa;return!this.config.request_batching||h&&!i._batchKey||i.send_instantly?this.__compress_and_send_json_request(l,o,i):this._requestQueue.enqueue(l,s,i),this._invokeCaptureHooks(e,s),s}}else j.error("No event name provided to posthog.capture")}}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,r){this.config._onCapture(e,r),Ce(this.__captureHooks,function(i){return i(e)})}},{key:"_calculate_event_properties",value:function(e,r){if(!this.persistence||!this.sessionPersistence)return r;var i=this.persistence.remove_event_timer(e),n=ne({},r);if(n.token=this.config.token,e==="$snapshot"){var s=ne(ne({},this.persistence.properties()),this.sessionPersistence.properties());return n.distinct_id=s.distinct_id,n}var a=He.properties();if(this.sessionManager){var o=this.sessionManager.checkAndGetSessionAndWindowId(),l=o.sessionId,h=o.windowId;n.$session_id=l,n.$window_id=h}if(this.sessionPropsManager&&this.config.__preview_send_client_session_params&&(e==="$pageview"||e==="$pageleave"||e==="$autocapture")){var c=this.sessionPropsManager.getSessionProps();n=Ye(n,c)}if(this.config.__preview_measure_pageview_stats){var u={};e==="$pageview"?u=this.pageViewManager.doPageView():e==="$pageleave"&&(u=this.pageViewManager.doPageLeave()),n=Ye(n,u)}if(e==="$pageview"&&K&&(n.title=K.title),e==="$performance_event"){var f=this.persistence.properties();return n.distinct_id=f.distinct_id,n.$current_url=a.$current_url,n}if(!ve(i)){var p=new Date().getTime()-i;n.$duration=parseFloat((p/1e3).toFixed(3))}n=Ye({},He.properties(),this.persistence.properties(),this.sessionPersistence.properties(),n);var m=this.config.property_blacklist;We(m)?Ce(m,function(d){delete n[d]}):j.error("Invalid value for property_blacklist config: "+m);var g=this.config.sanitize_properties;return g&&(n=g(n,e)),n}},{key:"register",value:function(e,r){var i;(i=this.persistence)===null||i===void 0||i.register(e,r)}},{key:"register_once",value:function(e,r,i){var n;(n=this.persistence)===null||n===void 0||n.register_once(e,r,i)}},{key:"register_for_session",value:function(e){var r;(r=this.sessionPersistence)===null||r===void 0||r.register(e)}},{key:"unregister",value:function(e){var r;(r=this.persistence)===null||r===void 0||r.unregister(e)}},{key:"unregister_for_session",value:function(e){var r;(r=this.sessionPersistence)===null||r===void 0||r.unregister(e)}},{key:"_register_single",value:function(e,r){this.register(Y({},e,r))}},{key:"getFeatureFlag",value:function(e,r){return this.featureFlags.getFeatureFlag(e,r)}},{key:"getFeatureFlagPayload",value:function(e){var r=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(r)}catch{return r}}},{key:"isFeatureEnabled",value:function(e,r){return this.featureFlags.isFeatureEnabled(e,r)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,r)}},{key:"getEarlyAccessFeatures",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,r)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var r,i;return(r=(i=this.sessionManager)===null||i===void 0?void 0:i.onSessionId(e))!==null&&r!==void 0?r:function(){}}},{key:"getSurveys",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,r)}},{key:"getActiveMatchingSurveys",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,r)}},{key:"identify",value:function(e,r,i){if(!this.__loaded||!this.persistence)return j.uninitializedWarning("posthog.identify");if(e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))j.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else{var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==n&&e!==this.get_property(Ba)&&(this.unregister(Ba),this.register({distinct_id:e}));var a=this.persistence.get_user_state()==="anonymous";e!==n&&a?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags(r||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:r||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(n)):(r||i)&&this.setPersonProperties(r,i),e!==n&&(this.reloadFeatureFlags(),this.unregister(Wa))}else j.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,r){(e||r)&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:r||{}}))}},{key:"group",value:function(e,r,i){if(e&&r){var n=this.getGroups();n[e]!==r&&this.resetGroupPropertiesForFlags(e),this.register({$groups:ne(ne({},n),{},Y({},e,r))}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:r,$group_set:i}),this.setGroupPropertiesForFlags(Y({},e,i))),n[e]===r||i||this.reloadFeatureFlags()}else j.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,r)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setGroupPropertiesForFlags(e,r)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var r,i,n,s;if(!this.__loaded)return j.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");(r=this.persistence)===null||r===void 0||r.clear(),(i=this.sessionPersistence)===null||i===void 0||i.clear(),(n=this.persistence)===null||n===void 0||n.set_user_state("anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId();var o=this.config.get_device_id(ni());this.register_once({distinct_id:o,$device_id:e?o:a},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,r;return(e=(r=this.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var r=this.config.ui_host||this.config.api_host,i=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=i.sessionId,s=i.sessionStartTimestamp,a=r+"/replay/"+n;if(e!=null&&e.withTimestamp&&s){var o,l=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!s)return a;var h=Math.max(Math.floor((new Date().getTime()-s)/1e3)-l,0);a+="?t=".concat(h)}return a}},{key:"alias",value:function(e,r){return e===this.get_property(Td)?(j.critical("Attempting to create alias for existing People user - aborting."),-2):(ve(r)&&(r=this.get_distinct_id()),e!==r?(this._register_single(Ba,e),this.capture("$create_alias",{alias:e,distinct_id:r})):(j.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var r,i,n=ne({},this.config);Pr(e)&&(Ye(this.config,e),this.config.persistence_name||(this.config.persistence_name=this.config.cookie_name),this.config.disable_persistence||(this.config.disable_persistence=this.config.disable_cookie),this.config.api_host=this.config.api_host.replace(/\/$/,""),(r=this.persistence)===null||r===void 0||r.update_config(this.config),(i=this.sessionPersistence)===null||i===void 0||i.update_config(this.config),Le.is_supported()&&Le.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(oi.DEBUG=!0),this.sessionRecording&&!ve(e.disable_session_recording)&&n.disable_session_recording!==e.disable_session_recording&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!((e=this.sessionRecording)===null||e===void 0||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var r;return(r=this.persistence)===null||r===void 0?void 0:r.props[e]}},{key:"getSessionProperty",value:function(e){var r;return(r=this.sessionPersistence)===null||r===void 0?void 0:r.props[e]}},{key:"toString",value:function(){var e,r=(e=this.config.name)!==null&&e!==void 0?e:pt;return r!==pt&&(r=pt+"."+r),r}},{key:"_gdpr_init",value:function(){this.config.opt_out_capturing_persistence_type==="localStorage"&&Le.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.config.opt_out_capturing_by_default&&!Jt.get("ph_optout")||(Jt.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.config.opt_out_persistence_by_default}))}},{key:"_gdpr_update_persistence",value:function(e){var r,i,n,s,a;if(e&&e.clear_persistence)n=!0;else{if(!e||!e.enable_persistence)return;n=!1}this.config.disable_persistence||((r=this.persistence)===null||r===void 0?void 0:r.disabled)===n||(s=this.persistence)===null||s===void 0||s.set_disabled(n),this.config.disable_persistence||((i=this.sessionPersistence)===null||i===void 0?void 0:i.disabled)===n||(a=this.sessionPersistence)===null||a===void 0||a.set_disabled(n)}},{key:"_gdpr_call_func",value:function(e,r){return r=Ye({capture:this.capture.bind(this),persistence_type:this.config.opt_out_capturing_persistence_type,cookie_prefix:this.config.opt_out_capturing_cookie_prefix,cookie_expiration:this.config.cookie_expiration,cross_subdomain_cookie:this.config.cross_subdomain_cookie,secure_cookie:this.config.secure_cookie},r||{}),Le.is_supported()||r.persistence_type!=="localStorage"||(r.persistence_type="cookie"),e(this.config.token,{capture:r.capture,captureEventName:r.capture_event_name,captureProperties:r.capture_properties,persistenceType:r.persistence_type,persistencePrefix:r.cookie_prefix,cookieExpiration:r.cookie_expiration,crossSubdomainCookie:r.cross_subdomain_cookie,secureCookie:r.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=Ye({enable_persistence:!0},e||{}),this._gdpr_call_func(vy,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var r=Ye({clear_persistence:!0},e||{});this._gdpr_call_func(by,r),this._gdpr_update_persistence(r)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(_y,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(ud,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var r=Ye({enable_persistence:!0},e??{});this._gdpr_call_func(wy,r),this._gdpr_update_persistence(r)}},{key:"debug",value:function(e){e===!1?(O?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(O?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),t}();(function(t,e){for(var r=0;r<e.length;r++)t.prototype[e[r]]=Ed(t.prototype[e[r]])})(yh,["identify"]);var yd,vd,Sr={},Ky=function(){Je.init=function(t,e,r){if(r)return Je[r]||(Je[r]=Sr[r]=ah(t||"",e||{},r,function(n){Je[r]=Sr[r]=n,n._loaded()})),Je[r];var i=Je;return Sr[pt]?i=Sr[pt]:t&&(i=ah(t,e||{},pt,function(n){Sr[pt]=n,n._loaded()}),Sr[pt]=i),Je=i,gh===Zn.INIT_SNIPPET&&(tt[pt]=Je),Ce(Sr,function(n,s){s!==pt&&(Je[s]=n)}),i}},Qy=function(){function t(){t.done||(t.done=!0,Gd=!1,Ce(Sr,function(e){e._dom_loaded()}))}K!=null&&K.addEventListener&&(K.readyState==="complete"?t():K.addEventListener("DOMContentLoaded",t,!1)),O&&qn(O,"load",t,!0)};(function(t){t.Popover="popover",t.API="api",t.Widget="widget"})(yd||(yd={})),function(t){t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link"}(vd||(vd={}));var Hd=(gh=Zn.INIT_MODULE,Je=new yh,Ky(),Je.init(),Qy(),Je);var qd=Hd.init("phc_OTZ3wJ6VemgVupCRKS5Sbqb9Ks0JYe0hMYZPtLwl0nu",{api_host:"https://pheu.molin.ai",ui_host:"https://eu.posthog.com",secure_cookie:document.location.protocol==="https:",persistence:"cookie",autocapture:!1,rageclick:!1,capture_pageview:!0,disable_session_recording:!0},"MolinShopAI");function dt(t,e){if(!qd)throw new Error("Failed to initialize PostHog");qd.capture(t,e)}var Ki,Ka,$t,Be,Qa,Ud,eo,Wd,to,Zd,ro,Yd,io,Jd,no,Xd,so,Kd,ao,Qd,Xa=class extends Fe(Pe){constructor(){super();W(this,Ki);W(this,Qa);W(this,eo);W(this,to);W(this,ro);W(this,io);W(this,no);W(this,so);W(this,ao);W(this,$t,new Ta(this,{url:(r,{resume:i}={})=>{let n=new URL(this.config.wsApiUrl);return n.searchParams.set("widgetId",this.widgetId),n.searchParams.set("resume",i?"1":""),n.searchParams.set("conversationId",r),n.searchParams.set("pageUrl",window.location.href),n},onReconnect:()=>{},onError:r=>{console.error("ws error",r),dt("ShopAssistant: error",{widgetId:this.widgetId,error:"websocket onError"})},onClose:()=>{},onNewMessage:r=>{r.role==="assistant"&&dt("ShopAssistant: user received bot message (streaming started)",{widgetId:this.widgetId,message:r})},onUpdateMessage:r=>{},onMessageDone:r=>{let i={...L(this,$t)?.messages.find(n=>n.id===r.message?.id)};Object.assign(i,r.message),i.role==="assistant"&&dt("ShopAssistant: user received bot message (streaming ended)",{widgetId:this.widgetId,text:i.content??"",message:i,usage_TOKENS_COMPLETION:r.message.usage.TOKENS_COMPLETION})},onMessageError:r=>{console.error("ws message error",r),r.message&&L(this,Be)&&alert(r.message),dt("ShopAssistant: error",{widgetId:this.widgetId,error:"websocket ERROR message type: "+r.message})},persistConversationState:(r,i)=>{let n={conversationId:r,messages:i};localStorage.setItem(L(this,Ki,Ka),JSON.stringify(n))},restoreConversationState:()=>{try{let r=JSON.parse(localStorage.getItem(L(this,Ki,Ka))||"{}");return!(typeof r.conversationId=="string"&&r.conversationId)||!(Array.isArray(r.messages)&&r.messages.every(i=>typeof i=="object"&&i))?void 0:{conversationId:r.conversationId,messages:r.messages}}catch(r){console.error(r)}},onReset:()=>{localStorage.removeItem(L(this,Ki,Ka))}}));W(this,Be,!1);this.widgetId="",this.config}render(){console.assert(this.widgetId,"widget id is required"),console.assert(this.config,"config is required");let r=Object.entries(this.config.bubble.position).filter(([a,o])=>o).map(([a,o])=>`${a}-[${o}]`).reduce((a,o)=>(a[o]=!0,a),{}),i={bottom:"72px"},n=Object.entries(this.config.bubble.position).filter(([a,o])=>o).map(([a,o])=>`sm:${a}-[calc(${[i[a],o].filter(l=>!!l).join("+")})]`).reduce((a,o)=>(a[o]=!0,a),{}),s=n;return ye`
421
- <mw-bubble class="${Bp(r)} fixed z-[99999999]" @click=${ue(this,ro,Yd)} ?dialog-shown="${L(this,Be)}" bubble-image-url="${this.config.bubble?.imageUrl||""}"></mw-bubble>
420
+ `)).length,n=0;n<i;n++){var a=t.charCodeAt(n),o=null;a<128?r++:o=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),Ft(o)||(r>e&&(s+=t.substring(e,r)),s+=o,e=r=n+1)}return r>e&&(s+=t.substring(e,t.length)),s},qn=function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation),e}return t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0},function(e,r,i,n,s){if(e)if(e.addEventListener&&!n)e.addEventListener(r,i,!!s);else{var a="on"+r,o=e[a];e[a]=function(l,h,c){return function(u){if(u=u||t(O?.event)){var f,p=!0;jt(c)&&(f=c(u));var m=h.call(l,u);return f!==!1&&m!==!1||(p=!1),p}}}(e,i,o)}else j.error("No valid element provided to register_event")}}();function Un(t,e){var r=function(){if(!K)return e("document not found");var i=K.createElement("script");i.type="text/javascript",i.src=t,i.onload=function(a){return e(void 0,a)},i.onerror=function(a){return e(a)};var n,s=K.querySelectorAll("body > script");s.length>0?(n=s[0].parentNode)===null||n===void 0||n.insertBefore(i,s[0]):K.body.appendChild(i)};K!=null&&K.body?r():K?.addEventListener("DOMContentLoaded",r)}function ch(t){return t?Ga(t).split(/\s+/):[]}function Ha(t){var e="";switch(Hl(t.className)){case"string":e=t.className;break;case"object":e=("baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return ch(e)}function qa(t){var e="";return La(t)&&!Ad(t)&&t.childNodes&&t.childNodes.length&&Ce(t.childNodes,function(r){Pd(r)&&r.textContent&&(e+=Ga(r.textContent).split(/(\s+)/).filter(Wi).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),Ga(e)}function Zp(t){return!!t&&t.nodeType===1}function si(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Pd(t){return!!t&&t.nodeType===3}function Yp(t){return!!t&&t.nodeType===11}var Vl=["a","button","form","input","select","textarea","label"];function La(t){for(var e=t;e.parentNode&&!si(e,"body");e=e.parentNode){var r=Ha(e);if(xe(r,"ph-sensitive")||xe(r,"ph-no-capture"))return!1}if(xe(Ha(t),"ph-include"))return!0;var i=t.type||"";if(St(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!(St(n)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))}function Ad(t){return!!(si(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||si(t,"select")||si(t,"textarea")||t.getAttribute("contenteditable")==="true")}function Wi(t){return!(Ft(t)||ve(t)||St(t)&&(t=Ga(t),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((t||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(t)))}function Jp(t){var e=qa(t);return Wi(e="".concat(e," ").concat(Cd(t)).trim())?e:""}function Cd(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Ce(t.childNodes,function(r){var i;if(r&&((i=r.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{var n=qa(r);e="".concat(e," ").concat(n).trim(),r.childNodes&&r.childNodes.length&&(e="".concat(e," ").concat(Cd(r)).trim())}catch(s){j.error(s)}}),e}function R0(t){return function(e){var r=e.map(function(i){var n,s,a="";if(i.tag_name&&(a+=i.tag_name),i.attr_class){i.attr_class.sort();var o,l=ai(i.attr_class);try{for(l.s();!(o=l.n()).done;){var h=o.value;a+=".".concat(h.replace(/"/g,""))}}catch(f){l.e(f)}finally{l.f()}}var c=ne(ne(ne(ne({},i.text?{text:i.text}:{}),{},{"nth-child":(n=i.nth_child)!==null&&n!==void 0?n:0,"nth-of-type":(s=i.nth_of_type)!==null&&s!==void 0?s:0},i.href?{href:i.href}:{}),i.attr_id?{attr_id:i.attr_id}:{}),i.attributes),u={};return Ra(c).sort(function(f,p){var m=zt(f,1)[0],g=zt(p,1)[0];return m.localeCompare(g)}).forEach(function(f){var p=zt(f,2),m=p[0],g=p[1];return u[Xp(m.toString())]=Xp(g.toString())}),a+=":",a+=Ra(c).map(function(f){var p=zt(f,2),m=p[0],g=p[1];return"".concat(m,'="').concat(g,'"')}).join("")});return r.join(";")}(function(e){return e.map(function(r){var i,n,s={text:(i=r.$el_text)===null||i===void 0?void 0:i.slice(0,400),tag_name:r.tag_name,href:(n=r.attr__href)===null||n===void 0?void 0:n.slice(0,2048),attr_class:L0(r),attr_id:r.attr__id,nth_child:r.nth_child,nth_of_type:r.nth_of_type,attributes:{}};return Ra(r).filter(function(a){return zt(a,1)[0].indexOf("attr__")===0}).forEach(function(a){var o=zt(a,2),l=o[0],h=o[1];return s.attributes[l]=h}),s})}(t))}function Xp(t){return t.replace(/"|\\"/g,'\\"')}function L0(t){var e=t.attr__class;return e?We(e)?e:ch(e):void 0}var B0=function(){function t(e){Oe(this,t),this.clicks=[],this.enabled=e}return Re(t,[{key:"isRageClick",value:function(e,r,i){if(!this.enabled)return!1;var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(r-n.y)<30&&i-n.timestamp<1e3){if(this.clicks.push({x:e,y:r,timestamp:i}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:r,timestamp:i}];return!1}}]),t}(),Td="$people_distinct_id",Ba="__alias",Gn="__timers",Kp="$autocapture_disabled_server_side",Jl="$session_recording_enabled_server_side",Qp="$console_log_recording_enabled_server_side",ed="$session_recording_recorder_version_server_side",td="$session_recording_network_payload_capture",Ua="$sesid",Va="$session_is_sampled",Zi="$enabled_feature_flags",Xl="$early_access_features",Yi="$stored_person_properties",kr="$stored_group_properties",Kl="$surveys",Wa="$flag_call_reported",Ql="$user_state",eh="$posthog_quota_limited",th="$client_session_props",V0=[Td,Ba,"__cmpns",Gn,Jl,Ua,Zi,Ql,eh,Xl,kr,Yi,Kl,Wa,th];function Nl(t,e){return e.length>t?e.slice(0,t)+"...":e}var Er={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(t){var e,r=Ft(this._isDisabledServerSide)?!((e=t.persistence)===null||e===void 0||!e.props[Kp]):this._isDisabledServerSide,i=!!t.config.autocapture;this._isAutocaptureEnabled=i&&!r},_previousElementSibling:function(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Zp(e));return e},_getAugmentPropertiesFromElement:function(t){if(!La(t))return{};var e={};return Ce(t.attributes,function(r){if(r.name.indexOf("data-ph-capture-attribute")===0){var i=r.name.replace("data-ph-capture-attribute-",""),n=r.value;i&&n&&Wi(n)&&(e[i]=n)}}),e},_getPropertiesFromElement:function(t,e,r){var i,n=t.tagName.toLowerCase(),s={tag_name:n};Vl.indexOf(n)>-1&&!r&&(n.toLowerCase()==="a"||n.toLowerCase()==="button"?s.$el_text=Nl(1024,Jp(t)):s.$el_text=Nl(1024,qa(t)));var a=Ha(t);a.length>0&&(s.classes=a.filter(function(u){return u!==""}));var o=(i=this.config)===null||i===void 0?void 0:i.element_attribute_ignorelist;Ce(t.attributes,function(u){var f;if((!Ad(t)||["name","id","class"].indexOf(u.name)!==-1)&&(o==null||!o.includes(u.name))&&!e&&Wi(u.value)&&(f=u.name,!St(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var p=u.value;u.name==="class"&&(p=ch(p).join(" ")),s["attr__"+u.name]=Nl(1024,p)}});for(var l=1,h=1,c=t;c=this._previousElementSibling(c);)l++,c.tagName===t.tagName&&h++;return s.nth_child=l,s.nth_of_type=h,s},_getDefaultProperties:function(t){return{$event_type:t,$ce_version:1}},_extractCustomPropertyValue:function(t){var e=[];return Ce(K?.querySelectorAll(t.css_selector),function(r){var i;["input","select"].indexOf(r.tagName.toLowerCase())>-1?i=r.value:r.textContent&&(i=r.textContent),Wi(i)&&e.push(i)}),e.join(", ")},_getCustomProperties:function(t){var e=this,r={};return Ce(this._customProperties,function(i){Ce(i.event_selectors,function(n){Ce(K?.querySelectorAll(n),function(s){xe(t,s)&&La(s)&&(r[i.name]=e._extractCustomPropertyValue(i))})})}),r},_getEventTarget:function(t){return ve(t.target)?t.srcElement||null:(e=t.target)!==null&&e!==void 0&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e},_captureEvent:function(t,e){var r,i=this,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"$autocapture",s=this._getEventTarget(t);if(Pd(s)&&(s=s.parentNode||null),n==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this._captureEvent(t,e,"$rageclick"),s&&function(g,d){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!O||!g||si(g,"html")||!Zp(g))return!1;if(y!=null&&y.url_allowlist){var v=O.location.href,b=y.url_allowlist;if(b&&!b.some(function(E){return v.match(E)}))return!1}if(y!=null&&y.dom_event_allowlist){var _=y.dom_event_allowlist;if(_&&!_.some(function(E){return d.type===E}))return!1}if(y!=null&&y.element_allowlist){var S=y.element_allowlist;if(S&&!S.some(function(E){return g.tagName.toLowerCase()===E}))return!1}if(y!=null&&y.css_selector_allowlist){var T=y.css_selector_allowlist;if(T&&!T.some(function(E){return g.matches(E)}))return!1}for(var x=!1,w=[g],M=!0,k=g;k.parentNode&&!si(k,"body");)if(Yp(k.parentNode))w.push(k.parentNode.host),k=k.parentNode.host;else{if(!(M=k.parentNode||!1))break;if(Vl.indexOf(M.tagName.toLowerCase())>-1)x=!0;else{var I=O.getComputedStyle(M);I&&I.getPropertyValue("cursor")==="pointer"&&(x=!0)}w.push(M),k=M}var P=O.getComputedStyle(g);if(P&&P.getPropertyValue("cursor")==="pointer"&&d.type==="click")return!0;var A=g.tagName.toLowerCase();switch(A){case"html":return!1;case"form":return d.type==="submit";case"input":case"select":case"textarea":return d.type==="change"||d.type==="click";default:return x?d.type==="click":d.type==="click"&&(Vl.indexOf(A)>-1||g.getAttribute("contenteditable")==="true")}}(s,t,this.config)){for(var a,o,l=[s],h=s;h.parentNode&&!si(h,"body");)Yp(h.parentNode)?(l.push(h.parentNode.host),h=h.parentNode.host):(l.push(h.parentNode),h=h.parentNode);var c,u=[],f={},p=!1;if(Ce(l,function(g){var d=La(g);g.tagName.toLowerCase()==="a"&&(c=g.getAttribute("href"),c=d&&Wi(c)&&c),xe(Ha(g),"ph-no-capture")&&(p=!0),u.push(i._getPropertiesFromElement(g,e.config.mask_all_element_attributes,e.config.mask_all_text));var y=i._getAugmentPropertiesFromElement(g);Ye(f,y)}),e.config.mask_all_text||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?u[0].$el_text=Jp(s):u[0].$el_text=qa(s)),c&&(u[0].attr__href=c),p)return!1;var m=Ye(this._getDefaultProperties(t.type),e.elementsChainAsString?{$elements_chain:R0(u)}:{$elements:u},(a=u[0])!==null&&a!==void 0&&a.$el_text?{$el_text:(o=u[0])===null||o===void 0?void 0:o.$el_text}:{},this._getCustomProperties(l),f);return e.capture(n,m),!0}},_navigate:function(t){O&&(O.location.href=t)},_addDomEventHandlers:function(t){var e=this;if(O&&K){var r=function(i){i=i||O?.event,e._captureEvent(i,t)};qn(K,"submit",r,!1,!0),qn(K,"change",r,!1,!0),qn(K,"click",r,!1,!0)}},_customProperties:[],rageclicks:null,config:void 0,init:function(t){var e;Zl(t.__autocapture)||(this.config=t.__autocapture),(e=this.config)!==null&&e!==void 0&&e.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map(function(r){return new RegExp(r)})),this.rageclicks=new B0(t.config.rageclick)},afterDecideResponse:function(t,e){var r=e.config.token;this._initializedTokens.indexOf(r)>-1?j.info('autocapture already initialized for token "'+r+'"'):(e.persistence&&e.persistence.register(Y({},Kp,!!t.autocapture_opt_out)),this._isDisabledServerSide=!!t.autocapture_opt_out,this._setIsAutocaptureEnabled(e),this._initializedTokens.push(r),t&&t.config&&t.config.enable_collect_everything&&this._isAutocaptureEnabled?(t.custom_properties&&(this._customProperties=t.custom_properties),this._addDomEventHandlers(e)):e.__autocapture=!1)},enabledForProject:function(t,e,r){if(!t)return!0;e=ve(e)?10:e,r=ve(r)?10:r;for(var i=0,n=0;n<t.length;n++)i+=t.charCodeAt(n);return i%e<r},isBrowserSupported:function(){return jt(K?.querySelectorAll)}};(function(t){for(var e in t)jt(t[e])&&(t[e]=t[e].bind(t))})(Er),function(t){for(var e in t)jt(t[e])&&(t[e]=Ed(t[e]))}(Er);var zl="$active_feature_flags",Ma="$override_feature_flags",rd="$feature_flag_payloads",id=function(t){var e,r={},i=ai(Ra(t||{}));try{for(i.s();!(e=i.n()).done;){var n=zt(e.value,2),s=n[0],a=n[1];a&&(r[s]=a)}}catch(o){i.e(o)}finally{i.f()}return r},N0=function(){function t(e){Oe(this,t),this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return Re(t,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Zi),r=this.instance.get_property(Ma);if(!r)return e||{};for(var i=Ye({},e),n=Object.keys(r),s=0;s<n.length;s++)r[n[s]]===!1?delete i[n[s]]:i[n[s]]=r[n[s]];return this._override_warning||(j.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:r,finalFlags:i}),this._override_warning=!0),i}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(rd)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var r=this.instance.config.token,i=this.instance.get_property(Yi),n=this.instance.get_property(kr),s=hh(JSON.stringify({token:r,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i,group_properties:n,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0}));this.instance._send_request(this.instance.config.api_host+"/decide/?v=3",{data:s},{method:"POST"},this.instance._prepare_callback(function(a){e.$anon_distinct_id=void 0,e.receivedFeatureFlags(a),e.setReloadingPaused(!1),e._startReloadTimer()}))}}},{key:"getFeatureFlag",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var i,n=this.getFlagVariants()[e],s="".concat(n),a=this.instance.get_property(Wa)||{};return(r.send_event||!("send_event"in r))&&(!(e in a)||!a[e].includes(s))&&(We(a[e])?a[e].push(s):a[e]=[s],(i=this.instance.persistence)===null||i===void 0||i.register(Y({},Wa,a)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}j.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,r);j.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(r){return r!==e})}},{key:"receivedFeatureFlags",value:function(e){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads();(function(n,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=n.featureFlags,h=n.featureFlagPayloads;if(l)if(We(l)){var c,u={};if(l)for(var f=0;f<l.length;f++)u[l[f]]=!0;s&&s.register((Y(c={},zl,l),Y(c,Zi,u),c))}else{var p,m=l,g=h;n.errorsWhileComputingFlags&&(m=ne(ne({},a),m),g=ne(ne({},o),g)),s&&s.register((Y(p={},zl,Object.keys(id(m))),Y(p,Zi,m||{}),Y(p,rd,g||{}),p))}})(e,this.instance.persistence,r,i),this._fireFeatureFlagsCallbacks()}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return j.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,e===!1)this.instance.persistence.unregister(Ma);else if(We(e)){for(var r={},i=0;i<e.length;i++)r[e[i]]=!0;this.instance.persistence.register(Y({},Ma,r))}else this.instance.persistence.register(Y({},Ma,e))}},{key:"onFeatureFlags",value:function(e){var r=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var i=this._prepareFeatureFlagsForCallbacks(),n=i.flags,s=i.flagVariants;e(n,s)}return function(){return r.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,r){var i,n,s=Y({},"$feature_enrollment/".concat(e),r);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:r,$set:s}),this.setPersonPropertiesForFlags(s,!1);var a=ne(ne({},this.getFlagVariants()),{},Y({},e,r));(i=this.instance.persistence)===null||i===void 0||i.register((Y(n={},zl,Object.keys(id(a))),Y(n,Zi,a),n)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.instance.get_property(Xl);if(n&&!i)return e(n);this.instance._send_request("".concat(this.instance.config.api_host,"/api/early_access_features/?token=").concat(this.instance.config.token),{},{method:"GET"},function(s){var a,o=s.earlyAccessFeatures;return(a=r.instance.persistence)===null||a===void 0||a.register(Y({},Xl,o)),e(o)})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),r=this.getFlagVariants();return{flags:e.filter(function(i){return r[i]}),flagVariants:Object.keys(r).filter(function(i){return r[i]}).reduce(function(i,n){return i[n]=r[n],i},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(){var e=this._prepareFeatureFlagsForCallbacks(),r=e.flags,i=e.flagVariants;this.featureFlagEventHandlers.forEach(function(n){return n(r,i)})}},{key:"setPersonPropertiesForFlags",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(Yi)||{};this.instance.register(Y({},Yi,ne(ne({},i),e))),r&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Yi)}},{key:"setGroupPropertiesForFlags",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(kr)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(function(n){i[n]=ne(ne({},i[n]),e[n]),delete e[n]}),this.instance.register(Y({},kr,ne(ne({},i),e))),r&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var r=this.instance.get_property(kr)||{};this.instance.register(Y({},kr,ne(ne({},r),{},Y({},e,{}))))}else this.instance.unregister(kr)}}]),t}();Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return cr(t)&&isFinite(t)&&Math.floor(t)===t});var nd="0123456789abcdef",z0=function(){function t(e){if(Oe(this,t),this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}return Re(t,[{key:"toString",value:function(){for(var e="",r=0;r<this.bytes.length;r++)e=e+nd.charAt(this.bytes[r]>>>4)+nd.charAt(15&this.bytes[r]),r!==3&&r!==5&&r!==7&&r!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new t(this.bytes.slice(0))}},{key:"equals",value:function(e){return this.compareTo(e)===0}},{key:"compareTo",value:function(e){for(var r=0;r<16;r++){var i=this.bytes[r]-e.bytes[r];if(i!==0)return Math.sign(i)}return 0}}],[{key:"fromFieldsV7",value:function(e,r,i,n){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(n)||e<0||r<0||i<0||n<0||e>0xffffffffffff||r>4095||i>1073741823||n>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|r>>>8,s[7]=r,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new t(s)}}]),t}(),j0=function(){function t(){Oe(this,t),Y(this,"timestamp",0),Y(this,"counter",0),Y(this,"random",new G0)}return Re(t,[{key:"generate",value:function(){var e=this.generateOrAbort();if(ve(e)){this.timestamp=0;var r=this.generateOrAbort();if(ve(r))throw new Error("Could not generate UUID after timestamp reset");return r}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return z0.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),t}(),Id=function(t){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};O&&!ve(O.crypto)&&crypto.getRandomValues&&(Id=function(t){return crypto.getRandomValues(t)});var sd,G0=function(){function t(){Oe(this,t),Y(this,"buffer",new Uint32Array(8)),Y(this,"cursor",1/0)}return Re(t,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(Id(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),t}(),ni=function(){return H0().toString()},H0=function(){return(sd||(sd=new j0)).generate()},q0="Thu, 01 Jan 1970 00:00:00 GMT",Nn="",U0=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,W0=function(t){var e=t.match(U0);return e?e[0]:""};function Z0(t,e){if(e){var r=function(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:K;if(Nn)return Nn;if(!s||["localhost","127.0.0.1"].includes(n))return"";for(var a=n.split("."),o=Math.min(a.length,8),l="dmn_chk_"+ni(),h=new RegExp("(^|;)\\s*"+l+"=1");!Nn&&o--;){var c=a.slice(o).join("."),u=l+"=1;domain=."+c;s.cookie=u,h.test(s.cookie)&&(s.cookie=u+";expires="+q0,Nn=c)}return Nn}(t);if(!r){var i=W0(t);i!==r&&j.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var Jt={is_supported:function(){return!!K},error:function(t){j.error("cookieStore error: "+t)},get:function(t){if(K){try{for(var e=t+"=",r=K.cookie.split(";").filter(function(s){return s.length}),i=0;i<r.length;i++){for(var n=r[i];n.charAt(0)==" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return decodeURIComponent(n.substring(e.length,n.length))}}catch{}return null}},parse:function(t){var e;try{e=JSON.parse(Jt.get(t))||{}}catch{}return e},set:function(t,e,r,i,n){if(K)try{var s="",a="",o=Z0(K.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+24*r*60*60*1e3),s="; expires="+l.toUTCString()}n&&(a="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+o+a;return h.length>3686.4&&j.warn("cookieStore warning: large cookie, len="+h.length),K.cookie=h,h}catch{return}},remove:function(t,e){try{Jt.set(t,"",-1,e)}catch{return}}},jl=null,Le={is_supported:function(){if(!Ft(jl))return jl;var t=!0;if(ve(O))t=!1;else try{var e="__mplssupport__";Le.set(e,"xyz"),Le.get(e)!=='"xyz"'&&(t=!1),Le.remove(e)}catch{t=!1}return t||j.error("localStorage unsupported; falling back to cookie store"),jl=t,t},error:function(t){j.error("localStorage error: "+t)},get:function(t){try{return O?.localStorage.getItem(t)}catch(e){Le.error(e)}return null},parse:function(t){try{return JSON.parse(Le.get(t))||{}}catch{}return null},set:function(t,e){try{O?.localStorage.setItem(t,JSON.stringify(e))}catch(r){Le.error(r)}},remove:function(t){try{O?.localStorage.removeItem(t)}catch(e){Le.error(e)}}},Y0=["distinct_id",Ua,Va],Hn=ne(ne({},Le),{},{parse:function(t){try{var e={};try{e=Jt.parse(t)||{}}catch{}var r=Ye(e,JSON.parse(Le.get(t)||"{}"));return Le.set(t,r),r}catch{}return null},set:function(t,e,r,i,n){try{Le.set(t,e);var s={};Y0.forEach(function(a){e[a]&&(s[a]=e[a])}),Object.keys(s).length&&Jt.set(t,s,r,i,n)}catch(a){Le.error(a)}},remove:function(t,e){try{O?.localStorage.removeItem(t),Jt.remove(t,e)}catch(r){Le.error(r)}}}),Da={},J0={is_supported:function(){return!0},error:function(t){j.error("memoryStorage error: "+t)},get:function(t){return Da[t]||null},parse:function(t){return Da[t]||null},set:function(t,e){Da[t]=e},remove:function(t){delete Da[t]}},ri=null,Xe={is_supported:function(){if(!Ft(ri))return ri;if(ri=!0,ve(O))ri=!1;else try{var t="__support__";Xe.set(t,"xyz"),Xe.get(t)!=='"xyz"'&&(ri=!1),Xe.remove(t)}catch{ri=!1}return ri},error:function(t){j.error("sessionStorage error: ",t)},get:function(t){try{return O?.sessionStorage.getItem(t)}catch(e){Xe.error(e)}return null},parse:function(t){try{return JSON.parse(Xe.get(t))||null}catch{}return null},set:function(t,e){try{O?.sessionStorage.setItem(t,JSON.stringify(e))}catch(r){Xe.error(r)}},remove:function(t){try{O?.sessionStorage.removeItem(t)}catch(e){Xe.error(e)}}},X0=["localhost","127.0.0.1"],Md=function(t){var e=K?.createElement("a");return ve(e)?null:(e.href=t,e)},K0=function(t,e){return!!function(r){try{new RegExp(r)}catch{return!1}return!0}(e)&&new RegExp(e).test(t)},ad=function(t,e){for(var r,i=((t.split("#")[0]||"").split("?")[1]||"").split("&"),n=0;n<i.length;n++){var s=i[n].split("=");if(s[0]===e){r=s;break}}if(!We(r)||r.length<2)return"";var a=r[1];try{a=decodeURIComponent(a)}catch{j.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Za=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null},He={campaignParams:function(t){var e=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gbraid","wbraid","fbclid","msclkid"].concat(t||[]),r={};return Ce(e,function(i){var n=K?ad(K.URL,i):"";n.length&&(r[i]=n)}),r},searchEngine:function(){var t=K?.referrer;return t?t.search("https?://(.*)google.([^/?]*)")===0?"google":t.search("https?://(.*)bing.com")===0?"bing":t.search("https?://(.*)yahoo.com")===0?"yahoo":t.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null},searchInfo:function(){var t=He.searchEngine(),e=t!="yahoo"?"q":"p",r={};if(!Ft(t)){r.$search_engine=t;var i=K?ad(K.referrer,e):"";i.length&&(r.ph_keyword=i)}return r},browser:function(t,e,r){return e=e||"",r||xe(t," OPR/")?xe(t,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":xe(t,"IEMobile")||xe(t,"WPDesktop")?"Internet Explorer Mobile":xe(t,"SamsungBrowser/")?"Samsung Internet":xe(t,"Edge")||xe(t,"Edg/")?"Microsoft Edge":xe(t,"FBIOS")?"Facebook Mobile":xe(t,"Chrome")?"Chrome":xe(t,"CriOS")?"Chrome iOS":xe(t,"UCWEB")||xe(t,"UCBrowser")?"UC Browser":xe(t,"FxiOS")?"Firefox iOS":xe(e,"Apple")||function(i){return xe(i,"Safari")&&!xe(i,"Chrome")&&!xe(i,"Android")}(t)?xe(t,"Mobile")?"Mobile Safari":"Safari":xe(t,"Android")?"Android Mobile":xe(t,"Konqueror")||xe(t,"konqueror")?"Konqueror":xe(t,"Firefox")?"Firefox":xe(t,"MSIE")||xe(t,"Trident/")?"Internet Explorer":xe(t,"Gecko")?"Mozilla":""},browserVersion:function(t,e,r){var i={"Internet Explorer Mobile":[/rv:(\d+(\.\d+)?)/],"Microsoft Edge":[/Edge?\/(\d+(\.\d+)?)/],Chrome:[/Chrome\/(\d+(\.\d+)?)/],"Chrome iOS":[/CriOS\/(\d+(\.\d+)?)/],"UC Browser":[/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/],Safari:[/Version\/(\d+(\.\d+)?)/],"Mobile Safari":[/Version\/(\d+(\.\d+)?)/],Opera:[/(Opera|OPR)\/(\d+(\.\d+)?)/],Firefox:[/Firefox\/(\d+(\.\d+)?)/],"Firefox iOS":[/FxiOS\/(\d+(\.\d+)?)/],Konqueror:[/Konqueror[:/]?(\d+(\.\d+)?)/i],BlackBerry:[/BlackBerry (\d+(\.\d+)?)/,/Version\/(\d+(\.\d+)?)/],"Android Mobile":[/android\s(\d+(\.\d+)?)/],"Samsung Internet":[/SamsungBrowser\/(\d+(\.\d+)?)/],"Internet Explorer":[/(rv:|MSIE )(\d+(\.\d+)?)/],Mozilla:[/rv:(\d+(\.\d+)?)/]}[He.browser(t,e,r)];if(ve(i))return null;for(var n=0;n<i.length;n++){var s=i[n],a=t.match(s);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(t){if(/Windows/i.test(t)){if(/Phone/.test(t)||/WPDesktop/.test(t))return{os_name:"Windows Phone",os_version:""};var e=/Windows NT ([0-9.]+)/i.exec(t);return e&&e[1]?{os_name:"Windows",os_version:e[1]}:{os_name:"Windows",os_version:""}}if(/(iPhone|iPad|iPod)/.test(t)){var r=/OS (\d+)_(\d+)_?(\d+)?/i.exec(t);return r&&r[1]?{os_name:"iOS",os_version:[r[1],r[2],r[3]||"0"].join(".")}:{os_name:"iOS",os_version:""}}if(/Android/.test(t)){var i=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(t);return i&&i[1]?{os_name:"Android",os_version:[i[1],i[2],i[3]||"0"].join(".")}:{os_name:"Android",os_version:""}}if(/(BlackBerry|PlayBook|BB10)/i.test(t))return{os_name:"BlackBerry",os_version:""};if(/Mac/i.test(t)){var n=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(t);return n&&n[1]?{os_name:"Mac OS X",os_version:[n[1],n[2],n[3]||"0"].join(".")}:{os_name:"Mac OS X",os_version:""}}return/Linux/.test(t)?{os_name:"Linux",os_version:""}:/CrOS/.test(t)?{os_name:"Chrome OS",os_version:""}:{os_name:"",os_version:""}},device:function(t){return/Windows Phone/i.test(t)||/WPDesktop/.test(t)?"Windows Phone":/iPad/.test(t)?"iPad":/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(t)?"BlackBerry":/Android/.test(t)&&!/Mobile/.test(t)?"Android Tablet":/Android/.test(t)?"Android":""},deviceType:function(t){var e=this.device(t);return e==="iPad"||e==="Android Tablet"?"Tablet":e?"Mobile":"Desktop"},referrer:function(){return K?.referrer||"$direct"},referringDomain:function(){var t;return K!=null&&K.referrer&&((t=Md(K.referrer))===null||t===void 0?void 0:t.host)||"$direct"},properties:function(){if(!Ge)return{};var t=He.os(Ge),e=t.os_name,r=t.os_version;return Ye(Yl({$os:e,$os_version:r,$browser:He.browser(Ge,navigator.vendor,tt.opera),$device:He.device(Ge),$device_type:He.deviceType(Ge)}),{$current_url:O?.location.href,$host:O?.location.host,$pathname:O?.location.pathname,$raw_user_agent:Ge.length>1e3?Ge.substring(0,997)+"...":Ge,$browser_version:He.browserVersion(Ge,navigator.vendor,tt.opera),$browser_language:He.browserLanguage(),$screen_height:O?.screen.height,$screen_width:O?.screen.width,$viewport_height:O?.innerHeight,$viewport_width:O?.innerWidth,$lib:"web",$lib_version:oi.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:kd()/1e3})},people_properties:function(){if(!Ge)return{};var t=He.os(Ge),e=t.os_name,r=t.os_version;return Ye(Yl({$os:e,$os_version:r,$browser:He.browser(Ge,navigator.vendor,tt.opera)}),{$browser_version:He.browserVersion(Ge,navigator.vendor,tt.opera)})}},Q0=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],od=function(){function t(e){Oe(this,t);var r="";e.token&&(r=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,this.custom_campaign_params=e.custom_campaign_params||[],e.persistence_name?this.name="ph_"+e.persistence_name:this.name="ph_"+r+"_posthog",Q0.indexOf(e.persistence.toLowerCase())===-1&&(j.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var i=e.persistence.toLowerCase();i==="localstorage"&&Le.is_supported()?this.storage=Le:i==="localstorage+cookie"&&Hn.is_supported()?this.storage=Hn:i==="sessionstorage"&&Xe.is_supported()?this.storage=Xe:i==="memory"?this.storage=J0:i==="cookie"?this.storage=Jt:Hn.is_supported()?this.storage=Hn:this.storage=Jt,this.user_state="anonymous",this.load(),this.update_config(e),this.save()}return Re(t,[{key:"properties",value:function(){var e={};return Ce(this.props,function(r,i){if(i===Zi&&Pr(r))for(var n=Object.keys(r),s=0;s<n.length;s++)e["$feature/".concat(n[s])]=r[n[s]];else o=i,l=!1,(Ft(a=V0)?l:Hp&&a.indexOf===Hp?a.indexOf(o)!=-1:(Ce(a,function(h){if(l||(l=h===o))return lh}),l))||(e[i]=r);var a,o,l}),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Ye({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,r,i){var n=this;if(Pr(e)){ve(r)&&(r="None"),this.expire_days=ve(i)?this.default_expiry:i;var s=!1;if(Ce(e,function(a,o){n.props.hasOwnProperty(o)&&n.props[o]!==r||(n.props[o]=a,s=!0)}),s)return this.save(),!0}return!1}},{key:"register",value:function(e,r){var i=this;if(Pr(e)){this.expire_days=ve(r)?this.default_expiry:r;var n=!1;if(Ce(e,function(s,a){e.hasOwnProperty(a)&&i.props[a]!==s&&(i.props[a]=s,n=!0)}),n)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(He.campaignParams(this.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(He.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||He.referrer(),$referring_domain:this.props.$referring_domain||He.referringDomain()})}},{key:"get_referrer_info",value:function(){return Yl({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return Ce(this.props,function(r,i){i in e||(e[i]=r)}),e}},{key:"update_config",value:function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,r){var i=this.props[Gn]||{};i[e]=r,this.props[Gn]=i,this.save()}},{key:"remove_event_timer",value:function(e){var r=(this.props[Gn]||{})[e];return ve(r)||(delete this.props[Gn][e],this.save()),r}},{key:"get_user_state",value:function(){return this.props[Ql]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[Ql]=e,this.save()}},{key:"get_quota_limits",value:function(){return this.props[eh]||{}}},{key:"set_quota_limits",value:function(e){this.props[eh]=e,this.save()}}]),t}(),ld=2,ey=4,Dd=3,ty=6,ry=0,iy="rrweb/console@1",ny=Re(function t(e){var r,i,n=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Oe(this,t),Y(this,"bucketSize",100),Y(this,"refillRate",10),Y(this,"mutationBuckets",{}),Y(this,"loggedTracker",{}),Y(this,"refillBuckets",function(){Object.keys(n.mutationBuckets).forEach(function(a){n.mutationBuckets[a]=n.mutationBuckets[a]+n.refillRate,n.mutationBuckets[a]>=n.bucketSize&&delete n.mutationBuckets[a]})}),Y(this,"getNodeOrRelevantParent",function(a){var o=n.rrweb.mirror.getNode(a);if(o?.nodeName!=="svg"&&o instanceof Element){var l=o.closest("svg");if(l)return[n.rrweb.mirror.getId(l),l]}return[a,o]}),Y(this,"numberOfChanges",function(a){var o,l,h,c,u,f,p,m;return((o=(l=a.removes)===null||l===void 0?void 0:l.length)!==null&&o!==void 0?o:0)+((h=(c=a.attributes)===null||c===void 0?void 0:c.length)!==null&&h!==void 0?h:0)+((u=(f=a.texts)===null||f===void 0?void 0:f.length)!==null&&u!==void 0?u:0)+((p=(m=a.adds)===null||m===void 0?void 0:m.length)!==null&&p!==void 0?p:0)}),Y(this,"throttleMutations",function(a){if(a.type!==Dd||a.data.source!==ry)return a;var o=a.data,l=n.numberOfChanges(o);o.attributes&&(o.attributes=o.attributes.filter(function(c){var u,f,p,m=zt(n.getNodeOrRelevantParent(c.id),2),g=m[0],d=m[1];return n.mutationBuckets[g]===0?!1:(n.mutationBuckets[g]=(u=n.mutationBuckets[g])!==null&&u!==void 0?u:n.bucketSize,n.mutationBuckets[g]=Math.max(n.mutationBuckets[g]-1,0),n.mutationBuckets[g]===0&&(n.loggedTracker[g]||(n.loggedTracker[g]=!0,(f=(p=n.options).onBlockedNode)===null||f===void 0||f.call(p,g,d))),c)}));var h=n.numberOfChanges(o);return h!==0||l===h?a:void 0}),this.rrweb=e,this.options=s,this.refillRate=(r=this.options.refillRate)!==null&&r!==void 0?r:this.refillRate,this.bucketSize=(i=this.options.bucketSize)!==null&&i!==void 0?i:this.bucketSize,setInterval(function(){n.refillBuckets()},1e3)}),Fd=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}(Fd||{}),sy={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(t){return t},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6},ay=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],oy=["/s/","/e/","/i/vo/e/"];function hd(t,e,r,i){var n=e?.["content-length"];return n&&parseInt(n)>r?"".concat(i," body too large to record"):t}var Yt,ly=function(t,e){var r,i,n,s=t.session_recording,a=s.recordHeaders!==!1&&e.recordHeaders,o=s.recordBody!==!1&&e.recordBody,l=s.recordPerformance!==!1&&e.recordPerformance,h=(r=s,n=Math.min(1e6,(i=r.payloadSizeLimitBytes)!==null&&i!==void 0?i:1e6),function(f){return f!=null&&f.requestBody&&(f.requestBody=hd(f.requestBody,f.requestHeaders,n,"Request")),f!=null&&f.responseBody&&(f.responseBody=hd(f.responseBody,f.responseHeaders,n,"Response")),f}),c=function(f){return h(function(g){var d=Md(g.name);if(!(d&&d.pathname&&oy.includes(d.pathname)))return g}((p=f,Object.keys((m=p.requestHeaders)!==null&&m!==void 0?m:{}).forEach(function(g){var d;ay.includes(g.toLowerCase())&&((d=p.requestHeaders)===null||d===void 0||delete d[g])}),p)));var p,m},u=jt(t.session_recording.maskNetworkRequestFn);return u&&jt(t.session_recording.maskCapturedNetworkRequestFn)&&j.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),u&&(t.session_recording.maskCapturedNetworkRequestFn=function(f){var p=t.session_recording.maskNetworkRequestFn({url:f.name});return ne(ne({},f),{},{name:p?.url})}),s.maskRequestFn=jt(t.session_recording.maskCapturedNetworkRequestFn)?function(f){var p,m,g,d=c(f);return d&&(p=(m=(g=t.session_recording).maskCapturedNetworkRequestFn)===null||m===void 0?void 0:m.call(g,d))!==null&&p!==void 0?p:void 0}:void 0,s.maskRequestFn||(s.maskRequestFn=c),ne(ne(ne({},sy),s),{},{recordHeaders:a,recordBody:o,recordPerformance:l,recordInitialRequests:l})},hy="/s/",cd=3e5;(function(t){t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet"})(Yt||(Yt={}));var cy=[Yt.MouseMove,Yt.MouseInteraction,Yt.Scroll,Yt.ViewportResize,Yt.Input,Yt.TouchMove,Yt.MediaInteraction,Yt.Drag],uy=function(){function t(e){var r=this;if(Oe(this,t),Y(this,"isIdle",!1),Y(this,"_linkedFlagSeen",!1),Y(this,"_lastActivityTimestamp",Date.now()),Y(this,"windowId",null),Y(this,"sessionId",null),Y(this,"_linkedFlag",null),Y(this,"_sampleRate",null),Y(this,"_minimumDuration",null),Y(this,"_forceAllowLocalhostNetworkCapture",!1),this.instance=e,this._captureStarted=!1,this._endpoint=hy,this.stopRrweb=void 0,this.receivedDecide=!1,O?.addEventListener("beforeunload",function(){r._flushBuffer()}),!this.instance.sessionManager)throw j.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");this.buffer=this.clearBuffer()}return Re(t,[{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw j.error("Session recording started without valid sessionManager"),new Error("Session recording started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){return cr(this._sampleRate)?this.instance.get_property(Va):null}},{key:"sessionDuration",get:function(){var e,r,i=(e=this.buffer)===null||e===void 0?void 0:e.data[((r=this.buffer)===null||r===void 0?void 0:r.data.length)-1],n=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return i?i.timestamp-n:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(Jl),r=!this.instance.config.disable_session_recording;return O&&e&&r}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(Qp),r=this.instance.config.enable_recording_console_log;return r??e}},{key:"recordingVersion",get:function(){var e,r=this.instance.get_property(ed);return((e=this.instance.config.session_recording)===null||e===void 0?void 0:e.recorderVersion)||r||"v1"}},{key:"networkPayloadCapture",get:function(){var e,r,i=this.instance.get_property(td),n={recordHeaders:(e=this.instance.config.session_recording)===null||e===void 0?void 0:e.recordHeaders,recordBody:(r=this.instance.config.session_recording)===null||r===void 0?void 0:r.recordBody},s=n?.recordHeaders||i?.recordHeaders,a=n?.recordBody||i?.recordBody,o=this.instance.config.capture_performance||i?.capturePerformance;return s||a||o?{recordHeaders:s,recordBody:a,recordPerformance:o}:void 0}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?St(this._linkedFlag)&&!this._linkedFlagSeen?"buffering":Zl(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"disabled":"buffering"}},{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled?this.startCaptureAndTrySendingQueuedSnapshots():(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1)}},{key:"makeSamplingDecision",value:function(e){var r,i=this.sessionId!==e;if(cr(this._sampleRate)){var n,s=this.isSampled;i||!Zl(s)?n=Math.random()<this._sampleRate:n=s,n||j.warn("[SessionSampling] Sample rate (".concat(this._sampleRate,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),(r=this.instance.persistence)===null||r===void 0||r.register(Y({},Va,n))}else{var a;(a=this.instance.persistence)===null||a===void 0||a.register(Y({},Va,null))}}},{key:"afterDecideResponse",value:function(e){var r,i,n,s,a,o,l,h,c=this;this.instance.persistence&&this.instance.persistence.register((Y(h={},Jl,!!e.sessionRecording),Y(h,Qp,(a=e.sessionRecording)===null||a===void 0?void 0:a.consoleLogRecordingEnabled),Y(h,ed,(o=e.sessionRecording)===null||o===void 0?void 0:o.recorderVersion),Y(h,td,ne({capturePerformance:e.capturePerformance},(l=e.sessionRecording)===null||l===void 0?void 0:l.networkPayloadCapture)),h));var u=(r=e.sessionRecording)===null||r===void 0?void 0:r.sampleRate;this._sampleRate=ve(u)||Ft(u)?null:parseFloat(u);var f,p=(i=e.sessionRecording)===null||i===void 0?void 0:i.minimumDurationMilliseconds;if(this._minimumDuration=ve(p)?null:p,this._linkedFlag=((n=e.sessionRecording)===null||n===void 0?void 0:n.linkedFlag)||null,(s=e.sessionRecording)!==null&&s!==void 0&&s.endpoint&&(this._endpoint=(f=e.sessionRecording)===null||f===void 0?void 0:f.endpoint),cr(this._sampleRate)&&this.sessionManager.onSessionId(function(g){c.makeSamplingDecision(g)}),St(this._linkedFlag)){var m=this._linkedFlag;this.instance.onFeatureFlags(function(g){c._linkedFlagSeen=g.includes(m)})}this.receivedDecide=!0,this.startRecordingIfEnabled()}},{key:"log",value:function(e){var r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(r=this.instance.sessionRecording)===null||r===void 0||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:i,trace:[],payload:[JSON.stringify(e)]}},timestamp:kd()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){this._startCapture()}},{key:"_startCapture",value:function(){var e=this;if(!ve(Object.assign)&&!this._captureStarted&&!this.instance.config.disable_session_recording){this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId();var r=this.recordingVersion==="v2"?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.recordingVersion?Un(this.instance.config.api_host+"/static/".concat(r,"?v=").concat(oi.LIB_VERSION),function(i){if(i)return j.error("Could not load ".concat(r),i);e._onScriptLoaded()}):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(e){var r;return e.type===Dd&&cy.indexOf((r=e.data)===null||r===void 0?void 0:r.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(e){var r=this._isInteractiveEvent(e);if(r||this.isIdle||e.timestamp-this._lastActivityTimestamp>cd&&(this.isIdle=!0,this._tryAddCustomEvent("sessionIdle",{reason:"user inactivity",timeSinceLastActive:e.timestamp-this._lastActivityTimestamp,threshold:cd})),r&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),this._tryTakeFullSnapshot())),!this.isIdle){var i=this.sessionManager.checkAndGetSessionAndWindowId(!r,e.timestamp),n=i.windowId,s=i.sessionId,a=this.sessionId!==s,o=this.windowId!==n;[ld,ey].indexOf(e.type)===-1&&(o||a)&&this._tryTakeFullSnapshot(),this.windowId=n,this.sessionId=s}}},{key:"_tryRRwebMethod",value:function(e){if(!this._captureStarted)return!1;try{return e(),!0}catch(r){return j.error("[Session-Recording] using rrweb when not started.",r),!1}}},{key:"_tryAddCustomEvent",value:function(e,r){var i=this;return this._tryRRwebMethod(function(){var n;return(n=i.rrwebRecord)===null||n===void 0?void 0:n.addCustomEvent(e,r)})}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRwebMethod(function(){var r;return(r=e.rrwebRecord)===null||r===void 0?void 0:r.takeFullSnapshot()})}},{key:"_onScriptLoaded",value:function(){var e,r=this,i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=O.rrweb?O.rrweb.record:O.rrwebRecord;for(var n=this.instance.config.session_recording,s=0,a=Object.entries(n||{});s<a.length;s++){var o=zt(a[s],2),l=o[0],h=o[1];l in i&&(i[l]=h)}this.rrwebRecord?(this.mutationRateLimiter=(e=this.mutationRateLimiter)!==null&&e!==void 0?e:new ny(this.rrwebRecord,{onBlockedNode:function(c,u){var f="Too many mutations on node '".concat(c,"'. Rate limiting. This could be due to SVG animations or something similar");j.info(f,{node:u}),r.log("[PostHog Recorder] "+f,"warn")}}),this.stopRrweb=this.rrwebRecord(ne({emit:function(c){r.onRRwebEmit(c)},plugins:this._gatherRRWebPlugins()},i)),this.instance._addCaptureHook(function(c){try{if(c==="$pageview"){var u=O?r._maskUrl(O.location.href):"";if(!u)return;r._tryAddCustomEvent("$pageview",{href:u})}}catch(f){j.error("Could not add $pageview to rrweb session",f)}}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1):j.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_gatherRRWebPlugins",value:function(){var e=[];return tt.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(tt.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&jt(tt.getRecordNetworkPlugin)&&(!X0.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(tt.getRecordNetworkPlugin(ly(this.instance.config,this.networkPayloadCapture))):j.info("[SessionReplay-NetworkCapture] not started because we are on localhost.")),e}},{key:"onRRwebEmit",value:function(e){if(e&&Pr(e)){if(e.type===Fd.Meta){var r=this._maskUrl(e.data.href);if(!r)return;e.data.href=r}var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var n=function(o){var l=o;if(l&&Pr(l)&&l.type===ty&&Pr(l.data)&&l.data.plugin===iy){l.data.payload.payload.length>10&&(l.data.payload.payload=l.data.payload.payload.slice(0,10),l.data.payload.payload.push("...[truncated]"));for(var h=[],c=0;c<l.data.payload.payload.length;c++)l.data.payload.payload[c]&&l.data.payload.payload[c].length>2e3?h.push(l.data.payload.payload[c].slice(0,2e3)+"...[truncated]"):h.push(l.data.payload.payload[c]);return l.data.payload.payload=h,o}return o}(i),s=JSON.stringify(n).length;if(this._updateWindowAndSessionIds(n),!this.isIdle){var a={$snapshot_bytes:s,$snapshot_data:n,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(a):this.clearBuffer()}}}}},{key:"_maskUrl",value:function(e){var r=this.instance.config.session_recording;if(r.maskNetworkRequestFn){var i,n={url:e};return(i=n=r.maskNetworkRequestFn(n))===null||i===void 0?void 0:i.url}return e}},{key:"clearBuffer",value:function(){return this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var r=this._minimumDuration,i=this.sessionDuration,n=cr(i)&&i>=0,s=cr(r)&&n&&i<r;return this.status==="buffering"||s?(this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3),this.buffer||this.clearBuffer()):this.buffer&&this.buffer.data.length!==0?(this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer()):this.buffer||this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var r,i=this,n=2+(((r=this.buffer)===null||r===void 0?void 0:r.data.length)||0);(!this.buffer||this.buffer.size+e.$snapshot_bytes+n>943718.4||this.buffer.sessionId&&this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),Ft(this.buffer.sessionId)&&!Ft(this.sessionId)&&(this.buffer.sessionId=this.sessionId,this.buffer.windowId=this.windowId),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){i._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this._endpoint,_noTruncate:!0,_batchKey:"recordings",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===ld}})}}]),t}(),py=function(){function t(e){Oe(this,t),this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return Re(t,[{key:"call",value:function(){var e=this,r=hh(JSON.stringify({token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Yi),group_properties:this.instance.get_property(kr),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0}));this.instance._send_request("".concat(this.instance.config.api_host,"/decide/?v=3"),{data:r,verbose:!0},{method:"POST"},function(i){return e.parseDecideResponse(i)})}},{key:"parseDecideResponse",value:function(e){var r,i=this;if(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer(),e?.status!==0){if(!K||!K.body)return j.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){i.parseDecideResponse(e)},500);this.instance.toolbar.afterDecideResponse(e),(r=this.instance.sessionRecording)===null||r===void 0||r.afterDecideResponse(e),Er.afterDecideResponse(e,this.instance),this.instance._afterDecideResponse(e),this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e);var n=O?.extendPostHogWithSurveys;e.surveys&&!n&&Un(this.instance.config.api_host+"/static/surveys.js",function(c){if(c)return j.error("Could not load surveys script",c);O.extendPostHogWithSurveys(i.instance)});var s=O?.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&ve(s)&&Un(this.instance.config.api_host+"/static/exception-autocapture.js",function(c){if(c)return j.error("Could not load exception autocapture script",c);O.extendPostHogWithExceptionAutocapture(i.instance,e)}),e.siteApps)if(this.instance.config.opt_in_site_apps){var a,o=this.instance.config.api_host,l=ai(e.siteApps);try{var h=function(){var c=a.value,u=c.id,f=c.url,p=[o,o[o.length-1]==="/"&&f[0]==="/"?f.substring(1):f].join("");tt["__$$ph_site_app_".concat(u)]=i.instance,Un(p,function(m){m&&j.error("Error while initializing PostHog app with config id ".concat(u),m)})};for(l.s();!(a=l.n()).done;)h()}catch(c){l.e(c)}finally{l.f()}}else e.siteApps.length>0&&j.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else j.error("Failed to fetch feature flags from PostHog.")}}]),t}(),dy=["https://app.posthog.com","https://eu.posthog.com"],fy=["source"],my=O!=null&&O.location?Za(O.location.hash,"__posthog")||Za(location.hash,"state"):null,gy=function(){function t(e){Oe(this,t),this.instance=e}return Re(t,[{key:"afterDecideResponse",value:function(e){var r=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&r.toolbarVersion&&r.toolbarVersion.indexOf("toolbar")===0&&this.loadToolbar(ne({},r))}},{key:"maybeLoadToolbar",value:function(){var e,r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!O||!K)return!1;i=(e=i)!==null&&e!==void 0?e:O.location,s=(r=s)!==null&&r!==void 0?r:O.history;try{if(!n){try{O.localStorage.setItem("test","test"),O.localStorage.removeItem("test")}catch{return!1}n=O?.localStorage}var a,o=my||Za(i.hash,"__posthog")||Za(i.hash,"state"),l=o?Wp(function(){return JSON.parse(atob(decodeURIComponent(o)))})||Wp(function(){return JSON.parse(decodeURIComponent(o))}):null;return l&&l.action==="ph_authorize"?((a=l).source="url",a&&Object.keys(a).length>0&&(l.desiredHash?i.hash=l.desiredHash:s?s.replaceState("",K.title,i.pathname+i.search):i.hash="")):((a=JSON.parse(n.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete a.userIntent),!(!a.token||this.instance.config.token!==a.token)&&(this.loadToolbar(a),!0)}catch{return!1}}},{key:"loadToolbar",value:function(e){var r=this;if(!O||tt._postHogToolbarLoaded)return!1;tt._postHogToolbarLoaded=!0;var i=this.instance.config.api_host,n=3e5,s=Math.floor(Date.now()/n)*n,a="".concat(i).concat(i.endsWith("/")?"":"/","static/toolbar.js?t=").concat(s),o=!dy.includes(this.instance.config.api_host)&&this.instance.config.advanced_disable_toolbar_metrics,l=ne(ne({token:this.instance.config.token},e),{},{apiURL:i},o?{instrument:!1}:{});l.source;var h=T0(l,fy);return O.localStorage.setItem("_postHogToolbarParams",JSON.stringify(h)),Un(a,function(c){c?j.error("Failed to load toolbar",c):(tt.ph_load_toolbar||tt.ph_load_editor)(l,r.instance)}),qn(O,"turbolinks:load",function(){tt._postHogToolbarLoaded=!1,r.loadToolbar(l)}),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,r,i)}}]),t}(),yy="__ph_opt_in_out_";function vy(t,e){Od(!0,t,e)}function by(t,e){Od(!1,t,e)}function _y(t,e){return $d(t,e)==="1"}function ud(t,e){return!!function(r){if(r&&r.respectDnt){var i=r&&r.window||O,n=i?.navigator,s=!1;return Ce([n?.doNotTrack,n.msDoNotTrack,i.doNotTrack],function(a){xe([!0,1,"1","yes"],a)&&(s=!0)}),s}return!1}(e)||$d(t,e)==="0"}function wy(t,e){uh(e=e||{}).remove(ph(t,e),!!e.crossSubdomainCookie)}function uh(t){return(t=t||{}).persistenceType==="localStorage"?Le:t.persistenceType==="localStorage+cookie"?Hn:Jt}function ph(t,e){return((e=e||{}).persistencePrefix||yy)+t}function $d(t,e){return uh(e).get(ph(t,e))}function Od(t,e,r){St(e)&&e.length?(uh(r=r||{}).set(ph(e,r),t?1:0,cr(r.cookieExpiration)?r.cookieExpiration:null,r.crossSubdomainCookie,r.secureCookie),r.capture&&t&&r.capture(r.captureEventName||"$opt_in",r.captureProperties||{},{send_instantly:!0})):j.error("gdpr."+(t?"optIn":"optOut")+" called with an invalid token")}var Rd=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:3e3;Oe(this,t),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=e}return Re(t,[{key:"setPollInterval",value:function(e){this._pollInterval=e,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return new Date().getTime()}}]),t}(),xy=function(t){bd(r,Rd);var e=_d(r);function r(i){var n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e3;return Oe(this,r),(n=e.call(this,s)).handlePollRequest=i,n}return Re(r,[{key:"enqueue",value:function(i,n,s){this._event_queue.push({url:i,data:n,options:s}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var i=this;clearTimeout(this._poller),this._poller=setTimeout(function(){if(i._event_queue.length>0){var n=i.formatQueue(),s=function(o){var l=n[o],h=l.url,c=l.data,u=l.options;Ce(c,function(f,p){c[p].offset=Math.abs(c[p].timestamp-i.getTime()),delete c[p].timestamp}),i.handlePollRequest(h,c,u)};for(var a in n)s(a);i._event_queue.length=0,i._empty_queue_count=0}else i._empty_queue_count++;i._empty_queue_count>4&&(i.isPolling=!1,i._empty_queue_count=0),i.isPolling&&i.poll()},this._pollInterval)}},{key:"unload",value:function(){var i=this;clearTimeout(this._poller);var n=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var s=Object.values(n);[].concat(Ul(s.filter(function(a){return a.url.indexOf("/e")===0})),Ul(s.filter(function(a){return a.url.indexOf("/e")!==0}))).map(function(a){var o=a.url,l=a.data,h=a.options;i.handlePollRequest(o,l,ne(ne({},h),{},{transport:"sendBeacon"}))})}},{key:"formatQueue",value:function(){var i={};return Ce(this._event_queue,function(n){var s=n.url,a=n.data,o=n.options,l=(o?o._batchKey:null)||s;ve(i[l])&&(i[l]={data:[],url:s,options:o}),o&&i[l].options&&i[l].options._metrics&&!i[l].options._metrics.rrweb_full_snapshot&&(i[l].options._metrics.rrweb_full_snapshot=o._metrics.rrweb_full_snapshot),i[l].data.push(a)}),i}}]),r}(),kt=Uint8Array,at=Uint16Array,Xi=Uint32Array,dh=new kt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fh=new kt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),pd=new kt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ld=function(t,e){for(var r=new at(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];var n=new Xi(r[30]);for(i=1;i<30;++i)for(var s=r[i];s<r[i+1];++s)n[s]=s-r[i]<<5|i;return[r,n]},Bd=Ld(dh,2),Sy=Bd[0],rh=Bd[1];Sy[28]=258,rh[258]=28;for(ih=Ld(fh,0)[1],Ya=new at(32768),Ie=0;Ie<32768;++Ie)xr=(43690&Ie)>>>1|(21845&Ie)<<1,xr=(61680&(xr=(52428&xr)>>>2|(13107&xr)<<2))>>>4|(3855&xr)<<4,Ya[Ie]=((65280&xr)>>>8|(255&xr)<<8)>>>1;var xr,ih,Ya,Ie,Wn=function(t,e,r){for(var i=t.length,n=0,s=new at(e);n<i;++n)++s[t[n]-1];var a,o=new at(e);for(n=0;n<e;++n)o[n]=o[n-1]+s[n-1]<<1;if(r){a=new at(1<<e);var l=15-e;for(n=0;n<i;++n)if(t[n])for(var h=n<<4|t[n],c=e-t[n],u=o[t[n]-1]++<<c,f=u|(1<<c)-1;u<=f;++u)a[Ya[u]>>>l]=h}else for(a=new at(i),n=0;n<i;++n)a[n]=Ya[o[t[n]-1]++]>>>15-t[n];return a},li=new kt(288);for(Ie=0;Ie<144;++Ie)li[Ie]=8;for(Ie=144;Ie<256;++Ie)li[Ie]=9;for(Ie=256;Ie<280;++Ie)li[Ie]=7;for(Ie=280;Ie<288;++Ie)li[Ie]=8;var Ja=new kt(32);for(Ie=0;Ie<32;++Ie)Ja[Ie]=5;var ii,ky=Wn(li,9,0),Ey=Wn(Ja,5,0),Vd=function(t){return(t/8>>0)+(7&t&&1)},Nd=function(t,e,r){(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length);var i=new(t instanceof at?at:t instanceof Xi?Xi:kt)(r-e);return i.set(t.subarray(e,r)),i},hr=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8},zn=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Gl=function(t,e){for(var r=[],i=0;i<t.length;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new kt(0),0];if(n==1){var a=new kt(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort(function(S,T){return S.f-T.f}),r.push({s:-1,f:25001});var o=r[0],l=r[1],h=0,c=1,u=2;for(r[0]={s:-1,f:o.f+l.f,l:o,r:l};c!=n-1;)o=r[r[h].f<r[u].f?h++:u++],l=r[h!=c&&r[h].f<r[u].f?h++:u++],r[c++]={s:-1,f:o.f+l.f,l:o,r:l};var f=s[0].s;for(i=1;i<n;++i)s[i].s>f&&(f=s[i].s);var p=new at(f+1),m=Py(r[c-1],p,0);if(m>e){i=0;var g=0,d=m-e,y=1<<d;for(s.sort(function(S,T){return p[T.s]-p[S.s]||S.f-T.f});i<n;++i){var v=s[i].s;if(!(p[v]>e))break;g+=y-(1<<m-p[v]),p[v]=e}for(g>>>=d;g>0;){var b=s[i].s;p[b]<e?g-=1<<e-p[b]++-1:++i}for(;i>=0&&g;--i){var _=s[i].s;p[_]==e&&(--p[_],++g)}m=e}return[new kt(p),m]},Py=function t(e,r,i){return e.s==-1?Math.max(t(e.l,r,i+1),t(e.r,r,i+1)):r[e.s]=i},dd=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new at(++e),i=0,n=t[0],s=1,a=function(l){r[i++]=l},o=1;o<=e;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[r.subarray(0,i),e]},jn=function(t,e){for(var r=0,i=0;i<e.length;++i)r+=t[i]*e[i];return r},Na=function(t,e,r){var i=r.length,n=Vd(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;s<i;++s)t[n+s+4]=r[s];return 8*(n+4+i)},fd=function(t,e,r,i,n,s,a,o,l,h,c){hr(e,c++,r),++n[256];for(var u=Gl(n,15),f=u[0],p=u[1],m=Gl(s,15),g=m[0],d=m[1],y=dd(f),v=y[0],b=y[1],_=dd(g),S=_[0],T=_[1],x=new at(19),w=0;w<v.length;++w)x[31&v[w]]++;for(w=0;w<S.length;++w)x[31&S[w]]++;for(var M=Gl(x,7),k=M[0],I=M[1],P=19;P>4&&!k[pd[P-1]];--P);var A,E,F,$,D=h+5<<3,C=jn(n,li)+jn(s,Ja)+a,R=jn(n,f)+jn(s,g)+a+14+3*P+jn(x,k)+(2*x[16]+3*x[17]+7*x[18]);if(D<=C&&D<=R)return Na(e,c,t.subarray(l,l+h));if(hr(e,c,1+(R<C)),c+=2,R<C){A=Wn(f,p,0),E=f,F=Wn(g,d,0),$=g;var B=Wn(k,I,0);for(hr(e,c,b-257),hr(e,c+5,T-1),hr(e,c+10,P-4),c+=14,w=0;w<P;++w)hr(e,c+3*w,k[pd[w]]);c+=3*P;for(var U=[v,S],Z=0;Z<2;++Z){var X=U[Z];for(w=0;w<X.length;++w){var H=31&X[w];hr(e,c,B[H]),c+=k[H],H>15&&(hr(e,c,X[w]>>>5&127),c+=X[w]>>>12)}}}else A=ky,E=li,F=Ey,$=Ja;for(w=0;w<o;++w)if(i[w]>255){H=i[w]>>>18&31,zn(e,c,A[H+257]),c+=E[H+257],H>7&&(hr(e,c,i[w]>>>23&31),c+=dh[H]);var ie=31&i[w];zn(e,c,F[ie]),c+=$[ie],ie>3&&(zn(e,c,i[w]>>>5&8191),c+=fh[ie])}else zn(e,c,A[i[w]]),c+=E[i[w]];return zn(e,c,A[256]),c+E[256]},Ay=new Xi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Cy=new kt(0),Ty=function(){for(var t=new Xi(256),e=0;e<256;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Iy=function(){var t=4294967295;return{p:function(e){for(var r=t,i=0;i<e.length;++i)r=Ty[255&r^e[i]]^r>>>8;t=r},d:function(){return 4294967295^t}}},My=function(t,e,r,i,n){return function(s,a,o,l,h,c){var u=s.length,f=new kt(l+u+5*(1+Math.floor(u/7e3))+h),p=f.subarray(l,f.length-h),m=0;if(!a||u<8)for(var g=0;g<=u;g+=65535){var d=g+65535;d<u?m=Na(p,m,s.subarray(g,d)):(p[g]=c,m=Na(p,m,s.subarray(g,u)))}else{for(var y=Ay[a-1],v=y>>>13,b=8191&y,_=(1<<o)-1,S=new at(32768),T=new at(_+1),x=Math.ceil(o/3),w=2*x,M=function(ot){return(s[ot]^s[ot+1]<<x^s[ot+2]<<w)&_},k=new Xi(25e3),I=new at(288),P=new at(32),A=0,E=0,F=(g=0,0),$=0,D=0;g<u;++g){var C=M(g),R=32767&g,B=T[C];if(S[R]=B,T[C]=R,$<=g){var U=u-g;if((A>7e3||F>24576)&&U>423){m=fd(s,p,0,k,I,P,E,F,D,g-D,m),F=A=E=0,D=g;for(var Z=0;Z<286;++Z)I[Z]=0;for(Z=0;Z<30;++Z)P[Z]=0}var X=2,H=0,ie=b,oe=R-B&32767;if(U>2&&C==M(g-oe))for(var se=Math.min(v,U)-1,te=Math.min(32767,g),ke=Math.min(258,U);oe<=te&&--ie&&R!=B;){if(s[g+X]==s[g+X-oe]){for(var fe=0;fe<ke&&s[g+fe]==s[g+fe-oe];++fe);if(fe>X){if(X=fe,H=oe,fe>se)break;var Me=Math.min(oe,fe-2),Ee=0;for(Z=0;Z<Me;++Z){var J=g-oe+Z+32768&32767,Ze=J-S[J]+32768&32767;Ze>Ee&&(Ee=Ze,B=J)}}}oe+=(R=B)-(B=S[R])+32768&32767}if(H){k[F++]=268435456|rh[X]<<18|ih[H];var Et=31&rh[X],Pt=31&ih[H];E+=dh[Et]+fh[Pt],++I[257+Et],++P[Pt],$=g+X,++A}else k[F++]=s[g],++I[s[g]]}}m=fd(s,p,c,k,I,P,E,F,D,g-D,m),c||(m=Na(p,m,Cy))}return Nd(f,0,l+Vd(m)+h)}(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i,!n)},nh=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},Dy=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&nh(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}},Fy=function(t){return 10+(t.filename&&t.filename.length+1||0)};function $y(t,e){e===void 0&&(e={});var r=Iy(),i=t.length;r.p(t);var n=My(t,e,Fy(e),8),s=n.length;return Dy(n,e),nh(n,s-8,r.d()),nh(n,s-4,i),n}function Oy(t,e){var r=t.length;if(!e&&typeof TextEncoder<"u")return new TextEncoder().encode(t);for(var i=new kt(t.length+(t.length>>>1)),n=0,s=function(h){i[n++]=h},a=0;a<r;++a){if(n+5>i.length){var o=new kt(n+8+(r-a<<1));o.set(i),i=o}var l=t.charCodeAt(a);l<128||e?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++a))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return Nd(i,0,n)}(function(t){t.GZipJS="gzip-js",t.Base64="base64"})(ii||(ii={}));var zd=function(t,e,r){var i=e||{};i.ip=r.ip?1:0,i._=new Date().getTime().toString(),i.ver=oi.LIB_VERSION;var n=t.split("?");if(n.length>1){var s,a=ai(n[1].split("&"));try{for(a.s();!(s=a.n()).done;){var o=s.value.split("=")[0];ve(i[o])||delete i[o]}}catch(h){a.e(h)}finally{a.f()}}var l=t.indexOf("?")>-1?"&":"?";return t+l+function(h){var c,u,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",p=[];return Ce(h,function(m,g){ve(m)||ve(g)||g==="undefined"||(c=encodeURIComponent(m.toString()),u=encodeURIComponent(g),p[p.length]=u+"="+c)}),p.join(f)}(i)},mh=function t(e,r){if(r.blob&&e.buffer)return new Blob([jp(e)?e:e.buffer],{type:"text/plain"});if(r.sendBeacon||r.blob){var i=t(e,{method:"POST"});return new Blob([i],{type:"application/x-www-form-urlencoded"})}return r.method!=="POST"?null:(n=We(e)||jp(e)?"data="+encodeURIComponent(e):"data="+encodeURIComponent(e.data),"compression"in e&&e.compression&&(n+="&compression="+e.compression),n);var n},jd=function(t){var e=t.url,r=t.data,i=t.headers,n=t.options,s=t.callback,a=t.retriesPerformedSoFar,o=t.retryQueue,l=t.onXHRError,h=t.timeout,c=h===void 0?6e4:h,u=t.onResponse;cr(a)&&a>0&&(e=zd(e,{retry_count:a},{}));var f=new XMLHttpRequest;f.open(n.method||"GET",e,!0);var p=mh(r,n);Ce(i,function(m,g){f.setRequestHeader(g,m)}),n.method!=="POST"||n.blob||f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.timeout=c,f.withCredentials=!0,f.onreadystatechange=function(){if(f.readyState===4)if(u?.(f),f.status===200){if(s){var m;try{m=JSON.parse(f.responseText)}catch(g){return void j.error(g)}s(m)}}else jt(l)&&l(f),(f.status<400||f.status>500)&&o.enqueue({url:e,data:r,options:n,headers:i,retriesPerformedSoFar:(a||0)+1,callback:s}),s?.({status:0})},f.send(p)},Ry=18e5,Ly=function(t){bd(r,Rd);var e=_d(r);function r(i,n){var s;return Oe(this,r),(s=e.call(this)).isPolling=!1,s.queue=[],s.areWeOnline=!0,s.onXHRError=i,s.rateLimiter=n,!ve(O)&&"onLine"in O.navigator&&(s.areWeOnline=O.navigator.onLine,O.addEventListener("online",function(){s._handleWeAreNowOnline()}),O.addEventListener("offline",function(){s.areWeOnline=!1})),s}return Re(r,[{key:"enqueue",value:function(i){var n=i.retriesPerformedSoFar||0;if(!(n>=10)){var s=function(l){var h=3e3*Math.pow(2,l),c=h/2,u=Math.min(Ry,h),f=(Math.random()-.5)*(u-c);return Math.ceil(u+f)}(n),a=new Date(Date.now()+s);this.queue.push({retryAt:a,requestData:i});var o="Enqueued failed request for retry in ".concat(s);navigator.onLine||(o+=" (Browser is offline)"),j.warn(o),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var i=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout(function(){i.areWeOnline&&i.queue.length>0&&i.flush(),i.poll()},this._pollInterval)}},{key:"flush",value:function(){var i=new Date(Date.now()),n=this.queue.filter(function(l){return l.retryAt<i});if(n.length>0){this.queue=this.queue.filter(function(l){return l.retryAt>=i});var s,a=ai(n);try{for(a.s();!(s=a.n()).done;){var o=s.value.requestData;this._executeXhrRequest(o)}}catch(l){a.e(l)}finally{a.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var i,n=ai(this.queue);try{for(n.s();!(i=n.n()).done;){var s=i.value.requestData,a=s.url,o=s.data,l=s.options;if(this.rateLimiter.isRateLimited(l._batchKey))j.warn("[RetryQueue] is quota limited. Dropping request.");else try{O?.navigator.sendBeacon(a,mh(o,ne(ne({},l),{},{sendBeacon:!0})))}catch(h){j.error(h)}}}catch(h){n.e(h)}finally{n.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(i){var n=i.url,s=i.data,a=i.options,o=i.headers,l=i.callback,h=i.retriesPerformedSoFar;this.rateLimiter.isRateLimited(a._batchKey)||jd({url:n,data:s||{},options:a||{},headers:o||{},retriesPerformedSoFar:h||0,callback:l,retryQueue:this,onXHRError:this.onXHRError,onResponse:this.rateLimiter.checkForLimiting})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),r}(),Fa=1800,md=60,By=864e5,Vy=function(){function t(e,r,i,n){Oe(this,t),Y(this,"_sessionIdChangedHandlers",[]),this.config=e,this.persistence=r,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=i||ni,this._windowIdGenerator=n||ni;var s=e.persistence_name||e.token,a=e.session_idle_timeout_seconds||Fa;if(cr(a)?a>Fa?j.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a<md&&j.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(j.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=Fa),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,md),Fa),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var o=Xe.parse(this._window_id_storage_key),l=Xe.parse(this._primary_window_exists_storage_key);o&&!l?this._windowId=o:Xe.remove(this._window_id_storage_key),Xe.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return Re(t,[{key:"onSessionId",value:function(e){var r=this;return ve(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){r._sessionIdChangedHandlers=r._sessionIdChangedHandlers.filter(function(i){return i!==e})}}},{key:"_canUseSessionStorage",value:function(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Xe.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Xe.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Xe.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,r,i){e===this._sessionId&&r===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=r,this._sessionId=e,this.persistence.register(Y({},Ua,[r,e,i])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Ua];return We(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;O?.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&Xe.remove(e._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),i=zt(this._getSessionId(),3),n=i[0],s=i[1],a=i[2],o=this._getWindowId(),l=a&&a>0&&Math.abs(r-a)>By,h=!1,c=!s,u=!e&&Math.abs(r-n)>this._sessionTimeoutMs;c||u||l?(s=this._sessionIdGenerator(),o=this._windowIdGenerator(),a=r,h=!0):o||(o=this._windowIdGenerator(),h=!0);var f=n===0||!e||l?r:n,p=a===0?new Date().getTime():a;return this._setWindowId(o),this._setSessionId(s,f,p),h&&this._sessionIdChangedHandlers.forEach(function(m){return m(s,o)}),{sessionId:s,windowId:o,sessionStartTimestamp:p}}}]),t}(),Ny=Re(function t(e,r,i,n){Oe(this,t),this.name="posthog-js",this.setupOnce=function(s){s(function(a){var o,l,h,c,u;if(a.level!=="error"||!e.__loaded)return a;a.tags||(a.tags={});var f=e.config.ui_host||e.config.api_host;a.tags["PostHog Person URL"]=f+"/person/"+e.get_distinct_id(),e.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=((o=a.exception)===null||o===void 0?void 0:o.values)||[],m={$exception_message:(l=p[0])===null||l===void 0?void 0:l.value,$exception_type:(h=p[0])===null||h===void 0?void 0:h.type,$exception_personURL:f+"/person/"+e.get_distinct_id(),$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:(c=p[0])===null||c===void 0?void 0:c.value,$sentry_exception_type:(u=p[0])===null||u===void 0?void 0:u.type,$sentry_tags:a.tags};return r&&i&&(m.$sentry_url=(n||"https://sentry.io/organizations/")+r+"/issues/?project="+i+"&query="+a.event_id),e.capture("$exception",m),a})}}),zy=function(t){Promise&&Promise.resolve||j.warn("This browser does not have Promise support, and can not use the segment integration");var e=function(r,i){r.event.userId||r.event.anonymousId===t.get_distinct_id()||t.reset(),r.event.userId&&r.event.userId!==t.get_distinct_id()&&(t.register({distinct_id:r.event.userId}),t.reloadFeatureFlags());var n=t._calculate_event_properties(i,r.event.properties);return r.event.properties=Object.assign({},n,r.event.properties),r};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(r){return e(r,r.event.event)},page:function(r){return e(r,"$pageview")},identify:function(r){return e(r,"$identify")},screen:function(r){return e(r,"$screen")}}},jy=function(){function t(){var e=this;Oe(this,t),Y(this,"_hasSeenPageView",!1),Y(this,"_updateScrollData",function(){var r,i,n,s;e._pageViewData||(e._pageViewData=e._createPageViewData());var a=e._pageViewData,o=e._scrollY(),l=e._scrollHeight(),h=e._contentY(),c=e._contentHeight();a.lastScrollY=o,a.maxScrollY=Math.max(o,(r=a.maxScrollY)!==null&&r!==void 0?r:0),a.maxScrollHeight=Math.max(l,(i=a.maxScrollHeight)!==null&&i!==void 0?i:0),a.lastContentY=h,a.maxContentY=Math.max(h,(n=a.maxContentY)!==null&&n!==void 0?n:0),a.maxContentHeight=Math.max(c,(s=a.maxContentHeight)!==null&&s!==void 0?s:0)})}return Re(t,[{key:"_createPageViewData",value:function(){var e;return{pathname:(e=O?.location.pathname)!==null&&e!==void 0?e:""}}},{key:"doPageView",value:function(){var e,r;return this._hasSeenPageView?(r=this._pageViewData,this._pageViewData=this._createPageViewData()):(this._hasSeenPageView=!0,r=void 0,this._pageViewData||(this._pageViewData=this._createPageViewData())),setTimeout(this._updateScrollData,0),ne({$prev_pageview_pathname:(e=r)===null||e===void 0?void 0:e.pathname},this._calculatePrevPageScrollProperties(r))}},{key:"doPageLeave",value:function(){var e=this._pageViewData;return ne({$prev_pageview_pathname:e?.pathname},this._calculatePrevPageScrollProperties(e))}},{key:"_calculatePrevPageScrollProperties",value:function(e){if(!e||e.maxScrollHeight==null||e.lastScrollY==null||e.maxScrollY==null||e.maxContentHeight==null||e.lastContentY==null||e.maxContentY==null)return{};var r=e.maxScrollHeight,i=e.lastScrollY,n=e.maxScrollY,s=e.maxContentHeight,a=e.lastContentY,o=e.maxContentY;return r=Math.ceil(r),i=Math.ceil(i),n=Math.ceil(n),s=Math.ceil(s),a=Math.ceil(a),o=Math.ceil(o),{$prev_pageview_last_scroll:i,$prev_pageview_last_scroll_percentage:r<=1?1:$a(i/r,0,1),$prev_pageview_max_scroll:n,$prev_pageview_max_scroll_percentage:r<=1?1:$a(n/r,0,1),$prev_pageview_last_content:a,$prev_pageview_last_content_percentage:s<=1?1:$a(a/s,0,1),$prev_pageview_max_content:o,$prev_pageview_max_content_percentage:s<=1?1:$a(o/s,0,1)}}},{key:"startMeasuringScrollPosition",value:function(){O?.addEventListener("scroll",this._updateScrollData),O?.addEventListener("scrollend",this._updateScrollData),O?.addEventListener("resize",this._updateScrollData)}},{key:"stopMeasuringScrollPosition",value:function(){O?.removeEventListener("scroll",this._updateScrollData),O?.removeEventListener("scrollend",this._updateScrollData),O?.removeEventListener("resize",this._updateScrollData)}},{key:"_scrollHeight",value:function(){return O?Math.max(0,O.document.documentElement.scrollHeight-O.document.documentElement.clientHeight):0}},{key:"_scrollY",value:function(){return O&&(O.scrollY||O.pageYOffset||O.document.documentElement.scrollTop)||0}},{key:"_contentHeight",value:function(){return O?.document.documentElement.scrollHeight||0}},{key:"_contentY",value:function(){var e=O?.document.documentElement.clientHeight||0;return this._scrollY()+e}}]),t}();function $a(t,e,r){return Math.max(e,Math.min(t,r))}var Zn,gh,Je,Gy={icontains:function(t){return!!O&&O.location.href.toLowerCase().indexOf(t.toLowerCase())>-1},regex:function(t){return!!O&&K0(O.location.href,t)},exact:function(t){return O?.location.href===t}},Hy=function(){function t(e){Oe(this,t),this.instance=e}return Re(t,[{key:"getSurveys",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.instance.get_property(Kl);if(n&&!i)return e(n);this.instance._send_request("".concat(this.instance.config.api_host,"/api/surveys/?token=").concat(this.instance.config.token),{},{method:"GET"},function(s){var a,o=s.surveys||[];return(a=r.instance.persistence)===null||a===void 0||a.register(Y({},Kl,o)),e(o)})}},{key:"getActiveMatchingSurveys",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(n){var s=n.filter(function(a){return!(!a.start_date||a.end_date)}).filter(function(a){var o,l,h,c;if(!a.conditions)return!0;var u=(o=a.conditions)===null||o===void 0||!o.url||Gy[(l=(h=a.conditions)===null||h===void 0?void 0:h.urlMatchType)!==null&&l!==void 0?l:"icontains"](a.conditions.url),f=(c=a.conditions)===null||c===void 0||!c.selector||K?.querySelector(a.conditions.selector);return u&&f}).filter(function(a){if(!a.linked_flag_key&&!a.targeting_flag_key)return!0;var o=!a.linked_flag_key||r.instance.featureFlags.isFeatureEnabled(a.linked_flag_key),l=!a.targeting_flag_key||r.instance.featureFlags.isFeatureEnabled(a.targeting_flag_key);return o&&l});return e(s)},i)}}]),t}(),qy=6e4,Uy=function(){function t(){var e=this;Oe(this,t),Y(this,"limits",{}),Y(this,"checkForLimiting",function(r){try{var i=r.responseText;if(!i||!i.length)return;(JSON.parse(i).quota_limited||[]).forEach(function(n){j.info("[RateLimiter] ".concat(n||"events"," is quota limited.")),e.limits[n]=new Date().getTime()+qy})}catch(n){return void j.error(n)}})}return Re(t,[{key:"isRateLimited",value:function(e){var r=this.limits[e||"events"]||!1;return r!==!1&&new Date().getTime()<r}}]),t}(),Wy=function(){return ne({initialPathName:O?.location.pathname||"",referringDomain:He.referringDomain()},He.campaignParams())},Zy=function(){function t(e,r,i){var n=this;Oe(this,t),Y(this,"_onSessionIdCallback",function(s){var a=n._getStoredProps();if(!a||a.sessionId!==s){var o={sessionId:s,props:n._sessionSourceParamGenerator()};n._persistence.register(Y({},th,o))}}),this._sessionIdManager=e,this._persistence=r,this._sessionSourceParamGenerator=i||Wy,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return Re(t,[{key:"_getStoredProps",value:function(){return this._persistence.props[th]}},{key:"getSessionProps",value:function(){var e,r=(e=this._getStoredProps())===null||e===void 0?void 0:e.props;return r?{$client_session_initial_referring_host:r.referringDomain,$client_session_initial_pathname:r.initialPathName,$client_session_initial_utm_source:r.utm_source,$client_session_initial_utm_campaign:r.utm_campaign,$client_session_initial_utm_medium:r.utm_medium,$client_session_initial_utm_content:r.utm_content,$client_session_initial_utm_term:r.utm_term}:{}}}]),t}(),Yy=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"],Jy=function(t,e){if(!t)return!1;var r=t.toLowerCase();return Yy.concat(e||[]).some(function(i){var n=i.toLowerCase();return r.includes?r.includes(n):r.indexOf(n)!==-1})};(function(t){t[t.INIT_MODULE=0]="INIT_MODULE",t[t.INIT_SNIPPET=1]="INIT_SNIPPET"})(Zn||(Zn={}));var sh=function(){},Oa={},pt="posthog",za=O?.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Gd=!za&&Ge?.indexOf("MSIE")===-1&&Ge?.indexOf("Mozilla")===-1,gd=function(){var t,e,r;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=K?.location,r=e?.hostname,!!St(r)&&r.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",cookie_name:"",loaded:sh,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:!0,debug:!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:(O==null||(t=O.location)===null||t===void 0?void 0:t.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(i){var n="Bad HTTP status: "+i.status+" "+i.statusText;j.error(n)},get_device_id:function(i){return i},_onCapture:sh,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800}},ah=function(t,e,r,i){var n,s=r!==pt&&Je?r?Je[r]:void 0:Je,a={initComplete:!1,syncCode:!1},o=function(l){return function(h){a[l]||(a[l]=!0,a.initComplete&&a.syncCode&&i?.(h))}};if(s&&gh===Zn.INIT_MODULE)n=s;else{if(s&&!We(s))return void j.error("You have already initialized "+r);n=new yh}return n._init(t,e,r,o("initComplete")),n.toolbar.maybeLoadToolbar(),n.sessionRecording=new uy(n),n.sessionRecording.startRecordingIfEnabled(),n.config.__preview_measure_pageview_stats&&n.pageViewManager.startMeasuringScrollPosition(),n.__autocapture=n.config.autocapture,Er._setIsAutocaptureEnabled(n),Er._isAutocaptureEnabled&&(n.__autocapture=n.config.autocapture,Er.enabledForProject(n.config.token,100,100)?Er.isBrowserSupported()?Er.init(n):(n.__autocapture=!1,j.info("Disabling Automatic Event Collection because this browser is not supported")):(n.__autocapture=!1,j.info("Not in active bucket: disabling Automatic Event Collection."))),oi.DEBUG=oi.DEBUG||n.config.debug,!ve(s)&&We(s)&&(n._execute_array.call(n.people,s.people),n._execute_array(s)),o("syncCode")(n),n},Xy=function(){function t(){Oe(this,t),Y(this,"__forceAllowLocalhost",!1)}return Re(t,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){j.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),t}(),yh=function(){function t(){var e=this;Oe(this,t),Y(this,"webPerformance",new Xy),this.config=gd(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=Ny,this.segmentIntegration=function(){return zy(e)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.analyticsDefaultEndpoint="/e/",this.elementsChainAsString=!1,this.featureFlags=new N0(this),this.toolbar=new gy(this),this.pageViewManager=new jy,this.surveys=new Hy(this),this.rateLimiter=new Uy,this.people={set:function(r,i,n){var s=St(r)?Y({},r,i):r;e.setPersonProperties(s),n?.({})},set_once:function(r,i,n){var s=St(r)?Y({},r,i):r;e.setPersonProperties(void 0,s),n?.({})}}}return Re(t,[{key:"init",value:function(e,r,i){if(ve(i))j.critical("You must name your new library: init(token, config, name)");else{if(i!==pt){var n=ah(e,r,i,function(s){Je[i]=s,s._loaded()});return Je[i]=n,n}j.critical("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var r,i,n,s=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,l=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var h,c={segmentRegister:!1,syncCode:!1},u=function(S){return function(){c[S]||(c[S]=!0,c.segmentRegister&&c.syncCode&&l?.(s))}};if(this.set_config(Ye({},gd(),a,{name:o,token:e,callback_fn:(o===pt?o:pt+"."+o)+"._jsc"})),this._jsc=function(){},(O!=null&&(r=O.rrweb)!==null&&r!==void 0&&r.record||O!=null&&O.rrwebRecord)&&(this.__loaded_recorder_version=O==null||(h=O.rrweb)===null||h===void 0?void 0:h.version),this.persistence=new od(this.config),this._requestQueue=new xy(this._handle_queued_event.bind(this)),this._retryQueue=new Ly(this.config.on_xhr_error,this.rateLimiter),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new Vy(this.config,this.persistence),this.sessionPropsManager=new Zy(this.sessionManager,this.persistence),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new od(ne(ne({},this.config),{},{persistence:"sessionStorage"})),this._gdpr_init(),a.segment?(this.config.get_device_id=function(){return a.segment.user().anonymousId()},a.segment.user().id()&&(this.register({distinct_id:a.segment.user().id()}),this.persistence.set_user_state("identified")),a.segment.register(this.segmentIntegration()).then(u("segmentRegister"))):u("segmentRegister")(),((i=a.bootstrap)===null||i===void 0?void 0:i.distinctID)!==void 0){var f,p,m=this.config.get_device_id(ni()),g=(f=a.bootstrap)!==null&&f!==void 0&&f.isIdentifiedID?m:a.bootstrap.distinctID;this.persistence.set_user_state((p=a.bootstrap)!==null&&p!==void 0&&p.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:g})}if(this._hasBootstrappedFeatureFlags()){var d,y,v=Object.keys(((d=a.bootstrap)===null||d===void 0?void 0:d.featureFlags)||{}).filter(function(S){var T,x;return!((T=a.bootstrap)===null||T===void 0||(x=T.featureFlags)===null||x===void 0||!x[S])}).reduce(function(S,T){var x,w;return S[T]=((x=a.bootstrap)===null||x===void 0||(w=x.featureFlags)===null||w===void 0?void 0:w[T])||!1,S},{}),b=Object.keys(((y=a.bootstrap)===null||y===void 0?void 0:y.featureFlagPayloads)||{}).filter(function(S){return v[S]}).reduce(function(S,T){var x,w,M,k;return(x=a.bootstrap)!==null&&x!==void 0&&(w=x.featureFlagPayloads)!==null&&w!==void 0&&w[T]&&(S[T]=(M=a.bootstrap)===null||M===void 0||(k=M.featureFlagPayloads)===null||k===void 0?void 0:k[T]),S},{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:b})}if(!this.get_distinct_id()){var _=this.config.get_device_id(ni());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_user_state("anonymous")}O==null||(n=O.addEventListener)===null||n===void 0||n.call(O,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),u("syncCode")()}},{key:"_afterDecideResponse",value:function(e){var r;if(this.compression={},e.supportedCompression&&!this.config.disable_compression){var i,n={},s=ai(e.supportedCompression);try{for(s.s();!(i=s.n()).done;)n[i.value]=!0}catch(a){s.e(a)}finally{s.f()}this.compression=n}(r=e.analytics)!==null&&r!==void 0&&r.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),e.elementsChainAsString&&(this.elementsChainAsString=e.elementsChainAsString)}},{key:"_loaded",value:function(){var e=this.config.advanced_disable_decide;e||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(r){j.critical("`loaded` function failed",r)}this._start_queue_if_opted_in(),this.config.capture_pageview&&K&&this.capture("$pageview",{title:K.title},{send_instantly:!0}),e||(new py(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)===null||e===void 0||e.poll())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||Ji(this.__request_queue,function(r){e._send_request.apply(e,Ul(r))}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,r){if(ve(e))return null;if(za)return function(a){e(a,r)};var i=this._jsc,n=""+Math.floor(1e8*Math.random()),s=this.config.callback_fn+"["+n+"]";return i[n]=function(a){delete i[n],e(a,r)},s}},{key:"_handle_unload",value:function(){var e,r;this.config.request_batching?(this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave"),(e=this._requestQueue)===null||e===void 0||e.unload(),(r=this._retryQueue)===null||r===void 0||r.unload()):this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(e,r,i){var n=JSON.stringify(r);this.__compress_and_send_json_request(e,n,i||Oa,sh)}},{key:"__compress_and_send_json_request",value:function(e,r,i,n){var s=function(h,c,u){return h===ii.GZipJS?[$y(Oy(c),{mtime:0}),ne(ne({},u),{},{blob:!0,urlQueryArgs:{compression:ii.GZipJS}})]:[{data:hh(c)},u]}(this.compression[ii.GZipJS]?ii.GZipJS:ii.Base64,r,i),a=zt(s,2),o=a[0],l=a[1];this._send_request(e,o,l,n)}},{key:"_send_request",value:function(e,r,i,n){if(this.__loaded&&this._retryQueue&&!this.rateLimiter.isRateLimited(i._batchKey))if(Gd)this.__request_queue.push([e,r,i,n]);else{var s={method:this.config.api_method,transport:this.config.api_transport,verbose:this.config.verbose};i=Ye(s,i||{}),za||(i.method="GET");var a=O&&"sendBeacon"in O.navigator&&i.transport==="sendBeacon";if(e=zd(e,i.urlQueryArgs||{},{ip:this.config.ip}),a)try{O?.navigator.sendBeacon(e,mh(r,ne(ne({},i),{},{sendBeacon:!0})))}catch{}else if(za||!K)try{jd({url:e,data:r,headers:this.config.xhr_headers,options:i,callback:n,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.config.on_xhr_error,onResponse:this.rateLimiter.checkForLimiting})}catch(c){j.error(c)}else{var o,l=K.createElement("script");l.type="text/javascript",l.async=!0,l.defer=!0,l.src=e;var h=K.getElementsByTagName("script")[0];(o=h.parentNode)===null||o===void 0||o.insertBefore(l,h)}}}},{key:"_execute_array",value:function(e){var r,i=this,n=[],s=[],a=[];Ji(e,function(l){l&&(r=l[0],We(r)?a.push(l):jt(l)?l.call(i):We(l)&&r==="alias"?n.push(l):We(l)&&r.indexOf("capture")!==-1&&jt(i[r])?a.push(l):s.push(l))});var o=function(l,h){Ji(l,function(c){if(We(c[0])){var u=h;Ce(c,function(f){u=u[f[0]].apply(u,f.slice(1))})}else this[c[0]].apply(this,c.slice(1))},h)};o(n,this),o(s,this),o(a,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,r;return((e=this.config.bootstrap)===null||e===void 0?void 0:e.featureFlags)&&Object.keys((r=this.config.bootstrap)===null||r===void 0?void 0:r.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Oa;if(!this.__loaded||!this.sessionPersistence||!this._requestQueue)return j.uninitializedWarning("posthog.capture");if(!function(c){var u=!1;try{var f=c.config.token,p=c.config.respect_dnt,m=c.config.opt_out_capturing_persistence_type,g=c.config.opt_out_capturing_cookie_prefix||void 0,d=c.config.window;f&&(u=ud(f,{respectDnt:p,persistenceType:m,persistencePrefix:g,window:d}))}catch(y){j.error("Unexpected error when checking capturing opt-out status: "+y)}return u}(this)){var n=(i=i||Oa).transport;if(n&&(i.transport=n),!ve(e)&&St(e)){if(!Ge||!Jy(Ge,this.config.custom_blocked_useragents)){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info();var s={uuid:ni(),event:e,properties:this._calculate_event_properties(e,r||{})};e==="$identify"&&(s.$set=i.$set,s.$set_once=i.$set_once),(s=$0(s,i._noTruncate?null:this.config.properties_string_max_length)).timestamp=i.timestamp||new Date;var a=ne(ne({},s.properties.$set),s.$set);D0(a)||this.setPersonPropertiesForFlags(a),j.info("send",s);var o=JSON.stringify(s),l=this.config.api_host+(i.endpoint||this.analyticsDefaultEndpoint),h=i!==Oa;return!this.config.request_batching||h&&!i._batchKey||i.send_instantly?this.__compress_and_send_json_request(l,o,i):this._requestQueue.enqueue(l,s,i),this._invokeCaptureHooks(e,s),s}}else j.error("No event name provided to posthog.capture")}}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,r){this.config._onCapture(e,r),Ce(this.__captureHooks,function(i){return i(e)})}},{key:"_calculate_event_properties",value:function(e,r){if(!this.persistence||!this.sessionPersistence)return r;var i=this.persistence.remove_event_timer(e),n=ne({},r);if(n.token=this.config.token,e==="$snapshot"){var s=ne(ne({},this.persistence.properties()),this.sessionPersistence.properties());return n.distinct_id=s.distinct_id,n}var a=He.properties();if(this.sessionManager){var o=this.sessionManager.checkAndGetSessionAndWindowId(),l=o.sessionId,h=o.windowId;n.$session_id=l,n.$window_id=h}if(this.sessionPropsManager&&this.config.__preview_send_client_session_params&&(e==="$pageview"||e==="$pageleave"||e==="$autocapture")){var c=this.sessionPropsManager.getSessionProps();n=Ye(n,c)}if(this.config.__preview_measure_pageview_stats){var u={};e==="$pageview"?u=this.pageViewManager.doPageView():e==="$pageleave"&&(u=this.pageViewManager.doPageLeave()),n=Ye(n,u)}if(e==="$pageview"&&K&&(n.title=K.title),e==="$performance_event"){var f=this.persistence.properties();return n.distinct_id=f.distinct_id,n.$current_url=a.$current_url,n}if(!ve(i)){var p=new Date().getTime()-i;n.$duration=parseFloat((p/1e3).toFixed(3))}n=Ye({},He.properties(),this.persistence.properties(),this.sessionPersistence.properties(),n);var m=this.config.property_blacklist;We(m)?Ce(m,function(d){delete n[d]}):j.error("Invalid value for property_blacklist config: "+m);var g=this.config.sanitize_properties;return g&&(n=g(n,e)),n}},{key:"register",value:function(e,r){var i;(i=this.persistence)===null||i===void 0||i.register(e,r)}},{key:"register_once",value:function(e,r,i){var n;(n=this.persistence)===null||n===void 0||n.register_once(e,r,i)}},{key:"register_for_session",value:function(e){var r;(r=this.sessionPersistence)===null||r===void 0||r.register(e)}},{key:"unregister",value:function(e){var r;(r=this.persistence)===null||r===void 0||r.unregister(e)}},{key:"unregister_for_session",value:function(e){var r;(r=this.sessionPersistence)===null||r===void 0||r.unregister(e)}},{key:"_register_single",value:function(e,r){this.register(Y({},e,r))}},{key:"getFeatureFlag",value:function(e,r){return this.featureFlags.getFeatureFlag(e,r)}},{key:"getFeatureFlagPayload",value:function(e){var r=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(r)}catch{return r}}},{key:"isFeatureEnabled",value:function(e,r){return this.featureFlags.isFeatureEnabled(e,r)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,r)}},{key:"getEarlyAccessFeatures",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,r)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var r,i;return(r=(i=this.sessionManager)===null||i===void 0?void 0:i.onSessionId(e))!==null&&r!==void 0?r:function(){}}},{key:"getSurveys",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,r)}},{key:"getActiveMatchingSurveys",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,r)}},{key:"identify",value:function(e,r,i){if(!this.__loaded||!this.persistence)return j.uninitializedWarning("posthog.identify");if(e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))j.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else{var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==n&&e!==this.get_property(Ba)&&(this.unregister(Ba),this.register({distinct_id:e}));var a=this.persistence.get_user_state()==="anonymous";e!==n&&a?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags(r||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:r||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(n)):(r||i)&&this.setPersonProperties(r,i),e!==n&&(this.reloadFeatureFlags(),this.unregister(Wa))}else j.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,r){(e||r)&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:r||{}}))}},{key:"group",value:function(e,r,i){if(e&&r){var n=this.getGroups();n[e]!==r&&this.resetGroupPropertiesForFlags(e),this.register({$groups:ne(ne({},n),{},Y({},e,r))}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:r,$group_set:i}),this.setGroupPropertiesForFlags(Y({},e,i))),n[e]===r||i||this.reloadFeatureFlags()}else j.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,r)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setGroupPropertiesForFlags(e,r)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var r,i,n,s;if(!this.__loaded)return j.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");(r=this.persistence)===null||r===void 0||r.clear(),(i=this.sessionPersistence)===null||i===void 0||i.clear(),(n=this.persistence)===null||n===void 0||n.set_user_state("anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId();var o=this.config.get_device_id(ni());this.register_once({distinct_id:o,$device_id:e?o:a},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,r;return(e=(r=this.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var r=this.config.ui_host||this.config.api_host,i=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=i.sessionId,s=i.sessionStartTimestamp,a=r+"/replay/"+n;if(e!=null&&e.withTimestamp&&s){var o,l=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!s)return a;var h=Math.max(Math.floor((new Date().getTime()-s)/1e3)-l,0);a+="?t=".concat(h)}return a}},{key:"alias",value:function(e,r){return e===this.get_property(Td)?(j.critical("Attempting to create alias for existing People user - aborting."),-2):(ve(r)&&(r=this.get_distinct_id()),e!==r?(this._register_single(Ba,e),this.capture("$create_alias",{alias:e,distinct_id:r})):(j.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var r,i,n=ne({},this.config);Pr(e)&&(Ye(this.config,e),this.config.persistence_name||(this.config.persistence_name=this.config.cookie_name),this.config.disable_persistence||(this.config.disable_persistence=this.config.disable_cookie),this.config.api_host=this.config.api_host.replace(/\/$/,""),(r=this.persistence)===null||r===void 0||r.update_config(this.config),(i=this.sessionPersistence)===null||i===void 0||i.update_config(this.config),Le.is_supported()&&Le.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(oi.DEBUG=!0),this.sessionRecording&&!ve(e.disable_session_recording)&&n.disable_session_recording!==e.disable_session_recording&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!((e=this.sessionRecording)===null||e===void 0||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var r;return(r=this.persistence)===null||r===void 0?void 0:r.props[e]}},{key:"getSessionProperty",value:function(e){var r;return(r=this.sessionPersistence)===null||r===void 0?void 0:r.props[e]}},{key:"toString",value:function(){var e,r=(e=this.config.name)!==null&&e!==void 0?e:pt;return r!==pt&&(r=pt+"."+r),r}},{key:"_gdpr_init",value:function(){this.config.opt_out_capturing_persistence_type==="localStorage"&&Le.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.config.opt_out_capturing_by_default&&!Jt.get("ph_optout")||(Jt.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.config.opt_out_persistence_by_default}))}},{key:"_gdpr_update_persistence",value:function(e){var r,i,n,s,a;if(e&&e.clear_persistence)n=!0;else{if(!e||!e.enable_persistence)return;n=!1}this.config.disable_persistence||((r=this.persistence)===null||r===void 0?void 0:r.disabled)===n||(s=this.persistence)===null||s===void 0||s.set_disabled(n),this.config.disable_persistence||((i=this.sessionPersistence)===null||i===void 0?void 0:i.disabled)===n||(a=this.sessionPersistence)===null||a===void 0||a.set_disabled(n)}},{key:"_gdpr_call_func",value:function(e,r){return r=Ye({capture:this.capture.bind(this),persistence_type:this.config.opt_out_capturing_persistence_type,cookie_prefix:this.config.opt_out_capturing_cookie_prefix,cookie_expiration:this.config.cookie_expiration,cross_subdomain_cookie:this.config.cross_subdomain_cookie,secure_cookie:this.config.secure_cookie},r||{}),Le.is_supported()||r.persistence_type!=="localStorage"||(r.persistence_type="cookie"),e(this.config.token,{capture:r.capture,captureEventName:r.capture_event_name,captureProperties:r.capture_properties,persistenceType:r.persistence_type,persistencePrefix:r.cookie_prefix,cookieExpiration:r.cookie_expiration,crossSubdomainCookie:r.cross_subdomain_cookie,secureCookie:r.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=Ye({enable_persistence:!0},e||{}),this._gdpr_call_func(vy,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var r=Ye({clear_persistence:!0},e||{});this._gdpr_call_func(by,r),this._gdpr_update_persistence(r)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(_y,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(ud,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var r=Ye({enable_persistence:!0},e??{});this._gdpr_call_func(wy,r),this._gdpr_update_persistence(r)}},{key:"debug",value:function(e){e===!1?(O?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(O?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),t}();(function(t,e){for(var r=0;r<e.length;r++)t.prototype[e[r]]=Ed(t.prototype[e[r]])})(yh,["identify"]);var yd,vd,Sr={},Ky=function(){Je.init=function(t,e,r){if(r)return Je[r]||(Je[r]=Sr[r]=ah(t||"",e||{},r,function(n){Je[r]=Sr[r]=n,n._loaded()})),Je[r];var i=Je;return Sr[pt]?i=Sr[pt]:t&&(i=ah(t,e||{},pt,function(n){Sr[pt]=n,n._loaded()}),Sr[pt]=i),Je=i,gh===Zn.INIT_SNIPPET&&(tt[pt]=Je),Ce(Sr,function(n,s){s!==pt&&(Je[s]=n)}),i}},Qy=function(){function t(){t.done||(t.done=!0,Gd=!1,Ce(Sr,function(e){e._dom_loaded()}))}K!=null&&K.addEventListener&&(K.readyState==="complete"?t():K.addEventListener("DOMContentLoaded",t,!1)),O&&qn(O,"load",t,!0)};(function(t){t.Popover="popover",t.API="api",t.Widget="widget"})(yd||(yd={})),function(t){t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link"}(vd||(vd={}));var Hd=(gh=Zn.INIT_MODULE,Je=new yh,Ky(),Je.init(),Qy(),Je);var qd=Hd.init("phc_OTZ3wJ6VemgVupCRKS5Sbqb9Ks0JYe0hMYZPtLwl0nu",{api_host:"https://pheu.molin.ai",ui_host:"https://eu.posthog.com",secure_cookie:document.location.protocol==="https:",persistence:"cookie",autocapture:!1,rageclick:!1,capture_pageview:!0,disable_session_recording:!0},"MolinShopAI");function dt(t,e){if(!qd)throw new Error("Failed to initialize PostHog");qd.capture(t,e)}var Ki,Ka,$t,Be,Qa,Ud,eo,Wd,to,Zd,ro,Yd,io,Jd,no,Xd,so,Kd,ao,Qd,Xa=class extends Fe(Pe){constructor(){super();W(this,Ki);W(this,Qa);W(this,eo);W(this,to);W(this,ro);W(this,io);W(this,no);W(this,so);W(this,ao);W(this,$t,new Ta(this,{url:(r,{resume:i}={})=>{let n=new URL(this.config.wsApiUrl);return n.searchParams.set("widgetId",this.widgetId),n.searchParams.set("resume",i?"1":""),n.searchParams.set("conversationId",r),n.searchParams.set("pageUrl",window.location.href),n},onReconnect:()=>{},onError:r=>{console.error("ws error",r),dt("ShopAssistant: error",{widgetId:this.widgetId,error:"websocket onError"})},onClose:()=>{},onNewMessage:r=>{r.role==="assistant"&&dt("ShopAssistant: user received bot message (streaming started)",{widgetId:this.widgetId,message:r})},onUpdateMessage:r=>{},onMessageDone:r=>{let i={...L(this,$t)?.messages.find(n=>n.id===r.message?.id)};Object.assign(i,r.message),i.role==="assistant"&&dt("ShopAssistant: user received bot message (streaming ended)",{widgetId:this.widgetId,text:i.content??"",message:i,usage_TOKENS_COMPLETION:r.message.usage.TOKENS_COMPLETION})},onMessageError:r=>{console.error("ws message error",r),r.message&&L(this,Be)&&alert(r.message),dt("ShopAssistant: error",{widgetId:this.widgetId,error:"websocket ERROR message type: "+r.message})},persistConversationState:(r,i)=>{let n={conversationId:r,messages:i};localStorage.setItem(L(this,Ki,Ka),JSON.stringify(n))},restoreConversationState:()=>{try{let r=JSON.parse(localStorage.getItem(L(this,Ki,Ka))||"{}");return!(typeof r.conversationId=="string"&&r.conversationId)||!(Array.isArray(r.messages)&&r.messages.every(i=>typeof i=="object"&&i))?void 0:{conversationId:r.conversationId,messages:r.messages}}catch(r){console.error(r)}},onReset:()=>{localStorage.removeItem(L(this,Ki,Ka))}}));W(this,Be,!1);this.widgetId="",this.config}render(){console.assert(this.widgetId,"widget id is required"),console.assert(this.config,"config is required");let r=Object.entries(this.config.bubble.position).filter(([a,o])=>o).map(([a,o])=>`${a}-[${o}]`).reduce((a,o)=>(a[o]=!0,a),{}),i={bottom:"72px"},n=Object.entries(this.config.bubble.position).filter(([a,o])=>o).map(([a,o])=>`sm:${a}-[calc(${[i[a],o].filter(l=>!!l).join("+")})]`).reduce((a,o)=>(a[o]=!0,a),{}),s=n;return ye`
421
+ <mw-bubble class="${Bp(r)} fixed z-[2147483647]" @click=${ue(this,ro,Yd)} ?dialog-shown="${L(this,Be)}" bubble-image-url="${this.config.bubble?.imageUrl||""}"></mw-bubble>
422
422
 
423
423
  ${this.config?.popup?.mobileEnabled||this.config?.popup?.desktopEnabled?ye`
424
424
  <!-- -->
425
425
  <mw-popup class="${this.config?.popup?.mobileEnabled?"visible":"invisible"} ${this.config?.popup?.desktopEnabled?"sm:visible":"sm:invisible"}" .position="${s}" ai-name="${this.config.title}" ai-color="${this.config.color}" ?dialog-shown="${L(this,Be)}" popup-delay-ms="${Fl(this.config.popup?.delayMs)}" popup-text="${Fl(this.config.popup?.text)}" @popup-chat-open="${ue(this,eo,Wd)}"></mw-popup>
426
426
  `:""}
427
427
 
428
- <div id="dialog" class="${L(this,Be)?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${Object.keys(n).join(" ")} fixed bottom-0 left-0 right-0 top-0 z-[99999999] overflow-hidden bg-white font-sans text-[16px] leading-normal text-gray-800 subpixel-antialiased shadow-2xl transition-all sm:left-auto sm:top-auto sm:h-4/5 sm:max-h-[800px] sm:w-5/6 sm:max-w-[400px] sm:rounded-2xl 2xl:max-w-[420px]">
428
+ <div id="dialog" class="${L(this,Be)?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${Object.keys(n).join(" ")} fixed bottom-0 left-0 right-0 top-0 z-[2147483647] overflow-hidden bg-white font-sans text-[16px] leading-normal text-gray-800 subpixel-antialiased shadow-2xl transition-all sm:left-auto sm:top-auto sm:h-4/5 sm:max-h-[800px] sm:w-5/6 sm:max-w-[400px] sm:rounded-2xl 2xl:max-w-[420px]">
429
429
  <div class="mx-auto flex h-full w-full max-w-4xl flex-col">
430
430
  <mw-header class="z-10 border-b bg-[${this.config.header.background}] text-lg" .messages="${L(this,$t).messages.length}" .config="${this.config}" @mw-close="${ue(this,io,Jd)}" @mw-delete-history="${ue(this,no,Xd)}"></mw-header>
431
431