point-click-lib 0.0.6 → 0.0.8
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/dist/point-click-lib.cjs +20 -1
- package/dist/point-click-lib.d.ts +289 -273
- package/dist/point-click-lib.iife.js +20 -1
- package/dist/point-click-lib.js +6683 -2163
- package/dist/point-click-lib.umd.cjs +20 -1
- package/package.json +3 -1
|
@@ -1 +1,20 @@
|
|
|
1
|
-
var PointClickLib=(function(u){"use strict";const ta=[{schemaVersion:3,changes:[{breaking:!1,description:"Designs have schemaVersion property"},{breaking:!1,description:"storyBoards array is required"}]},{schemaVersion:4,changes:[{breaking:!0,description:"Endings deprecated in favour of storyBoards. Any Endings have been converted to Storyboards."},{breaking:!1,description:"StoryBoards have end of game option."}]}];var C;(function(a){a.assertEqual=s=>{};function e(s){}a.assertIs=e;function t(s){throw new Error}a.assertNever=t,a.arrayToEnum=s=>{const r={};for(const i of s)r[i]=i;return r},a.getValidEnumValues=s=>{const r=a.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of r)i[o]=s[o];return a.objectValues(i)},a.objectValues=s=>a.objectKeys(s).map(function(r){return s[r]}),a.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const r=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&r.push(i);return r},a.find=(s,r)=>{for(const i of s)if(r(i))return i},a.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,r=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(r)}a.joinValues=n,a.jsonStringifyReplacer=(s,r)=>typeof r=="bigint"?r.toString():r})(C||(C={}));var ft;(function(a){a.mergeShapes=(e,t)=>({...e,...t})})(ft||(ft={}));const m=C.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$=a=>{switch(typeof a){case"undefined":return m.undefined;case"string":return m.string;case"number":return Number.isNaN(a)?m.nan:m.number;case"boolean":return m.boolean;case"function":return m.function;case"bigint":return m.bigint;case"symbol":return m.symbol;case"object":return Array.isArray(a)?m.array:a===null?m.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?m.promise:typeof Map<"u"&&a instanceof Map?m.map:typeof Set<"u"&&a instanceof Set?m.set:typeof Date<"u"&&a instanceof Date?m.date:m.object;default:return m.unknown}},d=C.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 V extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(r){return r.message},n={_errors:[]},s=r=>{for(const i of r.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let o=n,p=0;for(;p<i.path.length;){const y=i.path[p];p===i.path.length-1?(o[y]=o[y]||{_errors:[]},o[y]._errors.push(t(i))):o[y]=o[y]||{_errors:[]},o=o[y],p++}}};return s(this),n}static assert(e){if(!(e instanceof V))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,C.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const s of this.issues)if(s.path.length>0){const r=s.path[0];t[r]=t[r]||[],t[r].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}V.create=a=>new V(a);const Pe=(a,e)=>{let t;switch(a.code){case d.invalid_type:a.received===m.undefined?t="Required":t=`Expected ${a.expected}, received ${a.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(a.expected,C.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${C.joinValues(a.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${C.joinValues(a.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${C.joinValues(a.options)}, received '${a.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(t=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?t=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?t=`Invalid input: must end with "${a.validation.endsWith}"`:C.assertNever(a.validation):a.validation!=="regex"?t=`Invalid ${a.validation}`:t="Invalid";break;case d.too_small:a.type==="array"?t=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?t=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?t=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="bigint"?t=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?t=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:t="Invalid input";break;case d.too_big:a.type==="array"?t=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?t=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?t=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?t=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?t=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${a.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,C.assertNever(a)}return{message:t}};let aa=Pe;function na(){return aa}const sa=a=>{const{data:e,path:t,errorMaps:n,issueData:s}=a,r=[...t,...s.path||[]],i={...s,path:r};if(s.message!==void 0)return{...s,path:r,message:s.message};let o="";const p=n.filter(y=>!!y).slice().reverse();for(const y of p)o=y(i,{data:e,defaultError:o}).message;return{...s,path:r,message:o}};function l(a,e){const t=na(),n=sa({issueData:e,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,t,t===Pe?void 0:Pe].filter(s=>!!s)});a.common.issues.push(n)}class R{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if(s.status==="aborted")return _;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t){const r=await s.key,i=await s.value;n.push({key:r,value:i})}return R.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:r,value:i}=s;if(r.status==="aborted"||i.status==="aborted")return _;r.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[r.value]=i.value)}return{status:e.value,value:n}}}const _=Object.freeze({status:"aborted"}),me=a=>({status:"dirty",value:a}),Z=a=>({status:"valid",value:a}),pt=a=>a.status==="aborted",yt=a=>a.status==="dirty",U=a=>a.status==="valid",ke=a=>typeof Promise<"u"&&a instanceof Promise;var f;(function(a){a.errToObj=e=>typeof e=="string"?{message:e}:e||{},a.toString=e=>typeof e=="string"?e:e?.message})(f||(f={}));class j{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}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 gt=(a,e)=>{if(U(e))return{success:!0,data:e.value};if(!a.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new V(a.common.issues);return this._error=t,this._error}}};function k(a){if(!a)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:s}=a;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{const{message:p}=a;return i.code==="invalid_enum_value"?{message:p??o.defaultError}:typeof o.data>"u"?{message:p??n??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:p??t??o.defaultError}},description:s}}class b{get description(){return this._def.description}_getType(e){return $(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new R,ctx:{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ke(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 n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},s=this._parseSync({data:e,path:n.path,parent:n});return gt(n,s)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return U(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>U(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},s=this._parse({data:e,path:n.path,parent:n}),r=await(ke(s)?s:Promise.resolve(s));return gt(n,r)}refine(e,t){const n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,r)=>{const i=e(s),o=()=>r.addIssue({code:d.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(p=>p?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new Y({schema:this,typeName:v.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 M.create(this,this._def)}nullable(){return X.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return D.create(this)}promise(){return Te.create(this,this._def)}or(e){return xe.create([this,e],this._def)}and(e){return Ce.create(this,e,this._def)}transform(e){return new Y({...k(this._def),schema:this,typeName:v.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Fe({...k(this._def),innerType:this,defaultValue:t,typeName:v.ZodDefault})}brand(){return new Ia({typeName:v.ZodBranded,type:this,...k(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new We({...k(this._def),innerType:this,catchValue:t,typeName:v.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Ue.create(this,e)}readonly(){return Ge.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ra=/^c[^\s-]{8,}$/i,ia=/^[0-9a-z]+$/,oa=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ca=/^[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,da=/^[a-z0-9_-]{21}$/i,ua=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,la=/^[-+]?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)?)??$/,ha=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ma="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let $e;const fa=/^(?:(?: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])$/,pa=/^(?:(?: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])$/,ya=/^(([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]))$/,ga=/^(([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])$/,va=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_a=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,vt="((\\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])))",Sa=new RegExp(`^${vt}$`);function _t(a){let e="[0-5]\\d";a.precision?e=`${e}\\.\\d{${a.precision}}`:a.precision==null&&(e=`${e}(\\.\\d+)?`);const t=a.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function ka(a){return new RegExp(`^${_t(a)}$`)}function ba(a){let e=`${vt}T${_t(a)}`;const t=[];return t.push(a.local?"Z?":"Z"),a.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function xa(a,e){return!!((e==="v4"||!e)&&fa.test(a)||(e==="v6"||!e)&&ya.test(a))}function Ca(a,e){if(!ua.test(a))return!1;try{const[t]=a.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function wa(a,e){return!!((e==="v4"||!e)&&pa.test(a)||(e==="v6"||!e)&&ga.test(a))}class P extends b{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==m.string){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:m.string,received:r.parsedType}),_}const n=new R;let s;for(const r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="max")e.data.length>r.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="length"){const i=e.data.length>r.value,o=e.data.length<r.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?l(s,{code:d.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):o&&l(s,{code:d.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),n.dirty())}else if(r.kind==="email")ha.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"email",code:d.invalid_string,message:r.message}),n.dirty());else if(r.kind==="emoji")$e||($e=new RegExp(ma,"u")),$e.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"emoji",code:d.invalid_string,message:r.message}),n.dirty());else if(r.kind==="uuid")ca.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"uuid",code:d.invalid_string,message:r.message}),n.dirty());else if(r.kind==="nanoid")da.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"nanoid",code:d.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid")ra.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid",code:d.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid2")ia.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid2",code:d.invalid_string,message:r.message}),n.dirty());else if(r.kind==="ulid")oa.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ulid",code:d.invalid_string,message:r.message}),n.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),l(s,{validation:"url",code:d.invalid_string,message:r.message}),n.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"regex",code:d.invalid_string,message:r.message}),n.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),n.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{startsWith:r.value},message:r.message}),n.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{endsWith:r.value},message:r.message}),n.dirty()):r.kind==="datetime"?ba(r).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"datetime",message:r.message}),n.dirty()):r.kind==="date"?Sa.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"date",message:r.message}),n.dirty()):r.kind==="time"?ka(r).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"time",message:r.message}),n.dirty()):r.kind==="duration"?la.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"duration",code:d.invalid_string,message:r.message}),n.dirty()):r.kind==="ip"?xa(e.data,r.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ip",code:d.invalid_string,message:r.message}),n.dirty()):r.kind==="jwt"?Ca(e.data,r.alg)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"jwt",code:d.invalid_string,message:r.message}),n.dirty()):r.kind==="cidr"?wa(e.data,r.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cidr",code:d.invalid_string,message:r.message}),n.dirty()):r.kind==="base64"?va.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64",code:d.invalid_string,message:r.message}),n.dirty()):r.kind==="base64url"?_a.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64url",code:d.invalid_string,message:r.message}),n.dirty()):C.assertNever(r);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:d.invalid_string,...f.errToObj(n)})}_addCheck(e){return new P({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...f.errToObj(e)})}url(e){return this._addCheck({kind:"url",...f.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...f.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...f.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...f.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...f.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...f.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...f.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...f.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...f.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...f.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...f.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...f.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?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...f.errToObj(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?.precision>"u"?null:e?.precision,...f.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...f.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...f.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...f.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...f.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...f.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...f.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...f.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...f.errToObj(t)})}nonempty(e){return this.min(1,f.errToObj(e))}trim(){return new P({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new P({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new P({...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 t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}P.create=a=>new P({checks:[],typeName:v.ZodString,coerce:a?.coerce??!1,...k(a)});function Ta(a,e){const t=(a.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,r=Number.parseInt(a.toFixed(s).replace(".","")),i=Number.parseInt(e.toFixed(s).replace(".",""));return r%i/10**s}class G extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==m.number){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:m.number,received:r.parsedType}),_}let n;const s=new R;for(const r of this._def.checks)r.kind==="int"?C.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_type,expected:"integer",received:"float",message:r.message}),s.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty()):r.kind==="multipleOf"?Ta(e.data,r.value)!==0&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.not_finite,message:r.message}),s.dirty()):C.assertNever(r);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,f.toString(t))}gt(e,t){return this.setLimit("min",e,!1,f.toString(t))}lte(e,t){return this.setLimit("max",e,!0,f.toString(t))}lt(e,t){return this.setLimit("max",e,!1,f.toString(t))}setLimit(e,t,n,s){return new G({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:f.toString(s)}]})}_addCheck(e){return new G({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:f.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:f.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:f.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:f.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:f.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:f.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:f.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:f.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:f.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&C.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}G.create=a=>new G({checks:[],typeName:v.ZodNumber,coerce:a?.coerce||!1,...k(a)});class fe extends b{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)!==m.bigint)return this._getInvalidInput(e);let n;const s=new R;for(const r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),s.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),s.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()):C.assertNever(r);return{status:s.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return l(t,{code:d.invalid_type,expected:m.bigint,received:t.parsedType}),_}gte(e,t){return this.setLimit("min",e,!0,f.toString(t))}gt(e,t){return this.setLimit("min",e,!1,f.toString(t))}lte(e,t){return this.setLimit("max",e,!0,f.toString(t))}lt(e,t){return this.setLimit("max",e,!1,f.toString(t))}setLimit(e,t,n,s){return new fe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:f.toString(s)}]})}_addCheck(e){return new fe({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:f.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:f.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:f.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:f.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:f.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}fe.create=a=>new fe({checks:[],typeName:v.ZodBigInt,coerce:a?.coerce??!1,...k(a)});class Be extends b{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==m.boolean){const n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.boolean,received:n.parsedType}),_}return Z(e.data)}}Be.create=a=>new Be({typeName:v.ZodBoolean,coerce:a?.coerce||!1,...k(a)});class be extends b{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==m.date){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:m.date,received:r.parsedType}),_}if(Number.isNaN(e.data.getTime())){const r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_date}),_}const n=new R;let s;for(const r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):C.assertNever(r);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new be({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:f.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:f.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}be.create=a=>new be({checks:[],coerce:a?.coerce||!1,typeName:v.ZodDate,...k(a)});class St extends b{_parse(e){if(this._getType(e)!==m.symbol){const n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.symbol,received:n.parsedType}),_}return Z(e.data)}}St.create=a=>new St({typeName:v.ZodSymbol,...k(a)});class Me extends b{_parse(e){if(this._getType(e)!==m.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.undefined,received:n.parsedType}),_}return Z(e.data)}}Me.create=a=>new Me({typeName:v.ZodUndefined,...k(a)});class kt extends b{_parse(e){if(this._getType(e)!==m.null){const n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.null,received:n.parsedType}),_}return Z(e.data)}}kt.create=a=>new kt({typeName:v.ZodNull,...k(a)});class bt extends b{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}}bt.create=a=>new bt({typeName:v.ZodAny,...k(a)});class xt extends b{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}}xt.create=a=>new xt({typeName:v.ZodUnknown,...k(a)});class B extends b{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:d.invalid_type,expected:m.never,received:t.parsedType}),_}}B.create=a=>new B({typeName:v.ZodNever,...k(a)});class Ct extends b{_parse(e){if(this._getType(e)!==m.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.void,received:n.parsedType}),_}return Z(e.data)}}Ct.create=a=>new Ct({typeName:v.ZodVoid,...k(a)});class D extends b{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==m.array)return l(t,{code:d.invalid_type,expected:m.array,received:t.parsedType}),_;if(s.exactLength!==null){const i=t.data.length>s.exactLength.value,o=t.data.length<s.exactLength.value;(i||o)&&(l(t,{code:i?d.too_big:d.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(l(t,{code:d.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(l(t,{code:d.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>s.type._parseAsync(new j(t,i,t.path,o)))).then(i=>R.mergeArray(n,i));const r=[...t.data].map((i,o)=>s.type._parseSync(new j(t,i,t.path,o)));return R.mergeArray(n,r)}get element(){return this._def.type}min(e,t){return new D({...this._def,minLength:{value:e,message:f.toString(t)}})}max(e,t){return new D({...this._def,maxLength:{value:e,message:f.toString(t)}})}length(e,t){return new D({...this._def,exactLength:{value:e,message:f.toString(t)}})}nonempty(e){return this.min(1,e)}}D.create=(a,e)=>new D({type:a,minLength:null,maxLength:null,exactLength:null,typeName:v.ZodArray,...k(e)});function H(a){if(a instanceof A){const e={};for(const t in a.shape){const n=a.shape[t];e[t]=M.create(H(n))}return new A({...a._def,shape:()=>e})}else return a instanceof D?new D({...a._def,type:H(a.element)}):a instanceof M?M.create(H(a.unwrap())):a instanceof X?X.create(H(a.unwrap())):a instanceof L?L.create(a.items.map(e=>H(e))):a}class A extends b{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=C.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==m.object){const y=this._getOrReturnCtx(e);return l(y,{code:d.invalid_type,expected:m.object,received:y.parsedType}),_}const{status:n,ctx:s}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof B&&this._def.unknownKeys==="strip"))for(const y in s.data)i.includes(y)||o.push(y);const p=[];for(const y of i){const x=r[y],W=s.data[y];p.push({key:{status:"valid",value:y},value:x._parse(new j(s,W,s.path,y)),alwaysSet:y in s.data})}if(this._def.catchall instanceof B){const y=this._def.unknownKeys;if(y==="passthrough")for(const x of o)p.push({key:{status:"valid",value:x},value:{status:"valid",value:s.data[x]}});else if(y==="strict")o.length>0&&(l(s,{code:d.unrecognized_keys,keys:o}),n.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const y=this._def.catchall;for(const x of o){const W=s.data[x];p.push({key:{status:"valid",value:x},value:y._parse(new j(s,W,s.path,x)),alwaysSet:x in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const y=[];for(const x of p){const W=await x.key,lt=await x.value;y.push({key:W,value:lt,alwaysSet:x.alwaysSet})}return y}).then(y=>R.mergeObjectSync(n,y)):R.mergeObjectSync(n,p)}get shape(){return this._def.shape()}strict(e){return f.errToObj,new A({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{const s=this._def.errorMap?.(t,n).message??n.defaultError;return t.code==="unrecognized_keys"?{message:f.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new A({...this._def,unknownKeys:"strip"})}passthrough(){return new A({...this._def,unknownKeys:"passthrough"})}extend(e){return new A({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new A({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:v.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new A({...this._def,catchall:e})}pick(e){const t={};for(const n of C.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new A({...this._def,shape:()=>t})}omit(e){const t={};for(const n of C.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new A({...this._def,shape:()=>t})}deepPartial(){return H(this)}partial(e){const t={};for(const n of C.objectKeys(this.shape)){const s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}return new A({...this._def,shape:()=>t})}required(e){const t={};for(const n of C.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let r=this.shape[n];for(;r instanceof M;)r=r._def.innerType;t[n]=r}return new A({...this._def,shape:()=>t})}keyof(){return It(C.objectKeys(this.shape))}}A.create=(a,e)=>new A({shape:()=>a,unknownKeys:"strip",catchall:B.create(),typeName:v.ZodObject,...k(e)}),A.strictCreate=(a,e)=>new A({shape:()=>a,unknownKeys:"strict",catchall:B.create(),typeName:v.ZodObject,...k(e)}),A.lazycreate=(a,e)=>new A({shape:a,unknownKeys:"strip",catchall:B.create(),typeName:v.ZodObject,...k(e)});class xe extends b{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function s(r){for(const o of r)if(o.result.status==="valid")return o.result;for(const o of r)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=r.map(o=>new V(o.ctx.common.issues));return l(t,{code:d.invalid_union,unionErrors:i}),_}if(t.common.async)return Promise.all(n.map(async r=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await r._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(s);{let r;const i=[];for(const p of n){const y={...t,common:{...t.common,issues:[]},parent:null},x=p._parseSync({data:t.data,path:t.path,parent:y});if(x.status==="valid")return x;x.status==="dirty"&&!r&&(r={result:x,ctx:y}),y.common.issues.length&&i.push(y.common.issues)}if(r)return t.common.issues.push(...r.ctx.common.issues),r.result;const o=i.map(p=>new V(p));return l(t,{code:d.invalid_union,unionErrors:o}),_}}get options(){return this._def.options}}xe.create=(a,e)=>new xe({options:a,typeName:v.ZodUnion,...k(e)});function ze(a,e){const t=$(a),n=$(e);if(a===e)return{valid:!0,data:a};if(t===m.object&&n===m.object){const s=C.objectKeys(e),r=C.objectKeys(a).filter(o=>s.indexOf(o)!==-1),i={...a,...e};for(const o of r){const p=ze(a[o],e[o]);if(!p.valid)return{valid:!1};i[o]=p.data}return{valid:!0,data:i}}else if(t===m.array&&n===m.array){if(a.length!==e.length)return{valid:!1};const s=[];for(let r=0;r<a.length;r++){const i=a[r],o=e[r],p=ze(i,o);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return t===m.date&&n===m.date&&+a==+e?{valid:!0,data:a}:{valid:!1}}class Ce extends b{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(r,i)=>{if(pt(r)||pt(i))return _;const o=ze(r.value,i.value);return o.valid?((yt(r)||yt(i))&&t.dirty(),{status:t.value,value:o.data}):(l(n,{code:d.invalid_intersection_types}),_)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,i])=>s(r,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Ce.create=(a,e,t)=>new Ce({left:a,right:e,typeName:v.ZodIntersection,...k(t)});class L extends b{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.array)return l(n,{code:d.invalid_type,expected:m.array,received:n.parsedType}),_;if(n.data.length<this._def.items.length)return l(n,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&n.data.length>this._def.items.length&&(l(n,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map((i,o)=>{const p=this._def.items[o]||this._def.rest;return p?p._parse(new j(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(r).then(i=>R.mergeArray(t,i)):R.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new L({...this._def,rest:e})}}L.create=(a,e)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new L({items:a,typeName:v.ZodTuple,rest:null,...k(e)})};class we extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.object)return l(n,{code:d.invalid_type,expected:m.object,received:n.parsedType}),_;const s=[],r=this._def.keyType,i=this._def.valueType;for(const o in n.data)s.push({key:r._parse(new j(n,o,n.path,o)),value:i._parse(new j(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?R.mergeObjectAsync(t,s):R.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof b?new we({keyType:e,valueType:t,typeName:v.ZodRecord,...k(n)}):new we({keyType:P.create(),valueType:e,typeName:v.ZodRecord,...k(t)})}}class wt extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.map)return l(n,{code:d.invalid_type,expected:m.map,received:n.parsedType}),_;const s=this._def.keyType,r=this._def.valueType,i=[...n.data.entries()].map(([o,p],y)=>({key:s._parse(new j(n,o,n.path,[y,"key"])),value:r._parse(new j(n,p,n.path,[y,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const p of i){const y=await p.key,x=await p.value;if(y.status==="aborted"||x.status==="aborted")return _;(y.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(y.value,x.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const p of i){const y=p.key,x=p.value;if(y.status==="aborted"||x.status==="aborted")return _;(y.status==="dirty"||x.status==="dirty")&&t.dirty(),o.set(y.value,x.value)}return{status:t.value,value:o}}}}wt.create=(a,e,t)=>new wt({valueType:e,keyType:a,typeName:v.ZodMap,...k(t)});class pe extends b{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.set)return l(n,{code:d.invalid_type,expected:m.set,received:n.parsedType}),_;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(l(n,{code:d.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(l(n,{code:d.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const r=this._def.valueType;function i(p){const y=new Set;for(const x of p){if(x.status==="aborted")return _;x.status==="dirty"&&t.dirty(),y.add(x.value)}return{status:t.value,value:y}}const o=[...n.data.values()].map((p,y)=>r._parse(new j(n,p,n.path,y)));return n.common.async?Promise.all(o).then(p=>i(p)):i(o)}min(e,t){return new pe({...this._def,minSize:{value:e,message:f.toString(t)}})}max(e,t){return new pe({...this._def,maxSize:{value:e,message:f.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}pe.create=(a,e)=>new pe({valueType:a,minSize:null,maxSize:null,typeName:v.ZodSet,...k(e)});class Tt extends b{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})}}Tt.create=(a,e)=>new Tt({getter:a,typeName:v.ZodLazy,...k(e)});class Le extends b{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}Le.create=(a,e)=>new Le({value:a,typeName:v.ZodLiteral,...k(e)});function It(a,e){return new J({values:a,typeName:v.ZodEnum,...k(e)})}class J extends b{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{expected:C.joinValues(n),received:t.parsedType,code:d.invalid_type}),_}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{received:t.data,code:d.invalid_enum_value,options:n}),_}return Z(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return J.create(e,{...this._def,...t})}exclude(e,t=this._def){return J.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}J.create=It;class Ot extends b{_parse(e){const t=C.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==m.string&&n.parsedType!==m.number){const s=C.objectValues(t);return l(n,{expected:C.joinValues(s),received:n.parsedType,code:d.invalid_type}),_}if(this._cache||(this._cache=new Set(C.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=C.objectValues(t);return l(n,{received:n.data,code:d.invalid_enum_value,options:s}),_}return Z(e.data)}get enum(){return this._def.values}}Ot.create=(a,e)=>new Ot({values:a,typeName:v.ZodNativeEnum,...k(e)});class Te extends b{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==m.promise&&t.common.async===!1)return l(t,{code:d.invalid_type,expected:m.promise,received:t.parsedType}),_;const n=t.parsedType===m.promise?t.data:Promise.resolve(t.data);return Z(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Te.create=(a,e)=>new Te({type:a,typeName:v.ZodPromise,...k(e)});class Y extends b{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===v.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,r={addIssue:i=>{l(n,i),i.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),s.type==="preprocess"){const i=s.transform(n.data,r);if(n.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return _;const p=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return p.status==="aborted"?_:p.status==="dirty"||t.value==="dirty"?me(p.value):p});{if(t.value==="aborted")return _;const o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?_:o.status==="dirty"||t.value==="dirty"?me(o.value):o}}if(s.type==="refinement"){const i=o=>{const p=s.refinement(o,r);if(n.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?_:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?_:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!U(i))return _;const o=s.transform(i.value,r);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>U(i)?Promise.resolve(s.transform(i.value,r)).then(o=>({status:t.value,value:o})):_);C.assertNever(s)}}Y.create=(a,e,t)=>new Y({schema:a,typeName:v.ZodEffects,effect:e,...k(t)}),Y.createWithPreprocess=(a,e,t)=>new Y({schema:e,effect:{type:"preprocess",transform:a},typeName:v.ZodEffects,...k(t)});class M extends b{_parse(e){return this._getType(e)===m.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}M.create=(a,e)=>new M({innerType:a,typeName:v.ZodOptional,...k(e)});class X extends b{_parse(e){return this._getType(e)===m.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}X.create=(a,e)=>new X({innerType:a,typeName:v.ZodNullable,...k(e)});class Fe extends b{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===m.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Fe.create=(a,e)=>new Fe({innerType:a,typeName:v.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...k(e)});class We extends b{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ke(s)?s.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new V(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new V(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}We.create=(a,e)=>new We({innerType:a,typeName:v.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...k(e)});class At extends b{_parse(e){if(this._getType(e)!==m.nan){const n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.nan,received:n.parsedType}),_}return{status:"valid",value:e.data}}}At.create=a=>new At({typeName:v.ZodNaN,...k(a)});class Ia extends b{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ue extends b{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const r=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?_:r.status==="dirty"?(t.dirty(),me(r.value)):this._def.out._parseAsync({data:r.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?_:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new Ue({in:e,out:t,typeName:v.ZodPipeline})}}class Ge extends b{_parse(e){const t=this._def.innerType._parse(e),n=s=>(U(s)&&(s.value=Object.freeze(s.value)),s);return ke(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}}Ge.create=(a,e)=>new Ge({innerType:a,typeName:v.ZodReadonly,...k(e)});var v;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(v||(v={}));const c=P.create,g=G.create,T=Be.create,Oa=Me.create;B.create;const N=D.create,h=A.create,Q=xe.create;Ce.create;const He=L.create,z=we.create,w=Le.create,q=J.create;Te.create;const S=M.create;X.create;const Rt=()=>T().optional(),K=q(["left","right","up","down"]),Aa=K.options,Ie=h({type:c(),id:c(),name:S(c()),status:S(c())}),Nt=h({height:g(),width:g(),sprite:c().optional(),direction:S(K),filter:S(c())}),Zt=h({room:S(c()),x:g(),y:g()}),ye=h({imageId:c(),col:g().optional(),row:g().optional()}),I=h({text:c().array()}),Et=h({x:g(),y:g()}),Oe=h({soundId:c(),volume:g().optional()}),Ae={_started:Rt(),narrative:I.optional(),startDirection:K.optional(),endDirection:K.optional(),endStatus:c().optional()},Ra={_started:!0,narrative:!0,startDirection:!0,endDirection:!0,endStatus:!0,type:!0},Na=h({animation:S(c()),x:g(),y:g(),speed:S(g())}),qt=h({type:w("move"),roomId:c().optional(),pathIsSet:S(T()),doPendingInteractionWhenFinished:S(T()),steps:N(Na)}).extend(Ae),jt=h({type:w("goTo"),animation:S(c()),speed:S(g()),targetId:c()}).extend(Ae),Dt=h({type:w("say"),animation:S(c()),text:c(),time:g()}).extend(Ae),Za=h({animation:S(c()),duration:g(),timeElapsed:S(g()),reverse:S(T())}),Vt=h({type:w("act"),steps:N(Za)}).extend(Ae),ge=Q([qt,Vt,Dt,jt]),Ea=ge.options.map(a=>a.shape.type.value),Re=h({type:w("order"),actorId:c().optional(),orders:N(ge),replaceCurrentOrders:S(T()),narrative:I.optional()}),ee=h({type:w("changeRoom"),roomId:c(),takePlayer:T(),x:S(g()),y:S(g()),narrative:I.optional()}),te=h({type:w("inventory"),itemId:c(),actorId:c().optional(),addOrRemove:q(["ADD","REMOVE"]),narrative:I.optional()}),ae=h({type:w("removeActor"),actorId:c(),narrative:I.optional()}),ne=h({type:w("changeStatus"),targetId:c(),targetType:q(["actor","item","hotspot"]),status:c(),narrative:I.optional()}),Ne=h({type:w("sequence"),sequence:c(),narrative:I.optional()}),se=h({type:w("conversation"),conversationId:c(),end:S(T()),narrative:I.optional()}),re=h({type:w("conversationChoice"),on:T(),conversationId:c(),branchId:c(),choiceRef:c(),narrative:I.optional()}),ie=h({type:w("teleportActor"),actorId:c(),roomId:S(c()),x:g(),y:g(),narrative:I.optional()}),F=h({type:w("toggleZone"),roomId:S(c()),on:T(),ref:c(),zoneType:q(["hotspot","obstacle","walkable"]),narrative:I.optional()}),oe=h({type:w("soundEffect"),sound:c(),volume:g().optional(),narrative:I.optional()}),ce=h({type:w("backgroundMusic"),sound:c().optional(),roomId:c().optional(),volume:g().optional(),narrative:I.optional()}),de=h({type:w("ambientNoise"),sound:c().optional(),roomId:c().optional(),volume:g().optional(),narrative:I.optional()}),ue=h({type:w("flag"),on:T(),flag:c(),narrative:I.optional()}),le=h({type:w("storyBoardConsequence"),storyBoardId:c(),narrative:I.optional()}),he=h({type:w("changePlayerCharacterConsequence"),actorId:c(),narrative:I.optional()}),qa=F.shape.zoneType.options,Pt=Q([Re,ee,te,ae,ne,Ne,se,ie,F,oe,ce,de,ue,re,le,he]),ja=q(["conversation","sequence","changeStatus","backgroundMusic","ambientNoise","removeActor","inventory","changeRoom","order","teleportActor","toggleZone","soundEffect","flag","conversationChoice","storyBoardConsequence","changePlayerCharacterConsequence"]).options,Da={conversation:se,sequence:Ne,changeStatus:ne,removeActor:ae,inventory:te,changeRoom:ee,order:Re,teleportActor:ie,toggleZone:F,soundEffect:oe,flag:ue,conversationChoice:re,backgroundMusic:ce,ambientNoise:de,storyBoardConsequence:le,changePlayerCharacterConsequence:he},Je=Q([ae,ne,te,se,ie,F,oe,ue,ee,re,ce,de,le,he]),Va=Je.options.map(a=>a.shape.type.value),Ze=h({verbId:c(),targetId:c(),roomId:c().optional(),itemId:c().optional(),targetStatus:c().optional(),mustReachFirst:T().optional(),consequences:N(Pt),flagsThatMustBeFalse:N(c()).optional(),flagsThatMustBeTrue:N(c()).optional(),requiredInventory:N(c()).optional()}),Ye=h({actorOrders:S(z(c(),ge.array())),immediateConsequences:S(Je.array()),narrative:I.optional(),_started:Rt()}),ve=h({id:c(),description:c().optional(),stages:Ye.array()}),$t=h({conversationId:c().optional(),branchId:c().optional(),choiceRef:c().optional()}),Xe=h({ref:c().optional(),text:c(),sequence:c().optional(),nextBranch:S(c()),once:S(T()),disabled:S(T()),enablesChoices:N($t).optional(),disablesChoices:N($t).optional(),end:S(T()),choiceSequence:ve.optional()}),Bt=h({choices:N(Xe)}),Qe=h({id:c(),branches:z(c(),S(Bt)),currentBranch:S(c()),defaultBranch:c()}),Ke=h({id:c(),message:c(),imageId:c().optional(),imageWidth:g().optional()}),et=h({type:w("ending"),endingId:c(),narrative:I.optional()}),Pa=Q([Re,ee,te,ae,ne,Ne,se,ie,F,oe,ce,de,ue,re,le,he,et]),Mt=Q([ae,ne,te,se,ie,F,oe,ue,ee,re,ce,de,le,he,et]),tt=Ze.merge(h({consequences:N(Pa)})),Ee=ve.merge(h({stages:Ye.merge(h({immediateConsequences:S(Mt.array())})).array()})),$a=Xe.merge(h({choiceSequence:Ee.optional()})),Ba=h({choices:N($a)}),at=Qe.merge(h({branches:z(c(),S(Ba))})),nt=h({soundId:c(),frameIndex:g().optional(),volume:g().optional()}),Ma=z(c(),nt.or(nt.array()).or(Oa())),qe=Ie.merge(Zt).merge(Nt).merge(h({type:w("actor"),isPlayer:S(T()),noInteraction:S(T()),speed:S(g()),baseline:S(g()),dialogueColor:S(c()),soundEffectMap:Ma.optional(),walkToX:g().optional(),walkToY:g().optional(),defaultFrame:ye.optional(),statusFrames:z(ye).optional()})),zt=h({value:T(),default:T(),description:c().optional()}),st=z(c(),zt.optional()),_e=Ie.extend({type:w("item"),actorId:c().optional()}).and(ye.partial());q(["rect","circle","polygon"]);const za=N(He([g(),g()])),Lt=h({type:c().optional(),x:g(),y:g(),path:S(c()),polygon:S(za),circle:S(g()),rect:S(He([g(),g()]))}),rt=Lt.merge(h({ref:c().optional(),disabled:T().optional()})),it=Lt.merge(Ie).merge(h({type:w("hotspot"),parallax:g(),walkToX:g().optional(),walkToY:g().optional()})),La=h({parallax:g(),imageId:c(),placement:h({x:g(),y:g(),width:g(),height:g()}).optional()}),Fa=N(He([g(),g()])),ot=h({id:c(),frameWidth:g(),frameHeight:g().optional(),width:g(),height:g(),background:La.array(),hotspots:it.array().optional(),obstacleAreas:S(rt.array()),walkableAreas:S(rt.array()),scaling:S(Fa),backgroundColor:c().optional(),name:c().optional(),narrative:I.optional(),backgroundMusic:Oe.optional(),ambientNoise:Oe.optional()}),Se=h({imageId:c(),row:g(),col:g()}),Wa=h({left:Se.array().optional(),right:Se.array().optional(),up:Se.array().optional(),down:Se.array().optional()}),ct=h({id:c(),defaultDirection:K,animations:z(c(),Wa)}),Ft=q(["center","left","right"]),Wt=q(["center","top","bottom"]),Ua=h({x:Ft,y:Wt,width:g().optional(),height:g().optional(),aspectRatio:Et.optional()}).merge(h({image:ye})),Ut=h({title:c(),narrative:I,pictures:Ua.array(),backgroundColor:c(),color:c()}),Gt=q(["sound","buttons"]),Ht=q(["serif","sans-serif","monospace","cursive","fantasy","math"]),dt=h({id:c(),isEndOfGame:T().optional(),pages:Ut.array(),font:Ht.optional(),sound:Oe.optional(),progression:Gt.optional()}),je=h({id:c(),label:c(),preposition:c().optional(),isMoveVerb:T().optional(),isNotForItems:T().optional(),isLookVerb:T().optional(),requiresItem:T().optional(),defaultResponseNoItem:c().optional(),defaultResponseWithItem:c().optional(),defaultResponseCannotReach:c().optional()}),Ga=h({schemaVersion:g().optional(),rooms:ot.array(),items:_e.array(),actors:qe.array(),interactions:tt.array(),conversations:at.array(),flagMap:st,currentRoomId:c(),id:c(),description:c().optional().describe("a short description of your game"),thumbnailAssetId:c().optional()}),Ha=h({verbs:je.array(),sequences:Ee.array(),sprites:ct.array(),endings:Ke.array(),openingSequenceId:c().optional(),openingStoryboardId:c().optional(),storyBoards:dt.array().optional()}),Jt=Ga.and(Ha).describe("The game schema"),De=4,Yt=h({sequenceRunning:ve.optional(),currentStoryBoardId:c().optional(),actorOrders:z(c(),ge.array()),currentConversationId:c().optional(),pendingInteraction:Ze.optional(),gameNotBegun:T()}),Ve=h({schemaVersion:w(De),rooms:ot.array(),items:_e.array(),actors:qe.array(),interactions:Ze.array(),conversations:Qe.array(),flagMap:st,currentRoomId:c(),id:c(),description:c().optional().describe("a short description of your game"),thumbnailAssetId:c().optional()}),ut=h({verbs:je.array(),sequences:ve.array(),sprites:ct.array(),openingSequenceId:c().optional(),openingStoryboardId:c().optional(),storyBoards:dt.array()}),Ja=Ve.and(Yt),Xt=Ve.and(ut).describe("The game schema"),Ya=q(["rooms","items","actors","conversations","sprites","sequences","verbs","storyBoards"]),Xa=Ve.merge(h({schemaVersion:w(3),interactions:tt.array(),conversations:at.array()})),Qa=ut.merge(h({endings:Ke.array(),sequences:Ee.array()})),Qt=Xa.and(Qa).describe("The game schema"),Kt=Q([qe,_e,it]),Ka=h({verb:je,target:Kt,item:S(_e)}),en=a=>({...a,storyBoards:a.storyBoards??[],schemaVersion:3}),tn=a=>ea(en(a)),an=(a,e)=>{const t=a.imageId?{x:"center",y:"center",width:a.imageWidth?a.imageWidth/16:20,height:a.imageWidth?a.imageWidth/16:20,image:{imageId:a.imageId}}:void 0;return{id:e??a.id,isEndOfGame:!0,pages:[{title:a.message,narrative:{text:[]},color:"#FFFFFF",backgroundColor:"#000000",pictures:t?[t]:[]}]}},nn=(a,e)=>{const t=e.filter(s=>s.startsWith(a)),n=(s=1)=>{const r=`${a}_${s}`;return t.includes(r)?n(s+1):r};return n()},ea=a=>{const{storyBoards:e,interactions:t,sequences:n,conversations:s}=a,r=e.map(O=>O.id),i={},o=a.endings.map(O=>{const E=r.includes(O.id)?nn(O.id,r):void 0;return E&&r.push(E),i[O.id]=E??O.id,an(O,E)}),p=O=>O.type!=="ending"?O:{type:"storyBoardConsequence",storyBoardId:i[O.endingId]??O.endingId,narrative:O.narrative},y=O=>({...O,stages:O.stages.map(E=>({...E,immediateConsequences:E.immediateConsequences?.map(p)}))}),x=O=>{const{branches:E}=O;for(let on in E){const ht=E[on];ht&&(ht.choices=ht.choices.map(mt=>({...mt,choiceSequence:mt.choiceSequence?y(mt.choiceSequence):void 0})))}return{...O,branches:E}},W=t.map(O=>({...O,consequences:O.consequences.map(p)})),lt=n.map(y),rn=s.map(x);return{...a,storyBoards:[...e,...o],interactions:W,sequences:lt,conversations:rn,schemaVersion:De}},sn=a=>{const e=Xt.safeParse(a);if(e.success)return{success:!0,gameDesign:e.data,sourceVersion:De,updated:!1};const t=Qt.safeParse(a);if(t.success)return{success:!0,gameDesign:ea(t.data),sourceVersion:3,updated:!0};const n=Jt.safeParse(a);return n.success?{success:!0,gameDesign:tn(n.data),sourceVersion:2,updated:!0}:{success:!1,failureMessage:n.error.message}};return u.ActOrderSchema=Vt,u.ActorDataSchema=qe,u.AmbientNoiseConsequenceSchema=de,u.AspectRatioSchema=Et,u.BackgroundMusicConsequenceSchema=ce,u.BoardFontSchema=Ht,u.BoardProgressionSchema=Gt,u.ChangePlayerCharacterConsequenceSchema=he,u.ChangeRoomConsequenceSchema=ee,u.ChangeStatusConsequenceSchema=ne,u.CommandSchema=Ka,u.CommandTargetSchema=Kt,u.ConsequenceSchema=Pt,u.ConversationBranchSchema=Bt,u.ConversationChoiceConsequenceSchema=re,u.ConversationChoiceSchema=Xe,u.ConversationConsequenceSchema=se,u.ConversationSchema=Qe,u.ConversationSchemaWithDeprecatedConsequences=at,u.DB_VERSION=De,u.DirectionEnum=K,u.EndingConsequenceSchema=et,u.EndingSchema=Ke,u.FixedGameInfoSchema=ut,u.FlagConsequenceSchema=ue,u.FlagMapSchema=st,u.FlagSchema=zt,u.GameContentsDataSchema=Ve,u.GameDataItemTypeEnum=Ya,u.GameDataSchema=Ja,u.GameDesignSchema=Xt,u.GameHappeningsSchema=Yt,u.GotoOrderSchema=jt,u.HotspotZoneSchema=it,u.IdentSchema=Ie,u.ImmediateConsequenceSchema=Je,u.ImmediateConsequenceSchemaWithDeprecated=Mt,u.InteractionSchema=Ze,u.InteractionSchemaWithDeprecatedConsequences=tt,u.InventoryConsequenceSchema=te,u.ItemDataSchema=_e,u.MoveOrderSchema=qt,u.NarrativeSchema=I,u.OrderConsequenceSchema=Re,u.PositionSchema=Zt,u.RemoveActorConsequenceSchema=ae,u.RoomDataSchema=ot,u.SayOrderSchema=Dt,u.SequenceConsequenceSchema=Ne,u.SequenceSchema=ve,u.SequenceSchemaWithDeprecatedConsequences=Ee,u.SoundEffectConsequenceSchema=oe,u.SoundValueSchema=nt,u.SpriteDataSchema=ct,u.SpriteFrameSchema=Se,u.SpriteParamsSchema=Nt,u.StageSchema=Ye,u.StaticFrameParamsSchema=ye,u.StoryBoardConsequenceSchema=le,u.StoryBoardPageSchema=Ut,u.StoryBoardSchema=dt,u.TeleportActorConsequenceSchema=ie,u.ToggleZoneConsequenceSchema=F,u.VerbSchema=je,u.ZoneSchema=rt,u.changeHistory=ta,u.consequenceMap=Da,u.consequenceTypes=ja,u.directions=Aa,u.immediateConsequenceTypes=Va,u.orderBaseOmits=Ra,u.orderSchema=ge,u.orderTypes=Ea,u.parseAndUpgrade=sn,u.soundInstanceSchema=Oe,u.v2GameDesignSchema=Jt,u.v3GameDesignSchema=Qt,u.xPlacement=Ft,u.yPlacement=Wt,u.zoneTypes=qa,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),u})({});
|
|
1
|
+
var PointClickLib=(function(k){"use strict";const Dl=[{schemaVersion:3,changes:[{breaking:!1,description:"Designs have schemaVersion property"},{breaking:!1,description:"storyBoards array is required"}]},{schemaVersion:4,changes:[{breaking:!0,description:"Endings deprecated in favour of storyBoards. Any Endings have been converted to Storyboards."},{breaking:!1,description:"StoryBoards have end of game option."}]}];var se;(function(s){s.assertEqual=c=>{};function r(c){}s.assertIs=r;function i(c){throw new Error}s.assertNever=i,s.arrayToEnum=c=>{const f={};for(const p of c)f[p]=p;return f},s.getValidEnumValues=c=>{const f=s.objectKeys(c).filter(_=>typeof c[c[_]]!="number"),p={};for(const _ of f)p[_]=c[_];return s.objectValues(p)},s.objectValues=c=>s.objectKeys(c).map(function(f){return c[f]}),s.objectKeys=typeof Object.keys=="function"?c=>Object.keys(c):c=>{const f=[];for(const p in c)Object.prototype.hasOwnProperty.call(c,p)&&f.push(p);return f},s.find=(c,f)=>{for(const p of c)if(f(p))return p},s.isInteger=typeof Number.isInteger=="function"?c=>Number.isInteger(c):c=>typeof c=="number"&&Number.isFinite(c)&&Math.floor(c)===c;function o(c,f=" | "){return c.map(p=>typeof p=="string"?`'${p}'`:p).join(f)}s.joinValues=o,s.jsonStringifyReplacer=(c,f)=>typeof f=="bigint"?f.toString():f})(se||(se={}));var ua;(function(s){s.mergeShapes=(r,i)=>({...r,...i})})(ua||(ua={}));const P=se.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),It=s=>{switch(typeof s){case"undefined":return P.undefined;case"string":return P.string;case"number":return Number.isNaN(s)?P.nan:P.number;case"boolean":return P.boolean;case"function":return P.function;case"bigint":return P.bigint;case"symbol":return P.symbol;case"object":return Array.isArray(s)?P.array:s===null?P.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?P.promise:typeof Map<"u"&&s instanceof Map?P.map:typeof Set<"u"&&s instanceof Set?P.set:typeof Date<"u"&&s instanceof Date?P.date:P.object;default:return P.unknown}},O=se.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"]),Bl=s=>JSON.stringify(s,null,2).replace(/"([^"]+)":/g,"$1:");class He extends Error{get errors(){return this.issues}constructor(r){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=r}format(r){const i=r||function(f){return f.message},o={_errors:[]},c=f=>{for(const p of f.issues)if(p.code==="invalid_union")p.unionErrors.map(c);else if(p.code==="invalid_return_type")c(p.returnTypeError);else if(p.code==="invalid_arguments")c(p.argumentsError);else if(p.path.length===0)o._errors.push(i(p));else{let _=o,w=0;for(;w<p.path.length;){const y=p.path[w];w===p.path.length-1?(_[y]=_[y]||{_errors:[]},_[y]._errors.push(i(p))):_[y]=_[y]||{_errors:[]},_=_[y],w++}}};return c(this),o}static assert(r){if(!(r instanceof He))throw new Error(`Not a ZodError: ${r}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,se.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(r=i=>i.message){const i={},o=[];for(const c of this.issues)if(c.path.length>0){const f=c.path[0];i[f]=i[f]||[],i[f].push(r(c))}else o.push(r(c));return{formErrors:o,fieldErrors:i}}get formErrors(){return this.flatten()}}He.create=s=>new He(s);const vn=(s,r)=>{let i;switch(s.code){case O.invalid_type:s.received===P.undefined?i="Required":i=`Expected ${s.expected}, received ${s.received}`;break;case O.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(s.expected,se.jsonStringifyReplacer)}`;break;case O.unrecognized_keys:i=`Unrecognized key(s) in object: ${se.joinValues(s.keys,", ")}`;break;case O.invalid_union:i="Invalid input";break;case O.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${se.joinValues(s.options)}`;break;case O.invalid_enum_value:i=`Invalid enum value. Expected ${se.joinValues(s.options)}, received '${s.received}'`;break;case O.invalid_arguments:i="Invalid function arguments";break;case O.invalid_return_type:i="Invalid function return type";break;case O.invalid_date:i="Invalid date";break;case O.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(i=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?i=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?i=`Invalid input: must end with "${s.validation.endsWith}"`:se.assertNever(s.validation):s.validation!=="regex"?i=`Invalid ${s.validation}`:i="Invalid";break;case O.too_small:s.type==="array"?i=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?i=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?i=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?i=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?i=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:i="Invalid input";break;case O.too_big:s.type==="array"?i=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?i=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?i=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?i=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?i=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:i="Invalid input";break;case O.custom:i="Invalid input";break;case O.invalid_intersection_types:i="Intersection results could not be merged";break;case O.not_multiple_of:i=`Number must be a multiple of ${s.multipleOf}`;break;case O.not_finite:i="Number must be finite";break;default:i=r.defaultError,se.assertNever(s)}return{message:i}};let ro=vn;function Fl(s){ro=s}function Kr(){return ro}const Xr=s=>{const{data:r,path:i,errorMaps:o,issueData:c}=s,f=[...i,...c.path||[]],p={...c,path:f};if(c.message!==void 0)return{...c,path:f,message:c.message};let _="";const w=o.filter(y=>!!y).slice().reverse();for(const y of w)_=y(p,{data:r,defaultError:_}).message;return{...c,path:f,message:_}},Wl=[];function L(s,r){const i=Kr(),o=Xr({issueData:r,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,i,i===vn?void 0:vn].filter(c=>!!c)});s.common.issues.push(o)}class Ne{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(r,i){const o=[];for(const c of i){if(c.status==="aborted")return U;c.status==="dirty"&&r.dirty(),o.push(c.value)}return{status:r.value,value:o}}static async mergeObjectAsync(r,i){const o=[];for(const c of i){const f=await c.key,p=await c.value;o.push({key:f,value:p})}return Ne.mergeObjectSync(r,o)}static mergeObjectSync(r,i){const o={};for(const c of i){const{key:f,value:p}=c;if(f.status==="aborted"||p.status==="aborted")return U;f.status==="dirty"&&r.dirty(),p.status==="dirty"&&r.dirty(),f.value!=="__proto__"&&(typeof p.value<"u"||c.alwaysSet)&&(o[f.value]=p.value)}return{status:r.value,value:o}}}const U=Object.freeze({status:"aborted"}),yn=s=>({status:"dirty",value:s}),De=s=>({status:"valid",value:s}),ca=s=>s.status==="aborted",la=s=>s.status==="dirty",en=s=>s.status==="valid",er=s=>typeof Promise<"u"&&s instanceof Promise;var F;(function(s){s.errToObj=r=>typeof r=="string"?{message:r}:r||{},s.toString=r=>typeof r=="string"?r:r?.message})(F||(F={}));class vt{constructor(r,i,o,c){this._cachedPath=[],this.parent=r,this.data=i,this._path=o,this._key=c}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 io=(s,r)=>{if(en(r))return{success:!0,data:r.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const i=new He(s.common.issues);return this._error=i,this._error}}};function K(s){if(!s)return{};const{errorMap:r,invalid_type_error:i,required_error:o,description:c}=s;if(r&&(i||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return r?{errorMap:r,description:c}:{errorMap:(p,_)=>{const{message:w}=s;return p.code==="invalid_enum_value"?{message:w??_.defaultError}:typeof _.data>"u"?{message:w??o??_.defaultError}:p.code!=="invalid_type"?{message:_.defaultError}:{message:w??i??_.defaultError}},description:c}}class j{get description(){return this._def.description}_getType(r){return It(r.data)}_getOrReturnCtx(r,i){return i||{common:r.parent.common,data:r.data,parsedType:It(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}_processInputParams(r){return{status:new Ne,ctx:{common:r.parent.common,data:r.data,parsedType:It(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}}_parseSync(r){const i=this._parse(r);if(er(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(r){const i=this._parse(r);return Promise.resolve(i)}parse(r,i){const o=this.safeParse(r,i);if(o.success)return o.data;throw o.error}safeParse(r,i){const o={common:{issues:[],async:i?.async??!1,contextualErrorMap:i?.errorMap},path:i?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:It(r)},c=this._parseSync({data:r,path:o.path,parent:o});return io(o,c)}"~validate"(r){const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:It(r)};if(!this["~standard"].async)try{const o=this._parseSync({data:r,path:[],parent:i});return en(o)?{value:o.value}:{issues:i.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:r,path:[],parent:i}).then(o=>en(o)?{value:o.value}:{issues:i.common.issues})}async parseAsync(r,i){const o=await this.safeParseAsync(r,i);if(o.success)return o.data;throw o.error}async safeParseAsync(r,i){const o={common:{issues:[],contextualErrorMap:i?.errorMap,async:!0},path:i?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:It(r)},c=this._parse({data:r,path:o.path,parent:o}),f=await(er(c)?c:Promise.resolve(c));return io(o,f)}refine(r,i){const o=c=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(c):i;return this._refinement((c,f)=>{const p=r(c),_=()=>f.addIssue({code:O.custom,...o(c)});return typeof Promise<"u"&&p instanceof Promise?p.then(w=>w?!0:(_(),!1)):p?!0:(_(),!1)})}refinement(r,i){return this._refinement((o,c)=>r(o)?!0:(c.addIssue(typeof i=="function"?i(o,c):i),!1))}_refinement(r){return new lt({schema:this,typeName:H.ZodEffects,effect:{type:"refinement",refinement:r}})}superRefine(r){return this._refinement(r)}constructor(r){this.spa=this.safeParseAsync,this._def=r,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:i=>this["~validate"](i)}}optional(){return xt.create(this,this._def)}nullable(){return Ut.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ct.create(this)}promise(){return bn.create(this,this._def)}or(r){return ir.create([this,r],this._def)}and(r){return ar.create(this,r,this._def)}transform(r){return new lt({...K(this._def),schema:this,typeName:H.ZodEffects,effect:{type:"transform",transform:r}})}default(r){const i=typeof r=="function"?r:()=>r;return new lr({...K(this._def),innerType:this,defaultValue:i,typeName:H.ZodDefault})}brand(){return new ha({typeName:H.ZodBranded,type:this,...K(this._def)})}catch(r){const i=typeof r=="function"?r:()=>r;return new fr({...K(this._def),innerType:this,catchValue:i,typeName:H.ZodCatch})}describe(r){const i=this.constructor;return new i({...this._def,description:r})}pipe(r){return dr.create(this,r)}readonly(){return hr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ql=/^c[^\s-]{8,}$/i,Zl=/^[0-9a-z]+$/,Ul=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Gl=/^[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,Vl=/^[a-z0-9_-]{21}$/i,Hl=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,zl=/^[-+]?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)?)??$/,$l=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Yl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let fa;const Kl=/^(?:(?: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])$/,Xl=/^(?:(?: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])$/,Jl=/^(([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]))$/,jl=/^(([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])$/,Ql=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ef=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ao="((\\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])))",tf=new RegExp(`^${ao}$`);function so(s){let r="[0-5]\\d";s.precision?r=`${r}\\.\\d{${s.precision}}`:s.precision==null&&(r=`${r}(\\.\\d+)?`);const i=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${r})${i}`}function nf(s){return new RegExp(`^${so(s)}$`)}function oo(s){let r=`${ao}T${so(s)}`;const i=[];return i.push(s.local?"Z?":"Z"),s.offset&&i.push("([+-]\\d{2}:?\\d{2})"),r=`${r}(${i.join("|")})`,new RegExp(`^${r}$`)}function rf(s,r){return!!((r==="v4"||!r)&&Kl.test(s)||(r==="v6"||!r)&&Jl.test(s))}function af(s,r){if(!Hl.test(s))return!1;try{const[i]=s.split(".");if(!i)return!1;const o=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),c=JSON.parse(atob(o));return!(typeof c!="object"||c===null||"typ"in c&&c?.typ!=="JWT"||!c.alg||r&&c.alg!==r)}catch{return!1}}function sf(s,r){return!!((r==="v4"||!r)&&Xl.test(s)||(r==="v6"||!r)&&jl.test(s))}class ut extends j{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==P.string){const f=this._getOrReturnCtx(r);return L(f,{code:O.invalid_type,expected:P.string,received:f.parsedType}),U}const o=new Ne;let c;for(const f of this._def.checks)if(f.kind==="min")r.data.length<f.value&&(c=this._getOrReturnCtx(r,c),L(c,{code:O.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),o.dirty());else if(f.kind==="max")r.data.length>f.value&&(c=this._getOrReturnCtx(r,c),L(c,{code:O.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),o.dirty());else if(f.kind==="length"){const p=r.data.length>f.value,_=r.data.length<f.value;(p||_)&&(c=this._getOrReturnCtx(r,c),p?L(c,{code:O.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}):_&&L(c,{code:O.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}),o.dirty())}else if(f.kind==="email")$l.test(r.data)||(c=this._getOrReturnCtx(r,c),L(c,{validation:"email",code:O.invalid_string,message:f.message}),o.dirty());else if(f.kind==="emoji")fa||(fa=new RegExp(Yl,"u")),fa.test(r.data)||(c=this._getOrReturnCtx(r,c),L(c,{validation:"emoji",code:O.invalid_string,message:f.message}),o.dirty());else if(f.kind==="uuid")Gl.test(r.data)||(c=this._getOrReturnCtx(r,c),L(c,{validation:"uuid",code:O.invalid_string,message:f.message}),o.dirty());else if(f.kind==="nanoid")Vl.test(r.data)||(c=this._getOrReturnCtx(r,c),L(c,{validation:"nanoid",code:O.invalid_string,message:f.message}),o.dirty());else if(f.kind==="cuid")ql.test(r.data)||(c=this._getOrReturnCtx(r,c),L(c,{validation:"cuid",code:O.invalid_string,message:f.message}),o.dirty());else if(f.kind==="cuid2")Zl.test(r.data)||(c=this._getOrReturnCtx(r,c),L(c,{validation:"cuid2",code:O.invalid_string,message:f.message}),o.dirty());else if(f.kind==="ulid")Ul.test(r.data)||(c=this._getOrReturnCtx(r,c),L(c,{validation:"ulid",code:O.invalid_string,message:f.message}),o.dirty());else if(f.kind==="url")try{new URL(r.data)}catch{c=this._getOrReturnCtx(r,c),L(c,{validation:"url",code:O.invalid_string,message:f.message}),o.dirty()}else f.kind==="regex"?(f.regex.lastIndex=0,f.regex.test(r.data)||(c=this._getOrReturnCtx(r,c),L(c,{validation:"regex",code:O.invalid_string,message:f.message}),o.dirty())):f.kind==="trim"?r.data=r.data.trim():f.kind==="includes"?r.data.includes(f.value,f.position)||(c=this._getOrReturnCtx(r,c),L(c,{code:O.invalid_string,validation:{includes:f.value,position:f.position},message:f.message}),o.dirty()):f.kind==="toLowerCase"?r.data=r.data.toLowerCase():f.kind==="toUpperCase"?r.data=r.data.toUpperCase():f.kind==="startsWith"?r.data.startsWith(f.value)||(c=this._getOrReturnCtx(r,c),L(c,{code:O.invalid_string,validation:{startsWith:f.value},message:f.message}),o.dirty()):f.kind==="endsWith"?r.data.endsWith(f.value)||(c=this._getOrReturnCtx(r,c),L(c,{code:O.invalid_string,validation:{endsWith:f.value},message:f.message}),o.dirty()):f.kind==="datetime"?oo(f).test(r.data)||(c=this._getOrReturnCtx(r,c),L(c,{code:O.invalid_string,validation:"datetime",message:f.message}),o.dirty()):f.kind==="date"?tf.test(r.data)||(c=this._getOrReturnCtx(r,c),L(c,{code:O.invalid_string,validation:"date",message:f.message}),o.dirty()):f.kind==="time"?nf(f).test(r.data)||(c=this._getOrReturnCtx(r,c),L(c,{code:O.invalid_string,validation:"time",message:f.message}),o.dirty()):f.kind==="duration"?zl.test(r.data)||(c=this._getOrReturnCtx(r,c),L(c,{validation:"duration",code:O.invalid_string,message:f.message}),o.dirty()):f.kind==="ip"?rf(r.data,f.version)||(c=this._getOrReturnCtx(r,c),L(c,{validation:"ip",code:O.invalid_string,message:f.message}),o.dirty()):f.kind==="jwt"?af(r.data,f.alg)||(c=this._getOrReturnCtx(r,c),L(c,{validation:"jwt",code:O.invalid_string,message:f.message}),o.dirty()):f.kind==="cidr"?sf(r.data,f.version)||(c=this._getOrReturnCtx(r,c),L(c,{validation:"cidr",code:O.invalid_string,message:f.message}),o.dirty()):f.kind==="base64"?Ql.test(r.data)||(c=this._getOrReturnCtx(r,c),L(c,{validation:"base64",code:O.invalid_string,message:f.message}),o.dirty()):f.kind==="base64url"?ef.test(r.data)||(c=this._getOrReturnCtx(r,c),L(c,{validation:"base64url",code:O.invalid_string,message:f.message}),o.dirty()):se.assertNever(f);return{status:o.value,value:r.data}}_regex(r,i,o){return this.refinement(c=>r.test(c),{validation:i,code:O.invalid_string,...F.errToObj(o)})}_addCheck(r){return new ut({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",...F.errToObj(r)})}url(r){return this._addCheck({kind:"url",...F.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",...F.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",...F.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",...F.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",...F.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",...F.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",...F.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",...F.errToObj(r)})}base64url(r){return this._addCheck({kind:"base64url",...F.errToObj(r)})}jwt(r){return this._addCheck({kind:"jwt",...F.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",...F.errToObj(r)})}cidr(r){return this._addCheck({kind:"cidr",...F.errToObj(r)})}datetime(r){return typeof r=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:r}):this._addCheck({kind:"datetime",precision:typeof r?.precision>"u"?null:r?.precision,offset:r?.offset??!1,local:r?.local??!1,...F.errToObj(r?.message)})}date(r){return this._addCheck({kind:"date",message:r})}time(r){return typeof r=="string"?this._addCheck({kind:"time",precision:null,message:r}):this._addCheck({kind:"time",precision:typeof r?.precision>"u"?null:r?.precision,...F.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",...F.errToObj(r)})}regex(r,i){return this._addCheck({kind:"regex",regex:r,...F.errToObj(i)})}includes(r,i){return this._addCheck({kind:"includes",value:r,position:i?.position,...F.errToObj(i?.message)})}startsWith(r,i){return this._addCheck({kind:"startsWith",value:r,...F.errToObj(i)})}endsWith(r,i){return this._addCheck({kind:"endsWith",value:r,...F.errToObj(i)})}min(r,i){return this._addCheck({kind:"min",value:r,...F.errToObj(i)})}max(r,i){return this._addCheck({kind:"max",value:r,...F.errToObj(i)})}length(r,i){return this._addCheck({kind:"length",value:r,...F.errToObj(i)})}nonempty(r){return this.min(1,F.errToObj(r))}trim(){return new ut({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ut({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ut({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(r=>r.kind==="datetime")}get isDate(){return!!this._def.checks.find(r=>r.kind==="date")}get isTime(){return!!this._def.checks.find(r=>r.kind==="time")}get isDuration(){return!!this._def.checks.find(r=>r.kind==="duration")}get isEmail(){return!!this._def.checks.find(r=>r.kind==="email")}get isURL(){return!!this._def.checks.find(r=>r.kind==="url")}get isEmoji(){return!!this._def.checks.find(r=>r.kind==="emoji")}get isUUID(){return!!this._def.checks.find(r=>r.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(r=>r.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(r=>r.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(r=>r.kind==="cuid2")}get isULID(){return!!this._def.checks.find(r=>r.kind==="ulid")}get isIP(){return!!this._def.checks.find(r=>r.kind==="ip")}get isCIDR(){return!!this._def.checks.find(r=>r.kind==="cidr")}get isBase64(){return!!this._def.checks.find(r=>r.kind==="base64")}get isBase64url(){return!!this._def.checks.find(r=>r.kind==="base64url")}get minLength(){let r=null;for(const i of this._def.checks)i.kind==="min"&&(r===null||i.value>r)&&(r=i.value);return r}get maxLength(){let r=null;for(const i of this._def.checks)i.kind==="max"&&(r===null||i.value<r)&&(r=i.value);return r}}ut.create=s=>new ut({checks:[],typeName:H.ZodString,coerce:s?.coerce??!1,...K(s)});function of(s,r){const i=(s.toString().split(".")[1]||"").length,o=(r.toString().split(".")[1]||"").length,c=i>o?i:o,f=Number.parseInt(s.toFixed(c).replace(".","")),p=Number.parseInt(r.toFixed(c).replace(".",""));return f%p/10**c}class Wt extends j{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){if(this._def.coerce&&(r.data=Number(r.data)),this._getType(r)!==P.number){const f=this._getOrReturnCtx(r);return L(f,{code:O.invalid_type,expected:P.number,received:f.parsedType}),U}let o;const c=new Ne;for(const f of this._def.checks)f.kind==="int"?se.isInteger(r.data)||(o=this._getOrReturnCtx(r,o),L(o,{code:O.invalid_type,expected:"integer",received:"float",message:f.message}),c.dirty()):f.kind==="min"?(f.inclusive?r.data<f.value:r.data<=f.value)&&(o=this._getOrReturnCtx(r,o),L(o,{code:O.too_small,minimum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),c.dirty()):f.kind==="max"?(f.inclusive?r.data>f.value:r.data>=f.value)&&(o=this._getOrReturnCtx(r,o),L(o,{code:O.too_big,maximum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),c.dirty()):f.kind==="multipleOf"?of(r.data,f.value)!==0&&(o=this._getOrReturnCtx(r,o),L(o,{code:O.not_multiple_of,multipleOf:f.value,message:f.message}),c.dirty()):f.kind==="finite"?Number.isFinite(r.data)||(o=this._getOrReturnCtx(r,o),L(o,{code:O.not_finite,message:f.message}),c.dirty()):se.assertNever(f);return{status:c.value,value:r.data}}gte(r,i){return this.setLimit("min",r,!0,F.toString(i))}gt(r,i){return this.setLimit("min",r,!1,F.toString(i))}lte(r,i){return this.setLimit("max",r,!0,F.toString(i))}lt(r,i){return this.setLimit("max",r,!1,F.toString(i))}setLimit(r,i,o,c){return new Wt({...this._def,checks:[...this._def.checks,{kind:r,value:i,inclusive:o,message:F.toString(c)}]})}_addCheck(r){return new Wt({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:F.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:F.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:F.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:F.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:F.toString(r)})}multipleOf(r,i){return this._addCheck({kind:"multipleOf",value:r,message:F.toString(i)})}finite(r){return this._addCheck({kind:"finite",message:F.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:F.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:F.toString(r)})}get minValue(){let r=null;for(const i of this._def.checks)i.kind==="min"&&(r===null||i.value>r)&&(r=i.value);return r}get maxValue(){let r=null;for(const i of this._def.checks)i.kind==="max"&&(r===null||i.value<r)&&(r=i.value);return r}get isInt(){return!!this._def.checks.find(r=>r.kind==="int"||r.kind==="multipleOf"&&se.isInteger(r.value))}get isFinite(){let r=null,i=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(i===null||o.value>i)&&(i=o.value):o.kind==="max"&&(r===null||o.value<r)&&(r=o.value)}return Number.isFinite(i)&&Number.isFinite(r)}}Wt.create=s=>new Wt({checks:[],typeName:H.ZodNumber,coerce:s?.coerce||!1,...K(s)});class qt extends j{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce)try{r.data=BigInt(r.data)}catch{return this._getInvalidInput(r)}if(this._getType(r)!==P.bigint)return this._getInvalidInput(r);let o;const c=new Ne;for(const f of this._def.checks)f.kind==="min"?(f.inclusive?r.data<f.value:r.data<=f.value)&&(o=this._getOrReturnCtx(r,o),L(o,{code:O.too_small,type:"bigint",minimum:f.value,inclusive:f.inclusive,message:f.message}),c.dirty()):f.kind==="max"?(f.inclusive?r.data>f.value:r.data>=f.value)&&(o=this._getOrReturnCtx(r,o),L(o,{code:O.too_big,type:"bigint",maximum:f.value,inclusive:f.inclusive,message:f.message}),c.dirty()):f.kind==="multipleOf"?r.data%f.value!==BigInt(0)&&(o=this._getOrReturnCtx(r,o),L(o,{code:O.not_multiple_of,multipleOf:f.value,message:f.message}),c.dirty()):se.assertNever(f);return{status:c.value,value:r.data}}_getInvalidInput(r){const i=this._getOrReturnCtx(r);return L(i,{code:O.invalid_type,expected:P.bigint,received:i.parsedType}),U}gte(r,i){return this.setLimit("min",r,!0,F.toString(i))}gt(r,i){return this.setLimit("min",r,!1,F.toString(i))}lte(r,i){return this.setLimit("max",r,!0,F.toString(i))}lt(r,i){return this.setLimit("max",r,!1,F.toString(i))}setLimit(r,i,o,c){return new qt({...this._def,checks:[...this._def.checks,{kind:r,value:i,inclusive:o,message:F.toString(c)}]})}_addCheck(r){return new qt({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:F.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:F.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:F.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:F.toString(r)})}multipleOf(r,i){return this._addCheck({kind:"multipleOf",value:r,message:F.toString(i)})}get minValue(){let r=null;for(const i of this._def.checks)i.kind==="min"&&(r===null||i.value>r)&&(r=i.value);return r}get maxValue(){let r=null;for(const i of this._def.checks)i.kind==="max"&&(r===null||i.value<r)&&(r=i.value);return r}}qt.create=s=>new qt({checks:[],typeName:H.ZodBigInt,coerce:s?.coerce??!1,...K(s)});class tr extends j{_parse(r){if(this._def.coerce&&(r.data=!!r.data),this._getType(r)!==P.boolean){const o=this._getOrReturnCtx(r);return L(o,{code:O.invalid_type,expected:P.boolean,received:o.parsedType}),U}return De(r.data)}}tr.create=s=>new tr({typeName:H.ZodBoolean,coerce:s?.coerce||!1,...K(s)});class tn extends j{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==P.date){const f=this._getOrReturnCtx(r);return L(f,{code:O.invalid_type,expected:P.date,received:f.parsedType}),U}if(Number.isNaN(r.data.getTime())){const f=this._getOrReturnCtx(r);return L(f,{code:O.invalid_date}),U}const o=new Ne;let c;for(const f of this._def.checks)f.kind==="min"?r.data.getTime()<f.value&&(c=this._getOrReturnCtx(r,c),L(c,{code:O.too_small,message:f.message,inclusive:!0,exact:!1,minimum:f.value,type:"date"}),o.dirty()):f.kind==="max"?r.data.getTime()>f.value&&(c=this._getOrReturnCtx(r,c),L(c,{code:O.too_big,message:f.message,inclusive:!0,exact:!1,maximum:f.value,type:"date"}),o.dirty()):se.assertNever(f);return{status:o.value,value:new Date(r.data.getTime())}}_addCheck(r){return new tn({...this._def,checks:[...this._def.checks,r]})}min(r,i){return this._addCheck({kind:"min",value:r.getTime(),message:F.toString(i)})}max(r,i){return this._addCheck({kind:"max",value:r.getTime(),message:F.toString(i)})}get minDate(){let r=null;for(const i of this._def.checks)i.kind==="min"&&(r===null||i.value>r)&&(r=i.value);return r!=null?new Date(r):null}get maxDate(){let r=null;for(const i of this._def.checks)i.kind==="max"&&(r===null||i.value<r)&&(r=i.value);return r!=null?new Date(r):null}}tn.create=s=>new tn({checks:[],coerce:s?.coerce||!1,typeName:H.ZodDate,...K(s)});class Jr extends j{_parse(r){if(this._getType(r)!==P.symbol){const o=this._getOrReturnCtx(r);return L(o,{code:O.invalid_type,expected:P.symbol,received:o.parsedType}),U}return De(r.data)}}Jr.create=s=>new Jr({typeName:H.ZodSymbol,...K(s)});class nr extends j{_parse(r){if(this._getType(r)!==P.undefined){const o=this._getOrReturnCtx(r);return L(o,{code:O.invalid_type,expected:P.undefined,received:o.parsedType}),U}return De(r.data)}}nr.create=s=>new nr({typeName:H.ZodUndefined,...K(s)});class rr extends j{_parse(r){if(this._getType(r)!==P.null){const o=this._getOrReturnCtx(r);return L(o,{code:O.invalid_type,expected:P.null,received:o.parsedType}),U}return De(r.data)}}rr.create=s=>new rr({typeName:H.ZodNull,...K(s)});class xn extends j{constructor(){super(...arguments),this._any=!0}_parse(r){return De(r.data)}}xn.create=s=>new xn({typeName:H.ZodAny,...K(s)});class nn extends j{constructor(){super(...arguments),this._unknown=!0}_parse(r){return De(r.data)}}nn.create=s=>new nn({typeName:H.ZodUnknown,...K(s)});class At extends j{_parse(r){const i=this._getOrReturnCtx(r);return L(i,{code:O.invalid_type,expected:P.never,received:i.parsedType}),U}}At.create=s=>new At({typeName:H.ZodNever,...K(s)});class jr extends j{_parse(r){if(this._getType(r)!==P.undefined){const o=this._getOrReturnCtx(r);return L(o,{code:O.invalid_type,expected:P.void,received:o.parsedType}),U}return De(r.data)}}jr.create=s=>new jr({typeName:H.ZodVoid,...K(s)});class ct extends j{_parse(r){const{ctx:i,status:o}=this._processInputParams(r),c=this._def;if(i.parsedType!==P.array)return L(i,{code:O.invalid_type,expected:P.array,received:i.parsedType}),U;if(c.exactLength!==null){const p=i.data.length>c.exactLength.value,_=i.data.length<c.exactLength.value;(p||_)&&(L(i,{code:p?O.too_big:O.too_small,minimum:_?c.exactLength.value:void 0,maximum:p?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),o.dirty())}if(c.minLength!==null&&i.data.length<c.minLength.value&&(L(i,{code:O.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),o.dirty()),c.maxLength!==null&&i.data.length>c.maxLength.value&&(L(i,{code:O.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),o.dirty()),i.common.async)return Promise.all([...i.data].map((p,_)=>c.type._parseAsync(new vt(i,p,i.path,_)))).then(p=>Ne.mergeArray(o,p));const f=[...i.data].map((p,_)=>c.type._parseSync(new vt(i,p,i.path,_)));return Ne.mergeArray(o,f)}get element(){return this._def.type}min(r,i){return new ct({...this._def,minLength:{value:r,message:F.toString(i)}})}max(r,i){return new ct({...this._def,maxLength:{value:r,message:F.toString(i)}})}length(r,i){return new ct({...this._def,exactLength:{value:r,message:F.toString(i)}})}nonempty(r){return this.min(1,r)}}ct.create=(s,r)=>new ct({type:s,minLength:null,maxLength:null,exactLength:null,typeName:H.ZodArray,...K(r)});function wn(s){if(s instanceof _e){const r={};for(const i in s.shape){const o=s.shape[i];r[i]=xt.create(wn(o))}return new _e({...s._def,shape:()=>r})}else return s instanceof ct?new ct({...s._def,type:wn(s.element)}):s instanceof xt?xt.create(wn(s.unwrap())):s instanceof Ut?Ut.create(wn(s.unwrap())):s instanceof yt?yt.create(s.items.map(r=>wn(r))):s}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 r=this._def.shape(),i=se.objectKeys(r);return this._cached={shape:r,keys:i},this._cached}_parse(r){if(this._getType(r)!==P.object){const y=this._getOrReturnCtx(r);return L(y,{code:O.invalid_type,expected:P.object,received:y.parsedType}),U}const{status:o,ctx:c}=this._processInputParams(r),{shape:f,keys:p}=this._getCached(),_=[];if(!(this._def.catchall instanceof At&&this._def.unknownKeys==="strip"))for(const y in c.data)p.includes(y)||_.push(y);const w=[];for(const y of p){const A=f[y],D=c.data[y];w.push({key:{status:"valid",value:y},value:A._parse(new vt(c,D,c.path,y)),alwaysSet:y in c.data})}if(this._def.catchall instanceof At){const y=this._def.unknownKeys;if(y==="passthrough")for(const A of _)w.push({key:{status:"valid",value:A},value:{status:"valid",value:c.data[A]}});else if(y==="strict")_.length>0&&(L(c,{code:O.unrecognized_keys,keys:_}),o.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const y=this._def.catchall;for(const A of _){const D=c.data[A];w.push({key:{status:"valid",value:A},value:y._parse(new vt(c,D,c.path,A)),alwaysSet:A in c.data})}}return c.common.async?Promise.resolve().then(async()=>{const y=[];for(const A of w){const D=await A.key,re=await A.value;y.push({key:D,value:re,alwaysSet:A.alwaysSet})}return y}).then(y=>Ne.mergeObjectSync(o,y)):Ne.mergeObjectSync(o,w)}get shape(){return this._def.shape()}strict(r){return F.errToObj,new _e({...this._def,unknownKeys:"strict",...r!==void 0?{errorMap:(i,o)=>{const c=this._def.errorMap?.(i,o).message??o.defaultError;return i.code==="unrecognized_keys"?{message:F.errToObj(r).message??c}:{message:c}}}:{}})}strip(){return new _e({...this._def,unknownKeys:"strip"})}passthrough(){return new _e({...this._def,unknownKeys:"passthrough"})}extend(r){return new _e({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new _e({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:H.ZodObject})}setKey(r,i){return this.augment({[r]:i})}catchall(r){return new _e({...this._def,catchall:r})}pick(r){const i={};for(const o of se.objectKeys(r))r[o]&&this.shape[o]&&(i[o]=this.shape[o]);return new _e({...this._def,shape:()=>i})}omit(r){const i={};for(const o of se.objectKeys(this.shape))r[o]||(i[o]=this.shape[o]);return new _e({...this._def,shape:()=>i})}deepPartial(){return wn(this)}partial(r){const i={};for(const o of se.objectKeys(this.shape)){const c=this.shape[o];r&&!r[o]?i[o]=c:i[o]=c.optional()}return new _e({...this._def,shape:()=>i})}required(r){const i={};for(const o of se.objectKeys(this.shape))if(r&&!r[o])i[o]=this.shape[o];else{let f=this.shape[o];for(;f instanceof xt;)f=f._def.innerType;i[o]=f}return new _e({...this._def,shape:()=>i})}keyof(){return uo(se.objectKeys(this.shape))}}_e.create=(s,r)=>new _e({shape:()=>s,unknownKeys:"strip",catchall:At.create(),typeName:H.ZodObject,...K(r)}),_e.strictCreate=(s,r)=>new _e({shape:()=>s,unknownKeys:"strict",catchall:At.create(),typeName:H.ZodObject,...K(r)}),_e.lazycreate=(s,r)=>new _e({shape:s,unknownKeys:"strip",catchall:At.create(),typeName:H.ZodObject,...K(r)});class ir extends j{_parse(r){const{ctx:i}=this._processInputParams(r),o=this._def.options;function c(f){for(const _ of f)if(_.result.status==="valid")return _.result;for(const _ of f)if(_.result.status==="dirty")return i.common.issues.push(..._.ctx.common.issues),_.result;const p=f.map(_=>new He(_.ctx.common.issues));return L(i,{code:O.invalid_union,unionErrors:p}),U}if(i.common.async)return Promise.all(o.map(async f=>{const p={...i,common:{...i.common,issues:[]},parent:null};return{result:await f._parseAsync({data:i.data,path:i.path,parent:p}),ctx:p}})).then(c);{let f;const p=[];for(const w of o){const y={...i,common:{...i.common,issues:[]},parent:null},A=w._parseSync({data:i.data,path:i.path,parent:y});if(A.status==="valid")return A;A.status==="dirty"&&!f&&(f={result:A,ctx:y}),y.common.issues.length&&p.push(y.common.issues)}if(f)return i.common.issues.push(...f.ctx.common.issues),f.result;const _=p.map(w=>new He(w));return L(i,{code:O.invalid_union,unionErrors:_}),U}}get options(){return this._def.options}}ir.create=(s,r)=>new ir({options:s,typeName:H.ZodUnion,...K(r)});const Tt=s=>s instanceof or?Tt(s.schema):s instanceof lt?Tt(s.innerType()):s instanceof ur?[s.value]:s instanceof Zt?s.options:s instanceof cr?se.objectValues(s.enum):s instanceof lr?Tt(s._def.innerType):s instanceof nr?[void 0]:s instanceof rr?[null]:s instanceof xt?[void 0,...Tt(s.unwrap())]:s instanceof Ut?[null,...Tt(s.unwrap())]:s instanceof ha||s instanceof hr?Tt(s.unwrap()):s instanceof fr?Tt(s._def.innerType):[];class Qr extends j{_parse(r){const{ctx:i}=this._processInputParams(r);if(i.parsedType!==P.object)return L(i,{code:O.invalid_type,expected:P.object,received:i.parsedType}),U;const o=this.discriminator,c=i.data[o],f=this.optionsMap.get(c);return f?i.common.async?f._parseAsync({data:i.data,path:i.path,parent:i}):f._parseSync({data:i.data,path:i.path,parent:i}):(L(i,{code:O.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),U)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(r,i,o){const c=new Map;for(const f of i){const p=Tt(f.shape[r]);if(!p.length)throw new Error(`A discriminator value for key \`${r}\` could not be extracted from all schema options`);for(const _ of p){if(c.has(_))throw new Error(`Discriminator property ${String(r)} has duplicate value ${String(_)}`);c.set(_,f)}}return new Qr({typeName:H.ZodDiscriminatedUnion,discriminator:r,options:i,optionsMap:c,...K(o)})}}function da(s,r){const i=It(s),o=It(r);if(s===r)return{valid:!0,data:s};if(i===P.object&&o===P.object){const c=se.objectKeys(r),f=se.objectKeys(s).filter(_=>c.indexOf(_)!==-1),p={...s,...r};for(const _ of f){const w=da(s[_],r[_]);if(!w.valid)return{valid:!1};p[_]=w.data}return{valid:!0,data:p}}else if(i===P.array&&o===P.array){if(s.length!==r.length)return{valid:!1};const c=[];for(let f=0;f<s.length;f++){const p=s[f],_=r[f],w=da(p,_);if(!w.valid)return{valid:!1};c.push(w.data)}return{valid:!0,data:c}}else return i===P.date&&o===P.date&&+s==+r?{valid:!0,data:s}:{valid:!1}}class ar extends j{_parse(r){const{status:i,ctx:o}=this._processInputParams(r),c=(f,p)=>{if(ca(f)||ca(p))return U;const _=da(f.value,p.value);return _.valid?((la(f)||la(p))&&i.dirty(),{status:i.value,value:_.data}):(L(o,{code:O.invalid_intersection_types}),U)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([f,p])=>c(f,p)):c(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}ar.create=(s,r,i)=>new ar({left:s,right:r,typeName:H.ZodIntersection,...K(i)});class yt extends j{_parse(r){const{status:i,ctx:o}=this._processInputParams(r);if(o.parsedType!==P.array)return L(o,{code:O.invalid_type,expected:P.array,received:o.parsedType}),U;if(o.data.length<this._def.items.length)return L(o,{code:O.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),U;!this._def.rest&&o.data.length>this._def.items.length&&(L(o,{code:O.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const f=[...o.data].map((p,_)=>{const w=this._def.items[_]||this._def.rest;return w?w._parse(new vt(o,p,o.path,_)):null}).filter(p=>!!p);return o.common.async?Promise.all(f).then(p=>Ne.mergeArray(i,p)):Ne.mergeArray(i,f)}get items(){return this._def.items}rest(r){return new yt({...this._def,rest:r})}}yt.create=(s,r)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new yt({items:s,typeName:H.ZodTuple,rest:null,...K(r)})};class sr extends j{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){const{status:i,ctx:o}=this._processInputParams(r);if(o.parsedType!==P.object)return L(o,{code:O.invalid_type,expected:P.object,received:o.parsedType}),U;const c=[],f=this._def.keyType,p=this._def.valueType;for(const _ in o.data)c.push({key:f._parse(new vt(o,_,o.path,_)),value:p._parse(new vt(o,o.data[_],o.path,_)),alwaysSet:_ in o.data});return o.common.async?Ne.mergeObjectAsync(i,c):Ne.mergeObjectSync(i,c)}get element(){return this._def.valueType}static create(r,i,o){return i instanceof j?new sr({keyType:r,valueType:i,typeName:H.ZodRecord,...K(o)}):new sr({keyType:ut.create(),valueType:r,typeName:H.ZodRecord,...K(i)})}}class ei extends j{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){const{status:i,ctx:o}=this._processInputParams(r);if(o.parsedType!==P.map)return L(o,{code:O.invalid_type,expected:P.map,received:o.parsedType}),U;const c=this._def.keyType,f=this._def.valueType,p=[...o.data.entries()].map(([_,w],y)=>({key:c._parse(new vt(o,_,o.path,[y,"key"])),value:f._parse(new vt(o,w,o.path,[y,"value"]))}));if(o.common.async){const _=new Map;return Promise.resolve().then(async()=>{for(const w of p){const y=await w.key,A=await w.value;if(y.status==="aborted"||A.status==="aborted")return U;(y.status==="dirty"||A.status==="dirty")&&i.dirty(),_.set(y.value,A.value)}return{status:i.value,value:_}})}else{const _=new Map;for(const w of p){const y=w.key,A=w.value;if(y.status==="aborted"||A.status==="aborted")return U;(y.status==="dirty"||A.status==="dirty")&&i.dirty(),_.set(y.value,A.value)}return{status:i.value,value:_}}}}ei.create=(s,r,i)=>new ei({valueType:r,keyType:s,typeName:H.ZodMap,...K(i)});class rn extends j{_parse(r){const{status:i,ctx:o}=this._processInputParams(r);if(o.parsedType!==P.set)return L(o,{code:O.invalid_type,expected:P.set,received:o.parsedType}),U;const c=this._def;c.minSize!==null&&o.data.size<c.minSize.value&&(L(o,{code:O.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),i.dirty()),c.maxSize!==null&&o.data.size>c.maxSize.value&&(L(o,{code:O.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),i.dirty());const f=this._def.valueType;function p(w){const y=new Set;for(const A of w){if(A.status==="aborted")return U;A.status==="dirty"&&i.dirty(),y.add(A.value)}return{status:i.value,value:y}}const _=[...o.data.values()].map((w,y)=>f._parse(new vt(o,w,o.path,y)));return o.common.async?Promise.all(_).then(w=>p(w)):p(_)}min(r,i){return new rn({...this._def,minSize:{value:r,message:F.toString(i)}})}max(r,i){return new rn({...this._def,maxSize:{value:r,message:F.toString(i)}})}size(r,i){return this.min(r,i).max(r,i)}nonempty(r){return this.min(1,r)}}rn.create=(s,r)=>new rn({valueType:s,minSize:null,maxSize:null,typeName:H.ZodSet,...K(r)});class Sn extends j{constructor(){super(...arguments),this.validate=this.implement}_parse(r){const{ctx:i}=this._processInputParams(r);if(i.parsedType!==P.function)return L(i,{code:O.invalid_type,expected:P.function,received:i.parsedType}),U;function o(_,w){return Xr({data:_,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Kr(),vn].filter(y=>!!y),issueData:{code:O.invalid_arguments,argumentsError:w}})}function c(_,w){return Xr({data:_,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Kr(),vn].filter(y=>!!y),issueData:{code:O.invalid_return_type,returnTypeError:w}})}const f={errorMap:i.common.contextualErrorMap},p=i.data;if(this._def.returns instanceof bn){const _=this;return De(async function(...w){const y=new He([]),A=await _._def.args.parseAsync(w,f).catch(X=>{throw y.addIssue(o(w,X)),y}),D=await Reflect.apply(p,this,A);return await _._def.returns._def.type.parseAsync(D,f).catch(X=>{throw y.addIssue(c(D,X)),y})})}else{const _=this;return De(function(...w){const y=_._def.args.safeParse(w,f);if(!y.success)throw new He([o(w,y.error)]);const A=Reflect.apply(p,this,y.data),D=_._def.returns.safeParse(A,f);if(!D.success)throw new He([c(A,D.error)]);return D.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...r){return new Sn({...this._def,args:yt.create(r).rest(nn.create())})}returns(r){return new Sn({...this._def,returns:r})}implement(r){return this.parse(r)}strictImplement(r){return this.parse(r)}static create(r,i,o){return new Sn({args:r||yt.create([]).rest(nn.create()),returns:i||nn.create(),typeName:H.ZodFunction,...K(o)})}}class or extends j{get schema(){return this._def.getter()}_parse(r){const{ctx:i}=this._processInputParams(r);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}or.create=(s,r)=>new or({getter:s,typeName:H.ZodLazy,...K(r)});class ur extends j{_parse(r){if(r.data!==this._def.value){const i=this._getOrReturnCtx(r);return L(i,{received:i.data,code:O.invalid_literal,expected:this._def.value}),U}return{status:"valid",value:r.data}}get value(){return this._def.value}}ur.create=(s,r)=>new ur({value:s,typeName:H.ZodLiteral,...K(r)});function uo(s,r){return new Zt({values:s,typeName:H.ZodEnum,...K(r)})}class Zt extends j{_parse(r){if(typeof r.data!="string"){const i=this._getOrReturnCtx(r),o=this._def.values;return L(i,{expected:se.joinValues(o),received:i.parsedType,code:O.invalid_type}),U}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(r.data)){const i=this._getOrReturnCtx(r),o=this._def.values;return L(i,{received:i.data,code:O.invalid_enum_value,options:o}),U}return De(r.data)}get options(){return this._def.values}get enum(){const r={};for(const i of this._def.values)r[i]=i;return r}get Values(){const r={};for(const i of this._def.values)r[i]=i;return r}get Enum(){const r={};for(const i of this._def.values)r[i]=i;return r}extract(r,i=this._def){return Zt.create(r,{...this._def,...i})}exclude(r,i=this._def){return Zt.create(this.options.filter(o=>!r.includes(o)),{...this._def,...i})}}Zt.create=uo;class cr extends j{_parse(r){const i=se.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(r);if(o.parsedType!==P.string&&o.parsedType!==P.number){const c=se.objectValues(i);return L(o,{expected:se.joinValues(c),received:o.parsedType,code:O.invalid_type}),U}if(this._cache||(this._cache=new Set(se.getValidEnumValues(this._def.values))),!this._cache.has(r.data)){const c=se.objectValues(i);return L(o,{received:o.data,code:O.invalid_enum_value,options:c}),U}return De(r.data)}get enum(){return this._def.values}}cr.create=(s,r)=>new cr({values:s,typeName:H.ZodNativeEnum,...K(r)});class bn extends j{unwrap(){return this._def.type}_parse(r){const{ctx:i}=this._processInputParams(r);if(i.parsedType!==P.promise&&i.common.async===!1)return L(i,{code:O.invalid_type,expected:P.promise,received:i.parsedType}),U;const o=i.parsedType===P.promise?i.data:Promise.resolve(i.data);return De(o.then(c=>this._def.type.parseAsync(c,{path:i.path,errorMap:i.common.contextualErrorMap})))}}bn.create=(s,r)=>new bn({type:s,typeName:H.ZodPromise,...K(r)});class lt extends j{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===H.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){const{status:i,ctx:o}=this._processInputParams(r),c=this._def.effect||null,f={addIssue:p=>{L(o,p),p.fatal?i.abort():i.dirty()},get path(){return o.path}};if(f.addIssue=f.addIssue.bind(f),c.type==="preprocess"){const p=c.transform(o.data,f);if(o.common.async)return Promise.resolve(p).then(async _=>{if(i.value==="aborted")return U;const w=await this._def.schema._parseAsync({data:_,path:o.path,parent:o});return w.status==="aborted"?U:w.status==="dirty"||i.value==="dirty"?yn(w.value):w});{if(i.value==="aborted")return U;const _=this._def.schema._parseSync({data:p,path:o.path,parent:o});return _.status==="aborted"?U:_.status==="dirty"||i.value==="dirty"?yn(_.value):_}}if(c.type==="refinement"){const p=_=>{const w=c.refinement(_,f);if(o.common.async)return Promise.resolve(w);if(w instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return _};if(o.common.async===!1){const _=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return _.status==="aborted"?U:(_.status==="dirty"&&i.dirty(),p(_.value),{status:i.value,value:_.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(_=>_.status==="aborted"?U:(_.status==="dirty"&&i.dirty(),p(_.value).then(()=>({status:i.value,value:_.value}))))}if(c.type==="transform")if(o.common.async===!1){const p=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!en(p))return U;const _=c.transform(p.value,f);if(_ instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:_}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(p=>en(p)?Promise.resolve(c.transform(p.value,f)).then(_=>({status:i.value,value:_})):U);se.assertNever(c)}}lt.create=(s,r,i)=>new lt({schema:s,typeName:H.ZodEffects,effect:r,...K(i)}),lt.createWithPreprocess=(s,r,i)=>new lt({schema:r,effect:{type:"preprocess",transform:s},typeName:H.ZodEffects,...K(i)});class xt extends j{_parse(r){return this._getType(r)===P.undefined?De(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}xt.create=(s,r)=>new xt({innerType:s,typeName:H.ZodOptional,...K(r)});class Ut extends j{_parse(r){return this._getType(r)===P.null?De(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}Ut.create=(s,r)=>new Ut({innerType:s,typeName:H.ZodNullable,...K(r)});class lr extends j{_parse(r){const{ctx:i}=this._processInputParams(r);let o=i.data;return i.parsedType===P.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}lr.create=(s,r)=>new lr({innerType:s,typeName:H.ZodDefault,defaultValue:typeof r.default=="function"?r.default:()=>r.default,...K(r)});class fr extends j{_parse(r){const{ctx:i}=this._processInputParams(r),o={...i,common:{...i.common,issues:[]}},c=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return er(c)?c.then(f=>({status:"valid",value:f.status==="valid"?f.value:this._def.catchValue({get error(){return new He(o.common.issues)},input:o.data})})):{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new He(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}fr.create=(s,r)=>new fr({innerType:s,typeName:H.ZodCatch,catchValue:typeof r.catch=="function"?r.catch:()=>r.catch,...K(r)});class ti extends j{_parse(r){if(this._getType(r)!==P.nan){const o=this._getOrReturnCtx(r);return L(o,{code:O.invalid_type,expected:P.nan,received:o.parsedType}),U}return{status:"valid",value:r.data}}}ti.create=s=>new ti({typeName:H.ZodNaN,...K(s)});const uf=Symbol("zod_brand");class ha extends j{_parse(r){const{ctx:i}=this._processInputParams(r),o=i.data;return this._def.type._parse({data:o,path:i.path,parent:i})}unwrap(){return this._def.type}}class dr extends j{_parse(r){const{status:i,ctx:o}=this._processInputParams(r);if(o.common.async)return(async()=>{const f=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return f.status==="aborted"?U:f.status==="dirty"?(i.dirty(),yn(f.value)):this._def.out._parseAsync({data:f.value,path:o.path,parent:o})})();{const c=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return c.status==="aborted"?U:c.status==="dirty"?(i.dirty(),{status:"dirty",value:c.value}):this._def.out._parseSync({data:c.value,path:o.path,parent:o})}}static create(r,i){return new dr({in:r,out:i,typeName:H.ZodPipeline})}}class hr extends j{_parse(r){const i=this._def.innerType._parse(r),o=c=>(en(c)&&(c.value=Object.freeze(c.value)),c);return er(i)?i.then(c=>o(c)):o(i)}unwrap(){return this._def.innerType}}hr.create=(s,r)=>new hr({innerType:s,typeName:H.ZodReadonly,...K(r)});function co(s,r){const i=typeof s=="function"?s(r):typeof s=="string"?{message:s}:s;return typeof i=="string"?{message:i}:i}function lo(s,r={},i){return s?xn.create().superRefine((o,c)=>{const f=s(o);if(f instanceof Promise)return f.then(p=>{if(!p){const _=co(r,o),w=_.fatal??i??!0;c.addIssue({code:"custom",..._,fatal:w})}});if(!f){const p=co(r,o),_=p.fatal??i??!0;c.addIssue({code:"custom",...p,fatal:_})}}):xn.create()}const cf={object:_e.lazycreate};var H;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(H||(H={}));const lf=(s,r={message:`Input not instance of ${s.name}`})=>lo(i=>i instanceof s,r),I=ut.create,q=Wt.create,ff=ti.create,df=qt.create,de=tr.create,hf=tn.create,pf=Jr.create,fo=nr.create,gf=rr.create,mf=xn.create,_f=nn.create,vf=At.create,yf=jr.create,Be=ct.create,M=_e.create,xf=_e.strictCreate,an=ir.create,wf=Qr.create,Sf=ar.create,ni=yt.create,Ot=sr.create,bf=ei.create,Cf=rn.create,If=Sn.create,Af=or.create,le=ur.create,Qe=Zt.create,Tf=cr.create,Of=bn.create,ho=lt.create,z=xt.create,Rf=Ut.create,kf=lt.createWithPreprocess,Ef=dr.create,Lf=()=>I().optional(),Nf=()=>q().optional(),pa=()=>de().optional(),ga=Object.freeze(Object.defineProperty({__proto__:null,BRAND:uf,DIRTY:yn,EMPTY_PATH:Wl,INVALID:U,NEVER:U,OK:De,ParseStatus:Ne,Schema:j,ZodAny:xn,ZodArray:ct,ZodBigInt:qt,ZodBoolean:tr,ZodBranded:ha,ZodCatch:fr,ZodDate:tn,ZodDefault:lr,ZodDiscriminatedUnion:Qr,ZodEffects:lt,ZodEnum:Zt,ZodError:He,get ZodFirstPartyTypeKind(){return H},ZodFunction:Sn,ZodIntersection:ar,ZodIssueCode:O,ZodLazy:or,ZodLiteral:ur,ZodMap:ei,ZodNaN:ti,ZodNativeEnum:cr,ZodNever:At,ZodNull:rr,ZodNullable:Ut,ZodNumber:Wt,ZodObject:_e,ZodOptional:xt,ZodParsedType:P,ZodPipeline:dr,ZodPromise:bn,ZodReadonly:hr,ZodRecord:sr,ZodSchema:j,ZodSet:rn,ZodString:ut,ZodSymbol:Jr,ZodTransformer:lt,ZodTuple:yt,ZodType:j,ZodUndefined:nr,ZodUnion:ir,ZodUnknown:nn,ZodVoid:jr,addIssueToContext:L,any:mf,array:Be,bigint:df,boolean:de,coerce:{string:(s=>ut.create({...s,coerce:!0})),number:(s=>Wt.create({...s,coerce:!0})),boolean:(s=>tr.create({...s,coerce:!0})),bigint:(s=>qt.create({...s,coerce:!0})),date:(s=>tn.create({...s,coerce:!0}))},custom:lo,date:hf,datetimeRegex:oo,defaultErrorMap:vn,discriminatedUnion:wf,effect:ho,enum:Qe,function:If,getErrorMap:Kr,getParsedType:It,instanceof:lf,intersection:Sf,isAborted:ca,isAsync:er,isDirty:la,isValid:en,late:cf,lazy:Af,literal:le,makeIssue:Xr,map:bf,nan:ff,nativeEnum:Tf,never:vf,null:gf,nullable:Rf,number:q,object:M,get objectUtil(){return ua},oboolean:pa,onumber:Nf,optional:z,ostring:Lf,pipeline:Ef,preprocess:kf,promise:Of,quotelessJson:Bl,record:Ot,set:Cf,setErrorMap:Fl,strictObject:xf,string:I,symbol:pf,transformer:ho,tuple:ni,undefined:fo,union:an,unknown:_f,get util(){return se},void:yf},Symbol.toStringTag,{value:"Module"})),Cn=Qe(["left","right","up","down"]),Mf=Cn.options,ri=M({type:I(),id:I(),name:z(I()),status:z(I())}),po=M({height:q(),width:q(),sprite:I().optional(),direction:z(Cn),filter:z(I())}),go=M({room:z(I()),x:q(),y:q()}),pr=M({imageId:I(),col:q().optional(),row:q().optional()}),ye=M({text:I().array()}),mo=M({x:q(),y:q()}),ii=M({soundId:I(),volume:q().optional()}),ai={_started:pa(),narrative:ye.optional(),startDirection:Cn.optional(),endDirection:Cn.optional(),endStatus:I().optional()},Pf={_started:!0,narrative:!0,startDirection:!0,endDirection:!0,endStatus:!0,type:!0},Df=M({animation:z(I()),x:q(),y:q(),speed:z(q())}),_o=M({type:le("move"),roomId:I().optional(),pathIsSet:z(de()),doPendingInteractionWhenFinished:z(de()),steps:Be(Df)}).extend(ai),vo=M({type:le("goTo"),animation:z(I()),speed:z(q()),targetId:I()}).extend(ai),yo=M({type:le("say"),animation:z(I()),text:I(),time:q()}).extend(ai),Bf=M({animation:z(I()),duration:q(),timeElapsed:z(q()),reverse:z(de())}),xo=M({type:le("act"),steps:Be(Bf)}).extend(ai),gr=an([_o,xo,yo,vo]),Ff=gr.options.map(s=>s.shape.type.value),si=M({type:le("order"),actorId:I().optional(),orders:Be(gr),replaceCurrentOrders:z(de()),narrative:ye.optional()}),In=M({type:le("changeRoom"),roomId:I(),takePlayer:de(),x:z(q()),y:z(q()),narrative:ye.optional()}),An=M({type:le("inventory"),itemId:I(),actorId:I().optional(),addOrRemove:Qe(["ADD","REMOVE"]),narrative:ye.optional()}),Tn=M({type:le("removeActor"),actorId:I(),narrative:ye.optional()}),On=M({type:le("changeStatus"),targetId:I(),targetType:Qe(["actor","item","hotspot"]),status:I(),narrative:ye.optional()}),oi=M({type:le("sequence"),sequence:I(),narrative:ye.optional()}),Rn=M({type:le("conversation"),conversationId:I(),end:z(de()),narrative:ye.optional()}),kn=M({type:le("conversationChoice"),on:de(),conversationId:I(),branchId:I(),choiceRef:I(),narrative:ye.optional()}),En=M({type:le("teleportActor"),actorId:I(),roomId:z(I()),x:q(),y:q(),narrative:ye.optional()}),sn=M({type:le("toggleZone"),roomId:z(I()),on:de(),ref:I(),zoneType:Qe(["hotspot","obstacle","walkable"]),narrative:ye.optional()}),Ln=M({type:le("soundEffect"),sound:I(),volume:q().optional(),narrative:ye.optional()}),Nn=M({type:le("backgroundMusic"),sound:I().optional(),roomId:I().optional(),volume:q().optional(),narrative:ye.optional()}),Mn=M({type:le("ambientNoise"),sound:I().optional(),roomId:I().optional(),volume:q().optional(),narrative:ye.optional()}),Pn=M({type:le("flag"),on:de(),flag:I(),narrative:ye.optional()}),Dn=M({type:le("storyBoardConsequence"),storyBoardId:I(),narrative:ye.optional()}),Bn=M({type:le("changePlayerCharacter"),actorId:I(),narrative:ye.optional()}),Wf=sn.shape.zoneType.options,wo=an([si,In,An,Tn,On,oi,Rn,En,sn,Ln,Nn,Mn,Pn,kn,Dn,Bn]),qf=Qe(["conversation","sequence","changeStatus","backgroundMusic","ambientNoise","removeActor","inventory","changeRoom","order","teleportActor","toggleZone","soundEffect","flag","conversationChoice","storyBoardConsequence","changePlayerCharacter"]).options,Zf={conversation:Rn,sequence:oi,changeStatus:On,removeActor:Tn,inventory:An,changeRoom:In,order:si,teleportActor:En,toggleZone:sn,soundEffect:Ln,flag:Pn,conversationChoice:kn,backgroundMusic:Nn,ambientNoise:Mn,storyBoardConsequence:Dn,changePlayerCharacter:Bn},ma=an([Tn,On,An,Rn,En,sn,Ln,Pn,In,kn,Nn,Mn,Dn,Bn]),Uf=ma.options.map(s=>s.shape.type.value),ui=M({verbId:I(),targetId:I(),roomId:I().optional(),itemId:I().optional(),targetStatus:I().optional(),mustReachFirst:de().optional(),consequences:Be(wo),flagsThatMustBeFalse:Be(I()).optional(),flagsThatMustBeTrue:Be(I()).optional(),requiredInventory:Be(I()).optional()}),_a=M({actorOrders:z(Ot(I(),gr.array())),immediateConsequences:z(ma.array()),narrative:ye.optional(),_started:pa()}),mr=M({id:I(),description:I().optional(),stages:_a.array()}),So=M({conversationId:I().optional(),branchId:I().optional(),choiceRef:I().optional()}),va=M({ref:I().optional(),text:I(),sequence:I().optional(),nextBranch:z(I()),once:z(de()),disabled:z(de()),enablesChoices:Be(So).optional(),disablesChoices:Be(So).optional(),end:z(de()),choiceSequence:mr.optional()}),bo=M({choices:Be(va)}),ya=M({id:I(),branches:Ot(I(),z(bo)),currentBranch:z(I()),defaultBranch:I()}),xa=M({id:I(),message:I(),imageId:I().optional(),imageWidth:q().optional()}),wa=M({type:le("ending"),endingId:I(),narrative:ye.optional()}),Gf=an([si,In,An,Tn,On,oi,Rn,En,sn,Ln,Nn,Mn,Pn,kn,Dn,Bn,wa]),Co=an([Tn,On,An,Rn,En,sn,Ln,Pn,In,kn,Nn,Mn,Dn,Bn,wa]),Sa=ui.merge(M({consequences:Be(Gf)})),ci=mr.merge(M({stages:_a.merge(M({immediateConsequences:z(Co.array())})).array()})),Vf=va.merge(M({choiceSequence:ci.optional()})),Hf=M({choices:Be(Vf)}),ba=ya.merge(M({branches:Ot(I(),z(Hf))})),Ca=M({soundId:I(),frameIndex:q().optional(),volume:q().optional()}),zf=Ot(I(),Ca.or(Ca.array()).or(fo())),li=ri.merge(go).merge(po).merge(M({type:le("actor"),isPlayer:z(de()),noInteraction:z(de()),speed:z(q()),baseline:z(q()),dialogueColor:z(I()),soundEffectMap:zf.optional(),walkToX:q().optional(),walkToY:q().optional(),defaultFrame:pr.optional(),statusFrames:Ot(pr).optional()})),Io=M({value:de(),default:de(),description:I().optional()}),Ia=Ot(I(),Io.optional()),_r=ri.extend({type:le("item"),actorId:I().optional()}).and(pr.partial());Qe(["rect","circle","polygon"]);const $f=Be(ni([q(),q()])),Ao=M({type:I().optional(),x:q(),y:q(),path:z(I()),polygon:z($f),circle:z(q()),rect:z(ni([q(),q()]))}),Aa=Ao.merge(M({ref:I().optional(),disabled:de().optional()})),Ta=Ao.merge(ri).merge(M({type:le("hotspot"),parallax:q(),walkToX:q().optional(),walkToY:q().optional()})),Yf=M({parallax:q(),imageId:I(),placement:M({x:q(),y:q(),width:q(),height:q()}).optional()}),Kf=Be(ni([q(),q()])),Oa=M({id:I(),frameWidth:q(),frameHeight:q().optional(),width:q(),height:q(),background:Yf.array(),hotspots:Ta.array().optional(),obstacleAreas:z(Aa.array()),walkableAreas:z(Aa.array()),scaling:z(Kf),backgroundColor:I().optional(),name:I().optional(),narrative:ye.optional(),backgroundMusic:ii.optional(),ambientNoise:ii.optional()}),vr=M({imageId:I(),row:q(),col:q()}),Xf=M({left:vr.array().optional(),right:vr.array().optional(),up:vr.array().optional(),down:vr.array().optional()}),Ra=M({id:I(),defaultDirection:Cn,animations:Ot(I(),Xf)}),To=Qe(["center","left","right"]),Oo=Qe(["center","top","bottom"]),Jf=M({x:To,y:Oo,width:q().optional(),height:q().optional(),aspectRatio:mo.optional()}).merge(M({image:pr})),Ro=M({title:I(),narrative:ye,pictures:Jf.array(),backgroundColor:I(),color:I()}),ko=Qe(["sound","buttons"]),Eo=Qe(["serif","sans-serif","monospace","cursive","fantasy","math"]),ka=M({id:I(),isEndOfGame:de().optional(),pages:Ro.array(),font:Eo.optional(),sound:ii.optional(),progression:ko.optional()}),fi=M({id:I(),label:I(),preposition:I().optional(),isMoveVerb:de().optional(),isNotForItems:de().optional(),isLookVerb:de().optional(),requiresItem:de().optional(),defaultResponseNoItem:I().optional(),defaultResponseWithItem:I().optional(),defaultResponseCannotReach:I().optional()}),jf=M({schemaVersion:q().optional(),rooms:Oa.array(),items:_r.array(),actors:li.array(),interactions:Sa.array(),conversations:ba.array(),flagMap:Ia,currentRoomId:I(),id:I(),description:I().optional().describe("a short description of your game"),thumbnailAssetId:I().optional()}),Qf=M({verbs:fi.array(),sequences:ci.array(),sprites:Ra.array(),endings:xa.array(),openingSequenceId:I().optional(),openingStoryboardId:I().optional(),storyBoards:ka.array().optional()}),Lo=jf.and(Qf).describe("The game schema"),No=ga.union([ga.literal(0),ga.literal(1)]).array().array(),di=4,Mo=M({sequenceRunning:mr.optional(),currentStoryBoardId:I().optional(),actorOrders:Ot(I(),gr.array()),currentConversationId:I().optional(),pendingInteraction:ui.optional(),gameNotBegun:de(),cellMatrix:No.optional()}),hi=M({schemaVersion:le(di),rooms:Oa.array(),items:_r.array(),actors:li.array(),interactions:ui.array(),conversations:ya.array(),flagMap:Ia,currentRoomId:I(),id:I(),description:I().optional().describe("a short description of your game"),thumbnailAssetId:I().optional()}),Ea=M({verbs:fi.array(),sequences:mr.array(),sprites:Ra.array(),openingSequenceId:I().optional(),openingStoryboardId:I().optional(),storyBoards:ka.array()}),ed=hi.and(Mo),Po=hi.and(Ea).describe("The game schema"),td=Qe(["rooms","items","actors","conversations","sprites","sequences","verbs","storyBoards"]),nd=hi.merge(M({schemaVersion:le(3),interactions:Sa.array(),conversations:ba.array()})),rd=Ea.merge(M({endings:xa.array(),sequences:ci.array()})),Do=nd.and(rd).describe("The game schema"),Bo=an([li,_r,Ta]),id=M({verb:fi,target:Bo,item:z(_r)});var pi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},on={},ze={},Fo;function La(){return Fo||(Fo=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze._extreme=ze._DEG=ze._360_DEG=ze._90_DEG_RIGHT=ze._90_DEG_LEFT=void 0,ze._90_DEG_LEFT=Math.PI*.5,ze._90_DEG_RIGHT=Math.PI*-.5,ze._360_DEG=Math.PI*2,ze._DEG=Math.PI/180,ze._extreme=Math.pow(10,30)),ze}var Na={},Wo;function qo(){return Wo||(Wo=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.expandRect=s.findRotationBetweenHeadings=s.findClosestAndDistance=s.doCircleIntersect=s.doRectsIntersect=s.isPointInsideRect=s.getDistance=s.translate=s.getHeadingFrom=s.getVectorFrom=s.normaliseHeading=s.getHeading=s.getXYVector=s.xy=void 0;const r=La();function i(E,R){return E*Math.sin(R)}function o(E,R){return E*Math.cos(R)}const c=(E,R)=>({x:E,y:R});s.xy=c;function f(E,R){return{x:i(E,R),y:o(E,R)}}s.getXYVector=f;const p=E=>{const{x:R,y:xe}=E;return R==0&&xe==0?0:xe==0&&R!=0?R<0?Math.PI*1.5:Math.PI*.5:R==0&&xe!=0?xe>0?0:Math.PI*1:xe>0?Math.atan(R/xe):Math.PI+Math.atan(R/xe)};s.getHeading=p;const _=E=>{const R=E%r._360_DEG;return R>0?R:r._360_DEG+R};s.normaliseHeading=_;const w=(E,R)=>({x:R.x-E.x,y:R.y-E.y});s.getVectorFrom=w;const y=(E,R)=>(0,s.getHeading)((0,s.getVectorFrom)(E,R));s.getHeadingFrom=y;const A=(E,R)=>({x:E.x+R.x,y:E.y+R.y});s.translate=A;const D=(E,R)=>Math.sqrt(Math.pow(E.x-R.x,2)+Math.pow(E.y-R.y,2));s.getDistance=D;const re=(E,R)=>{const{top:xe,left:Se,bottom:ke,right:Ar}=R;return!(E.y<=xe||E.y>=ke||E.x<=Se||E.x>=Ar)};s.isPointInsideRect=re;const X=(E,R)=>E.bottom<=R.bottom&&E.top>=R.top||R.bottom<=E.bottom&&R.top>=E.top,Q=(E,R)=>E.right<=R.right&&E.left>=R.left||R.right<=E.right&&R.left>=E.left,ge=(E,R)=>(0,s.isPointInsideRect)({x:E.left,y:E.top},R)||(0,s.isPointInsideRect)({x:E.left,y:E.bottom},R)||(0,s.isPointInsideRect)({x:E.right,y:E.top},R)||(0,s.isPointInsideRect)({x:E.right,y:E.bottom},R)||(0,s.isPointInsideRect)({x:R.left,y:R.top},E)||(0,s.isPointInsideRect)({x:R.left,y:R.bottom},E)||(0,s.isPointInsideRect)({x:R.right,y:R.top},E)||(0,s.isPointInsideRect)({x:R.right,y:R.bottom},E)||Q(E,R)&&X(E,R)||Q(E,R)&&(E.top>=R.top&&E.top<=R.bottom||R.top>=E.top&&R.top<=E.bottom)||X(E,R)&&(E.left>=R.left&&E.left<=R.right||R.left>=E.left&&R.left<=E.right);s.doRectsIntersect=ge;const Oe=(E,R)=>(0,s.getDistance)(E,R)<E.r+R.r;s.doCircleIntersect=Oe;const Ie=(E,R)=>{if(E.length===0)return{distance:1/0};const xe=E.map(ke=>({item:ke,distance:(0,s.getDistance)(R,ke)}));let[Se]=xe;return xe.forEach(ke=>{Se.distance>ke.distance&&(Se=ke)}),Se};s.findClosestAndDistance=Ie;const Gt=(E,R)=>{const xe=(0,s.normaliseHeading)(E),Se=(0,s.normaliseHeading)(R);let ke=Se;return xe-Se>r._360_DEG/2?ke=Se+r._360_DEG:xe-Se<-r._360_DEG/2&&(ke=Se-r._360_DEG),ke-xe};s.findRotationBetweenHeadings=Gt;const ft=(E,R)=>({top:E.top-R,bottom:E.bottom+R,left:E.left-R,right:E.right+R});s.expandRect=ft})(Na)),Na}var yr={},Zo;function ad(){if(Zo)return yr;Zo=1,Object.defineProperty(yr,"__esModule",{value:!0}),yr.doesLineSegmentCrossCircleEdge=void 0;const s=qo();function r(p,_){return(0,s.getDistance)(p,_)<=p.r}function i(p,_,w,y){return{x:(1-p)*w.x+p*y.x-_.x,y:(1-p)*w.y+p*y.y-_.y}}function o(p){return Math.pow(p.x,2)+Math.pow(p.y,2)}function c(p,_,w){const y={x:_.x-p.x,y:_.y-p.y},A={x:p.x-w.x,y:p.y-w.y},D=y.x*A.x+y.y*A.y,re=Math.pow(y.x,2)+Math.pow(y.y,2),X=-D/re;if(X>=0&&X<=1)return i(X,{x:0,y:0},p,_);const Q=o(i(0,w,p,_)),ge=o(i(1,w,p,_));return Q<=ge?p:_}function f(p,_){const w=r(_,p[0]),y=r(_,p[1]);return w&&y?!1:y!=w?!0:r(_,c(...p,_))}return yr.doesLineSegmentCrossCircleEdge=f,yr}var Ma={},Uo;function sd(){return Uo||(Uo=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.isPointInsidePolygon=s.isPointOnLineSegment=void 0;const r=La();function i(w,y,A){return y.x<=Math.max(w.x,A.x)&&y.x>=Math.min(w.x,A.x)&&y.y<=Math.max(w.y,A.y)&&y.y>=Math.min(w.y,A.y)}var o;(function(w){w[w.Colinear=0]="Colinear",w[w.Clockwise=1]="Clockwise",w[w.Counterclockwise=2]="Counterclockwise"})(o||(o={}));function c(w,y,A){const D=(y.y-w.y)*(A.x-y.x)-(y.x-w.x)*(A.y-y.y);return D==0?o.Colinear:D>0?o.Clockwise:o.Counterclockwise}const f=(w,y)=>c(w,...y)===o.Colinear?i(y[0],w,y[1]):!1;s.isPointOnLineSegment=f;function p(w,y){const A=c(w[0],w[1],y[0]),D=c(w[0],w[1],y[1]),re=c(y[0],y[1],w[0]),X=c(y[0],y[1],w[1]);return!!(A!=D&&re!=X||A==0&&i(w[0],y[0],w[1])||D==0&&i(w[0],y[1],w[1])||re==0&&i(y[0],w[0],y[1])||X==0&&i(y[0],w[1],y[1]))}function _(w,y){if(y.length<3)return!1;const D={y:w.y,x:r._extreme},re=[w,D];let X=0,Q,ge;for(let Ie=0;Ie<y.length;Ie++)Q=y[Ie],ge=Ie+1>=y.length?y[0]:y[Ie+1],p(re,[Q,ge])&&X++;let Oe=0;return y.forEach(Ie=>{(0,s.isPointOnLineSegment)(Ie,re)&&Oe++}),(X-Oe)%2!==0}s.isPointInsidePolygon=_})(Ma)),Ma}var Go;function od(){return Go||(Go=1,(function(s){var r=on&&on.__createBinding||(Object.create?(function(o,c,f,p){p===void 0&&(p=f);var _=Object.getOwnPropertyDescriptor(c,f);(!_||("get"in _?!c.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return c[f]}}),Object.defineProperty(o,p,_)}):(function(o,c,f,p){p===void 0&&(p=f),o[p]=c[f]})),i=on&&on.__exportStar||function(o,c){for(var f in o)f!=="default"&&!Object.prototype.hasOwnProperty.call(c,f)&&r(c,o,f)};Object.defineProperty(s,"__esModule",{value:!0}),i(La(),s),i(qo(),s),i(ad(),s),i(sd(),s)})(on)),on}var ud=od();function cd(s,r){const{x:i,y:o,width:c,height:f}=r;return s.x>=i&&s.x<=i+c&&s.y>=o&&s.y<=o+f}function ld(s,r){const{x:i,y:o,radius:c}=r;return Math.sqrt((s.x-i)**2+(s.y-o)**2)<=c}function fd(s,r,i,o,c){const f={x:(r+.5)*i,y:(s-.5)*i},p=Vo(f,o);if(c){const _=Vo(f,c);return p||!_}return p}function Vo(s,r){const{polygons:i,rectangles:o,circles:c}=r;return i.some(f=>ud.isPointInsidePolygon(s,f))||o.some(f=>cd(s,f))||c.some(f=>ld(s,f))}function Ho(s){return s.filter(r=>r.polygon).map(r=>{const{x:i,y:o,polygon:c=[]}=r;return c.map(f=>({x:i+f[0],y:o+f[1]}))})}function zo(s){return s.filter(r=>r.rect).map(r=>{const{x:i,y:o,rect:c}=r,[f,p]=c;return{x:i,y:o-p,width:f,height:p}})}function $o(s){return s.filter(r=>r.circle).map(r=>{const{x:i,y:o,circle:c}=r;return{x:i,y:o,radius:c}})}function dd(s,r){const{width:i,height:o,obstacleAreas:c=[],walkableAreas:f=[]}=s,p=f.length>0?{polygons:Ho(f.filter(D=>!D.disabled)),rectangles:zo(f.filter(D=>!D.disabled)),circles:$o(f.filter(D=>!D.disabled))}:null,_={polygons:Ho(c.filter(D=>!D.disabled)),rectangles:zo(c.filter(D=>!D.disabled)),circles:$o(c.filter(D=>!D.disabled))},w=Math.ceil(o/r),y=Math.ceil(i/r),A=[];for(let D=0;D<w;D++){const re=[];for(let X=0;X<y;X++)re.push(fd(w-D,X,r,_,p)?1:0);A.push(re)}return A}var Pa={},xr={},wr={exports:{}};var hd=wr.exports,Yo;function pd(){return Yo||(Yo=1,(function(s,r){(function(){var i,o="4.17.21",c=200,f="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",p="Expected a function",_="Invalid `variable` option passed into `_.template`",w="__lodash_hash_undefined__",y=500,A="__lodash_placeholder__",D=1,re=2,X=4,Q=1,ge=2,Oe=1,Ie=2,Gt=4,ft=8,E=16,R=32,xe=64,Se=128,ke=256,Ar=512,Od=30,Rd="...",kd=800,Ed=16,iu=1,Ld=2,Nd=3,un=1/0,Vt=9007199254740991,Md=17976931348623157e292,gi=NaN,wt=4294967295,Pd=wt-1,Dd=wt>>>1,Bd=[["ary",Se],["bind",Oe],["bindKey",Ie],["curry",ft],["curryRight",E],["flip",Ar],["partial",R],["partialRight",xe],["rearg",ke]],Fn="[object Arguments]",mi="[object Array]",Fd="[object AsyncFunction]",Tr="[object Boolean]",Or="[object Date]",Wd="[object DOMException]",_i="[object Error]",vi="[object Function]",au="[object GeneratorFunction]",dt="[object Map]",Rr="[object Number]",qd="[object Null]",Rt="[object Object]",su="[object Promise]",Zd="[object Proxy]",kr="[object RegExp]",ht="[object Set]",Er="[object String]",yi="[object Symbol]",Ud="[object Undefined]",Lr="[object WeakMap]",Gd="[object WeakSet]",Nr="[object ArrayBuffer]",Wn="[object DataView]",Da="[object Float32Array]",Ba="[object Float64Array]",Fa="[object Int8Array]",Wa="[object Int16Array]",qa="[object Int32Array]",Za="[object Uint8Array]",Ua="[object Uint8ClampedArray]",Ga="[object Uint16Array]",Va="[object Uint32Array]",Vd=/\b__p \+= '';/g,Hd=/\b(__p \+=) '' \+/g,zd=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ou=/&(?:amp|lt|gt|quot|#39);/g,uu=/[&<>"']/g,$d=RegExp(ou.source),Yd=RegExp(uu.source),Kd=/<%-([\s\S]+?)%>/g,Xd=/<%([\s\S]+?)%>/g,cu=/<%=([\s\S]+?)%>/g,Jd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jd=/^\w*$/,Qd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ha=/[\\^$.*+?()[\]{}|]/g,eh=RegExp(Ha.source),za=/^\s+/,th=/\s/,nh=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,rh=/\{\n\/\* \[wrapped with (.+)\] \*/,ih=/,? & /,ah=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,sh=/[()=,{}\[\]\/\s]/,oh=/\\(\\)?/g,uh=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,lu=/\w*$/,ch=/^[-+]0x[0-9a-f]+$/i,lh=/^0b[01]+$/i,fh=/^\[object .+?Constructor\]$/,dh=/^0o[0-7]+$/i,hh=/^(?:0|[1-9]\d*)$/,ph=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xi=/($^)/,gh=/['\n\r\u2028\u2029\\]/g,wi="\\ud800-\\udfff",mh="\\u0300-\\u036f",_h="\\ufe20-\\ufe2f",vh="\\u20d0-\\u20ff",fu=mh+_h+vh,du="\\u2700-\\u27bf",hu="a-z\\xdf-\\xf6\\xf8-\\xff",yh="\\xac\\xb1\\xd7\\xf7",xh="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",wh="\\u2000-\\u206f",Sh=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pu="A-Z\\xc0-\\xd6\\xd8-\\xde",gu="\\ufe0e\\ufe0f",mu=yh+xh+wh+Sh,$a="['’]",bh="["+wi+"]",_u="["+mu+"]",Si="["+fu+"]",vu="\\d+",Ch="["+du+"]",yu="["+hu+"]",xu="[^"+wi+mu+vu+du+hu+pu+"]",Ya="\\ud83c[\\udffb-\\udfff]",Ih="(?:"+Si+"|"+Ya+")",wu="[^"+wi+"]",Ka="(?:\\ud83c[\\udde6-\\uddff]){2}",Xa="[\\ud800-\\udbff][\\udc00-\\udfff]",qn="["+pu+"]",Su="\\u200d",bu="(?:"+yu+"|"+xu+")",Ah="(?:"+qn+"|"+xu+")",Cu="(?:"+$a+"(?:d|ll|m|re|s|t|ve))?",Iu="(?:"+$a+"(?:D|LL|M|RE|S|T|VE))?",Au=Ih+"?",Tu="["+gu+"]?",Th="(?:"+Su+"(?:"+[wu,Ka,Xa].join("|")+")"+Tu+Au+")*",Oh="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rh="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ou=Tu+Au+Th,kh="(?:"+[Ch,Ka,Xa].join("|")+")"+Ou,Eh="(?:"+[wu+Si+"?",Si,Ka,Xa,bh].join("|")+")",Lh=RegExp($a,"g"),Nh=RegExp(Si,"g"),Ja=RegExp(Ya+"(?="+Ya+")|"+Eh+Ou,"g"),Mh=RegExp([qn+"?"+yu+"+"+Cu+"(?="+[_u,qn,"$"].join("|")+")",Ah+"+"+Iu+"(?="+[_u,qn+bu,"$"].join("|")+")",qn+"?"+bu+"+"+Cu,qn+"+"+Iu,Rh,Oh,vu,kh].join("|"),"g"),Ph=RegExp("["+Su+wi+fu+gu+"]"),Dh=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Bh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Fh=-1,pe={};pe[Da]=pe[Ba]=pe[Fa]=pe[Wa]=pe[qa]=pe[Za]=pe[Ua]=pe[Ga]=pe[Va]=!0,pe[Fn]=pe[mi]=pe[Nr]=pe[Tr]=pe[Wn]=pe[Or]=pe[_i]=pe[vi]=pe[dt]=pe[Rr]=pe[Rt]=pe[kr]=pe[ht]=pe[Er]=pe[Lr]=!1;var he={};he[Fn]=he[mi]=he[Nr]=he[Wn]=he[Tr]=he[Or]=he[Da]=he[Ba]=he[Fa]=he[Wa]=he[qa]=he[dt]=he[Rr]=he[Rt]=he[kr]=he[ht]=he[Er]=he[yi]=he[Za]=he[Ua]=he[Ga]=he[Va]=!0,he[_i]=he[vi]=he[Lr]=!1;var Wh={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},qh={"&":"&","<":"<",">":">",'"':""","'":"'"},Zh={"&":"&","<":"<",">":">",""":'"',"'":"'"},Uh={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Gh=parseFloat,Vh=parseInt,Ru=typeof pi=="object"&&pi&&pi.Object===Object&&pi,Hh=typeof self=="object"&&self&&self.Object===Object&&self,Ee=Ru||Hh||Function("return this")(),ja=r&&!r.nodeType&&r,cn=ja&&!0&&s&&!s.nodeType&&s,ku=cn&&cn.exports===ja,Qa=ku&&Ru.process,et=(function(){try{var m=cn&&cn.require&&cn.require("util").types;return m||Qa&&Qa.binding&&Qa.binding("util")}catch{}})(),Eu=et&&et.isArrayBuffer,Lu=et&&et.isDate,Nu=et&&et.isMap,Mu=et&&et.isRegExp,Pu=et&&et.isSet,Du=et&&et.isTypedArray;function $e(m,S,x){switch(x.length){case 0:return m.call(S);case 1:return m.call(S,x[0]);case 2:return m.call(S,x[0],x[1]);case 3:return m.call(S,x[0],x[1],x[2])}return m.apply(S,x)}function zh(m,S,x,B){for(var $=-1,oe=m==null?0:m.length;++$<oe;){var Ae=m[$];S(B,Ae,x(Ae),m)}return B}function tt(m,S){for(var x=-1,B=m==null?0:m.length;++x<B&&S(m[x],x,m)!==!1;);return m}function $h(m,S){for(var x=m==null?0:m.length;x--&&S(m[x],x,m)!==!1;);return m}function Bu(m,S){for(var x=-1,B=m==null?0:m.length;++x<B;)if(!S(m[x],x,m))return!1;return!0}function Ht(m,S){for(var x=-1,B=m==null?0:m.length,$=0,oe=[];++x<B;){var Ae=m[x];S(Ae,x,m)&&(oe[$++]=Ae)}return oe}function bi(m,S){var x=m==null?0:m.length;return!!x&&Zn(m,S,0)>-1}function es(m,S,x){for(var B=-1,$=m==null?0:m.length;++B<$;)if(x(S,m[B]))return!0;return!1}function me(m,S){for(var x=-1,B=m==null?0:m.length,$=Array(B);++x<B;)$[x]=S(m[x],x,m);return $}function zt(m,S){for(var x=-1,B=S.length,$=m.length;++x<B;)m[$+x]=S[x];return m}function ts(m,S,x,B){var $=-1,oe=m==null?0:m.length;for(B&&oe&&(x=m[++$]);++$<oe;)x=S(x,m[$],$,m);return x}function Yh(m,S,x,B){var $=m==null?0:m.length;for(B&&$&&(x=m[--$]);$--;)x=S(x,m[$],$,m);return x}function ns(m,S){for(var x=-1,B=m==null?0:m.length;++x<B;)if(S(m[x],x,m))return!0;return!1}var Kh=rs("length");function Xh(m){return m.split("")}function Jh(m){return m.match(ah)||[]}function Fu(m,S,x){var B;return x(m,function($,oe,Ae){if(S($,oe,Ae))return B=oe,!1}),B}function Ci(m,S,x,B){for(var $=m.length,oe=x+(B?1:-1);B?oe--:++oe<$;)if(S(m[oe],oe,m))return oe;return-1}function Zn(m,S,x){return S===S?cp(m,S,x):Ci(m,Wu,x)}function jh(m,S,x,B){for(var $=x-1,oe=m.length;++$<oe;)if(B(m[$],S))return $;return-1}function Wu(m){return m!==m}function qu(m,S){var x=m==null?0:m.length;return x?as(m,S)/x:gi}function rs(m){return function(S){return S==null?i:S[m]}}function is(m){return function(S){return m==null?i:m[S]}}function Zu(m,S,x,B,$){return $(m,function(oe,Ae,fe){x=B?(B=!1,oe):S(x,oe,Ae,fe)}),x}function Qh(m,S){var x=m.length;for(m.sort(S);x--;)m[x]=m[x].value;return m}function as(m,S){for(var x,B=-1,$=m.length;++B<$;){var oe=S(m[B]);oe!==i&&(x=x===i?oe:x+oe)}return x}function ss(m,S){for(var x=-1,B=Array(m);++x<m;)B[x]=S(x);return B}function ep(m,S){return me(S,function(x){return[x,m[x]]})}function Uu(m){return m&&m.slice(0,zu(m)+1).replace(za,"")}function Ye(m){return function(S){return m(S)}}function os(m,S){return me(S,function(x){return m[x]})}function Mr(m,S){return m.has(S)}function Gu(m,S){for(var x=-1,B=m.length;++x<B&&Zn(S,m[x],0)>-1;);return x}function Vu(m,S){for(var x=m.length;x--&&Zn(S,m[x],0)>-1;);return x}function tp(m,S){for(var x=m.length,B=0;x--;)m[x]===S&&++B;return B}var np=is(Wh),rp=is(qh);function ip(m){return"\\"+Uh[m]}function ap(m,S){return m==null?i:m[S]}function Un(m){return Ph.test(m)}function sp(m){return Dh.test(m)}function op(m){for(var S,x=[];!(S=m.next()).done;)x.push(S.value);return x}function us(m){var S=-1,x=Array(m.size);return m.forEach(function(B,$){x[++S]=[$,B]}),x}function Hu(m,S){return function(x){return m(S(x))}}function $t(m,S){for(var x=-1,B=m.length,$=0,oe=[];++x<B;){var Ae=m[x];(Ae===S||Ae===A)&&(m[x]=A,oe[$++]=x)}return oe}function Ii(m){var S=-1,x=Array(m.size);return m.forEach(function(B){x[++S]=B}),x}function up(m){var S=-1,x=Array(m.size);return m.forEach(function(B){x[++S]=[B,B]}),x}function cp(m,S,x){for(var B=x-1,$=m.length;++B<$;)if(m[B]===S)return B;return-1}function lp(m,S,x){for(var B=x+1;B--;)if(m[B]===S)return B;return B}function Gn(m){return Un(m)?dp(m):Kh(m)}function pt(m){return Un(m)?hp(m):Xh(m)}function zu(m){for(var S=m.length;S--&&th.test(m.charAt(S)););return S}var fp=is(Zh);function dp(m){for(var S=Ja.lastIndex=0;Ja.test(m);)++S;return S}function hp(m){return m.match(Ja)||[]}function pp(m){return m.match(Mh)||[]}var gp=(function m(S){S=S==null?Ee:Vn.defaults(Ee.Object(),S,Vn.pick(Ee,Bh));var x=S.Array,B=S.Date,$=S.Error,oe=S.Function,Ae=S.Math,fe=S.Object,cs=S.RegExp,mp=S.String,nt=S.TypeError,Ai=x.prototype,_p=oe.prototype,Hn=fe.prototype,Ti=S["__core-js_shared__"],Oi=_p.toString,ce=Hn.hasOwnProperty,vp=0,$u=(function(){var e=/[^.]+$/.exec(Ti&&Ti.keys&&Ti.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})(),Ri=Hn.toString,yp=Oi.call(fe),xp=Ee._,wp=cs("^"+Oi.call(ce).replace(Ha,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ki=ku?S.Buffer:i,Yt=S.Symbol,Ei=S.Uint8Array,Yu=ki?ki.allocUnsafe:i,Li=Hu(fe.getPrototypeOf,fe),Ku=fe.create,Xu=Hn.propertyIsEnumerable,Ni=Ai.splice,Ju=Yt?Yt.isConcatSpreadable:i,Pr=Yt?Yt.iterator:i,ln=Yt?Yt.toStringTag:i,Mi=(function(){try{var e=gn(fe,"defineProperty");return e({},"",{}),e}catch{}})(),Sp=S.clearTimeout!==Ee.clearTimeout&&S.clearTimeout,bp=B&&B.now!==Ee.Date.now&&B.now,Cp=S.setTimeout!==Ee.setTimeout&&S.setTimeout,Pi=Ae.ceil,Di=Ae.floor,ls=fe.getOwnPropertySymbols,Ip=ki?ki.isBuffer:i,ju=S.isFinite,Ap=Ai.join,Tp=Hu(fe.keys,fe),Te=Ae.max,Me=Ae.min,Op=B.now,Rp=S.parseInt,Qu=Ae.random,kp=Ai.reverse,fs=gn(S,"DataView"),Dr=gn(S,"Map"),ds=gn(S,"Promise"),zn=gn(S,"Set"),Br=gn(S,"WeakMap"),Fr=gn(fe,"create"),Bi=Br&&new Br,$n={},Ep=mn(fs),Lp=mn(Dr),Np=mn(ds),Mp=mn(zn),Pp=mn(Br),Fi=Yt?Yt.prototype:i,Wr=Fi?Fi.valueOf:i,ec=Fi?Fi.toString:i;function l(e){if(we(e)&&!Y(e)&&!(e instanceof ie)){if(e instanceof rt)return e;if(ce.call(e,"__wrapped__"))return tl(e)}return new rt(e)}var Yn=(function(){function e(){}return function(t){if(!ve(t))return{};if(Ku)return Ku(t);e.prototype=t;var n=new e;return e.prototype=i,n}})();function Wi(){}function rt(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}l.templateSettings={escape:Kd,evaluate:Xd,interpolate:cu,variable:"",imports:{_:l}},l.prototype=Wi.prototype,l.prototype.constructor=l,rt.prototype=Yn(Wi.prototype),rt.prototype.constructor=rt;function ie(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=wt,this.__views__=[]}function Dp(){var e=new ie(this.__wrapped__);return e.__actions__=Ze(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ze(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ze(this.__views__),e}function Bp(){if(this.__filtered__){var e=new ie(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Fp(){var e=this.__wrapped__.value(),t=this.__dir__,n=Y(e),a=t<0,u=n?e.length:0,d=Xg(0,u,this.__views__),h=d.start,g=d.end,v=g-h,b=a?g:h-1,C=this.__iteratees__,T=C.length,N=0,W=Me(v,this.__takeCount__);if(!n||!a&&u==v&&W==v)return Cc(e,this.__actions__);var G=[];e:for(;v--&&N<W;){b+=t;for(var ee=-1,V=e[b];++ee<T;){var ne=C[ee],ae=ne.iteratee,Je=ne.type,qe=ae(V);if(Je==Ld)V=qe;else if(!qe){if(Je==iu)continue e;break e}}G[N++]=V}return G}ie.prototype=Yn(Wi.prototype),ie.prototype.constructor=ie;function fn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var a=e[t];this.set(a[0],a[1])}}function Wp(){this.__data__=Fr?Fr(null):{},this.size=0}function qp(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Zp(e){var t=this.__data__;if(Fr){var n=t[e];return n===w?i:n}return ce.call(t,e)?t[e]:i}function Up(e){var t=this.__data__;return Fr?t[e]!==i:ce.call(t,e)}function Gp(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Fr&&t===i?w:t,this}fn.prototype.clear=Wp,fn.prototype.delete=qp,fn.prototype.get=Zp,fn.prototype.has=Up,fn.prototype.set=Gp;function kt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var a=e[t];this.set(a[0],a[1])}}function Vp(){this.__data__=[],this.size=0}function Hp(e){var t=this.__data__,n=qi(t,e);if(n<0)return!1;var a=t.length-1;return n==a?t.pop():Ni.call(t,n,1),--this.size,!0}function zp(e){var t=this.__data__,n=qi(t,e);return n<0?i:t[n][1]}function $p(e){return qi(this.__data__,e)>-1}function Yp(e,t){var n=this.__data__,a=qi(n,e);return a<0?(++this.size,n.push([e,t])):n[a][1]=t,this}kt.prototype.clear=Vp,kt.prototype.delete=Hp,kt.prototype.get=zp,kt.prototype.has=$p,kt.prototype.set=Yp;function Et(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var a=e[t];this.set(a[0],a[1])}}function Kp(){this.size=0,this.__data__={hash:new fn,map:new(Dr||kt),string:new fn}}function Xp(e){var t=ji(this,e).delete(e);return this.size-=t?1:0,t}function Jp(e){return ji(this,e).get(e)}function jp(e){return ji(this,e).has(e)}function Qp(e,t){var n=ji(this,e),a=n.size;return n.set(e,t),this.size+=n.size==a?0:1,this}Et.prototype.clear=Kp,Et.prototype.delete=Xp,Et.prototype.get=Jp,Et.prototype.has=jp,Et.prototype.set=Qp;function dn(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Et;++t<n;)this.add(e[t])}function eg(e){return this.__data__.set(e,w),this}function tg(e){return this.__data__.has(e)}dn.prototype.add=dn.prototype.push=eg,dn.prototype.has=tg;function gt(e){var t=this.__data__=new kt(e);this.size=t.size}function ng(){this.__data__=new kt,this.size=0}function rg(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function ig(e){return this.__data__.get(e)}function ag(e){return this.__data__.has(e)}function sg(e,t){var n=this.__data__;if(n instanceof kt){var a=n.__data__;if(!Dr||a.length<c-1)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new Et(a)}return n.set(e,t),this.size=n.size,this}gt.prototype.clear=ng,gt.prototype.delete=rg,gt.prototype.get=ig,gt.prototype.has=ag,gt.prototype.set=sg;function tc(e,t){var n=Y(e),a=!n&&_n(e),u=!n&&!a&&Qt(e),d=!n&&!a&&!u&&jn(e),h=n||a||u||d,g=h?ss(e.length,mp):[],v=g.length;for(var b in e)(t||ce.call(e,b))&&!(h&&(b=="length"||u&&(b=="offset"||b=="parent")||d&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||Pt(b,v)))&&g.push(b);return g}function nc(e){var t=e.length;return t?e[bs(0,t-1)]:i}function og(e,t){return Qi(Ze(e),hn(t,0,e.length))}function ug(e){return Qi(Ze(e))}function hs(e,t,n){(n!==i&&!mt(e[t],n)||n===i&&!(t in e))&&Lt(e,t,n)}function qr(e,t,n){var a=e[t];(!(ce.call(e,t)&&mt(a,n))||n===i&&!(t in e))&&Lt(e,t,n)}function qi(e,t){for(var n=e.length;n--;)if(mt(e[n][0],t))return n;return-1}function cg(e,t,n,a){return Kt(e,function(u,d,h){t(a,u,n(u),h)}),a}function rc(e,t){return e&&bt(t,Re(t),e)}function lg(e,t){return e&&bt(t,Ge(t),e)}function Lt(e,t,n){t=="__proto__"&&Mi?Mi(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ps(e,t){for(var n=-1,a=t.length,u=x(a),d=e==null;++n<a;)u[n]=d?i:Ys(e,t[n]);return u}function hn(e,t,n){return e===e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function it(e,t,n,a,u,d){var h,g=t&D,v=t&re,b=t&X;if(n&&(h=u?n(e,a,u,d):n(e)),h!==i)return h;if(!ve(e))return e;var C=Y(e);if(C){if(h=jg(e),!g)return Ze(e,h)}else{var T=Pe(e),N=T==vi||T==au;if(Qt(e))return Tc(e,g);if(T==Rt||T==Fn||N&&!u){if(h=v||N?{}:zc(e),!g)return v?Zg(e,lg(h,e)):qg(e,rc(h,e))}else{if(!he[T])return u?e:{};h=Qg(e,T,g)}}d||(d=new gt);var W=d.get(e);if(W)return W;d.set(e,h),wl(e)?e.forEach(function(V){h.add(it(V,t,n,V,e,d))}):yl(e)&&e.forEach(function(V,ne){h.set(ne,it(V,t,n,ne,e,d))});var G=b?v?Ms:Ns:v?Ge:Re,ee=C?i:G(e);return tt(ee||e,function(V,ne){ee&&(ne=V,V=e[ne]),qr(h,ne,it(V,t,n,ne,e,d))}),h}function fg(e){var t=Re(e);return function(n){return ic(n,e,t)}}function ic(e,t,n){var a=n.length;if(e==null)return!a;for(e=fe(e);a--;){var u=n[a],d=t[u],h=e[u];if(h===i&&!(u in e)||!d(h))return!1}return!0}function ac(e,t,n){if(typeof e!="function")throw new nt(p);return $r(function(){e.apply(i,n)},t)}function Zr(e,t,n,a){var u=-1,d=bi,h=!0,g=e.length,v=[],b=t.length;if(!g)return v;n&&(t=me(t,Ye(n))),a?(d=es,h=!1):t.length>=c&&(d=Mr,h=!1,t=new dn(t));e:for(;++u<g;){var C=e[u],T=n==null?C:n(C);if(C=a||C!==0?C:0,h&&T===T){for(var N=b;N--;)if(t[N]===T)continue e;v.push(C)}else d(t,T,a)||v.push(C)}return v}var Kt=Lc(St),sc=Lc(ms,!0);function dg(e,t){var n=!0;return Kt(e,function(a,u,d){return n=!!t(a,u,d),n}),n}function Zi(e,t,n){for(var a=-1,u=e.length;++a<u;){var d=e[a],h=t(d);if(h!=null&&(g===i?h===h&&!Xe(h):n(h,g)))var g=h,v=d}return v}function hg(e,t,n,a){var u=e.length;for(n=J(n),n<0&&(n=-n>u?0:u+n),a=a===i||a>u?u:J(a),a<0&&(a+=u),a=n>a?0:bl(a);n<a;)e[n++]=t;return e}function oc(e,t){var n=[];return Kt(e,function(a,u,d){t(a,u,d)&&n.push(a)}),n}function Le(e,t,n,a,u){var d=-1,h=e.length;for(n||(n=tm),u||(u=[]);++d<h;){var g=e[d];t>0&&n(g)?t>1?Le(g,t-1,n,a,u):zt(u,g):a||(u[u.length]=g)}return u}var gs=Nc(),uc=Nc(!0);function St(e,t){return e&&gs(e,t,Re)}function ms(e,t){return e&&uc(e,t,Re)}function Ui(e,t){return Ht(t,function(n){return Dt(e[n])})}function pn(e,t){t=Jt(t,e);for(var n=0,a=t.length;e!=null&&n<a;)e=e[Ct(t[n++])];return n&&n==a?e:i}function cc(e,t,n){var a=t(e);return Y(e)?a:zt(a,n(e))}function Fe(e){return e==null?e===i?Ud:qd:ln&&ln in fe(e)?Kg(e):um(e)}function _s(e,t){return e>t}function pg(e,t){return e!=null&&ce.call(e,t)}function gg(e,t){return e!=null&&t in fe(e)}function mg(e,t,n){return e>=Me(t,n)&&e<Te(t,n)}function vs(e,t,n){for(var a=n?es:bi,u=e[0].length,d=e.length,h=d,g=x(d),v=1/0,b=[];h--;){var C=e[h];h&&t&&(C=me(C,Ye(t))),v=Me(C.length,v),g[h]=!n&&(t||u>=120&&C.length>=120)?new dn(h&&C):i}C=e[0];var T=-1,N=g[0];e:for(;++T<u&&b.length<v;){var W=C[T],G=t?t(W):W;if(W=n||W!==0?W:0,!(N?Mr(N,G):a(b,G,n))){for(h=d;--h;){var ee=g[h];if(!(ee?Mr(ee,G):a(e[h],G,n)))continue e}N&&N.push(G),b.push(W)}}return b}function _g(e,t,n,a){return St(e,function(u,d,h){t(a,n(u),d,h)}),a}function Ur(e,t,n){t=Jt(t,e),e=Xc(e,t);var a=e==null?e:e[Ct(st(t))];return a==null?i:$e(a,e,n)}function lc(e){return we(e)&&Fe(e)==Fn}function vg(e){return we(e)&&Fe(e)==Nr}function yg(e){return we(e)&&Fe(e)==Or}function Gr(e,t,n,a,u){return e===t?!0:e==null||t==null||!we(e)&&!we(t)?e!==e&&t!==t:xg(e,t,n,a,Gr,u)}function xg(e,t,n,a,u,d){var h=Y(e),g=Y(t),v=h?mi:Pe(e),b=g?mi:Pe(t);v=v==Fn?Rt:v,b=b==Fn?Rt:b;var C=v==Rt,T=b==Rt,N=v==b;if(N&&Qt(e)){if(!Qt(t))return!1;h=!0,C=!1}if(N&&!C)return d||(d=new gt),h||jn(e)?Gc(e,t,n,a,u,d):$g(e,t,v,n,a,u,d);if(!(n&Q)){var W=C&&ce.call(e,"__wrapped__"),G=T&&ce.call(t,"__wrapped__");if(W||G){var ee=W?e.value():e,V=G?t.value():t;return d||(d=new gt),u(ee,V,n,a,d)}}return N?(d||(d=new gt),Yg(e,t,n,a,u,d)):!1}function wg(e){return we(e)&&Pe(e)==dt}function ys(e,t,n,a){var u=n.length,d=u,h=!a;if(e==null)return!d;for(e=fe(e);u--;){var g=n[u];if(h&&g[2]?g[1]!==e[g[0]]:!(g[0]in e))return!1}for(;++u<d;){g=n[u];var v=g[0],b=e[v],C=g[1];if(h&&g[2]){if(b===i&&!(v in e))return!1}else{var T=new gt;if(a)var N=a(b,C,v,e,t,T);if(!(N===i?Gr(C,b,Q|ge,a,T):N))return!1}}return!0}function fc(e){if(!ve(e)||rm(e))return!1;var t=Dt(e)?wp:fh;return t.test(mn(e))}function Sg(e){return we(e)&&Fe(e)==kr}function bg(e){return we(e)&&Pe(e)==ht}function Cg(e){return we(e)&&aa(e.length)&&!!pe[Fe(e)]}function dc(e){return typeof e=="function"?e:e==null?Ve:typeof e=="object"?Y(e)?gc(e[0],e[1]):pc(e):Ml(e)}function xs(e){if(!zr(e))return Tp(e);var t=[];for(var n in fe(e))ce.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ig(e){if(!ve(e))return om(e);var t=zr(e),n=[];for(var a in e)a=="constructor"&&(t||!ce.call(e,a))||n.push(a);return n}function ws(e,t){return e<t}function hc(e,t){var n=-1,a=Ue(e)?x(e.length):[];return Kt(e,function(u,d,h){a[++n]=t(u,d,h)}),a}function pc(e){var t=Ds(e);return t.length==1&&t[0][2]?Yc(t[0][0],t[0][1]):function(n){return n===e||ys(n,e,t)}}function gc(e,t){return Fs(e)&&$c(t)?Yc(Ct(e),t):function(n){var a=Ys(n,e);return a===i&&a===t?Ks(n,e):Gr(t,a,Q|ge)}}function Gi(e,t,n,a,u){e!==t&&gs(t,function(d,h){if(u||(u=new gt),ve(d))Ag(e,t,h,n,Gi,a,u);else{var g=a?a(qs(e,h),d,h+"",e,t,u):i;g===i&&(g=d),hs(e,h,g)}},Ge)}function Ag(e,t,n,a,u,d,h){var g=qs(e,n),v=qs(t,n),b=h.get(v);if(b){hs(e,n,b);return}var C=d?d(g,v,n+"",e,t,h):i,T=C===i;if(T){var N=Y(v),W=!N&&Qt(v),G=!N&&!W&&jn(v);C=v,N||W||G?Y(g)?C=g:be(g)?C=Ze(g):W?(T=!1,C=Tc(v,!0)):G?(T=!1,C=Oc(v,!0)):C=[]:Yr(v)||_n(v)?(C=g,_n(g)?C=Cl(g):(!ve(g)||Dt(g))&&(C=zc(v))):T=!1}T&&(h.set(v,C),u(C,v,a,d,h),h.delete(v)),hs(e,n,C)}function mc(e,t){var n=e.length;if(n)return t+=t<0?n:0,Pt(t,n)?e[t]:i}function _c(e,t,n){t.length?t=me(t,function(d){return Y(d)?function(h){return pn(h,d.length===1?d[0]:d)}:d}):t=[Ve];var a=-1;t=me(t,Ye(Z()));var u=hc(e,function(d,h,g){var v=me(t,function(b){return b(d)});return{criteria:v,index:++a,value:d}});return Qh(u,function(d,h){return Wg(d,h,n)})}function Tg(e,t){return vc(e,t,function(n,a){return Ks(e,a)})}function vc(e,t,n){for(var a=-1,u=t.length,d={};++a<u;){var h=t[a],g=pn(e,h);n(g,h)&&Vr(d,Jt(h,e),g)}return d}function Og(e){return function(t){return pn(t,e)}}function Ss(e,t,n,a){var u=a?jh:Zn,d=-1,h=t.length,g=e;for(e===t&&(t=Ze(t)),n&&(g=me(e,Ye(n)));++d<h;)for(var v=0,b=t[d],C=n?n(b):b;(v=u(g,C,v,a))>-1;)g!==e&&Ni.call(g,v,1),Ni.call(e,v,1);return e}function yc(e,t){for(var n=e?t.length:0,a=n-1;n--;){var u=t[n];if(n==a||u!==d){var d=u;Pt(u)?Ni.call(e,u,1):As(e,u)}}return e}function bs(e,t){return e+Di(Qu()*(t-e+1))}function Rg(e,t,n,a){for(var u=-1,d=Te(Pi((t-e)/(n||1)),0),h=x(d);d--;)h[a?d:++u]=e,e+=n;return h}function Cs(e,t){var n="";if(!e||t<1||t>Vt)return n;do t%2&&(n+=e),t=Di(t/2),t&&(e+=e);while(t);return n}function te(e,t){return Zs(Kc(e,t,Ve),e+"")}function kg(e){return nc(Qn(e))}function Eg(e,t){var n=Qn(e);return Qi(n,hn(t,0,n.length))}function Vr(e,t,n,a){if(!ve(e))return e;t=Jt(t,e);for(var u=-1,d=t.length,h=d-1,g=e;g!=null&&++u<d;){var v=Ct(t[u]),b=n;if(v==="__proto__"||v==="constructor"||v==="prototype")return e;if(u!=h){var C=g[v];b=a?a(C,v,g):i,b===i&&(b=ve(C)?C:Pt(t[u+1])?[]:{})}qr(g,v,b),g=g[v]}return e}var xc=Bi?function(e,t){return Bi.set(e,t),e}:Ve,Lg=Mi?function(e,t){return Mi(e,"toString",{configurable:!0,enumerable:!1,value:Js(t),writable:!0})}:Ve;function Ng(e){return Qi(Qn(e))}function at(e,t,n){var a=-1,u=e.length;t<0&&(t=-t>u?0:u+t),n=n>u?u:n,n<0&&(n+=u),u=t>n?0:n-t>>>0,t>>>=0;for(var d=x(u);++a<u;)d[a]=e[a+t];return d}function Mg(e,t){var n;return Kt(e,function(a,u,d){return n=t(a,u,d),!n}),!!n}function Vi(e,t,n){var a=0,u=e==null?a:e.length;if(typeof t=="number"&&t===t&&u<=Dd){for(;a<u;){var d=a+u>>>1,h=e[d];h!==null&&!Xe(h)&&(n?h<=t:h<t)?a=d+1:u=d}return u}return Is(e,t,Ve,n)}function Is(e,t,n,a){var u=0,d=e==null?0:e.length;if(d===0)return 0;t=n(t);for(var h=t!==t,g=t===null,v=Xe(t),b=t===i;u<d;){var C=Di((u+d)/2),T=n(e[C]),N=T!==i,W=T===null,G=T===T,ee=Xe(T);if(h)var V=a||G;else b?V=G&&(a||N):g?V=G&&N&&(a||!W):v?V=G&&N&&!W&&(a||!ee):W||ee?V=!1:V=a?T<=t:T<t;V?u=C+1:d=C}return Me(d,Pd)}function wc(e,t){for(var n=-1,a=e.length,u=0,d=[];++n<a;){var h=e[n],g=t?t(h):h;if(!n||!mt(g,v)){var v=g;d[u++]=h===0?0:h}}return d}function Sc(e){return typeof e=="number"?e:Xe(e)?gi:+e}function Ke(e){if(typeof e=="string")return e;if(Y(e))return me(e,Ke)+"";if(Xe(e))return ec?ec.call(e):"";var t=e+"";return t=="0"&&1/e==-un?"-0":t}function Xt(e,t,n){var a=-1,u=bi,d=e.length,h=!0,g=[],v=g;if(n)h=!1,u=es;else if(d>=c){var b=t?null:Hg(e);if(b)return Ii(b);h=!1,u=Mr,v=new dn}else v=t?[]:g;e:for(;++a<d;){var C=e[a],T=t?t(C):C;if(C=n||C!==0?C:0,h&&T===T){for(var N=v.length;N--;)if(v[N]===T)continue e;t&&v.push(T),g.push(C)}else u(v,T,n)||(v!==g&&v.push(T),g.push(C))}return g}function As(e,t){return t=Jt(t,e),e=Xc(e,t),e==null||delete e[Ct(st(t))]}function bc(e,t,n,a){return Vr(e,t,n(pn(e,t)),a)}function Hi(e,t,n,a){for(var u=e.length,d=a?u:-1;(a?d--:++d<u)&&t(e[d],d,e););return n?at(e,a?0:d,a?d+1:u):at(e,a?d+1:0,a?u:d)}function Cc(e,t){var n=e;return n instanceof ie&&(n=n.value()),ts(t,function(a,u){return u.func.apply(u.thisArg,zt([a],u.args))},n)}function Ts(e,t,n){var a=e.length;if(a<2)return a?Xt(e[0]):[];for(var u=-1,d=x(a);++u<a;)for(var h=e[u],g=-1;++g<a;)g!=u&&(d[u]=Zr(d[u]||h,e[g],t,n));return Xt(Le(d,1),t,n)}function Ic(e,t,n){for(var a=-1,u=e.length,d=t.length,h={};++a<u;){var g=a<d?t[a]:i;n(h,e[a],g)}return h}function Os(e){return be(e)?e:[]}function Rs(e){return typeof e=="function"?e:Ve}function Jt(e,t){return Y(e)?e:Fs(e,t)?[e]:el(ue(e))}var Pg=te;function jt(e,t,n){var a=e.length;return n=n===i?a:n,!t&&n>=a?e:at(e,t,n)}var Ac=Sp||function(e){return Ee.clearTimeout(e)};function Tc(e,t){if(t)return e.slice();var n=e.length,a=Yu?Yu(n):new e.constructor(n);return e.copy(a),a}function ks(e){var t=new e.constructor(e.byteLength);return new Ei(t).set(new Ei(e)),t}function Dg(e,t){var n=t?ks(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Bg(e){var t=new e.constructor(e.source,lu.exec(e));return t.lastIndex=e.lastIndex,t}function Fg(e){return Wr?fe(Wr.call(e)):{}}function Oc(e,t){var n=t?ks(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Rc(e,t){if(e!==t){var n=e!==i,a=e===null,u=e===e,d=Xe(e),h=t!==i,g=t===null,v=t===t,b=Xe(t);if(!g&&!b&&!d&&e>t||d&&h&&v&&!g&&!b||a&&h&&v||!n&&v||!u)return 1;if(!a&&!d&&!b&&e<t||b&&n&&u&&!a&&!d||g&&n&&u||!h&&u||!v)return-1}return 0}function Wg(e,t,n){for(var a=-1,u=e.criteria,d=t.criteria,h=u.length,g=n.length;++a<h;){var v=Rc(u[a],d[a]);if(v){if(a>=g)return v;var b=n[a];return v*(b=="desc"?-1:1)}}return e.index-t.index}function kc(e,t,n,a){for(var u=-1,d=e.length,h=n.length,g=-1,v=t.length,b=Te(d-h,0),C=x(v+b),T=!a;++g<v;)C[g]=t[g];for(;++u<h;)(T||u<d)&&(C[n[u]]=e[u]);for(;b--;)C[g++]=e[u++];return C}function Ec(e,t,n,a){for(var u=-1,d=e.length,h=-1,g=n.length,v=-1,b=t.length,C=Te(d-g,0),T=x(C+b),N=!a;++u<C;)T[u]=e[u];for(var W=u;++v<b;)T[W+v]=t[v];for(;++h<g;)(N||u<d)&&(T[W+n[h]]=e[u++]);return T}function Ze(e,t){var n=-1,a=e.length;for(t||(t=x(a));++n<a;)t[n]=e[n];return t}function bt(e,t,n,a){var u=!n;n||(n={});for(var d=-1,h=t.length;++d<h;){var g=t[d],v=a?a(n[g],e[g],g,n,e):i;v===i&&(v=e[g]),u?Lt(n,g,v):qr(n,g,v)}return n}function qg(e,t){return bt(e,Bs(e),t)}function Zg(e,t){return bt(e,Vc(e),t)}function zi(e,t){return function(n,a){var u=Y(n)?zh:cg,d=t?t():{};return u(n,e,Z(a,2),d)}}function Kn(e){return te(function(t,n){var a=-1,u=n.length,d=u>1?n[u-1]:i,h=u>2?n[2]:i;for(d=e.length>3&&typeof d=="function"?(u--,d):i,h&&We(n[0],n[1],h)&&(d=u<3?i:d,u=1),t=fe(t);++a<u;){var g=n[a];g&&e(t,g,a,d)}return t})}function Lc(e,t){return function(n,a){if(n==null)return n;if(!Ue(n))return e(n,a);for(var u=n.length,d=t?u:-1,h=fe(n);(t?d--:++d<u)&&a(h[d],d,h)!==!1;);return n}}function Nc(e){return function(t,n,a){for(var u=-1,d=fe(t),h=a(t),g=h.length;g--;){var v=h[e?g:++u];if(n(d[v],v,d)===!1)break}return t}}function Ug(e,t,n){var a=t&Oe,u=Hr(e);function d(){var h=this&&this!==Ee&&this instanceof d?u:e;return h.apply(a?n:this,arguments)}return d}function Mc(e){return function(t){t=ue(t);var n=Un(t)?pt(t):i,a=n?n[0]:t.charAt(0),u=n?jt(n,1).join(""):t.slice(1);return a[e]()+u}}function Xn(e){return function(t){return ts(Ll(El(t).replace(Lh,"")),e,"")}}function Hr(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Yn(e.prototype),a=e.apply(n,t);return ve(a)?a:n}}function Gg(e,t,n){var a=Hr(e);function u(){for(var d=arguments.length,h=x(d),g=d,v=Jn(u);g--;)h[g]=arguments[g];var b=d<3&&h[0]!==v&&h[d-1]!==v?[]:$t(h,v);if(d-=b.length,d<n)return Wc(e,t,$i,u.placeholder,i,h,b,i,i,n-d);var C=this&&this!==Ee&&this instanceof u?a:e;return $e(C,this,h)}return u}function Pc(e){return function(t,n,a){var u=fe(t);if(!Ue(t)){var d=Z(n,3);t=Re(t),n=function(g){return d(u[g],g,u)}}var h=e(t,n,a);return h>-1?u[d?t[h]:h]:i}}function Dc(e){return Mt(function(t){var n=t.length,a=n,u=rt.prototype.thru;for(e&&t.reverse();a--;){var d=t[a];if(typeof d!="function")throw new nt(p);if(u&&!h&&Ji(d)=="wrapper")var h=new rt([],!0)}for(a=h?a:n;++a<n;){d=t[a];var g=Ji(d),v=g=="wrapper"?Ps(d):i;v&&Ws(v[0])&&v[1]==(Se|ft|R|ke)&&!v[4].length&&v[9]==1?h=h[Ji(v[0])].apply(h,v[3]):h=d.length==1&&Ws(d)?h[g]():h.thru(d)}return function(){var b=arguments,C=b[0];if(h&&b.length==1&&Y(C))return h.plant(C).value();for(var T=0,N=n?t[T].apply(this,b):C;++T<n;)N=t[T].call(this,N);return N}})}function $i(e,t,n,a,u,d,h,g,v,b){var C=t&Se,T=t&Oe,N=t&Ie,W=t&(ft|E),G=t&Ar,ee=N?i:Hr(e);function V(){for(var ne=arguments.length,ae=x(ne),Je=ne;Je--;)ae[Je]=arguments[Je];if(W)var qe=Jn(V),je=tp(ae,qe);if(a&&(ae=kc(ae,a,u,W)),d&&(ae=Ec(ae,d,h,W)),ne-=je,W&&ne<b){var Ce=$t(ae,qe);return Wc(e,t,$i,V.placeholder,n,ae,Ce,g,v,b-ne)}var _t=T?n:this,Ft=N?_t[e]:e;return ne=ae.length,g?ae=cm(ae,g):G&&ne>1&&ae.reverse(),C&&v<ne&&(ae.length=v),this&&this!==Ee&&this instanceof V&&(Ft=ee||Hr(Ft)),Ft.apply(_t,ae)}return V}function Bc(e,t){return function(n,a){return _g(n,e,t(a),{})}}function Yi(e,t){return function(n,a){var u;if(n===i&&a===i)return t;if(n!==i&&(u=n),a!==i){if(u===i)return a;typeof n=="string"||typeof a=="string"?(n=Ke(n),a=Ke(a)):(n=Sc(n),a=Sc(a)),u=e(n,a)}return u}}function Es(e){return Mt(function(t){return t=me(t,Ye(Z())),te(function(n){var a=this;return e(t,function(u){return $e(u,a,n)})})})}function Ki(e,t){t=t===i?" ":Ke(t);var n=t.length;if(n<2)return n?Cs(t,e):t;var a=Cs(t,Pi(e/Gn(t)));return Un(t)?jt(pt(a),0,e).join(""):a.slice(0,e)}function Vg(e,t,n,a){var u=t&Oe,d=Hr(e);function h(){for(var g=-1,v=arguments.length,b=-1,C=a.length,T=x(C+v),N=this&&this!==Ee&&this instanceof h?d:e;++b<C;)T[b]=a[b];for(;v--;)T[b++]=arguments[++g];return $e(N,u?n:this,T)}return h}function Fc(e){return function(t,n,a){return a&&typeof a!="number"&&We(t,n,a)&&(n=a=i),t=Bt(t),n===i?(n=t,t=0):n=Bt(n),a=a===i?t<n?1:-1:Bt(a),Rg(t,n,a,e)}}function Xi(e){return function(t,n){return typeof t=="string"&&typeof n=="string"||(t=ot(t),n=ot(n)),e(t,n)}}function Wc(e,t,n,a,u,d,h,g,v,b){var C=t&ft,T=C?h:i,N=C?i:h,W=C?d:i,G=C?i:d;t|=C?R:xe,t&=~(C?xe:R),t&Gt||(t&=-4);var ee=[e,t,u,W,T,G,N,g,v,b],V=n.apply(i,ee);return Ws(e)&&Jc(V,ee),V.placeholder=a,jc(V,e,t)}function Ls(e){var t=Ae[e];return function(n,a){if(n=ot(n),a=a==null?0:Me(J(a),292),a&&ju(n)){var u=(ue(n)+"e").split("e"),d=t(u[0]+"e"+(+u[1]+a));return u=(ue(d)+"e").split("e"),+(u[0]+"e"+(+u[1]-a))}return t(n)}}var Hg=zn&&1/Ii(new zn([,-0]))[1]==un?function(e){return new zn(e)}:eo;function qc(e){return function(t){var n=Pe(t);return n==dt?us(t):n==ht?up(t):ep(t,e(t))}}function Nt(e,t,n,a,u,d,h,g){var v=t&Ie;if(!v&&typeof e!="function")throw new nt(p);var b=a?a.length:0;if(b||(t&=-97,a=u=i),h=h===i?h:Te(J(h),0),g=g===i?g:J(g),b-=u?u.length:0,t&xe){var C=a,T=u;a=u=i}var N=v?i:Ps(e),W=[e,t,n,a,u,C,T,d,h,g];if(N&&sm(W,N),e=W[0],t=W[1],n=W[2],a=W[3],u=W[4],g=W[9]=W[9]===i?v?0:e.length:Te(W[9]-b,0),!g&&t&(ft|E)&&(t&=-25),!t||t==Oe)var G=Ug(e,t,n);else t==ft||t==E?G=Gg(e,t,g):(t==R||t==(Oe|R))&&!u.length?G=Vg(e,t,n,a):G=$i.apply(i,W);var ee=N?xc:Jc;return jc(ee(G,W),e,t)}function Zc(e,t,n,a){return e===i||mt(e,Hn[n])&&!ce.call(a,n)?t:e}function Uc(e,t,n,a,u,d){return ve(e)&&ve(t)&&(d.set(t,e),Gi(e,t,i,Uc,d),d.delete(t)),e}function zg(e){return Yr(e)?i:e}function Gc(e,t,n,a,u,d){var h=n&Q,g=e.length,v=t.length;if(g!=v&&!(h&&v>g))return!1;var b=d.get(e),C=d.get(t);if(b&&C)return b==t&&C==e;var T=-1,N=!0,W=n&ge?new dn:i;for(d.set(e,t),d.set(t,e);++T<g;){var G=e[T],ee=t[T];if(a)var V=h?a(ee,G,T,t,e,d):a(G,ee,T,e,t,d);if(V!==i){if(V)continue;N=!1;break}if(W){if(!ns(t,function(ne,ae){if(!Mr(W,ae)&&(G===ne||u(G,ne,n,a,d)))return W.push(ae)})){N=!1;break}}else if(!(G===ee||u(G,ee,n,a,d))){N=!1;break}}return d.delete(e),d.delete(t),N}function $g(e,t,n,a,u,d,h){switch(n){case Wn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Nr:return!(e.byteLength!=t.byteLength||!d(new Ei(e),new Ei(t)));case Tr:case Or:case Rr:return mt(+e,+t);case _i:return e.name==t.name&&e.message==t.message;case kr:case Er:return e==t+"";case dt:var g=us;case ht:var v=a&Q;if(g||(g=Ii),e.size!=t.size&&!v)return!1;var b=h.get(e);if(b)return b==t;a|=ge,h.set(e,t);var C=Gc(g(e),g(t),a,u,d,h);return h.delete(e),C;case yi:if(Wr)return Wr.call(e)==Wr.call(t)}return!1}function Yg(e,t,n,a,u,d){var h=n&Q,g=Ns(e),v=g.length,b=Ns(t),C=b.length;if(v!=C&&!h)return!1;for(var T=v;T--;){var N=g[T];if(!(h?N in t:ce.call(t,N)))return!1}var W=d.get(e),G=d.get(t);if(W&&G)return W==t&&G==e;var ee=!0;d.set(e,t),d.set(t,e);for(var V=h;++T<v;){N=g[T];var ne=e[N],ae=t[N];if(a)var Je=h?a(ae,ne,N,t,e,d):a(ne,ae,N,e,t,d);if(!(Je===i?ne===ae||u(ne,ae,n,a,d):Je)){ee=!1;break}V||(V=N=="constructor")}if(ee&&!V){var qe=e.constructor,je=t.constructor;qe!=je&&"constructor"in e&&"constructor"in t&&!(typeof qe=="function"&&qe instanceof qe&&typeof je=="function"&&je instanceof je)&&(ee=!1)}return d.delete(e),d.delete(t),ee}function Mt(e){return Zs(Kc(e,i,il),e+"")}function Ns(e){return cc(e,Re,Bs)}function Ms(e){return cc(e,Ge,Vc)}var Ps=Bi?function(e){return Bi.get(e)}:eo;function Ji(e){for(var t=e.name+"",n=$n[t],a=ce.call($n,t)?n.length:0;a--;){var u=n[a],d=u.func;if(d==null||d==e)return u.name}return t}function Jn(e){var t=ce.call(l,"placeholder")?l:e;return t.placeholder}function Z(){var e=l.iteratee||js;return e=e===js?dc:e,arguments.length?e(arguments[0],arguments[1]):e}function ji(e,t){var n=e.__data__;return nm(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Ds(e){for(var t=Re(e),n=t.length;n--;){var a=t[n],u=e[a];t[n]=[a,u,$c(u)]}return t}function gn(e,t){var n=ap(e,t);return fc(n)?n:i}function Kg(e){var t=ce.call(e,ln),n=e[ln];try{e[ln]=i;var a=!0}catch{}var u=Ri.call(e);return a&&(t?e[ln]=n:delete e[ln]),u}var Bs=ls?function(e){return e==null?[]:(e=fe(e),Ht(ls(e),function(t){return Xu.call(e,t)}))}:to,Vc=ls?function(e){for(var t=[];e;)zt(t,Bs(e)),e=Li(e);return t}:to,Pe=Fe;(fs&&Pe(new fs(new ArrayBuffer(1)))!=Wn||Dr&&Pe(new Dr)!=dt||ds&&Pe(ds.resolve())!=su||zn&&Pe(new zn)!=ht||Br&&Pe(new Br)!=Lr)&&(Pe=function(e){var t=Fe(e),n=t==Rt?e.constructor:i,a=n?mn(n):"";if(a)switch(a){case Ep:return Wn;case Lp:return dt;case Np:return su;case Mp:return ht;case Pp:return Lr}return t});function Xg(e,t,n){for(var a=-1,u=n.length;++a<u;){var d=n[a],h=d.size;switch(d.type){case"drop":e+=h;break;case"dropRight":t-=h;break;case"take":t=Me(t,e+h);break;case"takeRight":e=Te(e,t-h);break}}return{start:e,end:t}}function Jg(e){var t=e.match(rh);return t?t[1].split(ih):[]}function Hc(e,t,n){t=Jt(t,e);for(var a=-1,u=t.length,d=!1;++a<u;){var h=Ct(t[a]);if(!(d=e!=null&&n(e,h)))break;e=e[h]}return d||++a!=u?d:(u=e==null?0:e.length,!!u&&aa(u)&&Pt(h,u)&&(Y(e)||_n(e)))}function jg(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&ce.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function zc(e){return typeof e.constructor=="function"&&!zr(e)?Yn(Li(e)):{}}function Qg(e,t,n){var a=e.constructor;switch(t){case Nr:return ks(e);case Tr:case Or:return new a(+e);case Wn:return Dg(e,n);case Da:case Ba:case Fa:case Wa:case qa:case Za:case Ua:case Ga:case Va:return Oc(e,n);case dt:return new a;case Rr:case Er:return new a(e);case kr:return Bg(e);case ht:return new a;case yi:return Fg(e)}}function em(e,t){var n=t.length;if(!n)return e;var a=n-1;return t[a]=(n>1?"& ":"")+t[a],t=t.join(n>2?", ":" "),e.replace(nh,`{
|
|
2
|
+
/* [wrapped with `+t+`] */
|
|
3
|
+
`)}function tm(e){return Y(e)||_n(e)||!!(Ju&&e&&e[Ju])}function Pt(e,t){var n=typeof e;return t=t??Vt,!!t&&(n=="number"||n!="symbol"&&hh.test(e))&&e>-1&&e%1==0&&e<t}function We(e,t,n){if(!ve(n))return!1;var a=typeof t;return(a=="number"?Ue(n)&&Pt(t,n.length):a=="string"&&t in n)?mt(n[t],e):!1}function Fs(e,t){if(Y(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Xe(e)?!0:jd.test(e)||!Jd.test(e)||t!=null&&e in fe(t)}function nm(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ws(e){var t=Ji(e),n=l[t];if(typeof n!="function"||!(t in ie.prototype))return!1;if(e===n)return!0;var a=Ps(n);return!!a&&e===a[0]}function rm(e){return!!$u&&$u in e}var im=Ti?Dt:no;function zr(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Hn;return e===n}function $c(e){return e===e&&!ve(e)}function Yc(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==i||e in fe(n))}}function am(e){var t=ra(e,function(a){return n.size===y&&n.clear(),a}),n=t.cache;return t}function sm(e,t){var n=e[1],a=t[1],u=n|a,d=u<(Oe|Ie|Se),h=a==Se&&n==ft||a==Se&&n==ke&&e[7].length<=t[8]||a==(Se|ke)&&t[7].length<=t[8]&&n==ft;if(!(d||h))return e;a&Oe&&(e[2]=t[2],u|=n&Oe?0:Gt);var g=t[3];if(g){var v=e[3];e[3]=v?kc(v,g,t[4]):g,e[4]=v?$t(e[3],A):t[4]}return g=t[5],g&&(v=e[5],e[5]=v?Ec(v,g,t[6]):g,e[6]=v?$t(e[5],A):t[6]),g=t[7],g&&(e[7]=g),a&Se&&(e[8]=e[8]==null?t[8]:Me(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=u,e}function om(e){var t=[];if(e!=null)for(var n in fe(e))t.push(n);return t}function um(e){return Ri.call(e)}function Kc(e,t,n){return t=Te(t===i?e.length-1:t,0),function(){for(var a=arguments,u=-1,d=Te(a.length-t,0),h=x(d);++u<d;)h[u]=a[t+u];u=-1;for(var g=x(t+1);++u<t;)g[u]=a[u];return g[t]=n(h),$e(e,this,g)}}function Xc(e,t){return t.length<2?e:pn(e,at(t,0,-1))}function cm(e,t){for(var n=e.length,a=Me(t.length,n),u=Ze(e);a--;){var d=t[a];e[a]=Pt(d,n)?u[d]:i}return e}function qs(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Jc=Qc(xc),$r=Cp||function(e,t){return Ee.setTimeout(e,t)},Zs=Qc(Lg);function jc(e,t,n){var a=t+"";return Zs(e,em(a,lm(Jg(a),n)))}function Qc(e){var t=0,n=0;return function(){var a=Op(),u=Ed-(a-n);if(n=a,u>0){if(++t>=kd)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Qi(e,t){var n=-1,a=e.length,u=a-1;for(t=t===i?a:t;++n<t;){var d=bs(n,u),h=e[d];e[d]=e[n],e[n]=h}return e.length=t,e}var el=am(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Qd,function(n,a,u,d){t.push(u?d.replace(oh,"$1"):a||n)}),t});function Ct(e){if(typeof e=="string"||Xe(e))return e;var t=e+"";return t=="0"&&1/e==-un?"-0":t}function mn(e){if(e!=null){try{return Oi.call(e)}catch{}try{return e+""}catch{}}return""}function lm(e,t){return tt(Bd,function(n){var a="_."+n[0];t&n[1]&&!bi(e,a)&&e.push(a)}),e.sort()}function tl(e){if(e instanceof ie)return e.clone();var t=new rt(e.__wrapped__,e.__chain__);return t.__actions__=Ze(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function fm(e,t,n){(n?We(e,t,n):t===i)?t=1:t=Te(J(t),0);var a=e==null?0:e.length;if(!a||t<1)return[];for(var u=0,d=0,h=x(Pi(a/t));u<a;)h[d++]=at(e,u,u+=t);return h}function dm(e){for(var t=-1,n=e==null?0:e.length,a=0,u=[];++t<n;){var d=e[t];d&&(u[a++]=d)}return u}function hm(){var e=arguments.length;if(!e)return[];for(var t=x(e-1),n=arguments[0],a=e;a--;)t[a-1]=arguments[a];return zt(Y(n)?Ze(n):[n],Le(t,1))}var pm=te(function(e,t){return be(e)?Zr(e,Le(t,1,be,!0)):[]}),gm=te(function(e,t){var n=st(t);return be(n)&&(n=i),be(e)?Zr(e,Le(t,1,be,!0),Z(n,2)):[]}),mm=te(function(e,t){var n=st(t);return be(n)&&(n=i),be(e)?Zr(e,Le(t,1,be,!0),i,n):[]});function _m(e,t,n){var a=e==null?0:e.length;return a?(t=n||t===i?1:J(t),at(e,t<0?0:t,a)):[]}function vm(e,t,n){var a=e==null?0:e.length;return a?(t=n||t===i?1:J(t),t=a-t,at(e,0,t<0?0:t)):[]}function ym(e,t){return e&&e.length?Hi(e,Z(t,3),!0,!0):[]}function xm(e,t){return e&&e.length?Hi(e,Z(t,3),!0):[]}function wm(e,t,n,a){var u=e==null?0:e.length;return u?(n&&typeof n!="number"&&We(e,t,n)&&(n=0,a=u),hg(e,t,n,a)):[]}function nl(e,t,n){var a=e==null?0:e.length;if(!a)return-1;var u=n==null?0:J(n);return u<0&&(u=Te(a+u,0)),Ci(e,Z(t,3),u)}function rl(e,t,n){var a=e==null?0:e.length;if(!a)return-1;var u=a-1;return n!==i&&(u=J(n),u=n<0?Te(a+u,0):Me(u,a-1)),Ci(e,Z(t,3),u,!0)}function il(e){var t=e==null?0:e.length;return t?Le(e,1):[]}function Sm(e){var t=e==null?0:e.length;return t?Le(e,un):[]}function bm(e,t){var n=e==null?0:e.length;return n?(t=t===i?1:J(t),Le(e,t)):[]}function Cm(e){for(var t=-1,n=e==null?0:e.length,a={};++t<n;){var u=e[t];a[u[0]]=u[1]}return a}function al(e){return e&&e.length?e[0]:i}function Im(e,t,n){var a=e==null?0:e.length;if(!a)return-1;var u=n==null?0:J(n);return u<0&&(u=Te(a+u,0)),Zn(e,t,u)}function Am(e){var t=e==null?0:e.length;return t?at(e,0,-1):[]}var Tm=te(function(e){var t=me(e,Os);return t.length&&t[0]===e[0]?vs(t):[]}),Om=te(function(e){var t=st(e),n=me(e,Os);return t===st(n)?t=i:n.pop(),n.length&&n[0]===e[0]?vs(n,Z(t,2)):[]}),Rm=te(function(e){var t=st(e),n=me(e,Os);return t=typeof t=="function"?t:i,t&&n.pop(),n.length&&n[0]===e[0]?vs(n,i,t):[]});function km(e,t){return e==null?"":Ap.call(e,t)}function st(e){var t=e==null?0:e.length;return t?e[t-1]:i}function Em(e,t,n){var a=e==null?0:e.length;if(!a)return-1;var u=a;return n!==i&&(u=J(n),u=u<0?Te(a+u,0):Me(u,a-1)),t===t?lp(e,t,u):Ci(e,Wu,u,!0)}function Lm(e,t){return e&&e.length?mc(e,J(t)):i}var Nm=te(sl);function sl(e,t){return e&&e.length&&t&&t.length?Ss(e,t):e}function Mm(e,t,n){return e&&e.length&&t&&t.length?Ss(e,t,Z(n,2)):e}function Pm(e,t,n){return e&&e.length&&t&&t.length?Ss(e,t,i,n):e}var Dm=Mt(function(e,t){var n=e==null?0:e.length,a=ps(e,t);return yc(e,me(t,function(u){return Pt(u,n)?+u:u}).sort(Rc)),a});function Bm(e,t){var n=[];if(!(e&&e.length))return n;var a=-1,u=[],d=e.length;for(t=Z(t,3);++a<d;){var h=e[a];t(h,a,e)&&(n.push(h),u.push(a))}return yc(e,u),n}function Us(e){return e==null?e:kp.call(e)}function Fm(e,t,n){var a=e==null?0:e.length;return a?(n&&typeof n!="number"&&We(e,t,n)?(t=0,n=a):(t=t==null?0:J(t),n=n===i?a:J(n)),at(e,t,n)):[]}function Wm(e,t){return Vi(e,t)}function qm(e,t,n){return Is(e,t,Z(n,2))}function Zm(e,t){var n=e==null?0:e.length;if(n){var a=Vi(e,t);if(a<n&&mt(e[a],t))return a}return-1}function Um(e,t){return Vi(e,t,!0)}function Gm(e,t,n){return Is(e,t,Z(n,2),!0)}function Vm(e,t){var n=e==null?0:e.length;if(n){var a=Vi(e,t,!0)-1;if(mt(e[a],t))return a}return-1}function Hm(e){return e&&e.length?wc(e):[]}function zm(e,t){return e&&e.length?wc(e,Z(t,2)):[]}function $m(e){var t=e==null?0:e.length;return t?at(e,1,t):[]}function Ym(e,t,n){return e&&e.length?(t=n||t===i?1:J(t),at(e,0,t<0?0:t)):[]}function Km(e,t,n){var a=e==null?0:e.length;return a?(t=n||t===i?1:J(t),t=a-t,at(e,t<0?0:t,a)):[]}function Xm(e,t){return e&&e.length?Hi(e,Z(t,3),!1,!0):[]}function Jm(e,t){return e&&e.length?Hi(e,Z(t,3)):[]}var jm=te(function(e){return Xt(Le(e,1,be,!0))}),Qm=te(function(e){var t=st(e);return be(t)&&(t=i),Xt(Le(e,1,be,!0),Z(t,2))}),e_=te(function(e){var t=st(e);return t=typeof t=="function"?t:i,Xt(Le(e,1,be,!0),i,t)});function t_(e){return e&&e.length?Xt(e):[]}function n_(e,t){return e&&e.length?Xt(e,Z(t,2)):[]}function r_(e,t){return t=typeof t=="function"?t:i,e&&e.length?Xt(e,i,t):[]}function Gs(e){if(!(e&&e.length))return[];var t=0;return e=Ht(e,function(n){if(be(n))return t=Te(n.length,t),!0}),ss(t,function(n){return me(e,rs(n))})}function ol(e,t){if(!(e&&e.length))return[];var n=Gs(e);return t==null?n:me(n,function(a){return $e(t,i,a)})}var i_=te(function(e,t){return be(e)?Zr(e,t):[]}),a_=te(function(e){return Ts(Ht(e,be))}),s_=te(function(e){var t=st(e);return be(t)&&(t=i),Ts(Ht(e,be),Z(t,2))}),o_=te(function(e){var t=st(e);return t=typeof t=="function"?t:i,Ts(Ht(e,be),i,t)}),u_=te(Gs);function c_(e,t){return Ic(e||[],t||[],qr)}function l_(e,t){return Ic(e||[],t||[],Vr)}var f_=te(function(e){var t=e.length,n=t>1?e[t-1]:i;return n=typeof n=="function"?(e.pop(),n):i,ol(e,n)});function ul(e){var t=l(e);return t.__chain__=!0,t}function d_(e,t){return t(e),e}function ea(e,t){return t(e)}var h_=Mt(function(e){var t=e.length,n=t?e[0]:0,a=this.__wrapped__,u=function(d){return ps(d,e)};return t>1||this.__actions__.length||!(a instanceof ie)||!Pt(n)?this.thru(u):(a=a.slice(n,+n+(t?1:0)),a.__actions__.push({func:ea,args:[u],thisArg:i}),new rt(a,this.__chain__).thru(function(d){return t&&!d.length&&d.push(i),d}))});function p_(){return ul(this)}function g_(){return new rt(this.value(),this.__chain__)}function m_(){this.__values__===i&&(this.__values__=Sl(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function __(){return this}function v_(e){for(var t,n=this;n instanceof Wi;){var a=tl(n);a.__index__=0,a.__values__=i,t?u.__wrapped__=a:t=a;var u=a;n=n.__wrapped__}return u.__wrapped__=e,t}function y_(){var e=this.__wrapped__;if(e instanceof ie){var t=e;return this.__actions__.length&&(t=new ie(this)),t=t.reverse(),t.__actions__.push({func:ea,args:[Us],thisArg:i}),new rt(t,this.__chain__)}return this.thru(Us)}function x_(){return Cc(this.__wrapped__,this.__actions__)}var w_=zi(function(e,t,n){ce.call(e,n)?++e[n]:Lt(e,n,1)});function S_(e,t,n){var a=Y(e)?Bu:dg;return n&&We(e,t,n)&&(t=i),a(e,Z(t,3))}function b_(e,t){var n=Y(e)?Ht:oc;return n(e,Z(t,3))}var C_=Pc(nl),I_=Pc(rl);function A_(e,t){return Le(ta(e,t),1)}function T_(e,t){return Le(ta(e,t),un)}function O_(e,t,n){return n=n===i?1:J(n),Le(ta(e,t),n)}function cl(e,t){var n=Y(e)?tt:Kt;return n(e,Z(t,3))}function ll(e,t){var n=Y(e)?$h:sc;return n(e,Z(t,3))}var R_=zi(function(e,t,n){ce.call(e,n)?e[n].push(t):Lt(e,n,[t])});function k_(e,t,n,a){e=Ue(e)?e:Qn(e),n=n&&!a?J(n):0;var u=e.length;return n<0&&(n=Te(u+n,0)),sa(e)?n<=u&&e.indexOf(t,n)>-1:!!u&&Zn(e,t,n)>-1}var E_=te(function(e,t,n){var a=-1,u=typeof t=="function",d=Ue(e)?x(e.length):[];return Kt(e,function(h){d[++a]=u?$e(t,h,n):Ur(h,t,n)}),d}),L_=zi(function(e,t,n){Lt(e,n,t)});function ta(e,t){var n=Y(e)?me:hc;return n(e,Z(t,3))}function N_(e,t,n,a){return e==null?[]:(Y(t)||(t=t==null?[]:[t]),n=a?i:n,Y(n)||(n=n==null?[]:[n]),_c(e,t,n))}var M_=zi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]});function P_(e,t,n){var a=Y(e)?ts:Zu,u=arguments.length<3;return a(e,Z(t,4),n,u,Kt)}function D_(e,t,n){var a=Y(e)?Yh:Zu,u=arguments.length<3;return a(e,Z(t,4),n,u,sc)}function B_(e,t){var n=Y(e)?Ht:oc;return n(e,ia(Z(t,3)))}function F_(e){var t=Y(e)?nc:kg;return t(e)}function W_(e,t,n){(n?We(e,t,n):t===i)?t=1:t=J(t);var a=Y(e)?og:Eg;return a(e,t)}function q_(e){var t=Y(e)?ug:Ng;return t(e)}function Z_(e){if(e==null)return 0;if(Ue(e))return sa(e)?Gn(e):e.length;var t=Pe(e);return t==dt||t==ht?e.size:xs(e).length}function U_(e,t,n){var a=Y(e)?ns:Mg;return n&&We(e,t,n)&&(t=i),a(e,Z(t,3))}var G_=te(function(e,t){if(e==null)return[];var n=t.length;return n>1&&We(e,t[0],t[1])?t=[]:n>2&&We(t[0],t[1],t[2])&&(t=[t[0]]),_c(e,Le(t,1),[])}),na=bp||function(){return Ee.Date.now()};function V_(e,t){if(typeof t!="function")throw new nt(p);return e=J(e),function(){if(--e<1)return t.apply(this,arguments)}}function fl(e,t,n){return t=n?i:t,t=e&&t==null?e.length:t,Nt(e,Se,i,i,i,i,t)}function dl(e,t){var n;if(typeof t!="function")throw new nt(p);return e=J(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Vs=te(function(e,t,n){var a=Oe;if(n.length){var u=$t(n,Jn(Vs));a|=R}return Nt(e,a,t,n,u)}),hl=te(function(e,t,n){var a=Oe|Ie;if(n.length){var u=$t(n,Jn(hl));a|=R}return Nt(t,a,e,n,u)});function pl(e,t,n){t=n?i:t;var a=Nt(e,ft,i,i,i,i,i,t);return a.placeholder=pl.placeholder,a}function gl(e,t,n){t=n?i:t;var a=Nt(e,E,i,i,i,i,i,t);return a.placeholder=gl.placeholder,a}function ml(e,t,n){var a,u,d,h,g,v,b=0,C=!1,T=!1,N=!0;if(typeof e!="function")throw new nt(p);t=ot(t)||0,ve(n)&&(C=!!n.leading,T="maxWait"in n,d=T?Te(ot(n.maxWait)||0,t):d,N="trailing"in n?!!n.trailing:N);function W(Ce){var _t=a,Ft=u;return a=u=i,b=Ce,h=e.apply(Ft,_t),h}function G(Ce){return b=Ce,g=$r(ne,t),C?W(Ce):h}function ee(Ce){var _t=Ce-v,Ft=Ce-b,Pl=t-_t;return T?Me(Pl,d-Ft):Pl}function V(Ce){var _t=Ce-v,Ft=Ce-b;return v===i||_t>=t||_t<0||T&&Ft>=d}function ne(){var Ce=na();if(V(Ce))return ae(Ce);g=$r(ne,ee(Ce))}function ae(Ce){return g=i,N&&a?W(Ce):(a=u=i,h)}function Je(){g!==i&&Ac(g),b=0,a=v=u=g=i}function qe(){return g===i?h:ae(na())}function je(){var Ce=na(),_t=V(Ce);if(a=arguments,u=this,v=Ce,_t){if(g===i)return G(v);if(T)return Ac(g),g=$r(ne,t),W(v)}return g===i&&(g=$r(ne,t)),h}return je.cancel=Je,je.flush=qe,je}var H_=te(function(e,t){return ac(e,1,t)}),z_=te(function(e,t,n){return ac(e,ot(t)||0,n)});function $_(e){return Nt(e,Ar)}function ra(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new nt(p);var n=function(){var a=arguments,u=t?t.apply(this,a):a[0],d=n.cache;if(d.has(u))return d.get(u);var h=e.apply(this,a);return n.cache=d.set(u,h)||d,h};return n.cache=new(ra.Cache||Et),n}ra.Cache=Et;function ia(e){if(typeof e!="function")throw new nt(p);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Y_(e){return dl(2,e)}var K_=Pg(function(e,t){t=t.length==1&&Y(t[0])?me(t[0],Ye(Z())):me(Le(t,1),Ye(Z()));var n=t.length;return te(function(a){for(var u=-1,d=Me(a.length,n);++u<d;)a[u]=t[u].call(this,a[u]);return $e(e,this,a)})}),Hs=te(function(e,t){var n=$t(t,Jn(Hs));return Nt(e,R,i,t,n)}),_l=te(function(e,t){var n=$t(t,Jn(_l));return Nt(e,xe,i,t,n)}),X_=Mt(function(e,t){return Nt(e,ke,i,i,i,t)});function J_(e,t){if(typeof e!="function")throw new nt(p);return t=t===i?t:J(t),te(e,t)}function j_(e,t){if(typeof e!="function")throw new nt(p);return t=t==null?0:Te(J(t),0),te(function(n){var a=n[t],u=jt(n,0,t);return a&&zt(u,a),$e(e,this,u)})}function Q_(e,t,n){var a=!0,u=!0;if(typeof e!="function")throw new nt(p);return ve(n)&&(a="leading"in n?!!n.leading:a,u="trailing"in n?!!n.trailing:u),ml(e,t,{leading:a,maxWait:t,trailing:u})}function ev(e){return fl(e,1)}function tv(e,t){return Hs(Rs(t),e)}function nv(){if(!arguments.length)return[];var e=arguments[0];return Y(e)?e:[e]}function rv(e){return it(e,X)}function iv(e,t){return t=typeof t=="function"?t:i,it(e,X,t)}function av(e){return it(e,D|X)}function sv(e,t){return t=typeof t=="function"?t:i,it(e,D|X,t)}function ov(e,t){return t==null||ic(e,t,Re(t))}function mt(e,t){return e===t||e!==e&&t!==t}var uv=Xi(_s),cv=Xi(function(e,t){return e>=t}),_n=lc((function(){return arguments})())?lc:function(e){return we(e)&&ce.call(e,"callee")&&!Xu.call(e,"callee")},Y=x.isArray,lv=Eu?Ye(Eu):vg;function Ue(e){return e!=null&&aa(e.length)&&!Dt(e)}function be(e){return we(e)&&Ue(e)}function fv(e){return e===!0||e===!1||we(e)&&Fe(e)==Tr}var Qt=Ip||no,dv=Lu?Ye(Lu):yg;function hv(e){return we(e)&&e.nodeType===1&&!Yr(e)}function pv(e){if(e==null)return!0;if(Ue(e)&&(Y(e)||typeof e=="string"||typeof e.splice=="function"||Qt(e)||jn(e)||_n(e)))return!e.length;var t=Pe(e);if(t==dt||t==ht)return!e.size;if(zr(e))return!xs(e).length;for(var n in e)if(ce.call(e,n))return!1;return!0}function gv(e,t){return Gr(e,t)}function mv(e,t,n){n=typeof n=="function"?n:i;var a=n?n(e,t):i;return a===i?Gr(e,t,i,n):!!a}function zs(e){if(!we(e))return!1;var t=Fe(e);return t==_i||t==Wd||typeof e.message=="string"&&typeof e.name=="string"&&!Yr(e)}function _v(e){return typeof e=="number"&&ju(e)}function Dt(e){if(!ve(e))return!1;var t=Fe(e);return t==vi||t==au||t==Fd||t==Zd}function vl(e){return typeof e=="number"&&e==J(e)}function aa(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Vt}function ve(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function we(e){return e!=null&&typeof e=="object"}var yl=Nu?Ye(Nu):wg;function vv(e,t){return e===t||ys(e,t,Ds(t))}function yv(e,t,n){return n=typeof n=="function"?n:i,ys(e,t,Ds(t),n)}function xv(e){return xl(e)&&e!=+e}function wv(e){if(im(e))throw new $(f);return fc(e)}function Sv(e){return e===null}function bv(e){return e==null}function xl(e){return typeof e=="number"||we(e)&&Fe(e)==Rr}function Yr(e){if(!we(e)||Fe(e)!=Rt)return!1;var t=Li(e);if(t===null)return!0;var n=ce.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Oi.call(n)==yp}var $s=Mu?Ye(Mu):Sg;function Cv(e){return vl(e)&&e>=-Vt&&e<=Vt}var wl=Pu?Ye(Pu):bg;function sa(e){return typeof e=="string"||!Y(e)&&we(e)&&Fe(e)==Er}function Xe(e){return typeof e=="symbol"||we(e)&&Fe(e)==yi}var jn=Du?Ye(Du):Cg;function Iv(e){return e===i}function Av(e){return we(e)&&Pe(e)==Lr}function Tv(e){return we(e)&&Fe(e)==Gd}var Ov=Xi(ws),Rv=Xi(function(e,t){return e<=t});function Sl(e){if(!e)return[];if(Ue(e))return sa(e)?pt(e):Ze(e);if(Pr&&e[Pr])return op(e[Pr]());var t=Pe(e),n=t==dt?us:t==ht?Ii:Qn;return n(e)}function Bt(e){if(!e)return e===0?e:0;if(e=ot(e),e===un||e===-un){var t=e<0?-1:1;return t*Md}return e===e?e:0}function J(e){var t=Bt(e),n=t%1;return t===t?n?t-n:t:0}function bl(e){return e?hn(J(e),0,wt):0}function ot(e){if(typeof e=="number")return e;if(Xe(e))return gi;if(ve(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ve(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Uu(e);var n=lh.test(e);return n||dh.test(e)?Vh(e.slice(2),n?2:8):ch.test(e)?gi:+e}function Cl(e){return bt(e,Ge(e))}function kv(e){return e?hn(J(e),-Vt,Vt):e===0?e:0}function ue(e){return e==null?"":Ke(e)}var Ev=Kn(function(e,t){if(zr(t)||Ue(t)){bt(t,Re(t),e);return}for(var n in t)ce.call(t,n)&&qr(e,n,t[n])}),Il=Kn(function(e,t){bt(t,Ge(t),e)}),oa=Kn(function(e,t,n,a){bt(t,Ge(t),e,a)}),Lv=Kn(function(e,t,n,a){bt(t,Re(t),e,a)}),Nv=Mt(ps);function Mv(e,t){var n=Yn(e);return t==null?n:rc(n,t)}var Pv=te(function(e,t){e=fe(e);var n=-1,a=t.length,u=a>2?t[2]:i;for(u&&We(t[0],t[1],u)&&(a=1);++n<a;)for(var d=t[n],h=Ge(d),g=-1,v=h.length;++g<v;){var b=h[g],C=e[b];(C===i||mt(C,Hn[b])&&!ce.call(e,b))&&(e[b]=d[b])}return e}),Dv=te(function(e){return e.push(i,Uc),$e(Al,i,e)});function Bv(e,t){return Fu(e,Z(t,3),St)}function Fv(e,t){return Fu(e,Z(t,3),ms)}function Wv(e,t){return e==null?e:gs(e,Z(t,3),Ge)}function qv(e,t){return e==null?e:uc(e,Z(t,3),Ge)}function Zv(e,t){return e&&St(e,Z(t,3))}function Uv(e,t){return e&&ms(e,Z(t,3))}function Gv(e){return e==null?[]:Ui(e,Re(e))}function Vv(e){return e==null?[]:Ui(e,Ge(e))}function Ys(e,t,n){var a=e==null?i:pn(e,t);return a===i?n:a}function Hv(e,t){return e!=null&&Hc(e,t,pg)}function Ks(e,t){return e!=null&&Hc(e,t,gg)}var zv=Bc(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=Ri.call(t)),e[t]=n},Js(Ve)),$v=Bc(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=Ri.call(t)),ce.call(e,t)?e[t].push(n):e[t]=[n]},Z),Yv=te(Ur);function Re(e){return Ue(e)?tc(e):xs(e)}function Ge(e){return Ue(e)?tc(e,!0):Ig(e)}function Kv(e,t){var n={};return t=Z(t,3),St(e,function(a,u,d){Lt(n,t(a,u,d),a)}),n}function Xv(e,t){var n={};return t=Z(t,3),St(e,function(a,u,d){Lt(n,u,t(a,u,d))}),n}var Jv=Kn(function(e,t,n){Gi(e,t,n)}),Al=Kn(function(e,t,n,a){Gi(e,t,n,a)}),jv=Mt(function(e,t){var n={};if(e==null)return n;var a=!1;t=me(t,function(d){return d=Jt(d,e),a||(a=d.length>1),d}),bt(e,Ms(e),n),a&&(n=it(n,D|re|X,zg));for(var u=t.length;u--;)As(n,t[u]);return n});function Qv(e,t){return Tl(e,ia(Z(t)))}var ey=Mt(function(e,t){return e==null?{}:Tg(e,t)});function Tl(e,t){if(e==null)return{};var n=me(Ms(e),function(a){return[a]});return t=Z(t),vc(e,n,function(a,u){return t(a,u[0])})}function ty(e,t,n){t=Jt(t,e);var a=-1,u=t.length;for(u||(u=1,e=i);++a<u;){var d=e==null?i:e[Ct(t[a])];d===i&&(a=u,d=n),e=Dt(d)?d.call(e):d}return e}function ny(e,t,n){return e==null?e:Vr(e,t,n)}function ry(e,t,n,a){return a=typeof a=="function"?a:i,e==null?e:Vr(e,t,n,a)}var Ol=qc(Re),Rl=qc(Ge);function iy(e,t,n){var a=Y(e),u=a||Qt(e)||jn(e);if(t=Z(t,4),n==null){var d=e&&e.constructor;u?n=a?new d:[]:ve(e)?n=Dt(d)?Yn(Li(e)):{}:n={}}return(u?tt:St)(e,function(h,g,v){return t(n,h,g,v)}),n}function ay(e,t){return e==null?!0:As(e,t)}function sy(e,t,n){return e==null?e:bc(e,t,Rs(n))}function oy(e,t,n,a){return a=typeof a=="function"?a:i,e==null?e:bc(e,t,Rs(n),a)}function Qn(e){return e==null?[]:os(e,Re(e))}function uy(e){return e==null?[]:os(e,Ge(e))}function cy(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=ot(n),n=n===n?n:0),t!==i&&(t=ot(t),t=t===t?t:0),hn(ot(e),t,n)}function ly(e,t,n){return t=Bt(t),n===i?(n=t,t=0):n=Bt(n),e=ot(e),mg(e,t,n)}function fy(e,t,n){if(n&&typeof n!="boolean"&&We(e,t,n)&&(t=n=i),n===i&&(typeof t=="boolean"?(n=t,t=i):typeof e=="boolean"&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=Bt(e),t===i?(t=e,e=0):t=Bt(t)),e>t){var a=e;e=t,t=a}if(n||e%1||t%1){var u=Qu();return Me(e+u*(t-e+Gh("1e-"+((u+"").length-1))),t)}return bs(e,t)}var dy=Xn(function(e,t,n){return t=t.toLowerCase(),e+(n?kl(t):t)});function kl(e){return Xs(ue(e).toLowerCase())}function El(e){return e=ue(e),e&&e.replace(ph,np).replace(Nh,"")}function hy(e,t,n){e=ue(e),t=Ke(t);var a=e.length;n=n===i?a:hn(J(n),0,a);var u=n;return n-=t.length,n>=0&&e.slice(n,u)==t}function py(e){return e=ue(e),e&&Yd.test(e)?e.replace(uu,rp):e}function gy(e){return e=ue(e),e&&eh.test(e)?e.replace(Ha,"\\$&"):e}var my=Xn(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),_y=Xn(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),vy=Mc("toLowerCase");function yy(e,t,n){e=ue(e),t=J(t);var a=t?Gn(e):0;if(!t||a>=t)return e;var u=(t-a)/2;return Ki(Di(u),n)+e+Ki(Pi(u),n)}function xy(e,t,n){e=ue(e),t=J(t);var a=t?Gn(e):0;return t&&a<t?e+Ki(t-a,n):e}function wy(e,t,n){e=ue(e),t=J(t);var a=t?Gn(e):0;return t&&a<t?Ki(t-a,n)+e:e}function Sy(e,t,n){return n||t==null?t=0:t&&(t=+t),Rp(ue(e).replace(za,""),t||0)}function by(e,t,n){return(n?We(e,t,n):t===i)?t=1:t=J(t),Cs(ue(e),t)}function Cy(){var e=arguments,t=ue(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var Iy=Xn(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});function Ay(e,t,n){return n&&typeof n!="number"&&We(e,t,n)&&(t=n=i),n=n===i?wt:n>>>0,n?(e=ue(e),e&&(typeof t=="string"||t!=null&&!$s(t))&&(t=Ke(t),!t&&Un(e))?jt(pt(e),0,n):e.split(t,n)):[]}var Ty=Xn(function(e,t,n){return e+(n?" ":"")+Xs(t)});function Oy(e,t,n){return e=ue(e),n=n==null?0:hn(J(n),0,e.length),t=Ke(t),e.slice(n,n+t.length)==t}function Ry(e,t,n){var a=l.templateSettings;n&&We(e,t,n)&&(t=i),e=ue(e),t=oa({},t,a,Zc);var u=oa({},t.imports,a.imports,Zc),d=Re(u),h=os(u,d),g,v,b=0,C=t.interpolate||xi,T="__p += '",N=cs((t.escape||xi).source+"|"+C.source+"|"+(C===cu?uh:xi).source+"|"+(t.evaluate||xi).source+"|$","g"),W="//# sourceURL="+(ce.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Fh+"]")+`
|
|
4
|
+
`;e.replace(N,function(V,ne,ae,Je,qe,je){return ae||(ae=Je),T+=e.slice(b,je).replace(gh,ip),ne&&(g=!0,T+=`' +
|
|
5
|
+
__e(`+ne+`) +
|
|
6
|
+
'`),qe&&(v=!0,T+=`';
|
|
7
|
+
`+qe+`;
|
|
8
|
+
__p += '`),ae&&(T+=`' +
|
|
9
|
+
((__t = (`+ae+`)) == null ? '' : __t) +
|
|
10
|
+
'`),b=je+V.length,V}),T+=`';
|
|
11
|
+
`;var G=ce.call(t,"variable")&&t.variable;if(!G)T=`with (obj) {
|
|
12
|
+
`+T+`
|
|
13
|
+
}
|
|
14
|
+
`;else if(sh.test(G))throw new $(_);T=(v?T.replace(Vd,""):T).replace(Hd,"$1").replace(zd,"$1;"),T="function("+(G||"obj")+`) {
|
|
15
|
+
`+(G?"":`obj || (obj = {});
|
|
16
|
+
`)+"var __t, __p = ''"+(g?", __e = _.escape":"")+(v?`, __j = Array.prototype.join;
|
|
17
|
+
function print() { __p += __j.call(arguments, '') }
|
|
18
|
+
`:`;
|
|
19
|
+
`)+T+`return __p
|
|
20
|
+
}`;var ee=Nl(function(){return oe(d,W+"return "+T).apply(i,h)});if(ee.source=T,zs(ee))throw ee;return ee}function ky(e){return ue(e).toLowerCase()}function Ey(e){return ue(e).toUpperCase()}function Ly(e,t,n){if(e=ue(e),e&&(n||t===i))return Uu(e);if(!e||!(t=Ke(t)))return e;var a=pt(e),u=pt(t),d=Gu(a,u),h=Vu(a,u)+1;return jt(a,d,h).join("")}function Ny(e,t,n){if(e=ue(e),e&&(n||t===i))return e.slice(0,zu(e)+1);if(!e||!(t=Ke(t)))return e;var a=pt(e),u=Vu(a,pt(t))+1;return jt(a,0,u).join("")}function My(e,t,n){if(e=ue(e),e&&(n||t===i))return e.replace(za,"");if(!e||!(t=Ke(t)))return e;var a=pt(e),u=Gu(a,pt(t));return jt(a,u).join("")}function Py(e,t){var n=Od,a=Rd;if(ve(t)){var u="separator"in t?t.separator:u;n="length"in t?J(t.length):n,a="omission"in t?Ke(t.omission):a}e=ue(e);var d=e.length;if(Un(e)){var h=pt(e);d=h.length}if(n>=d)return e;var g=n-Gn(a);if(g<1)return a;var v=h?jt(h,0,g).join(""):e.slice(0,g);if(u===i)return v+a;if(h&&(g+=v.length-g),$s(u)){if(e.slice(g).search(u)){var b,C=v;for(u.global||(u=cs(u.source,ue(lu.exec(u))+"g")),u.lastIndex=0;b=u.exec(C);)var T=b.index;v=v.slice(0,T===i?g:T)}}else if(e.indexOf(Ke(u),g)!=g){var N=v.lastIndexOf(u);N>-1&&(v=v.slice(0,N))}return v+a}function Dy(e){return e=ue(e),e&&$d.test(e)?e.replace(ou,fp):e}var By=Xn(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Xs=Mc("toUpperCase");function Ll(e,t,n){return e=ue(e),t=n?i:t,t===i?sp(e)?pp(e):Jh(e):e.match(t)||[]}var Nl=te(function(e,t){try{return $e(e,i,t)}catch(n){return zs(n)?n:new $(n)}}),Fy=Mt(function(e,t){return tt(t,function(n){n=Ct(n),Lt(e,n,Vs(e[n],e))}),e});function Wy(e){var t=e==null?0:e.length,n=Z();return e=t?me(e,function(a){if(typeof a[1]!="function")throw new nt(p);return[n(a[0]),a[1]]}):[],te(function(a){for(var u=-1;++u<t;){var d=e[u];if($e(d[0],this,a))return $e(d[1],this,a)}})}function qy(e){return fg(it(e,D))}function Js(e){return function(){return e}}function Zy(e,t){return e==null||e!==e?t:e}var Uy=Dc(),Gy=Dc(!0);function Ve(e){return e}function js(e){return dc(typeof e=="function"?e:it(e,D))}function Vy(e){return pc(it(e,D))}function Hy(e,t){return gc(e,it(t,D))}var zy=te(function(e,t){return function(n){return Ur(n,e,t)}}),$y=te(function(e,t){return function(n){return Ur(e,n,t)}});function Qs(e,t,n){var a=Re(t),u=Ui(t,a);n==null&&!(ve(t)&&(u.length||!a.length))&&(n=t,t=e,e=this,u=Ui(t,Re(t)));var d=!(ve(n)&&"chain"in n)||!!n.chain,h=Dt(e);return tt(u,function(g){var v=t[g];e[g]=v,h&&(e.prototype[g]=function(){var b=this.__chain__;if(d||b){var C=e(this.__wrapped__),T=C.__actions__=Ze(this.__actions__);return T.push({func:v,args:arguments,thisArg:e}),C.__chain__=b,C}return v.apply(e,zt([this.value()],arguments))})}),e}function Yy(){return Ee._===this&&(Ee._=xp),this}function eo(){}function Ky(e){return e=J(e),te(function(t){return mc(t,e)})}var Xy=Es(me),Jy=Es(Bu),jy=Es(ns);function Ml(e){return Fs(e)?rs(Ct(e)):Og(e)}function Qy(e){return function(t){return e==null?i:pn(e,t)}}var e0=Fc(),t0=Fc(!0);function to(){return[]}function no(){return!1}function n0(){return{}}function r0(){return""}function i0(){return!0}function a0(e,t){if(e=J(e),e<1||e>Vt)return[];var n=wt,a=Me(e,wt);t=Z(t),e-=wt;for(var u=ss(a,t);++n<e;)t(n);return u}function s0(e){return Y(e)?me(e,Ct):Xe(e)?[e]:Ze(el(ue(e)))}function o0(e){var t=++vp;return ue(e)+t}var u0=Yi(function(e,t){return e+t},0),c0=Ls("ceil"),l0=Yi(function(e,t){return e/t},1),f0=Ls("floor");function d0(e){return e&&e.length?Zi(e,Ve,_s):i}function h0(e,t){return e&&e.length?Zi(e,Z(t,2),_s):i}function p0(e){return qu(e,Ve)}function g0(e,t){return qu(e,Z(t,2))}function m0(e){return e&&e.length?Zi(e,Ve,ws):i}function _0(e,t){return e&&e.length?Zi(e,Z(t,2),ws):i}var v0=Yi(function(e,t){return e*t},1),y0=Ls("round"),x0=Yi(function(e,t){return e-t},0);function w0(e){return e&&e.length?as(e,Ve):0}function S0(e,t){return e&&e.length?as(e,Z(t,2)):0}return l.after=V_,l.ary=fl,l.assign=Ev,l.assignIn=Il,l.assignInWith=oa,l.assignWith=Lv,l.at=Nv,l.before=dl,l.bind=Vs,l.bindAll=Fy,l.bindKey=hl,l.castArray=nv,l.chain=ul,l.chunk=fm,l.compact=dm,l.concat=hm,l.cond=Wy,l.conforms=qy,l.constant=Js,l.countBy=w_,l.create=Mv,l.curry=pl,l.curryRight=gl,l.debounce=ml,l.defaults=Pv,l.defaultsDeep=Dv,l.defer=H_,l.delay=z_,l.difference=pm,l.differenceBy=gm,l.differenceWith=mm,l.drop=_m,l.dropRight=vm,l.dropRightWhile=ym,l.dropWhile=xm,l.fill=wm,l.filter=b_,l.flatMap=A_,l.flatMapDeep=T_,l.flatMapDepth=O_,l.flatten=il,l.flattenDeep=Sm,l.flattenDepth=bm,l.flip=$_,l.flow=Uy,l.flowRight=Gy,l.fromPairs=Cm,l.functions=Gv,l.functionsIn=Vv,l.groupBy=R_,l.initial=Am,l.intersection=Tm,l.intersectionBy=Om,l.intersectionWith=Rm,l.invert=zv,l.invertBy=$v,l.invokeMap=E_,l.iteratee=js,l.keyBy=L_,l.keys=Re,l.keysIn=Ge,l.map=ta,l.mapKeys=Kv,l.mapValues=Xv,l.matches=Vy,l.matchesProperty=Hy,l.memoize=ra,l.merge=Jv,l.mergeWith=Al,l.method=zy,l.methodOf=$y,l.mixin=Qs,l.negate=ia,l.nthArg=Ky,l.omit=jv,l.omitBy=Qv,l.once=Y_,l.orderBy=N_,l.over=Xy,l.overArgs=K_,l.overEvery=Jy,l.overSome=jy,l.partial=Hs,l.partialRight=_l,l.partition=M_,l.pick=ey,l.pickBy=Tl,l.property=Ml,l.propertyOf=Qy,l.pull=Nm,l.pullAll=sl,l.pullAllBy=Mm,l.pullAllWith=Pm,l.pullAt=Dm,l.range=e0,l.rangeRight=t0,l.rearg=X_,l.reject=B_,l.remove=Bm,l.rest=J_,l.reverse=Us,l.sampleSize=W_,l.set=ny,l.setWith=ry,l.shuffle=q_,l.slice=Fm,l.sortBy=G_,l.sortedUniq=Hm,l.sortedUniqBy=zm,l.split=Ay,l.spread=j_,l.tail=$m,l.take=Ym,l.takeRight=Km,l.takeRightWhile=Xm,l.takeWhile=Jm,l.tap=d_,l.throttle=Q_,l.thru=ea,l.toArray=Sl,l.toPairs=Ol,l.toPairsIn=Rl,l.toPath=s0,l.toPlainObject=Cl,l.transform=iy,l.unary=ev,l.union=jm,l.unionBy=Qm,l.unionWith=e_,l.uniq=t_,l.uniqBy=n_,l.uniqWith=r_,l.unset=ay,l.unzip=Gs,l.unzipWith=ol,l.update=sy,l.updateWith=oy,l.values=Qn,l.valuesIn=uy,l.without=i_,l.words=Ll,l.wrap=tv,l.xor=a_,l.xorBy=s_,l.xorWith=o_,l.zip=u_,l.zipObject=c_,l.zipObjectDeep=l_,l.zipWith=f_,l.entries=Ol,l.entriesIn=Rl,l.extend=Il,l.extendWith=oa,Qs(l,l),l.add=u0,l.attempt=Nl,l.camelCase=dy,l.capitalize=kl,l.ceil=c0,l.clamp=cy,l.clone=rv,l.cloneDeep=av,l.cloneDeepWith=sv,l.cloneWith=iv,l.conformsTo=ov,l.deburr=El,l.defaultTo=Zy,l.divide=l0,l.endsWith=hy,l.eq=mt,l.escape=py,l.escapeRegExp=gy,l.every=S_,l.find=C_,l.findIndex=nl,l.findKey=Bv,l.findLast=I_,l.findLastIndex=rl,l.findLastKey=Fv,l.floor=f0,l.forEach=cl,l.forEachRight=ll,l.forIn=Wv,l.forInRight=qv,l.forOwn=Zv,l.forOwnRight=Uv,l.get=Ys,l.gt=uv,l.gte=cv,l.has=Hv,l.hasIn=Ks,l.head=al,l.identity=Ve,l.includes=k_,l.indexOf=Im,l.inRange=ly,l.invoke=Yv,l.isArguments=_n,l.isArray=Y,l.isArrayBuffer=lv,l.isArrayLike=Ue,l.isArrayLikeObject=be,l.isBoolean=fv,l.isBuffer=Qt,l.isDate=dv,l.isElement=hv,l.isEmpty=pv,l.isEqual=gv,l.isEqualWith=mv,l.isError=zs,l.isFinite=_v,l.isFunction=Dt,l.isInteger=vl,l.isLength=aa,l.isMap=yl,l.isMatch=vv,l.isMatchWith=yv,l.isNaN=xv,l.isNative=wv,l.isNil=bv,l.isNull=Sv,l.isNumber=xl,l.isObject=ve,l.isObjectLike=we,l.isPlainObject=Yr,l.isRegExp=$s,l.isSafeInteger=Cv,l.isSet=wl,l.isString=sa,l.isSymbol=Xe,l.isTypedArray=jn,l.isUndefined=Iv,l.isWeakMap=Av,l.isWeakSet=Tv,l.join=km,l.kebabCase=my,l.last=st,l.lastIndexOf=Em,l.lowerCase=_y,l.lowerFirst=vy,l.lt=Ov,l.lte=Rv,l.max=d0,l.maxBy=h0,l.mean=p0,l.meanBy=g0,l.min=m0,l.minBy=_0,l.stubArray=to,l.stubFalse=no,l.stubObject=n0,l.stubString=r0,l.stubTrue=i0,l.multiply=v0,l.nth=Lm,l.noConflict=Yy,l.noop=eo,l.now=na,l.pad=yy,l.padEnd=xy,l.padStart=wy,l.parseInt=Sy,l.random=fy,l.reduce=P_,l.reduceRight=D_,l.repeat=by,l.replace=Cy,l.result=ty,l.round=y0,l.runInContext=m,l.sample=F_,l.size=Z_,l.snakeCase=Iy,l.some=U_,l.sortedIndex=Wm,l.sortedIndexBy=qm,l.sortedIndexOf=Zm,l.sortedLastIndex=Um,l.sortedLastIndexBy=Gm,l.sortedLastIndexOf=Vm,l.startCase=Ty,l.startsWith=Oy,l.subtract=x0,l.sum=w0,l.sumBy=S0,l.template=Ry,l.times=a0,l.toFinite=Bt,l.toInteger=J,l.toLength=bl,l.toLower=ky,l.toNumber=ot,l.toSafeInteger=kv,l.toString=ue,l.toUpper=Ey,l.trim=Ly,l.trimEnd=Ny,l.trimStart=My,l.truncate=Py,l.unescape=Dy,l.uniqueId=o0,l.upperCase=By,l.upperFirst=Xs,l.each=cl,l.eachRight=ll,l.first=al,Qs(l,(function(){var e={};return St(l,function(t,n){ce.call(l.prototype,n)||(e[n]=t)}),e})(),{chain:!1}),l.VERSION=o,tt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),tt(["drop","take"],function(e,t){ie.prototype[e]=function(n){n=n===i?1:Te(J(n),0);var a=this.__filtered__&&!t?new ie(this):this.clone();return a.__filtered__?a.__takeCount__=Me(n,a.__takeCount__):a.__views__.push({size:Me(n,wt),type:e+(a.__dir__<0?"Right":"")}),a},ie.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),tt(["filter","map","takeWhile"],function(e,t){var n=t+1,a=n==iu||n==Nd;ie.prototype[e]=function(u){var d=this.clone();return d.__iteratees__.push({iteratee:Z(u,3),type:n}),d.__filtered__=d.__filtered__||a,d}}),tt(["head","last"],function(e,t){var n="take"+(t?"Right":"");ie.prototype[e]=function(){return this[n](1).value()[0]}}),tt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");ie.prototype[e]=function(){return this.__filtered__?new ie(this):this[n](1)}}),ie.prototype.compact=function(){return this.filter(Ve)},ie.prototype.find=function(e){return this.filter(e).head()},ie.prototype.findLast=function(e){return this.reverse().find(e)},ie.prototype.invokeMap=te(function(e,t){return typeof e=="function"?new ie(this):this.map(function(n){return Ur(n,e,t)})}),ie.prototype.reject=function(e){return this.filter(ia(Z(e)))},ie.prototype.slice=function(e,t){e=J(e);var n=this;return n.__filtered__&&(e>0||t<0)?new ie(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(t=J(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},ie.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ie.prototype.toArray=function(){return this.take(wt)},St(ie.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),u=l[a?"take"+(t=="last"?"Right":""):t],d=a||/^find/.test(t);u&&(l.prototype[t]=function(){var h=this.__wrapped__,g=a?[1]:arguments,v=h instanceof ie,b=g[0],C=v||Y(h),T=function(ne){var ae=u.apply(l,zt([ne],g));return a&&N?ae[0]:ae};C&&n&&typeof b=="function"&&b.length!=1&&(v=C=!1);var N=this.__chain__,W=!!this.__actions__.length,G=d&&!N,ee=v&&!W;if(!d&&C){h=ee?h:new ie(this);var V=e.apply(h,g);return V.__actions__.push({func:ea,args:[T],thisArg:i}),new rt(V,N)}return G&&ee?e.apply(this,g):(V=this.thru(T),G?a?V.value()[0]:V.value():V)})}),tt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ai[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",a=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var u=arguments;if(a&&!this.__chain__){var d=this.value();return t.apply(Y(d)?d:[],u)}return this[n](function(h){return t.apply(Y(h)?h:[],u)})}}),St(ie.prototype,function(e,t){var n=l[t];if(n){var a=n.name+"";ce.call($n,a)||($n[a]=[]),$n[a].push({name:t,func:n})}}),$n[$i(i,Ie).name]=[{name:"wrapper",func:i}],ie.prototype.clone=Dp,ie.prototype.reverse=Bp,ie.prototype.value=Fp,l.prototype.at=h_,l.prototype.chain=p_,l.prototype.commit=g_,l.prototype.next=m_,l.prototype.plant=v_,l.prototype.reverse=y_,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=x_,l.prototype.first=l.prototype.head,Pr&&(l.prototype[Pr]=__),l}),Vn=gp();cn?((cn.exports=Vn)._=Vn,ja._=Vn):Ee._=Vn}).call(hd)})(wr,wr.exports)),wr.exports}var Sr={},Ko;function gd(){if(Ko)return Sr;Ko=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.backtrace=void 0;function s(r,i,o){const c=[];let f=o?r:r.getParent();for(;f.getParent();)c.push([f.position.x,f.position.y]),f=f.getParent();return i&&c.push([f.position.x,f.position.y]),c.reverse()}return Sr.backtrace=s,Sr}var br={},Xo;function md(){if(Xo)return br;Xo=1,Object.defineProperty(br,"__esModule",{value:!0}),br.calculateHeuristic=void 0;function s(r,i,o,c){const f=Math.abs(o.x-i.x),p=Math.abs(o.y-i.y);switch(r){case"Manhatten":case"Manhattan":return(f+p)*c;case"Euclidean":return Math.sqrt(f*f+p*p)*c;case"Chebyshev":return Math.max(f,p)*c;case"Octile":return(f+p-.58*Math.min(f,p))*c}}return br.calculateHeuristic=s,br}var Cr={},Ir={},Jo;function _d(){if(Jo)return Ir;Jo=1,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.Node=void 0;class s{constructor(i){this.id=i.id,this.position=i.position,this.hValue=0,this.gValue=0,this.fValue=0,this.parentNode=void 0,this.isOnClosedList=!1,this.isOnOpenList=!1,this.isWalkable=i.walkable||!0}calculateFValue(){this.fValue=this.gValue+this.hValue}setGValue(i){this.gValue=i,this.calculateFValue()}setHValue(i){this.hValue=i,this.calculateFValue()}setFGHValuesToZero(){this.fValue=this.gValue=this.hValue=0}getFValue(){return this.fValue}getGValue(){return this.gValue}getHValue(){return this.hValue}getParent(){return this.parentNode}getIsOnClosedList(){return this.isOnClosedList}getIsOnOpenList(){return this.isOnOpenList}getIsWalkable(){return this.isWalkable}setParent(i){this.parentNode=i}setIsOnClosedList(i){this.isOnClosedList=i}setIsOnOpenList(i){this.isOnOpenList=i}setIsWalkable(i){this.isWalkable=i}}return Ir.Node=s,Ir}var jo;function Qo(){if(jo)return Cr;jo=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.Grid=void 0;const s=_d();class r{constructor(o){o.width&&o.height?(this.width=o.width,this.height=o.height,this.numberOfFields=this.width*this.height):o.matrix&&(this.width=o.matrix[0].length,this.height=o.matrix.length,this.numberOfFields=this.width*this.height),this.gridNodes=this.buildGridWithNodes(o.matrix||void 0,this.width,this.height,o.densityOfObstacles||0)}buildGridWithNodes(o,c,f,p){const _=[];let w=0;for(let y=0;y<f;y++){_[y]=[];for(let A=0;A<c;A++)_[y][A]=new s.Node({id:w,position:{x:A,y}}),w++}if(o===void 0){for(let y=0;y<f;y++)for(let A=0;A<c;A++)Math.floor(Math.random()*10)+1>10-p?_[y][A].setIsWalkable(!1):_[y][A].setIsWalkable(!0);return _}for(let y=0;y<f;y++)for(let A=0;A<c;A++)_[y][A].setIsWalkable(!o[y][A]);return _}getNodeAt(o){return this.gridNodes[o.y][o.x]}isWalkableAt(o){return this.gridNodes[o.y][o.x].getIsWalkable()}isOnTheGrid(o){return o.x>=0&&o.x<this.width&&o.y>=0&&o.y<this.height}getSurroundingNodes(o,c){const f=[],p=o.x-1,_=o.x+1,w=o.y-1,y=o.y+1;for(let A=w;A<=y;A++)for(let D=p;D<=_;D++)(D!==o.x||A!==o.y)&&this.isOnTheGrid({x:D,y:A})&&this.isWalkableAt({x:D,y:A})&&(c||D==o.x||A==o.y)&&f.push(this.getNodeAt({x:D,y:A}));return f}setGrid(o){this.gridNodes=o}resetGrid(){for(let o=0;o<this.gridNodes.length;o++)for(let c=0;c<this.gridNodes[o].length;c++)this.gridNodes[o][c].setIsOnClosedList(!1),this.gridNodes[o][c].setIsOnOpenList(!1),this.gridNodes[o][c].setParent(void 0),this.gridNodes[o][c].setFGHValuesToZero()}getGridNodes(){return this.gridNodes}clone(){const o=[];let c=0;for(let f=0;f<this.height;f++){o[f]=[];for(let p=0;p<this.width;p++)o[f][p]=new s.Node({id:c,position:{x:p,y:f},walkable:this.gridNodes[f][p].getIsWalkable()}),c++}return o}}return Cr.Grid=r,Cr}var eu;function vd(){if(eu)return xr;eu=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.AStarFinder=void 0;const s=pd(),r=gd(),i=md(),o=Qo();class c{constructor(p){this.grid=new o.Grid({width:p.grid.width,height:p.grid.height,matrix:p.grid.matrix||void 0,densityOfObstacles:p.grid.densityOfObstacles||0}),this.closedList=[],this.openList=[],this.diagonalAllowed=p.diagonalAllowed!==void 0?p.diagonalAllowed:!0,this.heuristic=p.heuristic?p.heuristic:"Manhattan",this.includeStartNode=p.includeStartNode!==void 0?p.includeStartNode:!0,this.includeEndNode=p.includeEndNode!==void 0?p.includeEndNode:!0,this.allowPathAsCloseAsPossible=p.allowPathAsCloseAsPossible||!1,this.weight=p.weight||1}findPath(p,_){this.closedList=[],this.openList=[],this.grid.resetGrid();const w=this.grid.getNodeAt(p),y=this.grid.getNodeAt(_);if(!this.grid.isWalkableAt(_)||!this.grid.isWalkableAt(p))return[];w.setIsOnOpenList(!0),this.openList.push(w);for(let A=0;A<this.grid.height;A++)for(let D=0;D<this.grid.width;D++){let re=this.grid.getNodeAt({x:D,y:A});this.grid.isWalkableAt({x:D,y:A})?re.setHValue((0,i.calculateHeuristic)(this.heuristic,re.position,y.position,this.weight)):(re.setFGHValuesToZero(),re.setIsOnClosedList(!0),this.closedList.push(re))}for(;this.openList.length!==0;){const A=(0,s.minBy)(this.openList,re=>re.getFValue());if(A.setIsOnOpenList(!1),(0,s.remove)(this.openList,A),A.setIsOnClosedList(!0),this.closedList.push(A),A===y)return(0,r.backtrace)(y,this.includeStartNode,this.includeEndNode);const D=this.grid.getSurroundingNodes(A.position,this.diagonalAllowed);for(let re in D){const X=D[re];if(X.getIsOnClosedList())continue;const Q=A.getGValue()+(X.position.x!==A.position.x||X.position.y==A.position.y?this.weight:this.weight*1.41421);(!X.getIsOnOpenList()||Q<X.getGValue())&&(X.setGValue(Q),X.setParent(A),X.getIsOnOpenList()?X.setParent(A):(X.setIsOnOpenList(!0),this.openList.push(X)))}}return this.allowPathAsCloseAsPossible?(0,r.backtrace)(this.closedList[this.closedList.length-1],this.includeStartNode,!1):[]}setHeuristic(p){this.heuristic=p}setWeight(p){this.weight=p}getGridClone(){return this.grid.clone()}getGrid(){return this.grid}}return xr.AStarFinder=c,xr}var tu;function yd(){return tu||(tu=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.Grid=s.AStarFinder=void 0;var r=vd();Object.defineProperty(s,"AStarFinder",{enumerable:!0,get:function(){return r.AStarFinder}});var i=Qo();Object.defineProperty(s,"Grid",{enumerable:!0,get:function(){return i.Grid}})})(Pa)),Pa}var xd=yd();const wd=s=>s.map(r=>r.map(i=>i)).reverse(),nu=(s,r)=>s.x>=r[0].length||s.y>=r.length||s.x<0||s.y<0;function Sd(s,r,i,o){const c=re=>({x:Math.floor(re.x/o),y:Math.floor(re.y/o)}),f=re=>({x:(re[0]+.5)*o,y:(re[1]+.5)*o}),p=wd(i),_=c(s),w=c(r);if(nu(_,p))return[];if(nu(w,p))return[];const A=new xd.AStarFinder({grid:{matrix:p}}).findPath(_,w);return A.length===0?[]:A.map(f)}const bd=s=>({...s,storyBoards:s.storyBoards??[],schemaVersion:3}),Cd=s=>ru(bd(s)),Id=(s,r)=>{const i=s.imageId?{x:"center",y:"center",width:s.imageWidth?s.imageWidth/16:20,height:s.imageWidth?s.imageWidth/16:20,image:{imageId:s.imageId}}:void 0;return{id:r??s.id,isEndOfGame:!0,pages:[{title:s.message,narrative:{text:[]},color:"#FFFFFF",backgroundColor:"#000000",pictures:i?[i]:[]}]}},Ad=(s,r)=>{const i=r.filter(c=>c.startsWith(s)),o=(c=1)=>{const f=`${s}_${c}`;return i.includes(f)?o(c+1):f};return o()},ru=s=>{const{storyBoards:r,interactions:i,sequences:o,conversations:c}=s,f=r.map(Q=>Q.id),p={},_=s.endings.map(Q=>{const ge=f.includes(Q.id)?Ad(Q.id,f):void 0;return ge&&f.push(ge),p[Q.id]=ge??Q.id,Id(Q,ge)}),w=Q=>Q.type!=="ending"?Q:{type:"storyBoardConsequence",storyBoardId:p[Q.endingId]??Q.endingId,narrative:Q.narrative},y=Q=>({...Q,stages:Q.stages.map(ge=>({...ge,immediateConsequences:ge.immediateConsequences?.map(w)}))}),A=Q=>{const{branches:ge}=Q;for(let Oe in ge){const Ie=ge[Oe];Ie&&(Ie.choices=Ie.choices.map(Gt=>({...Gt,choiceSequence:Gt.choiceSequence?y(Gt.choiceSequence):void 0})))}return{...Q,branches:ge}},D=i.map(Q=>({...Q,consequences:Q.consequences.map(w)})),re=o.map(y),X=c.map(A);return{...s,storyBoards:[...r,..._],interactions:D,sequences:re,conversations:X,schemaVersion:di}},Td=s=>{const r=Po.safeParse(s);if(r.success)return{success:!0,gameDesign:r.data,sourceVersion:di,updated:!1};const i=Do.safeParse(s);if(i.success)return{success:!0,gameDesign:ru(i.data),sourceVersion:3,updated:!0};const o=Lo.safeParse(s);return o.success?{success:!0,gameDesign:Cd(o.data),sourceVersion:2,updated:!0}:{success:!1,failureMessage:o.error.message}};return k.ActOrderSchema=xo,k.ActorDataSchema=li,k.AmbientNoiseConsequenceSchema=Mn,k.AspectRatioSchema=mo,k.BackgroundMusicConsequenceSchema=Nn,k.BoardFontSchema=Eo,k.BoardProgressionSchema=ko,k.ChangePlayerCharacterConsequenceSchema=Bn,k.ChangeRoomConsequenceSchema=In,k.ChangeStatusConsequenceSchema=On,k.CommandSchema=id,k.CommandTargetSchema=Bo,k.ConsequenceSchema=wo,k.ConversationBranchSchema=bo,k.ConversationChoiceConsequenceSchema=kn,k.ConversationChoiceSchema=va,k.ConversationConsequenceSchema=Rn,k.ConversationSchema=ya,k.ConversationSchemaWithDeprecatedConsequences=ba,k.DB_VERSION=di,k.DirectionEnum=Cn,k.EndingConsequenceSchema=wa,k.EndingSchema=xa,k.FixedGameInfoSchema=Ea,k.FlagConsequenceSchema=Pn,k.FlagMapSchema=Ia,k.FlagSchema=Io,k.GameContentsDataSchema=hi,k.GameDataItemTypeEnum=td,k.GameDataSchema=ed,k.GameDesignSchema=Po,k.GameHappeningsSchema=Mo,k.GotoOrderSchema=vo,k.HotspotZoneSchema=Ta,k.IdentSchema=ri,k.ImmediateConsequenceSchema=ma,k.ImmediateConsequenceSchemaWithDeprecated=Co,k.InteractionSchema=ui,k.InteractionSchemaWithDeprecatedConsequences=Sa,k.InventoryConsequenceSchema=An,k.ItemDataSchema=_r,k.MoveOrderSchema=_o,k.NarrativeSchema=ye,k.OrderConsequenceSchema=si,k.PositionSchema=go,k.RemoveActorConsequenceSchema=Tn,k.RoomDataSchema=Oa,k.SayOrderSchema=yo,k.SequenceConsequenceSchema=oi,k.SequenceSchema=mr,k.SequenceSchemaWithDeprecatedConsequences=ci,k.SoundEffectConsequenceSchema=Ln,k.SoundValueSchema=Ca,k.SpriteDataSchema=Ra,k.SpriteFrameSchema=vr,k.SpriteParamsSchema=po,k.StageSchema=_a,k.StaticFrameParamsSchema=pr,k.StoryBoardConsequenceSchema=Dn,k.StoryBoardPageSchema=Ro,k.StoryBoardSchema=ka,k.TeleportActorConsequenceSchema=En,k.ToggleZoneConsequenceSchema=sn,k.VerbSchema=fi,k.ZoneSchema=Aa,k.cellMatrixSchema=No,k.changeHistory=Dl,k.consequenceMap=Zf,k.consequenceTypes=qf,k.directions=Mf,k.findPath=Sd,k.generateCellMatrix=dd,k.immediateConsequenceTypes=Uf,k.orderBaseOmits=Pf,k.orderSchema=gr,k.orderTypes=Ff,k.parseAndUpgrade=Td,k.soundInstanceSchema=ii,k.v2GameDesignSchema=Lo,k.v3GameDesignSchema=Do,k.xPlacement=To,k.yPlacement=Oo,k.zoneTypes=Wf,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),k})({});
|