mirror of
https://github.com/SwingTheVine/Wplace-BlueMarble.git
synced 2026-05-10 19:40:33 +00:00
1 line
No EOL
55 KiB
JavaScript
1 line
No EOL
55 KiB
JavaScript
(()=>{var e=Object.defineProperty,t=(t,s,n)=>((t,s,n)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n)(t,"symbol"!=typeof s?s+"":s,n);function s(e,t){const s=document.createElement(e);return t&&Object.entries(t).forEach(([e,t])=>{"className"===e?s.setAttribute("class",t):s.setAttribute(e,t)}),s}new Blob;var n,i=null;function r(){const e=function(){console.log("test"),n&&i||window.charity.lib.sonner.toast.error("You must select a pixel first"),console.log("test"),console.log("lnglat: ",n),console.log(n.t,n.i,i);const e=window.charity.game.mercator.latLonToTileAndPixel(n.t,n.i,i);return console.log("test"),[...e.o,...e.u]}();console.log(e);const t=document.querySelector("#bm-create-template #coords-container");if(!t)return;if(e.length<4)return;let s=0;t.childNodes.forEach(t=>{"INPUT"==t.nodeName.toLocaleUpperCase()&&4!=s&&(t.value=e[s].toString(),s++)})}var a,o,u,c={};((t,s)=>{for(var n in s)e(t,n,{get:s[n],enumerable:!0})})(c,{h:()=>Ve,l:()=>Z,m:()=>b,p:()=>_,NEVER:()=>Pt,OK:()=>$,v:()=>A,k:()=>O,ZodAny:()=>pe,ZodArray:()=>ge,ZodBigInt:()=>ue,ZodBoolean:()=>ce,ZodBranded:()=>Re,ZodCatch:()=>Le,ZodDate:()=>de,ZodDefault:()=>Ue,ZodDiscriminatedUnion:()=>Ne,ZodEffects:()=>Pe,ZodEnum:()=>De,N:()=>p,A:()=>Je,ZodFunction:()=>Te,ZodIntersection:()=>_e,_:()=>l,ZodLazy:()=>Fe,ZodLiteral:()=>Se,ZodMap:()=>Ie,ZodNaN:()=>ze,ZodNativeEnum:()=>Be,ZodNever:()=>ve,ZodNull:()=>me,ZodNullable:()=>Ce,ZodNumber:()=>oe,ZodObject:()=>be,ZodOptional:()=>je,Z:()=>d,ZodPipeline:()=>We,ZodPromise:()=>Oe,ZodReadonly:()=>qe,ZodRecord:()=>$e,$:()=>O,ZodSet:()=>Ee,ZodString:()=>re,ZodSymbol:()=>he,I:()=>Pe,ZodTuple:()=>Ze,T:()=>O,ZodUndefined:()=>le,ZodUnion:()=>xe,ZodUnknown:()=>fe,ZodVoid:()=>ye,F:()=>x,any:()=>ut,S:()=>lt,M:()=>st,D:()=>nt,B:()=>Ot,O:()=>He,P:()=>it,j:()=>te,C:()=>f,U:()=>vt,effect:()=>It,L:()=>_t,V:()=>kt,R:()=>g,W:()=>h,q:()=>Qe,intersection:()=>yt,K:()=>I,H:()=>F,J:()=>E,Y:()=>T,G:()=>Ge,X:()=>Nt,ee:()=>At,te:()=>w,map:()=>bt,se:()=>tt,ne:()=>Zt,ie:()=>dt,null:()=>ot,re:()=>Tt,number:()=>et,object:()=>mt,ae:()=>u,oe:()=>Bt,ue:()=>Dt,ce:()=>Et,de:()=>Mt,he:()=>St,le:()=>Ft,promise:()=>$t,me:()=>m,pe:()=>wt,set:()=>xt,fe:()=>y,ve:()=>pt,string:()=>Xe,ye:()=>rt,ge:()=>It,we:()=>gt,undefined:()=>at,union:()=>ft,be:()=>ct,xe:()=>a,ke:()=>ht}),(o=a||(a={})).Ne=e=>{},o.Ae=function(e){},o._e=function(e){throw new Error},o.Ze=e=>{const t={};for(const s of e)t[s]=s;return t},o.$e=e=>{const t=o.Ie(e).filter(t=>"number"!=typeof e[e[t]]),s={};for(const n of t)s[n]=e[n];return o.Ee(s)},o.Ee=e=>o.Ie(e).map(function(t){return e[t]}),o.Ie="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.push(s);return t},o.find=(e,t)=>{for(const s of e)if(t(s))return s},o.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,o.Te=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},o.Fe=(e,t)=>"bigint"==typeof t?t.toString():t,(u||(u={})).Se=(e,t)=>({...e,...t});var d=a.Ze(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),h=e=>{switch(typeof e){case"undefined":return d.undefined;case"string":return d.string;case"number":return Number.isNaN(e)?d.se:d.number;case"boolean":return d.D;case"function":return d.V;case"bigint":return d.M;case"symbol":return d.ye;case"object":return Array.isArray(e)?d.S:null===e?d.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?d.promise:"undefined"!=typeof Map&&e instanceof Map?d.map:"undefined"!=typeof Set&&e instanceof Set?d.set:"undefined"!=typeof Date&&e instanceof Date?d.P:d.object;default:return d.be}},l=a.Ze(["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"]),m=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),p=class e extends Error{get Me(){return this.De}constructor(e){super(),this.De=[],this.Be=e=>{this.De=[...this.De,e]},this.Oe=(e=[])=>{this.De=[...this.De,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.De=e}format(e){const t=e||function(e){return e.message},s={Pe:[]},n=e=>{for(const i of e.De)if("invalid_union"===i.code)i.je.map(n);else if("invalid_return_type"===i.code)n(i.Ce);else if("invalid_arguments"===i.code)n(i.Ue);else if(0===i.path.length)s.Pe.push(t(i));else{let e=s,n=0;for(;n<i.path.length;){const s=i.path[n];n===i.path.length-1?(e[s]=e[s]||{Pe:[]},e[s].Pe.push(t(i))):e[s]=e[s]||{Pe:[]},e=e[s],n++}}};return n(this),s}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.De,a.Fe,2)}get Le(){return 0===this.De.length}ze(e=e=>e.message){const t={},s=[];for(const n of this.De)if(n.path.length>0){const s=n.path[0];t[s]=t[s]||[],t[s].push(e(n))}else s.push(e(n));return{Ve:s,Re:t}}get Ve(){return this.ze()}};p.create=e=>new p(e);var f=(e,t)=>{let s;switch(e.code){case l.We:s=e.qe===d.undefined?"Required":`Expected ${e.Ke}, received ${e.qe}`;break;case l.He:s=`Invalid literal value, expected ${JSON.stringify(e.Ke,a.Fe)}`;break;case l.Je:s=`Unrecognized key(s) in object: ${a.Te(e.keys,", ")}`;break;case l.Ye:s="Invalid input";break;case l.Ge:s=`Invalid discriminator value. Expected ${a.Te(e.options)}`;break;case l.Qe:s=`Invalid enum value. Expected ${a.Te(e.options)}, received '${e.qe}'`;break;case l.Xe:s="Invalid function arguments";break;case l.et:s="Invalid function return type";break;case l.tt:s="Invalid date";break;case l.st:"object"==typeof e.nt?"includes"in e.nt?(s=`Invalid input: must include "${e.nt.includes}"`,"number"==typeof e.nt.position&&(s=`${s} at one or more positions greater than or equal to ${e.nt.position}`)):"startsWith"in e.nt?s=`Invalid input: must start with "${e.nt.startsWith}"`:"endsWith"in e.nt?s=`Invalid input: must end with "${e.nt.endsWith}"`:a._e(e.nt):s="regex"!==e.nt?`Invalid ${e.nt}`:"Invalid";break;case l.it:s="array"===e.type?`Array must contain ${e.rt?"exactly":e.ot?"at least":"more than"} ${e.ut} element(s)`:"string"===e.type?`String must contain ${e.rt?"exactly":e.ot?"at least":"over"} ${e.ut} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.rt?"exactly equal to ":e.ot?"greater than or equal to ":"greater than "}${e.ut}`:"date"===e.type?`Date must be ${e.rt?"exactly equal to ":e.ot?"greater than or equal to ":"greater than "}${new Date(Number(e.ut))}`:"Invalid input";break;case l.ct:s="array"===e.type?`Array must contain ${e.rt?"exactly":e.ot?"at most":"less than"} ${e.dt} element(s)`:"string"===e.type?`String must contain ${e.rt?"exactly":e.ot?"at most":"under"} ${e.dt} character(s)`:"number"===e.type?`Number must be ${e.rt?"exactly":e.ot?"less than or equal to":"less than"} ${e.dt}`:"bigint"===e.type?`BigInt must be ${e.rt?"exactly":e.ot?"less than or equal to":"less than"} ${e.dt}`:"date"===e.type?`Date must be ${e.rt?"exactly":e.ot?"smaller than or equal to":"smaller than"} ${new Date(Number(e.dt))}`:"Invalid input";break;case l.O:s="Invalid input";break;case l.ht:s="Intersection results could not be merged";break;case l.lt:s=`Number must be a multiple of ${e.ft}`;break;case l.vt:s="Number must be finite";break;default:s=t.yt,a._e(e)}return{message:s}},v=f;function y(e){v=e}function g(){return v}var w=e=>{const{data:t,path:s,gt:n,wt:i}=e,r=[...s,...i.path||[]],a={...i,path:r};if(void 0!==i.message)return{...i,path:r,message:i.message};let o="";const u=n.filter(e=>!!e).slice().reverse();for(const e of u)o=e(a,{data:t,yt:o}).message;return{...i,path:r,message:o}},b=[];function x(e,t){const s=g(),n=w({wt:t,data:e.data,path:e.path,gt:[e.xt.bt,e.kt,s,s===f?void 0:f].filter(e=>!!e)});e.xt.De.push(n)}var k,N,A=class e{constructor(){this.value="valid"}Nt(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static At(e,t){const s=[];for(const n of t){if("aborted"===n.status)return _;"dirty"===n.status&&e.Nt(),s.push(n.value)}return{status:e.value,value:s}}static async _t(t,s){const n=[];for(const e of s){const t=await e.key,s=await e.value;n.push({key:t,value:s})}return e.Zt(t,n)}static Zt(e,t){const s={};for(const n of t){const{key:t,value:i}=n;if("aborted"===t.status)return _;if("aborted"===i.status)return _;"dirty"===t.status&&e.Nt(),"dirty"===i.status&&e.Nt(),"__proto__"===t.value||void 0===i.value&&!n.$t||(s[t.value]=i.value)}return{status:e.value,value:s}}},_=Object.freeze({status:"aborted"}),Z=e=>({status:"dirty",value:e}),$=e=>({status:"valid",value:e}),I=e=>"aborted"===e.status,E=e=>"dirty"===e.status,T=e=>"valid"===e.status,F=e=>"undefined"!=typeof Promise&&e instanceof Promise;(N=k||(k={})).It=e=>"string"==typeof e?{message:e}:e||{},N.toString=e=>"string"==typeof e?e:e?.message;var S=class{constructor(e,t,s,n){this.Et=[],this.parent=e,this.data=t,this.Tt=s,this.Ft=n}get path(){return this.Et.length||(Array.isArray(this.Ft)?this.Et.push(...this.Tt,...this.Ft):this.Et.push(...this.Tt,this.Ft)),this.Et}},M=(e,t)=>{if(T(t))return{St:!0,data:t.value};if(!e.xt.De.length)throw new Error("Validation failed but no issues detected.");return{St:!1,get error(){if(this.Mt)return this.Mt;const t=new p(e.xt.De);return this.Mt=t,this.Mt}}};function D(e){if(!e)return{};const{Dt:t,Bt:s,Ot:n,description:i}=e;if(t&&(s||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{Dt:t,description:i}:{Dt:(t,i)=>{const{message:r}=e;return"invalid_enum_value"===t.code?{message:r??i.yt}:void 0===i.data?{message:r??n??i.yt}:"invalid_type"!==t.code?{message:i.yt}:{message:r??s??i.yt}},description:i}}var B,O=class{get description(){return this.Pt.description}jt(e){return h(e.data)}Ct(e,t){return t||{xt:e.parent.xt,data:e.data,Ut:h(e.data),kt:this.Pt.Dt,path:e.path,parent:e.parent}}Lt(e){return{status:new A,zt:{xt:e.parent.xt,data:e.data,Ut:h(e.data),kt:this.Pt.Dt,path:e.path,parent:e.parent}}}Vt(e){const t=this.Rt(e);if(F(t))throw new Error("Synchronous parse encountered promise.");return t}Wt(e){const t=this.Rt(e);return Promise.resolve(t)}parse(e,t){const s=this.qt(e,t);if(s.St)return s.data;throw s.error}qt(e,t){const s={xt:{De:[],async:t?.async??!1,bt:t?.Dt},path:t?.path||[],kt:this.Pt.Dt,parent:null,data:e,Ut:h(e)},n=this.Vt({data:e,path:s.path,parent:s});return M(s,n)}"~validate"(e){const t={xt:{De:[],async:!!this["~standard"].async},path:[],kt:this.Pt.Dt,parent:null,data:e,Ut:h(e)};if(!this["~standard"].async)try{const s=this.Vt({data:e,path:[],parent:t});return T(s)?{value:s.value}:{De:t.xt.De}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.xt={De:[],async:!0}}return this.Wt({data:e,path:[],parent:t}).then(e=>T(e)?{value:e.value}:{De:t.xt.De})}async Kt(e,t){const s=await this.Ht(e,t);if(s.St)return s.data;throw s.error}async Ht(e,t){const s={xt:{De:[],bt:t?.Dt,async:!0},path:t?.path||[],kt:this.Pt.Dt,parent:null,data:e,Ut:h(e)},n=this.Rt({data:e,path:s.path,parent:s}),i=await(F(n)?n:Promise.resolve(n));return M(s,i)}Jt(e,t){const s=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this.Yt((t,n)=>{const i=e(t),r=()=>n.Be({code:l.O,...s(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(e=>!!e||(r(),!1)):!!i||(r(),!1)})}Gt(e,t){return this.Yt((s,n)=>!!e(s)||(n.Be("function"==typeof t?t(s,n):t),!1))}Yt(e){return new Pe({Qt:this,Xt:Je.ZodEffects,effect:{type:"refinement",Gt:e}})}es(e){return this.Yt(e)}constructor(e){this.ts=this.Ht,this.Pt=e,this.parse=this.parse.bind(this),this.qt=this.qt.bind(this),this.Kt=this.Kt.bind(this),this.Ht=this.Ht.bind(this),this.ts=this.ts.bind(this),this.Jt=this.Jt.bind(this),this.Gt=this.Gt.bind(this),this.es=this.es.bind(this),this.ce=this.ce.bind(this),this.re=this.re.bind(this),this.ss=this.ss.bind(this),this.S=this.S.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.ns=this.ns.bind(this),this.rs=this.rs.bind(this),this.us=this.us.bind(this),this.cs=this.cs.bind(this),this.ds=this.ds.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}ce(){return je.create(this,this.Pt)}re(){return Ce.create(this,this.Pt)}ss(){return this.re().ce()}S(){return ge.create(this)}promise(){return Oe.create(this,this.Pt)}or(e){return xe.create([this,e],this.Pt)}and(e){return _e.create(this,e,this.Pt)}transform(e){return new Pe({...D(this.Pt),Qt:this,Xt:Je.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ue({...D(this.Pt),hs:this,defaultValue:t,Xt:Je.ZodDefault})}brand(){return new Re({Xt:Je.ZodBranded,type:this,...D(this.Pt)})}catch(e){const t="function"==typeof e?e:()=>e;return new Le({...D(this.Pt),hs:this,ls:t,Xt:Je.ZodCatch})}ns(e){return new(0,this.constructor)({...this.Pt,description:e})}rs(e){return We.create(this,e)}us(){return qe.create(this)}ds(){return this.qt(void 0).St}cs(){return this.qt(null).St}},P=/^c[^\s-]{8,}$/i,j=/^[0-9a-z]+$/,C=/^[0-9A-HJKMNP-TV-Z]{26}$/i,U=/^[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,L=/^[a-z0-9_-]{21}$/i,z=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,V=/^[-+]?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)?)??$/,R=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,W=/^(?:(?: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])$/,q=/^(?:(?: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])$/,K=/^(([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]))$/,H=/^(([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])$/,J=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Y=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,G="((\\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])))",Q=new RegExp(`^${G}$`);function X(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function ee(e){return new RegExp(`^${X(e)}$`)}function te(e){let t=`${G}T${X(e)}`;const s=[];return s.push(e.ps?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function se(e,t){return!("v4"!==t&&t||!W.test(e))||!("v6"!==t&&t||!K.test(e))}function ne(e,t){if(!z.test(e))return!1;try{const[s]=e.split(".");if(!s)return!1;const n=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),i=JSON.parse(atob(n));return!("object"!=typeof i||null===i||"fs"in i&&"JWT"!==i?.fs||!i.vs||t&&i.vs!==t)}catch{return!1}}function ie(e,t){return!("v4"!==t&&t||!q.test(e))||!("v6"!==t&&t||!H.test(e))}var re=class e extends O{Rt(e){if(this.Pt.B&&(e.data=String(e.data)),this.jt(e)!==d.string){const t=this.Ct(e);return x(t,{code:l.We,Ke:d.string,qe:t.Ut}),_}const t=new A;let s;for(const n of this.Pt.ys)if("min"===n.kind)e.data.length<n.value&&(s=this.Ct(e,s),x(s,{code:l.it,ut:n.value,type:"string",ot:!0,rt:!1,message:n.message}),t.Nt());else if("max"===n.kind)e.data.length>n.value&&(s=this.Ct(e,s),x(s,{code:l.ct,dt:n.value,type:"string",ot:!0,rt:!1,message:n.message}),t.Nt());else if("length"===n.kind){const i=e.data.length>n.value,r=e.data.length<n.value;(i||r)&&(s=this.Ct(e,s),i?x(s,{code:l.ct,dt:n.value,type:"string",ot:!0,rt:!0,message:n.message}):r&&x(s,{code:l.it,ut:n.value,type:"string",ot:!0,rt:!0,message:n.message}),t.Nt())}else if("email"===n.kind)R.test(e.data)||(s=this.Ct(e,s),x(s,{nt:"email",code:l.st,message:n.message}),t.Nt());else if("emoji"===n.kind)B||(B=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),B.test(e.data)||(s=this.Ct(e,s),x(s,{nt:"emoji",code:l.st,message:n.message}),t.Nt());else if("uuid"===n.kind)U.test(e.data)||(s=this.Ct(e,s),x(s,{nt:"uuid",code:l.st,message:n.message}),t.Nt());else if("nanoid"===n.kind)L.test(e.data)||(s=this.Ct(e,s),x(s,{nt:"nanoid",code:l.st,message:n.message}),t.Nt());else if("cuid"===n.kind)P.test(e.data)||(s=this.Ct(e,s),x(s,{nt:"cuid",code:l.st,message:n.message}),t.Nt());else if("cuid2"===n.kind)j.test(e.data)||(s=this.Ct(e,s),x(s,{nt:"cuid2",code:l.st,message:n.message}),t.Nt());else if("ulid"===n.kind)C.test(e.data)||(s=this.Ct(e,s),x(s,{nt:"ulid",code:l.st,message:n.message}),t.Nt());else if("url"===n.kind)try{new URL(e.data)}catch{s=this.Ct(e,s),x(s,{nt:"url",code:l.st,message:n.message}),t.Nt()}else"regex"===n.kind?(n.gs.lastIndex=0,n.gs.test(e.data)||(s=this.Ct(e,s),x(s,{nt:"regex",code:l.st,message:n.message}),t.Nt())):"trim"===n.kind?e.data=e.data.trim():"includes"===n.kind?e.data.includes(n.value,n.position)||(s=this.Ct(e,s),x(s,{code:l.st,nt:{includes:n.value,position:n.position},message:n.message}),t.Nt()):"toLowerCase"===n.kind?e.data=e.data.toLowerCase():"toUpperCase"===n.kind?e.data=e.data.toUpperCase():"startsWith"===n.kind?e.data.startsWith(n.value)||(s=this.Ct(e,s),x(s,{code:l.st,nt:{startsWith:n.value},message:n.message}),t.Nt()):"endsWith"===n.kind?e.data.endsWith(n.value)||(s=this.Ct(e,s),x(s,{code:l.st,nt:{endsWith:n.value},message:n.message}),t.Nt()):"datetime"===n.kind?te(n).test(e.data)||(s=this.Ct(e,s),x(s,{code:l.st,nt:"datetime",message:n.message}),t.Nt()):"date"===n.kind?Q.test(e.data)||(s=this.Ct(e,s),x(s,{code:l.st,nt:"date",message:n.message}),t.Nt()):"time"===n.kind?ee(n).test(e.data)||(s=this.Ct(e,s),x(s,{code:l.st,nt:"time",message:n.message}),t.Nt()):"duration"===n.kind?V.test(e.data)||(s=this.Ct(e,s),x(s,{nt:"duration",code:l.st,message:n.message}),t.Nt()):"ip"===n.kind?se(e.data,n.version)||(s=this.Ct(e,s),x(s,{nt:"ip",code:l.st,message:n.message}),t.Nt()):"jwt"===n.kind?ne(e.data,n.vs)||(s=this.Ct(e,s),x(s,{nt:"jwt",code:l.st,message:n.message}),t.Nt()):"cidr"===n.kind?ie(e.data,n.version)||(s=this.Ct(e,s),x(s,{nt:"cidr",code:l.st,message:n.message}),t.Nt()):"base64"===n.kind?J.test(e.data)||(s=this.Ct(e,s),x(s,{nt:"base64",code:l.st,message:n.message}),t.Nt()):"base64url"===n.kind?Y.test(e.data)||(s=this.Ct(e,s),x(s,{nt:"base64url",code:l.st,message:n.message}),t.Nt()):a._e(n);return{status:t.value,value:e.data}}ws(e,t,s){return this.Gt(t=>e.test(t),{nt:t,code:l.st,...k.It(s)})}bs(t){return new e({...this.Pt,ys:[...this.Pt.ys,t]})}email(e){return this.bs({kind:"email",...k.It(e)})}url(e){return this.bs({kind:"url",...k.It(e)})}xs(e){return this.bs({kind:"emoji",...k.It(e)})}uuid(e){return this.bs({kind:"uuid",...k.It(e)})}ks(e){return this.bs({kind:"nanoid",...k.It(e)})}Ns(e){return this.bs({kind:"cuid",...k.It(e)})}As(e){return this.bs({kind:"cuid2",...k.It(e)})}_s(e){return this.bs({kind:"ulid",...k.It(e)})}Zs(e){return this.bs({kind:"base64",...k.It(e)})}$s(e){return this.bs({kind:"base64url",...k.It(e)})}Is(e){return this.bs({kind:"jwt",...k.It(e)})}Es(e){return this.bs({kind:"ip",...k.It(e)})}Ts(e){return this.bs({kind:"cidr",...k.It(e)})}Fs(e){return"string"==typeof e?this.bs({kind:"datetime",precision:null,offset:!1,ps:!1,message:e}):this.bs({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,ps:e?.ps??!1,...k.It(e?.message)})}P(e){return this.bs({kind:"date",message:e})}time(e){return"string"==typeof e?this.bs({kind:"time",precision:null,message:e}):this.bs({kind:"time",precision:void 0===e?.precision?null:e?.precision,...k.It(e?.message)})}duration(e){return this.bs({kind:"duration",...k.It(e)})}gs(e,t){return this.bs({kind:"regex",gs:e,...k.It(t)})}includes(e,t){return this.bs({kind:"includes",value:e,position:t?.position,...k.It(t?.message)})}startsWith(e,t){return this.bs({kind:"startsWith",value:e,...k.It(t)})}endsWith(e,t){return this.bs({kind:"endsWith",value:e,...k.It(t)})}min(e,t){return this.bs({kind:"min",value:e,...k.It(t)})}max(e,t){return this.bs({kind:"max",value:e,...k.It(t)})}length(e,t){return this.bs({kind:"length",value:e,...k.It(t)})}Ss(e){return this.min(1,k.It(e))}trim(){return new e({...this.Pt,ys:[...this.Pt.ys,{kind:"trim"}]})}toLowerCase(){return new e({...this.Pt,ys:[...this.Pt.ys,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this.Pt,ys:[...this.Pt.ys,{kind:"toUpperCase"}]})}get Ms(){return!!this.Pt.ys.find(e=>"datetime"===e.kind)}get Ds(){return!!this.Pt.ys.find(e=>"date"===e.kind)}get Bs(){return!!this.Pt.ys.find(e=>"time"===e.kind)}get Os(){return!!this.Pt.ys.find(e=>"duration"===e.kind)}get Ps(){return!!this.Pt.ys.find(e=>"email"===e.kind)}get js(){return!!this.Pt.ys.find(e=>"url"===e.kind)}get Cs(){return!!this.Pt.ys.find(e=>"emoji"===e.kind)}get Us(){return!!this.Pt.ys.find(e=>"uuid"===e.kind)}get Ls(){return!!this.Pt.ys.find(e=>"nanoid"===e.kind)}get zs(){return!!this.Pt.ys.find(e=>"cuid"===e.kind)}get Vs(){return!!this.Pt.ys.find(e=>"cuid2"===e.kind)}get Rs(){return!!this.Pt.ys.find(e=>"ulid"===e.kind)}get Ws(){return!!this.Pt.ys.find(e=>"ip"===e.kind)}get qs(){return!!this.Pt.ys.find(e=>"cidr"===e.kind)}get Ks(){return!!this.Pt.ys.find(e=>"base64"===e.kind)}get Hs(){return!!this.Pt.ys.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this.Pt.ys)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this.Pt.ys)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}};function ae(e,t){const s=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=s>n?s:n;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}re.create=e=>new re({ys:[],Xt:Je.ZodString,B:e?.B??!1,...D(e)});var oe=class e extends O{constructor(){super(...arguments),this.min=this.Js,this.max=this.Ys,this.step=this.ft}Rt(e){if(this.Pt.B&&(e.data=Number(e.data)),this.jt(e)!==d.number){const t=this.Ct(e);return x(t,{code:l.We,Ke:d.number,qe:t.Ut}),_}let t;const s=new A;for(const n of this.Pt.ys)"int"===n.kind?a.isInteger(e.data)||(t=this.Ct(e,t),x(t,{code:l.We,Ke:"integer",qe:"float",message:n.message}),s.Nt()):"min"===n.kind?(n.ot?e.data<n.value:e.data<=n.value)&&(t=this.Ct(e,t),x(t,{code:l.it,ut:n.value,type:"number",ot:n.ot,rt:!1,message:n.message}),s.Nt()):"max"===n.kind?(n.ot?e.data>n.value:e.data>=n.value)&&(t=this.Ct(e,t),x(t,{code:l.ct,dt:n.value,type:"number",ot:n.ot,rt:!1,message:n.message}),s.Nt()):"multipleOf"===n.kind?0!==ae(e.data,n.value)&&(t=this.Ct(e,t),x(t,{code:l.lt,ft:n.value,message:n.message}),s.Nt()):"finite"===n.kind?Number.isFinite(e.data)||(t=this.Ct(e,t),x(t,{code:l.vt,message:n.message}),s.Nt()):a._e(n);return{status:s.value,value:e.data}}Js(e,t){return this.Gs("min",e,!0,k.toString(t))}Qs(e,t){return this.Gs("min",e,!1,k.toString(t))}Ys(e,t){return this.Gs("max",e,!0,k.toString(t))}Xs(e,t){return this.Gs("max",e,!1,k.toString(t))}Gs(t,s,n,i){return new e({...this.Pt,ys:[...this.Pt.ys,{kind:t,value:s,ot:n,message:k.toString(i)}]})}bs(t){return new e({...this.Pt,ys:[...this.Pt.ys,t]})}en(e){return this.bs({kind:"int",message:k.toString(e)})}tn(e){return this.bs({kind:"min",value:0,ot:!1,message:k.toString(e)})}negative(e){return this.bs({kind:"max",value:0,ot:!1,message:k.toString(e)})}sn(e){return this.bs({kind:"max",value:0,ot:!0,message:k.toString(e)})}nn(e){return this.bs({kind:"min",value:0,ot:!0,message:k.toString(e)})}ft(e,t){return this.bs({kind:"multipleOf",value:e,message:k.toString(t)})}rn(e){return this.bs({kind:"finite",message:k.toString(e)})}an(e){return this.bs({kind:"min",ot:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(e)}).bs({kind:"max",ot:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(e)})}get minValue(){let e=null;for(const t of this.Pt.ys)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this.Pt.ys)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get un(){return!!this.Pt.ys.find(e=>"int"===e.kind||"multipleOf"===e.kind&&a.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this.Pt.ys){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===t||s.value>t)&&(t=s.value):"max"===s.kind&&(null===e||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}};oe.create=e=>new oe({ys:[],Xt:Je.ZodNumber,B:e?.B||!1,...D(e)});var ue=class e extends O{constructor(){super(...arguments),this.min=this.Js,this.max=this.Ys}Rt(e){if(this.Pt.B)try{e.data=BigInt(e.data)}catch{return this.cn(e)}if(this.jt(e)!==d.M)return this.cn(e);let t;const s=new A;for(const n of this.Pt.ys)"min"===n.kind?(n.ot?e.data<n.value:e.data<=n.value)&&(t=this.Ct(e,t),x(t,{code:l.it,type:"bigint",ut:n.value,ot:n.ot,message:n.message}),s.Nt()):"max"===n.kind?(n.ot?e.data>n.value:e.data>=n.value)&&(t=this.Ct(e,t),x(t,{code:l.ct,type:"bigint",dt:n.value,ot:n.ot,message:n.message}),s.Nt()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this.Ct(e,t),x(t,{code:l.lt,ft:n.value,message:n.message}),s.Nt()):a._e(n);return{status:s.value,value:e.data}}cn(e){const t=this.Ct(e);return x(t,{code:l.We,Ke:d.M,qe:t.Ut}),_}Js(e,t){return this.Gs("min",e,!0,k.toString(t))}Qs(e,t){return this.Gs("min",e,!1,k.toString(t))}Ys(e,t){return this.Gs("max",e,!0,k.toString(t))}Xs(e,t){return this.Gs("max",e,!1,k.toString(t))}Gs(t,s,n,i){return new e({...this.Pt,ys:[...this.Pt.ys,{kind:t,value:s,ot:n,message:k.toString(i)}]})}bs(t){return new e({...this.Pt,ys:[...this.Pt.ys,t]})}tn(e){return this.bs({kind:"min",value:BigInt(0),ot:!1,message:k.toString(e)})}negative(e){return this.bs({kind:"max",value:BigInt(0),ot:!1,message:k.toString(e)})}sn(e){return this.bs({kind:"max",value:BigInt(0),ot:!0,message:k.toString(e)})}nn(e){return this.bs({kind:"min",value:BigInt(0),ot:!0,message:k.toString(e)})}ft(e,t){return this.bs({kind:"multipleOf",value:e,message:k.toString(t)})}get minValue(){let e=null;for(const t of this.Pt.ys)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this.Pt.ys)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}};ue.create=e=>new ue({ys:[],Xt:Je.ZodBigInt,B:e?.B??!1,...D(e)});var ce=class extends O{Rt(e){if(this.Pt.B&&(e.data=Boolean(e.data)),this.jt(e)!==d.D){const t=this.Ct(e);return x(t,{code:l.We,Ke:d.D,qe:t.Ut}),_}return $(e.data)}};ce.create=e=>new ce({Xt:Je.ZodBoolean,B:e?.B||!1,...D(e)});var de=class e extends O{Rt(e){if(this.Pt.B&&(e.data=new Date(e.data)),this.jt(e)!==d.P){const t=this.Ct(e);return x(t,{code:l.We,Ke:d.P,qe:t.Ut}),_}if(Number.isNaN(e.data.getTime()))return x(this.Ct(e),{code:l.tt}),_;const t=new A;let s;for(const n of this.Pt.ys)"min"===n.kind?e.data.getTime()<n.value&&(s=this.Ct(e,s),x(s,{code:l.it,message:n.message,ot:!0,rt:!1,ut:n.value,type:"date"}),t.Nt()):"max"===n.kind?e.data.getTime()>n.value&&(s=this.Ct(e,s),x(s,{code:l.ct,message:n.message,ot:!0,rt:!1,dt:n.value,type:"date"}),t.Nt()):a._e(n);return{status:t.value,value:new Date(e.data.getTime())}}bs(t){return new e({...this.Pt,ys:[...this.Pt.ys,t]})}min(e,t){return this.bs({kind:"min",value:e.getTime(),message:k.toString(t)})}max(e,t){return this.bs({kind:"max",value:e.getTime(),message:k.toString(t)})}get dn(){let e=null;for(const t of this.Pt.ys)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get hn(){let e=null;for(const t of this.Pt.ys)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}};de.create=e=>new de({ys:[],B:e?.B||!1,Xt:Je.ZodDate,...D(e)});var he=class extends O{Rt(e){if(this.jt(e)!==d.ye){const t=this.Ct(e);return x(t,{code:l.We,Ke:d.ye,qe:t.Ut}),_}return $(e.data)}};he.create=e=>new he({Xt:Je.ZodSymbol,...D(e)});var le=class extends O{Rt(e){if(this.jt(e)!==d.undefined){const t=this.Ct(e);return x(t,{code:l.We,Ke:d.undefined,qe:t.Ut}),_}return $(e.data)}};le.create=e=>new le({Xt:Je.ZodUndefined,...D(e)});var me=class extends O{Rt(e){if(this.jt(e)!==d.null){const t=this.Ct(e);return x(t,{code:l.We,Ke:d.null,qe:t.Ut}),_}return $(e.data)}};me.create=e=>new me({Xt:Je.ZodNull,...D(e)});var pe=class extends O{constructor(){super(...arguments),this.ln=!0}Rt(e){return $(e.data)}};pe.create=e=>new pe({Xt:Je.ZodAny,...D(e)});var fe=class extends O{constructor(){super(...arguments),this.mn=!0}Rt(e){return $(e.data)}};fe.create=e=>new fe({Xt:Je.ZodUnknown,...D(e)});var ve=class extends O{Rt(e){const t=this.Ct(e);return x(t,{code:l.We,Ke:d.ie,qe:t.Ut}),_}};ve.create=e=>new ve({Xt:Je.ZodNever,...D(e)});var ye=class extends O{Rt(e){if(this.jt(e)!==d.undefined){const t=this.Ct(e);return x(t,{code:l.We,Ke:d.ke,qe:t.Ut}),_}return $(e.data)}};ye.create=e=>new ye({Xt:Je.ZodVoid,...D(e)});var ge=class e extends O{Rt(e){const{zt:t,status:s}=this.Lt(e),n=this.Pt;if(t.Ut!==d.S)return x(t,{code:l.We,Ke:d.S,qe:t.Ut}),_;if(null!==n.pn){const e=t.data.length>n.pn.value,i=t.data.length<n.pn.value;(e||i)&&(x(t,{code:e?l.ct:l.it,ut:i?n.pn.value:void 0,dt:e?n.pn.value:void 0,type:"array",ot:!0,rt:!0,message:n.pn.message}),s.Nt())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(x(t,{code:l.it,ut:n.minLength.value,type:"array",ot:!0,rt:!1,message:n.minLength.message}),s.Nt()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(x(t,{code:l.ct,dt:n.maxLength.value,type:"array",ot:!0,rt:!1,message:n.maxLength.message}),s.Nt()),t.xt.async)return Promise.all([...t.data].map((e,s)=>n.type.Wt(new S(t,e,t.path,s)))).then(e=>A.At(s,e));const i=[...t.data].map((e,s)=>n.type.Vt(new S(t,e,t.path,s)));return A.At(s,i)}get element(){return this.Pt.type}min(t,s){return new e({...this.Pt,minLength:{value:t,message:k.toString(s)}})}max(t,s){return new e({...this.Pt,maxLength:{value:t,message:k.toString(s)}})}length(t,s){return new e({...this.Pt,pn:{value:t,message:k.toString(s)}})}Ss(e){return this.min(1,e)}};function we(e){if(e instanceof be){const t={};for(const s in e.shape){const n=e.shape[s];t[s]=je.create(we(n))}return new be({...e.Pt,shape:()=>t})}return e instanceof ge?new ge({...e.Pt,type:we(e.element)}):e instanceof je?je.create(we(e.fn())):e instanceof Ce?Ce.create(we(e.fn())):e instanceof Ze?Ze.create(e.items.map(e=>we(e))):e}ge.create=(e,t)=>new ge({type:e,minLength:null,maxLength:null,pn:null,Xt:Je.ZodArray,...D(t)});var be=class e extends O{constructor(){super(...arguments),this.vn=null,this.yn=this.gn,this.wn=this.extend}bn(){if(null!==this.vn)return this.vn;const e=this.Pt.shape(),t=a.Ie(e);return this.vn={shape:e,keys:t},this.vn}Rt(e){if(this.jt(e)!==d.object){const t=this.Ct(e);return x(t,{code:l.We,Ke:d.object,qe:t.Ut}),_}const{status:t,zt:s}=this.Lt(e),{shape:n,keys:i}=this.bn(),r=[];if(!(this.Pt.xn instanceof ve&&"strip"===this.Pt.kn))for(const e in s.data)i.includes(e)||r.push(e);const a=[];for(const e of i){const t=n[e],i=s.data[e];a.push({key:{status:"valid",value:e},value:t.Rt(new S(s,i,s.path,e)),$t:e in s.data})}if(this.Pt.xn instanceof ve){const e=this.Pt.kn;if("passthrough"===e)for(const e of r)a.push({key:{status:"valid",value:e},value:{status:"valid",value:s.data[e]}});else if("strict"===e)r.length>0&&(x(s,{code:l.Je,keys:r}),t.Nt());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this.Pt.xn;for(const t of r){const n=s.data[t];a.push({key:{status:"valid",value:t},value:e.Rt(new S(s,n,s.path,t)),$t:t in s.data})}}return s.xt.async?Promise.resolve().then(async()=>{const e=[];for(const t of a){const s=await t.key,n=await t.value;e.push({key:s,value:n,$t:t.$t})}return e}).then(e=>A.Zt(t,e)):A.Zt(t,a)}get shape(){return this.Pt.shape()}Nn(t){return k.It,new e({...this.Pt,kn:"strict",...void 0!==t?{Dt:(e,s)=>{const n=this.Pt.Dt?.(e,s).message??s.yt;return"unrecognized_keys"===e.code?{message:k.It(t).message??n}:{message:n}}}:{}})}An(){return new e({...this.Pt,kn:"strip"})}gn(){return new e({...this.Pt,kn:"passthrough"})}extend(t){return new e({...this.Pt,shape:()=>({...this.Pt.shape(),...t})})}_n(t){return new e({kn:t.Pt.kn,xn:t.Pt.xn,shape:()=>({...this.Pt.shape(),...t.Pt.shape()}),Xt:Je.ZodObject})}Zn(e,t){return this.wn({[e]:t})}xn(t){return new e({...this.Pt,xn:t})}$n(t){const s={};for(const e of a.Ie(t))t[e]&&this.shape[e]&&(s[e]=this.shape[e]);return new e({...this.Pt,shape:()=>s})}In(t){const s={};for(const e of a.Ie(this.shape))t[e]||(s[e]=this.shape[e]);return new e({...this.Pt,shape:()=>s})}En(){return we(this)}Tn(t){const s={};for(const e of a.Ie(this.shape)){const n=this.shape[e];t&&!t[e]?s[e]=n:s[e]=n.ce()}return new e({...this.Pt,shape:()=>s})}required(t){const s={};for(const e of a.Ie(this.shape))if(t&&!t[e])s[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof je;)t=t.Pt.hs;s[e]=t}return new e({...this.Pt,shape:()=>s})}Fn(){return Me(a.Ie(this.shape))}};be.create=(e,t)=>new be({shape:()=>e,kn:"strip",xn:ve.create(),Xt:Je.ZodObject,...D(t)}),be.Sn=(e,t)=>new be({shape:()=>e,kn:"strict",xn:ve.create(),Xt:Je.ZodObject,...D(t)}),be.Mn=(e,t)=>new be({shape:e,kn:"strip",xn:ve.create(),Xt:Je.ZodObject,...D(t)});var xe=class extends O{Rt(e){const{zt:t}=this.Lt(e),s=this.Pt.options;if(t.xt.async)return Promise.all(s.map(async e=>{const s={...t,xt:{...t.xt,De:[]},parent:null};return{result:await e.Wt({data:t.data,path:t.path,parent:s}),zt:s}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const s of e)if("dirty"===s.result.status)return t.xt.De.push(...s.zt.xt.De),s.result;const s=e.map(e=>new p(e.zt.xt.De));return x(t,{code:l.Ye,je:s}),_});{let e;const n=[];for(const i of s){const s={...t,xt:{...t.xt,De:[]},parent:null},r=i.Vt({data:t.data,path:t.path,parent:s});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,zt:s}),s.xt.De.length&&n.push(s.xt.De)}if(e)return t.xt.De.push(...e.zt.xt.De),e.result;const i=n.map(e=>new p(e));return x(t,{code:l.Ye,je:i}),_}}get options(){return this.Pt.options}};xe.create=(e,t)=>new xe({options:e,Xt:Je.ZodUnion,...D(t)});var ke=e=>e instanceof Fe?ke(e.Qt):e instanceof Pe?ke(e.hs()):e instanceof Se?[e.value]:e instanceof De?e.options:e instanceof Be?a.Ee(e.L):e instanceof Ue?ke(e.Pt.hs):e instanceof le?[void 0]:e instanceof me?[null]:e instanceof je?[void 0,...ke(e.fn())]:e instanceof Ce?[null,...ke(e.fn())]:e instanceof Re||e instanceof qe?ke(e.fn()):e instanceof Le?ke(e.Pt.hs):[],Ne=class e extends O{Rt(e){const{zt:t}=this.Lt(e);if(t.Ut!==d.object)return x(t,{code:l.We,Ke:d.object,qe:t.Ut}),_;const s=this.Dn,n=t.data[s],i=this.Bn.get(n);return i?t.xt.async?i.Wt({data:t.data,path:t.path,parent:t}):i.Vt({data:t.data,path:t.path,parent:t}):(x(t,{code:l.Ge,options:Array.from(this.Bn.keys()),path:[s]}),_)}get Dn(){return this.Pt.Dn}get options(){return this.Pt.options}get Bn(){return this.Pt.Bn}static create(t,s,n){const i=new Map;for(const e of s){const s=ke(e.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const n of s){if(i.has(n))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(n)}`);i.set(n,e)}}return new e({Xt:Je.ZodDiscriminatedUnion,Dn:t,options:s,Bn:i,...D(n)})}};function Ae(e,t){const s=h(e),n=h(t);if(e===t)return{valid:!0,data:e};if(s===d.object&&n===d.object){const s=a.Ie(t),n=a.Ie(e).filter(e=>-1!==s.indexOf(e)),i={...e,...t};for(const s of n){const n=Ae(e[s],t[s]);if(!n.valid)return{valid:!1};i[s]=n.data}return{valid:!0,data:i}}if(s===d.S&&n===d.S){if(e.length!==t.length)return{valid:!1};const s=[];for(let n=0;n<e.length;n++){const i=Ae(e[n],t[n]);if(!i.valid)return{valid:!1};s.push(i.data)}return{valid:!0,data:s}}return s===d.P&&n===d.P&&+e===+t?{valid:!0,data:e}:{valid:!1}}var _e=class extends O{Rt(e){const{status:t,zt:s}=this.Lt(e),n=(e,n)=>{if(I(e)||I(n))return _;const i=Ae(e.value,n.value);return i.valid?((E(e)||E(n))&&t.Nt(),{status:t.value,value:i.data}):(x(s,{code:l.ht}),_)};return s.xt.async?Promise.all([this.Pt.left.Wt({data:s.data,path:s.path,parent:s}),this.Pt.right.Wt({data:s.data,path:s.path,parent:s})]).then(([e,t])=>n(e,t)):n(this.Pt.left.Vt({data:s.data,path:s.path,parent:s}),this.Pt.right.Vt({data:s.data,path:s.path,parent:s}))}};_e.create=(e,t,s)=>new _e({left:e,right:t,Xt:Je.ZodIntersection,...D(s)});var Ze=class e extends O{Rt(e){const{status:t,zt:s}=this.Lt(e);if(s.Ut!==d.S)return x(s,{code:l.We,Ke:d.S,qe:s.Ut}),_;if(s.data.length<this.Pt.items.length)return x(s,{code:l.it,ut:this.Pt.items.length,ot:!0,rt:!1,type:"array"}),_;!this.Pt.On&&s.data.length>this.Pt.items.length&&(x(s,{code:l.ct,dt:this.Pt.items.length,ot:!0,rt:!1,type:"array"}),t.Nt());const n=[...s.data].map((e,t)=>{const n=this.Pt.items[t]||this.Pt.On;return n?n.Rt(new S(s,e,s.path,t)):null}).filter(e=>!!e);return s.xt.async?Promise.all(n).then(e=>A.At(t,e)):A.At(t,n)}get items(){return this.Pt.items}On(t){return new e({...this.Pt,On:t})}};Ze.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ze({items:e,Xt:Je.ZodTuple,On:null,...D(t)})};var $e=class e extends O{get Pn(){return this.Pt.jn}get Cn(){return this.Pt.valueType}Rt(e){const{status:t,zt:s}=this.Lt(e);if(s.Ut!==d.object)return x(s,{code:l.We,Ke:d.object,qe:s.Ut}),_;const n=[],i=this.Pt.jn,r=this.Pt.valueType;for(const e in s.data)n.push({key:i.Rt(new S(s,e,s.path,e)),value:r.Rt(new S(s,s.data[e],s.path,e)),$t:e in s.data});return s.xt.async?A._t(t,n):A.Zt(t,n)}get element(){return this.Pt.valueType}static create(t,s,n){return new e(s instanceof O?{jn:t,valueType:s,Xt:Je.ZodRecord,...D(n)}:{jn:re.create(),valueType:t,Xt:Je.ZodRecord,...D(s)})}},Ie=class extends O{get Pn(){return this.Pt.jn}get Cn(){return this.Pt.valueType}Rt(e){const{status:t,zt:s}=this.Lt(e);if(s.Ut!==d.map)return x(s,{code:l.We,Ke:d.map,qe:s.Ut}),_;const n=this.Pt.jn,i=this.Pt.valueType,r=[...s.data.entries()].map(([e,t],r)=>({key:n.Rt(new S(s,e,s.path,[r,"key"])),value:i.Rt(new S(s,t,s.path,[r,"value"]))}));if(s.xt.async){const e=new Map;return Promise.resolve().then(async()=>{for(const s of r){const n=await s.key,i=await s.value;if("aborted"===n.status||"aborted"===i.status)return _;"dirty"!==n.status&&"dirty"!==i.status||t.Nt(),e.set(n.value,i.value)}return{status:t.value,value:e}})}{const e=new Map;for(const s of r){const n=s.key,i=s.value;if("aborted"===n.status||"aborted"===i.status)return _;"dirty"!==n.status&&"dirty"!==i.status||t.Nt(),e.set(n.value,i.value)}return{status:t.value,value:e}}}};Ie.create=(e,t,s)=>new Ie({valueType:t,jn:e,Xt:Je.ZodMap,...D(s)});var Ee=class e extends O{Rt(e){const{status:t,zt:s}=this.Lt(e);if(s.Ut!==d.set)return x(s,{code:l.We,Ke:d.set,qe:s.Ut}),_;const n=this.Pt;null!==n.Un&&s.data.size<n.Un.value&&(x(s,{code:l.it,ut:n.Un.value,type:"set",ot:!0,rt:!1,message:n.Un.message}),t.Nt()),null!==n.Ln&&s.data.size>n.Ln.value&&(x(s,{code:l.ct,dt:n.Ln.value,type:"set",ot:!0,rt:!1,message:n.Ln.message}),t.Nt());const i=this.Pt.valueType;function r(e){const s=new Set;for(const n of e){if("aborted"===n.status)return _;"dirty"===n.status&&t.Nt(),s.add(n.value)}return{status:t.value,value:s}}const a=[...s.data.values()].map((e,t)=>i.Rt(new S(s,e,s.path,t)));return s.xt.async?Promise.all(a).then(e=>r(e)):r(a)}min(t,s){return new e({...this.Pt,Un:{value:t,message:k.toString(s)}})}max(t,s){return new e({...this.Pt,Ln:{value:t,message:k.toString(s)}})}size(e,t){return this.min(e,t).max(e,t)}Ss(e){return this.min(1,e)}};Ee.create=(e,t)=>new Ee({valueType:e,Un:null,Ln:null,Xt:Je.ZodSet,...D(t)});var Te=class e extends O{constructor(){super(...arguments),this.validate=this.zn}Rt(e){const{zt:t}=this.Lt(e);if(t.Ut!==d.V)return x(t,{code:l.We,Ke:d.V,qe:t.Ut}),_;function s(e,s){return w({data:e,path:t.path,gt:[t.xt.bt,t.kt,g(),f].filter(e=>!!e),wt:{code:l.Xe,Ue:s}})}function n(e,s){return w({data:e,path:t.path,gt:[t.xt.bt,t.kt,g(),f].filter(e=>!!e),wt:{code:l.et,Ce:s}})}const i={Dt:t.xt.bt},r=t.data;if(this.Pt.Vn instanceof Oe){const e=this;return $(async function(...t){const a=new p([]),o=await e.Pt.Rn.Kt(t,i).catch(e=>{throw a.Be(s(t,e)),a}),u=await Reflect.apply(r,this,o);return await e.Pt.Vn.Pt.type.Kt(u,i).catch(e=>{throw a.Be(n(u,e)),a})})}{const e=this;return $(function(...t){const a=e.Pt.Rn.qt(t,i);if(!a.St)throw new p([s(t,a.error)]);const o=Reflect.apply(r,this,a.data),u=e.Pt.Vn.qt(o,i);if(!u.St)throw new p([n(o,u.error)]);return u.data})}}parameters(){return this.Pt.Rn}Wn(){return this.Pt.Vn}Rn(...t){return new e({...this.Pt,Rn:Ze.create(t).On(fe.create())})}Vn(t){return new e({...this.Pt,Vn:t})}zn(e){return this.parse(e)}qn(e){return this.parse(e)}static create(t,s,n){return new e({Rn:t||Ze.create([]).On(fe.create()),Vn:s||fe.create(),Xt:Je.ZodFunction,...D(n)})}},Fe=class extends O{get Qt(){return this.Pt.Kn()}Rt(e){const{zt:t}=this.Lt(e);return this.Pt.Kn().Rt({data:t.data,path:t.path,parent:t})}};Fe.create=(e,t)=>new Fe({Kn:e,Xt:Je.ZodLazy,...D(t)});var Se=class extends O{Rt(e){if(e.data!==this.Pt.value){const t=this.Ct(e);return x(t,{qe:t.data,code:l.He,Ke:this.Pt.value}),_}return{status:"valid",value:e.data}}get value(){return this.Pt.value}};function Me(e,t){return new De({values:e,Xt:Je.ZodEnum,...D(t)})}Se.create=(e,t)=>new Se({value:e,Xt:Je.ZodLiteral,...D(t)});var De=class e extends O{Rt(e){if("string"!=typeof e.data){const t=this.Ct(e),s=this.Pt.values;return x(t,{Ke:a.Te(s),qe:t.Ut,code:l.We}),_}if(this.Hn||(this.Hn=new Set(this.Pt.values)),!this.Hn.has(e.data)){const t=this.Ct(e),s=this.Pt.values;return x(t,{qe:t.data,code:l.Qe,options:s}),_}return $(e.data)}get options(){return this.Pt.values}get L(){const e={};for(const t of this.Pt.values)e[t]=t;return e}get Jn(){const e={};for(const t of this.Pt.values)e[t]=t;return e}get Yn(){const e={};for(const t of this.Pt.values)e[t]=t;return e}Gn(t,s=this.Pt){return e.create(t,{...this.Pt,...s})}Qn(t,s=this.Pt){return e.create(this.options.filter(e=>!t.includes(e)),{...this.Pt,...s})}};De.create=Me;var Be=class extends O{Rt(e){const t=a.$e(this.Pt.values),s=this.Ct(e);if(s.Ut!==d.string&&s.Ut!==d.number){const e=a.Ee(t);return x(s,{Ke:a.Te(e),qe:s.Ut,code:l.We}),_}if(this.Hn||(this.Hn=new Set(a.$e(this.Pt.values))),!this.Hn.has(e.data)){const e=a.Ee(t);return x(s,{qe:s.data,code:l.Qe,options:e}),_}return $(e.data)}get L(){return this.Pt.values}};Be.create=(e,t)=>new Be({values:e,Xt:Je.ZodNativeEnum,...D(t)});var Oe=class extends O{fn(){return this.Pt.type}Rt(e){const{zt:t}=this.Lt(e);if(t.Ut!==d.promise&&!1===t.xt.async)return x(t,{code:l.We,Ke:d.promise,qe:t.Ut}),_;const s=t.Ut===d.promise?t.data:Promise.resolve(t.data);return $(s.then(e=>this.Pt.type.Kt(e,{path:t.path,Dt:t.xt.bt})))}};Oe.create=(e,t)=>new Oe({type:e,Xt:Je.ZodPromise,...D(t)});var Pe=class extends O{hs(){return this.Pt.Qt}Xn(){return this.Pt.Qt.Pt.Xt===Je.ZodEffects?this.Pt.Qt.Xn():this.Pt.Qt}Rt(e){const{status:t,zt:s}=this.Lt(e),n=this.Pt.effect||null,i={Be:e=>{x(s,e),e.fatal?t.abort():t.Nt()},get path(){return s.path}};if(i.Be=i.Be.bind(i),"preprocess"===n.type){const e=n.transform(s.data,i);if(s.xt.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return _;const n=await this.Pt.Qt.Wt({data:e,path:s.path,parent:s});return"aborted"===n.status?_:"dirty"===n.status||"dirty"===t.value?Z(n.value):n});{if("aborted"===t.value)return _;const n=this.Pt.Qt.Vt({data:e,path:s.path,parent:s});return"aborted"===n.status?_:"dirty"===n.status||"dirty"===t.value?Z(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.Gt(e,i);if(s.xt.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===s.xt.async){const n=this.Pt.Qt.Vt({data:s.data,path:s.path,parent:s});return"aborted"===n.status?_:("dirty"===n.status&&t.Nt(),e(n.value),{status:t.value,value:n.value})}return this.Pt.Qt.Wt({data:s.data,path:s.path,parent:s}).then(s=>"aborted"===s.status?_:("dirty"===s.status&&t.Nt(),e(s.value).then(()=>({status:t.value,value:s.value}))))}if("transform"===n.type){if(!1===s.xt.async){const e=this.Pt.Qt.Vt({data:s.data,path:s.path,parent:s});if(!T(e))return _;const r=n.transform(e.value,i);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this.Pt.Qt.Wt({data:s.data,path:s.path,parent:s}).then(e=>T(e)?Promise.resolve(n.transform(e.value,i)).then(e=>({status:t.value,value:e})):_)}a._e(n)}};Pe.create=(e,t,s)=>new Pe({Qt:e,Xt:Je.ZodEffects,effect:t,...D(s)}),Pe.ei=(e,t,s)=>new Pe({Qt:t,effect:{type:"preprocess",transform:e},Xt:Je.ZodEffects,...D(s)});var je=class extends O{Rt(e){return this.jt(e)===d.undefined?$(void 0):this.Pt.hs.Rt(e)}fn(){return this.Pt.hs}};je.create=(e,t)=>new je({hs:e,Xt:Je.ZodOptional,...D(t)});var Ce=class extends O{Rt(e){return this.jt(e)===d.null?$(null):this.Pt.hs.Rt(e)}fn(){return this.Pt.hs}};Ce.create=(e,t)=>new Ce({hs:e,Xt:Je.ZodNullable,...D(t)});var Ue=class extends O{Rt(e){const{zt:t}=this.Lt(e);let s=t.data;return t.Ut===d.undefined&&(s=this.Pt.defaultValue()),this.Pt.hs.Rt({data:s,path:t.path,parent:t})}ti(){return this.Pt.hs}};Ue.create=(e,t)=>new Ue({hs:e,Xt:Je.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...D(t)});var Le=class extends O{Rt(e){const{zt:t}=this.Lt(e),s={...t,xt:{...t.xt,De:[]}},n=this.Pt.hs.Rt({data:s.data,path:s.path,parent:{...s}});return F(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this.Pt.ls({get error(){return new p(s.xt.De)},input:s.data})})):{status:"valid",value:"valid"===n.status?n.value:this.Pt.ls({get error(){return new p(s.xt.De)},input:s.data})}}si(){return this.Pt.hs}};Le.create=(e,t)=>new Le({hs:e,Xt:Je.ZodCatch,ls:"function"==typeof t.catch?t.catch:()=>t.catch,...D(t)});var ze=class extends O{Rt(e){if(this.jt(e)!==d.se){const t=this.Ct(e);return x(t,{code:l.We,Ke:d.se,qe:t.Ut}),_}return{status:"valid",value:e.data}}};ze.create=e=>new ze({Xt:Je.ZodNaN,...D(e)});var Ve=Symbol("zod_brand"),Re=class extends O{Rt(e){const{zt:t}=this.Lt(e),s=t.data;return this.Pt.type.Rt({data:s,path:t.path,parent:t})}fn(){return this.Pt.type}},We=class e extends O{Rt(e){const{status:t,zt:s}=this.Lt(e);if(s.xt.async)return(async()=>{const e=await this.Pt.in.Wt({data:s.data,path:s.path,parent:s});return"aborted"===e.status?_:"dirty"===e.status?(t.Nt(),Z(e.value)):this.Pt.ni.Wt({data:e.value,path:s.path,parent:s})})();{const e=this.Pt.in.Vt({data:s.data,path:s.path,parent:s});return"aborted"===e.status?_:"dirty"===e.status?(t.Nt(),{status:"dirty",value:e.value}):this.Pt.ni.Vt({data:e.value,path:s.path,parent:s})}}static create(t,s){return new e({in:t,ni:s,Xt:Je.ZodPipeline})}},qe=class extends O{Rt(e){const t=this.Pt.hs.Rt(e),s=e=>(T(e)&&(e.value=Object.freeze(e.value)),e);return F(t)?t.then(e=>s(e)):s(t)}fn(){return this.Pt.hs}};function Ke(e,t){const s="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof s?{message:s}:s}function He(e,t={},s){return e?pe.create().es((n,i)=>{const r=e(n);if(r instanceof Promise)return r.then(e=>{if(!e){const e=Ke(t,n),r=e.fatal??s??!0;i.Be({code:"custom",...e,fatal:r})}});if(!r){const e=Ke(t,n),r=e.fatal??s??!0;i.Be({code:"custom",...e,fatal:r})}}):pe.create()}qe.create=(e,t)=>new qe({hs:e,Xt:Je.ZodReadonly,...D(t)});var Je,Ye,Ge={object:be.Mn};(Ye=Je||(Je={})).ZodString="ZodString",Ye.ZodNumber="ZodNumber",Ye.ZodNaN="ZodNaN",Ye.ZodBigInt="ZodBigInt",Ye.ZodBoolean="ZodBoolean",Ye.ZodDate="ZodDate",Ye.ZodSymbol="ZodSymbol",Ye.ZodUndefined="ZodUndefined",Ye.ZodNull="ZodNull",Ye.ZodAny="ZodAny",Ye.ZodUnknown="ZodUnknown",Ye.ZodNever="ZodNever",Ye.ZodVoid="ZodVoid",Ye.ZodArray="ZodArray",Ye.ZodObject="ZodObject",Ye.ZodUnion="ZodUnion",Ye.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Ye.ZodIntersection="ZodIntersection",Ye.ZodTuple="ZodTuple",Ye.ZodRecord="ZodRecord",Ye.ZodMap="ZodMap",Ye.ZodSet="ZodSet",Ye.ZodFunction="ZodFunction",Ye.ZodLazy="ZodLazy",Ye.ZodLiteral="ZodLiteral",Ye.ZodEnum="ZodEnum",Ye.ZodEffects="ZodEffects",Ye.ZodNativeEnum="ZodNativeEnum",Ye.ZodOptional="ZodOptional",Ye.ZodNullable="ZodNullable",Ye.ZodDefault="ZodDefault",Ye.ZodCatch="ZodCatch",Ye.ZodPromise="ZodPromise",Ye.ZodBranded="ZodBranded",Ye.ZodPipeline="ZodPipeline",Ye.ZodReadonly="ZodReadonly";var Qe=(e,t={message:`Input not instance of ${e.name}`})=>He(t=>t instanceof e,t),Xe=re.create,et=oe.create,tt=ze.create,st=ue.create,nt=ce.create,it=de.create,rt=he.create,at=le.create,ot=me.create,ut=pe.create,ct=fe.create,dt=ve.create,ht=ye.create,lt=ge.create,mt=be.create,pt=be.Sn,ft=xe.create,vt=Ne.create,yt=_e.create,gt=Ze.create,wt=$e.create,bt=Ie.create,xt=Ee.create,kt=Te.create,Nt=Fe.create,At=Se.create,_t=De.create,Zt=Be.create,$t=Oe.create,It=Pe.create,Et=je.create,Tt=Ce.create,Ft=Pe.ei,St=We.create,Mt=()=>Xe().ce(),Dt=()=>et().ce(),Bt=()=>nt().ce(),Ot={string:e=>re.create({...e,B:!0}),number:e=>oe.create({...e,B:!0}),D:e=>ce.create({...e,B:!0}),M:e=>ue.create({...e,B:!0}),P:e=>de.create({...e,B:!0})},Pt=_,jt=c,Ct=jt.object({ii:jt.object({ri:jt.string(),ai:jt.string().Jt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")),oi:jt.string().Jt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")).ce()}),ui:jt.object({name:jt.string(),ci:jt.string()}).ce(),di:jt.S(jt.object({name:jt.string().ce(),enabled:jt.D(),coords:jt.object({hi:jt.number(),li:jt.number(),px:jt.number(),mi:jt.number()}),sources:jt.S(jt.string()),pi:jt.number().ce(),animation:jt.object({fi:jt.number().ce(),yi:jt.number().ce(),frameCount:jt.number().ce(),gi:jt.number().ce(),wi:jt.number().ce(),bi:jt.number().ce(),xi:jt.number().ce(),startTime:jt.number().ce(),looping:jt.D().ce()}).ce(),uuid:jt.string()})),ki:jt.S(jt.object({name:jt.string().ce(),url:jt.string()})),Ni:jt.S(jt.object({name:jt.string().ce(),url:jt.string()}))}),Ut=jt.object({name:jt.string().ce(),coords:jt.S(jt.number()),Ai:jt.number().ce(),enabled:jt.D(),_i:jt.string().ce(),uuid:jt.string()}),Lt=jt.object({name:jt.string().ce(),url:jt.string(),Zi:jt.S(jt.object({Ai:jt.number().ce(),uuid:jt.string()})).ce()}),zt=jt.object({ri:jt.string(),oi:jt.string().Jt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")).ce(),ai:jt.string().Jt(e=>e.match("^0|([1-9]d*)([.](0|([1-9]d*))){2}$")),di:jt.S(Ut),links:jt.S(Lt).ce()}),Vt=document.querySelector("#bm-manage-templates table");Vt&&"TABLE"===Vt.nodeName.toLocaleUpperCase()&&(Vt=Vt.children[0])&&"BM"===qt.getType()&&qt.get().di.forEach((e,t)=>{const n=s("tr",{id:"main-row"}),i=s("td",{textContent:t.toString()}),r=s("td",{textContent:e.name||"unnamed-0"}),a=document.createElement("td"),o=s("button",{id:"enable"});a.appendChild(o);const u=document.createElement("td"),c=s("button",{id:"exportAdd"});u.appendChild(c);const d=document.createElement("td"),h=s("div",{className:"shifts-container"}),l=s("button",{id:"up"}),m=s("button",{id:"down"});h.append(l,m),d.appendChild(h),n.append(i,r,a,u,d)});var Rt={"bm-create-template":"flex","bm-main-overlay":"flex","bm-manage-links":"flex","bm-manage-templates":"flex"},Wt=document.createElement("style");Wt.textContent="",document.body.appendChild(Wt);var qt=new class{constructor(e){t(this,"object"),t(this,"type"),this.object=e,e&&(Ct.qt(e).St?this.type="CHA":zt.qt(e).St?this.type="BM":this.type="N/A")}update(e){if(zt.qt(e).St)this.type="BM";else{if(!Ct.qt(e).St)return;this.type="CHA"}this.object=e}get(){return this.object}getType(){return this.type}$i(){"N/A"!==this.type&&"CHA"!==this.type&&("BM"===this.type&&(this.object=this.object,this.object={ii:{ri:"Charity",ai:"0.1.0",oi:this.object.oi},di:this.object.di.map(e=>({name:e.name,enabled:e.enabled||!1,coords:{hi:e.coords[0],li:e.coords[1],px:e.coords[2],mi:e.coords[3]},sources:[e._i||""],pi:e.Ai,uuid:e.uuid})),ki:[],Ni:[]}),this.type="CHA")}Ii(){"N/A"!==this.type&&"BM"!==this.type&&("CHA"===this.type&&(this.object=this.object,this.object={ri:"BlueMarble",ai:"0.1.0",oi:this.object.ii.oi,di:this.object.di.map(e=>({name:e.name,coords:Object.values(e.coords),Ei:e.pi,enabled:e.enabled,_i:e.sources[0],uuid:e.uuid}))}),this.type="BM")}appendData(e){"BM"===this.type&&(this.object=this.object,Ct.parse(e)?this.object.di.push(...e.di.map(e=>({name:e.name,coords:Object.values(e.coords),Ei:e.pi,enabled:e.enabled,_i:e.sources[0],uuid:e.uuid}))):zt.parse(e)&&(this.object.di.push(...e.di),this.object.links?e.links&&this.object.links.push(...e.links):this.object.links=e.links))}Ti(e){"BM"===this.type&&this.object.di.push(e)}Fi(e){"BM"===this.type&&(this.object=this.object,this.object.links?this.object.links.push(e):this.object.links=[e])}Si(e,t){if("N/A"===this.type)return null;if(this.object.hasOwnProperty("links")){const s=this.object;return{...s,di:e?e.map(e=>!!(Number.isInteger(e)&&e>=0&&s.di.length<e)&&s.di[e]).filter(Boolean):s.di,links:t?t.map(e=>!!(Number.isInteger(e)&&e>=0&&s.links.length<e)&&s.links[e]).filter(Boolean):s.links}}const s=this.object;return{...s,di:e?e.map(e=>!!(Number.isInteger(e)&&e>=0&&s.di.length<e)&&s.di[e]).filter(Boolean):s.di}}}({ri:"BlueMarble",ai:"",di:[{coords:[0,1,2,3],enabled:!1,uuid:"BLAJSIAFBNIUBAWIFIOANWA"},{coords:[0,1,2,3],name:"Test",enabled:!1,Ai:54,uuid:"BLAJSIAFBNIUBAWIFIOANWA"}]}),Kt=(new class{constructor(){t(this,"updateFunctions",{"bm-create-template":void 0,"bm-main-overlay":void 0,"bm-manage-links":void 0,"bm-manage-templates":void 0})}close(e){const t=document.querySelector("#"+e);t&&(t.style.display="none")}open(e){const t=document.querySelector("#"+e);t&&(t.style.display=Rt[e],this.Mi[e]&&this.Mi[e]())}},new URLSearchParams(document.location.search));if(Kt.has("bmShare"))try{const e=JSON.parse(Kt.get("bmShare"));qt.appendData(e)}catch{}!function(){window.charity.game.map.on("click",e=>{console.log(e),n=e.Di,console.log(e.Di),i=window.charity.game.map.getZoom(),console.log("test"),r()});const e=document.querySelector("#bm-create-template button#coords");console.log("coordsBtn: testestsetestseesseetestest ",e),console.log(e?.nodeName),console.log("BUTTON"===e?.nodeName.toLocaleUpperCase()),e&&"BUTTON"===e.nodeName.toLocaleUpperCase()&&e.addEventListener("click",()=>{console.log("test"),r()})}()})(); |