@bymos/agentkit-sdk 0.1.4 → 0.2.0
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.
- package/README.md +235 -0
- package/agentkit-widget.iife.js +865 -0
- package/agentkit-widget.js +7769 -0
- package/index.cjs +105 -46
- package/index.js +4234 -3911
- package/package.json +10 -2
package/index.cjs
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
"use strict";var An=Object.defineProperty;var En=(t,e,n)=>e in t?An(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ee=(t,e,n)=>En(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Mn=require("preact/compat/client"),P=require("preact/compat"),u=require("preact/jsx-runtime");var N;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function n(a){throw new Error}t.assertNever=n,t.arrayToEnum=a=>{const i={};for(const s of a)i[s]=s;return i},t.getValidEnumValues=a=>{const i=t.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),s={};for(const o of i)s[o]=a[o];return t.objectValues(s)},t.objectValues=a=>t.objectKeys(a).map(function(i){return a[i]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&i.push(s);return i},t.find=(a,i)=>{for(const s of a)if(i(s))return s},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(N||(N={}));var mt;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(mt||(mt={}));const v=N.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ne=t=>{switch(typeof t){case"undefined":return v.undefined;case"string":return v.string;case"number":return Number.isNaN(t)?v.nan:v.number;case"boolean":return v.boolean;case"function":return v.function;case"bigint":return v.bigint;case"symbol":return v.symbol;case"object":return Array.isArray(t)?v.array:t===null?v.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?v.promise:typeof Map<"u"&&t instanceof Map?v.map:typeof Set<"u"&&t instanceof Set?v.set:typeof Date<"u"&&t instanceof Date?v.date:v.object;default:return v.unknown}},h=N.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class K extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},a=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(a);else if(s.code==="invalid_return_type")a(s.returnTypeError);else if(s.code==="invalid_arguments")a(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let o=r,c=0;for(;c<s.path.length;){const d=s.path[c];c===s.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(n(s))):o[d]=o[d]||{_errors:[]},o=o[d],c++}}};return a(this),r}static assert(e){if(!(e instanceof K))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,N.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];n[i]=n[i]||[],n[i].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}K.create=t=>new K(t);const $e=(t,e)=>{let n;switch(t.code){case h.invalid_type:t.received===v.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case h.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,N.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:n=`Unrecognized key(s) in object: ${N.joinValues(t.keys,", ")}`;break;case h.invalid_union:n="Invalid input";break;case h.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${N.joinValues(t.options)}`;break;case h.invalid_enum_value:n=`Invalid enum value. Expected ${N.joinValues(t.options)}, received '${t.received}'`;break;case h.invalid_arguments:n="Invalid function arguments";break;case h.invalid_return_type:n="Invalid function return type";break;case h.invalid_date:n="Invalid date";break;case h.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:N.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case h.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case h.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case h.custom:n="Invalid input";break;case h.invalid_intersection_types:n="Intersection results could not be merged";break;case h.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case h.not_finite:n="Number must be finite";break;default:n=e.defaultError,N.assertNever(t)}return{message:n}};let Zn=$e;function On(){return Zn}const Vn=t=>{const{data:e,path:n,errorMaps:r,issueData:a}=t,i=[...n,...a.path||[]],s={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let o="";const c=r.filter(d=>!!d).slice().reverse();for(const d of c)o=d(s,{data:e,defaultError:o}).message;return{...a,path:i,message:o}};function g(t,e){const n=On(),r=Vn({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===$e?void 0:$e].filter(a=>!!a)});t.common.issues.push(r)}class O{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const a of n){if(a.status==="aborted")return x;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const a of n){const i=await a.key,s=await a.value;r.push({key:i,value:s})}return O.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const a of n){const{key:i,value:s}=a;if(i.status==="aborted"||s.status==="aborted")return x;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||a.alwaysSet)&&(r[i.value]=s.value)}return{status:e.value,value:r}}}const x=Object.freeze({status:"aborted"}),ye=t=>({status:"dirty",value:t}),D=t=>({status:"valid",value:t}),pt=t=>t.status==="aborted",gt=t=>t.status==="dirty",me=t=>t.status==="valid",Re=t=>typeof Promise<"u"&&t instanceof Promise;var y;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(y||(y={}));class Y{constructor(e,n,r,a){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const vt=(t,e)=>{if(me(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new K(t.common.issues);return this._error=n,this._error}}};function C(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:a}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(s,o)=>{const{message:c}=t;return s.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??r??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:c??n??o.defaultError}},description:a}}class j{get description(){return this._def.description}_getType(e){return ne(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ne(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new O,ctx:{common:e.parent.common,data:e.data,parsedType:ne(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Re(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ne(e)},a=this._parseSync({data:e,path:r.path,parent:r});return vt(r,a)}"~validate"(e){var r,a;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ne(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return me(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(a=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>me(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ne(e)},a=this._parse({data:e,path:r.path,parent:r}),i=await(Re(a)?a:Promise.resolve(a));return vt(r,i)}refine(e,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const s=e(a),o=()=>i.addIssue({code:h.custom,...r(a)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(e){return new ge({schema:this,typeName:b.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return re.create(this,this._def)}nullable(){return ve.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return G.create(this)}promise(){return Oe.create(this,this._def)}or(e){return Ee.create([this,e],this._def)}and(e){return Me.create(this,e,this._def)}transform(e){return new ge({...C(this._def),schema:this,typeName:b.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new He({...C(this._def),innerType:this,defaultValue:n,typeName:b.ZodDefault})}brand(){return new sr({typeName:b.ZodBranded,type:this,...C(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Xe({...C(this._def),innerType:this,catchValue:n,typeName:b.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return at.create(this,e)}readonly(){return Je.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Pn=/^c[^\s-]{8,}$/i,Fn=/^[0-9a-z]+$/,Wn=/^[0-9A-HJKMNP-TV-Z]{26}$/i,zn=/^[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,Dn=/^[a-z0-9_-]{21}$/i,Un=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$n=/^[-+]?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)?)??$/,Bn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Gn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let We;const Yn=/^(?:(?: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])$/,Hn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Xn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Jn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Qn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Kn=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Dt="((\\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])))",qn=new RegExp(`^${Dt}$`);function Ut(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function er(t){return new RegExp(`^${Ut(t)}$`)}function tr(t){let e=`${Dt}T${Ut(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function nr(t,e){return!!((e==="v4"||!e)&&Yn.test(t)||(e==="v6"||!e)&&Xn.test(t))}function rr(t,e){if(!Un.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function ar(t,e){return!!((e==="v4"||!e)&&Hn.test(t)||(e==="v6"||!e)&&Jn.test(t))}class Q extends j{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==v.string){const i=this._getOrReturnCtx(e);return g(i,{code:h.invalid_type,expected:v.string,received:i.parsedType}),x}const r=new O;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,o=e.data.length<i.value;(s||o)&&(a=this._getOrReturnCtx(e,a),s?g(a,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&g(a,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Bn.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"email",code:h.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")We||(We=new RegExp(Gn,"u")),We.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"emoji",code:h.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")zn.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"uuid",code:h.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Dn.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"nanoid",code:h.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")Pn.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"cuid",code:h.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")Fn.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"cuid2",code:h.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Wn.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"ulid",code:h.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),g(a,{validation:"url",code:h.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"regex",code:h.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?tr(i).test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?qn.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?er(i).test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{code:h.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?$n.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"duration",code:h.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?nr(e.data,i.version)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"ip",code:h.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?rr(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"jwt",code:h.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?ar(e.data,i.version)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"cidr",code:h.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Qn.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"base64",code:h.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?Kn.test(e.data)||(a=this._getOrReturnCtx(e,a),g(a,{validation:"base64url",code:h.invalid_string,message:i.message}),r.dirty()):N.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(a=>e.test(a),{validation:n,code:h.invalid_string,...y.errToObj(r)})}_addCheck(e){return new Q({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...y.errToObj(e)})}url(e){return this._addCheck({kind:"url",...y.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...y.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...y.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...y.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...y.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...y.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...y.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...y.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...y.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...y.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...y.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...y.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...y.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,...y.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...y.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...y.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...y.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...y.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...y.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...y.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...y.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...y.errToObj(n)})}nonempty(e){return this.min(1,y.errToObj(e))}trim(){return new Q({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Q({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Q({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Q.create=t=>new Q({checks:[],typeName:b.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...C(t)});function ir(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=n>r?n:r,i=Number.parseInt(t.toFixed(a).replace(".","")),s=Number.parseInt(e.toFixed(a).replace(".",""));return i%s/10**a}class be extends j{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)!==v.number){const i=this._getOrReturnCtx(e);return g(i,{code:h.invalid_type,expected:v.number,received:i.parsedType}),x}let r;const a=new O;for(const i of this._def.checks)i.kind==="int"?N.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),g(r,{code:h.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),g(r,{code:h.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),g(r,{code:h.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?ir(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),g(r,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),g(r,{code:h.not_finite,message:i.message}),a.dirty()):N.assertNever(i);return{status:a.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,y.toString(n))}gt(e,n){return this.setLimit("min",e,!1,y.toString(n))}lte(e,n){return this.setLimit("max",e,!0,y.toString(n))}lt(e,n){return this.setLimit("max",e,!1,y.toString(n))}setLimit(e,n,r,a){return new be({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:y.toString(a)}]})}_addCheck(e){return new be({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:y.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:y.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:y.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:y.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:y.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:y.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&N.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}be.create=t=>new be({checks:[],typeName:b.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...C(t)});class xe extends j{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==v.bigint)return this._getInvalidInput(e);let r;const a=new O;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),g(r,{code:h.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),g(r,{code:h.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),g(r,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):N.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return g(n,{code:h.invalid_type,expected:v.bigint,received:n.parsedType}),x}gte(e,n){return this.setLimit("min",e,!0,y.toString(n))}gt(e,n){return this.setLimit("min",e,!1,y.toString(n))}lte(e,n){return this.setLimit("max",e,!0,y.toString(n))}lt(e,n){return this.setLimit("max",e,!1,y.toString(n))}setLimit(e,n,r,a){return new xe({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:y.toString(a)}]})}_addCheck(e){return new xe({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:y.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:y.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}xe.create=t=>new xe({checks:[],typeName:b.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...C(t)});class Be extends j{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==v.boolean){const r=this._getOrReturnCtx(e);return g(r,{code:h.invalid_type,expected:v.boolean,received:r.parsedType}),x}return D(e.data)}}Be.create=t=>new Be({typeName:b.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...C(t)});class Ae extends j{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==v.date){const i=this._getOrReturnCtx(e);return g(i,{code:h.invalid_type,expected:v.date,received:i.parsedType}),x}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return g(i,{code:h.invalid_date}),x}const r=new O;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:h.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),g(a,{code:h.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):N.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ae({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:y.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:y.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Ae.create=t=>new Ae({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:b.ZodDate,...C(t)});class yt extends j{_parse(e){if(this._getType(e)!==v.symbol){const r=this._getOrReturnCtx(e);return g(r,{code:h.invalid_type,expected:v.symbol,received:r.parsedType}),x}return D(e.data)}}yt.create=t=>new yt({typeName:b.ZodSymbol,...C(t)});class kt extends j{_parse(e){if(this._getType(e)!==v.undefined){const r=this._getOrReturnCtx(e);return g(r,{code:h.invalid_type,expected:v.undefined,received:r.parsedType}),x}return D(e.data)}}kt.create=t=>new kt({typeName:b.ZodUndefined,...C(t)});class bt extends j{_parse(e){if(this._getType(e)!==v.null){const r=this._getOrReturnCtx(e);return g(r,{code:h.invalid_type,expected:v.null,received:r.parsedType}),x}return D(e.data)}}bt.create=t=>new bt({typeName:b.ZodNull,...C(t)});class xt extends j{constructor(){super(...arguments),this._any=!0}_parse(e){return D(e.data)}}xt.create=t=>new xt({typeName:b.ZodAny,...C(t)});class Ge extends j{constructor(){super(...arguments),this._unknown=!0}_parse(e){return D(e.data)}}Ge.create=t=>new Ge({typeName:b.ZodUnknown,...C(t)});class ae extends j{_parse(e){const n=this._getOrReturnCtx(e);return g(n,{code:h.invalid_type,expected:v.never,received:n.parsedType}),x}}ae.create=t=>new ae({typeName:b.ZodNever,...C(t)});class _t extends j{_parse(e){if(this._getType(e)!==v.undefined){const r=this._getOrReturnCtx(e);return g(r,{code:h.invalid_type,expected:v.void,received:r.parsedType}),x}return D(e.data)}}_t.create=t=>new _t({typeName:b.ZodVoid,...C(t)});class G extends j{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),a=this._def;if(n.parsedType!==v.array)return g(n,{code:h.invalid_type,expected:v.array,received:n.parsedType}),x;if(a.exactLength!==null){const s=n.data.length>a.exactLength.value,o=n.data.length<a.exactLength.value;(s||o)&&(g(n,{code:s?h.too_big:h.too_small,minimum:o?a.exactLength.value:void 0,maximum:s?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(g(n,{code:h.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(g(n,{code:h.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,o)=>a.type._parseAsync(new Y(n,s,n.path,o)))).then(s=>O.mergeArray(r,s));const i=[...n.data].map((s,o)=>a.type._parseSync(new Y(n,s,n.path,o)));return O.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new G({...this._def,minLength:{value:e,message:y.toString(n)}})}max(e,n){return new G({...this._def,maxLength:{value:e,message:y.toString(n)}})}length(e,n){return new G({...this._def,exactLength:{value:e,message:y.toString(n)}})}nonempty(e){return this.min(1,e)}}G.create=(t,e)=>new G({type:t,minLength:null,maxLength:null,exactLength:null,typeName:b.ZodArray,...C(e)});function fe(t){if(t instanceof E){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=re.create(fe(r))}return new E({...t._def,shape:()=>e})}else return t instanceof G?new G({...t._def,type:fe(t.element)}):t instanceof re?re.create(fe(t.unwrap())):t instanceof ve?ve.create(fe(t.unwrap())):t instanceof oe?oe.create(t.items.map(e=>fe(e))):t}class E extends j{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=N.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==v.object){const d=this._getOrReturnCtx(e);return g(d,{code:h.invalid_type,expected:v.object,received:d.parsedType}),x}const{status:r,ctx:a}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof ae&&this._def.unknownKeys==="strip"))for(const d in a.data)s.includes(d)||o.push(d);const c=[];for(const d of s){const l=i[d],f=a.data[d];c.push({key:{status:"valid",value:d},value:l._parse(new Y(a,f,a.path,d)),alwaysSet:d in a.data})}if(this._def.catchall instanceof ae){const d=this._def.unknownKeys;if(d==="passthrough")for(const l of o)c.push({key:{status:"valid",value:l},value:{status:"valid",value:a.data[l]}});else if(d==="strict")o.length>0&&(g(a,{code:h.unrecognized_keys,keys:o}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const l of o){const f=a.data[l];c.push({key:{status:"valid",value:l},value:d._parse(new Y(a,f,a.path,l)),alwaysSet:l in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const d=[];for(const l of c){const f=await l.key,p=await l.value;d.push({key:f,value:p,alwaysSet:l.alwaysSet})}return d}).then(d=>O.mergeObjectSync(r,d)):O.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return y.errToObj,new E({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s;const a=((s=(i=this._def).errorMap)==null?void 0:s.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:y.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new E({...this._def,unknownKeys:"strip"})}passthrough(){return new E({...this._def,unknownKeys:"passthrough"})}extend(e){return new E({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new E({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:b.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new E({...this._def,catchall:e})}pick(e){const n={};for(const r of N.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new E({...this._def,shape:()=>n})}omit(e){const n={};for(const r of N.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new E({...this._def,shape:()=>n})}deepPartial(){return fe(this)}partial(e){const n={};for(const r of N.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?n[r]=a:n[r]=a.optional()}return new E({...this._def,shape:()=>n})}required(e){const n={};for(const r of N.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof re;)i=i._def.innerType;n[r]=i}return new E({...this._def,shape:()=>n})}keyof(){return $t(N.objectKeys(this.shape))}}E.create=(t,e)=>new E({shape:()=>t,unknownKeys:"strip",catchall:ae.create(),typeName:b.ZodObject,...C(e)});E.strictCreate=(t,e)=>new E({shape:()=>t,unknownKeys:"strict",catchall:ae.create(),typeName:b.ZodObject,...C(e)});E.lazycreate=(t,e)=>new E({shape:t,unknownKeys:"strip",catchall:ae.create(),typeName:b.ZodObject,...C(e)});class Ee extends j{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function a(i){for(const o of i)if(o.result.status==="valid")return o.result;for(const o of i)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const s=i.map(o=>new K(o.ctx.common.issues));return g(n,{code:h.invalid_union,unionErrors:s}),x}if(n.common.async)return Promise.all(r.map(async i=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(a);{let i;const s=[];for(const c of r){const d={...n,common:{...n.common,issues:[]},parent:null},l=c._parseSync({data:n.data,path:n.path,parent:d});if(l.status==="valid")return l;l.status==="dirty"&&!i&&(i={result:l,ctx:d}),d.common.issues.length&&s.push(d.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const o=s.map(c=>new K(c));return g(n,{code:h.invalid_union,unionErrors:o}),x}}get options(){return this._def.options}}Ee.create=(t,e)=>new Ee({options:t,typeName:b.ZodUnion,...C(e)});function Ye(t,e){const n=ne(t),r=ne(e);if(t===e)return{valid:!0,data:t};if(n===v.object&&r===v.object){const a=N.objectKeys(e),i=N.objectKeys(t).filter(o=>a.indexOf(o)!==-1),s={...t,...e};for(const o of i){const c=Ye(t[o],e[o]);if(!c.valid)return{valid:!1};s[o]=c.data}return{valid:!0,data:s}}else if(n===v.array&&r===v.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let i=0;i<t.length;i++){const s=t[i],o=e[i],c=Ye(s,o);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return n===v.date&&r===v.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Me extends j{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),a=(i,s)=>{if(pt(i)||pt(s))return x;const o=Ye(i.value,s.value);return o.valid?((gt(i)||gt(s))&&n.dirty(),{status:n.value,value:o.data}):(g(r,{code:h.invalid_intersection_types}),x)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,s])=>a(i,s)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Me.create=(t,e,n)=>new Me({left:t,right:e,typeName:b.ZodIntersection,...C(n)});class oe extends j{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==v.array)return g(r,{code:h.invalid_type,expected:v.array,received:r.parsedType}),x;if(r.data.length<this._def.items.length)return g(r,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&r.data.length>this._def.items.length&&(g(r,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new Y(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>O.mergeArray(n,s)):O.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new oe({...this._def,rest:e})}}oe.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new oe({items:t,typeName:b.ZodTuple,rest:null,...C(e)})};class Ze extends j{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==v.object)return g(r,{code:h.invalid_type,expected:v.object,received:r.parsedType}),x;const a=[],i=this._def.keyType,s=this._def.valueType;for(const o in r.data)a.push({key:i._parse(new Y(r,o,r.path,o)),value:s._parse(new Y(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?O.mergeObjectAsync(n,a):O.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof j?new Ze({keyType:e,valueType:n,typeName:b.ZodRecord,...C(r)}):new Ze({keyType:Q.create(),valueType:e,typeName:b.ZodRecord,...C(n)})}}class wt extends j{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==v.map)return g(r,{code:h.invalid_type,expected:v.map,received:r.parsedType}),x;const a=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([o,c],d)=>({key:a._parse(new Y(r,o,r.path,[d,"key"])),value:i._parse(new Y(r,c,r.path,[d,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of s){const d=await c.key,l=await c.value;if(d.status==="aborted"||l.status==="aborted")return x;(d.status==="dirty"||l.status==="dirty")&&n.dirty(),o.set(d.value,l.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const c of s){const d=c.key,l=c.value;if(d.status==="aborted"||l.status==="aborted")return x;(d.status==="dirty"||l.status==="dirty")&&n.dirty(),o.set(d.value,l.value)}return{status:n.value,value:o}}}}wt.create=(t,e,n)=>new wt({valueType:e,keyType:t,typeName:b.ZodMap,...C(n)});class _e extends j{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==v.set)return g(r,{code:h.invalid_type,expected:v.set,received:r.parsedType}),x;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(g(r,{code:h.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(g(r,{code:h.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function s(c){const d=new Set;for(const l of c){if(l.status==="aborted")return x;l.status==="dirty"&&n.dirty(),d.add(l.value)}return{status:n.value,value:d}}const o=[...r.data.values()].map((c,d)=>i._parse(new Y(r,c,r.path,d)));return r.common.async?Promise.all(o).then(c=>s(c)):s(o)}min(e,n){return new _e({...this._def,minSize:{value:e,message:y.toString(n)}})}max(e,n){return new _e({...this._def,maxSize:{value:e,message:y.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}_e.create=(t,e)=>new _e({valueType:t,minSize:null,maxSize:null,typeName:b.ZodSet,...C(e)});class St extends j{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}St.create=(t,e)=>new St({getter:t,typeName:b.ZodLazy,...C(e)});class Ct extends j{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return g(n,{received:n.data,code:h.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ct.create=(t,e)=>new Ct({value:t,typeName:b.ZodLiteral,...C(e)});function $t(t,e){return new pe({values:t,typeName:b.ZodEnum,...C(e)})}class pe extends j{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return g(n,{expected:N.joinValues(r),received:n.parsedType,code:h.invalid_type}),x}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return g(n,{received:n.data,code:h.invalid_enum_value,options:r}),x}return D(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return pe.create(e,{...this._def,...n})}exclude(e,n=this._def){return pe.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}pe.create=$t;class It extends j{_parse(e){const n=N.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==v.string&&r.parsedType!==v.number){const a=N.objectValues(n);return g(r,{expected:N.joinValues(a),received:r.parsedType,code:h.invalid_type}),x}if(this._cache||(this._cache=new Set(N.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=N.objectValues(n);return g(r,{received:r.data,code:h.invalid_enum_value,options:a}),x}return D(e.data)}get enum(){return this._def.values}}It.create=(t,e)=>new It({values:t,typeName:b.ZodNativeEnum,...C(e)});class Oe extends j{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==v.promise&&n.common.async===!1)return g(n,{code:h.invalid_type,expected:v.promise,received:n.parsedType}),x;const r=n.parsedType===v.promise?n.data:Promise.resolve(n.data);return D(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Oe.create=(t,e)=>new Oe({type:t,typeName:b.ZodPromise,...C(e)});class ge extends j{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===b.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:s=>{g(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const s=a.transform(r.data,i);if(r.common.async)return Promise.resolve(s).then(async o=>{if(n.value==="aborted")return x;const c=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return c.status==="aborted"?x:c.status==="dirty"||n.value==="dirty"?ye(c.value):c});{if(n.value==="aborted")return x;const o=this._def.schema._parseSync({data:s,path:r.path,parent:r});return o.status==="aborted"?x:o.status==="dirty"||n.value==="dirty"?ye(o.value):o}}if(a.type==="refinement"){const s=o=>{const c=a.refinement(o,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?x:(o.status==="dirty"&&n.dirty(),s(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?x:(o.status==="dirty"&&n.dirty(),s(o.value).then(()=>({status:n.value,value:o.value}))))}if(a.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!me(s))return x;const o=a.transform(s.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>me(s)?Promise.resolve(a.transform(s.value,i)).then(o=>({status:n.value,value:o})):x);N.assertNever(a)}}ge.create=(t,e,n)=>new ge({schema:t,typeName:b.ZodEffects,effect:e,...C(n)});ge.createWithPreprocess=(t,e,n)=>new ge({schema:e,effect:{type:"preprocess",transform:t},typeName:b.ZodEffects,...C(n)});class re extends j{_parse(e){return this._getType(e)===v.undefined?D(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}re.create=(t,e)=>new re({innerType:t,typeName:b.ZodOptional,...C(e)});class ve extends j{_parse(e){return this._getType(e)===v.null?D(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ve.create=(t,e)=>new ve({innerType:t,typeName:b.ZodNullable,...C(e)});class He extends j{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===v.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}He.create=(t,e)=>new He({innerType:t,typeName:b.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...C(e)});class Xe extends j{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Re(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new K(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new K(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Xe.create=(t,e)=>new Xe({innerType:t,typeName:b.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...C(e)});class jt extends j{_parse(e){if(this._getType(e)!==v.nan){const r=this._getOrReturnCtx(e);return g(r,{code:h.invalid_type,expected:v.nan,received:r.parsedType}),x}return{status:"valid",value:e.data}}}jt.create=t=>new jt({typeName:b.ZodNaN,...C(t)});class sr extends j{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class at extends j{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?x:i.status==="dirty"?(n.dirty(),ye(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?x:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,n){return new at({in:e,out:n,typeName:b.ZodPipeline})}}class Je extends j{_parse(e){const n=this._def.innerType._parse(e),r=a=>(me(a)&&(a.value=Object.freeze(a.value)),a);return Re(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}Je.create=(t,e)=>new Je({innerType:t,typeName:b.ZodReadonly,...C(e)});var b;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(b||(b={}));const M=Q.create,or=Be.create,cr=Ge.create;ae.create;G.create;const Bt=E.create;Ee.create;Me.create;oe.create;const dr=Ze.create,Gt=pe.create;Oe.create;re.create;ve.create;const lr=Bt({mode:Gt(["light","dark","system"]).optional(),accentColor:M().optional(),fontFamily:M().optional(),borderRadius:M().optional()}),Yt=Bt({agentId:M().min(1,"agentId is required"),apiBaseUrl:M().url("apiBaseUrl must be a valid URL"),tenantId:M().optional(),userId:M().optional(),name:M().optional(),email:M().optional(),authUserId:M().optional(),sessionId:M().optional(),mode:Gt(["floating","inline"]).optional(),title:M().optional(),subtitle:M().optional(),greeting:M().optional(),avatarUrl:M().optional(),privacyPolicyUrl:M().optional(),streaming:or().optional(),metadata:dr(cr()).optional(),theme:lr.optional()}),ur=Yt.omit({agentId:!0,apiBaseUrl:!0}).partial(),se={mode:"floating",streaming:!0,title:"AI Assistant",theme:{mode:"light",accentColor:"#6366f1",fontFamily:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",borderRadius:"12px"}};function Pe(t,e){var o,c,d,l;Yt.parse(t);let n;const r=e?{...e}:void 0;r&&typeof r.theme=="object"&&r.theme!==null?(n=r.theme,delete r.theme):r&&typeof r.theme=="string"&&(n={mode:r.theme},delete r.theme);const a=r?ur.passthrough().safeParse(r).data:void 0,i=a?Ht(a,t):t,s={mode:((o=i.theme)==null?void 0:o.mode)??(n==null?void 0:n.mode)??se.theme.mode,accentColor:((c=i.theme)==null?void 0:c.accentColor)??(n==null?void 0:n.accentColor)??se.theme.accentColor,fontFamily:((d=i.theme)==null?void 0:d.fontFamily)??(n==null?void 0:n.fontFamily)??se.theme.fontFamily,borderRadius:((l=i.theme)==null?void 0:l.borderRadius)??(n==null?void 0:n.borderRadius)??se.theme.borderRadius};return{agentId:i.agentId,apiBaseUrl:i.apiBaseUrl.replace(/\/$/,""),tenantId:i.tenantId,userId:i.userId,name:i.name,email:i.email,authUserId:i.authUserId,sessionId:i.sessionId,mode:i.mode??se.mode,title:i.title??se.title,subtitle:i.subtitle,greeting:i.greeting,avatarUrl:i.avatarUrl,privacyPolicyUrl:i.privacyPolicyUrl,streaming:i.streaming??se.streaming,metadata:i.metadata??{},theme:s,thinkingEnabled:(a==null?void 0:a.thinkingEnabled)===!0,thinkingViewable:(a==null?void 0:a.thinkingViewable)===!0}}function Ht(t,e){const n={...t};for(const r of Object.keys(e)){const a=e[r];a!=null&&(typeof a=="object"&&!Array.isArray(a)&&n[r]!==null&&typeof n[r]=="object"?n[r]=Ht(n[r],a):n[r]=a)}return n}var Qe=function(){return Qe=Object.assign||function(e){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Qe.apply(this,arguments)};function H(t,e,n,r){function a(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function o(l){try{d(r.next(l))}catch(f){s(f)}}function c(l){try{d(r.throw(l))}catch(f){s(f)}}function d(l){l.done?i(l.value):a(l.value).then(o,c)}d((r=r.apply(t,e||[])).next())})}function X(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,a,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(d){return function(l){return c([d,l])}}function c(d){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,d[0]&&(n=0)),n;)try{if(r=1,a&&(i=d[0]&2?a.return:d[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,d[1])).done)return i;switch(a=0,i&&(d=[d[0]&2,i.value]),d[0]){case 0:case 1:i=d;break;case 4:return n.label++,{value:d[1],done:!1};case 5:n.label++,a=d[1],d=[0];continue;case 7:d=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!i||d[1]>i[0]&&d[1]<i[3])){n.label=d[1];break}if(d[0]===6&&n.label<i[1]){n.label=i[1],i=d;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(d);break}i[2]&&n.ops.pop(),n.trys.pop();continue}d=e.call(t,n)}catch(l){d=[6,l],a=0}finally{r=i=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Xt(t,e,n){if(n||arguments.length===2)for(var r=0,a=e.length,i;r<a;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var Jt="4.6.2";function Ve(t,e){return new Promise(function(n){return setTimeout(n,t,e)})}function fr(){return new Promise(function(t){var e=new MessageChannel;e.port1.onmessage=function(){return t()},e.port2.postMessage(null)})}function hr(t,e){e===void 0&&(e=1/0);var n=window.requestIdleCallback;return n?new Promise(function(r){return n.call(window,function(){return r()},{timeout:e})}):Ve(Math.min(t,e))}function Qt(t){return!!t&&typeof t.then=="function"}function Nt(t,e){try{var n=t();Qt(n)?n.then(function(r){return e(!0,r)},function(r){return e(!1,r)}):e(!0,n)}catch(r){e(!1,r)}}function Tt(t,e,n){return n===void 0&&(n=16),H(this,void 0,void 0,function(){var r,a,i,s;return X(this,function(o){switch(o.label){case 0:r=Array(t.length),a=Date.now(),i=0,o.label=1;case 1:return i<t.length?(r[i]=e(t[i],i),s=Date.now(),s>=a+n?(a=s,[4,fr()]):[3,3]):[3,4];case 2:o.sent(),o.label=3;case 3:return++i,[3,1];case 4:return[2,r]}})})}function we(t){return t.then(void 0,function(){}),t}function mr(t,e){for(var n=0,r=t.length;n<r;++n)if(t[n]===e)return!0;return!1}function pr(t,e){return!mr(t,e)}function it(t){return parseInt(t)}function $(t){return parseFloat(t)}function J(t,e){return typeof t=="number"&&isNaN(t)?e:t}function V(t){return t.reduce(function(e,n){return e+(n?1:0)},0)}function Kt(t,e){if(e===void 0&&(e=1),Math.abs(e)>=1)return Math.round(t/e)*e;var n=1/e;return Math.round(t*n)/n}function gr(t){for(var e,n,r="Unexpected syntax '".concat(t,"'"),a=/^\s*([a-z-]*)(.*)$/i.exec(t),i=a[1]||void 0,s={},o=/([.:#][\w-]+|\[.+?\])/gi,c=function(p,m){s[p]=s[p]||[],s[p].push(m)};;){var d=o.exec(a[2]);if(!d)break;var l=d[0];switch(l[0]){case".":c("class",l.slice(1));break;case"#":c("id",l.slice(1));break;case"[":{var f=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(l);if(f)c(f[1],(n=(e=f[4])!==null&&e!==void 0?e:f[5])!==null&&n!==void 0?n:"");else throw new Error(r);break}default:throw new Error(r)}}return[i,s]}function vr(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r>127)return new TextEncoder().encode(t);e[n]=r}return e}function te(t,e){var n=t[0]>>>16,r=t[0]&65535,a=t[1]>>>16,i=t[1]&65535,s=e[0]>>>16,o=e[0]&65535,c=e[1]>>>16,d=e[1]&65535,l=0,f=0,p=0,m=0;m+=i+d,p+=m>>>16,m&=65535,p+=a+c,f+=p>>>16,p&=65535,f+=r+o,l+=f>>>16,f&=65535,l+=n+s,l&=65535,t[0]=l<<16|f,t[1]=p<<16|m}function z(t,e){var n=t[0]>>>16,r=t[0]&65535,a=t[1]>>>16,i=t[1]&65535,s=e[0]>>>16,o=e[0]&65535,c=e[1]>>>16,d=e[1]&65535,l=0,f=0,p=0,m=0;m+=i*d,p+=m>>>16,m&=65535,p+=a*d,f+=p>>>16,p&=65535,p+=i*c,f+=p>>>16,p&=65535,f+=r*d,l+=f>>>16,f&=65535,f+=a*c,l+=f>>>16,f&=65535,f+=i*o,l+=f>>>16,f&=65535,l+=n*d+r*c+a*o+i*s,l&=65535,t[0]=l<<16|f,t[1]=p<<16|m}function de(t,e){var n=t[0];e%=64,e===32?(t[0]=t[1],t[1]=n):e<32?(t[0]=n<<e|t[1]>>>32-e,t[1]=t[1]<<e|n>>>32-e):(e-=32,t[0]=t[1]<<e|n>>>32-e,t[1]=n<<e|t[1]>>>32-e)}function F(t,e){e%=64,e!==0&&(e<32?(t[0]=t[1]>>>32-e,t[1]=t[1]<<e):(t[0]=t[1]<<e-32,t[1]=0))}function A(t,e){t[0]^=e[0],t[1]^=e[1]}var yr=[4283543511,3981806797],kr=[3301882366,444984403];function Lt(t){var e=[0,t[0]>>>1];A(t,e),z(t,yr),e[1]=t[0]>>>1,A(t,e),z(t,kr),e[1]=t[0]>>>1,A(t,e)}var je=[2277735313,289559509],Ne=[1291169091,658871167],Rt=[0,5],br=[0,1390208809],xr=[0,944331445];function _r(t,e){var n=vr(t);e=e||0;var r=[0,n.length],a=r[1]%16,i=r[1]-a,s=[0,e],o=[0,e],c=[0,0],d=[0,0],l;for(l=0;l<i;l=l+16)c[0]=n[l+4]|n[l+5]<<8|n[l+6]<<16|n[l+7]<<24,c[1]=n[l]|n[l+1]<<8|n[l+2]<<16|n[l+3]<<24,d[0]=n[l+12]|n[l+13]<<8|n[l+14]<<16|n[l+15]<<24,d[1]=n[l+8]|n[l+9]<<8|n[l+10]<<16|n[l+11]<<24,z(c,je),de(c,31),z(c,Ne),A(s,c),de(s,27),te(s,o),z(s,Rt),te(s,br),z(d,Ne),de(d,33),z(d,je),A(o,d),de(o,31),te(o,s),z(o,Rt),te(o,xr);c[0]=0,c[1]=0,d[0]=0,d[1]=0;var f=[0,0];switch(a){case 15:f[1]=n[l+14],F(f,48),A(d,f);case 14:f[1]=n[l+13],F(f,40),A(d,f);case 13:f[1]=n[l+12],F(f,32),A(d,f);case 12:f[1]=n[l+11],F(f,24),A(d,f);case 11:f[1]=n[l+10],F(f,16),A(d,f);case 10:f[1]=n[l+9],F(f,8),A(d,f);case 9:f[1]=n[l+8],A(d,f),z(d,Ne),de(d,33),z(d,je),A(o,d);case 8:f[1]=n[l+7],F(f,56),A(c,f);case 7:f[1]=n[l+6],F(f,48),A(c,f);case 6:f[1]=n[l+5],F(f,40),A(c,f);case 5:f[1]=n[l+4],F(f,32),A(c,f);case 4:f[1]=n[l+3],F(f,24),A(c,f);case 3:f[1]=n[l+2],F(f,16),A(c,f);case 2:f[1]=n[l+1],F(f,8),A(c,f);case 1:f[1]=n[l],A(c,f),z(c,je),de(c,31),z(c,Ne),A(s,c)}return A(s,r),A(o,r),te(s,o),te(o,s),Lt(s),Lt(o),te(s,o),te(o,s),("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)}function wr(t){var e;return Qe({name:t.name,message:t.message,stack:(e=t.stack)===null||e===void 0?void 0:e.split(`
|
|
2
|
-
`)},t)}function Sr(t){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))}function Cr(t){return typeof t!="function"}function Ir(t,e){var n=we(new Promise(function(r){var a=Date.now();Nt(t.bind(null,e),function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];var o=Date.now()-a;if(!i[0])return r(function(){return{error:i[1],duration:o}});var c=i[1];if(Cr(c))return r(function(){return{value:c,duration:o}});r(function(){return new Promise(function(d){var l=Date.now();Nt(c,function(){for(var f=[],p=0;p<arguments.length;p++)f[p]=arguments[p];var m=o+Date.now()-l;if(!f[0])return d({error:f[1],duration:m});d({value:f[1],duration:m})})})})})}));return function(){return n.then(function(a){return a()})}}function jr(t,e,n,r){var a=Object.keys(t).filter(function(s){return pr(n,s)}),i=we(Tt(a,function(s){return Ir(t[s],e)},r));return function(){return H(this,void 0,void 0,function(){var o,c,d,l,f;return X(this,function(p){switch(p.label){case 0:return[4,i];case 1:return o=p.sent(),[4,Tt(o,function(m){return we(m())},r)];case 2:return c=p.sent(),[4,Promise.all(c)];case 3:for(d=p.sent(),l={},f=0;f<a.length;++f)l[a[f]]=d[f];return[2,l]}})})}}function qt(){var t=window,e=navigator;return V(["MSCSSMatrix"in t,"msSetImmediate"in t,"msIndexedDB"in t,"msMaxTouchPoints"in e,"msPointerEnabled"in e])>=4}function Nr(){var t=window,e=navigator;return V(["msWriteProfilerMark"in t,"MSStream"in t,"msLaunchUri"in e,"msSaveBlob"in e])>=3&&!qt()}function Se(){var t=window,e=navigator;return V(["webkitPersistentStorage"in e,"webkitTemporaryStorage"in e,(e.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in t,"BatteryManager"in t,"webkitMediaStream"in t,"webkitSpeechGrammar"in t])>=5}function B(){var t=window,e=navigator;return V(["ApplePayError"in t,"CSSPrimitiveValue"in t,"Counter"in t,e.vendor.indexOf("Apple")===0,"RGBColor"in t,"WebKitMediaKeys"in t])>=4}function st(){var t=window,e=t.HTMLElement,n=t.Document;return V(["safari"in t,!("ongestureend"in t),!("TouchEvent"in t),!("orientation"in t),e&&!("autocapitalize"in e.prototype),n&&"pointerLockElement"in n.prototype])>=4}function Ce(){var t=window;return Sr(t.print)&&String(t.browser)==="[object WebPageNamespace]"}function en(){var t,e,n=window;return V(["buildID"in navigator,"MozAppearance"in((e=(t=document.documentElement)===null||t===void 0?void 0:t.style)!==null&&e!==void 0?e:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function Tr(){var t=window;return V([!("MediaSettingsRange"in t),"RTCEncodedAudioFrame"in t,""+t.Intl=="[object Intl]",""+t.Reflect=="[object Reflect]"])>=3}function Lr(){var t=window,e=t.URLPattern;return V(["union"in Set.prototype,"Iterator"in t,e&&"hasRegExpGroups"in e.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function Rr(){var t=window;return V(["DOMRectList"in t,"RTCPeerConnectionIceEvent"in t,"SVGGeometryElement"in t,"ontransitioncancel"in t])>=3}function Ie(){var t=window,e=navigator,n=t.CSS,r=t.HTMLButtonElement;return V([!("getStorageUpdates"in e),r&&"popover"in r.prototype,"CSSCounterStyleRule"in t,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function Ar(){if(navigator.platform==="iPad")return!0;var t=screen,e=t.width/t.height;return V(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,e>.65&&e<1.53])>=2}function Er(){var t=document;return t.fullscreenElement||t.msFullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement||null}function Mr(){var t=document;return(t.exitFullscreen||t.msExitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen).call(t)}function ot(){var t=Se(),e=en(),n=window,r=navigator,a="connection";return t?V([!("SharedWorker"in n),r[a]&&"ontypechange"in r[a],!("sinkId"in new Audio)])>=2:e?V(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2:!1}function Zr(){var t=navigator,e=window,n=Audio.prototype,r=e.visualViewport;return V(["srLatency"in n,"srChannelCount"in n,"devicePosture"in t,r&&"segments"in r,"getTextInformation"in Image.prototype])>=3}function Or(){return Fr()?-4:Vr()}function Vr(){var t=window,e=t.OfflineAudioContext||t.webkitOfflineAudioContext;if(!e)return-2;if(Pr())return-1;var n=4500,r=5e3,a=new e(1,r,44100),i=a.createOscillator();i.type="triangle",i.frequency.value=1e4;var s=a.createDynamicsCompressor();s.threshold.value=-50,s.knee.value=40,s.ratio.value=12,s.attack.value=0,s.release.value=.25,i.connect(s),s.connect(a.destination),i.start(0);var o=Wr(a),c=o[0],d=o[1],l=we(c.then(function(f){return zr(f.getChannelData(0).subarray(n))},function(f){if(f.name==="timeout"||f.name==="suspended")return-3;throw f}));return function(){return d(),l}}function Pr(){return B()&&!st()&&!Rr()}function Fr(){return B()&&Ie()&&Ce()||Se()&&Zr()&&Lr()}function Wr(t){var e=3,n=500,r=500,a=5e3,i=function(){},s=new Promise(function(o,c){var d=!1,l=0,f=0;t.oncomplete=function(w){return o(w.renderedBuffer)};var p=function(){setTimeout(function(){return c(At("timeout"))},Math.min(r,f+a-Date.now()))},m=function(){try{var w=t.startRendering();switch(Qt(w)&&we(w),t.state){case"running":f=Date.now(),d&&p();break;case"suspended":document.hidden||l++,d&&l>=e?c(At("suspended")):setTimeout(m,n);break}}catch(k){c(k)}};m(),i=function(){d||(d=!0,f>0&&p())}});return[s,i]}function zr(t){for(var e=0,n=0;n<t.length;++n)e+=Math.abs(t[n]);return e}function At(t){var e=new Error(t);return e.name=t,e}function tn(t,e,n){var r,a,i;return n===void 0&&(n=50),H(this,void 0,void 0,function(){var s,o;return X(this,function(c){switch(c.label){case 0:s=document,c.label=1;case 1:return s.body?[3,3]:[4,Ve(n)];case 2:return c.sent(),[3,1];case 3:o=s.createElement("iframe"),c.label=4;case 4:return c.trys.push([4,,10,11]),[4,new Promise(function(d,l){var f=!1,p=function(){f=!0,d()},m=function(R){f=!0,l(R)};o.onload=p,o.onerror=m;var w=o.style;w.setProperty("display","block","important"),w.position="absolute",w.top="0",w.left="0",w.visibility="hidden",e&&"srcdoc"in o?o.srcdoc=e:o.src="about:blank",s.body.appendChild(o);var k=function(){var R,_;f||(((_=(R=o.contentWindow)===null||R===void 0?void 0:R.document)===null||_===void 0?void 0:_.readyState)==="complete"?p():setTimeout(k,10))};k()})];case 5:c.sent(),c.label=6;case 6:return!((a=(r=o.contentWindow)===null||r===void 0?void 0:r.document)===null||a===void 0)&&a.body?[3,8]:[4,Ve(n)];case 7:return c.sent(),[3,6];case 8:return[4,t(o,o.contentWindow)];case 9:return[2,c.sent()];case 10:return(i=o.parentNode)===null||i===void 0||i.removeChild(o),[7];case 11:return[2]}})})}function Dr(t){for(var e=gr(t),n=e[0],r=e[1],a=document.createElement(n??"div"),i=0,s=Object.keys(r);i<s.length;i++){var o=s[i],c=r[o].join(" ");o==="style"?Ur(a.style,c):a.setAttribute(o,c)}return a}function Ur(t,e){for(var n=0,r=e.split(";");n<r.length;n++){var a=r[n],i=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(a);if(i){var s=i[1],o=i[2],c=i[4];t.setProperty(s,o,c||"")}}}function $r(){for(var t=window;;){var e=t.parent;if(!e||e===t)return!1;try{if(e.location.origin!==t.location.origin)return!0}catch(n){if(n instanceof Error&&n.name==="SecurityError")return!0;throw n}t=e}}var Br="mmMwWLliI0O&1",Gr="48px",le=["monospace","sans-serif","serif"],Et=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function Yr(){var t=this;return tn(function(e,n){var r=n.document;return H(t,void 0,void 0,function(){var a,i,s,o,c,d,l,f,p,m,w,k;return X(this,function(R){for(a=r.body,a.style.fontSize=Gr,i=r.createElement("div"),i.style.setProperty("visibility","hidden","important"),s={},o={},c=function(_){var S=r.createElement("span"),I=S.style;return I.position="absolute",I.top="0",I.left="0",I.fontFamily=_,S.textContent=Br,i.appendChild(S),S},d=function(_,S){return c("'".concat(_,"',").concat(S))},l=function(){return le.map(c)},f=function(){for(var _={},S=function(q){_[q]=le.map(function(ce){return d(q,ce)})},I=0,W=Et;I<W.length;I++){var ie=W[I];S(ie)}return _},p=function(_){return le.some(function(S,I){return _[I].offsetWidth!==s[S]||_[I].offsetHeight!==o[S]})},m=l(),w=f(),a.appendChild(i),k=0;k<le.length;k++)s[le[k]]=m[k].offsetWidth,o[le[k]]=m[k].offsetHeight;return[2,Et.filter(function(_){return p(w[_])})]})})})}function Hr(){var t=navigator.plugins;if(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];if(r){for(var a=[],i=0;i<r.length;++i){var s=r[i];a.push({type:s.type,suffixes:s.suffixes})}e.push({name:r.name,description:r.description,mimeTypes:a})}}return e}}function Xr(){return Jr(ra())}function Jr(t){var e,n=!1,r,a,i=Qr(),s=i[0],o=i[1];return Kr(s,o)?(n=qr(o),t?r=a="skipped":(e=ea(s,o),r=e[0],a=e[1])):r=a="unsupported",{winding:n,geometry:r,text:a}}function Qr(){var t=document.createElement("canvas");return t.width=1,t.height=1,[t,t.getContext("2d")]}function Kr(t,e){return!!(e&&t.toDataURL)}function qr(t){return t.rect(0,0,10,10),t.rect(2,2,6,6),!t.isPointInPath(5,5,"evenodd")}function ea(t,e){ta(t,e);var n=ze(t),r=ze(t);if(n!==r)return["unstable","unstable"];na(t,e);var a=ze(t);return[a,n]}function ta(t,e){t.width=240,t.height=60,e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(100,1,62,20),e.fillStyle="#069",e.font='11pt "Times New Roman"';var n="Cwm fjordbank gly ".concat("😃");e.fillText(n,2,15),e.fillStyle="rgba(102, 204, 0, 0.2)",e.font="18pt Arial",e.fillText(n,4,45)}function na(t,e){t.width=122,t.height=110,e.globalCompositeOperation="multiply";for(var n=0,r=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];n<r.length;n++){var a=r[n],i=a[0],s=a[1],o=a[2];e.fillStyle=i,e.beginPath(),e.arc(s,o,40,0,Math.PI*2,!0),e.closePath(),e.fill()}e.fillStyle="#f9c",e.arc(60,60,60,0,Math.PI*2,!0),e.arc(60,60,20,0,Math.PI*2,!0),e.fill("evenodd")}function ze(t){return t.toDataURL()}function ra(){return B()&&Ie()&&Ce()}function aa(){var t=navigator,e=0,n;t.maxTouchPoints!==void 0?e=it(t.maxTouchPoints):t.msMaxTouchPoints!==void 0&&(e=t.msMaxTouchPoints);try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}var r="ontouchstart"in window;return{maxTouchPoints:e,touchEvent:n,touchStart:r}}function ia(){return navigator.oscpu}function sa(){var t=navigator,e=[],n=t.language||t.userLanguage||t.browserLanguage||t.systemLanguage;if(n!==void 0&&e.push([n]),Array.isArray(t.languages))Se()&&Tr()||e.push(t.languages);else if(typeof t.languages=="string"){var r=t.languages;r&&e.push(r.split(","))}return e}function oa(){return window.screen.colorDepth}function ca(){return J($(navigator.deviceMemory),void 0)}function da(){if(!(B()&&Ie()&&Ce()))return la()}function la(){var t=screen,e=function(r){return J(it(r),null)},n=[e(t.width),e(t.height)];return n.sort().reverse(),n}var ua=2500,fa=10,Te,De;function ha(){if(De===void 0){var t=function(){var e=Ke();qe(e)?De=setTimeout(t,ua):(Te=e,De=void 0)};t()}}function ma(){var t=this;return ha(),function(){return H(t,void 0,void 0,function(){var e;return X(this,function(n){switch(n.label){case 0:return e=Ke(),qe(e)?Te?[2,Xt([],Te,!0)]:Er()?[4,Mr()]:[3,2]:[3,2];case 1:n.sent(),e=Ke(),n.label=2;case 2:return qe(e)||(Te=e),[2,e]}})})}}function pa(){var t=this;if(B()&&Ie()&&Ce())return function(){return Promise.resolve(void 0)};var e=ma();return function(){return H(t,void 0,void 0,function(){var n,r;return X(this,function(a){switch(a.label){case 0:return[4,e()];case 1:return n=a.sent(),r=function(i){return i===null?null:Kt(i,fa)},[2,[r(n[0]),r(n[1]),r(n[2]),r(n[3])]]}})})}}function Ke(){var t=screen;return[J($(t.availTop),null),J($(t.width)-$(t.availWidth)-J($(t.availLeft),0),null),J($(t.height)-$(t.availHeight)-J($(t.availTop),0),null),J($(t.availLeft),null)]}function qe(t){for(var e=0;e<4;++e)if(t[e])return!1;return!0}function ga(){return J(it(navigator.hardwareConcurrency),void 0)}function va(){var t,e=(t=window.Intl)===null||t===void 0?void 0:t.DateTimeFormat;if(e){var n=new e().resolvedOptions().timeZone;if(n)return n}var r=-ya();return"UTC".concat(r>=0?"+":"").concat(r)}function ya(){var t=new Date().getFullYear();return Math.max($(new Date(t,0,1).getTimezoneOffset()),$(new Date(t,6,1).getTimezoneOffset()))}function ka(){try{return!!window.sessionStorage}catch{return!0}}function ba(){try{return!!window.localStorage}catch{return!0}}function xa(){if(!(qt()||Nr()))try{return!!window.indexedDB}catch{return!0}}function _a(){return!!window.openDatabase}function wa(){return navigator.cpuClass}function Sa(){var t=navigator.platform;return t==="MacIntel"&&B()&&!st()?Ar()?"iPad":"iPhone":t}function Ca(){return navigator.vendor||""}function Ia(){for(var t=[],e=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];e<n.length;e++){var r=n[e],a=window[r];a&&typeof a=="object"&&t.push(r)}return t.sort()}function ja(){var t=document;try{t.cookie="cookietest=1; SameSite=Strict;";var e=t.cookie.indexOf("cookietest=")!==-1;return t.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",e}catch{return!1}}function Na(){var t=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',t("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",t("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",t("LnNwb25zb3JpdA=="),".ylamainos",t("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),t("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",t("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",t("LmhlYWRlci1ibG9ja2VkLWFk"),t("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",t("I2FkXzMwMFgyNTA="),t("I2Jhbm5lcmZsb2F0MjI="),t("I2NhbXBhaWduLWJhbm5lcg=="),t("I0FkLUNvbnRlbnQ=")],adGuardChinese:[t("LlppX2FkX2FfSA=="),t("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",t("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),t("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",t("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",t("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",t("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),t("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),t("LmFkZ29vZ2xl"),t("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[t("YW1wLWF1dG8tYWRz"),t("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",t("I2FkX2ludmlld19hcmVh")],adGuardRussian:[t("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),t("LnJlY2xhbWE="),'div[id^="smi2adblock"]',t("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[t("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),t("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",t("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),t("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),t("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",t("I3Jla2xhbWk="),t("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),t("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),t("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[t("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",t("LndpZGdldF9wb19hZHNfd2lkZ2V0"),t("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",t("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[t("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),t("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",t("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",t("I3Jla2xhbW5pLWJveA=="),t("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",t("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[t("I2FkdmVydGVudGll"),t("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",t("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",t("LnNwb25zb3JsaW5rZ3J1ZW4="),t("I3dlcmJ1bmdza3k="),t("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),t("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[t("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",t("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),t("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),t("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[t("LnJla2xhbW9zX3RhcnBhcw=="),t("LnJla2xhbW9zX251b3JvZG9z"),t("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),t("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),t("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[t("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[t("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),t("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",t("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[t("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),t("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),t("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",t("LmFkX19tYWlu"),t("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[t("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[t("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),t("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[t("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),t("I2xpdmVyZUFkV3JhcHBlcg=="),t("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),t("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[t("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",t("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),t("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),t("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[t("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),t("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),t("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",t("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),t("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),t("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),t("ZGl2I3NrYXBpZWNfYWQ=")],ro:[t("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),t("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),t("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),t("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[t("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),t("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),t("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",t("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),t("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",t("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}function Ta(t){var e=t===void 0?{}:t,n=e.debug;return H(this,void 0,void 0,function(){var r,a,i,s,o,c;return X(this,function(d){switch(d.label){case 0:return La()?(r=Na(),a=Object.keys(r),i=(c=[]).concat.apply(c,a.map(function(l){return r[l]})),[4,Ra(i)]):[2,void 0];case 1:return s=d.sent(),n&&Aa(r,s),o=a.filter(function(l){var f=r[l],p=V(f.map(function(m){return s[m]}));return p>f.length*.6}),o.sort(),[2,o]}})})}function La(){return B()||ot()}function Ra(t){var e;return H(this,void 0,void 0,function(){var n,r,a,i,c,s,o,c;return X(this,function(d){switch(d.label){case 0:for(n=document,r=n.createElement("div"),a=new Array(t.length),i={},Mt(r),c=0;c<t.length;++c)s=Dr(t[c]),s.tagName==="DIALOG"&&s.show(),o=n.createElement("div"),Mt(o),o.appendChild(s),r.appendChild(o),a[c]=s;d.label=1;case 1:return n.body?[3,3]:[4,Ve(50)];case 2:return d.sent(),[3,1];case 3:n.body.appendChild(r);try{for(c=0;c<t.length;++c)a[c].offsetParent||(i[t[c]]=!0)}finally{(e=r.parentNode)===null||e===void 0||e.removeChild(r)}return[2,i]}})})}function Mt(t){t.style.setProperty("visibility","hidden","important"),t.style.setProperty("display","block","important")}function Aa(t,e){for(var n="DOM blockers debug:\n```",r=0,a=Object.keys(t);r<a.length;r++){var i=a[r];n+=`
|
|
3
|
-
`.concat(i,":");for(var s=0,o=
|
|
4
|
-
`.concat(e[c]?"🚫":"➡️"," ").concat(c)}}console.log("".concat(n,"\n```"))}function Ea(){for(var t=0,e=["rec2020","p3","srgb"];t<e.length;t++){var n=e[t];if(matchMedia("(color-gamut: ".concat(n,")")).matches)return n}}function Ma(){if(Zt("inverted"))return!0;if(Zt("none"))return!1}function Zt(t){return matchMedia("(inverted-colors: ".concat(t,")")).matches}function Za(){if(Ot("active"))return!0;if(Ot("none"))return!1}function Ot(t){return matchMedia("(forced-colors: ".concat(t,")")).matches}var Oa=100;function Va(){if(matchMedia("(min-monochrome: 0)").matches){for(var t=0;t<=Oa;++t)if(matchMedia("(max-monochrome: ".concat(t,")")).matches)return t;throw new Error("Too high value")}}function Pa(){if(ue("no-preference"))return 0;if(ue("high")||ue("more"))return 1;if(ue("low")||ue("less"))return-1;if(ue("forced"))return 10}function ue(t){return matchMedia("(prefers-contrast: ".concat(t,")")).matches}function Fa(){if(Vt("reduce"))return!0;if(Vt("no-preference"))return!1}function Vt(t){return matchMedia("(prefers-reduced-motion: ".concat(t,")")).matches}function Wa(){if(Pt("reduce"))return!0;if(Pt("no-preference"))return!1}function Pt(t){return matchMedia("(prefers-reduced-transparency: ".concat(t,")")).matches}function za(){if(Ft("high"))return!0;if(Ft("standard"))return!1}function Ft(t){return matchMedia("(dynamic-range: ".concat(t,")")).matches}var T=Math,Z=function(){return 0};function Da(){var t=T.acos||Z,e=T.acosh||Z,n=T.asin||Z,r=T.asinh||Z,a=T.atanh||Z,i=T.atan||Z,s=T.sin||Z,o=T.sinh||Z,c=T.cos||Z,d=T.cosh||Z,l=T.tan||Z,f=T.tanh||Z,p=T.exp||Z,m=T.expm1||Z,w=T.log1p||Z,k=function(L){return T.pow(T.PI,L)},R=function(L){return T.log(L+T.sqrt(L*L-1))},_=function(L){return T.log(L+T.sqrt(L*L+1))},S=function(L){return T.log((1+L)/(1-L))/2},I=function(L){return T.exp(L)-1/T.exp(L)/2},W=function(L){return(T.exp(L)+1/T.exp(L))/2},ie=function(L){return T.exp(L)-1},q=function(L){return(T.exp(2*L)-1)/(T.exp(2*L)+1)},ce=function(L){return T.log(1+L)};return{acos:t(.12312423423423424),acosh:e(1e308),acoshPf:R(1e154),asin:n(.12312423423423424),asinh:r(1),asinhPf:_(1),atanh:a(.5),atanhPf:S(.5),atan:i(.5),sin:s(-1e300),sinh:o(1),sinhPf:I(1),cos:c(10.000000000123),cosh:d(1),coshPf:W(1),tan:l(-1e300),tanh:f(1),tanhPf:q(1),exp:p(1),expm1:m(1),expm1Pf:ie(1),log1p:w(10),log1pPf:ce(10),powPI:k(-100)}}var Ua="mmMwWLliI0fiflO&1",Ue={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function $a(){return Ba(function(t,e){for(var n={},r={},a=0,i=Object.keys(Ue);a<i.length;a++){var s=i[a],o=Ue[s],c=o[0],d=c===void 0?{}:c,l=o[1],f=l===void 0?Ua:l,p=t.createElement("span");p.textContent=f,p.style.whiteSpace="nowrap";for(var m=0,w=Object.keys(d);m<w.length;m++){var k=w[m],R=d[k];R!==void 0&&(p.style[k]=R)}n[s]=p,e.append(t.createElement("br"),p)}for(var _=0,S=Object.keys(Ue);_<S.length;_++){var s=S[_];r[s]=n[s].getBoundingClientRect().width}return r})}function Ba(t,e){return e===void 0&&(e=4e3),tn(function(n,r){var a=r.document,i=a.body,s=i.style;s.width="".concat(e,"px"),s.webkitTextSizeAdjust=s.textSizeAdjust="none",Se()?i.style.zoom="".concat(1/r.devicePixelRatio):B()&&(i.style.zoom="reset");var o=a.createElement("div");return o.textContent=Xt([],Array(e/20<<0),!0).map(function(){return"word"}).join(" "),i.appendChild(o),t(a,i)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function Ga(){return navigator.pdfViewerEnabled}function Ya(){var t=new Float32Array(1),e=new Uint8Array(t.buffer);return t[0]=1/0,t[0]=t[0]-t[0],e[3]}function Ha(){var t=window.ApplePaySession;if(typeof(t==null?void 0:t.canMakePayments)!="function")return-1;if(Xa())return-3;try{return t.canMakePayments()?1:0}catch(e){return Ja(e)}}var Xa=$r;function Ja(t){if(t instanceof Error&&t.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(t.message))return-2;throw t}function Qa(){var t,e=document.createElement("a"),n=(t=e.attributionSourceId)!==null&&t!==void 0?t:e.attributionsourceid;return n===void 0?void 0:String(n)}var nn=-1,rn=-2,Ka=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),qa=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),ei=["FRAGMENT_SHADER","VERTEX_SHADER"],ti=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],an="WEBGL_debug_renderer_info",ni="WEBGL_polygon_mode";function ri(t){var e,n,r,a,i,s,o=t.cache,c=sn(o);if(!c)return nn;if(!cn(c))return rn;var d=on()?null:c.getExtension(an);return{version:((e=c.getParameter(c.VERSION))===null||e===void 0?void 0:e.toString())||"",vendor:((n=c.getParameter(c.VENDOR))===null||n===void 0?void 0:n.toString())||"",vendorUnmasked:d?(r=c.getParameter(d.UNMASKED_VENDOR_WEBGL))===null||r===void 0?void 0:r.toString():"",renderer:((a=c.getParameter(c.RENDERER))===null||a===void 0?void 0:a.toString())||"",rendererUnmasked:d?(i=c.getParameter(d.UNMASKED_RENDERER_WEBGL))===null||i===void 0?void 0:i.toString():"",shadingLanguageVersion:((s=c.getParameter(c.SHADING_LANGUAGE_VERSION))===null||s===void 0?void 0:s.toString())||""}}function ai(t){var e=t.cache,n=sn(e);if(!n)return nn;if(!cn(n))return rn;var r=n.getSupportedExtensions(),a=n.getContextAttributes(),i=[],s=[],o=[],c=[],d=[];if(a)for(var l=0,f=Object.keys(a);l<f.length;l++){var p=f[l];s.push("".concat(p,"=").concat(a[p]))}for(var m=Wt(n),w=0,k=m;w<k.length;w++){var R=k[w],_=n[R];o.push("".concat(R,"=").concat(_).concat(Ka.has(_)?"=".concat(n.getParameter(_)):""))}if(r)for(var S=0,I=r;S<I.length;S++){var W=I[S];if(!(W===an&&on()||W===ni&&oi())){var ie=n.getExtension(W);if(!ie){i.push(W);continue}for(var q=0,ce=Wt(ie);q<ce.length;q++){var R=ce[q],_=ie[R];c.push("".concat(R,"=").concat(_).concat(qa.has(_)?"=".concat(n.getParameter(_)):""))}}}for(var L=0,lt=ei;L<lt.length;L++)for(var ut=lt[L],Fe=0,ft=ti;Fe<ft.length;Fe++){var ht=ft[Fe],Rn=ii(n,ut,ht);d.push("".concat(ut,".").concat(ht,"=").concat(Rn.join(",")))}return c.sort(),o.sort(),{contextAttributes:s,parameters:o,shaderPrecisions:d,extensions:r,extensionParameters:c,unsupportedExtensions:i}}function sn(t){if(t.webgl)return t.webgl.context;var e=document.createElement("canvas"),n;e.addEventListener("webglCreateContextError",function(){return n=void 0});for(var r=0,a=["webgl","experimental-webgl"];r<a.length;r++){var i=a[r];try{n=e.getContext(i)}catch{}if(n)break}return t.webgl={context:n},n}function ii(t,e,n){var r=t.getShaderPrecisionFormat(t[e],t[n]);return r?[r.rangeMin,r.rangeMax,r.precision]:[]}function Wt(t){var e=Object.keys(t.__proto__);return e.filter(si)}function si(t){return typeof t=="string"&&!t.match(/[^A-Z0-9_x]/)}function on(){return en()}function oi(){return Se()||B()}function cn(t){return typeof t.getParameter=="function"}function ci(){var t=ot()||B();if(!t)return-2;if(!window.AudioContext)return-1;var e=new AudioContext().baseLatency;return e==null?-1:isFinite(e)?e:-3}function di(){if(!window.Intl)return-1;var t=window.Intl.DateTimeFormat;if(!t)return-2;var e=t().resolvedOptions().locale;return!e&&e!==""?-3:e}var li={fonts:Yr,domBlockers:Ta,fontPreferences:$a,audio:Or,screenFrame:pa,canvas:Xr,osCpu:ia,languages:sa,colorDepth:oa,deviceMemory:ca,screenResolution:da,hardwareConcurrency:ga,timezone:va,sessionStorage:ka,localStorage:ba,indexedDB:xa,openDatabase:_a,cpuClass:wa,platform:Sa,plugins:Hr,touchSupport:aa,vendor:Ca,vendorFlavors:Ia,cookiesEnabled:ja,colorGamut:Ea,invertedColors:Ma,forcedColors:Za,monochrome:Va,contrast:Pa,reducedMotion:Fa,reducedTransparency:Wa,hdr:za,math:Da,pdfViewerEnabled:Ga,architecture:Ya,applePay:Ha,privateClickMeasurement:Qa,audioBaseLatency:ci,dateTimeLocale:di,webGlBasics:ri,webGlExtensions:ai};function ui(t){return jr(li,t,[])}var fi="$ if upgrade to Pro: https://fpjs.dev/pro";function hi(t){var e=mi(t),n=pi(e);return{score:e,comment:fi.replace(/\$/g,"".concat(n))}}function mi(t){if(ot())return .4;if(B())return st()&&!(Ie()&&Ce())?.5:.3;var e="value"in t.platform?t.platform.value:"";return/^Win/.test(e)?.6:/^Mac/.test(e)?.5:.7}function pi(t){return Kt(.99+.01*t,1e-4)}function gi(t){for(var e="",n=0,r=Object.keys(t).sort();n<r.length;n++){var a=r[n],i=t[a],s="error"in i?"error":JSON.stringify(i.value);e+="".concat(e?"|":"").concat(a.replace(/([:|\\])/g,"\\$1"),":").concat(s)}return e}function dn(t){return JSON.stringify(t,function(e,n){return n instanceof Error?wr(n):n},2)}function ln(t){return _r(gi(t))}function vi(t){var e,n=hi(t);return{get visitorId(){return e===void 0&&(e=ln(this.components)),e},set visitorId(r){e=r},confidence:n,components:t,version:Jt}}function yi(t){return t===void 0&&(t=50),hr(t,t*2)}function ki(t,e){var n=Date.now();return{get:function(r){return H(this,void 0,void 0,function(){var a,i,s;return X(this,function(o){switch(o.label){case 0:return a=Date.now(),[4,t()];case 1:return i=o.sent(),s=vi(i),(e||r!=null&&r.debug)&&console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(s.version,`
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
visitorId: `).concat(s.visitorId,`
|
|
8
|
-
components: `).concat(dn(i),"\n```")),[2,s]}})})}}}function bi(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var t=new XMLHttpRequest;t.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(Jt,"/npm-monitoring"),!0),t.send()}catch(e){console.error(e)}}function xi(t){var e;return t===void 0&&(t={}),H(this,void 0,void 0,function(){var n,r,a;return X(this,function(i){switch(i.label){case 0:return(!((e=t.monitoring)!==null&&e!==void 0)||e)&&bi(),n=t.delayFallback,r=t.debug,[4,yi(n)];case 1:return i.sent(),a=ui({cache:{},debug:r}),[2,ki(a,r)]}})})}var _i={load:xi,hashComponents:ln,componentsToDebugString:dn};class un{constructor(e){this.baseUrl=e}async validateWidget(e,n){if(!n)return{valid:!1,error:"Widget is not configured: tenantId is required"};try{const r=new URLSearchParams({agentId:e,tenantId:n}),a=await fetch(`${this.baseUrl}/v1/widget/validate?${r}`),i=await a.json();return a.ok&&i.success?{valid:!0,agentId:i.data.agentId,tenantId:i.data.tenantId}:{valid:!1,error:i.error??`Widget configuration is invalid (${a.status})`}}catch{return{valid:!1,error:"Unable to reach the AgentForge API to validate widget configuration"}}}async chat(e){var a,i,s;const n=await fetch(`${this.baseUrl}/v1/agents/${encodeURIComponent(e.agentId)}/responses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e.message,sessionId:e.sessionId,tenantId:e.tenantId,userId:e.userId,name:e.name,email:e.email,authUserId:e.authUserId,fingerprint:e.fingerprint,metadata:e.metadata,imageUrl:e.imageUrl})});if(!n.ok)throw new Error(`API error: ${n.status} ${n.statusText}`);const r=await n.json();if(!r.success)throw new Error(r.error??"Unknown API error");return{content:((a=r.data)==null?void 0:a.text)??"",sessionId:(i=r.data)==null?void 0:i.sessionId,images:(s=r.data)==null?void 0:s.images}}async fetchSessionMessages(e){var n;try{const r=await fetch(`${this.baseUrl}/v1/sessions/${encodeURIComponent(e)}/messages`);if(r.status===410||!r.ok)return null;const a=await r.json();return a.success?((n=a.data)==null?void 0:n.messages)??null:null}catch{return null}}async uploadImage(e,n,r){const a=await fetch(`${this.baseUrl}/v1/upload`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e,mimeType:n,fileName:r})});if(!a.ok)throw new Error(`Upload error: ${a.status} ${a.statusText}`);const i=await a.json();if(!i.success)throw new Error(i.error??"Upload failed");return{url:i.data.url}}async fetchWidgetConfig(e,n){try{const r=n?`?tenantId=${encodeURIComponent(n)}`:"",a=await fetch(`${this.baseUrl}/v1/agents/${encodeURIComponent(e)}/widget-config${r}`);if(!a.ok)return null;const i=await a.json();return i.success?i.data:null}catch{return null}}}const wi=6e4;function Si(t){return Promise.race([t.read(),new Promise((e,n)=>setTimeout(()=>n(new Error("Stream timed out — no data received for 60s")),wi))])}async function fn(t,e,n){let r="",a="";try{const i=await fetch(`${t}/v1/agents/${encodeURIComponent(e.agentId)}/responses:stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e.message,sessionId:e.sessionId,tenantId:e.tenantId,userId:e.userId,name:e.name,email:e.email,authUserId:e.authUserId,fingerprint:e.fingerprint,metadata:e.metadata,imageUrl:e.imageUrl})});if(!i.ok||!i.body)throw new Error(`Stream error: ${i.status} ${i.statusText}`);const s=i.headers.get("x-session-id");s&&n.onSession&&n.onSession(s);const o=i.body.getReader(),c=new TextDecoder;let d="";const l=f=>{if(!f.startsWith("data: "))return!1;const p=f.slice(6).trim();if(!p)return!1;if(p==="[DONE]")return n.onEnd(r),!0;try{const m=JSON.parse(p);if(m.type==="session"){const k=m.sessionId;return k&&n.onSession&&n.onSession(k),!1}if(m.type==="done"||m.type==="stop")return n.onEnd(r),!0;if(m.type==="error")throw new Error(m.message??"Stream error");if(m.type==="images"){const k=m.images;return k&&n.onImages&&n.onImages(k),!1}if(m.type==="thinking_chunk"){const k=m.content;return k&&n.onThinkingDelta&&(a+=k,n.onThinkingDelta(k,a)),!1}const w=Ci(m);w&&(r+=w,n.onDelta(w,r))}catch(m){if(!(m instanceof SyntaxError))throw m}return!1};e:for(;;){const{done:f,value:p}=await Si(o);if(f)break;d+=c.decode(p,{stream:!0});const m=d.lastIndexOf(`
|
|
9
|
-
`);if(m===-1)continue;const w=d.slice(0,m);d=d.slice(m+1);for(const k of w.split(`
|
|
10
|
-
`))if(l(k))break e}n.onEnd(r)}catch(i){n.onError(i instanceof Error?i:new Error(String(i)))}}function Ci(t){var a;const e=t.choices;if(Array.isArray(e)&&e.length>0){const i=(a=e[0])==null?void 0:a.delta,s=(i==null?void 0:i.content)??(i==null?void 0:i.text)??"";if(s)return s}const n=t.delta;if(n){const i=n.content??n.text??"";if(i)return i}const r=t.response;return r||(t.text??t.content??"")}class hn{constructor(){ee(this,"listeners",new Map)}on(e,n){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(n)}off(e,n){var r;(r=this.listeners.get(e))==null||r.delete(n)}emit(...e){var a;const[n,r]=e;(a=this.listeners.get(n))==null||a.forEach(i=>i(r))}removeAllListeners(){this.listeners.clear()}}const Ii="agentforge";function ct(t){return`${Ii}:session:${t}`}function mn(t){try{return sessionStorage.getItem(ct(t))??void 0}catch{return}}function Le(t,e){try{sessionStorage.setItem(ct(t),e)}catch{}}function et(t){try{sessionStorage.removeItem(ct(t))}catch{}}function ke(){return`msg-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`}function ji(t){return{id:ke(),role:"assistant",content:t,createdAt:new Date().toISOString(),status:"sent"}}class pn{constructor(e,n,r){ee(this,"config");ee(this,"apiClient");ee(this,"state");ee(this,"greetingShown",!1);ee(this,"fingerprint");ee(this,"emitter");this.hostConfig=n,this.onStateChange=r,this.config=e,this.apiClient=new un(e.apiBaseUrl),this.emitter=new hn,this.initializeFingerprint();const a=e.sessionId??mn(e.agentId);e.sessionId&&Le(e.agentId,e.sessionId);const i=e.mode==="inline";this.state={isOpen:i,messages:[],isLoading:!1,error:null,sessionId:a,initStatus:"validating",initError:null},i&&queueMicrotask(()=>this.openWithGreeting())}async initializeFingerprint(){try{const n=await(await _i.load()).get();this.fingerprint=n.visitorId}catch(e){console.warn("Could not generate browser fingerprint:",e),this.fingerprint=void 0}}getState(){return{...this.state,messages:[...this.state.messages]}}setOpen(e){e?this.openWithGreeting():this.setState({isOpen:!1})}openWithGreeting(){if(this.state.initStatus==="error")return;const e=!this.greetingShown&&!!this.config.greeting;e&&(this.greetingShown=!0),this.setState({isOpen:!0,messages:e?[ji(this.config.greeting),...this.state.messages]:this.state.messages})}async hydrate(){const e=await this.apiClient.validateWidget(this.config.agentId,this.config.tenantId);if(!e.valid){this.setState({initStatus:"error",initError:e.error});return}const n=await this.apiClient.fetchWidgetConfig(this.config.agentId,this.config.tenantId);if(n&&(this.config=Pe(this.hostConfig,n),this.onStateChange(this.getState(),this.config)),this.setState({initStatus:"ready"}),!this.state.sessionId)return;const r=await this.apiClient.fetchSessionMessages(this.state.sessionId);if(r===null){this.handleSessionExpired();return}if(r.length===0)return;const a=r.map(i=>({id:ke(),role:i.role,content:i.content,images:i.images&&i.images.length>0?i.images:void 0,createdAt:new Date().toISOString(),status:"sent"}));this.setState({messages:[...this.state.messages,...a]})}setState(e){this.state={...this.state,...e},this.onStateChange(this.getState(),this.config)}updateMessage(e,n){this.state={...this.state,messages:this.state.messages.map(r=>r.id===e?{...r,...n}:r)},this.onStateChange(this.getState(),this.config)}reset(){et(this.config.agentId),this.greetingShown=!1,this.setState({sessionId:void 0,messages:[],isLoading:!1,error:null}),this.state.isOpen&&this.openWithGreeting()}handleSessionExpired(){et(this.config.agentId),this.setState({sessionId:void 0})}async sendMessage(e,n){if(this.state.isLoading||!e.trim()||this.state.initStatus!=="ready")return;let r;if(n)try{const s=await Ni(n);r=(await this.apiClient.uploadImage(s,n.type,n.name)).url}catch(s){const o=s instanceof Error?s.message:"Image upload failed";this.setState({error:o});return}const a={id:ke(),role:"user",content:e.trim(),uploadedImageUrl:r,createdAt:new Date().toISOString(),status:"sent"},i=!this.state.messages.some(s=>s.role==="user");this.setState({messages:[...this.state.messages,a],isLoading:!0,error:null}),this.emitter.emit("message:sent",a),i&&this.emitter.emit("conversation:started",{sessionId:this.state.sessionId}),this.config.streaming?await this.sendStreaming(e.trim(),r):await this.sendNonStreaming(e.trim(),r)}async sendNonStreaming(e,n,r=!1){try{const a=await this.apiClient.chat({agentId:this.config.agentId,message:e,sessionId:this.state.sessionId,tenantId:this.config.tenantId,userId:this.config.userId,name:this.config.name,email:this.config.email,authUserId:this.config.authUserId,fingerprint:this.fingerprint,metadata:this.config.metadata,imageUrl:n}),i={id:ke(),role:"assistant",content:a.content,images:a.images,createdAt:new Date().toISOString(),status:"sent"};this.setState({messages:[...this.state.messages,i],isLoading:!1,...a.sessionId?{sessionId:a.sessionId}:{}}),a.sessionId&&Le(this.config.agentId,a.sessionId),this.emitter.emit("message:received",i)}catch(a){const i=a instanceof Error?a.message:"Failed to send message";if(!r&&i.includes("410"))return this.handleSessionExpired(),this.sendNonStreaming(e,n,!0);this.setState({isLoading:!1,error:i}),this.emitter.emit("message:error",{error:i,message:null})}}async sendStreaming(e,n,r=!1){const a=ke(),i={id:a,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming",isThinking:this.config.thinkingEnabled?!0:void 0};this.setState({messages:[...this.state.messages,i]}),this.emitter.emit("stream:start");let s=!1;await fn(this.config.apiBaseUrl,{agentId:this.config.agentId,message:e,sessionId:this.state.sessionId,tenantId:this.config.tenantId,userId:this.config.userId,name:this.config.name,email:this.config.email,authUserId:this.config.authUserId,fingerprint:this.fingerprint,metadata:this.config.metadata,imageUrl:n},{onSession:o=>{this.setState({sessionId:o}),Le(this.config.agentId,o)},onImages:o=>{this.updateMessage(a,{images:o})},onThinkingDelta:(o,c)=>{this.updateMessage(a,{thinking:c,isThinking:!0}),this.emitter.emit("thinking:delta",{delta:o,accumulated:c})},onDelta:(o,c)=>{this.updateMessage(a,{content:c,isThinking:!1}),this.emitter.emit("stream:delta",{delta:o,accumulated:c})},onEnd:o=>{this.updateMessage(a,{content:o,status:"sent",isThinking:!1}),this.setState({isLoading:!1}),this.emitter.emit("stream:end",{content:o});const c=this.state.messages.find(d=>d.id===a);c&&(c.thinking&&this.emitter.emit("thinking:end",{content:c.thinking}),this.emitter.emit("message:received",c))},onError:o=>{var d;if(!r&&o.message.includes("410")){s=!0,this.setState({messages:this.state.messages.filter(l=>l.id!==a),isLoading:!1});return}const c=((d=this.state.messages.find(l=>l.id===a))==null?void 0:d.content)??"";this.updateMessage(a,{content:c||"Something went wrong. Please try again.",status:"error"}),this.setState({isLoading:!1,error:"Something went wrong. Please try again."}),this.emitter.emit("message:error",{error:o.message,message:null})}}),s&&(this.handleSessionExpired(),await this.sendStreaming(e,n,!0))}}function Ni(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=()=>{const a=r.result;e(a.split(",")[1]??"")},r.onerror=()=>n(new Error("Failed to read file")),r.readAsDataURL(t)})}function gn(t){const e=document.createElement("div");e.setAttribute("data-agentkit-widget",""),t.appendChild(e);const n=e.attachShadow({mode:"open"}),r=document.createElement("style");n.appendChild(r);const a=document.createElement("div");return a.style.cssText="display: contents;",n.appendChild(a),{host:e,shadowRoot:n,styleSlot:r,mountPoint:a}}function vn(t,e){t.textContent=e}function yn(t){t.remove()}function kn(){const t=document.createElement("div");return t.setAttribute("data-agentkit-root","floating"),t.style.cssText=["position: fixed","bottom: 24px","right: 24px","z-index: 2147483647","pointer-events: none"].join("; "),document.body.appendChild(t),t}function Ti(t){getComputedStyle(t).position==="static"&&(t.style.position="relative");const e=document.createElement("div");return e.setAttribute("data-agentkit-root","floating"),e.style.cssText=["position: absolute","bottom: 24px","right: 24px","z-index: 2147483647","pointer-events: none"].join("; "),t.appendChild(e),e}function bn(t){return t.setAttribute("data-agentkit-root","inline"),getComputedStyle(t).position==="static"&&(t.style.position="relative"),t}function Li(t){t.remove()}function Ri(t){t.removeAttribute("data-agentkit-root")}function dt(t,e,n,r,a){const i=t.mode==="inline";let s=!1;const o=i&&a?bn(a):!i&&a?Ti(a):kn(),c=gn(o);vn(c.styleSlot,r);const d=new pn(t,e,(p,m)=>{s||l.update(p,m)}),l=n(c.mountPoint,t,d.getState(),{onOpen:()=>f.open(),onClose:()=>f.close(),onSendMessage:(p,m)=>{d.sendMessage(p,m)}});d.hydrate(),setTimeout(()=>{s||d.emitter.emit("ready",d.getState())},0);const f={open(){s||(d.setOpen(!0),d.emitter.emit("open"))},close(){s||(d.setOpen(!1),d.emitter.emit("close"))},toggle(){d.getState().isOpen?f.close():f.open()},async sendMessage(p,m){await d.sendMessage(p,m)},reset(){s||(d.reset(),d.emitter.emit("reset"))},destroy(){s||(s=!0,l.destroy(),yn(c.host),i&&a?Ri(a):Li(o),d.emitter.emit("destroy"),d.emitter.removeAllListeners())},on(p,m){d.emitter.on(p,m)},off(p,m){d.emitter.off(p,m)},getState(){return d.getState()}};return f}const he=new Map;let Ai=0;function xn(t){const e=`agentkit-widget-${++Ai}`,n=t.destroy.bind(t);return t.destroy=()=>{he.delete(e),n()},he.set(e,t),e}function Ei(t,e,n){const r={...t,mode:"floating"},a=Pe(r),i=dt(a,r,e,n);return xn(i),i}function Mi(t,e,n,r){const a={...e,mode:"inline"},i=Pe(a),s=dt(i,a,n,r,t);return xn(s),s}function Zi(t){var e;t?(e=he.get(t))==null||e.destroy():(he.forEach(n=>n.destroy()),he.clear())}function Oi(){return Array.from(he.keys())}function _n(t){const{theme:e}=t,n=[`--ak-accent: ${e.accentColor}`,`--ak-font: ${e.fontFamily}`,`--ak-radius: ${e.borderRadius}`];return n.push(`--ak-accent-hover: color-mix(in srgb, ${e.accentColor} 85%, black)`),`:host { ${n.join("; ")} }`}function wn(t){return t!=="system"?t:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const Sn=`
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let Yr=require("preact/compat/client"),O=require("preact/compat"),l=require("preact/jsx-runtime");var I;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{const i={};for(const s of a)i[s]=s;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),s={};for(const o of i)s[o]=a[o];return e.objectValues(s)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&i.push(s);return i},e.find=(a,i)=>{for(const s of a)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(I||(I={}));var Rt;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Rt||(Rt={}));var v=I.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ne=e=>{switch(typeof e){case"undefined":return v.undefined;case"string":return v.string;case"number":return Number.isNaN(e)?v.nan:v.number;case"boolean":return v.boolean;case"function":return v.function;case"bigint":return v.bigint;case"symbol":return v.symbol;case"object":return Array.isArray(e)?v.array:e===null?v.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?v.promise:typeof Map<"u"&&e instanceof Map?v.map:typeof Set<"u"&&e instanceof Set?v.set:typeof Date<"u"&&e instanceof Date?v.date:v.object;default:return v.unknown}},f=I.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"]),G=class Qt extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},n={_errors:[]},a=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(a);else if(s.code==="invalid_return_type")a(s.returnTypeError);else if(s.code==="invalid_arguments")a(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let o=n,c=0;for(;c<s.path.length;){const d=s.path[c];c!==s.path.length-1?o[d]=o[d]||{_errors:[]}:(o[d]=o[d]||{_errors:[]},o[d]._errors.push(r(s))),o=o[d],c++}}};return a(this),n}static assert(t){if(!(t instanceof Qt))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,I.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];r[i]=r[i]||[],r[i].push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};G.create=e=>new G(e);var xe=(e,t)=>{let r;switch(e.code){case f.invalid_type:e.received===v.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case f.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,I.jsonStringifyReplacer)}`;break;case f.unrecognized_keys:r=`Unrecognized key(s) in object: ${I.joinValues(e.keys,", ")}`;break;case f.invalid_union:r="Invalid input";break;case f.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${I.joinValues(e.options)}`;break;case f.invalid_enum_value:r=`Invalid enum value. Expected ${I.joinValues(e.options)}, received '${e.received}'`;break;case f.invalid_arguments:r="Invalid function arguments";break;case f.invalid_return_type:r="Invalid function return type";break;case f.invalid_date:r="Invalid date";break;case f.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:I.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case f.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case f.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case f.custom:r="Invalid input";break;case f.invalid_intersection_types:r="Intersection results could not be merged";break;case f.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case f.not_finite:r="Number must be finite";break;default:r=t.defaultError,I.assertNever(e)}return{message:r}},Hr=xe;function qe(){return Hr}var et=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,i=[...r,...a.path||[]],s={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let o="";const c=n.filter(d=>!!d).slice().reverse();for(const d of c)o=d(s,{data:t,defaultError:o}).message;return{...a,path:i,message:o}};function g(e,t){const r=qe(),n=et({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===xe?void 0:xe].filter(a=>!!a)});e.common.issues.push(n)}var F=class Kt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const a of r){if(a.status==="aborted")return k;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const a of r){const i=await a.key,s=await a.value;n.push({key:i,value:s})}return Kt.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const a of r){const{key:i,value:s}=a;if(i.status==="aborted"||s.status==="aborted")return k;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||a.alwaysSet)&&(n[i.value]=s.value)}return{status:t.value,value:n}}},k=Object.freeze({status:"aborted"}),ye=e=>({status:"dirty",value:e}),V=e=>({status:"valid",value:e}),Et=e=>e.status==="aborted",Mt=e=>e.status==="dirty",ge=e=>e.status==="valid",Re=e=>typeof Promise<"u"&&e instanceof Promise,y;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(y||(y={}));var Y=class{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Ot=(e,t)=>{if(ge(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){return this._error?this._error:(this._error=new G(e.common.issues),this._error)}}};function w(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(s,o)=>{const{message:c}=e;return s.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??n??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:c??r??o.defaultError}},description:a}}var C=class{get description(){return this._def.description}_getType(e){return ne(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ne(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new F,ctx:{common:e.parent.common,data:e.data,parsedType:ne(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Re(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ne(e)};return Ot(r,this._parseSync({data:e,path:r.path,parent:r}))}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ne(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:t});return ge(r)?{value:r.value}:{issues:t.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(r=>ge(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ne(e)},n=this._parse({data:e,path:r.path,parent:r});return Ot(r,await(Re(n)?n:Promise.resolve(n)))}refine(e,t){const r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),s=()=>a.addIssue({code:f.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(o=>o?!0:(s(),!1)):i?!0:(s(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new ee({schema:this,typeName:x.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return q.create(this,this._def)}nullable(){return ce.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ve.create(this)}promise(){return _e.create(this,this._def)}or(e){return Ve.create([this,e],this._def)}and(e){return Pe.create(this,e,this._def)}transform(e){return new ee({...w(this._def),schema:this,typeName:x.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new De({...w(this._def),innerType:this,defaultValue:t,typeName:x.ZodDefault})}brand(){return new ir({typeName:x.ZodBranded,type:this,...w(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Ue({...w(this._def),innerType:this,catchValue:t,typeName:x.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return sr.create(this,e)}readonly(){return $e.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Xr=/^c[^\s-]{8,}$/i,Jr=/^[0-9a-z]+$/,Qr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Kr=/^[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,qr=/^[a-z0-9_-]{21}$/i,en=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,tn=/^[-+]?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)?)??$/,rn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Xe,an=/^(?:(?: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])$/,sn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,on=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,cn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ln=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,qt="((\\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])))",un=new RegExp(`^${qt}$`);function er(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function hn(e){return new RegExp(`^${er(e)}$`)}function fn(e){let t=`${qt}T${er(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function mn(e,t){return!!((t==="v4"||!t)&&an.test(e)||(t==="v6"||!t)&&on.test(e))}function pn(e,t){if(!en.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function gn(e,t){return!!((t==="v4"||!t)&&sn.test(e)||(t==="v6"||!t)&&cn.test(e))}var Ee=class be extends C{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==v.string){const a=this._getOrReturnCtx(t);return g(a,{code:f.invalid_type,expected:v.string,received:a.parsedType}),k}const r=new F;let n;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(n=this._getOrReturnCtx(t,n),g(n,{code:f.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(n=this._getOrReturnCtx(t,n),g(n,{code:f.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const i=t.data.length>a.value,s=t.data.length<a.value;(i||s)&&(n=this._getOrReturnCtx(t,n),i?g(n,{code:f.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&g(n,{code:f.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")rn.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"email",code:f.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")Xe||(Xe=new RegExp(nn,"u")),Xe.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"emoji",code:f.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")Kr.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"uuid",code:f.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")qr.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"nanoid",code:f.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")Xr.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"cuid",code:f.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")Jr.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"cuid2",code:f.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")Qr.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"ulid",code:f.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),g(n,{validation:"url",code:f.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"regex",code:f.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(t,n),g(n,{code:f.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(n=this._getOrReturnCtx(t,n),g(n,{code:f.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(n=this._getOrReturnCtx(t,n),g(n,{code:f.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?fn(a).test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{code:f.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?un.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{code:f.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?hn(a).test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{code:f.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?tn.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"duration",code:f.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?mn(t.data,a.version)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"ip",code:f.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?pn(t.data,a.alg)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"jwt",code:f.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?gn(t.data,a.version)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"cidr",code:f.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?dn.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"base64",code:f.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?ln.test(t.data)||(n=this._getOrReturnCtx(t,n),g(n,{validation:"base64url",code:f.invalid_string,message:a.message}),r.dirty()):I.assertNever(a);return{status:r.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:f.invalid_string,...y.errToObj(n)})}_addCheck(t){return new be({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...y.errToObj(t)})}url(t){return this._addCheck({kind:"url",...y.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...y.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...y.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...y.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...y.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...y.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...y.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...y.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...y.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...y.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...y.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...y.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...y.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...y.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...y.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...y.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...y.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...y.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...y.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...y.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...y.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...y.errToObj(r)})}nonempty(t){return this.min(1,y.errToObj(t))}trim(){return new be({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new be({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new be({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Ee.create=e=>new Ee({checks:[],typeName:x.ZodString,coerce:e?.coerce??!1,...w(e)});function vn(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(t.toFixed(a).replace(".",""))/10**a}var tt=class rt extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==v.number){const a=this._getOrReturnCtx(t);return g(a,{code:f.invalid_type,expected:v.number,received:a.parsedType}),k}let r;const n=new F;for(const a of this._def.checks)a.kind==="int"?I.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),g(r,{code:f.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),g(r,{code:f.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),g(r,{code:f.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?vn(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),g(r,{code:f.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),g(r,{code:f.not_finite,message:a.message}),n.dirty()):I.assertNever(a);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,y.toString(r))}gt(t,r){return this.setLimit("min",t,!1,y.toString(r))}lte(t,r){return this.setLimit("max",t,!0,y.toString(r))}lt(t,r){return this.setLimit("max",t,!1,y.toString(r))}setLimit(t,r,n,a){return new rt({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:y.toString(a)}]})}_addCheck(t){return new rt({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:y.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:y.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:y.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:y.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:y.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:y.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:y.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:y.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:y.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&I.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};tt.create=e=>new tt({checks:[],typeName:x.ZodNumber,coerce:e?.coerce||!1,...w(e)});var nt=class at extends C{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==v.bigint)return this._getInvalidInput(t);let r;const n=new F;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),g(r,{code:f.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),g(r,{code:f.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),g(r,{code:f.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):I.assertNever(a);return{status:n.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return g(r,{code:f.invalid_type,expected:v.bigint,received:r.parsedType}),k}gte(t,r){return this.setLimit("min",t,!0,y.toString(r))}gt(t,r){return this.setLimit("min",t,!1,y.toString(r))}lte(t,r){return this.setLimit("max",t,!0,y.toString(r))}lt(t,r){return this.setLimit("max",t,!1,y.toString(r))}setLimit(t,r,n,a){return new at({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:y.toString(a)}]})}_addCheck(t){return new at({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:y.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:y.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:y.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:y.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:y.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};nt.create=e=>new nt({checks:[],typeName:x.ZodBigInt,coerce:e?.coerce??!1,...w(e)});var it=class extends C{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==v.boolean){const t=this._getOrReturnCtx(e);return g(t,{code:f.invalid_type,expected:v.boolean,received:t.parsedType}),k}return V(e.data)}};it.create=e=>new it({typeName:x.ZodBoolean,coerce:e?.coerce||!1,...w(e)});var st=class tr extends C{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==v.date){const a=this._getOrReturnCtx(t);return g(a,{code:f.invalid_type,expected:v.date,received:a.parsedType}),k}if(Number.isNaN(t.data.getTime()))return g(this._getOrReturnCtx(t),{code:f.invalid_date}),k;const r=new F;let n;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(n=this._getOrReturnCtx(t,n),g(n,{code:f.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(n=this._getOrReturnCtx(t,n),g(n,{code:f.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):I.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new tr({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:y.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:y.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};st.create=e=>new st({checks:[],coerce:e?.coerce||!1,typeName:x.ZodDate,...w(e)});var ot=class extends C{_parse(e){if(this._getType(e)!==v.symbol){const t=this._getOrReturnCtx(e);return g(t,{code:f.invalid_type,expected:v.symbol,received:t.parsedType}),k}return V(e.data)}};ot.create=e=>new ot({typeName:x.ZodSymbol,...w(e)});var Me=class extends C{_parse(e){if(this._getType(e)!==v.undefined){const t=this._getOrReturnCtx(e);return g(t,{code:f.invalid_type,expected:v.undefined,received:t.parsedType}),k}return V(e.data)}};Me.create=e=>new Me({typeName:x.ZodUndefined,...w(e)});var Oe=class extends C{_parse(e){if(this._getType(e)!==v.null){const t=this._getOrReturnCtx(e);return g(t,{code:f.invalid_type,expected:v.null,received:t.parsedType}),k}return V(e.data)}};Oe.create=e=>new Oe({typeName:x.ZodNull,...w(e)});var ct=class extends C{constructor(){super(...arguments),this._any=!0}_parse(e){return V(e.data)}};ct.create=e=>new ct({typeName:x.ZodAny,...w(e)});var me=class extends C{constructor(){super(...arguments),this._unknown=!0}_parse(e){return V(e.data)}};me.create=e=>new me({typeName:x.ZodUnknown,...w(e)});var ae=class extends C{_parse(e){const t=this._getOrReturnCtx(e);return g(t,{code:f.invalid_type,expected:v.never,received:t.parsedType}),k}};ae.create=e=>new ae({typeName:x.ZodNever,...w(e)});var dt=class extends C{_parse(e){if(this._getType(e)!==v.undefined){const t=this._getOrReturnCtx(e);return g(t,{code:f.invalid_type,expected:v.void,received:t.parsedType}),k}return V(e.data)}};dt.create=e=>new dt({typeName:x.ZodVoid,...w(e)});var ve=class Ne extends C{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==v.array)return g(r,{code:f.invalid_type,expected:v.array,received:r.parsedType}),k;if(a.exactLength!==null){const s=r.data.length>a.exactLength.value,o=r.data.length<a.exactLength.value;(s||o)&&(g(r,{code:s?f.too_big:f.too_small,minimum:o?a.exactLength.value:void 0,maximum:s?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(g(r,{code:f.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(g(r,{code:f.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,o)=>a.type._parseAsync(new Y(r,s,r.path,o)))).then(s=>F.mergeArray(n,s));const i=[...r.data].map((s,o)=>a.type._parseSync(new Y(r,s,r.path,o)));return F.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new Ne({...this._def,minLength:{value:t,message:y.toString(r)}})}max(t,r){return new Ne({...this._def,maxLength:{value:t,message:y.toString(r)}})}length(t,r){return new Ne({...this._def,exactLength:{value:t,message:y.toString(r)}})}nonempty(t){return this.min(1,t)}};ve.create=(e,t)=>new ve({type:e,minLength:null,maxLength:null,exactLength:null,typeName:x.ZodArray,...w(t)});function fe(e){if(e instanceof $){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=q.create(fe(n))}return new $({...e._def,shape:()=>t})}else return e instanceof ve?new ve({...e._def,type:fe(e.element)}):e instanceof q?q.create(fe(e.unwrap())):e instanceof ce?ce.create(fe(e.unwrap())):e instanceof oe?oe.create(e.items.map(t=>fe(t))):e}var $=class D extends C{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape();return this._cached={shape:t,keys:I.objectKeys(t)},this._cached}_parse(t){if(this._getType(t)!==v.object){const c=this._getOrReturnCtx(t);return g(c,{code:f.invalid_type,expected:v.object,received:c.parsedType}),k}const{status:r,ctx:n}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),s=[];if(!(this._def.catchall instanceof ae&&this._def.unknownKeys==="strip"))for(const c in n.data)i.includes(c)||s.push(c);const o=[];for(const c of i){const d=a[c],u=n.data[c];o.push({key:{status:"valid",value:c},value:d._parse(new Y(n,u,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof ae){const c=this._def.unknownKeys;if(c==="passthrough")for(const d of s)o.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(c==="strict")s.length>0&&(g(n,{code:f.unrecognized_keys,keys:s}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const d of s){const u=n.data[d];o.push({key:{status:"valid",value:d},value:c._parse(new Y(n,u,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const c=[];for(const d of o){const u=await d.key,h=await d.value;c.push({key:u,value:h,alwaysSet:d.alwaysSet})}return c}).then(c=>F.mergeObjectSync(r,c)):F.mergeObjectSync(r,o)}get shape(){return this._def.shape()}strict(t){return y.errToObj,new D({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{const a=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:y.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new D({...this._def,unknownKeys:"strip"})}passthrough(){return new D({...this._def,unknownKeys:"passthrough"})}extend(t){return new D({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new D({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:x.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new D({...this._def,catchall:t})}pick(t){const r={};for(const n of I.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new D({...this._def,shape:()=>r})}omit(t){const r={};for(const n of I.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new D({...this._def,shape:()=>r})}deepPartial(){return fe(this)}partial(t){const r={};for(const n of I.objectKeys(this.shape)){const a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}return new D({...this._def,shape:()=>r})}required(t){const r={};for(const n of I.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof q;)a=a._def.innerType;r[n]=a}return new D({...this._def,shape:()=>r})}keyof(){return ar(I.objectKeys(this.shape))}};$.create=(e,t)=>new $({shape:()=>e,unknownKeys:"strip",catchall:ae.create(),typeName:x.ZodObject,...w(t)});$.strictCreate=(e,t)=>new $({shape:()=>e,unknownKeys:"strict",catchall:ae.create(),typeName:x.ZodObject,...w(t)});$.lazycreate=(e,t)=>new $({shape:e,unknownKeys:"strip",catchall:ae.create(),typeName:x.ZodObject,...w(t)});var Ve=class extends C{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(const s of a)if(s.result.status==="valid")return s.result;for(const s of a)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;const i=a.map(s=>new G(s.ctx.common.issues));return g(t,{code:f.invalid_union,unionErrors:i}),k}if(t.common.async)return Promise.all(r.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const o of r){const c={...t,common:{...t.common,issues:[]},parent:null},d=o._parseSync({data:t.data,path:t.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const s=i.map(o=>new G(o));return g(t,{code:f.invalid_union,unionErrors:s}),k}}get options(){return this._def.options}};Ve.create=(e,t)=>new Ve({options:e,typeName:x.ZodUnion,...w(t)});var Q=e=>e instanceof Fe?Q(e.schema):e instanceof ee?Q(e.innerType()):e instanceof We?[e.value]:e instanceof Ge?e.options:e instanceof ze?I.objectValues(e.enum):e instanceof De?Q(e._def.innerType):e instanceof Me?[void 0]:e instanceof Oe?[null]:e instanceof q?[void 0,...Q(e.unwrap())]:e instanceof ce?[null,...Q(e.unwrap())]:e instanceof ir||e instanceof $e?Q(e.unwrap()):e instanceof Ue?Q(e._def.innerType):[],yn=class rr extends C{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==v.object)return g(r,{code:f.invalid_type,expected:v.object,received:r.parsedType}),k;const n=this.discriminator,a=r.data[n],i=this.optionsMap.get(a);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(g(r,{code:f.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),k)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const a=new Map;for(const i of r){const s=Q(i.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const o of s){if(a.has(o))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(o)}`);a.set(o,i)}}return new rr({typeName:x.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...w(n)})}};function lt(e,t){const r=ne(e),n=ne(t);if(e===t)return{valid:!0,data:e};if(r===v.object&&n===v.object){const a=I.objectKeys(t),i=I.objectKeys(e).filter(o=>a.indexOf(o)!==-1),s={...e,...t};for(const o of i){const c=lt(e[o],t[o]);if(!c.valid)return{valid:!1};s[o]=c.data}return{valid:!0,data:s}}else if(r===v.array&&n===v.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const s=e[i],o=t[i],c=lt(s,o);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return r===v.date&&n===v.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Pe=class extends C{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(a,i)=>{if(Et(a)||Et(i))return k;const s=lt(a.value,i.value);return s.valid?((Mt(a)||Mt(i))&&t.dirty(),{status:t.value,value:s.data}):(g(r,{code:f.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(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Pe.create=(e,t,r)=>new Pe({left:e,right:t,typeName:x.ZodIntersection,...w(r)});var oe=class nr extends C{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==v.array)return g(n,{code:f.invalid_type,expected:v.array,received:n.parsedType}),k;if(n.data.length<this._def.items.length)return g(n,{code:f.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),k;!this._def.rest&&n.data.length>this._def.items.length&&(g(n,{code:f.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((i,s)=>{const o=this._def.items[s]||this._def.rest;return o?o._parse(new Y(n,i,n.path,s)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>F.mergeArray(r,i)):F.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new nr({...this._def,rest:t})}};oe.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new oe({items:e,typeName:x.ZodTuple,rest:null,...w(t)})};var bn=class ut extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==v.object)return g(n,{code:f.invalid_type,expected:v.object,received:n.parsedType}),k;const a=[],i=this._def.keyType,s=this._def.valueType;for(const o in n.data)a.push({key:i._parse(new Y(n,o,n.path,o)),value:s._parse(new Y(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?F.mergeObjectAsync(r,a):F.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof C?new ut({keyType:t,valueType:r,typeName:x.ZodRecord,...w(n)}):new ut({keyType:Ee.create(),valueType:t,typeName:x.ZodRecord,...w(r)})}},ht=class extends C{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==v.map)return g(r,{code:f.invalid_type,expected:v.map,received:r.parsedType}),k;const n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([s,o],c)=>({key:n._parse(new Y(r,s,r.path,[c,"key"])),value:a._parse(new Y(r,o,r.path,[c,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const o of i){const c=await o.key,d=await o.value;if(c.status==="aborted"||d.status==="aborted")return k;(c.status==="dirty"||d.status==="dirty")&&t.dirty(),s.set(c.value,d.value)}return{status:t.value,value:s}})}else{const s=new Map;for(const o of i){const c=o.key,d=o.value;if(c.status==="aborted"||d.status==="aborted")return k;(c.status==="dirty"||d.status==="dirty")&&t.dirty(),s.set(c.value,d.value)}return{status:t.value,value:s}}}};ht.create=(e,t,r)=>new ht({valueType:t,keyType:e,typeName:x.ZodMap,...w(r)});var ft=class mt extends C{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==v.set)return g(n,{code:f.invalid_type,expected:v.set,received:n.parsedType}),k;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(g(n,{code:f.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(g(n,{code:f.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const i=this._def.valueType;function s(c){const d=new Set;for(const u of c){if(u.status==="aborted")return k;u.status==="dirty"&&r.dirty(),d.add(u.value)}return{status:r.value,value:d}}const o=[...n.data.values()].map((c,d)=>i._parse(new Y(n,c,n.path,d)));return n.common.async?Promise.all(o).then(c=>s(c)):s(o)}min(t,r){return new mt({...this._def,minSize:{value:t,message:y.toString(r)}})}max(t,r){return new mt({...this._def,maxSize:{value:t,message:y.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};ft.create=(e,t)=>new ft({valueType:e,minSize:null,maxSize:null,typeName:x.ZodSet,...w(t)});var kn=class Le extends C{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==v.function)return g(r,{code:f.invalid_type,expected:v.function,received:r.parsedType}),k;function n(o,c){return et({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,qe(),xe].filter(d=>!!d),issueData:{code:f.invalid_arguments,argumentsError:c}})}function a(o,c){return et({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,qe(),xe].filter(d=>!!d),issueData:{code:f.invalid_return_type,returnTypeError:c}})}const i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof _e){const o=this;return V(async function(...c){const d=new G([]),u=await o._def.args.parseAsync(c,i).catch(m=>{throw d.addIssue(n(c,m)),d}),h=await Reflect.apply(s,this,u);return await o._def.returns._def.type.parseAsync(h,i).catch(m=>{throw d.addIssue(a(h,m)),d})})}else{const o=this;return V(function(...c){const d=o._def.args.safeParse(c,i);if(!d.success)throw new G([n(c,d.error)]);const u=Reflect.apply(s,this,d.data),h=o._def.returns.safeParse(u,i);if(!h.success)throw new G([a(u,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Le({...this._def,args:oe.create(t).rest(me.create())})}returns(t){return new Le({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Le({args:t||oe.create([]).rest(me.create()),returns:r||me.create(),typeName:x.ZodFunction,...w(n)})}},Fe=class extends C{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})}};Fe.create=(e,t)=>new Fe({getter:e,typeName:x.ZodLazy,...w(t)});var We=class extends C{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return g(t,{received:t.data,code:f.invalid_literal,expected:this._def.value}),k}return{status:"valid",value:e.data}}get value(){return this._def.value}};We.create=(e,t)=>new We({value:e,typeName:x.ZodLiteral,...w(t)});function ar(e,t){return new Ge({values:e,typeName:x.ZodEnum,...w(t)})}var Ge=class pt extends C{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return g(r,{expected:I.joinValues(n),received:r.parsedType,code:f.invalid_type}),k}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return g(r,{received:r.data,code:f.invalid_enum_value,options:n}),k}return V(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return pt.create(t,{...this._def,...r})}exclude(t,r=this._def){return pt.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Ge.create=ar;var ze=class extends C{_parse(e){const t=I.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==v.string&&r.parsedType!==v.number){const n=I.objectValues(t);return g(r,{expected:I.joinValues(n),received:r.parsedType,code:f.invalid_type}),k}if(this._cache||(this._cache=new Set(I.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=I.objectValues(t);return g(r,{received:r.data,code:f.invalid_enum_value,options:n}),k}return V(e.data)}get enum(){return this._def.values}};ze.create=(e,t)=>new ze({values:e,typeName:x.ZodNativeEnum,...w(t)});var _e=class extends C{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);return t.parsedType!==v.promise&&t.common.async===!1?(g(t,{code:f.invalid_type,expected:v.promise,received:t.parsedType}),k):V((t.parsedType===v.promise?t.data:Promise.resolve(t.data)).then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};_e.create=(e,t)=>new _e({type:e,typeName:x.ZodPromise,...w(t)});var ee=class extends C{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===x.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{g(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async s=>{if(t.value==="aborted")return k;const o=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return o.status==="aborted"?k:o.status==="dirty"||t.value==="dirty"?ye(o.value):o});{if(t.value==="aborted")return k;const s=this._def.schema._parseSync({data:i,path:r.path,parent:r});return s.status==="aborted"?k:s.status==="dirty"||t.value==="dirty"?ye(s.value):s}}if(n.type==="refinement"){const i=s=>{const o=n.refinement(s,a);if(r.common.async)return Promise.resolve(o);if(o instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?k:(s.status==="dirty"&&t.dirty(),i(s.value),{status:t.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?k:(s.status==="dirty"&&t.dirty(),i(s.value).then(()=>({status:t.value,value:s.value}))))}if(n.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ge(i))return k;const s=n.transform(i.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>ge(i)?Promise.resolve(n.transform(i.value,a)).then(s=>({status:t.value,value:s})):k);I.assertNever(n)}};ee.create=(e,t,r)=>new ee({schema:e,typeName:x.ZodEffects,effect:t,...w(r)});ee.createWithPreprocess=(e,t,r)=>new ee({schema:t,effect:{type:"preprocess",transform:e},typeName:x.ZodEffects,...w(r)});var q=class extends C{_parse(e){return this._getType(e)===v.undefined?V(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};q.create=(e,t)=>new q({innerType:e,typeName:x.ZodOptional,...w(t)});var ce=class extends C{_parse(e){return this._getType(e)===v.null?V(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ce.create=(e,t)=>new ce({innerType:e,typeName:x.ZodNullable,...w(t)});var De=class extends C{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===v.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};De.create=(e,t)=>new De({innerType:e,typeName:x.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...w(t)});var Ue=class extends C{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Re(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new G(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new G(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Ue.create=(e,t)=>new Ue({innerType:e,typeName:x.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...w(t)});var gt=class extends C{_parse(e){if(this._getType(e)!==v.nan){const t=this._getOrReturnCtx(e);return g(t,{code:f.invalid_type,expected:v.nan,received:t.parsedType}),k}return{status:"valid",value:e.data}}};gt.create=e=>new gt({typeName:x.ZodNaN,...w(e)});var ir=class extends C{_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}},sr=class or extends C{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?k:i.status==="dirty"?(r.dirty(),ye(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?k:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new or({in:t,out:r,typeName:x.ZodPipeline})}},$e=class extends C{_parse(e){const t=this._def.innerType._parse(e),r=n=>(ge(n)&&(n.value=Object.freeze(n.value)),n);return Re(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}};$e.create=(e,t)=>new $e({innerType:e,typeName:x.ZodReadonly,...w(t)});var hs={object:$.lazycreate},x;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(x||(x={}));var R=Ee.create,fs=tt.create,ms=gt.create,ps=nt.create,xn=it.create,gs=st.create,vs=ot.create,ys=Me.create,bs=Oe.create,ks=ct.create,_n=me.create,xs=ae.create,_s=dt.create,ws=ve.create,cr=$.create,Ss=$.strictCreate,js=Ve.create,Cs=yn.create,Is=Pe.create,Ts=oe.create,wn=bn.create,Ns=ht.create,Ls=ft.create,As=kn.create,Zs=Fe.create,Rs=We.create,dr=Ge.create,Es=ze.create,Ms=_e.create,Os=ee.create,Vs=q.create,Ps=ce.create,Fs=ee.createWithPreprocess,Ws=sr.create,Sn=cr({mode:dr(["light","dark","system"]).optional(),accentColor:R().optional(),fontFamily:R().optional(),borderRadius:R().optional()}),lr=cr({agentId:R().min(1,"agentId is required"),apiBaseUrl:R().url("apiBaseUrl must be a valid URL"),tenantId:R().optional(),userId:R().optional(),name:R().optional(),email:R().optional(),authUserId:R().optional(),sessionId:R().optional(),mode:dr(["floating","inline"]).optional(),title:R().optional(),subtitle:R().optional(),greeting:R().optional(),avatarUrl:R().optional(),privacyPolicyUrl:R().optional(),streaming:xn().optional(),metadata:wn(_n()).optional(),theme:Sn.optional()}),jn=lr.omit({agentId:!0,apiBaseUrl:!0}).partial(),se={mode:"floating",streaming:!0,title:"AI Assistant",theme:{mode:"light",accentColor:"#6366f1",fontFamily:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",borderRadius:"12px"}};function Ye(e,t){lr.parse(e);let r;const n=t?{...t}:void 0;n&&typeof n.theme=="object"&&n.theme!==null?(r=n.theme,delete n.theme):n&&typeof n.theme=="string"&&(r={mode:n.theme},delete n.theme);const a=n?jn.passthrough().safeParse(n).data:void 0,i=a?ur(a,e):e,s={mode:i.theme?.mode??r?.mode??se.theme.mode,accentColor:i.theme?.accentColor??r?.accentColor??se.theme.accentColor,fontFamily:i.theme?.fontFamily??r?.fontFamily??se.theme.fontFamily,borderRadius:i.theme?.borderRadius??r?.borderRadius??se.theme.borderRadius};return{agentId:i.agentId,apiBaseUrl:i.apiBaseUrl.replace(/\/$/,""),tenantId:i.tenantId,userId:i.userId,name:i.name,email:i.email,authUserId:i.authUserId,sessionId:i.sessionId,mode:i.mode??se.mode,title:i.title??se.title,subtitle:i.subtitle,greeting:i.greeting,avatarUrl:i.avatarUrl,privacyPolicyUrl:i.privacyPolicyUrl,streaming:i.streaming??se.streaming,metadata:i.metadata??{},theme:s,thinkingEnabled:a?.thinkingEnabled===!0,thinkingViewable:a?.thinkingViewable===!0}}function ur(e,t){const r={...e};for(const n of Object.keys(t)){const a=t[n];a!=null&&(typeof a=="object"&&!Array.isArray(a)&&r[n]!==null&&typeof r[n]=="object"?r[n]=ur(r[n],a):r[n]=a)}return r}var vt=function(){return vt=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},vt.apply(this,arguments)};function H(e,t,r,n){function a(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function o(u){try{d(n.next(u))}catch(h){s(h)}}function c(u){try{d(n.throw(u))}catch(h){s(h)}}function d(u){u.done?i(u.value):a(u.value).then(o,c)}d((n=n.apply(e,t||[])).next())})}function X(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(d){return function(u){return c([d,u])}}function c(d){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,d[0]&&(r=0)),r;)try{if(n=1,a&&(i=d[0]&2?a.return:d[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,d[1])).done)return i;switch(a=0,i&&(d=[d[0]&2,i.value]),d[0]){case 0:case 1:i=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,a=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!i||d[1]>i[0]&&d[1]<i[3])){r.label=d[1];break}if(d[0]===6&&r.label<i[1]){r.label=i[1],i=d;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(d);break}i[2]&&r.ops.pop(),r.trys.pop();continue}d=t.call(e,r)}catch(u){d=[6,u],a=0}finally{n=i=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function hr(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,i;n<a;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var fr="4.6.2";function Be(e,t){return new Promise(function(r){return setTimeout(r,e,t)})}function Cn(){return new Promise(function(e){var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(null)})}function In(e,t){t===void 0&&(t=1/0);var r=window.requestIdleCallback;return r?new Promise(function(n){return r.call(window,function(){return n()},{timeout:t})}):Be(Math.min(e,t))}function mr(e){return!!e&&typeof e.then=="function"}function Vt(e,t){try{var r=e();mr(r)?r.then(function(n){return t(!0,n)},function(n){return t(!1,n)}):t(!0,r)}catch(n){t(!1,n)}}function Pt(e,t,r){return r===void 0&&(r=16),H(this,void 0,void 0,function(){var n,a,i,s;return X(this,function(o){switch(o.label){case 0:n=Array(e.length),a=Date.now(),i=0,o.label=1;case 1:return i<e.length?(n[i]=t(e[i],i),s=Date.now(),s>=a+r?(a=s,[4,Cn()]):[3,3]):[3,4];case 2:o.sent(),o.label=3;case 3:return++i,[3,1];case 4:return[2,n]}})})}function we(e){return e.then(void 0,function(){}),e}function Tn(e,t){for(var r=0,n=e.length;r<n;++r)if(e[r]===t)return!0;return!1}function Nn(e,t){return!Tn(e,t)}function St(e){return parseInt(e)}function U(e){return parseFloat(e)}function K(e,t){return typeof e=="number"&&isNaN(e)?t:e}function M(e){return e.reduce(function(t,r){return t+(r?1:0)},0)}function pr(e,t){if(t===void 0&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var r=1/t;return Math.round(e*r)/r}function Ln(e){for(var t,r,n="Unexpected syntax '".concat(e,"'"),a=/^\s*([a-z-]*)(.*)$/i.exec(e),i=a[1]||void 0,s={},o=/([.:#][\w-]+|\[.+?\])/gi,c=function(m,p){s[m]=s[m]||[],s[m].push(p)};;){var d=o.exec(a[2]);if(!d)break;var u=d[0];switch(u[0]){case".":c("class",u.slice(1));break;case"#":c("id",u.slice(1));break;case"[":var h=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(h)c(h[1],(r=(t=h[4])!==null&&t!==void 0?t:h[5])!==null&&r!==void 0?r:"");else throw new Error(n);break;default:throw new Error(n)}}return[i,s]}function An(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n>127)return new TextEncoder().encode(e);t[r]=n}return t}function re(e,t){var r=e[0]>>>16,n=e[0]&65535,a=e[1]>>>16,i=e[1]&65535,s=t[0]>>>16,o=t[0]&65535,c=t[1]>>>16,d=t[1]&65535,u=0,h=0,m=0,p=0;p+=i+d,m+=p>>>16,p&=65535,m+=a+c,h+=m>>>16,m&=65535,h+=n+o,u+=h>>>16,h&=65535,u+=r+s,u&=65535,e[0]=u<<16|h,e[1]=m<<16|p}function W(e,t){var r=e[0]>>>16,n=e[0]&65535,a=e[1]>>>16,i=e[1]&65535,s=t[0]>>>16,o=t[0]&65535,c=t[1]>>>16,d=t[1]&65535,u=0,h=0,m=0,p=0;p+=i*d,m+=p>>>16,p&=65535,m+=a*d,h+=m>>>16,m&=65535,m+=i*c,h+=m>>>16,m&=65535,h+=n*d,u+=h>>>16,h&=65535,h+=a*c,u+=h>>>16,h&=65535,h+=i*o,u+=h>>>16,h&=65535,u+=r*d+n*c+a*o+i*s,u&=65535,e[0]=u<<16|h,e[1]=m<<16|p}function le(e,t){var r=e[0];t%=64,t===32?(e[0]=e[1],e[1]=r):t<32?(e[0]=r<<t|e[1]>>>32-t,e[1]=e[1]<<t|r>>>32-t):(t-=32,e[0]=e[1]<<t|r>>>32-t,e[1]=r<<t|e[1]>>>32-t)}function P(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function A(e,t){e[0]^=t[0],e[1]^=t[1]}var Zn=[4283543511,3981806797],Rn=[3301882366,444984403];function Ft(e){var t=[0,e[0]>>>1];A(e,t),W(e,Zn),t[1]=e[0]>>>1,A(e,t),W(e,Rn),t[1]=e[0]>>>1,A(e,t)}var Ie=[2277735313,289559509],Te=[1291169091,658871167],Wt=[0,5],En=[0,1390208809],Mn=[0,944331445];function On(e,t){var r=An(e);t=t||0;var n=[0,r.length],a=n[1]%16,i=n[1]-a,s=[0,t],o=[0,t],c=[0,0],d=[0,0],u;for(u=0;u<i;u=u+16)c[0]=r[u+4]|r[u+5]<<8|r[u+6]<<16|r[u+7]<<24,c[1]=r[u]|r[u+1]<<8|r[u+2]<<16|r[u+3]<<24,d[0]=r[u+12]|r[u+13]<<8|r[u+14]<<16|r[u+15]<<24,d[1]=r[u+8]|r[u+9]<<8|r[u+10]<<16|r[u+11]<<24,W(c,Ie),le(c,31),W(c,Te),A(s,c),le(s,27),re(s,o),W(s,Wt),re(s,En),W(d,Te),le(d,33),W(d,Ie),A(o,d),le(o,31),re(o,s),W(o,Wt),re(o,Mn);c[0]=0,c[1]=0,d[0]=0,d[1]=0;var h=[0,0];switch(a){case 15:h[1]=r[u+14],P(h,48),A(d,h);case 14:h[1]=r[u+13],P(h,40),A(d,h);case 13:h[1]=r[u+12],P(h,32),A(d,h);case 12:h[1]=r[u+11],P(h,24),A(d,h);case 11:h[1]=r[u+10],P(h,16),A(d,h);case 10:h[1]=r[u+9],P(h,8),A(d,h);case 9:h[1]=r[u+8],A(d,h),W(d,Te),le(d,33),W(d,Ie),A(o,d);case 8:h[1]=r[u+7],P(h,56),A(c,h);case 7:h[1]=r[u+6],P(h,48),A(c,h);case 6:h[1]=r[u+5],P(h,40),A(c,h);case 5:h[1]=r[u+4],P(h,32),A(c,h);case 4:h[1]=r[u+3],P(h,24),A(c,h);case 3:h[1]=r[u+2],P(h,16),A(c,h);case 2:h[1]=r[u+1],P(h,8),A(c,h);case 1:h[1]=r[u],A(c,h),W(c,Ie),le(c,31),W(c,Te),A(s,c)}return A(s,n),A(o,n),re(s,o),re(o,s),Ft(s),Ft(o),re(s,o),re(o,s),("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)}function Vn(e){var t;return vt({name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
|
|
2
|
+
`)},e)}function Pn(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function Fn(e){return typeof e!="function"}function Wn(e,t){var r=we(new Promise(function(n){var a=Date.now();Vt(e.bind(null,t),function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];var o=Date.now()-a;if(!i[0])return n(function(){return{error:i[1],duration:o}});var c=i[1];if(Fn(c))return n(function(){return{value:c,duration:o}});n(function(){return new Promise(function(d){var u=Date.now();Vt(c,function(){for(var h=[],m=0;m<arguments.length;m++)h[m]=arguments[m];var p=o+Date.now()-u;if(!h[0])return d({error:h[1],duration:p});d({value:h[1],duration:p})})})})})}));return function(){return r.then(function(a){return a()})}}function zn(e,t,r,n){var a=Object.keys(e).filter(function(s){return Nn(r,s)}),i=we(Pt(a,function(s){return Wn(e[s],t)},n));return function(){return H(this,void 0,void 0,function(){var o,c,d,u,h;return X(this,function(m){switch(m.label){case 0:return[4,i];case 1:return o=m.sent(),[4,Pt(o,function(p){return we(p())},n)];case 2:return c=m.sent(),[4,Promise.all(c)];case 3:for(d=m.sent(),u={},h=0;h<a.length;++h)u[a[h]]=d[h];return[2,u]}})})}}function gr(){var e=window,t=navigator;return M(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Dn(){var e=window,t=navigator;return M(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!gr()}function Se(){var e=window,t=navigator;return M(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function B(){var e=window,t=navigator;return M(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function jt(){var e=window,t=e.HTMLElement,r=e.Document;return M(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),r&&"pointerLockElement"in r.prototype])>=4}function je(){var e=window;return Pn(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function vr(){var e,t,r=window;return M(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in r,"mozInnerScreenX"in r,"CSSMozDocumentRule"in r,"CanvasCaptureMediaStream"in r])>=4}function Un(){var e=window;return M([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function $n(){var e=window,t=e.URLPattern;return M(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function Bn(){var e=window;return M(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function Ce(){var e=window,t=navigator,r=e.CSS,n=e.HTMLButtonElement;return M([!("getStorageUpdates"in t),n&&"popover"in n.prototype,"CSSCounterStyleRule"in e,r.supports("font-size-adjust: ex-height 0.5"),r.supports("text-transform: full-width")])>=4}function Gn(){if(navigator.platform==="iPad")return!0;var e=screen,t=e.width/e.height;return M(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function Yn(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function Hn(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Ct(){var e=Se(),t=vr(),r=window,n=navigator,a="connection";return e?M([!("SharedWorker"in r),n[a]&&"ontypechange"in n[a],!("sinkId"in new Audio)])>=2:t?M(["onorientationchange"in r,"orientation"in r,/android/i.test(n.appVersion)])>=2:!1}function Xn(){var e=navigator,t=window,r=Audio.prototype,n=t.visualViewport;return M(["srLatency"in r,"srChannelCount"in r,"devicePosture"in e,n&&"segments"in n,"getTextInformation"in Image.prototype])>=3}function Jn(){return qn()?-4:Qn()}function Qn(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(Kn())return-1;var r=4500,n=new t(1,5e3,44100),a=n.createOscillator();a.type="triangle",a.frequency.value=1e4;var i=n.createDynamicsCompressor();i.threshold.value=-50,i.knee.value=40,i.ratio.value=12,i.attack.value=0,i.release.value=.25,a.connect(i),i.connect(n.destination),a.start(0);var s=ea(n),o=s[0],c=s[1],d=we(o.then(function(u){return ta(u.getChannelData(0).subarray(r))},function(u){if(u.name==="timeout"||u.name==="suspended")return-3;throw u}));return function(){return c(),d}}function Kn(){return B()&&!jt()&&!Bn()}function qn(){return B()&&Ce()&&je()||Se()&&Xn()&&$n()}function ea(e){var t=3,r=500,n=500,a=5e3,i=function(){};return[new Promise(function(s,o){var c=!1,d=0,u=0;e.oncomplete=function(p){return s(p.renderedBuffer)};var h=function(){setTimeout(function(){return o(zt("timeout"))},Math.min(n,u+a-Date.now()))},m=function(){try{var p=e.startRendering();switch(mr(p)&&we(p),e.state){case"running":u=Date.now(),c&&h();break;case"suspended":document.hidden||d++,c&&d>=t?o(zt("suspended")):setTimeout(m,r);break}}catch(j){o(j)}};m(),i=function(){c||(c=!0,u>0&&h())}}),i]}function ta(e){for(var t=0,r=0;r<e.length;++r)t+=Math.abs(e[r]);return t}function zt(e){var t=new Error(e);return t.name=e,t}function yr(e,t,r){var n,a,i;return r===void 0&&(r=50),H(this,void 0,void 0,function(){var s,o;return X(this,function(c){switch(c.label){case 0:s=document,c.label=1;case 1:return s.body?[3,3]:[4,Be(r)];case 2:return c.sent(),[3,1];case 3:o=s.createElement("iframe"),c.label=4;case 4:return c.trys.push([4,,10,11]),[4,new Promise(function(d,u){var h=!1,m=function(){h=!0,d()},p=function(Z){h=!0,u(Z)};o.onload=m,o.onerror=p;var j=o.style;j.setProperty("display","block","important"),j.position="absolute",j.top="0",j.left="0",j.visibility="hidden",t&&"srcdoc"in o?o.srcdoc=t:o.src="about:blank",s.body.appendChild(o);var b=function(){var Z,S;h||(((S=(Z=o.contentWindow)===null||Z===void 0?void 0:Z.document)===null||S===void 0?void 0:S.readyState)==="complete"?m():setTimeout(b,10))};b()})];case 5:c.sent(),c.label=6;case 6:return!((a=(n=o.contentWindow)===null||n===void 0?void 0:n.document)===null||a===void 0)&&a.body?[3,8]:[4,Be(r)];case 7:return c.sent(),[3,6];case 8:return[4,e(o,o.contentWindow)];case 9:return[2,c.sent()];case 10:return(i=o.parentNode)===null||i===void 0||i.removeChild(o),[7];case 11:return[2]}})})}function ra(e){for(var t=Ln(e),r=t[0],n=t[1],a=document.createElement(r??"div"),i=0,s=Object.keys(n);i<s.length;i++){var o=s[i],c=n[o].join(" ");o==="style"?na(a.style,c):a.setAttribute(o,c)}return a}function na(e,t){for(var r=0,n=t.split(";");r<n.length;r++){var a=n[r],i=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(a);if(i){var s=i[1],o=i[2],c=i[4];e.setProperty(s,o,c||"")}}}function aa(){for(var e=window;;){var t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(r){if(r instanceof Error&&r.name==="SecurityError")return!0;throw r}e=t}}var ia="mmMwWLliI0O&1",sa="48px",ue=["monospace","sans-serif","serif"],Dt=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function oa(){var e=this;return yr(function(t,r){var n=r.document;return H(e,void 0,void 0,function(){var a,i,s,o,c,d,u,h,m,p,j,b;return X(this,function(Z){for(a=n.body,a.style.fontSize=sa,i=n.createElement("div"),i.style.setProperty("visibility","hidden","important"),s={},o={},c=function(S){var _=n.createElement("span"),L=_.style;return L.position="absolute",L.top="0",L.left="0",L.fontFamily=S,_.textContent=ia,i.appendChild(_),_},d=function(S,_){return c("'".concat(S,"',").concat(_))},u=function(){return ue.map(c)},h=function(){for(var S={},_=function(te){S[te]=ue.map(function(de){return d(te,de)})},L=0,J=Dt;L<J.length;L++){var ie=J[L];_(ie)}return S},m=function(S){return ue.some(function(_,L){return S[L].offsetWidth!==s[_]||S[L].offsetHeight!==o[_]})},p=u(),j=h(),a.appendChild(i),b=0;b<ue.length;b++)s[ue[b]]=p[b].offsetWidth,o[ue[b]]=p[b].offsetHeight;return[2,Dt.filter(function(S){return m(j[S])})]})})})}function ca(){var e=navigator.plugins;if(e){for(var t=[],r=0;r<e.length;++r){var n=e[r];if(n){for(var a=[],i=0;i<n.length;++i){var s=n[i];a.push({type:s.type,suffixes:s.suffixes})}t.push({name:n.name,description:n.description,mimeTypes:a})}}return t}}function da(){return la(va())}function la(e){var t,r=!1,n,a,i=ua(),s=i[0],o=i[1];return ha(s,o)?(r=fa(o),e?n=a="skipped":(t=ma(s,o),n=t[0],a=t[1])):n=a="unsupported",{winding:r,geometry:n,text:a}}function ua(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function ha(e,t){return!!(t&&e.toDataURL)}function fa(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function ma(e,t){pa(e,t);var r=Je(e);return r!==Je(e)?["unstable","unstable"]:(ga(e,t),[Je(e),r])}function pa(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var r="Cwm fjordbank gly ".concat("😃");t.fillText(r,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(r,4,45)}function ga(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var r=0,n=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];r<n.length;r++){var a=n[r],i=a[0],s=a[1],o=a[2];t.fillStyle=i,t.beginPath(),t.arc(s,o,40,0,Math.PI*2,!0),t.closePath(),t.fill()}t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function Je(e){return e.toDataURL()}function va(){return B()&&Ce()&&je()}function ya(){var e=navigator,t=0,r;e.maxTouchPoints!==void 0?t=St(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),r=!0}catch{r=!1}var n="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:r,touchStart:n}}function ba(){return navigator.oscpu}function ka(){var e=navigator,t=[],r=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(r!==void 0&&t.push([r]),Array.isArray(e.languages))Se()&&Un()||t.push(e.languages);else if(typeof e.languages=="string"){var n=e.languages;n&&t.push(n.split(","))}return t}function xa(){return window.screen.colorDepth}function _a(){return K(U(navigator.deviceMemory),void 0)}function wa(){if(!(B()&&Ce()&&je()))return Sa()}function Sa(){var e=screen,t=function(n){return K(St(n),null)},r=[t(e.width),t(e.height)];return r.sort().reverse(),r}var ja=2500,Ca=10,Ae,Qe;function Ia(){if(Qe===void 0){var e=function(){var t=yt();bt(t)?Qe=setTimeout(e,ja):(Ae=t,Qe=void 0)};e()}}function Ta(){var e=this;return Ia(),function(){return H(e,void 0,void 0,function(){var t;return X(this,function(r){switch(r.label){case 0:return t=yt(),bt(t)?Ae?[2,hr([],Ae,!0)]:Yn()?[4,Hn()]:[3,2]:[3,2];case 1:r.sent(),t=yt(),r.label=2;case 2:return bt(t)||(Ae=t),[2,t]}})})}}function Na(){var e=this;if(B()&&Ce()&&je())return function(){return Promise.resolve(void 0)};var t=Ta();return function(){return H(e,void 0,void 0,function(){var r,n;return X(this,function(a){switch(a.label){case 0:return[4,t()];case 1:return r=a.sent(),n=function(i){return i===null?null:pr(i,Ca)},[2,[n(r[0]),n(r[1]),n(r[2]),n(r[3])]]}})})}}function yt(){var e=screen;return[K(U(e.availTop),null),K(U(e.width)-U(e.availWidth)-K(U(e.availLeft),0),null),K(U(e.height)-U(e.availHeight)-K(U(e.availTop),0),null),K(U(e.availLeft),null)]}function bt(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function La(){return K(St(navigator.hardwareConcurrency),void 0)}function Aa(){var e,t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){var r=new t().resolvedOptions().timeZone;if(r)return r}var n=-Za();return"UTC".concat(n>=0?"+":"").concat(n)}function Za(){var e=new Date().getFullYear();return Math.max(U(new Date(e,0,1).getTimezoneOffset()),U(new Date(e,6,1).getTimezoneOffset()))}function Ra(){try{return!!window.sessionStorage}catch{return!0}}function Ea(){try{return!!window.localStorage}catch{return!0}}function Ma(){if(!(gr()||Dn()))try{return!!window.indexedDB}catch{return!0}}function Oa(){return!!window.openDatabase}function Va(){return navigator.cpuClass}function Pa(){var e=navigator.platform;return e==="MacIntel"&&B()&&!jt()?Gn()?"iPad":"iPhone":e}function Fa(){return navigator.vendor||""}function Wa(){for(var e=[],t=0,r=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<r.length;t++){var n=r[t],a=window[n];a&&typeof a=="object"&&e.push(n)}return e.sort()}function za(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function Da(){var e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}function Ua(e){var t=(e===void 0?{}:e).debug;return H(this,void 0,void 0,function(){var r,n,a,i,s,o;return X(this,function(c){switch(c.label){case 0:return $a()?(r=Da(),n=Object.keys(r),a=(o=[]).concat.apply(o,n.map(function(d){return r[d]})),[4,Ba(a)]):[2,void 0];case 1:return i=c.sent(),t&&Ga(r,i),s=n.filter(function(d){var u=r[d];return M(u.map(function(h){return i[h]}))>u.length*.6}),s.sort(),[2,s]}})})}function $a(){return B()||Ct()}function Ba(e){var t;return H(this,void 0,void 0,function(){var r,n,a,i,c,s,o,c;return X(this,function(d){switch(d.label){case 0:for(r=document,n=r.createElement("div"),a=new Array(e.length),i={},Ut(n),c=0;c<e.length;++c)s=ra(e[c]),s.tagName==="DIALOG"&&s.show(),o=r.createElement("div"),Ut(o),o.appendChild(s),n.appendChild(o),a[c]=s;d.label=1;case 1:return r.body?[3,3]:[4,Be(50)];case 2:return d.sent(),[3,1];case 3:r.body.appendChild(n);try{for(c=0;c<e.length;++c)a[c].offsetParent||(i[e[c]]=!0)}finally{(t=n.parentNode)===null||t===void 0||t.removeChild(n)}return[2,i]}})})}function Ut(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Ga(e,t){for(var r="DOM blockers debug:\n```",n=0,a=Object.keys(e);n<a.length;n++){var i=a[n];r+=`
|
|
3
|
+
`.concat(i,":");for(var s=0,o=e[i];s<o.length;s++){var c=o[s];r+=`
|
|
4
|
+
`.concat(t[c]?"🚫":"➡️"," ").concat(c)}}}function Ya(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var r=t[e];if(matchMedia("(color-gamut: ".concat(r,")")).matches)return r}}function Ha(){if($t("inverted"))return!0;if($t("none"))return!1}function $t(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function Xa(){if(Bt("active"))return!0;if(Bt("none"))return!1}function Bt(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}var Ja=100;function Qa(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=Ja;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}}function Ka(){if(he("no-preference"))return 0;if(he("high")||he("more"))return 1;if(he("low")||he("less"))return-1;if(he("forced"))return 10}function he(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function qa(){if(Gt("reduce"))return!0;if(Gt("no-preference"))return!1}function Gt(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function ei(){if(Yt("reduce"))return!0;if(Yt("no-preference"))return!1}function Yt(e){return matchMedia("(prefers-reduced-transparency: ".concat(e,")")).matches}function ti(){if(Ht("high"))return!0;if(Ht("standard"))return!1}function Ht(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var T=Math,E=function(){return 0};function ri(){var e=T.acos||E,t=T.acosh||E,r=T.asin||E,n=T.asinh||E,a=T.atanh||E,i=T.atan||E,s=T.sin||E,o=T.sinh||E,c=T.cos||E,d=T.cosh||E,u=T.tan||E,h=T.tanh||E,m=T.exp||E,p=T.expm1||E,j=T.log1p||E,b=function(N){return T.pow(T.PI,N)},Z=function(N){return T.log(N+T.sqrt(N*N-1))},S=function(N){return T.log(N+T.sqrt(N*N+1))},_=function(N){return T.log((1+N)/(1-N))/2},L=function(N){return T.exp(N)-1/T.exp(N)/2},J=function(N){return(T.exp(N)+1/T.exp(N))/2},ie=function(N){return T.exp(N)-1},te=function(N){return(T.exp(2*N)-1)/(T.exp(2*N)+1)},de=function(N){return T.log(1+N)};return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:Z(1e154),asin:r(.12312423423423424),asinh:n(1),asinhPf:S(1),atanh:a(.5),atanhPf:_(.5),atan:i(.5),sin:s(-1e300),sinh:o(1),sinhPf:L(1),cos:c(10.000000000123),cosh:d(1),coshPf:J(1),tan:u(-1e300),tanh:h(1),tanhPf:te(1),exp:m(1),expm1:p(1),expm1Pf:ie(1),log1p:j(10),log1pPf:de(10),powPI:b(-100)}}var ni="mmMwWLliI0fiflO&1",Ke={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function ai(){return ii(function(e,t){for(var r={},n={},a=0,i=Object.keys(Ke);a<i.length;a++){var s=i[a],o=Ke[s],c=o[0],d=c===void 0?{}:c,u=o[1],h=u===void 0?ni:u,m=e.createElement("span");m.textContent=h,m.style.whiteSpace="nowrap";for(var p=0,j=Object.keys(d);p<j.length;p++){var b=j[p],Z=d[b];Z!==void 0&&(m.style[b]=Z)}r[s]=m,t.append(e.createElement("br"),m)}for(var S=0,_=Object.keys(Ke);S<_.length;S++){var s=_[S];n[s]=r[s].getBoundingClientRect().width}return n})}function ii(e,t){return t===void 0&&(t=4e3),yr(function(r,n){var a=n.document,i=a.body,s=i.style;s.width="".concat(t,"px"),s.webkitTextSizeAdjust=s.textSizeAdjust="none",Se()?i.style.zoom="".concat(1/n.devicePixelRatio):B()&&(i.style.zoom="reset");var o=a.createElement("div");return o.textContent=hr([],Array(t/20<<0),!0).map(function(){return"word"}).join(" "),i.appendChild(o),e(a,i)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function si(){return navigator.pdfViewerEnabled}function oi(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function ci(){var e=window.ApplePaySession;if(typeof e?.canMakePayments!="function")return-1;if(di())return-3;try{return e.canMakePayments()?1:0}catch(t){return li(t)}}var di=aa;function li(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function ui(){var e,t=document.createElement("a"),r=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return r===void 0?void 0:String(r)}var br=-1,kr=-2,hi=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),fi=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),mi=["FRAGMENT_SHADER","VERTEX_SHADER"],pi=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],xr="WEBGL_debug_renderer_info",gi="WEBGL_polygon_mode";function vi(e){var t,r,n,a,i,s,o=e.cache,c=_r(o);if(!c)return br;if(!Sr(c))return kr;var d=wr()?null:c.getExtension(xr);return{version:((t=c.getParameter(c.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((r=c.getParameter(c.VENDOR))===null||r===void 0?void 0:r.toString())||"",vendorUnmasked:d?(n=c.getParameter(d.UNMASKED_VENDOR_WEBGL))===null||n===void 0?void 0:n.toString():"",renderer:((a=c.getParameter(c.RENDERER))===null||a===void 0?void 0:a.toString())||"",rendererUnmasked:d?(i=c.getParameter(d.UNMASKED_RENDERER_WEBGL))===null||i===void 0?void 0:i.toString():"",shadingLanguageVersion:((s=c.getParameter(c.SHADING_LANGUAGE_VERSION))===null||s===void 0?void 0:s.toString())||""}}function yi(e){var t=e.cache,r=_r(t);if(!r)return br;if(!Sr(r))return kr;var n=r.getSupportedExtensions(),a=r.getContextAttributes(),i=[],s=[],o=[],c=[],d=[];if(a)for(var u=0,h=Object.keys(a);u<h.length;u++){var m=h[u];s.push("".concat(m,"=").concat(a[m]))}for(var p=Xt(r),j=0,b=p;j<b.length;j++){var Z=b[j],S=r[Z];o.push("".concat(Z,"=").concat(S).concat(hi.has(S)?"=".concat(r.getParameter(S)):""))}if(n)for(var _=0,L=n;_<L.length;_++){var J=L[_];if(!(J===xr&&wr()||J===gi&&xi())){var ie=r.getExtension(J);if(!ie){i.push(J);continue}for(var te=0,de=Xt(ie);te<de.length;te++){var Z=de[te],S=ie[Z];c.push("".concat(Z,"=").concat(S).concat(fi.has(S)?"=".concat(r.getParameter(S)):""))}}}for(var N=0,Nt=mi;N<Nt.length;N++)for(var Lt=Nt[N],He=0,At=pi;He<At.length;He++){var Zt=At[He],Gr=bi(r,Lt,Zt);d.push("".concat(Lt,".").concat(Zt,"=").concat(Gr.join(",")))}return c.sort(),o.sort(),{contextAttributes:s,parameters:o,shaderPrecisions:d,extensions:n,extensionParameters:c,unsupportedExtensions:i}}function _r(e){if(e.webgl)return e.webgl.context;var t=document.createElement("canvas"),r;t.addEventListener("webglCreateContextError",function(){r=void 0});for(var n=0,a=["webgl","experimental-webgl"];n<a.length;n++){var i=a[n];try{r=t.getContext(i)}catch{}if(r)break}return e.webgl={context:r},r}function bi(e,t,r){var n=e.getShaderPrecisionFormat(e[t],e[r]);return n?[n.rangeMin,n.rangeMax,n.precision]:[]}function Xt(e){return Object.keys(e.__proto__).filter(ki)}function ki(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function wr(){return vr()}function xi(){return Se()||B()}function Sr(e){return typeof e.getParameter=="function"}function _i(){if(!(Ct()||B()))return-2;if(!window.AudioContext)return-1;var e=new AudioContext().baseLatency;return e==null?-1:isFinite(e)?e:-3}function wi(){if(!window.Intl)return-1;var e=window.Intl.DateTimeFormat;if(!e)return-2;var t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}var Si={fonts:oa,domBlockers:Ua,fontPreferences:ai,audio:Jn,screenFrame:Na,canvas:da,osCpu:ba,languages:ka,colorDepth:xa,deviceMemory:_a,screenResolution:wa,hardwareConcurrency:La,timezone:Aa,sessionStorage:Ra,localStorage:Ea,indexedDB:Ma,openDatabase:Oa,cpuClass:Va,platform:Pa,plugins:ca,touchSupport:ya,vendor:Fa,vendorFlavors:Wa,cookiesEnabled:za,colorGamut:Ya,invertedColors:Ha,forcedColors:Xa,monochrome:Qa,contrast:Ka,reducedMotion:qa,reducedTransparency:ei,hdr:ti,math:ri,pdfViewerEnabled:si,architecture:oi,applePay:ci,privateClickMeasurement:ui,audioBaseLatency:_i,dateTimeLocale:wi,webGlBasics:vi,webGlExtensions:yi};function ji(e){return zn(Si,e,[])}var Ci="$ if upgrade to Pro: https://fpjs.dev/pro";function Ii(e){var t=Ti(e),r=Ni(t);return{score:t,comment:Ci.replace(/\$/g,"".concat(r))}}function Ti(e){if(Ct())return .4;if(B())return jt()&&!(Ce()&&je())?.5:.3;var t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function Ni(e){return pr(.99+.01*e,1e-4)}function Li(e){for(var t="",r=0,n=Object.keys(e).sort();r<n.length;r++){var a=n[r],i=e[a],s="error"in i?"error":JSON.stringify(i.value);t+="".concat(t?"|":"").concat(a.replace(/([:|\\])/g,"\\$1"),":").concat(s)}return t}function Ai(e){return JSON.stringify(e,function(t,r){return r instanceof Error?Vn(r):r},2)}function jr(e){return On(Li(e))}function Zi(e){var t;return{get visitorId(){return t===void 0&&(t=jr(this.components)),t},set visitorId(r){t=r},confidence:Ii(e),components:e,version:fr}}function Ri(e){return e===void 0&&(e=50),In(e,e*2)}function Ei(e,t){var r=Date.now();return{get:function(n){return H(this,void 0,void 0,function(){var a,i,s;return X(this,function(o){switch(o.label){case 0:return a=Date.now(),[4,e()];case 1:return i=o.sent(),s=Zi(i),t||n?.debug,[2,s]}})})}}}function Mi(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(fr,"/npm-monitoring"),!0),e.send()}catch{}}function Oi(e){var t;return e===void 0&&(e={}),H(this,void 0,void 0,function(){var r,n,a;return X(this,function(i){switch(i.label){case 0:return(!((t=e.monitoring)!==null&&t!==void 0)||t)&&Mi(),r=e.delayFallback,n=e.debug,[4,Ri(r)];case 1:return i.sent(),a=ji({cache:{},debug:n}),[2,Ei(a,n)]}})})}var Vi={load:Oi,hashComponents:jr,componentsToDebugString:Ai},Cr=class{constructor(e){this.baseUrl=e}async validateWidget(e,t){if(!t)return{valid:!1,error:"Widget is not configured: tenantId is required"};try{const r=new URLSearchParams({agentId:e,tenantId:t}),n=await fetch(`${this.baseUrl}/v1/widget/validate?${r}`),a=await n.json();return n.ok&&a.success?{valid:!0,agentId:a.data.agentId,tenantId:a.data.tenantId}:{valid:!1,error:a.error??`Widget configuration is invalid (${n.status})`}}catch{return{valid:!1,error:"Unable to reach the AgentForge API to validate widget configuration"}}}async chat(e){const t=await fetch(`${this.baseUrl}/v1/agents/${encodeURIComponent(e.agentId)}/responses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e.message,sessionId:e.sessionId,tenantId:e.tenantId,userId:e.userId,name:e.name,email:e.email,authUserId:e.authUserId,fingerprint:e.fingerprint,metadata:e.metadata,imageUrl:e.imageUrl})});if(!t.ok)throw new Error(`API error: ${t.status} ${t.statusText}`);const r=await t.json();if(!r.success)throw new Error(r.error??"Unknown API error");return{content:r.data?.text??"",sessionId:r.data?.sessionId,images:r.data?.images}}async fetchSessionMessages(e){try{const t=await fetch(`${this.baseUrl}/v1/sessions/${encodeURIComponent(e)}/messages`);if(t.status===410||!t.ok)return null;const r=await t.json();return r.success?r.data?.messages??null:null}catch{return null}}async uploadImage(e,t,r){const n=await fetch(`${this.baseUrl}/v1/upload`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e,mimeType:t,fileName:r})});if(!n.ok)throw new Error(`Upload error: ${n.status} ${n.statusText}`);const a=await n.json();if(!a.success)throw new Error(a.error??"Upload failed");return{url:a.data.url}}async fetchWidgetConfig(e,t){try{const r=t?`?tenantId=${encodeURIComponent(t)}`:"",n=await fetch(`${this.baseUrl}/v1/agents/${encodeURIComponent(e)}/widget-config${r}`);if(!n.ok)return null;const a=await n.json();return a.success?a.data:null}catch{return null}}},Pi=6e4;function Fi(e){return Promise.race([e.read(),new Promise((t,r)=>setTimeout(()=>r(new Error("Stream timed out — no data received for 60s")),Pi))])}async function Ir(e,t,r){let n="",a="";try{const i=await fetch(`${e}/v1/agents/${encodeURIComponent(t.agentId)}/responses:stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t.message,sessionId:t.sessionId,tenantId:t.tenantId,userId:t.userId,name:t.name,email:t.email,authUserId:t.authUserId,fingerprint:t.fingerprint,metadata:t.metadata,imageUrl:t.imageUrl})});if(!i.ok||!i.body)throw new Error(`Stream error: ${i.status} ${i.statusText}`);const s=i.headers.get("x-session-id");s&&r.onSession&&r.onSession(s);const o=i.body.getReader(),c=new TextDecoder;let d="";const u=h=>{if(!h.startsWith("data: "))return!1;const m=h.slice(6).trim();if(!m)return!1;if(m==="[DONE]")return r.onEnd(n),!0;try{const p=JSON.parse(m);if(p.type==="session"){const b=p.sessionId;return b&&r.onSession&&r.onSession(b),!1}if(p.type==="done"||p.type==="stop")return r.onEnd(n),!0;if(p.type==="error")throw new Error(p.message??"Stream error");if(p.type==="images"){const b=p.images;return b&&r.onImages&&r.onImages(b),!1}if(p.type==="thinking_chunk"){const b=p.content;return b&&r.onThinkingDelta&&(a+=b,r.onThinkingDelta(b,a)),!1}const j=Wi(p);j&&(n+=j,r.onDelta(j,n))}catch(p){if(!(p instanceof SyntaxError))throw p}return!1};e:for(;;){const{done:h,value:m}=await Fi(o);if(h)break;d+=c.decode(m,{stream:!0});const p=d.lastIndexOf(`
|
|
5
|
+
`);if(p===-1)continue;const j=d.slice(0,p);d=d.slice(p+1);for(const b of j.split(`
|
|
6
|
+
`))if(u(b))break e}r.onEnd(n)}catch(i){r.onError(i instanceof Error?i:new Error(String(i)))}}function Wi(e){const t=e.choices;if(Array.isArray(t)&&t.length>0){const a=t[0]?.delta,i=a?.content??a?.text??"";if(i)return i}const r=e.delta;if(r){const a=r.content??r.text??"";if(a)return a}const n=e.response;return n||(e.text??e.content??"")}var Tr=class{listeners=new Map;on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t)}off(e,t){this.listeners.get(e)?.delete(t)}emit(...e){const[t,r]=e;this.listeners.get(t)?.forEach(n=>n(r))}removeAllListeners(){this.listeners.clear()}},zi="agentforge";function It(e){return`${zi}:session:${e}`}function Nr(e){try{return sessionStorage.getItem(It(e))??void 0}catch{return}}function Ze(e,t){try{sessionStorage.setItem(It(e),t)}catch{}}function kt(e){try{sessionStorage.removeItem(It(e))}catch{}}function ke(){return`msg-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`}function Di(e){return{id:ke(),role:"assistant",content:e,createdAt:new Date().toISOString(),status:"sent"}}var Lr=class{config;apiClient;state;greetingShown=!1;fingerprint;emitter;constructor(e,t,r){this.hostConfig=t,this.onStateChange=r,this.config=e,this.apiClient=new Cr(e.apiBaseUrl),this.emitter=new Tr,this.initializeFingerprint();const n=e.sessionId??Nr(e.agentId);e.sessionId&&Ze(e.agentId,e.sessionId);const a=e.mode==="inline";this.state={isOpen:a,messages:[],isLoading:!1,error:null,sessionId:n,initStatus:"validating",initError:null},a&&queueMicrotask(()=>this.openWithGreeting())}async initializeFingerprint(){try{this.fingerprint=(await(await Vi.load()).get()).visitorId}catch{this.fingerprint=void 0}}getState(){return{...this.state,messages:[...this.state.messages]}}setOpen(e){e?this.openWithGreeting():this.setState({isOpen:!1})}openWithGreeting(){if(this.state.initStatus==="error")return;const e=!this.greetingShown&&!!this.config.greeting;e&&(this.greetingShown=!0),this.setState({isOpen:!0,messages:e?[Di(this.config.greeting),...this.state.messages]:this.state.messages})}async hydrate(){const e=await this.apiClient.validateWidget(this.config.agentId,this.config.tenantId);if(!e.valid){this.setState({initStatus:"error",initError:e.error});return}const t=await this.apiClient.fetchWidgetConfig(this.config.agentId,this.config.tenantId);if(t&&(this.config=Ye(this.hostConfig,t),this.onStateChange(this.getState(),this.config)),this.setState({initStatus:"ready"}),!this.state.sessionId)return;const r=await this.apiClient.fetchSessionMessages(this.state.sessionId);if(r===null){this.handleSessionExpired();return}if(r.length===0)return;const n=r.map(a=>({id:ke(),role:a.role,content:a.content,images:a.images&&a.images.length>0?a.images:void 0,createdAt:new Date().toISOString(),status:"sent"}));this.setState({messages:[...this.state.messages,...n]})}setState(e){this.state={...this.state,...e},this.onStateChange(this.getState(),this.config)}updateMessage(e,t){this.state={...this.state,messages:this.state.messages.map(r=>r.id===e?{...r,...t}:r)},this.onStateChange(this.getState(),this.config)}reset(){kt(this.config.agentId),this.greetingShown=!1,this.setState({sessionId:void 0,messages:[],isLoading:!1,error:null}),this.state.isOpen&&this.openWithGreeting()}handleSessionExpired(){kt(this.config.agentId),this.setState({sessionId:void 0})}async sendMessage(e,t){if(this.state.isLoading||!e.trim()||this.state.initStatus!=="ready")return;let r;if(t)try{const i=await Ui(t);r=(await this.apiClient.uploadImage(i,t.type,t.name)).url}catch(i){const s=i instanceof Error?i.message:"Image upload failed";this.setState({error:s});return}const n={id:ke(),role:"user",content:e.trim(),uploadedImageUrl:r,createdAt:new Date().toISOString(),status:"sent"},a=!this.state.messages.some(i=>i.role==="user");this.setState({messages:[...this.state.messages,n],isLoading:!0,error:null}),this.emitter.emit("message:sent",n),a&&this.emitter.emit("conversation:started",{sessionId:this.state.sessionId}),this.config.streaming?await this.sendStreaming(e.trim(),r):await this.sendNonStreaming(e.trim(),r)}async sendNonStreaming(e,t,r=!1){try{const n=await this.apiClient.chat({agentId:this.config.agentId,message:e,sessionId:this.state.sessionId,tenantId:this.config.tenantId,userId:this.config.userId,name:this.config.name,email:this.config.email,authUserId:this.config.authUserId,fingerprint:this.fingerprint,metadata:this.config.metadata,imageUrl:t}),a={id:ke(),role:"assistant",content:n.content,images:n.images,createdAt:new Date().toISOString(),status:"sent"};this.setState({messages:[...this.state.messages,a],isLoading:!1,...n.sessionId?{sessionId:n.sessionId}:{}}),n.sessionId&&Ze(this.config.agentId,n.sessionId),this.emitter.emit("message:received",a)}catch(n){const a=n instanceof Error?n.message:"Failed to send message";if(!r&&a.includes("410"))return this.handleSessionExpired(),this.sendNonStreaming(e,t,!0);this.setState({isLoading:!1,error:a}),this.emitter.emit("message:error",{error:a,message:null})}}async sendStreaming(e,t,r=!1){const n=ke(),a={id:n,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming",isThinking:this.config.thinkingEnabled?!0:void 0};this.setState({messages:[...this.state.messages,a]}),this.emitter.emit("stream:start");let i=!1;await Ir(this.config.apiBaseUrl,{agentId:this.config.agentId,message:e,sessionId:this.state.sessionId,tenantId:this.config.tenantId,userId:this.config.userId,name:this.config.name,email:this.config.email,authUserId:this.config.authUserId,fingerprint:this.fingerprint,metadata:this.config.metadata,imageUrl:t},{onSession:s=>{this.setState({sessionId:s}),Ze(this.config.agentId,s)},onImages:s=>{this.updateMessage(n,{images:s})},onThinkingDelta:(s,o)=>{this.updateMessage(n,{thinking:o,isThinking:!0}),this.emitter.emit("thinking:delta",{delta:s,accumulated:o})},onDelta:(s,o)=>{this.updateMessage(n,{content:o,isThinking:!1}),this.emitter.emit("stream:delta",{delta:s,accumulated:o})},onEnd:s=>{this.updateMessage(n,{content:s,status:"sent",isThinking:!1}),this.setState({isLoading:!1}),this.emitter.emit("stream:end",{content:s});const o=this.state.messages.find(c=>c.id===n);o&&(o.thinking&&this.emitter.emit("thinking:end",{content:o.thinking}),this.emitter.emit("message:received",o))},onError:s=>{if(!r&&s.message.includes("410")){i=!0,this.setState({messages:this.state.messages.filter(c=>c.id!==n),isLoading:!1});return}const o=this.state.messages.find(c=>c.id===n)?.content??"";this.updateMessage(n,{content:o||"Something went wrong. Please try again.",status:"error"}),this.setState({isLoading:!1,error:"Something went wrong. Please try again."}),this.emitter.emit("message:error",{error:s.message,message:null})}}),i&&(this.handleSessionExpired(),await this.sendStreaming(e,t,!0))}};function Ui(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{const a=n.result;t(a.split(",")[1]??"")},n.onerror=()=>r(new Error("Failed to read file")),n.readAsDataURL(e)})}function Ar(e){const t=document.createElement("div");t.setAttribute("data-agentkit-widget",""),e.appendChild(t);const r=t.attachShadow({mode:"open"}),n=document.createElement("style");r.appendChild(n);const a=document.createElement("div");return a.style.cssText="display: contents;",r.appendChild(a),{host:t,shadowRoot:r,styleSlot:n,mountPoint:a}}function Zr(e,t){e.textContent=t}function Rr(e){e.remove()}function Er(){const e=document.createElement("div");return e.setAttribute("data-agentkit-root","floating"),e.style.cssText=["position: fixed","bottom: 24px","right: 24px","z-index: 2147483647","pointer-events: none"].join("; "),document.body.appendChild(e),e}function $i(e){getComputedStyle(e).position==="static"&&(e.style.position="relative");const t=document.createElement("div");return t.setAttribute("data-agentkit-root","floating"),t.style.cssText=["position: absolute","bottom: 24px","right: 24px","z-index: 2147483647","pointer-events: none"].join("; "),e.appendChild(t),t}function Mr(e){return e.setAttribute("data-agentkit-root","inline"),getComputedStyle(e).position==="static"&&(e.style.position="relative"),e}function Bi(e){e.remove()}function Gi(e){e.removeAttribute("data-agentkit-root")}function Tt(e,t,r,n,a){const i=e.mode==="inline";let s=!1;const o=i&&a?Mr(a):!i&&a?$i(a):Er(),c=Ar(o);Zr(c.styleSlot,n);const d=new Lr(e,t,(m,p)=>{s||u.update(m,p)}),u=r(c.mountPoint,e,d.getState(),{onOpen:()=>h.open(),onClose:()=>h.close(),onSendMessage:(m,p)=>{d.sendMessage(m,p)}});d.hydrate(),setTimeout(()=>{s||d.emitter.emit("ready",d.getState())},0);const h={open(){s||(d.setOpen(!0),d.emitter.emit("open"))},close(){s||(d.setOpen(!1),d.emitter.emit("close"))},toggle(){d.getState().isOpen?h.close():h.open()},async sendMessage(m,p){await d.sendMessage(m,p)},reset(){s||(d.reset(),d.emitter.emit("reset"))},destroy(){s||(s=!0,u.destroy(),Rr(c.host),i&&a?Gi(a):Bi(o),d.emitter.emit("destroy"),d.emitter.removeAllListeners())},on(m,p){d.emitter.on(m,p)},off(m,p){d.emitter.off(m,p)},getState(){return d.getState()}};return h}var pe=new Map,Yi=0;function Or(e){const t=`agentkit-widget-${++Yi}`,r=e.destroy.bind(e);return e.destroy=()=>{pe.delete(t),r()},pe.set(t,e),t}function Hi(e,t,r){const n={...e,mode:"floating"},a=Tt(Ye(n),n,t,r);return Or(a),a}function Xi(e,t,r,n){const a={...t,mode:"inline"},i=Tt(Ye(a),a,r,n,e);return Or(i),i}function Ji(e){e?pe.get(e)?.destroy():(pe.forEach(t=>t.destroy()),pe.clear())}function Qi(){return Array.from(pe.keys())}function Vr(e){const{theme:t}=e,r=[`--ak-accent: ${t.accentColor}`,`--ak-font: ${t.fontFamily}`,`--ak-radius: ${t.borderRadius}`];return r.push(`--ak-accent-hover: color-mix(in srgb, ${t.accentColor} 85%, black)`),`:host { ${r.join("; ")} }`}function Pr(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var Fr=`
|
|
11
7
|
*, *::before, *::after {
|
|
12
8
|
box-sizing: border-box;
|
|
13
9
|
margin: 0;
|
|
@@ -51,7 +47,7 @@ components: `).concat(dn(i),"\n```")),[2,s]}})})}}}function bi(){if(!(window.__f
|
|
|
51
47
|
display: flex;
|
|
52
48
|
flex-direction: column;
|
|
53
49
|
align-items: flex-end;
|
|
54
|
-
gap:
|
|
50
|
+
gap: 6px;
|
|
55
51
|
pointer-events: none;
|
|
56
52
|
}
|
|
57
53
|
.ak-floating > * {
|
|
@@ -108,6 +104,13 @@ components: `).concat(dn(i),"\n```")),[2,s]}})})}}}function bi(){if(!(window.__f
|
|
|
108
104
|
pointer-events: none;
|
|
109
105
|
}
|
|
110
106
|
|
|
107
|
+
/* ── Shell wrapper (positions the hanging branding tab) ─────── */
|
|
108
|
+
.ak-shell-wrap {
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
align-items: flex-start;
|
|
112
|
+
}
|
|
113
|
+
|
|
111
114
|
/* ── Widget shell / panel ────────────────────────────────────── */
|
|
112
115
|
.ak-shell {
|
|
113
116
|
background: var(--ak-bg);
|
|
@@ -204,6 +207,17 @@ components: `).concat(dn(i),"\n```")),[2,s]}})})}}}function bi(){if(!(window.__f
|
|
|
204
207
|
border: 2px solid rgba(255, 255, 255, 0.3);
|
|
205
208
|
background: rgba(255, 255, 255, 0.15);
|
|
206
209
|
}
|
|
210
|
+
.ak-header__bot-icon {
|
|
211
|
+
width: 28px;
|
|
212
|
+
height: 28px;
|
|
213
|
+
border-radius: 50%;
|
|
214
|
+
background: rgba(255, 255, 255, 0.2);
|
|
215
|
+
display: flex;
|
|
216
|
+
align-items: center;
|
|
217
|
+
justify-content: center;
|
|
218
|
+
color: #fff;
|
|
219
|
+
flex-shrink: 0;
|
|
220
|
+
}
|
|
207
221
|
|
|
208
222
|
/* ── Message list ────────────────────────────────────────────── */
|
|
209
223
|
.ak-messages {
|
|
@@ -261,6 +275,7 @@ components: `).concat(dn(i),"\n```")),[2,s]}})})}}}function bi(){if(!(window.__f
|
|
|
261
275
|
background: var(--ak-bot-bg);
|
|
262
276
|
color: var(--ak-bot-text);
|
|
263
277
|
border-bottom-left-radius: 4px;
|
|
278
|
+
border: 1px solid var(--ak-border);
|
|
264
279
|
}
|
|
265
280
|
.ak-message--error .ak-message__bubble {
|
|
266
281
|
background: #fee2e2;
|
|
@@ -375,6 +390,7 @@ components: `).concat(dn(i),"\n```")),[2,s]}})})}}}function bi(){if(!(window.__f
|
|
|
375
390
|
background: var(--ak-bot-bg);
|
|
376
391
|
border-radius: 16px;
|
|
377
392
|
border-bottom-left-radius: 4px;
|
|
393
|
+
border: 1px solid var(--ak-border);
|
|
378
394
|
align-self: flex-start;
|
|
379
395
|
width: fit-content;
|
|
380
396
|
animation: ak-msg-in 0.15s ease-out;
|
|
@@ -428,70 +444,76 @@ components: `).concat(dn(i),"\n```")),[2,s]}})})}}}function bi(){if(!(window.__f
|
|
|
428
444
|
flex-shrink: 0;
|
|
429
445
|
}
|
|
430
446
|
|
|
431
|
-
/* Inner row: photo button + textarea + send button */
|
|
432
|
-
.ak-composer__row {
|
|
433
|
-
display: flex;
|
|
434
|
-
gap: 8px;
|
|
435
|
-
align-items: flex-end;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
447
|
/* Hidden native file input */
|
|
439
448
|
.ak-composer__file-input {
|
|
440
449
|
display: none;
|
|
441
450
|
}
|
|
442
451
|
|
|
443
|
-
/*
|
|
444
|
-
.ak-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
background:
|
|
452
|
+
/* Unified input container — wraps +, textarea, send as one row */
|
|
453
|
+
.ak-composer__input-wrap {
|
|
454
|
+
display: flex;
|
|
455
|
+
align-items: center;
|
|
456
|
+
gap: 6px;
|
|
457
|
+
background: var(--ak-surface);
|
|
458
|
+
border: 1px solid var(--ak-border);
|
|
459
|
+
border-radius: 14px;
|
|
460
|
+
padding: 5px 5px 5px 6px;
|
|
461
|
+
transition: border-color 0.15s;
|
|
462
|
+
}
|
|
463
|
+
.ak-composer__input-wrap:focus-within {
|
|
464
|
+
border-color: var(--ak-accent);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/* "+" attachment button — square with rounded corners */
|
|
468
|
+
.ak-composer__attach {
|
|
469
|
+
width: 28px;
|
|
470
|
+
height: 28px;
|
|
471
|
+
border-radius: 8px;
|
|
472
|
+
background: var(--ak-bg);
|
|
449
473
|
border: 1px solid var(--ak-border);
|
|
450
474
|
cursor: pointer;
|
|
451
475
|
display: flex;
|
|
452
476
|
align-items: center;
|
|
453
477
|
justify-content: center;
|
|
454
478
|
color: var(--ak-text-muted);
|
|
455
|
-
transition:
|
|
479
|
+
transition: color 0.15s, border-color 0.15s;
|
|
456
480
|
flex-shrink: 0;
|
|
457
481
|
}
|
|
458
|
-
.ak-
|
|
459
|
-
background: var(--ak-surface);
|
|
482
|
+
.ak-composer__attach:hover:not(:disabled) {
|
|
460
483
|
color: var(--ak-accent);
|
|
461
484
|
border-color: var(--ak-accent);
|
|
462
485
|
}
|
|
463
|
-
.ak-
|
|
486
|
+
.ak-composer__attach:disabled {
|
|
464
487
|
opacity: 0.4;
|
|
465
488
|
cursor: not-allowed;
|
|
466
489
|
}
|
|
467
490
|
|
|
491
|
+
/* Textarea — borderless, transparent, sits inside the container */
|
|
468
492
|
.ak-composer__input {
|
|
469
493
|
flex: 1;
|
|
470
|
-
padding:
|
|
471
|
-
border:
|
|
472
|
-
border-radius:
|
|
473
|
-
background:
|
|
494
|
+
padding: 4px 6px;
|
|
495
|
+
border: none;
|
|
496
|
+
border-radius: 0;
|
|
497
|
+
background: transparent;
|
|
474
498
|
color: var(--ak-text);
|
|
475
499
|
font-family: var(--ak-font);
|
|
476
500
|
font-size: 14px;
|
|
477
501
|
line-height: 1.45;
|
|
478
502
|
resize: none;
|
|
479
503
|
outline: none;
|
|
480
|
-
|
|
481
|
-
min-height: 38px;
|
|
504
|
+
min-height: 28px;
|
|
482
505
|
max-height: 110px;
|
|
483
506
|
overflow-y: auto;
|
|
484
507
|
}
|
|
485
|
-
.ak-composer__input:focus {
|
|
486
|
-
border-color: var(--ak-accent);
|
|
487
|
-
}
|
|
488
508
|
.ak-composer__input::placeholder {
|
|
489
509
|
color: var(--ak-text-muted);
|
|
490
510
|
}
|
|
511
|
+
|
|
512
|
+
/* Send button — square with rounded corners */
|
|
491
513
|
.ak-composer__send {
|
|
492
|
-
width:
|
|
493
|
-
height:
|
|
494
|
-
border-radius:
|
|
514
|
+
width: 28px;
|
|
515
|
+
height: 28px;
|
|
516
|
+
border-radius: 8px;
|
|
495
517
|
background: var(--ak-accent);
|
|
496
518
|
border: none;
|
|
497
519
|
cursor: pointer;
|
|
@@ -499,18 +521,22 @@ components: `).concat(dn(i),"\n```")),[2,s]}})})}}}function bi(){if(!(window.__f
|
|
|
499
521
|
align-items: center;
|
|
500
522
|
justify-content: center;
|
|
501
523
|
color: white;
|
|
502
|
-
transition: background 0.15s,
|
|
524
|
+
transition: background 0.15s, opacity 0.15s;
|
|
503
525
|
flex-shrink: 0;
|
|
504
526
|
}
|
|
505
527
|
.ak-composer__send:hover:not(:disabled) {
|
|
506
528
|
background: var(--ak-accent-hover);
|
|
507
|
-
transform: scale(1.06);
|
|
508
529
|
}
|
|
509
530
|
.ak-composer__send:disabled {
|
|
510
531
|
opacity: 0.45;
|
|
511
532
|
cursor: not-allowed;
|
|
512
533
|
}
|
|
513
534
|
|
|
535
|
+
/* Old photo button — hidden but keep so file-input trigger still works */
|
|
536
|
+
.ak-composer__photo {
|
|
537
|
+
display: none;
|
|
538
|
+
}
|
|
539
|
+
|
|
514
540
|
/* Image preview strip above the input row */
|
|
515
541
|
.ak-composer__preview {
|
|
516
542
|
display: flex;
|
|
@@ -800,7 +826,40 @@ components: `).concat(dn(i),"\n```")),[2,s]}})})}}}function bi(){if(!(window.__f
|
|
|
800
826
|
overflow-y: auto;
|
|
801
827
|
line-height: 1.5;
|
|
802
828
|
}
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
`)})})]},a++));continue}const o=i.match(/^(#{1,6})(\s+.*)?$/);if(o){const d=o[1].length,l=o[2]?U(o[2].trim()):"";d===1?n.push(u.jsx("h1",{className:"ak-md-h1",children:l},a++)):d===2?n.push(u.jsx("h2",{className:"ak-md-h2",children:l},a++)):d===3?n.push(u.jsx("h3",{className:"ak-md-h3",children:l},a++)):d===4?n.push(u.jsx("h4",{className:"ak-md-h4",children:l},a++)):d===5?n.push(u.jsx("h5",{className:"ak-md-h5",children:l},a++)):n.push(u.jsx("h6",{className:"ak-md-h6",children:l},a++)),r++;continue}if(/^[-*_]{3,}$/.test(i.trim())){n.push(u.jsx("hr",{className:"ak-md-hr"},a++)),r++;continue}if(/^[-*+]\s/.test(i)){const d=[];let l=r;for(;l<e.length&&(/^[-*+]\s/.test(e[l])||e[l].trim()==="");){if(e[l].trim()===""){l++;continue}const f=e[l].length-e[l].trimStart().length,p=e[l].replace(/^[-*+]\s+/,""),m=[],w=[];let k=l+1;for(;k<e.length&&k<l+20;){const _=e[k];if(_.length-_.trimStart().length>f&&_.trim()!==""){const I=_.trim();/^[-*+]\s/.test(I)?m.push(u.jsx("li",{children:U(I.replace(/^[-*+]\s+/,""))},`nested-${k}`)):w.push(u.jsx("p",{style:{margin:"0.2em 0 0"},children:U(I)},`cont-${k}`)),k++}else break}const R=w.length>0||m.length>0?u.jsxs(u.Fragment,{children:[U(p),w,m.length>0&&u.jsx("ul",{style:{margin:"0.2em 0 0",paddingLeft:"1.2em"},children:m})]}):U(p);d.push(u.jsx("li",{children:R},`item-${l}`)),l=k}n.push(u.jsx("ul",{className:"ak-md-ul",children:d},a++)),r=l;continue}if(/^\d+\.\s/.test(i)){const d=[];let l=r;for(;l<e.length&&(/^\d+\.\s/.test(e[l])||e[l].trim()==="");){if(e[l].trim()===""){l++;continue}const f=e[l].length-e[l].trimStart().length,p=e[l].replace(/^\d+\.\s+/,""),m=[],w=[];let k=l+1;for(;k<e.length&&k<l+20;){const _=e[k];if(_.length-_.trimStart().length>f&&_.trim()!==""){const I=_.trim();/^\d+\.\s/.test(I)?m.push(u.jsx("li",{children:U(I.replace(/^\d+\.\s+/,""))},`nested-order-${k}`)):/^[-*+]\s/.test(I)?m.push(u.jsx("li",{children:U(I.replace(/^[-*+]\s+/,""))},`nested-unorder-${k}`)):w.push(u.jsx("p",{style:{margin:"0.2em 0 0"},children:U(I)},`cont-${k}`)),k++}else break}const R=w.length>0||m.length>0?u.jsxs(u.Fragment,{children:[U(p),w,m.length>0&&u.jsx("ol",{style:{margin:"0.2em 0 0",paddingLeft:"1.2em"},children:m})]}):U(p);d.push(u.jsx("li",{children:R},`order-item-${l}`)),l=k}n.push(u.jsx("ol",{className:"ak-md-ol",children:d},a++)),r=l;continue}if(i.trim()===""){r++;continue}const c=[];for(;r<e.length&&e[r].trim()!==""&&!e[r].startsWith("#")&&!/^\s*```/.test(e[r])&&!/^[-*+]\s/.test(e[r])&&!/^\d+\.\s/.test(e[r])&&!/^[-*_]{3,}$/.test(e[r].trim());)c.push(e[r]),r++;if(c.length>0){const d=[];c.forEach((l,f)=>{d.push(...U(l)),f<c.length-1&&d.push(u.jsx("br",{},`br-${f}`))}),n.push(u.jsx("p",{className:"ak-md-p",children:d},a++))}}return u.jsx(u.Fragment,{children:n})}function In({message:t,thinkingViewable:e=!1}){const n=t.role==="user",r=t.status==="error",a=t.status==="streaming",i=!!(t.images&&t.images.length>0),s=!!(n&&t.uploadedImageUrl),o=i||s,c=!n&&!r,d=n?"ak-message--user":r?"ak-message--assistant ak-message--error":"ak-message--assistant",l=["ak-message__bubble",c?"ak-message__bubble--md":"",o?"ak-message__bubble--has-image":""].filter(Boolean).join(" "),f=u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:l,children:[s&&u.jsx("div",{className:"ak-message__images",children:u.jsxs("div",{className:"ak-message__image-wrap",children:[u.jsx("a",{href:t.uploadedImageUrl,className:"ak-message__image-link",children:u.jsx("img",{src:t.uploadedImageUrl,alt:"Uploaded image",className:"ak-message__image"})}),u.jsx("a",{href:t.uploadedImageUrl,download:!0,className:"ak-message__image-dl-icon",title:"Download image",onClick:m=>m.stopPropagation(),children:u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),u.jsx("polyline",{points:"7 10 12 15 17 10"}),u.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]})}),i&&u.jsx("div",{className:"ak-message__images",children:t.images.map((m,w)=>{const k=m.url??(m.base64?`data:${m.mimeType};base64,${m.base64}`:null);return k?u.jsxs("div",{className:"ak-message__image-wrap",children:[u.jsx("a",{href:k,className:"ak-message__image-link",children:u.jsx("img",{src:k,alt:"Generated image",className:"ak-message__image"})}),u.jsx("a",{href:k,download:!0,className:"ak-message__image-dl-icon",title:"Download image",onClick:R=>R.stopPropagation(),children:u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),u.jsx("polyline",{points:"7 10 12 15 17 10"}),u.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]},w):null})}),(t.content||a&&!t.isThinking)&&u.jsxs("div",{className:o?"ak-message__image-caption":void 0,children:[c?Wi(t.content):t.content,a&&!t.isThinking&&u.jsxs("span",{className:"ak-cursor","aria-hidden":"true",children:[u.jsx("span",{className:"ak-cursor__dot"}),u.jsx("span",{className:"ak-cursor__dot"}),u.jsx("span",{className:"ak-cursor__dot"})]})]})]}),u.jsx("span",{className:"ak-message__time",children:Fi(t.createdAt)})]}),p=!t.isThinking||!!t.content;return u.jsxs("div",{className:`ak-message ${d}`,children:[!n&&u.jsx(Pi,{thinking:t.thinking,isThinking:t.isThinking??!1,thinkingViewable:e}),p&&f]})}function jn(){return u.jsxs("div",{className:"ak-typing","aria-label":"Assistant is typing",children:[u.jsx("span",{className:"ak-typing__dot"}),u.jsx("span",{className:"ak-typing__dot"}),u.jsx("span",{className:"ak-typing__dot"})]})}function Nn({messages:t,isLoading:e,thinkingViewable:n}){var s,o;const r=P.useRef(null),a=((s=t.find(c=>c.status==="streaming"))==null?void 0:s.content)??"",i=((o=t.find(c=>c.isThinking))==null?void 0:o.thinking)??"";return P.useEffect(()=>{var c;(c=r.current)==null||c.scrollIntoView({behavior:"smooth"})},[t.length,e,a,i]),u.jsxs("div",{className:"ak-messages",role:"log","aria-live":"polite","aria-label":"Conversation",children:[t.map(c=>u.jsx(In,{message:c,thinkingViewable:n},c.id)),e&&!t.some(c=>c.status==="streaming")&&u.jsx(jn,{}),u.jsx("div",{ref:r})]})}function zi(){return u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),u.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}function Di(){return u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),u.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),u.jsx("polyline",{points:"21 15 16 10 5 21"})]})}function Ui(){return u.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),u.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Tn({onSend:t,disabled:e=!1,placeholder:n="Type a message…",privacyPolicyUrl:r}){const[a,i]=P.useState(""),[s,o]=P.useState(null),[c,d]=P.useState(null),l=P.useRef(null),f=P.useRef(null);P.useEffect(()=>()=>{c&&URL.revokeObjectURL(c)},[c]),P.useEffect(()=>{var S;e||(S=l.current)==null||S.focus()},[e]);function p(){o(null),c&&URL.revokeObjectURL(c),d(null),f.current&&(f.current.value="")}function m(){const S=a.trim();!S&&!s||e||(t(S,s??void 0),i(""),p(),l.current&&(l.current.style.height="auto"))}function w(S){S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),m())}function k(S){const I=S.currentTarget;i(I.value),I.style.height="auto",I.style.height=`${I.scrollHeight}px`}function R(S){var W;const I=(W=S.currentTarget.files)==null?void 0:W[0];if(I){if(I.size>5*1024*1024){alert("Image must be smaller than 5 MB."),S.currentTarget.value="";return}c&&URL.revokeObjectURL(c),o(I),d(URL.createObjectURL(I))}}const _=!e&&(!!a.trim()||!!s);return u.jsxs("div",{className:"ak-composer",children:[c&&u.jsx("div",{className:"ak-composer__preview",children:u.jsxs("div",{className:"ak-composer__preview-wrap",children:[u.jsx("img",{src:c,alt:"Selected",className:"ak-composer__preview-img"}),u.jsx("button",{className:"ak-composer__preview-remove",onClick:p,type:"button","aria-label":"Remove image",disabled:e,children:u.jsx(Ui,{})})]})}),u.jsxs("div",{className:"ak-composer__row",children:[u.jsx("input",{ref:f,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",className:"ak-composer__file-input",onChange:R,disabled:e,"aria-label":"Attach image"}),u.jsx("button",{className:"ak-composer__photo",onClick:()=>{var S;return(S=f.current)==null?void 0:S.click()},disabled:e,"aria-label":"Attach image",type:"button",children:u.jsx(Di,{})}),u.jsx("textarea",{ref:l,className:"ak-composer__input",value:a,onInput:k,onKeyDown:w,placeholder:n,disabled:e,rows:1,"aria-label":"Message input"}),u.jsx("button",{className:"ak-composer__send",onClick:m,disabled:!_,"aria-label":"Send message",type:"button",children:u.jsx(zi,{})})]}),r&&u.jsxs("p",{className:"ak-composer__disclaimer",children:["By chatting with us, you agree to our"," ",u.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"})]})]})}function tt({message:t}){return t.includes("Origin not allowed")?u.jsxs("div",{className:"ak-error ak-error--origin",role:"alert",children:[u.jsx("div",{className:"ak-error__icon",children:"🔒"}),u.jsxs("div",{className:"ak-error__content",children:[u.jsx("h3",{className:"ak-error__title",children:"Access Restricted"}),u.jsx("p",{className:"ak-error__description",children:"This widget has been restricted to specific websites only."}),u.jsx("p",{className:"ak-error__message",children:"Contact the website administrator if you believe this is an error."})]})]}):u.jsxs("div",{className:"ak-error",role:"alert",children:[u.jsx("div",{className:"ak-error__icon",children:"⚠️"}),u.jsx("div",{className:"ak-error__content",children:u.jsx("p",{className:"ak-error__message",children:t})})]})}function nt({config:t,messages:e,isLoading:n,error:r,isInline:a,initStatus:i,initError:s,callbacks:o}){const c=a?"ak-shell ak-shell--inline":"ak-shell ak-shell--floating ak-shell-enter";return u.jsxs("div",{className:c,role:"dialog","aria-label":t.title,children:[u.jsx(Cn,{title:t.title,subtitle:t.subtitle,avatarUrl:t.avatarUrl,onClose:o.onClose,hideClose:a}),i==="validating"&&u.jsx("div",{className:"ak-init-status",children:u.jsx("div",{className:"ak-init-spinner","aria-label":"Connecting…"})}),i==="error"&&u.jsx("div",{className:"ak-init-status ak-init-status--error",children:u.jsx(tt,{message:s??"Widget configuration is invalid."})}),i==="ready"&&u.jsxs(u.Fragment,{children:[u.jsx(Nn,{messages:e,isLoading:n,thinkingViewable:t.thinkingViewable}),r&&u.jsx(tt,{message:r}),u.jsx(Tn,{onSend:o.onSendMessage,disabled:n,placeholder:"Type a message…",privacyPolicyUrl:t.privacyPolicyUrl})]})]})}function $i(){return u.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:u.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function Bi(){return u.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[u.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),u.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Ln({isOpen:t,onClick:e,avatarUrl:n,ariaLabel:r="Toggle chat"}){const a=!t&&!!n;return u.jsx("button",{className:`ak-launcher${a?" ak-launcher--avatar":""}`,onClick:e,"aria-label":r,"aria-expanded":t,type:"button",children:t?u.jsx(Bi,{}):a?u.jsx("img",{src:n,alt:"",className:"ak-launcher__avatar-img","aria-hidden":"true"}):u.jsx($i,{})})}function rt({config:t,state:e,callbacks:n}){const r=t.mode==="inline",a=P.useRef(null);return P.useEffect(()=>{var c;const i=(c=a.current)==null?void 0:c.getRootNode(),s=i==null?void 0:i.host;if(!s)return;const o=wn(t.theme.mode);s.setAttribute("data-theme",o)},[t.theme.mode]),r?u.jsx("div",{ref:a,className:"ak-inline",children:u.jsx(nt,{config:t,messages:e.messages,isLoading:e.isLoading,error:e.error,isInline:!0,initStatus:e.initStatus,initError:e.initError,callbacks:n})}):u.jsxs("div",{ref:a,className:"ak-floating",children:[e.isOpen&&u.jsx(nt,{config:t,messages:e.messages,isLoading:e.isLoading,error:e.error,isInline:!1,initStatus:e.initStatus,initError:e.initError,callbacks:n}),u.jsx(Ln,{isOpen:e.isOpen,onClick:e.isOpen?n.onClose:n.onOpen,avatarUrl:t.avatarUrl})]})}const Gi=(t,e,n,r)=>{const a=Mn.createRoot(t);return a.render(P.createElement(rt,{config:e,state:n,callbacks:r})),{update(i,s){a.render(P.createElement(rt,{config:s,state:i,callbacks:r}))},destroy(){setTimeout(()=>{a.unmount()},0)}}};function Yi(t){return Sn+`
|
|
806
|
-
|
|
829
|
+
|
|
830
|
+
/* ── Powered by hanging tab ──────────────────────────────────── */
|
|
831
|
+
.ak-branding {
|
|
832
|
+
display: inline-flex;
|
|
833
|
+
align-items: center;
|
|
834
|
+
gap: 4px;
|
|
835
|
+
padding: 4px 10px 5px;
|
|
836
|
+
background: var(--ak-bg);
|
|
837
|
+
border: 1px solid var(--ak-border);
|
|
838
|
+
border-top: none;
|
|
839
|
+
border-radius: 0 0 8px 8px;
|
|
840
|
+
margin-left: 16px;
|
|
841
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
|
|
842
|
+
}
|
|
843
|
+
.ak-branding__logo {
|
|
844
|
+
width: 11px;
|
|
845
|
+
height: 11px;
|
|
846
|
+
flex-shrink: 0;
|
|
847
|
+
color: var(--ak-accent);
|
|
848
|
+
opacity: 0.75;
|
|
849
|
+
}
|
|
850
|
+
.ak-branding__label {
|
|
851
|
+
font-size: 9px;
|
|
852
|
+
color: var(--ak-text-muted);
|
|
853
|
+
opacity: 0.75;
|
|
854
|
+
}
|
|
855
|
+
.ak-branding__name {
|
|
856
|
+
font-size: 9px;
|
|
857
|
+
font-weight: 600;
|
|
858
|
+
color: var(--ak-accent);
|
|
859
|
+
opacity: 0.75;
|
|
860
|
+
letter-spacing: -0.01em;
|
|
861
|
+
}
|
|
862
|
+
`;function Ki(){return(0,l.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),(0,l.jsx)("circle",{cx:"12",cy:"5",r:"2"}),(0,l.jsx)("path",{d:"M12 7v4"}),(0,l.jsx)("line",{x1:"8",y1:"16",x2:"8",y2:"16"}),(0,l.jsx)("line",{x1:"16",y1:"16",x2:"16",y2:"16"})]})}function qi(){return(0,l.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[(0,l.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,l.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Wr({title:e,subtitle:t,avatarUrl:r,onClose:n,hideClose:a=!1}){return(0,l.jsxs)("div",{className:"ak-header",children:[r?(0,l.jsx)("img",{src:r,alt:"",className:"ak-header__avatar","aria-hidden":"true"}):(0,l.jsx)("span",{className:"ak-header__bot-icon","aria-hidden":"true",children:(0,l.jsx)(Ki,{})}),(0,l.jsxs)("div",{className:"ak-header__title-group",children:[(0,l.jsx)("span",{className:"ak-header__title",children:e}),t&&(0,l.jsx)("span",{className:"ak-header__subtitle",children:t})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,l.jsx)("span",{className:"ak-header__status","aria-hidden":"true"}),!a&&(0,l.jsx)("button",{className:"ak-header__close",onClick:n,"aria-label":"Close chat",type:"button",children:(0,l.jsx)(qi,{})})]})]})}function es({thinking:e,isThinking:t,thinkingViewable:r}){const[n,a]=(0,O.useState)(!1);return!t&&!e?null:t?(0,l.jsx)("div",{className:"ak-thinking",children:(0,l.jsxs)("div",{className:"ak-thinking__indicator",children:[(0,l.jsx)("span",{className:"ak-thinking__label",children:"Thinking"}),(0,l.jsxs)("span",{className:"ak-cursor","aria-hidden":"true",children:[(0,l.jsx)("span",{className:"ak-cursor__dot"}),(0,l.jsx)("span",{className:"ak-cursor__dot"}),(0,l.jsx)("span",{className:"ak-cursor__dot"})]})]})}):!r||!e?null:(0,l.jsxs)("div",{className:"ak-thinking ak-thinking--done",children:[(0,l.jsxs)("button",{className:"ak-thinking__toggle",onClick:()=>a(i=>!i),"aria-expanded":n,type:"button",children:[(0,l.jsx)("svg",{className:`ak-thinking__chevron${n?" ak-thinking__chevron--open":""}`,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,l.jsx)("polyline",{points:"6 9 12 15 18 9"})}),(0,l.jsx)("span",{children:"Thought for a moment"})]}),n&&(0,l.jsx)("div",{className:"ak-thinking__content",children:e})]})}function ts(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}var Jt=/(`[^`\n]+`|\*\*[^*\n]+\*\*|\*[^*\n]+\*|!\[[^\]\n]*\]\([^)\n]+\)|\[[^\]\n]+\]\([^)\n]+\))/g;function z(e){const t=[];let r=0,n=0;Jt.lastIndex=0;let a;for(;(a=Jt.exec(e))!==null;){a.index>r&&t.push(e.slice(r,a.index));const i=a[0];if(i.startsWith("`"))t.push((0,l.jsx)("code",{className:"ak-md-ic",children:i.slice(1,-1)},n++));else if(i.startsWith("**"))t.push((0,l.jsx)("strong",{children:i.slice(2,-2)},n++));else if(i.startsWith("*"))t.push((0,l.jsx)("em",{children:i.slice(1,-1)},n++));else if(i.startsWith("![")){const s=i.match(/!\[([^\]]*)\]\(([^)]+)\)/);s&&t.push((0,l.jsx)("a",{href:s[2],target:"_blank",rel:"noopener noreferrer",children:s[1]||"image"},n++))}else{const s=i.match(/\[(.+?)\]\((.+?)\)/);s?t.push((0,l.jsx)("a",{href:s[2],target:"_blank",rel:"noopener noreferrer",children:s[1]},n++)):t.push(i)}r=a.index+i.length}return r<e.length&&t.push(e.slice(r)),t}function rs(e){const t=e.split(`
|
|
863
|
+
`),r=[];let n=0,a=0;for(;n<t.length;){const i=t[n],s=i.match(/^(\s*)```/);if(s){const d=s[1],u=i.trimStart().match(/^```(\w+)?\s*$/)?.[1]||"",h=[];for(n++;n<t.length&&!t[n].trimStart().startsWith("```");)h.push(t[n].startsWith(d)?t[n].slice(d.length):t[n]),n++;n<t.length&&t[n].trimStart().startsWith("```")&&n++,r.push((0,l.jsxs)("div",{className:"ak-md-pre-wrap",children:[u&&(0,l.jsx)("span",{className:"ak-md-pre-lang",children:u}),(0,l.jsx)("pre",{className:`ak-md-pre${u?` ak-md-pre--${u}`:""}`,children:(0,l.jsx)("code",{className:"ak-md-code",children:h.join(`
|
|
864
|
+
`)})})]},a++));continue}const o=i.match(/^(#{1,6})(\s+.*)?$/);if(o){const d=o[1].length,u=o[2]?z(o[2].trim()):"";d===1?r.push((0,l.jsx)("h1",{className:"ak-md-h1",children:u},a++)):d===2?r.push((0,l.jsx)("h2",{className:"ak-md-h2",children:u},a++)):d===3?r.push((0,l.jsx)("h3",{className:"ak-md-h3",children:u},a++)):d===4?r.push((0,l.jsx)("h4",{className:"ak-md-h4",children:u},a++)):d===5?r.push((0,l.jsx)("h5",{className:"ak-md-h5",children:u},a++)):r.push((0,l.jsx)("h6",{className:"ak-md-h6",children:u},a++)),n++;continue}if(/^[-*_]{3,}$/.test(i.trim())){r.push((0,l.jsx)("hr",{className:"ak-md-hr"},a++)),n++;continue}if(/^[-*+]\s/.test(i)){const d=[];let u=n;for(;u<t.length&&(/^[-*+]\s/.test(t[u])||t[u].trim()==="");){if(t[u].trim()===""){u++;continue}const h=t[u].length-t[u].trimStart().length,m=t[u].replace(/^[-*+]\s+/,""),p=[],j=[];let b=u+1;for(;b<t.length&&b<u+20;){const S=t[b];if(S.length-S.trimStart().length>h&&S.trim()!==""){const _=S.trim();/^[-*+]\s/.test(_)?p.push((0,l.jsx)("li",{children:z(_.replace(/^[-*+]\s+/,""))},`nested-${b}`)):j.push((0,l.jsx)("p",{style:{margin:"0.2em 0 0"},children:z(_)},`cont-${b}`)),b++}else break}const Z=j.length>0||p.length>0?(0,l.jsxs)(l.Fragment,{children:[z(m),j,p.length>0&&(0,l.jsx)("ul",{style:{margin:"0.2em 0 0",paddingLeft:"1.2em"},children:p})]}):z(m);d.push((0,l.jsx)("li",{children:Z},`item-${u}`)),u=b}r.push((0,l.jsx)("ul",{className:"ak-md-ul",children:d},a++)),n=u;continue}if(/^\d+\.\s/.test(i)){const d=[];let u=n;for(;u<t.length&&(/^\d+\.\s/.test(t[u])||t[u].trim()==="");){if(t[u].trim()===""){u++;continue}const h=t[u].length-t[u].trimStart().length,m=t[u].replace(/^\d+\.\s+/,""),p=[],j=[];let b=u+1;for(;b<t.length&&b<u+20;){const S=t[b];if(S.length-S.trimStart().length>h&&S.trim()!==""){const _=S.trim();/^\d+\.\s/.test(_)?p.push((0,l.jsx)("li",{children:z(_.replace(/^\d+\.\s+/,""))},`nested-order-${b}`)):/^[-*+]\s/.test(_)?p.push((0,l.jsx)("li",{children:z(_.replace(/^[-*+]\s+/,""))},`nested-unorder-${b}`)):j.push((0,l.jsx)("p",{style:{margin:"0.2em 0 0"},children:z(_)},`cont-${b}`)),b++}else break}const Z=j.length>0||p.length>0?(0,l.jsxs)(l.Fragment,{children:[z(m),j,p.length>0&&(0,l.jsx)("ol",{style:{margin:"0.2em 0 0",paddingLeft:"1.2em"},children:p})]}):z(m);d.push((0,l.jsx)("li",{children:Z},`order-item-${u}`)),u=b}r.push((0,l.jsx)("ol",{className:"ak-md-ol",children:d},a++)),n=u;continue}if(i.trim()===""){n++;continue}const c=[];for(;n<t.length&&t[n].trim()!==""&&!t[n].startsWith("#")&&!/^\s*```/.test(t[n])&&!/^[-*+]\s/.test(t[n])&&!/^\d+\.\s/.test(t[n])&&!/^[-*_]{3,}$/.test(t[n].trim());)c.push(t[n]),n++;if(c.length>0){const d=[];c.forEach((u,h)=>{d.push(...z(u)),h<c.length-1&&d.push((0,l.jsx)("br",{},`br-${h}`))}),r.push((0,l.jsx)("p",{className:"ak-md-p",children:d},a++))}}return(0,l.jsx)(l.Fragment,{children:r})}function zr({message:e,thinkingViewable:t=!1}){const r=e.role==="user",n=e.status==="error",a=e.status==="streaming",i=!!(e.images&&e.images.length>0),s=!!(r&&e.uploadedImageUrl),o=i||s,c=!r&&!n,d=r?"ak-message--user":n?"ak-message--assistant ak-message--error":"ak-message--assistant",u=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:["ak-message__bubble",c?"ak-message__bubble--md":"",o?"ak-message__bubble--has-image":""].filter(Boolean).join(" "),children:[s&&(0,l.jsx)("div",{className:"ak-message__images",children:(0,l.jsxs)("div",{className:"ak-message__image-wrap",children:[(0,l.jsx)("a",{href:e.uploadedImageUrl,className:"ak-message__image-link",children:(0,l.jsx)("img",{src:e.uploadedImageUrl,alt:"Uploaded image",className:"ak-message__image"})}),(0,l.jsx)("a",{href:e.uploadedImageUrl,download:!0,className:"ak-message__image-dl-icon",title:"Download image",onClick:m=>m.stopPropagation(),children:(0,l.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,l.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,l.jsx)("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]})}),i&&(0,l.jsx)("div",{className:"ak-message__images",children:e.images.map((m,p)=>{const j=m.url??(m.base64?`data:${m.mimeType};base64,${m.base64}`:null);return j?(0,l.jsxs)("div",{className:"ak-message__image-wrap",children:[(0,l.jsx)("a",{href:j,className:"ak-message__image-link",children:(0,l.jsx)("img",{src:j,alt:"Generated image",className:"ak-message__image"})}),(0,l.jsx)("a",{href:j,download:!0,className:"ak-message__image-dl-icon",title:"Download image",onClick:b=>b.stopPropagation(),children:(0,l.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,l.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,l.jsx)("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})})]},p):null})}),(e.content||a&&!e.isThinking)&&(0,l.jsxs)("div",{className:o?"ak-message__image-caption":void 0,children:[c?rs(e.content):e.content,a&&!e.isThinking&&(0,l.jsxs)("span",{className:"ak-cursor","aria-hidden":"true",children:[(0,l.jsx)("span",{className:"ak-cursor__dot"}),(0,l.jsx)("span",{className:"ak-cursor__dot"}),(0,l.jsx)("span",{className:"ak-cursor__dot"})]})]})]}),(0,l.jsx)("span",{className:"ak-message__time",children:ts(e.createdAt)})]}),h=!e.isThinking||!!e.content;return(0,l.jsxs)("div",{className:`ak-message ${d}`,children:[!r&&(0,l.jsx)(es,{thinking:e.thinking,isThinking:e.isThinking??!1,thinkingViewable:t}),h&&u]})}function Dr(){return(0,l.jsxs)("div",{className:"ak-typing","aria-label":"Assistant is typing",children:[(0,l.jsx)("span",{className:"ak-typing__dot"}),(0,l.jsx)("span",{className:"ak-typing__dot"}),(0,l.jsx)("span",{className:"ak-typing__dot"})]})}function Ur({messages:e,isLoading:t,thinkingViewable:r}){const n=(0,O.useRef)(null),a=e.find(s=>s.status==="streaming")?.content??"",i=e.find(s=>s.isThinking)?.thinking??"";return(0,O.useEffect)(()=>{n.current?.scrollIntoView({behavior:"smooth"})},[e.length,t,a,i]),(0,l.jsxs)("div",{className:"ak-messages",role:"log","aria-live":"polite","aria-label":"Conversation",children:[e.map(s=>(0,l.jsx)(zr,{message:s,thinkingViewable:r},s.id)),t&&!e.some(s=>s.status==="streaming")&&(0,l.jsx)(Dr,{}),(0,l.jsx)("div",{ref:n})]})}function ns(){return(0,l.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),(0,l.jsx)("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}function as(){return(0,l.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[(0,l.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,l.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function is(){return(0,l.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,l.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function $r({onSend:e,disabled:t=!1,placeholder:r="Type a message…",privacyPolicyUrl:n}){const[a,i]=(0,O.useState)(""),[s,o]=(0,O.useState)(null),[c,d]=(0,O.useState)(null),u=(0,O.useRef)(null),h=(0,O.useRef)(null);(0,O.useEffect)(()=>()=>{c&&URL.revokeObjectURL(c)},[c]),(0,O.useEffect)(()=>{t||u.current?.focus()},[t]);function m(){o(null),c&&URL.revokeObjectURL(c),d(null),h.current&&(h.current.value="")}function p(){const _=a.trim();!_&&!s||t||(e(_,s??void 0),i(""),m(),u.current&&(u.current.style.height="auto"))}function j(_){_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),p())}function b(_){const L=_.currentTarget;i(L.value),L.style.height="auto",L.style.height=`${L.scrollHeight}px`}function Z(_){const L=_.currentTarget.files?.[0];if(L){if(L.size>5*1024*1024){alert("Image must be smaller than 5 MB."),_.currentTarget.value="";return}c&&URL.revokeObjectURL(c),o(L),d(URL.createObjectURL(L))}}const S=!t&&(!!a.trim()||!!s);return(0,l.jsxs)("div",{className:"ak-composer",children:[c&&(0,l.jsx)("div",{className:"ak-composer__preview",children:(0,l.jsxs)("div",{className:"ak-composer__preview-wrap",children:[(0,l.jsx)("img",{src:c,alt:"Selected",className:"ak-composer__preview-img"}),(0,l.jsx)("button",{className:"ak-composer__preview-remove",onClick:m,type:"button","aria-label":"Remove image",disabled:t,children:(0,l.jsx)(is,{})})]})}),(0,l.jsxs)("div",{className:"ak-composer__input-wrap",children:[(0,l.jsx)("input",{ref:h,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",className:"ak-composer__file-input",onChange:Z,disabled:t,"aria-label":"Attach image"}),(0,l.jsx)("button",{className:"ak-composer__attach",onClick:()=>h.current?.click(),disabled:t,"aria-label":"Attach image",type:"button",children:(0,l.jsx)(as,{})}),(0,l.jsx)("textarea",{ref:u,className:"ak-composer__input",value:a,onInput:b,onKeyDown:j,placeholder:r,disabled:t,rows:1,"aria-label":"Message input"}),(0,l.jsx)("button",{className:"ak-composer__send",onClick:p,disabled:!S,"aria-label":"Send message",type:"button",children:(0,l.jsx)(ns,{})})]}),(0,l.jsxs)("p",{className:"ak-composer__disclaimer",children:["By chatting with us, you agree to our"," ",n?(0,l.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"}):"Privacy Policy"]})]})}function xt({message:e}){return e.includes("Origin not allowed")?(0,l.jsxs)("div",{className:"ak-error ak-error--origin",role:"alert",children:[(0,l.jsx)("div",{className:"ak-error__icon",children:"🔒"}),(0,l.jsxs)("div",{className:"ak-error__content",children:[(0,l.jsx)("h3",{className:"ak-error__title",children:"Access Restricted"}),(0,l.jsx)("p",{className:"ak-error__description",children:"This widget has been restricted to specific websites only."}),(0,l.jsx)("p",{className:"ak-error__message",children:"Contact the website administrator if you believe this is an error."})]})]}):(0,l.jsxs)("div",{className:"ak-error",role:"alert",children:[(0,l.jsx)("div",{className:"ak-error__icon",children:"⚠️"}),(0,l.jsx)("div",{className:"ak-error__content",children:(0,l.jsx)("p",{className:"ak-error__message",children:e})})]})}function ss(){return(0,l.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:"ak-branding__logo",children:[(0,l.jsx)("rect",{width:"24",height:"24",rx:"5",fill:"currentColor"}),(0,l.jsx)("path",{d:"M12 5L7 13h3.5v6l6.5-9H13.5V5z",fill:"white"})]})}function os(){return(0,l.jsxs)("div",{className:"ak-branding",children:[(0,l.jsx)(ss,{}),(0,l.jsx)("span",{className:"ak-branding__label",children:"Powered by"}),(0,l.jsx)("span",{className:"ak-branding__name",children:"AgentForge"})]})}function _t({config:e,messages:t,isLoading:r,error:n,isInline:a,initStatus:i,initError:s,callbacks:o}){return(0,l.jsxs)("div",{className:a?"ak-shell-wrap":"ak-shell-wrap ak-shell-enter",children:[(0,l.jsxs)("div",{className:a?"ak-shell ak-shell--inline":"ak-shell ak-shell--floating",role:"dialog","aria-label":e.title,children:[(0,l.jsx)(Wr,{title:e.title,subtitle:e.subtitle,avatarUrl:e.avatarUrl,onClose:o.onClose,hideClose:a}),i==="validating"&&(0,l.jsx)("div",{className:"ak-init-status",children:(0,l.jsx)("div",{className:"ak-init-spinner","aria-label":"Connecting…"})}),i==="error"&&(0,l.jsx)("div",{className:"ak-init-status ak-init-status--error",children:(0,l.jsx)(xt,{message:s??"Widget configuration is invalid."})}),i==="ready"&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ur,{messages:t,isLoading:r,thinkingViewable:e.thinkingViewable}),n&&(0,l.jsx)(xt,{message:n}),(0,l.jsx)($r,{onSend:o.onSendMessage,disabled:r,placeholder:"Type a message…",privacyPolicyUrl:e.privacyPolicyUrl})]})]}),!a&&(0,l.jsx)(os,{})]})}function cs(){return(0,l.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,l.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function ds(){return(0,l.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[(0,l.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,l.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Br({isOpen:e,onClick:t,avatarUrl:r,ariaLabel:n="Toggle chat"}){const a=!e&&!!r;return(0,l.jsx)("button",{className:`ak-launcher${a?" ak-launcher--avatar":""}`,onClick:t,"aria-label":n,"aria-expanded":e,type:"button",children:e?(0,l.jsx)(ds,{}):a?(0,l.jsx)("img",{src:r,alt:"",className:"ak-launcher__avatar-img","aria-hidden":"true"}):(0,l.jsx)(cs,{})})}function wt({config:e,state:t,callbacks:r}){const n=e.mode==="inline",a=(0,O.useRef)(null);return(0,O.useEffect)(()=>{const i=a.current?.getRootNode()?.host;if(!i)return;const s=Pr(e.theme.mode);i.setAttribute("data-theme",s)},[e.theme.mode]),n?(0,l.jsx)("div",{ref:a,className:"ak-inline",children:(0,l.jsx)(_t,{config:e,messages:t.messages,isLoading:t.isLoading,error:t.error,isInline:!0,initStatus:t.initStatus,initError:t.initError,callbacks:r})}):(0,l.jsxs)("div",{ref:a,className:"ak-floating",children:[t.isOpen&&(0,l.jsx)(_t,{config:e,messages:t.messages,isLoading:t.isLoading,error:t.error,isInline:!1,initStatus:t.initStatus,initError:t.initError,callbacks:r}),(0,l.jsx)(Br,{isOpen:t.isOpen,onClick:t.isOpen?r.onClose:r.onOpen,avatarUrl:e.avatarUrl})]})}var ls=(e,t,r,n)=>{const a=(0,Yr.createRoot)(e);return a.render((0,O.createElement)(wt,{config:t,state:r,callbacks:n})),{update(i,s){a.render((0,O.createElement)(wt,{config:s,state:i,callbacks:n}))},destroy(){setTimeout(()=>{a.unmount()},0)}}};function us(e){return Fr+`
|
|
865
|
+
`+Vr(e)}exports.ApiClient=Cr;exports.Composer=$r;exports.ErrorState=xt;exports.EventEmitter=Tr;exports.Header=Wr;exports.Launcher=Br;exports.MessageBubble=zr;exports.MessageList=Ur;exports.TypingIndicator=Dr;exports.WidgetApp=wt;exports.WidgetClient=Lr;exports.WidgetShell=_t;exports.buildThemeVars=Vr;exports.buildWidgetCSS=us;exports.clearSession=kt;exports.createFloatingContainer=Er;exports.createShadowHost=Ar;exports.createWidget=Tt;exports.destroyWidget=Ji;exports.getSessionId=Nr;exports.init=Hi;exports.injectStyles=Zr;exports.listWidgets=Qi;exports.mount=Xi;exports.normalizeConfig=Ye;exports.prepareInlineContainer=Mr;exports.removeShadowHost=Rr;exports.renderWidget=ls;exports.resolveThemeMode=Pr;exports.setSessionId=Ze;exports.streamChat=Ir;exports.widgetCSS=Fr;
|