@iai-lib/any-chat-widget 0.1.0-alpha.55 → 0.1.0-alpha.57
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.
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2021 Google LLC
|
|
42
42
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
-
*/function uc(n,e,t){return n?e(n):t==null?void 0:t(n)}var pe;(function(n){n.assertEqual=i=>i;function e(i){}n.assertIs=e;function t(i){throw new Error}n.assertNever=t,n.arrayToEnum=i=>{const s={};for(const l of i)s[l]=l;return s},n.getValidEnumValues=i=>{const s=n.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),l={};for(const a of s)l[a]=i[a];return n.objectValues(l)},n.objectValues=i=>n.objectKeys(i).map(function(s){return i[s]}),n.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const l in i)Object.prototype.hasOwnProperty.call(i,l)&&s.push(l);return s},n.find=(i,s)=>{for(const l of i)if(s(l))return l},n.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(l=>typeof l=="string"?`'${l}'`:l).join(s)}n.joinValues=r,n.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(pe||(pe={}));var Us;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(Us||(Us={}));const M=pe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ft=n=>{switch(typeof n){case"undefined":return M.undefined;case"string":return M.string;case"number":return isNaN(n)?M.nan:M.number;case"boolean":return M.boolean;case"function":return M.function;case"bigint":return M.bigint;case"symbol":return M.symbol;case"object":return Array.isArray(n)?M.array:n===null?M.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?M.promise:typeof Map<"u"&&n instanceof Map?M.map:typeof Set<"u"&&n instanceof Set?M.set:typeof Date<"u"&&n instanceof Date?M.date:M.object;default:return M.unknown}},T=pe.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"]),cc=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class lt extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const l of s.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)r._errors.push(t(l));else{let a=r,o=0;for(;o<l.path.length;){const u=l.path[o];o===l.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(l))):a[u]=a[u]||{_errors:[]},a=a[u],o++}}};return i(this),r}static assert(e){if(!(e instanceof lt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,pe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}lt.create=n=>new lt(n);const Vn=(n,e)=>{let t;switch(n.code){case T.invalid_type:n.received===M.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case T.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,pe.jsonStringifyReplacer)}`;break;case T.unrecognized_keys:t=`Unrecognized key(s) in object: ${pe.joinValues(n.keys,", ")}`;break;case T.invalid_union:t="Invalid input";break;case T.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${pe.joinValues(n.options)}`;break;case T.invalid_enum_value:t=`Invalid enum value. Expected ${pe.joinValues(n.options)}, received '${n.received}'`;break;case T.invalid_arguments:t="Invalid function arguments";break;case T.invalid_return_type:t="Invalid function return type";break;case T.invalid_date:t="Invalid date";break;case T.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:pe.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case T.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case T.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case T.custom:t="Invalid input";break;case T.invalid_intersection_types:t="Intersection results could not be merged";break;case T.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case T.not_finite:t="Number must be finite";break;default:t=e.defaultError,pe.assertNever(n)}return{message:t}};let ca=Vn;function dc(n){ca=n}function ji(){return ca}const Li=n=>{const{data:e,path:t,errorMaps:r,issueData:i}=n,s=[...t,...i.path||[]],l={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const o=r.filter(u=>!!u).slice().reverse();for(const u of o)a=u(l,{data:e,defaultError:a}).message;return{...i,path:s,message:a}},hc=[];function E(n,e){const t=ji(),r=Li({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===Vn?void 0:Vn].filter(i=>!!i)});n.common.issues.push(r)}class Ge{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const i of t){if(i.status==="aborted")return K;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const i of t){const s=await i.key,l=await i.value;r.push({key:s,value:l})}return Ge.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const i of t){const{key:s,value:l}=i;if(s.status==="aborted"||l.status==="aborted")return K;s.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(r[s.value]=l.value)}return{status:e.value,value:r}}}const K=Object.freeze({status:"aborted"}),Bn=n=>({status:"dirty",value:n}),et=n=>({status:"valid",value:n}),Vs=n=>n.status==="aborted",Bs=n=>n.status==="dirty",xr=n=>n.status==="valid",kr=n=>typeof Promise<"u"&&n instanceof Promise;function Zi(n,e,t,r){if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(n)}function da(n,e,t,r,i){if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(n,t),t}typeof SuppressedError=="function"&&SuppressedError;var H;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(H||(H={}));var $r,Ar;class kt{constructor(e,t,r,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ha=(n,e)=>{if(xr(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new lt(n.common.issues);return this._error=t,this._error}}};function te(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:i}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(l,a)=>{var o,u;const{message:c}=n;return l.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:(o=c??r)!==null&&o!==void 0?o:a.defaultError}:l.code!=="invalid_type"?{message:a.defaultError}:{message:(u=c??t)!==null&&u!==void 0?u:a.defaultError}},description:i}}class ae{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Ft(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ft(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ge,ctx:{common:e.parent.common,data:e.data,parsedType:Ft(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(kr(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){var r;const i={common:{issues:[],async:(r=t==null?void 0:t.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ft(e)},s=this._parseSync({data:e,path:i.path,parent:i});return ha(i,s)}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==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ft(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(kr(i)?i:Promise.resolve(i));return ha(r,s)}refine(e,t){const r=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,s)=>{const l=e(i),a=()=>s.addIssue({code:T.custom,...r(i)});return typeof Promise<"u"&&l instanceof Promise?l.then(o=>o?!0:(a(),!1)):l?!0:(a(),!1)})}refinement(e,t){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof t=="function"?t(r,i):t),!1))}_refinement(e){return new pt({schema:this,typeName:W.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return At.create(this,this._def)}nullable(){return Yt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ht.create(this,this._def)}promise(){return Kn.create(this,this._def)}or(e){return Er.create([this,e],this._def)}and(e){return Mr.create(this,e,this._def)}transform(e){return new pt({...te(this._def),schema:this,typeName:W.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Rr({...te(this._def),innerType:this,defaultValue:t,typeName:W.ZodDefault})}brand(){return new qs({typeName:W.ZodBranded,type:this,...te(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Dr({...te(this._def),innerType:this,catchValue:t,typeName:W.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return jr.create(this,e)}readonly(){return Lr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const pc=/^c[^\s-]{8,}$/i,fc=/^[0-9a-z]+$/,mc=/^[0-9A-HJKMNP-TV-Z]{26}$/,gc=/^[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,yc=/^[a-z0-9_-]{21}$/i,vc=/^[-+]?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)?)??$/,bc=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,wc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Fs;const _c=/^(?:(?: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])$/,xc=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,kc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,pa="((\\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])))",$c=new RegExp(`^${pa}$`);function fa(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Ac(n){return new RegExp(`^${fa(n)}$`)}function ma(n){let e=`${pa}T${fa(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Sc(n,e){return!!((e==="v4"||!e)&&_c.test(n)||(e==="v6"||!e)&&xc.test(n))}class dt extends ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==M.string){const s=this._getOrReturnCtx(e);return E(s,{code:T.invalid_type,expected:M.string,received:s.parsedType}),K}const r=new Ge;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),E(i,{code:T.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),E(i,{code:T.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const l=e.data.length>s.value,a=e.data.length<s.value;(l||a)&&(i=this._getOrReturnCtx(e,i),l?E(i,{code:T.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&E(i,{code:T.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")bc.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"email",code:T.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Fs||(Fs=new RegExp(wc,"u")),Fs.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"emoji",code:T.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")gc.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"uuid",code:T.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")yc.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"nanoid",code:T.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")pc.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"cuid",code:T.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")fc.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"cuid2",code:T.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")mc.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"ulid",code:T.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),E(i,{validation:"url",code:T.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"regex",code:T.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),E(i,{code:T.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),E(i,{code:T.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),E(i,{code:T.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?ma(s).test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{code:T.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?$c.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{code:T.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?Ac(s).test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{code:T.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?vc.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"duration",code:T.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?Sc(e.data,s.version)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"ip",code:T.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?kc.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"base64",code:T.invalid_string,message:s.message}),r.dirty()):pe.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(i=>e.test(i),{validation:t,code:T.invalid_string,...H.errToObj(r)})}_addCheck(e){return new dt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...H.errToObj(e)})}url(e){return this._addCheck({kind:"url",...H.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...H.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...H.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...H.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...H.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...H.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...H.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...H.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...H.errToObj(e)})}datetime(e){var t,r;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:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...H.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,...H.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...H.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...H.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...H.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...H.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...H.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...H.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...H.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...H.errToObj(t)})}nonempty(e){return this.min(1,H.errToObj(e))}trim(){return new dt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new dt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new dt({...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 isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}dt.create=n=>{var e;return new dt({checks:[],typeName:W.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...te(n)})};function Tc(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=t>r?t:r,s=parseInt(n.toFixed(i).replace(".","")),l=parseInt(e.toFixed(i).replace(".",""));return s%l/Math.pow(10,i)}class Wt extends ae{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)!==M.number){const s=this._getOrReturnCtx(e);return E(s,{code:T.invalid_type,expected:M.number,received:s.parsedType}),K}let r;const i=new Ge;for(const s of this._def.checks)s.kind==="int"?pe.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{code:T.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),E(r,{code:T.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),E(r,{code:T.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Tc(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),E(r,{code:T.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{code:T.not_finite,message:s.message}),i.dirty()):pe.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,H.toString(t))}gt(e,t){return this.setLimit("min",e,!1,H.toString(t))}lte(e,t){return this.setLimit("max",e,!0,H.toString(t))}lt(e,t){return this.setLimit("max",e,!1,H.toString(t))}setLimit(e,t,r,i){return new Wt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:H.toString(i)}]})}_addCheck(e){return new Wt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:H.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:H.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:H.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:H.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:H.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&pe.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Wt.create=n=>new Wt({checks:[],typeName:W.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...te(n)});class qt extends ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==M.bigint){const s=this._getOrReturnCtx(e);return E(s,{code:T.invalid_type,expected:M.bigint,received:s.parsedType}),K}let r;const i=new Ge;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),E(r,{code:T.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),E(r,{code:T.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),E(r,{code:T.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):pe.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,H.toString(t))}gt(e,t){return this.setLimit("min",e,!1,H.toString(t))}lte(e,t){return this.setLimit("max",e,!0,H.toString(t))}lt(e,t){return this.setLimit("max",e,!1,H.toString(t))}setLimit(e,t,r,i){return new qt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:H.toString(i)}]})}_addCheck(e){return new qt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:H.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}qt.create=n=>{var e;return new qt({checks:[],typeName:W.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...te(n)})};class Sr extends ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==M.boolean){const r=this._getOrReturnCtx(e);return E(r,{code:T.invalid_type,expected:M.boolean,received:r.parsedType}),K}return et(e.data)}}Sr.create=n=>new Sr({typeName:W.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...te(n)});class fn extends ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==M.date){const s=this._getOrReturnCtx(e);return E(s,{code:T.invalid_type,expected:M.date,received:s.parsedType}),K}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return E(s,{code:T.invalid_date}),K}const r=new Ge;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),E(i,{code:T.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),E(i,{code:T.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):pe.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new fn({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:H.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:H.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}fn.create=n=>new fn({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:W.ZodDate,...te(n)});class zi extends ae{_parse(e){if(this._getType(e)!==M.symbol){const r=this._getOrReturnCtx(e);return E(r,{code:T.invalid_type,expected:M.symbol,received:r.parsedType}),K}return et(e.data)}}zi.create=n=>new zi({typeName:W.ZodSymbol,...te(n)});class Tr extends ae{_parse(e){if(this._getType(e)!==M.undefined){const r=this._getOrReturnCtx(e);return E(r,{code:T.invalid_type,expected:M.undefined,received:r.parsedType}),K}return et(e.data)}}Tr.create=n=>new Tr({typeName:W.ZodUndefined,...te(n)});class Cr extends ae{_parse(e){if(this._getType(e)!==M.null){const r=this._getOrReturnCtx(e);return E(r,{code:T.invalid_type,expected:M.null,received:r.parsedType}),K}return et(e.data)}}Cr.create=n=>new Cr({typeName:W.ZodNull,...te(n)});class Fn extends ae{constructor(){super(...arguments),this._any=!0}_parse(e){return et(e.data)}}Fn.create=n=>new Fn({typeName:W.ZodAny,...te(n)});class mn extends ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return et(e.data)}}mn.create=n=>new mn({typeName:W.ZodUnknown,...te(n)});class Ot extends ae{_parse(e){const t=this._getOrReturnCtx(e);return E(t,{code:T.invalid_type,expected:M.never,received:t.parsedType}),K}}Ot.create=n=>new Ot({typeName:W.ZodNever,...te(n)});class Hi extends ae{_parse(e){if(this._getType(e)!==M.undefined){const r=this._getOrReturnCtx(e);return E(r,{code:T.invalid_type,expected:M.void,received:r.parsedType}),K}return et(e.data)}}Hi.create=n=>new Hi({typeName:W.ZodVoid,...te(n)});class ht extends ae{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),i=this._def;if(t.parsedType!==M.array)return E(t,{code:T.invalid_type,expected:M.array,received:t.parsedType}),K;if(i.exactLength!==null){const l=t.data.length>i.exactLength.value,a=t.data.length<i.exactLength.value;(l||a)&&(E(t,{code:l?T.too_big:T.too_small,minimum:a?i.exactLength.value:void 0,maximum:l?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(E(t,{code:T.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(E(t,{code:T.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((l,a)=>i.type._parseAsync(new kt(t,l,t.path,a)))).then(l=>Ge.mergeArray(r,l));const s=[...t.data].map((l,a)=>i.type._parseSync(new kt(t,l,t.path,a)));return Ge.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new ht({...this._def,minLength:{value:e,message:H.toString(t)}})}max(e,t){return new ht({...this._def,maxLength:{value:e,message:H.toString(t)}})}length(e,t){return new ht({...this._def,exactLength:{value:e,message:H.toString(t)}})}nonempty(e){return this.min(1,e)}}ht.create=(n,e)=>new ht({type:n,minLength:null,maxLength:null,exactLength:null,typeName:W.ZodArray,...te(e)});function Wn(n){if(n instanceof Ne){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=At.create(Wn(r))}return new Ne({...n._def,shape:()=>e})}else return n instanceof ht?new ht({...n._def,type:Wn(n.element)}):n instanceof At?At.create(Wn(n.unwrap())):n instanceof Yt?Yt.create(Wn(n.unwrap())):n instanceof $t?$t.create(n.items.map(e=>Wn(e))):n}class Ne extends ae{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(),t=pe.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==M.object){const u=this._getOrReturnCtx(e);return E(u,{code:T.invalid_type,expected:M.object,received:u.parsedType}),K}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),a=[];if(!(this._def.catchall instanceof Ot&&this._def.unknownKeys==="strip"))for(const u in i.data)l.includes(u)||a.push(u);const o=[];for(const u of l){const c=s[u],p=i.data[u];o.push({key:{status:"valid",value:u},value:c._parse(new kt(i,p,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Ot){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of a)o.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")a.length>0&&(E(i,{code:T.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of a){const p=i.data[c];o.push({key:{status:"valid",value:c},value:u._parse(new kt(i,p,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of o){const p=await c.key,d=await c.value;u.push({key:p,value:d,alwaysSet:c.alwaysSet})}return u}).then(u=>Ge.mergeObjectSync(r,u)):Ge.mergeObjectSync(r,o)}get shape(){return this._def.shape()}strict(e){return H.errToObj,new Ne({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var i,s,l,a;const o=(l=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,t,r).message)!==null&&l!==void 0?l:r.defaultError;return t.code==="unrecognized_keys"?{message:(a=H.errToObj(e).message)!==null&&a!==void 0?a:o}:{message:o}}}:{}})}strip(){return new Ne({...this._def,unknownKeys:"strip"})}passthrough(){return new Ne({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ne({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ne({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:W.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ne({...this._def,catchall:e})}pick(e){const t={};return pe.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new Ne({...this._def,shape:()=>t})}omit(e){const t={};return pe.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new Ne({...this._def,shape:()=>t})}deepPartial(){return Wn(this)}partial(e){const t={};return pe.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?t[r]=i:t[r]=i.optional()}),new Ne({...this._def,shape:()=>t})}required(e){const t={};return pe.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof At;)s=s._def.innerType;t[r]=s}}),new Ne({...this._def,shape:()=>t})}keyof(){return ga(pe.objectKeys(this.shape))}}Ne.create=(n,e)=>new Ne({shape:()=>n,unknownKeys:"strip",catchall:Ot.create(),typeName:W.ZodObject,...te(e)}),Ne.strictCreate=(n,e)=>new Ne({shape:()=>n,unknownKeys:"strict",catchall:Ot.create(),typeName:W.ZodObject,...te(e)}),Ne.lazycreate=(n,e)=>new Ne({shape:n,unknownKeys:"strip",catchall:Ot.create(),typeName:W.ZodObject,...te(e)});class Er extends ae{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const l=s.map(a=>new lt(a.ctx.common.issues));return E(t,{code:T.invalid_union,unionErrors:l}),K}if(t.common.async)return Promise.all(r.map(async s=>{const l={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(i);{let s;const l=[];for(const o of r){const u={...t,common:{...t.common,issues:[]},parent:null},c=o._parseSync({data:t.data,path:t.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:u}),u.common.issues.length&&l.push(u.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const a=l.map(o=>new lt(o));return E(t,{code:T.invalid_union,unionErrors:a}),K}}get options(){return this._def.options}}Er.create=(n,e)=>new Er({options:n,typeName:W.ZodUnion,...te(e)});const Nt=n=>n instanceof Or?Nt(n.schema):n instanceof pt?Nt(n.innerType()):n instanceof Nr?[n.value]:n instanceof Kt?n.options:n instanceof Pr?pe.objectValues(n.enum):n instanceof Rr?Nt(n._def.innerType):n instanceof Tr?[void 0]:n instanceof Cr?[null]:n instanceof At?[void 0,...Nt(n.unwrap())]:n instanceof Yt?[null,...Nt(n.unwrap())]:n instanceof qs||n instanceof Lr?Nt(n.unwrap()):n instanceof Dr?Nt(n._def.innerType):[];class Ui extends ae{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==M.object)return E(t,{code:T.invalid_type,expected:M.object,received:t.parsedType}),K;const r=this.discriminator,i=t.data[r],s=this.optionsMap.get(i);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(E(t,{code:T.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),K)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const i=new Map;for(const s of t){const l=Nt(s.shape[e]);if(!l.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of l){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new Ui({typeName:W.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...te(r)})}}function Ws(n,e){const t=Ft(n),r=Ft(e);if(n===e)return{valid:!0,data:n};if(t===M.object&&r===M.object){const i=pe.objectKeys(e),s=pe.objectKeys(n).filter(a=>i.indexOf(a)!==-1),l={...n,...e};for(const a of s){const o=Ws(n[a],e[a]);if(!o.valid)return{valid:!1};l[a]=o.data}return{valid:!0,data:l}}else if(t===M.array&&r===M.array){if(n.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<n.length;s++){const l=n[s],a=e[s],o=Ws(l,a);if(!o.valid)return{valid:!1};i.push(o.data)}return{valid:!0,data:i}}else return t===M.date&&r===M.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class Mr extends ae{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),i=(s,l)=>{if(Vs(s)||Vs(l))return K;const a=Ws(s.value,l.value);return a.valid?((Bs(s)||Bs(l))&&t.dirty(),{status:t.value,value:a.data}):(E(r,{code:T.invalid_intersection_types}),K)};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(([s,l])=>i(s,l)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Mr.create=(n,e,t)=>new Mr({left:n,right:e,typeName:W.ZodIntersection,...te(t)});class $t extends ae{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.array)return E(r,{code:T.invalid_type,expected:M.array,received:r.parsedType}),K;if(r.data.length<this._def.items.length)return E(r,{code:T.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),K;!this._def.rest&&r.data.length>this._def.items.length&&(E(r,{code:T.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...r.data].map((l,a)=>{const o=this._def.items[a]||this._def.rest;return o?o._parse(new kt(r,l,r.path,a)):null}).filter(l=>!!l);return r.common.async?Promise.all(s).then(l=>Ge.mergeArray(t,l)):Ge.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new $t({...this._def,rest:e})}}$t.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $t({items:n,typeName:W.ZodTuple,rest:null,...te(e)})};class Ir extends ae{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!==M.object)return E(r,{code:T.invalid_type,expected:M.object,received:r.parsedType}),K;const i=[],s=this._def.keyType,l=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new kt(r,a,r.path,a)),value:l._parse(new kt(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Ge.mergeObjectAsync(t,i):Ge.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof ae?new Ir({keyType:e,valueType:t,typeName:W.ZodRecord,...te(r)}):new Ir({keyType:dt.create(),valueType:e,typeName:W.ZodRecord,...te(t)})}}class Vi extends ae{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!==M.map)return E(r,{code:T.invalid_type,expected:M.map,received:r.parsedType}),K;const i=this._def.keyType,s=this._def.valueType,l=[...r.data.entries()].map(([a,o],u)=>({key:i._parse(new kt(r,a,r.path,[u,"key"])),value:s._parse(new kt(r,o,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const o of l){const u=await o.key,c=await o.value;if(u.status==="aborted"||c.status==="aborted")return K;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const o of l){const u=o.key,c=o.value;if(u.status==="aborted"||c.status==="aborted")return K;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}}}}Vi.create=(n,e,t)=>new Vi({valueType:e,keyType:n,typeName:W.ZodMap,...te(t)});class gn extends ae{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.set)return E(r,{code:T.invalid_type,expected:M.set,received:r.parsedType}),K;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(E(r,{code:T.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(E(r,{code:T.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const s=this._def.valueType;function l(o){const u=new Set;for(const c of o){if(c.status==="aborted")return K;c.status==="dirty"&&t.dirty(),u.add(c.value)}return{status:t.value,value:u}}const a=[...r.data.values()].map((o,u)=>s._parse(new kt(r,o,r.path,u)));return r.common.async?Promise.all(a).then(o=>l(o)):l(a)}min(e,t){return new gn({...this._def,minSize:{value:e,message:H.toString(t)}})}max(e,t){return new gn({...this._def,maxSize:{value:e,message:H.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}gn.create=(n,e)=>new gn({valueType:n,minSize:null,maxSize:null,typeName:W.ZodSet,...te(e)});class qn extends ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==M.function)return E(t,{code:T.invalid_type,expected:M.function,received:t.parsedType}),K;function r(a,o){return Li({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ji(),Vn].filter(u=>!!u),issueData:{code:T.invalid_arguments,argumentsError:o}})}function i(a,o){return Li({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ji(),Vn].filter(u=>!!u),issueData:{code:T.invalid_return_type,returnTypeError:o}})}const s={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof Kn){const a=this;return et(async function(...o){const u=new lt([]),c=await a._def.args.parseAsync(o,s).catch(g=>{throw u.addIssue(r(o,g)),u}),p=await Reflect.apply(l,this,c);return await a._def.returns._def.type.parseAsync(p,s).catch(g=>{throw u.addIssue(i(p,g)),u})})}else{const a=this;return et(function(...o){const u=a._def.args.safeParse(o,s);if(!u.success)throw new lt([r(o,u.error)]);const c=Reflect.apply(l,this,u.data),p=a._def.returns.safeParse(c,s);if(!p.success)throw new lt([i(c,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new qn({...this._def,args:$t.create(e).rest(mn.create())})}returns(e){return new qn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new qn({args:e||$t.create([]).rest(mn.create()),returns:t||mn.create(),typeName:W.ZodFunction,...te(r)})}}class Or extends ae{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})}}Or.create=(n,e)=>new Or({getter:n,typeName:W.ZodLazy,...te(e)});class Nr extends ae{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return E(t,{received:t.data,code:T.invalid_literal,expected:this._def.value}),K}return{status:"valid",value:e.data}}get value(){return this._def.value}}Nr.create=(n,e)=>new Nr({value:n,typeName:W.ZodLiteral,...te(e)});function ga(n,e){return new Kt({values:n,typeName:W.ZodEnum,...te(e)})}class Kt extends ae{constructor(){super(...arguments),$r.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return E(t,{expected:pe.joinValues(r),received:t.parsedType,code:T.invalid_type}),K}if(Zi(this,$r)||da(this,$r,new Set(this._def.values)),!Zi(this,$r).has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return E(t,{received:t.data,code:T.invalid_enum_value,options:r}),K}return et(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Kt.create(e,{...this._def,...t})}exclude(e,t=this._def){return Kt.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}$r=new WeakMap,Kt.create=ga;class Pr extends ae{constructor(){super(...arguments),Ar.set(this,void 0)}_parse(e){const t=pe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==M.string&&r.parsedType!==M.number){const i=pe.objectValues(t);return E(r,{expected:pe.joinValues(i),received:r.parsedType,code:T.invalid_type}),K}if(Zi(this,Ar)||da(this,Ar,new Set(pe.getValidEnumValues(this._def.values))),!Zi(this,Ar).has(e.data)){const i=pe.objectValues(t);return E(r,{received:r.data,code:T.invalid_enum_value,options:i}),K}return et(e.data)}get enum(){return this._def.values}}Ar=new WeakMap,Pr.create=(n,e)=>new Pr({values:n,typeName:W.ZodNativeEnum,...te(e)});class Kn extends ae{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==M.promise&&t.common.async===!1)return E(t,{code:T.invalid_type,expected:M.promise,received:t.parsedType}),K;const r=t.parsedType===M.promise?t.data:Promise.resolve(t.data);return et(r.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Kn.create=(n,e)=>new Kn({type:n,typeName:W.ZodPromise,...te(e)});class pt extends ae{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:t,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:l=>{E(r,l),l.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const l=i.transform(r.data,s);if(r.common.async)return Promise.resolve(l).then(async a=>{if(t.value==="aborted")return K;const o=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return o.status==="aborted"?K:o.status==="dirty"||t.value==="dirty"?Bn(o.value):o});{if(t.value==="aborted")return K;const a=this._def.schema._parseSync({data:l,path:r.path,parent:r});return a.status==="aborted"?K:a.status==="dirty"||t.value==="dirty"?Bn(a.value):a}}if(i.type==="refinement"){const l=a=>{const o=i.refinement(a,s);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 a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?K:(a.status==="dirty"&&t.dirty(),l(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?K:(a.status==="dirty"&&t.dirty(),l(a.value).then(()=>({status:t.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!xr(l))return l;const a=i.transform(l.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>xr(l)?Promise.resolve(i.transform(l.value,s)).then(a=>({status:t.value,value:a})):l);pe.assertNever(i)}}pt.create=(n,e,t)=>new pt({schema:n,typeName:W.ZodEffects,effect:e,...te(t)}),pt.createWithPreprocess=(n,e,t)=>new pt({schema:e,effect:{type:"preprocess",transform:n},typeName:W.ZodEffects,...te(t)});class At extends ae{_parse(e){return this._getType(e)===M.undefined?et(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}At.create=(n,e)=>new At({innerType:n,typeName:W.ZodOptional,...te(e)});class Yt extends ae{_parse(e){return this._getType(e)===M.null?et(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Yt.create=(n,e)=>new Yt({innerType:n,typeName:W.ZodNullable,...te(e)});class Rr extends ae{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===M.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Rr.create=(n,e)=>new Rr({innerType:n,typeName:W.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...te(e)});class Dr extends ae{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return kr(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new lt(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new lt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Dr.create=(n,e)=>new Dr({innerType:n,typeName:W.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...te(e)});class Bi extends ae{_parse(e){if(this._getType(e)!==M.nan){const r=this._getOrReturnCtx(e);return E(r,{code:T.invalid_type,expected:M.nan,received:r.parsedType}),K}return{status:"valid",value:e.data}}}Bi.create=n=>new Bi({typeName:W.ZodNaN,...te(n)});const Cc=Symbol("zod_brand");class qs extends ae{_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}}class jr extends ae{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?K:s.status==="dirty"?(t.dirty(),Bn(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?K:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,t){return new jr({in:e,out:t,typeName:W.ZodPipeline})}}class Lr extends ae{_parse(e){const t=this._def.innerType._parse(e),r=i=>(xr(i)&&(i.value=Object.freeze(i.value)),i);return kr(t)?t.then(i=>r(i)):r(t)}unwrap(){return this._def.innerType}}Lr.create=(n,e)=>new Lr({innerType:n,typeName:W.ZodReadonly,...te(e)});function ya(n,e={},t){return n?Fn.create().superRefine((r,i)=>{var s,l;if(!n(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,o=(l=(s=a.fatal)!==null&&s!==void 0?s:t)!==null&&l!==void 0?l:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:o})}}):Fn.create()}const Ec={object:Ne.lazycreate};var W;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(W||(W={}));const Mc=(n,e={message:`Input not instance of ${n.name}`})=>ya(t=>t instanceof n,e),va=dt.create,ba=Wt.create,Ic=Bi.create,Oc=qt.create,wa=Sr.create,Nc=fn.create,Pc=zi.create,Rc=Tr.create,Dc=Cr.create,jc=Fn.create,Lc=mn.create,Zc=Ot.create,zc=Hi.create,Hc=ht.create,Uc=Ne.create,Vc=Ne.strictCreate,Bc=Er.create,Fc=Ui.create,Wc=Mr.create,qc=$t.create,Kc=Ir.create,Yc=Vi.create,Gc=gn.create,Jc=qn.create,Qc=Or.create,Xc=Nr.create,ed=Kt.create,td=Pr.create,nd=Kn.create,_a=pt.create,rd=At.create,id=Yt.create,sd=pt.createWithPreprocess,ld=jr.create;var Zr=Object.freeze({__proto__:null,defaultErrorMap:Vn,setErrorMap:dc,getErrorMap:ji,makeIssue:Li,EMPTY_PATH:hc,addIssueToContext:E,ParseStatus:Ge,INVALID:K,DIRTY:Bn,OK:et,isAborted:Vs,isDirty:Bs,isValid:xr,isAsync:kr,get util(){return pe},get objectUtil(){return Us},ZodParsedType:M,getParsedType:Ft,ZodType:ae,datetimeRegex:ma,ZodString:dt,ZodNumber:Wt,ZodBigInt:qt,ZodBoolean:Sr,ZodDate:fn,ZodSymbol:zi,ZodUndefined:Tr,ZodNull:Cr,ZodAny:Fn,ZodUnknown:mn,ZodNever:Ot,ZodVoid:Hi,ZodArray:ht,ZodObject:Ne,ZodUnion:Er,ZodDiscriminatedUnion:Ui,ZodIntersection:Mr,ZodTuple:$t,ZodRecord:Ir,ZodMap:Vi,ZodSet:gn,ZodFunction:qn,ZodLazy:Or,ZodLiteral:Nr,ZodEnum:Kt,ZodNativeEnum:Pr,ZodPromise:Kn,ZodEffects:pt,ZodTransformer:pt,ZodOptional:At,ZodNullable:Yt,ZodDefault:Rr,ZodCatch:Dr,ZodNaN:Bi,BRAND:Cc,ZodBranded:qs,ZodPipeline:jr,ZodReadonly:Lr,custom:ya,Schema:ae,ZodSchema:ae,late:Ec,get ZodFirstPartyTypeKind(){return W},coerce:{string:n=>dt.create({...n,coerce:!0}),number:n=>Wt.create({...n,coerce:!0}),boolean:n=>Sr.create({...n,coerce:!0}),bigint:n=>qt.create({...n,coerce:!0}),date:n=>fn.create({...n,coerce:!0})},any:jc,array:Hc,bigint:Oc,boolean:wa,date:Nc,discriminatedUnion:Fc,effect:_a,enum:ed,function:Jc,instanceof:Mc,intersection:Wc,lazy:Qc,literal:Xc,map:Yc,nan:Ic,nativeEnum:td,never:Zc,null:Dc,nullable:id,number:ba,object:Uc,oboolean:()=>wa().optional(),onumber:()=>ba().optional(),optional:rd,ostring:()=>va().optional(),pipeline:ld,preprocess:sd,promise:nd,record:Kc,set:Gc,strictObject:Vc,string:va,symbol:Pc,transformer:_a,tuple:qc,undefined:Rc,union:Bc,unknown:Lc,void:zc,NEVER:K,ZodIssueCode:T,quotelessJson:cc,ZodError:lt});const xa=Zu`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: \"\"}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.static{position:static}.relative{position:relative}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-4{margin-bottom:1rem}.mt-4{margin-top:1rem}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rounded{border-radius:.25rem}.border{border-width:1px}.border-red-400{--tw-border-opacity: 1;border-color:rgb(248 113 113 / var(--tw-border-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.px-4{padding-left:1rem;padding-right:1rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity))}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}input{width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.25rem;border-width:1px;padding:.5rem .75rem;line-height:1.25;--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity));--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}label{margin-bottom:.5rem;display:block;font-size:.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.btn-primary{border-radius:.25rem;padding:.5rem 1rem;font-weight:700;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-primary:hover{opacity:.95}.btn-primary:disabled{pointer-events:none;opacity:.5}.btn-primary{background-color:var(--iai-chat-i-button-bg);color:var(--iai-chat-i-button-fg)}.btn-secondary{padding:.5rem 1rem;font-weight:700;--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.btn-secondary:hover{opacity:.95}.btn-secondary:disabled{pointer-events:none;opacity:.5}`;var Fi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ad(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}(function(){function n(h,f){var m=h.split("."),S=Ke;m[0]in S||!S.execScript||S.execScript("var "+m[0]);for(var z;m.length&&(z=m.shift());)m.length||f===void 0?S=S[z]?S[z]:S[z]={}:S[z]=f}function e(h,f){function m(){}m.prototype=f.prototype,h.M=f.prototype,h.prototype=new m,h.prototype.constructor=h,h.N=function(S,z,B){for(var be=Array(arguments.length-2),je=2;je<arguments.length;je++)be[je-2]=arguments[je];return f.prototype[z].apply(S,be)}}function t(h,f){h!=null&&this.a.apply(this,arguments)}function r(h){h.b=""}function i(h,f){h.sort(f||s)}function s(h,f){return h>f?1:h<f?-1:0}function l(h){var f,m=[],S=0;for(f in h)m[S++]=h[f];return m}function a(h,f){this.b=h,this.a={};for(var m=0;m<f.length;m++){var S=f[m];this.a[S.b]=S}}function o(h){return h=l(h.a),i(h,function(f,m){return f.b-m.b}),h}function u(h,f){switch(this.b=h,this.g=!!f.v,this.a=f.c,this.i=f.type,this.h=!1,this.a){case ze:case fe:case De:case Xe:case ot:case nt:case He:this.h=!0}this.f=f.defaultValue}function c(){this.a={},this.f=this.j().a,this.b=this.g=null}function p(h,f){for(var m=o(h.j()),S=0;S<m.length;S++){var z=m[S],B=z.b;if(f.a[B]!=null){h.b&&delete h.b[z.b];var be=z.a==11||z.a==10;if(z.g)for(var z=d(f,B)||[],je=0;je<z.length;je++){var We=h,_t=B,Mi=be?z[je].clone():z[je];We.a[_t]||(We.a[_t]=[]),We.a[_t].push(Mi),We.b&&delete We.b[_t]}else z=d(f,B),be?(be=d(h,B))?p(be,z):Z(h,B,z.clone()):Z(h,B,z)}}}function d(h,f){var m=h.a[f];if(m==null)return null;if(h.g){if(!(f in h.b)){var S=h.g,z=h.f[f];if(m!=null)if(z.g){for(var B=[],be=0;be<m.length;be++)B[be]=S.b(z,m[be]);m=B}else m=S.b(z,m);return h.b[f]=m}return h.b[f]}return m}function g(h,f,m){var S=d(h,f);return h.f[f].g?S[m||0]:S}function x(h,f){var m;if(h.a[f]!=null)m=g(h,f,void 0);else e:{if(m=h.f[f],m.f===void 0){var S=m.i;if(S===Boolean)m.f=!1;else if(S===Number)m.f=0;else{if(S!==String){m=new S;break e}m.f=m.h?"0":""}}m=m.f}return m}function j(h,f){return h.f[f].g?h.a[f]!=null?h.a[f].length:0:h.a[f]!=null?1:0}function Z(h,f,m){h.a[f]=m,h.b&&(h.b[f]=m)}function de(h,f){var m,S=[];for(m in f)m!=0&&S.push(new u(m,f[m]));return new a(h,S)}function ve(){c.call(this)}function le(){c.call(this)}function Ie(){c.call(this)}function Ae(){}function U(){}function qe(){}function xe(){this.a={}}function Ze(h){return h.length==0||bt.test(h)}function G(h,f){if(f==null)return null;f=f.toUpperCase();var m=h.a[f];if(m==null){if(m=ye[f],m==null)return null;m=new qe().a(Ie.j(),m),h.a[f]=m}return m}function P(h){return h=he[h],h==null?"ZZ":h[0]}function X(h){this.H=RegExp(" "),this.C="",this.m=new t,this.w="",this.i=new t,this.u=new t,this.l=!0,this.A=this.o=this.F=!1,this.G=xe.b(),this.s=0,this.b=new t,this.B=!1,this.h="",this.a=new t,this.f=[],this.D=h,this.J=this.g=Qe(this,this.D)}function Qe(h,f){var m;if(f!=null&&isNaN(f)&&f.toUpperCase()in ye){if(m=G(h.G,f),m==null)throw Error("Invalid region code: "+f);m=x(m,10)}else m=0;return m=G(h.G,P(m)),m??wt}function $(h){for(var f=h.f.length,m=0;m<f;++m){var S=h.f[m],z=x(S,1);if(h.w==z)return!1;var B;B=h;var be=S,je=x(be,1);if(je.indexOf("|")!=-1)B=!1;else{je=je.replace(Ci,"\\d"),je=je.replace(pr,"\\d"),r(B.m);var We;We=B;var be=x(be,2),_t="999999999999999".match(je)[0];_t.length<We.a.b.length?We="":(We=_t.replace(new RegExp(je,"g"),be),We=We.replace(RegExp("9","g")," ")),0<We.length?(B.m.a(We),B=!0):B=!1}if(B)return h.w=z,h.B=fr.test(g(S,4)),h.s=0,!0}return h.l=!1}function b(h,f){for(var m=[],S=f.length-3,z=h.f.length,B=0;B<z;++B){var be=h.f[B];j(be,3)==0?m.push(h.f[B]):(be=g(be,3,Math.min(S,j(be,3)-1)),f.search(be)==0&&m.push(h.f[B]))}h.f=m}function y(h,f){h.i.a(f);var m=f;if(vt.test(m)||h.i.b.length==1&&Ht.test(m)){var S,m=f;m=="+"?(S=m,h.u.a(m)):(S=ct[m],h.u.a(S),h.a.a(S)),f=S}else h.l=!1,h.F=!0;if(!h.l){if(!h.F){if(ee(h)){if(ue(h))return _(h)}else if(0<h.h.length&&(m=h.a.toString(),r(h.a),h.a.a(h.h),h.a.a(m),m=h.b.toString(),S=m.lastIndexOf(h.h),r(h.b),h.b.a(m.substring(0,S))),h.h!=Y(h))return h.b.a(" "),_(h)}return h.i.toString()}switch(h.u.b.length){case 0:case 1:case 2:return h.i.toString();case 3:if(!ee(h))return h.h=Y(h),k(h);h.A=!0;default:return h.A?(ue(h)&&(h.A=!1),h.b.toString()+h.a.toString()):0<h.f.length?(m=ge(h,f),S=v(h),0<S.length?S:(b(h,h.a.toString()),$(h)?N(h):h.l?A(h,m):h.i.toString())):k(h)}}function _(h){return h.l=!0,h.A=!1,h.f=[],h.s=0,r(h.m),h.w="",k(h)}function v(h){for(var f=h.a.toString(),m=h.f.length,S=0;S<m;++S){var z=h.f[S],B=x(z,1);if(new RegExp("^(?:"+B+")$").test(f))return h.B=fr.test(g(z,4)),f=f.replace(new RegExp(B,"g"),g(z,2)),A(h,f)}return""}function A(h,f){var m=h.b.b.length;return h.B&&0<m&&h.b.toString().charAt(m-1)!=" "?h.b+" "+f:h.b+f}function k(h){var f=h.a.toString();if(3<=f.length){for(var m=h.o&&h.h.length==0&&0<j(h.g,20)?d(h.g,20)||[]:d(h.g,19)||[],S=m.length,z=0;z<S;++z){var B=m[z];0<h.h.length&&Ze(x(B,4))&&!g(B,6)&&B.a[5]==null||(h.h.length!=0||h.o||Ze(x(B,4))||g(B,6))&&Ei.test(x(B,2))&&h.f.push(B)}return b(h,f),f=v(h),0<f.length?f:$(h)?N(h):h.i.toString()}return A(h,f)}function N(h){var f=h.a.toString(),m=f.length;if(0<m){for(var S="",z=0;z<m;z++)S=ge(h,f.charAt(z));return h.l?A(h,S):h.i.toString()}return h.b.toString()}function Y(h){var f,m=h.a.toString(),S=0;return g(h.g,10)!=1?f=!1:(f=h.a.toString(),f=f.charAt(0)=="1"&&f.charAt(1)!="0"&&f.charAt(1)!="1"),f?(S=1,h.b.a("1").a(" "),h.o=!0):h.g.a[15]!=null&&(f=new RegExp("^(?:"+g(h.g,15)+")"),f=m.match(f),f!=null&&f[0]!=null&&0<f[0].length&&(h.o=!0,S=f[0].length,h.b.a(m.substring(0,S)))),r(h.a),h.a.a(m.substring(S)),m.substring(0,S)}function ee(h){var f=h.u.toString(),m=new RegExp("^(?:\\+|"+g(h.g,11)+")"),m=f.match(m);return m!=null&&m[0]!=null&&0<m[0].length&&(h.o=!0,m=m[0].length,r(h.a),h.a.a(f.substring(m)),r(h.b),h.b.a(f.substring(0,m)),f.charAt(0)!="+"&&h.b.a(" "),!0)}function ue(h){if(h.a.b.length==0)return!1;var f,m=new t;e:{if(f=h.a.toString(),f.length!=0&&f.charAt(0)!="0"){for(var S,z=f.length,B=1;3>=B&&B<=z;++B)if(S=parseInt(f.substring(0,B),10),S in he){m.a(f.substring(B)),f=S;break e}}f=0}return f!=0&&(r(h.a),h.a.a(m.toString()),m=P(f),m=="001"?h.g=G(h.G,""+f):m!=h.D&&(h.g=Qe(h,m)),h.b.a(""+f).a(" "),h.h="",!0)}function ge(h,f){var m=h.m.toString();if(0<=m.substring(h.s).search(h.H)){var S=m.search(h.H),m=m.replace(h.H,f);return r(h.m),h.m.a(m),h.s=S,m.substring(0,h.s+1)}return h.f.length==1&&(h.l=!1),h.w="",h.i.toString()}var Ke=this;t.prototype.b="",t.prototype.set=function(h){this.b=""+h},t.prototype.a=function(h,f,m){if(this.b+=String(h),f!=null)for(var S=1;S<arguments.length;S++)this.b+=arguments[S];return this},t.prototype.toString=function(){return this.b};var He=1,nt=2,ze=3,fe=4,De=6,Xe=16,ot=18;c.prototype.set=function(h,f){Z(this,h.b,f)},c.prototype.clone=function(){var h=new this.constructor;return h!=this&&(h.a={},h.b&&(h.b={}),p(h,this)),h},e(ve,c);var w=null;e(le,c);var R=null;e(Ie,c);var ce=null;ve.prototype.j=function(){var h=w;return h||(w=h=de(ve,{0:{name:"NumberFormat",I:"i18n.phonenumbers.NumberFormat"},1:{name:"pattern",required:!0,c:9,type:String},2:{name:"format",required:!0,c:9,type:String},3:{name:"leading_digits_pattern",v:!0,c:9,type:String},4:{name:"national_prefix_formatting_rule",c:9,type:String},6:{name:"national_prefix_optional_when_formatting",c:8,defaultValue:!1,type:Boolean},5:{name:"domestic_carrier_code_formatting_rule",c:9,type:String}})),h},ve.j=ve.prototype.j,le.prototype.j=function(){var h=R;return h||(R=h=de(le,{0:{name:"PhoneNumberDesc",I:"i18n.phonenumbers.PhoneNumberDesc"},2:{name:"national_number_pattern",c:9,type:String},9:{name:"possible_length",v:!0,c:5,type:Number},10:{name:"possible_length_local_only",v:!0,c:5,type:Number},6:{name:"example_number",c:9,type:String}})),h},le.j=le.prototype.j,Ie.prototype.j=function(){var h=ce;return h||(ce=h=de(Ie,{0:{name:"PhoneMetadata",I:"i18n.phonenumbers.PhoneMetadata"},1:{name:"general_desc",c:11,type:le},2:{name:"fixed_line",c:11,type:le},3:{name:"mobile",c:11,type:le},4:{name:"toll_free",c:11,type:le},5:{name:"premium_rate",c:11,type:le},6:{name:"shared_cost",c:11,type:le},7:{name:"personal_number",c:11,type:le},8:{name:"voip",c:11,type:le},21:{name:"pager",c:11,type:le},25:{name:"uan",c:11,type:le},27:{name:"emergency",c:11,type:le},28:{name:"voicemail",c:11,type:le},29:{name:"short_code",c:11,type:le},30:{name:"standard_rate",c:11,type:le},31:{name:"carrier_specific",c:11,type:le},33:{name:"sms_services",c:11,type:le},24:{name:"no_international_dialling",c:11,type:le},9:{name:"id",required:!0,c:9,type:String},10:{name:"country_code",c:5,type:Number},11:{name:"international_prefix",c:9,type:String},17:{name:"preferred_international_prefix",c:9,type:String},12:{name:"national_prefix",c:9,type:String},13:{name:"preferred_extn_prefix",c:9,type:String},15:{name:"national_prefix_for_parsing",c:9,type:String},16:{name:"national_prefix_transform_rule",c:9,type:String},18:{name:"same_mobile_and_fixed_line_pattern",c:8,defaultValue:!1,type:Boolean},19:{name:"number_format",v:!0,c:11,type:ve},20:{name:"intl_number_format",v:!0,c:11,type:ve},22:{name:"main_country_for_code",c:8,defaultValue:!1,type:Boolean},23:{name:"leading_digits",c:9,type:String},26:{name:"leading_zero_possible",c:8,defaultValue:!1,type:Boolean}})),h},Ie.j=Ie.prototype.j,Ae.prototype.a=function(h){throw new h.b,Error("Unimplemented")},Ae.prototype.b=function(h,f){if(h.a==11||h.a==10)return f instanceof c?f:this.a(h.i.prototype.j(),f);if(h.a==14){if(typeof f=="string"&&V.test(f)){var m=Number(f);if(0<m)return m}return f}if(!h.h)return f;if(m=h.i,m===String){if(typeof f=="number")return String(f)}else if(m===Number&&typeof f=="string"&&(f==="Infinity"||f==="-Infinity"||f==="NaN"||V.test(f)))return Number(f);return f};var V=/^-?[0-9]+$/;e(U,Ae),U.prototype.a=function(h,f){var m=new h.b;return m.g=this,m.a=f,m.b={},m},e(qe,U),qe.prototype.b=function(h,f){return h.a==8?!!f:Ae.prototype.b.apply(this,arguments)},qe.prototype.a=function(h,f){return qe.M.a.call(this,h,f)};var he={1:"US AG AI AS BB BM BS CA DM DO GD GU JM KN KY LC MP MS PR SX TC TT VC VG VI".split(" ")},ye={AG:[null,[null,null,"(?:268|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}",null,null,null,"2684601234",null,null,null,[7]],[null,null,"268(?:464|7(?:1[3-9]|2\\d|3[246]|64|[78][0-689]))\\d{4}",null,null,null,"2684641234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,"26848[01]\\d{4}",null,null,null,"2684801234",null,null,null,[7]],"AG",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,"26840[69]\\d{4}",null,null,null,"2684061234",null,null,null,[7]],null,"268",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],AI:[null,[null,null,"(?:264|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"2644(?:6[12]|9[78])\\d{4}",null,null,null,"2644612345",null,null,null,[7]],[null,null,"264(?:235|476|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}",null,null,null,"2642351234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"AI",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"264",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],AS:[null,[null,null,"(?:[58]\\d\\d|684|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"6846(?:22|33|44|55|77|88|9[19])\\d{4}",null,null,null,"6846221234",null,null,null,[7]],[null,null,"684(?:2(?:5[2468]|72)|7(?:3[13]|70))\\d{4}",null,null,null,"6847331234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"AS",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"684",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],BB:[null,[null,null,"(?:246|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"246(?:2(?:2[78]|7[0-4])|4(?:1[024-6]|2\\d|3[2-9])|5(?:20|[34]\\d|54|7[1-3])|6(?:2\\d|38)|7[35]7|9(?:1[89]|63))\\d{4}",null,null,null,"2464123456",null,null,null,[7]],[null,null,"246(?:2(?:[356]\\d|4[0-57-9]|8[0-79])|45\\d|69[5-7]|8(?:[2-5]\\d|83))\\d{4}",null,null,null,"2462501234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"(?:246976|900[2-9]\\d\\d)\\d{4}",null,null,null,"9002123456",null,null,null,[7]],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,"24631\\d{5}",null,null,null,"2463101234",null,null,null,[7]],"BB",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"246",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"246(?:292|367|4(?:1[7-9]|3[01]|44|67)|7(?:36|53))\\d{4}",null,null,null,"2464301234",null,null,null,[7]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],BM:[null,[null,null,"(?:441|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"441(?:2(?:02|23|[3479]\\d|61)|[46]\\d\\d|5(?:4\\d|60|89)|824)\\d{4}",null,null,null,"4412345678",null,null,null,[7]],[null,null,"441(?:[37]\\d|5[0-39])\\d{5}",null,null,null,"4413701234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"BM",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"441",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],BS:[null,[null,null,"(?:242|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[347]|8[0-4]|9[2-467])|461|502|6(?:0[1-4]|12|2[013]|[45]0|7[67]|8[78]|9[89])|7(?:02|88))\\d{4}",null,null,null,"2423456789",null,null,null,[7]],[null,null,"242(?:3(?:5[79]|7[56]|95)|4(?:[23][1-9]|4[1-35-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-46-9]|65|77)|6[34]6|7(?:27|38)|8(?:0[1-9]|1[02-9]|2\\d|[89]9))\\d{4}",null,null,null,"2423591234",null,null,null,[7]],[null,null,"(?:242300|8(?:00|33|44|55|66|77|88)[2-9]\\d\\d)\\d{4}",null,null,null,"8002123456",null,null,null,[7]],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"BS",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"242",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"242225[0-46-9]\\d{3}",null,null,null,"2422250123"],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],CA:[null,[null,null,"(?:[2-8]\\d|90)\\d{8}",null,null,null,null,null,null,[10],[7]],[null,null,"(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}",null,null,null,"5062345678",null,null,null,[7]],[null,null,"(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}",null,null,null,"5062345678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"(?:5(?:00|2[12]|33|44|66|77|88)|622)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,"600[2-9]\\d{6}",null,null,null,"6002012345"],"CA",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],DM:[null,[null,null,"(?:[58]\\d\\d|767|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"767(?:2(?:55|66)|4(?:2[01]|4[0-25-9])|50[0-4]|70[1-3])\\d{4}",null,null,null,"7674201234",null,null,null,[7]],[null,null,"767(?:2(?:[2-4689]5|7[5-7])|31[5-7]|61[1-7])\\d{4}",null,null,null,"7672251234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"DM",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"767",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],DO:[null,[null,null,"(?:[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"8(?:[04]9[2-9]\\d\\d|29(?:2(?:[0-59]\\d|6[04-9]|7[0-27]|8[0237-9])|3(?:[0-35-9]\\d|4[7-9])|[45]\\d\\d|6(?:[0-27-9]\\d|[3-5][1-9]|6[0135-8])|7(?:0[013-9]|[1-37]\\d|4[1-35689]|5[1-4689]|6[1-57-9]|8[1-79]|9[1-8])|8(?:0[146-9]|1[0-48]|[248]\\d|3[1-79]|5[01589]|6[013-68]|7[124-8]|9[0-8])|9(?:[0-24]\\d|3[02-46-9]|5[0-79]|60|7[0169]|8[57-9]|9[02-9])))\\d{4}",null,null,null,"8092345678",null,null,null,[7]],[null,null,"8[024]9[2-9]\\d{6}",null,null,null,"8092345678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"DO",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"8[024]9",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],GD:[null,[null,null,"(?:473|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"473(?:2(?:3[0-2]|69)|3(?:2[89]|86)|4(?:[06]8|3[5-9]|4[0-49]|5[5-79]|73|90)|63[68]|7(?:58|84)|800|938)\\d{4}",null,null,null,"4732691234",null,null,null,[7]],[null,null,"473(?:4(?:0[2-79]|1[04-9]|2[0-5]|58)|5(?:2[01]|3[3-8])|901)\\d{4}",null,null,null,"4734031234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"GD",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"473",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],GU:[null,[null,null,"(?:[58]\\d\\d|671|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[0236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[48])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}",null,null,null,"6713001234",null,null,null,[7]],[null,null,"671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[0236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[48])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}",null,null,null,"6713001234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"GU",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"671",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],JM:[null,[null,null,"(?:[58]\\d\\d|658|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"(?:658[2-9]\\d\\d|876(?:5(?:0[12]|1[0-468]|2[35]|63)|6(?:0[1-3579]|1[0237-9]|[23]\\d|40|5[06]|6[2-589]|7[05]|8[04]|9[4-9])|7(?:0[2-689]|[1-6]\\d|8[056]|9[45])|9(?:0[1-8]|1[02378]|[2-8]\\d|9[2-468])))\\d{4}",null,null,null,"8765230123",null,null,null,[7]],[null,null,"876(?:(?:2[14-9]|[348]\\d)\\d|5(?:0[3-9]|[2-57-9]\\d|6[0-24-9])|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579]))\\d{4}",null,null,null,"8762101234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"JM",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"658|876",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],KN:[null,[null,null,"(?:[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"869(?:2(?:29|36)|302|4(?:6[015-9]|70))\\d{4}",null,null,null,"8692361234",null,null,null,[7]],[null,null,"869(?:5(?:5[6-8]|6[5-7])|66\\d|76[02-7])\\d{4}",null,null,null,"8697652917",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"KN",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"869",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],KY:[null,[null,null,"(?:345|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"345(?:2(?:22|44)|444|6(?:23|38|40)|7(?:4[35-79]|6[6-9]|77)|8(?:00|1[45]|25|[48]8)|9(?:14|4[035-9]))\\d{4}",null,null,null,"3452221234",null,null,null,[7]],[null,null,"345(?:32[1-9]|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|9(?:1[67]|2[2-9]|3[689]))\\d{4}",null,null,null,"3453231234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"(?:345976|900[2-9]\\d\\d)\\d{4}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"KY",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,"345849\\d{4}",null,null,null,"3458491234"],null,"345",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],LC:[null,[null,null,"(?:[58]\\d\\d|758|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"758(?:4(?:30|5\\d|6[2-9]|8[0-2])|57[0-2]|638)\\d{4}",null,null,null,"7584305678",null,null,null,[7]],[null,null,"758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2\\d|3[01]))\\d{4}",null,null,null,"7582845678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"LC",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"758",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],MP:[null,[null,null,"(?:[58]\\d\\d|(?:67|90)0)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"670(?:2(?:3[3-7]|56|8[5-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}",null,null,null,"6702345678",null,null,null,[7]],[null,null,"670(?:2(?:3[3-7]|56|8[5-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}",null,null,null,"6702345678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"MP",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"670",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],MS:[null,[null,null,"(?:(?:[58]\\d\\d|900)\\d\\d|66449)\\d{5}",null,null,null,null,null,null,[10],[7]],[null,null,"664491\\d{4}",null,null,null,"6644912345",null,null,null,[7]],[null,null,"66449[2-6]\\d{4}",null,null,null,"6644923456",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"MS",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"664",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],PR:[null,[null,null,"(?:[589]\\d\\d|787)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"(?:787|939)[2-9]\\d{6}",null,null,null,"7872345678",null,null,null,[7]],[null,null,"(?:787|939)[2-9]\\d{6}",null,null,null,"7872345678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"PR",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"787|939",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],SX:[null,[null,null,"(?:(?:[58]\\d\\d|900)\\d|7215)\\d{6}",null,null,null,null,null,null,[10],[7]],[null,null,"7215(?:4[2-8]|8[239]|9[056])\\d{4}",null,null,null,"7215425678",null,null,null,[7]],[null,null,"7215(?:1[02]|2\\d|5[034679]|8[014-8])\\d{4}",null,null,null,"7215205678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"SX",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"721",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],TC:[null,[null,null,"(?:[58]\\d\\d|649|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"649(?:712|9(?:4\\d|50))\\d{4}",null,null,null,"6497121234",null,null,null,[7]],[null,null,"649(?:2(?:3[129]|4[1-7])|3(?:3[1-389]|4[1-8])|4[34][1-3])\\d{4}",null,null,null,"6492311234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,"64971[01]\\d{4}",null,null,null,"6497101234",null,null,null,[7]],"TC",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"649",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],TT:[null,[null,null,"(?:[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"868(?:2(?:01|[23]\\d)|6(?:0[7-9]|1[02-8]|2[1-9]|[3-69]\\d|7[0-79])|82[124])\\d{4}",null,null,null,"8682211234",null,null,null,[7]],[null,null,"868(?:2(?:6[6-9]|[7-9]\\d)|[37](?:0[1-9]|1[02-9]|[2-9]\\d)|4[6-9]\\d|6(?:20|78|8\\d))\\d{4}",null,null,null,"8682911234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"TT",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"868",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,"868619\\d{4}",null,null,null,"8686191234",null,null,null,[7]]],US:[null,[null,null,"[2-9]\\d{9}",null,null,null,null,null,null,[10],[7]],[null,null,"(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[0-24679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[017]|6[0-279]|78|8[0-2])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-28]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[0179]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}",null,null,null,"2015550123",null,null,null,[7]],[null,null,"(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[0-24679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[017]|6[0-279]|78|8[0-2])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-28]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[0179]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}",null,null,null,"2015550123",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"US",1,"011","1",null,null,"1",null,null,1,[[null,"(\\d{3})(\\d{4})","$1-$2",["[2-9]"]],[null,"(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],null,null,1]],[[null,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[2-9]"]]],[null,null,null,null,null,null,null,null,null,[-1]],1,null,[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"710[2-9]\\d{6}",null,null,null,"7102123456"],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],VC:[null,[null,null,"(?:[58]\\d\\d|784|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"784(?:266|3(?:6[6-9]|7\\d|8[0-24-6])|4(?:38|5[0-36-8]|8[0-8])|5(?:55|7[0-2]|93)|638|784)\\d{4}",null,null,null,"7842661234",null,null,null,[7]],[null,null,"784(?:4(?:3[0-5]|5[45]|89|9[0-8])|5(?:2[6-9]|3[0-4]))\\d{4}",null,null,null,"7844301234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"VC",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"784",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],VG:[null,[null,null,"(?:284|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"284(?:(?:229|774|8(?:52|6[459]))\\d|4(?:22\\d|9(?:[45]\\d|6[0-5])))\\d{3}",null,null,null,"2842291234",null,null,null,[7]],[null,null,"284(?:(?:3(?:0[0-3]|4[0-7]|68|9[34])|54[0-57])\\d|4(?:(?:4[0-6]|68)\\d|9(?:6[6-9]|9\\d)))\\d{3}",null,null,null,"2843001234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"VG",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"284",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],VI:[null,[null,null,"(?:(?:34|90)0|[58]\\d\\d)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"340(?:2(?:01|2[06-8]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-57-9]|27|7\\d)|884|998)\\d{4}",null,null,null,"3406421234",null,null,null,[7]],[null,null,"340(?:2(?:01|2[06-8]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-57-9]|27|7\\d)|884|998)\\d{4}",null,null,null,"3406421234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"VI",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"340",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]]};xe.b=function(){return xe.a?xe.a:xe.a=new xe};var ct={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"},Ht=RegExp("[++]+"),vt=RegExp("([0-90-9٠-٩۰-۹])"),bt=/^\(?\$1\)?$/,wt=new Ie;Z(wt,11,"NA");var Ci=/\[([^\[\]])*\]/g,pr=/\d(?=[^,}][^,}])/g,Ei=RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)+$"),fr=/[- ]/;X.prototype.K=function(){this.C="",r(this.i),r(this.u),r(this.m),this.s=0,this.w="",r(this.b),this.h="",r(this.a),this.l=!0,this.A=this.o=this.F=!1,this.f=[],this.B=!1,this.g!=this.J&&(this.g=Qe(this,this.D))},X.prototype.L=function(h){return this.C=y(this,h)},n("Cleave.AsYouTypeFormatter",X),n("Cleave.AsYouTypeFormatter.prototype.inputDigit",X.prototype.L),n("Cleave.AsYouTypeFormatter.prototype.clear",X.prototype.K)}).call(typeof Fi=="object"&&Fi?Fi:window);var od=Object.defineProperty,ud=Object.getOwnPropertyDescriptor,Wi=(n,e,t,r)=>{for(var i=r>1?void 0:r?ud(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&od(e,t,i),i};const cd=Zr.object({firstName:Zr.string().min(1,{message:"First name is required"}),lastName:Zr.string().min(1,{message:"Last name is required"}),email:Zr.string().email({message:"Invalid email address"}),phone:Zr.string().regex(/^(1-)?\d{3}-\d{3}-\d{4}$/,{message:"Invalid phone number"}).transform(n=>n.replace(/-/g,"").replace(/^1/,""))});let Yn=class extends Un{constructor(){super(...arguments),this.params={firstName:"",lastName:"",email:"",phone:""},this.errors=[]}firstUpdated(){this.phoneCleave=new ju(this.phoneInput,{phone:!0,phoneRegionCode:"US",delimiter:"-"})}submit(n){n.preventDefault();try{this.params=cd.parse(this.params)}catch(e){this.errors=e.errors;return}this.dispatchEvent(new CustomEvent("submit",{composed:!0,detail:this.params}))}cancel(){this.dispatchEvent(new CustomEvent("cancel"))}updateField(n,e){this.params={...this.params,[n]:e}}render(){return Ri`
|
|
43
|
+
*/function uc(n,e,t){return n?e(n):t==null?void 0:t(n)}var pe;(function(n){n.assertEqual=i=>i;function e(i){}n.assertIs=e;function t(i){throw new Error}n.assertNever=t,n.arrayToEnum=i=>{const s={};for(const l of i)s[l]=l;return s},n.getValidEnumValues=i=>{const s=n.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),l={};for(const a of s)l[a]=i[a];return n.objectValues(l)},n.objectValues=i=>n.objectKeys(i).map(function(s){return i[s]}),n.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const l in i)Object.prototype.hasOwnProperty.call(i,l)&&s.push(l);return s},n.find=(i,s)=>{for(const l of i)if(s(l))return l},n.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(l=>typeof l=="string"?`'${l}'`:l).join(s)}n.joinValues=r,n.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(pe||(pe={}));var Us;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(Us||(Us={}));const M=pe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ft=n=>{switch(typeof n){case"undefined":return M.undefined;case"string":return M.string;case"number":return isNaN(n)?M.nan:M.number;case"boolean":return M.boolean;case"function":return M.function;case"bigint":return M.bigint;case"symbol":return M.symbol;case"object":return Array.isArray(n)?M.array:n===null?M.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?M.promise:typeof Map<"u"&&n instanceof Map?M.map:typeof Set<"u"&&n instanceof Set?M.set:typeof Date<"u"&&n instanceof Date?M.date:M.object;default:return M.unknown}},T=pe.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"]),cc=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class lt extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const l of s.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)r._errors.push(t(l));else{let a=r,o=0;for(;o<l.path.length;){const u=l.path[o];o===l.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(l))):a[u]=a[u]||{_errors:[]},a=a[u],o++}}};return i(this),r}static assert(e){if(!(e instanceof lt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,pe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}lt.create=n=>new lt(n);const Vn=(n,e)=>{let t;switch(n.code){case T.invalid_type:n.received===M.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case T.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,pe.jsonStringifyReplacer)}`;break;case T.unrecognized_keys:t=`Unrecognized key(s) in object: ${pe.joinValues(n.keys,", ")}`;break;case T.invalid_union:t="Invalid input";break;case T.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${pe.joinValues(n.options)}`;break;case T.invalid_enum_value:t=`Invalid enum value. Expected ${pe.joinValues(n.options)}, received '${n.received}'`;break;case T.invalid_arguments:t="Invalid function arguments";break;case T.invalid_return_type:t="Invalid function return type";break;case T.invalid_date:t="Invalid date";break;case T.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:pe.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case T.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case T.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case T.custom:t="Invalid input";break;case T.invalid_intersection_types:t="Intersection results could not be merged";break;case T.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case T.not_finite:t="Number must be finite";break;default:t=e.defaultError,pe.assertNever(n)}return{message:t}};let ca=Vn;function dc(n){ca=n}function ji(){return ca}const Li=n=>{const{data:e,path:t,errorMaps:r,issueData:i}=n,s=[...t,...i.path||[]],l={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const o=r.filter(u=>!!u).slice().reverse();for(const u of o)a=u(l,{data:e,defaultError:a}).message;return{...i,path:s,message:a}},hc=[];function E(n,e){const t=ji(),r=Li({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===Vn?void 0:Vn].filter(i=>!!i)});n.common.issues.push(r)}class Ge{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const i of t){if(i.status==="aborted")return K;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const i of t){const s=await i.key,l=await i.value;r.push({key:s,value:l})}return Ge.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const i of t){const{key:s,value:l}=i;if(s.status==="aborted"||l.status==="aborted")return K;s.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(r[s.value]=l.value)}return{status:e.value,value:r}}}const K=Object.freeze({status:"aborted"}),Bn=n=>({status:"dirty",value:n}),et=n=>({status:"valid",value:n}),Vs=n=>n.status==="aborted",Bs=n=>n.status==="dirty",xr=n=>n.status==="valid",kr=n=>typeof Promise<"u"&&n instanceof Promise;function Zi(n,e,t,r){if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(n)}function da(n,e,t,r,i){if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(n,t),t}typeof SuppressedError=="function"&&SuppressedError;var H;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(H||(H={}));var $r,Ar;class kt{constructor(e,t,r,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ha=(n,e)=>{if(xr(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new lt(n.common.issues);return this._error=t,this._error}}};function ne(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:i}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(l,a)=>{var o,u;const{message:c}=n;return l.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:(o=c??r)!==null&&o!==void 0?o:a.defaultError}:l.code!=="invalid_type"?{message:a.defaultError}:{message:(u=c??t)!==null&&u!==void 0?u:a.defaultError}},description:i}}class ae{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Ft(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Ft(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ge,ctx:{common:e.parent.common,data:e.data,parsedType:Ft(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(kr(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){var r;const i={common:{issues:[],async:(r=t==null?void 0:t.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ft(e)},s=this._parseSync({data:e,path:i.path,parent:i});return ha(i,s)}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==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ft(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(kr(i)?i:Promise.resolve(i));return ha(r,s)}refine(e,t){const r=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,s)=>{const l=e(i),a=()=>s.addIssue({code:T.custom,...r(i)});return typeof Promise<"u"&&l instanceof Promise?l.then(o=>o?!0:(a(),!1)):l?!0:(a(),!1)})}refinement(e,t){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof t=="function"?t(r,i):t),!1))}_refinement(e){return new pt({schema:this,typeName:W.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return At.create(this,this._def)}nullable(){return Yt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ht.create(this,this._def)}promise(){return Kn.create(this,this._def)}or(e){return Er.create([this,e],this._def)}and(e){return Mr.create(this,e,this._def)}transform(e){return new pt({...ne(this._def),schema:this,typeName:W.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Rr({...ne(this._def),innerType:this,defaultValue:t,typeName:W.ZodDefault})}brand(){return new qs({typeName:W.ZodBranded,type:this,...ne(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Dr({...ne(this._def),innerType:this,catchValue:t,typeName:W.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return jr.create(this,e)}readonly(){return Lr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const pc=/^c[^\s-]{8,}$/i,fc=/^[0-9a-z]+$/,mc=/^[0-9A-HJKMNP-TV-Z]{26}$/,gc=/^[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,yc=/^[a-z0-9_-]{21}$/i,vc=/^[-+]?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)?)??$/,bc=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,wc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Fs;const _c=/^(?:(?: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])$/,xc=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,kc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,pa="((\\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])))",$c=new RegExp(`^${pa}$`);function fa(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Ac(n){return new RegExp(`^${fa(n)}$`)}function ma(n){let e=`${pa}T${fa(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Sc(n,e){return!!((e==="v4"||!e)&&_c.test(n)||(e==="v6"||!e)&&xc.test(n))}class dt extends ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==M.string){const s=this._getOrReturnCtx(e);return E(s,{code:T.invalid_type,expected:M.string,received:s.parsedType}),K}const r=new Ge;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),E(i,{code:T.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),E(i,{code:T.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const l=e.data.length>s.value,a=e.data.length<s.value;(l||a)&&(i=this._getOrReturnCtx(e,i),l?E(i,{code:T.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&E(i,{code:T.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")bc.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"email",code:T.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Fs||(Fs=new RegExp(wc,"u")),Fs.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"emoji",code:T.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")gc.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"uuid",code:T.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")yc.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"nanoid",code:T.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")pc.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"cuid",code:T.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")fc.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"cuid2",code:T.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")mc.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"ulid",code:T.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),E(i,{validation:"url",code:T.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"regex",code:T.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),E(i,{code:T.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),E(i,{code:T.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),E(i,{code:T.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?ma(s).test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{code:T.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?$c.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{code:T.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?Ac(s).test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{code:T.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?vc.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"duration",code:T.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?Sc(e.data,s.version)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"ip",code:T.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?kc.test(e.data)||(i=this._getOrReturnCtx(e,i),E(i,{validation:"base64",code:T.invalid_string,message:s.message}),r.dirty()):pe.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(i=>e.test(i),{validation:t,code:T.invalid_string,...H.errToObj(r)})}_addCheck(e){return new dt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...H.errToObj(e)})}url(e){return this._addCheck({kind:"url",...H.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...H.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...H.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...H.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...H.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...H.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...H.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...H.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...H.errToObj(e)})}datetime(e){var t,r;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:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...H.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,...H.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...H.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...H.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...H.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...H.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...H.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...H.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...H.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...H.errToObj(t)})}nonempty(e){return this.min(1,H.errToObj(e))}trim(){return new dt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new dt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new dt({...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 isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}dt.create=n=>{var e;return new dt({checks:[],typeName:W.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...ne(n)})};function Tc(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=t>r?t:r,s=parseInt(n.toFixed(i).replace(".","")),l=parseInt(e.toFixed(i).replace(".",""));return s%l/Math.pow(10,i)}class Wt extends ae{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)!==M.number){const s=this._getOrReturnCtx(e);return E(s,{code:T.invalid_type,expected:M.number,received:s.parsedType}),K}let r;const i=new Ge;for(const s of this._def.checks)s.kind==="int"?pe.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{code:T.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),E(r,{code:T.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),E(r,{code:T.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Tc(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),E(r,{code:T.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),E(r,{code:T.not_finite,message:s.message}),i.dirty()):pe.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,H.toString(t))}gt(e,t){return this.setLimit("min",e,!1,H.toString(t))}lte(e,t){return this.setLimit("max",e,!0,H.toString(t))}lt(e,t){return this.setLimit("max",e,!1,H.toString(t))}setLimit(e,t,r,i){return new Wt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:H.toString(i)}]})}_addCheck(e){return new Wt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:H.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:H.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:H.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:H.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:H.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&pe.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Wt.create=n=>new Wt({checks:[],typeName:W.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...ne(n)});class qt extends ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==M.bigint){const s=this._getOrReturnCtx(e);return E(s,{code:T.invalid_type,expected:M.bigint,received:s.parsedType}),K}let r;const i=new Ge;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),E(r,{code:T.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),E(r,{code:T.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),E(r,{code:T.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):pe.assertNever(s);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,H.toString(t))}gt(e,t){return this.setLimit("min",e,!1,H.toString(t))}lte(e,t){return this.setLimit("max",e,!0,H.toString(t))}lt(e,t){return this.setLimit("max",e,!1,H.toString(t))}setLimit(e,t,r,i){return new qt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:H.toString(i)}]})}_addCheck(e){return new qt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:H.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}qt.create=n=>{var e;return new qt({checks:[],typeName:W.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...ne(n)})};class Sr extends ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==M.boolean){const r=this._getOrReturnCtx(e);return E(r,{code:T.invalid_type,expected:M.boolean,received:r.parsedType}),K}return et(e.data)}}Sr.create=n=>new Sr({typeName:W.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...ne(n)});class fn extends ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==M.date){const s=this._getOrReturnCtx(e);return E(s,{code:T.invalid_type,expected:M.date,received:s.parsedType}),K}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return E(s,{code:T.invalid_date}),K}const r=new Ge;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),E(i,{code:T.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),E(i,{code:T.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):pe.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new fn({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:H.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:H.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}fn.create=n=>new fn({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:W.ZodDate,...ne(n)});class zi extends ae{_parse(e){if(this._getType(e)!==M.symbol){const r=this._getOrReturnCtx(e);return E(r,{code:T.invalid_type,expected:M.symbol,received:r.parsedType}),K}return et(e.data)}}zi.create=n=>new zi({typeName:W.ZodSymbol,...ne(n)});class Tr extends ae{_parse(e){if(this._getType(e)!==M.undefined){const r=this._getOrReturnCtx(e);return E(r,{code:T.invalid_type,expected:M.undefined,received:r.parsedType}),K}return et(e.data)}}Tr.create=n=>new Tr({typeName:W.ZodUndefined,...ne(n)});class Cr extends ae{_parse(e){if(this._getType(e)!==M.null){const r=this._getOrReturnCtx(e);return E(r,{code:T.invalid_type,expected:M.null,received:r.parsedType}),K}return et(e.data)}}Cr.create=n=>new Cr({typeName:W.ZodNull,...ne(n)});class Fn extends ae{constructor(){super(...arguments),this._any=!0}_parse(e){return et(e.data)}}Fn.create=n=>new Fn({typeName:W.ZodAny,...ne(n)});class mn extends ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return et(e.data)}}mn.create=n=>new mn({typeName:W.ZodUnknown,...ne(n)});class Ot extends ae{_parse(e){const t=this._getOrReturnCtx(e);return E(t,{code:T.invalid_type,expected:M.never,received:t.parsedType}),K}}Ot.create=n=>new Ot({typeName:W.ZodNever,...ne(n)});class Hi extends ae{_parse(e){if(this._getType(e)!==M.undefined){const r=this._getOrReturnCtx(e);return E(r,{code:T.invalid_type,expected:M.void,received:r.parsedType}),K}return et(e.data)}}Hi.create=n=>new Hi({typeName:W.ZodVoid,...ne(n)});class ht extends ae{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),i=this._def;if(t.parsedType!==M.array)return E(t,{code:T.invalid_type,expected:M.array,received:t.parsedType}),K;if(i.exactLength!==null){const l=t.data.length>i.exactLength.value,a=t.data.length<i.exactLength.value;(l||a)&&(E(t,{code:l?T.too_big:T.too_small,minimum:a?i.exactLength.value:void 0,maximum:l?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(E(t,{code:T.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(E(t,{code:T.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((l,a)=>i.type._parseAsync(new kt(t,l,t.path,a)))).then(l=>Ge.mergeArray(r,l));const s=[...t.data].map((l,a)=>i.type._parseSync(new kt(t,l,t.path,a)));return Ge.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new ht({...this._def,minLength:{value:e,message:H.toString(t)}})}max(e,t){return new ht({...this._def,maxLength:{value:e,message:H.toString(t)}})}length(e,t){return new ht({...this._def,exactLength:{value:e,message:H.toString(t)}})}nonempty(e){return this.min(1,e)}}ht.create=(n,e)=>new ht({type:n,minLength:null,maxLength:null,exactLength:null,typeName:W.ZodArray,...ne(e)});function Wn(n){if(n instanceof Ne){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=At.create(Wn(r))}return new Ne({...n._def,shape:()=>e})}else return n instanceof ht?new ht({...n._def,type:Wn(n.element)}):n instanceof At?At.create(Wn(n.unwrap())):n instanceof Yt?Yt.create(Wn(n.unwrap())):n instanceof $t?$t.create(n.items.map(e=>Wn(e))):n}class Ne extends ae{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(),t=pe.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==M.object){const u=this._getOrReturnCtx(e);return E(u,{code:T.invalid_type,expected:M.object,received:u.parsedType}),K}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:l}=this._getCached(),a=[];if(!(this._def.catchall instanceof Ot&&this._def.unknownKeys==="strip"))for(const u in i.data)l.includes(u)||a.push(u);const o=[];for(const u of l){const c=s[u],p=i.data[u];o.push({key:{status:"valid",value:u},value:c._parse(new kt(i,p,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Ot){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of a)o.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")a.length>0&&(E(i,{code:T.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of a){const p=i.data[c];o.push({key:{status:"valid",value:c},value:u._parse(new kt(i,p,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of o){const p=await c.key,d=await c.value;u.push({key:p,value:d,alwaysSet:c.alwaysSet})}return u}).then(u=>Ge.mergeObjectSync(r,u)):Ge.mergeObjectSync(r,o)}get shape(){return this._def.shape()}strict(e){return H.errToObj,new Ne({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var i,s,l,a;const o=(l=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,t,r).message)!==null&&l!==void 0?l:r.defaultError;return t.code==="unrecognized_keys"?{message:(a=H.errToObj(e).message)!==null&&a!==void 0?a:o}:{message:o}}}:{}})}strip(){return new Ne({...this._def,unknownKeys:"strip"})}passthrough(){return new Ne({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ne({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ne({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:W.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ne({...this._def,catchall:e})}pick(e){const t={};return pe.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new Ne({...this._def,shape:()=>t})}omit(e){const t={};return pe.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new Ne({...this._def,shape:()=>t})}deepPartial(){return Wn(this)}partial(e){const t={};return pe.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?t[r]=i:t[r]=i.optional()}),new Ne({...this._def,shape:()=>t})}required(e){const t={};return pe.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof At;)s=s._def.innerType;t[r]=s}}),new Ne({...this._def,shape:()=>t})}keyof(){return ga(pe.objectKeys(this.shape))}}Ne.create=(n,e)=>new Ne({shape:()=>n,unknownKeys:"strip",catchall:Ot.create(),typeName:W.ZodObject,...ne(e)}),Ne.strictCreate=(n,e)=>new Ne({shape:()=>n,unknownKeys:"strict",catchall:Ot.create(),typeName:W.ZodObject,...ne(e)}),Ne.lazycreate=(n,e)=>new Ne({shape:n,unknownKeys:"strip",catchall:Ot.create(),typeName:W.ZodObject,...ne(e)});class Er extends ae{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const l=s.map(a=>new lt(a.ctx.common.issues));return E(t,{code:T.invalid_union,unionErrors:l}),K}if(t.common.async)return Promise.all(r.map(async s=>{const l={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(i);{let s;const l=[];for(const o of r){const u={...t,common:{...t.common,issues:[]},parent:null},c=o._parseSync({data:t.data,path:t.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:u}),u.common.issues.length&&l.push(u.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const a=l.map(o=>new lt(o));return E(t,{code:T.invalid_union,unionErrors:a}),K}}get options(){return this._def.options}}Er.create=(n,e)=>new Er({options:n,typeName:W.ZodUnion,...ne(e)});const Nt=n=>n instanceof Or?Nt(n.schema):n instanceof pt?Nt(n.innerType()):n instanceof Nr?[n.value]:n instanceof Kt?n.options:n instanceof Pr?pe.objectValues(n.enum):n instanceof Rr?Nt(n._def.innerType):n instanceof Tr?[void 0]:n instanceof Cr?[null]:n instanceof At?[void 0,...Nt(n.unwrap())]:n instanceof Yt?[null,...Nt(n.unwrap())]:n instanceof qs||n instanceof Lr?Nt(n.unwrap()):n instanceof Dr?Nt(n._def.innerType):[];class Ui extends ae{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==M.object)return E(t,{code:T.invalid_type,expected:M.object,received:t.parsedType}),K;const r=this.discriminator,i=t.data[r],s=this.optionsMap.get(i);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(E(t,{code:T.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),K)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const i=new Map;for(const s of t){const l=Nt(s.shape[e]);if(!l.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of l){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new Ui({typeName:W.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...ne(r)})}}function Ws(n,e){const t=Ft(n),r=Ft(e);if(n===e)return{valid:!0,data:n};if(t===M.object&&r===M.object){const i=pe.objectKeys(e),s=pe.objectKeys(n).filter(a=>i.indexOf(a)!==-1),l={...n,...e};for(const a of s){const o=Ws(n[a],e[a]);if(!o.valid)return{valid:!1};l[a]=o.data}return{valid:!0,data:l}}else if(t===M.array&&r===M.array){if(n.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<n.length;s++){const l=n[s],a=e[s],o=Ws(l,a);if(!o.valid)return{valid:!1};i.push(o.data)}return{valid:!0,data:i}}else return t===M.date&&r===M.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class Mr extends ae{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),i=(s,l)=>{if(Vs(s)||Vs(l))return K;const a=Ws(s.value,l.value);return a.valid?((Bs(s)||Bs(l))&&t.dirty(),{status:t.value,value:a.data}):(E(r,{code:T.invalid_intersection_types}),K)};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(([s,l])=>i(s,l)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Mr.create=(n,e,t)=>new Mr({left:n,right:e,typeName:W.ZodIntersection,...ne(t)});class $t extends ae{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.array)return E(r,{code:T.invalid_type,expected:M.array,received:r.parsedType}),K;if(r.data.length<this._def.items.length)return E(r,{code:T.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),K;!this._def.rest&&r.data.length>this._def.items.length&&(E(r,{code:T.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...r.data].map((l,a)=>{const o=this._def.items[a]||this._def.rest;return o?o._parse(new kt(r,l,r.path,a)):null}).filter(l=>!!l);return r.common.async?Promise.all(s).then(l=>Ge.mergeArray(t,l)):Ge.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new $t({...this._def,rest:e})}}$t.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $t({items:n,typeName:W.ZodTuple,rest:null,...ne(e)})};class Ir extends ae{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!==M.object)return E(r,{code:T.invalid_type,expected:M.object,received:r.parsedType}),K;const i=[],s=this._def.keyType,l=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new kt(r,a,r.path,a)),value:l._parse(new kt(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Ge.mergeObjectAsync(t,i):Ge.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof ae?new Ir({keyType:e,valueType:t,typeName:W.ZodRecord,...ne(r)}):new Ir({keyType:dt.create(),valueType:e,typeName:W.ZodRecord,...ne(t)})}}class Vi extends ae{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!==M.map)return E(r,{code:T.invalid_type,expected:M.map,received:r.parsedType}),K;const i=this._def.keyType,s=this._def.valueType,l=[...r.data.entries()].map(([a,o],u)=>({key:i._parse(new kt(r,a,r.path,[u,"key"])),value:s._parse(new kt(r,o,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const o of l){const u=await o.key,c=await o.value;if(u.status==="aborted"||c.status==="aborted")return K;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const o of l){const u=o.key,c=o.value;if(u.status==="aborted"||c.status==="aborted")return K;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}}}}Vi.create=(n,e,t)=>new Vi({valueType:e,keyType:n,typeName:W.ZodMap,...ne(t)});class gn extends ae{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.set)return E(r,{code:T.invalid_type,expected:M.set,received:r.parsedType}),K;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(E(r,{code:T.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(E(r,{code:T.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const s=this._def.valueType;function l(o){const u=new Set;for(const c of o){if(c.status==="aborted")return K;c.status==="dirty"&&t.dirty(),u.add(c.value)}return{status:t.value,value:u}}const a=[...r.data.values()].map((o,u)=>s._parse(new kt(r,o,r.path,u)));return r.common.async?Promise.all(a).then(o=>l(o)):l(a)}min(e,t){return new gn({...this._def,minSize:{value:e,message:H.toString(t)}})}max(e,t){return new gn({...this._def,maxSize:{value:e,message:H.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}gn.create=(n,e)=>new gn({valueType:n,minSize:null,maxSize:null,typeName:W.ZodSet,...ne(e)});class qn extends ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==M.function)return E(t,{code:T.invalid_type,expected:M.function,received:t.parsedType}),K;function r(a,o){return Li({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ji(),Vn].filter(u=>!!u),issueData:{code:T.invalid_arguments,argumentsError:o}})}function i(a,o){return Li({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ji(),Vn].filter(u=>!!u),issueData:{code:T.invalid_return_type,returnTypeError:o}})}const s={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof Kn){const a=this;return et(async function(...o){const u=new lt([]),c=await a._def.args.parseAsync(o,s).catch(g=>{throw u.addIssue(r(o,g)),u}),p=await Reflect.apply(l,this,c);return await a._def.returns._def.type.parseAsync(p,s).catch(g=>{throw u.addIssue(i(p,g)),u})})}else{const a=this;return et(function(...o){const u=a._def.args.safeParse(o,s);if(!u.success)throw new lt([r(o,u.error)]);const c=Reflect.apply(l,this,u.data),p=a._def.returns.safeParse(c,s);if(!p.success)throw new lt([i(c,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new qn({...this._def,args:$t.create(e).rest(mn.create())})}returns(e){return new qn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new qn({args:e||$t.create([]).rest(mn.create()),returns:t||mn.create(),typeName:W.ZodFunction,...ne(r)})}}class Or extends ae{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})}}Or.create=(n,e)=>new Or({getter:n,typeName:W.ZodLazy,...ne(e)});class Nr extends ae{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return E(t,{received:t.data,code:T.invalid_literal,expected:this._def.value}),K}return{status:"valid",value:e.data}}get value(){return this._def.value}}Nr.create=(n,e)=>new Nr({value:n,typeName:W.ZodLiteral,...ne(e)});function ga(n,e){return new Kt({values:n,typeName:W.ZodEnum,...ne(e)})}class Kt extends ae{constructor(){super(...arguments),$r.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return E(t,{expected:pe.joinValues(r),received:t.parsedType,code:T.invalid_type}),K}if(Zi(this,$r)||da(this,$r,new Set(this._def.values)),!Zi(this,$r).has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return E(t,{received:t.data,code:T.invalid_enum_value,options:r}),K}return et(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Kt.create(e,{...this._def,...t})}exclude(e,t=this._def){return Kt.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}$r=new WeakMap,Kt.create=ga;class Pr extends ae{constructor(){super(...arguments),Ar.set(this,void 0)}_parse(e){const t=pe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==M.string&&r.parsedType!==M.number){const i=pe.objectValues(t);return E(r,{expected:pe.joinValues(i),received:r.parsedType,code:T.invalid_type}),K}if(Zi(this,Ar)||da(this,Ar,new Set(pe.getValidEnumValues(this._def.values))),!Zi(this,Ar).has(e.data)){const i=pe.objectValues(t);return E(r,{received:r.data,code:T.invalid_enum_value,options:i}),K}return et(e.data)}get enum(){return this._def.values}}Ar=new WeakMap,Pr.create=(n,e)=>new Pr({values:n,typeName:W.ZodNativeEnum,...ne(e)});class Kn extends ae{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==M.promise&&t.common.async===!1)return E(t,{code:T.invalid_type,expected:M.promise,received:t.parsedType}),K;const r=t.parsedType===M.promise?t.data:Promise.resolve(t.data);return et(r.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Kn.create=(n,e)=>new Kn({type:n,typeName:W.ZodPromise,...ne(e)});class pt extends ae{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:t,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:l=>{E(r,l),l.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const l=i.transform(r.data,s);if(r.common.async)return Promise.resolve(l).then(async a=>{if(t.value==="aborted")return K;const o=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return o.status==="aborted"?K:o.status==="dirty"||t.value==="dirty"?Bn(o.value):o});{if(t.value==="aborted")return K;const a=this._def.schema._parseSync({data:l,path:r.path,parent:r});return a.status==="aborted"?K:a.status==="dirty"||t.value==="dirty"?Bn(a.value):a}}if(i.type==="refinement"){const l=a=>{const o=i.refinement(a,s);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 a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?K:(a.status==="dirty"&&t.dirty(),l(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?K:(a.status==="dirty"&&t.dirty(),l(a.value).then(()=>({status:t.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!xr(l))return l;const a=i.transform(l.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>xr(l)?Promise.resolve(i.transform(l.value,s)).then(a=>({status:t.value,value:a})):l);pe.assertNever(i)}}pt.create=(n,e,t)=>new pt({schema:n,typeName:W.ZodEffects,effect:e,...ne(t)}),pt.createWithPreprocess=(n,e,t)=>new pt({schema:e,effect:{type:"preprocess",transform:n},typeName:W.ZodEffects,...ne(t)});class At extends ae{_parse(e){return this._getType(e)===M.undefined?et(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}At.create=(n,e)=>new At({innerType:n,typeName:W.ZodOptional,...ne(e)});class Yt extends ae{_parse(e){return this._getType(e)===M.null?et(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Yt.create=(n,e)=>new Yt({innerType:n,typeName:W.ZodNullable,...ne(e)});class Rr extends ae{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===M.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Rr.create=(n,e)=>new Rr({innerType:n,typeName:W.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ne(e)});class Dr extends ae{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return kr(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new lt(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new lt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Dr.create=(n,e)=>new Dr({innerType:n,typeName:W.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ne(e)});class Bi extends ae{_parse(e){if(this._getType(e)!==M.nan){const r=this._getOrReturnCtx(e);return E(r,{code:T.invalid_type,expected:M.nan,received:r.parsedType}),K}return{status:"valid",value:e.data}}}Bi.create=n=>new Bi({typeName:W.ZodNaN,...ne(n)});const Cc=Symbol("zod_brand");class qs extends ae{_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}}class jr extends ae{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?K:s.status==="dirty"?(t.dirty(),Bn(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?K:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,t){return new jr({in:e,out:t,typeName:W.ZodPipeline})}}class Lr extends ae{_parse(e){const t=this._def.innerType._parse(e),r=i=>(xr(i)&&(i.value=Object.freeze(i.value)),i);return kr(t)?t.then(i=>r(i)):r(t)}unwrap(){return this._def.innerType}}Lr.create=(n,e)=>new Lr({innerType:n,typeName:W.ZodReadonly,...ne(e)});function ya(n,e={},t){return n?Fn.create().superRefine((r,i)=>{var s,l;if(!n(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,o=(l=(s=a.fatal)!==null&&s!==void 0?s:t)!==null&&l!==void 0?l:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:o})}}):Fn.create()}const Ec={object:Ne.lazycreate};var W;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(W||(W={}));const Mc=(n,e={message:`Input not instance of ${n.name}`})=>ya(t=>t instanceof n,e),va=dt.create,ba=Wt.create,Ic=Bi.create,Oc=qt.create,wa=Sr.create,Nc=fn.create,Pc=zi.create,Rc=Tr.create,Dc=Cr.create,jc=Fn.create,Lc=mn.create,Zc=Ot.create,zc=Hi.create,Hc=ht.create,Uc=Ne.create,Vc=Ne.strictCreate,Bc=Er.create,Fc=Ui.create,Wc=Mr.create,qc=$t.create,Kc=Ir.create,Yc=Vi.create,Gc=gn.create,Jc=qn.create,Qc=Or.create,Xc=Nr.create,ed=Kt.create,td=Pr.create,nd=Kn.create,_a=pt.create,rd=At.create,id=Yt.create,sd=pt.createWithPreprocess,ld=jr.create;var Zr=Object.freeze({__proto__:null,defaultErrorMap:Vn,setErrorMap:dc,getErrorMap:ji,makeIssue:Li,EMPTY_PATH:hc,addIssueToContext:E,ParseStatus:Ge,INVALID:K,DIRTY:Bn,OK:et,isAborted:Vs,isDirty:Bs,isValid:xr,isAsync:kr,get util(){return pe},get objectUtil(){return Us},ZodParsedType:M,getParsedType:Ft,ZodType:ae,datetimeRegex:ma,ZodString:dt,ZodNumber:Wt,ZodBigInt:qt,ZodBoolean:Sr,ZodDate:fn,ZodSymbol:zi,ZodUndefined:Tr,ZodNull:Cr,ZodAny:Fn,ZodUnknown:mn,ZodNever:Ot,ZodVoid:Hi,ZodArray:ht,ZodObject:Ne,ZodUnion:Er,ZodDiscriminatedUnion:Ui,ZodIntersection:Mr,ZodTuple:$t,ZodRecord:Ir,ZodMap:Vi,ZodSet:gn,ZodFunction:qn,ZodLazy:Or,ZodLiteral:Nr,ZodEnum:Kt,ZodNativeEnum:Pr,ZodPromise:Kn,ZodEffects:pt,ZodTransformer:pt,ZodOptional:At,ZodNullable:Yt,ZodDefault:Rr,ZodCatch:Dr,ZodNaN:Bi,BRAND:Cc,ZodBranded:qs,ZodPipeline:jr,ZodReadonly:Lr,custom:ya,Schema:ae,ZodSchema:ae,late:Ec,get ZodFirstPartyTypeKind(){return W},coerce:{string:n=>dt.create({...n,coerce:!0}),number:n=>Wt.create({...n,coerce:!0}),boolean:n=>Sr.create({...n,coerce:!0}),bigint:n=>qt.create({...n,coerce:!0}),date:n=>fn.create({...n,coerce:!0})},any:jc,array:Hc,bigint:Oc,boolean:wa,date:Nc,discriminatedUnion:Fc,effect:_a,enum:ed,function:Jc,instanceof:Mc,intersection:Wc,lazy:Qc,literal:Xc,map:Yc,nan:Ic,nativeEnum:td,never:Zc,null:Dc,nullable:id,number:ba,object:Uc,oboolean:()=>wa().optional(),onumber:()=>ba().optional(),optional:rd,ostring:()=>va().optional(),pipeline:ld,preprocess:sd,promise:nd,record:Kc,set:Gc,strictObject:Vc,string:va,symbol:Pc,transformer:_a,tuple:qc,undefined:Rc,union:Bc,unknown:Lc,void:zc,NEVER:K,ZodIssueCode:T,quotelessJson:cc,ZodError:lt});const xa=Zu`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: \"\"}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.static{position:static}.relative{position:relative}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-4{margin-bottom:1rem}.mt-4{margin-top:1rem}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rounded{border-radius:.25rem}.border{border-width:1px}.border-red-400{--tw-border-opacity: 1;border-color:rgb(248 113 113 / var(--tw-border-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.px-4{padding-left:1rem;padding-right:1rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity))}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}input{width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.25rem;border-width:1px;padding:.5rem .75rem;line-height:1.25;--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity));--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}label{margin-bottom:.5rem;display:block;font-size:.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.btn-primary{border-radius:.25rem;padding:.5rem 1rem;font-weight:700;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-primary:hover{opacity:.95}.btn-primary:disabled{pointer-events:none;opacity:.5}.btn-primary{background-color:var(--iai-chat-i-button-bg);color:var(--iai-chat-i-button-fg)}.btn-secondary{padding:.5rem 1rem;font-weight:700;--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.btn-secondary:hover{opacity:.95}.btn-secondary:disabled{pointer-events:none;opacity:.5}`;var Fi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ad(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}(function(){function n(h,f){var m=h.split("."),S=Ke;m[0]in S||!S.execScript||S.execScript("var "+m[0]);for(var z;m.length&&(z=m.shift());)m.length||f===void 0?S=S[z]?S[z]:S[z]={}:S[z]=f}function e(h,f){function m(){}m.prototype=f.prototype,h.M=f.prototype,h.prototype=new m,h.prototype.constructor=h,h.N=function(S,z,B){for(var be=Array(arguments.length-2),je=2;je<arguments.length;je++)be[je-2]=arguments[je];return f.prototype[z].apply(S,be)}}function t(h,f){h!=null&&this.a.apply(this,arguments)}function r(h){h.b=""}function i(h,f){h.sort(f||s)}function s(h,f){return h>f?1:h<f?-1:0}function l(h){var f,m=[],S=0;for(f in h)m[S++]=h[f];return m}function a(h,f){this.b=h,this.a={};for(var m=0;m<f.length;m++){var S=f[m];this.a[S.b]=S}}function o(h){return h=l(h.a),i(h,function(f,m){return f.b-m.b}),h}function u(h,f){switch(this.b=h,this.g=!!f.v,this.a=f.c,this.i=f.type,this.h=!1,this.a){case ze:case fe:case De:case Xe:case ot:case nt:case He:this.h=!0}this.f=f.defaultValue}function c(){this.a={},this.f=this.j().a,this.b=this.g=null}function p(h,f){for(var m=o(h.j()),S=0;S<m.length;S++){var z=m[S],B=z.b;if(f.a[B]!=null){h.b&&delete h.b[z.b];var be=z.a==11||z.a==10;if(z.g)for(var z=d(f,B)||[],je=0;je<z.length;je++){var We=h,_t=B,Mi=be?z[je].clone():z[je];We.a[_t]||(We.a[_t]=[]),We.a[_t].push(Mi),We.b&&delete We.b[_t]}else z=d(f,B),be?(be=d(h,B))?p(be,z):Z(h,B,z.clone()):Z(h,B,z)}}}function d(h,f){var m=h.a[f];if(m==null)return null;if(h.g){if(!(f in h.b)){var S=h.g,z=h.f[f];if(m!=null)if(z.g){for(var B=[],be=0;be<m.length;be++)B[be]=S.b(z,m[be]);m=B}else m=S.b(z,m);return h.b[f]=m}return h.b[f]}return m}function g(h,f,m){var S=d(h,f);return h.f[f].g?S[m||0]:S}function x(h,f){var m;if(h.a[f]!=null)m=g(h,f,void 0);else e:{if(m=h.f[f],m.f===void 0){var S=m.i;if(S===Boolean)m.f=!1;else if(S===Number)m.f=0;else{if(S!==String){m=new S;break e}m.f=m.h?"0":""}}m=m.f}return m}function j(h,f){return h.f[f].g?h.a[f]!=null?h.a[f].length:0:h.a[f]!=null?1:0}function Z(h,f,m){h.a[f]=m,h.b&&(h.b[f]=m)}function de(h,f){var m,S=[];for(m in f)m!=0&&S.push(new u(m,f[m]));return new a(h,S)}function me(){c.call(this)}function X(){c.call(this)}function Ie(){c.call(this)}function Ae(){}function U(){}function qe(){}function xe(){this.a={}}function Ze(h){return h.length==0||bt.test(h)}function G(h,f){if(f==null)return null;f=f.toUpperCase();var m=h.a[f];if(m==null){if(m=ve[f],m==null)return null;m=new qe().a(Ie.j(),m),h.a[f]=m}return m}function P(h){return h=he[h],h==null?"ZZ":h[0]}function ee(h){this.H=RegExp(" "),this.C="",this.m=new t,this.w="",this.i=new t,this.u=new t,this.l=!0,this.A=this.o=this.F=!1,this.G=xe.b(),this.s=0,this.b=new t,this.B=!1,this.h="",this.a=new t,this.f=[],this.D=h,this.J=this.g=Qe(this,this.D)}function Qe(h,f){var m;if(f!=null&&isNaN(f)&&f.toUpperCase()in ve){if(m=G(h.G,f),m==null)throw Error("Invalid region code: "+f);m=x(m,10)}else m=0;return m=G(h.G,P(m)),m??wt}function $(h){for(var f=h.f.length,m=0;m<f;++m){var S=h.f[m],z=x(S,1);if(h.w==z)return!1;var B;B=h;var be=S,je=x(be,1);if(je.indexOf("|")!=-1)B=!1;else{je=je.replace(Ci,"\\d"),je=je.replace(pr,"\\d"),r(B.m);var We;We=B;var be=x(be,2),_t="999999999999999".match(je)[0];_t.length<We.a.b.length?We="":(We=_t.replace(new RegExp(je,"g"),be),We=We.replace(RegExp("9","g")," ")),0<We.length?(B.m.a(We),B=!0):B=!1}if(B)return h.w=z,h.B=fr.test(g(S,4)),h.s=0,!0}return h.l=!1}function b(h,f){for(var m=[],S=f.length-3,z=h.f.length,B=0;B<z;++B){var be=h.f[B];j(be,3)==0?m.push(h.f[B]):(be=g(be,3,Math.min(S,j(be,3)-1)),f.search(be)==0&&m.push(h.f[B]))}h.f=m}function y(h,f){h.i.a(f);var m=f;if(vt.test(m)||h.i.b.length==1&&Ht.test(m)){var S,m=f;m=="+"?(S=m,h.u.a(m)):(S=ct[m],h.u.a(S),h.a.a(S)),f=S}else h.l=!1,h.F=!0;if(!h.l){if(!h.F){if(te(h)){if(ue(h))return _(h)}else if(0<h.h.length&&(m=h.a.toString(),r(h.a),h.a.a(h.h),h.a.a(m),m=h.b.toString(),S=m.lastIndexOf(h.h),r(h.b),h.b.a(m.substring(0,S))),h.h!=Y(h))return h.b.a(" "),_(h)}return h.i.toString()}switch(h.u.b.length){case 0:case 1:case 2:return h.i.toString();case 3:if(!te(h))return h.h=Y(h),k(h);h.A=!0;default:return h.A?(ue(h)&&(h.A=!1),h.b.toString()+h.a.toString()):0<h.f.length?(m=ye(h,f),S=v(h),0<S.length?S:(b(h,h.a.toString()),$(h)?N(h):h.l?A(h,m):h.i.toString())):k(h)}}function _(h){return h.l=!0,h.A=!1,h.f=[],h.s=0,r(h.m),h.w="",k(h)}function v(h){for(var f=h.a.toString(),m=h.f.length,S=0;S<m;++S){var z=h.f[S],B=x(z,1);if(new RegExp("^(?:"+B+")$").test(f))return h.B=fr.test(g(z,4)),f=f.replace(new RegExp(B,"g"),g(z,2)),A(h,f)}return""}function A(h,f){var m=h.b.b.length;return h.B&&0<m&&h.b.toString().charAt(m-1)!=" "?h.b+" "+f:h.b+f}function k(h){var f=h.a.toString();if(3<=f.length){for(var m=h.o&&h.h.length==0&&0<j(h.g,20)?d(h.g,20)||[]:d(h.g,19)||[],S=m.length,z=0;z<S;++z){var B=m[z];0<h.h.length&&Ze(x(B,4))&&!g(B,6)&&B.a[5]==null||(h.h.length!=0||h.o||Ze(x(B,4))||g(B,6))&&Ei.test(x(B,2))&&h.f.push(B)}return b(h,f),f=v(h),0<f.length?f:$(h)?N(h):h.i.toString()}return A(h,f)}function N(h){var f=h.a.toString(),m=f.length;if(0<m){for(var S="",z=0;z<m;z++)S=ye(h,f.charAt(z));return h.l?A(h,S):h.i.toString()}return h.b.toString()}function Y(h){var f,m=h.a.toString(),S=0;return g(h.g,10)!=1?f=!1:(f=h.a.toString(),f=f.charAt(0)=="1"&&f.charAt(1)!="0"&&f.charAt(1)!="1"),f?(S=1,h.b.a("1").a(" "),h.o=!0):h.g.a[15]!=null&&(f=new RegExp("^(?:"+g(h.g,15)+")"),f=m.match(f),f!=null&&f[0]!=null&&0<f[0].length&&(h.o=!0,S=f[0].length,h.b.a(m.substring(0,S)))),r(h.a),h.a.a(m.substring(S)),m.substring(0,S)}function te(h){var f=h.u.toString(),m=new RegExp("^(?:\\+|"+g(h.g,11)+")"),m=f.match(m);return m!=null&&m[0]!=null&&0<m[0].length&&(h.o=!0,m=m[0].length,r(h.a),h.a.a(f.substring(m)),r(h.b),h.b.a(f.substring(0,m)),f.charAt(0)!="+"&&h.b.a(" "),!0)}function ue(h){if(h.a.b.length==0)return!1;var f,m=new t;e:{if(f=h.a.toString(),f.length!=0&&f.charAt(0)!="0"){for(var S,z=f.length,B=1;3>=B&&B<=z;++B)if(S=parseInt(f.substring(0,B),10),S in he){m.a(f.substring(B)),f=S;break e}}f=0}return f!=0&&(r(h.a),h.a.a(m.toString()),m=P(f),m=="001"?h.g=G(h.G,""+f):m!=h.D&&(h.g=Qe(h,m)),h.b.a(""+f).a(" "),h.h="",!0)}function ye(h,f){var m=h.m.toString();if(0<=m.substring(h.s).search(h.H)){var S=m.search(h.H),m=m.replace(h.H,f);return r(h.m),h.m.a(m),h.s=S,m.substring(0,h.s+1)}return h.f.length==1&&(h.l=!1),h.w="",h.i.toString()}var Ke=this;t.prototype.b="",t.prototype.set=function(h){this.b=""+h},t.prototype.a=function(h,f,m){if(this.b+=String(h),f!=null)for(var S=1;S<arguments.length;S++)this.b+=arguments[S];return this},t.prototype.toString=function(){return this.b};var He=1,nt=2,ze=3,fe=4,De=6,Xe=16,ot=18;c.prototype.set=function(h,f){Z(this,h.b,f)},c.prototype.clone=function(){var h=new this.constructor;return h!=this&&(h.a={},h.b&&(h.b={}),p(h,this)),h},e(me,c);var w=null;e(X,c);var R=null;e(Ie,c);var ce=null;me.prototype.j=function(){var h=w;return h||(w=h=de(me,{0:{name:"NumberFormat",I:"i18n.phonenumbers.NumberFormat"},1:{name:"pattern",required:!0,c:9,type:String},2:{name:"format",required:!0,c:9,type:String},3:{name:"leading_digits_pattern",v:!0,c:9,type:String},4:{name:"national_prefix_formatting_rule",c:9,type:String},6:{name:"national_prefix_optional_when_formatting",c:8,defaultValue:!1,type:Boolean},5:{name:"domestic_carrier_code_formatting_rule",c:9,type:String}})),h},me.j=me.prototype.j,X.prototype.j=function(){var h=R;return h||(R=h=de(X,{0:{name:"PhoneNumberDesc",I:"i18n.phonenumbers.PhoneNumberDesc"},2:{name:"national_number_pattern",c:9,type:String},9:{name:"possible_length",v:!0,c:5,type:Number},10:{name:"possible_length_local_only",v:!0,c:5,type:Number},6:{name:"example_number",c:9,type:String}})),h},X.j=X.prototype.j,Ie.prototype.j=function(){var h=ce;return h||(ce=h=de(Ie,{0:{name:"PhoneMetadata",I:"i18n.phonenumbers.PhoneMetadata"},1:{name:"general_desc",c:11,type:X},2:{name:"fixed_line",c:11,type:X},3:{name:"mobile",c:11,type:X},4:{name:"toll_free",c:11,type:X},5:{name:"premium_rate",c:11,type:X},6:{name:"shared_cost",c:11,type:X},7:{name:"personal_number",c:11,type:X},8:{name:"voip",c:11,type:X},21:{name:"pager",c:11,type:X},25:{name:"uan",c:11,type:X},27:{name:"emergency",c:11,type:X},28:{name:"voicemail",c:11,type:X},29:{name:"short_code",c:11,type:X},30:{name:"standard_rate",c:11,type:X},31:{name:"carrier_specific",c:11,type:X},33:{name:"sms_services",c:11,type:X},24:{name:"no_international_dialling",c:11,type:X},9:{name:"id",required:!0,c:9,type:String},10:{name:"country_code",c:5,type:Number},11:{name:"international_prefix",c:9,type:String},17:{name:"preferred_international_prefix",c:9,type:String},12:{name:"national_prefix",c:9,type:String},13:{name:"preferred_extn_prefix",c:9,type:String},15:{name:"national_prefix_for_parsing",c:9,type:String},16:{name:"national_prefix_transform_rule",c:9,type:String},18:{name:"same_mobile_and_fixed_line_pattern",c:8,defaultValue:!1,type:Boolean},19:{name:"number_format",v:!0,c:11,type:me},20:{name:"intl_number_format",v:!0,c:11,type:me},22:{name:"main_country_for_code",c:8,defaultValue:!1,type:Boolean},23:{name:"leading_digits",c:9,type:String},26:{name:"leading_zero_possible",c:8,defaultValue:!1,type:Boolean}})),h},Ie.j=Ie.prototype.j,Ae.prototype.a=function(h){throw new h.b,Error("Unimplemented")},Ae.prototype.b=function(h,f){if(h.a==11||h.a==10)return f instanceof c?f:this.a(h.i.prototype.j(),f);if(h.a==14){if(typeof f=="string"&&V.test(f)){var m=Number(f);if(0<m)return m}return f}if(!h.h)return f;if(m=h.i,m===String){if(typeof f=="number")return String(f)}else if(m===Number&&typeof f=="string"&&(f==="Infinity"||f==="-Infinity"||f==="NaN"||V.test(f)))return Number(f);return f};var V=/^-?[0-9]+$/;e(U,Ae),U.prototype.a=function(h,f){var m=new h.b;return m.g=this,m.a=f,m.b={},m},e(qe,U),qe.prototype.b=function(h,f){return h.a==8?!!f:Ae.prototype.b.apply(this,arguments)},qe.prototype.a=function(h,f){return qe.M.a.call(this,h,f)};var he={1:"US AG AI AS BB BM BS CA DM DO GD GU JM KN KY LC MP MS PR SX TC TT VC VG VI".split(" ")},ve={AG:[null,[null,null,"(?:268|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}",null,null,null,"2684601234",null,null,null,[7]],[null,null,"268(?:464|7(?:1[3-9]|2\\d|3[246]|64|[78][0-689]))\\d{4}",null,null,null,"2684641234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,"26848[01]\\d{4}",null,null,null,"2684801234",null,null,null,[7]],"AG",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,"26840[69]\\d{4}",null,null,null,"2684061234",null,null,null,[7]],null,"268",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],AI:[null,[null,null,"(?:264|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"2644(?:6[12]|9[78])\\d{4}",null,null,null,"2644612345",null,null,null,[7]],[null,null,"264(?:235|476|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}",null,null,null,"2642351234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"AI",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"264",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],AS:[null,[null,null,"(?:[58]\\d\\d|684|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"6846(?:22|33|44|55|77|88|9[19])\\d{4}",null,null,null,"6846221234",null,null,null,[7]],[null,null,"684(?:2(?:5[2468]|72)|7(?:3[13]|70))\\d{4}",null,null,null,"6847331234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"AS",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"684",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],BB:[null,[null,null,"(?:246|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"246(?:2(?:2[78]|7[0-4])|4(?:1[024-6]|2\\d|3[2-9])|5(?:20|[34]\\d|54|7[1-3])|6(?:2\\d|38)|7[35]7|9(?:1[89]|63))\\d{4}",null,null,null,"2464123456",null,null,null,[7]],[null,null,"246(?:2(?:[356]\\d|4[0-57-9]|8[0-79])|45\\d|69[5-7]|8(?:[2-5]\\d|83))\\d{4}",null,null,null,"2462501234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"(?:246976|900[2-9]\\d\\d)\\d{4}",null,null,null,"9002123456",null,null,null,[7]],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,"24631\\d{5}",null,null,null,"2463101234",null,null,null,[7]],"BB",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"246",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"246(?:292|367|4(?:1[7-9]|3[01]|44|67)|7(?:36|53))\\d{4}",null,null,null,"2464301234",null,null,null,[7]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],BM:[null,[null,null,"(?:441|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"441(?:2(?:02|23|[3479]\\d|61)|[46]\\d\\d|5(?:4\\d|60|89)|824)\\d{4}",null,null,null,"4412345678",null,null,null,[7]],[null,null,"441(?:[37]\\d|5[0-39])\\d{5}",null,null,null,"4413701234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"BM",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"441",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],BS:[null,[null,null,"(?:242|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[347]|8[0-4]|9[2-467])|461|502|6(?:0[1-4]|12|2[013]|[45]0|7[67]|8[78]|9[89])|7(?:02|88))\\d{4}",null,null,null,"2423456789",null,null,null,[7]],[null,null,"242(?:3(?:5[79]|7[56]|95)|4(?:[23][1-9]|4[1-35-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-46-9]|65|77)|6[34]6|7(?:27|38)|8(?:0[1-9]|1[02-9]|2\\d|[89]9))\\d{4}",null,null,null,"2423591234",null,null,null,[7]],[null,null,"(?:242300|8(?:00|33|44|55|66|77|88)[2-9]\\d\\d)\\d{4}",null,null,null,"8002123456",null,null,null,[7]],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"BS",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"242",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"242225[0-46-9]\\d{3}",null,null,null,"2422250123"],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],CA:[null,[null,null,"(?:[2-8]\\d|90)\\d{8}",null,null,null,null,null,null,[10],[7]],[null,null,"(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}",null,null,null,"5062345678",null,null,null,[7]],[null,null,"(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}",null,null,null,"5062345678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"(?:5(?:00|2[12]|33|44|66|77|88)|622)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,"600[2-9]\\d{6}",null,null,null,"6002012345"],"CA",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],DM:[null,[null,null,"(?:[58]\\d\\d|767|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"767(?:2(?:55|66)|4(?:2[01]|4[0-25-9])|50[0-4]|70[1-3])\\d{4}",null,null,null,"7674201234",null,null,null,[7]],[null,null,"767(?:2(?:[2-4689]5|7[5-7])|31[5-7]|61[1-7])\\d{4}",null,null,null,"7672251234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"DM",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"767",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],DO:[null,[null,null,"(?:[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"8(?:[04]9[2-9]\\d\\d|29(?:2(?:[0-59]\\d|6[04-9]|7[0-27]|8[0237-9])|3(?:[0-35-9]\\d|4[7-9])|[45]\\d\\d|6(?:[0-27-9]\\d|[3-5][1-9]|6[0135-8])|7(?:0[013-9]|[1-37]\\d|4[1-35689]|5[1-4689]|6[1-57-9]|8[1-79]|9[1-8])|8(?:0[146-9]|1[0-48]|[248]\\d|3[1-79]|5[01589]|6[013-68]|7[124-8]|9[0-8])|9(?:[0-24]\\d|3[02-46-9]|5[0-79]|60|7[0169]|8[57-9]|9[02-9])))\\d{4}",null,null,null,"8092345678",null,null,null,[7]],[null,null,"8[024]9[2-9]\\d{6}",null,null,null,"8092345678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"DO",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"8[024]9",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],GD:[null,[null,null,"(?:473|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"473(?:2(?:3[0-2]|69)|3(?:2[89]|86)|4(?:[06]8|3[5-9]|4[0-49]|5[5-79]|73|90)|63[68]|7(?:58|84)|800|938)\\d{4}",null,null,null,"4732691234",null,null,null,[7]],[null,null,"473(?:4(?:0[2-79]|1[04-9]|2[0-5]|58)|5(?:2[01]|3[3-8])|901)\\d{4}",null,null,null,"4734031234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"GD",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"473",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],GU:[null,[null,null,"(?:[58]\\d\\d|671|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[0236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[48])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}",null,null,null,"6713001234",null,null,null,[7]],[null,null,"671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[0236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[48])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}",null,null,null,"6713001234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"GU",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"671",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],JM:[null,[null,null,"(?:[58]\\d\\d|658|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"(?:658[2-9]\\d\\d|876(?:5(?:0[12]|1[0-468]|2[35]|63)|6(?:0[1-3579]|1[0237-9]|[23]\\d|40|5[06]|6[2-589]|7[05]|8[04]|9[4-9])|7(?:0[2-689]|[1-6]\\d|8[056]|9[45])|9(?:0[1-8]|1[02378]|[2-8]\\d|9[2-468])))\\d{4}",null,null,null,"8765230123",null,null,null,[7]],[null,null,"876(?:(?:2[14-9]|[348]\\d)\\d|5(?:0[3-9]|[2-57-9]\\d|6[0-24-9])|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579]))\\d{4}",null,null,null,"8762101234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"JM",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"658|876",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],KN:[null,[null,null,"(?:[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"869(?:2(?:29|36)|302|4(?:6[015-9]|70))\\d{4}",null,null,null,"8692361234",null,null,null,[7]],[null,null,"869(?:5(?:5[6-8]|6[5-7])|66\\d|76[02-7])\\d{4}",null,null,null,"8697652917",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"KN",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"869",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],KY:[null,[null,null,"(?:345|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"345(?:2(?:22|44)|444|6(?:23|38|40)|7(?:4[35-79]|6[6-9]|77)|8(?:00|1[45]|25|[48]8)|9(?:14|4[035-9]))\\d{4}",null,null,null,"3452221234",null,null,null,[7]],[null,null,"345(?:32[1-9]|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|9(?:1[67]|2[2-9]|3[689]))\\d{4}",null,null,null,"3453231234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"(?:345976|900[2-9]\\d\\d)\\d{4}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"KY",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,"345849\\d{4}",null,null,null,"3458491234"],null,"345",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],LC:[null,[null,null,"(?:[58]\\d\\d|758|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"758(?:4(?:30|5\\d|6[2-9]|8[0-2])|57[0-2]|638)\\d{4}",null,null,null,"7584305678",null,null,null,[7]],[null,null,"758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2\\d|3[01]))\\d{4}",null,null,null,"7582845678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"LC",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"758",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],MP:[null,[null,null,"(?:[58]\\d\\d|(?:67|90)0)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"670(?:2(?:3[3-7]|56|8[5-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}",null,null,null,"6702345678",null,null,null,[7]],[null,null,"670(?:2(?:3[3-7]|56|8[5-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}",null,null,null,"6702345678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"MP",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"670",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],MS:[null,[null,null,"(?:(?:[58]\\d\\d|900)\\d\\d|66449)\\d{5}",null,null,null,null,null,null,[10],[7]],[null,null,"664491\\d{4}",null,null,null,"6644912345",null,null,null,[7]],[null,null,"66449[2-6]\\d{4}",null,null,null,"6644923456",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"MS",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"664",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],PR:[null,[null,null,"(?:[589]\\d\\d|787)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"(?:787|939)[2-9]\\d{6}",null,null,null,"7872345678",null,null,null,[7]],[null,null,"(?:787|939)[2-9]\\d{6}",null,null,null,"7872345678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"PR",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"787|939",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],SX:[null,[null,null,"(?:(?:[58]\\d\\d|900)\\d|7215)\\d{6}",null,null,null,null,null,null,[10],[7]],[null,null,"7215(?:4[2-8]|8[239]|9[056])\\d{4}",null,null,null,"7215425678",null,null,null,[7]],[null,null,"7215(?:1[02]|2\\d|5[034679]|8[014-8])\\d{4}",null,null,null,"7215205678",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002123456"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002123456"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"SX",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"721",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],TC:[null,[null,null,"(?:[58]\\d\\d|649|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"649(?:712|9(?:4\\d|50))\\d{4}",null,null,null,"6497121234",null,null,null,[7]],[null,null,"649(?:2(?:3[129]|4[1-7])|3(?:3[1-389]|4[1-8])|4[34][1-3])\\d{4}",null,null,null,"6492311234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,"64971[01]\\d{4}",null,null,null,"6497101234",null,null,null,[7]],"TC",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"649",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],TT:[null,[null,null,"(?:[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"868(?:2(?:01|[23]\\d)|6(?:0[7-9]|1[02-8]|2[1-9]|[3-69]\\d|7[0-79])|82[124])\\d{4}",null,null,null,"8682211234",null,null,null,[7]],[null,null,"868(?:2(?:6[6-9]|[7-9]\\d)|[37](?:0[1-9]|1[02-9]|[2-9]\\d)|4[6-9]\\d|6(?:20|78|8\\d))\\d{4}",null,null,null,"8682911234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"TT",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"868",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,"868619\\d{4}",null,null,null,"8686191234",null,null,null,[7]]],US:[null,[null,null,"[2-9]\\d{9}",null,null,null,null,null,null,[10],[7]],[null,null,"(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[0-24679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[017]|6[0-279]|78|8[0-2])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-28]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[0179]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}",null,null,null,"2015550123",null,null,null,[7]],[null,null,"(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[0-24679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[017]|6[0-279]|78|8[0-2])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-28]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[0179]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}",null,null,null,"2015550123",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"US",1,"011","1",null,null,"1",null,null,1,[[null,"(\\d{3})(\\d{4})","$1-$2",["[2-9]"]],[null,"(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],null,null,1]],[[null,"(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[2-9]"]]],[null,null,null,null,null,null,null,null,null,[-1]],1,null,[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"710[2-9]\\d{6}",null,null,null,"7102123456"],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],VC:[null,[null,null,"(?:[58]\\d\\d|784|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"784(?:266|3(?:6[6-9]|7\\d|8[0-24-6])|4(?:38|5[0-36-8]|8[0-8])|5(?:55|7[0-2]|93)|638|784)\\d{4}",null,null,null,"7842661234",null,null,null,[7]],[null,null,"784(?:4(?:3[0-5]|5[45]|89|9[0-8])|5(?:2[6-9]|3[0-4]))\\d{4}",null,null,null,"7844301234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"VC",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"784",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],VG:[null,[null,null,"(?:284|[58]\\d\\d|900)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"284(?:(?:229|774|8(?:52|6[459]))\\d|4(?:22\\d|9(?:[45]\\d|6[0-5])))\\d{3}",null,null,null,"2842291234",null,null,null,[7]],[null,null,"284(?:(?:3(?:0[0-3]|4[0-7]|68|9[34])|54[0-57])\\d|4(?:(?:4[0-6]|68)\\d|9(?:6[6-9]|9\\d)))\\d{3}",null,null,null,"2843001234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"VG",1,"011","1",null,null,"1",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"284",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],VI:[null,[null,null,"(?:(?:34|90)0|[58]\\d\\d)\\d{7}",null,null,null,null,null,null,[10],[7]],[null,null,"340(?:2(?:01|2[06-8]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-57-9]|27|7\\d)|884|998)\\d{4}",null,null,null,"3406421234",null,null,null,[7]],[null,null,"340(?:2(?:01|2[06-8]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-57-9]|27|7\\d)|884|998)\\d{4}",null,null,null,"3406421234",null,null,null,[7]],[null,null,"8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",null,null,null,"8002345678"],[null,null,"900[2-9]\\d{6}",null,null,null,"9002345678"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}",null,null,null,"5002345678"],[null,null,null,null,null,null,null,null,null,[-1]],"VI",1,"011","1",null,null,"1",null,null,1,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"340",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]]};xe.b=function(){return xe.a?xe.a:xe.a=new xe};var ct={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"},Ht=RegExp("[++]+"),vt=RegExp("([0-90-9٠-٩۰-۹])"),bt=/^\(?\$1\)?$/,wt=new Ie;Z(wt,11,"NA");var Ci=/\[([^\[\]])*\]/g,pr=/\d(?=[^,}][^,}])/g,Ei=RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)+$"),fr=/[- ]/;ee.prototype.K=function(){this.C="",r(this.i),r(this.u),r(this.m),this.s=0,this.w="",r(this.b),this.h="",r(this.a),this.l=!0,this.A=this.o=this.F=!1,this.f=[],this.B=!1,this.g!=this.J&&(this.g=Qe(this,this.D))},ee.prototype.L=function(h){return this.C=y(this,h)},n("Cleave.AsYouTypeFormatter",ee),n("Cleave.AsYouTypeFormatter.prototype.inputDigit",ee.prototype.L),n("Cleave.AsYouTypeFormatter.prototype.clear",ee.prototype.K)}).call(typeof Fi=="object"&&Fi?Fi:window);var od=Object.defineProperty,ud=Object.getOwnPropertyDescriptor,Wi=(n,e,t,r)=>{for(var i=r>1?void 0:r?ud(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&od(e,t,i),i};const cd=Zr.object({firstName:Zr.string().min(1,{message:"First name is required"}),lastName:Zr.string().min(1,{message:"Last name is required"}),email:Zr.string().email({message:"Invalid email address"}),phone:Zr.string().regex(/^(1-)?\d{3}-\d{3}-\d{4}$/,{message:"Invalid phone number"}).transform(n=>n.replace(/-/g,"").replace(/^1/,""))});let Yn=class extends Un{constructor(){super(...arguments),this.params={firstName:"",lastName:"",email:"",phone:""},this.errors=[]}firstUpdated(){this.phoneCleave=new ju(this.phoneInput,{phone:!0,phoneRegionCode:"US",delimiter:"-"})}submit(n){n.preventDefault();try{this.params=cd.parse(this.params)}catch(e){this.errors=e.errors;return}this.dispatchEvent(new CustomEvent("submit",{composed:!0,detail:this.params}))}cancel(){this.dispatchEvent(new CustomEvent("cancel"))}updateField(n,e){this.params={...this.params,[n]:e}}render(){return Ri`
|
|
44
44
|
<div>
|
|
45
45
|
<iai-chat-message-assistant
|
|
46
46
|
content="Your contact information is required to transfer to a live agent."
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
150
150
|
*/const Xi=globalThis,es=Xi.trustedTypes,Va=es?es.createPolicy("lit-html",{createHTML:n=>n}):void 0,Ba="$lit$",Qt=`lit$${(Math.random()+"").slice(9)}$`,Fa="?"+Qt,Pd=`<${Fa}>`,wn=document,Vr=()=>wn.createComment(""),Br=n=>n===null||typeof n!="object"&&typeof n!="function",Wa=Array.isArray,Rd=n=>Wa(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",tl=`[
|
|
151
151
|
\f\r]`,Fr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,qa=/-->/g,Ka=/>/g,_n=RegExp(`>|${tl}(?:([^\\s"'>=/]+)(${tl}*=${tl}*(?:[^
|
|
152
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ya=/'/g,Ga=/"/g,Ja=/^(?:script|style|textarea|title)$/i,Dd=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),
|
|
152
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ya=/'/g,Ga=/"/g,Ja=/^(?:script|style|textarea|title)$/i,Dd=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),se=Dd(1),Xn=Symbol.for("lit-noChange"),Be=Symbol.for("lit-nothing"),Qa=new WeakMap,xn=wn.createTreeWalker(wn,129);function Xa(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Va!==void 0?Va.createHTML(e):e}const jd=(n,e)=>{const t=n.length-1,r=[];let i,s=e===2?"<svg>":"",l=Fr;for(let a=0;a<t;a++){const o=n[a];let u,c,p=-1,d=0;for(;d<o.length&&(l.lastIndex=d,c=l.exec(o),c!==null);)d=l.lastIndex,l===Fr?c[1]==="!--"?l=qa:c[1]!==void 0?l=Ka:c[2]!==void 0?(Ja.test(c[2])&&(i=RegExp("</"+c[2],"g")),l=_n):c[3]!==void 0&&(l=_n):l===_n?c[0]===">"?(l=i??Fr,p=-1):c[1]===void 0?p=-2:(p=l.lastIndex-c[2].length,u=c[1],l=c[3]===void 0?_n:c[3]==='"'?Ga:Ya):l===Ga||l===Ya?l=_n:l===qa||l===Ka?l=Fr:(l=_n,i=void 0);const g=l===_n&&n[a+1].startsWith("/>")?" ":"";s+=l===Fr?o+Pd:p>=0?(r.push(u),o.slice(0,p)+Ba+o.slice(p)+Qt+g):o+Qt+(p===-2?a:g)}return[Xa(n,s+(n[t]||"<?>")+(e===2?"</svg>":"")),r]};let nl=class Su{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let s=0,l=0;const a=e.length-1,o=this.parts,[u,c]=jd(e,t);if(this.el=Su.createElement(u,r),xn.currentNode=this.el.content,t===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(i=xn.nextNode())!==null&&o.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const p of i.getAttributeNames())if(p.endsWith(Ba)){const d=c[l++],g=i.getAttribute(p).split(Qt),x=/([.?@])?(.*)/.exec(d);o.push({type:1,index:s,name:x[2],strings:g,ctor:x[1]==="."?Zd:x[1]==="?"?zd:x[1]==="@"?Hd:ts}),i.removeAttribute(p)}else p.startsWith(Qt)&&(o.push({type:6,index:s}),i.removeAttribute(p));if(Ja.test(i.tagName)){const p=i.textContent.split(Qt),d=p.length-1;if(d>0){i.textContent=es?es.emptyScript:"";for(let g=0;g<d;g++)i.append(p[g],Vr()),xn.nextNode(),o.push({type:2,index:++s});i.append(p[d],Vr())}}}else if(i.nodeType===8)if(i.data===Fa)o.push({type:2,index:s});else{let p=-1;for(;(p=i.data.indexOf(Qt,p+1))!==-1;)o.push({type:7,index:s}),p+=Qt.length-1}s++}}static createElement(e,t){const r=wn.createElement("template");return r.innerHTML=e,r}};function er(n,e,t=n,r){var i,s;if(e===Xn)return e;let l=r!==void 0?(i=t._$Co)==null?void 0:i[r]:t._$Cl;const a=Br(e)?void 0:e._$litDirective$;return(l==null?void 0:l.constructor)!==a&&((s=l==null?void 0:l._$AO)==null||s.call(l,!1),a===void 0?l=void 0:(l=new a(n),l._$AT(n,t,r)),r!==void 0?(t._$Co??(t._$Co=[]))[r]=l:t._$Cl=l),l!==void 0&&(e=er(n,l._$AS(n,e.values),l,r)),e}let Ld=class{constructor(n,e){this._$AV=[],this._$AN=void 0,this._$AD=n,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(n){const{el:{content:e},parts:t}=this._$AD,r=((n==null?void 0:n.creationScope)??wn).importNode(e,!0);xn.currentNode=r;let i=xn.nextNode(),s=0,l=0,a=t[0];for(;a!==void 0;){if(s===a.index){let o;a.type===2?o=new rl(i,i.nextSibling,this,n):a.type===1?o=new a.ctor(i,a.name,a.strings,this,n):a.type===6&&(o=new Ud(i,this,n)),this._$AV.push(o),a=t[++l]}s!==(a==null?void 0:a.index)&&(i=xn.nextNode(),s++)}return xn.currentNode=wn,r}p(n){let e=0;for(const t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(n,t,e),e+=t.strings.length-2):t._$AI(n[e])),e++}},rl=class Tu{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=Be,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=er(this,e,t),Br(e)?e===Be||e==null||e===""?(this._$AH!==Be&&this._$AR(),this._$AH=Be):e!==this._$AH&&e!==Xn&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Rd(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==Be&&Br(this._$AH)?this._$AA.nextSibling.data=e:this.T(wn.createTextNode(e)),this._$AH=e}$(e){var t;const{values:r,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=nl.createElement(Xa(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)==null?void 0:t._$AD)===s)this._$AH.p(r);else{const l=new Ld(s,this),a=l.u(this.options);l.p(r),this.T(a),this._$AH=l}}_$AC(e){let t=Qa.get(e.strings);return t===void 0&&Qa.set(e.strings,t=new nl(e)),t}k(e){Wa(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,i=0;for(const s of e)i===t.length?t.push(r=new Tu(this.S(Vr()),this.S(Vr()),this,this.options)):r=t[i],r._$AI(s),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},ts=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(n,e,t,r,i){this.type=1,this._$AH=Be,this._$AN=void 0,this.element=n,this.name=e,this._$AM=r,this.options=i,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=Be}_$AI(n,e=this,t,r){const i=this.strings;let s=!1;if(i===void 0)n=er(this,n,e,0),s=!Br(n)||n!==this._$AH&&n!==Xn,s&&(this._$AH=n);else{const l=n;let a,o;for(n=i[0],a=0;a<i.length-1;a++)o=er(this,l[t+a],e,a),o===Xn&&(o=this._$AH[a]),s||(s=!Br(o)||o!==this._$AH[a]),o===Be?n=Be:n!==Be&&(n+=(o??"")+i[a+1]),this._$AH[a]=o}s&&!r&&this.j(n)}j(n){n===Be?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,n??"")}},Zd=class extends ts{constructor(){super(...arguments),this.type=3}j(n){this.element[this.name]=n===Be?void 0:n}},zd=class extends ts{constructor(){super(...arguments),this.type=4}j(n){this.element.toggleAttribute(this.name,!!n&&n!==Be)}},Hd=class extends ts{constructor(n,e,t,r,i){super(n,e,t,r,i),this.type=5}_$AI(n,e=this){if((n=er(this,n,e,0)??Be)===Xn)return;const t=this._$AH,r=n===Be&&t!==Be||n.capture!==t.capture||n.once!==t.once||n.passive!==t.passive,i=n!==Be&&(t===Be||r);r&&this.element.removeEventListener(this.name,this,t),i&&this.element.addEventListener(this.name,this,n),this._$AH=n}handleEvent(n){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,n):this._$AH.handleEvent(n)}},Ud=class{constructor(n,e,t){this.element=n,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(n){er(this,n)}};const eo=Xi.litHtmlPolyfillSupport;eo==null||eo(nl,rl),(Xi.litHtmlVersions??(Xi.litHtmlVersions=[])).push("3.1.2");const Vd=(n,e,t)=>{const r=(t==null?void 0:t.renderBefore)??e;let i=r._$litPart$;if(i===void 0){const s=(t==null?void 0:t.renderBefore)??null;r._$litPart$=i=new rl(e.insertBefore(Vr(),s),s,void 0,t??{})}return i._$AI(n),i};/**
|
|
153
153
|
* @license
|
|
154
154
|
* Copyright 2017 Google LLC
|
|
155
155
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
* @license
|
|
192
192
|
* Copyright 2017 Google LLC
|
|
193
193
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
194
|
-
*/const xo=(n,e,t)=>{const r=new Map;for(let i=e;i<=t;i++)r.set(n[i],i);return r},ul=Gd(class extends Jd{constructor(n){if(super(n),n.type!==Yd.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);const i=[],s=[];let l=0;for(const a of n)i[l]=r?r(a,l):l,s[l]=t(a,l),l++;return{values:s,keys:i}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,r]){const i=th(n),{values:s,keys:l}=this.dt(e,t,r);if(!Array.isArray(i))return this.ut=l,s;const a=this.ut??(this.ut=[]),o=[];let u,c,p=0,d=i.length-1,g=0,x=s.length-1;for(;p<=d&&g<=x;)if(i[p]===null)p++;else if(i[d]===null)d--;else if(a[p]===l[g])o[g]=Cn(i[p],s[g]),p++,g++;else if(a[d]===l[x])o[x]=Cn(i[d],s[x]),d--,x--;else if(a[p]===l[x])o[x]=Cn(i[p],s[x]),Gr(n,o[x+1],i[p]),p++,x--;else if(a[d]===l[g])o[g]=Cn(i[d],s[g]),Gr(n,i[p],i[d]),d--,g++;else if(u===void 0&&(u=xo(l,g,x),c=xo(a,p,d)),u.has(a[p]))if(u.has(a[d])){const j=c.get(l[g]),Z=j!==void 0?i[j]:null;if(Z===null){const de=Gr(n,i[p]);Cn(de,s[g]),o[g]=de}else o[g]=Cn(Z,s[g]),Gr(n,i[p],Z),i[j]=null;g++}else ol(i[d]),d--;else ol(i[p]),p++;for(;g<=x;){const j=Gr(n,o[x+1]);Cn(j,s[g]),o[g++]=j}for(;p<=d;){const j=i[p++];j!==null&&ol(j)}return this.ut=l,eh(n,o),tr}}),Tt=Pt`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: \"\"}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-\\[-1px\\]{bottom:-1px}.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-12{top:3rem}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.m-0{margin:0}.m-0\\.5{margin:.125rem}.m-2{margin:.5rem}.m-4{margin:1rem}.m-8{margin:2rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-8{margin-left:2rem;margin-right:2rem}.mx-auto{margin-left:auto;margin-right:auto}.my-auto{margin-top:auto;margin-bottom:auto}.mb-1{margin-bottom:.25rem}.mb-\\[-8px\\]{margin-bottom:-8px}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-20{margin-left:5rem}.mr-2{margin-right:.5rem}.mr-20{margin-right:5rem}.mt-1{margin-top:.25rem}.mt-4{margin-top:1rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.hidden{display:none}.h-0{height:0px}.h-12{height:3rem}.h-2{height:.5rem}.h-2\\.5{height:.625rem}.h-3\\/5{height:60%}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-9{height:2.25rem}.h-dvh{height:100dvh}.h-full{height:100%}.max-h-20{max-height:5rem}.max-h-\\[90vh\\]{max-height:90vh}.w-0{width:0px}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-3\\/5{width:60%}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-9{width:2.25rem}.w-dvw{width:100dvw}.max-w-\\[350px\\]{max-width:350px}.max-w-\\[90vw\\]{max-width:90vw}.flex-1{flex:1 1 0%}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness: mandatory}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-x-8{border-left-width:8px;border-right-width:8px}.border-t-8{border-top-width:8px}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.border-x-transparent{border-left-color:transparent;border-right-color:transparent}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.p-0{padding:0}.p-2{padding:.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pb-2{padding-bottom:.5rem}.pl-3{padding-left:.75rem}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.text-center{text-align:center}.text-right{text-align:right}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-semibold{font-weight:600}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:host{font-size:16px;line-height:1.2;text-align:left;--iai-chat-i-primary-color: var(--iai-chat-primary-color, #0B64F4);--iai-chat-i-text-color: var(--iai-chat-text-color, #FFF);--iai-chat-i-link-color: var(--iai-chat-link-color, var(--iai-chat-i-primary-color));--iai-chat-i-header-bg: var(--iai-chat-header-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-header-fg: var(--iai-chat-header-text-color, var(--iai-chat-i-text-color));--iai-chat-i-button-bg: var(--iai-chat-button-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-button-fg: var(--iai-chat-button-text-color, var(--iai-chat-i-text-color));--iai-chat-i-message-user-bg: var(--iai-chat-messages-user-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-message-user-fg: var(--iai-chat-messages-user-text-color, var(--iai-chat-i-text-color));--iai-chat-i-message-assistant-bg: var(--iai-chat-messages-assistant-background-color, #6B7280);--iai-chat-i-message-assistant-fg: var(--iai-chat-messages-assistant-text-color, var(--iai-chat-i-text-color));--iai-chat-i-message-assistant-rating-active: var(--iai-chat-messages-assistant-rating-active-color, var(--iai-chat-i-primary-color));--iai-chat-i-ocb-bg: var(--iai-chat-open-chat-button-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-ocb-fg: var(--iai-chat-open-chat-button-icon-color, var(--iai-chat-i-text-color));--iai-chat-i-iframe-modal-header-bg: var(--iai-chat-iframe-modal-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-iframe-modal-header-fg: var(--iai-chat-iframe-modal-text-color, var(--iai-chat-i-text-color))}h1{font-size:1.5em}h2{font-size:1.17em}h3{font-size:1em}ol,ul{display:flex;flex-direction:column;padding:0;margin-left:20px;gap:8px}ol{list-style-type:decimal}a{color:var(--iai-chat-i-link-color);text-decoration:underline}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.disabled\\:bg-gray-200:disabled{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.disabled\\:opacity-50:disabled{opacity:.5}@media (min-width: 768px){.md\\:mx-8{margin-left:2rem;margin-right:2rem}.md\\:block{display:block}.md\\:h-\\[400px\\]{height:400px}.md\\:h-\\[500px\\]{height:500px}.md\\:h-\\[600px\\]{height:600px}.md\\:h-\\[700px\\]{height:700px}.md\\:h-\\[800px\\]{height:800px}.md\\:w-\\[1200px\\]{width:1200px}.md\\:w-\\[350px\\]{width:350px}.md\\:w-\\[500px\\]{width:500px}.md\\:w-\\[760px\\]{width:760px}.md\\:w-\\[900px\\]{width:900px}}`;var nh=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,ls=(n,e,t,r)=>{for(var i=r>1?void 0:r?rh(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&nh(e,t,i),i};let nr=class extends it{constructor(){super(...arguments),this.activeIndex=0,this.items=[]}render(){return ie`
|
|
194
|
+
*/const xo=(n,e,t)=>{const r=new Map;for(let i=e;i<=t;i++)r.set(n[i],i);return r},ul=Gd(class extends Jd{constructor(n){if(super(n),n.type!==Yd.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);const i=[],s=[];let l=0;for(const a of n)i[l]=r?r(a,l):l,s[l]=t(a,l),l++;return{values:s,keys:i}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,r]){const i=th(n),{values:s,keys:l}=this.dt(e,t,r);if(!Array.isArray(i))return this.ut=l,s;const a=this.ut??(this.ut=[]),o=[];let u,c,p=0,d=i.length-1,g=0,x=s.length-1;for(;p<=d&&g<=x;)if(i[p]===null)p++;else if(i[d]===null)d--;else if(a[p]===l[g])o[g]=Cn(i[p],s[g]),p++,g++;else if(a[d]===l[x])o[x]=Cn(i[d],s[x]),d--,x--;else if(a[p]===l[x])o[x]=Cn(i[p],s[x]),Gr(n,o[x+1],i[p]),p++,x--;else if(a[d]===l[g])o[g]=Cn(i[d],s[g]),Gr(n,i[p],i[d]),d--,g++;else if(u===void 0&&(u=xo(l,g,x),c=xo(a,p,d)),u.has(a[p]))if(u.has(a[d])){const j=c.get(l[g]),Z=j!==void 0?i[j]:null;if(Z===null){const de=Gr(n,i[p]);Cn(de,s[g]),o[g]=de}else o[g]=Cn(Z,s[g]),Gr(n,i[p],Z),i[j]=null;g++}else ol(i[d]),d--;else ol(i[p]),p++;for(;g<=x;){const j=Gr(n,o[x+1]);Cn(j,s[g]),o[g++]=j}for(;p<=d;){const j=i[p++];j!==null&&ol(j)}return this.ut=l,eh(n,o),tr}}),Tt=Pt`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: \"\"}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.invisible{visibility:hidden}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-\\[-1px\\]{bottom:-1px}.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-12{top:3rem}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.m-0{margin:0}.m-0\\.5{margin:.125rem}.m-2{margin:.5rem}.m-4{margin:1rem}.m-8{margin:2rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-8{margin-left:2rem;margin-right:2rem}.mx-auto{margin-left:auto;margin-right:auto}.my-auto{margin-top:auto;margin-bottom:auto}.mb-1{margin-bottom:.25rem}.mb-\\[-8px\\]{margin-bottom:-8px}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-20{margin-left:5rem}.mr-2{margin-right:.5rem}.mr-20{margin-right:5rem}.mt-1{margin-top:.25rem}.mt-4{margin-top:1rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.hidden{display:none}.h-0{height:0px}.h-12{height:3rem}.h-2{height:.5rem}.h-2\\.5{height:.625rem}.h-3\\/5{height:60%}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-9{height:2.25rem}.h-dvh{height:100dvh}.h-full{height:100%}.max-h-20{max-height:5rem}.max-h-\\[90vh\\]{max-height:90vh}.w-0{width:0px}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-3\\/5{width:60%}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-9{width:2.25rem}.w-dvw{width:100dvw}.max-w-\\[350px\\]{max-width:350px}.max-w-\\[90vw\\]{max-width:90vw}.flex-1{flex:1 1 0%}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize{resize:both}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness: mandatory}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-x-8{border-left-width:8px;border-right-width:8px}.border-t-8{border-top-width:8px}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity))}.border-x-transparent{border-left-color:transparent;border-right-color:transparent}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity: .5}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.p-0{padding:0}.p-2{padding:.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pb-2{padding-bottom:.5rem}.pl-3{padding-left:.75rem}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.text-center{text-align:center}.text-right{text-align:right}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-semibold{font-weight:600}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:host{font-size:16px;line-height:1.2;text-align:left;--iai-chat-i-primary-color: var(--iai-chat-primary-color, #0B64F4);--iai-chat-i-text-color: var(--iai-chat-text-color, #FFF);--iai-chat-i-link-color: var(--iai-chat-link-color, var(--iai-chat-i-primary-color));--iai-chat-i-header-bg: var(--iai-chat-header-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-header-fg: var(--iai-chat-header-text-color, var(--iai-chat-i-text-color));--iai-chat-i-button-bg: var(--iai-chat-button-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-button-fg: var(--iai-chat-button-text-color, var(--iai-chat-i-text-color));--iai-chat-i-message-user-bg: var(--iai-chat-messages-user-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-message-user-fg: var(--iai-chat-messages-user-text-color, var(--iai-chat-i-text-color));--iai-chat-i-message-assistant-bg: var(--iai-chat-messages-assistant-background-color, #6B7280);--iai-chat-i-message-assistant-fg: var(--iai-chat-messages-assistant-text-color, var(--iai-chat-i-text-color));--iai-chat-i-message-assistant-rating-active: var(--iai-chat-messages-assistant-rating-active-color, var(--iai-chat-i-primary-color));--iai-chat-i-ocb-bg: var(--iai-chat-open-chat-button-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-ocb-fg: var(--iai-chat-open-chat-button-icon-color, var(--iai-chat-i-text-color));--iai-chat-i-iframe-modal-header-bg: var(--iai-chat-iframe-modal-background-color, var(--iai-chat-i-primary-color));--iai-chat-i-iframe-modal-header-fg: var(--iai-chat-iframe-modal-text-color, var(--iai-chat-i-text-color))}h1{font-size:1.5em}h2{font-size:1.17em}h3{font-size:1em}ol,ul{display:flex;flex-direction:column;padding:0;margin-left:20px;gap:8px}ol{list-style-type:decimal}a{color:var(--iai-chat-i-link-color);text-decoration:underline}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.disabled\\:bg-gray-200:disabled{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.disabled\\:opacity-50:disabled{opacity:.5}@media (min-width: 768px){.md\\:mx-8{margin-left:2rem;margin-right:2rem}.md\\:block{display:block}.md\\:h-\\[400px\\]{height:400px}.md\\:h-\\[500px\\]{height:500px}.md\\:h-\\[600px\\]{height:600px}.md\\:h-\\[700px\\]{height:700px}.md\\:h-\\[800px\\]{height:800px}.md\\:w-\\[1200px\\]{width:1200px}.md\\:w-\\[350px\\]{width:350px}.md\\:w-\\[500px\\]{width:500px}.md\\:w-\\[760px\\]{width:760px}.md\\:w-\\[900px\\]{width:900px}}`;var nh=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,ls=(n,e,t,r)=>{for(var i=r>1?void 0:r?rh(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&nh(e,t,i),i};let nr=class extends it{constructor(){super(...arguments),this.activeIndex=0,this.items=[]}render(){return se`
|
|
195
195
|
<div>
|
|
196
196
|
<div
|
|
197
197
|
id="carousel"
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
</button>
|
|
218
218
|
|
|
219
219
|
<div class="flex justify-center space-x-2">
|
|
220
|
-
${ul(this.items,(n,e)=>e,(n,e)=>
|
|
220
|
+
${ul(this.items,(n,e)=>e,(n,e)=>se`
|
|
221
221
|
<span
|
|
222
222
|
class="h-2.5 w-2.5 bg-gray-400 rounded-full inline-block ${this.activeIndex===e?"bg-gray-600":""}"
|
|
223
223
|
@click=${()=>this.scrollToIndex(e)}
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
* @license
|
|
259
259
|
* Copyright 2018 Google LLC
|
|
260
260
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
261
|
-
*/const ko="important",ih=" !"+ko,Jr=dl(class extends hl{constructor(n){var e;if(super(n),n.type!==cl.ATTRIBUTE||n.name!=="style"||((e=n.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];return r==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(n,[e]){const{style:t}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const r of this.ft)e[r]==null&&(this.ft.delete(r),r.includes("-")?t.removeProperty(r):t[r]=null);for(const r in e){const i=e[r];if(i!=null){this.ft.add(r);const s=typeof i=="string"&&i.endsWith(ih);r.includes("-")||s?t.setProperty(r,s?i.slice(0,-11):i,s?ko:""):t[r]=i}}return Jt}}),pl=
|
|
261
|
+
*/const ko="important",ih=" !"+ko,Jr=dl(class extends hl{constructor(n){var e;if(super(n),n.type!==cl.ATTRIBUTE||n.name!=="style"||((e=n.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];return r==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(n,[e]){const{style:t}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const r of this.ft)e[r]==null&&(this.ft.delete(r),r.includes("-")?t.removeProperty(r):t[r]=null);for(const r in e){const i=e[r];if(i!=null){this.ft.add(r);const s=typeof i=="string"&&i.endsWith(ih);r.includes("-")||s?t.setProperty(r,s?i.slice(0,-11):i,s?ko:""):t[r]=i}}return Jt}}),pl=se`
|
|
262
262
|
<svg
|
|
263
263
|
xmlns="http://www.w3.org/2000/svg"
|
|
264
264
|
viewBox="0 0 24 24"
|
|
@@ -270,7 +270,7 @@
|
|
|
270
270
|
<path
|
|
271
271
|
d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"/>
|
|
272
272
|
</svg>
|
|
273
|
-
`,sh=
|
|
273
|
+
`,sh=se`
|
|
274
274
|
<svg
|
|
275
275
|
xmlns="http://www.w3.org/2000/svg"
|
|
276
276
|
viewBox="0 0 24 24"
|
|
@@ -282,7 +282,7 @@
|
|
|
282
282
|
<path
|
|
283
283
|
d="M12,3C17.5,3 22,6.58 22,11C22,15.42 17.5,19 12,19C10.76,19 9.57,18.82 8.47,18.5C5.55,21 2,21 2,21C4.33,18.67 4.7,17.1 4.75,16.5C3.05,15.07 2,13.13 2,11C2,6.58 6.5,3 12,3Z"/>
|
|
284
284
|
</svg>
|
|
285
|
-
`,lh=
|
|
285
|
+
`,lh=se`
|
|
286
286
|
<svg
|
|
287
287
|
xmlns="http://www.w3.org/2000/svg"
|
|
288
288
|
viewBox="0 0 24 24"
|
|
@@ -293,7 +293,7 @@
|
|
|
293
293
|
<title>send</title>
|
|
294
294
|
<path d="M2,21L23,12L2,3V10L17,12L2,14V21Z"/>
|
|
295
295
|
</svg>
|
|
296
|
-
`,ah=
|
|
296
|
+
`,ah=se`
|
|
297
297
|
<svg
|
|
298
298
|
xmlns="http://www.w3.org/2000/svg"
|
|
299
299
|
viewBox="0 0 24 24"
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
<title>refresh</title>
|
|
305
305
|
<path d="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z" />
|
|
306
306
|
</svg>
|
|
307
|
-
`,oh=
|
|
307
|
+
`,oh=se`
|
|
308
308
|
<svg
|
|
309
309
|
xmlns="http://www.w3.org/2000/svg"
|
|
310
310
|
viewBox="0 0 24 24"
|
|
@@ -315,7 +315,7 @@
|
|
|
315
315
|
<title>minus</title>
|
|
316
316
|
<path d="M19,13H5V11H19V13Z" />
|
|
317
317
|
</svg>
|
|
318
|
-
`,uh=
|
|
318
|
+
`,uh=se`
|
|
319
319
|
<svg
|
|
320
320
|
xmlns="http://www.w3.org/2000/svg"
|
|
321
321
|
viewBox="0 0 24 24"
|
|
@@ -326,7 +326,7 @@
|
|
|
326
326
|
<title>thumb-up</title>
|
|
327
327
|
<path d="M23,10C23,8.89 22.1,8 21,8H14.68L15.64,3.43C15.66,3.33 15.67,3.22 15.67,3.11C15.67,2.7 15.5,2.32 15.23,2.05L14.17,1L7.59,7.58C7.22,7.95 7,8.45 7,9V19A2,2 0 0,0 9,21H18C18.83,21 19.54,20.5 19.84,19.78L22.86,12.73C22.95,12.5 23,12.26 23,12V10M1,21H5V9H1V21Z" />
|
|
328
328
|
</svg>
|
|
329
|
-
`,ch=
|
|
329
|
+
`,ch=se`
|
|
330
330
|
<svg
|
|
331
331
|
xmlns="http://www.w3.org/2000/svg"
|
|
332
332
|
viewBox="0 0 24 24"
|
|
@@ -337,7 +337,7 @@
|
|
|
337
337
|
<title>thumb-down</title>
|
|
338
338
|
<path d="M19,15H23V3H19M15,3H6C5.17,3 4.46,3.5 4.16,4.22L1.14,11.27C1.05,11.5 1,11.74 1,12V14A2,2 0 0,0 3,16H9.31L8.36,20.57C8.34,20.67 8.33,20.77 8.33,20.88C8.33,21.3 8.5,21.67 8.77,21.94L9.83,23L16.41,16.41C16.78,16.05 17,15.55 17,15V5C17,3.89 16.1,3 15,3Z" />
|
|
339
339
|
</svg>
|
|
340
|
-
`,dh=
|
|
340
|
+
`,dh=se`
|
|
341
341
|
<svg
|
|
342
342
|
xmlns="http://www.w3.org/2000/svg"
|
|
343
343
|
viewBox="0 0 24 24"
|
|
@@ -348,7 +348,7 @@
|
|
|
348
348
|
<title>thumb-up-outline</title>
|
|
349
349
|
<path d="M5,9V21H1V9H5M9,21A2,2 0 0,1 7,19V9C7,8.45 7.22,7.95 7.59,7.59L14.17,1L15.23,2.06C15.5,2.33 15.67,2.7 15.67,3.11L15.64,3.43L14.69,8H21C22.11,8 23,8.9 23,10V12C23,12.26 22.95,12.5 22.86,12.73L19.84,19.78C19.54,20.5 18.83,21 18,21H9M9,19H18.03L21,12V10H12.21L13.34,4.68L9,9.03V19Z" />
|
|
350
350
|
</svg>
|
|
351
|
-
`,hh=
|
|
351
|
+
`,hh=se`
|
|
352
352
|
<svg
|
|
353
353
|
xmlns="http://www.w3.org/2000/svg"
|
|
354
354
|
viewBox="0 0 24 24"
|
|
@@ -359,7 +359,7 @@
|
|
|
359
359
|
<title>thumb-down-outline</title>
|
|
360
360
|
<path d="M19,15V3H23V15H19M15,3A2,2 0 0,1 17,5V15C17,15.55 16.78,16.05 16.41,16.41L9.83,23L8.77,21.94C8.5,21.67 8.33,21.3 8.33,20.88L8.36,20.57L9.31,16H3C1.89,16 1,15.1 1,14V12C1,11.74 1.05,11.5 1.14,11.27L4.16,4.22C4.46,3.5 5.17,3 6,3H15M15,5H5.97L3,12V14H11.78L10.65,19.32L15,14.97V5Z" />
|
|
361
361
|
</svg>
|
|
362
|
-
`;var ph=Object.defineProperty,fh=Object.getOwnPropertyDescriptor,fl=(n,e,t,r)=>{for(var i=r>1?void 0:r?fh(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&ph(e,t,i),i};let Qr=class extends it{constructor(){super(...arguments),this.message="",this.pointerPosition="right"}render(){return
|
|
362
|
+
`;var ph=Object.defineProperty,fh=Object.getOwnPropertyDescriptor,fl=(n,e,t,r)=>{for(var i=r>1?void 0:r?fh(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&ph(e,t,i),i};let Qr=class extends it{constructor(){super(...arguments),this.message="",this.pointerPosition="right"}render(){return se`
|
|
363
363
|
<div class="relative rounded-lg p-5 shadow-md bg-white text-black max-w-[350px]">
|
|
364
364
|
<button
|
|
365
365
|
class="absolute top-0 right-0 w-5 h-5 m-0.5"
|
|
@@ -385,7 +385,7 @@
|
|
|
385
385
|
* @license
|
|
386
386
|
* Copyright 2021 Google LLC
|
|
387
387
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
388
|
-
*/function Dt(n,e,t){return n?e(n):t==null?void 0:t(n)}const yl="-",kh=n=>{const e=Ah(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:i=>{const s=i.split(yl);return s[0]===""&&s.length!==1&&s.shift(),Co(s,e)||$h(i)},getConflictingClassGroupIds:(i,s)=>{const l=t[i]||[];return s&&r[i]?[...l,...r[i]]:l}}},Co=(n,e)=>{var t;if(n.length===0)return e.classGroupId;const r=n[0],i=e.nextPart.get(r),s=i?Co(n.slice(1),i):void 0;if(s)return s;if(e.validators.length===0)return;const l=n.join(yl);return(t=e.validators.find(({validator:a})=>a(l)))==null?void 0:t.classGroupId},Eo=/^\[(.+)\]$/,$h=n=>{if(Eo.test(n)){const e=Eo.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},Ah=n=>{const{theme:e,prefix:t}=n,r={nextPart:new Map,validators:[]};return Th(Object.entries(n.classGroups),t).forEach(([i,s])=>{vl(s,r,i,e)}),r},vl=(n,e,t,r)=>{n.forEach(i=>{if(typeof i=="string"){const s=i===""?e:Mo(e,i);s.classGroupId=t;return}if(typeof i=="function"){if(Sh(i)){vl(i(r),e,t,r);return}e.validators.push({validator:i,classGroupId:t});return}Object.entries(i).forEach(([s,l])=>{vl(l,Mo(e,s),t,r)})})},Mo=(n,e)=>{let t=n;return e.split(yl).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t},Sh=n=>n.isThemeGetter,Th=(n,e)=>e?n.map(([t,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([l,a])=>[e+l,a])):s);return[t,i]}):n,Ch=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;const i=(s,l)=>{t.set(s,l),e++,e>n&&(e=0,r=t,t=new Map)};return{get(s){let l=t.get(s);if(l!==void 0)return l;if((l=r.get(s))!==void 0)return i(s,l),l},set(s,l){t.has(s)?t.set(s,l):i(s,l)}}},Io="!",Eh=n=>{const{separator:e,experimentalParseClassName:t}=n,r=e.length===1,i=e[0],s=e.length,l=a=>{const o=[];let u=0,c=0,p;for(let Z=0;Z<a.length;Z++){let de=a[Z];if(u===0){if(de===i&&(r||a.slice(Z,Z+s)===e)){o.push(a.slice(c,Z)),c=Z+s;continue}if(de==="/"){p=Z;continue}}de==="["?u++:de==="]"&&u--}const d=o.length===0?a:a.substring(c),g=d.startsWith(Io),x=g?d.substring(1):d,j=p&&p>c?p-c:void 0;return{modifiers:o,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:j}};return t?a=>t({className:a,parseClassName:l}):l},Mh=n=>{if(n.length<=1)return n;const e=[];let t=[];return n.forEach(r=>{r[0]==="["?(e.push(...t.sort(),r),t=[]):t.push(r)}),e.push(...t.sort()),e},Ih=n=>({cache:Ch(n.cacheSize),parseClassName:Eh(n),...kh(n)}),Oh=/\s+/,Nh=(n,e)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],l=n.trim().split(Oh);let a="";for(let o=l.length-1;o>=0;o-=1){const u=l[o],{modifiers:c,hasImportantModifier:p,baseClassName:d,maybePostfixModifierPosition:g}=t(u);let x=!!g,j=r(x?d.substring(0,g):d);if(!j){if(!x){a=u+(a.length>0?" "+a:a);continue}if(j=r(d),!j){a=u+(a.length>0?" "+a:a);continue}x=!1}const Z=Mh(c).join(":"),de=p?Z+Io:Z,ve=de+j;if(s.includes(ve))continue;s.push(ve);const le=i(j,x);for(let Ie=0;Ie<le.length;++Ie){const Ae=le[Ie];s.push(de+Ae)}a=u+(a.length>0?" "+a:a)}return a};function Ph(){let n=0,e,t,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Oo(e))&&(r&&(r+=" "),r+=t);return r}const Oo=n=>{if(typeof n=="string")return n;let e,t="";for(let r=0;r<n.length;r++)n[r]&&(e=Oo(n[r]))&&(t&&(t+=" "),t+=e);return t};function Rh(n,...e){let t,r,i,s=l;function l(o){const u=e.reduce((c,p)=>p(c),n());return t=Ih(u),r=t.cache.get,i=t.cache.set,s=a,a(o)}function a(o){const u=r(o);if(u)return u;const c=Nh(o,t);return i(o,c),c}return function(){return s(Ph.apply(null,arguments))}}const Ce=n=>{const e=t=>t[n]||[];return e.isThemeGetter=!0,e},No=/^\[(?:([a-z-]+):)?(.+)\]$/i,Dh=/^\d+\/\d+$/,jh=new Set(["px","full","screen"]),Lh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zh=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,zh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Hh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Uh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jt=n=>rr(n)||jh.has(n)||Dh.test(n),Xt=n=>ir(n,"length",Gh),rr=n=>!!n&&!Number.isNaN(Number(n)),bl=n=>ir(n,"number",rr),ti=n=>!!n&&Number.isInteger(Number(n)),Vh=n=>n.endsWith("%")&&rr(n.slice(0,-1)),se=n=>No.test(n),en=n=>Lh.test(n),Bh=new Set(["length","size","percentage"]),Fh=n=>ir(n,Bh,Po),Wh=n=>ir(n,"position",Po),qh=new Set(["image","url"]),Kh=n=>ir(n,qh,Qh),Yh=n=>ir(n,"",Jh),ni=()=>!0,ir=(n,e,t)=>{const r=No.exec(n);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):t(r[2]):!1},Gh=n=>Zh.test(n)&&!zh.test(n),Po=()=>!1,Jh=n=>Hh.test(n),Qh=n=>Uh.test(n),Xh=()=>{const n=Ce("colors"),e=Ce("spacing"),t=Ce("blur"),r=Ce("brightness"),i=Ce("borderColor"),s=Ce("borderRadius"),l=Ce("borderSpacing"),a=Ce("borderWidth"),o=Ce("contrast"),u=Ce("grayscale"),c=Ce("hueRotate"),p=Ce("invert"),d=Ce("gap"),g=Ce("gradientColorStops"),x=Ce("gradientColorStopPositions"),j=Ce("inset"),Z=Ce("margin"),de=Ce("opacity"),ve=Ce("padding"),le=Ce("saturate"),Ie=Ce("scale"),Ae=Ce("sepia"),U=Ce("skew"),qe=Ce("space"),xe=Ce("translate"),Ze=()=>["auto","contain","none"],G=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",se,e],X=()=>[se,e],Qe=()=>["",jt,Xt],$=()=>["auto",rr,se],b=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],y=()=>["solid","dashed","dotted","double","none"],_=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],v=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",se],k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>[rr,se];return{cacheSize:500,separator:":",theme:{colors:[ni],spacing:[jt,Xt],blur:["none","",en,se],brightness:N(),borderColor:[n],borderRadius:["none","","full",en,se],borderSpacing:X(),borderWidth:Qe(),contrast:N(),grayscale:A(),hueRotate:N(),invert:A(),gap:X(),gradientColorStops:[n],gradientColorStopPositions:[Vh,Xt],inset:P(),margin:P(),opacity:N(),padding:X(),saturate:N(),scale:N(),sepia:A(),skew:N(),space:X(),translate:X()},classGroups:{aspect:[{aspect:["auto","square","video",se]}],container:["container"],columns:[{columns:[en]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...b(),se]}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:Ze()}],"overscroll-x":[{"overscroll-x":Ze()}],"overscroll-y":[{"overscroll-y":Ze()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ti,se]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",se]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",ti,se]}],"grid-cols":[{"grid-cols":[ni]}],"col-start-end":[{col:["auto",{span:["full",ti,se]},se]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[ni]}],"row-start-end":[{row:["auto",{span:[ti,se]},se]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",se]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",se]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...v()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...v(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...v(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[ve]}],px:[{px:[ve]}],py:[{py:[ve]}],ps:[{ps:[ve]}],pe:[{pe:[ve]}],pt:[{pt:[ve]}],pr:[{pr:[ve]}],pb:[{pb:[ve]}],pl:[{pl:[ve]}],m:[{m:[Z]}],mx:[{mx:[Z]}],my:[{my:[Z]}],ms:[{ms:[Z]}],me:[{me:[Z]}],mt:[{mt:[Z]}],mr:[{mr:[Z]}],mb:[{mb:[Z]}],ml:[{ml:[Z]}],"space-x":[{"space-x":[qe]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[qe]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",se,e]}],"min-w":[{"min-w":[se,e,"min","max","fit"]}],"max-w":[{"max-w":[se,e,"none","full","min","max","fit","prose",{screen:[en]},en]}],h:[{h:[se,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[se,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[se,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[se,e,"auto","min","max","fit"]}],"font-size":[{text:["base",en,Xt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",bl]}],"font-family":[{font:[ni]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",se]}],"line-clamp":[{"line-clamp":["none",rr,bl]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",jt,se]}],"list-image":[{"list-image":["none",se]}],"list-style-type":[{list:["none","disc","decimal",se]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[de]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[de]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",jt,Xt]}],"underline-offset":[{"underline-offset":["auto",jt,se]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:X()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[de]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...b(),Wh]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Fh]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Kh]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[de]}],"border-style":[{border:[...y(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[de]}],"divide-style":[{divide:y()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...y()]}],"outline-offset":[{"outline-offset":[jt,se]}],"outline-w":[{outline:[jt,Xt]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:Qe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[de]}],"ring-offset-w":[{"ring-offset":[jt,Xt]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",en,Yh]}],"shadow-color":[{shadow:[ni]}],opacity:[{opacity:[de]}],"mix-blend":[{"mix-blend":[..._(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":_()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[o]}],"drop-shadow":[{"drop-shadow":["","none",en,se]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[p]}],saturate:[{saturate:[le]}],sepia:[{sepia:[Ae]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[o]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[de]}],"backdrop-saturate":[{"backdrop-saturate":[le]}],"backdrop-sepia":[{"backdrop-sepia":[Ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",se]}],duration:[{duration:N()}],ease:[{ease:["linear","in","out","in-out",se]}],delay:[{delay:N()}],animate:[{animate:["none","spin","ping","pulse","bounce",se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[Ie]}],"scale-x":[{"scale-x":[Ie]}],"scale-y":[{"scale-y":[Ie]}],rotate:[{rotate:[ti,se]}],"translate-x":[{"translate-x":[xe]}],"translate-y":[{"translate-y":[xe]}],"skew-x":[{"skew-x":[U]}],"skew-y":[{"skew-y":[U]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",se]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",se]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":X()}],"scroll-mx":[{"scroll-mx":X()}],"scroll-my":[{"scroll-my":X()}],"scroll-ms":[{"scroll-ms":X()}],"scroll-me":[{"scroll-me":X()}],"scroll-mt":[{"scroll-mt":X()}],"scroll-mr":[{"scroll-mr":X()}],"scroll-mb":[{"scroll-mb":X()}],"scroll-ml":[{"scroll-ml":X()}],"scroll-p":[{"scroll-p":X()}],"scroll-px":[{"scroll-px":X()}],"scroll-py":[{"scroll-py":X()}],"scroll-ps":[{"scroll-ps":X()}],"scroll-pe":[{"scroll-pe":X()}],"scroll-pt":[{"scroll-pt":X()}],"scroll-pr":[{"scroll-pr":X()}],"scroll-pb":[{"scroll-pb":X()}],"scroll-pl":[{"scroll-pl":X()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",se]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[jt,Xt,bl]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},ep=Rh(Xh);var tp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ro(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var wl={};(function(n){function e(a){a&&a.options&&clearTimeout(a.options.timer)}function t(a,o,u,c){var p={timer:void 0,lastArgs:[]},d=function(){for(var g=this,x=[],j=0;j<arguments.length;j++)x[j]=arguments[j];p.lastArgs=x,p.timer?clearTimeout(p.timer):o&&u.apply(this,p.lastArgs),p.timer=setTimeout(function(){o||u.apply(g,p.lastArgs),p.timer=void 0},a)};return c&&(d=d.bind(c)),d.options=p,d}function r(a,o,u,c){var p;Object.defineProperty(u,c,{configurable:!0,enumerable:!1,get:function(){return p},set:function(d){p=t(a,o,d,this)}})}function i(a,o,u){var c=u.value;return u.value=t(a,o,c),u}function s(a,o){for(var u=[],c=2;c<arguments.length;c++)u[c-2]=arguments[c];if(u.length===0)throw new Error("function applied debounce decorator should be a method");if(u.length===1)throw new Error("method applied debounce decorator should have valid name");var p=u[0],d=u[1],g=u.length===3&&u[2]?u[2]:Object.getOwnPropertyDescriptor(p,d);if(g)return i(a,o,g);r(a,o,p,d)}function l(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];var u=500,c=!1;if(a.length&&(typeof a[0]=="number"||typeof a[0]=="object"&&a[0].leading!==void 0)){typeof a[0]=="number"&&(u=a[0]);var p=void 0;return typeof a[0]=="object"&&a[0].leading!==void 0&&(p=a[0]),1<a.length&&typeof a[1]=="object"&&a[1].leading!==void 0&&(p=a[1]),p&&(c=p.leading),function(){for(var d=[],g=0;g<arguments.length;g++)d[g]=arguments[g];return s.apply(void 0,[u,c].concat(d))}}return s.apply(void 0,[u,c].concat(a))}Object.defineProperty(n,"__esModule",{value:!0}),n.cancel=e,n.debounce=l})(wl);var me;(function(n){n.assertEqual=i=>i;function e(i){}n.assertIs=e;function t(i){throw new Error}n.assertNever=t,n.arrayToEnum=i=>{const s={};for(const l of i)s[l]=l;return s},n.getValidEnumValues=i=>{const s=n.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),l={};for(const a of s)l[a]=i[a];return n.objectValues(l)},n.objectValues=i=>n.objectKeys(i).map(function(s){return i[s]}),n.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const l in i)Object.prototype.hasOwnProperty.call(i,l)&&s.push(l);return s},n.find=(i,s)=>{for(const l of i)if(s(l))return l},n.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(l=>typeof l=="string"?`'${l}'`:l).join(s)}n.joinValues=r,n.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(me||(me={}));var _l;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(_l||(_l={}));const I=me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tn=n=>{switch(typeof n){case"undefined":return I.undefined;case"string":return I.string;case"number":return isNaN(n)?I.nan:I.number;case"boolean":return I.boolean;case"function":return I.function;case"bigint":return I.bigint;case"symbol":return I.symbol;case"object":return Array.isArray(n)?I.array:n===null?I.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?I.promise:typeof Map<"u"&&n instanceof Map?I.map:typeof Set<"u"&&n instanceof Set?I.set:typeof Date<"u"&&n instanceof Date?I.date:I.object;default:return I.unknown}},C=me.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"]),np=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class ft extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const l of s.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)r._errors.push(t(l));else{let a=r,o=0;for(;o<l.path.length;){const u=l.path[o];o===l.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(l))):a[u]=a[u]||{_errors:[]},a=a[u],o++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}ft.create=n=>new ft(n);const ri=(n,e)=>{let t;switch(n.code){case C.invalid_type:n.received===I.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case C.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,me.jsonStringifyReplacer)}`;break;case C.unrecognized_keys:t=`Unrecognized key(s) in object: ${me.joinValues(n.keys,", ")}`;break;case C.invalid_union:t="Invalid input";break;case C.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${me.joinValues(n.options)}`;break;case C.invalid_enum_value:t=`Invalid enum value. Expected ${me.joinValues(n.options)}, received '${n.received}'`;break;case C.invalid_arguments:t="Invalid function arguments";break;case C.invalid_return_type:t="Invalid function return type";break;case C.invalid_date:t="Invalid date";break;case C.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:me.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case C.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case C.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case C.custom:t="Invalid input";break;case C.invalid_intersection_types:t="Intersection results could not be merged";break;case C.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case C.not_finite:t="Number must be finite";break;default:t=e.defaultError,me.assertNever(n)}return{message:t}};let Do=ri;function rp(n){Do=n}function cs(){return Do}const ds=n=>{const{data:e,path:t,errorMaps:r,issueData:i}=n,s=[...t,...i.path||[]],l={...i,path:s};let a="";const o=r.filter(u=>!!u).slice().reverse();for(const u of o)a=u(l,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},ip=[];function D(n,e){const t=ds({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,cs(),ri].filter(r=>!!r)});n.common.issues.push(t)}class Je{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const i of t){if(i.status==="aborted")return Q;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const i of t)r.push({key:await i.key,value:await i.value});return Je.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const i of t){const{key:s,value:l}=i;if(s.status==="aborted"||l.status==="aborted")return Q;s.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(r[s.value]=l.value)}return{status:e.value,value:r}}}const Q=Object.freeze({status:"aborted"}),jo=n=>({status:"dirty",value:n}),tt=n=>({status:"valid",value:n}),xl=n=>n.status==="aborted",kl=n=>n.status==="dirty",ii=n=>n.status==="valid",hs=n=>typeof Promise<"u"&&n instanceof Promise;var F;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(F||(F={}));class Ct{constructor(e,t,r,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Lo=(n,e)=>{if(ii(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ft(n.common.issues);return this._error=t,this._error}}};function ne(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:i}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,l)=>s.code!=="invalid_type"?{message:l.defaultError}:typeof l.data>"u"?{message:r??l.defaultError}:{message:t??l.defaultError},description:i}}class oe{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return tn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:tn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Je,ctx:{common:e.parent.common,data:e.data,parsedType:tn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(hs(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){var r;const i={common:{issues:[],async:(r=t==null?void 0:t.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tn(e)},s=this._parseSync({data:e,path:i.path,parent:i});return Lo(i,s)}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==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tn(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(hs(i)?i:Promise.resolve(i));return Lo(r,s)}refine(e,t){const r=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,s)=>{const l=e(i),a=()=>s.addIssue({code:C.custom,...r(i)});return typeof Promise<"u"&&l instanceof Promise?l.then(o=>o?!0:(a(),!1)):l?!0:(a(),!1)})}refinement(e,t){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof t=="function"?t(r,i):t),!1))}_refinement(e){return new yt({schema:this,typeName:q.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Zt.create(this,this._def)}nullable(){return Pn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return gt.create(this,this._def)}promise(){return or.create(this,this._def)}or(e){return oi.create([this,e],this._def)}and(e){return ui.create(this,e,this._def)}transform(e){return new yt({...ne(this._def),schema:this,typeName:q.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new fi({...ne(this._def),innerType:this,defaultValue:t,typeName:q.ZodDefault})}brand(){return new zo({typeName:q.ZodBranded,type:this,...ne(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new vs({...ne(this._def),innerType:this,catchValue:t,typeName:q.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return mi.create(this,e)}readonly(){return ws.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const sp=/^c[^\s-]{8,}$/i,lp=/^[a-z][a-z0-9]*$/,ap=/^[0-9A-HJKMNP-TV-Z]{26}$/,op=/^[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,up=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let $l;const dp=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,hp=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,pp=n=>n.precision?n.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${n.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${n.precision}}Z$`):n.precision===0?n.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):n.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function fp(n,e){return!!((e==="v4"||!e)&&dp.test(n)||(e==="v6"||!e)&&hp.test(n))}class mt extends oe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==I.string){const i=this._getOrReturnCtx(e);return D(i,{code:C.invalid_type,expected:I.string,received:i.parsedType}),Q}const t=new Je;let r;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:C.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if(i.kind==="max")e.data.length>i.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:C.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,l=e.data.length<i.value;(s||l)&&(r=this._getOrReturnCtx(e,r),s?D(r,{code:C.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&D(r,{code:C.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if(i.kind==="email")up.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"email",code:C.invalid_string,message:i.message}),t.dirty());else if(i.kind==="emoji")$l||($l=new RegExp(cp,"u")),$l.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"emoji",code:C.invalid_string,message:i.message}),t.dirty());else if(i.kind==="uuid")op.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"uuid",code:C.invalid_string,message:i.message}),t.dirty());else if(i.kind==="cuid")sp.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cuid",code:C.invalid_string,message:i.message}),t.dirty());else if(i.kind==="cuid2")lp.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cuid2",code:C.invalid_string,message:i.message}),t.dirty());else if(i.kind==="ulid")ap.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"ulid",code:C.invalid_string,message:i.message}),t.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),D(r,{validation:"url",code:C.invalid_string,message:i.message}),t.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"regex",code:C.invalid_string,message:i.message}),t.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(e,r),D(r,{code:C.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),t.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)||(r=this._getOrReturnCtx(e,r),D(r,{code:C.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(r=this._getOrReturnCtx(e,r),D(r,{code:C.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty()):i.kind==="datetime"?pp(i).test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:C.invalid_string,validation:"datetime",message:i.message}),t.dirty()):i.kind==="ip"?fp(e.data,i.version)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"ip",code:C.invalid_string,message:i.message}),t.dirty()):me.assertNever(i);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement(i=>e.test(i),{validation:t,code:C.invalid_string,...F.errToObj(r)})}_addCheck(e){return new mt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...F.errToObj(e)})}url(e){return this._addCheck({kind:"url",...F.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...F.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...F.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...F.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...F.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...F.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...F.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,...F.errToObj(e==null?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...F.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...F.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...F.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...F.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...F.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...F.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...F.errToObj(t)})}nonempty(e){return this.min(1,F.errToObj(e))}trim(){return new mt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new mt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new mt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}mt.create=n=>{var e;return new mt({checks:[],typeName:q.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...ne(n)})};function mp(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=t>r?t:r,s=parseInt(n.toFixed(i).replace(".","")),l=parseInt(e.toFixed(i).replace(".",""));return s%l/Math.pow(10,i)}class nn extends oe{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)!==I.number){const i=this._getOrReturnCtx(e);return D(i,{code:C.invalid_type,expected:I.number,received:i.parsedType}),Q}let t;const r=new Je;for(const i of this._def.checks)i.kind==="int"?me.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),D(t,{code:C.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),D(t,{code:C.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),D(t,{code:C.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?mp(e.data,i.value)!==0&&(t=this._getOrReturnCtx(e,t),D(t,{code:C.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),D(t,{code:C.not_finite,message:i.message}),r.dirty()):me.assertNever(i);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,F.toString(t))}gt(e,t){return this.setLimit("min",e,!1,F.toString(t))}lte(e,t){return this.setLimit("max",e,!0,F.toString(t))}lt(e,t){return this.setLimit("max",e,!1,F.toString(t))}setLimit(e,t,r,i){return new nn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:F.toString(i)}]})}_addCheck(e){return new nn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:F.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:F.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:F.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:F.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:F.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:F.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:F.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:F.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:F.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&me.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}nn.create=n=>new nn({checks:[],typeName:q.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...ne(n)});class rn extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==I.bigint){const i=this._getOrReturnCtx(e);return D(i,{code:C.invalid_type,expected:I.bigint,received:i.parsedType}),Q}let t;const r=new Je;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),D(t,{code:C.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),D(t,{code:C.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),D(t,{code:C.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):me.assertNever(i);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,F.toString(t))}gt(e,t){return this.setLimit("min",e,!1,F.toString(t))}lte(e,t){return this.setLimit("max",e,!0,F.toString(t))}lt(e,t){return this.setLimit("max",e,!1,F.toString(t))}setLimit(e,t,r,i){return new rn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:F.toString(i)}]})}_addCheck(e){return new rn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:F.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:F.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:F.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:F.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:F.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}rn.create=n=>{var e;return new rn({checks:[],typeName:q.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...ne(n)})};class si extends oe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==I.boolean){const t=this._getOrReturnCtx(e);return D(t,{code:C.invalid_type,expected:I.boolean,received:t.parsedType}),Q}return tt(e.data)}}si.create=n=>new si({typeName:q.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...ne(n)});class In extends oe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==I.date){const i=this._getOrReturnCtx(e);return D(i,{code:C.invalid_type,expected:I.date,received:i.parsedType}),Q}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return D(i,{code:C.invalid_date}),Q}const t=new Je;let r;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:C.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),t.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:C.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),t.dirty()):me.assertNever(i);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new In({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:F.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:F.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}In.create=n=>new In({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:q.ZodDate,...ne(n)});class ps extends oe{_parse(e){if(this._getType(e)!==I.symbol){const t=this._getOrReturnCtx(e);return D(t,{code:C.invalid_type,expected:I.symbol,received:t.parsedType}),Q}return tt(e.data)}}ps.create=n=>new ps({typeName:q.ZodSymbol,...ne(n)});class li extends oe{_parse(e){if(this._getType(e)!==I.undefined){const t=this._getOrReturnCtx(e);return D(t,{code:C.invalid_type,expected:I.undefined,received:t.parsedType}),Q}return tt(e.data)}}li.create=n=>new li({typeName:q.ZodUndefined,...ne(n)});class ai extends oe{_parse(e){if(this._getType(e)!==I.null){const t=this._getOrReturnCtx(e);return D(t,{code:C.invalid_type,expected:I.null,received:t.parsedType}),Q}return tt(e.data)}}ai.create=n=>new ai({typeName:q.ZodNull,...ne(n)});class sr extends oe{constructor(){super(...arguments),this._any=!0}_parse(e){return tt(e.data)}}sr.create=n=>new sr({typeName:q.ZodAny,...ne(n)});class On extends oe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return tt(e.data)}}On.create=n=>new On({typeName:q.ZodUnknown,...ne(n)});class Lt extends oe{_parse(e){const t=this._getOrReturnCtx(e);return D(t,{code:C.invalid_type,expected:I.never,received:t.parsedType}),Q}}Lt.create=n=>new Lt({typeName:q.ZodNever,...ne(n)});class fs extends oe{_parse(e){if(this._getType(e)!==I.undefined){const t=this._getOrReturnCtx(e);return D(t,{code:C.invalid_type,expected:I.void,received:t.parsedType}),Q}return tt(e.data)}}fs.create=n=>new fs({typeName:q.ZodVoid,...ne(n)});class gt extends oe{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),i=this._def;if(t.parsedType!==I.array)return D(t,{code:C.invalid_type,expected:I.array,received:t.parsedType}),Q;if(i.exactLength!==null){const l=t.data.length>i.exactLength.value,a=t.data.length<i.exactLength.value;(l||a)&&(D(t,{code:l?C.too_big:C.too_small,minimum:a?i.exactLength.value:void 0,maximum:l?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(D(t,{code:C.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(D(t,{code:C.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((l,a)=>i.type._parseAsync(new Ct(t,l,t.path,a)))).then(l=>Je.mergeArray(r,l));const s=[...t.data].map((l,a)=>i.type._parseSync(new Ct(t,l,t.path,a)));return Je.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new gt({...this._def,minLength:{value:e,message:F.toString(t)}})}max(e,t){return new gt({...this._def,maxLength:{value:e,message:F.toString(t)}})}length(e,t){return new gt({...this._def,exactLength:{value:e,message:F.toString(t)}})}nonempty(e){return this.min(1,e)}}gt.create=(n,e)=>new gt({type:n,minLength:null,maxLength:null,exactLength:null,typeName:q.ZodArray,...ne(e)});function lr(n){if(n instanceof Pe){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=Zt.create(lr(r))}return new Pe({...n._def,shape:()=>e})}else return n instanceof gt?new gt({...n._def,type:lr(n.element)}):n instanceof Zt?Zt.create(lr(n.unwrap())):n instanceof Pn?Pn.create(lr(n.unwrap())):n instanceof Et?Et.create(n.items.map(e=>lr(e))):n}class Pe extends oe{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(),t=me.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==I.object){const o=this._getOrReturnCtx(e);return D(o,{code:C.invalid_type,expected:I.object,received:o.parsedType}),Q}const{status:t,ctx:r}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),l=[];if(!(this._def.catchall instanceof Lt&&this._def.unknownKeys==="strip"))for(const o in r.data)s.includes(o)||l.push(o);const a=[];for(const o of s){const u=i[o],c=r.data[o];a.push({key:{status:"valid",value:o},value:u._parse(new Ct(r,c,r.path,o)),alwaysSet:o in r.data})}if(this._def.catchall instanceof Lt){const o=this._def.unknownKeys;if(o==="passthrough")for(const u of l)a.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(o==="strict")l.length>0&&(D(r,{code:C.unrecognized_keys,keys:l}),t.dirty());else if(o!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const o=this._def.catchall;for(const u of l){const c=r.data[u];a.push({key:{status:"valid",value:u},value:o._parse(new Ct(r,c,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const o=[];for(const u of a){const c=await u.key;o.push({key:c,value:await u.value,alwaysSet:u.alwaysSet})}return o}).then(o=>Je.mergeObjectSync(t,o)):Je.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return F.errToObj,new Pe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var i,s,l,a;const o=(l=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,t,r).message)!==null&&l!==void 0?l:r.defaultError;return t.code==="unrecognized_keys"?{message:(a=F.errToObj(e).message)!==null&&a!==void 0?a:o}:{message:o}}}:{}})}strip(){return new Pe({...this._def,unknownKeys:"strip"})}passthrough(){return new Pe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Pe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Pe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:q.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Pe({...this._def,catchall:e})}pick(e){const t={};return me.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new Pe({...this._def,shape:()=>t})}omit(e){const t={};return me.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new Pe({...this._def,shape:()=>t})}deepPartial(){return lr(this)}partial(e){const t={};return me.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?t[r]=i:t[r]=i.optional()}),new Pe({...this._def,shape:()=>t})}required(e){const t={};return me.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Zt;)i=i._def.innerType;t[r]=i}}),new Pe({...this._def,shape:()=>t})}keyof(){return Zo(me.objectKeys(this.shape))}}Pe.create=(n,e)=>new Pe({shape:()=>n,unknownKeys:"strip",catchall:Lt.create(),typeName:q.ZodObject,...ne(e)}),Pe.strictCreate=(n,e)=>new Pe({shape:()=>n,unknownKeys:"strict",catchall:Lt.create(),typeName:q.ZodObject,...ne(e)}),Pe.lazycreate=(n,e)=>new Pe({shape:n,unknownKeys:"strip",catchall:Lt.create(),typeName:q.ZodObject,...ne(e)});class oi extends oe{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const l=s.map(a=>new ft(a.ctx.common.issues));return D(t,{code:C.invalid_union,unionErrors:l}),Q}if(t.common.async)return Promise.all(r.map(async s=>{const l={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(i);{let s;const l=[];for(const o of r){const u={...t,common:{...t.common,issues:[]},parent:null},c=o._parseSync({data:t.data,path:t.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:u}),u.common.issues.length&&l.push(u.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const a=l.map(o=>new ft(o));return D(t,{code:C.invalid_union,unionErrors:a}),Q}}get options(){return this._def.options}}oi.create=(n,e)=>new oi({options:n,typeName:q.ZodUnion,...ne(e)});const ms=n=>n instanceof di?ms(n.schema):n instanceof yt?ms(n.innerType()):n instanceof hi?[n.value]:n instanceof sn?n.options:n instanceof pi?Object.keys(n.enum):n instanceof fi?ms(n._def.innerType):n instanceof li?[void 0]:n instanceof ai?[null]:null;class gs extends oe{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.object)return D(t,{code:C.invalid_type,expected:I.object,received:t.parsedType}),Q;const r=this.discriminator,i=t.data[r],s=this.optionsMap.get(i);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(D(t,{code:C.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const i=new Map;for(const s of t){const l=ms(s.shape[e]);if(!l)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of l){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new gs({typeName:q.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...ne(r)})}}function Al(n,e){const t=tn(n),r=tn(e);if(n===e)return{valid:!0,data:n};if(t===I.object&&r===I.object){const i=me.objectKeys(e),s=me.objectKeys(n).filter(a=>i.indexOf(a)!==-1),l={...n,...e};for(const a of s){const o=Al(n[a],e[a]);if(!o.valid)return{valid:!1};l[a]=o.data}return{valid:!0,data:l}}else if(t===I.array&&r===I.array){if(n.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<n.length;s++){const l=n[s],a=e[s],o=Al(l,a);if(!o.valid)return{valid:!1};i.push(o.data)}return{valid:!0,data:i}}else return t===I.date&&r===I.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class ui extends oe{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),i=(s,l)=>{if(xl(s)||xl(l))return Q;const a=Al(s.value,l.value);return a.valid?((kl(s)||kl(l))&&t.dirty(),{status:t.value,value:a.data}):(D(r,{code:C.invalid_intersection_types}),Q)};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(([s,l])=>i(s,l)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ui.create=(n,e,t)=>new ui({left:n,right:e,typeName:q.ZodIntersection,...ne(t)});class Et extends oe{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==I.array)return D(r,{code:C.invalid_type,expected:I.array,received:r.parsedType}),Q;if(r.data.length<this._def.items.length)return D(r,{code:C.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&r.data.length>this._def.items.length&&(D(r,{code:C.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...r.data].map((s,l)=>{const a=this._def.items[l]||this._def.rest;return a?a._parse(new Ct(r,s,r.path,l)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>Je.mergeArray(t,s)):Je.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new Et({...this._def,rest:e})}}Et.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Et({items:n,typeName:q.ZodTuple,rest:null,...ne(e)})};class ci extends oe{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!==I.object)return D(r,{code:C.invalid_type,expected:I.object,received:r.parsedType}),Q;const i=[],s=this._def.keyType,l=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new Ct(r,a,r.path,a)),value:l._parse(new Ct(r,r.data[a],r.path,a))});return r.common.async?Je.mergeObjectAsync(t,i):Je.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof oe?new ci({keyType:e,valueType:t,typeName:q.ZodRecord,...ne(r)}):new ci({keyType:mt.create(),valueType:e,typeName:q.ZodRecord,...ne(t)})}}class ys extends oe{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!==I.map)return D(r,{code:C.invalid_type,expected:I.map,received:r.parsedType}),Q;const i=this._def.keyType,s=this._def.valueType,l=[...r.data.entries()].map(([a,o],u)=>({key:i._parse(new Ct(r,a,r.path,[u,"key"])),value:s._parse(new Ct(r,o,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const o of l){const u=await o.key,c=await o.value;if(u.status==="aborted"||c.status==="aborted")return Q;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const o of l){const u=o.key,c=o.value;if(u.status==="aborted"||c.status==="aborted")return Q;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}}}}ys.create=(n,e,t)=>new ys({valueType:e,keyType:n,typeName:q.ZodMap,...ne(t)});class Nn extends oe{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==I.set)return D(r,{code:C.invalid_type,expected:I.set,received:r.parsedType}),Q;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(D(r,{code:C.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(D(r,{code:C.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const s=this._def.valueType;function l(o){const u=new Set;for(const c of o){if(c.status==="aborted")return Q;c.status==="dirty"&&t.dirty(),u.add(c.value)}return{status:t.value,value:u}}const a=[...r.data.values()].map((o,u)=>s._parse(new Ct(r,o,r.path,u)));return r.common.async?Promise.all(a).then(o=>l(o)):l(a)}min(e,t){return new Nn({...this._def,minSize:{value:e,message:F.toString(t)}})}max(e,t){return new Nn({...this._def,maxSize:{value:e,message:F.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Nn.create=(n,e)=>new Nn({valueType:n,minSize:null,maxSize:null,typeName:q.ZodSet,...ne(e)});class ar extends oe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.function)return D(t,{code:C.invalid_type,expected:I.function,received:t.parsedType}),Q;function r(a,o){return ds({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,cs(),ri].filter(u=>!!u),issueData:{code:C.invalid_arguments,argumentsError:o}})}function i(a,o){return ds({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,cs(),ri].filter(u=>!!u),issueData:{code:C.invalid_return_type,returnTypeError:o}})}const s={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof or){const a=this;return tt(async function(...o){const u=new ft([]),c=await a._def.args.parseAsync(o,s).catch(d=>{throw u.addIssue(r(o,d)),u}),p=await Reflect.apply(l,this,c);return await a._def.returns._def.type.parseAsync(p,s).catch(d=>{throw u.addIssue(i(p,d)),u})})}else{const a=this;return tt(function(...o){const u=a._def.args.safeParse(o,s);if(!u.success)throw new ft([r(o,u.error)]);const c=Reflect.apply(l,this,u.data),p=a._def.returns.safeParse(c,s);if(!p.success)throw new ft([i(c,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ar({...this._def,args:Et.create(e).rest(On.create())})}returns(e){return new ar({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ar({args:e||Et.create([]).rest(On.create()),returns:t||On.create(),typeName:q.ZodFunction,...ne(r)})}}class di extends oe{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})}}di.create=(n,e)=>new di({getter:n,typeName:q.ZodLazy,...ne(e)});class hi extends oe{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return D(t,{received:t.data,code:C.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}}hi.create=(n,e)=>new hi({value:n,typeName:q.ZodLiteral,...ne(e)});function Zo(n,e){return new sn({values:n,typeName:q.ZodEnum,...ne(e)})}class sn extends oe{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return D(t,{expected:me.joinValues(r),received:t.parsedType,code:C.invalid_type}),Q}if(this._def.values.indexOf(e.data)===-1){const t=this._getOrReturnCtx(e),r=this._def.values;return D(t,{received:t.data,code:C.invalid_enum_value,options:r}),Q}return tt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return sn.create(e)}exclude(e){return sn.create(this.options.filter(t=>!e.includes(t)))}}sn.create=Zo;class pi extends oe{_parse(e){const t=me.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==I.string&&r.parsedType!==I.number){const i=me.objectValues(t);return D(r,{expected:me.joinValues(i),received:r.parsedType,code:C.invalid_type}),Q}if(t.indexOf(e.data)===-1){const i=me.objectValues(t);return D(r,{received:r.data,code:C.invalid_enum_value,options:i}),Q}return tt(e.data)}get enum(){return this._def.values}}pi.create=(n,e)=>new pi({values:n,typeName:q.ZodNativeEnum,...ne(e)});class or extends oe{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.promise&&t.common.async===!1)return D(t,{code:C.invalid_type,expected:I.promise,received:t.parsedType}),Q;const r=t.parsedType===I.promise?t.data:Promise.resolve(t.data);return tt(r.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}or.create=(n,e)=>new or({type:n,typeName:q.ZodPromise,...ne(e)});class yt extends oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:l=>{D(r,l),l.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const l=i.transform(r.data,s);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(l).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:l,path:r.path,parent:r})}if(i.type==="refinement"){const l=a=>{const o=i.refinement(a,s);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 a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Q:(a.status==="dirty"&&t.dirty(),l(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Q:(a.status==="dirty"&&t.dirty(),l(a.value).then(()=>({status:t.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ii(l))return l;const a=i.transform(l.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>ii(l)?Promise.resolve(i.transform(l.value,s)).then(a=>({status:t.value,value:a})):l);me.assertNever(i)}}yt.create=(n,e,t)=>new yt({schema:n,typeName:q.ZodEffects,effect:e,...ne(t)}),yt.createWithPreprocess=(n,e,t)=>new yt({schema:e,effect:{type:"preprocess",transform:n},typeName:q.ZodEffects,...ne(t)});class Zt extends oe{_parse(e){return this._getType(e)===I.undefined?tt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Zt.create=(n,e)=>new Zt({innerType:n,typeName:q.ZodOptional,...ne(e)});class Pn extends oe{_parse(e){return this._getType(e)===I.null?tt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Pn.create=(n,e)=>new Pn({innerType:n,typeName:q.ZodNullable,...ne(e)});class fi extends oe{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===I.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}fi.create=(n,e)=>new fi({innerType:n,typeName:q.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ne(e)});class vs extends oe{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return hs(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ft(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ft(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}vs.create=(n,e)=>new vs({innerType:n,typeName:q.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ne(e)});class bs extends oe{_parse(e){if(this._getType(e)!==I.nan){const t=this._getOrReturnCtx(e);return D(t,{code:C.invalid_type,expected:I.nan,received:t.parsedType}),Q}return{status:"valid",value:e.data}}}bs.create=n=>new bs({typeName:q.ZodNaN,...ne(n)});const gp=Symbol("zod_brand");class zo extends oe{_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}}class mi extends oe{_parse(e){const{status:t,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"?Q:i.status==="dirty"?(t.dirty(),jo(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Q:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,t){return new mi({in:e,out:t,typeName:q.ZodPipeline})}}class ws extends oe{_parse(e){const t=this._def.innerType._parse(e);return ii(t)&&(t.value=Object.freeze(t.value)),t}}ws.create=(n,e)=>new ws({innerType:n,typeName:q.ZodReadonly,...ne(e)});const Ho=(n,e={},t)=>n?sr.create().superRefine((r,i)=>{var s,l;if(!n(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,o=(l=(s=a.fatal)!==null&&s!==void 0?s:t)!==null&&l!==void 0?l:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:o})}}):sr.create(),yp={object:Pe.lazycreate};var q;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(q||(q={}));const vp=(n,e={message:`Input not instance of ${n.name}`})=>Ho(t=>t instanceof n,e),Uo=mt.create,Vo=nn.create,bp=bs.create,wp=rn.create,Bo=si.create,_p=In.create,xp=ps.create,kp=li.create,$p=ai.create,Ap=sr.create,Sp=On.create,Tp=Lt.create,Cp=fs.create,Ep=gt.create,Mp=Pe.create,Ip=Pe.strictCreate,Op=oi.create,Np=gs.create,Pp=ui.create,Rp=Et.create,Dp=ci.create,jp=ys.create,Lp=Nn.create,Zp=ar.create,zp=di.create,Hp=hi.create,Up=sn.create,Vp=pi.create,Bp=or.create,Fo=yt.create,Fp=Zt.create,Wp=Pn.create,qp=yt.createWithPreprocess,Kp=mi.create;var O=Object.freeze({__proto__:null,defaultErrorMap:ri,setErrorMap:rp,getErrorMap:cs,makeIssue:ds,EMPTY_PATH:ip,addIssueToContext:D,ParseStatus:Je,INVALID:Q,DIRTY:jo,OK:tt,isAborted:xl,isDirty:kl,isValid:ii,isAsync:hs,get util(){return me},get objectUtil(){return _l},ZodParsedType:I,getParsedType:tn,ZodType:oe,ZodString:mt,ZodNumber:nn,ZodBigInt:rn,ZodBoolean:si,ZodDate:In,ZodSymbol:ps,ZodUndefined:li,ZodNull:ai,ZodAny:sr,ZodUnknown:On,ZodNever:Lt,ZodVoid:fs,ZodArray:gt,ZodObject:Pe,ZodUnion:oi,ZodDiscriminatedUnion:gs,ZodIntersection:ui,ZodTuple:Et,ZodRecord:ci,ZodMap:ys,ZodSet:Nn,ZodFunction:ar,ZodLazy:di,ZodLiteral:hi,ZodEnum:sn,ZodNativeEnum:pi,ZodPromise:or,ZodEffects:yt,ZodTransformer:yt,ZodOptional:Zt,ZodNullable:Pn,ZodDefault:fi,ZodCatch:vs,ZodNaN:bs,BRAND:gp,ZodBranded:zo,ZodPipeline:mi,ZodReadonly:ws,custom:Ho,Schema:oe,ZodSchema:oe,late:yp,get ZodFirstPartyTypeKind(){return q},coerce:{string:n=>mt.create({...n,coerce:!0}),number:n=>nn.create({...n,coerce:!0}),boolean:n=>si.create({...n,coerce:!0}),bigint:n=>rn.create({...n,coerce:!0}),date:n=>In.create({...n,coerce:!0})},any:Ap,array:Ep,bigint:wp,boolean:Bo,date:_p,discriminatedUnion:Np,effect:Fo,enum:Up,function:Zp,instanceof:vp,intersection:Pp,lazy:zp,literal:Hp,map:jp,nan:bp,nativeEnum:Vp,never:Tp,null:$p,nullable:Wp,number:Vo,object:Mp,oboolean:()=>Bo().optional(),onumber:()=>Vo().optional(),optional:Fp,ostring:()=>Uo().optional(),pipeline:Kp,preprocess:qp,promise:Bp,record:Dp,set:Lp,strictObject:Ip,string:Uo,symbol:xp,transformer:Fo,tuple:Rp,undefined:kp,union:Op,unknown:Sp,void:Cp,NEVER:Q,ZodIssueCode:C,quotelessJson:np,ZodError:ft});const Yp={sm:"md:w-[350px]",md:"md:w-[500px]",lg:"md:w-[760px]",xl:"md:w-[900px]",xxl:"md:w-[1200px]"},Gp={sm:"md:h-[400px]",md:"md:h-[500px]",lg:"md:h-[600px]",xl:"md:h-[700px]",xxl:"md:h-[800px]"},_s=O.object({assistantId:O.string(),clientId:O.string().optional(),params:O.record(O.any()).default({}),config:O.object({historyKey:O.string().refine(n=>n.replace(/-/g,"_")).nullable().default("main"),welcomeMessage:O.string().default("Hello! How can I help you today?"),focusOnOpen:O.boolean().default(!0),inactivityWarningMessage:O.string().default("Are you still there? The chat will end soon if we don't hear from you."),chatEndedMessage:O.string().default("Chat Ended"),resetEndedChatOnLoad:O.boolean().default(!1),disableMessageRating:O.boolean().default(!1),initialReplyMessage:O.string().nullable().default(null),disclaimerMessage:O.string().nullable().default(null),disclaimerPopover:O.object({message:O.string().nullable().default(null),agreeButtonText:O.string().default("I Agree"),rememberDurationMinutes:O.number().default(60*24*3)}).default({}),placement:O.enum(["left","right"]).default("right"),openChatButton:O.object({imageSrc:O.string().nullable().default(null),width:O.union([O.string(),O.number()]).default("48px"),height:O.union([O.string(),O.number()]).default("48px"),cta:O.string().nullable().default(null)}).default({}),chatWindow:O.object({width:O.enum(["sm","md","lg","xl","xxl"]).default("sm"),height:O.enum(["sm","md","lg","xl","xxl"]).default("md"),header:O.object({text:O.string().nullable().default("AI Chat"),imageSrc:O.string().nullable().default(null)}).default({}),showCloseButton:O.boolean().default(!0)}).default({}),styles:O.object({primaryColor:O.string().nullable().default(null),textColor:O.string().nullable().default(null),linkColor:O.string().nullable().default(null),openChatButton:O.object({backgroundColor:O.string().nullable().default(null),iconColor:O.string().nullable().default(null)}).default({}),header:O.object({backgroundColor:O.string().nullable().default(null),textColor:O.string().nullable().default(null)}).default({}),button:O.object({backgroundColor:O.string().nullable().default(null),textColor:O.string().nullable().default(null)}).default({}),messages:O.object({user:O.object({backgroundColor:O.string().nullable().default(null),textColor:O.string().nullable().default(null)}).default({}),assistant:O.object({backgroundColor:O.string().nullable().default(null),textColor:O.string().nullable().default(null)}).default({})}).default({})}).default({})}).default({}),handlers:O.object({functionCalls:O.record(O.function().returns(O.union([O.any(),O.promise(O.any())]))).default({}),enhancedContent:O.record(O.function().returns(O.union([O.any(),O.promise(O.any())]))).default({})}).default({})});var Jp=Object.defineProperty,Qp=Object.getOwnPropertyDescriptor,ur=(n,e,t,r)=>{for(var i=r>1?void 0:r?Qp(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&Jp(e,t,i),i};let ln=class extends it{constructor(){super(...arguments),this.isOpen=!1,this.ctaClosed=!1,this.onResizeHandler=()=>{this.isOpen&&window.innerWidth<768?(xh(this,{allowTouchMove:n=>n.nodeName==="IAI-CHAT-POPUP"}),this.isIosDevice||(document.documentElement.style.overflow="hidden")):(To(this),this.isIosDevice||(document.documentElement.style.overflow=this.initialHtmlOverflow))}}connectedCallback(){super.connectedCallback(),this.cleanOptions=_s.parse(this.options),this.identifyIosDevice(),this.setInitialHtmlOverflow(),this.initialScrollPosition={x:0,y:0},this.onResizeHandler(),window.addEventListener("resize",this.onResizeHandler,{passive:!0})}disconnectedCallback(){super.disconnectedCallback(),To(this),window.removeEventListener("resize",this.onResizeHandler)}render(){const{placement:n,chatWindow:e}=this.cleanOptions.config,{height:t,cta:r}=this.cleanOptions.config.openChatButton,i=ep("chat-widget w-dvw h-dvh md:mx-8",Yp[e.width],Gp[e.height],this.isOpen?"":"invisible");return ie`
|
|
388
|
+
*/function Dt(n,e,t){return n?e(n):t==null?void 0:t(n)}const yl="-",kh=n=>{const e=Ah(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:i=>{const s=i.split(yl);return s[0]===""&&s.length!==1&&s.shift(),Co(s,e)||$h(i)},getConflictingClassGroupIds:(i,s)=>{const l=t[i]||[];return s&&r[i]?[...l,...r[i]]:l}}},Co=(n,e)=>{var t;if(n.length===0)return e.classGroupId;const r=n[0],i=e.nextPart.get(r),s=i?Co(n.slice(1),i):void 0;if(s)return s;if(e.validators.length===0)return;const l=n.join(yl);return(t=e.validators.find(({validator:a})=>a(l)))==null?void 0:t.classGroupId},Eo=/^\[(.+)\]$/,$h=n=>{if(Eo.test(n)){const e=Eo.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},Ah=n=>{const{theme:e,prefix:t}=n,r={nextPart:new Map,validators:[]};return Th(Object.entries(n.classGroups),t).forEach(([i,s])=>{vl(s,r,i,e)}),r},vl=(n,e,t,r)=>{n.forEach(i=>{if(typeof i=="string"){const s=i===""?e:Mo(e,i);s.classGroupId=t;return}if(typeof i=="function"){if(Sh(i)){vl(i(r),e,t,r);return}e.validators.push({validator:i,classGroupId:t});return}Object.entries(i).forEach(([s,l])=>{vl(l,Mo(e,s),t,r)})})},Mo=(n,e)=>{let t=n;return e.split(yl).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t},Sh=n=>n.isThemeGetter,Th=(n,e)=>e?n.map(([t,r])=>{const i=r.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([l,a])=>[e+l,a])):s);return[t,i]}):n,Ch=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;const i=(s,l)=>{t.set(s,l),e++,e>n&&(e=0,r=t,t=new Map)};return{get(s){let l=t.get(s);if(l!==void 0)return l;if((l=r.get(s))!==void 0)return i(s,l),l},set(s,l){t.has(s)?t.set(s,l):i(s,l)}}},Io="!",Eh=n=>{const{separator:e,experimentalParseClassName:t}=n,r=e.length===1,i=e[0],s=e.length,l=a=>{const o=[];let u=0,c=0,p;for(let Z=0;Z<a.length;Z++){let de=a[Z];if(u===0){if(de===i&&(r||a.slice(Z,Z+s)===e)){o.push(a.slice(c,Z)),c=Z+s;continue}if(de==="/"){p=Z;continue}}de==="["?u++:de==="]"&&u--}const d=o.length===0?a:a.substring(c),g=d.startsWith(Io),x=g?d.substring(1):d,j=p&&p>c?p-c:void 0;return{modifiers:o,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:j}};return t?a=>t({className:a,parseClassName:l}):l},Mh=n=>{if(n.length<=1)return n;const e=[];let t=[];return n.forEach(r=>{r[0]==="["?(e.push(...t.sort(),r),t=[]):t.push(r)}),e.push(...t.sort()),e},Ih=n=>({cache:Ch(n.cacheSize),parseClassName:Eh(n),...kh(n)}),Oh=/\s+/,Nh=(n,e)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:i}=e,s=[],l=n.trim().split(Oh);let a="";for(let o=l.length-1;o>=0;o-=1){const u=l[o],{modifiers:c,hasImportantModifier:p,baseClassName:d,maybePostfixModifierPosition:g}=t(u);let x=!!g,j=r(x?d.substring(0,g):d);if(!j){if(!x){a=u+(a.length>0?" "+a:a);continue}if(j=r(d),!j){a=u+(a.length>0?" "+a:a);continue}x=!1}const Z=Mh(c).join(":"),de=p?Z+Io:Z,me=de+j;if(s.includes(me))continue;s.push(me);const X=i(j,x);for(let Ie=0;Ie<X.length;++Ie){const Ae=X[Ie];s.push(de+Ae)}a=u+(a.length>0?" "+a:a)}return a};function Ph(){let n=0,e,t,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Oo(e))&&(r&&(r+=" "),r+=t);return r}const Oo=n=>{if(typeof n=="string")return n;let e,t="";for(let r=0;r<n.length;r++)n[r]&&(e=Oo(n[r]))&&(t&&(t+=" "),t+=e);return t};function Rh(n,...e){let t,r,i,s=l;function l(o){const u=e.reduce((c,p)=>p(c),n());return t=Ih(u),r=t.cache.get,i=t.cache.set,s=a,a(o)}function a(o){const u=r(o);if(u)return u;const c=Nh(o,t);return i(o,c),c}return function(){return s(Ph.apply(null,arguments))}}const Ce=n=>{const e=t=>t[n]||[];return e.isThemeGetter=!0,e},No=/^\[(?:([a-z-]+):)?(.+)\]$/i,Dh=/^\d+\/\d+$/,jh=new Set(["px","full","screen"]),Lh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zh=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,zh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Hh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Uh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jt=n=>rr(n)||jh.has(n)||Dh.test(n),Xt=n=>ir(n,"length",Gh),rr=n=>!!n&&!Number.isNaN(Number(n)),bl=n=>ir(n,"number",rr),ti=n=>!!n&&Number.isInteger(Number(n)),Vh=n=>n.endsWith("%")&&rr(n.slice(0,-1)),le=n=>No.test(n),en=n=>Lh.test(n),Bh=new Set(["length","size","percentage"]),Fh=n=>ir(n,Bh,Po),Wh=n=>ir(n,"position",Po),qh=new Set(["image","url"]),Kh=n=>ir(n,qh,Qh),Yh=n=>ir(n,"",Jh),ni=()=>!0,ir=(n,e,t)=>{const r=No.exec(n);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):t(r[2]):!1},Gh=n=>Zh.test(n)&&!zh.test(n),Po=()=>!1,Jh=n=>Hh.test(n),Qh=n=>Uh.test(n),Xh=()=>{const n=Ce("colors"),e=Ce("spacing"),t=Ce("blur"),r=Ce("brightness"),i=Ce("borderColor"),s=Ce("borderRadius"),l=Ce("borderSpacing"),a=Ce("borderWidth"),o=Ce("contrast"),u=Ce("grayscale"),c=Ce("hueRotate"),p=Ce("invert"),d=Ce("gap"),g=Ce("gradientColorStops"),x=Ce("gradientColorStopPositions"),j=Ce("inset"),Z=Ce("margin"),de=Ce("opacity"),me=Ce("padding"),X=Ce("saturate"),Ie=Ce("scale"),Ae=Ce("sepia"),U=Ce("skew"),qe=Ce("space"),xe=Ce("translate"),Ze=()=>["auto","contain","none"],G=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",le,e],ee=()=>[le,e],Qe=()=>["",jt,Xt],$=()=>["auto",rr,le],b=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],y=()=>["solid","dashed","dotted","double","none"],_=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],v=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",le],k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>[rr,le];return{cacheSize:500,separator:":",theme:{colors:[ni],spacing:[jt,Xt],blur:["none","",en,le],brightness:N(),borderColor:[n],borderRadius:["none","","full",en,le],borderSpacing:ee(),borderWidth:Qe(),contrast:N(),grayscale:A(),hueRotate:N(),invert:A(),gap:ee(),gradientColorStops:[n],gradientColorStopPositions:[Vh,Xt],inset:P(),margin:P(),opacity:N(),padding:ee(),saturate:N(),scale:N(),sepia:A(),skew:N(),space:ee(),translate:ee()},classGroups:{aspect:[{aspect:["auto","square","video",le]}],container:["container"],columns:[{columns:[en]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...b(),le]}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:Ze()}],"overscroll-x":[{"overscroll-x":Ze()}],"overscroll-y":[{"overscroll-y":Ze()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ti,le]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",le]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",ti,le]}],"grid-cols":[{"grid-cols":[ni]}],"col-start-end":[{col:["auto",{span:["full",ti,le]},le]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[ni]}],"row-start-end":[{row:["auto",{span:[ti,le]},le]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",le]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",le]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...v()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...v(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...v(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[me]}],px:[{px:[me]}],py:[{py:[me]}],ps:[{ps:[me]}],pe:[{pe:[me]}],pt:[{pt:[me]}],pr:[{pr:[me]}],pb:[{pb:[me]}],pl:[{pl:[me]}],m:[{m:[Z]}],mx:[{mx:[Z]}],my:[{my:[Z]}],ms:[{ms:[Z]}],me:[{me:[Z]}],mt:[{mt:[Z]}],mr:[{mr:[Z]}],mb:[{mb:[Z]}],ml:[{ml:[Z]}],"space-x":[{"space-x":[qe]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[qe]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",le,e]}],"min-w":[{"min-w":[le,e,"min","max","fit"]}],"max-w":[{"max-w":[le,e,"none","full","min","max","fit","prose",{screen:[en]},en]}],h:[{h:[le,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[le,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[le,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[le,e,"auto","min","max","fit"]}],"font-size":[{text:["base",en,Xt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",bl]}],"font-family":[{font:[ni]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",le]}],"line-clamp":[{"line-clamp":["none",rr,bl]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",jt,le]}],"list-image":[{"list-image":["none",le]}],"list-style-type":[{list:["none","disc","decimal",le]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[de]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[de]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",jt,Xt]}],"underline-offset":[{"underline-offset":["auto",jt,le]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ee()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[de]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...b(),Wh]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Fh]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Kh]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[de]}],"border-style":[{border:[...y(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[de]}],"divide-style":[{divide:y()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...y()]}],"outline-offset":[{"outline-offset":[jt,le]}],"outline-w":[{outline:[jt,Xt]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:Qe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[de]}],"ring-offset-w":[{"ring-offset":[jt,Xt]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",en,Yh]}],"shadow-color":[{shadow:[ni]}],opacity:[{opacity:[de]}],"mix-blend":[{"mix-blend":[..._(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":_()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[o]}],"drop-shadow":[{"drop-shadow":["","none",en,le]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[p]}],saturate:[{saturate:[X]}],sepia:[{sepia:[Ae]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[o]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[de]}],"backdrop-saturate":[{"backdrop-saturate":[X]}],"backdrop-sepia":[{"backdrop-sepia":[Ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",le]}],duration:[{duration:N()}],ease:[{ease:["linear","in","out","in-out",le]}],delay:[{delay:N()}],animate:[{animate:["none","spin","ping","pulse","bounce",le]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[Ie]}],"scale-x":[{"scale-x":[Ie]}],"scale-y":[{"scale-y":[Ie]}],rotate:[{rotate:[ti,le]}],"translate-x":[{"translate-x":[xe]}],"translate-y":[{"translate-y":[xe]}],"skew-x":[{"skew-x":[U]}],"skew-y":[{"skew-y":[U]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",le]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",le]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ee()}],"scroll-mx":[{"scroll-mx":ee()}],"scroll-my":[{"scroll-my":ee()}],"scroll-ms":[{"scroll-ms":ee()}],"scroll-me":[{"scroll-me":ee()}],"scroll-mt":[{"scroll-mt":ee()}],"scroll-mr":[{"scroll-mr":ee()}],"scroll-mb":[{"scroll-mb":ee()}],"scroll-ml":[{"scroll-ml":ee()}],"scroll-p":[{"scroll-p":ee()}],"scroll-px":[{"scroll-px":ee()}],"scroll-py":[{"scroll-py":ee()}],"scroll-ps":[{"scroll-ps":ee()}],"scroll-pe":[{"scroll-pe":ee()}],"scroll-pt":[{"scroll-pt":ee()}],"scroll-pr":[{"scroll-pr":ee()}],"scroll-pb":[{"scroll-pb":ee()}],"scroll-pl":[{"scroll-pl":ee()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",le]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[jt,Xt,bl]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},ep=Rh(Xh);var tp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ro(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var wl={};(function(n){function e(a){a&&a.options&&clearTimeout(a.options.timer)}function t(a,o,u,c){var p={timer:void 0,lastArgs:[]},d=function(){for(var g=this,x=[],j=0;j<arguments.length;j++)x[j]=arguments[j];p.lastArgs=x,p.timer?clearTimeout(p.timer):o&&u.apply(this,p.lastArgs),p.timer=setTimeout(function(){o||u.apply(g,p.lastArgs),p.timer=void 0},a)};return c&&(d=d.bind(c)),d.options=p,d}function r(a,o,u,c){var p;Object.defineProperty(u,c,{configurable:!0,enumerable:!1,get:function(){return p},set:function(d){p=t(a,o,d,this)}})}function i(a,o,u){var c=u.value;return u.value=t(a,o,c),u}function s(a,o){for(var u=[],c=2;c<arguments.length;c++)u[c-2]=arguments[c];if(u.length===0)throw new Error("function applied debounce decorator should be a method");if(u.length===1)throw new Error("method applied debounce decorator should have valid name");var p=u[0],d=u[1],g=u.length===3&&u[2]?u[2]:Object.getOwnPropertyDescriptor(p,d);if(g)return i(a,o,g);r(a,o,p,d)}function l(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];var u=500,c=!1;if(a.length&&(typeof a[0]=="number"||typeof a[0]=="object"&&a[0].leading!==void 0)){typeof a[0]=="number"&&(u=a[0]);var p=void 0;return typeof a[0]=="object"&&a[0].leading!==void 0&&(p=a[0]),1<a.length&&typeof a[1]=="object"&&a[1].leading!==void 0&&(p=a[1]),p&&(c=p.leading),function(){for(var d=[],g=0;g<arguments.length;g++)d[g]=arguments[g];return s.apply(void 0,[u,c].concat(d))}}return s.apply(void 0,[u,c].concat(a))}Object.defineProperty(n,"__esModule",{value:!0}),n.cancel=e,n.debounce=l})(wl);var ge;(function(n){n.assertEqual=i=>i;function e(i){}n.assertIs=e;function t(i){throw new Error}n.assertNever=t,n.arrayToEnum=i=>{const s={};for(const l of i)s[l]=l;return s},n.getValidEnumValues=i=>{const s=n.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),l={};for(const a of s)l[a]=i[a];return n.objectValues(l)},n.objectValues=i=>n.objectKeys(i).map(function(s){return i[s]}),n.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const l in i)Object.prototype.hasOwnProperty.call(i,l)&&s.push(l);return s},n.find=(i,s)=>{for(const l of i)if(s(l))return l},n.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(l=>typeof l=="string"?`'${l}'`:l).join(s)}n.joinValues=r,n.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(ge||(ge={}));var _l;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(_l||(_l={}));const I=ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tn=n=>{switch(typeof n){case"undefined":return I.undefined;case"string":return I.string;case"number":return isNaN(n)?I.nan:I.number;case"boolean":return I.boolean;case"function":return I.function;case"bigint":return I.bigint;case"symbol":return I.symbol;case"object":return Array.isArray(n)?I.array:n===null?I.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?I.promise:typeof Map<"u"&&n instanceof Map?I.map:typeof Set<"u"&&n instanceof Set?I.set:typeof Date<"u"&&n instanceof Date?I.date:I.object;default:return I.unknown}},C=ge.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"]),np=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class ft extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const l of s.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)r._errors.push(t(l));else{let a=r,o=0;for(;o<l.path.length;){const u=l.path[o];o===l.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(l))):a[u]=a[u]||{_errors:[]},a=a[u],o++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}ft.create=n=>new ft(n);const ri=(n,e)=>{let t;switch(n.code){case C.invalid_type:n.received===I.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case C.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,ge.jsonStringifyReplacer)}`;break;case C.unrecognized_keys:t=`Unrecognized key(s) in object: ${ge.joinValues(n.keys,", ")}`;break;case C.invalid_union:t="Invalid input";break;case C.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${ge.joinValues(n.options)}`;break;case C.invalid_enum_value:t=`Invalid enum value. Expected ${ge.joinValues(n.options)}, received '${n.received}'`;break;case C.invalid_arguments:t="Invalid function arguments";break;case C.invalid_return_type:t="Invalid function return type";break;case C.invalid_date:t="Invalid date";break;case C.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:ge.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case C.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case C.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case C.custom:t="Invalid input";break;case C.invalid_intersection_types:t="Intersection results could not be merged";break;case C.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case C.not_finite:t="Number must be finite";break;default:t=e.defaultError,ge.assertNever(n)}return{message:t}};let Do=ri;function rp(n){Do=n}function cs(){return Do}const ds=n=>{const{data:e,path:t,errorMaps:r,issueData:i}=n,s=[...t,...i.path||[]],l={...i,path:s};let a="";const o=r.filter(u=>!!u).slice().reverse();for(const u of o)a=u(l,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},ip=[];function D(n,e){const t=ds({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,cs(),ri].filter(r=>!!r)});n.common.issues.push(t)}class Je{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const i of t){if(i.status==="aborted")return Q;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const i of t)r.push({key:await i.key,value:await i.value});return Je.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const i of t){const{key:s,value:l}=i;if(s.status==="aborted"||l.status==="aborted")return Q;s.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(r[s.value]=l.value)}return{status:e.value,value:r}}}const Q=Object.freeze({status:"aborted"}),jo=n=>({status:"dirty",value:n}),tt=n=>({status:"valid",value:n}),xl=n=>n.status==="aborted",kl=n=>n.status==="dirty",ii=n=>n.status==="valid",hs=n=>typeof Promise<"u"&&n instanceof Promise;var F;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(F||(F={}));class Ct{constructor(e,t,r,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Lo=(n,e)=>{if(ii(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ft(n.common.issues);return this._error=t,this._error}}};function re(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:i}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,l)=>s.code!=="invalid_type"?{message:l.defaultError}:typeof l.data>"u"?{message:r??l.defaultError}:{message:t??l.defaultError},description:i}}class oe{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return tn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:tn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Je,ctx:{common:e.parent.common,data:e.data,parsedType:tn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(hs(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){var r;const i={common:{issues:[],async:(r=t==null?void 0:t.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tn(e)},s=this._parseSync({data:e,path:i.path,parent:i});return Lo(i,s)}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==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tn(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(hs(i)?i:Promise.resolve(i));return Lo(r,s)}refine(e,t){const r=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,s)=>{const l=e(i),a=()=>s.addIssue({code:C.custom,...r(i)});return typeof Promise<"u"&&l instanceof Promise?l.then(o=>o?!0:(a(),!1)):l?!0:(a(),!1)})}refinement(e,t){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof t=="function"?t(r,i):t),!1))}_refinement(e){return new yt({schema:this,typeName:q.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Zt.create(this,this._def)}nullable(){return Pn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return gt.create(this,this._def)}promise(){return or.create(this,this._def)}or(e){return oi.create([this,e],this._def)}and(e){return ui.create(this,e,this._def)}transform(e){return new yt({...re(this._def),schema:this,typeName:q.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new fi({...re(this._def),innerType:this,defaultValue:t,typeName:q.ZodDefault})}brand(){return new zo({typeName:q.ZodBranded,type:this,...re(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new vs({...re(this._def),innerType:this,catchValue:t,typeName:q.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return mi.create(this,e)}readonly(){return ws.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const sp=/^c[^\s-]{8,}$/i,lp=/^[a-z][a-z0-9]*$/,ap=/^[0-9A-HJKMNP-TV-Z]{26}$/,op=/^[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,up=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let $l;const dp=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,hp=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,pp=n=>n.precision?n.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${n.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${n.precision}}Z$`):n.precision===0?n.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):n.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function fp(n,e){return!!((e==="v4"||!e)&&dp.test(n)||(e==="v6"||!e)&&hp.test(n))}class mt extends oe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==I.string){const i=this._getOrReturnCtx(e);return D(i,{code:C.invalid_type,expected:I.string,received:i.parsedType}),Q}const t=new Je;let r;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:C.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if(i.kind==="max")e.data.length>i.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:C.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,l=e.data.length<i.value;(s||l)&&(r=this._getOrReturnCtx(e,r),s?D(r,{code:C.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&D(r,{code:C.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if(i.kind==="email")up.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"email",code:C.invalid_string,message:i.message}),t.dirty());else if(i.kind==="emoji")$l||($l=new RegExp(cp,"u")),$l.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"emoji",code:C.invalid_string,message:i.message}),t.dirty());else if(i.kind==="uuid")op.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"uuid",code:C.invalid_string,message:i.message}),t.dirty());else if(i.kind==="cuid")sp.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cuid",code:C.invalid_string,message:i.message}),t.dirty());else if(i.kind==="cuid2")lp.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"cuid2",code:C.invalid_string,message:i.message}),t.dirty());else if(i.kind==="ulid")ap.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"ulid",code:C.invalid_string,message:i.message}),t.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),D(r,{validation:"url",code:C.invalid_string,message:i.message}),t.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"regex",code:C.invalid_string,message:i.message}),t.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(e,r),D(r,{code:C.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),t.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)||(r=this._getOrReturnCtx(e,r),D(r,{code:C.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(r=this._getOrReturnCtx(e,r),D(r,{code:C.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty()):i.kind==="datetime"?pp(i).test(e.data)||(r=this._getOrReturnCtx(e,r),D(r,{code:C.invalid_string,validation:"datetime",message:i.message}),t.dirty()):i.kind==="ip"?fp(e.data,i.version)||(r=this._getOrReturnCtx(e,r),D(r,{validation:"ip",code:C.invalid_string,message:i.message}),t.dirty()):ge.assertNever(i);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement(i=>e.test(i),{validation:t,code:C.invalid_string,...F.errToObj(r)})}_addCheck(e){return new mt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...F.errToObj(e)})}url(e){return this._addCheck({kind:"url",...F.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...F.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...F.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...F.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...F.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...F.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...F.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,...F.errToObj(e==null?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...F.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...F.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...F.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...F.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...F.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...F.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...F.errToObj(t)})}nonempty(e){return this.min(1,F.errToObj(e))}trim(){return new mt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new mt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new mt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}mt.create=n=>{var e;return new mt({checks:[],typeName:q.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...re(n)})};function mp(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=t>r?t:r,s=parseInt(n.toFixed(i).replace(".","")),l=parseInt(e.toFixed(i).replace(".",""));return s%l/Math.pow(10,i)}class nn extends oe{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)!==I.number){const i=this._getOrReturnCtx(e);return D(i,{code:C.invalid_type,expected:I.number,received:i.parsedType}),Q}let t;const r=new Je;for(const i of this._def.checks)i.kind==="int"?ge.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),D(t,{code:C.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),D(t,{code:C.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),D(t,{code:C.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?mp(e.data,i.value)!==0&&(t=this._getOrReturnCtx(e,t),D(t,{code:C.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),D(t,{code:C.not_finite,message:i.message}),r.dirty()):ge.assertNever(i);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,F.toString(t))}gt(e,t){return this.setLimit("min",e,!1,F.toString(t))}lte(e,t){return this.setLimit("max",e,!0,F.toString(t))}lt(e,t){return this.setLimit("max",e,!1,F.toString(t))}setLimit(e,t,r,i){return new nn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:F.toString(i)}]})}_addCheck(e){return new nn({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:F.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:F.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:F.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:F.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:F.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:F.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:F.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:F.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:F.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ge.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}nn.create=n=>new nn({checks:[],typeName:q.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...re(n)});class rn extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==I.bigint){const i=this._getOrReturnCtx(e);return D(i,{code:C.invalid_type,expected:I.bigint,received:i.parsedType}),Q}let t;const r=new Je;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),D(t,{code:C.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),D(t,{code:C.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),D(t,{code:C.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):ge.assertNever(i);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,F.toString(t))}gt(e,t){return this.setLimit("min",e,!1,F.toString(t))}lte(e,t){return this.setLimit("max",e,!0,F.toString(t))}lt(e,t){return this.setLimit("max",e,!1,F.toString(t))}setLimit(e,t,r,i){return new rn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:F.toString(i)}]})}_addCheck(e){return new rn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:F.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:F.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:F.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:F.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:F.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}rn.create=n=>{var e;return new rn({checks:[],typeName:q.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,...re(n)})};class si extends oe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==I.boolean){const t=this._getOrReturnCtx(e);return D(t,{code:C.invalid_type,expected:I.boolean,received:t.parsedType}),Q}return tt(e.data)}}si.create=n=>new si({typeName:q.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...re(n)});class In extends oe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==I.date){const i=this._getOrReturnCtx(e);return D(i,{code:C.invalid_type,expected:I.date,received:i.parsedType}),Q}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return D(i,{code:C.invalid_date}),Q}const t=new Je;let r;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:C.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),t.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(r=this._getOrReturnCtx(e,r),D(r,{code:C.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),t.dirty()):ge.assertNever(i);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new In({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:F.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:F.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}In.create=n=>new In({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:q.ZodDate,...re(n)});class ps extends oe{_parse(e){if(this._getType(e)!==I.symbol){const t=this._getOrReturnCtx(e);return D(t,{code:C.invalid_type,expected:I.symbol,received:t.parsedType}),Q}return tt(e.data)}}ps.create=n=>new ps({typeName:q.ZodSymbol,...re(n)});class li extends oe{_parse(e){if(this._getType(e)!==I.undefined){const t=this._getOrReturnCtx(e);return D(t,{code:C.invalid_type,expected:I.undefined,received:t.parsedType}),Q}return tt(e.data)}}li.create=n=>new li({typeName:q.ZodUndefined,...re(n)});class ai extends oe{_parse(e){if(this._getType(e)!==I.null){const t=this._getOrReturnCtx(e);return D(t,{code:C.invalid_type,expected:I.null,received:t.parsedType}),Q}return tt(e.data)}}ai.create=n=>new ai({typeName:q.ZodNull,...re(n)});class sr extends oe{constructor(){super(...arguments),this._any=!0}_parse(e){return tt(e.data)}}sr.create=n=>new sr({typeName:q.ZodAny,...re(n)});class On extends oe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return tt(e.data)}}On.create=n=>new On({typeName:q.ZodUnknown,...re(n)});class Lt extends oe{_parse(e){const t=this._getOrReturnCtx(e);return D(t,{code:C.invalid_type,expected:I.never,received:t.parsedType}),Q}}Lt.create=n=>new Lt({typeName:q.ZodNever,...re(n)});class fs extends oe{_parse(e){if(this._getType(e)!==I.undefined){const t=this._getOrReturnCtx(e);return D(t,{code:C.invalid_type,expected:I.void,received:t.parsedType}),Q}return tt(e.data)}}fs.create=n=>new fs({typeName:q.ZodVoid,...re(n)});class gt extends oe{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),i=this._def;if(t.parsedType!==I.array)return D(t,{code:C.invalid_type,expected:I.array,received:t.parsedType}),Q;if(i.exactLength!==null){const l=t.data.length>i.exactLength.value,a=t.data.length<i.exactLength.value;(l||a)&&(D(t,{code:l?C.too_big:C.too_small,minimum:a?i.exactLength.value:void 0,maximum:l?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(D(t,{code:C.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(D(t,{code:C.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((l,a)=>i.type._parseAsync(new Ct(t,l,t.path,a)))).then(l=>Je.mergeArray(r,l));const s=[...t.data].map((l,a)=>i.type._parseSync(new Ct(t,l,t.path,a)));return Je.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new gt({...this._def,minLength:{value:e,message:F.toString(t)}})}max(e,t){return new gt({...this._def,maxLength:{value:e,message:F.toString(t)}})}length(e,t){return new gt({...this._def,exactLength:{value:e,message:F.toString(t)}})}nonempty(e){return this.min(1,e)}}gt.create=(n,e)=>new gt({type:n,minLength:null,maxLength:null,exactLength:null,typeName:q.ZodArray,...re(e)});function lr(n){if(n instanceof Pe){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=Zt.create(lr(r))}return new Pe({...n._def,shape:()=>e})}else return n instanceof gt?new gt({...n._def,type:lr(n.element)}):n instanceof Zt?Zt.create(lr(n.unwrap())):n instanceof Pn?Pn.create(lr(n.unwrap())):n instanceof Et?Et.create(n.items.map(e=>lr(e))):n}class Pe extends oe{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(),t=ge.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==I.object){const o=this._getOrReturnCtx(e);return D(o,{code:C.invalid_type,expected:I.object,received:o.parsedType}),Q}const{status:t,ctx:r}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),l=[];if(!(this._def.catchall instanceof Lt&&this._def.unknownKeys==="strip"))for(const o in r.data)s.includes(o)||l.push(o);const a=[];for(const o of s){const u=i[o],c=r.data[o];a.push({key:{status:"valid",value:o},value:u._parse(new Ct(r,c,r.path,o)),alwaysSet:o in r.data})}if(this._def.catchall instanceof Lt){const o=this._def.unknownKeys;if(o==="passthrough")for(const u of l)a.push({key:{status:"valid",value:u},value:{status:"valid",value:r.data[u]}});else if(o==="strict")l.length>0&&(D(r,{code:C.unrecognized_keys,keys:l}),t.dirty());else if(o!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const o=this._def.catchall;for(const u of l){const c=r.data[u];a.push({key:{status:"valid",value:u},value:o._parse(new Ct(r,c,r.path,u)),alwaysSet:u in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const o=[];for(const u of a){const c=await u.key;o.push({key:c,value:await u.value,alwaysSet:u.alwaysSet})}return o}).then(o=>Je.mergeObjectSync(t,o)):Je.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return F.errToObj,new Pe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var i,s,l,a;const o=(l=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,t,r).message)!==null&&l!==void 0?l:r.defaultError;return t.code==="unrecognized_keys"?{message:(a=F.errToObj(e).message)!==null&&a!==void 0?a:o}:{message:o}}}:{}})}strip(){return new Pe({...this._def,unknownKeys:"strip"})}passthrough(){return new Pe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Pe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Pe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:q.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Pe({...this._def,catchall:e})}pick(e){const t={};return ge.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new Pe({...this._def,shape:()=>t})}omit(e){const t={};return ge.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new Pe({...this._def,shape:()=>t})}deepPartial(){return lr(this)}partial(e){const t={};return ge.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?t[r]=i:t[r]=i.optional()}),new Pe({...this._def,shape:()=>t})}required(e){const t={};return ge.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Zt;)i=i._def.innerType;t[r]=i}}),new Pe({...this._def,shape:()=>t})}keyof(){return Zo(ge.objectKeys(this.shape))}}Pe.create=(n,e)=>new Pe({shape:()=>n,unknownKeys:"strip",catchall:Lt.create(),typeName:q.ZodObject,...re(e)}),Pe.strictCreate=(n,e)=>new Pe({shape:()=>n,unknownKeys:"strict",catchall:Lt.create(),typeName:q.ZodObject,...re(e)}),Pe.lazycreate=(n,e)=>new Pe({shape:n,unknownKeys:"strip",catchall:Lt.create(),typeName:q.ZodObject,...re(e)});class oi extends oe{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;const l=s.map(a=>new ft(a.ctx.common.issues));return D(t,{code:C.invalid_union,unionErrors:l}),Q}if(t.common.async)return Promise.all(r.map(async s=>{const l={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(i);{let s;const l=[];for(const o of r){const u={...t,common:{...t.common,issues:[]},parent:null},c=o._parseSync({data:t.data,path:t.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:u}),u.common.issues.length&&l.push(u.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const a=l.map(o=>new ft(o));return D(t,{code:C.invalid_union,unionErrors:a}),Q}}get options(){return this._def.options}}oi.create=(n,e)=>new oi({options:n,typeName:q.ZodUnion,...re(e)});const ms=n=>n instanceof di?ms(n.schema):n instanceof yt?ms(n.innerType()):n instanceof hi?[n.value]:n instanceof sn?n.options:n instanceof pi?Object.keys(n.enum):n instanceof fi?ms(n._def.innerType):n instanceof li?[void 0]:n instanceof ai?[null]:null;class gs extends oe{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.object)return D(t,{code:C.invalid_type,expected:I.object,received:t.parsedType}),Q;const r=this.discriminator,i=t.data[r],s=this.optionsMap.get(i);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(D(t,{code:C.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const i=new Map;for(const s of t){const l=ms(s.shape[e]);if(!l)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of l){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new gs({typeName:q.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...re(r)})}}function Al(n,e){const t=tn(n),r=tn(e);if(n===e)return{valid:!0,data:n};if(t===I.object&&r===I.object){const i=ge.objectKeys(e),s=ge.objectKeys(n).filter(a=>i.indexOf(a)!==-1),l={...n,...e};for(const a of s){const o=Al(n[a],e[a]);if(!o.valid)return{valid:!1};l[a]=o.data}return{valid:!0,data:l}}else if(t===I.array&&r===I.array){if(n.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<n.length;s++){const l=n[s],a=e[s],o=Al(l,a);if(!o.valid)return{valid:!1};i.push(o.data)}return{valid:!0,data:i}}else return t===I.date&&r===I.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class ui extends oe{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),i=(s,l)=>{if(xl(s)||xl(l))return Q;const a=Al(s.value,l.value);return a.valid?((kl(s)||kl(l))&&t.dirty(),{status:t.value,value:a.data}):(D(r,{code:C.invalid_intersection_types}),Q)};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(([s,l])=>i(s,l)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ui.create=(n,e,t)=>new ui({left:n,right:e,typeName:q.ZodIntersection,...re(t)});class Et extends oe{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==I.array)return D(r,{code:C.invalid_type,expected:I.array,received:r.parsedType}),Q;if(r.data.length<this._def.items.length)return D(r,{code:C.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&r.data.length>this._def.items.length&&(D(r,{code:C.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...r.data].map((s,l)=>{const a=this._def.items[l]||this._def.rest;return a?a._parse(new Ct(r,s,r.path,l)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>Je.mergeArray(t,s)):Je.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new Et({...this._def,rest:e})}}Et.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Et({items:n,typeName:q.ZodTuple,rest:null,...re(e)})};class ci extends oe{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!==I.object)return D(r,{code:C.invalid_type,expected:I.object,received:r.parsedType}),Q;const i=[],s=this._def.keyType,l=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new Ct(r,a,r.path,a)),value:l._parse(new Ct(r,r.data[a],r.path,a))});return r.common.async?Je.mergeObjectAsync(t,i):Je.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof oe?new ci({keyType:e,valueType:t,typeName:q.ZodRecord,...re(r)}):new ci({keyType:mt.create(),valueType:e,typeName:q.ZodRecord,...re(t)})}}class ys extends oe{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!==I.map)return D(r,{code:C.invalid_type,expected:I.map,received:r.parsedType}),Q;const i=this._def.keyType,s=this._def.valueType,l=[...r.data.entries()].map(([a,o],u)=>({key:i._parse(new Ct(r,a,r.path,[u,"key"])),value:s._parse(new Ct(r,o,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const o of l){const u=await o.key,c=await o.value;if(u.status==="aborted"||c.status==="aborted")return Q;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}})}else{const a=new Map;for(const o of l){const u=o.key,c=o.value;if(u.status==="aborted"||c.status==="aborted")return Q;(u.status==="dirty"||c.status==="dirty")&&t.dirty(),a.set(u.value,c.value)}return{status:t.value,value:a}}}}ys.create=(n,e,t)=>new ys({valueType:e,keyType:n,typeName:q.ZodMap,...re(t)});class Nn extends oe{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==I.set)return D(r,{code:C.invalid_type,expected:I.set,received:r.parsedType}),Q;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(D(r,{code:C.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(D(r,{code:C.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const s=this._def.valueType;function l(o){const u=new Set;for(const c of o){if(c.status==="aborted")return Q;c.status==="dirty"&&t.dirty(),u.add(c.value)}return{status:t.value,value:u}}const a=[...r.data.values()].map((o,u)=>s._parse(new Ct(r,o,r.path,u)));return r.common.async?Promise.all(a).then(o=>l(o)):l(a)}min(e,t){return new Nn({...this._def,minSize:{value:e,message:F.toString(t)}})}max(e,t){return new Nn({...this._def,maxSize:{value:e,message:F.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Nn.create=(n,e)=>new Nn({valueType:n,minSize:null,maxSize:null,typeName:q.ZodSet,...re(e)});class ar extends oe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.function)return D(t,{code:C.invalid_type,expected:I.function,received:t.parsedType}),Q;function r(a,o){return ds({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,cs(),ri].filter(u=>!!u),issueData:{code:C.invalid_arguments,argumentsError:o}})}function i(a,o){return ds({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,cs(),ri].filter(u=>!!u),issueData:{code:C.invalid_return_type,returnTypeError:o}})}const s={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof or){const a=this;return tt(async function(...o){const u=new ft([]),c=await a._def.args.parseAsync(o,s).catch(d=>{throw u.addIssue(r(o,d)),u}),p=await Reflect.apply(l,this,c);return await a._def.returns._def.type.parseAsync(p,s).catch(d=>{throw u.addIssue(i(p,d)),u})})}else{const a=this;return tt(function(...o){const u=a._def.args.safeParse(o,s);if(!u.success)throw new ft([r(o,u.error)]);const c=Reflect.apply(l,this,u.data),p=a._def.returns.safeParse(c,s);if(!p.success)throw new ft([i(c,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ar({...this._def,args:Et.create(e).rest(On.create())})}returns(e){return new ar({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ar({args:e||Et.create([]).rest(On.create()),returns:t||On.create(),typeName:q.ZodFunction,...re(r)})}}class di extends oe{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})}}di.create=(n,e)=>new di({getter:n,typeName:q.ZodLazy,...re(e)});class hi extends oe{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return D(t,{received:t.data,code:C.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}}hi.create=(n,e)=>new hi({value:n,typeName:q.ZodLiteral,...re(e)});function Zo(n,e){return new sn({values:n,typeName:q.ZodEnum,...re(e)})}class sn extends oe{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return D(t,{expected:ge.joinValues(r),received:t.parsedType,code:C.invalid_type}),Q}if(this._def.values.indexOf(e.data)===-1){const t=this._getOrReturnCtx(e),r=this._def.values;return D(t,{received:t.data,code:C.invalid_enum_value,options:r}),Q}return tt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return sn.create(e)}exclude(e){return sn.create(this.options.filter(t=>!e.includes(t)))}}sn.create=Zo;class pi extends oe{_parse(e){const t=ge.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==I.string&&r.parsedType!==I.number){const i=ge.objectValues(t);return D(r,{expected:ge.joinValues(i),received:r.parsedType,code:C.invalid_type}),Q}if(t.indexOf(e.data)===-1){const i=ge.objectValues(t);return D(r,{received:r.data,code:C.invalid_enum_value,options:i}),Q}return tt(e.data)}get enum(){return this._def.values}}pi.create=(n,e)=>new pi({values:n,typeName:q.ZodNativeEnum,...re(e)});class or extends oe{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.promise&&t.common.async===!1)return D(t,{code:C.invalid_type,expected:I.promise,received:t.parsedType}),Q;const r=t.parsedType===I.promise?t.data:Promise.resolve(t.data);return tt(r.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}or.create=(n,e)=>new or({type:n,typeName:q.ZodPromise,...re(e)});class yt extends oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:l=>{D(r,l),l.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const l=i.transform(r.data,s);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(l).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:l,path:r.path,parent:r})}if(i.type==="refinement"){const l=a=>{const o=i.refinement(a,s);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 a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Q:(a.status==="dirty"&&t.dirty(),l(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Q:(a.status==="dirty"&&t.dirty(),l(a.value).then(()=>({status:t.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ii(l))return l;const a=i.transform(l.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>ii(l)?Promise.resolve(i.transform(l.value,s)).then(a=>({status:t.value,value:a})):l);ge.assertNever(i)}}yt.create=(n,e,t)=>new yt({schema:n,typeName:q.ZodEffects,effect:e,...re(t)}),yt.createWithPreprocess=(n,e,t)=>new yt({schema:e,effect:{type:"preprocess",transform:n},typeName:q.ZodEffects,...re(t)});class Zt extends oe{_parse(e){return this._getType(e)===I.undefined?tt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Zt.create=(n,e)=>new Zt({innerType:n,typeName:q.ZodOptional,...re(e)});class Pn extends oe{_parse(e){return this._getType(e)===I.null?tt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Pn.create=(n,e)=>new Pn({innerType:n,typeName:q.ZodNullable,...re(e)});class fi extends oe{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===I.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}fi.create=(n,e)=>new fi({innerType:n,typeName:q.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...re(e)});class vs extends oe{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return hs(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ft(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ft(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}vs.create=(n,e)=>new vs({innerType:n,typeName:q.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...re(e)});class bs extends oe{_parse(e){if(this._getType(e)!==I.nan){const t=this._getOrReturnCtx(e);return D(t,{code:C.invalid_type,expected:I.nan,received:t.parsedType}),Q}return{status:"valid",value:e.data}}}bs.create=n=>new bs({typeName:q.ZodNaN,...re(n)});const gp=Symbol("zod_brand");class zo extends oe{_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}}class mi extends oe{_parse(e){const{status:t,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"?Q:i.status==="dirty"?(t.dirty(),jo(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Q:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,t){return new mi({in:e,out:t,typeName:q.ZodPipeline})}}class ws extends oe{_parse(e){const t=this._def.innerType._parse(e);return ii(t)&&(t.value=Object.freeze(t.value)),t}}ws.create=(n,e)=>new ws({innerType:n,typeName:q.ZodReadonly,...re(e)});const Ho=(n,e={},t)=>n?sr.create().superRefine((r,i)=>{var s,l;if(!n(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,o=(l=(s=a.fatal)!==null&&s!==void 0?s:t)!==null&&l!==void 0?l:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:o})}}):sr.create(),yp={object:Pe.lazycreate};var q;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(q||(q={}));const vp=(n,e={message:`Input not instance of ${n.name}`})=>Ho(t=>t instanceof n,e),Uo=mt.create,Vo=nn.create,bp=bs.create,wp=rn.create,Bo=si.create,_p=In.create,xp=ps.create,kp=li.create,$p=ai.create,Ap=sr.create,Sp=On.create,Tp=Lt.create,Cp=fs.create,Ep=gt.create,Mp=Pe.create,Ip=Pe.strictCreate,Op=oi.create,Np=gs.create,Pp=ui.create,Rp=Et.create,Dp=ci.create,jp=ys.create,Lp=Nn.create,Zp=ar.create,zp=di.create,Hp=hi.create,Up=sn.create,Vp=pi.create,Bp=or.create,Fo=yt.create,Fp=Zt.create,Wp=Pn.create,qp=yt.createWithPreprocess,Kp=mi.create;var O=Object.freeze({__proto__:null,defaultErrorMap:ri,setErrorMap:rp,getErrorMap:cs,makeIssue:ds,EMPTY_PATH:ip,addIssueToContext:D,ParseStatus:Je,INVALID:Q,DIRTY:jo,OK:tt,isAborted:xl,isDirty:kl,isValid:ii,isAsync:hs,get util(){return ge},get objectUtil(){return _l},ZodParsedType:I,getParsedType:tn,ZodType:oe,ZodString:mt,ZodNumber:nn,ZodBigInt:rn,ZodBoolean:si,ZodDate:In,ZodSymbol:ps,ZodUndefined:li,ZodNull:ai,ZodAny:sr,ZodUnknown:On,ZodNever:Lt,ZodVoid:fs,ZodArray:gt,ZodObject:Pe,ZodUnion:oi,ZodDiscriminatedUnion:gs,ZodIntersection:ui,ZodTuple:Et,ZodRecord:ci,ZodMap:ys,ZodSet:Nn,ZodFunction:ar,ZodLazy:di,ZodLiteral:hi,ZodEnum:sn,ZodNativeEnum:pi,ZodPromise:or,ZodEffects:yt,ZodTransformer:yt,ZodOptional:Zt,ZodNullable:Pn,ZodDefault:fi,ZodCatch:vs,ZodNaN:bs,BRAND:gp,ZodBranded:zo,ZodPipeline:mi,ZodReadonly:ws,custom:Ho,Schema:oe,ZodSchema:oe,late:yp,get ZodFirstPartyTypeKind(){return q},coerce:{string:n=>mt.create({...n,coerce:!0}),number:n=>nn.create({...n,coerce:!0}),boolean:n=>si.create({...n,coerce:!0}),bigint:n=>rn.create({...n,coerce:!0}),date:n=>In.create({...n,coerce:!0})},any:Ap,array:Ep,bigint:wp,boolean:Bo,date:_p,discriminatedUnion:Np,effect:Fo,enum:Up,function:Zp,instanceof:vp,intersection:Pp,lazy:zp,literal:Hp,map:jp,nan:bp,nativeEnum:Vp,never:Tp,null:$p,nullable:Wp,number:Vo,object:Mp,oboolean:()=>Bo().optional(),onumber:()=>Vo().optional(),optional:Fp,ostring:()=>Uo().optional(),pipeline:Kp,preprocess:qp,promise:Bp,record:Dp,set:Lp,strictObject:Ip,string:Uo,symbol:xp,transformer:Fo,tuple:Rp,undefined:kp,union:Op,unknown:Sp,void:Cp,NEVER:Q,ZodIssueCode:C,quotelessJson:np,ZodError:ft});const Yp={sm:"md:w-[350px]",md:"md:w-[500px]",lg:"md:w-[760px]",xl:"md:w-[900px]",xxl:"md:w-[1200px]"},Gp={sm:"md:h-[400px]",md:"md:h-[500px]",lg:"md:h-[600px]",xl:"md:h-[700px]",xxl:"md:h-[800px]"},_s=O.object({assistantId:O.string(),clientId:O.string().optional(),params:O.record(O.any()).default({}),config:O.object({historyKey:O.string().refine(n=>n.replace(/-/g,"_")).nullable().default("main"),welcomeMessage:O.string().default("Hello! How can I help you today?"),focusOnOpen:O.boolean().default(!0),inactivityWarningMessage:O.string().default("Are you still there? The chat will end soon if we don't hear from you."),chatEndedMessage:O.string().default("Chat Ended"),resetEndedChatOnLoad:O.boolean().default(!1),disableMessageRating:O.boolean().default(!1),initialReplyMessage:O.string().nullable().default(null),disclaimerMessage:O.string().nullable().default(null),disclaimerPopover:O.object({message:O.string().nullable().default(null),agreeButtonText:O.string().default("I Agree"),rememberDurationMinutes:O.number().default(60*24*3)}).default({}),placement:O.enum(["left","right"]).default("right"),openChatButton:O.object({imageSrc:O.string().nullable().default(null),width:O.union([O.string(),O.number()]).default("48px"),height:O.union([O.string(),O.number()]).default("48px"),cta:O.string().nullable().default(null)}).default({}),chatWindow:O.object({width:O.enum(["sm","md","lg","xl","xxl"]).default("sm"),height:O.enum(["sm","md","lg","xl","xxl"]).default("md"),header:O.object({text:O.string().nullable().default("AI Chat"),imageSrc:O.string().nullable().default(null)}).default({}),showCloseButton:O.boolean().default(!0)}).default({}),styles:O.object({primaryColor:O.string().nullable().default(null),textColor:O.string().nullable().default(null),linkColor:O.string().nullable().default(null),openChatButton:O.object({backgroundColor:O.string().nullable().default(null),iconColor:O.string().nullable().default(null)}).default({}),header:O.object({backgroundColor:O.string().nullable().default(null),textColor:O.string().nullable().default(null)}).default({}),button:O.object({backgroundColor:O.string().nullable().default(null),textColor:O.string().nullable().default(null)}).default({}),messages:O.object({user:O.object({backgroundColor:O.string().nullable().default(null),textColor:O.string().nullable().default(null)}).default({}),assistant:O.object({backgroundColor:O.string().nullable().default(null),textColor:O.string().nullable().default(null)}).default({})}).default({})}).default({})}).default({}),handlers:O.object({functionCalls:O.record(O.function().returns(O.union([O.any(),O.promise(O.any())]))).default({}),enhancedContent:O.record(O.function().returns(O.union([O.any(),O.promise(O.any())]))).default({})}).default({})});var Jp=Object.defineProperty,Qp=Object.getOwnPropertyDescriptor,ur=(n,e,t,r)=>{for(var i=r>1?void 0:r?Qp(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&Jp(e,t,i),i};let ln=class extends it{constructor(){super(...arguments),this.isOpen=!1,this.ctaClosed=!1,this.onResizeHandler=()=>{this.isOpen&&window.innerWidth<768?(xh(this,{allowTouchMove:n=>n.nodeName==="IAI-CHAT-POPUP"}),this.isIosDevice||(document.documentElement.style.overflow="hidden")):(To(this),this.isIosDevice||(document.documentElement.style.overflow=this.initialHtmlOverflow))}}connectedCallback(){super.connectedCallback(),this.cleanOptions=_s.parse(this.options),this.identifyIosDevice(),this.setInitialHtmlOverflow(),this.initialScrollPosition={x:0,y:0},this.onResizeHandler(),window.addEventListener("resize",this.onResizeHandler,{passive:!0})}disconnectedCallback(){super.disconnectedCallback(),To(this),window.removeEventListener("resize",this.onResizeHandler)}render(){const{placement:n,chatWindow:e}=this.cleanOptions.config,{height:t,cta:r}=this.cleanOptions.config.openChatButton,i=ep("chat-widget w-dvw h-dvh md:mx-8",Yp[e.width],Gp[e.height],this.isOpen?"":"invisible");return se`
|
|
389
389
|
<div
|
|
390
390
|
class="chat-widget-popup fixed flex flex-col bottom-0 z-40 ${us({"right-0 items-end":n==="right","left-0 items-start":n==="left"})}"
|
|
391
391
|
style=${Jr({colorScheme:"normal"})}
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
@iai-chat-close=${this.toggleChat}
|
|
398
398
|
></iai-chat>
|
|
399
399
|
|
|
400
|
-
${Dt(r&&!this.ctaClosed&&!this.isOpen,()=>
|
|
400
|
+
${Dt(r&&!this.ctaClosed&&!this.isOpen,()=>se`
|
|
401
401
|
<iai-chat-cta-bubble
|
|
402
402
|
class="mx-8"
|
|
403
403
|
.message=${r}
|
|
@@ -427,7 +427,7 @@
|
|
|
427
427
|
max-height: calc(100dvh - var(--iai-i-button-height, 48px) - 4rem);
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
`],ur([Te({type:Object})],ln.prototype,"options",2),ur([kn()],ln.prototype,"isOpen",2),ur([kn()],ln.prototype,"ctaClosed",2),ur([ns("iai-chat")],ln.prototype,"chatWindow",2),ur([wl.debounce(250)],ln.prototype,"onResizeHandler",2),ln=ur([St("iai-chat-popup")],ln);const Xp=typeof window<"u"&&window||typeof global<"u"&&global||{},ef=Xp.IAI_BACKEND_URL||"https://api.ai.inhabit.services",cr={async get(n,e={}){return this.request(n,{...e,method:"GET"})},async post(n,e={},t={}){return this.request(n,{...t,method:"POST",body:JSON.stringify(e)})},async put(n,e={},t={}){return this.request(n,{...t,method:"PUT",body:JSON.stringify(e)})},async delete(n,e={}){return this.request(n,{...e,method:"DELETE"})},async patch(n,e={},t={}){return this.request(n,{...t,method:"PATCH",body:JSON.stringify(e)})},async request(n,e={}){const{returnFullResponse:t=!1,...r}=e,i={...r,headers:{"Content-Type":"application/json",...r.headers}};n=n.replace(/^\//,"");const s=await fetch(`${ef}/${n}`,i);if(!s.ok){if(s.status===429){const a=+(s.headers.get("Retry-After")||30);throw new gi(`Rate limited fetching /${n}: retry after ${a} seconds`,s.status,{retryAfter:a})}const l=[`Failed to fetch /${n}:`];try{const{message:a}=await s.json();if(!a)throw new Error;l.push(a)}catch{l.push(`${s.status} (${s.statusText})`)}throw new gi(l.join(" "),s.status)}if(t)return s;try{return await s.json()}catch{return null}}};async function tf(n,e={},t){return cr.post("/threads",{assistantId:n,params:e,clientId:t})}async function nf(n,e="No reason provided"){await cr.post(`/threads/${n}/end`,{reason:e})}async function rf(n,e){return cr.post(`/threads/${n}/messages`,{content:e})}async function sf(n,e,t){await cr.put(`/threads/${n}/messages/${e}/rate`,{rating:t})}async function lf(n,e,t,r=!1){return cr.post(`/threads/${n}/functions/${e}`,{params:t,rerunLLM:r})}async function af(n){return cr.post(`/threads/${n}/ping`)}class gi extends Error{constructor(e,t,r){super(e),this.status=t,this.details=r}}function of(n){return{all:n=n||new Map,on:function(e,t){var r=n.get(e);r?r.push(t):n.set(e,[t])},off:function(e,t){var r=n.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var r=n.get(e);r&&r.slice().map(function(i){i(t)}),(r=n.get("*"))&&r.slice().map(function(i){i(e,t)})}}}class uf{constructor(e,t={}){if(this._assistantId="",this._recurringKeepAliveInterval=null,this._recurringKeepAliveCallers=new Set,this._conversationDetails=null,this._messages=[],this.isTyping=!1,this.inputDisabled=!1,this.chatEndingWarningSent=!1,this.chatEnded=!1,this._resetCounter=0,this.onStorageEvent=r=>{var i;const[s,l,a]=((i=r.key)==null?void 0:i.split("-"))||[];if(!(s!=="iaiChat"||l!==this.options.historyKey))switch(a){case"messageHistory":this.onMessageHistoryStorageEvent(r);break;case"conversation":this.setConversationDetails(JSON.parse(r.newValue||"null"),!0);break;case"lastActivity":this.keepAlive(JSON.parse(r.newValue||"null"),!0);break;case"chatEndingWarningSent":this.setChatEndingWarningSent(JSON.parse(r.newValue||"false"),!0);break;case"chatEnded":this.setChatEnded(JSON.parse(r.newValue||"false"),!0);break;case"typing":this.setTyping(JSON.parse(r.newValue||"false"),!0);break;case"inputDisabled":this.setInputDisabled(JSON.parse(r.newValue||"false"),!0);break}},this.userMessageTypingId=null,this._assistantId=e,this._clientId=t.clientId,this.options={params:{},resetEndedChatOnLoad:!1,historyKey:"main",...t},this._emitter=of(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),t.events&&Object.entries(t.events).forEach(([r,i])=>{this._emitter.on(r,i)}),t.historyKey){this._messages=this.storageGet("messageHistory",[]);const r=this.storageGet("conversation");r&&this.setConversationDetails(r,!0);const i=this.storageGet("chatEndingWarningSent");i&&this.setChatEndingWarningSent(i,!0);const s=this.storageGet("chatEnded");s&&this.setChatEnded(s,!0);const l=this.storageGet("typing");l&&this.setTyping(l,!0);const a=this.storageGet("inputDisabled");a&&this.setInputDisabled(a,!0);const o=this.storageGet("lastActivity");o&&setTimeout(()=>this.keepAlive(o,!0),0),setTimeout(()=>{this.chatEnded&&this.options.resetEndedChatOnLoad&&this.reset()},0),window.addEventListener("storage",this.onStorageEvent)}}onMessageHistoryStorageEvent(e){if(!e.newValue){this.reset();return}const t=JSON.parse(e.newValue),r=this._messages.map(s=>s.id),i=t.map(s=>s.id);this._messages.forEach(s=>{i.includes(s.id)||this._emitter.emit("messageRemoved",s.id)}),t.forEach(s=>{r.includes(s.id)||this._emitter.emit("message",s)}),this._messages=t}async endChat(e,t=!0){!this.threadId||this.chatEnded||(t&&(this._emitter.emit("chatEnded"),this.setChatEnded(!0)),this.stopInactivityTimers(),await nf(this.threadId,e))}reset(e){this.endChat(e,!1).then(()=>{}),this._messages=[],this.setConversationDetails(null),this.setTyping(!1),this.setInputDisabled(!1),this.setChatEnded(!1),this._recurringKeepAliveCallers.forEach(t=>t()),this.stopInactivityTimers(),this.setChatEndingWarningSent(!1),this.storageRemoveAll(),this._resetCounter+=1,this._emitter.emit("reset")}destroy(){this._emitter.all.clear(),window.removeEventListener("storage",this.onStorageEvent),this.stopInactivityTimers(),this._emitter.emit("destroy")}stopInactivityTimers(){this._inactivityTimeout&&(clearTimeout(this._inactivityTimeout),this._inactivityTimeout=null),this._inactivityWarningTimeout&&(clearTimeout(this._inactivityWarningTimeout),this._inactivityWarningTimeout=null)}keepAlive(e=Date.now(),t=!1){if(this.stopInactivityTimers(),this.chatEnded||!e)return;const{timeUntilChatEnds:r,timeUntilWarnAboutChatEnding:i}=this;if(!r)return;t||this.storageSet("lastActivity",e);const s=Date.now()-e;if(s>r){if(this.chatEnded)return;this.setChatEnded(!0),this._emitter.emit("chatEnded")}else s>i?(this.sendChatEndingWarning(),this._inactivityTimeout=setTimeout(()=>{this.chatEnded||(this.setChatEnded(!0),this._emitter.emit("chatEnded"))},r-s)):(this.setChatEndingWarningSent(!1),this._inactivityWarningTimeout=setTimeout(()=>this.sendChatEndingWarning(),i-s),this._inactivityTimeout=setTimeout(()=>{this.chatEnded||(this.setChatEnded(!0),this._emitter.emit("chatEnded"))},r-s))}registerRecurringKeepAlive(){if(!this.chatStarted)throw new Error("Chat not started");const e=()=>{this._recurringKeepAliveCallers.delete(e),this._recurringKeepAliveCallers.size===0&&this._recurringKeepAliveInterval&&(clearInterval(this._recurringKeepAliveInterval),this._recurringKeepAliveInterval=null)};return this._recurringKeepAliveCallers.add(e),this._recurringKeepAliveInterval||(this._recurringKeepAliveInterval=setInterval(()=>{this.chatStarted&&(this.keepAlive(),af(this.threadId).then(()=>{}))},3e4)),e}async startChat(){if(this.chatStarted)return;const e=this.getResetChecker(),{id:t,inactivityWaitTime:r,inactivityWarningTime:i}=await tf(this.assistantId,this.params,this.clientId);if(!t)throw new Sl("Could not start chat","ChatStartError");if(e.resetOccurred)throw new Sl("Chat was reset","ChatReset");this.setConversationDetails({threadId:t,inactivityWaitTime:r,inactivityWarningTime:i})}handleSendUserMessageResponse({messages:e,functions:t}){this.addMessages(e),t.forEach(r=>this._emitter.emit("functionCall",r))}addMessages(e){e.forEach(t=>this.addMessage(t))}addMessage(e){const t={...e,id:e.id||Math.random().toString(36).substring(7)};return this._messages.push(t),this.storageSet("messageHistory",this._messages),this._emitter.emit("message",t),t}removeMessage(e){this._messages.find(t=>t.id===e)&&(this._messages=this._messages.filter(t=>t.id!==e),this.storageSet("messageHistory",this._messages),this._emitter.emit("messageRemoved",e))}async respondToFunctionCall(e,t,r){if(!this.threadId)throw new Error("Thread not started");try{const i=this.getResetChecker();this.setTyping(!0),this.keepAlive();const s=await lf(this.threadId,e,t,r);if(i.resetOccurred)return;this.handleSendUserMessageResponse(s)}catch(i){i instanceof gi&&i.status===429?this.sendErrorMessage(`You are sending messages too quickly. You may try again in ${i.details.retryAfter} second(s).`):this.sendErrorMessage(),console.error("Error sending message:",i)}finally{this.setTyping(!1)}}getTypingManager(){let e=null;return{start:()=>{e=Math.random().toString(36).substring(7),this.userMessageTypingId=e,this.setTyping(!0)},done:()=>{this.userMessageTypingId===e&&(this.setTyping(!1),this.userMessageTypingId=null)}}}async sendUserMessage(e){const t=this.getTypingManager();try{const r=this.getResetChecker();if(this.addMessage({role:"user",content:e}),t.start(),!this.chatStarted){const{initialReplyMessage:s}=this.options;s&&this.addMessage({role:"assistant",content:s});try{await this.startChat()}catch(l){if(l instanceof gi&&l.status===429){this.sendErrorMessage(`You are starting new chats too quickly. You may try again in ${l.details.retryAfter} second(s).`);return}if(l instanceof Sl&&l.name==="ChatReset")return;throw l}}this.keepAlive();const i=await rf(this.threadId,e);if(r.resetOccurred)return;this.handleSendUserMessageResponse(i)}catch(r){r instanceof gi&&r.status===429?this.sendErrorMessage(`You are sending messages too quickly. You may try again in ${r.details.retryAfter} second(s).`):this.sendErrorMessage(),console.error("Error sending message:",r)}finally{t.done()}}async rateMessage(e,t){const r=this._messages.find(i=>i.id===e);!r||r.role!=="assistant"||(r.userRating=t,this.storageSet("messageHistory",this._messages),await sf(this.threadId,e,t))}sendErrorMessage(e="There was an unexpected error. Please try again later."){this.addMessage({role:"assistant",content:e})}setTyping(e,t=!1){this.isTyping=e,this._emitter.emit("typing",e),t||this.storageSet("typing",e)}setConversationDetails(e,t=!1){this._conversationDetails=e,t||this.storageSet("conversation",e)}setInputDisabled(e,t=!1){this.inputDisabled=e,this._emitter.emit("inputDisabled",e),t||this.storageSet("inputDisabled",e)}setChatEnded(e,t=!1){this.chatEnded=e,t||this.storageSet("chatEnded",e)}setChatEndingWarningSent(e,t=!1){this.chatEndingWarningSent=e,t||this.storageSet("chatEndingWarningSent",e)}sendChatEndingWarning(){this.chatEndingWarningSent||(this._emitter.emit("inactivityWarning"),this.setChatEndingWarningSent(!0))}getResetChecker(){const e=this._resetCounter,t=this;return{get resetOccurred(){return e!==t._resetCounter}}}get assistantId(){return this._assistantId}get clientId(){return this._clientId}get params(){return this.options.params}get threadId(){var e;return(e=this._conversationDetails)==null?void 0:e.threadId}get timeUntilChatEnds(){const{inactivityWaitTime:e}=this._conversationDetails||{};return e?e*60*1e3:null}get timeUntilWarnAboutChatEnding(){const{inactivityWaitTime:e=0,inactivityWarningTime:t=0}=this._conversationDetails||{};return(e-t)*60*1e3}get messages(){return this._messages}get chatStarted(){return!!this.threadId}storageSet(e,t){this.options.historyKey&&localStorage.setItem(`iaiChat-${this.options.historyKey}-${e}`,JSON.stringify(t))}storageGet(e,t=null){if(!this.options.historyKey)return null;const r=localStorage.getItem(`iaiChat-${this.options.historyKey}-${e}`);return r?JSON.parse(r):t}storageRemove(e){localStorage.removeItem(`iaiChat-${this.options.historyKey}-${e}`)}storageRemoveAll(){this.options.historyKey&&Object.keys(localStorage).forEach(e=>{e.startsWith(`iaiChat-${this.options.historyKey}-`)&&localStorage.removeItem(e)})}}class Sl extends Error{constructor(e,t){super(e),this.name=t}}var Wo={exports:{}};(function(n,e){(function(t,r){n.exports=r()})(tp,function(){var t=1e3,r=6e4,i=36e5,s="millisecond",l="second",a="minute",o="hour",u="day",c="week",p="month",d="quarter",g="year",x="date",j="Invalid Date",Z=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,de=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ve={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var b=["th","st","nd","rd"],y=$%100;return"["+$+(b[(y-20)%10]||b[y]||b[0])+"]"}},le=function($,b,y){var _=String($);return!_||_.length>=b?$:""+Array(b+1-_.length).join(y)+$},Ie={s:le,z:function($){var b=-$.utcOffset(),y=Math.abs(b),_=Math.floor(y/60),v=y%60;return(b<=0?"+":"-")+le(_,2,"0")+":"+le(v,2,"0")},m:function $(b,y){if(b.date()<y.date())return-$(y,b);var _=12*(y.year()-b.year())+(y.month()-b.month()),v=b.clone().add(_,p),A=y-v<0,k=b.clone().add(_+(A?-1:1),p);return+(-(_+(y-v)/(A?v-k:k-v))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:p,y:g,w:c,d:u,D:x,h:o,m:a,s:l,ms:s,Q:d}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},Ae="en",U={};U[Ae]=ve;var qe="$isDayjsObject",xe=function($){return $ instanceof X||!(!$||!$[qe])},Ze=function $(b,y,_){var v;if(!b)return Ae;if(typeof b=="string"){var A=b.toLowerCase();U[A]&&(v=A),y&&(U[A]=y,v=A);var k=b.split("-");if(!v&&k.length>1)return $(k[0])}else{var N=b.name;U[N]=b,v=N}return!_&&v&&(Ae=v),v||!_&&Ae},G=function($,b){if(xe($))return $.clone();var y=typeof b=="object"?b:{};return y.date=$,y.args=arguments,new X(y)},P=Ie;P.l=Ze,P.i=xe,P.w=function($,b){return G($,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var X=function(){function $(y){this.$L=Ze(y.locale,null,!0),this.parse(y),this.$x=this.$x||y.x||{},this[qe]=!0}var b=$.prototype;return b.parse=function(y){this.$d=function(_){var v=_.date,A=_.utc;if(v===null)return new Date(NaN);if(P.u(v))return new Date;if(v instanceof Date)return new Date(v);if(typeof v=="string"&&!/Z$/i.test(v)){var k=v.match(Z);if(k){var N=k[2]-1||0,Y=(k[7]||"0").substring(0,3);return A?new Date(Date.UTC(k[1],N,k[3]||1,k[4]||0,k[5]||0,k[6]||0,Y)):new Date(k[1],N,k[3]||1,k[4]||0,k[5]||0,k[6]||0,Y)}}return new Date(v)}(y),this.init()},b.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},b.$utils=function(){return P},b.isValid=function(){return this.$d.toString()!==j},b.isSame=function(y,_){var v=G(y);return this.startOf(_)<=v&&v<=this.endOf(_)},b.isAfter=function(y,_){return G(y)<this.startOf(_)},b.isBefore=function(y,_){return this.endOf(_)<G(y)},b.$g=function(y,_,v){return P.u(y)?this[_]:this.set(v,y)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(y,_){var v=this,A=!!P.u(_)||_,k=P.p(y),N=function(ze,fe){var De=P.w(v.$u?Date.UTC(v.$y,fe,ze):new Date(v.$y,fe,ze),v);return A?De:De.endOf(u)},Y=function(ze,fe){return P.w(v.toDate()[ze].apply(v.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(fe)),v)},ee=this.$W,ue=this.$M,ge=this.$D,Ke="set"+(this.$u?"UTC":"");switch(k){case g:return A?N(1,0):N(31,11);case p:return A?N(1,ue):N(0,ue+1);case c:var He=this.$locale().weekStart||0,nt=(ee<He?ee+7:ee)-He;return N(A?ge-nt:ge+(6-nt),ue);case u:case x:return Y(Ke+"Hours",0);case o:return Y(Ke+"Minutes",1);case a:return Y(Ke+"Seconds",2);case l:return Y(Ke+"Milliseconds",3);default:return this.clone()}},b.endOf=function(y){return this.startOf(y,!1)},b.$set=function(y,_){var v,A=P.p(y),k="set"+(this.$u?"UTC":""),N=(v={},v[u]=k+"Date",v[x]=k+"Date",v[p]=k+"Month",v[g]=k+"FullYear",v[o]=k+"Hours",v[a]=k+"Minutes",v[l]=k+"Seconds",v[s]=k+"Milliseconds",v)[A],Y=A===u?this.$D+(_-this.$W):_;if(A===p||A===g){var ee=this.clone().set(x,1);ee.$d[N](Y),ee.init(),this.$d=ee.set(x,Math.min(this.$D,ee.daysInMonth())).$d}else N&&this.$d[N](Y);return this.init(),this},b.set=function(y,_){return this.clone().$set(y,_)},b.get=function(y){return this[P.p(y)]()},b.add=function(y,_){var v,A=this;y=Number(y);var k=P.p(_),N=function(ue){var ge=G(A);return P.w(ge.date(ge.date()+Math.round(ue*y)),A)};if(k===p)return this.set(p,this.$M+y);if(k===g)return this.set(g,this.$y+y);if(k===u)return N(1);if(k===c)return N(7);var Y=(v={},v[a]=r,v[o]=i,v[l]=t,v)[k]||1,ee=this.$d.getTime()+y*Y;return P.w(ee,this)},b.subtract=function(y,_){return this.add(-1*y,_)},b.format=function(y){var _=this,v=this.$locale();if(!this.isValid())return v.invalidDate||j;var A=y||"YYYY-MM-DDTHH:mm:ssZ",k=P.z(this),N=this.$H,Y=this.$m,ee=this.$M,ue=v.weekdays,ge=v.months,Ke=v.meridiem,He=function(fe,De,Xe,ot){return fe&&(fe[De]||fe(_,A))||Xe[De].slice(0,ot)},nt=function(fe){return P.s(N%12||12,fe,"0")},ze=Ke||function(fe,De,Xe){var ot=fe<12?"AM":"PM";return Xe?ot.toLowerCase():ot};return A.replace(de,function(fe,De){return De||function(Xe){switch(Xe){case"YY":return String(_.$y).slice(-2);case"YYYY":return P.s(_.$y,4,"0");case"M":return ee+1;case"MM":return P.s(ee+1,2,"0");case"MMM":return He(v.monthsShort,ee,ge,3);case"MMMM":return He(ge,ee);case"D":return _.$D;case"DD":return P.s(_.$D,2,"0");case"d":return String(_.$W);case"dd":return He(v.weekdaysMin,_.$W,ue,2);case"ddd":return He(v.weekdaysShort,_.$W,ue,3);case"dddd":return ue[_.$W];case"H":return String(N);case"HH":return P.s(N,2,"0");case"h":return nt(1);case"hh":return nt(2);case"a":return ze(N,Y,!0);case"A":return ze(N,Y,!1);case"m":return String(Y);case"mm":return P.s(Y,2,"0");case"s":return String(_.$s);case"ss":return P.s(_.$s,2,"0");case"SSS":return P.s(_.$ms,3,"0");case"Z":return k}return null}(fe)||k.replace(":","")})},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(y,_,v){var A,k=this,N=P.p(_),Y=G(y),ee=(Y.utcOffset()-this.utcOffset())*r,ue=this-Y,ge=function(){return P.m(k,Y)};switch(N){case g:A=ge()/12;break;case p:A=ge();break;case d:A=ge()/3;break;case c:A=(ue-ee)/6048e5;break;case u:A=(ue-ee)/864e5;break;case o:A=ue/i;break;case a:A=ue/r;break;case l:A=ue/t;break;default:A=ue}return v?A:P.a(A)},b.daysInMonth=function(){return this.endOf(p).$D},b.$locale=function(){return U[this.$L]},b.locale=function(y,_){if(!y)return this.$L;var v=this.clone(),A=Ze(y,_,!0);return A&&(v.$L=A),v},b.clone=function(){return P.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},$}(),Qe=X.prototype;return G.prototype=Qe,[["$ms",s],["$s",l],["$m",a],["$H",o],["$W",u],["$M",p],["$y",g],["$D",x]].forEach(function($){Qe[$[1]]=function(b){return this.$g(b,$[0],$[1])}}),G.extend=function($,b){return $.$i||($(b,X,G),$.$i=!0),G},G.locale=Ze,G.isDayjs=xe,G.unix=function($){return G(1e3*$)},G.en=U[Ae],G.Ls=U,G.p={},G})})(Wo);var cf=Wo.exports;const qo=Ro(cf);function df(n){return{all:n=n||new Map,on:function(e,t){var r=n.get(e);r?r.push(t):n.set(e,[t])},off:function(e,t){var r=n.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var r=n.get(e);r&&r.slice().map(function(i){i(t)}),(r=n.get("*"))&&r.slice().map(function(i){i(e,t)})}}}/**
|
|
430
|
+
`],ur([Te({type:Object})],ln.prototype,"options",2),ur([kn()],ln.prototype,"isOpen",2),ur([kn()],ln.prototype,"ctaClosed",2),ur([ns("iai-chat")],ln.prototype,"chatWindow",2),ur([wl.debounce(250)],ln.prototype,"onResizeHandler",2),ln=ur([St("iai-chat-popup")],ln);const Xp=typeof window<"u"&&window||typeof global<"u"&&global||{},ef=Xp.IAI_BACKEND_URL||"https://api.ai.inhabit.services",cr={async get(n,e={}){return this.request(n,{...e,method:"GET"})},async post(n,e={},t={}){return this.request(n,{...t,method:"POST",body:JSON.stringify(e)})},async put(n,e={},t={}){return this.request(n,{...t,method:"PUT",body:JSON.stringify(e)})},async delete(n,e={}){return this.request(n,{...e,method:"DELETE"})},async patch(n,e={},t={}){return this.request(n,{...t,method:"PATCH",body:JSON.stringify(e)})},async request(n,e={}){const{returnFullResponse:t=!1,...r}=e,i={...r,headers:{"Content-Type":"application/json",...r.headers}};n=n.replace(/^\//,"");const s=await fetch(`${ef}/${n}`,i);if(!s.ok){if(s.status===429){const a=+(s.headers.get("Retry-After")||30);throw new gi(`Rate limited fetching /${n}: retry after ${a} seconds`,s.status,{retryAfter:a})}const l=[`Failed to fetch /${n}:`];try{const{message:a}=await s.json();if(!a)throw new Error;l.push(a)}catch{l.push(`${s.status} (${s.statusText})`)}throw new gi(l.join(" "),s.status)}if(t)return s;try{return await s.json()}catch{return null}}};async function tf(n,e={},t){return cr.post("/threads",{assistantId:n,params:e,clientId:t})}async function nf(n,e="No reason provided"){await cr.post(`/threads/${n}/end`,{reason:e})}async function rf(n,e){return cr.post(`/threads/${n}/messages`,{content:e})}async function sf(n,e,t){await cr.put(`/threads/${n}/messages/${e}/rate`,{rating:t})}async function lf(n,e,t,r=!1){return cr.post(`/threads/${n}/functions/${e}`,{params:t,rerunLLM:r})}async function af(n){return cr.post(`/threads/${n}/ping`)}class gi extends Error{constructor(e,t,r){super(e),this.status=t,this.details=r}}function of(n){return{all:n=n||new Map,on:function(e,t){var r=n.get(e);r?r.push(t):n.set(e,[t])},off:function(e,t){var r=n.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var r=n.get(e);r&&r.slice().map(function(i){i(t)}),(r=n.get("*"))&&r.slice().map(function(i){i(e,t)})}}}class uf{constructor(e,t={}){if(this._assistantId="",this._recurringKeepAliveInterval=null,this._recurringKeepAliveCallers=new Set,this._conversationDetails=null,this._messages=[],this.isTyping=!1,this.inputDisabled=!1,this.chatEndingWarningSent=!1,this.chatEnded=!1,this._resetCounter=0,this.onStorageEvent=r=>{var i;const[s,l,a]=((i=r.key)==null?void 0:i.split("-"))||[];if(!(s!=="iaiChat"||l!==this.options.historyKey))switch(a){case"messageHistory":this.onMessageHistoryStorageEvent(r);break;case"conversation":this.setConversationDetails(JSON.parse(r.newValue||"null"),!0);break;case"lastActivity":this.keepAlive(JSON.parse(r.newValue||"null"),!0);break;case"chatEndingWarningSent":this.setChatEndingWarningSent(JSON.parse(r.newValue||"false"),!0);break;case"chatEnded":this.setChatEnded(JSON.parse(r.newValue||"false"),!0);break;case"typing":this.setTyping(JSON.parse(r.newValue||"false"),!0);break;case"inputDisabled":this.setInputDisabled(JSON.parse(r.newValue||"false"),!0);break}},this.userMessageTypingId=null,this._assistantId=e,this._clientId=t.clientId,this.options={params:{},resetEndedChatOnLoad:!1,historyKey:"main",...t},this._emitter=of(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),t.events&&Object.entries(t.events).forEach(([r,i])=>{this._emitter.on(r,i)}),t.historyKey){this._messages=this.storageGet("messageHistory",[]);const r=this.storageGet("conversation");r&&this.setConversationDetails(r,!0);const i=this.storageGet("chatEndingWarningSent");i&&this.setChatEndingWarningSent(i,!0);const s=this.storageGet("chatEnded");s&&this.setChatEnded(s,!0);const l=this.storageGet("typing");l&&this.setTyping(l,!0);const a=this.storageGet("inputDisabled");a&&this.setInputDisabled(a,!0);const o=this.storageGet("lastActivity");o&&setTimeout(()=>this.keepAlive(o,!0),0),setTimeout(()=>{this.chatEnded&&this.options.resetEndedChatOnLoad&&this.reset()},0),window.addEventListener("storage",this.onStorageEvent)}}onMessageHistoryStorageEvent(e){if(!e.newValue){this.reset();return}const t=JSON.parse(e.newValue),r=this._messages.map(s=>s.id),i=t.map(s=>s.id);this._messages.forEach(s=>{i.includes(s.id)||this._emitter.emit("messageRemoved",s.id)}),t.forEach(s=>{r.includes(s.id)||this._emitter.emit("message",s)}),this._messages=t}async endChat(e,t=!0){!this.threadId||this.chatEnded||(t&&(this._emitter.emit("chatEnded"),this.setChatEnded(!0)),this.stopInactivityTimers(),await nf(this.threadId,e))}reset(e){this.endChat(e,!1).then(()=>{}),this._messages=[],this.setConversationDetails(null),this.setTyping(!1),this.setInputDisabled(!1),this.setChatEnded(!1),this._recurringKeepAliveCallers.forEach(t=>t()),this.stopInactivityTimers(),this.setChatEndingWarningSent(!1),this.storageRemoveAll(),this._resetCounter+=1,this._emitter.emit("reset")}destroy(){this._emitter.all.clear(),window.removeEventListener("storage",this.onStorageEvent),this.stopInactivityTimers(),this._emitter.emit("destroy")}stopInactivityTimers(){this._inactivityTimeout&&(clearTimeout(this._inactivityTimeout),this._inactivityTimeout=null),this._inactivityWarningTimeout&&(clearTimeout(this._inactivityWarningTimeout),this._inactivityWarningTimeout=null)}keepAlive(e=Date.now(),t=!1){if(this.stopInactivityTimers(),this.chatEnded||!e)return;const{timeUntilChatEnds:r,timeUntilWarnAboutChatEnding:i}=this;if(!r)return;t||this.storageSet("lastActivity",e);const s=Date.now()-e;if(s>r){if(this.chatEnded)return;this.setChatEnded(!0),this._emitter.emit("chatEnded")}else s>i?(this.sendChatEndingWarning(),this._inactivityTimeout=setTimeout(()=>{this.chatEnded||(this.setChatEnded(!0),this._emitter.emit("chatEnded"))},r-s)):(this.setChatEndingWarningSent(!1),this._inactivityWarningTimeout=setTimeout(()=>this.sendChatEndingWarning(),i-s),this._inactivityTimeout=setTimeout(()=>{this.chatEnded||(this.setChatEnded(!0),this._emitter.emit("chatEnded"))},r-s))}registerRecurringKeepAlive(){if(!this.chatStarted)throw new Error("Chat not started");const e=()=>{this._recurringKeepAliveCallers.delete(e),this._recurringKeepAliveCallers.size===0&&this._recurringKeepAliveInterval&&(clearInterval(this._recurringKeepAliveInterval),this._recurringKeepAliveInterval=null)};return this._recurringKeepAliveCallers.add(e),this._recurringKeepAliveInterval||(this._recurringKeepAliveInterval=setInterval(()=>{this.chatStarted&&(this.keepAlive(),af(this.threadId).then(()=>{}))},3e4)),e}async startChat(){if(this.chatStarted)return;const e=this.getResetChecker(),{id:t,inactivityWaitTime:r,inactivityWarningTime:i}=await tf(this.assistantId,this.params,this.clientId);if(!t)throw new Sl("Could not start chat","ChatStartError");if(e.resetOccurred)throw new Sl("Chat was reset","ChatReset");this.setConversationDetails({threadId:t,inactivityWaitTime:r,inactivityWarningTime:i})}handleSendUserMessageResponse({messages:e,functions:t}){this.addMessages(e),t.forEach(r=>this._emitter.emit("functionCall",r))}addMessages(e){e.forEach(t=>this.addMessage(t))}addMessage(e){const t={...e,id:e.id||Math.random().toString(36).substring(7)};return this._messages.push(t),this.storageSet("messageHistory",this._messages),this._emitter.emit("message",t),t}removeMessage(e){this._messages.find(t=>t.id===e)&&(this._messages=this._messages.filter(t=>t.id!==e),this.storageSet("messageHistory",this._messages),this._emitter.emit("messageRemoved",e))}async respondToFunctionCall(e,t,r){if(!this.threadId)throw new Error("Thread not started");try{const i=this.getResetChecker();this.setTyping(!0),this.keepAlive();const s=await lf(this.threadId,e,t,r);if(i.resetOccurred)return;this.handleSendUserMessageResponse(s)}catch(i){i instanceof gi&&i.status===429?this.sendErrorMessage(`You are sending messages too quickly. You may try again in ${i.details.retryAfter} second(s).`):this.sendErrorMessage(),console.error("Error sending message:",i)}finally{this.setTyping(!1)}}getTypingManager(){let e=null;return{start:()=>{e=Math.random().toString(36).substring(7),this.userMessageTypingId=e,this.setTyping(!0)},done:()=>{this.userMessageTypingId===e&&(this.setTyping(!1),this.userMessageTypingId=null)}}}async sendUserMessage(e){const t=this.getTypingManager();try{const r=this.getResetChecker();if(this.addMessage({role:"user",content:e}),t.start(),!this.chatStarted){const{initialReplyMessage:s}=this.options;s&&this.addMessage({role:"assistant",content:s});try{await this.startChat()}catch(l){if(l instanceof gi&&l.status===429){this.sendErrorMessage(`You are starting new chats too quickly. You may try again in ${l.details.retryAfter} second(s).`);return}if(l instanceof Sl&&l.name==="ChatReset")return;throw l}}this.keepAlive();const i=await rf(this.threadId,e);if(r.resetOccurred)return;this.handleSendUserMessageResponse(i)}catch(r){r instanceof gi&&r.status===429?this.sendErrorMessage(`You are sending messages too quickly. You may try again in ${r.details.retryAfter} second(s).`):this.sendErrorMessage(),console.error("Error sending message:",r)}finally{t.done()}}async rateMessage(e,t){const r=this._messages.find(i=>i.id===e);!r||r.role!=="assistant"||(r.userRating=t,this.storageSet("messageHistory",this._messages),await sf(this.threadId,e,t))}sendErrorMessage(e="There was an unexpected error. Please try again later."){this.addMessage({role:"assistant",content:e})}setTyping(e,t=!1){this.isTyping=e,this._emitter.emit("typing",e),t||this.storageSet("typing",e)}setConversationDetails(e,t=!1){this._conversationDetails=e,t||this.storageSet("conversation",e)}setInputDisabled(e,t=!1){this.inputDisabled=e,this._emitter.emit("inputDisabled",e),t||this.storageSet("inputDisabled",e)}setChatEnded(e,t=!1){this.chatEnded=e,t||this.storageSet("chatEnded",e)}setChatEndingWarningSent(e,t=!1){this.chatEndingWarningSent=e,t||this.storageSet("chatEndingWarningSent",e)}sendChatEndingWarning(){this.chatEndingWarningSent||(this._emitter.emit("inactivityWarning"),this.setChatEndingWarningSent(!0))}getResetChecker(){const e=this._resetCounter,t=this;return{get resetOccurred(){return e!==t._resetCounter}}}get assistantId(){return this._assistantId}get clientId(){return this._clientId}get params(){return this.options.params}get threadId(){var e;return(e=this._conversationDetails)==null?void 0:e.threadId}get timeUntilChatEnds(){const{inactivityWaitTime:e}=this._conversationDetails||{};return e?e*60*1e3:null}get timeUntilWarnAboutChatEnding(){const{inactivityWaitTime:e=0,inactivityWarningTime:t=0}=this._conversationDetails||{};return(e-t)*60*1e3}get messages(){return this._messages}get chatStarted(){return!!this.threadId}storageSet(e,t){this.options.historyKey&&localStorage.setItem(`iaiChat-${this.options.historyKey}-${e}`,JSON.stringify(t))}storageGet(e,t=null){if(!this.options.historyKey)return null;const r=localStorage.getItem(`iaiChat-${this.options.historyKey}-${e}`);return r?JSON.parse(r):t}storageRemove(e){localStorage.removeItem(`iaiChat-${this.options.historyKey}-${e}`)}storageRemoveAll(){this.options.historyKey&&Object.keys(localStorage).forEach(e=>{e.startsWith(`iaiChat-${this.options.historyKey}-`)&&localStorage.removeItem(e)})}}class Sl extends Error{constructor(e,t){super(e),this.name=t}}var Wo={exports:{}};(function(n,e){(function(t,r){n.exports=r()})(tp,function(){var t=1e3,r=6e4,i=36e5,s="millisecond",l="second",a="minute",o="hour",u="day",c="week",p="month",d="quarter",g="year",x="date",j="Invalid Date",Z=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,de=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,me={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var b=["th","st","nd","rd"],y=$%100;return"["+$+(b[(y-20)%10]||b[y]||b[0])+"]"}},X=function($,b,y){var _=String($);return!_||_.length>=b?$:""+Array(b+1-_.length).join(y)+$},Ie={s:X,z:function($){var b=-$.utcOffset(),y=Math.abs(b),_=Math.floor(y/60),v=y%60;return(b<=0?"+":"-")+X(_,2,"0")+":"+X(v,2,"0")},m:function $(b,y){if(b.date()<y.date())return-$(y,b);var _=12*(y.year()-b.year())+(y.month()-b.month()),v=b.clone().add(_,p),A=y-v<0,k=b.clone().add(_+(A?-1:1),p);return+(-(_+(y-v)/(A?v-k:k-v))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:p,y:g,w:c,d:u,D:x,h:o,m:a,s:l,ms:s,Q:d}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},Ae="en",U={};U[Ae]=me;var qe="$isDayjsObject",xe=function($){return $ instanceof ee||!(!$||!$[qe])},Ze=function $(b,y,_){var v;if(!b)return Ae;if(typeof b=="string"){var A=b.toLowerCase();U[A]&&(v=A),y&&(U[A]=y,v=A);var k=b.split("-");if(!v&&k.length>1)return $(k[0])}else{var N=b.name;U[N]=b,v=N}return!_&&v&&(Ae=v),v||!_&&Ae},G=function($,b){if(xe($))return $.clone();var y=typeof b=="object"?b:{};return y.date=$,y.args=arguments,new ee(y)},P=Ie;P.l=Ze,P.i=xe,P.w=function($,b){return G($,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var ee=function(){function $(y){this.$L=Ze(y.locale,null,!0),this.parse(y),this.$x=this.$x||y.x||{},this[qe]=!0}var b=$.prototype;return b.parse=function(y){this.$d=function(_){var v=_.date,A=_.utc;if(v===null)return new Date(NaN);if(P.u(v))return new Date;if(v instanceof Date)return new Date(v);if(typeof v=="string"&&!/Z$/i.test(v)){var k=v.match(Z);if(k){var N=k[2]-1||0,Y=(k[7]||"0").substring(0,3);return A?new Date(Date.UTC(k[1],N,k[3]||1,k[4]||0,k[5]||0,k[6]||0,Y)):new Date(k[1],N,k[3]||1,k[4]||0,k[5]||0,k[6]||0,Y)}}return new Date(v)}(y),this.init()},b.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},b.$utils=function(){return P},b.isValid=function(){return this.$d.toString()!==j},b.isSame=function(y,_){var v=G(y);return this.startOf(_)<=v&&v<=this.endOf(_)},b.isAfter=function(y,_){return G(y)<this.startOf(_)},b.isBefore=function(y,_){return this.endOf(_)<G(y)},b.$g=function(y,_,v){return P.u(y)?this[_]:this.set(v,y)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(y,_){var v=this,A=!!P.u(_)||_,k=P.p(y),N=function(ze,fe){var De=P.w(v.$u?Date.UTC(v.$y,fe,ze):new Date(v.$y,fe,ze),v);return A?De:De.endOf(u)},Y=function(ze,fe){return P.w(v.toDate()[ze].apply(v.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(fe)),v)},te=this.$W,ue=this.$M,ye=this.$D,Ke="set"+(this.$u?"UTC":"");switch(k){case g:return A?N(1,0):N(31,11);case p:return A?N(1,ue):N(0,ue+1);case c:var He=this.$locale().weekStart||0,nt=(te<He?te+7:te)-He;return N(A?ye-nt:ye+(6-nt),ue);case u:case x:return Y(Ke+"Hours",0);case o:return Y(Ke+"Minutes",1);case a:return Y(Ke+"Seconds",2);case l:return Y(Ke+"Milliseconds",3);default:return this.clone()}},b.endOf=function(y){return this.startOf(y,!1)},b.$set=function(y,_){var v,A=P.p(y),k="set"+(this.$u?"UTC":""),N=(v={},v[u]=k+"Date",v[x]=k+"Date",v[p]=k+"Month",v[g]=k+"FullYear",v[o]=k+"Hours",v[a]=k+"Minutes",v[l]=k+"Seconds",v[s]=k+"Milliseconds",v)[A],Y=A===u?this.$D+(_-this.$W):_;if(A===p||A===g){var te=this.clone().set(x,1);te.$d[N](Y),te.init(),this.$d=te.set(x,Math.min(this.$D,te.daysInMonth())).$d}else N&&this.$d[N](Y);return this.init(),this},b.set=function(y,_){return this.clone().$set(y,_)},b.get=function(y){return this[P.p(y)]()},b.add=function(y,_){var v,A=this;y=Number(y);var k=P.p(_),N=function(ue){var ye=G(A);return P.w(ye.date(ye.date()+Math.round(ue*y)),A)};if(k===p)return this.set(p,this.$M+y);if(k===g)return this.set(g,this.$y+y);if(k===u)return N(1);if(k===c)return N(7);var Y=(v={},v[a]=r,v[o]=i,v[l]=t,v)[k]||1,te=this.$d.getTime()+y*Y;return P.w(te,this)},b.subtract=function(y,_){return this.add(-1*y,_)},b.format=function(y){var _=this,v=this.$locale();if(!this.isValid())return v.invalidDate||j;var A=y||"YYYY-MM-DDTHH:mm:ssZ",k=P.z(this),N=this.$H,Y=this.$m,te=this.$M,ue=v.weekdays,ye=v.months,Ke=v.meridiem,He=function(fe,De,Xe,ot){return fe&&(fe[De]||fe(_,A))||Xe[De].slice(0,ot)},nt=function(fe){return P.s(N%12||12,fe,"0")},ze=Ke||function(fe,De,Xe){var ot=fe<12?"AM":"PM";return Xe?ot.toLowerCase():ot};return A.replace(de,function(fe,De){return De||function(Xe){switch(Xe){case"YY":return String(_.$y).slice(-2);case"YYYY":return P.s(_.$y,4,"0");case"M":return te+1;case"MM":return P.s(te+1,2,"0");case"MMM":return He(v.monthsShort,te,ye,3);case"MMMM":return He(ye,te);case"D":return _.$D;case"DD":return P.s(_.$D,2,"0");case"d":return String(_.$W);case"dd":return He(v.weekdaysMin,_.$W,ue,2);case"ddd":return He(v.weekdaysShort,_.$W,ue,3);case"dddd":return ue[_.$W];case"H":return String(N);case"HH":return P.s(N,2,"0");case"h":return nt(1);case"hh":return nt(2);case"a":return ze(N,Y,!0);case"A":return ze(N,Y,!1);case"m":return String(Y);case"mm":return P.s(Y,2,"0");case"s":return String(_.$s);case"ss":return P.s(_.$s,2,"0");case"SSS":return P.s(_.$ms,3,"0");case"Z":return k}return null}(fe)||k.replace(":","")})},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(y,_,v){var A,k=this,N=P.p(_),Y=G(y),te=(Y.utcOffset()-this.utcOffset())*r,ue=this-Y,ye=function(){return P.m(k,Y)};switch(N){case g:A=ye()/12;break;case p:A=ye();break;case d:A=ye()/3;break;case c:A=(ue-te)/6048e5;break;case u:A=(ue-te)/864e5;break;case o:A=ue/i;break;case a:A=ue/r;break;case l:A=ue/t;break;default:A=ue}return v?A:P.a(A)},b.daysInMonth=function(){return this.endOf(p).$D},b.$locale=function(){return U[this.$L]},b.locale=function(y,_){if(!y)return this.$L;var v=this.clone(),A=Ze(y,_,!0);return A&&(v.$L=A),v},b.clone=function(){return P.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},$}(),Qe=ee.prototype;return G.prototype=Qe,[["$ms",s],["$s",l],["$m",a],["$H",o],["$W",u],["$M",p],["$y",g],["$D",x]].forEach(function($){Qe[$[1]]=function(b){return this.$g(b,$[0],$[1])}}),G.extend=function($,b){return $.$i||($(b,ee,G),$.$i=!0),G},G.locale=Ze,G.isDayjs=xe,G.unix=function($){return G(1e3*$)},G.en=U[Ae],G.Ls=U,G.p={},G})})(Wo);var cf=Wo.exports;const qo=Ro(cf);function df(n){return{all:n=n||new Map,on:function(e,t){var r=n.get(e);r?r.push(t):n.set(e,[t])},off:function(e,t){var r=n.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var r=n.get(e);r&&r.slice().map(function(i){i(t)}),(r=n.get("*"))&&r.slice().map(function(i){i(e,t)})}}}/**
|
|
431
431
|
* @license
|
|
432
432
|
* Copyright 2017 Google LLC
|
|
433
433
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -439,9 +439,9 @@
|
|
|
439
439
|
`);const i=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(r);return this.lexer.state.top=i,{type:"blockquote",raw:t[0],tokens:s,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const i=r.length>1,s={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:"[*+-]");const l=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`);let a="",o="",u=!1;for(;e;){let c=!1;if(!(t=l.exec(e))||this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let p=t[2].split(`
|
|
440
440
|
`,1)[0].replace(/^\t+/,de=>" ".repeat(3*de.length)),d=e.split(`
|
|
441
441
|
`,1)[0],g=0;this.options.pedantic?(g=2,o=p.trimStart()):(g=t[2].search(/[^ ]/),g=g>4?1:g,o=p.slice(g),g+=t[1].length);let x=!1;if(!p&&/^ *$/.test(d)&&(a+=d+`
|
|
442
|
-
`,e=e.substring(d.length+1),c=!0),!c){const de=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
443
|
-
`,1)[0];if(d=Ae,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),
|
|
444
|
-
`+d.slice(g);else{if(x||p.search(/[^ ]/)>=4||
|
|
442
|
+
`,e=e.substring(d.length+1),c=!0),!c){const de=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),me=new RegExp(`^ {0,${Math.min(3,g-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),X=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:\`\`\`|~~~)`),Ie=new RegExp(`^ {0,${Math.min(3,g-1)}}#`);for(;e;){const Ae=e.split(`
|
|
443
|
+
`,1)[0];if(d=Ae,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),X.test(d)||Ie.test(d)||de.test(d)||me.test(e))break;if(d.search(/[^ ]/)>=g||!d.trim())o+=`
|
|
444
|
+
`+d.slice(g);else{if(x||p.search(/[^ ]/)>=4||X.test(p)||Ie.test(p)||me.test(p))break;o+=`
|
|
445
445
|
`+d}!x&&!d.trim()&&(x=!0),a+=Ae+`
|
|
446
446
|
`,e=e.substring(Ae.length+1),p=d.slice(g)}}s.loose||(u?s.loose=!0:/\n *\n *$/.test(a)&&(u=!0));let j=null,Z;this.options.gfm&&(j=/^\[[ xX]\] /.exec(o),j&&(Z=j[0]!=="[ ] ",o=o.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:a,task:!!j,checked:Z,loose:!1,text:o,tokens:[]}),s.raw+=a}s.items[s.items.length-1].raw=a.trimEnd(),s.items[s.items.length-1].text=o.trimEnd(),s.raw=s.raw.trimEnd();for(let c=0;c<s.items.length;c++)if(this.lexer.state.top=!1,s.items[c].tokens=this.lexer.blockTokens(s.items[c].text,[]),!s.loose){const p=s.items[c].tokens.filter(g=>g.type==="space"),d=p.length>0&&p.some(g=>/\n.*\n/.test(g.raw));s.loose=d}if(s.loose)for(let c=0;c<s.items.length;c++)s.items[c].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const r=t[1].toLowerCase().replace(/\s+/g," "),i=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:i,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const r=Xo(t[1]),i=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
|
|
447
447
|
`):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===i.length){for(const a of i)/^ *-+: *$/.test(a)?l.align.push("right"):/^ *:-+: *$/.test(a)?l.align.push("center"):/^ *:-+ *$/.test(a)?l.align.push("left"):l.align.push(null);for(const a of r)l.header.push({text:a,tokens:this.lexer.inline(a)});for(const a of s)l.rows.push(Xo(a,l.header.length).map(o=>({text:o,tokens:this.lexer.inline(o)})));return l}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const r=t[1].charAt(t[1].length-1)===`
|
|
@@ -476,18 +476,18 @@ ${e}</tr>
|
|
|
476
476
|
`}tablecell(e,t){const r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>
|
|
477
477
|
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,r){const i=Qo(e);if(i===null)return r;e=i;let s='<a href="'+e+'"';return t&&(s+=' title="'+t+'"'),s+=">"+r+"</a>",s}image(e,t,r){const i=Qo(e);if(i===null)return r;e=i;let s=`<img src="${e}" alt="${r}"`;return t&&(s+=` title="${t}"`),s+=">",s}text(e){return e}}class Rl{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,r){return""+r}image(e,t,r){return""+r}br(){return""}}class It{constructor(e){Me(this,"options"),Me(this,"renderer"),Me(this,"textRenderer"),this.options=e||Rn,this.options.renderer=this.options.renderer||new _i,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Rl}static parse(e,t){return new It(t).parse(e)}static parseInline(e,t){return new It(t).parseInline(e)}parse(e,t=!0){let r="";for(let i=0;i<e.length;i++){const s=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const l=s,a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){r+=a||"";continue}}switch(s.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{const l=s;r+=this.renderer.heading(this.parseInline(l.tokens),l.depth,yf(this.parseInline(l.tokens,this.textRenderer)));continue}case"code":{const l=s;r+=this.renderer.code(l.text,l.lang,!!l.escaped);continue}case"table":{const l=s;let a="",o="";for(let c=0;c<l.header.length;c++)o+=this.renderer.tablecell(this.parseInline(l.header[c].tokens),{header:!0,align:l.align[c]});a+=this.renderer.tablerow(o);let u="";for(let c=0;c<l.rows.length;c++){const p=l.rows[c];o="";for(let d=0;d<p.length;d++)o+=this.renderer.tablecell(this.parseInline(p[d].tokens),{header:!1,align:l.align[d]});u+=this.renderer.tablerow(o)}r+=this.renderer.table(a,u);continue}case"blockquote":{const l=s,a=this.parse(l.tokens);r+=this.renderer.blockquote(a);continue}case"list":{const l=s,a=l.ordered,o=l.start,u=l.loose;let c="";for(let p=0;p<l.items.length;p++){const d=l.items[p],g=d.checked,x=d.task;let j="";if(d.task){const Z=this.renderer.checkbox(!!g);u?d.tokens.length>0&&d.tokens[0].type==="paragraph"?(d.tokens[0].text=Z+" "+d.tokens[0].text,d.tokens[0].tokens&&d.tokens[0].tokens.length>0&&d.tokens[0].tokens[0].type==="text"&&(d.tokens[0].tokens[0].text=Z+" "+d.tokens[0].tokens[0].text)):d.tokens.unshift({type:"text",text:Z+" "}):j+=Z+" "}j+=this.parse(d.tokens,u),c+=this.renderer.listitem(j,x,!!g)}r+=this.renderer.list(c,a,o);continue}case"html":{const l=s;r+=this.renderer.html(l.text,l.block);continue}case"paragraph":{const l=s;r+=this.renderer.paragraph(this.parseInline(l.tokens));continue}case"text":{let l=s,a=l.tokens?this.parseInline(l.tokens):l.text;for(;i+1<e.length&&e[i+1].type==="text";)l=e[++i],a+=`
|
|
478
478
|
`+(l.tokens?this.parseInline(l.tokens):l.text);r+=t?this.renderer.paragraph(a):a;continue}default:{const l='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}parseInline(e,t){t=t||this.renderer;let r="";for(let i=0;i<e.length;i++){const s=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){const l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=l||"";continue}}switch(s.type){case"escape":{const l=s;r+=t.text(l.text);break}case"html":{const l=s;r+=t.html(l.text);break}case"link":{const l=s;r+=t.link(l.href,l.title,this.parseInline(l.tokens,t));break}case"image":{const l=s;r+=t.image(l.href,l.title,l.text);break}case"strong":{const l=s;r+=t.strong(this.parseInline(l.tokens,t));break}case"em":{const l=s;r+=t.em(this.parseInline(l.tokens,t));break}case"codespan":{const l=s;r+=t.codespan(l.text);break}case"br":{r+=t.br();break}case"del":{const l=s;r+=t.del(this.parseInline(l.tokens,t));break}case"text":{const l=s;r+=t.text(l.text);break}default:{const l='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}}class xi{constructor(e){Me(this,"options"),this.options=e||Rn}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}Me(xi,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));var Ts,Dl,jl,uu;class cu{constructor(...e){ka(this,Ts),ka(this,jl),Me(this,"defaults",Cl()),Me(this,"options",this.setOptions),Me(this,"parse",Ys(this,Ts,Dl).call(this,Mt.lex,It.parse)),Me(this,"parseInline",Ys(this,Ts,Dl).call(this,Mt.lexInline,It.parseInline)),Me(this,"Parser",It),Me(this,"Renderer",_i),Me(this,"TextRenderer",Rl),Me(this,"Lexer",Mt),Me(this,"Tokenizer",ks),Me(this,"Hooks",xi),this.use(...e)}walkTokens(e,t){var r,i;let s=[];for(const l of e)switch(s=s.concat(t.call(this,l)),l.type){case"table":{const a=l;for(const o of a.header)s=s.concat(this.walkTokens(o.tokens,t));for(const o of a.rows)for(const u of o)s=s.concat(this.walkTokens(u.tokens,t));break}case"list":{const a=l;s=s.concat(this.walkTokens(a.items,t));break}default:{const a=l;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[a.type]?this.defaults.extensions.childTokens[a.type].forEach(o=>{const u=a[o].flat(1/0);s=s.concat(this.walkTokens(u,t))}):a.tokens&&(s=s.concat(this.walkTokens(a.tokens,t)))}}return s}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{const i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const l=t.renderers[s.name];l?t.renderers[s.name]=function(...a){let o=s.renderer.apply(this,a);return o===!1&&(o=l.apply(this,a)),o}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const l=t[s.level];l?l.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),i.extensions=t),r.renderer){const s=this.defaults.renderer||new _i(this.defaults);for(const l in r.renderer){if(!(l in s))throw new Error(`renderer '${l}' does not exist`);if(l==="options")continue;const a=l,o=r.renderer[a],u=s[a];s[a]=(...c)=>{let p=o.apply(s,c);return p===!1&&(p=u.apply(s,c)),p||""}}i.renderer=s}if(r.tokenizer){const s=this.defaults.tokenizer||new ks(this.defaults);for(const l in r.tokenizer){if(!(l in s))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;const a=l,o=r.tokenizer[a],u=s[a];s[a]=(...c)=>{let p=o.apply(s,c);return p===!1&&(p=u.apply(s,c)),p}}i.tokenizer=s}if(r.hooks){const s=this.defaults.hooks||new xi;for(const l in r.hooks){if(!(l in s))throw new Error(`hook '${l}' does not exist`);if(l==="options")continue;const a=l,o=r.hooks[a],u=s[a];xi.passThroughHooks.has(l)?s[a]=c=>{if(this.defaults.async)return Promise.resolve(o.call(s,c)).then(d=>u.call(s,d));const p=o.call(s,c);return u.call(s,p)}:s[a]=(...c)=>{let p=o.apply(s,c);return p===!1&&(p=u.apply(s,c)),p}}i.hooks=s}if(r.walkTokens){const s=this.defaults.walkTokens,l=r.walkTokens;i.walkTokens=function(a){let o=[];return o.push(l.call(this,a)),s&&(o=o.concat(s.call(this,a))),o}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Mt.lex(e,t??this.defaults)}parser(e,t){return It.parse(e,t??this.defaults)}}Ts=new WeakSet,Dl=function(n,e){return(t,r)=>{const i={...r},s={...this.defaults,...i};this.defaults.async===!0&&i.async===!1&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const l=Ys(this,jl,uu).call(this,!!s.silent,!!s.async);if(typeof t>"u"||t===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(t):t).then(a=>n(a,s)).then(a=>s.hooks?s.hooks.processAllTokens(a):a).then(a=>s.walkTokens?Promise.all(this.walkTokens(a,s.walkTokens)).then(()=>a):a).then(a=>e(a,s)).then(a=>s.hooks?s.hooks.postprocess(a):a).catch(l);try{s.hooks&&(t=s.hooks.preprocess(t));let a=n(t,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let o=e(a,s);return s.hooks&&(o=s.hooks.postprocess(o)),o}catch(a){return l(a)}}},jl=new WeakSet,uu=function(n,e){return t=>{if(t.message+=`
|
|
479
|
-
Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An error occurred:</p><pre>"+at(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}};const Dn=new cu;function $e(n,e){return Dn.parse(n,e)}$e.options=$e.setOptions=function(n){return Dn.setOptions(n),$e.defaults=Dn.defaults,Ko($e.defaults),$e},$e.getDefaults=Cl,$e.defaults=Rn,$e.use=function(...n){return Dn.use(...n),$e.defaults=Dn.defaults,Ko($e.defaults),$e},$e.walkTokens=function(n,e){return Dn.walkTokens(n,e)},$e.parseInline=Dn.parseInline,$e.Parser=It,$e.parser=It.parse,$e.Renderer=_i,$e.TextRenderer=Rl,$e.Lexer=Mt,$e.lexer=Mt.lex,$e.Tokenizer=ks,$e.Hooks=xi,$e.parse=$e,$e.options,$e.setOptions,$e.use,$e.walkTokens,$e.parseInline,It.parse,Mt.lex;const Ll=new _i;Ll.link=(n,e,t)=>{const r=document.createElement("a");return r.setAttribute("href",n),r.setAttribute("target","_blank"),r.setAttribute("rel","noopener nofollow"),r.textContent=t,e&&r.setAttribute("title",e),r.outerHTML};const qf=new cu({renderer:Ll});function Kf(n){const e=Yf(n);return qf.parse(e,{renderer:Ll})}function Zl(n){const e=Kf(n);return
|
|
479
|
+
Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An error occurred:</p><pre>"+at(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}};const Dn=new cu;function $e(n,e){return Dn.parse(n,e)}$e.options=$e.setOptions=function(n){return Dn.setOptions(n),$e.defaults=Dn.defaults,Ko($e.defaults),$e},$e.getDefaults=Cl,$e.defaults=Rn,$e.use=function(...n){return Dn.use(...n),$e.defaults=Dn.defaults,Ko($e.defaults),$e},$e.walkTokens=function(n,e){return Dn.walkTokens(n,e)},$e.parseInline=Dn.parseInline,$e.Parser=It,$e.parser=It.parse,$e.Renderer=_i,$e.TextRenderer=Rl,$e.Lexer=Mt,$e.lexer=Mt.lex,$e.Tokenizer=ks,$e.Hooks=xi,$e.parse=$e,$e.options,$e.setOptions,$e.use,$e.walkTokens,$e.parseInline,It.parse,Mt.lex;const Ll=new _i;Ll.link=(n,e,t)=>{const r=document.createElement("a");return r.setAttribute("href",n),r.setAttribute("target","_blank"),r.setAttribute("rel","noopener nofollow"),r.textContent=t,e&&r.setAttribute("title",e),r.outerHTML};const qf=new cu({renderer:Ll});function Kf(n){const e=Yf(n);return qf.parse(e,{renderer:Ll})}function Zl(n){const e=Kf(n);return se`
|
|
480
480
|
<div class="flex flex-col gap-3">
|
|
481
481
|
${hf(e)}
|
|
482
482
|
</div>
|
|
483
|
-
`}function Yf(n){const e={"&":"&","<":"<",">":">",'"':""","'":"'"};return n.replace(/[&<>"']/g,t=>e[t])}var Gf=Object.defineProperty,Jf=Object.getOwnPropertyDescriptor,ut=(n,e,t,r)=>{for(var i=r>1?void 0:r?Jf(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&Gf(e,t,i),i},du=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},ki=(n,e,t)=>(du(n,e,"read from private field"),t?t.call(n):e.get(n)),Qf=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Xf=(n,e,t,r)=>(du(n,e,"write to private field"),e.set(n,t),t),an;let st=class extends it{constructor(){super(),Qf(this,an,void 0),this.disableInput=!1,this.showTyping=!1,this.messages=[],this.inputValue="",this.internalShowTyping=!1,this.showPopoverDisclaimer=!1,this.previousThreads=[],this._emitter=df(),this._emitter.on("*",(n,e)=>this.dispatchEvent(new CustomEvent(`iai-chat-${n.toString()}`,{bubbles:!0,composed:!0,detail:e})))}connectedCallback(){super.connectedCallback(),this.cleanOptions=_s.parse(this.options||{});const{assistantId:n,clientId:e,params:t,config:r}=this.cleanOptions;this.checkIfDisclaimerShouldBeShown(),Xf(this,an,new uf(n,{clientId:e,params:t,historyKey:r.historyKey,initialReplyMessage:r.initialReplyMessage,resetEndedChatOnLoad:r.resetEndedChatOnLoad})),this.updateMessages(ki(this,an).messages),this.showTyping=ki(this,an).isTyping,this.disableInput=ki(this,an).inputDisabled,this.chatManager.on("functionCall",({id:i,name:s,params:l})=>{const a=this.cleanOptions.handlers.functionCalls[s];if(!a){console.warn(`No function call handler found for ${s}`);return}a.call(this,{id:i,params:l,html:
|
|
483
|
+
`}function Yf(n){const e={"&":"&","<":"<",">":">",'"':""","'":"'"};return n.replace(/[&<>"']/g,t=>e[t])}var Gf=Object.defineProperty,Jf=Object.getOwnPropertyDescriptor,ut=(n,e,t,r)=>{for(var i=r>1?void 0:r?Jf(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&Gf(e,t,i),i},du=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},ki=(n,e,t)=>(du(n,e,"read from private field"),t?t.call(n):e.get(n)),Qf=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Xf=(n,e,t,r)=>(du(n,e,"write to private field"),e.set(n,t),t),an;let st=class extends it{constructor(){super(),Qf(this,an,void 0),this.disableInput=!1,this.showTyping=!1,this.messages=[],this.inputValue="",this.internalShowTyping=!1,this.showPopoverDisclaimer=!1,this.previousThreads=[],this._emitter=df(),this._emitter.on("*",(n,e)=>this.dispatchEvent(new CustomEvent(`iai-chat-${n.toString()}`,{bubbles:!0,composed:!0,detail:e})))}connectedCallback(){super.connectedCallback(),this.cleanOptions=_s.parse(this.options||{});const{assistantId:n,clientId:e,params:t,config:r}=this.cleanOptions;this.checkIfDisclaimerShouldBeShown(),Xf(this,an,new uf(n,{clientId:e,params:t,historyKey:r.historyKey,initialReplyMessage:r.initialReplyMessage,resetEndedChatOnLoad:r.resetEndedChatOnLoad})),this.updateMessages(ki(this,an).messages),this.showTyping=ki(this,an).isTyping,this.disableInput=ki(this,an).inputDisabled,this.chatManager.on("functionCall",({id:i,name:s,params:l})=>{const a=this.cleanOptions.handlers.functionCalls[s];if(!a){console.warn(`No function call handler found for ${s}`);return}a.call(this,{id:i,params:l,html:se,chatWindow:this})}),this.chatManager.on("typing",i=>{this.showTyping=i}),this.chatManager.on("inputDisabled",i=>{this.disableInput=i}),this.chatManager.on("inactivityWarning",()=>{this.addMessage({role:"assistant",content:r.inactivityWarningMessage})}),this.chatManager.on("chatEnded",()=>{this.addMessage({role:"system",content:r.chatEndedMessage}),this.previousThreads.push([...this.messages]),this.chatManager.reset()}),this.chatManager.on("message",i=>{this.updateMessages([...this.messages,i])}),this.chatManager.on("messageRemoved",i=>{this.updateMessages(this.messages.filter(s=>s.id!==i))}),this.chatManager.on("reset",()=>{this.updateMessages([]),this.checkIfDisclaimerShouldBeShown()}),this.chatManager.on("*",this._emitter.emit)}disconnectedCallback(){super.disconnectedCallback(),this._emitter.all.clear(),ki(this,an).destroy()}updateMessages(n){this.messages=[...n],this.scrollChatToBottom()}render(){const{chatWindow:n,disclaimerMessage:e,disclaimerPopover:t}=this.cleanOptions.config,{header:r,showCloseButton:i}=n;return se`
|
|
484
484
|
<div class="relative flex flex-col h-full rounded-lg shadow-lg bg-white text-black">
|
|
485
485
|
<div class="header rounded-t-lg text-lg p-2 flex justify-between items-center h-12">
|
|
486
486
|
<div class="flex flex-row h-full items-center">
|
|
487
|
-
${Dt(r.imageSrc,()=>
|
|
487
|
+
${Dt(r.imageSrc,()=>se`
|
|
488
488
|
<img src="${r.imageSrc}" alt="Logo" style="max-height: 100%" />
|
|
489
489
|
`)}
|
|
490
|
-
${Dt(r.text,()=>
|
|
490
|
+
${Dt(r.text,()=>se`
|
|
491
491
|
<span class="text-lg font-semibold ml-2">${r.text}</span>
|
|
492
492
|
`)}
|
|
493
493
|
</div>
|
|
@@ -501,14 +501,14 @@ Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An err
|
|
|
501
501
|
${ah}
|
|
502
502
|
</button>
|
|
503
503
|
|
|
504
|
-
${Dt(i,()=>
|
|
504
|
+
${Dt(i,()=>se`
|
|
505
505
|
<button class="mr-2 h-6 w-6" @click="${this.closeChat}">
|
|
506
506
|
${oh}
|
|
507
507
|
</button>
|
|
508
508
|
`)}
|
|
509
509
|
</div>
|
|
510
510
|
|
|
511
|
-
${Dt(this.showPopoverDisclaimer,()=>
|
|
511
|
+
${Dt(this.showPopoverDisclaimer,()=>se`
|
|
512
512
|
<div class="absolute top-12 left-0 right-0 bottom-0 bg-white z-10 flex flex-col gap-2 rounded-b-lg">
|
|
513
513
|
<div class="flex-grow overflow-y-auto pt-4 px-4 relative">
|
|
514
514
|
${Zl(t.message)}
|
|
@@ -528,7 +528,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An err
|
|
|
528
528
|
`)}
|
|
529
529
|
|
|
530
530
|
<div id="chat-container" class="flex-1 overflow-y-auto p-4 flex flex-col gap-2">
|
|
531
|
-
${ul(this.previousThreads,(s,l)=>l,(s,l)=>
|
|
531
|
+
${ul(this.previousThreads,(s,l)=>l,(s,l)=>se`
|
|
532
532
|
${this.listMessages(s,`${l}`)}
|
|
533
533
|
|
|
534
534
|
${this.chatMessage({id:`chat-started-message-${l}`,role:"system",content:"Chat Started"})}
|
|
@@ -572,17 +572,17 @@ Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An err
|
|
|
572
572
|
</p>
|
|
573
573
|
</div>
|
|
574
574
|
</div>
|
|
575
|
-
`}get isSubmitDisabled(){return!this.inputValue||this.disableInput}handleKeyDown(n){n.key==="Enter"&&!n.shiftKey&&(n.preventDefault(),!this.isSubmitDisabled&&this.sendUserMessage(n))}checkIfDisclaimerShouldBeShown(){const{config:n}=this.cleanOptions,e=localStorage.getItem(`iaiChatWindow-${n.historyKey}-acceptedDisclaimerTime`);this.showPopoverDisclaimer=!!(n.disclaimerPopover.message&&(!e||qo().diff(e,"minutes")>=n.disclaimerPopover.rememberDurationMinutes))}acceptDisclaimer(){localStorage.setItem(`iaiChatWindow-${this.cleanOptions.config.historyKey}-acceptedDisclaimerTime`,qo().toISOString()),this.showPopoverDisclaimer=!1}handleInput(){const{inputElement:n,chatContainer:e}=this;if(!n||!e)return;this.inputValue=n.value;const{scrollTop:t,clientHeight:r,scrollHeight:i}=e,s=t+r>=i;n.style.height="auto",n.style.height=`${n.scrollHeight+2}px`,s&&this.scrollChatToBottom()}get chatManager(){return ki(this,an)}resetChat(){this.previousThreads=[],this.chatManager.reset("Manually reset by user")}addMessage(n){return this.chatManager.addMessage(n)}removeMessage(n){this.chatManager.removeMessage(n)}setInputDisabled(n=!0){this.chatManager.setInputDisabled(n)}setTypingIndicatorVisible(n=!0){this.chatManager.setTyping(n)}async sendFunctionCallResponse(n,e,t=!1){try{await this.chatManager.respondToFunctionCall(n,e,t)}catch(r){console.error("sendFunctionCallResponse error",r),this.addMessage({role:"assistant",content:"An unexpected error occurred. Please try again later."})}}async sendUserMessage(n){n.preventDefault(),!this.disableInput&&(this.dispatchEvent(new CustomEvent("iai-chat-send-user-message",{bubbles:!0,composed:!0,detail:{message:this.inputValue},cancelable:!0}))&&this.chatManager.sendUserMessage(this.inputValue).then(),this.inputValue="",this.inputElement&&(this.inputElement.style.height="auto"),this.focusOnInput())}focusOnInput(){var n;(n=this.inputElement)==null||n.focus()}scrollChatToBottom(){const{chatContainer:n}=this;n==null||n.scrollTo({top:n==null?void 0:n.scrollHeight,behavior:"smooth"})}listMessages(n,e=Math.random().toString(36).substring(7)){const t=this.chatMessage({id:`intro-message-${e}`,role:"assistant",content:this.cleanOptions.config.welcomeMessage},{disableRatingControls:!0});return
|
|
575
|
+
`}get isSubmitDisabled(){return!this.inputValue||this.disableInput}handleKeyDown(n){n.key==="Enter"&&!n.shiftKey&&(n.preventDefault(),!this.isSubmitDisabled&&this.sendUserMessage(n))}checkIfDisclaimerShouldBeShown(){const{config:n}=this.cleanOptions,e=localStorage.getItem(`iaiChatWindow-${n.historyKey}-acceptedDisclaimerTime`);this.showPopoverDisclaimer=!!(n.disclaimerPopover.message&&(!e||qo().diff(e,"minutes")>=n.disclaimerPopover.rememberDurationMinutes))}acceptDisclaimer(){localStorage.setItem(`iaiChatWindow-${this.cleanOptions.config.historyKey}-acceptedDisclaimerTime`,qo().toISOString()),this.showPopoverDisclaimer=!1}handleInput(){const{inputElement:n,chatContainer:e}=this;if(!n||!e)return;this.inputValue=n.value;const{scrollTop:t,clientHeight:r,scrollHeight:i}=e,s=t+r>=i;n.style.height="auto",n.style.height=`${n.scrollHeight+2}px`,s&&this.scrollChatToBottom()}get chatManager(){return ki(this,an)}resetChat(){this.previousThreads=[],this.chatManager.reset("Manually reset by user")}addMessage(n){return this.chatManager.addMessage(n)}removeMessage(n){this.chatManager.removeMessage(n)}setInputDisabled(n=!0){this.chatManager.setInputDisabled(n)}setTypingIndicatorVisible(n=!0){this.chatManager.setTyping(n)}async sendFunctionCallResponse(n,e,t=!1){try{await this.chatManager.respondToFunctionCall(n,e,t)}catch(r){console.error("sendFunctionCallResponse error",r),this.addMessage({role:"assistant",content:"An unexpected error occurred. Please try again later."})}}async sendUserMessage(n){n.preventDefault(),!this.disableInput&&(this.dispatchEvent(new CustomEvent("iai-chat-send-user-message",{bubbles:!0,composed:!0,detail:{message:this.inputValue},cancelable:!0}))&&this.chatManager.sendUserMessage(this.inputValue).then(),this.inputValue="",this.inputElement&&(this.inputElement.style.height="auto"),this.focusOnInput())}focusOnInput(){var n;(n=this.inputElement)==null||n.focus()}scrollChatToBottom(){const{chatContainer:n}=this;n==null||n.scrollTo({top:n==null?void 0:n.scrollHeight,behavior:"smooth"})}listMessages(n,e=Math.random().toString(36).substring(7)){const t=this.chatMessage({id:`intro-message-${e}`,role:"assistant",content:this.cleanOptions.config.welcomeMessage},{disableRatingControls:!0});return se`
|
|
576
576
|
${t}
|
|
577
577
|
|
|
578
|
-
${ul(n,r=>r.id,(r,i)=>
|
|
578
|
+
${ul(n,r=>r.id,(r,i)=>se`
|
|
579
579
|
<div>
|
|
580
580
|
${this.nameLabel(n,i)}
|
|
581
581
|
${this.chatMessage(r)}
|
|
582
582
|
</div>
|
|
583
|
-
`)}`}nameLabel(n,e){const t=n[e];if(t.role!=="assistant")return null;const r=t.name||"Assistant",i=n[e-1];return((i==null?void 0:i.name)||"Assistant")===r?null:
|
|
583
|
+
`)}`}nameLabel(n,e){const t=n[e];if(t.role!=="assistant")return null;const r=t.name||"Assistant",i=n[e-1];return((i==null?void 0:i.name)||"Assistant")===r?null:se`
|
|
584
584
|
<div class="name text-sm">${t.name||"Assistant"}</div>
|
|
585
|
-
`}rateMessage(n,e){this.chatManager.rateMessage(n,e).then()}chatMessage(n,e={}){switch(n.role){case"assistant":return
|
|
585
|
+
`}rateMessage(n,e){this.chatManager.rateMessage(n,e).then()}chatMessage(n,e={}){switch(n.role){case"assistant":return se`
|
|
586
586
|
<iai-chat-message-assistant
|
|
587
587
|
id="message-${n.id}"
|
|
588
588
|
.content="${n.content}"
|
|
@@ -590,12 +590,12 @@ Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An err
|
|
|
590
590
|
rating="${n.userRating||0}"
|
|
591
591
|
@rate-message="${t=>this.rateMessage(n.id,t.detail.rating)}"
|
|
592
592
|
></iai-chat-message-assistant>
|
|
593
|
-
`;case"user":return
|
|
593
|
+
`;case"user":return se`
|
|
594
594
|
<iai-chat-message-user
|
|
595
595
|
id="message-${n.id}"
|
|
596
596
|
.content="${n.content}"
|
|
597
597
|
></iai-chat-message-user>
|
|
598
|
-
`;case"system":return
|
|
598
|
+
`;case"system":return se`
|
|
599
599
|
<iai-chat-message-system
|
|
600
600
|
id="message-${n.id}"
|
|
601
601
|
.content="${n.content}"
|
|
@@ -618,9 +618,9 @@ Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An err
|
|
|
618
618
|
.name {
|
|
619
619
|
color: #8c8c8c;
|
|
620
620
|
}
|
|
621
|
-
`],ut([Te({type:Object})],st.prototype,"options",2),ut([Te()],st.prototype,"disableInput",2),ut([Te()],st.prototype,"showTyping",2),ut([kn()],st.prototype,"messages",2),ut([kn()],st.prototype,"inputValue",2),ut([kn()],st.prototype,"internalShowTyping",2),ut([kn()],st.prototype,"showPopoverDisclaimer",2),ut([kn()],st.prototype,"previousThreads",2),ut([ns("#chat-container")],st.prototype,"chatContainer",2),ut([ns("#message-input")],st.prototype,"inputElement",2),ut([wl.debounce(1)],st.prototype,"scrollChatToBottom",1),st=ut([St("iai-chat")],st);var hu={exports:{}};(function(n){(function(e){if(typeof window>"u")return;var t=0,r=!1,i=!1,s="message",l=s.length,a="[iFrameSizer]",o=a.length,u=null,c=window.requestAnimationFrame,p=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),d={},g=null,x=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){xe("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function j(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function Z(w,R,ce){w.addEventListener(R,ce,!1)}function de(w,R,ce){w.removeEventListener(R,ce,!1)}function ve(){var w=["moz","webkit","o","ms"],R;for(R=0;R<w.length&&!c;R+=1)c=window[w[R]+"RequestAnimationFrame"];c?c=c.bind(window):U("setup","RequestAnimationFrame not supported")}function le(w){var R="Host page: "+w;return window.top!==window.self&&(R=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+w:"Nested host page: "+w),R}function Ie(w){return a+"["+le(w)+"]"}function Ae(w){return d[w]?d[w].log:r}function U(w,R){Ze("log",w,R,Ae(w))}function qe(w,R){Ze("info",w,R,Ae(w))}function xe(w,R){Ze("warn",w,R,!0)}function Ze(w,R,ce,V){V===!0&&typeof window.console=="object"&&console[w](Ie(R),ce)}function G(w){function R(){function L(){v(we),b(J),be("onResized",we)}ye("Height"),ye("Width"),A(L,we,"init")}function ce(){var L=xt.slice(o).split(":"),re=L[1]?parseInt(L[1],10):0,Se=d[L[0]]&&d[L[0]].iframe,Ee=getComputedStyle(Se);return{iframe:Se,id:L[0],height:re+V(Ee)+he(Ee),width:L[2],type:L[3]}}function V(L){if(L.boxSizing!=="border-box")return 0;var re=L.paddingTop?parseInt(L.paddingTop,10):0,Se=L.paddingBottom?parseInt(L.paddingBottom,10):0;return re+Se}function he(L){if(L.boxSizing!=="border-box")return 0;var re=L.borderTopWidth?parseInt(L.borderTopWidth,10):0,Se=L.borderBottomWidth?parseInt(L.borderBottomWidth,10):0;return re+Se}function ye(L){var re=Number(d[J]["max"+L]),Se=Number(d[J]["min"+L]),Ee=L.toLowerCase(),Ye=Number(we[Ee]);U(J,"Checking "+Ee+" is in range "+Se+"-"+re),Ye<Se&&(Ye=Se,U(J,"Set "+Ee+" to min value")),Ye>re&&(Ye=re,U(J,"Set "+Ee+" to max value")),we[Ee]=""+Ye}function ct(){function L(){function Ee(){var rt=0,Ut=!1;for(U(J,"Checking connection is from allowed list of origins: "+Se);rt<Se.length;rt++)if(Se[rt]===re){Ut=!0;break}return Ut}function Ye(){var rt=d[J]&&d[J].remoteHost;return U(J,"Checking connection is from: "+rt),re===rt}return Se.constructor===Array?Ee():Ye()}var re=w.origin,Se=d[J]&&d[J].checkOrigin;if(Se&&""+re!="null"&&!L())throw new Error("Unexpected message received from: "+re+" for "+we.iframe.id+". Message was: "+w.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function Ht(){return a===(""+xt).slice(0,o)&&xt.slice(o).split(":")[0]in d}function vt(){var L=we.type in{true:1,false:1,undefined:1};return L&&U(J,"Ignoring init message from meta parent page"),L}function bt(L){return xt.slice(xt.indexOf(":")+l+L)}function wt(L){U(J,"onMessage passed: {iframe: "+we.iframe.id+", message: "+L+"}"),be("onMessage",{iframe:we.iframe,message:JSON.parse(L)}),U(J,"--")}function Ci(){var L=document.body.getBoundingClientRect(),re=we.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:re.height,iframeWidth:re.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(re.top-L.top,10),offsetLeft:parseInt(re.left-L.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function pr(L,re){function Se(){k("Send Page Info","pageInfo:"+Ci(),L,re)}Ke(Se,32,re)}function Ei(){function L(Ye,rt){function Ut(){d[Ee]?pr(d[Ee].iframe,Ee):re()}["scroll","resize"].forEach(function(_u){U(Ee,Ye+_u+" listener for sendPageInfo"),rt(window,_u,Ut)})}function re(){L("Remove ",de)}function Se(){L("Add ",Z)}var Ee=J;Se(),d[Ee]&&(d[Ee].stopPageInfo=re)}function fr(){d[J]&&d[J].stopPageInfo&&(d[J].stopPageInfo(),delete d[J].stopPageInfo)}function h(){var L=!0;return we.iframe===null&&(xe(J,"IFrame ("+we.id+") not found"),L=!1),L}function f(L){var re=L.getBoundingClientRect();return $(J),{x:Math.floor(Number(re.left)+Number(u.x)),y:Math.floor(Number(re.top)+Number(u.y))}}function m(L){function re(){u=rt,S(),U(J,"--")}function Se(){return{x:Number(we.width)+Ye.x,y:Number(we.height)+Ye.y}}function Ee(){window.parentIFrame?window.parentIFrame["scrollTo"+(L?"Offset":"")](rt.x,rt.y):xe(J,"Unable to scroll to requested position, window.parentIFrame not found")}var Ye=L?f(we.iframe):{x:0,y:0},rt=Se();U(J,"Reposition requested from iFrame (offset x:"+Ye.x+" y:"+Ye.y+")"),window.top===window.self?re():Ee()}function S(){be("onScroll",u)===!1?y():b(J)}function z(L){function re(){var Ut=f(rt);U(J,"Moving to in page link (#"+Ee+") at x: "+Ut.x+" y: "+Ut.y),u={x:Ut.x,y:Ut.y},S(),U(J,"--")}function Se(){window.parentIFrame?window.parentIFrame.moveToAnchor(Ee):U(J,"In page link #"+Ee+" not found and window.parentIFrame not found")}var Ee=L.split("#")[1]||"",Ye=decodeURIComponent(Ee),rt=document.getElementById(Ye)||document.getElementsByName(Ye)[0];rt?re():window.top===window.self?U(J,"In page link #"+Ee+" not found"):Se()}function B(L){var re={};if(Number(we.width)===0&&Number(we.height)===0){var Se=bt(9).split(":");re={x:Se[1],y:Se[0]}}else re={x:we.width,y:we.height};be(L,{iframe:we.iframe,screenX:Number(re.x),screenY:Number(re.y),type:we.type})}function be(L,re){return P(J,L,re)}function je(){switch(d[J]&&d[J].firstRun&&Mi(),we.type){case"close":{Qe(we.iframe);break}case"message":{wt(bt(6));break}case"mouseenter":{B("onMouseEnter");break}case"mouseleave":{B("onMouseLeave");break}case"autoResize":{d[J].autoResize=JSON.parse(bt(9));break}case"scrollTo":{m(!1);break}case"scrollToOffset":{m(!0);break}case"pageInfo":{pr(d[J]&&d[J].iframe,J),Ei();break}case"pageInfoStop":{fr();break}case"inPageLink":{z(bt(9));break}case"reset":{_(we);break}case"init":{R(),be("onInit",we.iframe);break}default:Number(we.width)===0&&Number(we.height)===0?xe("Unsupported message received ("+we.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):R()}}function We(L){var re=!0;return d[L]||(re=!1,xe(we.type+" No settings for "+L+". Message was: "+xt)),re}function _t(){for(var L in d)k("iFrame requested init",N(L),d[L].iframe,L)}function Mi(){d[J]&&(d[J].firstRun=!1)}var xt=w.data,we={},J=null;xt==="[iFrameResizerChild]Ready"?_t():Ht()?(we=ce(),J=we.id,d[J]&&(d[J].loaded=!0),!vt()&&We(J)&&(U(J,"Received: "+xt),h()&&ct()&&je())):qe(J,"Ignored: "+xt)}function P(w,R,ce){var V=null,he=null;if(d[w])if(V=d[w][R],typeof V=="function")he=V(ce);else throw new TypeError(R+" on iFrame["+w+"] is not a function");return he}function X(w){var R=w.id;delete d[R]}function Qe(w){var R=w.id;if(P(R,"onClose",R)===!1){U(R,"Close iframe cancelled by onClose event");return}U(R,"Removing iFrame: "+R);try{w.parentNode&&w.parentNode.removeChild(w)}catch(ce){xe(ce)}P(R,"onClosed",R),U(R,"--"),X(w)}function $(w){u===null&&(u={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset},U(w,"Get page position: "+u.x+","+u.y))}function b(w){u!==null&&(window.scrollTo(u.x,u.y),U(w,"Set page position: "+u.x+","+u.y),y())}function y(){u=null}function _(w){function R(){v(w),k("reset","reset",w.iframe,w.id)}U(w.id,"Size reset requested by "+(w.type==="init"?"host page":"iFrame")),$(w.id),A(R,w,"reset")}function v(w){function R(ye){if(!w.id){U("undefined","messageData id not set");return}w.iframe.style[ye]=w[ye]+"px",U(w.id,"IFrame ("+he+") "+ye+" set to "+w[ye]+"px")}function ce(ye){!i&&w[ye]==="0"&&(i=!0,U(he,"Hidden iFrame detected, creating visibility listener"),He())}function V(ye){R(ye),ce(ye)}var he=w.iframe.id;d[he]&&(d[he].sizeHeight&&V("height"),d[he].sizeWidth&&V("width"))}function A(w,R,ce){ce!==R.type&&c&&!window.jasmine?(U(R.id,"Requesting animation frame"),c(w)):w()}function k(w,R,ce,V,he){function ye(){var wt=d[V]&&d[V].targetOrigin;U(V,"["+w+"] Sending msg to iframe["+V+"] ("+R+") targetOrigin: "+wt),ce.contentWindow.postMessage(a+R,wt)}function ct(){xe(V,"["+w+"] IFrame("+V+") not found")}function Ht(){ce&&"contentWindow"in ce&&ce.contentWindow!==null?ye():ct()}function vt(){function wt(){d[V]&&!d[V].loaded&&!bt&&(bt=!0,xe(V,"IFrame has not responded within "+d[V].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}he&&d[V]&&d[V].warningTimeout&&(d[V].msgTimeout=setTimeout(wt,d[V].warningTimeout))}var bt=!1;V=V||ce.id,d[V]&&(Ht(),vt())}function N(w){return w+":"+d[w].bodyMarginV1+":"+d[w].sizeWidth+":"+d[w].log+":"+d[w].interval+":"+d[w].enablePublicMethods+":"+d[w].autoResize+":"+d[w].bodyMargin+":"+d[w].heightCalculationMethod+":"+d[w].bodyBackground+":"+d[w].bodyPadding+":"+d[w].tolerance+":"+d[w].inPageLinks+":"+d[w].resizeFrom+":"+d[w].widthCalculationMethod+":"+d[w].mouseEvents}function Y(w){return typeof w=="number"}function ee(w,R){function ce(){function m(z){var B=d[f][z];B!==1/0&&B!==0&&(w.style[z]=Y(B)?B+"px":B,U(f,"Set "+z+" = "+w.style[z]))}function S(z){if(d[f]["min"+z]>d[f]["max"+z])throw new Error("Value for min"+z+" can not be greater than max"+z)}S("Height"),S("Width"),m("maxHeight"),m("minHeight"),m("maxWidth"),m("minWidth")}function V(){var m=R&&R.id||x.id+t++;return document.getElementById(m)!==null&&(m+=t++),m}function he(m){if(typeof m!="string")throw new TypeError("Invaild id for iFrame. Expected String");return m===""&&(w.id=m=V(),r=(R||{}).log,U(m,"Added missing iframe ID: "+m+" ("+w.src+")")),m}function ye(){switch(U(f,"IFrame scrolling "+(d[f]&&d[f].scrolling?"enabled":"disabled")+" for "+f),w.style.overflow=(d[f]&&d[f].scrolling)===!1?"hidden":"auto",d[f]&&d[f].scrolling){case"omit":break;case!0:{w.scrolling="yes";break}case!1:{w.scrolling="no";break}default:w.scrolling=d[f]?d[f].scrolling:"no"}}function ct(){(typeof(d[f]&&d[f].bodyMargin)=="number"||(d[f]&&d[f].bodyMargin)==="0")&&(d[f].bodyMarginV1=d[f].bodyMargin,d[f].bodyMargin=""+d[f].bodyMargin+"px")}function Ht(){var m=d[f]&&d[f].firstRun,S=d[f]&&d[f].heightCalculationMethod in p;!m&&S&&_({iframe:w,height:0,width:0,type:"init"})}function vt(){d[f]&&(d[f].iframe.iFrameResizer={close:Qe.bind(null,d[f].iframe),removeListeners:X.bind(null,d[f].iframe),resize:k.bind(null,"Window resize","resize",d[f].iframe),moveToAnchor:function(m){k("Move to anchor","moveToAnchor:"+m,d[f].iframe,f)},sendMessage:function(m){m=JSON.stringify(m),k("Send Message","message:"+m,d[f].iframe,f)}})}function bt(m){function S(){k("iFrame.onload",m,w,e,!0),Ht()}function z(be){if(w.parentNode){var je=new be(function(We){We.forEach(function(_t){var Mi=Array.prototype.slice.call(_t.removedNodes);Mi.forEach(function(xt){xt===w&&Qe(w)})})});je.observe(w.parentNode,{childList:!0})}}var B=j();B&&z(B),Z(w,"load",S),k("init",m,w,e,!0)}function wt(m){if(typeof m!="object")throw new TypeError("Options is not an object")}function Ci(m){for(var S in x)Object.prototype.hasOwnProperty.call(x,S)&&(d[f][S]=Object.prototype.hasOwnProperty.call(m,S)?m[S]:x[S])}function pr(m){return m===""||m.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":m}function Ei(m){var S=m.split("Callback");if(S.length===2){var z="on"+S[0].charAt(0).toUpperCase()+S[0].slice(1);this[z]=this[m],delete this[m],xe(f,"Deprecated: '"+m+"' has been renamed '"+z+"'. The old method will be removed in the next major version.")}}function fr(m){m=m||{},d[f]=Object.create(null),d[f].iframe=w,d[f].firstRun=!0,d[f].remoteHost=w.src&&w.src.split("/").slice(0,3).join("/"),wt(m),Object.keys(m).forEach(Ei,m),Ci(m),d[f]&&(d[f].targetOrigin=d[f].checkOrigin===!0?pr(d[f].remoteHost):"*")}function h(){return f in d&&"iFrameResizer"in w}var f=he(w.id);h()?xe(f,"Ignored iFrame, already setup."):(fr(R),ye(),ce(),ct(),bt(N(f)),vt())}function ue(w,R){g===null&&(g=setTimeout(function(){g=null,w()},R))}var ge={};function Ke(w,R,ce){ge[ce]||(ge[ce]=setTimeout(function(){ge[ce]=null,w()},R))}function He(){function w(){function he(ye){function ct(vt){return(d[ye]&&d[ye].iframe.style[vt])==="0px"}function Ht(vt){return vt.offsetParent!==null}d[ye]&&Ht(d[ye].iframe)&&(ct("height")||ct("width"))&&k("Visibility change","resize",d[ye].iframe,ye)}Object.keys(d).forEach(function(ye){he(ye)})}function R(he){U("window","Mutation observed: "+he[0].target+" "+he[0].type),ue(w,16)}function ce(){var he=document.querySelector("body"),ye={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0},ct=new V(R);ct.observe(he,ye)}var V=j();V&&ce()}function nt(w){function R(){fe("Window "+w,"resize")}U("window","Trigger event: "+w),ue(R,16)}function ze(){function w(){fe("Tab Visible","resize")}document.visibilityState!=="hidden"&&(U("document","Trigger event: Visibility change"),ue(w,16))}function fe(w,R){function ce(V){return d[V]&&d[V].resizeFrom==="parent"&&d[V].autoResize&&!d[V].firstRun}Object.keys(d).forEach(function(V){ce(V)&&k(w,R,d[V].iframe,V)})}function De(){Z(window,"message",G),Z(window,"resize",function(){nt("resize")}),Z(document,"visibilitychange",ze),Z(document,"-webkit-visibilitychange",ze)}function Xe(){function w(V,he){function ye(){if(he.tagName){if(he.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+he.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}he&&(ye(),ee(he,V),ce.push(he))}function R(V){V&&V.enablePublicMethods&&xe("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var ce;return ve(),De(),function(V,he){switch(ce=[],R(V),typeof he){case"undefined":case"string":{Array.prototype.forEach.call(document.querySelectorAll(he||"iframe"),w.bind(e,V));break}case"object":{w(V,he);break}default:throw new TypeError("Unexpected data type ("+typeof he+")")}return ce}}function ot(w){w.fn?w.fn.iFrameResize||(w.fn.iFrameResize=function(R){function ce(V,he){ee(he,R)}return this.filter("iframe").each(ce).end()}):qe("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery!==e&&ot(window.jQuery),n.exports=Xe(),window.iFrameResize=window.iFrameResize||Xe()})()})(hu);var em=hu.exports;const tm=Ro(em);var nm=Object.defineProperty,rm=Object.getOwnPropertyDescriptor,zl=(n,e,t,r)=>{for(var i=r>1?void 0:r?rm(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&nm(e,t,i),i};let $i=class extends it{constructor(){super(...arguments),this.src="",this.showCloseButton=!1}async onLoad(n){tm({log:!1,heightCalculationMethod:"max",onMessage:({message:e})=>{this.dispatchEvent(new CustomEvent("message-received",{bubbles:!0,composed:!0,detail:e}))}},n.target)}close(){this.dispatchEvent(new CustomEvent("close"))}render(){return ie`
|
|
621
|
+
`],ut([Te({type:Object})],st.prototype,"options",2),ut([Te()],st.prototype,"disableInput",2),ut([Te()],st.prototype,"showTyping",2),ut([kn()],st.prototype,"messages",2),ut([kn()],st.prototype,"inputValue",2),ut([kn()],st.prototype,"internalShowTyping",2),ut([kn()],st.prototype,"showPopoverDisclaimer",2),ut([kn()],st.prototype,"previousThreads",2),ut([ns("#chat-container")],st.prototype,"chatContainer",2),ut([ns("#message-input")],st.prototype,"inputElement",2),ut([wl.debounce(1)],st.prototype,"scrollChatToBottom",1),st=ut([St("iai-chat")],st);var hu={exports:{}};(function(n){(function(e){if(typeof window>"u")return;var t=0,r=!1,i=!1,s="message",l=s.length,a="[iFrameSizer]",o=a.length,u=null,c=window.requestAnimationFrame,p=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),d={},g=null,x=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){xe("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function j(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function Z(w,R,ce){w.addEventListener(R,ce,!1)}function de(w,R,ce){w.removeEventListener(R,ce,!1)}function me(){var w=["moz","webkit","o","ms"],R;for(R=0;R<w.length&&!c;R+=1)c=window[w[R]+"RequestAnimationFrame"];c?c=c.bind(window):U("setup","RequestAnimationFrame not supported")}function X(w){var R="Host page: "+w;return window.top!==window.self&&(R=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+w:"Nested host page: "+w),R}function Ie(w){return a+"["+X(w)+"]"}function Ae(w){return d[w]?d[w].log:r}function U(w,R){Ze("log",w,R,Ae(w))}function qe(w,R){Ze("info",w,R,Ae(w))}function xe(w,R){Ze("warn",w,R,!0)}function Ze(w,R,ce,V){V===!0&&typeof window.console=="object"&&console[w](Ie(R),ce)}function G(w){function R(){function L(){v(we),b(J),be("onResized",we)}ve("Height"),ve("Width"),A(L,we,"init")}function ce(){var L=xt.slice(o).split(":"),ie=L[1]?parseInt(L[1],10):0,Se=d[L[0]]&&d[L[0]].iframe,Ee=getComputedStyle(Se);return{iframe:Se,id:L[0],height:ie+V(Ee)+he(Ee),width:L[2],type:L[3]}}function V(L){if(L.boxSizing!=="border-box")return 0;var ie=L.paddingTop?parseInt(L.paddingTop,10):0,Se=L.paddingBottom?parseInt(L.paddingBottom,10):0;return ie+Se}function he(L){if(L.boxSizing!=="border-box")return 0;var ie=L.borderTopWidth?parseInt(L.borderTopWidth,10):0,Se=L.borderBottomWidth?parseInt(L.borderBottomWidth,10):0;return ie+Se}function ve(L){var ie=Number(d[J]["max"+L]),Se=Number(d[J]["min"+L]),Ee=L.toLowerCase(),Ye=Number(we[Ee]);U(J,"Checking "+Ee+" is in range "+Se+"-"+ie),Ye<Se&&(Ye=Se,U(J,"Set "+Ee+" to min value")),Ye>ie&&(Ye=ie,U(J,"Set "+Ee+" to max value")),we[Ee]=""+Ye}function ct(){function L(){function Ee(){var rt=0,Ut=!1;for(U(J,"Checking connection is from allowed list of origins: "+Se);rt<Se.length;rt++)if(Se[rt]===ie){Ut=!0;break}return Ut}function Ye(){var rt=d[J]&&d[J].remoteHost;return U(J,"Checking connection is from: "+rt),ie===rt}return Se.constructor===Array?Ee():Ye()}var ie=w.origin,Se=d[J]&&d[J].checkOrigin;if(Se&&""+ie!="null"&&!L())throw new Error("Unexpected message received from: "+ie+" for "+we.iframe.id+". Message was: "+w.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function Ht(){return a===(""+xt).slice(0,o)&&xt.slice(o).split(":")[0]in d}function vt(){var L=we.type in{true:1,false:1,undefined:1};return L&&U(J,"Ignoring init message from meta parent page"),L}function bt(L){return xt.slice(xt.indexOf(":")+l+L)}function wt(L){U(J,"onMessage passed: {iframe: "+we.iframe.id+", message: "+L+"}"),be("onMessage",{iframe:we.iframe,message:JSON.parse(L)}),U(J,"--")}function Ci(){var L=document.body.getBoundingClientRect(),ie=we.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:ie.height,iframeWidth:ie.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(ie.top-L.top,10),offsetLeft:parseInt(ie.left-L.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function pr(L,ie){function Se(){k("Send Page Info","pageInfo:"+Ci(),L,ie)}Ke(Se,32,ie)}function Ei(){function L(Ye,rt){function Ut(){d[Ee]?pr(d[Ee].iframe,Ee):ie()}["scroll","resize"].forEach(function(_u){U(Ee,Ye+_u+" listener for sendPageInfo"),rt(window,_u,Ut)})}function ie(){L("Remove ",de)}function Se(){L("Add ",Z)}var Ee=J;Se(),d[Ee]&&(d[Ee].stopPageInfo=ie)}function fr(){d[J]&&d[J].stopPageInfo&&(d[J].stopPageInfo(),delete d[J].stopPageInfo)}function h(){var L=!0;return we.iframe===null&&(xe(J,"IFrame ("+we.id+") not found"),L=!1),L}function f(L){var ie=L.getBoundingClientRect();return $(J),{x:Math.floor(Number(ie.left)+Number(u.x)),y:Math.floor(Number(ie.top)+Number(u.y))}}function m(L){function ie(){u=rt,S(),U(J,"--")}function Se(){return{x:Number(we.width)+Ye.x,y:Number(we.height)+Ye.y}}function Ee(){window.parentIFrame?window.parentIFrame["scrollTo"+(L?"Offset":"")](rt.x,rt.y):xe(J,"Unable to scroll to requested position, window.parentIFrame not found")}var Ye=L?f(we.iframe):{x:0,y:0},rt=Se();U(J,"Reposition requested from iFrame (offset x:"+Ye.x+" y:"+Ye.y+")"),window.top===window.self?ie():Ee()}function S(){be("onScroll",u)===!1?y():b(J)}function z(L){function ie(){var Ut=f(rt);U(J,"Moving to in page link (#"+Ee+") at x: "+Ut.x+" y: "+Ut.y),u={x:Ut.x,y:Ut.y},S(),U(J,"--")}function Se(){window.parentIFrame?window.parentIFrame.moveToAnchor(Ee):U(J,"In page link #"+Ee+" not found and window.parentIFrame not found")}var Ee=L.split("#")[1]||"",Ye=decodeURIComponent(Ee),rt=document.getElementById(Ye)||document.getElementsByName(Ye)[0];rt?ie():window.top===window.self?U(J,"In page link #"+Ee+" not found"):Se()}function B(L){var ie={};if(Number(we.width)===0&&Number(we.height)===0){var Se=bt(9).split(":");ie={x:Se[1],y:Se[0]}}else ie={x:we.width,y:we.height};be(L,{iframe:we.iframe,screenX:Number(ie.x),screenY:Number(ie.y),type:we.type})}function be(L,ie){return P(J,L,ie)}function je(){switch(d[J]&&d[J].firstRun&&Mi(),we.type){case"close":{Qe(we.iframe);break}case"message":{wt(bt(6));break}case"mouseenter":{B("onMouseEnter");break}case"mouseleave":{B("onMouseLeave");break}case"autoResize":{d[J].autoResize=JSON.parse(bt(9));break}case"scrollTo":{m(!1);break}case"scrollToOffset":{m(!0);break}case"pageInfo":{pr(d[J]&&d[J].iframe,J),Ei();break}case"pageInfoStop":{fr();break}case"inPageLink":{z(bt(9));break}case"reset":{_(we);break}case"init":{R(),be("onInit",we.iframe);break}default:Number(we.width)===0&&Number(we.height)===0?xe("Unsupported message received ("+we.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):R()}}function We(L){var ie=!0;return d[L]||(ie=!1,xe(we.type+" No settings for "+L+". Message was: "+xt)),ie}function _t(){for(var L in d)k("iFrame requested init",N(L),d[L].iframe,L)}function Mi(){d[J]&&(d[J].firstRun=!1)}var xt=w.data,we={},J=null;xt==="[iFrameResizerChild]Ready"?_t():Ht()?(we=ce(),J=we.id,d[J]&&(d[J].loaded=!0),!vt()&&We(J)&&(U(J,"Received: "+xt),h()&&ct()&&je())):qe(J,"Ignored: "+xt)}function P(w,R,ce){var V=null,he=null;if(d[w])if(V=d[w][R],typeof V=="function")he=V(ce);else throw new TypeError(R+" on iFrame["+w+"] is not a function");return he}function ee(w){var R=w.id;delete d[R]}function Qe(w){var R=w.id;if(P(R,"onClose",R)===!1){U(R,"Close iframe cancelled by onClose event");return}U(R,"Removing iFrame: "+R);try{w.parentNode&&w.parentNode.removeChild(w)}catch(ce){xe(ce)}P(R,"onClosed",R),U(R,"--"),ee(w)}function $(w){u===null&&(u={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset},U(w,"Get page position: "+u.x+","+u.y))}function b(w){u!==null&&(window.scrollTo(u.x,u.y),U(w,"Set page position: "+u.x+","+u.y),y())}function y(){u=null}function _(w){function R(){v(w),k("reset","reset",w.iframe,w.id)}U(w.id,"Size reset requested by "+(w.type==="init"?"host page":"iFrame")),$(w.id),A(R,w,"reset")}function v(w){function R(ve){if(!w.id){U("undefined","messageData id not set");return}w.iframe.style[ve]=w[ve]+"px",U(w.id,"IFrame ("+he+") "+ve+" set to "+w[ve]+"px")}function ce(ve){!i&&w[ve]==="0"&&(i=!0,U(he,"Hidden iFrame detected, creating visibility listener"),He())}function V(ve){R(ve),ce(ve)}var he=w.iframe.id;d[he]&&(d[he].sizeHeight&&V("height"),d[he].sizeWidth&&V("width"))}function A(w,R,ce){ce!==R.type&&c&&!window.jasmine?(U(R.id,"Requesting animation frame"),c(w)):w()}function k(w,R,ce,V,he){function ve(){var wt=d[V]&&d[V].targetOrigin;U(V,"["+w+"] Sending msg to iframe["+V+"] ("+R+") targetOrigin: "+wt),ce.contentWindow.postMessage(a+R,wt)}function ct(){xe(V,"["+w+"] IFrame("+V+") not found")}function Ht(){ce&&"contentWindow"in ce&&ce.contentWindow!==null?ve():ct()}function vt(){function wt(){d[V]&&!d[V].loaded&&!bt&&(bt=!0,xe(V,"IFrame has not responded within "+d[V].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}he&&d[V]&&d[V].warningTimeout&&(d[V].msgTimeout=setTimeout(wt,d[V].warningTimeout))}var bt=!1;V=V||ce.id,d[V]&&(Ht(),vt())}function N(w){return w+":"+d[w].bodyMarginV1+":"+d[w].sizeWidth+":"+d[w].log+":"+d[w].interval+":"+d[w].enablePublicMethods+":"+d[w].autoResize+":"+d[w].bodyMargin+":"+d[w].heightCalculationMethod+":"+d[w].bodyBackground+":"+d[w].bodyPadding+":"+d[w].tolerance+":"+d[w].inPageLinks+":"+d[w].resizeFrom+":"+d[w].widthCalculationMethod+":"+d[w].mouseEvents}function Y(w){return typeof w=="number"}function te(w,R){function ce(){function m(z){var B=d[f][z];B!==1/0&&B!==0&&(w.style[z]=Y(B)?B+"px":B,U(f,"Set "+z+" = "+w.style[z]))}function S(z){if(d[f]["min"+z]>d[f]["max"+z])throw new Error("Value for min"+z+" can not be greater than max"+z)}S("Height"),S("Width"),m("maxHeight"),m("minHeight"),m("maxWidth"),m("minWidth")}function V(){var m=R&&R.id||x.id+t++;return document.getElementById(m)!==null&&(m+=t++),m}function he(m){if(typeof m!="string")throw new TypeError("Invaild id for iFrame. Expected String");return m===""&&(w.id=m=V(),r=(R||{}).log,U(m,"Added missing iframe ID: "+m+" ("+w.src+")")),m}function ve(){switch(U(f,"IFrame scrolling "+(d[f]&&d[f].scrolling?"enabled":"disabled")+" for "+f),w.style.overflow=(d[f]&&d[f].scrolling)===!1?"hidden":"auto",d[f]&&d[f].scrolling){case"omit":break;case!0:{w.scrolling="yes";break}case!1:{w.scrolling="no";break}default:w.scrolling=d[f]?d[f].scrolling:"no"}}function ct(){(typeof(d[f]&&d[f].bodyMargin)=="number"||(d[f]&&d[f].bodyMargin)==="0")&&(d[f].bodyMarginV1=d[f].bodyMargin,d[f].bodyMargin=""+d[f].bodyMargin+"px")}function Ht(){var m=d[f]&&d[f].firstRun,S=d[f]&&d[f].heightCalculationMethod in p;!m&&S&&_({iframe:w,height:0,width:0,type:"init"})}function vt(){d[f]&&(d[f].iframe.iFrameResizer={close:Qe.bind(null,d[f].iframe),removeListeners:ee.bind(null,d[f].iframe),resize:k.bind(null,"Window resize","resize",d[f].iframe),moveToAnchor:function(m){k("Move to anchor","moveToAnchor:"+m,d[f].iframe,f)},sendMessage:function(m){m=JSON.stringify(m),k("Send Message","message:"+m,d[f].iframe,f)}})}function bt(m){function S(){k("iFrame.onload",m,w,e,!0),Ht()}function z(be){if(w.parentNode){var je=new be(function(We){We.forEach(function(_t){var Mi=Array.prototype.slice.call(_t.removedNodes);Mi.forEach(function(xt){xt===w&&Qe(w)})})});je.observe(w.parentNode,{childList:!0})}}var B=j();B&&z(B),Z(w,"load",S),k("init",m,w,e,!0)}function wt(m){if(typeof m!="object")throw new TypeError("Options is not an object")}function Ci(m){for(var S in x)Object.prototype.hasOwnProperty.call(x,S)&&(d[f][S]=Object.prototype.hasOwnProperty.call(m,S)?m[S]:x[S])}function pr(m){return m===""||m.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":m}function Ei(m){var S=m.split("Callback");if(S.length===2){var z="on"+S[0].charAt(0).toUpperCase()+S[0].slice(1);this[z]=this[m],delete this[m],xe(f,"Deprecated: '"+m+"' has been renamed '"+z+"'. The old method will be removed in the next major version.")}}function fr(m){m=m||{},d[f]=Object.create(null),d[f].iframe=w,d[f].firstRun=!0,d[f].remoteHost=w.src&&w.src.split("/").slice(0,3).join("/"),wt(m),Object.keys(m).forEach(Ei,m),Ci(m),d[f]&&(d[f].targetOrigin=d[f].checkOrigin===!0?pr(d[f].remoteHost):"*")}function h(){return f in d&&"iFrameResizer"in w}var f=he(w.id);h()?xe(f,"Ignored iFrame, already setup."):(fr(R),ve(),ce(),ct(),bt(N(f)),vt())}function ue(w,R){g===null&&(g=setTimeout(function(){g=null,w()},R))}var ye={};function Ke(w,R,ce){ye[ce]||(ye[ce]=setTimeout(function(){ye[ce]=null,w()},R))}function He(){function w(){function he(ve){function ct(vt){return(d[ve]&&d[ve].iframe.style[vt])==="0px"}function Ht(vt){return vt.offsetParent!==null}d[ve]&&Ht(d[ve].iframe)&&(ct("height")||ct("width"))&&k("Visibility change","resize",d[ve].iframe,ve)}Object.keys(d).forEach(function(ve){he(ve)})}function R(he){U("window","Mutation observed: "+he[0].target+" "+he[0].type),ue(w,16)}function ce(){var he=document.querySelector("body"),ve={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0},ct=new V(R);ct.observe(he,ve)}var V=j();V&&ce()}function nt(w){function R(){fe("Window "+w,"resize")}U("window","Trigger event: "+w),ue(R,16)}function ze(){function w(){fe("Tab Visible","resize")}document.visibilityState!=="hidden"&&(U("document","Trigger event: Visibility change"),ue(w,16))}function fe(w,R){function ce(V){return d[V]&&d[V].resizeFrom==="parent"&&d[V].autoResize&&!d[V].firstRun}Object.keys(d).forEach(function(V){ce(V)&&k(w,R,d[V].iframe,V)})}function De(){Z(window,"message",G),Z(window,"resize",function(){nt("resize")}),Z(document,"visibilitychange",ze),Z(document,"-webkit-visibilitychange",ze)}function Xe(){function w(V,he){function ve(){if(he.tagName){if(he.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+he.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}he&&(ve(),te(he,V),ce.push(he))}function R(V){V&&V.enablePublicMethods&&xe("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var ce;return me(),De(),function(V,he){switch(ce=[],R(V),typeof he){case"undefined":case"string":{Array.prototype.forEach.call(document.querySelectorAll(he||"iframe"),w.bind(e,V));break}case"object":{w(V,he);break}default:throw new TypeError("Unexpected data type ("+typeof he+")")}return ce}}function ot(w){w.fn?w.fn.iFrameResize||(w.fn.iFrameResize=function(R){function ce(V,he){te(he,R)}return this.filter("iframe").each(ce).end()}):qe("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery!==e&&ot(window.jQuery),n.exports=Xe(),window.iFrameResize=window.iFrameResize||Xe()})()})(hu);var em=hu.exports;const tm=Ro(em);var nm=Object.defineProperty,rm=Object.getOwnPropertyDescriptor,zl=(n,e,t,r)=>{for(var i=r>1?void 0:r?rm(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&nm(e,t,i),i};let $i=class extends it{constructor(){super(...arguments),this.src="",this.showCloseButton=!1}async onLoad(n){tm({log:!1,heightCalculationMethod:"max",onMessage:({message:e})=>{this.dispatchEvent(new CustomEvent("message-received",{bubbles:!0,composed:!0,detail:e}))}},n.target)}close(){this.dispatchEvent(new CustomEvent("close"))}render(){return se`
|
|
622
622
|
<div class="relative">
|
|
623
|
-
${Dt(this.showCloseButton,()=>
|
|
623
|
+
${Dt(this.showCloseButton,()=>se`
|
|
624
624
|
<button class="absolute top-0 right-0 m-2 h-6 text-white focus:outline-none" @click="${this.close}">
|
|
625
625
|
${pl}
|
|
626
626
|
</button>
|
|
@@ -632,14 +632,14 @@ Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An err
|
|
|
632
632
|
@load=${this.onLoad}
|
|
633
633
|
></iframe>
|
|
634
634
|
</div>
|
|
635
|
-
`}};$i.styles=[Tt],zl([Te({type:String})],$i.prototype,"src",2),zl([Te({type:Boolean})],$i.prototype,"showCloseButton",2),$i=zl([St("iai-chat-iframe")],$i);var im=Object.defineProperty,sm=Object.getOwnPropertyDescriptor,dr=(n,e,t,r)=>{for(var i=r>1?void 0:r?sm(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&im(e,t,i),i};let on=class extends it{constructor(){super(...arguments),this.title="",this.src="",this.width="500px",this.height=null,this.showHeader=!0}async connectedCallback(){super.connectedCallback()}close(){this.dispatchEvent(new CustomEvent("close"))}render(){const n=Jr({width:this.width,height:this.height});return
|
|
635
|
+
`}};$i.styles=[Tt],zl([Te({type:String})],$i.prototype,"src",2),zl([Te({type:Boolean})],$i.prototype,"showCloseButton",2),$i=zl([St("iai-chat-iframe")],$i);var im=Object.defineProperty,sm=Object.getOwnPropertyDescriptor,dr=(n,e,t,r)=>{for(var i=r>1?void 0:r?sm(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&im(e,t,i),i};let on=class extends it{constructor(){super(...arguments),this.title="",this.src="",this.width="500px",this.height=null,this.showHeader=!0}async connectedCallback(){super.connectedCallback()}close(){this.dispatchEvent(new CustomEvent("close"))}render(){const n=Jr({width:this.width,height:this.height});return se`
|
|
636
636
|
<div class="fixed inset-0 z-50 bg-black bg-opacity-50 flex justify-center items-center">
|
|
637
637
|
<div
|
|
638
638
|
class="flex flex-col rounded-lg shadow-lg bg-white mx-auto my-auto max-h-[90vh] max-w-[90vw] overflow-hidden"
|
|
639
639
|
style=${n}
|
|
640
640
|
part="modal"
|
|
641
641
|
>
|
|
642
|
-
${Dt(this.showHeader,()=>
|
|
642
|
+
${Dt(this.showHeader,()=>se`
|
|
643
643
|
<div class="header text-lg p-2 flex justify-between items-center">
|
|
644
644
|
<div class="flex flex-row h-full items-center">
|
|
645
645
|
<span class="text-lg font-semibold ml-2">${this.title}</span>
|
|
@@ -666,14 +666,14 @@ Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An err
|
|
|
666
666
|
color: var(--iai-chat-i-iframe-modal-header-fg);
|
|
667
667
|
height: 50px;
|
|
668
668
|
}
|
|
669
|
-
`],dr([Te({type:String})],on.prototype,"title",2),dr([Te({type:String})],on.prototype,"src",2),dr([Te({type:String})],on.prototype,"width",2),dr([Te({type:String})],on.prototype,"height",2),dr([Te({type:Boolean})],on.prototype,"showHeader",2),on=dr([St("iai-chat-iframe-modal")],on);var lm=Object.defineProperty,am=Object.getOwnPropertyDescriptor,Cs=(n,e,t,r)=>{for(var i=r>1?void 0:r?am(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&lm(e,t,i),i};let hr=class extends it{constructor(){super(...arguments),this.content="",this.showRatingControls=!0,this.rating=0}render(){return
|
|
669
|
+
`],dr([Te({type:String})],on.prototype,"title",2),dr([Te({type:String})],on.prototype,"src",2),dr([Te({type:String})],on.prototype,"width",2),dr([Te({type:String})],on.prototype,"height",2),dr([Te({type:Boolean})],on.prototype,"showHeader",2),on=dr([St("iai-chat-iframe-modal")],on);var lm=Object.defineProperty,am=Object.getOwnPropertyDescriptor,Cs=(n,e,t,r)=>{for(var i=r>1?void 0:r?am(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&lm(e,t,i),i};let hr=class extends it{constructor(){super(...arguments),this.content="",this.showRatingControls=!0,this.rating=0}render(){return se`
|
|
670
670
|
<div class="flex items-end mr-20">
|
|
671
671
|
<div class="flex flex-col">
|
|
672
672
|
<div class="message rounded-lg px-4 py-2">
|
|
673
673
|
${Zl(this.content)}
|
|
674
674
|
</div>
|
|
675
675
|
|
|
676
|
-
${Dt(this.showRatingControls,()=>
|
|
676
|
+
${Dt(this.showRatingControls,()=>se`
|
|
677
677
|
<div class="mt-1 pl-3 text-gray-400 opacity-80">
|
|
678
678
|
<button
|
|
679
679
|
class="h-4 w-4 ${us({"active-rating":this.rating===1})}"
|
|
@@ -701,15 +701,15 @@ Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An err
|
|
|
701
701
|
.active-rating {
|
|
702
702
|
color: var(--iai-chat-i-message-assistant-rating-active);
|
|
703
703
|
}
|
|
704
|
-
`],Cs([Te({type:String})],hr.prototype,"content",2),Cs([Te({type:Boolean})],hr.prototype,"showRatingControls",2),Cs([Te({type:Number})],hr.prototype,"rating",2),hr=Cs([St("iai-chat-message-assistant")],hr);async function om(n,e){const{type:t,params:r}=n,i=e[t];if(!i)throw new Error(`No handler for enhanced content type ${t}`);return i({params:r,html:
|
|
704
|
+
`],Cs([Te({type:String})],hr.prototype,"content",2),Cs([Te({type:Boolean})],hr.prototype,"showRatingControls",2),Cs([Te({type:Number})],hr.prototype,"rating",2),hr=Cs([St("iai-chat-message-assistant")],hr);async function om(n,e){const{type:t,params:r}=n,i=e[t];if(!i)throw new Error(`No handler for enhanced content type ${t}`);return i({params:r,html:se})}var um=Object.defineProperty,cm=Object.getOwnPropertyDescriptor,Ai=(n,e,t,r)=>{for(var i=r>1?void 0:r?cm(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&um(e,t,i),i};let jn=class extends it{constructor(){super(...arguments),this.content=""}async connectedCallback(){if(super.connectedCallback(),this.enhancedContent)try{this.contentHtmlTemplate=await om(this.enhancedContent,this.options.handlers.enhancedContent)}catch(n){console.warn("Error processing enhanced content",n)}this.contentHtmlTemplate||(this.contentHtmlTemplate=se`
|
|
705
705
|
<div class="text-center text-gray-400 text-sm">
|
|
706
706
|
${Zl(this.content)}
|
|
707
707
|
</div>
|
|
708
|
-
`)}render(){return
|
|
708
|
+
`)}render(){return se`
|
|
709
709
|
<div>
|
|
710
710
|
${this.contentHtmlTemplate}
|
|
711
711
|
</div>
|
|
712
|
-
`}};jn.styles=[Tt],Ai([Te({type:Object})],jn.prototype,"options",2),Ai([Te({type:String})],jn.prototype,"content",2),Ai([Te({type:Object})],jn.prototype,"enhancedContent",2),Ai([Te()],jn.prototype,"contentHtmlTemplate",2),jn=Ai([St("iai-chat-message-system")],jn);var dm=Object.defineProperty,hm=Object.getOwnPropertyDescriptor,pu=(n,e,t,r)=>{for(var i=r>1?void 0:r?hm(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&dm(e,t,i),i};let Es=class extends it{constructor(){super(...arguments),this.content=""}render(){return
|
|
712
|
+
`}};jn.styles=[Tt],Ai([Te({type:Object})],jn.prototype,"options",2),Ai([Te({type:String})],jn.prototype,"content",2),Ai([Te({type:Object})],jn.prototype,"enhancedContent",2),Ai([Te()],jn.prototype,"contentHtmlTemplate",2),jn=Ai([St("iai-chat-message-system")],jn);var dm=Object.defineProperty,hm=Object.getOwnPropertyDescriptor,pu=(n,e,t,r)=>{for(var i=r>1?void 0:r?hm(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&dm(e,t,i),i};let Es=class extends it{constructor(){super(...arguments),this.content=""}render(){return se`
|
|
713
713
|
<div class="flex items-end justify-end ml-20">
|
|
714
714
|
<div class="message rounded-lg px-4 py-2 flex gap-2">
|
|
715
715
|
<p class="whitespace-pre-wrap">${this.content}</p>
|
|
@@ -720,11 +720,11 @@ Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An err
|
|
|
720
720
|
background-color: var(--iai-chat-i-message-user-bg);
|
|
721
721
|
color: var(--iai-chat-i-message-user-fg);
|
|
722
722
|
}
|
|
723
|
-
`],pu([Te({type:String})],Es.prototype,"content",2),Es=pu([St("iai-chat-message-user")],Es);var pm=Object.defineProperty,fm=Object.getOwnPropertyDescriptor,fu=(n,e,t,r)=>{for(var i=r>1?void 0:r?fm(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&pm(e,t,i),i};let Ms=class extends it{render(){const{openChatButton:{width:n,height:e,imageSrc:t}}=this.options.config,r=Jr({width:n,height:e});return
|
|
723
|
+
`],pu([Te({type:String})],Es.prototype,"content",2),Es=pu([St("iai-chat-message-user")],Es);var pm=Object.defineProperty,fm=Object.getOwnPropertyDescriptor,fu=(n,e,t,r)=>{for(var i=r>1?void 0:r?fm(e,t):e,s=n.length-1,l;s>=0;s--)(l=n[s])&&(i=(r?l(e,t,i):l(i))||i);return r&&i&&pm(e,t,i),i};let Ms=class extends it{render(){const{openChatButton:{width:n,height:e,imageSrc:t}}=this.options.config,r=Jr({width:n,height:e});return se`
|
|
724
724
|
<button @click="${this.toggleChat}">
|
|
725
|
-
${Dt(t,()=>
|
|
725
|
+
${Dt(t,()=>se`
|
|
726
726
|
<img src="${t}" alt="Chat Icon" style=${r}/>
|
|
727
|
-
`,()=>
|
|
727
|
+
`,()=>se`
|
|
728
728
|
<div class="button rounded-full flex items-center justify-center" style=${r}>
|
|
729
729
|
<div class="h-3/5 w-3/5">
|
|
730
730
|
${sh}
|
|
@@ -742,6 +742,22 @@ Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An err
|
|
|
742
742
|
color: var(--iai-chat-i-ocb-fg);
|
|
743
743
|
}
|
|
744
744
|
`],fu([Te({type:Object})],Ms.prototype,"options",2),Ms=fu([St("iai-chat-open-chat-button")],Ms);function mm(n){return n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function mu(n,e=""){return Object.keys(n).reduce((t,r)=>{const i=mm(r),s=e?`${e}-${i}`:i;return typeof n[r]=="object"&&n[r]!==null?Object.assign(t,mu(n[r],s)):t[s]=n[r],t},{})}class gm{constructor(e){this.widget=null,this.options=_s.parse(e);const t=document.createElement("iai-chat-popup");t.options=this.options;const r=mu(this.options.config.styles);Object.entries(r).filter(([,i])=>i).forEach(([i,s])=>{t.style.setProperty(`--iai-chat-${i}`,s)}),document.body.appendChild(t),this.widget=t}get api(){if(!this.widget)throw new Error("Widget has not been initialized");return this.widget}destroy(){var e;(e=this.widget)==null||e.remove(),this.widget=null}}function ym({html:n,params:e}){return n`
|
|
745
|
+
<div>
|
|
746
|
+
<iai-chat-carousel>
|
|
747
|
+
${e.photos.map(t=>{const r=n`<img src="${`${t.url}`}" alt="${t.name||"Property image"}">`;return n`
|
|
748
|
+
<div>
|
|
749
|
+
<h2>${t.name||""}</h2>
|
|
750
|
+
<ul>
|
|
751
|
+
${t.bed?n`<li>Bedrooms: ${t.bed}</li>`:""}
|
|
752
|
+
${t.bath?n`<li>Bathrooms: ${t.bath}</li>`:""}
|
|
753
|
+
${t.sqft?n`<li>SQFT: ${t.sqft}</li>`:""}
|
|
754
|
+
</ul>
|
|
755
|
+
${r}
|
|
756
|
+
</div>
|
|
757
|
+
`})}
|
|
758
|
+
</iai-chat-carousel>
|
|
759
|
+
</div>
|
|
760
|
+
`}function vm({html:n,params:e}){return n`
|
|
745
761
|
<div>
|
|
746
762
|
<iai-chat-carousel>
|
|
747
763
|
${e.units.map(t=>{const r=t.floorPlanImage!=="Data not available"?n`<img src="${t.floorPlanImage}" alt="">`:"";return n`
|
|
@@ -758,7 +774,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An err
|
|
|
758
774
|
`})}
|
|
759
775
|
</iai-chat-carousel>
|
|
760
776
|
</div>
|
|
761
|
-
`}var gu={exports:{}};(function(n,e){(function(t,r){n.exports=r()})(Fi,function(){var t=1e3,r=6e4,i=36e5,s="millisecond",l="second",a="minute",o="hour",u="day",c="week",p="month",d="quarter",g="year",x="date",j="Invalid Date",Z=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,de=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ve={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var b=["th","st","nd","rd"],y=$%100;return"["+$+(b[(y-20)%10]||b[y]||b[0])+"]"}},le=function($,b,y){var _=String($);return!_||_.length>=b?$:""+Array(b+1-_.length).join(y)+$},Ie={s:le,z:function($){var b=-$.utcOffset(),y=Math.abs(b),_=Math.floor(y/60),v=y%60;return(b<=0?"+":"-")+le(_,2,"0")+":"+le(v,2,"0")},m:function $(b,y){if(b.date()<y.date())return-$(y,b);var _=12*(y.year()-b.year())+(y.month()-b.month()),v=b.clone().add(_,p),A=y-v<0,k=b.clone().add(_+(A?-1:1),p);return+(-(_+(y-v)/(A?v-k:k-v))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:p,y:g,w:c,d:u,D:x,h:o,m:a,s:l,ms:s,Q:d}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},Ae="en",U={};U[Ae]=ve;var qe="$isDayjsObject",xe=function($){return $ instanceof X||!(!$||!$[qe])},Ze=function $(b,y,_){var v;if(!b)return Ae;if(typeof b=="string"){var A=b.toLowerCase();U[A]&&(v=A),y&&(U[A]=y,v=A);var k=b.split("-");if(!v&&k.length>1)return $(k[0])}else{var N=b.name;U[N]=b,v=N}return!_&&v&&(Ae=v),v||!_&&Ae},G=function($,b){if(xe($))return $.clone();var y=typeof b=="object"?b:{};return y.date=$,y.args=arguments,new X(y)},P=Ie;P.l=Ze,P.i=xe,P.w=function($,b){return G($,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var X=function(){function $(y){this.$L=Ze(y.locale,null,!0),this.parse(y),this.$x=this.$x||y.x||{},this[qe]=!0}var b=$.prototype;return b.parse=function(y){this.$d=function(_){var v=_.date,A=_.utc;if(v===null)return new Date(NaN);if(P.u(v))return new Date;if(v instanceof Date)return new Date(v);if(typeof v=="string"&&!/Z$/i.test(v)){var k=v.match(Z);if(k){var N=k[2]-1||0,Y=(k[7]||"0").substring(0,3);return A?new Date(Date.UTC(k[1],N,k[3]||1,k[4]||0,k[5]||0,k[6]||0,Y)):new Date(k[1],N,k[3]||1,k[4]||0,k[5]||0,k[6]||0,Y)}}return new Date(v)}(y),this.init()},b.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},b.$utils=function(){return P},b.isValid=function(){return this.$d.toString()!==j},b.isSame=function(y,_){var v=G(y);return this.startOf(_)<=v&&v<=this.endOf(_)},b.isAfter=function(y,_){return G(y)<this.startOf(_)},b.isBefore=function(y,_){return this.endOf(_)<G(y)},b.$g=function(y,_,v){return P.u(y)?this[_]:this.set(v,y)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(y,_){var v=this,A=!!P.u(_)||_,k=P.p(y),N=function(ze,fe){var De=P.w(v.$u?Date.UTC(v.$y,fe,ze):new Date(v.$y,fe,ze),v);return A?De:De.endOf(u)},Y=function(ze,fe){return P.w(v.toDate()[ze].apply(v.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(fe)),v)},ee=this.$W,ue=this.$M,ge=this.$D,Ke="set"+(this.$u?"UTC":"");switch(k){case g:return A?N(1,0):N(31,11);case p:return A?N(1,ue):N(0,ue+1);case c:var He=this.$locale().weekStart||0,nt=(ee<He?ee+7:ee)-He;return N(A?ge-nt:ge+(6-nt),ue);case u:case x:return Y(Ke+"Hours",0);case o:return Y(Ke+"Minutes",1);case a:return Y(Ke+"Seconds",2);case l:return Y(Ke+"Milliseconds",3);default:return this.clone()}},b.endOf=function(y){return this.startOf(y,!1)},b.$set=function(y,_){var v,A=P.p(y),k="set"+(this.$u?"UTC":""),N=(v={},v[u]=k+"Date",v[x]=k+"Date",v[p]=k+"Month",v[g]=k+"FullYear",v[o]=k+"Hours",v[a]=k+"Minutes",v[l]=k+"Seconds",v[s]=k+"Milliseconds",v)[A],Y=A===u?this.$D+(_-this.$W):_;if(A===p||A===g){var ee=this.clone().set(x,1);ee.$d[N](Y),ee.init(),this.$d=ee.set(x,Math.min(this.$D,ee.daysInMonth())).$d}else N&&this.$d[N](Y);return this.init(),this},b.set=function(y,_){return this.clone().$set(y,_)},b.get=function(y){return this[P.p(y)]()},b.add=function(y,_){var v,A=this;y=Number(y);var k=P.p(_),N=function(ue){var ge=G(A);return P.w(ge.date(ge.date()+Math.round(ue*y)),A)};if(k===p)return this.set(p,this.$M+y);if(k===g)return this.set(g,this.$y+y);if(k===u)return N(1);if(k===c)return N(7);var Y=(v={},v[a]=r,v[o]=i,v[l]=t,v)[k]||1,ee=this.$d.getTime()+y*Y;return P.w(ee,this)},b.subtract=function(y,_){return this.add(-1*y,_)},b.format=function(y){var _=this,v=this.$locale();if(!this.isValid())return v.invalidDate||j;var A=y||"YYYY-MM-DDTHH:mm:ssZ",k=P.z(this),N=this.$H,Y=this.$m,ee=this.$M,ue=v.weekdays,ge=v.months,Ke=v.meridiem,He=function(fe,De,Xe,ot){return fe&&(fe[De]||fe(_,A))||Xe[De].slice(0,ot)},nt=function(fe){return P.s(N%12||12,fe,"0")},ze=Ke||function(fe,De,Xe){var ot=fe<12?"AM":"PM";return Xe?ot.toLowerCase():ot};return A.replace(de,function(fe,De){return De||function(Xe){switch(Xe){case"YY":return String(_.$y).slice(-2);case"YYYY":return P.s(_.$y,4,"0");case"M":return ee+1;case"MM":return P.s(ee+1,2,"0");case"MMM":return He(v.monthsShort,ee,ge,3);case"MMMM":return He(ge,ee);case"D":return _.$D;case"DD":return P.s(_.$D,2,"0");case"d":return String(_.$W);case"dd":return He(v.weekdaysMin,_.$W,ue,2);case"ddd":return He(v.weekdaysShort,_.$W,ue,3);case"dddd":return ue[_.$W];case"H":return String(N);case"HH":return P.s(N,2,"0");case"h":return nt(1);case"hh":return nt(2);case"a":return ze(N,Y,!0);case"A":return ze(N,Y,!1);case"m":return String(Y);case"mm":return P.s(Y,2,"0");case"s":return String(_.$s);case"ss":return P.s(_.$s,2,"0");case"SSS":return P.s(_.$ms,3,"0");case"Z":return k}return null}(fe)||k.replace(":","")})},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(y,_,v){var A,k=this,N=P.p(_),Y=G(y),ee=(Y.utcOffset()-this.utcOffset())*r,ue=this-Y,ge=function(){return P.m(k,Y)};switch(N){case g:A=ge()/12;break;case p:A=ge();break;case d:A=ge()/3;break;case c:A=(ue-ee)/6048e5;break;case u:A=(ue-ee)/864e5;break;case o:A=ue/i;break;case a:A=ue/r;break;case l:A=ue/t;break;default:A=ue}return v?A:P.a(A)},b.daysInMonth=function(){return this.endOf(p).$D},b.$locale=function(){return U[this.$L]},b.locale=function(y,_){if(!y)return this.$L;var v=this.clone(),A=Ze(y,_,!0);return A&&(v.$L=A),v},b.clone=function(){return P.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},$}(),Qe=X.prototype;return G.prototype=Qe,[["$ms",s],["$s",l],["$m",a],["$H",o],["$W",u],["$M",p],["$y",g],["$D",x]].forEach(function($){Qe[$[1]]=function(b){return this.$g(b,$[0],$[1])}}),G.extend=function($,b){return $.$i||($(b,X,G),$.$i=!0),G},G.locale=Ze,G.isDayjs=xe,G.unix=function($){return G(1e3*$)},G.en=U[Ae],G.Ls=U,G.p={},G})})(gu);var vm=gu.exports;const bm=ad(vm);function wm(n){return async function({id:t,params:r,chatWindow:i}){i.setInputDisabled(!0);const s=i.chatManager.registerRecurringKeepAlive(),{threadId:l}=i.chatManager,a={isAIChat:!0,guestCardId:r.guestCardId||null,AIChatSessionTimeout:!1,...l&&{AIChatUniqueSessionId:l},...r.firstName&&{firstName:r.firstName},...r.lastName&&{lastName:r.lastName},...r.email&&{email:r.email},...r.phoneNumber&&{phone:r.phoneNumber},...r.desiredMoveInDate&&{moveInDate:bm(r.desiredMoveInDate).format("MM/DD/YYYY")},...r.AccessWidgetLeadId&&{AccessWidgetLeadId:r.AccessWidgetLeadId}},o=document.createElement("iai-chat-iframe-modal");o.title="Schedule a Tour",o.src=`${n}?${new URLSearchParams(a).toString()}`,o.showHeader=!1;const u=()=>{s(),o.remove(),window.removeEventListener("beforeunload",d),i.removeEventListener("iai-chat-reset",u),i.setInputDisabled(!1)},c=async({detail:g})=>{if(g.type!=="tourScheduled")return;const{tourType:x,tourDate:j,tourTime:Z,guestCardId:de}=g;u(),i.setInputDisabled(!0),i.addMessage({role:"system",content:"Your tour has been scheduled!"});try{await i.sendFunctionCallResponse(t,{status:"scheduled",tourType:x,tourDate:j,tourTime:Z,guestCardId:de},!0)}finally{i.setInputDisabled(!1)}},p=async()=>{u(),i.setInputDisabled(!0),i.addMessage({role:"system",content:"Tour Scheduler Closed"});try{await i.sendFunctionCallResponse(t,{status:"canceled"},!0)}finally{i.setInputDisabled(!1)}},d=async()=>{u(),i.addMessage({role:"system",content:"Tour Scheduler Closed"})};o.addEventListener("message-received",c),o.addEventListener("close",p),i.addEventListener("iai-chat-reset",u),window.addEventListener("beforeunload",d),document.body.appendChild(o),i.addMessage({role:"system",content:"Tour Scheduler Opened"})}}const _m=typeof window<"u"&&window||typeof global<"u"&&global||{},yu=_m.IAI_BACKEND_URL||"https://api.ai.inhabit.services",un={async get(n,e={}){return this.request(n,{...e,method:"GET"})},async post(n,e={},t={}){return this.request(n,{...t,method:"POST",body:JSON.stringify(e)})},async put(n,e={},t={}){return this.request(n,{...t,method:"PUT",body:JSON.stringify(e)})},async delete(n,e={}){return this.request(n,{...e,method:"DELETE"})},async patch(n,e={},t={}){return this.request(n,{...t,method:"PATCH",body:JSON.stringify(e)})},async request(n,e={}){const{returnFullResponse:t=!1,...r}=e,i={...r,headers:{"Content-Type":"application/json",...r.headers}};n=n.replace(/^\//,"");const s=await fetch(`${yu}/${n}`,i);if(!s.ok){if(s.status===429){const a=+(s.headers.get("Retry-After")||30);throw new Hl(`Rate limited fetching /${n}: retry after ${a} seconds`,s.status,{retryAfter:a})}const l=[`Failed to fetch /${n}:`];try{const{message:a}=await s.json();if(!a)throw new Error;l.push(a)}catch{l.push(`${s.status} (${s.statusText})`)}throw new Hl(l.join(" "),s.status)}if(t)return s;try{return await s.json()}catch{return null}}};async function xm(n,e={},t){return un.post("/threads",{assistantId:n,params:e,clientId:t})}async function km(n,e="No reason provided"){await un.post(`/threads/${n}/end`,{reason:e})}async function $m(n,e){return un.post(`/threads/${n}/messages`,{content:e})}async function Am(n,e,t){const r=(await un.post(`/threads/${n}/messages/streaming`,{content:e},{returnFullResponse:!0})).body.getReader(),i=new TextDecoder("utf-8");let s=!1,l="";const a=async()=>{const{done:o,value:u}=await r.read();if(o)return JSON.parse(l);const c=i.decode(u);if(s)l+=c;else if(c.includes("---START_RESULT---")){const[p,d]=c.split("---START_RESULT---");s=!0,l+=d,p&&t(p)}else t(c);return a()};return a()}async function Sm(n,e,t){await un.put(`/threads/${n}/messages/${e}/rate`,{rating:t})}async function Tm(n,e,t,r=!1){return un.post(`/threads/${n}/functions/${e}`,{params:t,rerunLLM:r})}async function Cm(n){return un.post(`/threads/${n}/ping`)}class Hl extends Error{constructor(e,t,r){super(e),this.status=t,this.details=r}}const Em=Object.freeze(Object.defineProperty({__proto__:null,APIError:Hl,baseApi:un,baseUrl:yu,createThread:xm,endThread:km,pingThread:Cm,rateMessage:Sm,respondToFunctionCall:Tm,sendUserMessage:$m,sendUserMessageStreaming:Am},Symbol.toStringTag,{value:"Module"}));function vu(n){return{all:n=n||new Map,on:function(e,t){var r=n.get(e);r?r.push(t):n.set(e,[t])},off:function(e,t){var r=n.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var r=n.get(e);r&&r.slice().map(function(i){i(t)}),(r=n.get("*"))&&r.slice().map(function(i){i(e,t)})}}}class Mm{constructor(e){this.chatWsUrl=e,this._emitter=vu(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),this.reconnectCodes=new Set([1006]),this.reconnectAttempts=0,this.maxReconnectAttempts=10}connect(){const e=new WebSocket(this.chatWsUrl);e.onopen=async()=>{this.reconnectAttempts=0,e.send(JSON.stringify({type:"ready"}))},e.onmessage=t=>{const r=JSON.parse(t.data);this._emitter.emit(r.type,r.data)},e.onclose=t=>{console.log("Disconnected: ",t.code,t.reason||"No reason provided"),this._emitter.emit("disconnected",t),this.reconnectCodes.has(t.code)&&this.reconnectAttempts<this.maxReconnectAttempts&&(console.log("Reconnecting..."),this._emitter.emit("reconnecting"),this.reconnectAttempts++,setTimeout(()=>this.connect(),this.reconnectAttempts*1e3))},e.onerror=t=>{console.log("Error:",t),this._emitter.emit("error",t)},this.ws=e}reconnect(){this.reconnectAttempts=0,this.connect()}disconnect(){var e;(e=this.ws)==null||e.close()}destroy(){this.disconnect(),this._emitter.all.clear()}}var Is;(n=>{(e=>{e.TEXT="TEXT"})(n.MessageType||(n.MessageType={})),(e=>{e.DELIVERED="DELIVERED",e.READ="READ",e.FAILED="FAILED"})(n.AcknowledgeType||(n.AcknowledgeType={})),(e=>{e.GENERIC="GENERIC",e.SMS="SMS",e.RCS="RCS",e.FACEBOOK="FACEBOOK",e.TWITTER="TWITTER",e.WHATSAPP="WHATSAPP",e.WECHAT="WECHAT",e.QQMOBILE="QQMOBILE",e.APPLE_BUSINESS_CHAT="APPLE_BUSINESS_CHAT",e.SKYPE="SKYPE",e.SNAPCHAT="SNAPCHAT",e.VIBER="VIBER",e.LINE="LINE",e.TELEGRAM="TELEGRAM",e.KAKAO="KAKAO"})(n.ContentType||(n.ContentType={})),(e=>{e.SYSTEM="SYSTEM",e.USER="USER"})(n.ConversationEventOrigin||(n.ConversationEventOrigin={})),(e=>{e.PENDING="PENDING",e.ACTIVE="ACTIVE",e.TERMINATED="TERMINATED"})(n.ConversationStatus||(n.ConversationStatus={}))})(Is||(Is={}));const Im=Is.AcknowledgeType,Om="Anyone Home",Nm="IB Chat Leasing";let Pm="https://five9.ah.inhabit.work";const Rm="https://five9.ah.inhabit.work".replace("http","ws").replace(/\/$/,""),Ti=class Ti{constructor(){Ul(this,zt);Ul(this,Ln);this._emitter=vu(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),cn(this,zt,null),cn(this,Ln,null),this.conversationStarted=!1}serialize(){return JSON.stringify({sessionToken:this.sessionToken,conversationId:this.conversationId,conversationStarted:this.conversationStarted})}static deserialize(e){const t=JSON.parse(e),r=new Ti;return t.sessionToken&&r.setSession(t.sessionToken),t.conversationId&&r.setConversationId(t.conversationId),r.conversationStarted=t.conversationStarted||!1,r}static generateBaseUrl(e){return`https://${e}/appsvcs/rs/svc`}async createSession(){const e=await fetch(`${Ti.generateBaseUrl("app-scl.five9.com")}/auth/anon?cookieless=true`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({tenantName:Om})});return cn(this,zt,await e.json()),Ns(this,zt)}setSession(e){cn(this,zt,e)}setConversationId(e){cn(this,Ln,e),this.five9WebSocket&&(this.five9WebSocket.destroy(),this.five9WebSocket=void 0,e&&this.connectToWebSocket())}connect(){if(!this.sessionToken)throw new Error("Session not created");if(!this.conversationId)throw new Error("Conversation not started");this.connectToWebSocket()}connectToWebSocket(){if(!this.conversationId)throw new Error("Conversation not started");this.five9WebSocket&&this.five9WebSocket.destroy();const e=new Mm(`${Rm}/conversations/${this.conversationId}/ws`);e.on("*",(t,r)=>{this._emitter.emit(t,r)}),e.on("conversationCreated",t=>{this.conversationStarted=!0,console.log("Conversation Created:",t)}),e.on("conversationAccepted",t=>{console.log("Conversation Accepted:",t)}),e.on("agentJoined",t=>{console.log("Agent Joined:",t)}),e.on("agentTransferredConversation",t=>{console.log("Agent Transferred Conversation:",t)}),e.on("conversationTransferredToGroup",t=>{console.log("Conversation Transferred To Group:",t)}),e.on("agentLeftConversation",t=>{console.log("Agent Left Conversation:",t)}),e.on("agentTyping",t=>{console.log("Agent Typing:",t)}),e.on("message",async t=>{console.log("Message:",t),await this.acknowledgeMessage({messages:[{messageId:t.messageId,type:Im.READ}]})}),e.on("conversationTerminated",t=>{console.log("Conversation Terminated:",t)}),e.on("error",t=>{console.log("Error:",t)}),this.five9WebSocket=e,e.connect()}async authenticatedFetch(e,t={}){const{sessionToken:r}=this;if(!r)throw new Error("Session not found");e=e.startsWith("/")?e:`/${e}`;const i=r.metadata.dataCenters[0].apiUrls[0].host,s=await fetch(`${Ti.generateBaseUrl(i)}${e}`,{...t,headers:{...t.headers,"Content-Type":"application/json",Accept:"application/json",Authorization:r.tokenId,farmId:r.context.farmId}});return s.status===204?null:s.json()}async getMetadata(){if(!this.sessionToken)throw new Error("Session not created");return this.authenticatedFetch("/auth/metadata",{method:"GET"})}async createConversation(e){if(!this.sessionToken)throw new Error("Session not created");const t=e.contact||{};Object.keys(t).forEach(s=>{const l=s;t[l]||delete t[l]});const r={...e,campaignName:Nm,tenantId:this.tenantId,callbackUrl:Pm};console.log("body",r);const i=await this.authenticatedFetch("/conversations",{method:"POST",body:JSON.stringify(r)});return this.setConversationId(i.id),i}async sendMessage(e){const{conversationId:t,conversationStarted:r}=this;if(!t||!r)throw new Error("Conversation not started");const i={messageType:Is.MessageType.TEXT,message:e};await this.authenticatedFetch(`/conversations/${t}/messages`,{method:"POST",body:JSON.stringify(i)})}async sendTyping(){const{conversationId:e}=this;if(!e)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${e}/messages/typing`,{method:"PUT"})}async acknowledgeMessage(e){const{conversationId:t}=this;if(!t)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${t}/messages/acknowledge`,{method:"PUT",body:JSON.stringify(e)})}async terminateConversation(){const{conversationId:e}=this;if(!e)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${e}/terminate`,{method:"POST"}),this.destroy()}destroy(){this.five9WebSocket&&this.five9WebSocket.destroy(),cn(this,zt,null),cn(this,Ln,null)}get sessionToken(){return Ns(this,zt)}get conversationId(){return Ns(this,Ln)}get dataCenter(){var e;return(e=this.sessionToken)==null?void 0:e.metadata.dataCenters[0]}get apiUrl(){var e;return(e=this.dataCenter)==null?void 0:e.apiUrls[0].host}get tenantId(){var e;return(e=this.sessionToken)==null?void 0:e.orgId}get tokenId(){var e;return(e=this.sessionToken)==null?void 0:e.tokenId}get farmId(){var e;return(e=this.sessionToken)==null?void 0:e.context.farmId}};zt=new WeakMap,Ln=new WeakMap;let Os=Ti;const{baseApi:Dm}=Em;function Si(n){return`any-${n||"main"}-chatSession`}async function jm({id:n,params:e,chatWindow:t,html:r}){const{threadId:i}=t.chatManager;t=t;const s=async()=>{const{firstName:p,lastName:d,phone:g,email:x,propertyId:j}=e,Z={propertyId:j,firstName:p,lastName:d,phoneNumber:g,email:x,threadId:i},{guestCardId:de}=await Dm.post("/anyone-home/newGuestCard",Z);e.guestCardId=de},l=async()=>{t.removeMessage("transferMessageId"),t.removeMessage("guestCardFormId"),await t.sendFunctionCallResponse(n,{transfer:"Declined"},!0),t.setInputDisabled(!1)},a=async()=>{t.removeMessage("transferMessageId"),e.guestCardId?(o(),await u()):await c()},o=()=>{t.addMessage({id:"waitMessageId",role:"system",content:"Please wait while we connect you to a live agent"}),t.setInputDisabled(!0)},u=async()=>{await t.sendFunctionCallResponse(n,{transfer:"Accepted",guestCardId:e.guestCardId,firstName:e.firstName,lastName:e.lastName,phone:e.phoneNumber,email:e.email},!1),await t.chatManager.endChat("Transferred to live agent",!1);const p=new Os;await p.createSession();const{summary:d,subject:g,guestCardId:x,firstName:j,lastName:Z,phoneNumber:de,email:ve}=e;await p.createConversation({contact:{firstName:j,lastName:Z,number1:de,email:ve},attributes:{"Chat.gc_id":x,Question:g,"AI Summary":d}}),localStorage.setItem(Si(t.cleanOptions.config.historyKey),p.serialize()),bu(t,p)},c=async()=>{const p=async d=>{e={...e,...d.detail},t.removeMessage("guestCardFormId"),o();try{await s()}catch(g){console.log(g)}await u()};t.addMessage({id:"guestCardFormId",role:"system",contentHtmlTemplate:r`
|
|
777
|
+
`}var gu={exports:{}};(function(n,e){(function(t,r){n.exports=r()})(Fi,function(){var t=1e3,r=6e4,i=36e5,s="millisecond",l="second",a="minute",o="hour",u="day",c="week",p="month",d="quarter",g="year",x="date",j="Invalid Date",Z=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,de=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,me={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var b=["th","st","nd","rd"],y=$%100;return"["+$+(b[(y-20)%10]||b[y]||b[0])+"]"}},X=function($,b,y){var _=String($);return!_||_.length>=b?$:""+Array(b+1-_.length).join(y)+$},Ie={s:X,z:function($){var b=-$.utcOffset(),y=Math.abs(b),_=Math.floor(y/60),v=y%60;return(b<=0?"+":"-")+X(_,2,"0")+":"+X(v,2,"0")},m:function $(b,y){if(b.date()<y.date())return-$(y,b);var _=12*(y.year()-b.year())+(y.month()-b.month()),v=b.clone().add(_,p),A=y-v<0,k=b.clone().add(_+(A?-1:1),p);return+(-(_+(y-v)/(A?v-k:k-v))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:p,y:g,w:c,d:u,D:x,h:o,m:a,s:l,ms:s,Q:d}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},Ae="en",U={};U[Ae]=me;var qe="$isDayjsObject",xe=function($){return $ instanceof ee||!(!$||!$[qe])},Ze=function $(b,y,_){var v;if(!b)return Ae;if(typeof b=="string"){var A=b.toLowerCase();U[A]&&(v=A),y&&(U[A]=y,v=A);var k=b.split("-");if(!v&&k.length>1)return $(k[0])}else{var N=b.name;U[N]=b,v=N}return!_&&v&&(Ae=v),v||!_&&Ae},G=function($,b){if(xe($))return $.clone();var y=typeof b=="object"?b:{};return y.date=$,y.args=arguments,new ee(y)},P=Ie;P.l=Ze,P.i=xe,P.w=function($,b){return G($,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var ee=function(){function $(y){this.$L=Ze(y.locale,null,!0),this.parse(y),this.$x=this.$x||y.x||{},this[qe]=!0}var b=$.prototype;return b.parse=function(y){this.$d=function(_){var v=_.date,A=_.utc;if(v===null)return new Date(NaN);if(P.u(v))return new Date;if(v instanceof Date)return new Date(v);if(typeof v=="string"&&!/Z$/i.test(v)){var k=v.match(Z);if(k){var N=k[2]-1||0,Y=(k[7]||"0").substring(0,3);return A?new Date(Date.UTC(k[1],N,k[3]||1,k[4]||0,k[5]||0,k[6]||0,Y)):new Date(k[1],N,k[3]||1,k[4]||0,k[5]||0,k[6]||0,Y)}}return new Date(v)}(y),this.init()},b.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},b.$utils=function(){return P},b.isValid=function(){return this.$d.toString()!==j},b.isSame=function(y,_){var v=G(y);return this.startOf(_)<=v&&v<=this.endOf(_)},b.isAfter=function(y,_){return G(y)<this.startOf(_)},b.isBefore=function(y,_){return this.endOf(_)<G(y)},b.$g=function(y,_,v){return P.u(y)?this[_]:this.set(v,y)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(y,_){var v=this,A=!!P.u(_)||_,k=P.p(y),N=function(ze,fe){var De=P.w(v.$u?Date.UTC(v.$y,fe,ze):new Date(v.$y,fe,ze),v);return A?De:De.endOf(u)},Y=function(ze,fe){return P.w(v.toDate()[ze].apply(v.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(fe)),v)},te=this.$W,ue=this.$M,ye=this.$D,Ke="set"+(this.$u?"UTC":"");switch(k){case g:return A?N(1,0):N(31,11);case p:return A?N(1,ue):N(0,ue+1);case c:var He=this.$locale().weekStart||0,nt=(te<He?te+7:te)-He;return N(A?ye-nt:ye+(6-nt),ue);case u:case x:return Y(Ke+"Hours",0);case o:return Y(Ke+"Minutes",1);case a:return Y(Ke+"Seconds",2);case l:return Y(Ke+"Milliseconds",3);default:return this.clone()}},b.endOf=function(y){return this.startOf(y,!1)},b.$set=function(y,_){var v,A=P.p(y),k="set"+(this.$u?"UTC":""),N=(v={},v[u]=k+"Date",v[x]=k+"Date",v[p]=k+"Month",v[g]=k+"FullYear",v[o]=k+"Hours",v[a]=k+"Minutes",v[l]=k+"Seconds",v[s]=k+"Milliseconds",v)[A],Y=A===u?this.$D+(_-this.$W):_;if(A===p||A===g){var te=this.clone().set(x,1);te.$d[N](Y),te.init(),this.$d=te.set(x,Math.min(this.$D,te.daysInMonth())).$d}else N&&this.$d[N](Y);return this.init(),this},b.set=function(y,_){return this.clone().$set(y,_)},b.get=function(y){return this[P.p(y)]()},b.add=function(y,_){var v,A=this;y=Number(y);var k=P.p(_),N=function(ue){var ye=G(A);return P.w(ye.date(ye.date()+Math.round(ue*y)),A)};if(k===p)return this.set(p,this.$M+y);if(k===g)return this.set(g,this.$y+y);if(k===u)return N(1);if(k===c)return N(7);var Y=(v={},v[a]=r,v[o]=i,v[l]=t,v)[k]||1,te=this.$d.getTime()+y*Y;return P.w(te,this)},b.subtract=function(y,_){return this.add(-1*y,_)},b.format=function(y){var _=this,v=this.$locale();if(!this.isValid())return v.invalidDate||j;var A=y||"YYYY-MM-DDTHH:mm:ssZ",k=P.z(this),N=this.$H,Y=this.$m,te=this.$M,ue=v.weekdays,ye=v.months,Ke=v.meridiem,He=function(fe,De,Xe,ot){return fe&&(fe[De]||fe(_,A))||Xe[De].slice(0,ot)},nt=function(fe){return P.s(N%12||12,fe,"0")},ze=Ke||function(fe,De,Xe){var ot=fe<12?"AM":"PM";return Xe?ot.toLowerCase():ot};return A.replace(de,function(fe,De){return De||function(Xe){switch(Xe){case"YY":return String(_.$y).slice(-2);case"YYYY":return P.s(_.$y,4,"0");case"M":return te+1;case"MM":return P.s(te+1,2,"0");case"MMM":return He(v.monthsShort,te,ye,3);case"MMMM":return He(ye,te);case"D":return _.$D;case"DD":return P.s(_.$D,2,"0");case"d":return String(_.$W);case"dd":return He(v.weekdaysMin,_.$W,ue,2);case"ddd":return He(v.weekdaysShort,_.$W,ue,3);case"dddd":return ue[_.$W];case"H":return String(N);case"HH":return P.s(N,2,"0");case"h":return nt(1);case"hh":return nt(2);case"a":return ze(N,Y,!0);case"A":return ze(N,Y,!1);case"m":return String(Y);case"mm":return P.s(Y,2,"0");case"s":return String(_.$s);case"ss":return P.s(_.$s,2,"0");case"SSS":return P.s(_.$ms,3,"0");case"Z":return k}return null}(fe)||k.replace(":","")})},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(y,_,v){var A,k=this,N=P.p(_),Y=G(y),te=(Y.utcOffset()-this.utcOffset())*r,ue=this-Y,ye=function(){return P.m(k,Y)};switch(N){case g:A=ye()/12;break;case p:A=ye();break;case d:A=ye()/3;break;case c:A=(ue-te)/6048e5;break;case u:A=(ue-te)/864e5;break;case o:A=ue/i;break;case a:A=ue/r;break;case l:A=ue/t;break;default:A=ue}return v?A:P.a(A)},b.daysInMonth=function(){return this.endOf(p).$D},b.$locale=function(){return U[this.$L]},b.locale=function(y,_){if(!y)return this.$L;var v=this.clone(),A=Ze(y,_,!0);return A&&(v.$L=A),v},b.clone=function(){return P.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},$}(),Qe=ee.prototype;return G.prototype=Qe,[["$ms",s],["$s",l],["$m",a],["$H",o],["$W",u],["$M",p],["$y",g],["$D",x]].forEach(function($){Qe[$[1]]=function(b){return this.$g(b,$[0],$[1])}}),G.extend=function($,b){return $.$i||($(b,ee,G),$.$i=!0),G},G.locale=Ze,G.isDayjs=xe,G.unix=function($){return G(1e3*$)},G.en=U[Ae],G.Ls=U,G.p={},G})})(gu);var bm=gu.exports;const wm=ad(bm);function _m(n){return async function({id:t,params:r,chatWindow:i}){i.setInputDisabled(!0);const s=i.chatManager.registerRecurringKeepAlive(),{threadId:l}=i.chatManager,a={isAIChat:!0,guestCardId:r.guestCardId||null,AIChatSessionTimeout:!1,...l&&{AIChatUniqueSessionId:l},...r.firstName&&{firstName:r.firstName},...r.lastName&&{lastName:r.lastName},...r.email&&{email:r.email},...r.phoneNumber&&{phone:r.phoneNumber},...r.desiredMoveInDate&&{moveInDate:wm(r.desiredMoveInDate).format("MM/DD/YYYY")},...r.AccessWidgetLeadId&&{AccessWidgetLeadId:r.AccessWidgetLeadId}},o=document.createElement("iai-chat-iframe-modal");o.title="Schedule a Tour",o.src=`${n}?${new URLSearchParams(a).toString()}`,o.showHeader=!1;const u=()=>{s(),o.remove(),window.removeEventListener("beforeunload",d),i.removeEventListener("iai-chat-reset",u),i.setInputDisabled(!1)},c=async({detail:g})=>{if(g.type!=="tourScheduled")return;const{tourType:x,tourDate:j,tourTime:Z,prospectName:de,guestCardId:me,accessWidgetLeadId:X}=g;u(),i.setInputDisabled(!0),i.addMessage({role:"system",content:"Your tour has been scheduled!"});try{await i.sendFunctionCallResponse(t,{status:"scheduled",tourType:x,tourDate:j,tourTime:Z,guestCardId:me,firstName:de,accessWidgetLeadId:X},!0)}finally{i.setInputDisabled(!1)}},p=async()=>{u(),i.setInputDisabled(!0),i.addMessage({role:"system",content:"Tour Scheduler Closed"});try{await i.sendFunctionCallResponse(t,{status:"canceled"},!0)}finally{i.setInputDisabled(!1)}},d=async()=>{u(),i.addMessage({role:"system",content:"Tour Scheduler Closed"})};o.addEventListener("message-received",c),o.addEventListener("close",p),i.addEventListener("iai-chat-reset",u),window.addEventListener("beforeunload",d),document.body.appendChild(o),i.addMessage({role:"system",content:"Tour Scheduler Opened"})}}const xm=typeof window<"u"&&window||typeof global<"u"&&global||{},yu=xm.IAI_BACKEND_URL||"https://api.ai.inhabit.services",un={async get(n,e={}){return this.request(n,{...e,method:"GET"})},async post(n,e={},t={}){return this.request(n,{...t,method:"POST",body:JSON.stringify(e)})},async put(n,e={},t={}){return this.request(n,{...t,method:"PUT",body:JSON.stringify(e)})},async delete(n,e={}){return this.request(n,{...e,method:"DELETE"})},async patch(n,e={},t={}){return this.request(n,{...t,method:"PATCH",body:JSON.stringify(e)})},async request(n,e={}){const{returnFullResponse:t=!1,...r}=e,i={...r,headers:{"Content-Type":"application/json",...r.headers}};n=n.replace(/^\//,"");const s=await fetch(`${yu}/${n}`,i);if(!s.ok){if(s.status===429){const a=+(s.headers.get("Retry-After")||30);throw new Hl(`Rate limited fetching /${n}: retry after ${a} seconds`,s.status,{retryAfter:a})}const l=[`Failed to fetch /${n}:`];try{const{message:a}=await s.json();if(!a)throw new Error;l.push(a)}catch{l.push(`${s.status} (${s.statusText})`)}throw new Hl(l.join(" "),s.status)}if(t)return s;try{return await s.json()}catch{return null}}};async function km(n,e={},t){return un.post("/threads",{assistantId:n,params:e,clientId:t})}async function $m(n,e="No reason provided"){await un.post(`/threads/${n}/end`,{reason:e})}async function Am(n,e){return un.post(`/threads/${n}/messages`,{content:e})}async function Sm(n,e,t){const r=(await un.post(`/threads/${n}/messages/streaming`,{content:e},{returnFullResponse:!0})).body.getReader(),i=new TextDecoder("utf-8");let s=!1,l="";const a=async()=>{const{done:o,value:u}=await r.read();if(o)return JSON.parse(l);const c=i.decode(u);if(s)l+=c;else if(c.includes("---START_RESULT---")){const[p,d]=c.split("---START_RESULT---");s=!0,l+=d,p&&t(p)}else t(c);return a()};return a()}async function Tm(n,e,t){await un.put(`/threads/${n}/messages/${e}/rate`,{rating:t})}async function Cm(n,e,t,r=!1){return un.post(`/threads/${n}/functions/${e}`,{params:t,rerunLLM:r})}async function Em(n){return un.post(`/threads/${n}/ping`)}class Hl extends Error{constructor(e,t,r){super(e),this.status=t,this.details=r}}const Mm=Object.freeze(Object.defineProperty({__proto__:null,APIError:Hl,baseApi:un,baseUrl:yu,createThread:km,endThread:$m,pingThread:Em,rateMessage:Tm,respondToFunctionCall:Cm,sendUserMessage:Am,sendUserMessageStreaming:Sm},Symbol.toStringTag,{value:"Module"}));function vu(n){return{all:n=n||new Map,on:function(e,t){var r=n.get(e);r?r.push(t):n.set(e,[t])},off:function(e,t){var r=n.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var r=n.get(e);r&&r.slice().map(function(i){i(t)}),(r=n.get("*"))&&r.slice().map(function(i){i(e,t)})}}}class Im{constructor(e){this.chatWsUrl=e,this._emitter=vu(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),this.reconnectCodes=new Set([1006]),this.reconnectAttempts=0,this.maxReconnectAttempts=10}connect(){const e=new WebSocket(this.chatWsUrl);e.onopen=async()=>{this.reconnectAttempts=0,e.send(JSON.stringify({type:"ready"}))},e.onmessage=t=>{const r=JSON.parse(t.data);this._emitter.emit(r.type,r.data)},e.onclose=t=>{console.log("Disconnected: ",t.code,t.reason||"No reason provided"),this._emitter.emit("disconnected",t),this.reconnectCodes.has(t.code)&&this.reconnectAttempts<this.maxReconnectAttempts&&(console.log("Reconnecting..."),this._emitter.emit("reconnecting"),this.reconnectAttempts++,setTimeout(()=>this.connect(),this.reconnectAttempts*1e3))},e.onerror=t=>{console.log("Error:",t),this._emitter.emit("error",t)},this.ws=e}reconnect(){this.reconnectAttempts=0,this.connect()}disconnect(){var e;(e=this.ws)==null||e.close()}destroy(){this.disconnect(),this._emitter.all.clear()}}var Is;(n=>{(e=>{e.TEXT="TEXT"})(n.MessageType||(n.MessageType={})),(e=>{e.DELIVERED="DELIVERED",e.READ="READ",e.FAILED="FAILED"})(n.AcknowledgeType||(n.AcknowledgeType={})),(e=>{e.GENERIC="GENERIC",e.SMS="SMS",e.RCS="RCS",e.FACEBOOK="FACEBOOK",e.TWITTER="TWITTER",e.WHATSAPP="WHATSAPP",e.WECHAT="WECHAT",e.QQMOBILE="QQMOBILE",e.APPLE_BUSINESS_CHAT="APPLE_BUSINESS_CHAT",e.SKYPE="SKYPE",e.SNAPCHAT="SNAPCHAT",e.VIBER="VIBER",e.LINE="LINE",e.TELEGRAM="TELEGRAM",e.KAKAO="KAKAO"})(n.ContentType||(n.ContentType={})),(e=>{e.SYSTEM="SYSTEM",e.USER="USER"})(n.ConversationEventOrigin||(n.ConversationEventOrigin={})),(e=>{e.PENDING="PENDING",e.ACTIVE="ACTIVE",e.TERMINATED="TERMINATED"})(n.ConversationStatus||(n.ConversationStatus={}))})(Is||(Is={}));const Om=Is.AcknowledgeType,Nm="Anyone Home",Pm="IB Chat Leasing";let Rm="https://five9.ah.inhabit.work";const Dm="https://five9.ah.inhabit.work".replace("http","ws").replace(/\/$/,""),Ti=class Ti{constructor(){Ul(this,zt);Ul(this,Ln);this._emitter=vu(),this.on=this._emitter.on.bind(this._emitter),this.off=this._emitter.off.bind(this._emitter),cn(this,zt,null),cn(this,Ln,null),this.conversationStarted=!1}serialize(){return JSON.stringify({sessionToken:this.sessionToken,conversationId:this.conversationId,conversationStarted:this.conversationStarted})}static deserialize(e){const t=JSON.parse(e),r=new Ti;return t.sessionToken&&r.setSession(t.sessionToken),t.conversationId&&r.setConversationId(t.conversationId),r.conversationStarted=t.conversationStarted||!1,r}static generateBaseUrl(e){return`https://${e}/appsvcs/rs/svc`}async createSession(){const e=await fetch(`${Ti.generateBaseUrl("app-scl.five9.com")}/auth/anon?cookieless=true`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({tenantName:Nm})});return cn(this,zt,await e.json()),Ns(this,zt)}setSession(e){cn(this,zt,e)}setConversationId(e){cn(this,Ln,e),this.five9WebSocket&&(this.five9WebSocket.destroy(),this.five9WebSocket=void 0,e&&this.connectToWebSocket())}connect(){if(!this.sessionToken)throw new Error("Session not created");if(!this.conversationId)throw new Error("Conversation not started");this.connectToWebSocket()}connectToWebSocket(){if(!this.conversationId)throw new Error("Conversation not started");this.five9WebSocket&&this.five9WebSocket.destroy();const e=new Im(`${Dm}/conversations/${this.conversationId}/ws`);e.on("*",(t,r)=>{this._emitter.emit(t,r)}),e.on("conversationCreated",t=>{this.conversationStarted=!0,console.log("Conversation Created:",t)}),e.on("conversationAccepted",t=>{console.log("Conversation Accepted:",t)}),e.on("agentJoined",t=>{console.log("Agent Joined:",t)}),e.on("agentTransferredConversation",t=>{console.log("Agent Transferred Conversation:",t)}),e.on("conversationTransferredToGroup",t=>{console.log("Conversation Transferred To Group:",t)}),e.on("agentLeftConversation",t=>{console.log("Agent Left Conversation:",t)}),e.on("agentTyping",t=>{console.log("Agent Typing:",t)}),e.on("message",async t=>{console.log("Message:",t),await this.acknowledgeMessage({messages:[{messageId:t.messageId,type:Om.READ}]})}),e.on("conversationTerminated",t=>{console.log("Conversation Terminated:",t)}),e.on("error",t=>{console.log("Error:",t)}),this.five9WebSocket=e,e.connect()}async authenticatedFetch(e,t={}){const{sessionToken:r}=this;if(!r)throw new Error("Session not found");e=e.startsWith("/")?e:`/${e}`;const i=r.metadata.dataCenters[0].apiUrls[0].host,s=await fetch(`${Ti.generateBaseUrl(i)}${e}`,{...t,headers:{...t.headers,"Content-Type":"application/json",Accept:"application/json",Authorization:r.tokenId,farmId:r.context.farmId}});return s.status===204?null:s.json()}async getMetadata(){if(!this.sessionToken)throw new Error("Session not created");return this.authenticatedFetch("/auth/metadata",{method:"GET"})}async createConversation(e){if(!this.sessionToken)throw new Error("Session not created");const t=e.contact||{};Object.keys(t).forEach(s=>{const l=s;t[l]||delete t[l]});const r={...e,campaignName:Pm,tenantId:this.tenantId,callbackUrl:Rm};console.log("body",r);const i=await this.authenticatedFetch("/conversations",{method:"POST",body:JSON.stringify(r)});return this.setConversationId(i.id),i}async sendMessage(e){const{conversationId:t,conversationStarted:r}=this;if(!t||!r)throw new Error("Conversation not started");const i={messageType:Is.MessageType.TEXT,message:e};await this.authenticatedFetch(`/conversations/${t}/messages`,{method:"POST",body:JSON.stringify(i)})}async sendTyping(){const{conversationId:e}=this;if(!e)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${e}/messages/typing`,{method:"PUT"})}async acknowledgeMessage(e){const{conversationId:t}=this;if(!t)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${t}/messages/acknowledge`,{method:"PUT",body:JSON.stringify(e)})}async terminateConversation(){const{conversationId:e}=this;if(!e)throw new Error("Conversation not started");await this.authenticatedFetch(`/conversations/${e}/terminate`,{method:"POST"}),this.destroy()}destroy(){this.five9WebSocket&&this.five9WebSocket.destroy(),cn(this,zt,null),cn(this,Ln,null)}get sessionToken(){return Ns(this,zt)}get conversationId(){return Ns(this,Ln)}get dataCenter(){var e;return(e=this.sessionToken)==null?void 0:e.metadata.dataCenters[0]}get apiUrl(){var e;return(e=this.dataCenter)==null?void 0:e.apiUrls[0].host}get tenantId(){var e;return(e=this.sessionToken)==null?void 0:e.orgId}get tokenId(){var e;return(e=this.sessionToken)==null?void 0:e.tokenId}get farmId(){var e;return(e=this.sessionToken)==null?void 0:e.context.farmId}};zt=new WeakMap,Ln=new WeakMap;let Os=Ti;const{baseApi:jm}=Mm;function Si(n){return`any-${n||"main"}-chatSession`}async function Lm({id:n,params:e,chatWindow:t,html:r}){const{threadId:i}=t.chatManager;t=t;const s=async()=>{const{firstName:p,lastName:d,phone:g,email:x,propertyId:j}=e,Z={propertyId:j,firstName:p,lastName:d,phoneNumber:g,email:x,threadId:i},{guestCardId:de}=await jm.post("/anyone-home/newGuestCard",Z);e.guestCardId=de},l=async()=>{t.removeMessage("transferMessageId"),t.removeMessage("guestCardFormId"),await t.sendFunctionCallResponse(n,{transfer:"Declined"},!0),t.setInputDisabled(!1)},a=async()=>{t.removeMessage("transferMessageId"),e.guestCardId?(o(),await u()):await c()},o=()=>{t.addMessage({id:"waitMessageId",role:"system",content:"Please wait while we connect you to a live agent"}),t.setInputDisabled(!0)},u=async()=>{await t.sendFunctionCallResponse(n,{transfer:"Accepted",guestCardId:e.guestCardId,firstName:e.firstName,lastName:e.lastName,phoneNumber:e.phoneNumber,email:e.email},!1),await t.chatManager.endChat("Transferred to live agent",!1);const p=new Os;await p.createSession();const{summary:d,subject:g,guestCardId:x,firstName:j,lastName:Z,phoneNumber:de,email:me}=e;await p.createConversation({contact:{firstName:j,lastName:Z,number1:de,email:me},attributes:{"Chat.gc_id":x,Question:g,"AI Summary":d}}),localStorage.setItem(Si(t.cleanOptions.config.historyKey),p.serialize()),bu(t,p)},c=async()=>{const p=async d=>{e={...e,...d.detail},t.removeMessage("guestCardFormId"),o();try{await s()}catch(g){console.log(g)}await u()};t.addMessage({id:"guestCardFormId",role:"system",contentHtmlTemplate:r`
|
|
762
778
|
<any-contact-form
|
|
763
779
|
.params=${e}
|
|
764
780
|
@submit=${p}
|
|
@@ -769,4 +785,4 @@ Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An err
|
|
|
769
785
|
@transfer=${a}
|
|
770
786
|
@cancel=${l}
|
|
771
787
|
></any-transfer-confirmation>
|
|
772
|
-
`})}function bu(n,e){e.on("*",(l,a)=>{console.log("event:",l,a)}),e.on("conversationCreated",()=>{n.setInputDisabled(!1),localStorage.setItem(Si(n.cleanOptions.config.historyKey),e.serialize())}),e.on("conversationAccepted",l=>{n.addMessage({role:"system",content:`${l.displayName} has joined the chat`})}),e.on("agentTyping",()=>{n.setTypingIndicatorVisible(!0)}),e.on("agentJoined",l=>{n.addMessage({role:"system",content:`${l.displayName} has joined the chat`})}),e.on("agentTransferredConversation",l=>{n.addMessage({role:"system",content:`You have been transferred to ${l.toDisplayName}`})}),e.on("conversationTransferredToGroup",l=>{n.addMessage({role:"system",content:`You have been transferred to ${l.groupName}`})}),e.on("agentLeftConversation",l=>{n.addMessage({role:"system",content:`${l.displayName} has left the chat`})}),e.on("conversationTerminated",l=>{n.addMessage({role:"system",content:"The chat has ended"}),n.setInputDisabled(!0),localStorage.removeItem(Si(n.cleanOptions.config.historyKey))}),e.on("message",l=>{switch(l.from){case"SYSTEM":n.addMessage({role:"system",content:l.text});break;case"USER":n.setTypingIndicatorVisible(!1),n.addMessage({role:"assistant",name:l.displayName,content:l.text});break;default:console.log("unhandled message:",l);break}}),e.connect();const t=async l=>{l.preventDefault(),n.addMessage({role:"user",content:l.detail.message}),await e.sendMessage(l.detail.message)},r=async()=>{e.destroy(),n.removeEventListener("iai-chat-send-user-message",t),n.removeEventListener("iai-chat-reset",s),n.removeEventListener("iai-chat-destroy",r)},i=n.cleanOptions.config.disclaimerMessage,s=async()=>{await e.terminateConversation(),await r(),localStorage.removeItem(Si(n.cleanOptions.config.historyKey)),n.cleanOptions.config.disclaimerMessage=i};n.cleanOptions.config.disclaimerMessage="",n.addEventListener("iai-chat-send-user-message",t),n.addEventListener("iai-chat-reset",s),n.addEventListener("iai-chat-destroy",r)}class
|
|
788
|
+
`})}function bu(n,e){e.on("*",(l,a)=>{console.log("event:",l,a)}),e.on("conversationCreated",()=>{n.setInputDisabled(!1),localStorage.setItem(Si(n.cleanOptions.config.historyKey),e.serialize())}),e.on("conversationAccepted",l=>{n.addMessage({role:"system",content:`${l.displayName} has joined the chat`})}),e.on("agentTyping",()=>{n.setTypingIndicatorVisible(!0)}),e.on("agentJoined",l=>{n.addMessage({role:"system",content:`${l.displayName} has joined the chat`})}),e.on("agentTransferredConversation",l=>{n.addMessage({role:"system",content:`You have been transferred to ${l.toDisplayName}`})}),e.on("conversationTransferredToGroup",l=>{n.addMessage({role:"system",content:`You have been transferred to ${l.groupName}`})}),e.on("agentLeftConversation",l=>{n.addMessage({role:"system",content:`${l.displayName} has left the chat`})}),e.on("conversationTerminated",l=>{n.addMessage({role:"system",content:"The chat has ended"}),n.setInputDisabled(!0),localStorage.removeItem(Si(n.cleanOptions.config.historyKey))}),e.on("message",l=>{switch(l.from){case"SYSTEM":n.addMessage({role:"system",content:l.text});break;case"USER":n.setTypingIndicatorVisible(!1),n.addMessage({role:"assistant",name:l.displayName,content:l.text});break;default:console.log("unhandled message:",l);break}}),e.connect();const t=async l=>{l.preventDefault(),n.addMessage({role:"user",content:l.detail.message}),await e.sendMessage(l.detail.message)},r=async()=>{e.destroy(),n.removeEventListener("iai-chat-send-user-message",t),n.removeEventListener("iai-chat-reset",s),n.removeEventListener("iai-chat-destroy",r)},i=n.cleanOptions.config.disclaimerMessage,s=async()=>{await e.terminateConversation(),await r(),localStorage.removeItem(Si(n.cleanOptions.config.historyKey)),n.cleanOptions.config.disclaimerMessage=i};n.cleanOptions.config.disclaimerMessage="",n.addEventListener("iai-chat-send-user-message",t),n.addEventListener("iai-chat-reset",s),n.addEventListener("iai-chat-destroy",r)}class Zm{constructor(e,t){const r=_s.parse({assistantId:"657acbb4-d23e-487f-9090-4ac9a237b474",...e,config:{...e.config,styles:e.styles||{}}});r.handlers.functionCalls.transferToLiveAgent=Lm,r.handlers.functionCalls.showScheduleTourWidget=_m(t.schedulerUrl),r.handlers.enhancedContent.unitList=vm,r.handlers.enhancedContent.photoViewer=ym,this.chatWidget=new gm(r);const i=localStorage.getItem(Si(r.config.historyKey));if(i){const s=Os.deserialize(i);setTimeout(()=>{bu(this.chatWidget.api.chatWindow,s)},0)}}destroy(){this.chatWidget.destroy()}}Re.AnyChatWidget=Zm,Object.defineProperty(Re,Symbol.toStringTag,{value:"Module"})});
|