@bymos/agentkit-sdk 0.1.5 → 0.3.1

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,9 +1,9 @@
1
- var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T,pe)=>T in re?Zo(re,T,{enumerable:!0,configurable:!0,writable:!0,value:pe}):re[T]=pe;var me=(re,T,pe)=>Vo(re,typeof T!="symbol"?T+"":T,pe);var T;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function n(a){throw new Error}t.assertNever=n,t.arrayToEnum=a=>{const i={};for(const s of a)i[s]=s;return i},t.getValidEnumValues=a=>{const i=t.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),s={};for(const o of i)s[o]=a[o];return t.objectValues(s)},t.objectValues=a=>t.objectKeys(a).map(function(i){return a[i]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&i.push(s);return i},t.find=(a,i)=>{for(const s of a)if(i(s))return s},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(T||(T={}));var pe;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(pe||(pe={}));const k=T.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),de=t=>{switch(typeof t){case"undefined":return k.undefined;case"string":return k.string;case"number":return Number.isNaN(t)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":return Array.isArray(t)?k.array:t===null?k.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?k.promise:typeof Map<"u"&&t instanceof Map?k.map:typeof Set<"u"&&t instanceof Set?k.set:typeof Date<"u"&&t instanceof Date?k.date:k.object;default:return k.unknown}},p=T.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"]);class ae extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},a=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(a);else if(s.code==="invalid_return_type")a(s.returnTypeError);else if(s.code==="invalid_arguments")a(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let o=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(n(s))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return a(this),r}static assert(e){if(!(e instanceof ae))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,T.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];n[i]=n[i]||[],n[i].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}ae.create=t=>new ae(t);const ut=(t,e)=>{let n;switch(t.code){case p.invalid_type:t.received===k.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case p.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,T.jsonStringifyReplacer)}`;break;case p.unrecognized_keys:n=`Unrecognized key(s) in object: ${T.joinValues(t.keys,", ")}`;break;case p.invalid_union:n="Invalid input";break;case p.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${T.joinValues(t.options)}`;break;case p.invalid_enum_value:n=`Invalid enum value. Expected ${T.joinValues(t.options)}, received '${t.received}'`;break;case p.invalid_arguments:n="Invalid function arguments";break;case p.invalid_return_type:n="Invalid function return type";break;case p.invalid_date:n="Invalid date";break;case p.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:T.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case p.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case p.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case p.custom:n="Invalid input";break;case p.invalid_intersection_types:n="Intersection results could not be merged";break;case p.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case p.not_finite:n="Number must be finite";break;default:n=e.defaultError,T.assertNever(t)}return{message:n}};let Mr=ut;function jr(){return Mr}const Or=t=>{const{data:e,path:n,errorMaps:r,issueData:a}=t,i=[...n,...a.path||[]],s={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let o="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)o=c(s,{data:e,defaultError:o}).message;return{...a,path:i,message:o}};function g(t,e){const n=jr(),r=Or({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ut?void 0:ut].filter(a=>!!a)});t.common.issues.push(r)}class F{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const a of n){if(a.status==="aborted")return S;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const a of n){const i=await a.key,s=await a.value;r.push({key:i,value:s})}return F.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const a of n){const{key:i,value:s}=a;if(i.status==="aborted"||s.status==="aborted")return S;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||a.alwaysSet)&&(r[i.value]=s.value)}return{status:e.value,value:r}}}const S=Object.freeze({status:"aborted"}),Te=t=>({status:"dirty",value:t}),B=t=>({status:"valid",value:t}),zt=t=>t.status==="aborted",Dt=t=>t.status==="dirty",ye=t=>t.status==="valid",Ue=t=>typeof Promise<"u"&&t instanceof Promise;var b;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(b||(b={}));class q{constructor(e,n,r,a){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Bt=(t,e)=>{if(ye(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;const n=new ae(t.common.issues);return this._error=n,this._error}}};function L(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:a}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(s,o)=>{const{message:l}=t;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??r??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??n??o.defaultError}},description:a}}class A{get description(){return this._def.description}_getType(e){return de(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:de(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new F,ctx:{common:e.parent.common,data:e.data,parsedType:de(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Ue(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:de(e)},a=this._parseSync({data:e,path:r.path,parent:r});return Bt(r,a)}"~validate"(e){var r,a;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:de(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return ye(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(a=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>ye(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:de(e)},a=this._parse({data:e,path:r.path,parent:r}),i=await(Ue(a)?a:Promise.resolve(a));return Bt(r,i)}refine(e,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const s=e(a),o=()=>i.addIssue({code:p.custom,...r(a)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(e){return new xe({schema:this,typeName:w.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return fe.create(this,this._def)}nullable(){return we.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ee.create(this)}promise(){return He.create(this,this._def)}or(e){return De.create([this,e],this._def)}and(e){return Be.create(this,e,this._def)}transform(e){return new xe({...L(this._def),schema:this,typeName:w.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new gt({...L(this._def),innerType:this,defaultValue:n,typeName:w.ZodDefault})}brand(){return new aa({typeName:w.ZodBranded,type:this,...L(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new _t({...L(this._def),innerType:this,catchValue:n,typeName:w.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return vt.create(this,e)}readonly(){return yt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Pr=/^c[^\s-]{8,}$/i,Zr=/^[0-9a-z]+$/,Vr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Fr=/^[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,Wr=/^[a-z0-9_-]{21}$/i,$r=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ur=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,zr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Dr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ft;const Br=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Gr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Hr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Yr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Xr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Jr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Gt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Kr=new RegExp(`^${Gt}$`);function Ht(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Qr(t){return new RegExp(`^${Ht(t)}$`)}function qr(t){let e=`${Gt}T${Ht(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function ea(t,e){return!!((e==="v4"||!e)&&Br.test(t)||(e==="v6"||!e)&&Hr.test(t))}function ta(t,e){if(!$r.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function na(t,e){return!!((e==="v4"||!e)&&Gr.test(t)||(e==="v6"||!e)&&Yr.test(t))}class ie extends A{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==k.string){const i=this._getOrReturnCtx(e);return g(i,{code:p.invalid_type,expected:k.string,received:i.parsedType}),S}const r=new F;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:p.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:p.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,o=e.data.length<i.value;(s||o)&&(a=this._getOrReturnCtx(e,a),s?g(a,{code:p.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&g(a,{code:p.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")zr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"email",code:p.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")ft||(ft=new RegExp(Dr,"u")),ft.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"emoji",code:p.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")Fr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"uuid",code:p.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Wr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"nanoid",code:p.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")Pr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"cuid",code:p.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")Zr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"cuid2",code:p.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Vr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"ulid",code:p.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),g(a,{validation:"url",code:p.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"regex",code:p.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),g(a,{code:p.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),g(a,{code:p.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),g(a,{code:p.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?qr(i).test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:p.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Kr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:p.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?Qr(i).test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:p.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Ur.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"duration",code:p.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?ea(e.data,i.version)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"ip",code:p.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?ta(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"jwt",code:p.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?na(e.data,i.version)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"cidr",code:p.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Xr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"base64",code:p.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?Jr.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"base64url",code:p.invalid_string,message:i.message}),r.dirty()):T.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(a=>e.test(a),{validation:n,code:p.invalid_string,...b.errToObj(r)})}_addCheck(e){return new ie({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...b.errToObj(e)})}url(e){return this._addCheck({kind:"url",...b.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...b.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...b.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...b.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...b.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...b.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...b.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...b.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...b.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...b.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...b.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...b.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...b.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...b.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...b.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...b.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...b.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...b.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...b.errToObj(n)})}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new ie({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ie({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ie({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}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 isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}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 isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}ie.create=t=>new ie({checks:[],typeName:w.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...L(t)});function ra(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=n>r?n:r,i=Number.parseInt(t.toFixed(a).replace(".","")),s=Number.parseInt(e.toFixed(a).replace(".",""));return i%s/10**a}class Le extends A{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)!==k.number){const i=this._getOrReturnCtx(e);return g(i,{code:p.invalid_type,expected:k.number,received:i.parsedType}),S}let r;const a=new F;for(const i of this._def.checks)i.kind==="int"?T.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),g(r,{code:p.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),g(r,{code:p.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),g(r,{code:p.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?ra(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),g(r,{code:p.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),g(r,{code:p.not_finite,message:i.message}),a.dirty()):T.assertNever(i);return{status:a.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,b.toString(n))}gt(e,n){return this.setLimit("min",e,!1,b.toString(n))}lte(e,n){return this.setLimit("max",e,!0,b.toString(n))}lt(e,n){return this.setLimit("max",e,!1,b.toString(n))}setLimit(e,n,r,a){return new Le({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:b.toString(a)}]})}_addCheck(e){return new Le({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&T.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Le.create=t=>new Le({checks:[],typeName:w.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});class Ae extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==k.bigint)return this._getInvalidInput(e);let r;const a=new F;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),g(r,{code:p.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),g(r,{code:p.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),g(r,{code:p.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):T.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return g(n,{code:p.invalid_type,expected:k.bigint,received:n.parsedType}),S}gte(e,n){return this.setLimit("min",e,!0,b.toString(n))}gt(e,n){return this.setLimit("min",e,!1,b.toString(n))}lte(e,n){return this.setLimit("max",e,!0,b.toString(n))}lt(e,n){return this.setLimit("max",e,!1,b.toString(n))}setLimit(e,n,r,a){return new Ae({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:b.toString(a)}]})}_addCheck(e){return new Ae({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Ae.create=t=>new Ae({checks:[],typeName:w.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...L(t)});class ht extends A{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==k.boolean){const r=this._getOrReturnCtx(e);return g(r,{code:p.invalid_type,expected:k.boolean,received:r.parsedType}),S}return B(e.data)}}ht.create=t=>new ht({typeName:w.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});class ze extends A{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==k.date){const i=this._getOrReturnCtx(e);return g(i,{code:p.invalid_type,expected:k.date,received:i.parsedType}),S}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return g(i,{code:p.invalid_date}),S}const r=new F;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:p.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:p.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):T.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ze({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}ze.create=t=>new ze({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:w.ZodDate,...L(t)});class Yt extends A{_parse(e){if(this._getType(e)!==k.symbol){const r=this._getOrReturnCtx(e);return g(r,{code:p.invalid_type,expected:k.symbol,received:r.parsedType}),S}return B(e.data)}}Yt.create=t=>new Yt({typeName:w.ZodSymbol,...L(t)});class Xt extends A{_parse(e){if(this._getType(e)!==k.undefined){const r=this._getOrReturnCtx(e);return g(r,{code:p.invalid_type,expected:k.undefined,received:r.parsedType}),S}return B(e.data)}}Xt.create=t=>new Xt({typeName:w.ZodUndefined,...L(t)});class Jt extends A{_parse(e){if(this._getType(e)!==k.null){const r=this._getOrReturnCtx(e);return g(r,{code:p.invalid_type,expected:k.null,received:r.parsedType}),S}return B(e.data)}}Jt.create=t=>new Jt({typeName:w.ZodNull,...L(t)});class Kt extends A{constructor(){super(...arguments),this._any=!0}_parse(e){return B(e.data)}}Kt.create=t=>new Kt({typeName:w.ZodAny,...L(t)});class mt extends A{constructor(){super(...arguments),this._unknown=!0}_parse(e){return B(e.data)}}mt.create=t=>new mt({typeName:w.ZodUnknown,...L(t)});class ue extends A{_parse(e){const n=this._getOrReturnCtx(e);return g(n,{code:p.invalid_type,expected:k.never,received:n.parsedType}),S}}ue.create=t=>new ue({typeName:w.ZodNever,...L(t)});class Qt extends A{_parse(e){if(this._getType(e)!==k.undefined){const r=this._getOrReturnCtx(e);return g(r,{code:p.invalid_type,expected:k.void,received:r.parsedType}),S}return B(e.data)}}Qt.create=t=>new Qt({typeName:w.ZodVoid,...L(t)});class ee extends A{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),a=this._def;if(n.parsedType!==k.array)return g(n,{code:p.invalid_type,expected:k.array,received:n.parsedType}),S;if(a.exactLength!==null){const s=n.data.length>a.exactLength.value,o=n.data.length<a.exactLength.value;(s||o)&&(g(n,{code:s?p.too_big:p.too_small,minimum:o?a.exactLength.value:void 0,maximum:s?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(g(n,{code:p.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(g(n,{code:p.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,o)=>a.type._parseAsync(new q(n,s,n.path,o)))).then(s=>F.mergeArray(r,s));const i=[...n.data].map((s,o)=>a.type._parseSync(new q(n,s,n.path,o)));return F.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new ee({...this._def,minLength:{value:e,message:b.toString(n)}})}max(e,n){return new ee({...this._def,maxLength:{value:e,message:b.toString(n)}})}length(e,n){return new ee({...this._def,exactLength:{value:e,message:b.toString(n)}})}nonempty(e){return this.min(1,e)}}ee.create=(t,e)=>new ee({type:t,minLength:null,maxLength:null,exactLength:null,typeName:w.ZodArray,...L(e)});function ke(t){if(t instanceof O){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=fe.create(ke(r))}return new O({...t._def,shape:()=>e})}else return t instanceof ee?new ee({...t._def,type:ke(t.element)}):t instanceof fe?fe.create(ke(t.unwrap())):t instanceof we?we.create(ke(t.unwrap())):t instanceof ge?ge.create(t.items.map(e=>ke(e))):t}class O extends A{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=T.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==k.object){const c=this._getOrReturnCtx(e);return g(c,{code:p.invalid_type,expected:k.object,received:c.parsedType}),S}const{status:r,ctx:a}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof ue&&this._def.unknownKeys==="strip"))for(const c in a.data)s.includes(c)||o.push(c);const l=[];for(const c of s){const u=i[c],d=a.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new q(a,d,a.path,c)),alwaysSet:c in a.data})}if(this._def.catchall instanceof ue){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:a.data[u]}});else if(c==="strict")o.length>0&&(g(a,{code:p.unrecognized_keys,keys:o}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of o){const d=a.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new q(a,d,a.path,u)),alwaysSet:u in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,m=await u.value;c.push({key:d,value:m,alwaysSet:u.alwaysSet})}return c}).then(c=>F.mergeObjectSync(r,c)):F.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new O({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s;const a=((s=(i=this._def).errorMap)==null?void 0:s.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:b.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new O({...this._def,unknownKeys:"strip"})}passthrough(){return new O({...this._def,unknownKeys:"passthrough"})}extend(e){return new O({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new O({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:w.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new O({...this._def,catchall:e})}pick(e){const n={};for(const r of T.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new O({...this._def,shape:()=>n})}omit(e){const n={};for(const r of T.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new O({...this._def,shape:()=>n})}deepPartial(){return ke(this)}partial(e){const n={};for(const r of T.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?n[r]=a:n[r]=a.optional()}return new O({...this._def,shape:()=>n})}required(e){const n={};for(const r of T.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof fe;)i=i._def.innerType;n[r]=i}return new O({...this._def,shape:()=>n})}keyof(){return nn(T.objectKeys(this.shape))}}O.create=(t,e)=>new O({shape:()=>t,unknownKeys:"strip",catchall:ue.create(),typeName:w.ZodObject,...L(e)}),O.strictCreate=(t,e)=>new O({shape:()=>t,unknownKeys:"strict",catchall:ue.create(),typeName:w.ZodObject,...L(e)}),O.lazycreate=(t,e)=>new O({shape:t,unknownKeys:"strip",catchall:ue.create(),typeName:w.ZodObject,...L(e)});class De extends A{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function a(i){for(const o of i)if(o.result.status==="valid")return o.result;for(const o of i)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const s=i.map(o=>new ae(o.ctx.common.issues));return g(n,{code:p.invalid_union,unionErrors:s}),S}if(n.common.async)return Promise.all(r.map(async i=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(a);{let i;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const o=s.map(l=>new ae(l));return g(n,{code:p.invalid_union,unionErrors:o}),S}}get options(){return this._def.options}}De.create=(t,e)=>new De({options:t,typeName:w.ZodUnion,...L(e)});function pt(t,e){const n=de(t),r=de(e);if(t===e)return{valid:!0,data:t};if(n===k.object&&r===k.object){const a=T.objectKeys(e),i=T.objectKeys(t).filter(o=>a.indexOf(o)!==-1),s={...t,...e};for(const o of i){const l=pt(t[o],e[o]);if(!l.valid)return{valid:!1};s[o]=l.data}return{valid:!0,data:s}}else if(n===k.array&&r===k.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let i=0;i<t.length;i++){const s=t[i],o=e[i],l=pt(s,o);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return n===k.date&&r===k.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Be extends A{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),a=(i,s)=>{if(zt(i)||zt(s))return S;const o=pt(i.value,s.value);return o.valid?((Dt(i)||Dt(s))&&n.dirty(),{status:n.value,value:o.data}):(g(r,{code:p.invalid_intersection_types}),S)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,s])=>a(i,s)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Be.create=(t,e,n)=>new Be({left:t,right:e,typeName:w.ZodIntersection,...L(n)});class ge extends A{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==k.array)return g(r,{code:p.invalid_type,expected:k.array,received:r.parsedType}),S;if(r.data.length<this._def.items.length)return g(r,{code:p.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S;!this._def.rest&&r.data.length>this._def.items.length&&(g(r,{code:p.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new q(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>F.mergeArray(n,s)):F.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new ge({...this._def,rest:e})}}ge.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ge({items:t,typeName:w.ZodTuple,rest:null,...L(e)})};class Ge extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==k.object)return g(r,{code:p.invalid_type,expected:k.object,received:r.parsedType}),S;const a=[],i=this._def.keyType,s=this._def.valueType;for(const o in r.data)a.push({key:i._parse(new q(r,o,r.path,o)),value:s._parse(new q(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?F.mergeObjectAsync(n,a):F.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof A?new Ge({keyType:e,valueType:n,typeName:w.ZodRecord,...L(r)}):new Ge({keyType:ie.create(),valueType:e,typeName:w.ZodRecord,...L(n)})}}class qt extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==k.map)return g(r,{code:p.invalid_type,expected:k.map,received:r.parsedType}),S;const a=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([o,l],c)=>({key:a._parse(new q(r,o,r.path,[c,"key"])),value:i._parse(new q(r,l,r.path,[c,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return S;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return S;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}}}}qt.create=(t,e,n)=>new qt({valueType:e,keyType:t,typeName:w.ZodMap,...L(n)});class Re extends A{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==k.set)return g(r,{code:p.invalid_type,expected:k.set,received:r.parsedType}),S;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(g(r,{code:p.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(g(r,{code:p.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return S;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const o=[...r.data.values()].map((l,c)=>i._parse(new q(r,l,r.path,c)));return r.common.async?Promise.all(o).then(l=>s(l)):s(o)}min(e,n){return new Re({...this._def,minSize:{value:e,message:b.toString(n)}})}max(e,n){return new Re({...this._def,maxSize:{value:e,message:b.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Re.create=(t,e)=>new Re({valueType:t,minSize:null,maxSize:null,typeName:w.ZodSet,...L(e)});class en extends A{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}en.create=(t,e)=>new en({getter:t,typeName:w.ZodLazy,...L(e)});class tn extends A{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return g(n,{received:n.data,code:p.invalid_literal,expected:this._def.value}),S}return{status:"valid",value:e.data}}get value(){return this._def.value}}tn.create=(t,e)=>new tn({value:t,typeName:w.ZodLiteral,...L(e)});function nn(t,e){return new be({values:t,typeName:w.ZodEnum,...L(e)})}class be extends A{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return g(n,{expected:T.joinValues(r),received:n.parsedType,code:p.invalid_type}),S}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return g(n,{received:n.data,code:p.invalid_enum_value,options:r}),S}return B(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return be.create(e,{...this._def,...n})}exclude(e,n=this._def){return be.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}be.create=nn;class rn extends A{_parse(e){const n=T.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==k.string&&r.parsedType!==k.number){const a=T.objectValues(n);return g(r,{expected:T.joinValues(a),received:r.parsedType,code:p.invalid_type}),S}if(this._cache||(this._cache=new Set(T.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=T.objectValues(n);return g(r,{received:r.data,code:p.invalid_enum_value,options:a}),S}return B(e.data)}get enum(){return this._def.values}}rn.create=(t,e)=>new rn({values:t,typeName:w.ZodNativeEnum,...L(e)});class He extends A{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==k.promise&&n.common.async===!1)return g(n,{code:p.invalid_type,expected:k.promise,received:n.parsedType}),S;const r=n.parsedType===k.promise?n.data:Promise.resolve(n.data);return B(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}He.create=(t,e)=>new He({type:t,typeName:w.ZodPromise,...L(e)});class xe extends A{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:s=>{g(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const s=a.transform(r.data,i);if(r.common.async)return Promise.resolve(s).then(async o=>{if(n.value==="aborted")return S;const l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?S:l.status==="dirty"||n.value==="dirty"?Te(l.value):l});{if(n.value==="aborted")return S;const o=this._def.schema._parseSync({data:s,path:r.path,parent:r});return o.status==="aborted"?S:o.status==="dirty"||n.value==="dirty"?Te(o.value):o}}if(a.type==="refinement"){const s=o=>{const l=a.refinement(o,i);if(r.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(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?S:(o.status==="dirty"&&n.dirty(),s(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?S:(o.status==="dirty"&&n.dirty(),s(o.value).then(()=>({status:n.value,value:o.value}))))}if(a.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ye(s))return S;const o=a.transform(s.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>ye(s)?Promise.resolve(a.transform(s.value,i)).then(o=>({status:n.value,value:o})):S);T.assertNever(a)}}xe.create=(t,e,n)=>new xe({schema:t,typeName:w.ZodEffects,effect:e,...L(n)}),xe.createWithPreprocess=(t,e,n)=>new xe({schema:e,effect:{type:"preprocess",transform:t},typeName:w.ZodEffects,...L(n)});class fe extends A{_parse(e){return this._getType(e)===k.undefined?B(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}fe.create=(t,e)=>new fe({innerType:t,typeName:w.ZodOptional,...L(e)});class we extends A{_parse(e){return this._getType(e)===k.null?B(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}we.create=(t,e)=>new we({innerType:t,typeName:w.ZodNullable,...L(e)});class gt extends A{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===k.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}gt.create=(t,e)=>new gt({innerType:t,typeName:w.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});class _t extends A{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ue(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ae(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ae(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}_t.create=(t,e)=>new _t({innerType:t,typeName:w.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});class an extends A{_parse(e){if(this._getType(e)!==k.nan){const r=this._getOrReturnCtx(e);return g(r,{code:p.invalid_type,expected:k.nan,received:r.parsedType}),S}return{status:"valid",value:e.data}}}an.create=t=>new an({typeName:w.ZodNaN,...L(t)});class aa extends A{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class vt extends A{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?S:i.status==="dirty"?(n.dirty(),Te(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?S:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,n){return new vt({in:e,out:n,typeName:w.ZodPipeline})}}class yt extends A{_parse(e){const n=this._def.innerType._parse(e),r=a=>(ye(a)&&(a.value=Object.freeze(a.value)),a);return Ue(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}yt.create=(t,e)=>new yt({innerType:t,typeName:w.ZodReadonly,...L(e)});var w;(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"})(w||(w={}));const V=ie.create,ia=ht.create,sa=mt.create;ue.create,ee.create;const sn=O.create;De.create,Be.create,ge.create;const oa=Ge.create,on=be.create;He.create,fe.create,we.create;const ca=sn({mode:on(["light","dark","system"]).optional(),accentColor:V().optional(),fontFamily:V().optional(),borderRadius:V().optional()}),cn=sn({agentId:V().min(1,"agentId is required"),apiBaseUrl:V().url("apiBaseUrl must be a valid URL"),tenantId:V().optional(),userId:V().optional(),name:V().optional(),email:V().optional(),authUserId:V().optional(),sessionId:V().optional(),mode:on(["floating","inline"]).optional(),title:V().optional(),subtitle:V().optional(),greeting:V().optional(),avatarUrl:V().optional(),privacyPolicyUrl:V().optional(),streaming:ia().optional(),metadata:oa(sa()).optional(),theme:ca.optional()}),la=cn.omit({agentId:!0,apiBaseUrl:!0}).partial(),_e={mode:"floating",streaming:!0,title:"AI Assistant",theme:{mode:"light",accentColor:"#6366f1",fontFamily:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",borderRadius:"12px"}};function Ee(t,e){var o,l,c,u;cn.parse(t);let n;const r=e?{...e}:void 0;r&&typeof r.theme=="object"&&r.theme!==null?(n=r.theme,delete r.theme):r&&typeof r.theme=="string"&&(n={mode:r.theme},delete r.theme);const a=r?la.passthrough().safeParse(r).data:void 0,i=a?ln(a,t):t,s={mode:((o=i.theme)==null?void 0:o.mode)??(n==null?void 0:n.mode)??_e.theme.mode,accentColor:((l=i.theme)==null?void 0:l.accentColor)??(n==null?void 0:n.accentColor)??_e.theme.accentColor,fontFamily:((c=i.theme)==null?void 0:c.fontFamily)??(n==null?void 0:n.fontFamily)??_e.theme.fontFamily,borderRadius:((u=i.theme)==null?void 0:u.borderRadius)??(n==null?void 0:n.borderRadius)??_e.theme.borderRadius};return{agentId:i.agentId,apiBaseUrl:i.apiBaseUrl.replace(/\/$/,""),tenantId:i.tenantId,userId:i.userId,name:i.name,email:i.email,authUserId:i.authUserId,sessionId:i.sessionId,mode:i.mode??_e.mode,title:i.title??_e.title,subtitle:i.subtitle,greeting:i.greeting,avatarUrl:i.avatarUrl,privacyPolicyUrl:i.privacyPolicyUrl,streaming:i.streaming??_e.streaming,metadata:i.metadata??{},theme:s,thinkingEnabled:(a==null?void 0:a.thinkingEnabled)===!0,thinkingViewable:(a==null?void 0:a.thinkingViewable)===!0}}function ln(t,e){const n={...t};for(const r of Object.keys(e)){const a=e[r];a!=null&&(typeof a=="object"&&!Array.isArray(a)&&n[r]!==null&&typeof n[r]=="object"?n[r]=ln(n[r],a):n[r]=a)}return n}var kt=function(){return kt=Object.assign||function(e){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},kt.apply(this,arguments)};function te(t,e,n,r){function a(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function o(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?i(u.value):a(u.value).then(o,l)}c((r=r.apply(t,e||[])).next())})}function ne(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,a,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,a&&(i=c[0]&2?a.return:c[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,c[1])).done)return i;switch(a=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,a=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){n.label=c[1];break}if(c[0]===6&&n.label<i[1]){n.label=i[1],i=c;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(c);break}i[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],a=0}finally{r=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function dn(t,e,n){if(n||arguments.length===2)for(var r=0,a=e.length,i;r<a;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var un="4.6.2";function Ye(t,e){return new Promise(function(n){return setTimeout(n,t,e)})}function da(){return new Promise(function(t){var e=new MessageChannel;e.port1.onmessage=function(){return t()},e.port2.postMessage(null)})}function ua(t,e){e===void 0&&(e=1/0);var n=window.requestIdleCallback;return n?new Promise(function(r){return n.call(window,function(){return r()},{timeout:e})}):Ye(Math.min(t,e))}function fn(t){return!!t&&typeof t.then=="function"}function hn(t,e){try{var n=t();fn(n)?n.then(function(r){return e(!0,r)},function(r){return e(!1,r)}):e(!0,n)}catch(r){e(!1,r)}}function mn(t,e,n){return n===void 0&&(n=16),te(this,void 0,void 0,function(){var r,a,i,s;return ne(this,function(o){switch(o.label){case 0:r=Array(t.length),a=Date.now(),i=0,o.label=1;case 1:return i<t.length?(r[i]=e(t[i],i),s=Date.now(),s>=a+n?(a=s,[4,da()]):[3,3]):[3,4];case 2:o.sent(),o.label=3;case 3:return++i,[3,1];case 4:return[2,r]}})})}function Me(t){return t.then(void 0,function(){}),t}function fa(t,e){for(var n=0,r=t.length;n<r;++n)if(t[n]===e)return!0;return!1}function ha(t,e){return!fa(t,e)}function bt(t){return parseInt(t)}function H(t){return parseFloat(t)}function se(t,e){return typeof t=="number"&&isNaN(t)?e:t}function W(t){return t.reduce(function(e,n){return e+(n?1:0)},0)}function pn(t,e){if(e===void 0&&(e=1),Math.abs(e)>=1)return Math.round(t/e)*e;var n=1/e;return Math.round(t*n)/n}function ma(t){for(var e,n,r="Unexpected syntax '".concat(t,"'"),a=/^\s*([a-z-]*)(.*)$/i.exec(t),i=a[1]||void 0,s={},o=/([.:#][\w-]+|\[.+?\])/gi,l=function(m,h){s[m]=s[m]||[],s[m].push(h)};;){var c=o.exec(a[2]);if(!c)break;var u=c[0];switch(u[0]){case".":l("class",u.slice(1));break;case"#":l("id",u.slice(1));break;case"[":{var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(d)l(d[1],(n=(e=d[4])!==null&&e!==void 0?e:d[5])!==null&&n!==void 0?n:"");else throw new Error(r);break}default:throw new Error(r)}}return[i,s]}function pa(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r>127)return new TextEncoder().encode(t);e[n]=r}return e}function he(t,e){var n=t[0]>>>16,r=t[0]&65535,a=t[1]>>>16,i=t[1]&65535,s=e[0]>>>16,o=e[0]&65535,l=e[1]>>>16,c=e[1]&65535,u=0,d=0,m=0,h=0;h+=i+c,m+=h>>>16,h&=65535,m+=a+l,d+=m>>>16,m&=65535,d+=r+o,u+=d>>>16,d&=65535,u+=n+s,u&=65535,t[0]=u<<16|d,t[1]=m<<16|h}function G(t,e){var n=t[0]>>>16,r=t[0]&65535,a=t[1]>>>16,i=t[1]&65535,s=e[0]>>>16,o=e[0]&65535,l=e[1]>>>16,c=e[1]&65535,u=0,d=0,m=0,h=0;h+=i*c,m+=h>>>16,h&=65535,m+=a*c,d+=m>>>16,m&=65535,m+=i*l,d+=m>>>16,m&=65535,d+=r*c,u+=d>>>16,d&=65535,d+=a*l,u+=d>>>16,d&=65535,d+=i*o,u+=d>>>16,d&=65535,u+=n*c+r*l+a*o+i*s,u&=65535,t[0]=u<<16|d,t[1]=m<<16|h}function Se(t,e){var n=t[0];e%=64,e===32?(t[0]=t[1],t[1]=n):e<32?(t[0]=n<<e|t[1]>>>32-e,t[1]=t[1]<<e|n>>>32-e):(e-=32,t[0]=t[1]<<e|n>>>32-e,t[1]=n<<e|t[1]>>>32-e)}function U(t,e){e%=64,e!==0&&(e<32?(t[0]=t[1]>>>32-e,t[1]=t[1]<<e):(t[0]=t[1]<<e-32,t[1]=0))}function M(t,e){t[0]^=e[0],t[1]^=e[1]}var ga=[4283543511,3981806797],_a=[3301882366,444984403];function gn(t){var e=[0,t[0]>>>1];M(t,e),G(t,ga),e[1]=t[0]>>>1,M(t,e),G(t,_a),e[1]=t[0]>>>1,M(t,e)}var Xe=[2277735313,289559509],Je=[1291169091,658871167],_n=[0,5],va=[0,1390208809],ya=[0,944331445];function ka(t,e){var n=pa(t);e=e||0;var r=[0,n.length],a=r[1]%16,i=r[1]-a,s=[0,e],o=[0,e],l=[0,0],c=[0,0],u;for(u=0;u<i;u=u+16)l[0]=n[u+4]|n[u+5]<<8|n[u+6]<<16|n[u+7]<<24,l[1]=n[u]|n[u+1]<<8|n[u+2]<<16|n[u+3]<<24,c[0]=n[u+12]|n[u+13]<<8|n[u+14]<<16|n[u+15]<<24,c[1]=n[u+8]|n[u+9]<<8|n[u+10]<<16|n[u+11]<<24,G(l,Xe),Se(l,31),G(l,Je),M(s,l),Se(s,27),he(s,o),G(s,_n),he(s,va),G(c,Je),Se(c,33),G(c,Xe),M(o,c),Se(o,31),he(o,s),G(o,_n),he(o,ya);l[0]=0,l[1]=0,c[0]=0,c[1]=0;var d=[0,0];switch(a){case 15:d[1]=n[u+14],U(d,48),M(c,d);case 14:d[1]=n[u+13],U(d,40),M(c,d);case 13:d[1]=n[u+12],U(d,32),M(c,d);case 12:d[1]=n[u+11],U(d,24),M(c,d);case 11:d[1]=n[u+10],U(d,16),M(c,d);case 10:d[1]=n[u+9],U(d,8),M(c,d);case 9:d[1]=n[u+8],M(c,d),G(c,Je),Se(c,33),G(c,Xe),M(o,c);case 8:d[1]=n[u+7],U(d,56),M(l,d);case 7:d[1]=n[u+6],U(d,48),M(l,d);case 6:d[1]=n[u+5],U(d,40),M(l,d);case 5:d[1]=n[u+4],U(d,32),M(l,d);case 4:d[1]=n[u+3],U(d,24),M(l,d);case 3:d[1]=n[u+2],U(d,16),M(l,d);case 2:d[1]=n[u+1],U(d,8),M(l,d);case 1:d[1]=n[u],M(l,d),G(l,Xe),Se(l,31),G(l,Je),M(s,l)}return M(s,r),M(o,r),he(s,o),he(o,s),gn(s),gn(o),he(s,o),he(o,s),("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)}function ba(t){var e;return kt({name:t.name,message:t.message,stack:(e=t.stack)===null||e===void 0?void 0:e.split(`
2
- `)},t)}function xa(t){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))}function wa(t){return typeof t!="function"}function Sa(t,e){var n=Me(new Promise(function(r){var a=Date.now();hn(t.bind(null,e),function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];var o=Date.now()-a;if(!i[0])return r(function(){return{error:i[1],duration:o}});var l=i[1];if(wa(l))return r(function(){return{value:l,duration:o}});r(function(){return new Promise(function(c){var u=Date.now();hn(l,function(){for(var d=[],m=0;m<arguments.length;m++)d[m]=arguments[m];var h=o+Date.now()-u;if(!d[0])return c({error:d[1],duration:h});c({value:d[1],duration:h})})})})})}));return function(){return n.then(function(a){return a()})}}function Ca(t,e,n,r){var a=Object.keys(t).filter(function(s){return ha(n,s)}),i=Me(mn(a,function(s){return Sa(t[s],e)},r));return function(){return te(this,void 0,void 0,function(){var o,l,c,u,d;return ne(this,function(m){switch(m.label){case 0:return[4,i];case 1:return o=m.sent(),[4,mn(o,function(h){return Me(h())},r)];case 2:return l=m.sent(),[4,Promise.all(l)];case 3:for(c=m.sent(),u={},d=0;d<a.length;++d)u[a[d]]=c[d];return[2,u]}})})}}function vn(){var t=window,e=navigator;return W(["MSCSSMatrix"in t,"msSetImmediate"in t,"msIndexedDB"in t,"msMaxTouchPoints"in e,"msPointerEnabled"in e])>=4}function Ia(){var t=window,e=navigator;return W(["msWriteProfilerMark"in t,"MSStream"in t,"msLaunchUri"in e,"msSaveBlob"in e])>=3&&!vn()}function je(){var t=window,e=navigator;return W(["webkitPersistentStorage"in e,"webkitTemporaryStorage"in e,(e.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in t,"BatteryManager"in t,"webkitMediaStream"in t,"webkitSpeechGrammar"in t])>=5}function Y(){var t=window,e=navigator;return W(["ApplePayError"in t,"CSSPrimitiveValue"in t,"Counter"in t,e.vendor.indexOf("Apple")===0,"RGBColor"in t,"WebKitMediaKeys"in t])>=4}function xt(){var t=window,e=t.HTMLElement,n=t.Document;return W(["safari"in t,!("ongestureend"in t),!("TouchEvent"in t),!("orientation"in t),e&&!("autocapitalize"in e.prototype),n&&"pointerLockElement"in n.prototype])>=4}function Oe(){var t=window;return xa(t.print)&&String(t.browser)==="[object WebPageNamespace]"}function yn(){var t,e,n=window;return W(["buildID"in navigator,"MozAppearance"in((e=(t=document.documentElement)===null||t===void 0?void 0:t.style)!==null&&e!==void 0?e:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function Na(){var t=window;return W([!("MediaSettingsRange"in t),"RTCEncodedAudioFrame"in t,""+t.Intl=="[object Intl]",""+t.Reflect=="[object Reflect]"])>=3}function Ta(){var t=window,e=t.URLPattern;return W(["union"in Set.prototype,"Iterator"in t,e&&"hasRegExpGroups"in e.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function La(){var t=window;return W(["DOMRectList"in t,"RTCPeerConnectionIceEvent"in t,"SVGGeometryElement"in t,"ontransitioncancel"in t])>=3}function Pe(){var t=window,e=navigator,n=t.CSS,r=t.HTMLButtonElement;return W([!("getStorageUpdates"in e),r&&"popover"in r.prototype,"CSSCounterStyleRule"in t,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function Aa(){if(navigator.platform==="iPad")return!0;var t=screen,e=t.width/t.height;return W(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,e>.65&&e<1.53])>=2}function Ra(){var t=document;return t.fullscreenElement||t.msFullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement||null}function Ea(){var t=document;return(t.exitFullscreen||t.msExitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen).call(t)}function wt(){var t=je(),e=yn(),n=window,r=navigator,a="connection";return t?W([!("SharedWorker"in n),r[a]&&"ontypechange"in r[a],!("sinkId"in new Audio)])>=2:e?W(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2:!1}function Ma(){var t=navigator,e=window,n=Audio.prototype,r=e.visualViewport;return W(["srLatency"in n,"srChannelCount"in n,"devicePosture"in t,r&&"segments"in r,"getTextInformation"in Image.prototype])>=3}function ja(){return Za()?-4:Oa()}function Oa(){var t=window,e=t.OfflineAudioContext||t.webkitOfflineAudioContext;if(!e)return-2;if(Pa())return-1;var n=4500,r=5e3,a=new e(1,r,44100),i=a.createOscillator();i.type="triangle",i.frequency.value=1e4;var s=a.createDynamicsCompressor();s.threshold.value=-50,s.knee.value=40,s.ratio.value=12,s.attack.value=0,s.release.value=.25,i.connect(s),s.connect(a.destination),i.start(0);var o=Va(a),l=o[0],c=o[1],u=Me(l.then(function(d){return Fa(d.getChannelData(0).subarray(n))},function(d){if(d.name==="timeout"||d.name==="suspended")return-3;throw d}));return function(){return c(),u}}function Pa(){return Y()&&!xt()&&!La()}function Za(){return Y()&&Pe()&&Oe()||je()&&Ma()&&Ta()}function Va(t){var e=3,n=500,r=500,a=5e3,i=function(){},s=new Promise(function(o,l){var c=!1,u=0,d=0;t.oncomplete=function(x){return o(x.renderedBuffer)};var m=function(){setTimeout(function(){return l(kn("timeout"))},Math.min(r,d+a-Date.now()))},h=function(){try{var x=t.startRendering();switch(fn(x)&&Me(x),t.state){case"running":d=Date.now(),c&&m();break;case"suspended":document.hidden||u++,c&&u>=e?l(kn("suspended")):setTimeout(h,n);break}}catch(_){l(_)}};h(),i=function(){c||(c=!0,d>0&&m())}});return[s,i]}function Fa(t){for(var e=0,n=0;n<t.length;++n)e+=Math.abs(t[n]);return e}function kn(t){var e=new Error(t);return e.name=t,e}function bn(t,e,n){var r,a,i;return n===void 0&&(n=50),te(this,void 0,void 0,function(){var s,o;return ne(this,function(l){switch(l.label){case 0:s=document,l.label=1;case 1:return s.body?[3,3]:[4,Ye(n)];case 2:return l.sent(),[3,1];case 3:o=s.createElement("iframe"),l.label=4;case 4:return l.trys.push([4,,10,11]),[4,new Promise(function(c,u){var d=!1,m=function(){d=!0,c()},h=function(I){d=!0,u(I)};o.onload=m,o.onerror=h;var x=o.style;x.setProperty("display","block","important"),x.position="absolute",x.top="0",x.left="0",x.visibility="hidden",e&&"srcdoc"in o?o.srcdoc=e:o.src="about:blank",s.body.appendChild(o);var _=function(){var I,v;d||(((v=(I=o.contentWindow)===null||I===void 0?void 0:I.document)===null||v===void 0?void 0:v.readyState)==="complete"?m():setTimeout(_,10))};_()})];case 5:l.sent(),l.label=6;case 6:return!((a=(r=o.contentWindow)===null||r===void 0?void 0:r.document)===null||a===void 0)&&a.body?[3,8]:[4,Ye(n)];case 7:return l.sent(),[3,6];case 8:return[4,t(o,o.contentWindow)];case 9:return[2,l.sent()];case 10:return(i=o.parentNode)===null||i===void 0||i.removeChild(o),[7];case 11:return[2]}})})}function Wa(t){for(var e=ma(t),n=e[0],r=e[1],a=document.createElement(n??"div"),i=0,s=Object.keys(r);i<s.length;i++){var o=s[i],l=r[o].join(" ");o==="style"?$a(a.style,l):a.setAttribute(o,l)}return a}function $a(t,e){for(var n=0,r=e.split(";");n<r.length;n++){var a=r[n],i=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(a);if(i){var s=i[1],o=i[2],l=i[4];t.setProperty(s,o,l||"")}}}function Ua(){for(var t=window;;){var e=t.parent;if(!e||e===t)return!1;try{if(e.location.origin!==t.location.origin)return!0}catch(n){if(n instanceof Error&&n.name==="SecurityError")return!0;throw n}t=e}}var za="mmMwWLliI0O&1",Da="48px",Ce=["monospace","sans-serif","serif"],xn=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function Ba(){var t=this;return bn(function(e,n){var r=n.document;return te(t,void 0,void 0,function(){var a,i,s,o,l,c,u,d,m,h,x,_;return ne(this,function(I){for(a=r.body,a.style.fontSize=Da,i=r.createElement("div"),i.style.setProperty("visibility","hidden","important"),s={},o={},l=function(v){var y=r.createElement("span"),C=y.style;return C.position="absolute",C.top="0",C.left="0",C.fontFamily=v,y.textContent=za,i.appendChild(y),y},c=function(v,y){return l("'".concat(v,"',").concat(y))},u=function(){return Ce.map(l)},d=function(){for(var v={},y=function(K){v[K]=Ce.map(function(Q){return c(K,Q)})},C=0,Z=xn;C<Z.length;C++){var z=Z[C];y(z)}return v},m=function(v){return Ce.some(function(y,C){return v[C].offsetWidth!==s[y]||v[C].offsetHeight!==o[y]})},h=u(),x=d(),a.appendChild(i),_=0;_<Ce.length;_++)s[Ce[_]]=h[_].offsetWidth,o[Ce[_]]=h[_].offsetHeight;return[2,xn.filter(function(v){return m(x[v])})]})})})}function Ga(){var t=navigator.plugins;if(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];if(r){for(var a=[],i=0;i<r.length;++i){var s=r[i];a.push({type:s.type,suffixes:s.suffixes})}e.push({name:r.name,description:r.description,mimeTypes:a})}}return e}}function Ha(){return Ya(ti())}function Ya(t){var e,n=!1,r,a,i=Xa(),s=i[0],o=i[1];return Ja(s,o)?(n=Ka(o),t?r=a="skipped":(e=Qa(s,o),r=e[0],a=e[1])):r=a="unsupported",{winding:n,geometry:r,text:a}}function Xa(){var t=document.createElement("canvas");return t.width=1,t.height=1,[t,t.getContext("2d")]}function Ja(t,e){return!!(e&&t.toDataURL)}function Ka(t){return t.rect(0,0,10,10),t.rect(2,2,6,6),!t.isPointInPath(5,5,"evenodd")}function Qa(t,e){qa(t,e);var n=St(t),r=St(t);if(n!==r)return["unstable","unstable"];ei(t,e);var a=St(t);return[a,n]}function qa(t,e){t.width=240,t.height=60,e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(100,1,62,20),e.fillStyle="#069",e.font='11pt "Times New Roman"';var n="Cwm fjordbank gly ".concat("😃");e.fillText(n,2,15),e.fillStyle="rgba(102, 204, 0, 0.2)",e.font="18pt Arial",e.fillText(n,4,45)}function ei(t,e){t.width=122,t.height=110,e.globalCompositeOperation="multiply";for(var n=0,r=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];n<r.length;n++){var a=r[n],i=a[0],s=a[1],o=a[2];e.fillStyle=i,e.beginPath(),e.arc(s,o,40,0,Math.PI*2,!0),e.closePath(),e.fill()}e.fillStyle="#f9c",e.arc(60,60,60,0,Math.PI*2,!0),e.arc(60,60,20,0,Math.PI*2,!0),e.fill("evenodd")}function St(t){return t.toDataURL()}function ti(){return Y()&&Pe()&&Oe()}function ni(){var t=navigator,e=0,n;t.maxTouchPoints!==void 0?e=bt(t.maxTouchPoints):t.msMaxTouchPoints!==void 0&&(e=t.msMaxTouchPoints);try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}var r="ontouchstart"in window;return{maxTouchPoints:e,touchEvent:n,touchStart:r}}function ri(){return navigator.oscpu}function ai(){var t=navigator,e=[],n=t.language||t.userLanguage||t.browserLanguage||t.systemLanguage;if(n!==void 0&&e.push([n]),Array.isArray(t.languages))je()&&Na()||e.push(t.languages);else if(typeof t.languages=="string"){var r=t.languages;r&&e.push(r.split(","))}return e}function ii(){return window.screen.colorDepth}function si(){return se(H(navigator.deviceMemory),void 0)}function oi(){if(!(Y()&&Pe()&&Oe()))return ci()}function ci(){var t=screen,e=function(r){return se(bt(r),null)},n=[e(t.width),e(t.height)];return n.sort().reverse(),n}var li=2500,di=10,Ke,Ct;function ui(){if(Ct===void 0){var t=function(){var e=It();Nt(e)?Ct=setTimeout(t,li):(Ke=e,Ct=void 0)};t()}}function fi(){var t=this;return ui(),function(){return te(t,void 0,void 0,function(){var e;return ne(this,function(n){switch(n.label){case 0:return e=It(),Nt(e)?Ke?[2,dn([],Ke,!0)]:Ra()?[4,Ea()]:[3,2]:[3,2];case 1:n.sent(),e=It(),n.label=2;case 2:return Nt(e)||(Ke=e),[2,e]}})})}}function hi(){var t=this;if(Y()&&Pe()&&Oe())return function(){return Promise.resolve(void 0)};var e=fi();return function(){return te(t,void 0,void 0,function(){var n,r;return ne(this,function(a){switch(a.label){case 0:return[4,e()];case 1:return n=a.sent(),r=function(i){return i===null?null:pn(i,di)},[2,[r(n[0]),r(n[1]),r(n[2]),r(n[3])]]}})})}}function It(){var t=screen;return[se(H(t.availTop),null),se(H(t.width)-H(t.availWidth)-se(H(t.availLeft),0),null),se(H(t.height)-H(t.availHeight)-se(H(t.availTop),0),null),se(H(t.availLeft),null)]}function Nt(t){for(var e=0;e<4;++e)if(t[e])return!1;return!0}function mi(){return se(bt(navigator.hardwareConcurrency),void 0)}function pi(){var t,e=(t=window.Intl)===null||t===void 0?void 0:t.DateTimeFormat;if(e){var n=new e().resolvedOptions().timeZone;if(n)return n}var r=-gi();return"UTC".concat(r>=0?"+":"").concat(r)}function gi(){var t=new Date().getFullYear();return Math.max(H(new Date(t,0,1).getTimezoneOffset()),H(new Date(t,6,1).getTimezoneOffset()))}function _i(){try{return!!window.sessionStorage}catch{return!0}}function vi(){try{return!!window.localStorage}catch{return!0}}function yi(){if(!(vn()||Ia()))try{return!!window.indexedDB}catch{return!0}}function ki(){return!!window.openDatabase}function bi(){return navigator.cpuClass}function xi(){var t=navigator.platform;return t==="MacIntel"&&Y()&&!xt()?Aa()?"iPad":"iPhone":t}function wi(){return navigator.vendor||""}function Si(){for(var t=[],e=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];e<n.length;e++){var r=n[e],a=window[r];a&&typeof a=="object"&&t.push(r)}return t.sort()}function Ci(){var t=document;try{t.cookie="cookietest=1; SameSite=Strict;";var e=t.cookie.indexOf("cookietest=")!==-1;return t.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",e}catch{return!1}}function Ii(){var t=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',t("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",t("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",t("LnNwb25zb3JpdA=="),".ylamainos",t("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),t("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",t("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",t("LmhlYWRlci1ibG9ja2VkLWFk"),t("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",t("I2FkXzMwMFgyNTA="),t("I2Jhbm5lcmZsb2F0MjI="),t("I2NhbXBhaWduLWJhbm5lcg=="),t("I0FkLUNvbnRlbnQ=")],adGuardChinese:[t("LlppX2FkX2FfSA=="),t("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",t("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),t("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",t("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",t("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",t("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),t("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),t("LmFkZ29vZ2xl"),t("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[t("YW1wLWF1dG8tYWRz"),t("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",t("I2FkX2ludmlld19hcmVh")],adGuardRussian:[t("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),t("LnJlY2xhbWE="),'div[id^="smi2adblock"]',t("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[t("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),t("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",t("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),t("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),t("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",t("I3Jla2xhbWk="),t("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),t("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),t("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[t("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",t("LndpZGdldF9wb19hZHNfd2lkZ2V0"),t("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",t("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[t("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),t("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",t("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",t("I3Jla2xhbW5pLWJveA=="),t("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",t("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[t("I2FkdmVydGVudGll"),t("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",t("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",t("LnNwb25zb3JsaW5rZ3J1ZW4="),t("I3dlcmJ1bmdza3k="),t("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),t("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[t("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",t("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),t("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),t("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[t("LnJla2xhbW9zX3RhcnBhcw=="),t("LnJla2xhbW9zX251b3JvZG9z"),t("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),t("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),t("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[t("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[t("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),t("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",t("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[t("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),t("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),t("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",t("LmFkX19tYWlu"),t("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[t("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[t("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),t("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[t("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),t("I2xpdmVyZUFkV3JhcHBlcg=="),t("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),t("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[t("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",t("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),t("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),t("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[t("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),t("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),t("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",t("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),t("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),t("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),t("ZGl2I3NrYXBpZWNfYWQ=")],ro:[t("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),t("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),t("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),t("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[t("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),t("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),t("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",t("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),t("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",t("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}function Ni(t){var e=t===void 0?{}:t,n=e.debug;return te(this,void 0,void 0,function(){var r,a,i,s,o,l;return ne(this,function(c){switch(c.label){case 0:return Ti()?(r=Ii(),a=Object.keys(r),i=(l=[]).concat.apply(l,a.map(function(u){return r[u]})),[4,Li(i)]):[2,void 0];case 1:return s=c.sent(),n&&Ai(r,s),o=a.filter(function(u){var d=r[u],m=W(d.map(function(h){return s[h]}));return m>d.length*.6}),o.sort(),[2,o]}})})}function Ti(){return Y()||wt()}function Li(t){var e;return te(this,void 0,void 0,function(){var n,r,a,i,l,s,o,l;return ne(this,function(c){switch(c.label){case 0:for(n=document,r=n.createElement("div"),a=new Array(t.length),i={},wn(r),l=0;l<t.length;++l)s=Wa(t[l]),s.tagName==="DIALOG"&&s.show(),o=n.createElement("div"),wn(o),o.appendChild(s),r.appendChild(o),a[l]=s;c.label=1;case 1:return n.body?[3,3]:[4,Ye(50)];case 2:return c.sent(),[3,1];case 3:n.body.appendChild(r);try{for(l=0;l<t.length;++l)a[l].offsetParent||(i[t[l]]=!0)}finally{(e=r.parentNode)===null||e===void 0||e.removeChild(r)}return[2,i]}})})}function wn(t){t.style.setProperty("visibility","hidden","important"),t.style.setProperty("display","block","important")}function Ai(t,e){for(var n="DOM blockers debug:\n```",r=0,a=Object.keys(t);r<a.length;r++){var i=a[r];n+=`
3
- `.concat(i,":");for(var s=0,o=t[i];s<o.length;s++){var l=o[s];n+=`
4
- `.concat(e[l]?"🚫":"➡️"," ").concat(l)}}}function Ri(){for(var t=0,e=["rec2020","p3","srgb"];t<e.length;t++){var n=e[t];if(matchMedia("(color-gamut: ".concat(n,")")).matches)return n}}function Ei(){if(Sn("inverted"))return!0;if(Sn("none"))return!1}function Sn(t){return matchMedia("(inverted-colors: ".concat(t,")")).matches}function Mi(){if(Cn("active"))return!0;if(Cn("none"))return!1}function Cn(t){return matchMedia("(forced-colors: ".concat(t,")")).matches}var ji=100;function Oi(){if(matchMedia("(min-monochrome: 0)").matches){for(var t=0;t<=ji;++t)if(matchMedia("(max-monochrome: ".concat(t,")")).matches)return t;throw new Error("Too high value")}}function Pi(){if(Ie("no-preference"))return 0;if(Ie("high")||Ie("more"))return 1;if(Ie("low")||Ie("less"))return-1;if(Ie("forced"))return 10}function Ie(t){return matchMedia("(prefers-contrast: ".concat(t,")")).matches}function Zi(){if(In("reduce"))return!0;if(In("no-preference"))return!1}function In(t){return matchMedia("(prefers-reduced-motion: ".concat(t,")")).matches}function Vi(){if(Nn("reduce"))return!0;if(Nn("no-preference"))return!1}function Nn(t){return matchMedia("(prefers-reduced-transparency: ".concat(t,")")).matches}function Fi(){if(Tn("high"))return!0;if(Tn("standard"))return!1}function Tn(t){return matchMedia("(dynamic-range: ".concat(t,")")).matches}var E=Math,$=function(){return 0};function Wi(){var t=E.acos||$,e=E.acosh||$,n=E.asin||$,r=E.asinh||$,a=E.atanh||$,i=E.atan||$,s=E.sin||$,o=E.sinh||$,l=E.cos||$,c=E.cosh||$,u=E.tan||$,d=E.tanh||$,m=E.exp||$,h=E.expm1||$,x=E.log1p||$,_=function(R){return E.pow(E.PI,R)},I=function(R){return E.log(R+E.sqrt(R*R-1))},v=function(R){return E.log(R+E.sqrt(R*R+1))},y=function(R){return E.log((1+R)/(1-R))/2},C=function(R){return E.exp(R)-1/E.exp(R)/2},Z=function(R){return(E.exp(R)+1/E.exp(R))/2},z=function(R){return E.exp(R)-1},K=function(R){return(E.exp(2*R)-1)/(E.exp(2*R)+1)},Q=function(R){return E.log(1+R)};return{acos:t(.12312423423423424),acosh:e(1e308),acoshPf:I(1e154),asin:n(.12312423423423424),asinh:r(1),asinhPf:v(1),atanh:a(.5),atanhPf:y(.5),atan:i(.5),sin:s(-1e300),sinh:o(1),sinhPf:C(1),cos:l(10.000000000123),cosh:c(1),coshPf:Z(1),tan:u(-1e300),tanh:d(1),tanhPf:K(1),exp:m(1),expm1:h(1),expm1Pf:z(1),log1p:x(10),log1pPf:Q(10),powPI:_(-100)}}var $i="mmMwWLliI0fiflO&1",Tt={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function Ui(){return zi(function(t,e){for(var n={},r={},a=0,i=Object.keys(Tt);a<i.length;a++){var s=i[a],o=Tt[s],l=o[0],c=l===void 0?{}:l,u=o[1],d=u===void 0?$i:u,m=t.createElement("span");m.textContent=d,m.style.whiteSpace="nowrap";for(var h=0,x=Object.keys(c);h<x.length;h++){var _=x[h],I=c[_];I!==void 0&&(m.style[_]=I)}n[s]=m,e.append(t.createElement("br"),m)}for(var v=0,y=Object.keys(Tt);v<y.length;v++){var s=y[v];r[s]=n[s].getBoundingClientRect().width}return r})}function zi(t,e){return e===void 0&&(e=4e3),bn(function(n,r){var a=r.document,i=a.body,s=i.style;s.width="".concat(e,"px"),s.webkitTextSizeAdjust=s.textSizeAdjust="none",je()?i.style.zoom="".concat(1/r.devicePixelRatio):Y()&&(i.style.zoom="reset");var o=a.createElement("div");return o.textContent=dn([],Array(e/20<<0),!0).map(function(){return"word"}).join(" "),i.appendChild(o),t(a,i)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function Di(){return navigator.pdfViewerEnabled}function Bi(){var t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=1/0,t[0]=t[0]-t[0],e[3]}function Gi(){var t=window.ApplePaySession;if(typeof(t==null?void 0:t.canMakePayments)!="function")return-1;if(Hi())return-3;try{return t.canMakePayments()?1:0}catch(e){return Yi(e)}}var Hi=Ua;function Yi(t){if(t instanceof Error&&t.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(t.message))return-2;throw t}function Xi(){var t,e=document.createElement("a"),n=(t=e.attributionSourceId)!==null&&t!==void 0?t:e.attributionsourceid;return n===void 0?void 0:String(n)}var Ln=-1,An=-2,Ji=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Ki=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),Qi=["FRAGMENT_SHADER","VERTEX_SHADER"],qi=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Rn="WEBGL_debug_renderer_info",es="WEBGL_polygon_mode";function ts(t){var e,n,r,a,i,s,o=t.cache,l=En(o);if(!l)return Ln;if(!On(l))return An;var c=jn()?null:l.getExtension(Rn);return{version:((e=l.getParameter(l.VERSION))===null||e===void 0?void 0:e.toString())||"",vendor:((n=l.getParameter(l.VENDOR))===null||n===void 0?void 0:n.toString())||"",vendorUnmasked:c?(r=l.getParameter(c.UNMASKED_VENDOR_WEBGL))===null||r===void 0?void 0:r.toString():"",renderer:((a=l.getParameter(l.RENDERER))===null||a===void 0?void 0:a.toString())||"",rendererUnmasked:c?(i=l.getParameter(c.UNMASKED_RENDERER_WEBGL))===null||i===void 0?void 0:i.toString():"",shadingLanguageVersion:((s=l.getParameter(l.SHADING_LANGUAGE_VERSION))===null||s===void 0?void 0:s.toString())||""}}function ns(t){var e=t.cache,n=En(e);if(!n)return Ln;if(!On(n))return An;var r=n.getSupportedExtensions(),a=n.getContextAttributes(),i=[],s=[],o=[],l=[],c=[];if(a)for(var u=0,d=Object.keys(a);u<d.length;u++){var m=d[u];s.push("".concat(m,"=").concat(a[m]))}for(var h=Mn(n),x=0,_=h;x<_.length;x++){var I=_[x],v=n[I];o.push("".concat(I,"=").concat(v).concat(Ji.has(v)?"=".concat(n.getParameter(v)):""))}if(r)for(var y=0,C=r;y<C.length;y++){var Z=C[y];if(!(Z===Rn&&jn()||Z===es&&is())){var z=n.getExtension(Z);if(!z){i.push(Z);continue}for(var K=0,Q=Mn(z);K<Q.length;K++){var I=Q[K],v=z[I];l.push("".concat(I,"=").concat(v).concat(Ki.has(v)?"=".concat(n.getParameter(v)):""))}}}for(var R=0,D=Qi;R<D.length;R++)for(var le=D[R],Ut=0,Rr=qi;Ut<Rr.length;Ut++){var Er=Rr[Ut],Po=rs(n,le,Er);c.push("".concat(le,".").concat(Er,"=").concat(Po.join(",")))}return l.sort(),o.sort(),{contextAttributes:s,parameters:o,shaderPrecisions:c,extensions:r,extensionParameters:l,unsupportedExtensions:i}}function En(t){if(t.webgl)return t.webgl.context;var e=document.createElement("canvas"),n;e.addEventListener("webglCreateContextError",function(){return n=void 0});for(var r=0,a=["webgl","experimental-webgl"];r<a.length;r++){var i=a[r];try{n=e.getContext(i)}catch{}if(n)break}return t.webgl={context:n},n}function rs(t,e,n){var r=t.getShaderPrecisionFormat(t[e],t[n]);return r?[r.rangeMin,r.rangeMax,r.precision]:[]}function Mn(t){var e=Object.keys(t.__proto__);return e.filter(as)}function as(t){return typeof t=="string"&&!t.match(/[^A-Z0-9_x]/)}function jn(){return yn()}function is(){return je()||Y()}function On(t){return typeof t.getParameter=="function"}function ss(){var t=wt()||Y();if(!t)return-2;if(!window.AudioContext)return-1;var e=new AudioContext().baseLatency;return e==null?-1:isFinite(e)?e:-3}function os(){if(!window.Intl)return-1;var t=window.Intl.DateTimeFormat;if(!t)return-2;var e=t().resolvedOptions().locale;return!e&&e!==""?-3:e}var cs={fonts:Ba,domBlockers:Ni,fontPreferences:Ui,audio:ja,screenFrame:hi,canvas:Ha,osCpu:ri,languages:ai,colorDepth:ii,deviceMemory:si,screenResolution:oi,hardwareConcurrency:mi,timezone:pi,sessionStorage:_i,localStorage:vi,indexedDB:yi,openDatabase:ki,cpuClass:bi,platform:xi,plugins:Ga,touchSupport:ni,vendor:wi,vendorFlavors:Si,cookiesEnabled:Ci,colorGamut:Ri,invertedColors:Ei,forcedColors:Mi,monochrome:Oi,contrast:Pi,reducedMotion:Zi,reducedTransparency:Vi,hdr:Fi,math:Wi,pdfViewerEnabled:Di,architecture:Bi,applePay:Gi,privateClickMeasurement:Xi,audioBaseLatency:ss,dateTimeLocale:os,webGlBasics:ts,webGlExtensions:ns};function ls(t){return Ca(cs,t,[])}var ds="$ if upgrade to Pro: https://fpjs.dev/pro";function us(t){var e=fs(t),n=hs(e);return{score:e,comment:ds.replace(/\$/g,"".concat(n))}}function fs(t){if(wt())return .4;if(Y())return xt()&&!(Pe()&&Oe())?.5:.3;var e="value"in t.platform?t.platform.value:"";return/^Win/.test(e)?.6:/^Mac/.test(e)?.5:.7}function hs(t){return pn(.99+.01*t,1e-4)}function ms(t){for(var e="",n=0,r=Object.keys(t).sort();n<r.length;n++){var a=r[n],i=t[a],s="error"in i?"error":JSON.stringify(i.value);e+="".concat(e?"|":"").concat(a.replace(/([:|\\])/g,"\\$1"),":").concat(s)}return e}function ps(t){return JSON.stringify(t,function(e,n){return n instanceof Error?ba(n):n},2)}function Pn(t){return ka(ms(t))}function gs(t){var e,n=us(t);return{get visitorId(){return e===void 0&&(e=Pn(this.components)),e},set visitorId(r){e=r},confidence:n,components:t,version:un}}function _s(t){return t===void 0&&(t=50),ua(t,t*2)}function vs(t,e){var n=Date.now();return{get:function(r){return te(this,void 0,void 0,function(){var a,i,s;return ne(this,function(o){switch(o.label){case 0:return a=Date.now(),[4,t()];case 1:return i=o.sent(),s=gs(i),e||r!=null&&r.debug,[2,s]}})})}}}function ys(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var t=new XMLHttpRequest;t.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(un,"/npm-monitoring"),!0),t.send()}catch{}}function ks(t){var e;return t===void 0&&(t={}),te(this,void 0,void 0,function(){var n,r,a;return ne(this,function(i){switch(i.label){case 0:return(!((e=t.monitoring)!==null&&e!==void 0)||e)&&ys(),n=t.delayFallback,r=t.debug,[4,_s(n)];case 1:return i.sent(),a=ls({cache:{},debug:r}),[2,vs(a,r)]}})})}var bs={load:ks,hashComponents:Pn,componentsToDebugString:ps};class xs{constructor(e){this.baseUrl=e}async validateWidget(e,n){if(!n)return{valid:!1,error:"Widget is not configured: tenantId is required"};try{const r=new URLSearchParams({agentId:e,tenantId:n}),a=await fetch(`${this.baseUrl}/v1/widget/validate?${r}`),i=await a.json();return a.ok&&i.success?{valid:!0,agentId:i.data.agentId,tenantId:i.data.tenantId}:{valid:!1,error:i.error??`Widget configuration is invalid (${a.status})`}}catch{return{valid:!1,error:"Unable to reach the AgentForge API to validate widget configuration"}}}async chat(e){var a,i,s;const n=await fetch(`${this.baseUrl}/v1/agents/${encodeURIComponent(e.agentId)}/responses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e.message,sessionId:e.sessionId,tenantId:e.tenantId,userId:e.userId,name:e.name,email:e.email,authUserId:e.authUserId,fingerprint:e.fingerprint,metadata:e.metadata,imageUrl:e.imageUrl})});if(!n.ok)throw new Error(`API error: ${n.status} ${n.statusText}`);const r=await n.json();if(!r.success)throw new Error(r.error??"Unknown API error");return{content:((a=r.data)==null?void 0:a.text)??"",sessionId:(i=r.data)==null?void 0:i.sessionId,images:(s=r.data)==null?void 0:s.images}}async fetchSessionMessages(e){var n;try{const r=await fetch(`${this.baseUrl}/v1/sessions/${encodeURIComponent(e)}/messages`);if(r.status===410||!r.ok)return null;const a=await r.json();return a.success?((n=a.data)==null?void 0:n.messages)??null:null}catch{return null}}async uploadImage(e,n,r){const a=await fetch(`${this.baseUrl}/v1/upload`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e,mimeType:n,fileName:r})});if(!a.ok)throw new Error(`Upload error: ${a.status} ${a.statusText}`);const i=await a.json();if(!i.success)throw new Error(i.error??"Upload failed");return{url:i.data.url}}async fetchWidgetConfig(e,n){try{const r=n?`?tenantId=${encodeURIComponent(n)}`:"",a=await fetch(`${this.baseUrl}/v1/agents/${encodeURIComponent(e)}/widget-config${r}`);if(!a.ok)return null;const i=await a.json();return i.success?i.data:null}catch{return null}}}const ws=6e4;function Ss(t){return Promise.race([t.read(),new Promise((e,n)=>setTimeout(()=>n(new Error("Stream timed out — no data received for 60s")),ws))])}async function Cs(t,e,n){let r="",a="";try{const i=await fetch(`${t}/v1/agents/${encodeURIComponent(e.agentId)}/responses:stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e.message,sessionId:e.sessionId,tenantId:e.tenantId,userId:e.userId,name:e.name,email:e.email,authUserId:e.authUserId,fingerprint:e.fingerprint,metadata:e.metadata,imageUrl:e.imageUrl})});if(!i.ok||!i.body)throw new Error(`Stream error: ${i.status} ${i.statusText}`);const s=i.headers.get("x-session-id");s&&n.onSession&&n.onSession(s);const o=i.body.getReader(),l=new TextDecoder;let c="";const u=d=>{if(!d.startsWith("data: "))return!1;const m=d.slice(6).trim();if(!m)return!1;if(m==="[DONE]")return n.onEnd(r),!0;try{const h=JSON.parse(m);if(h.type==="session"){const _=h.sessionId;return _&&n.onSession&&n.onSession(_),!1}if(h.type==="done"||h.type==="stop")return n.onEnd(r),!0;if(h.type==="error")throw new Error(h.message??"Stream error");if(h.type==="images"){const _=h.images;return _&&n.onImages&&n.onImages(_),!1}if(h.type==="thinking_chunk"){const _=h.content;return _&&n.onThinkingDelta&&(a+=_,n.onThinkingDelta(_,a)),!1}const x=Is(h);x&&(r+=x,n.onDelta(x,r))}catch(h){if(!(h instanceof SyntaxError))throw h}return!1};e:for(;;){const{done:d,value:m}=await Ss(o);if(d)break;c+=l.decode(m,{stream:!0});const h=c.lastIndexOf(`
5
- `);if(h===-1)continue;const x=c.slice(0,h);c=c.slice(h+1);for(const _ of x.split(`
6
- `))if(u(_))break e}n.onEnd(r)}catch(i){n.onError(i instanceof Error?i:new Error(String(i)))}}function Is(t){var a;const e=t.choices;if(Array.isArray(e)&&e.length>0){const i=(a=e[0])==null?void 0:a.delta,s=(i==null?void 0:i.content)??(i==null?void 0:i.text)??"";if(s)return s}const n=t.delta;if(n){const i=n.content??n.text??"";if(i)return i}const r=t.response;return r||(t.text??t.content??"")}class Ns{constructor(){me(this,"listeners",new Map)}on(e,n){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(n)}off(e,n){var r;(r=this.listeners.get(e))==null||r.delete(n)}emit(...e){var a;const[n,r]=e;(a=this.listeners.get(n))==null||a.forEach(i=>i(r))}removeAllListeners(){this.listeners.clear()}}const Ts="agentforge";function Lt(t){return`${Ts}:session:${t}`}function Ls(t){try{return sessionStorage.getItem(Lt(t))??void 0}catch{return}}function At(t,e){try{sessionStorage.setItem(Lt(t),e)}catch{}}function Zn(t){try{sessionStorage.removeItem(Lt(t))}catch{}}function Ze(){return`msg-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`}function As(t){return{id:Ze(),role:"assistant",content:t,createdAt:new Date().toISOString(),status:"sent"}}class Rs{constructor(e,n,r){me(this,"config");me(this,"apiClient");me(this,"state");me(this,"greetingShown",!1);me(this,"fingerprint");me(this,"emitter");this.hostConfig=n,this.onStateChange=r,this.config=e,this.apiClient=new xs(e.apiBaseUrl),this.emitter=new Ns,this.initializeFingerprint();const a=e.sessionId??Ls(e.agentId);e.sessionId&&At(e.agentId,e.sessionId);const i=e.mode==="inline";this.state={isOpen:i,messages:[],isLoading:!1,error:null,sessionId:a,initStatus:"validating",initError:null},i&&queueMicrotask(()=>this.openWithGreeting())}async initializeFingerprint(){try{const n=await(await bs.load()).get();this.fingerprint=n.visitorId}catch{this.fingerprint=void 0}}getState(){return{...this.state,messages:[...this.state.messages]}}setOpen(e){e?this.openWithGreeting():this.setState({isOpen:!1})}openWithGreeting(){if(this.state.initStatus==="error")return;const e=!this.greetingShown&&!!this.config.greeting;e&&(this.greetingShown=!0),this.setState({isOpen:!0,messages:e?[As(this.config.greeting),...this.state.messages]:this.state.messages})}async hydrate(){const e=await this.apiClient.validateWidget(this.config.agentId,this.config.tenantId);if(!e.valid){this.setState({initStatus:"error",initError:e.error});return}const n=await this.apiClient.fetchWidgetConfig(this.config.agentId,this.config.tenantId);if(n&&(this.config=Ee(this.hostConfig,n),this.onStateChange(this.getState(),this.config)),this.setState({initStatus:"ready"}),!this.state.sessionId)return;const r=await this.apiClient.fetchSessionMessages(this.state.sessionId);if(r===null){this.handleSessionExpired();return}if(r.length===0)return;const a=r.map(i=>({id:Ze(),role:i.role,content:i.content,images:i.images&&i.images.length>0?i.images:void 0,createdAt:new Date().toISOString(),status:"sent"}));this.setState({messages:[...this.state.messages,...a]})}setState(e){this.state={...this.state,...e},this.onStateChange(this.getState(),this.config)}updateMessage(e,n){this.state={...this.state,messages:this.state.messages.map(r=>r.id===e?{...r,...n}:r)},this.onStateChange(this.getState(),this.config)}reset(){Zn(this.config.agentId),this.greetingShown=!1,this.setState({sessionId:void 0,messages:[],isLoading:!1,error:null}),this.state.isOpen&&this.openWithGreeting()}handleSessionExpired(){Zn(this.config.agentId),this.setState({sessionId:void 0})}async sendMessage(e,n){if(this.state.isLoading||!e.trim()||this.state.initStatus!=="ready")return;let r;if(n)try{const s=await Es(n);r=(await this.apiClient.uploadImage(s,n.type,n.name)).url}catch(s){const o=s instanceof Error?s.message:"Image upload failed";this.setState({error:o});return}const a={id:Ze(),role:"user",content:e.trim(),uploadedImageUrl:r,createdAt:new Date().toISOString(),status:"sent"},i=!this.state.messages.some(s=>s.role==="user");this.setState({messages:[...this.state.messages,a],isLoading:!0,error:null}),this.emitter.emit("message:sent",a),i&&this.emitter.emit("conversation:started",{sessionId:this.state.sessionId}),this.config.streaming?await this.sendStreaming(e.trim(),r):await this.sendNonStreaming(e.trim(),r)}async sendNonStreaming(e,n,r=!1){try{const a=await this.apiClient.chat({agentId:this.config.agentId,message:e,sessionId:this.state.sessionId,tenantId:this.config.tenantId,userId:this.config.userId,name:this.config.name,email:this.config.email,authUserId:this.config.authUserId,fingerprint:this.fingerprint,metadata:this.config.metadata,imageUrl:n}),i={id:Ze(),role:"assistant",content:a.content,images:a.images,createdAt:new Date().toISOString(),status:"sent"};this.setState({messages:[...this.state.messages,i],isLoading:!1,...a.sessionId?{sessionId:a.sessionId}:{}}),a.sessionId&&At(this.config.agentId,a.sessionId),this.emitter.emit("message:received",i)}catch(a){const i=a instanceof Error?a.message:"Failed to send message";if(!r&&i.includes("410"))return this.handleSessionExpired(),this.sendNonStreaming(e,n,!0);this.setState({isLoading:!1,error:i}),this.emitter.emit("message:error",{error:i,message:null})}}async sendStreaming(e,n,r=!1){const a=Ze(),i={id:a,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming",isThinking:this.config.thinkingEnabled?!0:void 0};this.setState({messages:[...this.state.messages,i]}),this.emitter.emit("stream:start");let s=!1;await Cs(this.config.apiBaseUrl,{agentId:this.config.agentId,message:e,sessionId:this.state.sessionId,tenantId:this.config.tenantId,userId:this.config.userId,name:this.config.name,email:this.config.email,authUserId:this.config.authUserId,fingerprint:this.fingerprint,metadata:this.config.metadata,imageUrl:n},{onSession:o=>{this.setState({sessionId:o}),At(this.config.agentId,o)},onImages:o=>{this.updateMessage(a,{images:o})},onThinkingDelta:(o,l)=>{this.updateMessage(a,{thinking:l,isThinking:!0}),this.emitter.emit("thinking:delta",{delta:o,accumulated:l})},onDelta:(o,l)=>{this.updateMessage(a,{content:l,isThinking:!1}),this.emitter.emit("stream:delta",{delta:o,accumulated:l})},onEnd:o=>{this.updateMessage(a,{content:o,status:"sent",isThinking:!1}),this.setState({isLoading:!1}),this.emitter.emit("stream:end",{content:o});const l=this.state.messages.find(c=>c.id===a);l&&(l.thinking&&this.emitter.emit("thinking:end",{content:l.thinking}),this.emitter.emit("message:received",l))},onError:o=>{var c;if(!r&&o.message.includes("410")){s=!0,this.setState({messages:this.state.messages.filter(u=>u.id!==a),isLoading:!1});return}const l=((c=this.state.messages.find(u=>u.id===a))==null?void 0:c.content)??"";this.updateMessage(a,{content:l||"Something went wrong. Please try again.",status:"error"}),this.setState({isLoading:!1,error:"Something went wrong. Please try again."}),this.emitter.emit("message:error",{error:o.message,message:null})}}),s&&(this.handleSessionExpired(),await this.sendStreaming(e,n,!0))}}function Es(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=()=>{const a=r.result;e(a.split(",")[1]??"")},r.onerror=()=>n(new Error("Failed to read file")),r.readAsDataURL(t)})}function Ms(t){const e=document.createElement("div");e.setAttribute("data-agentkit-widget",""),t.appendChild(e);const n=e.attachShadow({mode:"open"}),r=document.createElement("style");n.appendChild(r);const a=document.createElement("div");return a.style.cssText="display: contents;",n.appendChild(a),{host:e,shadowRoot:n,styleSlot:r,mountPoint:a}}function js(t,e){t.textContent=e}function Os(t){t.remove()}function Ps(){const t=document.createElement("div");return t.setAttribute("data-agentkit-root","floating"),t.style.cssText=["position: fixed","bottom: 24px","right: 24px","z-index: 2147483647","pointer-events: none"].join("; "),document.body.appendChild(t),t}function Zs(t){getComputedStyle(t).position==="static"&&(t.style.position="relative");const e=document.createElement("div");return e.setAttribute("data-agentkit-root","floating"),e.style.cssText=["position: absolute","bottom: 24px","right: 24px","z-index: 2147483647","pointer-events: none"].join("; "),t.appendChild(e),e}function Vs(t){return t.setAttribute("data-agentkit-root","inline"),getComputedStyle(t).position==="static"&&(t.style.position="relative"),t}function Fs(t){t.remove()}function Ws(t){t.removeAttribute("data-agentkit-root")}function Vn(t,e,n,r,a){const i=t.mode==="inline";let s=!1;const o=i&&a?Vs(a):!i&&a?Zs(a):Ps(),l=Ms(o);js(l.styleSlot,r);const c=new Rs(t,e,(m,h)=>{s||u.update(m,h)}),u=n(l.mountPoint,t,c.getState(),{onOpen:()=>d.open(),onClose:()=>d.close(),onSendMessage:(m,h)=>{c.sendMessage(m,h)}});c.hydrate(),setTimeout(()=>{s||c.emitter.emit("ready",c.getState())},0);const d={open(){s||(c.setOpen(!0),c.emitter.emit("open"))},close(){s||(c.setOpen(!1),c.emitter.emit("close"))},toggle(){c.getState().isOpen?d.close():d.open()},async sendMessage(m,h){await c.sendMessage(m,h)},reset(){s||(c.reset(),c.emitter.emit("reset"))},destroy(){s||(s=!0,u.destroy(),Os(l.host),i&&a?Ws(a):Fs(o),c.emitter.emit("destroy"),c.emitter.removeAllListeners())},on(m,h){c.emitter.on(m,h)},off(m,h){c.emitter.off(m,h)},getState(){return c.getState()}};return d}const Ve=new Map;let $s=0;function Fn(t){const e=`agentkit-widget-${++$s}`,n=t.destroy.bind(t);return t.destroy=()=>{Ve.delete(e),n()},Ve.set(e,t),e}function Us(t,e,n){const r={...t,mode:"floating"},a=Ee(r),i=Vn(a,r,e,n);return Fn(i),i}function zs(t,e,n,r){const a={...e,mode:"inline"},i=Ee(a),s=Vn(i,a,n,r,t);return Fn(s),s}function Ds(t){var e;t?(e=Ve.get(t))==null||e.destroy():(Ve.forEach(n=>n.destroy()),Ve.clear())}var Qe,N,Wn,ve,$n,Un,zn,Dn,Rt,Et,Mt,qe={},et=[],Bs=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Fe=Array.isArray;function oe(t,e){for(var n in e)t[n]=e[n];return t}function jt(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function We(t,e,n){var r,a,i,s={};for(i in e)i=="key"?r=e[i]:i=="ref"?a=e[i]:s[i]=e[i];if(arguments.length>2&&(s.children=arguments.length>3?Qe.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)s[i]===void 0&&(s[i]=t.defaultProps[i]);return tt(t,s,r,a,null)}function tt(t,e,n,r,a){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++Wn,__i:-1,__u:0};return a==null&&N.vnode!=null&&N.vnode(i),i}function X(t){return t.children}function ce(t,e){this.props=t,this.context=e}function Ne(t,e){if(e==null)return t.__?Ne(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Ne(t):null}function Gs(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,r=[],a=[],i=oe({},e);i.__v=e.__v+1,N.vnode&&N.vnode(i),Ot(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,r,n??Ne(e),!!(32&e.__u),a),i.__v=e.__v,i.__.__k[i.__i]=i,Kn(r,i,a),e.__e=e.__=null,i.__e!=n&&Bn(i)}}function Bn(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),Bn(t)}function Gn(t){(!t.__d&&(t.__d=!0)&&ve.push(t)&&!nt.__r++||$n!=N.debounceRendering)&&(($n=N.debounceRendering)||Un)(nt)}function nt(){for(var t,e=1;ve.length;)ve.length>e&&ve.sort(zn),t=ve.shift(),e=ve.length,Gs(t);nt.__r=0}function Hn(t,e,n,r,a,i,s,o,l,c,u){var d,m,h,x,_,I,v,y=r&&r.__k||et,C=e.length;for(l=Hs(n,e,y,l,C),d=0;d<C;d++)(h=n.__k[d])!=null&&(m=h.__i!=-1&&y[h.__i]||qe,h.__i=d,I=Ot(t,h,m,a,i,s,o,l,c,u),x=h.__e,h.ref&&m.ref!=h.ref&&(m.ref&&Zt(m.ref,null,h),u.push(h.ref,h.__c||x,h)),_==null&&x!=null&&(_=x),(v=!!(4&h.__u))||m.__k===h.__k?l=Yn(h,l,t,v):typeof h.type=="function"&&I!==void 0?l=I:x&&(l=x.nextSibling),h.__u&=-7);return n.__e=_,l}function Hs(t,e,n,r,a){var i,s,o,l,c,u=n.length,d=u,m=0;for(t.__k=new Array(a),i=0;i<a;i++)(s=e[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=t.__k[i]=tt(null,s,null,null,null):Fe(s)?s=t.__k[i]=tt(X,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=t.__k[i]=tt(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):t.__k[i]=s,l=i+m,s.__=t,s.__b=t.__b+1,o=null,(c=s.__i=Ys(s,n,l,d))!=-1&&(d--,(o=n[c])&&(o.__u|=2)),o==null||o.__v==null?(c==-1&&(a>u?m--:a<u&&m++),typeof s.type!="function"&&(s.__u|=4)):c!=l&&(c==l-1?m--:c==l+1?m++:(c>l?m--:m++,s.__u|=4))):t.__k[i]=null;if(d)for(i=0;i<u;i++)(o=n[i])!=null&&!(2&o.__u)&&(o.__e==r&&(r=Ne(o)),qn(o,o));return r}function Yn(t,e,n,r){var a,i;if(typeof t.type=="function"){for(a=t.__k,i=0;a&&i<a.length;i++)a[i]&&(a[i].__=t,e=Yn(a[i],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Ne(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function rt(t,e){return e=e||[],t==null||typeof t=="boolean"||(Fe(t)?t.some(function(n){rt(n,e)}):e.push(t)),e}function Ys(t,e,n,r){var a,i,s,o=t.key,l=t.type,c=e[n],u=c!=null&&(2&c.__u)==0;if(c===null&&o==null||u&&o==c.key&&l==c.type)return n;if(r>(u?1:0)){for(a=n-1,i=n+1;a>=0||i<e.length;)if((c=e[s=a>=0?a--:i++])!=null&&!(2&c.__u)&&o==c.key&&l==c.type)return s}return-1}function Xn(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Bs.test(e)?n:n+"px"}function at(t,e,n,r,a){var i,s;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||Xn(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||Xn(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(Dn,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.u=r.u:(n.u=Rt,t.addEventListener(e,i?Mt:Et,i)):t.removeEventListener(e,i?Mt:Et,i);else{if(a=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Jn(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Rt++;else if(e.t<n.u)return;return n(N.event?N.event(e):e)}}}function Ot(t,e,n,r,a,i,s,o,l,c){var u,d,m,h,x,_,I,v,y,C,Z,z,K,Q,R,D=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[o=e.__e=n.__e]),(u=N.__b)&&u(e);e:if(typeof D=="function")try{if(v=e.props,y="prototype"in D&&D.prototype.render,C=(u=D.contextType)&&r[u.__c],Z=u?C?C.props.value:u.__:r,n.__c?I=(d=e.__c=n.__c).__=d.__E:(y?e.__c=d=new D(v,Z):(e.__c=d=new ce(v,Z),d.constructor=D,d.render=Js),C&&C.sub(d),d.state||(d.state={}),d.__n=r,m=d.__d=!0,d.__h=[],d._sb=[]),y&&d.__s==null&&(d.__s=d.state),y&&D.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=oe({},d.__s)),oe(d.__s,D.getDerivedStateFromProps(v,d.__s))),h=d.props,x=d.state,d.__v=e,m)y&&D.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),y&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(y&&D.getDerivedStateFromProps==null&&v!==h&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(v,Z),e.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(v,d.__s,Z)===!1){e.__v!=n.__v&&(d.props=v,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(le){le&&(le.__=e)}),et.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(v,d.__s,Z),y&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(h,x,_)})}if(d.context=Z,d.props=v,d.__P=t,d.__e=!1,z=N.__r,K=0,y)d.state=d.__s,d.__d=!1,z&&z(e),u=d.render(d.props,d.state,d.context),et.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,z&&z(e),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++K<25);d.state=d.__s,d.getChildContext!=null&&(r=oe(oe({},r),d.getChildContext())),y&&!m&&d.getSnapshotBeforeUpdate!=null&&(_=d.getSnapshotBeforeUpdate(h,x)),Q=u!=null&&u.type===X&&u.key==null?Qn(u.props.children):u,o=Hn(t,Fe(Q)?Q:[Q],e,n,r,a,i,s,o,l,c),d.base=e.__e,e.__u&=-161,d.__h.length&&s.push(d),I&&(d.__E=d.__=null)}catch(le){if(e.__v=null,l||i!=null)if(le.then){for(e.__u|=l?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;i[i.indexOf(o)]=null,e.__e=o}else{for(R=i.length;R--;)jt(i[R]);Pt(e)}else e.__e=n.__e,e.__k=n.__k,le.then||Pt(e);N.__e(le,e,n)}else i==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):o=e.__e=Xs(n.__e,e,n,r,a,i,s,l,c);return(u=N.diffed)&&u(e),128&e.__u?void 0:o}function Pt(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Pt))}function Kn(t,e,n){for(var r=0;r<n.length;r++)Zt(n[r],n[++r],n[++r]);N.__c&&N.__c(e,t),t.some(function(a){try{t=a.__h,a.__h=[],t.some(function(i){i.call(a)})}catch(i){N.__e(i,a.__v)}})}function Qn(t){return typeof t!="object"||t==null||t.__b>0?t:Fe(t)?t.map(Qn):oe({},t)}function Xs(t,e,n,r,a,i,s,o,l){var c,u,d,m,h,x,_,I=n.props||qe,v=e.props,y=e.type;if(y=="svg"?a="http://www.w3.org/2000/svg":y=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((h=i[c])&&"setAttribute"in h==!!y&&(y?h.localName==y:h.nodeType==3)){t=h,i[c]=null;break}}if(t==null){if(y==null)return document.createTextNode(v);t=document.createElementNS(a,y,v.is&&v),o&&(N.__m&&N.__m(e,i),o=!1),i=null}if(y==null)I===v||o&&t.data==v||(t.data=v);else{if(i=i&&Qe.call(t.childNodes),!o&&i!=null)for(I={},c=0;c<t.attributes.length;c++)I[(h=t.attributes[c]).name]=h.value;for(c in I)h=I[c],c=="dangerouslySetInnerHTML"?d=h:c=="children"||c in v||c=="value"&&"defaultValue"in v||c=="checked"&&"defaultChecked"in v||at(t,c,null,h,a);for(c in v)h=v[c],c=="children"?m=h:c=="dangerouslySetInnerHTML"?u=h:c=="value"?x=h:c=="checked"?_=h:o&&typeof h!="function"||I[c]===h||at(t,c,h,I[c],a);if(u)o||d&&(u.__html==d.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(d&&(t.innerHTML=""),Hn(e.type=="template"?t.content:t,Fe(m)?m:[m],e,n,r,y=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,s,i?i[0]:n.__k&&Ne(n,0),o,l),i!=null)for(c=i.length;c--;)jt(i[c]);o||(c="value",y=="progress"&&x==null?t.removeAttribute("value"):x!=null&&(x!==t[c]||y=="progress"&&!x||y=="option"&&x!=I[c])&&at(t,c,x,I[c],a),c="checked",_!=null&&_!=t[c]&&at(t,c,_,I[c],a))}return t}function Zt(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(a){N.__e(a,n)}}function qn(t,e,n){var r,a;if(N.unmount&&N.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Zt(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){N.__e(i,e)}r.base=r.__P=null}if(r=t.__k)for(a=0;a<r.length;a++)r[a]&&qn(r[a],e,n||typeof t.type!="function");n||jt(t.__e),t.__c=t.__=t.__e=void 0}function Js(t,e,n){return this.constructor(t,n)}function er(t,e,n){var r,a,i,s;e==document&&(e=document.documentElement),N.__&&N.__(t,e),a=(r=!1)?null:e.__k,i=[],s=[],Ot(e,t=e.__k=We(X,null,[t]),a||qe,qe,e.namespaceURI,a?null:e.firstChild?Qe.call(e.childNodes):null,i,a?a.__e:e.firstChild,r,s),Kn(i,t,s)}Qe=et.slice,N={__e:function(t,e,n,r){for(var a,i,s;e=e.__;)if((a=e.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(t)),s=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(t,r||{}),s=a.__d),s)return a.__E=a}catch(o){t=o}throw t}},Wn=0,ce.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=oe({},this.state),typeof t=="function"&&(t=t(oe({},n),this.props)),t&&oe(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Gn(this))},ce.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Gn(this))},ce.prototype.render=X,ve=[],Un=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,zn=function(t,e){return t.__v.__b-e.__v.__b},nt.__r=0,Dn=/(PointerCapture)$|Capture$/i,Rt=0,Et=Jn(!1),Mt=Jn(!0);var $e,j,Vt,tr,it=0,nr=[],P=N,rr=P.__b,ar=P.__r,ir=P.diffed,sr=P.__c,or=P.unmount,cr=P.__;function Ft(t,e){P.__h&&P.__h(j,t,it||e),it=0;var n=j.__H||(j.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function st(t){return it=1,Ks(ur,t)}function Ks(t,e,n){var r=Ft($e++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):ur(void 0,e),function(o){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,o);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=j,!j.__f)){var a=function(o,l,c){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(m){return m.__c});if(u.every(function(m){return!m.__N}))return!i||i.call(this,o,l,c);var d=r.__c.props!==o;return u.some(function(m){if(m.__N){var h=m.__[0];m.__=m.__N,m.__N=void 0,h!==m.__[0]&&(d=!0)}}),i&&i.call(this,o,l,c)||d};j.__f=!0;var i=j.shouldComponentUpdate,s=j.componentWillUpdate;j.componentWillUpdate=function(o,l,c){if(this.__e){var u=i;i=void 0,a(o,l,c),i=u}s&&s.call(this,o,l,c)},j.shouldComponentUpdate=a}return r.__N||r.__}function ot(t,e){var n=Ft($e++,3);!P.__s&&dr(n.__H,e)&&(n.__=t,n.u=e,j.__H.__h.push(n))}function ct(t){return it=5,Qs(function(){return{current:t}},[])}function Qs(t,e){var n=Ft($e++,7);return dr(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function qs(){for(var t;t=nr.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(lt),e.__h.some(Wt),e.__h=[]}catch(n){e.__h=[],P.__e(n,t.__v)}}}P.__b=function(t){j=null,rr&&rr(t)},P.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),cr&&cr(t,e)},P.__r=function(t){ar&&ar(t),$e=0;var e=(j=t.__c).__H;e&&(Vt===j?(e.__h=[],j.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(lt),e.__h.some(Wt),e.__h=[],$e=0)),Vt=j},P.diffed=function(t){ir&&ir(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(nr.push(e)!==1&&tr===P.requestAnimationFrame||((tr=P.requestAnimationFrame)||eo)(qs)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Vt=j=null},P.__c=function(t,e){e.some(function(n){try{n.__h.some(lt),n.__h=n.__h.filter(function(r){return!r.__||Wt(r)})}catch(r){e.some(function(a){a.__h&&(a.__h=[])}),e=[],P.__e(r,n.__v)}}),sr&&sr(t,e)},P.unmount=function(t){or&&or(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(r){try{lt(r)}catch(a){e=a}}),n.__H=void 0,e&&P.__e(e,n.__v))};var lr=typeof requestAnimationFrame=="function";function eo(t){var e,n=function(){clearTimeout(r),lr&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);lr&&(e=requestAnimationFrame(n))}function lt(t){var e=j,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),j=e}function Wt(t){var e=j;t.__c=t.__(),j=e}function dr(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function ur(t,e){return typeof e=="function"?e(t):e}function to(t,e){for(var n in e)t[n]=e[n];return t}function fr(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return!0;for(var r in e)if(r!=="__source"&&t[r]!==e[r])return!0;return!1}function hr(t,e){this.props=t,this.context=e}(hr.prototype=new ce).isPureReactComponent=!0,hr.prototype.shouldComponentUpdate=function(t,e){return fr(this.props,t)||fr(this.state,e)};var mr=N.__b;N.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),mr&&mr(t)};var no=N.__e;N.__e=function(t,e,n,r){if(t.then){for(var a,i=e;i=i.__;)if((a=i.__c)&&a.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),a.__c(t,e)}no(t,e,n,r)};var pr=N.unmount;function gr(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),t.__c.__H=null),(t=to({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(r){return gr(r,e,n)})),t}function _r(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(r){return _r(r,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function $t(){this.__u=0,this.o=null,this.__b=null}function vr(t){if(!t.__)return null;var e=t.__.__c;return e&&e.__a&&e.__a(t)}function dt(){this.i=null,this.l=null}N.unmount=function(t){var e=t.__c;e&&(e.__z=!0),e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),pr&&pr(t)},($t.prototype=new ce).__c=function(t,e){var n=e.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var a=vr(r.__v),i=!1,s=function(){i||r.__z||(i=!0,n.__R=null,a?a(l):l())};n.__R=s;var o=n.__P;n.__P=null;var l=function(){if(!--r.__u){if(r.state.__a){var c=r.state.__a;r.__v.__k[0]=_r(c,c.__c.__P,c.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.o.pop();)u.__P=o,u.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(s,s)},$t.prototype.componentWillUnmount=function(){this.o=[]},$t.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=gr(this.__b,n,r.__O=r.__P)}this.__b=null}var a=e.__a&&We(X,null,t.fallback);return a&&(a.__u&=-33),[We(X,null,e.__a?null:t.children),a]};var yr=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};(dt.prototype=new ce).__a=function(t){var e=this,n=vr(e.__v),r=e.l.get(t);return r[0]++,function(a){var i=function(){e.props.revealOrder?(r.push(a),yr(e,t,r)):a()};n?n(i):i()}},dt.prototype.render=function(t){this.i=null,this.l=new Map;var e=rt(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},dt.prototype.componentDidUpdate=dt.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){yr(t,n,e)})};var ro=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,ao=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,io=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,so=/[A-Z0-9]/g,oo=typeof document<"u",co=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function lo(t,e,n){return e.__k==null&&(e.textContent=""),er(t,e),typeof n=="function"&&n(),t?t.__c:null}ce.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(ce.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var kr=N.event;function uo(){}function fo(){return this.cancelBubble}function ho(){return this.defaultPrevented}N.event=function(t){return kr&&(t=kr(t)),t.persist=uo,t.isPropagationStopped=fo,t.isDefaultPrevented=ho,t.nativeEvent=t};var mo={enumerable:!1,configurable:!0,get:function(){return this.class}},br=N.vnode;N.vnode=function(t){typeof t.type=="string"&&function(e){var n=e.props,r=e.type,a={},i=r.indexOf("-")===-1;for(var s in n){var o=n[s];if(!(s==="value"&&"defaultValue"in n&&o==null||oo&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var l=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&o===!0?o="":l==="translate"&&o==="no"?o=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?s="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||co(n.type)?l==="onfocus"?s="onfocusin":l==="onblur"?s="onfocusout":io.test(s)&&(s=l):l=s="oninput":i&&ao.test(s)?s=s.replace(so,"-$&").toLowerCase():o===null&&(o=void 0),l==="oninput"&&a[s=l]&&(s="oninputCapture"),a[s]=o}}r=="select"&&a.multiple&&Array.isArray(a.value)&&(a.value=rt(n.children).forEach(function(c){c.props.selected=a.value.indexOf(c.props.value)!=-1})),r=="select"&&a.defaultValue!=null&&(a.value=rt(n.children).forEach(function(c){c.props.selected=a.multiple?a.defaultValue.indexOf(c.props.value)!=-1:a.defaultValue==c.props.value})),n.class&&!n.className?(a.class=n.class,Object.defineProperty(a,"className",mo)):n.className&&(a.class=a.className=n.className),e.props=a}(t),t.$$typeof=ro,br&&br(t)};var xr=N.__r;N.__r=function(t){xr&&xr(t),t.__c};var wr=N.diffed;N.diffed=function(t){wr&&wr(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value)};function po(t){return!!t.__k&&(er(null,t),!0)}function go(t){return{render:function(e){lo(e,t)},unmount:function(){po(t)}}}function _o(t){const{theme:e}=t,n=[`--ak-accent: ${e.accentColor}`,`--ak-font: ${e.fontFamily}`,`--ak-radius: ${e.borderRadius}`];return n.push(`--ak-accent-hover: color-mix(in srgb, ${e.accentColor} 85%, black)`),`:host { ${n.join("; ")} }`}function vo(t){return t!=="system"?t:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const yo=`
1
+ var AgentKit=(function(kt){Object.defineProperty(kt,Symbol.toStringTag,{value:"Module"});var A;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{const i={};for(const s of a)i[s]=s;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),s={};for(const o of i)s[o]=a[o];return e.objectValues(s)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&i.push(s);return i},e.find=(a,i)=>{for(const s of a)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(A||(A={}));var lr;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(lr||(lr={}));var v=A.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fe=e=>{switch(typeof e){case"undefined":return v.undefined;case"string":return v.string;case"number":return Number.isNaN(e)?v.nan:v.number;case"boolean":return v.boolean;case"function":return v.function;case"bigint":return v.bigint;case"symbol":return v.symbol;case"object":return Array.isArray(e)?v.array:e===null?v.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?v.promise:typeof Map<"u"&&e instanceof Map?v.map:typeof Set<"u"&&e instanceof Set?v.set:typeof Date<"u"&&e instanceof Date?v.date:v.object;default:return v.unknown}},p=A.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"]),te=class Gn extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},n={_errors:[]},a=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(a);else if(s.code==="invalid_return_type")a(s.returnTypeError);else if(s.code==="invalid_arguments")a(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let o=n,l=0;for(;l<s.path.length;){const c=s.path[l];l!==s.path.length-1?o[c]=o[c]||{_errors:[]}:(o[c]=o[c]||{_errors:[]},o[c]._errors.push(r(s))),o=o[c],l++}}};return a(this),n}static assert(t){if(!(t instanceof Gn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,A.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];r[i]=r[i]||[],r[i].push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};te.create=e=>new te(e);var Ae=(e,t)=>{let r;switch(e.code){case p.invalid_type:e.received===v.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case p.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,A.jsonStringifyReplacer)}`;break;case p.unrecognized_keys:r=`Unrecognized key(s) in object: ${A.joinValues(e.keys,", ")}`;break;case p.invalid_union:r="Invalid input";break;case p.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${A.joinValues(e.options)}`;break;case p.invalid_enum_value:r=`Invalid enum value. Expected ${A.joinValues(e.options)}, received '${e.received}'`;break;case p.invalid_arguments:r="Invalid function arguments";break;case p.invalid_return_type:r="Invalid function return type";break;case p.invalid_date:r="Invalid date";break;case p.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:A.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case p.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case p.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case p.custom:r="Invalid input";break;case p.invalid_intersection_types:r="Intersection results could not be merged";break;case p.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case p.not_finite:r="Number must be finite";break;default:r=t.defaultError,A.assertNever(e)}return{message:r}},qn=Ae;function bt(){return qn}var xt=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,i=[...r,...a.path||[]],s={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let o="";const l=n.filter(c=>!!c).slice().reverse();for(const c of l)o=c(s,{data:t,defaultError:o}).message;return{...a,path:i,message:o}};function g(e,t){const r=bt(),n=xt({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Ae?void 0:Ae].filter(a=>!!a)});e.common.issues.push(n)}var U=class Yn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const a of r){if(a.status==="aborted")return w;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const a of r){const i=await a.key,s=await a.value;n.push({key:i,value:s})}return Yn.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const a of r){const{key:i,value:s}=a;if(i.status==="aborted"||s.status==="aborted")return w;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||a.alwaysSet)&&(n[i.value]=s.value)}return{status:t.value,value:n}}},w=Object.freeze({status:"aborted"}),Re=e=>({status:"dirty",value:e}),D=e=>({status:"valid",value:e}),dr=e=>e.status==="aborted",ur=e=>e.status==="dirty",ye=e=>e.status==="valid",Be=e=>typeof Promise<"u"&&e instanceof Promise,b;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(b||(b={}));var re=class{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},fr=(e,t)=>{if(ye(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){return this._error?this._error:(this._error=new te(e.common.issues),this._error)}}};function I(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(s,o)=>{const{message:l}=e;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??n??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??r??o.defaultError}},description:a}}var T=class{get description(){return this._def.description}_getType(e){return fe(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:fe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new U,ctx:{common:e.parent.common,data:e.data,parsedType:fe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Be(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fe(e)};return fr(r,this._parseSync({data:e,path:r.path,parent:r}))}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fe(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:t});return ye(r)?{value:r.value}:{issues:t.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(r=>ye(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fe(e)},n=this._parse({data:e,path:r.path,parent:r});return fr(r,await(Be(n)?n:Promise.resolve(n)))}refine(e,t){const r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),s=()=>a.addIssue({code:p.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(o=>o?!0:(s(),!1)):i?!0:(s(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new se({schema:this,typeName:S.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return oe.create(this,this._def)}nullable(){return _e.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return be.create(this)}promise(){return Ee.create(this,this._def)}or(e){return Xe.create([this,e],this._def)}and(e){return Je.create(this,e,this._def)}transform(e){return new se({...I(this._def),schema:this,typeName:S.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new tt({...I(this._def),innerType:this,defaultValue:t,typeName:S.ZodDefault})}brand(){return new gr({typeName:S.ZodBranded,type:this,...I(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new rt({...I(this._def),innerType:this,catchValue:t,typeName:S.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return _r.create(this,e)}readonly(){return nt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ea=/^c[^\s-]{8,}$/i,ta=/^[0-9a-z]+$/,ra=/^[0-9A-HJKMNP-TV-Z]{26}$/i,na=/^[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,aa=/^[a-z0-9_-]{21}$/i,ia=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,sa=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,oa=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ca="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",wt,la=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,da=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ua=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,fa=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ha=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ma=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,hr="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",pa=new RegExp(`^${hr}$`);function mr(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function ga(e){return new RegExp(`^${mr(e)}$`)}function _a(e){let t=`${hr}T${mr(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function va(e,t){return!!((t==="v4"||!t)&&la.test(e)||(t==="v6"||!t)&&ua.test(e))}function ya(e,t){if(!ia.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function ka(e,t){return!!((t==="v4"||!t)&&da.test(e)||(t==="v6"||!t)&&fa.test(e))}var He=class Ue extends T{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==v.string){const a=this._getOrReturnCtx(t);return g(a,{code:p.invalid_type,expected:v.string,received:a.parsedType}),w}const r=new U;let n;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(n=this._getOrReturnCtx(t,n),g(n,{code:p.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(n=this._getOrReturnCtx(t,n),g(n,{code:p.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const i=t.data.length>a.value,s=t.data.length<a.value;(i||s)&&(n=this._getOrReturnCtx(t,n),i?g(n,{code:p.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&g(n,{code:p.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")oa.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"email",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")wt||(wt=new RegExp(ca,"u")),wt.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"emoji",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")na.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"uuid",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")aa.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"nanoid",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")ea.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"cuid",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")ta.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"cuid2",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")ra.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"ulid",code:p.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),g(n,{validation:"url",code:p.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"regex",code:p.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(t,n),g(n,{code:p.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(n=this._getOrReturnCtx(t,n),g(n,{code:p.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(n=this._getOrReturnCtx(t,n),g(n,{code:p.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?_a(a).test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{code:p.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?pa.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{code:p.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?ga(a).test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{code:p.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?sa.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"duration",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?va(t.data,a.version)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"ip",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?ya(t.data,a.alg)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"jwt",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?ka(t.data,a.version)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"cidr",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?ha.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"base64",code:p.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?ma.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"base64url",code:p.invalid_string,message:a.message}),r.dirty()):A.assertNever(a);return{status:r.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:p.invalid_string,...b.errToObj(n)})}_addCheck(t){return new Ue({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...b.errToObj(t)})}url(t){return this._addCheck({kind:"url",...b.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...b.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...b.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...b.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...b.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...b.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...b.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...b.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...b.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...b.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...b.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...b.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...b.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...b.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...b.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...b.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...b.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...b.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...b.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...b.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...b.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...b.errToObj(r)})}nonempty(t){return this.min(1,b.errToObj(t))}trim(){return new Ue({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ue({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ue({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};He.create=e=>new He({checks:[],typeName:S.ZodString,coerce:e?.coerce??!1,...I(e)});function ba(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(t.toFixed(a).replace(".",""))/10**a}var St=class ar extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==v.number){const a=this._getOrReturnCtx(t);return g(a,{code:p.invalid_type,expected:v.number,received:a.parsedType}),w}let r;const n=new U;for(const a of this._def.checks)a.kind==="int"?A.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),g(r,{code:p.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),g(r,{code:p.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),g(r,{code:p.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?ba(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),g(r,{code:p.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),g(r,{code:p.not_finite,message:a.message}),n.dirty()):A.assertNever(a);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,b.toString(r))}gt(t,r){return this.setLimit("min",t,!1,b.toString(r))}lte(t,r){return this.setLimit("max",t,!0,b.toString(r))}lt(t,r){return this.setLimit("max",t,!1,b.toString(r))}setLimit(t,r,n,a){return new ar({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:b.toString(a)}]})}_addCheck(t){return new ar({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:b.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:b.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:b.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&A.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};St.create=e=>new St({checks:[],typeName:S.ZodNumber,coerce:e?.coerce||!1,...I(e)});var Ct=class ir extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==v.bigint)return this._getInvalidInput(t);let r;const n=new U;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),g(r,{code:p.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),g(r,{code:p.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),g(r,{code:p.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):A.assertNever(a);return{status:n.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return g(r,{code:p.invalid_type,expected:v.bigint,received:r.parsedType}),w}gte(t,r){return this.setLimit("min",t,!0,b.toString(r))}gt(t,r){return this.setLimit("min",t,!1,b.toString(r))}lte(t,r){return this.setLimit("max",t,!0,b.toString(r))}lt(t,r){return this.setLimit("max",t,!1,b.toString(r))}setLimit(t,r,n,a){return new ir({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:b.toString(a)}]})}_addCheck(t){return new ir({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:b.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Ct.create=e=>new Ct({checks:[],typeName:S.ZodBigInt,coerce:e?.coerce??!1,...I(e)});var It=class extends T{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==v.boolean){const t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:v.boolean,received:t.parsedType}),w}return D(e.data)}};It.create=e=>new It({typeName:S.ZodBoolean,coerce:e?.coerce||!1,...I(e)});var Nt=class Xn extends T{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==v.date){const a=this._getOrReturnCtx(t);return g(a,{code:p.invalid_type,expected:v.date,received:a.parsedType}),w}if(Number.isNaN(t.data.getTime()))return g(this._getOrReturnCtx(t),{code:p.invalid_date}),w;const r=new U;let n;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(n=this._getOrReturnCtx(t,n),g(n,{code:p.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(n=this._getOrReturnCtx(t,n),g(n,{code:p.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):A.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Xn({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:b.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:b.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Nt.create=e=>new Nt({checks:[],coerce:e?.coerce||!1,typeName:S.ZodDate,...I(e)});var Tt=class extends T{_parse(e){if(this._getType(e)!==v.symbol){const t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:v.symbol,received:t.parsedType}),w}return D(e.data)}};Tt.create=e=>new Tt({typeName:S.ZodSymbol,...I(e)});var Ge=class extends T{_parse(e){if(this._getType(e)!==v.undefined){const t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:v.undefined,received:t.parsedType}),w}return D(e.data)}};Ge.create=e=>new Ge({typeName:S.ZodUndefined,...I(e)});var Ye=class extends T{_parse(e){if(this._getType(e)!==v.null){const t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:v.null,received:t.parsedType}),w}return D(e.data)}};Ye.create=e=>new Ye({typeName:S.ZodNull,...I(e)});var Lt=class extends T{constructor(){super(...arguments),this._any=!0}_parse(e){return D(e.data)}};Lt.create=e=>new Lt({typeName:S.ZodAny,...I(e)});var ke=class extends T{constructor(){super(...arguments),this._unknown=!0}_parse(e){return D(e.data)}};ke.create=e=>new ke({typeName:S.ZodUnknown,...I(e)});var he=class extends T{_parse(e){const t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:v.never,received:t.parsedType}),w}};he.create=e=>new he({typeName:S.ZodNever,...I(e)});var At=class extends T{_parse(e){if(this._getType(e)!==v.undefined){const t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:v.void,received:t.parsedType}),w}return D(e.data)}};At.create=e=>new At({typeName:S.ZodVoid,...I(e)});var be=class vt extends T{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==v.array)return g(r,{code:p.invalid_type,expected:v.array,received:r.parsedType}),w;if(a.exactLength!==null){const s=r.data.length>a.exactLength.value,o=r.data.length<a.exactLength.value;(s||o)&&(g(r,{code:s?p.too_big:p.too_small,minimum:o?a.exactLength.value:void 0,maximum:s?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(g(r,{code:p.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(g(r,{code:p.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,o)=>a.type._parseAsync(new re(r,s,r.path,o)))).then(s=>U.mergeArray(n,s));const i=[...r.data].map((s,o)=>a.type._parseSync(new re(r,s,r.path,o)));return U.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new vt({...this._def,minLength:{value:t,message:b.toString(r)}})}max(t,r){return new vt({...this._def,maxLength:{value:t,message:b.toString(r)}})}length(t,r){return new vt({...this._def,exactLength:{value:t,message:b.toString(r)}})}nonempty(t){return this.min(1,t)}};be.create=(e,t)=>new be({type:e,minLength:null,maxLength:null,exactLength:null,typeName:S.ZodArray,...I(t)});function xe(e){if(e instanceof J){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=oe.create(xe(n))}return new J({...e._def,shape:()=>t})}else return e instanceof be?new be({...e._def,type:xe(e.element)}):e instanceof oe?oe.create(xe(e.unwrap())):e instanceof _e?_e.create(xe(e.unwrap())):e instanceof ge?ge.create(e.items.map(t=>xe(t))):e}var J=class ee extends T{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape();return this._cached={shape:t,keys:A.objectKeys(t)},this._cached}_parse(t){if(this._getType(t)!==v.object){const l=this._getOrReturnCtx(t);return g(l,{code:p.invalid_type,expected:v.object,received:l.parsedType}),w}const{status:r,ctx:n}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof he&&this._def.unknownKeys==="strip"))for(const l in n.data)i.includes(l)||s.push(l);const o=[];for(const l of i){const c=a[l],f=n.data[l];o.push({key:{status:"valid",value:l},value:c._parse(new re(n,f,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof he){const l=this._def.unknownKeys;if(l==="passthrough")for(const c of s)o.push({key:{status:"valid",value:c},value:{status:"valid",value:n.data[c]}});else if(l==="strict")s.length>0&&(g(n,{code:p.unrecognized_keys,keys:s}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const c of s){const f=n.data[c];o.push({key:{status:"valid",value:c},value:l._parse(new re(n,f,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const l=[];for(const c of o){const f=await c.key,d=await c.value;l.push({key:f,value:d,alwaysSet:c.alwaysSet})}return l}).then(l=>U.mergeObjectSync(r,l)):U.mergeObjectSync(r,o)}get shape(){return this._def.shape()}strict(t){return b.errToObj,new ee({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{const a=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:b.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new ee({...this._def,unknownKeys:"strip"})}passthrough(){return new ee({...this._def,unknownKeys:"passthrough"})}extend(t){return new ee({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ee({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:S.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new ee({...this._def,catchall:t})}pick(t){const r={};for(const n of A.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new ee({...this._def,shape:()=>r})}omit(t){const r={};for(const n of A.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new ee({...this._def,shape:()=>r})}deepPartial(){return xe(this)}partial(t){const r={};for(const n of A.objectKeys(this.shape)){const a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}return new ee({...this._def,shape:()=>r})}required(t){const r={};for(const n of A.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof oe;)a=a._def.innerType;r[n]=a}return new ee({...this._def,shape:()=>r})}keyof(){return pr(A.objectKeys(this.shape))}};J.create=(e,t)=>new J({shape:()=>e,unknownKeys:"strip",catchall:he.create(),typeName:S.ZodObject,...I(t)}),J.strictCreate=(e,t)=>new J({shape:()=>e,unknownKeys:"strict",catchall:he.create(),typeName:S.ZodObject,...I(t)}),J.lazycreate=(e,t)=>new J({shape:e,unknownKeys:"strip",catchall:he.create(),typeName:S.ZodObject,...I(t)});var Xe=class extends T{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(const s of a)if(s.result.status==="valid")return s.result;for(const s of a)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;const i=a.map(s=>new te(s.ctx.common.issues));return g(t,{code:p.invalid_union,unionErrors:i}),w}if(t.common.async)return Promise.all(r.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const o of r){const l={...t,common:{...t.common,issues:[]},parent:null},c=o._parseSync({data:t.data,path:t.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!a&&(a={result:c,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const s=i.map(o=>new te(o));return g(t,{code:p.invalid_union,unionErrors:s}),w}}get options(){return this._def.options}};Xe.create=(e,t)=>new Xe({options:e,typeName:S.ZodUnion,...I(t)});var ie=e=>e instanceof Qe?ie(e.schema):e instanceof se?ie(e.innerType()):e instanceof Ke?[e.value]:e instanceof qe?e.options:e instanceof et?A.objectValues(e.enum):e instanceof tt?ie(e._def.innerType):e instanceof Ge?[void 0]:e instanceof Ye?[null]:e instanceof oe?[void 0,...ie(e.unwrap())]:e instanceof _e?[null,...ie(e.unwrap())]:e instanceof gr||e instanceof nt?ie(e.unwrap()):e instanceof rt?ie(e._def.innerType):[],xa=class Jn extends T{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==v.object)return g(r,{code:p.invalid_type,expected:v.object,received:r.parsedType}),w;const n=this.discriminator,a=r.data[n],i=this.optionsMap.get(a);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(g(r,{code:p.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),w)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const a=new Map;for(const i of r){const s=ie(i.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const o of s){if(a.has(o))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(o)}`);a.set(o,i)}}return new Jn({typeName:S.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...I(n)})}};function Rt(e,t){const r=fe(e),n=fe(t);if(e===t)return{valid:!0,data:e};if(r===v.object&&n===v.object){const a=A.objectKeys(t),i=A.objectKeys(e).filter(o=>a.indexOf(o)!==-1),s={...e,...t};for(const o of i){const l=Rt(e[o],t[o]);if(!l.valid)return{valid:!1};s[o]=l.data}return{valid:!0,data:s}}else if(r===v.array&&n===v.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const s=e[i],o=t[i],l=Rt(s,o);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return r===v.date&&n===v.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Je=class extends T{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(a,i)=>{if(dr(a)||dr(i))return w;const s=Rt(a.value,i.value);return s.valid?((ur(a)||ur(i))&&t.dirty(),{status:t.value,value:s.data}):(g(r,{code:p.invalid_intersection_types}),w)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Je.create=(e,t,r)=>new Je({left:e,right:t,typeName:S.ZodIntersection,...I(r)});var ge=class Qn extends T{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==v.array)return g(n,{code:p.invalid_type,expected:v.array,received:n.parsedType}),w;if(n.data.length<this._def.items.length)return g(n,{code:p.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),w;!this._def.rest&&n.data.length>this._def.items.length&&(g(n,{code:p.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((i,s)=>{const o=this._def.items[s]||this._def.rest;return o?o._parse(new re(n,i,n.path,s)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>U.mergeArray(r,i)):U.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new Qn({...this._def,rest:t})}};ge.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ge({items:e,typeName:S.ZodTuple,rest:null,...I(t)})};var wa=class sr extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==v.object)return g(n,{code:p.invalid_type,expected:v.object,received:n.parsedType}),w;const a=[],i=this._def.keyType,s=this._def.valueType;for(const o in n.data)a.push({key:i._parse(new re(n,o,n.path,o)),value:s._parse(new re(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?U.mergeObjectAsync(r,a):U.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof T?new sr({keyType:t,valueType:r,typeName:S.ZodRecord,...I(n)}):new sr({keyType:He.create(),valueType:t,typeName:S.ZodRecord,...I(r)})}},Et=class extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==v.map)return g(r,{code:p.invalid_type,expected:v.map,received:r.parsedType}),w;const n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([s,o],l)=>({key:n._parse(new re(r,s,r.path,[l,"key"])),value:a._parse(new re(r,o,r.path,[l,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const o of i){const l=await o.key,c=await o.value;if(l.status==="aborted"||c.status==="aborted")return w;(l.status==="dirty"||c.status==="dirty")&&t.dirty(),s.set(l.value,c.value)}return{status:t.value,value:s}})}else{const s=new Map;for(const o of i){const l=o.key,c=o.value;if(l.status==="aborted"||c.status==="aborted")return w;(l.status==="dirty"||c.status==="dirty")&&t.dirty(),s.set(l.value,c.value)}return{status:t.value,value:s}}}};Et.create=(e,t,r)=>new Et({valueType:t,keyType:e,typeName:S.ZodMap,...I(r)});var Zt=class or extends T{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==v.set)return g(n,{code:p.invalid_type,expected:v.set,received:n.parsedType}),w;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(g(n,{code:p.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(g(n,{code:p.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const i=this._def.valueType;function s(l){const c=new Set;for(const f of l){if(f.status==="aborted")return w;f.status==="dirty"&&r.dirty(),c.add(f.value)}return{status:r.value,value:c}}const o=[...n.data.values()].map((l,c)=>i._parse(new re(n,l,n.path,c)));return n.common.async?Promise.all(o).then(l=>s(l)):s(o)}min(t,r){return new or({...this._def,minSize:{value:t,message:b.toString(r)}})}max(t,r){return new or({...this._def,maxSize:{value:t,message:b.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Zt.create=(e,t)=>new Zt({valueType:e,minSize:null,maxSize:null,typeName:S.ZodSet,...I(t)});var Sa=class yt extends T{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==v.function)return g(r,{code:p.invalid_type,expected:v.function,received:r.parsedType}),w;function n(o,l){return xt({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,bt(),Ae].filter(c=>!!c),issueData:{code:p.invalid_arguments,argumentsError:l}})}function a(o,l){return xt({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,bt(),Ae].filter(c=>!!c),issueData:{code:p.invalid_return_type,returnTypeError:l}})}const i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Ee){const o=this;return D(async function(...l){const c=new te([]),f=await o._def.args.parseAsync(l,i).catch(m=>{throw c.addIssue(n(l,m)),c}),d=await Reflect.apply(s,this,f);return await o._def.returns._def.type.parseAsync(d,i).catch(m=>{throw c.addIssue(a(d,m)),c})})}else{const o=this;return D(function(...l){const c=o._def.args.safeParse(l,i);if(!c.success)throw new te([n(l,c.error)]);const f=Reflect.apply(s,this,c.data),d=o._def.returns.safeParse(f,i);if(!d.success)throw new te([a(f,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new yt({...this._def,args:ge.create(t).rest(ke.create())})}returns(t){return new yt({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new yt({args:t||ge.create([]).rest(ke.create()),returns:r||ke.create(),typeName:S.ZodFunction,...I(n)})}},Qe=class extends T{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Qe.create=(e,t)=>new Qe({getter:e,typeName:S.ZodLazy,...I(t)});var Ke=class extends T{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return g(t,{received:t.data,code:p.invalid_literal,expected:this._def.value}),w}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ke.create=(e,t)=>new Ke({value:e,typeName:S.ZodLiteral,...I(t)});function pr(e,t){return new qe({values:e,typeName:S.ZodEnum,...I(t)})}var qe=class cr extends T{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return g(r,{expected:A.joinValues(n),received:r.parsedType,code:p.invalid_type}),w}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return g(r,{received:r.data,code:p.invalid_enum_value,options:n}),w}return D(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return cr.create(t,{...this._def,...r})}exclude(t,r=this._def){return cr.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};qe.create=pr;var et=class extends T{_parse(e){const t=A.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==v.string&&r.parsedType!==v.number){const n=A.objectValues(t);return g(r,{expected:A.joinValues(n),received:r.parsedType,code:p.invalid_type}),w}if(this._cache||(this._cache=new Set(A.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=A.objectValues(t);return g(r,{received:r.data,code:p.invalid_enum_value,options:n}),w}return D(e.data)}get enum(){return this._def.values}};et.create=(e,t)=>new et({values:e,typeName:S.ZodNativeEnum,...I(t)});var Ee=class extends T{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);return t.parsedType!==v.promise&&t.common.async===!1?(g(t,{code:p.invalid_type,expected:v.promise,received:t.parsedType}),w):D((t.parsedType===v.promise?t.data:Promise.resolve(t.data)).then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Ee.create=(e,t)=>new Ee({type:e,typeName:S.ZodPromise,...I(t)});var se=class extends T{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===S.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{g(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async s=>{if(t.value==="aborted")return w;const o=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return o.status==="aborted"?w:o.status==="dirty"||t.value==="dirty"?Re(o.value):o});{if(t.value==="aborted")return w;const s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?w:s.status==="dirty"||t.value==="dirty"?Re(s.value):s}}if(n.type==="refinement"){const i=s=>{const o=n.refinement(s,a);if(r.common.async)return Promise.resolve(o);if(o instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?w:(s.status==="dirty"&&t.dirty(),i(s.value),{status:t.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?w:(s.status==="dirty"&&t.dirty(),i(s.value).then(()=>({status:t.value,value:s.value}))))}if(n.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ye(i))return w;const s=n.transform(i.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>ye(i)?Promise.resolve(n.transform(i.value,a)).then(s=>({status:t.value,value:s})):w);A.assertNever(n)}};se.create=(e,t,r)=>new se({schema:e,typeName:S.ZodEffects,effect:t,...I(r)}),se.createWithPreprocess=(e,t,r)=>new se({schema:t,effect:{type:"preprocess",transform:e},typeName:S.ZodEffects,...I(r)});var oe=class extends T{_parse(e){return this._getType(e)===v.undefined?D(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};oe.create=(e,t)=>new oe({innerType:e,typeName:S.ZodOptional,...I(t)});var _e=class extends T{_parse(e){return this._getType(e)===v.null?D(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};_e.create=(e,t)=>new _e({innerType:e,typeName:S.ZodNullable,...I(t)});var tt=class extends T{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===v.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};tt.create=(e,t)=>new tt({innerType:e,typeName:S.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...I(t)});var rt=class extends T{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Be(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new te(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new te(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};rt.create=(e,t)=>new rt({innerType:e,typeName:S.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...I(t)});var jt=class extends T{_parse(e){if(this._getType(e)!==v.nan){const t=this._getOrReturnCtx(e);return g(t,{code:p.invalid_type,expected:v.nan,received:t.parsedType}),w}return{status:"valid",value:e.data}}};jt.create=e=>new jt({typeName:S.ZodNaN,...I(e)});var gr=class extends T{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}},_r=class Kn extends T{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?w:i.status==="dirty"?(r.dirty(),Re(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?w:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new Kn({in:t,out:r,typeName:S.ZodPipeline})}},nt=class extends T{_parse(e){const t=this._def.innerType._parse(e),r=n=>(ye(n)&&(n.value=Object.freeze(n.value)),n);return Be(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}};nt.create=(e,t)=>new nt({innerType:e,typeName:S.ZodReadonly,...I(t)});var lc={object:J.lazycreate},S;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(S||(S={}));var $=He.create,dc=St.create,uc=jt.create,fc=Ct.create,Ca=It.create,hc=Nt.create,mc=Tt.create,pc=Ge.create,gc=Ye.create,_c=Lt.create,Ia=ke.create,vc=he.create,yc=At.create,kc=be.create,Mt=J.create,bc=J.strictCreate,xc=Xe.create,wc=xa.create,Sc=Je.create,Cc=ge.create,Na=wa.create,Ic=Et.create,Nc=Zt.create,Tc=Sa.create,Lc=Qe.create,Ac=Ke.create,vr=qe.create,Rc=et.create,Ec=Ee.create,Zc=se.create,jc=oe.create,Mc=_e.create,Oc=se.createWithPreprocess,Pc=_r.create,Ta=Mt({mode:vr(["light","dark","system"]).optional(),accentColor:$().optional(),fontFamily:$().optional(),borderRadius:$().optional()}),La=Mt({externalId:$().optional(),authId:$().optional(),name:$().optional(),email:$().optional()}),yr=Mt({agentId:$().min(1,"agentId is required"),apiBaseUrl:$().url("apiBaseUrl must be a valid URL"),tenantId:$().optional(),user:La.optional(),sessionId:$().optional(),mode:vr(["floating","inline"]).optional(),title:$().optional(),subtitle:$().optional(),description:$().optional(),greeting:$().optional(),avatarUrl:$().optional(),privacyPolicyUrl:$().optional(),streaming:Ca().optional(),metadata:Na(Ia()).optional(),theme:Ta.optional()}),Aa=yr.omit({agentId:!0,apiBaseUrl:!0}).partial(),ve={mode:"floating",streaming:!0,title:"AI Assistant",theme:{mode:"light",accentColor:"#6366f1",fontFamily:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",borderRadius:"12px"}};function Ze(e,t){yr.parse(e);let r;const n=t?{...t}:void 0;n&&typeof n.theme=="object"&&n.theme!==null?(r=n.theme,delete n.theme):n&&typeof n.theme=="string"&&(r={mode:n.theme},delete n.theme);const a=n?Aa.passthrough().safeParse(n).data:void 0,i=a?kr(a,e):e,s={mode:i.theme?.mode??r?.mode??ve.theme.mode,accentColor:i.theme?.accentColor??r?.accentColor??ve.theme.accentColor,fontFamily:i.theme?.fontFamily??r?.fontFamily??ve.theme.fontFamily,borderRadius:i.theme?.borderRadius??r?.borderRadius??ve.theme.borderRadius};return{agentId:i.agentId,apiBaseUrl:i.apiBaseUrl.replace(/\/$/,""),tenantId:i.tenantId,user:{externalId:i.user?.externalId,authId:i.user?.authId,name:i.user?.name,email:i.user?.email},sessionId:i.sessionId,mode:i.mode??ve.mode,title:i.title??ve.title,subtitle:i.subtitle,description:i.description,greeting:i.greeting,avatarUrl:i.avatarUrl,privacyPolicyUrl:i.privacyPolicyUrl,streaming:i.streaming??ve.streaming,metadata:i.metadata??{},theme:s,thinkingEnabled:a?.thinkingEnabled===!0,thinkingViewable:a?.thinkingViewable===!0,photoSendingEnabled:a?.photoSendingEnabled===!0}}function kr(e,t){const r={...e};for(const n of Object.keys(t)){const a=t[n];a!=null&&(typeof a=="object"&&!Array.isArray(a)&&r[n]!==null&&typeof r[n]=="object"?r[n]=kr(r[n],a):r[n]=a)}return r}var Ot=function(){return Ot=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ot.apply(this,arguments)};function ne(e,t,r,n){function a(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function o(f){try{c(n.next(f))}catch(d){s(d)}}function l(f){try{c(n.throw(f))}catch(d){s(d)}}function c(f){f.done?i(f.value):a(f.value).then(o,l)}c((n=n.apply(e,t||[])).next())})}function ae(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(f){return l([c,f])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,a&&(i=c[0]&2?a.return:c[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,c[1])).done)return i;switch(a=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,a=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(f){c=[6,f],a=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function br(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,i;n<a;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var xr="4.6.2";function at(e,t){return new Promise(function(r){return setTimeout(r,e,t)})}function Ra(){return new Promise(function(e){var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(null)})}function Ea(e,t){t===void 0&&(t=1/0);var r=window.requestIdleCallback;return r?new Promise(function(n){return r.call(window,function(){return n()},{timeout:t})}):at(Math.min(e,t))}function wr(e){return!!e&&typeof e.then=="function"}function Sr(e,t){try{var r=e();wr(r)?r.then(function(n){return t(!0,n)},function(n){return t(!1,n)}):t(!0,r)}catch(n){t(!1,n)}}function Cr(e,t,r){return r===void 0&&(r=16),ne(this,void 0,void 0,function(){var n,a,i,s;return ae(this,function(o){switch(o.label){case 0:n=Array(e.length),a=Date.now(),i=0,o.label=1;case 1:return i<e.length?(n[i]=t(e[i],i),s=Date.now(),s>=a+r?(a=s,[4,Ra()]):[3,3]):[3,4];case 2:o.sent(),o.label=3;case 3:return++i,[3,1];case 4:return[2,n]}})})}function je(e){return e.then(void 0,function(){}),e}function Za(e,t){for(var r=0,n=e.length;r<n;++r)if(e[r]===t)return!0;return!1}function ja(e,t){return!Za(e,t)}function Pt(e){return parseInt(e)}function Q(e){return parseFloat(e)}function ce(e,t){return typeof e=="number"&&isNaN(e)?t:e}function F(e){return e.reduce(function(t,r){return t+(r?1:0)},0)}function Ir(e,t){if(t===void 0&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var r=1/t;return Math.round(e*r)/r}function Ma(e){for(var t,r,n="Unexpected syntax '".concat(e,"'"),a=/^\s*([a-z-]*)(.*)$/i.exec(e),i=a[1]||void 0,s={},o=/([.:#][\w-]+|\[.+?\])/gi,l=function(m,h){s[m]=s[m]||[],s[m].push(h)};;){var c=o.exec(a[2]);if(!c)break;var f=c[0];switch(f[0]){case".":l("class",f.slice(1));break;case"#":l("id",f.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(f);if(d)l(d[1],(r=(t=d[4])!==null&&t!==void 0?t:d[5])!==null&&r!==void 0?r:"");else throw new Error(n);break;default:throw new Error(n)}}return[i,s]}function Oa(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n>127)return new TextEncoder().encode(e);t[r]=n}return t}function me(e,t){var r=e[0]>>>16,n=e[0]&65535,a=e[1]>>>16,i=e[1]&65535,s=t[0]>>>16,o=t[0]&65535,l=t[1]>>>16,c=t[1]&65535,f=0,d=0,m=0,h=0;h+=i+c,m+=h>>>16,h&=65535,m+=a+l,d+=m>>>16,m&=65535,d+=n+o,f+=d>>>16,d&=65535,f+=r+s,f&=65535,e[0]=f<<16|d,e[1]=m<<16|h}function Y(e,t){var r=e[0]>>>16,n=e[0]&65535,a=e[1]>>>16,i=e[1]&65535,s=t[0]>>>16,o=t[0]&65535,l=t[1]>>>16,c=t[1]&65535,f=0,d=0,m=0,h=0;h+=i*c,m+=h>>>16,h&=65535,m+=a*c,d+=m>>>16,m&=65535,m+=i*l,d+=m>>>16,m&=65535,d+=n*c,f+=d>>>16,d&=65535,d+=a*l,f+=d>>>16,d&=65535,d+=i*o,f+=d>>>16,d&=65535,f+=r*c+n*l+a*o+i*s,f&=65535,e[0]=f<<16|d,e[1]=m<<16|h}function we(e,t){var r=e[0];t%=64,t===32?(e[0]=e[1],e[1]=r):t<32?(e[0]=r<<t|e[1]>>>32-t,e[1]=e[1]<<t|r>>>32-t):(t-=32,e[0]=e[1]<<t|r>>>32-t,e[1]=r<<t|e[1]>>>32-t)}function B(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function j(e,t){e[0]^=t[0],e[1]^=t[1]}var Pa=[4283543511,3981806797],Va=[3301882366,444984403];function Nr(e){var t=[0,e[0]>>>1];j(e,t),Y(e,Pa),t[1]=e[0]>>>1,j(e,t),Y(e,Va),t[1]=e[0]>>>1,j(e,t)}var it=[2277735313,289559509],st=[1291169091,658871167],Tr=[0,5],$a=[0,1390208809],Fa=[0,944331445];function Wa(e,t){var r=Oa(e);t=t||0;var n=[0,r.length],a=n[1]%16,i=n[1]-a,s=[0,t],o=[0,t],l=[0,0],c=[0,0],f;for(f=0;f<i;f=f+16)l[0]=r[f+4]|r[f+5]<<8|r[f+6]<<16|r[f+7]<<24,l[1]=r[f]|r[f+1]<<8|r[f+2]<<16|r[f+3]<<24,c[0]=r[f+12]|r[f+13]<<8|r[f+14]<<16|r[f+15]<<24,c[1]=r[f+8]|r[f+9]<<8|r[f+10]<<16|r[f+11]<<24,Y(l,it),we(l,31),Y(l,st),j(s,l),we(s,27),me(s,o),Y(s,Tr),me(s,$a),Y(c,st),we(c,33),Y(c,it),j(o,c),we(o,31),me(o,s),Y(o,Tr),me(o,Fa);l[0]=0,l[1]=0,c[0]=0,c[1]=0;var d=[0,0];switch(a){case 15:d[1]=r[f+14],B(d,48),j(c,d);case 14:d[1]=r[f+13],B(d,40),j(c,d);case 13:d[1]=r[f+12],B(d,32),j(c,d);case 12:d[1]=r[f+11],B(d,24),j(c,d);case 11:d[1]=r[f+10],B(d,16),j(c,d);case 10:d[1]=r[f+9],B(d,8),j(c,d);case 9:d[1]=r[f+8],j(c,d),Y(c,st),we(c,33),Y(c,it),j(o,c);case 8:d[1]=r[f+7],B(d,56),j(l,d);case 7:d[1]=r[f+6],B(d,48),j(l,d);case 6:d[1]=r[f+5],B(d,40),j(l,d);case 5:d[1]=r[f+4],B(d,32),j(l,d);case 4:d[1]=r[f+3],B(d,24),j(l,d);case 3:d[1]=r[f+2],B(d,16),j(l,d);case 2:d[1]=r[f+1],B(d,8),j(l,d);case 1:d[1]=r[f],j(l,d),Y(l,it),we(l,31),Y(l,st),j(s,l)}return j(s,n),j(o,n),me(s,o),me(o,s),Nr(s),Nr(o),me(s,o),me(o,s),("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)}function za(e){var t;return Ot({name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
2
+ `)},e)}function Da(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function Ua(e){return typeof e!="function"}function Ba(e,t){var r=je(new Promise(function(n){var a=Date.now();Sr(e.bind(null,t),function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];var o=Date.now()-a;if(!i[0])return n(function(){return{error:i[1],duration:o}});var l=i[1];if(Ua(l))return n(function(){return{value:l,duration:o}});n(function(){return new Promise(function(c){var f=Date.now();Sr(l,function(){for(var d=[],m=0;m<arguments.length;m++)d[m]=arguments[m];var h=o+Date.now()-f;if(!d[0])return c({error:d[1],duration:h});c({value:d[1],duration:h})})})})})}));return function(){return r.then(function(a){return a()})}}function Ha(e,t,r,n){var a=Object.keys(e).filter(function(s){return ja(r,s)}),i=je(Cr(a,function(s){return Ba(e[s],t)},n));return function(){return ne(this,void 0,void 0,function(){var o,l,c,f,d;return ae(this,function(m){switch(m.label){case 0:return[4,i];case 1:return o=m.sent(),[4,Cr(o,function(h){return je(h())},n)];case 2:return l=m.sent(),[4,Promise.all(l)];case 3:for(c=m.sent(),f={},d=0;d<a.length;++d)f[a[d]]=c[d];return[2,f]}})})}}function Lr(){var e=window,t=navigator;return F(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Ga(){var e=window,t=navigator;return F(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Lr()}function Me(){var e=window,t=navigator;return F(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function K(){var e=window,t=navigator;return F(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function Vt(){var e=window,t=e.HTMLElement,r=e.Document;return F(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),r&&"pointerLockElement"in r.prototype])>=4}function Oe(){var e=window;return Da(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function Ar(){var e,t,r=window;return F(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in r,"mozInnerScreenX"in r,"CSSMozDocumentRule"in r,"CanvasCaptureMediaStream"in r])>=4}function Ya(){var e=window;return F([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function Xa(){var e=window,t=e.URLPattern;return F(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function Ja(){var e=window;return F(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function Pe(){var e=window,t=navigator,r=e.CSS,n=e.HTMLButtonElement;return F([!("getStorageUpdates"in t),n&&"popover"in n.prototype,"CSSCounterStyleRule"in e,r.supports("font-size-adjust: ex-height 0.5"),r.supports("text-transform: full-width")])>=4}function Qa(){if(navigator.platform==="iPad")return!0;var e=screen,t=e.width/e.height;return F(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function Ka(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function qa(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function $t(){var e=Me(),t=Ar(),r=window,n=navigator,a="connection";return e?F([!("SharedWorker"in r),n[a]&&"ontypechange"in n[a],!("sinkId"in new Audio)])>=2:t?F(["onorientationchange"in r,"orientation"in r,/android/i.test(n.appVersion)])>=2:!1}function ei(){var e=navigator,t=window,r=Audio.prototype,n=t.visualViewport;return F(["srLatency"in r,"srChannelCount"in r,"devicePosture"in e,n&&"segments"in n,"getTextInformation"in Image.prototype])>=3}function ti(){return ai()?-4:ri()}function ri(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(ni())return-1;var r=4500,n=new t(1,5e3,44100),a=n.createOscillator();a.type="triangle",a.frequency.value=1e4;var i=n.createDynamicsCompressor();i.threshold.value=-50,i.knee.value=40,i.ratio.value=12,i.attack.value=0,i.release.value=.25,a.connect(i),i.connect(n.destination),a.start(0);var s=ii(n),o=s[0],l=s[1],c=je(o.then(function(f){return si(f.getChannelData(0).subarray(r))},function(f){if(f.name==="timeout"||f.name==="suspended")return-3;throw f}));return function(){return l(),c}}function ni(){return K()&&!Vt()&&!Ja()}function ai(){return K()&&Pe()&&Oe()||Me()&&ei()&&Xa()}function ii(e){var t=3,r=500,n=500,a=5e3,i=function(){};return[new Promise(function(s,o){var l=!1,c=0,f=0;e.oncomplete=function(h){return s(h.renderedBuffer)};var d=function(){setTimeout(function(){return o(Rr("timeout"))},Math.min(n,f+a-Date.now()))},m=function(){try{var h=e.startRendering();switch(wr(h)&&je(h),e.state){case"running":f=Date.now(),l&&d();break;case"suspended":document.hidden||c++,l&&c>=t?o(Rr("suspended")):setTimeout(m,r);break}}catch(k){o(k)}};m(),i=function(){l||(l=!0,f>0&&d())}}),i]}function si(e){for(var t=0,r=0;r<e.length;++r)t+=Math.abs(e[r]);return t}function Rr(e){var t=new Error(e);return t.name=e,t}function Er(e,t,r){var n,a,i;return r===void 0&&(r=50),ne(this,void 0,void 0,function(){var s,o;return ae(this,function(l){switch(l.label){case 0:s=document,l.label=1;case 1:return s.body?[3,3]:[4,at(r)];case 2:return l.sent(),[3,1];case 3:o=s.createElement("iframe"),l.label=4;case 4:return l.trys.push([4,,10,11]),[4,new Promise(function(c,f){var d=!1,m=function(){d=!0,c()},h=function(C){d=!0,f(C)};o.onload=m,o.onerror=h;var k=o.style;k.setProperty("display","block","important"),k.position="absolute",k.top="0",k.left="0",k.visibility="hidden",t&&"srcdoc"in o?o.srcdoc=t:o.src="about:blank",s.body.appendChild(o);var y=function(){var C,_;d||(((_=(C=o.contentWindow)===null||C===void 0?void 0:C.document)===null||_===void 0?void 0:_.readyState)==="complete"?m():setTimeout(y,10))};y()})];case 5:l.sent(),l.label=6;case 6:return!((a=(n=o.contentWindow)===null||n===void 0?void 0:n.document)===null||a===void 0)&&a.body?[3,8]:[4,at(r)];case 7:return l.sent(),[3,6];case 8:return[4,e(o,o.contentWindow)];case 9:return[2,l.sent()];case 10:return(i=o.parentNode)===null||i===void 0||i.removeChild(o),[7];case 11:return[2]}})})}function oi(e){for(var t=Ma(e),r=t[0],n=t[1],a=document.createElement(r??"div"),i=0,s=Object.keys(n);i<s.length;i++){var o=s[i],l=n[o].join(" ");o==="style"?ci(a.style,l):a.setAttribute(o,l)}return a}function ci(e,t){for(var r=0,n=t.split(";");r<n.length;r++){var a=n[r],i=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(a);if(i){var s=i[1],o=i[2],l=i[4];e.setProperty(s,o,l||"")}}}function li(){for(var e=window;;){var t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(r){if(r instanceof Error&&r.name==="SecurityError")return!0;throw r}e=t}}var di="mmMwWLliI0O&1",ui="48px",Se=["monospace","sans-serif","serif"],Zr=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function fi(){var e=this;return Er(function(t,r){var n=r.document;return ne(e,void 0,void 0,function(){var a,i,s,o,l,c,f,d,m,h,k,y;return ae(this,function(C){for(a=n.body,a.style.fontSize=ui,i=n.createElement("div"),i.style.setProperty("visibility","hidden","important"),s={},o={},l=function(_){var x=n.createElement("span"),Z=x.style;return Z.position="absolute",Z.top="0",Z.left="0",Z.fontFamily=_,x.textContent=di,i.appendChild(x),x},c=function(_,x){return l("'".concat(_,"',").concat(x))},f=function(){return Se.map(l)},d=function(){for(var _={},x=function(H){_[H]=Se.map(function(G){return c(H,G)})},Z=0,V=Zr;Z<V.length;Z++){var z=V[Z];x(z)}return _},m=function(_){return Se.some(function(x,Z){return _[Z].offsetWidth!==s[x]||_[Z].offsetHeight!==o[x]})},h=f(),k=d(),a.appendChild(i),y=0;y<Se.length;y++)s[Se[y]]=h[y].offsetWidth,o[Se[y]]=h[y].offsetHeight;return[2,Zr.filter(function(_){return m(k[_])})]})})})}function hi(){var e=navigator.plugins;if(e){for(var t=[],r=0;r<e.length;++r){var n=e[r];if(n){for(var a=[],i=0;i<n.length;++i){var s=n[i];a.push({type:s.type,suffixes:s.suffixes})}t.push({name:n.name,description:n.description,mimeTypes:a})}}return t}}function mi(){return pi(xi())}function pi(e){var t,r=!1,n,a,i=gi(),s=i[0],o=i[1];return _i(s,o)?(r=vi(o),e?n=a="skipped":(t=yi(s,o),n=t[0],a=t[1])):n=a="unsupported",{winding:r,geometry:n,text:a}}function gi(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function _i(e,t){return!!(t&&e.toDataURL)}function vi(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function yi(e,t){ki(e,t);var r=Ft(e);return r!==Ft(e)?["unstable","unstable"]:(bi(e,t),[Ft(e),r])}function ki(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var r="Cwm fjordbank gly ".concat("😃");t.fillText(r,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(r,4,45)}function bi(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var r=0,n=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];r<n.length;r++){var a=n[r],i=a[0],s=a[1],o=a[2];t.fillStyle=i,t.beginPath(),t.arc(s,o,40,0,Math.PI*2,!0),t.closePath(),t.fill()}t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function Ft(e){return e.toDataURL()}function xi(){return K()&&Pe()&&Oe()}function wi(){var e=navigator,t=0,r;e.maxTouchPoints!==void 0?t=Pt(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),r=!0}catch{r=!1}var n="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:r,touchStart:n}}function Si(){return navigator.oscpu}function Ci(){var e=navigator,t=[],r=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(r!==void 0&&t.push([r]),Array.isArray(e.languages))Me()&&Ya()||t.push(e.languages);else if(typeof e.languages=="string"){var n=e.languages;n&&t.push(n.split(","))}return t}function Ii(){return window.screen.colorDepth}function Ni(){return ce(Q(navigator.deviceMemory),void 0)}function Ti(){if(!(K()&&Pe()&&Oe()))return Li()}function Li(){var e=screen,t=function(n){return ce(Pt(n),null)},r=[t(e.width),t(e.height)];return r.sort().reverse(),r}var Ai=2500,Ri=10,ot,Wt;function Ei(){if(Wt===void 0){var e=function(){var t=zt();Dt(t)?Wt=setTimeout(e,Ai):(ot=t,Wt=void 0)};e()}}function Zi(){var e=this;return Ei(),function(){return ne(e,void 0,void 0,function(){var t;return ae(this,function(r){switch(r.label){case 0:return t=zt(),Dt(t)?ot?[2,br([],ot,!0)]:Ka()?[4,qa()]:[3,2]:[3,2];case 1:r.sent(),t=zt(),r.label=2;case 2:return Dt(t)||(ot=t),[2,t]}})})}}function ji(){var e=this;if(K()&&Pe()&&Oe())return function(){return Promise.resolve(void 0)};var t=Zi();return function(){return ne(e,void 0,void 0,function(){var r,n;return ae(this,function(a){switch(a.label){case 0:return[4,t()];case 1:return r=a.sent(),n=function(i){return i===null?null:Ir(i,Ri)},[2,[n(r[0]),n(r[1]),n(r[2]),n(r[3])]]}})})}}function zt(){var e=screen;return[ce(Q(e.availTop),null),ce(Q(e.width)-Q(e.availWidth)-ce(Q(e.availLeft),0),null),ce(Q(e.height)-Q(e.availHeight)-ce(Q(e.availTop),0),null),ce(Q(e.availLeft),null)]}function Dt(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function Mi(){return ce(Pt(navigator.hardwareConcurrency),void 0)}function Oi(){var e,t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){var r=new t().resolvedOptions().timeZone;if(r)return r}var n=-Pi();return"UTC".concat(n>=0?"+":"").concat(n)}function Pi(){var e=new Date().getFullYear();return Math.max(Q(new Date(e,0,1).getTimezoneOffset()),Q(new Date(e,6,1).getTimezoneOffset()))}function Vi(){try{return!!window.sessionStorage}catch{return!0}}function $i(){try{return!!window.localStorage}catch{return!0}}function Fi(){if(!(Lr()||Ga()))try{return!!window.indexedDB}catch{return!0}}function Wi(){return!!window.openDatabase}function zi(){return navigator.cpuClass}function Di(){var e=navigator.platform;return e==="MacIntel"&&K()&&!Vt()?Qa()?"iPad":"iPhone":e}function Ui(){return navigator.vendor||""}function Bi(){for(var e=[],t=0,r=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<r.length;t++){var n=r[t],a=window[n];a&&typeof a=="object"&&e.push(n)}return e.sort()}function Hi(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function Gi(){var e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}function Yi(e){var t=(e===void 0?{}:e).debug;return ne(this,void 0,void 0,function(){var r,n,a,i,s,o;return ae(this,function(l){switch(l.label){case 0:return Xi()?(r=Gi(),n=Object.keys(r),a=(o=[]).concat.apply(o,n.map(function(c){return r[c]})),[4,Ji(a)]):[2,void 0];case 1:return i=l.sent(),t&&Qi(r,i),s=n.filter(function(c){var f=r[c];return F(f.map(function(d){return i[d]}))>f.length*.6}),s.sort(),[2,s]}})})}function Xi(){return K()||$t()}function Ji(e){var t;return ne(this,void 0,void 0,function(){var r,n,a,i,l,s,o,l;return ae(this,function(c){switch(c.label){case 0:for(r=document,n=r.createElement("div"),a=new Array(e.length),i={},jr(n),l=0;l<e.length;++l)s=oi(e[l]),s.tagName==="DIALOG"&&s.show(),o=r.createElement("div"),jr(o),o.appendChild(s),n.appendChild(o),a[l]=s;c.label=1;case 1:return r.body?[3,3]:[4,at(50)];case 2:return c.sent(),[3,1];case 3:r.body.appendChild(n);try{for(l=0;l<e.length;++l)a[l].offsetParent||(i[e[l]]=!0)}finally{(t=n.parentNode)===null||t===void 0||t.removeChild(n)}return[2,i]}})})}function jr(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Qi(e,t){for(var r="DOM blockers debug:\n```",n=0,a=Object.keys(e);n<a.length;n++){var i=a[n];r+=`
3
+ `.concat(i,":");for(var s=0,o=e[i];s<o.length;s++){var l=o[s];r+=`
4
+ `.concat(t[l]?"🚫":"➡️"," ").concat(l)}}}function Ki(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var r=t[e];if(matchMedia("(color-gamut: ".concat(r,")")).matches)return r}}function qi(){if(Mr("inverted"))return!0;if(Mr("none"))return!1}function Mr(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function es(){if(Or("active"))return!0;if(Or("none"))return!1}function Or(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}var ts=100;function rs(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=ts;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}}function ns(){if(Ce("no-preference"))return 0;if(Ce("high")||Ce("more"))return 1;if(Ce("low")||Ce("less"))return-1;if(Ce("forced"))return 10}function Ce(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function as(){if(Pr("reduce"))return!0;if(Pr("no-preference"))return!1}function Pr(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function is(){if(Vr("reduce"))return!0;if(Vr("no-preference"))return!1}function Vr(e){return matchMedia("(prefers-reduced-transparency: ".concat(e,")")).matches}function ss(){if($r("high"))return!0;if($r("standard"))return!1}function $r(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var R=Math,W=function(){return 0};function os(){var e=R.acos||W,t=R.acosh||W,r=R.asin||W,n=R.asinh||W,a=R.atanh||W,i=R.atan||W,s=R.sin||W,o=R.sinh||W,l=R.cos||W,c=R.cosh||W,f=R.tan||W,d=R.tanh||W,m=R.exp||W,h=R.expm1||W,k=R.log1p||W,y=function(L){return R.pow(R.PI,L)},C=function(L){return R.log(L+R.sqrt(L*L-1))},_=function(L){return R.log(L+R.sqrt(L*L+1))},x=function(L){return R.log((1+L)/(1-L))/2},Z=function(L){return R.exp(L)-1/R.exp(L)/2},V=function(L){return(R.exp(L)+1/R.exp(L))/2},z=function(L){return R.exp(L)-1},H=function(L){return(R.exp(2*L)-1)/(R.exp(2*L)+1)},G=function(L){return R.log(1+L)};return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:C(1e154),asin:r(.12312423423423424),asinh:n(1),asinhPf:_(1),atanh:a(.5),atanhPf:x(.5),atan:i(.5),sin:s(-1e300),sinh:o(1),sinhPf:Z(1),cos:l(10.000000000123),cosh:c(1),coshPf:V(1),tan:f(-1e300),tanh:d(1),tanhPf:H(1),exp:m(1),expm1:h(1),expm1Pf:z(1),log1p:k(10),log1pPf:G(10),powPI:y(-100)}}var cs="mmMwWLliI0fiflO&1",Ut={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function ls(){return ds(function(e,t){for(var r={},n={},a=0,i=Object.keys(Ut);a<i.length;a++){var s=i[a],o=Ut[s],l=o[0],c=l===void 0?{}:l,f=o[1],d=f===void 0?cs:f,m=e.createElement("span");m.textContent=d,m.style.whiteSpace="nowrap";for(var h=0,k=Object.keys(c);h<k.length;h++){var y=k[h],C=c[y];C!==void 0&&(m.style[y]=C)}r[s]=m,t.append(e.createElement("br"),m)}for(var _=0,x=Object.keys(Ut);_<x.length;_++){var s=x[_];n[s]=r[s].getBoundingClientRect().width}return n})}function ds(e,t){return t===void 0&&(t=4e3),Er(function(r,n){var a=n.document,i=a.body,s=i.style;s.width="".concat(t,"px"),s.webkitTextSizeAdjust=s.textSizeAdjust="none",Me()?i.style.zoom="".concat(1/n.devicePixelRatio):K()&&(i.style.zoom="reset");var o=a.createElement("div");return o.textContent=br([],Array(t/20<<0),!0).map(function(){return"word"}).join(" "),i.appendChild(o),e(a,i)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function us(){return navigator.pdfViewerEnabled}function fs(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function hs(){var e=window.ApplePaySession;if(typeof e?.canMakePayments!="function")return-1;if(ms())return-3;try{return e.canMakePayments()?1:0}catch(t){return ps(t)}}var ms=li;function ps(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function gs(){var e,t=document.createElement("a"),r=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return r===void 0?void 0:String(r)}var Fr=-1,Wr=-2,_s=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),vs=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),ys=["FRAGMENT_SHADER","VERTEX_SHADER"],ks=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],zr="WEBGL_debug_renderer_info",bs="WEBGL_polygon_mode";function xs(e){var t,r,n,a,i,s,o=e.cache,l=Dr(o);if(!l)return Fr;if(!Hr(l))return Wr;var c=Br()?null:l.getExtension(zr);return{version:((t=l.getParameter(l.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((r=l.getParameter(l.VENDOR))===null||r===void 0?void 0:r.toString())||"",vendorUnmasked:c?(n=l.getParameter(c.UNMASKED_VENDOR_WEBGL))===null||n===void 0?void 0:n.toString():"",renderer:((a=l.getParameter(l.RENDERER))===null||a===void 0?void 0:a.toString())||"",rendererUnmasked:c?(i=l.getParameter(c.UNMASKED_RENDERER_WEBGL))===null||i===void 0?void 0:i.toString():"",shadingLanguageVersion:((s=l.getParameter(l.SHADING_LANGUAGE_VERSION))===null||s===void 0?void 0:s.toString())||""}}function ws(e){var t=e.cache,r=Dr(t);if(!r)return Fr;if(!Hr(r))return Wr;var n=r.getSupportedExtensions(),a=r.getContextAttributes(),i=[],s=[],o=[],l=[],c=[];if(a)for(var f=0,d=Object.keys(a);f<d.length;f++){var m=d[f];s.push("".concat(m,"=").concat(a[m]))}for(var h=Ur(r),k=0,y=h;k<y.length;k++){var C=y[k],_=r[C];o.push("".concat(C,"=").concat(_).concat(_s.has(_)?"=".concat(r.getParameter(_)):""))}if(n)for(var x=0,Z=n;x<Z.length;x++){var V=Z[x];if(!(V===zr&&Br()||V===bs&&Is())){var z=r.getExtension(V);if(!z){i.push(V);continue}for(var H=0,G=Ur(z);H<G.length;H++){var C=G[H],_=z[C];l.push("".concat(C,"=").concat(_).concat(vs.has(_)?"=".concat(r.getParameter(_)):""))}}}for(var L=0,E=ys;L<E.length;L++)for(var M=E[L],De=0,_t=ks;De<_t.length;De++){var Hn=_t[De],cc=Ss(r,M,Hn);c.push("".concat(M,".").concat(Hn,"=").concat(cc.join(",")))}return l.sort(),o.sort(),{contextAttributes:s,parameters:o,shaderPrecisions:c,extensions:n,extensionParameters:l,unsupportedExtensions:i}}function Dr(e){if(e.webgl)return e.webgl.context;var t=document.createElement("canvas"),r;t.addEventListener("webglCreateContextError",function(){r=void 0});for(var n=0,a=["webgl","experimental-webgl"];n<a.length;n++){var i=a[n];try{r=t.getContext(i)}catch{}if(r)break}return e.webgl={context:r},r}function Ss(e,t,r){var n=e.getShaderPrecisionFormat(e[t],e[r]);return n?[n.rangeMin,n.rangeMax,n.precision]:[]}function Ur(e){return Object.keys(e.__proto__).filter(Cs)}function Cs(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function Br(){return Ar()}function Is(){return Me()||K()}function Hr(e){return typeof e.getParameter=="function"}function Ns(){if(!($t()||K()))return-2;if(!window.AudioContext)return-1;var e=new AudioContext().baseLatency;return e==null?-1:isFinite(e)?e:-3}function Ts(){if(!window.Intl)return-1;var e=window.Intl.DateTimeFormat;if(!e)return-2;var t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}var Ls={fonts:fi,domBlockers:Yi,fontPreferences:ls,audio:ti,screenFrame:ji,canvas:mi,osCpu:Si,languages:Ci,colorDepth:Ii,deviceMemory:Ni,screenResolution:Ti,hardwareConcurrency:Mi,timezone:Oi,sessionStorage:Vi,localStorage:$i,indexedDB:Fi,openDatabase:Wi,cpuClass:zi,platform:Di,plugins:hi,touchSupport:wi,vendor:Ui,vendorFlavors:Bi,cookiesEnabled:Hi,colorGamut:Ki,invertedColors:qi,forcedColors:es,monochrome:rs,contrast:ns,reducedMotion:as,reducedTransparency:is,hdr:ss,math:os,pdfViewerEnabled:us,architecture:fs,applePay:hs,privateClickMeasurement:gs,audioBaseLatency:Ns,dateTimeLocale:Ts,webGlBasics:xs,webGlExtensions:ws};function As(e){return Ha(Ls,e,[])}var Rs="$ if upgrade to Pro: https://fpjs.dev/pro";function Es(e){var t=Zs(e),r=js(t);return{score:t,comment:Rs.replace(/\$/g,"".concat(r))}}function Zs(e){if($t())return .4;if(K())return Vt()&&!(Pe()&&Oe())?.5:.3;var t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function js(e){return Ir(.99+.01*e,1e-4)}function Ms(e){for(var t="",r=0,n=Object.keys(e).sort();r<n.length;r++){var a=n[r],i=e[a],s="error"in i?"error":JSON.stringify(i.value);t+="".concat(t?"|":"").concat(a.replace(/([:|\\])/g,"\\$1"),":").concat(s)}return t}function Os(e){return JSON.stringify(e,function(t,r){return r instanceof Error?za(r):r},2)}function Gr(e){return Wa(Ms(e))}function Ps(e){var t;return{get visitorId(){return t===void 0&&(t=Gr(this.components)),t},set visitorId(r){t=r},confidence:Es(e),components:e,version:xr}}function Vs(e){return e===void 0&&(e=50),Ea(e,e*2)}function $s(e,t){var r=Date.now();return{get:function(n){return ne(this,void 0,void 0,function(){var a,i,s;return ae(this,function(o){switch(o.label){case 0:return a=Date.now(),[4,e()];case 1:return i=o.sent(),s=Ps(i),t||n?.debug,[2,s]}})})}}}function Fs(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(xr,"/npm-monitoring"),!0),e.send()}catch{}}function Ws(e){var t;return e===void 0&&(e={}),ne(this,void 0,void 0,function(){var r,n,a;return ae(this,function(i){switch(i.label){case 0:return(!((t=e.monitoring)!==null&&t!==void 0)||t)&&Fs(),r=e.delayFallback,n=e.debug,[4,Vs(r)];case 1:return i.sent(),a=As({cache:{},debug:n}),[2,$s(a,n)]}})})}var zs={load:Ws,hashComponents:Gr,componentsToDebugString:Os},Ds=class{constructor(e){this.baseUrl=e}async validateWidget(e,t){if(!t)return{valid:!1,error:"Widget is not configured: tenantId is required"};try{const r=new URLSearchParams({agentId:e,tenantId:t}),n=await fetch(`${this.baseUrl}/v1/widget/validate?${r}`),a=await n.json();return n.ok&&a.success?{valid:!0,agentId:a.data.agentId,tenantId:a.data.tenantId}:{valid:!1,error:a.error??`Widget configuration is invalid (${n.status})`}}catch{return{valid:!1,error:"Unable to reach the AgentForge API to validate widget configuration"}}}async chat(e){const t=await fetch(`${this.baseUrl}/v1/agents/${encodeURIComponent(e.agentId)}/responses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e.message,sessionId:e.sessionId,tenantId:e.tenantId,externalId:e.externalId,name:e.name,email:e.email,authId:e.authId,fingerprint:e.fingerprint,metadata:e.metadata,imageUrl:e.imageUrl})});if(!t.ok)throw new Error(`API error: ${t.status} ${t.statusText}`);const r=await t.json();if(!r.success)throw new Error(r.error??"Unknown API error");return{content:r.data?.text??"",sessionId:r.data?.sessionId,images:r.data?.images}}async fetchSessionMessages(e){try{const t=await fetch(`${this.baseUrl}/v1/sessions/${encodeURIComponent(e)}/messages`);if(t.status===410||!t.ok)return null;const r=await t.json();return r.success?r.data?.messages??null:null}catch{return null}}async uploadImage(e,t,r,n,a){const i=await fetch(`${this.baseUrl}/v1/upload`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e,mimeType:t,fileName:r,agentId:n,tenantId:a})});if(!i.ok)throw new Error(`Upload error: ${i.status} ${i.statusText}`);const s=await i.json();if(!s.success)throw new Error(s.error??"Upload failed");return{url:s.data.url}}async fetchWidgetConfig(e,t){try{const r=t?`?tenantId=${encodeURIComponent(t)}`:"",n=await fetch(`${this.baseUrl}/v1/agents/${encodeURIComponent(e)}/widget-config${r}`);if(!n.ok)return null;const a=await n.json();return a.success?a.data:null}catch{return null}}async endSession(e,t,r,n,a){const i=await fetch(`${this.baseUrl}/v1/sessions/${encodeURIComponent(e)}/end`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tenantId:t,agentId:r,fingerprint:n,externalId:a})});if(!i.ok)throw new Error(`Failed to end session: ${i.status} ${i.statusText}`);const s=await i.json();if(!s.success)throw new Error(s.error??"Failed to end session")}},Us=12e4;function Bs(e){return Promise.race([e.read(),new Promise((t,r)=>setTimeout(()=>r(new Error("Stream timed out — no data received for 120s")),Us))])}async function Hs(e,t,r){let n="",a="";try{const i=await fetch(`${e}/v1/agents/${encodeURIComponent(t.agentId)}/responses:stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t.message,sessionId:t.sessionId,tenantId:t.tenantId,externalId:t.externalId,name:t.name,email:t.email,authId:t.authId,fingerprint:t.fingerprint,metadata:t.metadata,imageUrl:t.imageUrl})});if(!i.ok||!i.body){let d=`${i.status} ${i.statusText}`;try{const m=await i.json();m.error&&(d=m.error)}catch{}throw new Error(d)}const s=i.headers.get("x-session-id");s&&r.onSession&&r.onSession(s);const o=i.body.getReader(),l=new TextDecoder;let c="";const f=d=>{if(!d.startsWith("data: "))return!1;const m=d.slice(6).trim();if(!m)return!1;if(m==="[DONE]")return r.onEnd(n),!0;try{const h=JSON.parse(m);if(h.type==="session"){const y=h.sessionId;return y&&r.onSession&&r.onSession(y),!1}if(h.type==="done"||h.type==="stop")return r.onEnd(n),!0;if(h.type==="error")throw new Error(h.message??"Stream error");if(h.type==="images"){const y=h.images;return y&&r.onImages&&r.onImages(y),!1}if(h.type==="thinking_chunk"){const y=h.content;return y&&r.onThinkingDelta&&(a+=y,r.onThinkingDelta(y,a)),!1}const k=Gs(h);k&&(n+=k,r.onDelta(k,n))}catch(h){if(!(h instanceof SyntaxError))throw h}return!1};e:for(;;){const{done:d,value:m}=await Bs(o);if(d)break;c+=l.decode(m,{stream:!0});const h=c.lastIndexOf(`
5
+ `);if(h===-1)continue;const k=c.slice(0,h);c=c.slice(h+1);for(const y of k.split(`
6
+ `))if(f(y))break e}r.onEnd(n)}catch(i){r.onError(i instanceof Error?i:new Error(String(i)))}}function Gs(e){const t=e.choices;if(Array.isArray(t)&&t.length>0){const a=t[0]?.delta,i=a?.content??a?.text??"";if(i)return i}const r=e.delta;if(r){const a=r.content??r.text??"";if(a)return a}const n=e.response;return n||(e.text??e.content??"")}var Ys=class{listeners=new Map;on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t)}off(e,t){this.listeners.get(e)?.delete(t)}emit(...e){const[t,r]=e;this.listeners.get(t)?.forEach(n=>n(r))}removeAllListeners(){this.listeners.clear()}},Xs="agentforge";function Bt(e){return`${Xs}:session:${e}`}function Js(e){try{return sessionStorage.getItem(Bt(e))??void 0}catch{return}}function Ht(e,t){try{sessionStorage.setItem(Bt(e),t)}catch{}}function Yr(e){try{sessionStorage.removeItem(Bt(e))}catch{}}function ct(){return`msg-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`}var Qs=class{config;apiClient;state;fingerprint;emitter;constructor(e,t,r){this.hostConfig=t,this.onStateChange=r,this.config=e,this.apiClient=new Ds(e.apiBaseUrl),this.emitter=new Ys,this.initializeFingerprint();const n=e.sessionId??Js(e.agentId);e.sessionId&&Ht(e.agentId,e.sessionId);const a=e.mode==="inline";this.state={isOpen:a,messages:[],isLoading:!1,error:null,sessionId:n,initStatus:"validating",initError:null},a&&queueMicrotask(()=>this.openWithGreeting())}async initializeFingerprint(){try{this.fingerprint=(await(await zs.load()).get()).visitorId}catch{this.fingerprint=void 0}}getState(){return{...this.state,messages:[...this.state.messages]}}setOpen(e){e?this.openWithGreeting():this.setState({isOpen:!1})}openWithGreeting(){this.state.initStatus!=="error"&&this.setState({isOpen:!0})}async hydrate(){const e=await this.apiClient.validateWidget(this.config.agentId,this.config.tenantId);if(!e.valid){this.setState({initStatus:"error",initError:e.error});return}const t=await this.apiClient.fetchWidgetConfig(this.config.agentId,this.config.tenantId);if(t&&(this.config=Ze(this.hostConfig,t),this.onStateChange(this.getState(),this.config)),this.setState({initStatus:"ready"}),!this.state.sessionId)return;const r=await this.apiClient.fetchSessionMessages(this.state.sessionId);if(r===null){this.handleSessionExpired();return}if(r.length===0)return;const n=r.map(a=>({id:ct(),role:a.role,content:a.content,images:a.images&&a.images.length>0?a.images:void 0,uploadedImageUrl:a.imageUrl||void 0,createdAt:a.createdAt??new Date().toISOString(),status:"sent"}));this.setState({messages:[...this.state.messages,...n]})}setState(e){this.state={...this.state,...e},this.onStateChange(this.getState(),this.config)}updateMessage(e,t){this.state={...this.state,messages:this.state.messages.map(r=>r.id===e?{...r,...t}:r)},this.onStateChange(this.getState(),this.config)}async resetConversation(){if(this.state.sessionId)try{await this.apiClient.endSession(this.state.sessionId,this.config.tenantId,this.config.agentId,this.fingerprint,this.config.user.externalId)}catch{}Yr(this.config.agentId),this.setState({sessionId:void 0,messages:[],isLoading:!1,error:null}),this.emitter.emit("reset",void 0),this.state.isOpen&&this.openWithGreeting()}handleSessionExpired(){Yr(this.config.agentId),this.setState({sessionId:void 0})}async sendMessage(e,t){if(this.state.isLoading||!e.trim()&&!t||this.state.initStatus!=="ready")return;let r;if(t)try{const i=await Ks(t);r=(await this.apiClient.uploadImage(i,t.type,t.name,this.config.agentId,this.config.tenantId)).url}catch(i){const s=i instanceof Error?i.message:"Image upload failed";this.setState({error:s});return}const n={id:ct(),role:"user",content:e.trim(),uploadedImageUrl:r,createdAt:new Date().toISOString(),status:"sent"},a=!this.state.messages.some(i=>i.role==="user");this.setState({messages:[...this.state.messages,n],isLoading:!0,error:null}),this.emitter.emit("message:sent",n),a&&this.emitter.emit("conversation:started",{sessionId:this.state.sessionId}),this.config.streaming?await this.sendStreaming(e.trim(),r):await this.sendNonStreaming(e.trim(),r)}async sendNonStreaming(e,t,r=!1){try{const n=await this.apiClient.chat({agentId:this.config.agentId,message:e,sessionId:this.state.sessionId,tenantId:this.config.tenantId,externalId:this.config.user.externalId,name:this.config.user.name,email:this.config.user.email,authId:this.config.user.authId,fingerprint:this.fingerprint,metadata:this.config.metadata,imageUrl:t}),a={id:ct(),role:"assistant",content:n.content,images:n.images,createdAt:new Date().toISOString(),status:"sent"};this.setState({messages:[...this.state.messages,a],isLoading:!1,...n.sessionId?{sessionId:n.sessionId}:{}}),n.sessionId&&Ht(this.config.agentId,n.sessionId),this.emitter.emit("message:received",a)}catch(n){const a=n instanceof Error?n.message:"Failed to send message";if(!r&&a.includes("410"))return this.handleSessionExpired(),this.sendNonStreaming(e,t,!0);this.setState({isLoading:!1,error:a}),this.emitter.emit("message:error",{error:a,message:null})}}async sendStreaming(e,t,r=!1){const n=ct(),a={id:n,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming",isThinking:this.config.thinkingEnabled?!0:void 0};this.setState({messages:[...this.state.messages,a]}),this.emitter.emit("stream:start");let i=!1;await Hs(this.config.apiBaseUrl,{agentId:this.config.agentId,message:e,sessionId:this.state.sessionId,tenantId:this.config.tenantId,externalId:this.config.user.externalId,name:this.config.user.name,email:this.config.user.email,authId:this.config.user.authId,fingerprint:this.fingerprint,metadata:this.config.metadata,imageUrl:t},{onSession:s=>{this.setState({sessionId:s}),Ht(this.config.agentId,s)},onImages:s=>{this.updateMessage(n,{images:s})},onThinkingDelta:(s,o)=>{this.updateMessage(n,{thinking:o,isThinking:!0}),this.emitter.emit("thinking:delta",{delta:s,accumulated:o})},onDelta:(s,o)=>{this.updateMessage(n,{content:o,isThinking:!1}),this.emitter.emit("stream:delta",{delta:s,accumulated:o})},onEnd:s=>{this.updateMessage(n,{content:s,status:"sent",isThinking:!1}),this.setState({isLoading:!1}),this.emitter.emit("stream:end",{content:s});const o=this.state.messages.find(l=>l.id===n);o&&(o.thinking&&this.emitter.emit("thinking:end",{content:o.thinking}),this.emitter.emit("message:received",o))},onError:s=>{if(!r&&s.message.includes("410")){i=!0,this.setState({messages:this.state.messages.filter(c=>c.id!==n),isLoading:!1});return}const o=this.state.messages.find(c=>c.id===n)?.content??"",l=s.message||"Something went wrong. Please try again.";this.updateMessage(n,{content:o||l,status:"error"}),this.setState({isLoading:!1,error:l}),this.emitter.emit("message:error",{error:s.message,message:null})}}),i&&(this.handleSessionExpired(),await this.sendStreaming(e,t,!0))}};function Ks(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{const a=n.result;t(a.split(",")[1]??"")},n.onerror=()=>r(new Error("Failed to read file")),n.readAsDataURL(e)})}function qs(e){const t=document.createElement("div");t.setAttribute("data-agentkit-widget",""),e.appendChild(t);const r=t.attachShadow({mode:"open"}),n=document.createElement("style");r.appendChild(n);const a=document.createElement("div");return a.style.cssText="display: contents;",r.appendChild(a),{host:t,shadowRoot:r,styleSlot:n,mountPoint:a}}function eo(e,t){e.textContent=t}function to(e){e.remove()}function ro(){const e=document.createElement("div");return e.setAttribute("data-agentkit-root","floating"),e.style.cssText=["position: fixed","bottom: 24px","right: 24px","z-index: 2147483647","pointer-events: none"].join("; "),document.body.appendChild(e),e}function no(e){getComputedStyle(e).position==="static"&&(e.style.position="relative");const t=document.createElement("div");return t.setAttribute("data-agentkit-root","floating"),t.style.cssText=["position: absolute","bottom: 24px","right: 24px","z-index: 2147483647","pointer-events: none"].join("; "),e.appendChild(t),t}function ao(e){return e.setAttribute("data-agentkit-root","inline"),getComputedStyle(e).position==="static"&&(e.style.position="relative"),e}function io(e){e.remove()}function so(e){e.removeAttribute("data-agentkit-root")}function Xr(e,t,r,n,a){const i=e.mode==="inline";let s=!1;const o=i&&a?ao(a):!i&&a?no(a):ro(),l=qs(o);eo(l.styleSlot,n);const c=new Qs(e,t,(m,h)=>{s||f.update(m,h)}),f=r(l.mountPoint,e,c.getState(),{onOpen:()=>d.open(),onClose:()=>d.close(),onSendMessage:(m,h)=>{c.sendMessage(m,h)},onReset:()=>{c.resetConversation()}});c.hydrate(),setTimeout(()=>{s||c.emitter.emit("ready",c.getState())},0);const d={open(){s||(c.setOpen(!0),c.emitter.emit("open"))},close(){s||(c.setOpen(!1),c.emitter.emit("close"))},toggle(){c.getState().isOpen?d.close():d.open()},async sendMessage(m,h){await c.sendMessage(m,h)},reset(){s||(c.resetConversation(),c.emitter.emit("reset"))},destroy(){s||(s=!0,f.destroy(),to(l.host),i&&a?so(a):io(o),c.emitter.emit("destroy"),c.emitter.removeAllListeners())},on(m,h){c.emitter.on(m,h)},off(m,h){c.emitter.off(m,h)},getState(){return c.getState()}};return d}var Ve=new Map,oo=0;function Jr(e){const t=`agentkit-widget-${++oo}`,r=e.destroy.bind(e);return e.destroy=()=>{Ve.delete(t),r()},Ve.set(t,e),t}function co(e,t,r){const n={...e,mode:"floating"},a=Xr(Ze(n),n,t,r);return Jr(a),a}function lo(e,t,r,n){const a={...t,mode:"inline"},i=Xr(Ze(a),a,r,n,e);return Jr(i),i}function uo(e){e?Ve.get(e)?.destroy():(Ve.forEach(t=>t.destroy()),Ve.clear())}var lt,N,Qr,fo,pe,Kr,qr,en,tn,Gt,Yt,Xt,ho,dt={},ut=[],mo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$e=Array.isArray;function le(e,t){for(var r in t)e[r]=t[r];return e}function Jt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Fe(e,t,r){var n,a,i,s={};for(i in t)i=="key"?n=t[i]:i=="ref"?a=t[i]:s[i]=t[i];if(arguments.length>2&&(s.children=arguments.length>3?lt.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)s[i]===void 0&&(s[i]=e.defaultProps[i]);return ft(e,s,n,a,null)}function ft(e,t,r,n,a){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++Qr,__i:-1,__u:0};return a==null&&N.vnode!=null&&N.vnode(i),i}function X(e){return e.children}function de(e,t){this.props=e,this.context=t}function Ie(e,t){if(t==null)return e.__?Ie(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Ie(e):null}function po(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,n=[],a=[],i=le({},t);i.__v=t.__v+1,N.vnode&&N.vnode(i),Qt(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,n,r??Ie(t),!!(32&t.__u),a),i.__v=t.__v,i.__.__k[i.__i]=i,ln(n,i,a),t.__e=t.__=null,i.__e!=r&&rn(i)}}function rn(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),rn(e)}function nn(e){(!e.__d&&(e.__d=!0)&&pe.push(e)&&!ht.__r++||Kr!=N.debounceRendering)&&((Kr=N.debounceRendering)||qr)(ht)}function ht(){try{for(var e,t=1;pe.length;)pe.length>t&&pe.sort(en),e=pe.shift(),t=pe.length,po(e)}finally{pe.length=ht.__r=0}}function an(e,t,r,n,a,i,s,o,l,c,f){var d,m,h,k,y,C,_,x=n&&n.__k||ut,Z=t.length;for(l=go(r,t,x,l,Z),d=0;d<Z;d++)(h=r.__k[d])!=null&&(m=h.__i!=-1&&x[h.__i]||dt,h.__i=d,C=Qt(e,h,m,a,i,s,o,l,c,f),k=h.__e,h.ref&&m.ref!=h.ref&&(m.ref&&qt(m.ref,null,h),f.push(h.ref,h.__c||k,h)),y==null&&k!=null&&(y=k),(_=!!(4&h.__u))||m.__k===h.__k?l=sn(h,l,e,_):typeof h.type=="function"&&C!==void 0?l=C:k&&(l=k.nextSibling),h.__u&=-7);return r.__e=y,l}function go(e,t,r,n,a){var i,s,o,l,c,f=r.length,d=f,m=0;for(e.__k=new Array(a),i=0;i<a;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[i]=ft(null,s,null,null,null):$e(s)?s=e.__k[i]=ft(X,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[i]=ft(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[i]=s,l=i+m,s.__=e,s.__b=e.__b+1,o=null,(c=s.__i=_o(s,r,l,d))!=-1&&(d--,(o=r[c])&&(o.__u|=2)),o==null||o.__v==null?(c==-1&&(a>f?m--:a<f&&m++),typeof s.type!="function"&&(s.__u|=4)):c!=l&&(c==l-1?m--:c==l+1?m++:(c>l?m--:m++,s.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<f;i++)(o=r[i])!=null&&(2&o.__u)==0&&(o.__e==n&&(n=Ie(o)),un(o,o));return n}function sn(e,t,r,n){var a,i;if(typeof e.type=="function"){for(a=e.__k,i=0;a&&i<a.length;i++)a[i]&&(a[i].__=e,t=sn(a[i],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=Ie(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ue(e,t){return t=t||[],e==null||typeof e=="boolean"||($e(e)?e.some(function(r){ue(r,t)}):t.push(e)),t}function _o(e,t,r,n){var a,i,s,o=e.key,l=e.type,c=t[r],f=c!=null&&(2&c.__u)==0;if(c===null&&o==null||f&&o==c.key&&l==c.type)return r;if(n>(f?1:0)){for(a=r-1,i=r+1;a>=0||i<t.length;)if((c=t[s=a>=0?a--:i++])!=null&&(2&c.__u)==0&&o==c.key&&l==c.type)return s}return-1}function on(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||mo.test(t)?r:r+"px"}function mt(e,t,r,n,a){var i,s;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||on(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||on(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(tn,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.u=n.u:(r.u=Gt,e.addEventListener(t,i?Xt:Yt,i)):e.removeEventListener(t,i?Xt:Yt,i);else{if(a=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function cn(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Gt++;else if(t.t<r.u)return;return r(N.event?N.event(t):t)}}}function Qt(e,t,r,n,a,i,s,o,l,c){var f,d,m,h,k,y,C,_,x,Z,V,z,H,G,L,E=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),i=[o=t.__e=r.__e]),(f=N.__b)&&f(t);e:if(typeof E=="function")try{if(_=t.props,x=E.prototype&&E.prototype.render,Z=(f=E.contextType)&&n[f.__c],V=f?Z?Z.props.value:f.__:n,r.__c?C=(d=t.__c=r.__c).__=d.__E:(x?t.__c=d=new E(_,V):(t.__c=d=new de(_,V),d.constructor=E,d.render=yo),Z&&Z.sub(d),d.state||(d.state={}),d.__n=n,m=d.__d=!0,d.__h=[],d._sb=[]),x&&d.__s==null&&(d.__s=d.state),x&&E.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=le({},d.__s)),le(d.__s,E.getDerivedStateFromProps(_,d.__s))),h=d.props,k=d.state,d.__v=t,m)x&&E.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),x&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(x&&E.getDerivedStateFromProps==null&&_!==h&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(_,V),t.__v==r.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(_,d.__s,V)===!1){t.__v!=r.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(M){M&&(M.__=t)}),ut.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(_,d.__s,V),x&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(h,k,y)})}if(d.context=V,d.props=_,d.__P=e,d.__e=!1,z=N.__r,H=0,x)d.state=d.__s,d.__d=!1,z&&z(t),f=d.render(d.props,d.state,d.context),ut.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,z&&z(t),f=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++H<25);d.state=d.__s,d.getChildContext!=null&&(n=le(le({},n),d.getChildContext())),x&&!m&&d.getSnapshotBeforeUpdate!=null&&(y=d.getSnapshotBeforeUpdate(h,k)),G=f!=null&&f.type===X&&f.key==null?dn(f.props.children):f,o=an(e,$e(G)?G:[G],t,r,n,a,i,s,o,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),C&&(d.__E=d.__=null)}catch(M){if(t.__v=null,l||i!=null)if(M.then){for(t.__u|=l?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;i[i.indexOf(o)]=null,t.__e=o}else{for(L=i.length;L--;)Jt(i[L]);Kt(t)}else t.__e=r.__e,t.__k=r.__k,M.then||Kt(t);N.__e(M,t,r)}else i==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):o=t.__e=vo(r.__e,t,r,n,a,i,s,l,c);return(f=N.diffed)&&f(t),128&t.__u?void 0:o}function Kt(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Kt))}function ln(e,t,r){for(var n=0;n<r.length;n++)qt(r[n],r[++n],r[++n]);N.__c&&N.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){N.__e(i,a.__v)}})}function dn(e){return typeof e!="object"||e==null||e.__b>0?e:$e(e)?e.map(dn):le({},e)}function vo(e,t,r,n,a,i,s,o,l){var c,f,d,m,h,k,y,C=r.props||dt,_=t.props,x=t.type;if(x=="svg"?a="http://www.w3.org/2000/svg":x=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((h=i[c])&&"setAttribute"in h==!!x&&(x?h.localName==x:h.nodeType==3)){e=h,i[c]=null;break}}if(e==null){if(x==null)return document.createTextNode(_);e=document.createElementNS(a,x,_.is&&_),o&&(N.__m&&N.__m(t,i),o=!1),i=null}if(x==null)C===_||o&&e.data==_||(e.data=_);else{if(i=i&&lt.call(e.childNodes),!o&&i!=null)for(C={},c=0;c<e.attributes.length;c++)C[(h=e.attributes[c]).name]=h.value;for(c in C)h=C[c],c=="dangerouslySetInnerHTML"?d=h:c=="children"||c in _||c=="value"&&"defaultValue"in _||c=="checked"&&"defaultChecked"in _||mt(e,c,null,h,a);for(c in _)h=_[c],c=="children"?m=h:c=="dangerouslySetInnerHTML"?f=h:c=="value"?k=h:c=="checked"?y=h:o&&typeof h!="function"||C[c]===h||mt(e,c,h,C[c],a);if(f)o||d&&(f.__html==d.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(d&&(e.innerHTML=""),an(t.type=="template"?e.content:e,$e(m)?m:[m],t,r,n,x=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,s,i?i[0]:r.__k&&Ie(r,0),o,l),i!=null)for(c=i.length;c--;)Jt(i[c]);o||(c="value",x=="progress"&&k==null?e.removeAttribute("value"):k!=null&&(k!==e[c]||x=="progress"&&!k||x=="option"&&k!=C[c])&&mt(e,c,k,C[c],a),c="checked",y!=null&&y!=e[c]&&mt(e,c,y,C[c],a))}return e}function qt(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(a){N.__e(a,r)}}function un(e,t,r){var n,a;if(N.unmount&&N.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||qt(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){N.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(a=0;a<n.length;a++)n[a]&&un(n[a],t,r||typeof e.type!="function");r||Jt(e.__e),e.__c=e.__=e.__e=void 0}function yo(e,t,r){return this.constructor(e,r)}function fn(e,t,r){var n,a,i,s;t==document&&(t=document.documentElement),N.__&&N.__(e,t),a=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],s=[],Qt(t,e=(!n&&r||t).__k=Fe(X,null,[e]),a||dt,dt,t.namespaceURI,!n&&r?[r]:a?null:t.firstChild?lt.call(t.childNodes):null,i,!n&&r?r:a?a.__e:t.firstChild,n,s),ln(i,e,s)}lt=ut.slice,N={__e:function(e,t,r,n){for(var a,i,s;t=t.__;)if((a=t.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(e)),s=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,n||{}),s=a.__d),s)return a.__E=a}catch(o){e=o}throw e}},Qr=0,fo=function(e){return e!=null&&e.constructor===void 0},de.prototype.setState=function(e,t){var r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=le({},this.state);typeof e=="function"&&(e=e(le({},r),this.props)),e&&le(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),nn(this))},de.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),nn(this))},de.prototype.render=X,pe=[],qr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,en=function(e,t){return e.__v.__b-t.__v.__b},ht.__r=0,tn=/(PointerCapture)$|Capture$/i,Gt=0,Yt=cn(!1),Xt=cn(!0),ho=0;var We,O,er,hn,ze=0,mn=[],P=N,pn=P.__b,gn=P.__r,_n=P.diffed,vn=P.__c,yn=P.unmount,kn=P.__;function tr(e,t){P.__h&&P.__h(O,e,ze||t),ze=0;var r=O.__H||(O.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Ne(e){return ze=1,ko(Sn,e)}function ko(e,t,r){var n=tr(We++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Sn(void 0,t),function(o){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,o);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=O,!O.__f)){var a=function(o,l,c){if(!n.__c.__H)return!0;var f=n.__c.__H.__.filter(function(m){return m.__c});if(f.every(function(m){return!m.__N}))return!i||i.call(this,o,l,c);var d=n.__c.props!==o;return f.some(function(m){if(m.__N){var h=m.__[0];m.__=m.__N,m.__N=void 0,h!==m.__[0]&&(d=!0)}}),i&&i.call(this,o,l,c)||d};O.__f=!0;var i=O.shouldComponentUpdate,s=O.componentWillUpdate;O.componentWillUpdate=function(o,l,c){if(this.__e){var f=i;i=void 0,a(o,l,c),i=f}s&&s.call(this,o,l,c)},O.shouldComponentUpdate=a}return n.__N||n.__}function Te(e,t){var r=tr(We++,3);!P.__s&&wn(r.__H,t)&&(r.__=e,r.u=t,O.__H.__h.push(r))}function Le(e){return ze=5,bn(function(){return{current:e}},[])}function bn(e,t){var r=tr(We++,7);return wn(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function bo(e,t){return ze=8,bn(function(){return e},t)}function xo(){for(var e;e=mn.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(pt),t.__h.some(rr),t.__h=[]}catch(r){t.__h=[],P.__e(r,e.__v)}}}P.__b=function(e){O=null,pn&&pn(e)},P.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),kn&&kn(e,t)},P.__r=function(e){gn&&gn(e),We=0;var t=(O=e.__c).__H;t&&(er===O?(t.__h=[],O.__h=[],t.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.some(pt),t.__h.some(rr),t.__h=[],We=0)),er=O},P.diffed=function(e){_n&&_n(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(mn.push(t)!==1&&hn===P.requestAnimationFrame||((hn=P.requestAnimationFrame)||wo)(xo)),t.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),er=O=null},P.__c=function(e,t){t.some(function(r){try{r.__h.some(pt),r.__h=r.__h.filter(function(n){return!n.__||rr(n)})}catch(n){t.some(function(a){a.__h&&(a.__h=[])}),t=[],P.__e(n,r.__v)}}),vn&&vn(e,t)},P.unmount=function(e){yn&&yn(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(n){try{pt(n)}catch(a){t=a}}),r.__H=void 0,t&&P.__e(t,r.__v))};var xn=typeof requestAnimationFrame=="function";function wo(e){var t,r=function(){clearTimeout(n),xn&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);xn&&(t=requestAnimationFrame(r))}function pt(e){var t=O,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),O=t}function rr(e){var t=O;e.__c=e.__(),O=t}function wn(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Sn(e,t){return typeof t=="function"?t(e):t}function So(e,t){for(var r in t)e[r]=t[r];return e}function Cn(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function In(e,t){this.props=e,this.context=t}(In.prototype=new de).isPureReactComponent=!0,In.prototype.shouldComponentUpdate=function(e,t){return Cn(this.props,e)||Cn(this.state,t)};var Nn=N.__b;N.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Nn&&Nn(e)};var Vc=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911,Tn=function(e,t){return e==null?null:ue(ue(e).map(t))},$c={map:Tn,forEach:Tn,count:function(e){return e?ue(e).length:0},only:function(e){var t=ue(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:ue},Co=N.__e;N.__e=function(e,t,r,n){if(e.then){for(var a,i=t;i=i.__;)if((a=i.__c)&&a.__c)return t.__e??(t.__e=r.__e,t.__k=r.__k),a.__c(e,t)}Co(e,t,r,n)};var Ln=N.unmount;function An(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=So({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return An(n,t,r)})),e}function Rn(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Rn(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function nr(){this.__u=0,this.o=null,this.__b=null}function En(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function gt(){this.i=null,this.l=null}N.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ln&&Ln(e)},(nr.prototype=new de).__c=function(e,t){var r=t.__c,n=this;n.o??=[],n.o.push(r);var a=En(n.__v),i=!1,s=function(){i||n.__z||(i=!0,r.__R=null,a?a(l):l())};r.__R=s;var o=r.__P;r.__P=null;var l=function(){if(!--n.__u){if(n.state.__a){var c=n.state.__a;n.__v.__k[0]=Rn(c,c.__c.__P,c.__c.__O)}var f;for(n.setState({__a:n.__b=null});f=n.o.pop();)f.__P=o,f.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(s,s)},nr.prototype.componentWillUnmount=function(){this.o=[]},nr.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=An(this.__b,r,n.__O=n.__P)}this.__b=null}var a=t.__a&&Fe(X,null,e.fallback);return a&&(a.__u&=-33),[Fe(X,null,t.__a?null:e.children),a]};var Zn=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(gt.prototype=new de).__a=function(e){var t=this,r=En(t.__v),n=t.l.get(e);return n[0]++,function(a){var i=function(){t.props.revealOrder?(n.push(a),Zn(t,e,n)):a()};r?r(i):i()}},gt.prototype.render=function(e){this.i=null,this.l=new Map;var t=ue(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},gt.prototype.componentDidUpdate=gt.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Zn(e,r,t)})};var Io=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,No=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,To=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Lo=/[A-Z0-9]/g,Ao=typeof document<"u",Ro=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Eo(e,t,r){return t.__k??(t.textContent=""),fn(e,t),typeof r=="function"&&r(),e?e.__c:null}de.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(de.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var jn=N.event;N.event=function(e){return jn&&(e=jn(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Mn,Zo={configurable:!0,get:function(){return this.class}},On=N.vnode;N.vnode=function(e){typeof e.type=="string"&&(function(t){var r=t.props,n=t.type,a={},i=n.indexOf("-")==-1;for(var s in r){var o=r[s];if(!(s==="value"&&"defaultValue"in r&&o==null||Ao&&s==="children"&&n==="noscript"||s==="class"||s==="className")){var l=s.toLowerCase();s==="defaultValue"&&"value"in r&&r.value==null?s="value":s==="download"&&o===!0?o="":l==="translate"&&o==="no"?o=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?s="ondblclick":l!=="onchange"||n!=="input"&&n!=="textarea"||Ro(r.type)?l==="onfocus"?s="onfocusin":l==="onblur"?s="onfocusout":To.test(s)&&(s=l):l=s="oninput":i&&No.test(s)?s=s.replace(Lo,"-$&").toLowerCase():o===null&&(o=void 0),l==="oninput"&&a[s=l]&&(s="oninputCapture"),a[s]=o}}n=="select"&&(a.multiple&&Array.isArray(a.value)&&(a.value=ue(r.children).forEach(function(c){c.props.selected=a.value.indexOf(c.props.value)!=-1})),a.defaultValue!=null&&(a.value=ue(r.children).forEach(function(c){c.props.selected=a.multiple?a.defaultValue.indexOf(c.props.value)!=-1:a.defaultValue==c.props.value}))),r.class&&!r.className?(a.class=r.class,Object.defineProperty(a,"className",Zo)):r.className&&(a.class=a.className=r.className),t.props=a})(e),e.$$typeof=Io,On&&On(e)};var Pn=N.__r;N.__r=function(e){Pn&&Pn(e),Mn=e.__c};var Vn=N.diffed;N.diffed=function(e){Vn&&Vn(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),Mn=null};function jo(e){return!!e.__k&&(fn(null,e),!0)}function Mo(e){return{render:function(t){Eo(t,e)},unmount:function(){jo(e)}}}function Oo(e){const{theme:t}=e,r=[`--ak-accent: ${t.accentColor}`,`--ak-font: ${t.fontFamily}`,`--ak-radius: ${t.borderRadius}`];return r.push(`--ak-accent-hover: color-mix(in srgb, ${t.accentColor} 85%, black)`),`:host { ${r.join("; ")} }`}function Po(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Vo=`
7
7
  *, *::before, *::after {
8
8
  box-sizing: border-box;
9
9
  margin: 0;
@@ -47,7 +47,7 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
47
47
  display: flex;
48
48
  flex-direction: column;
49
49
  align-items: flex-end;
50
- gap: 12px;
50
+ gap: 6px;
51
51
  pointer-events: none;
52
52
  }
53
53
  .ak-floating > * {
@@ -104,6 +104,13 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
104
104
  pointer-events: none;
105
105
  }
106
106
 
107
+ /* ── Shell wrapper (positions the hanging branding tab) ─────── */
108
+ .ak-shell-wrap {
109
+ display: flex;
110
+ flex-direction: column;
111
+ align-items: flex-start;
112
+ }
113
+
107
114
  /* ── Widget shell / panel ────────────────────────────────────── */
108
115
  .ak-shell {
109
116
  background: var(--ak-bg);
@@ -139,6 +146,7 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
139
146
  /* ── Header ──────────────────────────────────────────────────── */
140
147
  .ak-header {
141
148
  display: flex;
149
+ flex-direction: row;
142
150
  align-items: center;
143
151
  justify-content: space-between;
144
152
  padding: 14px 18px;
@@ -147,6 +155,19 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
147
155
  flex-shrink: 0;
148
156
  gap: 8px;
149
157
  }
158
+ .ak-header--confirming {
159
+ flex-direction: column;
160
+ align-items: stretch;
161
+ justify-content: flex-start;
162
+ gap: 0;
163
+ }
164
+ .ak-header__row {
165
+ display: flex;
166
+ align-items: center;
167
+ justify-content: space-between;
168
+ width: 100%;
169
+ gap: 8px;
170
+ }
150
171
  .ak-header__status {
151
172
  width: 8px;
152
173
  height: 8px;
@@ -200,6 +221,114 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
200
221
  border: 2px solid rgba(255, 255, 255, 0.3);
201
222
  background: rgba(255, 255, 255, 0.15);
202
223
  }
224
+ .ak-header__bot-icon {
225
+ width: 28px;
226
+ height: 28px;
227
+ border-radius: 50%;
228
+ background: rgba(255, 255, 255, 0.2);
229
+ display: flex;
230
+ align-items: center;
231
+ justify-content: center;
232
+ color: #fff;
233
+ flex-shrink: 0;
234
+ }
235
+ .ak-header__button {
236
+ width: 28px;
237
+ height: 28px;
238
+ border-radius: 50%;
239
+ background: transparent;
240
+ border: none;
241
+ cursor: pointer;
242
+ display: flex;
243
+ align-items: center;
244
+ justify-content: center;
245
+ color: #fff;
246
+ transition: background 0.15s;
247
+ flex-shrink: 0;
248
+ }
249
+ .ak-header__button:hover {
250
+ background: rgba(255, 255, 255, 0.15);
251
+ }
252
+ .ak-header__button--active {
253
+ background: rgba(255, 255, 255, 0.3);
254
+ }
255
+ .ak-header__confirm {
256
+ width: 100%;
257
+ display: flex;
258
+ align-items: center;
259
+ justify-content: space-between;
260
+ gap: 8px;
261
+ padding: 8px 0 0;
262
+ margin: 8px 0 0;
263
+ border-top: 1px solid rgba(255, 255, 255, 0.2);
264
+ animation: ak-confirm-in 0.18s ease-out;
265
+ }
266
+ @keyframes ak-confirm-in {
267
+ from { opacity: 0; transform: translateY(-4px); }
268
+ to { opacity: 1; transform: translateY(0); }
269
+ }
270
+ .ak-header__confirm-text {
271
+ display: flex;
272
+ flex-direction: column;
273
+ gap: 1px;
274
+ flex: 1;
275
+ min-width: 0;
276
+ }
277
+ .ak-header__confirm-title {
278
+ font-size: 13px;
279
+ font-weight: 600;
280
+ color: #fff;
281
+ line-height: 1.3;
282
+ }
283
+ .ak-header__confirm-sub {
284
+ font-size: 11px;
285
+ color: rgba(255, 255, 255, 0.75);
286
+ line-height: 1.3;
287
+ }
288
+ .ak-header__confirm-actions {
289
+ display: flex;
290
+ align-items: center;
291
+ gap: 6px;
292
+ flex-shrink: 0;
293
+ }
294
+ .ak-header__confirm-cancel {
295
+ padding: 5px 10px;
296
+ border-radius: 6px;
297
+ border: 1px solid rgba(255, 255, 255, 0.4);
298
+ background: transparent;
299
+ color: #fff;
300
+ font-family: var(--ak-font);
301
+ font-size: 12px;
302
+ font-weight: 500;
303
+ cursor: pointer;
304
+ transition: background 0.15s;
305
+ white-space: nowrap;
306
+ }
307
+ .ak-header__confirm-cancel:hover {
308
+ background: rgba(255, 255, 255, 0.15);
309
+ }
310
+ .ak-header__confirm-cancel:active {
311
+ background: rgba(255, 255, 255, 0.25);
312
+ }
313
+ .ak-header__confirm-ok {
314
+ padding: 5px 10px;
315
+ border-radius: 6px;
316
+ border: none;
317
+ background: rgba(255, 255, 255, 0.2);
318
+ color: #fff;
319
+ font-family: var(--ak-font);
320
+ font-size: 12px;
321
+ font-weight: 600;
322
+ cursor: pointer;
323
+ transition: background 0.15s;
324
+ white-space: nowrap;
325
+ }
326
+ .ak-header__confirm-ok:hover {
327
+ background: rgba(239, 68, 68, 0.7);
328
+ }
329
+ .ak-header__confirm-ok:active {
330
+ background: rgba(239, 68, 68, 0.85);
331
+ }
203
332
 
204
333
  /* ── Message list ────────────────────────────────────────────── */
205
334
  .ak-messages {
@@ -219,6 +348,115 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
219
348
  border-radius: 4px;
220
349
  }
221
350
 
351
+ /* ── Empty state ─────────────────────────────────────────────── */
352
+ .ak-empty-state {
353
+ flex: 1;
354
+ position: relative;
355
+ display: flex;
356
+ flex-direction: column;
357
+ align-items: center;
358
+ justify-content: center;
359
+ padding: 0;
360
+ text-align: center;
361
+ gap: 16px;
362
+ overflow-y: auto;
363
+ overflow-x: hidden;
364
+ min-height: 0;
365
+ background: radial-gradient(ellipse 110% 55% at 50% 0%,
366
+ color-mix(in srgb, var(--ak-accent) 10%, var(--ak-bg)),
367
+ var(--ak-bg) 72%
368
+ );
369
+ }
370
+ /* Decorative blurred orb behind the avatar */
371
+ .ak-empty-state__glow {
372
+ position: absolute;
373
+ top: -24px;
374
+ left: 50%;
375
+ transform: translateX(-50%);
376
+ width: 180px;
377
+ height: 180px;
378
+ border-radius: 50%;
379
+ background: color-mix(in srgb, var(--ak-accent) 18%, transparent);
380
+ filter: blur(48px);
381
+ pointer-events: none;
382
+ }
383
+ .ak-empty-state__body {
384
+ display: flex;
385
+ flex-direction: column;
386
+ align-items: center;
387
+ gap: 8px;
388
+ position: relative;
389
+ }
390
+ .ak-empty-state__avatar {
391
+ width: 64px;
392
+ height: 64px;
393
+ border-radius: 50%;
394
+ background: var(--ak-bg);
395
+ border: 2px solid color-mix(in srgb, var(--ak-accent) 25%, var(--ak-border));
396
+ box-shadow:
397
+ 0 0 0 4px color-mix(in srgb, var(--ak-accent) 10%, transparent),
398
+ 0 4px 16px color-mix(in srgb, var(--ak-accent) 20%, transparent);
399
+ display: flex;
400
+ align-items: center;
401
+ justify-content: center;
402
+ color: var(--ak-accent);
403
+ margin-bottom: 4px;
404
+ flex-shrink: 0;
405
+ }
406
+ .ak-empty-state__avatar-img {
407
+ width: 64px;
408
+ height: 64px;
409
+ border-radius: 50%;
410
+ object-fit: cover;
411
+ }
412
+ .ak-empty-state__bot-icon {
413
+ display: flex;
414
+ align-items: center;
415
+ justify-content: center;
416
+ }
417
+ .ak-empty-state__title {
418
+ margin: 0;
419
+ font-size: 16px;
420
+ font-weight: 700;
421
+ color: var(--ak-text);
422
+ line-height: 1.3;
423
+ letter-spacing: -0.01em;
424
+ }
425
+ .ak-empty-state__description {
426
+ margin: 0;
427
+ font-size: 13px;
428
+ color: var(--ak-text-muted);
429
+ line-height: 1.55;
430
+ max-width: 260px;
431
+ }
432
+ /* Quoted greeting block */
433
+ .ak-empty-state__quote {
434
+ position: relative;
435
+ max-width: 280px;
436
+ width: calc(100% - 32px);
437
+ background: color-mix(in srgb, var(--ak-accent) 6%, var(--ak-bg));
438
+ border: 1px solid color-mix(in srgb, var(--ak-accent) 18%, var(--ak-border));
439
+ border-radius: 12px;
440
+ padding: 12px 14px 12px 16px;
441
+ text-align: left;
442
+ }
443
+ .ak-empty-state__quote-mark {
444
+ display: block;
445
+ font-size: 32px;
446
+ line-height: 1;
447
+ color: var(--ak-accent);
448
+ margin-bottom: 2px;
449
+ font-family: Georgia, serif;
450
+ opacity: 0.7;
451
+ }
452
+ .ak-empty-state__quote-text {
453
+ margin: 0;
454
+ font-size: 13px;
455
+ color: var(--ak-text-muted);
456
+ line-height: 1.55;
457
+ font-style: italic;
458
+ }
459
+
222
460
  /* ── Message bubbles ─────────────────────────────────────────── */
223
461
  .ak-message {
224
462
  display: flex;
@@ -248,6 +486,9 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
248
486
  max-width: 100%;
249
487
  min-width: 0;
250
488
  }
489
+ .ak-message__bubble--md {
490
+ white-space: normal;
491
+ }
251
492
  .ak-message--user .ak-message__bubble {
252
493
  background: var(--ak-user-bg);
253
494
  color: var(--ak-user-text);
@@ -257,6 +498,7 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
257
498
  background: var(--ak-bot-bg);
258
499
  color: var(--ak-bot-text);
259
500
  border-bottom-left-radius: 4px;
501
+ border: 1px solid var(--ak-border);
260
502
  }
261
503
  .ak-message--error .ak-message__bubble {
262
504
  background: #fee2e2;
@@ -371,6 +613,7 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
371
613
  background: var(--ak-bot-bg);
372
614
  border-radius: 16px;
373
615
  border-bottom-left-radius: 4px;
616
+ border: 1px solid var(--ak-border);
374
617
  align-self: flex-start;
375
618
  width: fit-content;
376
619
  animation: ak-msg-in 0.15s ease-out;
@@ -415,6 +658,7 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
415
658
 
416
659
  /* ── Composer ────────────────────────────────────────────────── */
417
660
  .ak-composer {
661
+ position: relative; /* establishes positioning context for the attachment submenu */
418
662
  padding: 10px 14px 12px;
419
663
  border-top: 1px solid var(--ak-border);
420
664
  display: flex;
@@ -424,70 +668,125 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
424
668
  flex-shrink: 0;
425
669
  }
426
670
 
427
- /* Inner row: photo button + textarea + send button */
428
- .ak-composer__row {
429
- display: flex;
430
- gap: 8px;
431
- align-items: flex-end;
432
- }
433
-
434
671
  /* Hidden native file input */
435
672
  .ak-composer__file-input {
436
673
  display: none;
437
674
  }
438
675
 
439
- /* Photo attach button */
440
- .ak-composer__photo {
441
- width: 34px;
442
- height: 34px;
443
- border-radius: 50%;
444
- background: transparent;
676
+ /* Unified input container — wraps +, textarea, send as one row */
677
+ .ak-composer__input-wrap {
678
+ display: flex;
679
+ align-items: center;
680
+ gap: 6px;
681
+ background: var(--ak-surface);
682
+ border: 1px solid var(--ak-border);
683
+ border-radius: 14px;
684
+ padding: 5px 5px 5px 6px;
685
+ transition: border-color 0.15s;
686
+ }
687
+ .ak-composer__input-wrap:focus-within {
688
+ border-color: var(--ak-accent);
689
+ }
690
+
691
+ /* Attach button wrapper */
692
+ .ak-composer__attach-wrap {
693
+ flex-shrink: 0;
694
+ }
695
+
696
+ /* "+" attachment button — square with rounded corners */
697
+ .ak-composer__attach {
698
+ width: 28px;
699
+ height: 28px;
700
+ border-radius: 8px;
701
+ background: var(--ak-bg);
445
702
  border: 1px solid var(--ak-border);
446
703
  cursor: pointer;
447
704
  display: flex;
448
705
  align-items: center;
449
706
  justify-content: center;
450
707
  color: var(--ak-text-muted);
451
- transition: background 0.15s, color 0.15s, border-color 0.15s;
708
+ transition: color 0.15s, border-color 0.15s, background 0.15s;
452
709
  flex-shrink: 0;
453
710
  }
454
- .ak-composer__photo:hover:not(:disabled) {
455
- background: var(--ak-surface);
711
+ .ak-composer__attach:hover:not(:disabled) {
456
712
  color: var(--ak-accent);
457
713
  border-color: var(--ak-accent);
458
714
  }
459
- .ak-composer__photo:disabled {
715
+ .ak-composer__attach--open {
716
+ color: var(--ak-accent);
717
+ border-color: var(--ak-accent);
718
+ background: color-mix(in srgb, var(--ak-accent) 8%, transparent);
719
+ }
720
+ .ak-composer__attach:disabled {
721
+ opacity: 0.4;
722
+ cursor: not-allowed;
723
+ }
724
+
725
+ /* Attachment submenu — floats above the composer, positioned relative to .ak-composer */
726
+ .ak-composer__attach-menu {
727
+ position: absolute;
728
+ bottom: calc(100% + 6px);
729
+ left: 14px;
730
+ background: var(--ak-surface);
731
+ border: 1px solid var(--ak-border);
732
+ border-radius: 10px;
733
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
734
+ padding: 4px;
735
+ min-width: 130px;
736
+ z-index: 10;
737
+ }
738
+
739
+ /* Individual item inside the attachment submenu */
740
+ .ak-composer__attach-menu-item {
741
+ display: flex;
742
+ align-items: center;
743
+ gap: 8px;
744
+ width: 100%;
745
+ padding: 7px 10px;
746
+ border: none;
747
+ border-radius: 7px;
748
+ background: transparent;
749
+ color: var(--ak-text);
750
+ font-family: var(--ak-font);
751
+ font-size: 13px;
752
+ cursor: pointer;
753
+ transition: background 0.12s;
754
+ text-align: left;
755
+ }
756
+ .ak-composer__attach-menu-item:hover:not(:disabled) {
757
+ background: var(--ak-bg);
758
+ }
759
+ .ak-composer__attach-menu-item:disabled {
460
760
  opacity: 0.4;
461
761
  cursor: not-allowed;
462
762
  }
463
763
 
764
+ /* Textarea — borderless, transparent, sits inside the container */
464
765
  .ak-composer__input {
465
766
  flex: 1;
466
- padding: 9px 13px;
467
- border: 1px solid var(--ak-border);
468
- border-radius: 20px;
469
- background: var(--ak-surface);
767
+ padding: 4px 6px;
768
+ border: none;
769
+ border-radius: 0;
770
+ background: transparent;
470
771
  color: var(--ak-text);
471
772
  font-family: var(--ak-font);
472
773
  font-size: 14px;
473
774
  line-height: 1.45;
474
775
  resize: none;
475
776
  outline: none;
476
- transition: border-color 0.15s;
477
- min-height: 38px;
777
+ min-height: 28px;
478
778
  max-height: 110px;
479
779
  overflow-y: auto;
480
780
  }
481
- .ak-composer__input:focus {
482
- border-color: var(--ak-accent);
483
- }
484
781
  .ak-composer__input::placeholder {
485
782
  color: var(--ak-text-muted);
486
783
  }
784
+
785
+ /* Send button — square with rounded corners */
487
786
  .ak-composer__send {
488
- width: 36px;
489
- height: 36px;
490
- border-radius: 50%;
787
+ width: 28px;
788
+ height: 28px;
789
+ border-radius: 8px;
491
790
  background: var(--ak-accent);
492
791
  border: none;
493
792
  cursor: pointer;
@@ -495,18 +794,22 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
495
794
  align-items: center;
496
795
  justify-content: center;
497
796
  color: white;
498
- transition: background 0.15s, transform 0.15s, opacity 0.15s;
797
+ transition: background 0.15s, opacity 0.15s;
499
798
  flex-shrink: 0;
500
799
  }
501
800
  .ak-composer__send:hover:not(:disabled) {
502
801
  background: var(--ak-accent-hover);
503
- transform: scale(1.06);
504
802
  }
505
803
  .ak-composer__send:disabled {
506
804
  opacity: 0.45;
507
805
  cursor: not-allowed;
508
806
  }
509
807
 
808
+ /* Old photo button — hidden but keep so file-input trigger still works */
809
+ .ak-composer__photo {
810
+ display: none;
811
+ }
812
+
510
813
  /* Image preview strip above the input row */
511
814
  .ak-composer__preview {
512
815
  display: flex;
@@ -575,11 +878,16 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
575
878
  min-width: 0;
576
879
  }
577
880
  .ak-message__bubble--md .ak-md-p {
578
- margin-bottom: 0.5em;
881
+ margin: 0 0 0.4em 0;
579
882
  }
580
883
  .ak-message__bubble--md .ak-md-p:last-child {
581
884
  margin-bottom: 0;
582
885
  }
886
+ /* Collapse margins between paragraph and following list */
887
+ .ak-message__bubble--md .ak-md-p + .ak-md-ul,
888
+ .ak-message__bubble--md .ak-md-p + .ak-md-ol {
889
+ margin-top: 0;
890
+ }
583
891
  .ak-message__bubble--md .ak-md-h1,
584
892
  .ak-message__bubble--md .ak-md-h2,
585
893
  .ak-message__bubble--md .ak-md-h3 {
@@ -598,7 +906,7 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
598
906
  .ak-message__bubble--md .ak-md-ul,
599
907
  .ak-message__bubble--md .ak-md-ol {
600
908
  padding-left: 1.4em;
601
- margin: 0.25em 0;
909
+ margin: 0.4em 0;
602
910
  }
603
911
  .ak-message__bubble--md .ak-md-ul li,
604
912
  .ak-message__bubble--md .ak-md-ol li {
@@ -796,7 +1104,42 @@ var AgentKit=function(re){"use strict";var Zo=Object.defineProperty;var Vo=(re,T
796
1104
  overflow-y: auto;
797
1105
  line-height: 1.5;
798
1106
  }
799
- `;var ko=0;function f(t,e,n,r,a,i){e||(e={});var s,o,l=e;if("ref"in l)for(o in l={},e)o=="ref"?s=e[o]:l[o]=e[o];var c={type:t,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ko,__i:-1,__u:0,__source:a,__self:i};if(typeof t=="function"&&(s=t.defaultProps))for(o in s)l[o]===void 0&&(l[o]=s[o]);return N.vnode&&N.vnode(c),c}function bo(){return f("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[f("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function xo({title:t,subtitle:e,avatarUrl:n,onClose:r,hideClose:a=!1}){return f("div",{className:"ak-header",children:[n?f("img",{src:n,alt:"",className:"ak-header__avatar","aria-hidden":"true"}):f("span",{className:"ak-header__status","aria-hidden":"true"}),f("div",{className:"ak-header__title-group",children:[f("span",{className:"ak-header__title",children:t}),e&&f("span",{className:"ak-header__subtitle",children:e})]}),!a&&f("button",{className:"ak-header__close",onClick:r,"aria-label":"Close chat",type:"button",children:f(bo,{})})]})}function wo({thinking:t,isThinking:e,thinkingViewable:n}){const[r,a]=st(!1);return!e&&!t?null:e?f("div",{className:"ak-thinking",children:f("div",{className:"ak-thinking__indicator",children:[f("span",{className:"ak-thinking__label",children:"Thinking"}),f("span",{className:"ak-cursor","aria-hidden":"true",children:[f("span",{className:"ak-cursor__dot"}),f("span",{className:"ak-cursor__dot"}),f("span",{className:"ak-cursor__dot"})]})]})}):!n||!t?null:f("div",{className:"ak-thinking ak-thinking--done",children:[f("button",{className:"ak-thinking__toggle",onClick:()=>a(i=>!i),"aria-expanded":r,type:"button",children:[f("svg",{className:`ak-thinking__chevron${r?" ak-thinking__chevron--open":""}`,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f("polyline",{points:"6 9 12 15 18 9"})}),f("span",{children:"Thought for a moment"})]}),r&&f("div",{className:"ak-thinking__content",children:t})]})}function So(t){try{return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}const Sr=/(`[^`\n]+`|\*\*[^*\n]+\*\*|\*[^*\n]+\*|!\[[^\]\n]*\]\([^)\n]+\)|\[[^\]\n]+\]\([^)\n]+\))/g;function J(t){const e=[];let n=0,r=0;Sr.lastIndex=0;let a;for(;(a=Sr.exec(t))!==null;){a.index>n&&e.push(t.slice(n,a.index));const i=a[0];if(i.startsWith("`"))e.push(f("code",{className:"ak-md-ic",children:i.slice(1,-1)},r++));else if(i.startsWith("**"))e.push(f("strong",{children:i.slice(2,-2)},r++));else if(i.startsWith("*"))e.push(f("em",{children:i.slice(1,-1)},r++));else if(i.startsWith("![")){const s=i.match(/!\[([^\]]*)\]\(([^)]+)\)/);s&&e.push(f("a",{href:s[2],target:"_blank",rel:"noopener noreferrer",children:s[1]||"image"},r++))}else{const s=i.match(/\[(.+?)\]\((.+?)\)/);s?e.push(f("a",{href:s[2],target:"_blank",rel:"noopener noreferrer",children:s[1]},r++)):e.push(i)}n=a.index+i.length}return n<t.length&&e.push(t.slice(n)),e}function Co(t){const e=t.split(`
800
- `),n=[];let r=0,a=0;for(;r<e.length;){const i=e[r],s=i.match(/^(\s*)```/);if(s){const c=s[1],u=i.trimStart().match(/^```(\w+)?\s*$/),d=(u==null?void 0:u[1])||"",m=[];for(r++;r<e.length&&!e[r].trimStart().startsWith("```");)m.push(e[r].startsWith(c)?e[r].slice(c.length):e[r]),r++;r<e.length&&e[r].trimStart().startsWith("```")&&r++,n.push(f("div",{className:"ak-md-pre-wrap",children:[d&&f("span",{className:"ak-md-pre-lang",children:d}),f("pre",{className:`ak-md-pre${d?` ak-md-pre--${d}`:""}`,children:f("code",{className:"ak-md-code",children:m.join(`
801
- `)})})]},a++));continue}const o=i.match(/^(#{1,6})(\s+.*)?$/);if(o){const c=o[1].length,u=o[2]?J(o[2].trim()):"";c===1?n.push(f("h1",{className:"ak-md-h1",children:u},a++)):c===2?n.push(f("h2",{className:"ak-md-h2",children:u},a++)):c===3?n.push(f("h3",{className:"ak-md-h3",children:u},a++)):c===4?n.push(f("h4",{className:"ak-md-h4",children:u},a++)):c===5?n.push(f("h5",{className:"ak-md-h5",children:u},a++)):n.push(f("h6",{className:"ak-md-h6",children:u},a++)),r++;continue}if(/^[-*_]{3,}$/.test(i.trim())){n.push(f("hr",{className:"ak-md-hr"},a++)),r++;continue}if(/^[-*+]\s/.test(i)){const c=[];let u=r;for(;u<e.length&&(/^[-*+]\s/.test(e[u])||e[u].trim()==="");){if(e[u].trim()===""){u++;continue}const d=e[u].length-e[u].trimStart().length,m=e[u].replace(/^[-*+]\s+/,""),h=[],x=[];let _=u+1;for(;_<e.length&&_<u+20;){const v=e[_];if(v.length-v.trimStart().length>d&&v.trim()!==""){const C=v.trim();/^[-*+]\s/.test(C)?h.push(f("li",{children:J(C.replace(/^[-*+]\s+/,""))},`nested-${_}`)):x.push(f("p",{style:{margin:"0.2em 0 0"},children:J(C)},`cont-${_}`)),_++}else break}const I=x.length>0||h.length>0?f(X,{children:[J(m),x,h.length>0&&f("ul",{style:{margin:"0.2em 0 0",paddingLeft:"1.2em"},children:h})]}):J(m);c.push(f("li",{children:I},`item-${u}`)),u=_}n.push(f("ul",{className:"ak-md-ul",children:c},a++)),r=u;continue}if(/^\d+\.\s/.test(i)){const c=[];let u=r;for(;u<e.length&&(/^\d+\.\s/.test(e[u])||e[u].trim()==="");){if(e[u].trim()===""){u++;continue}const d=e[u].length-e[u].trimStart().length,m=e[u].replace(/^\d+\.\s+/,""),h=[],x=[];let _=u+1;for(;_<e.length&&_<u+20;){const v=e[_];if(v.length-v.trimStart().length>d&&v.trim()!==""){const C=v.trim();/^\d+\.\s/.test(C)?h.push(f("li",{children:J(C.replace(/^\d+\.\s+/,""))},`nested-order-${_}`)):/^[-*+]\s/.test(C)?h.push(f("li",{children:J(C.replace(/^[-*+]\s+/,""))},`nested-unorder-${_}`)):x.push(f("p",{style:{margin:"0.2em 0 0"},children:J(C)},`cont-${_}`)),_++}else break}const I=x.length>0||h.length>0?f(X,{children:[J(m),x,h.length>0&&f("ol",{style:{margin:"0.2em 0 0",paddingLeft:"1.2em"},children:h})]}):J(m);c.push(f("li",{children:I},`order-item-${u}`)),u=_}n.push(f("ol",{className:"ak-md-ol",children:c},a++)),r=u;continue}if(i.trim()===""){r++;continue}const l=[];for(;r<e.length&&e[r].trim()!==""&&!e[r].startsWith("#")&&!/^\s*```/.test(e[r])&&!/^[-*+]\s/.test(e[r])&&!/^\d+\.\s/.test(e[r])&&!/^[-*_]{3,}$/.test(e[r].trim());)l.push(e[r]),r++;if(l.length>0){const c=[];l.forEach((u,d)=>{c.push(...J(u)),d<l.length-1&&c.push(f("br",{},`br-${d}`))}),n.push(f("p",{className:"ak-md-p",children:c},a++))}}return f(X,{children:n})}function Io({message:t,thinkingViewable:e=!1}){const n=t.role==="user",r=t.status==="error",a=t.status==="streaming",i=!!(t.images&&t.images.length>0),s=!!(n&&t.uploadedImageUrl),o=i||s,l=!n&&!r,c=n?"ak-message--user":r?"ak-message--assistant ak-message--error":"ak-message--assistant",u=["ak-message__bubble",l?"ak-message__bubble--md":"",o?"ak-message__bubble--has-image":""].filter(Boolean).join(" "),d=f(X,{children:[f("div",{className:u,children:[s&&f("div",{className:"ak-message__images",children:f("div",{className:"ak-message__image-wrap",children:[f("a",{href:t.uploadedImageUrl,className:"ak-message__image-link",children:f("img",{src:t.uploadedImageUrl,alt:"Uploaded image",className:"ak-message__image"})}),f("a",{href:t.uploadedImageUrl,download:!0,className:"ak-message__image-dl-icon",title:"Download image",onClick:h=>h.stopPropagation(),children:f("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[f("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),f("polyline",{points:"7 10 12 15 17 10"}),f("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]})}),i&&f("div",{className:"ak-message__images",children:t.images.map((h,x)=>{const _=h.url??(h.base64?`data:${h.mimeType};base64,${h.base64}`:null);return _?f("div",{className:"ak-message__image-wrap",children:[f("a",{href:_,className:"ak-message__image-link",children:f("img",{src:_,alt:"Generated image",className:"ak-message__image"})}),f("a",{href:_,download:!0,className:"ak-message__image-dl-icon",title:"Download image",onClick:I=>I.stopPropagation(),children:f("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[f("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),f("polyline",{points:"7 10 12 15 17 10"}),f("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]},x):null})}),(t.content||a&&!t.isThinking)&&f("div",{className:o?"ak-message__image-caption":void 0,children:[l?Co(t.content):t.content,a&&!t.isThinking&&f("span",{className:"ak-cursor","aria-hidden":"true",children:[f("span",{className:"ak-cursor__dot"}),f("span",{className:"ak-cursor__dot"}),f("span",{className:"ak-cursor__dot"})]})]})]}),f("span",{className:"ak-message__time",children:So(t.createdAt)})]}),m=!t.isThinking||!!t.content;return f("div",{className:`ak-message ${c}`,children:[!n&&f(wo,{thinking:t.thinking,isThinking:t.isThinking??!1,thinkingViewable:e}),m&&d]})}function No(){return f("div",{className:"ak-typing","aria-label":"Assistant is typing",children:[f("span",{className:"ak-typing__dot"}),f("span",{className:"ak-typing__dot"}),f("span",{className:"ak-typing__dot"})]})}function To({messages:t,isLoading:e,thinkingViewable:n}){var s,o;const r=ct(null),a=((s=t.find(l=>l.status==="streaming"))==null?void 0:s.content)??"",i=((o=t.find(l=>l.isThinking))==null?void 0:o.thinking)??"";return ot(()=>{var l;(l=r.current)==null||l.scrollIntoView({behavior:"smooth"})},[t.length,e,a,i]),f("div",{className:"ak-messages",role:"log","aria-live":"polite","aria-label":"Conversation",children:[t.map(l=>f(Io,{message:l,thinkingViewable:n},l.id)),e&&!t.some(l=>l.status==="streaming")&&f(No,{}),f("div",{ref:r})]})}function Lo(){return f("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[f("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),f("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}function Ao(){return f("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),f("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),f("polyline",{points:"21 15 16 10 5 21"})]})}function Ro(){return f("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[f("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Eo({onSend:t,disabled:e=!1,placeholder:n="Type a message…",privacyPolicyUrl:r}){const[a,i]=st(""),[s,o]=st(null),[l,c]=st(null),u=ct(null),d=ct(null);ot(()=>()=>{l&&URL.revokeObjectURL(l)},[l]),ot(()=>{var y;e||(y=u.current)==null||y.focus()},[e]);function m(){o(null),l&&URL.revokeObjectURL(l),c(null),d.current&&(d.current.value="")}function h(){const y=a.trim();!y&&!s||e||(t(y,s??void 0),i(""),m(),u.current&&(u.current.style.height="auto"))}function x(y){y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),h())}function _(y){const C=y.currentTarget;i(C.value),C.style.height="auto",C.style.height=`${C.scrollHeight}px`}function I(y){var Z;const C=(Z=y.currentTarget.files)==null?void 0:Z[0];if(C){if(C.size>5242880){alert("Image must be smaller than 5 MB."),y.currentTarget.value="";return}l&&URL.revokeObjectURL(l),o(C),c(URL.createObjectURL(C))}}const v=!e&&(!!a.trim()||!!s);return f("div",{className:"ak-composer",children:[l&&f("div",{className:"ak-composer__preview",children:f("div",{className:"ak-composer__preview-wrap",children:[f("img",{src:l,alt:"Selected",className:"ak-composer__preview-img"}),f("button",{className:"ak-composer__preview-remove",onClick:m,type:"button","aria-label":"Remove image",disabled:e,children:f(Ro,{})})]})}),f("div",{className:"ak-composer__row",children:[f("input",{ref:d,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",className:"ak-composer__file-input",onChange:I,disabled:e,"aria-label":"Attach image"}),f("button",{className:"ak-composer__photo",onClick:()=>{var y;return(y=d.current)==null?void 0:y.click()},disabled:e,"aria-label":"Attach image",type:"button",children:f(Ao,{})}),f("textarea",{ref:u,className:"ak-composer__input",value:a,onInput:_,onKeyDown:x,placeholder:n,disabled:e,rows:1,"aria-label":"Message input"}),f("button",{className:"ak-composer__send",onClick:h,disabled:!v,"aria-label":"Send message",type:"button",children:f(Lo,{})})]}),r&&f("p",{className:"ak-composer__disclaimer",children:["By chatting with us, you agree to our"," ",f("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"})]})]})}function Cr({message:t}){return t.includes("Origin not allowed")?f("div",{className:"ak-error ak-error--origin",role:"alert",children:[f("div",{className:"ak-error__icon",children:"🔒"}),f("div",{className:"ak-error__content",children:[f("h3",{className:"ak-error__title",children:"Access Restricted"}),f("p",{className:"ak-error__description",children:"This widget has been restricted to specific websites only."}),f("p",{className:"ak-error__message",children:"Contact the website administrator if you believe this is an error."})]})]}):f("div",{className:"ak-error",role:"alert",children:[f("div",{className:"ak-error__icon",children:"⚠️"}),f("div",{className:"ak-error__content",children:f("p",{className:"ak-error__message",children:t})})]})}function Ir({config:t,messages:e,isLoading:n,error:r,isInline:a,initStatus:i,initError:s,callbacks:o}){return f("div",{className:a?"ak-shell ak-shell--inline":"ak-shell ak-shell--floating ak-shell-enter",role:"dialog","aria-label":t.title,children:[f(xo,{title:t.title,subtitle:t.subtitle,avatarUrl:t.avatarUrl,onClose:o.onClose,hideClose:a}),i==="validating"&&f("div",{className:"ak-init-status",children:f("div",{className:"ak-init-spinner","aria-label":"Connecting…"})}),i==="error"&&f("div",{className:"ak-init-status ak-init-status--error",children:f(Cr,{message:s??"Widget configuration is invalid."})}),i==="ready"&&f(X,{children:[f(To,{messages:e,isLoading:n,thinkingViewable:t.thinkingViewable}),r&&f(Cr,{message:r}),f(Eo,{onSend:o.onSendMessage,disabled:n,placeholder:"Type a message…",privacyPolicyUrl:t.privacyPolicyUrl})]})]})}function Mo(){return f("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:f("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function jo(){return f("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[f("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Oo({isOpen:t,onClick:e,avatarUrl:n,ariaLabel:r="Toggle chat"}){const a=!t&&!!n;return f("button",{className:`ak-launcher${a?" ak-launcher--avatar":""}`,onClick:e,"aria-label":r,"aria-expanded":t,type:"button",children:t?f(jo,{}):a?f("img",{src:n,alt:"",className:"ak-launcher__avatar-img","aria-hidden":"true"}):f(Mo,{})})}function Nr({config:t,state:e,callbacks:n}){const r=t.mode==="inline",a=ct(null);return ot(()=>{var l;const i=(l=a.current)==null?void 0:l.getRootNode(),s=i==null?void 0:i.host;if(!s)return;const o=vo(t.theme.mode);s.setAttribute("data-theme",o)},[t.theme.mode]),r?f("div",{ref:a,className:"ak-inline",children:f(Ir,{config:t,messages:e.messages,isLoading:e.isLoading,error:e.error,isInline:!0,initStatus:e.initStatus,initError:e.initError,callbacks:n})}):f("div",{ref:a,className:"ak-floating",children:[e.isOpen&&f(Ir,{config:t,messages:e.messages,isLoading:e.isLoading,error:e.error,isInline:!1,initStatus:e.initStatus,initError:e.initError,callbacks:n}),f(Oo,{isOpen:e.isOpen,onClick:e.isOpen?n.onClose:n.onOpen,avatarUrl:t.avatarUrl})]})}const Tr=(t,e,n,r)=>{const a=go(t);return a.render(We(Nr,{config:e,state:n,callbacks:r})),{update(i,s){a.render(We(Nr,{config:s,state:i,callbacks:r}))},destroy(){setTimeout(()=>{a.unmount()},0)}}};function Lr(t){return yo+`
802
- `+_o(t)}const Ar={init(t){const e=Ee(t),n=Lr(e);return Us(t,Tr,n)},mount(t,e){const n=Ee({...e,mode:"inline"}),r=Lr(n);return zs(t,e,Tr,r)},destroy(t){Ds(t)}};return window.AgentKit=Ar,re.AgentKit=Ar,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"}),re}({});
1107
+
1108
+ /* ── Powered by hanging tab ──────────────────────────────────── */
1109
+ .ak-branding {
1110
+ display: inline-flex;
1111
+ align-items: center;
1112
+ gap: 4px;
1113
+ padding: 4px 10px 5px;
1114
+ background: var(--ak-bg);
1115
+ border: 1px solid var(--ak-border);
1116
+ border-top: none;
1117
+ border-radius: 0 0 8px 8px;
1118
+ margin-left: 16px;
1119
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
1120
+ }
1121
+ .ak-branding__logo {
1122
+ width: 11px;
1123
+ height: 11px;
1124
+ flex-shrink: 0;
1125
+ color: var(--ak-accent);
1126
+ opacity: 0.75;
1127
+ }
1128
+ .ak-branding__label {
1129
+ font-size: 9px;
1130
+ color: var(--ak-text-muted);
1131
+ opacity: 0.75;
1132
+ }
1133
+ .ak-branding__name {
1134
+ font-size: 9px;
1135
+ font-weight: 600;
1136
+ color: var(--ak-accent);
1137
+ opacity: 0.75;
1138
+ letter-spacing: -0.01em;
1139
+ }
1140
+ `,Fc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$o=0,Wc=Array.isArray;function u(e,t,r,n,a,i){t||(t={});var s,o,l=t;if("ref"in l)for(o in l={},t)o=="ref"?s=t[o]:l[o]=t[o];var c={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--$o,__i:-1,__u:0,__source:a,__self:i};if(typeof e=="function"&&(s=e.defaultProps))for(o in s)l[o]===void 0&&(l[o]=s[o]);return N.vnode&&N.vnode(c),c}function Fo(){return u("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[u("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),u("circle",{cx:"12",cy:"5",r:"2"}),u("path",{d:"M12 7v4"}),u("line",{x1:"8",y1:"16",x2:"8",y2:"16"}),u("line",{x1:"16",y1:"16",x2:"16",y2:"16"})]})}function Wo(){return u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[u("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),u("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function zo(){return u("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[u("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),u("path",{d:"M3 3v5h5"})]})}function Do({title:e,subtitle:t,avatarUrl:r,onClose:n,onReset:a,hideClose:i=!1}){const[s,o]=Ne(!1);return u("div",{className:`ak-header${s?" ak-header--confirming":""}`,children:[u("div",{className:"ak-header__row",children:[r?u("img",{src:r,alt:"",className:"ak-header__avatar","aria-hidden":"true"}):u("span",{className:"ak-header__bot-icon","aria-hidden":"true",children:u(Fo,{})}),u("div",{className:"ak-header__title-group",children:[u("span",{className:"ak-header__title",children:e}),t&&u("span",{className:"ak-header__subtitle",children:t})]}),u("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[u("span",{className:"ak-header__status","aria-hidden":"true"}),a&&u("button",{className:`ak-header__button${s?" ak-header__button--active":""}`,onClick:()=>o(!0),"aria-label":"New conversation",type:"button",title:"Start a new conversation (Retains current conversation to memory)",children:u(zo,{})}),!i&&u("button",{className:"ak-header__close",onClick:n,"aria-label":"Close chat",type:"button",children:u(Wo,{})})]})]}),s&&u("div",{className:"ak-header__confirm",role:"alert",children:[u("div",{className:"ak-header__confirm-text",children:[u("span",{className:"ak-header__confirm-title",children:"End this conversation?"}),u("span",{className:"ak-header__confirm-sub",children:"All messages will be removed"})]}),u("div",{className:"ak-header__confirm-actions",children:[u("button",{className:"ak-header__confirm-cancel",type:"button",onClick:()=>o(!1),children:"Cancel"}),u("button",{className:"ak-header__confirm-ok",type:"button",onClick:()=>{a?.(),o(!1)},children:"End chat"})]})]})]})}function Uo({thinking:e,isThinking:t,thinkingViewable:r}){const[n,a]=Ne(!1);return!t&&!e?null:t?u("div",{className:"ak-thinking",children:u("div",{className:"ak-thinking__indicator",children:[u("span",{className:"ak-thinking__label",children:"Thinking"}),u("span",{className:"ak-cursor","aria-hidden":"true",children:[u("span",{className:"ak-cursor__dot"}),u("span",{className:"ak-cursor__dot"}),u("span",{className:"ak-cursor__dot"})]})]})}):!r||!e?null:u("div",{className:"ak-thinking ak-thinking--done",children:[u("button",{className:"ak-thinking__toggle",onClick:()=>a(i=>!i),"aria-expanded":n,type:"button",children:[u("svg",{className:`ak-thinking__chevron${n?" ak-thinking__chevron--open":""}`,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u("polyline",{points:"6 9 12 15 18 9"})}),u("span",{children:"Thought for a moment"})]}),n&&u("div",{className:"ak-thinking__content",children:e})]})}function Bo(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}var $n=/(`[^`\n]+`|\*\*[^*\n]+\*\*|\*[^*\n]+\*|!\[[^\]\n]*\]\([^)\n]+\)|\[[^\]\n]+\]\([^)\n]+\))/g;function q(e){const t=[];let r=0,n=0;$n.lastIndex=0;let a;for(;(a=$n.exec(e))!==null;){a.index>r&&t.push(e.slice(r,a.index));const i=a[0];if(i.startsWith("`"))t.push(u("code",{className:"ak-md-ic",children:i.slice(1,-1)},n++));else if(i.startsWith("**"))t.push(u("strong",{children:i.slice(2,-2)},n++));else if(i.startsWith("*"))t.push(u("em",{children:i.slice(1,-1)},n++));else if(i.startsWith("![")){const s=i.match(/!\[([^\]]*)\]\(([^)]+)\)/);s&&t.push(u("a",{href:s[2],target:"_blank",rel:"noopener noreferrer",children:s[1]||"image"},n++))}else{const s=i.match(/\[(.+?)\]\((.+?)\)/);s?t.push(u("a",{href:s[2],target:"_blank",rel:"noopener noreferrer",children:s[1]},n++)):t.push(i)}r=a.index+i.length}return r<e.length&&t.push(e.slice(r)),t}function Ho(e){e=e.replace(/\\text\{([^}]*)\}/g,"$1").replace(/\\implies/g,"→").replace(/\\Rightarrow/g,"⟹").replace(/\\times/g,"×").replace(/\\div/g,"÷").replace(/\\cdot/g,"·").replace(/\\quad/g," ").replace(/\\qquad/g," ").replace(/\\leq/g,"≤").replace(/\\geq/g,"≥").replace(/\\neq/g,"≠").replace(/\\approx/g,"≈").replace(/\\infty/g,"∞").replace(/\\\((.+?)\\\)/gs,"$1").replace(/\\\[[\s\S]+?\\\]/g,"").replace(/\\\$/g,"\0DOLLAR\0").replace(/\$\$[\s\S]+?\$\$/g,"").replace(/\$([^$]+)\$/g,"$1").replace(/\x00DOLLAR\x00/g,"$").replace(/\\[a-zA-Z]+\*?/g,"").replace(/\n{3,}/g,`
1141
+
1142
+ `);const t=e.split(`
1143
+ `),r=[];let n=0,a=0;for(;n<t.length;){const i=t[n],s=i.match(/^(\s*)```/);if(s){const c=s[1],f=i.trimStart().match(/^```(\w+)?\s*$/)?.[1]||"",d=[];for(n++;n<t.length&&!t[n].trimStart().startsWith("```");)d.push(t[n].startsWith(c)?t[n].slice(c.length):t[n]),n++;n<t.length&&t[n].trimStart().startsWith("```")&&n++,r.push(u("div",{className:"ak-md-pre-wrap",children:[f&&u("span",{className:"ak-md-pre-lang",children:f}),u("pre",{className:`ak-md-pre${f?` ak-md-pre--${f}`:""}`,children:u("code",{className:"ak-md-code",children:d.join(`
1144
+ `)})})]},a++));continue}const o=i.match(/^(#{1,6})(\s+.*)?$/);if(o){const c=o[1].length,f=o[2]?q(o[2].trim()):"";c===1?r.push(u("h1",{className:"ak-md-h1",children:f},a++)):c===2?r.push(u("h2",{className:"ak-md-h2",children:f},a++)):c===3?r.push(u("h3",{className:"ak-md-h3",children:f},a++)):c===4?r.push(u("h4",{className:"ak-md-h4",children:f},a++)):c===5?r.push(u("h5",{className:"ak-md-h5",children:f},a++)):r.push(u("h6",{className:"ak-md-h6",children:f},a++)),n++;continue}if(/^[-*_]{3,}$/.test(i.trim())){r.push(u("hr",{className:"ak-md-hr"},a++)),n++;continue}if(/^[-*+]\s/.test(i)){const c=[];let f=n;for(;f<t.length&&(/^[-*+]\s/.test(t[f])||t[f].trim()==="");){if(t[f].trim()===""){f++;continue}const d=t[f].length-t[f].trimStart().length,m=t[f].replace(/^[-*+]\s+/,""),h=[],k=[];let y=f+1;for(;y<t.length&&y<f+20;){const _=t[y];if(_.length-_.trimStart().length>d&&_.trim()!==""){const x=_.trim();/^[-*+]\s/.test(x)?h.push(u("li",{children:q(x.replace(/^[-*+]\s+/,""))},`nested-${y}`)):k.push(u("p",{style:{margin:"0.2em 0 0"},children:q(x)},`cont-${y}`)),y++}else break}const C=k.length>0||h.length>0?u(X,{children:[q(m),k,h.length>0&&u("ul",{style:{margin:"0.2em 0 0",paddingLeft:"1.2em"},children:h})]}):q(m);c.push(u("li",{children:C},`item-${f}`)),f=y}r.push(u("ul",{className:"ak-md-ul",children:c},a++)),n=f;continue}if(/^\d+\.\s/.test(i)){const c=[];let f=n;for(;f<t.length&&(/^\d+\.\s/.test(t[f])||t[f].trim()==="");){if(t[f].trim()===""){f++;continue}const d=t[f].length-t[f].trimStart().length,m=t[f].replace(/^\d+\.\s+/,""),h=[],k=[];let y=f+1;for(;y<t.length&&y<f+20;){const _=t[y];if(_.length-_.trimStart().length>d&&_.trim()!==""){const x=_.trim();/^\d+\.\s/.test(x)?h.push(u("li",{children:q(x.replace(/^\d+\.\s+/,""))},`nested-order-${y}`)):/^[-*+]\s/.test(x)?h.push(u("li",{children:q(x.replace(/^[-*+]\s+/,""))},`nested-unorder-${y}`)):k.push(u("p",{style:{margin:"0.2em 0 0"},children:q(x)},`cont-${y}`)),y++}else break}const C=k.length>0||h.length>0?u(X,{children:[q(m),k,h.length>0&&u("ol",{style:{margin:"0.2em 0 0",paddingLeft:"1.2em"},children:h})]}):q(m);c.push(u("li",{children:C},`order-item-${f}`)),f=y}r.push(u("ol",{className:"ak-md-ol",children:c},a++)),n=f;continue}if(i.trim()===""){n++;continue}const l=[];for(;n<t.length&&t[n].trim()!==""&&!t[n].startsWith("#")&&!/^\s*```/.test(t[n])&&!/^[-*+]\s/.test(t[n])&&!/^\d+\.\s/.test(t[n])&&!/^[-*_]{3,}$/.test(t[n].trim());)l.push(t[n]),n++;if(l.length>0){const c=[];l.forEach((f,d)=>{c.push(...q(f)),d<l.length-1&&c.push(u("br",{},`br-${d}`))}),r.push(u("p",{className:"ak-md-p",children:c},a++))}}return u(X,{children:r})}function Go({message:e,thinkingViewable:t=!1}){const r=e.role==="user",n=e.status==="error",a=e.status==="streaming",i=!!(e.images&&e.images.length>0),s=!!(r&&e.uploadedImageUrl),o=i||s,l=!r&&!n,c=r?"ak-message--user":n?"ak-message--assistant ak-message--error":"ak-message--assistant",f=u(X,{children:[u("div",{className:["ak-message__bubble",l?"ak-message__bubble--md":"",o?"ak-message__bubble--has-image":""].filter(Boolean).join(" "),children:[s&&u("div",{className:"ak-message__images",children:u("div",{className:"ak-message__image-wrap",children:[u("a",{href:e.uploadedImageUrl,className:"ak-message__image-link",children:u("img",{src:e.uploadedImageUrl,alt:"Uploaded image",className:"ak-message__image"})}),u("a",{href:e.uploadedImageUrl,download:!0,className:"ak-message__image-dl-icon",title:"Download image",onClick:m=>m.stopPropagation(),children:u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[u("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),u("polyline",{points:"7 10 12 15 17 10"}),u("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]})}),i&&u("div",{className:"ak-message__images",children:e.images.map((m,h)=>{const k=m.url??(m.base64?`data:${m.mimeType};base64,${m.base64}`:null);return k?u("div",{className:"ak-message__image-wrap",children:[u("a",{href:k,className:"ak-message__image-link",children:u("img",{src:k,alt:"Generated image",className:"ak-message__image"})}),u("a",{href:k,download:!0,className:"ak-message__image-dl-icon",title:"Download image",onClick:y=>y.stopPropagation(),children:u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[u("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),u("polyline",{points:"7 10 12 15 17 10"}),u("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]},`${e.id}-img-${h}`):null})}),(e.content||a&&!e.isThinking)&&u("div",{className:o?"ak-message__image-caption":void 0,children:[l?Ho(e.content):e.content,a&&!e.isThinking&&u("span",{className:"ak-cursor","aria-hidden":"true",children:[u("span",{className:"ak-cursor__dot"}),u("span",{className:"ak-cursor__dot"}),u("span",{className:"ak-cursor__dot"})]})]})]}),u("span",{className:"ak-message__time",children:Bo(e.createdAt)})]}),d=!e.isThinking||!!e.content;return u("div",{className:`ak-message ${c}`,children:[!r&&u(Uo,{thinking:e.thinking,isThinking:e.isThinking??!1,thinkingViewable:t}),d&&f]})}function Yo(){return u("div",{className:"ak-typing","aria-label":"Assistant is typing",children:[u("span",{className:"ak-typing__dot"}),u("span",{className:"ak-typing__dot"}),u("span",{className:"ak-typing__dot"})]})}function Xo({messages:e,isLoading:t,thinkingViewable:r}){const n=Le(null),a=e.find(s=>s.status==="streaming")?.content??"",i=e.find(s=>s.isThinking)?.thinking??"";return Te(()=>{n.current?.scrollIntoView({behavior:"smooth"})},[e.length,t,a,i]),u("div",{className:"ak-messages",role:"log","aria-live":"polite","aria-label":"Conversation",children:[e.map(s=>u(Go,{message:s,thinkingViewable:r},s.id)),t&&!e.some(s=>s.status==="streaming")&&u(Yo,{}),u("div",{ref:n})]})}function Jo(){return u("svg",{width:"30",height:"30",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),u("circle",{cx:"12",cy:"5",r:"2"}),u("path",{d:"M12 7v4"}),u("line",{x1:"8",y1:"16",x2:"8",y2:"16"}),u("line",{x1:"16",y1:"16",x2:"16",y2:"16"})]})}function Qo({title:e,description:t,greeting:r,avatarUrl:n}){return u("div",{className:"ak-empty-state","aria-label":"Start a conversation",children:[u("div",{className:"ak-empty-state__glow","aria-hidden":"true"}),u("div",{className:"ak-empty-state__body",children:[u("div",{className:"ak-empty-state__avatar",children:n?u("img",{src:n,alt:"",className:"ak-empty-state__avatar-img","aria-hidden":"true"}):u("span",{className:"ak-empty-state__bot-icon","aria-hidden":"true",children:u(Jo,{})})}),u("p",{className:"ak-empty-state__title",children:e}),t&&u("p",{className:"ak-empty-state__description",children:t})]}),r&&u("div",{className:"ak-empty-state__quote",children:[u("span",{className:"ak-empty-state__quote-mark","aria-hidden":"true",children:'"'}),u("p",{className:"ak-empty-state__quote-text",children:r})]})]})}function Ko(){return u("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[u("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),u("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}function qo(){return u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[u("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),u("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function ec(){return u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[u("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),u("circle",{cx:"12",cy:"13",r:"4"})]})}function tc(){return u("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[u("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),u("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function rc({onSend:e,disabled:t=!1,placeholder:r="Type a message…",privacyPolicyUrl:n,photoSendingEnabled:a=!1}){const[i,s]=Ne(""),[o,l]=Ne(null),[c,f]=Ne(null),[d,m]=Ne(!1),h=Le(null),k=Le(null),y=Le(null),C=Le(null);Te(()=>()=>{c&&URL.revokeObjectURL(c)},[c]),Te(()=>{t||h.current?.focus()},[t]);const _=bo(E=>{if(!d)return;const M=E.composedPath?E.composedPath():[],De=!!y.current&&M.includes(y.current),_t=!!C.current&&M.includes(C.current);!De&&!_t&&m(!1)},[d]);Te(()=>{if(d)return document.addEventListener("click",_),()=>document.removeEventListener("click",_)},[d,_]),Te(()=>{a||m(!1)},[a]);function x(){l(null),c&&URL.revokeObjectURL(c),f(null),k.current&&(k.current.value="")}function Z(){const E=i.trim();!E&&!o||t||(e(E,o??void 0),s(""),x(),h.current&&(h.current.style.height="auto"))}function V(E){E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),Z())}function z(E){const M=E.currentTarget;s(M.value),M.style.height="auto",M.style.height=`${M.scrollHeight}px`}function H(E){const M=E.currentTarget.files?.[0];if(M){if(M.size>5242880){alert("Image must be smaller than 5 MB."),E.currentTarget.value="";return}c&&URL.revokeObjectURL(c),l(M),f(URL.createObjectURL(M))}}function G(){m(!1),k.current?.click()}const L=!t&&(!!i.trim()||!!o);return u("div",{className:"ak-composer",children:[a&&d&&u("div",{ref:y,className:"ak-composer__attach-menu",role:"menu",children:u("button",{className:"ak-composer__attach-menu-item",onClick:G,type:"button",role:"menuitem",disabled:t,children:[u(ec,{}),u("span",{children:"Photo"})]})}),c&&u("div",{className:"ak-composer__preview",children:u("div",{className:"ak-composer__preview-wrap",children:[u("img",{src:c,alt:"Selected",className:"ak-composer__preview-img"}),u("button",{className:"ak-composer__preview-remove",onClick:x,type:"button","aria-label":"Remove image",disabled:t,children:u(tc,{})})]})}),u("div",{className:"ak-composer__input-wrap",children:[a&&u(X,{children:[u("input",{ref:k,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",className:"ak-composer__file-input",onChange:H,disabled:t,"aria-label":"Attach image"}),u("div",{className:"ak-composer__attach-wrap",children:u("button",{ref:C,className:`ak-composer__attach${d?" ak-composer__attach--open":""}`,onClick:()=>m(E=>!E),disabled:t,"aria-label":"Attachment options","aria-haspopup":"true","aria-expanded":d,type:"button",children:u(qo,{})})})]}),u("textarea",{ref:h,className:"ak-composer__input",value:i,onInput:z,onKeyDown:V,placeholder:r,disabled:t,rows:1,"aria-label":"Message input"}),u("button",{className:"ak-composer__send",onClick:Z,disabled:!L,"aria-label":"Send message",type:"button",children:u(Ko,{})})]}),u("p",{className:"ak-composer__disclaimer",children:["By chatting with us, you agree to our"," ",n?u("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"}):"Privacy Policy"]})]})}function Fn({message:e}){return e.includes("Origin not allowed")?u("div",{className:"ak-error ak-error--origin",role:"alert",children:[u("div",{className:"ak-error__icon",children:"🔒"}),u("div",{className:"ak-error__content",children:[u("h3",{className:"ak-error__title",children:"Access Restricted"}),u("p",{className:"ak-error__description",children:"This widget has been restricted to specific websites only. Contact the website administrator if you believe this is an error."})]})]}):u("div",{className:"ak-error",role:"alert",children:[u("div",{className:"ak-error__icon",children:"⚠️"}),u("div",{className:"ak-error__content",children:u("p",{className:"ak-error__message",children:e})})]})}function nc(){return u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:"ak-branding__logo",children:[u("rect",{width:"24",height:"24",rx:"5",fill:"currentColor"}),u("path",{d:"M12 5L7 13h3.5v6l6.5-9H13.5V5z",fill:"white"})]})}function ac(){return u("div",{className:"ak-branding",children:[u(nc,{}),u("span",{className:"ak-branding__label",children:"Powered by"}),u("span",{className:"ak-branding__name",children:"AgentForge"})]})}function Wn({config:e,messages:t,isLoading:r,error:n,isInline:a,initStatus:i,initError:s,callbacks:o}){return u("div",{className:a?"ak-shell-wrap":"ak-shell-wrap ak-shell-enter",children:[u("div",{className:a?"ak-shell ak-shell--inline":"ak-shell ak-shell--floating",role:"dialog","aria-label":e.title,children:[u(Do,{title:e.title,subtitle:e.subtitle,avatarUrl:e.avatarUrl,onClose:o.onClose,onReset:o.onReset,hideClose:!0}),i==="validating"&&u("div",{className:"ak-init-status",children:u("div",{className:"ak-init-spinner","aria-label":"Connecting…"})}),i==="error"&&u("div",{className:"ak-init-status ak-init-status--error",children:u(Fn,{message:s??"Widget configuration is invalid."})}),i==="ready"&&u(X,{children:[t.length===0?u(Qo,{title:e.title,description:e.description??e.subtitle,greeting:e.greeting,avatarUrl:e.avatarUrl}):u(Xo,{messages:t,isLoading:r,thinkingViewable:e.thinkingViewable}),n&&u(Fn,{message:n}),u(rc,{onSend:o.onSendMessage,disabled:r,placeholder:"Type a message…",privacyPolicyUrl:e.privacyPolicyUrl,photoSendingEnabled:e.photoSendingEnabled})]})]}),!a&&u(ac,{})]})}function ic(){return u("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:u("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function sc(){return u("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:u("polyline",{points:"6,9 12,15 18,9"})})}function oc({isOpen:e,onClick:t,avatarUrl:r,ariaLabel:n="Toggle chat"}){const a=!e&&!!r;return u("button",{className:`ak-launcher${a?" ak-launcher--avatar":""}`,onClick:t,"aria-label":n,"aria-expanded":e,type:"button",children:e?u(sc,{}):a?u("img",{src:r,alt:"",className:"ak-launcher__avatar-img","aria-hidden":"true"}):u(ic,{})})}function zn({config:e,state:t,callbacks:r}){const n=e.mode==="inline",a=Le(null);return Te(()=>{const i=a.current?.getRootNode()?.host;if(!i)return;const s=Po(e.theme.mode);i.setAttribute("data-theme",s)},[e.theme.mode]),n?u("div",{ref:a,className:"ak-inline",children:u(Wn,{config:e,messages:t.messages,isLoading:t.isLoading,error:t.error,isInline:!0,initStatus:t.initStatus,initError:t.initError,callbacks:r})}):u("div",{ref:a,className:"ak-floating",children:[t.isOpen&&u(Wn,{config:e,messages:t.messages,isLoading:t.isLoading,error:t.error,isInline:!1,initStatus:t.initStatus,initError:t.initError,callbacks:r}),u(oc,{isOpen:t.isOpen,onClick:t.isOpen?r.onClose:r.onOpen,avatarUrl:e.avatarUrl})]})}var Dn=(e,t,r,n)=>{const a=Mo(e);return a.render(Fe(zn,{config:t,state:r,callbacks:n})),{update(i,s){a.render(Fe(zn,{config:s,state:i,callbacks:n}))},destroy(){setTimeout(()=>{a.unmount()},0)}}};function Un(e){return Vo+`
1145
+ `+Oo(e)}var Bn={init(e){return co(e,Dn,Un(Ze(e)))},mount(e,t){return lo(e,t,Dn,Un(Ze({...t,mode:"inline"})))},destroy(e){uo(e)}};return window.AgentKit=Bn,kt.AgentKit=Bn,kt})({});